import{bX as P,bY as C,bZ as tr,b_ as s,r as c,am as or}from"./index-Csef3-wA.js";var ir=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function R(e,r){var n=ar(e);if(typeof n.path!="string"){var t=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof r=="string"?r:typeof t=="string"&&t.length>0?t:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function ar(e){var r=e.name,n=r&&r.lastIndexOf(".")!==-1;if(n&&!e.type){var t=r.split(".").pop().toLowerCase(),i=ir.get(t);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var ur=[".DS_Store","Thumbs.db"];function lr(e){return P(this,void 0,void 0,function(){return C(this,function(r){return Y(e)&&sr(e)?[2,dr(e.dataTransfer,e.type)]:cr(e)?[2,fr(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,pr(e)]:[2,[]]})})}function sr(e){return Y(e.dataTransfer)}function cr(e){return Y(e)&&Y(e.target)}function Y(e){return typeof e=="object"&&e!==null}function fr(e){return ce(e.target.files).map(function(r){return R(r)})}function pr(e){return P(this,void 0,void 0,function(){var r;return C(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(t){return t.getFile()}))];case 1:return r=n.sent(),[2,r.map(function(t){return R(t)})]}})})}function dr(e,r){return P(this,void 0,void 0,function(){var n,t;return C(this,function(i){switch(i.label){case 0:return e===null?[2,[]]:e.items?(n=ce(e.items).filter(function(u){return u.kind==="file"}),r!=="drop"?[2,n]:[4,Promise.all(n.map(gr))]):[3,2];case 1:return t=i.sent(),[2,Te(We(t))];case 2:return[2,Te(ce(e.files).map(function(u){return R(u)}))]}})})}function Te(e){return e.filter(function(r){return ur.indexOf(r.name)===-1})}function ce(e){if(e===null)return[];for(var r=[],n=0;n<e.length;n++){var t=e[n];r.push(t)}return r}function gr(e){if(typeof e.webkitGetAsEntry!="function")return Se(e);var r=e.webkitGetAsEntry();return r&&r.isDirectory?Ne(r):Se(e)}function We(e){return e.reduce(function(r,n){return tr(r,Array.isArray(n)?We(n):[n])},[])}function Se(e){var r=e.getAsFile();if(!r)return Promise.reject(e+" is not a File");var n=R(r);return Promise.resolve(n)}function mr(e){return P(this,void 0,void 0,function(){return C(this,function(r){return[2,e.isDirectory?Ne(e):vr(e)]})})}function Ne(e){var r=e.createReader();return new Promise(function(n,t){var i=[];function u(){var f=this;r.readEntries(function(l){return P(f,void 0,void 0,function(){var m,F,w;return C(this,function(v){switch(v.label){case 0:if(l.length)return[3,5];v.label=1;case 1:return v.trys.push([1,3,,4]),[4,Promise.all(i)];case 2:return m=v.sent(),n(m),[3,4];case 3:return F=v.sent(),t(F),[3,4];case 4:return[3,6];case 5:w=Promise.all(l.map(mr)),i.push(w),u(),v.label=6;case 6:return[2]}})})},function(l){t(l)})}u()})}function vr(e){return P(this,void 0,void 0,function(){return C(this,function(r){return[2,new Promise(function(n,t){e.file(function(i){var u=R(i,e.fullPath);n(u)},function(i){t(i)})})]})})}var yr=function(e,r){if(e&&r){var n=Array.isArray(r)?r:r.split(","),t=e.name||"",i=(e.type||"").toLowerCase(),u=i.replace(/\/.*$/,"");return n.some(function(f){var l=f.trim().toLowerCase();return l.charAt(0)==="."?t.toLowerCase().endsWith(l):l.endsWith("/*")?u===l.replace(/\/.*$/,""):i===l})}return!0};function Ie(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,t)}return n}function ke(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Ie(Object(n),!0).forEach(function(t){Ye(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ie(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ye(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Re(e,r){return Or(e)||Dr(e,r)||hr(e,r)||br()}function br(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hr(e,r){if(e){if(typeof e=="string")return ze(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ze(e,r)}}function ze(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,t=new Array(r);n<r;n++)t[n]=e[n];return t}function Dr(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var t=[],i=!0,u=!1,f,l;try{for(n=n.call(e);!(i=(f=n.next()).done)&&(t.push(f.value),!(r&&t.length===r));i=!0);}catch(m){u=!0,l=m}finally{try{!i&&n.return!=null&&n.return()}finally{if(u)throw l}}return t}}function Or(e){if(Array.isArray(e))return e}var Fr="file-invalid-type",wr="file-too-large",Ar="file-too-small",Er="too-many-files",xr=function(r){r=Array.isArray(r)&&r.length===1?r[0]:r;var n=Array.isArray(r)?"one of ".concat(r.join(", ")):r;return{code:Fr,message:"File type must be ".concat(n)}},Le=function(r){return{code:wr,message:"File is larger than ".concat(r," ").concat(r===1?"byte":"bytes")}},Me=function(r){return{code:Ar,message:"File is smaller than ".concat(r," ").concat(r===1?"byte":"bytes")}},jr={code:Er,message:"Too many files"};function Ge(e,r){var n=e.type==="application/x-moz-file"||yr(e,r);return[n,n?null:xr(r)]}function Ue(e,r,n){if(k(e.size))if(k(r)&&k(n)){if(e.size>n)return[!1,Le(n)];if(e.size<r)return[!1,Me(r)]}else{if(k(r)&&e.size<r)return[!1,Me(r)];if(k(n)&&e.size>n)return[!1,Le(n)]}return[!0,null]}function k(e){return e!=null}function _r(e){var r=e.files,n=e.accept,t=e.minSize,i=e.maxSize,u=e.multiple,f=e.maxFiles;return!u&&r.length>1||u&&f>=1&&r.length>f?!1:r.every(function(l){var m=Ge(l,n),F=Re(m,1),w=F[0],v=Ue(l,t,i),T=Re(v,1),S=T[0];return w&&S})}function G(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function N(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(r){return r==="Files"||r==="application/x-moz-file"}):!!e.target&&!!e.target.files}function Ke(e){e.preventDefault()}function Pr(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Cr(e){return e.indexOf("Edge/")!==-1}function Tr(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Pr(e)||Cr(e)}function O(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return function(t){for(var i=arguments.length,u=new Array(i>1?i-1:0),f=1;f<i;f++)u[f-1]=arguments[f];return r.some(function(l){return!G(t)&&l&&l.apply(void 0,[t].concat(u)),G(t)})}}function $e(){return"showOpenFilePicker"in window}function Sr(e){return e=typeof e=="string"?e.split(","):e,[{description:"everything",accept:Array.isArray(e)?e.filter(function(r){return r==="audio/*"||r==="video/*"||r==="image/*"||r==="text/*"||/\w+\/[-+.\w]+/g.test(r)}).reduce(function(r,n){return ke(ke({},r),{},Ye({},n,[]))},{}):{}}]}var Ir=["children"],kr=["open"],Rr=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],zr=["refKey","onChange","onClick"];function Lr(e){return $r(e)||Kr(e)||qe(e)||Mr()}function Mr(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kr(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function $r(e){if(Array.isArray(e))return fe(e)}function se(e,r){return Wr(e)||Br(e,r)||qe(e,r)||Hr()}function Hr(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qe(e,r){if(e){if(typeof e=="string")return fe(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fe(e,r)}}function fe(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,t=new Array(r);n<r;n++)t[n]=e[n];return t}function Br(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var t=[],i=!0,u=!1,f,l;try{for(n=n.call(e);!(i=(f=n.next()).done)&&(t.push(f.value),!(r&&t.length===r));i=!0);}catch(m){u=!0,l=m}finally{try{!i&&n.return!=null&&n.return()}finally{if(u)throw l}}return t}}function Wr(e){if(Array.isArray(e))return e}function He(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,t)}return n}function p(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?He(Object(n),!0).forEach(function(t){pe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):He(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function pe(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function U(e,r){if(e==null)return{};var n=Nr(e,r),t,i;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(i=0;i<u.length;i++)t=u[i],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(n[t]=e[t])}return n}function Nr(e,r){if(e==null)return{};var n={},t=Object.keys(e),i,u;for(u=0;u<t.length;u++)i=t[u],!(r.indexOf(i)>=0)&&(n[i]=e[i]);return n}var ge=c.forwardRef(function(e,r){var n=e.children,t=U(e,Ir),i=Yr(t),u=i.open,f=U(i,kr);return c.useImperativeHandle(r,function(){return{open:u}},[u]),or.createElement(c.Fragment,null,n(p(p({},f),{},{open:u})))});ge.displayName="Dropzone";var Je={disabled:!1,getFilesFromEvent:lr,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1};ge.defaultProps=Je;ge.propTypes={children:s.func,accept:s.oneOfType([s.string,s.arrayOf(s.string)]),multiple:s.bool,preventDropOnDocument:s.bool,noClick:s.bool,noKeyboard:s.bool,noDrag:s.bool,noDragEventsBubbling:s.bool,minSize:s.number,maxSize:s.number,maxFiles:s.number,disabled:s.bool,getFilesFromEvent:s.func,onFileDialogCancel:s.func,onFileDialogOpen:s.func,useFsAccessApi:s.bool,onDragEnter:s.func,onDragLeave:s.func,onDragOver:s.func,onDrop:s.func,onDropAccepted:s.func,onDropRejected:s.func,validator:s.func};var de={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function Yr(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=p(p({},Je),e),n=r.accept,t=r.disabled,i=r.getFilesFromEvent,u=r.maxSize,f=r.minSize,l=r.multiple,m=r.maxFiles,F=r.onDragEnter,w=r.onDragLeave,v=r.onDragOver,T=r.onDrop,S=r.onDropAccepted,q=r.onDropRejected,J=r.onFileDialogCancel,V=r.onFileDialogOpen,z=r.useFsAccessApi,X=r.preventDropOnDocument,me=r.noClick,Z=r.noKeyboard,ve=r.noDrag,A=r.noDragEventsBubbling,Q=r.validator,ee=c.useMemo(function(){return typeof V=="function"?V:Be},[V]),L=c.useMemo(function(){return typeof J=="function"?J:Be},[J]),y=c.useRef(null),h=c.useRef(null),Ve=c.useReducer(Gr,de),ye=se(Ve,2),M=ye[0],b=ye[1],Xe=M.isFocused,be=M.isFileDialogActive,he=M.draggedFiles,De=function(){be&&setTimeout(function(){if(h.current){var a=h.current.files;a.length||(b({type:"closeDialog"}),L())}},300)};c.useEffect(function(){return z&&$e()?function(){}:(window.addEventListener("focus",De,!1),function(){window.removeEventListener("focus",De,!1)})},[h,be,L,z]);var E=c.useRef([]),Oe=function(a){y.current&&y.current.contains(a.target)||(a.preventDefault(),E.current=[])};c.useEffect(function(){return X&&(document.addEventListener("dragover",Ke,!1),document.addEventListener("drop",Oe,!1)),function(){X&&(document.removeEventListener("dragover",Ke),document.removeEventListener("drop",Oe))}},[y,X]);var Fe=c.useCallback(function(o){o.preventDefault(),o.persist(),B(o),E.current=[].concat(Lr(E.current),[o.target]),N(o)&&Promise.resolve(i(o)).then(function(a){G(o)&&!A||(b({draggedFiles:a,isDragActive:!0,type:"setDraggedFiles"}),F&&F(o))})},[i,F,A]),we=c.useCallback(function(o){o.preventDefault(),o.persist(),B(o);var a=N(o);if(a&&o.dataTransfer)try{o.dataTransfer.dropEffect="copy"}catch{}return a&&v&&v(o),!1},[v,A]),Ae=c.useCallback(function(o){o.preventDefault(),o.persist(),B(o);var a=E.current.filter(function(g){return y.current&&y.current.contains(g)}),d=a.indexOf(o.target);d!==-1&&a.splice(d,1),E.current=a,!(a.length>0)&&(b({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),N(o)&&w&&w(o))},[y,w,A]),K=c.useCallback(function(o,a){var d=[],g=[];o.forEach(function(D){var I=Ge(D,n),_=se(I,2),ne=_[0],te=_[1],oe=Ue(D,f,u),W=se(oe,2),ie=W[0],ae=W[1],ue=Q?Q(D):null;if(ne&&ie&&!ue)d.push(D);else{var le=[te,ae];ue&&(le=le.concat(ue)),g.push({file:D,errors:le.filter(function(nr){return nr})})}}),(!l&&d.length>1||l&&m>=1&&d.length>m)&&(d.forEach(function(D){g.push({file:D,errors:[jr]})}),d.splice(0)),b({acceptedFiles:d,fileRejections:g,type:"setFiles"}),T&&T(d,g,a),g.length>0&&q&&q(g,a),d.length>0&&S&&S(d,a)},[b,l,n,f,u,m,T,S,q,Q]),$=c.useCallback(function(o){o.preventDefault(),o.persist(),B(o),E.current=[],N(o)&&Promise.resolve(i(o)).then(function(a){G(o)&&!A||K(a,o)}),b({type:"reset"})},[i,K,A]),x=c.useCallback(function(){if(z&&$e()){b({type:"openDialog"}),ee();var o={multiple:l,types:Sr(n)};window.showOpenFilePicker(o).then(function(a){return i(a)}).then(function(a){return K(a,null)}).catch(function(a){return L(a)}).finally(function(){return b({type:"closeDialog"})});return}h.current&&(b({type:"openDialog"}),ee(),h.current.value=null,h.current.click())},[b,ee,L,z,K,n,l]),Ee=c.useCallback(function(o){!y.current||!y.current.isEqualNode(o.target)||(o.keyCode===32||o.keyCode===13)&&(o.preventDefault(),x())},[y,h,x]),xe=c.useCallback(function(){b({type:"focus"})},[]),je=c.useCallback(function(){b({type:"blur"})},[]),_e=c.useCallback(function(){me||(Tr()?setTimeout(x,0):x())},[h,me,x]),j=function(a){return t?null:a},re=function(a){return Z?null:j(a)},H=function(a){return ve?null:j(a)},B=function(a){A&&a.stopPropagation()},Ze=c.useMemo(function(){return function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=o.refKey,d=a===void 0?"ref":a,g=o.role,D=o.onKeyDown,I=o.onFocus,_=o.onBlur,ne=o.onClick,te=o.onDragEnter,oe=o.onDragOver,W=o.onDragLeave,ie=o.onDrop,ae=U(o,Rr);return p(p(pe({onKeyDown:re(O(D,Ee)),onFocus:re(O(I,xe)),onBlur:re(O(_,je)),onClick:j(O(ne,_e)),onDragEnter:H(O(te,Fe)),onDragOver:H(O(oe,we)),onDragLeave:H(O(W,Ae)),onDrop:H(O(ie,$)),role:typeof g=="string"&&g!==""?g:"button"},d,y),!t&&!Z?{tabIndex:0}:{}),ae)}},[y,Ee,xe,je,_e,Fe,we,Ae,$,Z,ve,t]),Qe=c.useCallback(function(o){o.stopPropagation()},[]),er=c.useMemo(function(){return function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=o.refKey,d=a===void 0?"ref":a,g=o.onChange,D=o.onClick,I=U(o,zr),_=pe({accept:n,multiple:l,type:"file",style:{display:"none"},onChange:j(O(g,$)),onClick:j(O(D,Qe)),autoComplete:"off",tabIndex:-1},d,h);return p(p({},_),I)}},[h,n,l,$,t]),Pe=he.length,Ce=Pe>0&&_r({files:he,accept:n,minSize:f,maxSize:u,multiple:l,maxFiles:m}),rr=Pe>0&&!Ce;return p(p({},M),{},{isDragAccept:Ce,isDragReject:rr,isFocused:Xe&&!t,getRootProps:Ze,getInputProps:er,rootRef:y,inputRef:h,open:j(x)})}function Gr(e,r){switch(r.type){case"focus":return p(p({},e),{},{isFocused:!0});case"blur":return p(p({},e),{},{isFocused:!1});case"openDialog":return p(p({},de),{},{isFileDialogActive:!0});case"closeDialog":return p(p({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":var n=r.isDragActive,t=r.draggedFiles;return p(p({},e),{},{draggedFiles:t,isDragActive:n});case"setFiles":return p(p({},e),{},{acceptedFiles:r.acceptedFiles,fileRejections:r.fileRejections});case"reset":return p({},de);default:return e}}function Be(){}export{Yr as u};