@pod-os/elements 0.37.0-rc.c8b54d1.0 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/dist/cjs/{chunk.URTPIBTY-DdK9pL5v.js → chunk.URTPIBTY-DcQsb_nW.js} +2 -2
  2. package/dist/cjs/{chunk.XQ2OKYYA-DEkhm1i7.js → chunk.XQ2OKYYA-D224sdKt.js} +3 -3
  3. package/dist/cjs/{chunk.ZGGPD2XJ-uKZZdqOH.js → chunk.ZGGPD2XJ-Cj6xUx2M.js} +1 -1
  4. package/dist/cjs/{class-map-DAZXfKKA.js → class-map-Nx8L8ElN.js} +1 -1
  5. package/dist/cjs/elements.cjs.js +3 -3
  6. package/dist/cjs/{index-DCpu_nnH.js → index-Be_lnf0w.js} +547 -2001
  7. package/dist/cjs/{index-FUnpyb19.js → index-OR1wNkjG.js} +1052 -489
  8. package/dist/cjs/{jsonld-V2RB47OZ-BerQ9IRa.js → jsonld-V2RB47OZ-B82QNsYZ.js} +1 -1
  9. package/dist/cjs/loader.cjs.js +2 -2
  10. package/dist/cjs/pos-add-literal-value_3.cjs.entry.js +6 -6
  11. package/dist/cjs/{pos-add-new-thing_31.cjs.entry.js → pos-add-new-thing_32.cjs.entry.js} +411 -227
  12. package/dist/cjs/pos-app-document-viewer.cjs.entry.js +1 -1
  13. package/dist/cjs/pos-app-generic.cjs.entry.js +1 -1
  14. package/dist/cjs/pos-app-image-viewer.cjs.entry.js +1 -1
  15. package/dist/cjs/pos-app-ldp-container.cjs.entry.js +1 -1
  16. package/dist/cjs/pos-app-rdf-document.cjs.entry.js +1 -1
  17. package/dist/cjs/pos-attachments.cjs.entry.js +2 -2
  18. package/dist/cjs/pos-case.cjs.entry.js +24 -0
  19. package/dist/cjs/pos-container-contents.cjs.entry.js +13 -4
  20. package/dist/cjs/pos-container-item_3.cjs.entry.js +4 -4
  21. package/dist/cjs/pos-document.cjs.entry.js +4 -4
  22. package/dist/cjs/pos-list.cjs.entry.js +1 -1
  23. package/dist/cjs/pos-markdown-document.cjs.entry.js +442 -2327
  24. package/dist/cjs/pos-relations_2.cjs.entry.js +1 -1
  25. package/dist/cjs/pos-subjects.cjs.entry.js +2 -2
  26. package/dist/cjs/pos-switch.cjs.entry.js +64 -0
  27. package/dist/cjs/pos-tool-attachments.cjs.entry.js +2 -2
  28. package/dist/cjs/pos-value.cjs.entry.js +1 -1
  29. package/dist/collection/collection-manifest.json +5 -1
  30. package/dist/collection/components/pos-app/pos-app.js +2 -1
  31. package/dist/collection/components/pos-attachments/pos-attachments.js +2 -1
  32. package/dist/collection/components/pos-container-contents/pos-container-contents.js +10 -1
  33. package/dist/collection/components/pos-container-contents/pos-create-new-container-item/pos-create-new-container-item.js +4 -2
  34. package/dist/collection/components/pos-markdown-document/pos-markdown-document.js +2 -1
  35. package/dist/collection/components/pos-navigation/bar/pos-navigation-bar.css +42 -22
  36. package/dist/collection/components/pos-navigation/bar/pos-navigation-bar.js +3 -2
  37. package/dist/collection/components/pos-new-thing-form/pos-new-thing-form.js +1 -1
  38. package/dist/collection/components/pos-router/pos-router.js +1 -1
  39. package/dist/collection/components/pos-select-term/pos-select-term.js +1 -1
  40. package/dist/collection/components/pos-share/openNewTab.js +3 -0
  41. package/dist/collection/components/pos-share/pos-share.css +36 -0
  42. package/dist/collection/components/pos-share/pos-share.js +111 -0
  43. package/dist/collection/components/pos-switch/pos-case/pos-case.js +88 -0
  44. package/dist/collection/components/pos-switch/pos-switch.js +89 -0
  45. package/dist/collection/components/pos-tool-select/pos-tool-select.js +6 -3
  46. package/dist/collection/components/pos-upload/pos-upload.js +7 -4
  47. package/dist/collection/components/pos-user-menu/pos-user-menu.js +1 -1
  48. package/dist/collection/tools/pos-tool-attachments/pos-tool-attachments.js +1 -1
  49. package/dist/components/chunk.IVVHNXMC.js +20 -0
  50. package/dist/components/index.js +1 -1
  51. package/dist/components/index2.js +2 -2
  52. package/dist/components/pos-add-literal-value2.js +1 -1
  53. package/dist/components/pos-app-browser.js +1 -1
  54. package/dist/components/pos-attachments2.js +1 -1
  55. package/dist/components/pos-case.d.ts +11 -0
  56. package/dist/components/pos-case.js +1 -0
  57. package/dist/components/pos-container-contents2.js +1 -1
  58. package/dist/components/pos-make-findable2.js +1 -1
  59. package/dist/components/pos-markdown-document2.js +1 -1
  60. package/dist/components/pos-navigation-bar2.js +1 -1
  61. package/dist/components/pos-navigation2.js +1 -1
  62. package/dist/components/pos-new-thing-form2.js +1 -1
  63. package/dist/components/pos-router2.js +1 -1
  64. package/dist/components/pos-select-term2.js +1 -1
  65. package/dist/components/pos-share.d.ts +11 -0
  66. package/dist/components/pos-share.js +1 -0
  67. package/dist/components/pos-share2.js +1 -0
  68. package/dist/components/pos-switch.d.ts +11 -0
  69. package/dist/components/pos-switch.js +1 -0
  70. package/dist/components/pos-tool-attachments.js +1 -1
  71. package/dist/components/pos-tool-select2.js +1 -1
  72. package/dist/components/pos-type-index-entries2.js +1 -1
  73. package/dist/components/pos-upload2.js +12 -3
  74. package/dist/components/pos-user-menu2.js +6 -25
  75. package/dist/elements/elements.esm.js +1 -1
  76. package/dist/elements/{p-6561f1b7.entry.js → p-03464a71.entry.js} +1 -1
  77. package/dist/elements/{p-52a612ed.entry.js → p-272209e3.entry.js} +1 -1
  78. package/dist/elements/{p-a9a18aa8.entry.js → p-38aa17bc.entry.js} +1 -1
  79. package/dist/elements/p-3a890f5f.entry.js +1 -0
  80. package/dist/elements/{p-9ad80b52.entry.js → p-4cd2f9da.entry.js} +1 -1
  81. package/dist/elements/{p-0e7413e6.entry.js → p-5126fb6e.entry.js} +1 -1
  82. package/dist/elements/p-53610ccd.entry.js +1 -0
  83. package/dist/elements/{p-b5d64c6f.entry.js → p-631976a8.entry.js} +1 -1
  84. package/dist/elements/{p-fe628201.entry.js → p-6d628d74.entry.js} +1 -1
  85. package/dist/elements/{p-b363349c.entry.js → p-7c3785d8.entry.js} +1 -1
  86. package/dist/elements/p-8934c5ea.entry.js +1 -0
  87. package/dist/elements/p-8e76e9dc.entry.js +1 -0
  88. package/dist/elements/{p-3e18b5dd.entry.js → p-9bf6c310.entry.js} +1 -1
  89. package/dist/elements/{p-Doy_38_j.js → p-BLUiM5OK.js} +1 -1
  90. package/dist/elements/{p-BkAnMOpW.js → p-CSTMd_cW.js} +2 -2
  91. package/dist/elements/{p-CrxYqX8r.js → p-CVwgVrbO.js} +7 -7
  92. package/dist/elements/{p-8ggjG2YF.js → p-CnIOZlf7.js} +1 -1
  93. package/dist/elements/p-DHl0QGLf.js +67 -0
  94. package/dist/elements/p-DzbCx-pP.js +2 -0
  95. package/dist/elements/{p-c8ee910c.entry.js → p-a1dd6b42.entry.js} +1 -1
  96. package/dist/elements/p-ab4eba43.entry.js +859 -0
  97. package/dist/elements/{p-dff14248.entry.js → p-c7032012.entry.js} +1 -1
  98. package/dist/elements/{p-a20b72d8.entry.js → p-d396cc56.entry.js} +1 -1
  99. package/dist/elements/p-dc4c38c8.entry.js +1 -0
  100. package/dist/elements/{p-0a087865.entry.js → p-e0660718.entry.js} +1 -1
  101. package/dist/elements/{p-8q-RA2Uq.js → p-mIPOXLnA.js} +3 -3
  102. package/dist/esm/{chunk.URTPIBTY-CNA3-SLq.js → chunk.URTPIBTY-yxgfEQ1K.js} +2 -2
  103. package/dist/esm/{chunk.XQ2OKYYA-CXNlpYUG.js → chunk.XQ2OKYYA-Cr3bMzqn.js} +3 -3
  104. package/dist/esm/{chunk.ZGGPD2XJ-BjT6fS1o.js → chunk.ZGGPD2XJ-SJISSXOc.js} +1 -1
  105. package/dist/esm/{class-map-CUYFUkXU.js → class-map-DEweE_Cr.js} +1 -1
  106. package/dist/esm/elements.js +4 -4
  107. package/dist/esm/{index-DFqG64hG.js → index-CXK32bJz.js} +1052 -489
  108. package/dist/esm/{index-VMHzF3uY.js → index-DzbCx-pP.js} +547 -2001
  109. package/dist/esm/{jsonld-V2RB47OZ-CaIJ08AA.js → jsonld-V2RB47OZ-BbN7F0s8.js} +1 -1
  110. package/dist/esm/loader.js +3 -3
  111. package/dist/esm/pos-add-literal-value_3.entry.js +6 -6
  112. package/dist/esm/{pos-add-new-thing_31.entry.js → pos-add-new-thing_32.entry.js} +411 -228
  113. package/dist/esm/pos-app-document-viewer.entry.js +1 -1
  114. package/dist/esm/pos-app-generic.entry.js +1 -1
  115. package/dist/esm/pos-app-image-viewer.entry.js +1 -1
  116. package/dist/esm/pos-app-ldp-container.entry.js +1 -1
  117. package/dist/esm/pos-app-rdf-document.entry.js +1 -1
  118. package/dist/esm/pos-attachments.entry.js +2 -2
  119. package/dist/esm/pos-case.entry.js +22 -0
  120. package/dist/esm/pos-container-contents.entry.js +12 -3
  121. package/dist/esm/pos-container-item_3.entry.js +4 -4
  122. package/dist/esm/pos-document.entry.js +4 -4
  123. package/dist/esm/pos-list.entry.js +1 -1
  124. package/dist/esm/pos-markdown-document.entry.js +442 -2327
  125. package/dist/esm/pos-relations_2.entry.js +1 -1
  126. package/dist/esm/pos-subjects.entry.js +2 -2
  127. package/dist/esm/pos-switch.entry.js +62 -0
  128. package/dist/esm/pos-tool-attachments.entry.js +2 -2
  129. package/dist/esm/pos-value.entry.js +1 -1
  130. package/dist/jest-setup.js +4 -0
  131. package/dist/types/components/pos-container-contents/pos-container-contents.d.ts +2 -0
  132. package/dist/types/components/pos-share/openNewTab.d.ts +1 -0
  133. package/dist/types/components/pos-share/pos-share.d.ts +28 -0
  134. package/dist/types/components/pos-switch/pos-case/pos-case.d.ts +22 -0
  135. package/dist/types/components/pos-switch/pos-switch.d.ts +19 -0
  136. package/dist/types/components.d.ts +300 -74
  137. package/dist/types/stencil-public-runtime.d.ts +52 -2
  138. package/package.json +13 -12
  139. package/dist/elements/p-637a38d9.entry.js +0 -1
  140. package/dist/elements/p-701f2c84.entry.js +0 -850
  141. package/dist/elements/p-9b74c400.entry.js +0 -1
  142. package/dist/elements/p-LoCE14bN.js +0 -67
  143. package/dist/elements/p-VMHzF3uY.js +0 -2
  144. package/dist/elements/p-ac17ed6a.entry.js +0 -1
@@ -0,0 +1,859 @@
1
+ import{r as e,h as t,H as i,c as r,a as o,i as s,j as a}from"./p-DzbCx-pP.js";import{i as n,E as l,T as d,c as p,_ as h,n as c,S as u,x as f,d as m,r as b,w as y,e as g,f as v}from"./p-CVwgVrbO.js";import{c as w,s as x,B as k}from"./p-mIPOXLnA.js";import{P as S,N as D,a as I,T as C}from"./p-DHl0QGLf.js";import{c as B}from"./p-vFMstSdt.js";import{L as P,e as z,s as F,a as T,g as A,b as E,w as _,S as M}from"./p-CSTMd_cW.js";import{a as R,i as N,t as U,e as O}from"./p-CnIOZlf7.js";import{s as $}from"./p-BW_CkW1K.js";import{s as j}from"./p-jlzl8vRd.js";import{u as W}from"./p-D0uCfr1-.js";const L=class{constructor(t){e(this,t)}openDialog(){this.dialog.showModal()}render(){return t(i,{key:"9a60547270fcc455679acdfe6de75da57e513b1f"},t("button",{key:"32a8ba00ef511587024c843663e281e2b6930c19",id:"new",title:"Add a new thing",onClick:()=>this.openDialog()},t("sl-icon",{key:"6faf99cef999b441410770b0509f5a8d6a10f7e9",name:"plus-circle"})),t("pos-dialog",{key:"f6cd827c19d3dfe33500f03e561f399e11d728ce",ref:e=>this.dialog=e},t("span",{key:"ff40b8f28a349a1ad6db11e2d427d74ea5fbd300",slot:"title"},"Add a new thing"),t("pos-new-thing-form",{key:"e48257160d78d025e6213bd61c4953261d4829c2",slot:"content",referenceUri:this.referenceUri})))}};L.style=":host{font-family:var(--font-sans);display:block}button#new{cursor:pointer;display:flex;align-items:center;justify-content:center;border:none;width:var(--size-10);height:var(--size-10);background-color:var(--pos-primary-color);color:var(--pos-primary-text-color);font-size:var(--scale-6);border-radius:var(--radius-xs);padding:var(--size-2)}button#new:hover,button#new:focus{outline:none;filter:brightness(110%);box-shadow:var(--shadow-sm)}pos-new-thing-form{margin:var(--scale-3)}";const H=localStorage.getItem("settings"),V=w(H?JSON.parse(H):{offlineCache:!1});V.on("set",(()=>{const e=JSON.stringify(V.state);localStorage.setItem("settings",e)})),window.addEventListener("storage",(e=>{if("settings"===e.key&&e.newValue){const t=JSON.parse(e.newValue);V.state.offlineCache=t.offlineCache}}));const J=(e,t)=>t.some((t=>e instanceof t));let K,q;const G=new WeakMap,X=new WeakMap,Y=new WeakMap;let Z={get(e,t,i){if(e instanceof IDBTransaction){if("done"===t)return G.get(e);if("store"===t)return i.objectStoreNames[1]?void 0:i.objectStore(i.objectStoreNames[0])}return te(e[t])},set:(e,t,i)=>(e[t]=i,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function Q(e){Z=e(Z)}function ee(e){return"function"==typeof e?(t=e,(q||(q=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(ie(this),e),te(this.request)}:function(...e){return te(t.apply(ie(this),e))}):(e instanceof IDBTransaction&&function(e){if(G.has(e))return;const t=new Promise(((t,i)=>{const r=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",s),e.removeEventListener("abort",s)},o=()=>{t(),r()},s=()=>{i(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",o),e.addEventListener("error",s),e.addEventListener("abort",s)}));G.set(e,t)}(e),J(e,K||(K=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,Z):e);var t}function te(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,i)=>{const r=()=>{e.removeEventListener("success",o),e.removeEventListener("error",s)},o=()=>{t(te(e.result)),r()},s=()=>{i(e.error),r()};e.addEventListener("success",o),e.addEventListener("error",s)}));return Y.set(t,e),t}(e);if(X.has(e))return X.get(e);const t=ee(e);return t!==e&&(X.set(e,t),Y.set(t,e)),t}const ie=e=>Y.get(e),re=["get","getKey","getAll","getAllKeys","count"],oe=["put","add","delete","clear"],se=new Map;function ae(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(se.get(t))return se.get(t);const i=t.replace(/FromIndex$/,""),r=t!==i,o=oe.includes(i);if(!(i in(r?IDBIndex:IDBObjectStore).prototype)||!o&&!re.includes(i))return;const s=async function(e,...t){const s=this.transaction(e,o?"readwrite":"readonly");let a=s.store;return r&&(a=a.index(t.shift())),(await Promise.all([a[i](...t),o&&s.done]))[0]};return se.set(t,s),s}Q((e=>({...e,get:(t,i,r)=>ae(t,i)||e.get(t,i,r),has:(t,i)=>!!ae(t,i)||e.has(t,i)})));const ne=["continue","continuePrimaryKey","advance"],le={},de=new WeakMap,pe=new WeakMap,he={get(e,t){if(!ne.includes(t))return e[t];let i=le[t];return i||(i=le[t]=function(...e){de.set(this,pe.get(this)[t](...e))}),i}};async function*ce(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;const i=new Proxy(t,he);for(pe.set(i,t),Y.set(i,ie(t));t;)yield i,t=await(de.get(i)||t.continue()),de.delete(i)}function ue(e,t){return t===Symbol.asyncIterator&&J(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&J(e,[IDBIndex,IDBObjectStore])}Q((e=>({...e,get:(t,i,r)=>ue(t,i)?ce:e.get(t,i,r),has:(t,i)=>ue(t,i)||e.has(t,i)})));class fe{constructor(){this.dbPromise=function(e,t,{blocked:i,upgrade:r,blocking:o,terminated:s}={}){const a=indexedDB.open(e,t),n=te(a);return r&&a.addEventListener("upgradeneeded",(e=>{r(te(a.result),e.oldVersion,e.newVersion,te(a.transaction),e)})),i&&a.addEventListener("blocked",(e=>i(e.oldVersion,e.newVersion,e))),n.then((e=>{s&&e.addEventListener("close",(()=>s())),o&&e.addEventListener("versionchange",(e=>o(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),n}("OfflineCacheDB",1,{upgrade(e){e.objectStoreNames.contains("documents")||e.createObjectStore("documents",{keyPath:"url"}).createIndex("url-revision",["url","revision"])}})}async clear(){return(await this.dbPromise).clear("documents")}async get(e){const t=await this.dbPromise;return await t.get("documents",e)}async put(e){const t=await this.dbPromise;await t.getFromIndex("documents","url-revision",[e.url,e.revision])||await t.put("documents",e)}}class me{isOnline(){return navigator.onLine}}const be=(e,t)=>new S({session:e,offlineCache:t.offlineCache?new fe:new D,onlineStatus:new me});var ye="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ge(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ve=crypto;const we=e=>e instanceof CryptoKey;const xe=new TextEncoder,ke=new TextDecoder;function Se(...e){const t=e.reduce(((e,{length:t})=>e+t),0),i=new Uint8Array(t);let r=0;for(const t of e)i.set(t,r),r+=t.length;return i}const De=e=>(e=>{let t=e;"string"==typeof t&&(t=xe.encode(t));const i=[];for(let e=0;e<t.length;e+=32768)i.push(String.fromCharCode.apply(null,t.subarray(e,e+32768)));return btoa(i.join(""))})(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),Ie=e=>{let t=e;t instanceof Uint8Array&&(t=ke.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return(e=>{const t=atob(e),i=new Uint8Array(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);return i})(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}};class Ce extends Error{constructor(e,t){super(e,t),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}Ce.code="ERR_JOSE_GENERIC";class Be extends Ce{constructor(e,t,i="unspecified",r="unspecified"){super(e,{cause:{claim:i,reason:r,payload:t}}),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=i,this.reason=r,this.payload=t}}Be.code="ERR_JWT_CLAIM_VALIDATION_FAILED";class Pe extends Ce{constructor(e,t,i="unspecified",r="unspecified"){super(e,{cause:{claim:i,reason:r,payload:t}}),this.code="ERR_JWT_EXPIRED",this.claim=i,this.reason=r,this.payload=t}}Pe.code="ERR_JWT_EXPIRED";class ze extends Ce{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}}ze.code="ERR_JOSE_ALG_NOT_ALLOWED";class Fe extends Ce{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}}Fe.code="ERR_JOSE_NOT_SUPPORTED",class extends Ce{constructor(e="decryption operation failed",t){super(e,t),this.code="ERR_JWE_DECRYPTION_FAILED"}}.code="ERR_JWE_DECRYPTION_FAILED",class extends Ce{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}}.code="ERR_JWE_INVALID";class Te extends Ce{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}}Te.code="ERR_JWS_INVALID";class Ae extends Ce{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}}Ae.code="ERR_JWT_INVALID";class Ee extends Ce{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}}Ee.code="ERR_JWK_INVALID";class _e extends Ce{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}}_e.code="ERR_JWKS_INVALID";class Me extends Ce{constructor(e="no applicable key found in the JSON Web Key Set",t){super(e,t),this.code="ERR_JWKS_NO_MATCHING_KEY"}}Me.code="ERR_JWKS_NO_MATCHING_KEY";class Re extends Ce{constructor(e="multiple matching keys found in the JSON Web Key Set",t){super(e,t),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS"}}Re.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";class Ne extends Ce{constructor(e="request timed out",t){super(e,t),this.code="ERR_JWKS_TIMEOUT"}}Ne.code="ERR_JWKS_TIMEOUT";class Ue extends Ce{constructor(e="signature verification failed",t){super(e,t),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}function Oe(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function $e(e,t){return e.name===t}function je(e){return parseInt(e.name.slice(4),10)}function We(e,t,...i){if((i=i.filter(Boolean)).length>2){const t=i.pop();e+=`one of type ${i.join(", ")}, or ${t}.`}else e+=2===i.length?`one of type ${i[0]} or ${i[1]}.`:`of type ${i[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}Ue.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";var Le=(e,...t)=>We("Key must be ",e,...t);function He(e,t,...i){return We(`Key for the ${e} algorithm must be `,t,...i)}var Ve=e=>!!we(e)||"KeyObject"===e?.[Symbol.toStringTag];const Je=["CryptoKey"];var Ke=(...e)=>{const t=e.filter(Boolean);if(0===t.length||1===t.length)return!0;let i;for(const e of t){const t=Object.keys(e);if(i&&0!==i.size)for(const e of t){if(i.has(e))return!1;i.add(e)}else i=new Set(t)}return!0};function qe(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let i=e;for(;null!==Object.getPrototypeOf(i);)i=Object.getPrototypeOf(i);return Object.getPrototypeOf(e)===i}var Ge=(e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:i}=t.algorithm;if("number"!=typeof i||i<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}};function Xe(e){return qe(e)&&"string"==typeof e.kty}var Ye=async e=>{if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:t,keyUsages:i}=function(e){let t,i;switch(e.kty){case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},i=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},i=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},i=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new Fe('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},i=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},i=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},i=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},i=e.d?["deriveBits"]:[];break;default:throw new Fe('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"Ed25519":t={name:"Ed25519"},i=e.d?["sign"]:["verify"];break;case"EdDSA":t={name:e.crv},i=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},i=e.d?["deriveBits"]:[];break;default:throw new Fe('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new Fe('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:i}}(e),r=[t,e.ext??!1,e.key_ops??i],o={...e};return delete o.alg,delete o.use,ve.subtle.importKey("jwk",o,...r)};const Ze=e=>Ie(e);let Qe,et;const tt=e=>"KeyObject"===e?.[Symbol.toStringTag],it=async(e,t,i,r,o=!1)=>{let s=e.get(t);if(s?.[r])return s[r];const a=await Ye({...i,alg:r});return o&&Object.freeze(t),s?s[r]=a:e.set(t,{[r]:a}),a};async function rt(e,t){if(!qe(e))throw new TypeError("JWK must be an object");switch(t||(t=e.alg),e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return Ie(e.k);case"RSA":if("oth"in e&&void 0!==e.oth)throw new Fe('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return Ye({...e,alg:t});default:throw new Fe('Unsupported "kty" (Key Type) Parameter value')}}const ot=e=>e?.[Symbol.toStringTag],st=(e,t,i)=>{if(void 0!==t.use&&"sig"!==t.use)throw new TypeError("Invalid key for this operation, when present its use must be sig");if(void 0!==t.key_ops&&!0!==t.key_ops.includes?.(i))throw new TypeError(`Invalid key for this operation, when present its key_ops must include ${i}`);if(void 0!==t.alg&&t.alg!==e)throw new TypeError(`Invalid key for this operation, when present its alg must be ${e}`);return!0};function at(e,t,i,r){t.startsWith("HS")||"dir"===t||t.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(t)?((e,t,i,r)=>{if(!(t instanceof Uint8Array)){if(r&&Xe(t)){if(function(e){return Xe(e)&&"oct"===e.kty&&"string"==typeof e.k}(t)&&st(e,t,i))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!Ve(t))throw new TypeError(He(e,t,...Je,"Uint8Array",r?"JSON Web Key":null));if("secret"!==t.type)throw new TypeError(`${ot(t)} instances for symmetric algorithms must be of type "secret"`)}})(t,i,r,e):((e,t,i,r)=>{if(r&&Xe(t))switch(i){case"sign":if(function(e){return"oct"!==e.kty&&"string"==typeof e.d}(t)&&st(e,t,i))return;throw new TypeError("JSON Web Key for this operation be a private JWK");case"verify":if(function(e){return"oct"!==e.kty&&void 0===e.d}(t)&&st(e,t,i))return;throw new TypeError("JSON Web Key for this operation be a public JWK")}if(!Ve(t))throw new TypeError(He(e,t,...Je,r?"JSON Web Key":null));if("secret"===t.type)throw new TypeError(`${ot(t)} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===i&&"public"===t.type)throw new TypeError(`${ot(t)} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===i&&"public"===t.type)throw new TypeError(`${ot(t)} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===i&&"private"===t.type)throw new TypeError(`${ot(t)} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===i&&"private"===t.type)throw new TypeError(`${ot(t)} instances for asymmetric algorithm encryption must be of type "public"`)})(t,i,r,e)}at.bind(void 0,!1);const nt=at.bind(void 0,!0);function lt(e,t,i,r,o){if(void 0!==o.crit&&void 0===r?.crit)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!r||void 0===r.crit)return new Set;if(!Array.isArray(r.crit)||0===r.crit.length||r.crit.some((e=>"string"!=typeof e||0===e.length)))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let s;s=void 0!==i?new Map([...Object.entries(i),...t.entries()]):t;for(const t of r.crit){if(!s.has(t))throw new Fe(`Extension Header Parameter "${t}" is not recognized`);if(void 0===o[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(s.get(t)&&void 0===r[t])throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(r.crit)}async function dt(e){return(async e=>{if(e instanceof Uint8Array)return{kty:"oct",k:De(e)};if(!we(e))throw new TypeError(Le(e,...Je,"Uint8Array"));if(!e.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");const{ext:t,key_ops:i,alg:r,use:o,...s}=await ve.subtle.exportKey("jwk",e);return s})(e)}function pt(e,t){const i=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:i,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:i,name:"RSA-PSS",saltLength:e.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:i,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:i,name:"ECDSA",namedCurve:t.namedCurve};case"Ed25519":return{name:"Ed25519"};case"EdDSA":return{name:t.name};default:throw new Fe(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}async function ht(e,t,i){if("sign"===i&&(t=await((e,t)=>{if(tt(e)){let i=e.export({format:"jwk"});return i.k?Ze(i.k):(Qe||(Qe=new WeakMap),it(Qe,e,i,t))}return Xe(e)?e.k?Ie(e.k):(Qe||(Qe=new WeakMap),it(Qe,e,e,t,!0)):e})(t,e)),"verify"===i&&(t=await((e,t)=>{if(tt(e)){let i=e.export({format:"jwk"});return delete i.d,delete i.dp,delete i.dq,delete i.p,delete i.q,delete i.qi,i.k?Ze(i.k):(et||(et=new WeakMap),it(et,e,i,t))}return Xe(e)?e.k?Ie(e.k):(et||(et=new WeakMap),it(et,e,e,t,!0)):e})(t,e)),we(t))return function(e,t,...i){switch(t){case"HS256":case"HS384":case"HS512":{if(!$e(e.algorithm,"HMAC"))throw Oe("HMAC");const i=parseInt(t.slice(2),10);if(je(e.algorithm.hash)!==i)throw Oe(`SHA-${i}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!$e(e.algorithm,"RSASSA-PKCS1-v1_5"))throw Oe("RSASSA-PKCS1-v1_5");const i=parseInt(t.slice(2),10);if(je(e.algorithm.hash)!==i)throw Oe(`SHA-${i}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!$e(e.algorithm,"RSA-PSS"))throw Oe("RSA-PSS");const i=parseInt(t.slice(2),10);if(je(e.algorithm.hash)!==i)throw Oe(`SHA-${i}`,"algorithm.hash");break}case"EdDSA":if("Ed25519"!==e.algorithm.name&&"Ed448"!==e.algorithm.name)throw Oe("Ed25519 or Ed448");break;case"Ed25519":if(!$e(e.algorithm,"Ed25519"))throw Oe("Ed25519");break;case"ES256":case"ES384":case"ES512":{if(!$e(e.algorithm,"ECDSA"))throw Oe("ECDSA");const i=function(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}(t);if(e.algorithm.namedCurve!==i)throw Oe(i,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}!function(e,t){if(t.length&&!t.some((t=>e.usages.includes(t)))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){const i=t.pop();e+=`one of ${t.join(", ")}, or ${i}.`}else e+=2===t.length?`one of ${t[0]} or ${t[1]}.`:`${t[0]}.`;throw new TypeError(e)}}(e,i)}(t,e,i),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(Le(t,...Je));return ve.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[i])}throw new TypeError(Le(t,...Je,"Uint8Array","JSON Web Key"))}async function ct(e,t,i){if(e instanceof Uint8Array&&(e=ke.decode(e)),"string"!=typeof e)throw new Te("Compact JWS must be a string or Uint8Array");const{0:r,1:o,2:s,length:a}=e.split(".");if(3!==a)throw new Te("Invalid Compact JWS");const n=await async function(e,t,i){if(!qe(e))throw new Te("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new Te('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new Te("JWS Protected Header incorrect type");if(void 0===e.payload)throw new Te("JWS Payload missing");if("string"!=typeof e.signature)throw new Te("JWS Signature missing or incorrect type");if(void 0!==e.header&&!qe(e.header))throw new Te("JWS Unprotected Header incorrect type");let r={};if(e.protected)try{const t=Ie(e.protected);r=JSON.parse(ke.decode(t))}catch{throw new Te("JWS Protected Header is invalid")}if(!Ke(r,e.header))throw new Te("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const o={...r,...e.header};let s=!0;if(lt(Te,new Map([["b64",!0]]),i?.crit,r,o).has("b64")&&(s=r.b64,"boolean"!=typeof s))throw new Te('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:a}=o;if("string"!=typeof a||!a)throw new Te('JWS "alg" (Algorithm) Header Parameter missing or invalid');const n=i&&((e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some((e=>"string"!=typeof e))))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)})("algorithms",i.algorithms);if(n&&!n.has(a))throw new ze('"alg" (Algorithm) Header Parameter value not allowed');if(s){if("string"!=typeof e.payload)throw new Te("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new Te("JWS Payload must be a string or an Uint8Array instance");let l=!1;"function"==typeof t?(t=await t(r,e),l=!0,nt(a,t,"verify"),Xe(t)&&(t=await rt(t,a))):nt(a,t,"verify");const d=Se(xe.encode(e.protected??""),xe.encode("."),"string"==typeof e.payload?xe.encode(e.payload):e.payload);let p,h;try{p=Ie(e.signature)}catch{throw new Te("Failed to base64url decode the signature")}if(!await(async(e,t,i,r)=>{const o=await ht(e,t,"verify");Ge(e,o);const s=pt(e,o.algorithm);try{return await ve.subtle.verify(s,o,i,r)}catch{return!1}})(a,t,p,d))throw new Ue;if(s)try{h=Ie(e.payload)}catch{throw new Te("Failed to base64url decode the payload")}else h="string"==typeof e.payload?xe.encode(e.payload):e.payload;const c={payload:h};return void 0!==e.protected&&(c.protectedHeader=r),void 0!==e.header&&(c.unprotectedHeader=e.header),l?{...c,key:t}:c}({payload:o,protected:r,signature:s},t,i),l={payload:n.payload,protectedHeader:n.protectedHeader};return"function"==typeof t?{...l,key:n.key}:l}var ut=e=>Math.floor(e.getTime()/1e3);const ft=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;var mt=e=>{const t=ft.exec(e);if(!t||t[4]&&t[1])throw new TypeError("Invalid time period format");const i=parseFloat(t[2]);let r;switch(t[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":r=Math.round(i);break;case"minute":case"minutes":case"min":case"mins":case"m":r=Math.round(60*i);break;case"hour":case"hours":case"hr":case"hrs":case"h":r=Math.round(3600*i);break;case"day":case"days":case"d":r=Math.round(86400*i);break;case"week":case"weeks":case"w":r=Math.round(604800*i);break;default:r=Math.round(31557600*i)}return"-"===t[1]||"ago"===t[4]?-r:r};const bt=e=>e.toLowerCase().replace(/^application\//,"");var yt=(e,t,i={})=>{let r;try{r=JSON.parse(ke.decode(t))}catch{}if(!qe(r))throw new Ae("JWT Claims Set must be a top-level JSON object");const{typ:o}=i;if(o&&("string"!=typeof e.typ||bt(e.typ)!==bt(o)))throw new Be('unexpected "typ" JWT header value',r,"typ","check_failed");const{requiredClaims:s=[],issuer:a,subject:n,audience:l,maxTokenAge:d}=i,p=[...s];void 0!==d&&p.push("iat"),void 0!==l&&p.push("aud"),void 0!==n&&p.push("sub"),void 0!==a&&p.push("iss");for(const e of new Set(p.reverse()))if(!(e in r))throw new Be(`missing required "${e}" claim`,r,e,"missing");if(a&&!(Array.isArray(a)?a:[a]).includes(r.iss))throw new Be('unexpected "iss" claim value',r,"iss","check_failed");if(n&&r.sub!==n)throw new Be('unexpected "sub" claim value',r,"sub","check_failed");if(l&&(c="string"==typeof l?[l]:l,!("string"==typeof(h=r.aud)?c.includes(h):Array.isArray(h)&&c.some(Set.prototype.has.bind(new Set(h))))))throw new Be('unexpected "aud" claim value',r,"aud","check_failed");var h,c;let u;switch(typeof i.clockTolerance){case"string":u=mt(i.clockTolerance);break;case"number":u=i.clockTolerance;break;case"undefined":u=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:f}=i,m=ut(f||new Date);if((void 0!==r.iat||d)&&"number"!=typeof r.iat)throw new Be('"iat" claim must be a number',r,"iat","invalid");if(void 0!==r.nbf){if("number"!=typeof r.nbf)throw new Be('"nbf" claim must be a number',r,"nbf","invalid");if(r.nbf>m+u)throw new Be('"nbf" claim timestamp check failed',r,"nbf","check_failed")}if(void 0!==r.exp){if("number"!=typeof r.exp)throw new Be('"exp" claim must be a number',r,"exp","invalid");if(r.exp<=m-u)throw new Pe('"exp" claim timestamp check failed',r,"exp","check_failed")}if(d){const e=m-r.iat;if(e-u>("number"==typeof d?d:mt(d)))throw new Pe('"iat" claim timestamp check failed (too far in the past)',r,"iat","check_failed");if(e<0-u)throw new Be('"iat" claim timestamp check failed (it should be in the past)',r,"iat","check_failed")}return r};async function gt(e,t,i){const r=await ct(e,t,i);if(r.protectedHeader.crit?.includes("b64")&&!1===r.protectedHeader.b64)throw new Ae("JWTs MUST NOT use unencoded payload");const o={payload:yt(r.protectedHeader,r.payload,i),protectedHeader:r.protectedHeader};return"function"==typeof t?{...o,key:r.key}:o}class vt{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("payload must be an instance of Uint8Array");this._payload=e}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}async sign(e,t){if(!this._protectedHeader&&!this._unprotectedHeader)throw new Te("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!Ke(this._protectedHeader,this._unprotectedHeader))throw new Te("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const i={...this._protectedHeader,...this._unprotectedHeader};let r=!0;if(lt(Te,new Map([["b64",!0]]),t?.crit,this._protectedHeader,i).has("b64")&&(r=this._protectedHeader.b64,"boolean"!=typeof r))throw new Te('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:o}=i;if("string"!=typeof o||!o)throw new Te('JWS "alg" (Algorithm) Header Parameter missing or invalid');nt(o,e,"sign");let s,a=this._payload;r&&(a=xe.encode(De(a))),s=xe.encode(this._protectedHeader?De(JSON.stringify(this._protectedHeader)):"");const n=Se(s,xe.encode("."),a),l=await(async(e,t,i)=>{const r=await ht(e,t,"sign");Ge(e,r);const o=await ve.subtle.sign(pt(e,r.algorithm),r,i);return new Uint8Array(o)})(o,e,n),d={signature:De(l),payload:""};return r&&(d.payload=ke.decode(a)),this._unprotectedHeader&&(d.header=this._unprotectedHeader),this._protectedHeader&&(d.protected=ke.decode(s)),d}}class wt{constructor(e){this._flattened=new vt(e)}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}async sign(e,t){const i=await this._flattened.sign(e,t);if(void 0===i.payload)throw new TypeError("use the flattened module for creating JWS with b64: false");return`${i.protected}.${i.payload}.${i.signature}`}}function xt(e,t){if(!Number.isFinite(t))throw new TypeError(`Invalid ${e} input`);return t}class kt{constructor(e={}){if(!qe(e))throw new TypeError("JWT Claims Set MUST be an object");this._payload=e}setIssuer(e){return this._payload={...this._payload,iss:e},this}setSubject(e){return this._payload={...this._payload,sub:e},this}setAudience(e){return this._payload={...this._payload,aud:e},this}setJti(e){return this._payload={...this._payload,jti:e},this}setNotBefore(e){return this._payload="number"==typeof e?{...this._payload,nbf:xt("setNotBefore",e)}:e instanceof Date?{...this._payload,nbf:xt("setNotBefore",ut(e))}:{...this._payload,nbf:ut(new Date)+mt(e)},this}setExpirationTime(e){return this._payload="number"==typeof e?{...this._payload,exp:xt("setExpirationTime",e)}:e instanceof Date?{...this._payload,exp:xt("setExpirationTime",ut(e))}:{...this._payload,exp:ut(new Date)+mt(e)},this}setIssuedAt(e){return this._payload=void 0===e?{...this._payload,iat:ut(new Date)}:e instanceof Date?{...this._payload,iat:xt("setIssuedAt",ut(e))}:"string"==typeof e?{...this._payload,iat:xt("setIssuedAt",ut(new Date)+mt(e))}:{...this._payload,iat:xt("setIssuedAt",e)},this}}class St extends kt{setProtectedHeader(e){return this._protectedHeader=e,this}async sign(e,t){const i=new wt(xe.encode(JSON.stringify(this._payload)));if(i.setProtectedHeader(this._protectedHeader),Array.isArray(this._protectedHeader?.crit)&&this._protectedHeader.crit.includes("b64")&&!1===this._protectedHeader.b64)throw new Ae("JWTs MUST NOT use unencoded payload");return i.sign(e,t)}}const Dt=(e,t)=>{if("string"!=typeof e||!e)throw new Ee(`${t} missing or invalid`)};async function It(e,t){if(!qe(e))throw new TypeError("JWK must be an object");if(t??(t="sha256"),"sha256"!==t&&"sha384"!==t&&"sha512"!==t)throw new TypeError('digestAlgorithm must one of "sha256", "sha384", or "sha512"');let i;switch(e.kty){case"EC":Dt(e.crv,'"crv" (Curve) Parameter'),Dt(e.x,'"x" (X Coordinate) Parameter'),Dt(e.y,'"y" (Y Coordinate) Parameter'),i={crv:e.crv,kty:e.kty,x:e.x,y:e.y};break;case"OKP":Dt(e.crv,'"crv" (Subtype of Key Pair) Parameter'),Dt(e.x,'"x" (Public Key) Parameter'),i={crv:e.crv,kty:e.kty,x:e.x};break;case"RSA":Dt(e.e,'"e" (Exponent) Parameter'),Dt(e.n,'"n" (Modulus) Parameter'),i={e:e.e,kty:e.kty,n:e.n};break;case"oct":Dt(e.k,'"k" (Key Value) Parameter'),i={k:e.k,kty:e.kty};break;default:throw new Fe('"kty" (Key Type) Parameter missing or unsupported')}const r=xe.encode(JSON.stringify(i));return De(await(async(e,t)=>{const i=`SHA-${e.slice(-3)}`;return new Uint8Array(await ve.subtle.digest(i,t))})(t,r))}function Ct(e){return qe(e)}function Bt(e){return"function"==typeof structuredClone?structuredClone(e):JSON.parse(JSON.stringify(e))}class Pt{constructor(e){if(this._cached=new WeakMap,!function(e){return e&&"object"==typeof e&&Array.isArray(e.keys)&&e.keys.every(Ct)}(e))throw new _e("JSON Web Key Set malformed");this._jwks=Bt(e)}async getKey(e,t){const{alg:i,kid:r}={...e,...t?.header},o=function(e){switch("string"==typeof e&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";default:throw new Fe('Unsupported "alg" value for a JSON Web Key Set')}}(i),s=this._jwks.keys.filter((e=>{let t=o===e.kty;if(t&&"string"==typeof r&&(t=r===e.kid),t&&"string"==typeof e.alg&&(t=i===e.alg),t&&"string"==typeof e.use&&(t="sig"===e.use),t&&Array.isArray(e.key_ops)&&(t=e.key_ops.includes("verify")),t)switch(i){case"ES256":t="P-256"===e.crv;break;case"ES256K":t="secp256k1"===e.crv;break;case"ES384":t="P-384"===e.crv;break;case"ES512":t="P-521"===e.crv;break;case"Ed25519":t="Ed25519"===e.crv;break;case"EdDSA":t="Ed25519"===e.crv||"Ed448"===e.crv}return t})),{0:a,length:n}=s;if(0===n)throw new Me;if(1!==n){const e=new Re,{_cached:t}=this;throw e[Symbol.asyncIterator]=async function*(){for(const e of s)try{yield await zt(t,e,i)}catch{}},e}return zt(this._cached,a,i)}}async function zt(e,t,i){const r=e.get(t)||e.set(t,{}).get(t);if(void 0===r[i]){const e=await rt({...t,ext:!0},i);if(e instanceof Uint8Array||"public"!==e.type)throw new _e("JSON Web Key Set members must be public keys");r[i]=e}return r[i]}function Ft(e){const t=new Pt(e),i=async(e,i)=>t.getKey(e,i);return Object.defineProperties(i,{jwks:{value:()=>Bt(t._jwks),enumerable:!0,configurable:!1,writable:!1}}),i}let Tt;"undefined"!=typeof navigator&&navigator.userAgent?.startsWith?.("Mozilla/5.0 ")||(Tt="jose/v5.10.0");const At=Symbol();class Et{constructor(e,t){if(!(e instanceof URL))throw new TypeError("url must be an instance of URL");var i,r;this._url=new URL(e.href),this._options={agent:t?.agent,headers:t?.headers},this._timeoutDuration="number"==typeof t?.timeoutDuration?t?.timeoutDuration:5e3,this._cooldownDuration="number"==typeof t?.cooldownDuration?t?.cooldownDuration:3e4,this._cacheMaxAge="number"==typeof t?.cacheMaxAge?t?.cacheMaxAge:6e5,void 0!==t?.[At]&&(this._cache=t?.[At],i=t?.[At],r=this._cacheMaxAge,"object"==typeof i&&null!==i&&"uat"in i&&"number"==typeof i.uat&&!(Date.now()-i.uat>=r)&&"jwks"in i&&qe(i.jwks)&&Array.isArray(i.jwks.keys)&&Array.prototype.every.call(i.jwks.keys,qe)&&(this._jwksTimestamp=this._cache.uat,this._local=Ft(this._cache.jwks)))}coolingDown(){return"number"==typeof this._jwksTimestamp&&Date.now()<this._jwksTimestamp+this._cooldownDuration}fresh(){return"number"==typeof this._jwksTimestamp&&Date.now()<this._jwksTimestamp+this._cacheMaxAge}async getKey(e,t){this._local&&this.fresh()||await this.reload();try{return await this._local(e,t)}catch(i){if(i instanceof Me&&!1===this.coolingDown())return await this.reload(),this._local(e,t);throw i}}async reload(){this._pendingFetch&&("undefined"!=typeof WebSocketPair||"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"undefined"!=typeof EdgeRuntime&&"vercel"===EdgeRuntime)&&(this._pendingFetch=void 0);const e=new Headers(this._options.headers);Tt&&!e.has("User-Agent")&&(e.set("User-Agent",Tt),this._options.headers=Object.fromEntries(e.entries())),this._pendingFetch||(this._pendingFetch=(async(e,t,i)=>{let r,o,s=!1;"function"==typeof AbortController&&(r=new AbortController,o=setTimeout((()=>{s=!0,r.abort()}),t));const a=await fetch(e.href,{signal:r?r.signal:void 0,redirect:"manual",headers:i.headers}).catch((e=>{if(s)throw new Ne;throw e}));if(void 0!==o&&clearTimeout(o),200!==a.status)throw new Ce("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await a.json()}catch{throw new Ce("Failed to parse the JSON Web Key Set HTTP response as JSON")}})(this._url,this._timeoutDuration,this._options).then((e=>{this._local=Ft(e),this._cache&&(this._cache.uat=Date.now(),this._cache.jwks=e),this._jwksTimestamp=Date.now(),this._pendingFetch=void 0})).catch((e=>{throw this._pendingFetch=void 0,e}))),await this._pendingFetch}}function _t(e,t){const i=new Et(e,t),r=async(e,t)=>i.getKey(e,t);return Object.defineProperties(r,{coolingDown:{get:()=>i.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>i.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>i.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>!!i._pendingFetch,enumerable:!0,configurable:!1},jwks:{value:()=>i._local?.jwks(),enumerable:!0,configurable:!1,writable:!1}}),r}const Mt=Ie;function Rt(e){const t=e?.modulusLength??2048;if("number"!=typeof t||t<2048)throw new Fe("Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used");return t}class Nt{dbName;storeName;dbVersion;db=null;constructor(e="soidc",t="session",i=1){this.dbName=e,this.storeName=t,this.dbVersion=i}async init(){return new Promise(((e,t)=>{const i=indexedDB.open(this.dbName,this.dbVersion);i.onerror=e=>{t(new Error(`Database error: ${e.target.error}`))},i.onsuccess=t=>{this.db=t.target.result,e(this)},i.onupgradeneeded=e=>{const t=e.target.result;t.objectStoreNames.contains(this.storeName)||t.createObjectStore(this.storeName)}}))}async setItem(e,t){return this.db||await this.init(),new Promise(((i,r)=>{const o=this.db.transaction(this.storeName,"readwrite");o.oncomplete=()=>{i()},o.onerror=t=>{r(new Error(`Transaction error for setItem(${e},...): ${t.target.error}`))},o.onabort=t=>{r(new Error(`Transaction aborted for setItem(${e},...): ${t.target.error}`))},o.objectStore(this.storeName).put(t,e)}))}async getItem(e){return this.db||await this.init(),new Promise(((t,i)=>{const r=this.db.transaction(this.storeName,"readonly");r.onerror=t=>{i(new Error(`Transaction error for getItem(${e}): ${t.target.error}`))},r.onabort=t=>{i(new Error(`Transaction aborted for getItem(${e}): ${t.target.error}`))};const o=r.objectStore(this.storeName).get(e);o.onsuccess=()=>{t(o.result||null)}}))}async deleteItem(e){return this.db||await this.init(),new Promise(((t,i)=>{const r=this.db.transaction(this.storeName,"readwrite");r.oncomplete=()=>{t()},r.onerror=t=>{i(new Error(`Transaction error for deleteItem(${e}): ${t.target.error}`))},r.onabort=t=>{i(new Error(`Transaction aborted for deleteItem(${e}): ${t.target.error}`))},r.objectStore(this.storeName).delete(e)}))}async clear(){return this.db||await this.init(),new Promise(((e,t)=>{const i=this.db.transaction(this.storeName,"readwrite");i.oncomplete=()=>{e()},i.onerror=e=>{t(new Error(`Transaction error for clear(): ${e.target.error}`))},i.onabort=e=>{t(new Error(`Transaction aborted for clear(): ${e.target.error}`))},i.objectStore(this.storeName).clear()}))}close(){this.db&&(this.db.close(),this.db=null)}}const Ut=async()=>{const e=window.crypto.randomUUID()+"-"+window.crypto.randomUUID(),t=new Uint8Array(await window.crypto.subtle.digest("SHA-256",(new TextEncoder).encode(e)));return{pkce_code_verifier:e,pkce_code_challenge:btoa(String.fromCharCode(...t)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}},Ot=async()=>{const e=await(new Nt).init(),t=await e.getItem("client_id"),i=await e.getItem("token_endpoint"),r=await e.getItem("dpop_keypair"),o=await e.getItem("refresh_token");if(null===t||null===i||null===r||null===o)throw new Error("Could not refresh tokens: details missing from database.");const s=await $t(o,t,i,r).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})),a=s.access_token,n=await e.getItem("idp");if(null===n)throw new Error("Access Token validation preparation - Could not find in sessionDatabase: idp");const l=await e.getItem("jwks_uri");if(null===l)throw new Error("Access Token validation preparation - Could not find in sessionDatabase: jwks_uri");const d=_t(new URL(l)),{payload:p}=await gt(a,d,{issuer:n,audience:"solid"}),h=await It(await dt(r.publicKey));if(p.cnf.jkt!=h)throw new Error("Access Token validation failed on `jkt`: jkt != DPoP thumbprint - "+p.cnf.jkt+" != "+h);if(p.client_id!=t)throw new Error("Access Token validation failed on `client_id`: JWT payload != client_id - "+p.client_id+" != "+t);return await e.setItem("refresh_token",s.refresh_token),e.close(),{...s,dpop_key_pair:r}},$t=async(e,t,i,r)=>{const o=await dt(r.publicKey);o.alg="ES256";const s=await new St({htu:i,htm:"POST"}).setIssuedAt().setJti(window.crypto.randomUUID()).setProtectedHeader({alg:"ES256",typ:"dpop+jwt",jwk:o}).sign(r.privateKey);return fetch(i,{method:"POST",headers:{dpop:s,"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:e,client_id:t})})};class jt{sessionInformation;isActive_=!1;webId_=void 0;currentAth_=void 0;tokenRefreshTimeout;sessionDeactivateTimeout;onSessionExpirationWarning;constructor(e,t){this.sessionInformation={clientDetails:e},this.onSessionExpirationWarning=t?.onSessionExpirationWarning}async login(e,t){await(async(e,t,i)=>{const r=new URL(t),o=r.origin+r.pathname+r.search,s=new URL(e).origin,a=await fetch(`${s}/.well-known/openid-configuration`).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})),n=a.issuer,l=e=>e.endsWith("/")?e.slice(0,-1):e;if(l(e)!==l(n))throw new Error("RFC 9207 - iss != idp - "+n+" != "+e);sessionStorage.setItem("idp",n),sessionStorage.setItem("token_endpoint",a.token_endpoint),sessionStorage.setItem("jwks_uri",a.jwks_uri);let d=i?.client_id;if(!d){const e=a.registration_endpoint,t=await(async(e,t)=>{const i={...t,grant_types:["authorization_code","refresh_token"],id_token_signed_response_alg:"ES256",token_endpoint_auth_method:"none",application_type:"web",subject_type:"public"};return fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})})(e,i??{redirect_uris:[o]}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()}));d=t.client_id,sessionStorage.setItem("client_id",d)}const{pkce_code_verifier:p,pkce_code_challenge:h}=await Ut();sessionStorage.setItem("pkce_code_verifier",p);const c=window.crypto.randomUUID();sessionStorage.setItem("csrf_token",c);const u=a.authorization_endpoint+"?response_type=code"+`&redirect_uri=${encodeURIComponent(o)}&scope=openid offline_access webid`+`&client_id=${encodeURIComponent(d)}&code_challenge_method=S256`+`&code_challenge=${h}`+`&state=${c}&prompt=consent`;window.location.href=u})(e,t,this.sessionInformation.clientDetails)}async logout(){if(this.sessionDeactivateTimeout&&clearTimeout(this.sessionDeactivateTimeout),this.sessionDeactivateTimeout=void 0,this.tokenRefreshTimeout&&clearTimeout(this.tokenRefreshTimeout),this.tokenRefreshTimeout=void 0,this.sessionInformation.idpDetails=void 0,this.sessionInformation.tokenDetails=void 0,this.isActive_=!1,this.webId_=void 0,this.sessionInformation.clientDetails?.client_id)try{new URL(this.sessionInformation.clientDetails.client_id)}catch(e){this.sessionInformation.clientDetails.client_id=void 0}const e=await(new Nt).init();await e.clear(),e.close()}async handleRedirectFromLogin(){const e=await(async e=>{const t=new URL(window.location.href),i=t.searchParams.get("code");if(null===i)return{clientDetails:e};const r=sessionStorage.getItem("idp");if(null===r||t.searchParams.get("iss")!=r)throw new Error("RFC 9207 - iss != idp - "+t.searchParams.get("iss")+" != "+r);if(t.searchParams.get("state")!=sessionStorage.getItem("csrf_token"))throw new Error("RFC 6749 - state != csrf_token - "+t.searchParams.get("state")+" != "+sessionStorage.getItem("csrf_token"));t.searchParams.delete("iss"),t.searchParams.delete("state"),t.searchParams.delete("code"),window.history.pushState({},document.title,t.toString());const o=sessionStorage.getItem("pkce_code_verifier");if(null===o)throw new Error("Access Token Request preparation - Could not find in sessionStorage: pkce_code_verifier");const s=e?.client_id||sessionStorage.getItem("client_id");if(!s)throw new Error("Access Token Request preparation - Could not find in sessionStorage: client_id (dynamic registration)");const a=sessionStorage.getItem("token_endpoint");if(null===a)throw new Error("Access Token Request preparation - Could not find in sessionStorage: token_endpoint");const n=await async function(e,t){return async function(e,t){let i,r;switch(e){case"PS256":case"PS384":case"PS512":i={name:"RSA-PSS",hash:`SHA-${e.slice(-3)}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:Rt(t)},r=["sign","verify"];break;case"RS256":case"RS384":case"RS512":i={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.slice(-3)}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:Rt(t)},r=["sign","verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":i={name:"RSA-OAEP",hash:`SHA-${parseInt(e.slice(-3),10)||1}`,publicExponent:new Uint8Array([1,0,1]),modulusLength:Rt(t)},r=["decrypt","unwrapKey","encrypt","wrapKey"];break;case"ES256":i={name:"ECDSA",namedCurve:"P-256"},r=["sign","verify"];break;case"ES384":i={name:"ECDSA",namedCurve:"P-384"},r=["sign","verify"];break;case"ES512":i={name:"ECDSA",namedCurve:"P-521"},r=["sign","verify"];break;case"Ed25519":i={name:"Ed25519"},r=["sign","verify"];break;case"EdDSA":{r=["sign","verify"];const e="Ed25519";switch(e){case"Ed25519":case"Ed448":i={name:e};break;default:throw new Fe("Invalid or unsupported crv option provided")}break}case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{r=["deriveKey","deriveBits"];const e="P-256";switch(e){case"P-256":case"P-384":case"P-521":i={name:"ECDH",namedCurve:e};break;case"X25519":case"X448":i={name:e};break;default:throw new Fe("Invalid or unsupported crv option provided, supported values are P-256, P-384, P-521, X25519, and X448")}break}default:throw new Fe('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return ve.subtle.generateKey(i,!1,r)}(e,t)}("ES256"),l=await(async(e,t,i,r,o,s)=>{const a=await dt(s.publicKey);a.alg="ES256";const n=await new St({htu:o,htm:"POST"}).setIssuedAt().setJti(window.crypto.randomUUID()).setProtectedHeader({alg:"ES256",typ:"dpop+jwt",jwk:a}).sign(s.privateKey);return fetch(o,{method:"POST",headers:{dpop:n,"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:i,client_id:r})})})(i,o,t.toString(),s,a,n).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})),d=l.access_token,p=sessionStorage.getItem("jwks_uri");if(null===p)throw new Error("Access Token validation preparation - Could not find in sessionStorage: jwks_uri");const h=_t(new URL(p)),{payload:c}=await gt(d,h,{issuer:r,audience:"solid"}),u=await It(await dt(n.publicKey));if(c.cnf.jkt!=u)throw new Error("Access Token validation failed on `jkt`: jkt != DPoP thumbprint - "+c.cnf.jkt+" != "+u);if(c.client_id!=s)throw new Error("Access Token validation failed on `client_id`: JWT payload != client_id - "+c.client_id+" != "+s);const f={...l,dpop_key_pair:n},m={idp:r,jwks_uri:p,token_endpoint:a};e||(e={redirect_uris:[window.location.href]}),e.client_id=s;const b=await(new Nt).init();return await Promise.all([b.setItem("idp",r),b.setItem("jwks_uri",p),b.setItem("token_endpoint",a),b.setItem("client_id",s),b.setItem("dpop_keypair",n),b.setItem("refresh_token",l.refresh_token)]),b.close(),sessionStorage.removeItem("csrf_token"),sessionStorage.removeItem("pkce_code_verifier"),sessionStorage.removeItem("idp"),sessionStorage.removeItem("jwks_uri"),sessionStorage.removeItem("token_endpoint"),sessionStorage.removeItem("client_id"),{clientDetails:e,idpDetails:m,tokenDetails:f}})(this.sessionInformation.clientDetails);e.tokenDetails&&(this.sessionInformation=e,await this.setSessionDetails())}async restore(){await Ot().then((e=>(this.sessionInformation.tokenDetails=e,this.setSessionDetails()))).catch((()=>{}))}async createSignedDPoPToken(e){if(!this.sessionInformation.tokenDetails||!this.currentAth_)throw new Error("Session not established.");e.ath=this.currentAth_;const t=await dt(this.sessionInformation.tokenDetails.dpop_key_pair.publicKey);return new St(e).setIssuedAt().setJti(window.crypto.randomUUID()).setProtectedHeader({alg:"ES256",typ:"dpop+jwt",jwk:t}).sign(this.sessionInformation.tokenDetails.dpop_key_pair.privateKey)}async authFetch(e,t,i){let r,o,s;if(e instanceof Request?(r=new URL(e.url),o=t?.method||e?.method||"GET",s=new Headers(e.headers)):(t=t||{},r=new URL(e.toString()),o=t.method||"GET",s=t.headers?new Headers(t.headers):new Headers),this.sessionInformation.tokenDetails){i=i??{htu:`${r.origin}${r.pathname}`,htm:o.toUpperCase()};const e=await this.createSignedDPoPToken(i);s.set("dpop",e),s.set("authorization",`DPoP ${this.sessionInformation.tokenDetails.access_token}`)}return e instanceof Request?fetch(new Request(e,{...t,headers:s})):fetch(r,{...t,headers:s})}get isActive(){return this.isActive_}get webId(){return this.webId_}async setSessionDetails(){this.sessionInformation.tokenDetails?.access_token||this.logout(),this.currentAth_=await this.computeAth(this.sessionInformation.tokenDetails.access_token),this.webId_=function(e){if("string"!=typeof e)throw new Ae("JWTs must use Compact JWS serialization, JWT must be a string");const{1:t,length:i}=e.split(".");if(5===i)throw new Ae("Only JWTs using Compact JWS serialization can be decoded");if(3!==i)throw new Ae("Invalid JWT");if(!t)throw new Ae("JWTs must contain a payload");let r,o;try{r=Mt(t)}catch{throw new Ae("Failed to base64url decode the payload")}try{o=JSON.parse(ke.decode(r))}catch{throw new Ae("Failed to parse the decoded payload as JSON")}if(!qe(o))throw new Ae("Invalid JWT Claims Set");return o}(this.sessionInformation.tokenDetails.access_token).webid,this.isActive_=void 0!==this.webId,this.setSessionDeactivateTimeout(),this.setTokenRefreshTimeout()}setSessionDeactivateTimeout(){const e=1e3*(this.sessionInformation.tokenDetails.expires_in-5);this.sessionDeactivateTimeout&&clearTimeout(this.sessionDeactivateTimeout),this.sessionDeactivateTimeout=setTimeout((()=>this.logout()),e)}setTokenRefreshTimeout(){const e=1e3*(this.sessionInformation.tokenDetails.expires_in-95);this.tokenRefreshTimeout&&clearTimeout(this.tokenRefreshTimeout),this.tokenRefreshTimeout=setTimeout((async()=>{const e=await Ot().catch((()=>{this.onSessionExpirationWarning&&this.onSessionExpirationWarning()}));e&&(this.sessionInformation.tokenDetails=e,this.setSessionDetails())}),e)}async computeAth(e){const t=(new TextEncoder).encode(e),i=await crypto.subtle.digest("SHA-256",t),r=Array.from(new Uint8Array(i));return btoa(String.fromCharCode(...r)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}}class Wt{get authenticatedFetch(){return this._authenticatedFetch}constructor(){this.onSessionRestoreCallback=()=>{},this.sessionInfo$=new B.BehaviorSubject({isLoggedIn:!1,webId:void 0}),this.session=new jt,this._authenticatedFetch=this.session.authFetch.bind(this.session)}async handleIncomingRedirect(e=!1){await this.session.handleRedirectFromLogin(),e&&(await this.session.restore(),this.session.isActive&&this.onSessionRestoreCallback(window.location.href)),this.sessionInfo$.next({isLoggedIn:this.session.isActive,webId:this.session.webId})}async login(e){return this.session.login(e,window.location.href)}async logout(){await this.session.logout(),this.sessionInfo$.next({isLoggedIn:!1,webId:void 0})}observeSession(){return this.sessionInfo$}onSessionRestore(e){this.onSessionRestoreCallback=e}}var Lt=n`
2
+ :host {
3
+ --height: 1rem;
4
+ --track-color: var(--sl-color-neutral-200);
5
+ --indicator-color: var(--sl-color-primary-600);
6
+ --label-color: var(--sl-color-neutral-0);
7
+
8
+ display: block;
9
+ }
10
+
11
+ .progress-bar {
12
+ position: relative;
13
+ background-color: var(--track-color);
14
+ height: var(--height);
15
+ border-radius: var(--sl-border-radius-pill);
16
+ box-shadow: inset var(--sl-shadow-small);
17
+ overflow: hidden;
18
+ }
19
+
20
+ .progress-bar__indicator {
21
+ height: 100%;
22
+ font-family: var(--sl-font-sans);
23
+ font-size: 12px;
24
+ font-weight: var(--sl-font-weight-normal);
25
+ background-color: var(--indicator-color);
26
+ color: var(--label-color);
27
+ text-align: center;
28
+ line-height: var(--height);
29
+ white-space: nowrap;
30
+ overflow: hidden;
31
+ transition:
32
+ 400ms width,
33
+ 400ms background-color;
34
+ user-select: none;
35
+ -webkit-user-select: none;
36
+ }
37
+
38
+ /* Indeterminate */
39
+ .progress-bar--indeterminate .progress-bar__indicator {
40
+ position: absolute;
41
+ animation: indeterminate 2.5s infinite cubic-bezier(0.37, 0, 0.63, 1);
42
+ }
43
+
44
+ .progress-bar--indeterminate.progress-bar--rtl .progress-bar__indicator {
45
+ animation-name: indeterminate-rtl;
46
+ }
47
+
48
+ @media (forced-colors: active) {
49
+ .progress-bar {
50
+ outline: solid 1px SelectedItem;
51
+ background-color: var(--sl-color-neutral-0);
52
+ }
53
+
54
+ .progress-bar__indicator {
55
+ outline: solid 1px SelectedItem;
56
+ background-color: SelectedItem;
57
+ }
58
+ }
59
+
60
+ @keyframes indeterminate {
61
+ 0% {
62
+ left: -50%;
63
+ width: 50%;
64
+ }
65
+ 75%,
66
+ 100% {
67
+ left: 100%;
68
+ width: 50%;
69
+ }
70
+ }
71
+
72
+ @keyframes indeterminate-rtl {
73
+ 0% {
74
+ right: -50%;
75
+ width: 50%;
76
+ }
77
+ 75%,
78
+ 100% {
79
+ right: 100%;
80
+ width: 50%;
81
+ }
82
+ }
83
+ `
84
+ /**
85
+ * @license
86
+ * Copyright 2018 Google LLC
87
+ * SPDX-License-Identifier: BSD-3-Clause
88
+ */;const Ht=e=>e??l
89
+ /**
90
+ * @license
91
+ * Copyright 2018 Google LLC
92
+ * SPDX-License-Identifier: BSD-3-Clause
93
+ */,Vt="important",Jt=" !"+Vt,Kt=R(class extends N{constructor(e){if(super(e),e.type!==U.ATTRIBUTE||"style"!==e.name||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce(((t,i)=>{const r=e[i];return null==r?t:t+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`}),"")}update(e,[t]){const{style:i}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(t)),this.render(t);for(const e of this.ft)null==t[e]&&(this.ft.delete(e),e.includes("-")?i.removeProperty(e):i[e]=null);for(const e in t){const r=t[e];if(null!=r){this.ft.add(e);const t="string"==typeof r&&r.endsWith(Jt);e.includes("-")||t?i.setProperty(e,t?r.slice(0,-11):r,t?Vt:""):i[e]=r}}return d}});var qt=class extends u{constructor(){super(...arguments),this.localize=new P(this),this.value=0,this.indeterminate=!1,this.label=""}render(){return f`
94
+ <div
95
+ part="base"
96
+ class=${O({"progress-bar":!0,"progress-bar--indeterminate":this.indeterminate,"progress-bar--rtl":"rtl"===this.localize.dir()})}
97
+ role="progressbar"
98
+ title=${Ht(this.title)}
99
+ aria-label=${this.label.length>0?this.label:this.localize.term("progress")}
100
+ aria-valuemin="0"
101
+ aria-valuemax="100"
102
+ aria-valuenow=${this.indeterminate?0:this.value}
103
+ >
104
+ <div part="indicator" class="progress-bar__indicator" style=${Kt({width:`${this.value}%`})}>
105
+ ${this.indeterminate?"":f` <slot part="label" class="progress-bar__label"></slot> `}
106
+ </div>
107
+ </div>
108
+ `}};qt.styles=[p,Lt],h([c({type:Number,reflect:!0})],qt.prototype,"value",2),h([c({type:Boolean,reflect:!0})],qt.prototype,"indeterminate",2),h([c()],qt.prototype,"label",2),qt.define("sl-progress-bar");const Gt=class{constructor(t){e(this,t),this.sessionRestoredEmitter=r(this,"pod-os:session-restored",7),this.podOsLoadedEmitter=r(this,"pod-os:loaded",7),this.restorePreviousSession=!1,this.disconnected$=new B.Subject,this.loading=!0}async componentWillLoad(){const e=new Wt;this.unsubscribeSettings=V.on("set",(()=>{this.os=be(e,V.state)})),this.os=be(e,V.state),e.onSessionRestore((e=>{this.sessionRestoredEmitter.emit({url:e})}));try{await e.handleIncomingRedirect(this.restorePreviousSession)}catch(e){console.error(e)}this.os.observeSession().pipe(B.takeUntil(this.disconnected$)).subscribe((async e=>{if(x.state.webId=e.webId,e.isLoggedIn){const t=await this.os.fetchProfile(e.webId);x.state.profile=t}x.state.isLoggedIn=e.isLoggedIn,this.loading=!1})),this.podOsLoadedEmitter.emit({os:this.os,authenticatedFetch:e.authenticatedFetch})}disconnectedCallback(){this.unsubscribeSettings(),this.disconnected$.next(),this.disconnected$.unsubscribe()}async initializeOs(e){e.stopPropagation(),e.detail(this.os)}async loadModule(e){e.stopPropagation();const t=await this.os.loadModule(e.detail.module);e.detail.receiver(t)}render(){return this.loading?t("sl-progress-bar",{indeterminate:!0}):t("slot",null)}},Xt=class{constructor(t){e(this,t),this.restorePreviousSession=!1,this.mode="standalone",this.uri=""}render(){return t(i,{key:"08b186d2f354d6c07df02707eb4ada81aef7dec3"},t("pos-app",{key:"54c372343e916ab5d77584381b3965c925ae0cd0",restorePreviousSession:this.restorePreviousSession},t("pos-error-toast",{key:"ab63e18121ca16670f81da141219a782dde0694b"},t("pos-router",{key:"69b6f3bf8ce3720c6c39cdb4be69e640e27ccc5b",mode:this.mode,"onPod-os:route-changed":e=>this.uri=e.detail},t("header",{key:"5cd3412caf13b6d99da517ae7e6f5877234e65d7"},t("pos-add-new-thing",{key:"9b83b3cf03b7038303975386176df539b35ff547",referenceUri:this.uri}),t("pos-navigation",{key:"26bfed9b1c8dd1be018babc6ef40ae42808a5c42",uri:"pod-os:dashboard"===this.uri?"":this.uri}),t("pos-login",{key:"e29f18dcde866d8ac1e317fcd7b71ef584e69034"},t("pos-user-menu",{key:"be796f0914649eb4e8525a9d8acdfd535626303c",webId:x.state.webId,slot:"if-logged-in"}))),t("main",{key:"f99dfb2d43e949528bc767b94801c99bf04a7eea"},this.mainContent()),t("footer",{key:"64744d1246356fa00da9c6b561785e2b794a7907"},t(Yt,{key:"a648f7f88e12c79348bda33152f2759d2b93e738"}),t("span",{key:"f22e2f9904ba517fc2e579a05018704b5ade6302"},"PodOS Browser"))))))}mainContent(){return""===this.uri?null:this.uri.startsWith("pod-os:")?t("pos-internal-router",{uri:this.uri}):t("pos-resource",{key:this.uri,uri:this.uri},t("pos-type-router",null))}},Yt=()=>t("svg",{viewBox:"0 0 400 400",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M50 350 L50 100 L200 50 L350 100 L350 350 Z",style:{fill:"#008BF8",stroke:"#008BF8","stroke-width":"70"},"stroke-linejoin":"round"}),t("path",{d:"M100 300 L100 150 L200 120 L300 150 L300 300 L130 300 L130 370 L100 370Z",style:{fill:"white",stroke:"white","stroke-width":"45"},"stroke-linejoin":"round"}),t("path",{d:"M150 250 L150 200 L200 180 L250 200 L250 250 Z",style:{fill:"#DC0073",stroke:"#DC0073","stroke-width":"20"},"stroke-linejoin":"round"}));Xt.style="pos-router{margin:0;padding:0;display:flex;flex-direction:column;height:100%}pos-navigation{max-width:var(--width-lg);margin:0;min-width:var(--size-32);flex-shrink:1;}pos-add-new-thing,pos-login{flex:0 1 auto;flex-shrink:0;}header,footer{display:flex;gap:var(--size-1);height:auto;justify-content:center;align-items:center;padding:var(--size-1)}footer svg{width:var(--size-5);height:var(--size-5)}footer{font-size:var(--scale-fluid-000);.settings{padding:0 var(--size-1);text-decoration:none;background-color:var(--pos-background-color);border:1px solid var(--pos-secondary-border-color);color:var(--pos-secondary-border-color);border-radius:var(--radius-xs);&:hover{background-color:var(--pos-secondary-border-color);color:var(--pos-background-color)}}}header{flex-wrap:nowrap;padding:var(--size-1) var(--size-8)}main{flex:1;max-height:100vh;overflow:auto}@media (max-width: 640px){header{padding:var(--size-1);justify-content:space-between}footer{display:none}}";const Zt=class{constructor(t){e(this,t)}render(){return t(i,{key:"85981cd25e72748708030d8e084c6b8024aae9b3"},x.state.isLoggedIn?t(Qt,{profile:x.state.profile}):[t("pos-getting-started",null),t("pos-example-resources",null)])}},Qt=({profile:e})=>{const i=e.getPublicTypeIndex(),r=e.getPrivateTypeIndex();return[t("pos-example-resources",null),i?t("div",{class:"card"},t("h2",null,"Your public things"),t("pos-type-index-entries",{uri:i})):null,r?t("div",{class:"card"},t("h2",null,"Your private things"),t("pos-type-index-entries",{uri:r})):null]};Zt.style=":host{display:grid;grid-template-columns:repeat(auto-fit, minmax(var(--size-12), var(--size-96)));gap:var(--size-4);padding:var(--size-2);justify-content:center;align-items:start;justify-items:stretch}.card{border:var(--size-px) solid var(--pos-border-color);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);padding:var(--size-8);max-width:var(--size-96);background:var(--pos-card-background)}";const ei=class{constructor(t){e(this,t)}render(){return t("pos-setting-offline-cache",{key:"a5f139aaeb3e290af4c72a4976c994b693ef0736"})}};ei.style=":host{display:grid;grid-template-columns:repeat(auto-fit, minmax(var(--size-12), var(--size-96)));gap:var(--size-4);padding:var(--size-2);justify-content:center;align-items:start;justify-items:stretch}";const ti=class{constructor(t){e(this,t),this.subscribeResource=r(this,"pod-os:resource",7),this.receiveResource=e=>{this.resource=e}}componentWillLoad(){$(this)}render(){return this.resource?this.resource.description():null}},ii=class{constructor(t){e(this,t)}async showModal(){this.dialog.showModal()}async close(){this.dialog.close()}render(){return t(i,{key:"dfce1d10a4d819888a37585cb83221e24da02033"},t("dialog",{key:"12eac20d03a70b67fa42ab2d8d438c389441d93b",ref:e=>this.dialog=e},t("header",{key:"b853bda833644cb757853e26f4f2f8cd2d4a8538"},t("slot",{key:"0d100ed81b8820851efe138930fadf6790ebfaf0",name:"title"}),t("button",{key:"879a24dfb4df55098821ac743d1578583b99906c",tabindex:-1,id:"close",title:"Close",onClick:()=>this.close()},t("sl-icon",{key:"3657f354064cbddad0327a59634a15515b707849",name:"x"}))),t("slot",{key:"870521255a4c4c741bb76cb323ff75fd5ab90b2c",name:"content"})))}};ii.style="dialog{background-color:var(--pos-background-color);color:var(--pos-normal-text-color);border:none;border-radius:var(--radius-md);box-shadow:var(--shadow-md);max-width:var(--width-xs);animation:slideIn 0.2s ease-out}dialog::backdrop{background:rgba(0, 0, 0, 0.5);backdrop-filter:var(--blur-sm);animation:fadeIn 0.2s ease-out}@media (prefers-color-scheme: dark){dialog::backdrop{background:rgb(100, 100, 100, 0.5)}}dialog header>:first-child{flex-grow:1;font-weight:var(--weight-light);font-size:var(--scale-2);font-family:var(--font-sans);margin:0}dialog header{display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:var(--scale-0);border-bottom-style:inset;padding:0 0 var(--scale-0) 0}dialog>:last-child{display:block;margin-top:var(--scale-3)}button#close{cursor:pointer;display:flex;align-items:center;justify-content:center;border:none;background:none;font-size:var(--scale-3);color:var(--color-grey-500)}button#close:hover{color:var(--pos-secondary-border-color)}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes slideIn{from{opacity:0;transform:translateY(-20px) scale(0.95)}to{opacity:1;transform:translateY(0) scale(1)}}";var ri=n`
109
+ :host {
110
+ display: inline-block;
111
+ color: var(--sl-color-neutral-600);
112
+ }
113
+
114
+ .icon-button {
115
+ flex: 0 0 auto;
116
+ display: flex;
117
+ align-items: center;
118
+ background: none;
119
+ border: none;
120
+ border-radius: var(--sl-border-radius-medium);
121
+ font-size: inherit;
122
+ color: inherit;
123
+ padding: var(--sl-spacing-x-small);
124
+ cursor: pointer;
125
+ transition: var(--sl-transition-x-fast) color;
126
+ -webkit-appearance: none;
127
+ }
128
+
129
+ .icon-button:hover:not(.icon-button--disabled),
130
+ .icon-button:focus-visible:not(.icon-button--disabled) {
131
+ color: var(--sl-color-primary-600);
132
+ }
133
+
134
+ .icon-button:active:not(.icon-button--disabled) {
135
+ color: var(--sl-color-primary-700);
136
+ }
137
+
138
+ .icon-button:focus {
139
+ outline: none;
140
+ }
141
+
142
+ .icon-button--disabled {
143
+ opacity: 0.5;
144
+ cursor: not-allowed;
145
+ }
146
+
147
+ .icon-button:focus-visible {
148
+ outline: var(--sl-focus-ring);
149
+ outline-offset: var(--sl-focus-ring-offset);
150
+ }
151
+
152
+ .icon-button__icon {
153
+ pointer-events: none;
154
+ }
155
+ `
156
+ /**
157
+ * @license
158
+ * Copyright 2020 Google LLC
159
+ * SPDX-License-Identifier: BSD-3-Clause
160
+ */;const oi=Symbol.for(""),si=e=>{if(e?.r===oi)return e?._$litStatic$},ai=(e,...t)=>({_$litStatic$:t.reduce(((t,i,r)=>t+(e=>{if(void 0!==e._$litStatic$)return e._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${e}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(i)+e[r+1]),e[0]),r:oi}),ni=new Map,li=(e=>(t,...i)=>{const r=i.length;let o,s;const a=[],n=[];let l,d=0,p=!1;for(;d<r;){for(l=t[d];d<r&&void 0!==(s=i[d],o=si(s));)l+=o+t[++d],p=!0;d!==r&&n.push(s),a.push(l),d++}if(d===r&&a.push(t[r]),p){const e=a.join("$$lit$$");void 0===(t=ni.get(e))&&(a.raw=a,ni.set(e,t=a)),i=n}return e(t,...i)})(f);var di=class extends u{constructor(){super(...arguments),this.hasFocus=!1,this.label="",this.disabled=!1}handleBlur(){this.hasFocus=!1,this.emit("sl-blur")}handleFocus(){this.hasFocus=!0,this.emit("sl-focus")}handleClick(e){this.disabled&&(e.preventDefault(),e.stopPropagation())}click(){this.button.click()}focus(e){this.button.focus(e)}blur(){this.button.blur()}render(){const e=!!this.href,t=e?ai`a`:ai`button`;return li`
161
+ <${t}
162
+ part="base"
163
+ class=${O({"icon-button":!0,"icon-button--disabled":!e&&this.disabled,"icon-button--focused":this.hasFocus})}
164
+ ?disabled=${Ht(e?void 0:this.disabled)}
165
+ type=${Ht(e?void 0:"button")}
166
+ href=${Ht(e?this.href:void 0)}
167
+ target=${Ht(e?this.target:void 0)}
168
+ download=${Ht(e?this.download:void 0)}
169
+ rel=${Ht(e&&this.target?"noreferrer noopener":void 0)}
170
+ role=${Ht(e?void 0:"button")}
171
+ aria-disabled=${this.disabled?"true":"false"}
172
+ aria-label="${this.label}"
173
+ tabindex=${this.disabled?"-1":"0"}
174
+ @blur=${this.handleBlur}
175
+ @focus=${this.handleFocus}
176
+ @click=${this.handleClick}
177
+ >
178
+ <sl-icon
179
+ class="icon-button__icon"
180
+ name=${Ht(this.name)}
181
+ library=${Ht(this.library)}
182
+ src=${Ht(this.src)}
183
+ aria-hidden="true"
184
+ ></sl-icon>
185
+ </${t}>
186
+ `}};di.styles=[p,ri],di.dependencies={"sl-icon":m},h([z(".icon-button")],di.prototype,"button",2),h([b()],di.prototype,"hasFocus",2),h([c()],di.prototype,"name",2),h([c()],di.prototype,"library",2),h([c()],di.prototype,"src",2),h([c()],di.prototype,"href",2),h([c()],di.prototype,"target",2),h([c()],di.prototype,"download",2),h([c()],di.prototype,"label",2),h([c({type:Boolean,reflect:!0})],di.prototype,"disabled",2);var pi=class{constructor(e,...t){this.slotNames=[],this.handleSlotChange=e=>{const t=e.target;(this.slotNames.includes("[default]")&&!t.name||t.name&&this.slotNames.includes(t.name))&&this.host.requestUpdate()},(this.host=e).addController(this),this.slotNames=t}hasDefaultSlot(){return[...this.host.childNodes].some((e=>{if(e.nodeType===e.TEXT_NODE&&""!==e.textContent.trim())return!0;if(e.nodeType===e.ELEMENT_NODE){const t=e;if("sl-visually-hidden"===t.tagName.toLowerCase())return!1;if(!t.hasAttribute("slot"))return!0}return!1}))}hasNamedSlot(e){return null!==this.host.querySelector(`:scope > [slot="${e}"]`)}test(e){return"[default]"===e?this.hasDefaultSlot():this.hasNamedSlot(e)}hostConnected(){this.host.shadowRoot.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){this.host.shadowRoot.removeEventListener("slotchange",this.handleSlotChange)}},hi=n`
187
+ :host {
188
+ display: contents;
189
+
190
+ /* For better DX, we'll reset the margin here so the base part can inherit it */
191
+ margin: 0;
192
+ }
193
+
194
+ .alert {
195
+ position: relative;
196
+ display: flex;
197
+ align-items: stretch;
198
+ background-color: var(--sl-panel-background-color);
199
+ border: solid var(--sl-panel-border-width) var(--sl-panel-border-color);
200
+ border-top-width: calc(var(--sl-panel-border-width) * 3);
201
+ border-radius: var(--sl-border-radius-medium);
202
+ font-family: var(--sl-font-sans);
203
+ font-size: var(--sl-font-size-small);
204
+ font-weight: var(--sl-font-weight-normal);
205
+ line-height: 1.6;
206
+ color: var(--sl-color-neutral-700);
207
+ margin: inherit;
208
+ overflow: hidden;
209
+ }
210
+
211
+ .alert:not(.alert--has-icon) .alert__icon,
212
+ .alert:not(.alert--closable) .alert__close-button {
213
+ display: none;
214
+ }
215
+
216
+ .alert__icon {
217
+ flex: 0 0 auto;
218
+ display: flex;
219
+ align-items: center;
220
+ font-size: var(--sl-font-size-large);
221
+ padding-inline-start: var(--sl-spacing-large);
222
+ }
223
+
224
+ .alert--has-countdown {
225
+ border-bottom: none;
226
+ }
227
+
228
+ .alert--primary {
229
+ border-top-color: var(--sl-color-primary-600);
230
+ }
231
+
232
+ .alert--primary .alert__icon {
233
+ color: var(--sl-color-primary-600);
234
+ }
235
+
236
+ .alert--success {
237
+ border-top-color: var(--sl-color-success-600);
238
+ }
239
+
240
+ .alert--success .alert__icon {
241
+ color: var(--sl-color-success-600);
242
+ }
243
+
244
+ .alert--neutral {
245
+ border-top-color: var(--sl-color-neutral-600);
246
+ }
247
+
248
+ .alert--neutral .alert__icon {
249
+ color: var(--sl-color-neutral-600);
250
+ }
251
+
252
+ .alert--warning {
253
+ border-top-color: var(--sl-color-warning-600);
254
+ }
255
+
256
+ .alert--warning .alert__icon {
257
+ color: var(--sl-color-warning-600);
258
+ }
259
+
260
+ .alert--danger {
261
+ border-top-color: var(--sl-color-danger-600);
262
+ }
263
+
264
+ .alert--danger .alert__icon {
265
+ color: var(--sl-color-danger-600);
266
+ }
267
+
268
+ .alert__message {
269
+ flex: 1 1 auto;
270
+ display: block;
271
+ padding: var(--sl-spacing-large);
272
+ overflow: hidden;
273
+ }
274
+
275
+ .alert__close-button {
276
+ flex: 0 0 auto;
277
+ display: flex;
278
+ align-items: center;
279
+ font-size: var(--sl-font-size-medium);
280
+ margin-inline-end: var(--sl-spacing-medium);
281
+ align-self: center;
282
+ }
283
+
284
+ .alert__countdown {
285
+ position: absolute;
286
+ bottom: 0;
287
+ left: 0;
288
+ width: 100%;
289
+ height: calc(var(--sl-panel-border-width) * 3);
290
+ background-color: var(--sl-panel-border-color);
291
+ display: flex;
292
+ }
293
+
294
+ .alert__countdown--ltr {
295
+ justify-content: flex-end;
296
+ }
297
+
298
+ .alert__countdown .alert__countdown-elapsed {
299
+ height: 100%;
300
+ width: 0;
301
+ }
302
+
303
+ .alert--primary .alert__countdown-elapsed {
304
+ background-color: var(--sl-color-primary-600);
305
+ }
306
+
307
+ .alert--success .alert__countdown-elapsed {
308
+ background-color: var(--sl-color-success-600);
309
+ }
310
+
311
+ .alert--neutral .alert__countdown-elapsed {
312
+ background-color: var(--sl-color-neutral-600);
313
+ }
314
+
315
+ .alert--warning .alert__countdown-elapsed {
316
+ background-color: var(--sl-color-warning-600);
317
+ }
318
+
319
+ .alert--danger .alert__countdown-elapsed {
320
+ background-color: var(--sl-color-danger-600);
321
+ }
322
+
323
+ .alert__timer {
324
+ display: none;
325
+ }
326
+ `,ci=class e extends u{constructor(){super(...arguments),this.hasSlotController=new pi(this,"icon","suffix"),this.localize=new P(this),this.open=!1,this.closable=!1,this.variant="primary",this.duration=1/0,this.remainingTime=this.duration}static get toastStack(){return this.currentToastStack||(this.currentToastStack=Object.assign(document.createElement("div"),{className:"sl-toast-stack"})),this.currentToastStack}firstUpdated(){this.base.hidden=!this.open}restartAutoHide(){this.handleCountdownChange(),clearTimeout(this.autoHideTimeout),clearInterval(this.remainingTimeInterval),this.open&&this.duration<1/0&&(this.autoHideTimeout=window.setTimeout((()=>this.hide()),this.duration),this.remainingTime=this.duration,this.remainingTimeInterval=window.setInterval((()=>{this.remainingTime-=100}),100))}pauseAutoHide(){var e;null==(e=this.countdownAnimation)||e.pause(),clearTimeout(this.autoHideTimeout),clearInterval(this.remainingTimeInterval)}resumeAutoHide(){var e;this.duration<1/0&&(this.autoHideTimeout=window.setTimeout((()=>this.hide()),this.remainingTime),this.remainingTimeInterval=window.setInterval((()=>{this.remainingTime-=100}),100),null==(e=this.countdownAnimation)||e.play())}handleCountdownChange(){if(this.open&&this.duration<1/0&&this.countdown){const{countdownElement:e}=this;this.countdownAnimation=e.animate([{width:"100%"},{width:"0"}],{duration:this.duration,easing:"linear"})}}handleCloseClick(){this.hide()}async handleOpenChange(){if(this.open){this.emit("sl-show"),this.duration<1/0&&this.restartAutoHide(),await T(this.base),this.base.hidden=!1;const{keyframes:e,options:t}=A(this,"alert.show",{dir:this.localize.dir()});await E(this.base,e,t),this.emit("sl-after-show")}else{(e=>{var t;const{activeElement:i}=document;i&&e.contains(i)&&(null==(t=document.activeElement)||t.blur())})(this),this.emit("sl-hide"),clearTimeout(this.autoHideTimeout),clearInterval(this.remainingTimeInterval),await T(this.base);const{keyframes:e,options:t}=A(this,"alert.hide",{dir:this.localize.dir()});await E(this.base,e,t),this.base.hidden=!0,this.emit("sl-after-hide")}}handleDurationChange(){this.restartAutoHide()}async show(){if(!this.open)return this.open=!0,_(this,"sl-after-show")}async hide(){if(this.open)return this.open=!1,_(this,"sl-after-hide")}async toast(){return new Promise((t=>{this.handleCountdownChange(),null===e.toastStack.parentElement&&document.body.append(e.toastStack),e.toastStack.appendChild(this),requestAnimationFrame((()=>{this.show()})),this.addEventListener("sl-after-hide",(()=>{e.toastStack.removeChild(this),t(),null===e.toastStack.querySelector("sl-alert")&&e.toastStack.remove()}),{once:!0})}))}render(){return f`
327
+ <div
328
+ part="base"
329
+ class=${O({alert:!0,"alert--open":this.open,"alert--closable":this.closable,"alert--has-countdown":!!this.countdown,"alert--has-icon":this.hasSlotController.test("icon"),"alert--primary":"primary"===this.variant,"alert--success":"success"===this.variant,"alert--neutral":"neutral"===this.variant,"alert--warning":"warning"===this.variant,"alert--danger":"danger"===this.variant})}
330
+ role="alert"
331
+ aria-hidden=${this.open?"false":"true"}
332
+ @mouseenter=${this.pauseAutoHide}
333
+ @mouseleave=${this.resumeAutoHide}
334
+ >
335
+ <div part="icon" class="alert__icon">
336
+ <slot name="icon"></slot>
337
+ </div>
338
+
339
+ <div part="message" class="alert__message" aria-live="polite">
340
+ <slot></slot>
341
+ </div>
342
+
343
+ ${this.closable?f`
344
+ <sl-icon-button
345
+ part="close-button"
346
+ exportparts="base:close-button__base"
347
+ class="alert__close-button"
348
+ name="x-lg"
349
+ library="system"
350
+ label=${this.localize.term("close")}
351
+ @click=${this.handleCloseClick}
352
+ ></sl-icon-button>
353
+ `:""}
354
+
355
+ <div role="timer" class="alert__timer">${this.remainingTime}</div>
356
+
357
+ ${this.countdown?f`
358
+ <div
359
+ class=${O({alert__countdown:!0,"alert__countdown--ltr":"ltr"===this.countdown})}
360
+ >
361
+ <div class="alert__countdown-elapsed"></div>
362
+ </div>
363
+ `:""}
364
+ </div>
365
+ `}};ci.styles=[p,hi],ci.dependencies={"sl-icon-button":di},h([z('[part~="base"]')],ci.prototype,"base",2),h([z(".alert__countdown-elapsed")],ci.prototype,"countdownElement",2),h([c({type:Boolean,reflect:!0})],ci.prototype,"open",2),h([c({type:Boolean,reflect:!0})],ci.prototype,"closable",2),h([c({reflect:!0})],ci.prototype,"variant",2),h([c({type:Number})],ci.prototype,"duration",2),h([c({type:String,reflect:!0})],ci.prototype,"countdown",2),h([b()],ci.prototype,"remainingTime",2),h([y("open",{waitUntilFirstUpdate:!0})],ci.prototype,"handleOpenChange",1),h([y("duration")],ci.prototype,"handleDurationChange",1);var ui=ci;F("alert.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:250,easing:"ease"}}),F("alert.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:250,easing:"ease"}}),ui.define("sl-alert");const fi=class{constructor(t){e(this,t)}async unhandledRejection(e){e.stopPropagation(),console.error("unhandled promise rejection",e),this.title="Unhandled promise rejection",this.message=e.reason.toString()}async catchError(e){if(e.stopPropagation(),console.error(e.detail),e.detail instanceof Error)this.title="Error",this.message=e.detail.message;else{const t=e.detail;this.title=t.title,this.message=t.detail}await this.alert.toast()}render(){return t(i,{key:"a2c2db82c085541f2912861ff715633c1a50872e"},t("sl-alert",{key:"af7e56dacdd8c2cdacfe4eb5020d59e8111e9947",ref:e=>this.alert=e,variant:"danger",duration:"10000",closable:!0},t("sl-icon",{key:"f50b8c321b0844c2f3cac2886f23b758e18500b1",slot:"icon",name:"exclamation-octagon"}),t("strong",{key:"0f7c7880b08366a16baaa1385df12614d6a6cddf"},this.title),t("br",{key:"5660dbabfa1162590b386087231301ee3920a415"}),this.message),t("slot",{key:"671026ea140044dfbeb63dee5c08a65591464668"}))}},mi=class{constructor(t){e(this,t)}render(){return t(i,{key:"edfbfc18bef5794e03385a6712cd6301b9f7fb56"},t("div",{key:"cb211969daa03f9377b9cc91d32983305d8efc8f"},t("h2",{key:"df34f7358c8b232d6d4874069c3a93491332589e"},"Try these... 💡"),t("p",{key:"512f37a9d3ba9f7492ab1770472732d3027751d4"},"No idea where to start? Try these example resources, and follow your nose 👃"),t("div",{key:"70c3dd35ffb296cfa535df0e74a1142c825d24a2",class:"links"},t("pos-rich-link",{key:"441945b22665c8688efb69bdb90fb61c13e41192",uri:"https://pod-os.solidcommunity.net/profile/card#me"}),t("pos-rich-link",{key:"d159b08661afd4c3dcc1d305f51c0a71dd8d1556",uri:"https://angelo.veltens.org/profile/card#me"}),t("pos-rich-link",{key:"82bf392405f612530d5de60d93e2201fae53f8fd",uri:"https://angelo.veltens.org/public/bookmarks"}),t("pos-rich-link",{key:"6f2151ad44f7659e723cb31f33b1a26170fbe37b",uri:"https://solidos.solidcommunity.net/profile/card#me"}))))}};mi.style=":host{border:var(--size-px) solid var(--pos-border-color);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);padding:var(--size-8);max-width:var(--size-96);background:var(--pos-card-background)}.links{display:flex;flex-direction:column;gap:var(--size-3);max-width:80vw}";const bi=class{constructor(t){e(this,t),this.login=r(this,"pod-os:login",7)}render(){return t(i,{key:"7486f4d04e3b7bd341fd2d9c02b85360079c5d5a"},t("div",{key:"710c84685022c9a55c821a421642cbff24c7ba5a"},t("h2",{key:"f01aa189a05ea101c61eecdc68d6fa1db9fefbb3"},"Getting started 🚀"),t("p",{key:"0e3320c4297a3438b2cdda02e27f0517a0ac2a85"},"🔎 Enter a URL into the above navigation bar to browse through the web of data. "),t("p",{key:"f99d218c35b6aa698bba807dc0f3b272ecd81416"},"🔐"," ",t("button",{key:"7091693cc439ddb12f35ef2f3be54f649c47e4ce",class:"login",onClick:()=>this.login.emit()},"Sign in")," ","to access private resources on your Solid Pod or those of your friends or coworkers.")),t("div",{key:"643c46009b4a962548ac501b3bca912a5163f4d3"},t("p",{key:"7fb4a75e5eb6f55a6b8d25825b39f8f82bcadeb9",class:"question"},"New to Solid?"),t("p",{key:"e7dd87fc055ad8981f28f00eb29a65c9e67f7a96"},t("a",{key:"1ad84ef46c7320e4adbb1ce573a8c6b97f60b8ec",href:"https://solidproject.org/for-developers#hosted-pod-services"},"Get a Pod →"))),t("div",{key:"bf50fd05a28e6536aae13cd6c7245c4b487850a6"},t("p",{key:"911eec270cee7a1dcc40320fb43298ad61b01206",class:"question"},"Want to dig deeper into PodOS?"),t("p",{key:"d1f7f4215577f50f1186b48ea0d48670eee53c22"},t("a",{key:"18c487f6e1ea48289654005286816b18e741c8a0",href:"http://pod-os.org"},"Learn more →"))))}};bi.style=":host{border:var(--size-px) solid var(--pos-border-color);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);padding:var(--size-8);max-width:var(--size-96);background:var(--pos-card-background)}.question{font-weight:var(--weight-semibold)}a{font-weight:var(--weight-bold);color:var(--pos-primary-color)}button.login{background:none;color:var(--pos-primary-color);display:inline;text-decoration:underline;border:none;padding:0;margin:0;cursor:pointer;font-size:unset}";const yi=class{constructor(t){e(this,t),this.initializeOsEmitter=r(this,"pod-os:init",7),this.resourceLoadedEmitter=r(this,"pod-os:resource-loaded",7),this.blurredBackground=!1,this.loading=!0,this.setOs=async e=>{this.os=e}}componentWillLoad(){x.onChange("isLoggedIn",(()=>this.fetchBlob())),this.initializeOsEmitter.emit(this.setOs)}async fetchBlob(){try{this.loading=!0,this.imageError=null,this.networkError=null,this.brokenFile=null;const e=await this.os.files().fetchFile(this.src);this.resourceLoadedEmitter.emit(this.src),e.blob()?this.dataUri=URL.createObjectURL(e.blob()):this.brokenFile=e}catch(e){this.networkError=e}finally{this.loading=!1}}onImageError(e){this.networkError=null,this.imageError=e}render(){return this.loading?t("sl-skeleton",{effect:"sheen"}):this.networkError?t("img",{alt:this.alt,src:this.src,onError:e=>this.onImageError(e)}):this.brokenFile?t(k,{file:this.brokenFile}):this.imageError?t("div",{class:"error"},t("a",{href:this.src},this.src)):t(i,{style:{backgroundImage:this.blurredBackground?`url('${this.dataUri}')`:null}},t("img",{src:this.dataUri,alt:this.alt}))}static get watchers(){return{os:[{fetchBlob:0}],src:[{fetchBlob:0}]}}};yi.style=":host{display:flex;background-size:cover;background-repeat:no-repeat;background-position:center;border-radius:inherit}img,div.error{border-radius:var(--border-radius);width:var(--width);height:var(--height);max-width:var(--max-width);max-height:var(--max-height);object-fit:var(--object-fit)}img{backdrop-filter:var(--blur-xl)}.error{display:flex;opacity:0.8;background:repeating-linear-gradient(-45deg, rgba(150, 0, 0, 0.1), rgba(150, 0, 0, 0.1) 10px, #fff 5px, #fff 25px);flex-direction:column;border:1px solid red;color:black;align-items:center;justify-content:center;word-break:break-all;padding:1rem;box-sizing:border-box}.error sl-icon{color:#282828;font-size:calc(var(--width) / 2)}a.error{text-decoration:none;width:var(--width);height:var(--height)}.code{font-weight:bold;font-size:calc(var(--width) / 8)}.text{font-size:calc(var(--width) / 20)}sl-skeleton{--border-radius:inherit;width:var(--width);height:var(--height);max-width:var(--max-width);max-height:var(--max-height);aspect-ratio:16 / 9}";const gi=class{constructor(t){e(this,t),this.uri="pod-os:dashboard"}render(){return t("pod-os:settings"===this.uri?"pos-app-settings":"pos-app-dashboard",null)}},vi=class{constructor(t){e(this,t),this.subscribeResource=r(this,"pod-os:resource",7),this.receiveResource=e=>{this.resource=e}}componentWillLoad(){$(this)}render(){return this.resource?this.resource.label():null}},wi=class{constructor(t){e(this,t),this.initializeOsEmitter=r(this,"pod-os:init",7),this.customLoggedInComponent=!1,this.setOs=async e=>{this.os=e}}componentWillLoad(){this.customLoggedInComponent=!!this.host.querySelector('[slot="if-logged-in"]'),this.initializeOsEmitter.emit(this.setOs)}login(e){this.os.login(e.detail)}logout(){this.os.logout()}onLogin(){this.openDialog()}openDialog(){this.dialog.showModal()}render(){return t(i,{key:"9c0cb63442db7acea4e60b09528bf4fc25afe2de"},t("div",{key:"ca56c2b730f371da27c1ac0a465a45d87071722f",class:"container"},x.state.isLoggedIn?this.loggedInComponents():t("button",{id:"login",onClick:()=>this.openDialog()},"Login")),t("pos-dialog",{key:"97b7d80acd6b57980641f189e3c2a67e8e45df44",ref:e=>this.dialog=e},t("span",{key:"3296c22755474e139546491890a5cc35c7a07be9",slot:"title"},"Sign in to your Pod"),t("pos-login-form",{key:"cb68b44a0a7541c116d3711c3ce8d0141515e815","onPod-os:idp-url-selected":e=>this.login(e),slot:"content"})))}loggedInComponents(){return this.customLoggedInComponent?t("slot",{name:"if-logged-in"}):this.defaultLoggedInComponents()}defaultLoggedInComponents(){return[t("pos-resource",{uri:x.state.webId},t("span",{class:"user-data"},t("pos-picture",{"no-upload":!0}),t("pos-label",null))),t("button",{id:"logout",onClick:()=>this.logout()},"Logout")]}get host(){return o(this)}};wi.style=".container{display:flex;align-items:center;gap:var(--size-2)}.user-data{align-items:center;display:inline-flex;gap:10px}.user-data pos-picture{--width:40px;--height:40px;--border-radius:50%}pos-login-form{margin:var(--size-2)}dialog{margin-top:var(--size-10)}button#login,button#logout{outline:none;font-weight:var(--weight-bold);letter-spacing:var(--letter-xl);border:none;box-sizing:border-box;border-radius:var(--radius-xs);padding:var(--size-2);box-shadow:var(--shadow-sm);color:var(--pos-primary-text-color);background-color:var(--pos-primary-color)}button#login:focus-within,button#logout:focus-within{outline:var(--pos-input-focus-outline)}button#login:focus,button#login:hover,button#logout:focus,button#logout:hover{filter:brightness(110%);box-shadow:var(--shadow-md)}";const xi=class{constructor(t){e(this,t),this.idpUrlSelected=r(this,"pod-os:idp-url-selected",7),this.idpUrl="",this.canSubmit=!1}validate(){this.canSubmit=Boolean(this.idpUrl)}render(){return t("form",{key:"15b515887ebceff9ed2adb03f05e4725d5b1d4da",method:"dialog",onSubmit:()=>this.handleSubmit()},t("label",{key:"2278fd2cd0629dfc8d0bc3dc1c10223383131e15",htmlFor:"idpUrl"},"Please enter your Identity Provider"),t("input",{key:"2e63bb5aa1d16393abd46d042fd78a8e70dbc476",id:"idpUrl",type:"url",value:this.idpUrl,required:!0,onInput:e=>this.handleChange(e),list:"suggestedIssuers",placeholder:"Type to search..."}),t("datalist",{key:"16de93f77ee4f756c76fd5e58d84cf8a96b7fafb",id:"suggestedIssuers"},t("option",{key:"c6612878e0dc7be06ba9c88266ba746cc41bbcbd",value:"https://solidcommunity.net/"},"solidcommunity.net"),t("option",{key:"c93e6a9e2cad61c5247a048a4261079daca2655d",value:"https://solidweb.me/"},"solidweb.me"),t("option",{key:"d051f96a34bafa0d8c55e0ea1b9bfc7a5eb4f59a",value:"https://login.inrupt.com"},"Inrupt PodSpaces"),t("option",{key:"c793826a68676e176714898363ad06daa023a2f3",value:"https://trinpod.us"},"trinpod.us"),t("option",{key:"8ed729faba2a6c7b9fbc53d96511ec4ebc0db340",value:"https://trinpod.eu"},"trinpod.eu"),t("option",{key:"e683f8901b359e8bf82cb3e6d196817ac1150134",value:"https://solid.redpencil.io/"},"redpencil.io"),t("option",{key:"ddbad19605db043fc6f19ca5d4fc7bfd1d96b743",value:"https://teamid.live/"},"teamid.live")),t("input",{key:"ac9ebfdcfe6e1053fde4f890abd3e1183621060c",id:"login",type:"submit",value:"Login",disabled:!this.canSubmit}))}handleChange(e){this.validate(),this.idpUrl=e.target.value}async handleSubmit(){this.idpUrlSelected.emit(this.idpUrl)}static get delegatesFocus(){return!0}static get watchers(){return{idpUrl:[{validate:0}]}}};xi.style=":host{display:block;margin:0}form{display:flex;flex-direction:column;gap:var(--size-4)}input{outline:var(--pos-input-outline);padding:var(--scale-000);border:none;border-radius:var(--radius-xs);width:var(--size-full);box-sizing:border-box;background:var(--pos-input-background-color);color:var(--pos-normal-text-color)}input:focus-within{outline:var(--pos-input-focus-outline)}input#login{outline:none;box-shadow:var(--shadow-sm);cursor:pointer;color:var(--pos-primary-text-color);background-color:var(--pos-primary-color)}input#login:disabled{cursor:default;color:var(--pos-disabled-text-color);background-color:var(--pos-disabled-color);box-shadow:none}input#login:hover:not(:disabled),input#login:focus{filter:brightness(110%);box-shadow:var(--shadow-md)}";var ki=n`
366
+ :host {
367
+ display: inline-block;
368
+ }
369
+
370
+ .dropdown::part(popup) {
371
+ z-index: var(--sl-z-index-dropdown);
372
+ }
373
+
374
+ .dropdown[data-current-placement^='top']::part(popup) {
375
+ transform-origin: bottom;
376
+ }
377
+
378
+ .dropdown[data-current-placement^='bottom']::part(popup) {
379
+ transform-origin: top;
380
+ }
381
+
382
+ .dropdown[data-current-placement^='left']::part(popup) {
383
+ transform-origin: right;
384
+ }
385
+
386
+ .dropdown[data-current-placement^='right']::part(popup) {
387
+ transform-origin: left;
388
+ }
389
+
390
+ .dropdown__trigger {
391
+ display: block;
392
+ }
393
+
394
+ .dropdown__panel {
395
+ font-family: var(--sl-font-sans);
396
+ font-size: var(--sl-font-size-medium);
397
+ font-weight: var(--sl-font-weight-normal);
398
+ box-shadow: var(--sl-shadow-large);
399
+ border-radius: var(--sl-border-radius-medium);
400
+ pointer-events: none;
401
+ }
402
+
403
+ .dropdown--open .dropdown__panel {
404
+ display: block;
405
+ pointer-events: all;
406
+ }
407
+
408
+ /* When users slot a menu, make sure it conforms to the popup's auto-size */
409
+ ::slotted(sl-menu) {
410
+ max-width: var(--auto-size-available-width) !important;
411
+ max-height: var(--auto-size-available-height) !important;
412
+ }
413
+ `;function*Si(e=document.activeElement){null!=e&&(yield e,"shadowRoot"in e&&e.shadowRoot&&"closed"!==e.shadowRoot.mode&&(yield*g(Si(e.shadowRoot.activeElement))))}var Di=new WeakMap;function Ii(e){let t=Di.get(e);return t||(t=window.getComputedStyle(e,null),Di.set(e,t)),t}function Ci(e){var t,i;const r=function(e){const t=new WeakMap,i=[];return function r(o){if(o instanceof Element){if(o.hasAttribute("inert")||o.closest("[inert]"))return;if(t.has(o))return;t.set(o,!0),!i.includes(o)&&function(e){const t=e.tagName.toLowerCase(),i=Number(e.getAttribute("tabindex"));if(e.hasAttribute("tabindex")&&(isNaN(i)||i<=-1))return!1;if(e.hasAttribute("disabled"))return!1;if(e.closest("[inert]"))return!1;if("input"===t&&"radio"===e.getAttribute("type")){const t=e.getRootNode(),i=`input[type='radio'][name="${e.getAttribute("name")}"]`,r=t.querySelector(`${i}:checked`);return r?r===e:t.querySelector(i)===e}return!!function(e){if("function"==typeof e.checkVisibility)return e.checkVisibility({checkOpacity:!1,checkVisibilityCSS:!0});const t=Ii(e);return"hidden"!==t.visibility&&"none"!==t.display}(e)&&(!("audio"!==t&&"video"!==t||!e.hasAttribute("controls"))||!!e.hasAttribute("tabindex")||!(!e.hasAttribute("contenteditable")||"false"===e.getAttribute("contenteditable"))||!!["button","input","select","textarea","a","audio","video","summary","iframe"].includes(t)||function(e){const t=Ii(e),{overflowY:i,overflowX:r}=t;return"scroll"===i||"scroll"===r||"auto"===i&&"auto"===r&&(e.scrollHeight>e.clientHeight&&"auto"===i||!(!(e.scrollWidth>e.clientWidth)||"auto"!==r))}(e))}(o)&&i.push(o),o instanceof HTMLSlotElement&&function(e,t){var i;return(null==(i=e.getRootNode({composed:!0}))?void 0:i.host)!==t}(o,e)&&o.assignedElements({flatten:!0}).forEach((e=>{r(e)})),null!==o.shadowRoot&&"open"===o.shadowRoot.mode&&r(o.shadowRoot)}for(const e of o.children)r(e)}(e),i.sort(((e,t)=>{const i=Number(e.getAttribute("tabindex"))||0;return(Number(t.getAttribute("tabindex"))||0)-i}))}(e);return{start:null!=(t=r[0])?t:null,end:null!=(i=r[r.length-1])?i:null}}var Bi=class extends u{constructor(){super(...arguments),this.localize=new P(this),this.open=!1,this.placement="bottom-start",this.disabled=!1,this.stayOpenOnSelect=!1,this.distance=0,this.skidding=0,this.hoist=!1,this.sync=void 0,this.handleKeyDown=e=>{this.open&&"Escape"===e.key&&(e.stopPropagation(),this.hide(),this.focusOnTrigger())},this.handleDocumentKeyDown=e=>{var t;if("Escape"===e.key&&this.open&&!this.closeWatcher)return e.stopPropagation(),this.focusOnTrigger(),void this.hide();if("Tab"===e.key){if(this.open&&"sl-menu-item"===(null==(t=document.activeElement)?void 0:t.tagName.toLowerCase()))return e.preventDefault(),this.hide(),void this.focusOnTrigger();const i=(e,t)=>{if(!e)return null;const r=e.closest(t);if(r)return r;const o=e.getRootNode();return o instanceof ShadowRoot?i(o.host,t):null};setTimeout((()=>{var e;const t=(null==(e=this.containingElement)?void 0:e.getRootNode())instanceof ShadowRoot?[...Si()].pop():document.activeElement;this.containingElement&&i(t,this.containingElement.tagName.toLowerCase())===this.containingElement||this.hide()}))}},this.handleDocumentMouseDown=e=>{const t=e.composedPath();this.containingElement&&!t.includes(this.containingElement)&&this.hide()},this.handlePanelSelect=e=>{this.stayOpenOnSelect||"sl-menu"!==e.target.tagName.toLowerCase()||(this.hide(),this.focusOnTrigger())}}connectedCallback(){super.connectedCallback(),this.containingElement||(this.containingElement=this)}firstUpdated(){this.panel.hidden=!this.open,this.open&&(this.addOpenListeners(),this.popup.active=!0)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.hide()}focusOnTrigger(){const e=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof(null==e?void 0:e.focus)&&e.focus()}getMenu(){return this.panel.assignedElements({flatten:!0}).find((e=>"sl-menu"===e.tagName.toLowerCase()))}handleTriggerClick(){this.open?this.hide():(this.show(),this.focusOnTrigger())}async handleTriggerKeyDown(e){if([" ","Enter"].includes(e.key))return e.preventDefault(),void this.handleTriggerClick();const t=this.getMenu();if(t){const i=t.getAllItems(),r=i[0],o=i[i.length-1];["ArrowDown","ArrowUp","Home","End"].includes(e.key)&&(e.preventDefault(),this.open||(this.show(),await this.updateComplete),i.length>0&&this.updateComplete.then((()=>{"ArrowDown"!==e.key&&"Home"!==e.key||(t.setCurrentItem(r),r.focus()),"ArrowUp"!==e.key&&"End"!==e.key||(t.setCurrentItem(o),o.focus())})))}}handleTriggerKeyUp(e){" "===e.key&&e.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}updateAccessibleTrigger(){const e=this.trigger.assignedElements({flatten:!0}).find((e=>Ci(e).start));let t;if(e){switch(e.tagName.toLowerCase()){case"sl-button":case"sl-icon-button":t=e.button;break;default:t=e}t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded",this.open?"true":"false")}}async show(){if(!this.open)return this.open=!0,_(this,"sl-after-show")}async hide(){if(this.open)return this.open=!1,_(this,"sl-after-hide")}reposition(){this.popup.reposition()}addOpenListeners(){var e;this.panel.addEventListener("sl-select",this.handlePanelSelect),"CloseWatcher"in window?(null==(e=this.closeWatcher)||e.destroy(),this.closeWatcher=new CloseWatcher,this.closeWatcher.onclose=()=>{this.hide(),this.focusOnTrigger()}):this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){var e;this.panel&&(this.panel.removeEventListener("sl-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown),null==(e=this.closeWatcher)||e.destroy()}async handleOpenChange(){if(this.disabled)this.open=!1;else if(this.updateAccessibleTrigger(),this.open){this.emit("sl-show"),this.addOpenListeners(),await T(this),this.panel.hidden=!1,this.popup.active=!0;const{keyframes:e,options:t}=A(this,"dropdown.show",{dir:this.localize.dir()});await E(this.popup.popup,e,t),this.emit("sl-after-show")}else{this.emit("sl-hide"),this.removeOpenListeners(),await T(this);const{keyframes:e,options:t}=A(this,"dropdown.hide",{dir:this.localize.dir()});await E(this.popup.popup,e,t),this.panel.hidden=!0,this.popup.active=!1,this.emit("sl-after-hide")}}render(){return f`
414
+ <sl-popup
415
+ part="base"
416
+ exportparts="popup:base__popup"
417
+ id="dropdown"
418
+ placement=${this.placement}
419
+ distance=${this.distance}
420
+ skidding=${this.skidding}
421
+ strategy=${this.hoist?"fixed":"absolute"}
422
+ flip
423
+ shift
424
+ auto-size="vertical"
425
+ auto-size-padding="10"
426
+ sync=${Ht(this.sync?this.sync:void 0)}
427
+ class=${O({dropdown:!0,"dropdown--open":this.open})}
428
+ >
429
+ <slot
430
+ name="trigger"
431
+ slot="anchor"
432
+ part="trigger"
433
+ class="dropdown__trigger"
434
+ @click=${this.handleTriggerClick}
435
+ @keydown=${this.handleTriggerKeyDown}
436
+ @keyup=${this.handleTriggerKeyUp}
437
+ @slotchange=${this.handleTriggerSlotChange}
438
+ ></slot>
439
+
440
+ <div aria-hidden=${this.open?"false":"true"} aria-labelledby="dropdown">
441
+ <slot part="panel" class="dropdown__panel"></slot>
442
+ </div>
443
+ </sl-popup>
444
+ `}};Bi.styles=[p,ki],Bi.dependencies={"sl-popup":M},h([z(".dropdown")],Bi.prototype,"popup",2),h([z(".dropdown__trigger")],Bi.prototype,"trigger",2),h([z(".dropdown__panel")],Bi.prototype,"panel",2),h([c({type:Boolean,reflect:!0})],Bi.prototype,"open",2),h([c({reflect:!0})],Bi.prototype,"placement",2),h([c({type:Boolean,reflect:!0})],Bi.prototype,"disabled",2),h([c({attribute:"stay-open-on-select",type:Boolean,reflect:!0})],Bi.prototype,"stayOpenOnSelect",2),h([c({attribute:!1})],Bi.prototype,"containingElement",2),h([c({type:Number})],Bi.prototype,"distance",2),h([c({type:Number})],Bi.prototype,"skidding",2),h([c({type:Boolean})],Bi.prototype,"hoist",2),h([c({reflect:!0})],Bi.prototype,"sync",2),h([y("open",{waitUntilFirstUpdate:!0})],Bi.prototype,"handleOpenChange",1),F("dropdown.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),F("dropdown.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}}),Bi.define("sl-dropdown");var Pi=n`
445
+ :host {
446
+ display: block;
447
+ position: relative;
448
+ background: var(--sl-panel-background-color);
449
+ border: solid var(--sl-panel-border-width) var(--sl-panel-border-color);
450
+ border-radius: var(--sl-border-radius-medium);
451
+ padding: var(--sl-spacing-x-small) 0;
452
+ overflow: auto;
453
+ overscroll-behavior: none;
454
+ }
455
+
456
+ ::slotted(sl-divider) {
457
+ --spacing: var(--sl-spacing-x-small);
458
+ }
459
+ `,zi=class extends u{connectedCallback(){super.connectedCallback(),this.setAttribute("role","menu")}handleClick(e){const t=["menuitem","menuitemcheckbox"],i=e.composedPath(),r=i.find((e=>{var i;return t.includes((null==(i=null==e?void 0:e.getAttribute)?void 0:i.call(e,"role"))||"")}));if(!r)return;if(i.find((e=>{var t;return"menu"===(null==(t=null==e?void 0:e.getAttribute)?void 0:t.call(e,"role"))}))!==this)return;const o=r;"checkbox"===o.type&&(o.checked=!o.checked),this.emit("sl-select",{detail:{item:o}})}handleKeyDown(e){if("Enter"===e.key||" "===e.key){const t=this.getCurrentItem();e.preventDefault(),e.stopPropagation(),null==t||t.click()}else if(["ArrowDown","ArrowUp","Home","End"].includes(e.key)){const t=this.getAllItems(),i=this.getCurrentItem();let r=i?t.indexOf(i):0;t.length>0&&(e.preventDefault(),e.stopPropagation(),"ArrowDown"===e.key?r++:"ArrowUp"===e.key?r--:"Home"===e.key?r=0:"End"===e.key&&(r=t.length-1),r<0&&(r=t.length-1),r>t.length-1&&(r=0),this.setCurrentItem(t[r]),t[r].focus())}}handleMouseDown(e){const t=e.target;this.isMenuItem(t)&&this.setCurrentItem(t)}handleSlotChange(){const e=this.getAllItems();e.length>0&&this.setCurrentItem(e[0])}isMenuItem(e){var t;return"sl-menu-item"===e.tagName.toLowerCase()||["menuitem","menuitemcheckbox","menuitemradio"].includes(null!=(t=e.getAttribute("role"))?t:"")}getAllItems(){return[...this.defaultSlot.assignedElements({flatten:!0})].filter((e=>!(e.inert||!this.isMenuItem(e))))}getCurrentItem(){return this.getAllItems().find((e=>"0"===e.getAttribute("tabindex")))}setCurrentItem(e){this.getAllItems().forEach((t=>{t.setAttribute("tabindex",t===e?"0":"-1")}))}render(){return f`
460
+ <slot
461
+ @slotchange=${this.handleSlotChange}
462
+ @click=${this.handleClick}
463
+ @keydown=${this.handleKeyDown}
464
+ @mousedown=${this.handleMouseDown}
465
+ ></slot>
466
+ `}};zi.styles=[p,Pi],h([z("slot")],zi.prototype,"defaultSlot",2),zi.define("sl-menu");var Fi=n`
467
+ :host {
468
+ --submenu-offset: -2px;
469
+
470
+ display: block;
471
+ }
472
+
473
+ :host([inert]) {
474
+ display: none;
475
+ }
476
+
477
+ .menu-item {
478
+ position: relative;
479
+ display: flex;
480
+ align-items: stretch;
481
+ font-family: var(--sl-font-sans);
482
+ font-size: var(--sl-font-size-medium);
483
+ font-weight: var(--sl-font-weight-normal);
484
+ line-height: var(--sl-line-height-normal);
485
+ letter-spacing: var(--sl-letter-spacing-normal);
486
+ color: var(--sl-color-neutral-700);
487
+ padding: var(--sl-spacing-2x-small) var(--sl-spacing-2x-small);
488
+ transition: var(--sl-transition-fast) fill;
489
+ user-select: none;
490
+ -webkit-user-select: none;
491
+ white-space: nowrap;
492
+ cursor: pointer;
493
+ }
494
+
495
+ .menu-item.menu-item--disabled {
496
+ outline: none;
497
+ opacity: 0.5;
498
+ cursor: not-allowed;
499
+ }
500
+
501
+ .menu-item.menu-item--loading {
502
+ outline: none;
503
+ cursor: wait;
504
+ }
505
+
506
+ .menu-item.menu-item--loading *:not(sl-spinner) {
507
+ opacity: 0.5;
508
+ }
509
+
510
+ .menu-item--loading sl-spinner {
511
+ --indicator-color: currentColor;
512
+ --track-width: 1px;
513
+ position: absolute;
514
+ font-size: 0.75em;
515
+ top: calc(50% - 0.5em);
516
+ left: 0.65rem;
517
+ opacity: 1;
518
+ }
519
+
520
+ .menu-item .menu-item__label {
521
+ flex: 1 1 auto;
522
+ display: inline-block;
523
+ text-overflow: ellipsis;
524
+ overflow: hidden;
525
+ }
526
+
527
+ .menu-item .menu-item__prefix {
528
+ flex: 0 0 auto;
529
+ display: flex;
530
+ align-items: center;
531
+ }
532
+
533
+ .menu-item .menu-item__prefix::slotted(*) {
534
+ margin-inline-end: var(--sl-spacing-x-small);
535
+ }
536
+
537
+ .menu-item .menu-item__suffix {
538
+ flex: 0 0 auto;
539
+ display: flex;
540
+ align-items: center;
541
+ }
542
+
543
+ .menu-item .menu-item__suffix::slotted(*) {
544
+ margin-inline-start: var(--sl-spacing-x-small);
545
+ }
546
+
547
+ /* Safe triangle */
548
+ .menu-item--submenu-expanded::after {
549
+ content: '';
550
+ position: fixed;
551
+ z-index: calc(var(--sl-z-index-dropdown) - 1);
552
+ top: 0;
553
+ right: 0;
554
+ bottom: 0;
555
+ left: 0;
556
+ clip-path: polygon(
557
+ var(--safe-triangle-cursor-x, 0) var(--safe-triangle-cursor-y, 0),
558
+ var(--safe-triangle-submenu-start-x, 0) var(--safe-triangle-submenu-start-y, 0),
559
+ var(--safe-triangle-submenu-end-x, 0) var(--safe-triangle-submenu-end-y, 0)
560
+ );
561
+ }
562
+
563
+ :host(:focus-visible) {
564
+ outline: none;
565
+ }
566
+
567
+ :host(:hover:not([aria-disabled='true'], :focus-visible)) .menu-item,
568
+ .menu-item--submenu-expanded {
569
+ background-color: var(--sl-color-neutral-100);
570
+ color: var(--sl-color-neutral-1000);
571
+ }
572
+
573
+ :host(:focus-visible) .menu-item {
574
+ outline: none;
575
+ background-color: var(--sl-color-primary-600);
576
+ color: var(--sl-color-neutral-0);
577
+ opacity: 1;
578
+ }
579
+
580
+ .menu-item .menu-item__check,
581
+ .menu-item .menu-item__chevron {
582
+ flex: 0 0 auto;
583
+ display: flex;
584
+ align-items: center;
585
+ justify-content: center;
586
+ width: 1.5em;
587
+ visibility: hidden;
588
+ }
589
+
590
+ .menu-item--checked .menu-item__check,
591
+ .menu-item--has-submenu .menu-item__chevron {
592
+ visibility: visible;
593
+ }
594
+
595
+ /* Add elevation and z-index to submenus */
596
+ sl-popup::part(popup) {
597
+ box-shadow: var(--sl-shadow-large);
598
+ z-index: var(--sl-z-index-dropdown);
599
+ margin-left: var(--submenu-offset);
600
+ }
601
+
602
+ .menu-item--rtl sl-popup::part(popup) {
603
+ margin-left: calc(-1 * var(--submenu-offset));
604
+ }
605
+
606
+ @media (forced-colors: active) {
607
+ :host(:hover:not([aria-disabled='true'])) .menu-item,
608
+ :host(:focus-visible) .menu-item {
609
+ outline: dashed 1px SelectedItem;
610
+ outline-offset: -1px;
611
+ }
612
+ }
613
+
614
+ ::slotted(sl-menu) {
615
+ max-width: var(--auto-size-available-width) !important;
616
+ max-height: var(--auto-size-available-height) !important;
617
+ }
618
+ `
619
+ /**
620
+ * @license
621
+ * Copyright 2017 Google LLC
622
+ * SPDX-License-Identifier: BSD-3-Clause
623
+ */;const Ti=(e,t)=>{const i=e._$AN;if(void 0===i)return!1;for(const e of i)e._$AO?.(t,!1),Ti(e,t);return!0},Ai=e=>{let t,i;do{if(void 0===(t=e._$AM))break;i=t._$AN,i.delete(e),e=t}while(0===i?.size)},Ei=e=>{for(let t;t=e._$AM;e=t){let i=t._$AN;if(void 0===i)t._$AN=i=new Set;else if(i.has(e))break;i.add(e),Ri(t)}};function _i(e){void 0!==this._$AN?(Ai(this),this._$AM=e,Ei(this)):this._$AM=e}function Mi(e,t=!1,i=0){const r=this._$AH,o=this._$AN;if(void 0!==o&&0!==o.size)if(t)if(Array.isArray(r))for(let e=i;e<r.length;e++)Ti(r[e],!1),Ai(r[e]);else null!=r&&(Ti(r,!1),Ai(r));else Ti(this,e)}const Ri=e=>{e.type==U.CHILD&&(e._$AP??=Mi,e._$AQ??=_i)};let Ni=class extends N{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,i){super._$AT(e,t,i),Ei(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(Ti(this,e),Ai(this))}setValue(e){if(v(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}},Ui=class{};
624
+ /**
625
+ * @license
626
+ * Copyright 2020 Google LLC
627
+ * SPDX-License-Identifier: BSD-3-Clause
628
+ */const Oi=new WeakMap,$i=R(class extends Ni{render(e){return l}update(e,[t]){const i=t!==this.G;return i&&void 0!==this.G&&this.rt(void 0),(i||this.lt!==this.ct)&&(this.G=t,this.ht=e.options?.host,this.rt(this.ct=e.element)),l}rt(e){if(this.isConnected||(e=void 0),"function"==typeof this.G){const t=this.ht??globalThis;let i=Oi.get(t);void 0===i&&(i=new WeakMap,Oi.set(t,i)),void 0!==i.get(this.G)&&this.G.call(this.ht,void 0),i.set(this.G,e),void 0!==e&&this.G.call(this.ht,e)}else this.G.value=e}get lt(){return"function"==typeof this.G?Oi.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var ji=class{constructor(e,t){this.popupRef=new Ui,this.enableSubmenuTimer=-1,this.isConnected=!1,this.isPopupConnected=!1,this.skidding=0,this.submenuOpenDelay=100,this.handleMouseMove=e=>{this.host.style.setProperty("--safe-triangle-cursor-x",`${e.clientX}px`),this.host.style.setProperty("--safe-triangle-cursor-y",`${e.clientY}px`)},this.handleMouseOver=()=>{this.hasSlotController.test("submenu")&&this.enableSubmenu()},this.handleKeyDown=e=>{switch(e.key){case"Escape":case"Tab":this.disableSubmenu();break;case"ArrowLeft":e.target!==this.host&&(e.preventDefault(),e.stopPropagation(),this.host.focus(),this.disableSubmenu());break;case"ArrowRight":case"Enter":case" ":this.handleSubmenuEntry(e)}},this.handleClick=e=>{var t;e.target===this.host?(e.preventDefault(),e.stopPropagation()):e.target instanceof Element&&("sl-menu-item"===e.target.tagName||(null==(t=e.target.role)?void 0:t.startsWith("menuitem")))&&this.disableSubmenu()},this.handleFocusOut=e=>{e.relatedTarget&&e.relatedTarget instanceof Element&&this.host.contains(e.relatedTarget)||this.disableSubmenu()},this.handlePopupMouseover=e=>{e.stopPropagation()},this.handlePopupReposition=()=>{const e=this.host.renderRoot.querySelector("slot[name='submenu']"),t=null==e?void 0:e.assignedElements({flatten:!0}).filter((e=>"sl-menu"===e.localName))[0],i="rtl"===getComputedStyle(this.host).direction;if(!t)return;const{left:r,top:o,width:s,height:a}=t.getBoundingClientRect();this.host.style.setProperty("--safe-triangle-submenu-start-x",`${i?r+s:r}px`),this.host.style.setProperty("--safe-triangle-submenu-start-y",`${o}px`),this.host.style.setProperty("--safe-triangle-submenu-end-x",`${i?r+s:r}px`),this.host.style.setProperty("--safe-triangle-submenu-end-y",`${o+a}px`)},(this.host=e).addController(this),this.hasSlotController=t}hostConnected(){this.hasSlotController.test("submenu")&&!this.host.disabled&&this.addListeners()}hostDisconnected(){this.removeListeners()}hostUpdated(){this.hasSlotController.test("submenu")&&!this.host.disabled?(this.addListeners(),this.updateSkidding()):this.removeListeners()}addListeners(){this.isConnected||(this.host.addEventListener("mousemove",this.handleMouseMove),this.host.addEventListener("mouseover",this.handleMouseOver),this.host.addEventListener("keydown",this.handleKeyDown),this.host.addEventListener("click",this.handleClick),this.host.addEventListener("focusout",this.handleFocusOut),this.isConnected=!0),this.isPopupConnected||this.popupRef.value&&(this.popupRef.value.addEventListener("mouseover",this.handlePopupMouseover),this.popupRef.value.addEventListener("sl-reposition",this.handlePopupReposition),this.isPopupConnected=!0)}removeListeners(){this.isConnected&&(this.host.removeEventListener("mousemove",this.handleMouseMove),this.host.removeEventListener("mouseover",this.handleMouseOver),this.host.removeEventListener("keydown",this.handleKeyDown),this.host.removeEventListener("click",this.handleClick),this.host.removeEventListener("focusout",this.handleFocusOut),this.isConnected=!1),this.isPopupConnected&&this.popupRef.value&&(this.popupRef.value.removeEventListener("mouseover",this.handlePopupMouseover),this.popupRef.value.removeEventListener("sl-reposition",this.handlePopupReposition),this.isPopupConnected=!1)}handleSubmenuEntry(e){const t=this.host.renderRoot.querySelector("slot[name='submenu']");if(!t)return void console.error("Cannot activate a submenu if no corresponding menuitem can be found.",this);let i=null;for(const e of t.assignedElements())if(i=e.querySelectorAll("sl-menu-item, [role^='menuitem']"),0!==i.length)break;if(i&&0!==i.length){i[0].setAttribute("tabindex","0");for(let e=1;e!==i.length;++e)i[e].setAttribute("tabindex","-1");this.popupRef.value&&(e.preventDefault(),e.stopPropagation(),this.popupRef.value.active?i[0]instanceof HTMLElement&&i[0].focus():(this.enableSubmenu(!1),this.host.updateComplete.then((()=>{i[0]instanceof HTMLElement&&i[0].focus()})),this.host.requestUpdate()))}}setSubmenuState(e){this.popupRef.value&&this.popupRef.value.active!==e&&(this.popupRef.value.active=e,this.host.requestUpdate())}enableSubmenu(e=!0){e?(window.clearTimeout(this.enableSubmenuTimer),this.enableSubmenuTimer=window.setTimeout((()=>{this.setSubmenuState(!0)}),this.submenuOpenDelay)):this.setSubmenuState(!0)}disableSubmenu(){window.clearTimeout(this.enableSubmenuTimer),this.setSubmenuState(!1)}updateSkidding(){var e;if(!(null==(e=this.host.parentElement)?void 0:e.computedStyleMap))return;const t=this.host.parentElement.computedStyleMap(),i=["padding-top","border-top-width","margin-top"].reduce(((e,i)=>{var r;const o=null!=(r=t.get(i))?r:new CSSUnitValue(0,"px");return e-(o instanceof CSSUnitValue?o:new CSSUnitValue(0,"px")).to("px").value}),0);this.skidding=i}isExpanded(){return!!this.popupRef.value&&this.popupRef.value.active}renderSubmenu(){const e="rtl"===getComputedStyle(this.host).direction;return this.isConnected?f`
629
+ <sl-popup
630
+ ${$i(this.popupRef)}
631
+ placement=${e?"left-start":"right-start"}
632
+ anchor="anchor"
633
+ flip
634
+ flip-fallback-strategy="best-fit"
635
+ skidding="${this.skidding}"
636
+ strategy="fixed"
637
+ auto-size="vertical"
638
+ auto-size-padding="10"
639
+ >
640
+ <slot name="submenu"></slot>
641
+ </sl-popup>
642
+ `:f` <slot name="submenu" hidden></slot> `}},Wi=n`
643
+ :host {
644
+ --track-width: 2px;
645
+ --track-color: rgb(128 128 128 / 25%);
646
+ --indicator-color: var(--sl-color-primary-600);
647
+ --speed: 2s;
648
+
649
+ display: inline-flex;
650
+ width: 1em;
651
+ height: 1em;
652
+ flex: none;
653
+ }
654
+
655
+ .spinner {
656
+ flex: 1 1 auto;
657
+ height: 100%;
658
+ width: 100%;
659
+ }
660
+
661
+ .spinner__track,
662
+ .spinner__indicator {
663
+ fill: none;
664
+ stroke-width: var(--track-width);
665
+ r: calc(0.5em - var(--track-width) / 2);
666
+ cx: 0.5em;
667
+ cy: 0.5em;
668
+ transform-origin: 50% 50%;
669
+ }
670
+
671
+ .spinner__track {
672
+ stroke: var(--track-color);
673
+ transform-origin: 0% 0%;
674
+ }
675
+
676
+ .spinner__indicator {
677
+ stroke: var(--indicator-color);
678
+ stroke-linecap: round;
679
+ stroke-dasharray: 150% 75%;
680
+ animation: spin var(--speed) linear infinite;
681
+ }
682
+
683
+ @keyframes spin {
684
+ 0% {
685
+ transform: rotate(0deg);
686
+ stroke-dasharray: 0.05em, 3em;
687
+ }
688
+
689
+ 50% {
690
+ transform: rotate(450deg);
691
+ stroke-dasharray: 1.375em, 1.375em;
692
+ }
693
+
694
+ 100% {
695
+ transform: rotate(1080deg);
696
+ stroke-dasharray: 0.05em, 3em;
697
+ }
698
+ }
699
+ `,Li=class extends u{constructor(){super(...arguments),this.localize=new P(this)}render(){return f`
700
+ <svg part="base" class="spinner" role="progressbar" aria-label=${this.localize.term("loading")}>
701
+ <circle class="spinner__track"></circle>
702
+ <circle class="spinner__indicator"></circle>
703
+ </svg>
704
+ `}};Li.styles=[p,Wi];var Hi=class extends u{constructor(){super(...arguments),this.localize=new P(this),this.type="normal",this.checked=!1,this.value="",this.loading=!1,this.disabled=!1,this.hasSlotController=new pi(this,"submenu"),this.submenuController=new ji(this,this.hasSlotController),this.handleHostClick=e=>{this.disabled&&(e.preventDefault(),e.stopImmediatePropagation())},this.handleMouseOver=e=>{this.focus(),e.stopPropagation()}}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.handleHostClick),this.addEventListener("mouseover",this.handleMouseOver)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleHostClick),this.removeEventListener("mouseover",this.handleMouseOver)}handleDefaultSlotChange(){const e=this.getTextLabel();void 0!==this.cachedTextLabel?e!==this.cachedTextLabel&&(this.cachedTextLabel=e,this.emit("slotchange",{bubbles:!0,composed:!1,cancelable:!1})):this.cachedTextLabel=e}handleCheckedChange(){if(this.checked&&"checkbox"!==this.type)return this.checked=!1,void console.error('The checked attribute can only be used on menu items with type="checkbox"',this);"checkbox"===this.type?this.setAttribute("aria-checked",this.checked?"true":"false"):this.removeAttribute("aria-checked")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleTypeChange(){"checkbox"===this.type?(this.setAttribute("role","menuitemcheckbox"),this.setAttribute("aria-checked",this.checked?"true":"false")):(this.setAttribute("role","menuitem"),this.removeAttribute("aria-checked"))}getTextLabel(){return function(e){if(!e)return"";const t=e.assignedNodes({flatten:!0});let i="";return[...t].forEach((e=>{e.nodeType===Node.TEXT_NODE&&(i+=e.textContent)})),i}(this.defaultSlot)}isSubmenu(){return this.hasSlotController.test("submenu")}render(){const e="rtl"===this.localize.dir(),t=this.submenuController.isExpanded();return f`
705
+ <div
706
+ id="anchor"
707
+ part="base"
708
+ class=${O({"menu-item":!0,"menu-item--rtl":e,"menu-item--checked":this.checked,"menu-item--disabled":this.disabled,"menu-item--loading":this.loading,"menu-item--has-submenu":this.isSubmenu(),"menu-item--submenu-expanded":t})}
709
+ ?aria-haspopup="${this.isSubmenu()}"
710
+ ?aria-expanded="${!!t}"
711
+ >
712
+ <span part="checked-icon" class="menu-item__check">
713
+ <sl-icon name="check" library="system" aria-hidden="true"></sl-icon>
714
+ </span>
715
+
716
+ <slot name="prefix" part="prefix" class="menu-item__prefix"></slot>
717
+
718
+ <slot part="label" class="menu-item__label" @slotchange=${this.handleDefaultSlotChange}></slot>
719
+
720
+ <slot name="suffix" part="suffix" class="menu-item__suffix"></slot>
721
+
722
+ <span part="submenu-icon" class="menu-item__chevron">
723
+ <sl-icon name=${e?"chevron-left":"chevron-right"} library="system" aria-hidden="true"></sl-icon>
724
+ </span>
725
+
726
+ ${this.submenuController.renderSubmenu()}
727
+ ${this.loading?f` <sl-spinner part="spinner" exportparts="base:spinner__base"></sl-spinner> `:""}
728
+ </div>
729
+ `}};Hi.styles=[p,Fi],Hi.dependencies={"sl-icon":m,"sl-popup":M,"sl-spinner":Li},h([z("slot:not([name])")],Hi.prototype,"defaultSlot",2),h([z(".menu-item")],Hi.prototype,"menuItem",2),h([c()],Hi.prototype,"type",2),h([c({type:Boolean,reflect:!0})],Hi.prototype,"checked",2),h([c()],Hi.prototype,"value",2),h([c({type:Boolean,reflect:!0})],Hi.prototype,"loading",2),h([c({type:Boolean,reflect:!0})],Hi.prototype,"disabled",2),h([y("checked")],Hi.prototype,"handleCheckedChange",1),h([y("disabled")],Hi.prototype,"handleDisabledChange",1),h([y("type")],Hi.prototype,"handleTypeChange",1),Hi.define("sl-menu-item");const Vi=class{constructor(t){e(this,t),this.subscribePodOs=r(this,"pod-os:init",7),this.errorEmitter=r(this,"pod-os:error",7),this.indexUpdatedEmitter=r(this,"pod-os:search:index-updated",7),this.indexCreatedEmitter=r(this,"pod-os:search:index-created",7),this.indexes=[],this.showOptions=!1,this.isIndexed=!1,this.receivePodOs=async e=>{this.os=e,this.thing=this.os.store.get(this.uri),this.getLabelIndexes(x.state.profile),this.unsubscribeSessionChange=x.onChange("profile",(e=>{this.getLabelIndexes(e)}))}}componentWillLoad(){j(this)}disconnectedCallback(){this.unsubscribeSessionChange&&this.unsubscribeSessionChange()}updateUri(e){this.thing=this.os.store.get(e),this.isIndexed=this.checkIfIndexed(e)}checkIfIndexed(e){return this.indexes.some((t=>t.contains(e)))}getLabelIndexes(e){e&&(this.indexes=e.getPrivateLabelIndexes().map((e=>this.os.store.get(e).assume(I))),this.showOptions=this.indexes.length>1,this.isIndexed=this.checkIfIndexed(this.uri))}async onClick(e){if(e.preventDefault(),1===this.indexes.length){const e=this.indexes[0];await this.addToLabelIndex(e),this.indexUpdatedEmitter.emit(e)}else if(0===this.indexes.length){const e=await this.createDefaultLabelIndex();await this.addToLabelIndex(e),this.indexCreatedEmitter.emit(e)}}async addToLabelIndex(e){try{await this.os.addToLabelIndex(this.thing,e),this.isIndexed=!0}catch(e){this.errorEmitter.emit(e)}}async createDefaultLabelIndex(){try{return await this.os.createDefaultLabelIndex(x.state.profile)}catch(e){this.errorEmitter.emit(e)}}render(){if(!x.state.isLoggedIn||!this.uri)return null;const e="Make this findable",r=t("button",{type:"button",slot:"trigger","aria-label":e,class:{main:!0,success:this.isIndexed},onClick:e=>this.onClick(e),title:""},t(this.isIndexed?Ki:Ji,null),t("p",null,e));return this.showOptions?t(i,null,t("sl-dropdown",null,r,t("sl-menu",{role:"listbox"},this.indexes.map((e=>t("sl-menu-item",{role:"option",value:e,type:"checkbox",checked:e.contains(this.uri)},t("pos-resource",{uri:e.uri,lazy:!0},t("pos-label",null)))))))):r}async onSelect(e){const t=e.detail.item.value;e.preventDefault(),await this.addToLabelIndex(t),this.indexUpdatedEmitter.emit(t)}get el(){return o(this)}static get watchers(){return{uri:[{updateUri:0}]}}},Ji=()=>t("svg",{role:"presentation",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},t("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m5.231 13.481L15 17.25m-4.5-15H5.625c-.621 0-1.125.504-1.125 1.125v16.5c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Zm3.75 11.625a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z"})),Ki=()=>t("svg",{role:"presentation",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},t("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.125 2.25h-4.5c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125v-9M10.125 2.25h.375a9 9 0 0 1 9 9v.375M10.125 2.25A3.375 3.375 0 0 1 13.5 5.625v1.5c0 .621.504 1.125 1.125 1.125h1.5a3.375 3.375 0 0 1 3.375 3.375M9 15l2.25 2.25L15 12"}));Vi.style="button.main{display:flex;transition:width 200ms, background-color 500ms, color 500ms, border-color 500ms;max-width:var(--size-40);flex-direction:row;overflow:hidden;height:var(--pos-navigation-bar-height);width:var(--pos-navigation-bar-height);align-items:center;justify-content:center;border-radius:var(--radius-md);color:var(--pos-subtle-text-color);border:var(--size-px) dashed var(--pos-subtle-text-color);background-color:var(--pos-background-color);p{padding:0;margin:0;display:none;white-space:nowrap}&.success{color:var(--color-green-700);border-color:var(--color-green-700);border-style:solid;background-color:var(--color-green-100)}&:active{transform:scale(0.99);filter:brightness(90%)}&:focus{outline:var(--pos-input-focus-outline)}}svg{display:inline-block;height:var(--size-6);flex-shrink:0;flex-grow:0;width:var(--size-6)}button.main:hover,sl-dropdown[open] button{width:var(--size-full);height:var(--pos-navigation-bar-height);background:var(--pos-background-color);color:var(--pos-normal-text-color);&.success{background:var(--color-green-200);color:var(--color-green-700)}p{display:inline-block}}";const qi=class{constructor(t){e(this,t),this.subscribePodOs=r(this,"pod-os:init",7),this.linkEmitter=r(this,"pod-os:link",7),this.uri="",this.inputValue=this.uri,this.searchIndex=void 0,this.suggestions=[],this.selectedIndex=-1,this.resource=null,this.changeEvents=new B.Subject,this.debouncedSearch=null,this.receivePodOs=async e=>{this.os=e}}updateResource(){var e;try{this.resource=this.uri?null===(e=this.os)||void 0===e?void 0:e.store.get(this.uri):null}catch(e){this.resource=null}}componentWillLoad(){j(this),this.updateResource(),x.onChange("isLoggedIn",(async e=>{e?await this.buildSearchIndex():this.clearSearchIndex()})),this.debouncedSearch=this.changeEvents.pipe(B.debounceTime(300)).subscribe((()=>this.search()))}disconnectedCallback(){var e;null===(e=this.debouncedSearch)||void 0===e||e.unsubscribe()}async buildSearchIndex(){this.searchIndex=await this.os.buildSearchIndex(x.state.profile)}rebuildSearchIndex(){this.searchIndex.rebuild()}openNavigationDialog(e){var t,i;this.resource=e.detail,e.detail&&(this.inputValue=e.detail.uri,this.search()),null===(t=this.inputRef)||void 0===t||t.select(),null===(i=this.dialogRef)||void 0===i||i.show()}clearSearchIndex(){var e;null===(e=this.searchIndex)||void 0===e||e.clear()}onChange(e){this.inputValue=e.target.value,this.changeEvents.next()}closeDialog(){var e;null===(e=this.dialogRef)||void 0===e||e.close(),this.selectedIndex=-1}clearSuggestions(){var e;this.suggestions=[],null===(e=this.dialogRef)||void 0===e||e.close(),this.selectedIndex=-1}onClickSelf(e){e.stopPropagation()}handleKeyDown(e){"Escape"===e.key?this.closeDialog():"ArrowDown"===e.key?(e.preventDefault(),this.selectedIndex=Math.min(this.selectedIndex+1,this.suggestions.length-1)):"ArrowUp"===e.key&&(e.preventDefault(),this.selectedIndex=Math.max(this.selectedIndex-1,0))}search(){this.searchIndex&&(this.suggestions=this.inputValue?this.searchIndex.search(this.inputValue):[])}onSubmit(){this.linkEmitter.emit(this.suggestions&&this.selectedIndex>-1?this.suggestions[this.selectedIndex].ref:this.inputValue)}render(){return t("nav",{key:"d5ad4841674cf172e9401a63fc50e58900ca5b1f"},t("search",{key:"8daf86774c49234d10637160fd983681ac483b44"},t("pos-navigation-bar",{key:"200137643dbc0aa1f120c231dc70a0d3f71b596a",searchIndexReady:void 0!==this.searchIndex,current:this.resource}),t("dialog",{key:"f2fb1d3e4a38d17efb6bd80ca791e8a30fafab66",ref:e=>this.dialogRef=e},t("form",{key:"e54698d8fb968a5ee6007cc4d5644fec36bf74f3",method:"dialog",onSubmit:()=>this.onSubmit()},t("input",{key:"633a4030c6296b5c94e2661bd73168afc1e04438",ref:e=>this.inputRef=e,enterkeyhint:"search","aria-label":"Search or enter URI",placeholder:"Search or enter URI",value:this.uri,onChange:e=>this.onChange(e),onInput:e=>this.onChange(e),role:"combobox","aria-autocomplete":"list","aria-expanded":this.suggestions.length>0,"aria-controls":"suggestions-list","aria-activedescendant":this.selectedIndex>=0?`option-${this.selectedIndex}`:null}),this.suggestions.length>0?t("div",{class:"suggestions"},t("ol",{id:"suggestions-list",role:"listbox","aria-label":"Search results"},this.suggestions.map(((e,i)=>t("li",{id:`option-${i}`,role:"option","aria-selected":i===this.selectedIndex?"true":"false"},t("pos-rich-link",{uri:e.ref})))))):null))))}static get watchers(){return{uri:[{updateResource:0}],os:[{updateResource:0}]}}};qi.style=":host{--pos-navigation-bar-height:var(--size-10)}search{position:relative}.suggestions ol{border:1px solid var(--pos-border-color);display:flex;flex-direction:column;margin:0;padding:0;list-style-type:none}.suggestions{width:100%;overflow-y:auto;max-height:90dvh;li{padding:1rem;background-color:var(--pos-background-color);pos-rich-link{--background-color:inherit}&[aria-selected='true']{background-color:var(--pos-primary-color);&:hover{background-color:var(--pos-primary-color)}}&:hover{background-color:var(--pos-border-color)}}}.suggestions li.selected pos-rich-link{--label-color:white;--description-color:var(--pos-border-color);--uri-color:var(--pos-subtle-text-color)}dialog{position:absolute;margin-top:calc(-1 * var(--pos-navigation-bar-height));padding:0;width:100%;max-width:100%;min-width:100%;overflow:hidden;max-height:100dvh;background-color:var(--pos-background-color);color:var(--pos-normal-text-color);border:var(--pos-border-color);border-radius:var(--radius-md);box-shadow:var(--shadow-md);form{display:flex;flex-direction:column;height:100%;width:100%;align-items:center;input{display:flex;font-size:var(--scale-1);height:var(--pos-navigation-bar-height);border-top-left-radius:var(--radius-md);border-top-right-radius:var(--radius-md);padding-left:var(--size-2);width:100%;border:none;outline:none;color:var(--pos-normal-text-color);background-color:var(--pos-input-background-color);box-sizing:border-box}}}dialog[open]{display:flex;z-index:var(--layer-top);animation:slideIn 100ms ease-out}@media (max-width: 640px){search{position:unset}dialog{margin-top:var(--size-1);top:0;width:95dvw;max-width:unset;min-width:unset;form{input{height:var(--size-12);font-size:var(--scale-fluid-3)}}}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}";const Gi=class{constructor(t){e(this,t),this.navigate=r(this,"pod-os:navigate",7)}onClick(){this.navigate.emit(this.current)}activate(e){(e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),this.navigate.emit(this.current))}render(){const e=this.current?`${this.current.label()} (Click to search or enter URI)`:"Search or enter URI";return t("section",{key:"5f49aa9dad9d07550ee8ffbee90036cbc1efda55",class:"current"},this.current&&this.searchIndexReady&&t("pos-make-findable",{key:"85974a4772aaf8cad3a11cdcd49e6df10141bfe3",uri:this.current.uri}),t("button",{key:"40660a3455b0f3392c68d7aea0075b102a1762a2","aria-label":e,onClick:()=>this.onClick()},t("div",{key:"9ab8922175d701f714f72aefb95745cf5ae4bb95"},this.current?this.current.label():"Search or enter URI"),this.icon()),this.current&&t("pos-share",{key:"3b80c1987f9f5138b11b8a106171fc73a236f426",uri:this.current.uri}))}icon(){return t("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},t("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))}};Gi.style="section.current{display:flex;align-items:center;box-sizing:border-box;padding:0 var(--size-2) 0 0;height:var(--pos-navigation-bar-height);flex-grow:1;gap:0;background-color:var(--pos-input-background-color);border-radius:var(--radius-md);width:100%;&:focus-within{outline:var(--pos-input-focus-outline)}button{cursor:pointer;font-size:var(--scale-1);display:flex;align-items:center;justify-content:center;flex-grow:1;background:none;color:var(--pos-normal-text-color);outline:none;border:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;&:focus{text-decoration:underline}:first-child{flex-grow:1}svg{width:var(--size-6);color:var(--pos-subtle-text-color)}}pos-share{height:80%;&:hover{&::part(button){color:var(--pos-primary-color);background-color:var(--pos-border-color);border-radius:var(--radius-full)}}&::part(button){font-size:var(--size-4);background:none;outline:none;border:none;color:var(--pos-subtle-text-color)}}}";const Xi=class{constructor(t){e(this,t),this.linkEmitter=r(this,"pod-os:link",7),this.errorEmitter=r(this,"pod-os:error",7),this.subscribePodOs=r(this,"pod-os:init",7),this.canSubmit=!1,this.receivePodOs=async e=>{this.os=e}}validate(){this.canSubmit=Boolean(this.name&&this.selectedTypeUri)}componentWillLoad(){j(this)}render(){return t("form",{key:"64781cfb0e570d2368325d674c6637c581bb87c2",method:"dialog",onSubmit:e=>this.handleSubmit(e)},t("label",{key:"409e04f147430042eb334024fc7061574ab543cf",htmlFor:"type"},"Type"),t("pos-select-term",{key:"8d5d580ee1f1e2e2c60cac0cc06798e94a0d28c3",id:"type",placeholder:"",value:this.selectedTypeUri,"onPod-os:term-selected":e=>this.onTermSelected(e)}),t("label",{key:"a45199618751e24b7d4a1bc13ad85c599cc93d1c",htmlFor:"name"},"Name"),t("input",{key:"bee3be7a680abbffc08caa5c549b68b1e653872d",id:"name",type:"text",value:this.name,onInput:e=>this.handleChange(e)}),this.newUri?t("div",{id:"new-uri",title:"This will be the URI of the new thing"},this.newUri):null,t("input",{key:"e8fab4d442188f7f2f325ff7bde3dce6d3f772f6",id:"create",type:"submit",value:"Create",disabled:!this.canSubmit}))}handleChange(e){this.name=e.target.value,this.newUri=this.os.proposeUriForNewThing(this.referenceUri,this.name)}onTermSelected(e){this.selectedTypeUri=e.detail.uri}async handleSubmit(e){try{await this.os.addNewThing(this.newUri,this.name,this.selectedTypeUri),this.linkEmitter.emit(this.newUri),this.reset()}catch(t){e.preventDefault(),this.errorEmitter.emit(t)}}reset(){this.name="",this.newUri="",this.selectedTypeUri=""}static get delegatesFocus(){return!0}static get watchers(){return{name:[{validate:0}],selectedTypeUri:[{validate:0}]}}};Xi.style=":host{display:block}form{display:grid;grid-template-columns:var(--size-16) 1fr;grid-gap:var(--scale-0)}label{grid-column:1 / 2;display:flex;align-items:center;justify-content:flex-end}input,pos-select-term,button{grid-column:2 / 3}input,pos-select-term::part(input){outline:var(--pos-input-outline);padding:var(--scale-000);border:none;border-radius:var(--radius-xs);width:var(--size-full);box-sizing:border-box;background:var(--pos-input-background-color);color:var(--pos-normal-text-color)}input:focus-within,pos-select-term::part(input):focus-within{outline:var(--pos-input-focus-outline)}#new-uri{grid-column:1/3;cursor:default;word-break:break-all;color:var(--pos-normal-text-color);font-weight:var(--weight-light);background:var(--pos-disabled-color);padding:var(--scale-000);border-radius:var(--radius-xs)}input#create{outline:none;box-shadow:var(--shadow-sm);cursor:pointer;color:var(--pos-primary-text-color);background-color:var(--pos-primary-color)}input#create:disabled{cursor:default;color:var(--pos-disabled-text-color);background-color:var(--pos-disabled-color);box-shadow:none}input#create:hover:not(:disabled),input#create:focus{filter:brightness(110%);box-shadow:var(--shadow-md)}";const Yi=class{constructor(t){e(this,t),this.subscribeResource=r(this,"pod-os:resource",7),this.blurredBackground=!1,this.noUpload=!1,this.isUploading=!1,this.receiveResource=e=>{this.resource=e},this.enterUploadMode=()=>{this.isUploading=!0},this.exitUploadMode=()=>{this.isUploading=!1}}async componentWillLoad(){$(this),this.os=await W(this.el)}renderUpload(){return t("div",{class:"upload-container"},t("button",{class:"close",onClick:()=>this.exitUploadMode()},t("sl-icon",{name:"x-circle"}),"Close upload"),t("pos-upload",{uploader:e=>this.os.uploadAndAddPicture(this.resource,e)}))}shouldShowUploadButton(){var e;return!0===(null===(e=this.resource)||void 0===e?void 0:e.editable)&&!this.noUpload}renderUploadButton(){return this.shouldShowUploadButton()?t("button",{class:"add",onClick:this.enterUploadMode},t("sl-icon",{name:"cloud-plus"}),"Upload picture"):null}renderPicture(){var e;const i=null===(e=this.resource)||void 0===e?void 0:e.picture();return i?[t("pos-image",{blurredBackground:this.blurredBackground,src:i.url,alt:this.resource.label()}),this.renderUploadButton()]:t("div",{class:"no-picture"},t("slot",null),this.renderUploadButton())}render(){return this.isUploading?this.renderUpload():this.renderPicture()}get el(){return o(this)}};Yi.style=":host{--width:300px;--height:300px;--border-radius:var(--border-radius, 0);--object-fit:var(--object-fit, cover);display:block;position:relative}button.add{display:none;align-items:center;gap:var(--size-1);padding:var(--size-1);position:absolute;bottom:var(--size-2);right:var(--size-2);z-index:var(--layer-top)}:host(:hover) button.add{display:flex}@media (pointer: coarse){button.add{display:flex}}.no-picture{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:var(--height);width:var(--width);position:relative}.no-picture button.add{position:static;margin-top:var(--size-2);display:flex}.upload-container{display:flex;flex-direction:column;gap:var(--size-2);padding:var(--size-2);button.close{display:flex;align-items:center;gap:var(--size-1);padding:var(--size-1)}}";const Zi=class{constructor(t){e(this,t),this.expanded=!1}render(){return this.expanded?t("div",{class:"container"},t("a",{href:this.uri},this.uri),t("sl-tooltip",{content:"Collapse URI"},t("button",{"aria-label":`collapse URI to ${this.label}`,onClick:()=>this.expanded=!1},t("sl-icon",{name:"arrow-left-circle"})))):t("sl-tooltip",{content:`${this.uri}`},t("button",{onClick:()=>this.expanded=!0},this.label))}};Zi.style=":host{--text-color:var(--pos-primary-color);font-family:var(--font-sans)}button{line-height:var(--scale-0);font-family:inherit;margin:0;padding:0;display:flex;background:none;border:none;cursor:pointer}button,a{color:var(--text-color);font-weight:var(--weight-light);line-height:var(--scale-0);font-size:var(--scale-0);font-family:inherit}.container{display:flex;gap:var(--size-1);flex-direction:row;align-items:center;line-height:var(--scale-0)}";const Qi=class{constructor(t){e(this,t),this.subscribePodOs=r(this,"pod-os:init",7),this.resourceLoadedEmitter=r(this,"pod-os:resource-loaded",7),this.consumers=[],this.lazy=!1,this.loading=!0,this.receivePodOs=async e=>{this.os=e}}componentWillLoad(){x.onChange("isLoggedIn",(()=>this.loadResource())),j(this)}async provideResource(e){e.stopPropagation(),this.resource&&e.detail(this.resource),this.consumers.push(e)}async loadResource(){await this.getResource(!this.lazy)}async fetch(){await this.getResource(!0)}async getResource(e=!1){try{e&&(this.loading=!0,await this.os.fetch(this.uri),this.resourceLoadedEmitter.emit(this.uri)),this.resource=this.os.store.get(this.uri),this.error=null,this.consumers.forEach((e=>{e.detail(this.resource)}))}catch(e){this.error=e}finally{this.loading=!1}}render(){return this.loading?t("sl-progress-bar",{indeterminate:!0}):this.error?t("details",{class:"error"},t("summary",{title:"Click to expand"},"⚠ Sorry, something went wrong"),t("p",null,"Status:",this.error.status),t("p",null,this.error.message),t("p",null,"You can try to open the link outside PodOS: ",t("a",{href:this.uri},this.uri))):t("slot",null)}static get watchers(){return{os:[{loadResource:0}],uri:[{loadResource:0}]}}};Qi.style="details.error{margin:var(--size-2);background-color:var(--pos-error-background-color);border:var(--size-px) solid var(--pos-error-border-color);padding:var(--size-2);border-radius:var(--radius-md);a{color:var(--pos-normal-text-color)}}sl-progress-bar{--height:var(--size-1)}";const er=class{constructor(t){e(this,t),this.linkEmitter=r(this,"pod-os:link",7),this.subscribeResource=r(this,"pod-os:resource",7),this.errorEmitter=r(this,"pod-os:error",7),this.followPredicate=!1,this.error=null,this.showCustomContent=!1,this.receiveResource=e=>{const t=(e,t,i,r)=>{0==e.length?(this.error="No matching link found",this.errorEmitter.emit(new Error(`pos-rich-link: No matching link found from ${t.uri} ${r}=${i}`))):e[0].uris.length>1?(this.error="More than one matching link found",this.errorEmitter.emit(new Error(`pos-rich-link: More than one matching link found from ${t.uri} ${r}=${i}`))):(this.link=e[0].uris[0],this.followPredicate=!0)};this.rel?t(e.relations(this.rel),e,this.rel,"rel"):this.rev?t(e.reverseRelations(this.rev),e,this.rev,"rev"):this.link=e.uri}}componentWillLoad(){this.showCustomContent=!!this.host.lastElementChild||""!=this.host.textContent.trim(),this.uri||$(this)}render(){const e=e=>this.showCustomContent?t("a",{href:e,onClick:t=>{t.preventDefault(),this.linkEmitter.emit(e)}},t("slot",null)):t("p",{class:"content"},t("a",{href:e,onClick:t=>{t.preventDefault(),this.linkEmitter.emit(e)}},t("pos-label",null)),t("span",{class:"url"},new URL(e).host),t("pos-description",null));return this.error?this.error:this.followPredicate?t("pos-resource",{lazy:!0,uri:this.link},e(this.link)):this.link?e(this.link):this.uri?t("pos-resource",{lazy:!0,uri:this.uri},e(this.uri)):null}get host(){return o(this)}};er.style=":host{--background-color:inherit;--label-color:var(--pos-normal-text-color);--description-color:var(--pos-normal-text-color);--uri-color:var(--pos-subtle-text-color);--font-family:var(--font-sans)}p.content{background-color:var(--background-color);line-height:var(--line-xs);margin:0;display:flex;flex-direction:column;align-items:baseline;gap:var(--size-1);.url{font-size:var(--scale-fluid-1);color:var(--pos-subtle-text-color)}}a{color:var(--label-color);max-width:min(100%, var(--prose-lg));text-decoration:underline;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-decoration-thickness:var(--size-px)}pos-label{color:var(--label-color);font-size:var(--scale-fluid-2);margin-bottom:var(--size-1)}pos-description{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;text-overflow:ellipsis;overflow:hidden;font-weight:var(--weight-light);color:var(--description-color);font-size:var(--scale-fluid-2)}@media (min-width: 640px){pos-label{font-size:var(--scale-fluid-0)}pos-description{font-size:var(--scale-fluid-1)}p.content{.url{font-size:var(--scale-fluid-000)}}}";const tr=e=>!("isConnected"in e)||e.isConnected,ir=(()=>{let e;return(...t)=>{e&&clearTimeout(e),e=setTimeout((()=>{e=0,(e=>{for(let t of e.keys())e.set(t,e.get(t).filter(tr))})(...t)}),2e3)}})(),rr=(e,t)=>{if("string"==typeof t){if(t===e)return{}}else if("function"==typeof t){const i=t(e);if(i)return!0===i?{}:{...i}}else{const i=t.exec(e);if(i)return t.lastIndex=0,{...i}}},or=e=>e.pathname.toLowerCase(),sr=(()=>{const e=window,t=new URL(e.location.href),i=or,{state:r,onChange:o,dispose:n}=((e,t)=>{const i=((e,t=(e,t)=>e!==t)=>{let i=new Map(Object.entries(null!=e?e:{}));const r={dispose:[],get:[],set:[],reset:[]},o=()=>{i=new Map(Object.entries(null!=e?e:{})),r.reset.forEach((e=>e()))},s=e=>(r.get.forEach((t=>t(e))),i.get(e)),a=(e,o)=>{const s=i.get(e);t(o,s,e)&&(i.set(e,o),r.set.forEach((t=>t(e,o,s))))},n="undefined"==typeof Proxy?{}:new Proxy(e,{get:(e,t)=>s(t),ownKeys:()=>Array.from(i.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(e,t)=>i.has(t),set:(e,t,i)=>(a(t,i),!0)}),l=(e,t)=>(r[e].push(t),()=>{((e,t)=>{const i=e.indexOf(t);i>=0&&(e[i]=e[e.length-1],e.length--)})(r[e],t)});return{state:n,get:s,set:a,on:l,onChange:(t,i)=>{const r=l("set",((e,r)=>{e===t&&i(r)})),o=l("reset",(()=>i(e[t])));return()=>{r(),o()}},use:(...e)=>{const t=e.reduce(((e,t)=>(t.set&&e.push(l("set",t.set)),t.get&&e.push(l("get",t.get)),t.reset&&e.push(l("reset",t.reset)),t.dispose&&e.push(l("dispose",t.dispose)),e)),[]);return()=>t.forEach((e=>e()))},dispose:()=>{r.dispose.forEach((e=>e())),o()},reset:o,forceUpdate:e=>{const t=i.get(e);r.set.forEach((i=>i(e,t,t)))}}})(e,t);return i.use((()=>{if("function"!=typeof s)return{};const e=new Map;return{dispose:()=>e.clear(),get:t=>{const i=s();i&&((e,t,i)=>{const r=e.get(t);r?r.includes(i)||r.push(i):e.set(t,[i])})(e,t,i)},set:t=>{const i=e.get(t);i&&e.set(t,i.filter(a)),ir(e)},reset:()=>{e.forEach((e=>e.forEach(a))),ir(e)}}})()),i})({url:t,activePath:i(t)},((e,t,i)=>"url"===i?e.href!==t.href:e!==t)),l=e=>{history.pushState(null,null,e);const t=new URL(e,document.baseURI);r.url=t,r.activePath=i(t)},d=e=>{const{activePath:t}=r;for(let i of e){const r=rr(t,i.path);if(r){if(null!=i.to){const r="string"==typeof i.to?i.to:i.to(t);return l(r),d(e)}return{params:r,route:i}}}},p=()=>{const t=new URL(e.location.href);r.url=t,r.activePath=i(t)},h={Switch:(e,t)=>{const i=d(t);if(i)return"function"==typeof i.route.jsx?i.route.jsx(i.params):i.route.jsx},get url(){return r.url},get activePath(){return r.activePath},push:l,onChange:o,dispose:()=>{e.removeEventListener("popstate",p),n()}};return p(),e.addEventListener("popstate",p),h})(),ar=class{constructor(t){e(this,t),this.routeChanged=r(this,"pod-os:route-changed",7),this.mode="standalone"}linkClicked(e){this.navigate(e.detail)}sessionRestored(e){sr.push(e.detail.url)}componentWillLoad(){this.updateUri(),sr.onChange("url",(()=>{this.updateUri()}))}navigate(e){sr.push("?uri="+encodeURIComponent(e))}updateUri(){this.uri=new URLSearchParams(window.location.search).get("uri")||("standalone"===this.mode?"pod-os:dashboard":window.location.href),this.routeChanged.emit(this.uri)}render(){return t("slot",{key:"2775fc2835158ccd8d540e4f27edfd497eafe7a9"})}};ar.style=".toolbar{display:flex;flex-direction:row;gap:0;align-items:center;margin-left:0.5rem}pos-navigation{flex-grow:1}";const nr=class{constructor(t){e(this,t),this.subscribePodOs=r(this,"pod-os:init",7),this.termSelected=r(this,"pod-os:term-selected",7),this.placeholder="Type to search...",this.value="",this.terms=[],this.receivePodOs=async e=>{this.os=e}}componentWillLoad(){j(this)}setTerms(){this.terms=this.os.listKnownTerms()}handleChange(e){this.termSelected.emit({uri:e.target.value})}render(){return t(i,{key:"a4050d72acd62d907f0fd4c3b90c54194700871c"},t("input",{key:"99b35c4a14a2623599ba237bb4af0b79c0761196",part:"input",list:"terms",placeholder:this.placeholder,value:this.value,onChange:e=>this.handleChange(e)}),t("datalist",{key:"d64ad5ea83200014c6de5cd4720f29922494982c",part:"terms",id:"terms"},this.terms.map((e=>t("option",{value:e.uri},e.shorthand)))))}static get delegatesFocus(){return!0}static get watchers(){return{os:[{setTerms:0}]}}};nr.style=":host{display:block}input{background-color:transparent;color:var(--pos-normal-text-color);border:none;padding-top:1rem;padding-bottom:1rem}input:focus{outline:none}";const lr=class{constructor(t){e(this,t)}render(){return t(i,{key:"7417274658af9e41cf662b9ab20d4b5a6236586f"},t("div",{key:"e92a78a1d2b1d067ffd10a68d78a386208d629d8"},t("h2",{key:"7be5f2cf380363e824519fc24fd1e07f0651334b"},t("svg",{key:"d2aa35c987e12836cf665b2574ae0c42a1574e97",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},t("path",{key:"562e3432799cb8111e543080722b6f20867f4b46","stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"})),"Cache Settings"),t("p",{key:"002eed9e13146d25cc9e52a68c8d9e030f1dd775",class:"info"},"ℹ Enable offline cache to be able to access previously loaded data while offline."),t("p",{key:"b5a1f45ed9fec335a43ecbb6573a31ed29e0692e",class:"warn"},"⚠ Private data may be stored on this device. Only enable it, if you trust this device."),t("label",{key:"49ab529db0b9d1bd4f216f6c54e78ed30a43be41"},t("input",{key:"e764d1a106906059c7c5286d13b9b8c7a6c01cce",type:"checkbox",checked:V.state.offlineCache,onChange:e=>V.state.offlineCache=e.target.checked}),"Enable offline cache")))}};lr.style=":host{border:var(--size-px) solid var(--pos-border-color);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);padding:var(--size-8);max-width:var(--size-96);background:var(--pos-card-background)}svg{width:var(--size-8)}h2{display:flex;align-items:center}p{padding:var(--size-2)}.info{color:var(--color-grey-900);background-color:var(--color-blue-200)}.warn{color:var(--color-grey-900);background-color:var(--color-yellow-200)}";var dr=n`
730
+ :host {
731
+ --color: var(--sl-panel-border-color);
732
+ --width: var(--sl-panel-border-width);
733
+ --spacing: var(--sl-spacing-medium);
734
+ }
735
+
736
+ :host(:not([vertical])) {
737
+ display: block;
738
+ border-top: solid var(--width) var(--color);
739
+ margin: var(--spacing) 0;
740
+ }
741
+
742
+ :host([vertical]) {
743
+ display: inline-block;
744
+ height: 100%;
745
+ border-left: solid var(--width) var(--color);
746
+ margin: 0 var(--spacing);
747
+ }
748
+ `,pr=class extends u{constructor(){super(...arguments),this.vertical=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","separator")}handleVerticalChange(){this.setAttribute("aria-orientation",this.vertical?"vertical":"horizontal")}};pr.styles=[p,dr],h([c({type:Boolean,reflect:!0})],pr.prototype,"vertical",2),h([y("vertical")],pr.prototype,"handleVerticalChange",1),pr.define("sl-divider");const hr=class{constructor(t){e(this,t),this.apps=[]}async resourceLoaded(e){e.detail===this.uri&&await this.updateApps()}async componentWillLoad(){this.os=await W(this.el),await this.updateApps()}async updateApps(){const e=this.os.store.get(this.uri);this.apps=this.os.proposeAppsFor(e)}onSelect(e){const{value:t}=e.detail.item;var i;"copy-uri"===t?navigator.clipboard.writeText(this.uri):(i=t.urlTemplate.expand({uri:this.uri}),window.open(i.toString(),"_blank"))}render(){return t("sl-dropdown",{key:"67ce5a1f7e5630ff40a6e79eaa9ab7f32b5f1a00"},t("button",{key:"6c946718e7af9f0ef212c3853641f06a24d79474",slot:"trigger","aria-label":"Share",part:"button"},t("sl-icon",{key:"effc4e9bdf4236451636f1b4622605c87746d414",name:"share"})),t("sl-menu",{key:"2f1c8e707e71a699803c2897fda8f1e79ccd5267"},t("sl-menu-item",{key:"5a59cffe8351c23389620b38b60f8ccd24dce351",value:"copy-uri"},t("sl-icon",{key:"ab9b9d7f8a2a91e0a4f5ac657b9ff390418948cc",slot:"prefix",name:"copy"}),"Copy URI"),this.apps.length>0&&t(cr,{key:"718fbda37b7171df356afe02e6d6f7f1e8e8cd26",apps:this.apps})))}get el(){return o(this)}static get watchers(){return{uri:[{updateApps:0}]}}};function cr({apps:e}){return[t("sl-divider",null),t("sl-menu-item",{disabled:!0},"Open with..."),e.map((e=>t("sl-menu-item",{value:e},e.name)))]}hr.style=":host{display:flex;aspect-ratio:1/1;height:var(--size-8);align-items:center;justify-content:center}sl-dropdown{height:100%;width:100%;display:flex;align-items:center;justify-content:center;&::part(trigger){height:100%;width:100%}button{display:flex;align-items:center;justify-content:center;height:100%;width:100%;cursor:pointer;padding:0;margin:0}}sl-menu-item[disabled]{&::part(base){cursor:default;opacity:1}}";const ur=class{constructor(t){e(this,t),this.toolSelected=r(this,"pod-os:tool-selected",7),this.tools=[]}render(){return this.tools.length>1?t("div",{role:"tablist","aria-label":"Tools","aria-multiselectable":"false"},this.tools.map((e=>{var i;return t("button",{role:"tab","aria-selected":(null===(i=this.selected)||void 0===i?void 0:i.element)===e.element,onClick:()=>this.toolSelected.emit(e)},t("sl-icon",{name:e.icon}),t("span",{class:"text"},e.label))}))):null}};ur.style=":host { --button-size: var(--size-16); display: block; position: sticky; align-self: flex-start; top: 0; overflow: auto; min-width: var(--button-size); z-index: var(--layer-1); } [role='tablist'] { display: flex; flex-direction: column; justify-content: center; border-right: var(--size-px) solid var(--pos-border-color); button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; font-size: var(--size-6); position: relative; overflow: hidden; outline: none; border: none; width: var(--button-size); min-width: var(--button-size); height: var(--button-size); min-height: var(--button-size); color: var(--pos-normal-text-color); background-color: var(--pos-background-color); &::after { content: ''; position: absolute; top: 50%; left: 50%; width: 0; height: 0; border-radius: 100%; background: color-mix(in srgb, var(--pos-primary-color), transparent 50%); transform: translate(-50%, -50%); opacity: 1; } &:active::after, &:focus::after { width: calc(var(--button-size) * 1.5); height: calc(var(--button-size) * 1.5); opacity: 0; transition: width 0.5s ease-out, height 0.5s ease-out, opacity 1s ease-out; } &:focus-visible { border: var(--size-px) solid var(--pos-primary-color); } @media (min-width: 640px) { &[aria-selected] { border-right: var(--size-1) solid var(--pos-primary-color); } } .text { font-size: var(--size-3); white-space: nowrap; text-overflow: ellipsis; width: 100%; overflow: hidden; } } } @media (max-width: 640px) { :host { position: fixed; top: unset; bottom: 0; width: 100dvw; } [role='tablist'] { flex-direction: row; background-color: var(--pos-background-color); border-top: var(--size-px) solid var(--pos-border-color); button { &[aria-selected] { border-top: var(--size-1) solid var(--pos-primary-color); } } } } ";const fr=class{constructor(t){e(this,t)}async componentWillLoad(){const e=await W(this.el);e.store.get(this.uri);const t=e.store.get(this.uri).assume(C);this.entries=t.listAll()}render(){if(0===this.entries.length)return null;const e=this.entries.map((e=>t("div",null,t("dt",null,t("pos-predicate",{uri:e.forClass,label:e.label})),e.targets.map((e=>t("dd",null,t("pos-rich-link",{uri:e.uri})))))));return t("dl",null,e)}get el(){return o(this)}};fr.style="dl { > * { display: flex; flex-direction: column; gap: var(--size-1); } display: flex; flex-direction: column; gap: var(--size-4); dd { margin: 0; } } ";const mr={Generic:{element:"pos-app-generic",label:"Data",icon:"list-ul",types:[]},Attachments:{element:"pos-tool-attachments",label:"Attach",icon:"paperclip",types:[]},RdfDocument:{element:"pos-app-rdf-document",label:"Things",icon:"diagram-2",types:[{uri:"http://www.w3.org/2007/ont/link#RDFDocument",priority:20}]},DocumentViewer:{element:"pos-app-document-viewer",label:"Doc",icon:"file-text",types:[{uri:"http://www.w3.org/ns/iana/media-types/application/pdf#Resource",priority:30},{uri:"http://www.w3.org/2007/ont/link#Document",priority:10}]},ImageViewer:{element:"pos-app-image-viewer",label:"Pic",icon:"file-image",types:[{uri:"http://purl.org/dc/terms/Image",priority:20}]},LdpContainer:{element:"pos-app-ldp-container",label:"Content",icon:"folder",types:[{uri:"http://www.w3.org/ns/ldp#Container",priority:30}]}};function br(e,t){return e.filter((e=>t.has(e.uri))).reduce(((e,t)=>Math.max(e,t.priority)),0)}const yr=e=>e.priority>0,gr=(e,t)=>t.priority-e.priority,vr=class{constructor(t){e(this,t),this.subscribeResource=r(this,"pod-os:resource",7),this.transitioning=!1,this.receiveResource=e=>{var t;const i=e.types();this.availableTools=function(e){const t=new Set(e.map((e=>e.uri)));return Object.values(mr).map((e=>t=>({tool:t,priority:br(t.types,e)}))(t)).filter(yr).toSorted(gr).map((e=>e.tool)).concat(mr.Generic).concat(mr.Attachments)}(i),this.currentTool=null!==(t=this.availableTools.find((e=>e.element===this.initialTool)))&&void 0!==t?t:this.availableTools[0]}}componentWillLoad(){$(this);const e=new URLSearchParams(window.location.search).get("tool");e&&(this.initialTool=e)}handleToolSelected(e){this.oldTool=this.currentTool,this.currentTool=e.detail,this.transitioning=!0;const t=new URL(window.location.href);t.searchParams.set("tool",e.detail.element),window.history.replaceState({},"",t.toString())}render(){return this.availableTools?this.renderApp():null}renderApp(){var e;const i=this.currentTool.element,r=null===(e=this.oldTool)||void 0===e?void 0:e.element;return t("section",null,t("pos-tool-select",{selected:this.currentTool,tools:this.availableTools}),t("div",{class:{tools:!0,transition:this.transitioning},onAnimationEnd:()=>this.removeOldTool()},r&&t(r,{class:"tool hidden"}),t(i,{class:"tool visible"})))}removeOldTool(){this.oldTool=null,this.transitioning=!1}};vr.style="section{display:flex;flex-direction:row}.tools{flex-grow:1;&.transition{position:relative;.tool{position:absolute}}}.tool{top:0;right:0;left:0;bottom:0;&.visible{animation:fadeIn 300ms ease-in}&.hidden{animation:fadeOut 300ms ease-in}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{from{opacity:1}to{opacity:0}}@media (max-width: 640px){section{--toolbar-size:var(--size-16);flex-direction:column-reverse;padding-bottom:var(--toolbar-size);pos-tool-select{--button-size:var(--toolbar-size)}}}";const wr=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function xr(e,t,i,r){return e===t?e:0===r?t:e+(t-e)*2**(-r/i)}var kr=['a[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','area[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])',"input:not([disabled]):not([inert]):not([aria-hidden])","select:not([disabled]):not([inert]):not([aria-hidden])","textarea:not([disabled]):not([inert]):not([aria-hidden])","button:not([disabled]):not([inert]):not([aria-hidden])",'iframe:not([tabindex^="-"]):not([inert]):not([aria-hidden])','object:not([tabindex^="-"]):not([inert]):not([aria-hidden])','embed:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[contenteditable]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[tabindex]:not([tabindex^="-"]):not([inert]):not([aria-hidden])'];function Sr(e){return"object"==typeof e&&null!==e&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Dr(e){if("string"==typeof e){const t=document.querySelectorAll(e);return 0===t.length?null:Array.from(t)}return"object"==typeof e&&Sr(e)?[e]:null}function Ir(e){const t=e.lastIndexOf(".");return-1===t||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}}var Cr={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",msg:"application/vnd.ms-outlook",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function Br(e){if(e.type)return e.type;const t=e.name?Ir(e.name).extension?.toLowerCase():null;return t&&t in Cr?Cr[t]:"application/octet-stream"}function Pr(e){let t="";return e.replace(/[^A-Z0-9]/gi,(e=>(t+=`-${function(e){return e.charCodeAt(0).toString(32)}(e)}`,"/")))+t}var zr=Array.from;function Fr(e,t,i,{onSuccess:r}){e.readEntries((o=>{const s=[...t,...o];o.length?queueMicrotask((()=>{Fr(e,s,i,{onSuccess:r})})):r(s)}),(e=>{i(e),r(t)}))}function Tr(e,t){return null==e?e:{kind:e.isFile?"file":e.isDirectory?"directory":void 0,name:e.name,getFile:()=>new Promise(((t,i)=>e.file(t,i))),async*values(){const i=e.createReader(),r=await new Promise((e=>{Fr(i,[],t,{onSuccess:i=>e(i.map((e=>Tr(e,t))))})}));yield*r},isSameEntry:void 0}}async function*Ar(e,t,i){const r=()=>`${t}/${e.name}`;if("file"===e.kind){const o=await e.getFile();null!=o?(o.relativePath=t?r():null,yield o):null!=i&&(yield i)}else if("directory"===e.kind)for await(const i of e.values())yield*Ar(i,t?r():e.name);else null!=i&&(yield i)}const Er={__proto__:null,"audio/mp3":"mp3","audio/mp4":"mp4","audio/ogg":"ogg","audio/webm":"webm","image/gif":"gif","image/heic":"heic","image/heif":"heif","image/jpeg":"jpg","image/webp":"webp","image/png":"png","image/svg+xml":"svg","video/mp4":"mp4","video/ogg":"ogv","video/quicktime":"mov","video/webm":"webm","video/x-matroska":"mkv","video/x-msvideo":"avi"};function _r(e){return[e]=e.split(";",1),Er[e]||null}function Mr(e){return e<10?`0${e}`:e.toString()}function Rr(){const e=new Date;return`${Mr(e.getHours())}:${Mr(e.getMinutes())}:${Mr(e.getSeconds())}`}function Nr(){if("undefined"==typeof window)return!1;const e=document.body;return null!=e&&null!=window&&"draggable"in e&&"ondragstart"in e&&"ondrop"in e&&"FormData"in window&&"FileReader"in window}function Ur(e){return e.startsWith("blob:")}function Or(e){return!!e&&/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(e)}function $r(e){const t=(i=e,{hours:Math.floor(i/3600)%24,minutes:Math.floor(i/60)%60,seconds:Math.floor(i%60)});var i;return`${0===t.hours?"":`${t.hours}h`}${0===t.minutes?"":`${0===t.hours?t.minutes:` ${t.minutes.toString(10).padStart(2,"0")}`}m`}${0!==t.hours?"":`${0===t.minutes?t.seconds:` ${t.seconds.toString(10).padStart(2,"0")}`}s`}`}function jr(e,t,i){const r=[];return e.forEach((e=>"string"!=typeof e?r.push(e):t[Symbol.split](e).forEach(((e,t,o)=>{""!==e&&r.push(e),t<o.length-1&&r.push(i)})))),r}
749
+ /**
750
+ * Takes a string with placeholder variables like `%{smart_count} file selected`
751
+ * and replaces it with values from options `{smart_count: 5}`
752
+ *
753
+ * @license https://github.com/airbnb/polyglot.js/blob/master/LICENSE
754
+ * taken from https://github.com/airbnb/polyglot.js/blob/master/lib/polyglot.js#L299
755
+ *
756
+ * @param phrase that needs interpolation, with placeholders
757
+ * @param options with values that will be used to replace placeholders
758
+ */function Wr(e,t){const i=/\$/g;let r=[e];if(null==t)return r;for(const e of Object.keys(t))if("_"!==e){let o=t[e];"string"==typeof o&&(o=i[Symbol.replace](o,"$$$$")),r=jr(r,new RegExp(`%\\{${e}\\}`,"g"),o)}return r}const Lr=e=>{throw new Error(`missing string: ${e}`)};class Hr{locale;constructor(e,{onMissingKey:t=Lr}={}){this.locale={strings:{},pluralize:e=>1===e?0:1},Array.isArray(e)?e.forEach(this.#e,this):this.#e(e),this.#t=t}#t;#e(e){if(!e?.strings)return;const t=this.locale;Object.assign(this.locale,{strings:{...t.strings,...e.strings},pluralize:e.pluralize||t.pluralize})}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let i=this.locale.strings[e];if(null==i&&(this.#t(e),i=e),"object"==typeof i){if(t&&void 0!==t.smart_count)return Wr(i[this.locale.pluralize(t.smart_count)],t);throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if("string"!=typeof i)throw new Error("string was not a string");return Wr(i,t)}}function Vr(e,t){if(0===t)return"";if(e.length<=t)return e;if(t<=4)return`${e.slice(0,t-1)}…`;const i=t-3,r=Math.ceil(i/2),o=Math.floor(i/2);return e.slice(0,r)+"..."+e.slice(-o)}var Jr,Kr,qr,Gr,Xr,Yr,Zr,Qr,eo,to,io,ro={},oo=[],so=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ao=Array.isArray;function no(e,t){for(var i in t)e[i]=t[i];return e}function lo(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function po(e,t,i){var r,o,s,a={};for(s in t)"key"==s?r=t[s]:"ref"==s?o=t[s]:a[s]=t[s];if(arguments.length>2&&(a.children=arguments.length>3?Jr.call(arguments,2):i),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===a[s]&&(a[s]=e.defaultProps[s]);return ho(e,a,r,o,null)}function ho(e,t,i,r,o){var s={type:e,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++qr:o,__i:-1,__u:0};return null==o&&null!=Kr.vnode&&Kr.vnode(s),s}function co(e){return e.children}function uo(e,t){this.props=e,this.context=t}function fo(e,t){if(null==t)return e.__?fo(e.__,e.__i+1):null;for(var i;t<e.__k.length;t++)if(null!=(i=e.__k[t])&&null!=i.__e)return i.__e;return"function"==typeof e.type?fo(e):null}function mo(e){var t,i;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(i=e.__k[t])&&null!=i.__e){e.__e=e.__c.base=i.__e;break}return mo(e)}}function bo(e){(!e.__d&&(e.__d=!0)&&Gr.push(e)&&!yo.__r++||Xr!=Kr.debounceRendering)&&((Xr=Kr.debounceRendering)||Yr)(yo)}function yo(){for(var e,t,i,r,o,s,a,n=1;Gr.length;)Gr.length>n&&Gr.sort(Zr),e=Gr.shift(),n=Gr.length,e.__d&&(i=void 0,r=void 0,o=(r=(t=e).__v).__e,s=[],a=[],t.__P&&((i=no({},r)).__v=r.__v+1,Kr.vnode&&Kr.vnode(i),Io(t.__P,i,r,t.__n,t.__P.namespaceURI,32&r.__u?[o]:null,s,null==o?fo(r):o,!!(32&r.__u),a),i.__v=r.__v,i.__.__k[i.__i]=i,Bo(s,i,a),r.__e=r.__=null,i.__e!=o&&mo(i)));yo.__r=0}function go(e,t,i,r,o,s,a,n,l,d,p){var h,c,u,f,m,b,y,g=r&&r.__k||oo,v=t.length;for(l=function(e,t,i,r,o){var s,a,n,l,d,p=i.length,h=p,c=0;for(e.__k=new Array(o),s=0;s<o;s++)null!=(a=t[s])&&"boolean"!=typeof a&&"function"!=typeof a?(l=s+c,(a=e.__k[s]="string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?ho(null,a,null,null,null):ao(a)?ho(co,{children:a},null,null,null):null==a.constructor&&a.__b>0?ho(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,n=null,-1!=(d=a.__i=xo(a,i,l,h))&&(h--,(n=i[d])&&(n.__u|=2)),null==n||null==n.__v?(-1==d&&(o>p?c--:o<p&&c++),"function"!=typeof a.type&&(a.__u|=4)):d!=l&&(d==l-1?c--:d==l+1?c++:(d>l?c--:c++,a.__u|=4))):e.__k[s]=null;if(h)for(s=0;s<p;s++)null!=(n=i[s])&&!(2&n.__u)&&(n.__e==r&&(r=fo(n)),Fo(n,n));return r}(i,t,g,l,v),h=0;h<v;h++)null!=(u=i.__k[h])&&(c=-1==u.__i?ro:g[u.__i]||ro,u.__i=h,b=Io(e,u,c,o,s,a,n,l,d,p),f=u.__e,u.ref&&c.ref!=u.ref&&(c.ref&&zo(c.ref,null,u),p.push(u.ref,u.__c||f,u)),null==m&&null!=f&&(m=f),(y=!!(4&u.__u))||c.__k===u.__k?l=vo(u,l,e,y):"function"==typeof u.type&&void 0!==b?l=b:f&&(l=f.nextSibling),u.__u&=-7);return i.__e=m,l}function vo(e,t,i,r){var o,s;if("function"==typeof e.type){for(o=e.__k,s=0;o&&s<o.length;s++)o[s]&&(o[s].__=e,t=vo(o[s],t,i,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=fo(e)),i.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function wo(e,t){return t=t||[],null==e||"boolean"==typeof e||(ao(e)?e.some((function(e){wo(e,t)})):t.push(e)),t}function xo(e,t,i,r){var o,s,a,n=e.key,l=e.type,d=t[i],p=null!=d&&!(2&d.__u);if(null===d&&null==e.key||p&&n==d.key&&l==d.type)return i;if(r>(p?1:0))for(o=i-1,s=i+1;o>=0||s<t.length;)if(null!=(d=t[a=o>=0?o--:s++])&&!(2&d.__u)&&n==d.key&&l==d.type)return a;return-1}function ko(e,t,i){"-"==t[0]?e.setProperty(t,null==i?"":i):e[t]=null==i?"":"number"!=typeof i||so.test(t)?i:i+"px"}function So(e,t,i,r,o){var s,a;e:if("style"==t)if("string"==typeof i)e.style.cssText=i;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)i&&t in i||ko(e.style,t,"");if(i)for(t in i)r&&i[t]==r[t]||ko(e.style,t,i[t])}else if("o"==t[0]&&"n"==t[1])s=t!=(t=t.replace(Qr,"$1")),a=t.toLowerCase(),t=a in e||"onFocusOut"==t||"onFocusIn"==t?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=i,i?r?i.u=r.u:(i.u=eo,e.addEventListener(t,s?io:to,s)):e.removeEventListener(t,s?io:to,s);else{if("http://www.w3.org/2000/svg"==o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==i?"":i;break e}catch(e){}"function"==typeof i||(null==i||!1===i&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==i?"":i))}}function Do(e){return function(t){if(this.l){var i=this.l[t.type+e];if(null==t.t)t.t=eo++;else if(t.t<i.u)return;return i(Kr.event?Kr.event(t):t)}}}function Io(e,t,i,r,o,s,a,n,l,d){var p,h,c,u,f,m,b,y,g,v,w,x,k,S,D,I,C,B=t.type;if(null!=t.constructor)return null;128&i.__u&&(l=!!(32&i.__u),s=[n=t.__e=i.__e]),(p=Kr.__b)&&p(t);e:if("function"==typeof B)try{if(y=t.props,g="prototype"in B&&B.prototype.render,v=(p=B.contextType)&&r[p.__c],w=p?v?v.props.value:p.__:r,i.__c?b=(h=t.__c=i.__c).__=h.__E:(g?t.__c=h=new B(y,w):(t.__c=h=new uo(y,w),h.constructor=B,h.render=To),v&&v.sub(h),h.props=y,h.state||(h.state={}),h.context=w,h.__n=r,c=h.__d=!0,h.__h=[],h._sb=[]),g&&null==h.__s&&(h.__s=h.state),g&&null!=B.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=no({},h.__s)),no(h.__s,B.getDerivedStateFromProps(y,h.__s))),u=h.props,f=h.state,h.__v=t,c)g&&null==B.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),g&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(g&&null==B.getDerivedStateFromProps&&y!==u&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(y,w),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(y,h.__s,w)||t.__v==i.__v){for(t.__v!=i.__v&&(h.props=y,h.state=h.__s,h.__d=!1),t.__e=i.__e,t.__k=i.__k,t.__k.some((function(e){e&&(e.__=t)})),x=0;x<h._sb.length;x++)h.__h.push(h._sb[x]);h._sb=[],h.__h.length&&a.push(h);break e}null!=h.componentWillUpdate&&h.componentWillUpdate(y,h.__s,w),g&&null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(u,f,m)}))}if(h.context=w,h.props=y,h.__P=e,h.__e=!1,k=Kr.__r,S=0,g){for(h.state=h.__s,h.__d=!1,k&&k(t),p=h.render(h.props,h.state,h.context),D=0;D<h._sb.length;D++)h.__h.push(h._sb[D]);h._sb=[]}else do{h.__d=!1,k&&k(t),p=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++S<25);h.state=h.__s,null!=h.getChildContext&&(r=no(no({},r),h.getChildContext())),g&&!c&&null!=h.getSnapshotBeforeUpdate&&(m=h.getSnapshotBeforeUpdate(u,f)),I=p,null!=p&&p.type===co&&null==p.key&&(I=Po(p.props.children)),n=go(e,ao(I)?I:[I],t,i,r,o,s,a,n,l,d),h.base=t.__e,t.__u&=-161,h.__h.length&&a.push(h),b&&(h.__E=h.__=null)}catch(e){if(t.__v=null,l||null!=s)if(e.then){for(t.__u|=l?160:128;n&&8==n.nodeType&&n.nextSibling;)n=n.nextSibling;s[s.indexOf(n)]=null,t.__e=n}else{for(C=s.length;C--;)lo(s[C]);Co(t)}else t.__e=i.__e,t.__k=i.__k,e.then||Co(t);Kr.__e(e,t,i)}else null==s&&t.__v==i.__v?(t.__k=i.__k,t.__e=i.__e):n=t.__e=function(e,t,i,r,o,s,a,n,l){var d,p,h,c,u,f,m,b=i.props,y=t.props,g=t.type;if("svg"==g?o="http://www.w3.org/2000/svg":"math"==g?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=s)for(d=0;d<s.length;d++)if((u=s[d])&&"setAttribute"in u==!!g&&(g?u.localName==g:3==u.nodeType)){e=u,s[d]=null;break}if(null==e){if(null==g)return document.createTextNode(y);e=document.createElementNS(o,g,y.is&&y),n&&(Kr.__m&&Kr.__m(t,s),n=!1),s=null}if(null==g)b===y||n&&e.data==y||(e.data=y);else{if(s=s&&Jr.call(e.childNodes),b=i.props||ro,!n&&null!=s)for(b={},d=0;d<e.attributes.length;d++)b[(u=e.attributes[d]).name]=u.value;for(d in b)if(u=b[d],"children"==d);else if("dangerouslySetInnerHTML"==d)h=u;else if(!(d in y)){if("value"==d&&"defaultValue"in y||"checked"==d&&"defaultChecked"in y)continue;So(e,d,null,u,o)}for(d in y)u=y[d],"children"==d?c=u:"dangerouslySetInnerHTML"==d?p=u:"value"==d?f=u:"checked"==d?m=u:n&&"function"!=typeof u||b[d]===u||So(e,d,u,b[d],o);if(p)n||h&&(p.__html==h.__html||p.__html==e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(h&&(e.innerHTML=""),go("template"==t.type?e.content:e,ao(c)?c:[c],t,i,r,"foreignObject"==g?"http://www.w3.org/1999/xhtml":o,s,a,s?s[0]:i.__k&&fo(i,0),n,l),null!=s)for(d=s.length;d--;)lo(s[d]);n||(d="value","progress"==g&&null==f?e.removeAttribute("value"):null!=f&&(f!==e[d]||"progress"==g&&!f||"option"==g&&f!=b[d])&&So(e,d,f,b[d],o),d="checked",null!=m&&m!=e[d]&&So(e,d,m,b[d],o))}return e}(i.__e,t,i,r,o,s,a,l,d);return(p=Kr.diffed)&&p(t),128&t.__u?void 0:n}function Co(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(Co)}function Bo(e,t,i){for(var r=0;r<i.length;r++)zo(i[r],i[++r],i[++r]);Kr.__c&&Kr.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Kr.__e(e,t.__v)}}))}function Po(e){return"object"!=typeof e||null==e||e.__b&&e.__b>0?e:ao(e)?e.map(Po):no({},e)}function zo(e,t,i){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){Kr.__e(e,i)}}function Fo(e,t,i){var r,o;if(Kr.unmount&&Kr.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||zo(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Kr.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&Fo(r[o],t,i||"function"!=typeof e.type);i||lo(e.__e),e.__c=e.__=e.__e=void 0}function To(e,t,i){return this.constructor(e,i)}function Ao(e,t){var i,r,o;t==document&&(t=document.documentElement),Kr.__&&Kr.__(e,t),i=t.__k,r=[],o=[],Io(t,e=t.__k=po(co,null,[e]),i||ro,ro,t.namespaceURI,i?null:t.firstChild?Jr.call(t.childNodes):null,r,i?i.__e:t.firstChild,!1,o),Bo(r,e,o)}function Eo(e,t,i){var r,o,s,a,n=no({},e.props);for(s in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)"key"==s?r=t[s]:"ref"==s?o=t[s]:n[s]=void 0===t[s]&&null!=a?a[s]:t[s];return arguments.length>2&&(n.children=arguments.length>3?Jr.call(arguments,2):i),ho(e.type,n,r||e.key,o||e.ref,null)}Jr=oo.slice,Kr={__e:function(e,t,i,r){for(var o,s,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((s=o.constructor)&&null!=s.getDerivedStateFromError&&(o.setState(s.getDerivedStateFromError(e)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(t){e=t}throw e}},qr=0,uo.prototype.setState=function(e,t){var i;i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=no({},this.state),"function"==typeof e&&(e=e(no({},i),this.props)),e&&no(i,e),null!=e&&this.__v&&(t&&this._sb.push(t),bo(this))},uo.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),bo(this))},uo.prototype.render=co,Gr=[],Yr="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Zr=function(e,t){return e.__v.__b-t.__v.__b},yo.__r=0,Qr=/(PointerCapture)$|Capture$/i,eo=0,to=Do(!1),io=Do(!0);var _o=0;function Mo(e,t,i,r,o,s){t||(t={});var a,n,l=t;if("ref"in l)for(n in l={},t)"ref"==n?a=t[n]:l[n]=t[n];var d={type:e,props:l,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--_o,__i:-1,__u:0,__source:o,__self:s};if("function"==typeof e&&(a=e.defaultProps))for(n in a)void 0===l[n]&&(l[n]=a[n]);return Kr.vnode&&Kr.vnode(d),d}var Ro,No,Uo,Oo,$o=0,jo=[],Wo=Kr,Lo=Wo.__b,Ho=Wo.__r,Vo=Wo.diffed,Jo=Wo.__c,Ko=Wo.unmount,qo=Wo.__;function Go(e,t){Wo.__h&&Wo.__h(No,e,$o||t),$o=0;var i=No.__H||(No.__H={__:[],__h:[]});return e>=i.__.length&&i.__.push({}),i.__[e]}function Xo(e){return $o=1,function(e,t){var i=Go(Ro++,2);if(i.t=e,!i.__c&&(i.__=[ns(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],r=i.t(t,e);t!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=No,!No.__f)){var r=function(e,t,r){if(!i.__c.__H)return!0;var s=i.__c.__H.__.filter((function(e){return!!e.__c}));if(s.every((function(e){return!e.__N})))return!o||o.call(this,e,t,r);var a=i.__c.props!==e;return s.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),o&&o.call(this,e,t,r)||a};No.__f=!0;var o=No.shouldComponentUpdate,s=No.componentWillUpdate;No.componentWillUpdate=function(e,t,i){if(this.__e){var a=o;o=void 0,r(e,t,i),o=a}s&&s.call(this,e,t,i)},No.shouldComponentUpdate=r}return i.__N||i.__}(ns,e)}function Yo(e,t){var i=Go(Ro++,3);!Wo.__s&&as(i.__H,t)&&(i.__=e,i.u=t,No.__H.__h.push(i))}function Zo(e){return $o=5,Qo((function(){return{current:e}}),[])}function Qo(e,t){var i=Go(Ro++,7);return as(i.__H,t)&&(i.__=e(),i.__H=t,i.__h=e),i.__}function es(e,t){return $o=8,Qo((function(){return e}),t)}function ts(){for(var e;e=jo.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(os),e.__H.__h.forEach(ss),e.__H.__h=[]}catch(t){e.__H.__h=[],Wo.__e(t,e.__v)}}Wo.__b=function(e){No=null,Lo&&Lo(e)},Wo.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),qo&&qo(e,t)},Wo.__r=function(e){Ho&&Ho(e),Ro=0;var t=(No=e.__c).__H;t&&(Uo===No?(t.__h=[],No.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.forEach(os),t.__h.forEach(ss),t.__h=[],Ro=0)),Uo=No},Wo.diffed=function(e){Vo&&Vo(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==jo.push(t)&&Oo===Wo.requestAnimationFrame||((Oo=Wo.requestAnimationFrame)||rs)(ts)),t.__H.__.forEach((function(e){e.u&&(e.__H=e.u),e.u=void 0}))),Uo=No=null},Wo.__c=function(e,t){t.some((function(e){try{e.__h.forEach(os),e.__h=e.__h.filter((function(e){return!e.__||ss(e)}))}catch(i){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Wo.__e(i,e.__v)}})),Jo&&Jo(e,t)},Wo.unmount=function(e){Ko&&Ko(e);var t,i=e.__c;i&&i.__H&&(i.__H.__.forEach((function(e){try{os(e)}catch(e){t=e}})),i.__H=void 0,t&&Wo.__e(t,i.__v))};var is="function"==typeof requestAnimationFrame;function rs(e){var t,i=function(){clearTimeout(r),is&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(i,35);is&&(t=requestAnimationFrame(i))}function os(e){var t=No,i=e.__c;"function"==typeof i&&(e.__c=void 0,i()),No=t}function ss(e){var t=No;e.__c=e.__(),No=t}function as(e,t){return!e||e.length!==t.length||t.some((function(t,i){return t!==e[i]}))}function ns(e,t){return"function"==typeof t?t(e):t}const ls={position:"relative",width:"100%",minHeight:"100%"},ds={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"};function ps({data:e,rowHeight:t,renderRow:i,overscanCount:r=10,padding:o=4,...s}){const a=Zo(null),[n,l]=Xo(0),[d,p]=Xo(0);Yo((()=>{function e(){null!=a.current&&d!==a.current.offsetHeight&&p(a.current.offsetHeight)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[d]);const h=es((()=>{a.current&&l(a.current.scrollTop)}),[]);let c=Math.floor(n/t),u=Math.floor(d/t);r&&(c=Math.max(0,c-c%r),u+=r);const f=e.slice(c,c+u+o),m={...ls,height:e.length*t},b={...ds,top:c*t};return Mo("div",{onScroll:h,ref:a,...s,children:Mo("div",{role:"presentation",style:m,children:Mo("div",{role:"presentation",style:b,children:f.map(i)})})})}class hs{uppy;opts;id;defaultLocale;i18n;i18nArray;type;VERSION;constructor(e,t){this.uppy=e,this.opts=t??{}}getPluginState(){const{plugins:e}=this.uppy.getState();return e?.[this.id]||{}}setPluginState(e){const{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(void 0),this.i18nInit()}i18nInit(){const e=new Hr([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState(void 0)}addTarget(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}}const cs={debug:()=>{},warn:()=>{},error:(...e)=>console.error(`[Uppy] [${Rr()}]`,...e)},us={debug:(...e)=>console.debug(`[Uppy] [${Rr()}]`,...e),warn:(...e)=>console.warn(`[Uppy] [${Rr()}]`,...e),error:(...e)=>console.error(`[Uppy] [${Rr()}]`,...e)};var fs,ms,bs,ys,gs,vs,ws=ge(ms?fs:(ms=1,fs=function(e){if("number"!=typeof e||Number.isNaN(e))throw new TypeError("Expected a number, got "+typeof e);const t=e<0;let i=Math.abs(e);if(t&&(i=-i),0===i)return"0 B";const r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],o=Math.min(Math.floor(Math.log(i)/Math.log(1024)),r.length-1),s=Number(i/1024**o),a=r[o];return`${s>=10||s%1==0?Math.round(s):s.toFixed(1)} ${a}`}));function xs(){if(ys)return bs;function e(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}return ys=1,e.prototype.match=function(e){var t,i,r=!0,o=this.parts,s=o.length;if("string"==typeof e||e instanceof String)if(this.hasWild||this.text==e){for(i=(e||"").split(this.separator),t=0;r&&t<s;t++)"*"!==o[t]&&(r=t<i.length&&o[t]===i[t]);r=r&&i}else r=!1;else if("function"==typeof e.splice)for(r=[],t=e.length;t--;)this.match(e[t])&&(r[r.length]=e[t]);else if("object"==typeof e)for(var a in r={},e)this.match(a)&&(r[a]=e[a]);return r},bs=function(t,i,r){var o=new e(t,r||/[\/\.]/);return void 0!==i?o.match(i):o},bs}var ks=function(){if(vs)return gs;vs=1;var e=xs(),t=/[\/\+\.]/;return gs=function(i,r){function o(r){var o=e(r,i,t);return o&&o.length>=2}return r?o(r.split(";")[0]):o}}(),Ss=ge(ks);const Ds={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};class Is extends Error{isUserFacing;file;constructor(e,t){super(e),this.isUserFacing=t?.isUserFacing??!0,t?.file&&(this.file=t.file)}isRestriction=!0}class Cs{getI18n;getOpts;constructor(e,t){this.getI18n=t,this.getOpts=()=>{const t=e();if(null!=t.restrictions?.allowedFileTypes&&!Array.isArray(t.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return t}}validateAggregateRestrictions(e,t){const{maxTotalFileSize:i,maxNumberOfFiles:r}=this.getOpts().restrictions;if(r){const i=e.filter((e=>!e.isGhost));if(i.length+t.length>r)throw new Is(`${this.getI18n()("youCanOnlyUploadX",{smart_count:r})}`)}if(i){const r=[...e,...t].reduce(((e,t)=>e+(t.size??0)),0);if(r>i)throw new Is(this.getI18n()("aggregateExceedsSize",{sizeAllowed:ws(i),size:ws(r)}))}}validateSingleFile(e){const{maxFileSize:t,minFileSize:i,allowedFileTypes:r}=this.getOpts().restrictions;if(r&&!r.some((t=>t.includes("/")?!!e.type&&Ss(e.type.replace(/;.*?$/,""),t):!("."!==t[0]||!e.extension)&&e.extension.toLowerCase()===t.slice(1).toLowerCase()))){const t=r.join(", ");throw new Is(this.getI18n()("youCanOnlyUploadFileTypes",{types:t}),{file:e})}if(t&&null!=e.size&&e.size>t)throw new Is(this.getI18n()("exceedsSize",{size:ws(t),file:e.name??this.getI18n()("unnamed")}),{file:e});if(i&&null!=e.size&&e.size<i)throw new Is(this.getI18n()("inferiorSize",{size:ws(i)}),{file:e})}validate(e,t){t.forEach((e=>{this.validateSingleFile(e)})),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){const{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length<t)throw new Is(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){const t=new Is(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:e.name??this.getI18n()("unnamed")})),{requiredMetaFields:i}=this.getOpts().restrictions,r=[];for(const t of i)Object.hasOwn(e.meta,t)&&""!==e.meta[t]||r.push(t);return{missingFields:r,error:t}}}class Bs extends hs{#i;isTargetDOMEl;el;parent;title;getTargetPlugin(e){let t;if("function"==typeof e?.addTarget)t=e,t instanceof Bs||console.warn(new Error("The provided plugin is not an instance of UIPlugin. This is an indication of a bug with the way Uppy is bundled.",{cause:{targetPlugin:t,UIPlugin:Bs}}));else if("function"==typeof e){const i=e;this.uppy.iteratePlugins((e=>{e instanceof i&&(t=e)}))}return t}mount(e,t){const i=t.id,r=function(e,t=document){return"string"==typeof e?t.querySelector(e):Sr(e)?e:null}(e);if(r){this.isTargetDOMEl=!0;const t=document.createElement("div");return t.classList.add("uppy-Root"),this.#i=function(e){let t,i=null;return(...r)=>(t=r,i||(i=Promise.resolve().then((()=>(i=null,e(...t))))),i)}((e=>{this.uppy.getPlugin(this.id)&&(Ao(this.render(e,t),t),this.afterUpdate())})),this.uppy.log(`Installing ${i} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(r.innerHTML=""),Ao(this.render(this.uppy.getState(),t),t),this.el=t,r.appendChild(t),t.dir=this.opts.direction||function(e){for(;e&&!e.dir;)e=e.parentNode;return e?.dir}(t)||"ltr",this.onMount(),this.el}const o=this.getTargetPlugin(e);if(o)return this.uppy.log(`Installing ${i} to ${o.id}`),this.parent=o,this.el=o.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${i}`);let s=`Invalid target option given to ${i}.`;throw s+="function"==typeof e?" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":"If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(s)}render(e,t){throw new Error("Extend the render method to add your plugin to a DOM element")}update(e){null!=this.el&&this.#i?.(e)}unmount(){this.isTargetDOMEl&&this.el?.remove(),this.onUnmount()}onMount(){}onUnmount(){}}var Ps,zs,Fs,Ts,As,Es,_s,Ms,Rs,Ns,Us,Os,$s,js,Ws,Ls,Hs,Vs,Js,Ks,qs,Gs,Xs,Ys,Zs,Qs,ea,ta,ia,ra;class oa{static VERSION="5.0.0";state={};#r=new Set;getState(){return this.state}setState(e){const t={...this.state},i={...this.state,...e};this.state=i,this.#o(t,i,e)}subscribe(e){return this.#r.add(e),()=>{this.#r.delete(e)}}#o(...e){this.#r.forEach((t=>{t(...e)}))}}function sa(){return zs?Ps:(zs=1,Ps=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)})}function aa(){if(Es)return As;Es=1;var e=Ts?Fs:(Ts=1,Fs="object"==typeof ye&&ye&&ye.Object===Object&&ye),t="object"==typeof self&&self&&self.Object===Object&&self,i=e||t||Function("return this")();return As=i}function na(){if(js)return $s;js=1;var e=aa();return $s=e.Symbol}function la(){if(Ys)return Xs;Ys=1;var e=function(){if(Ks)return Js;Ks=1;var e=na(),t=function(){if(Ls)return Ws;Ls=1;var e=na(),t=Object.prototype,i=t.hasOwnProperty,r=t.toString,o=e?e.toStringTag:void 0;return Ws=function(e){var t=i.call(e,o),s=e[o];try{e[o]=void 0;var a=!0}catch(e){}var n=r.call(e);return a&&(t?e[o]=s:delete e[o]),n},Ws}(),i=function(){if(Vs)return Hs;Vs=1;var e=Object.prototype.toString;return Hs=function(t){return e.call(t)}}(),r=e?e.toStringTag:void 0;return Js=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":r&&r in Object(e)?t(e):i(e)}}(),t=Gs?qs:(Gs=1,qs=function(e){return null!=e&&"object"==typeof e});return Xs=function(i){return"symbol"==typeof i||t(i)&&"[object Symbol]"==e(i)}}function da(){if(ta)return ea;ta=1;var e=sa(),t=function(){if(Ms)return _s;Ms=1;var e=aa();return _s=function(){return e.Date.now()}}(),i=function(){if(Qs)return Zs;Qs=1;var e=function(){if(Os)return Us;Os=1;var e=function(){if(Ns)return Rs;Ns=1;var e=/\s/;return Rs=function(t){for(var i=t.length;i--&&e.test(t.charAt(i)););return i}}(),t=/^\s+/;return Us=function(i){return i?i.slice(0,e(i)+1).replace(t,""):i}}(),t=sa(),i=la(),r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt;return Zs=function(n){if("number"==typeof n)return n;if(i(n))return NaN;if(t(n)){var l="function"==typeof n.valueOf?n.valueOf():n;n=t(l)?l+"":l}if("string"!=typeof n)return 0===n?n:+n;n=e(n);var d=o.test(n);return d||s.test(n)?a(n.slice(2),d?2:8):r.test(n)?NaN:+n}}(),r=Math.max,o=Math.min;return ea=function(s,a,n){var l,d,p,h,c,u,f=0,m=!1,b=!1,y=!0;if("function"!=typeof s)throw new TypeError("Expected a function");function g(e){var t=l,i=d;return l=d=void 0,f=e,h=s.apply(i,t)}function v(e){var t=e-u;return void 0===u||t>=a||t<0||b&&e-f>=p}function w(){var e=t();if(v(e))return x(e);c=setTimeout(w,function(e){var t=a-(e-u);return b?o(t,p-(e-f)):t}(e))}function x(e){return c=void 0,y&&l?g(e):(l=d=void 0,h)}function k(){var e=t(),i=v(e);if(l=arguments,d=this,u=e,i){if(void 0===c)return function(e){return f=e,c=setTimeout(w,a),m?g(e):h}(u);if(b)return clearTimeout(c),c=setTimeout(w,a),g(u)}return void 0===c&&(c=setTimeout(w,a)),h}return a=i(a)||0,e(n)&&(m=!!n.leading,p=(b="maxWait"in n)?r(i(n.maxWait)||0,a):p,y="trailing"in n?!!n.trailing:y),k.cancel=function(){void 0!==c&&clearTimeout(c),f=0,l=u=d=c=void 0},k.flush=function(){return void 0===c?h:x(t())},k},ea}var pa,ha,ca=function(){if(ra)return ia;ra=1;var e=da(),t=sa();return ia=function(i,r,o){var s=!0,a=!0;if("function"!=typeof i)throw new TypeError("Expected a function");return t(o)&&(s="leading"in o?!!o.leading:s,a="trailing"in o?!!o.trailing:a),e(i,r,{leading:s,maxWait:r,trailing:a})}}(),ua=ge(ca),fa=(ha||(ha=1,pa=function(){var e={},t=e._fns={};return e.emit=function(e,i,r,o,s,a,n){var l=function(e){for(var i=t[e]?t[e]:[],r=e.indexOf(":"),o=-1===r?[e]:[e.substring(0,r),e.substring(r+1)],s=Object.keys(t),a=0,n=s.length;a<n;a++){var l=s[a];if("*"===l&&(i=i.concat(t[l])),2===o.length&&o[0]===l){i=i.concat(t[l]);break}}return i}(e);l.length&&function(e,t,i){for(var r=0,o=t.length;r<o&&t[r];r++)t[r].event=e,t[r].apply(t[r],i)}(e,l,[i,r,o,s,a,n])},e.on=function(e,i){t[e]||(t[e]=[]),t[e].push(i)},e.once=function(t,i){this.on(t,(function r(){i.apply(this,arguments),e.off(t,r)}))},e.off=function(e,t){var i=[];if(e&&t)for(var r=this._fns[e],o=0,s=r?r.length:0;o<s;o++)r[o]!==t&&i.push(r[o]);i.length?this._fns[e]=i:delete this._fns[e]},e}),pa),ma=ge(fa);let ba=(e=21)=>{let t="",i=0|e;for(;i--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t};var ya={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",logIn:"Log in",pickFiles:"Pick files",pickPhotos:"Pick photos",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed",pleaseWait:"Please wait"}};function ga(e){if(null==e&&"undefined"!=typeof navigator&&(e=navigator.userAgent),!e)return!0;const t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;const i=t[1].split(".",2),r=parseInt(i[0],10),o=parseInt(i[1],10);return r<15||15===r&&o<15063||r>18||18===r&&o>=18218}const va={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null};class wa{static VERSION="5.2.0";#s=Object.create(null);#a;#n;#l=ma();#d=new Set;#p=new Set;#h=new Set;defaultLocale;locale;opts;store;i18n;i18nArray;scheduledAutoProceed=null;wasOffline=!1;constructor(e){this.defaultLocale=ya;const t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:Ds,meta:{},onBeforeFileAdded:(e,t)=>!Object.hasOwn(t,e.id),onBeforeUpload:e=>e,store:new oa,logger:cs,infoTimeout:5e3},i={...t,...e};this.opts={...i,restrictions:{...t.restrictions,...e?.restrictions}},e?.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e?.debug&&(this.opts.logger=us),this.log(`Using Core v${wa.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...va,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:ga(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),this.#a=new Cs((()=>this.opts),(()=>this.i18n)),this.#n=this.store.subscribe(((e,t,i)=>{this.emit("state-update",e,t,i),this.updateAll(t)})),this.opts.debug&&"undefined"!=typeof window&&(window[this.opts.id]=this),this.#c()}emit(e,...t){this.#l.emit(e,...t)}on(e,t){return this.#l.on(e,t),this}once(e,t){return this.#l.once(e,t),this}off(e,t){return this.#l.off(e,t),this}updateAll(e){this.iteratePlugins((t=>{t.update(e)}))}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){const t=this.getState().files;this.setState({files:{...t,...Object.fromEntries(Object.entries(e).map((([e,i])=>[e,{...t[e],...i}])))}})}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can’t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:t})}i18nInit(){const e=new Hr([this.defaultLocale,this.opts.locale],{onMissingKey:e=>this.log(`Missing i18n string: ${e}`,"error")});this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.locale=e.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e?.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins((t=>{t.setOptions(e)})),this.setState(void 0)}resetProgress(){const e={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},i=Object.create(null);Object.keys(t).forEach((r=>{i[r]={...t[r],progress:{...t[r].progress,...e},tus:void 0,transloadit:void 0}})),this.setState({files:i,...va})}clear(){const{capabilities:e,currentUploads:t}=this.getState();if(Object.keys(t).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState({...va,files:{}})}addPreProcessor(e){this.#d.add(e)}removePreProcessor(e){return this.#d.delete(e)}addPostProcessor(e){this.#h.add(e)}removePostProcessor(e){return this.#h.delete(e)}addUploader(e){this.#p.add(e)}removeUploader(e){return this.#p.delete(e)}setMeta(e){const t={...this.getState().meta,...e},i={...this.getState().files};Object.keys(i).forEach((t=>{i[t]={...i[t],meta:{...i[t].meta,...e}}})),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:i})}setFileMeta(e,t){const i={...this.getState().files};if(!i[e])return void this.log(`Was trying to set metadata for a file that has been removed: ${e}`);const r={...i[e].meta,...t};i[e]={...i[e],meta:r},this.setState({files:i})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map((e=>this.getFile(e)))}getObjectOfFilesPerState(){const{files:e,totalProgress:t,error:i}=this.getState(),r=Object.values(e),o=[],s=[],a=[],n=[],l=[],d=[],p=[],h=[],c=[];for(const e of r){const{progress:t}=e;!t.uploadComplete&&t.uploadStarted&&(o.push(e),e.isPaused||h.push(e)),t.uploadStarted||s.push(e),(t.uploadStarted||t.preprocess||t.postprocess)&&a.push(e),t.uploadStarted&&n.push(e),e.isPaused&&l.push(e),t.uploadComplete&&d.push(e),e.error&&p.push(e),(t.preprocess||t.postprocess)&&c.push(e)}return{newFiles:s,startedFiles:a,uploadStartedFiles:n,pausedFiles:l,completeFiles:d,erroredFiles:p,inProgressFiles:o,inProgressNotPausedFiles:h,processingFiles:c,isUploadStarted:n.length>0,isAllComplete:100===t&&d.length===r.length&&0===c.length,isAllErrored:!!i&&p.length===r.length,isAllPaused:0!==o.length&&l.length===o.length,isUploadInProgress:o.length>0,isSomeGhost:r.some((e=>e.isGhost))}}#u(e){for(const t of e)t.isRestriction?this.emit("restriction-failed",t.file,t):this.emit("error",t,t.file),this.log(t,"warning");const t=e.filter((e=>e.isUserFacing)),i=t.slice(0,4),r=t.slice(4);i.forEach((({message:e,details:t=""})=>{this.info({message:e,details:t},"error",this.opts.infoTimeout)})),r.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:r.length})})}validateRestrictions(e,t=this.getFiles()){try{this.#a.validate(t,[e])}catch(e){return e}return null}validateSingleFile(e){try{this.#a.validateSingleFile(e)}catch(e){return e.message}return null}validateAggregateRestrictions(e){const t=this.getFiles();try{this.#a.validateAggregateRestrictions(t,e)}catch(e){return e.message}return null}#f(e){const{missingFields:t,error:i}=this.#a.getMissingRequiredMetaFields(e);return t.length>0?(this.setFileState(e.id,{missingRequiredMetaFields:t,error:i.message}),this.log(i.message),this.emit("restriction-failed",e,i),!1):(0===t.length&&e.missingRequiredMetaFields&&this.setFileState(e.id,{missingRequiredMetaFields:[]}),!0)}#m(e){let t=!0;for(const i of Object.values(e))this.#f(i)||(t=!1);return t}#b(e){const{allowNewUpload:t}=this.getState();if(!1===t){const t=new Is(this.i18n("noMoreFilesAllowed"),{file:e});throw this.#u([t]),t}}checkIfFileAlreadyExists(e){const{files:t}=this.getState();return!(!t[e]||t[e].isGhost)}#y(e){const t=e instanceof File?{name:e.name,type:e.type,size:e.size,data:e,meta:{},isRemote:!1,source:void 0,preview:void 0}:e,i=Br(t),r=function(e,t){return t.name?t.name:"image"===e.split("/")[0]?`${e.split("/")[0]}.${e.split("/")[1]}`:"noname"}(i,t),o=Ir(r).extension,s=function(e,t){if(function(e){return!(!e.isRemote||!e.remote)&&new Set(["box","dropbox","drive","facebook","unsplash"]).has(e.remote.provider)}(e))return e.id;const i=Br(e);return function(e,t){let i=t||"uppy";return"string"==typeof e.name&&(i+=`-${Pr(e.name.toLowerCase())}`),void 0!==e.type&&(i+=`-${e.type}`),e.meta&&"string"==typeof e.meta.relativePath&&(i+=`-${Pr(e.meta.relativePath.toLowerCase())}`),void 0!==e.data?.size&&(i+=`-${e.data.size}`),void 0!==e.data.lastModified&&(i+=`-${e.data.lastModified}`),i}({...e,type:i},t)}(t,this.getID()),a={...t.meta,name:r,type:i},n=Number.isFinite(t.data.size)?t.data.size:null;return{source:t.source||"",id:s,name:r,extension:o||"",meta:{...this.getState().meta,...a},type:i,progress:{percentage:0,bytesUploaded:!1,bytesTotal:n,uploadComplete:!1,uploadStarted:null},size:n,isGhost:!1,...t.isRemote?{isRemote:!0,remote:t.remote,data:t.data}:{isRemote:!1,data:t.data},preview:t.preview}}#g(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout((()=>{this.scheduledAutoProceed=null,this.upload().catch((e=>{e.isRestriction||this.log(e.stack||e.message||e)}))}),4))}#v(e){let{files:t}=this.getState(),i={...t};const r=[],o=[];for(const s of e)try{let e=this.#y(s);this.#b(e);const o=t[e.id],a=o?.isGhost;if(a&&!e.isRemote){if(null==e.data)throw new Error("File data is missing");e={...o,isGhost:!1,data:e.data},this.log(`Replaced the blob in the restored ghost file: ${e.name}, ${e.id}`)}const n=this.opts.onBeforeFileAdded(e,i);if(t=this.getState().files,i={...t,...i},!n&&this.checkIfFileAlreadyExists(e.id))throw new Is(this.i18n("noDuplicates",{fileName:e.name??this.i18n("unnamed")}),{file:e});if(!1===n&&!a)throw new Is("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:e});"object"==typeof n&&null!==n&&(e=n),this.#a.validateSingleFile(e),i[e.id]=e,r.push(e)}catch(e){o.push(e)}try{this.#a.validateAggregateRestrictions(Object.values(t),r)}catch(e){return o.push(e),{nextFilesState:t,validFilesToAdd:[],errors:o}}return{nextFilesState:i,validFilesToAdd:r,errors:o}}addFile(e){const{nextFilesState:t,validFilesToAdd:i,errors:r}=this.#v([e]),o=r.filter((e=>e.isRestriction));if(this.#u(o),r.length>0)throw r[0];this.setState({files:t});const[s]=i;return this.emit("file-added",s),this.emit("files-added",i),this.log(`Added file: ${s.name}, ${s.id}, mime type: ${s.type}`),this.#g(),s.id}addFiles(e){const{nextFilesState:t,validFilesToAdd:i,errors:r}=this.#v(e),o=r.filter((e=>e.isRestriction));this.#u(o);const s=r.filter((e=>!e.isRestriction));if(s.length>0){let e="Multiple errors occurred while adding files:\n";if(s.forEach((t=>{e+=`\n * ${t.message}`})),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:s.length}),details:e},"error",this.opts.infoTimeout),"function"==typeof AggregateError)throw new AggregateError(s,e);{const t=new Error(e);throw t.errors=s,t}}this.setState({files:t}),i.forEach((e=>{this.emit("file-added",e)})),this.emit("files-added",i),i.length>5?this.log(`Added batch of ${i.length} files`):Object.values(i).forEach((e=>{this.log(`Added file: ${e.name}\n id: ${e.id}\n type: ${e.type}`)})),i.length>0&&this.#g()}removeFiles(e){const{files:t,currentUploads:i}=this.getState(),r={...t},o={...i},s=Object.create(null);function a(e){return void 0===s[e]}e.forEach((e=>{t[e]&&(s[e]=t[e],delete r[e])})),Object.keys(o).forEach((e=>{const t=i[e].fileIDs.filter(a);if(0===t.length)return void delete o[e];const{capabilities:r}=this.getState();if(t.length!==i[e].fileIDs.length&&!r.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");o[e]={...i[e],fileIDs:t}}));const n={currentUploads:o,files:r};0===Object.keys(r).length&&(n.allowNewUpload=!0,n.error=null,n.recoveredState=null),this.setState(n),this.#w();const l=Object.keys(s);l.forEach((e=>{this.emit("file-removed",s[e])})),this.log(l.length>5?`Removed ${l.length} files`:`Removed files: ${l.join(", ")}`)}removeFile(e){this.removeFiles([e])}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;const t=this.getFile(e),i=!t.isPaused;return this.setFileState(e,{isPaused:i}),this.emit("upload-pause",t,i),i}pauseAll(){const e={...this.getState().files};Object.keys(e).filter((t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted)).forEach((t=>{const i={...e[t],isPaused:!0};e[t]=i})),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter((t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted)).forEach((t=>{const i={...e[t],isPaused:!1,error:null};e[t]=i})),this.setState({files:e}),this.emit("resume-all")}#x(){const{files:e}=this.getState();return Object.keys(e).filter((t=>{const i=e[t];return i.error&&(!i.missingRequiredMetaFields||0===i.missingRequiredMetaFields.length)}))}async#k(){const e=this.#x(),t={...this.getState().files};if(e.forEach((e=>{t[e]={...t[e],isPaused:!1,error:null}})),this.setState({files:t,error:null}),this.emit("retry-all",this.getFilesByIds(e)),0===e.length)return{successful:[],failed:[]};const i=this.#S(e,{forceAllowNewUpload:!0});return this.#D(i)}async retryAll(){const e=await this.#k();return this.emit("complete",e),e}cancelAll(){this.emit("cancel-all");const{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t),this.setState(va)}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));const t=this.#S([e],{forceAllowNewUpload:!0});return this.#D(t)}logout(){this.iteratePlugins((e=>{e.provider?.logout?.()}))}#I=(e,t)=>{const i=e?this.getFile(e.id):void 0;if(null==e||!i)return void this.log(`Not setting progress for a file that has been removed: ${e?.id}`);if(100===i.progress.percentage)return void this.log(`Not setting progress for a file that has been already uploaded: ${e.id}`);const r={bytesTotal:t.bytesTotal,percentage:null!=t.bytesTotal&&Number.isFinite(t.bytesTotal)&&t.bytesTotal>0?Math.round(t.bytesUploaded/t.bytesTotal*100):void 0};this.setFileState(e.id,null!=i.progress.uploadStarted?{progress:{...i.progress,...r,bytesUploaded:t.bytesUploaded}}:{progress:{...i.progress,...r}}),this.#w()};#C(){const e=this.#B();let t=null;null!=e&&(t=Math.round(100*e),t>100?t=100:t<0&&(t=0)),this.emit("progress",t??0),this.setState({totalProgress:t??0})}#w=ua((()=>this.#C()),500,{leading:!0,trailing:!0});[Symbol.for("uppy test: updateTotalProgress")](){return this.#C()}#B(){const e=this.getFiles().filter((e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess));if(0===e.length)return 0;if(e.every((e=>e.progress.uploadComplete)))return 1;const t=e=>null!=e.progress.bytesTotal&&0!==e.progress.bytesTotal,i=e.filter(t),r=e.filter((e=>!t(e)));if(i.every((e=>e.progress.uploadComplete))&&r.length>0&&!r.every((e=>e.progress.uploadComplete)))return null;const o=i.reduce(((e,t)=>e+(t.progress.bytesTotal??0)),0),s=i.reduce(((e,t)=>e+(t.progress.bytesUploaded||0)),0);return 0===o?0:s/o}#c(){const e=(e,t,i)=>{let r=e.message||"Unknown error";e.details&&(r+=` ${e.details}`),this.setState({error:r}),null!=t&&t.id in this.getState().files&&this.setFileState(t.id,{error:r,response:i})};this.on("error",e),this.on("upload-error",((t,i,r)=>{if(e(i,t,r),"object"==typeof i&&i.message){this.log(i.message,"error");const e=new Error(this.i18n("failedToUpload",{file:t?.name??""}));e.isUserFacing=!0,e.details=i.message,i.details&&(e.details+=` ${i.details}`),this.#u([e])}else this.#u([i])}));let t=null;this.on("upload-stalled",((e,i)=>{const{message:r}=e,o=i.map((e=>e.meta.name)).join(", ");t||(this.info({message:r,details:o},"warning",this.opts.infoTimeout),t=setTimeout((()=>{t=null}),this.opts.infoTimeout)),this.log(`${r} ${o}`.trim(),"warning")})),this.on("upload",(()=>{this.setState({error:null})})),this.on("upload-start",(e=>{const t=e.filter((e=>{const t=null!=e&&this.getFile(e.id);return t||this.log(`Not setting progress for a file that has been removed: ${e?.id}`),t})),i=Object.fromEntries(t.map((e=>[e.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:e.size}}])));this.patchFilesState(i)})),this.on("upload-progress",this.#I),this.on("upload-success",((e,t)=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${e?.id}`);const i=this.getFile(e.id).progress,r=this.#h.size>0;this.setFileState(e.id,{progress:{...i,postprocess:r?{mode:"indeterminate"}:void 0,uploadComplete:!0,...!r&&{complete:!0},percentage:100,bytesUploaded:i.bytesTotal},response:t,uploadURL:t.uploadURL,isPaused:!1}),null==e.size&&this.setFileState(e.id,{size:t.bytesUploaded||i.bytesTotal}),this.#w()})),this.on("preprocess-progress",((e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,preprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${e?.id}`)})),this.on("preprocess-complete",(e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${e?.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.preprocess,this.setState({files:t})})),this.on("postprocess-progress",((e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getState().files[e.id].progress,postprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${e?.id}`)})),this.on("postprocess-complete",(e=>{const t=e&&this.getFile(e.id);if(null==t)return void this.log(`Not setting progress for a file that has been removed: ${e?.id}`);const{postprocess:i,...r}=t.progress;this.patchFilesState({[t.id]:{progress:{...r,complete:!0}}})})),this.on("restored",(()=>{this.#w()})),this.on("dashboard:file-edit-complete",(e=>{e&&this.#f(e)})),"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("online",this.#P),window.addEventListener("offline",this.#P),setTimeout(this.#P,3e3))}updateOnlineStatus(){window.navigator.onLine??1?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}#P=this.updateOnlineStatus.bind(this);getID(){return this.opts.id}use(e,...t){if("function"!=typeof e)throw new TypeError(`Expected a plugin class, but got ${null===e?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`);const i=new e(this,...t),r=i.id;if(!r)throw new Error("Your plugin must have an id");if(!i.type)throw new Error("Your plugin must have a type");const o=this.getPlugin(r);if(o)throw new Error(`Already found a plugin named '${o.id}'. Tried to use: '${r}'.\nUppy plugins must have unique \`id\` options.`);return e.VERSION&&this.log(`Using ${r} v${e.VERSION}`),i.type in this.#s?this.#s[i.type].push(i):this.#s[i.type]=[i],i.install(),this.emit("plugin-added",i),this}getPlugin(e){for(const t of Object.values(this.#s)){const i=t.find((t=>t.id===e));if(null!=i)return i}}[Symbol.for("uppy test: getPlugins")](e){return this.#s[e]}iteratePlugins(e){Object.values(this.#s).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const t=this.#s[e.type],i=t.findIndex((t=>t.id===e.id));-1!==i&&t.splice(i,1);const r={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(r)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),this.#n(),this.iteratePlugins((e=>{this.removePlugin(e)})),"undefined"!=typeof window&&window.removeEventListener&&(window.removeEventListener("online",this.#P),window.removeEventListener("offline",this.#P))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t="info",i=3e3){const r="object"==typeof e;this.setState({info:[...this.getState().info,{type:t,message:r?e.message:e,details:r?e.details:null}]}),setTimeout((()=>this.hideInfo()),i),this.emit("info-visible")}log(e,t){const{logger:i}=this.opts;switch(t){case"error":i.error(e);break;case"warning":i.warn(e);break;default:i.debug(e)}}#z=new Map;registerRequestClient(e,t){this.#z.set(e,t)}getRequestClientForFile(e){if(!("remote"in e)||!e.remote)throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);const t=this.#z.get(e.remote.requestClientId);if(null==t)throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return t}async restore(e){this.log(`Core: Running restored upload "${e}"`);const t=await this.#D(e);return this.emit("complete",t),t}#S(e,t={}){const{forceAllowNewUpload:i=!1}=t,{allowNewUpload:r,currentUploads:o}=this.getState();if(!r&&!i)throw new Error("Cannot create a new upload: already uploading.");const s=ba();return this.emit("upload",s,this.getFilesByIds(e)),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploadBatches&&!1!==this.opts.allowMultipleUploads,currentUploads:{...o,[s]:{fileIDs:e,step:0,result:{}}}}),s}[Symbol.for("uppy test: createUpload")](...e){return this.#S(...e)}#F(e){const{currentUploads:t}=this.getState();return t[e]}addResultData(e,t){if(!this.#F(e))return void this.log(`Not setting result for an upload that has been removed: ${e}`);const{currentUploads:i}=this.getState(),r={...i[e],result:{...i[e].result,...t}};this.setState({currentUploads:{...i,[e]:r}})}#T(e){const{[e]:t,...i}=this.getState().currentUploads;this.setState({currentUploads:i})}async#D(e){const t=()=>{const{currentUploads:t}=this.getState();return t[e]};let i=t();if(!i)throw new Error("Nonexistent upload");const r=[...this.#d,...this.#p,...this.#h];try{for(let o=i.step||0;o<r.length;o++){const s=r[o];this.setState({currentUploads:{...this.getState().currentUploads,[e]:{...i,step:o}}});const{fileIDs:a}=i;if(await s(a,e),i=t(),!i)break}}catch(t){throw this.#T(e),t}if(i){i.fileIDs.forEach((e=>{const t=this.getFile(e);t?.progress.postprocess&&this.emit("postprocess-complete",t)}));const r=i.fileIDs.map((e=>this.getFile(e))),o=r.filter((e=>!e.error)),s=r.filter((e=>e.error));this.addResultData(e,{successful:o,failed:s,uploadID:e}),i=t()}let o;return i&&(o=i.result,this.#T(e)),null==o&&(this.log(`Not setting result for an upload that has been removed: ${e}`),o={successful:[],failed:[],uploadID:e}),o}async upload(){this.#s.uploader?.length||this.log("No uploader type plugins are used","warning");let{files:e}=this.getState();if(this.#x().length>0){const t=await this.#k();if(!(this.getFiles().filter((e=>null==e.progress.uploadStarted)).length>0))return this.emit("complete",t),t;({files:e}=this.getState())}const t=this.opts.onBeforeUpload(e);if(!1===t)throw new Error("Not starting the upload because onBeforeUpload returned false");t&&"object"==typeof t&&(e=t,this.setState({files:e}));try{if(this.#a.validateMinNumberOfFiles(e),!this.#m(e))throw new Is(this.i18n("missingRequiredMetaField"));const{currentUploads:t}=this.getState(),i=Object.values(t).flatMap((e=>e.fileIDs)),r=Object.keys(e).filter((e=>{const t=this.getFile(e);return t&&!t.progress.uploadStarted&&!i.includes(e)})),o=this.#S(r),s=await this.#D(o);return this.emit("complete",s),s}catch(e){throw this.#u([e]),e}}}var xa,ka,Sa={exports:{}},Da=(xa||(xa=1,ka=Sa,function(){var e={}.hasOwnProperty;function t(){for(var e="",t=0;t<arguments.length;t++){var o=arguments[t];o&&(e=r(e,i(o)))}return e}function i(i){if("string"==typeof i||"number"==typeof i)return i;if("object"!=typeof i)return"";if(Array.isArray(i))return t.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var o="";for(var s in i)e.call(i,s)&&i[s]&&(o=r(o,s));return o}function r(e,t){return t?e?e+" "+t:e+t:e}ka.exports?(t.default=t,ka.exports=t):window.classNames=t}()),Sa.exports),Ia=ge(Da),Ca=ge(da());
759
+ /*!
760
+ Copyright (c) 2018 Jed Watson.
761
+ Licensed under the MIT License (MIT), see
762
+ http://jedwatson.github.io/classnames
763
+ */function Ba(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var Pa="undefined"!=typeof self?self:global;const za="undefined"!=typeof navigator,Fa=za&&"undefined"==typeof HTMLImageElement,Ta=!("undefined"==typeof global||"undefined"==typeof process||!process.versions||!process.versions.node),Aa=Pa.Buffer,Ea=!!Aa,_a=e=>void 0!==e;function Ma(e){return void 0===e||(e instanceof Map?0===e.size:0===Object.values(e).filter(_a).length)}function Ra(e){let t=new Error(e);throw delete t.stack,t}function Na(e){let t=function(e){let t=0;return e.ifd0.enabled&&(t+=1024),e.exif.enabled&&(t+=2048),e.makerNote&&(t+=2048),e.userComment&&(t+=1024),e.gps.enabled&&(t+=512),e.interop.enabled&&(t+=100),e.ifd1.enabled&&(t+=1024),t+2048}(e);return e.jfif.enabled&&(t+=50),e.xmp.enabled&&(t+=2e4),e.iptc.enabled&&(t+=14e3),e.icc.enabled&&(t+=6e3),t}const Ua=e=>String.fromCharCode.apply(null,e),Oa="undefined"!=typeof TextDecoder?new TextDecoder("utf-8"):void 0;class $a{static from(e,t){return e instanceof this&&e.le===t?e:new $a(e,void 0,void 0,t)}constructor(e,t=0,i,r){if("boolean"==typeof r&&(this.le=r),Array.isArray(e)&&(e=new Uint8Array(e)),0===e)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){void 0===i&&(i=e.byteLength-t);let r=new DataView(e,t,i);this._swapDataView(r)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof $a){void 0===i&&(i=e.byteLength-t),(t+=e.byteOffset)+i>e.byteOffset+e.byteLength&&Ra("Creating view outside of available memory in ArrayBuffer");let r=new DataView(e.buffer,t,i);this._swapDataView(r)}else if("number"==typeof e){let t=new DataView(new ArrayBuffer(e));this._swapDataView(t)}else Ra("Invalid input argument for BufferView: "+e)}_swapArrayBuffer(e){this._swapDataView(new DataView(e))}_swapBuffer(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength))}_swapDataView(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength}_lengthToEnd(e){return this.byteLength-e}set(e,t,i=$a){return e instanceof DataView||e instanceof $a?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||Ra("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new i(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new $a(this,e,t)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(e,t){return new Uint8Array(this.buffer,this.byteOffset+e,t)}getString(e=0,t=this.byteLength){return i=this.getUint8Array(e,t),Oa?Oa.decode(i):Ea?Buffer.from(i).toString("utf8"):decodeURIComponent(escape(Ua(i)));var i}getLatin1String(e=0,t=this.byteLength){let i=this.getUint8Array(e,t);return Ua(i)}getUnicodeString(e=0,t=this.byteLength){const i=[];for(let r=0;r<t&&e+r<this.byteLength;r+=2)i.push(this.getUint16(e+r));return Ua(i)}getInt8(e){return this.dataView.getInt8(e)}getUint8(e){return this.dataView.getUint8(e)}getInt16(e,t=this.le){return this.dataView.getInt16(e,t)}getInt32(e,t=this.le){return this.dataView.getInt32(e,t)}getUint16(e,t=this.le){return this.dataView.getUint16(e,t)}getUint32(e,t=this.le){return this.dataView.getUint32(e,t)}getFloat32(e,t=this.le){return this.dataView.getFloat32(e,t)}getFloat64(e,t=this.le){return this.dataView.getFloat64(e,t)}getFloat(e,t=this.le){return this.dataView.getFloat32(e,t)}getDouble(e,t=this.le){return this.dataView.getFloat64(e,t)}getUintBytes(e,t,i){switch(t){case 1:return this.getUint8(e,i);case 2:return this.getUint16(e,i);case 4:return this.getUint32(e,i);case 8:return this.getUint64&&this.getUint64(e,i)}}getUint(e,t,i){switch(t){case 8:return this.getUint8(e,i);case 16:return this.getUint16(e,i);case 32:return this.getUint32(e,i);case 64:return this.getUint64&&this.getUint64(e,i)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}}function ja(e,t){Ra(`${e} '${t}' was not loaded, try using full build of exifr.`)}class Wa extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||ja(this.kind,e),t&&(e in t||function(e,t){Ra(`Unknown ${e} '${t}'.`)}(this.kind,e),t[e].enabled||ja(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}}var La=new Wa("file parser"),Ha=new Wa("segment parser"),Va=new Wa("file reader");let Ja=Pa.fetch;function Ka(e,t){return(i=e).startsWith("data:")||i.length>1e4?Ga(e,t,"base64"):Ta&&e.includes("://")?qa(e,t,"url",Xa):Ta?Ga(e,t,"fs"):za?qa(e,t,"url",Xa):void Ra("Invalid input argument");var i}async function qa(e,t,i,r){return Va.has(i)?Ga(e,t,i):r?async function(e,t){let i=await t(e);return new $a(i)}(e,r):void Ra(`Parser ${i} is not loaded`)}async function Ga(e,t,i){let r=new(Va.get(i))(e,t);return await r.read(),r}const Xa=e=>Ja(e).then((e=>e.arrayBuffer())),Ya=e=>new Promise(((t,i)=>{let r=new FileReader;r.onloadend=()=>t(r.result||new ArrayBuffer),r.onerror=i,r.readAsArrayBuffer(e)})),Za=new Map,Qa=new Map,en=new Map,tn=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],rn=["jfif","xmp","icc","iptc","ihdr"],on=["tiff",...rn],sn=["ifd0","ifd1","exif","gps","interop"],an=[...on,...sn],nn=["makerNote","userComment"],ln=["translateKeys","translateValues","reviveValues","multiSegment"],dn=[...ln,"sanitize","mergeOutput","silentErrors"];class pn{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}}class hn extends pn{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,i,r){if(super(),Ba(this,"enabled",!1),Ba(this,"skip",new Set),Ba(this,"pick",new Set),Ba(this,"deps",new Set),Ba(this,"translateKeys",!1),Ba(this,"translateValues",!1),Ba(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(r),this.canBeFiltered=sn.includes(e),this.canBeFiltered&&(this.dict=Za.get(e)),void 0!==i)if(Array.isArray(i))this.parse=this.enabled=!0,this.canBeFiltered&&i.length>0&&this.translateTagSet(i,this.pick);else if("object"==typeof i){if(this.enabled=!0,this.parse=!1!==i.parse,this.canBeFiltered){let{pick:e,skip:t}=i;e&&e.length>0&&this.translateTagSet(e,this.pick),t&&t.length>0&&this.translateTagSet(t,this.skip)}this.applyInheritables(i)}else!0===i||!1===i?this.parse=this.enabled=i:Ra(`Invalid options argument: ${i}`)}applyInheritables(e){let t,i;for(t of ln)i=e[t],void 0!==i&&(this[t]=i)}translateTagSet(e,t){if(this.dict){let i,r,{tagKeys:o,tagValues:s}=this.dict;for(i of e)"string"==typeof i?(r=s.indexOf(i),-1===r&&(r=o.indexOf(Number(i))),-1!==r&&t.add(Number(o[r]))):t.add(i)}else for(let i of e)t.add(i)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,yn(this.pick,this.deps)):this.enabled&&this.pick.size>0&&yn(this.pick,this.deps)}}var cn={jfif:!1,tiff:!0,xmp:!1,icc:!1,iptc:!1,ifd0:!0,ifd1:!1,exif:!0,gps:!0,interop:!1,ihdr:void 0,makerNote:!1,userComment:!1,multiSegment:!1,skip:[],pick:[],translateKeys:!0,translateValues:!0,reviveValues:!0,sanitize:!0,mergeOutput:!0,silentErrors:!0,chunked:!0,firstChunkSize:void 0,firstChunkSizeNode:512,firstChunkSizeBrowser:65536,chunkSize:65536,chunkLimit:5},un=new Map;class fn extends pn{static useCached(e){let t=un.get(e);return void 0!==t||(t=new this(e),un.set(e,t)),t}constructor(e){super(),!0===e?this.setupFromTrue():void 0===e?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):"object"==typeof e?this.setupFromObject(e):Ra(`Invalid options argument ${e}`),void 0===this.firstChunkSize&&(this.firstChunkSize=za?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of tn)this[e]=cn[e];for(e of dn)this[e]=cn[e];for(e of nn)this[e]=cn[e];for(e of an)this[e]=new hn(e,cn[e],void 0,this)}setupFromTrue(){let e;for(e of tn)this[e]=cn[e];for(e of dn)this[e]=cn[e];for(e of nn)this[e]=!0;for(e of an)this[e]=new hn(e,!0,void 0,this)}setupFromArray(e){let t;for(t of tn)this[t]=cn[t];for(t of dn)this[t]=cn[t];for(t of nn)this[t]=cn[t];for(t of an)this[t]=new hn(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,sn)}setupFromObject(e){let t;for(t of(sn.ifd0=sn.ifd0||sn.image,sn.ifd1=sn.ifd1||sn.thumbnail,Object.assign(this,e),tn))this[t]=bn(e[t],cn[t]);for(t of dn)this[t]=bn(e[t],cn[t]);for(t of nn)this[t]=bn(e[t],cn[t]);for(t of on)this[t]=new hn(t,cn[t],e[t],this);for(t of sn)this[t]=new hn(t,cn[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,sn,an),!0===e.tiff?this.batchEnableWithBool(sn,!0):!1===e.tiff?this.batchEnableWithUserValue(sn,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,sn):"object"==typeof e.tiff&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,sn)}batchEnableWithBool(e,t){for(let i of e)this[i].enabled=t}batchEnableWithUserValue(e,t){for(let i of e){let e=t[i];this[i].enabled=!1!==e&&void 0!==e}}setupGlobalFilters(e,t,i,r=i){if(e&&e.length){for(let e of r)this[e].enabled=!1;let t=mn(e,i);for(let[e,i]of t)yn(this[e].pick,i),this[e].enabled=!0}else if(t&&t.length){let e=mn(t,i);for(let[t,i]of e)yn(this[t].skip,i)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:i,iptc:r,icc:o}=this;this.makerNote?t.deps.add(37500):t.skip.add(37500),this.userComment?t.deps.add(37510):t.skip.add(37510),i.enabled||e.skip.add(700),r.enabled||e.skip.add(33723),o.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:i,interop:r}=this;r.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),i.needed&&e.deps.add(34853),this.tiff.enabled=sn.some((e=>!0===this[e].enabled))||this.makerNote||this.userComment;for(let e of sn)this[e].finalizeFilters()}get onlyTiff(){return!rn.map((e=>this[e].enabled)).some((e=>!0===e))&&this.tiff.enabled}checkLoadedPlugins(){for(let e of on)this[e].enabled&&!Ha.has(e)&&ja("segment parser",e)}}function mn(e,t){let i,r,o,s,a=[];for(o of t){for(s of(i=Za.get(o),r=[],i))(e.includes(s[0])||e.includes(s[1]))&&r.push(s[0]);r.length&&a.push([o,r])}return a}function bn(e,t){return void 0!==e?e:void 0!==t?t:void 0}function yn(e,t){for(let i of t)e.add(i)}Ba(fn,"default",cn);class gn{constructor(e){Ba(this,"parsers",{}),Ba(this,"output",{}),Ba(this,"errors",[]),Ba(this,"pushToErrors",(e=>this.errors.push(e))),this.options=fn.useCached(e)}async read(e){this.file=await function(e,t){return"string"==typeof e?Ka(e,t):za&&!Fa&&e instanceof HTMLImageElement?Ka(e.src,t):e instanceof Uint8Array||e instanceof ArrayBuffer||e instanceof DataView?new $a(e):za&&e instanceof Blob?qa(e,t,"blob",Ya):void Ra("Invalid input argument")}(e,this.options)}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[i,r]of La)if(r.canHandle(e,t))return this.fileParser=new r(this.options,this.file,this.parsers),e[i]=!0;this.file.close&&this.file.close(),Ra("Unknown file format")}async parse(){let{output:e,errors:t}=this;return this.setup(),this.options.silentErrors?(await this.executeParsers().catch(this.pushToErrors),t.push(...this.fileParser.errors)):await this.executeParsers(),this.file.close&&this.file.close(),this.options.silentErrors&&t.length>0&&(e.errors=t),Ma(i=e)?void 0:i;var i}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map((async t=>{let i=await t.parse();t.assignToOutput(e,i)}));this.options.silentErrors&&(t=t.map((e=>e.catch(this.pushToErrors)))),await Promise.all(t)}async extractThumbnail(){this.setup();let{options:e,file:t}=this,i=Ha.get("tiff",e);var r;if(t.tiff?r={start:0,type:"tiff"}:t.jpeg&&(r=await this.fileParser.getOrFindSegment("tiff")),void 0===r)return;let o=await this.fileParser.ensureSegmentChunk(r),s=this.parsers.tiff=new i(o,e,t),a=await s.extractThumbnail();return t.close&&t.close(),a}}class vn{static findPosition(e,t){let i=e.getUint16(t+2)+2,r="function"==typeof this.headerLength?this.headerLength(e,t,i):this.headerLength,o=t+r,s=i-r;return{offset:t,length:i,headerLength:r,start:o,size:s,end:o+s}}static parse(e,t={}){return new this(e,new fn({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof $a?e:new $a(e)}constructor(e,t={},i){Ba(this,"errors",[]),Ba(this,"raw",new Map),Ba(this,"handleError",(e=>{if(!this.options.silentErrors)throw e;this.errors.push(e.message)})),this.chunk=this.normalizeInput(e),this.file=i,this.type=this.constructor.type,this.globalOptions=this.options=t,this.localOptions=t[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}translate(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}get output(){return this.translated?this.translated:this.raw?Object.fromEntries(this.raw):void 0}translateBlock(e,t){let i=en.get(t),r=Qa.get(t),o=Za.get(t),s=this.options[t],a=s.reviveValues&&!!i,n=s.translateValues&&!!r,l=s.translateKeys&&!!o,d={};for(let[t,s]of e)a&&i.has(t)?s=i.get(t)(s):n&&r.has(t)&&(s=this.translateValue(s,r.get(t))),l&&o.has(t)&&(t=o.get(t)||t),d[t]=s;return d}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,i){if(this.globalOptions.mergeOutput)return Object.assign(e,i);e[t]?Object.assign(e[t],i):e[t]=i}}function wn(e){return 192===e||194===e||196===e||219===e||221===e||218===e||254===e}function xn(e){return e>=224&&e<=239}function kn(e,t,i){for(let[r,o]of Ha)if(o.canHandle(e,t,i))return r}Ba(vn,"headerLength",4),Ba(vn,"type",void 0),Ba(vn,"multiSegment",!1),Ba(vn,"canHandle",(()=>!1));class Sn extends class{constructor(e,t,i){Ba(this,"errors",[]),Ba(this,"ensureSegmentChunk",(async e=>{let t=e.start,i=e.size||65536;if(this.file.chunked)if(this.file.available(t,i))e.chunk=this.file.subarray(t,i);else try{e.chunk=await this.file.readChunk(t,i)}catch(t){Ra(`Couldn't read segment: ${JSON.stringify(e)}. ${t.message}`)}else this.file.byteLength>t+i?e.chunk=this.file.subarray(t,i):void 0===e.size?e.chunk=this.file.subarray(t):Ra("Segment unreachable: "+JSON.stringify(e));return e.chunk})),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=t,this.parsers=i}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let i=new(Ha.get(e))(t,this.options,this.file);return this.parsers[e]=i}createParsers(e){for(let t of e){let{type:e,chunk:i}=t,r=this.options[e];if(r&&r.enabled){let t=this.parsers[e];t&&t.append||t||this.createParser(e,i)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}{constructor(...e){super(...e),Ba(this,"appSegments",[]),Ba(this,"jpegSegments",[]),Ba(this,"unknownSegments",[])}static canHandle(e,t){return 65496===t}async parse(){await this.findAppSegments(),await this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)}setupSegmentFinderArgs(e){!0===e?(this.findAll=!0,this.wanted=new Set(Ha.keyList())):(e=void 0===e?Ha.keyList().filter((e=>this.options[e].enabled)):e.filter((e=>this.options[e].enabled&&Ha.has(e))),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}async findAppSegments(e=0,t){this.setupSegmentFinderArgs(t);let{file:i,findAll:r,wanted:o,remaining:s}=this;if(!r&&this.file.chunked&&(r=Array.from(o).some((e=>Ha.get(e).multiSegment&&this.options[e].multiSegment)),r&&await this.file.readWhole()),e=this.findAppSegmentsInRange(e,i.byteLength),!this.options.onlyTiff&&i.chunked){let t=!1;for(;s.size>0&&!t&&(i.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:r}=i,o=this.appSegments.some((e=>!this.file.available(e.offset||e.start,e.length||e.size)));if(t=e>r&&!o?!await i.readNextChunk(e):!await i.readNextChunk(r),void 0===(e=this.findAppSegmentsInRange(e,i.byteLength)))return}}}findAppSegmentsInRange(e,t){t-=2;let i,r,o,s,a,n,{file:l,findAll:d,wanted:p,remaining:h,options:c}=this;for(;e<t;e++)if(255===l.getUint8(e))if(i=l.getUint8(e+1),xn(i)){if(r=l.getUint16(e+2),o=kn(l,e,r),o&&p.has(o)&&(s=Ha.get(o),a=s.findPosition(l,e),n=c[o],a.type=o,this.appSegments.push(a),!d&&(s.multiSegment&&n.multiSegment?(this.unfinishedMultiSegment=a.chunkNumber<a.chunkCount,this.unfinishedMultiSegment||h.delete(o)):h.delete(o),0===h.size)))break;c.recordUnknownSegments&&(a=vn.findPosition(l,e),a.marker=i,this.unknownSegments.push(a)),e+=r+1}else if(wn(i)){if(r=l.getUint16(e+2),218===i&&!1!==c.stopAfterSos)return;c.recordJpegSegments&&this.jpegSegments.push({offset:e,length:r,marker:i}),e+=r+1}return e}mergeMultiSegments(){if(!this.appSegments.some((e=>e.multiSegment)))return;let e=function(e){let t,i,r,o=new Map;for(let s=0;s<e.length;s++)t=e[s],i=t.type,o.has(i)?r=o.get(i):o.set(i,r=[]),r.push(t);return Array.from(o)}(this.appSegments);this.mergedAppSegments=e.map((([e,t])=>{let i=Ha.get(e,this.options);return i.handleMultiSegments?{type:e,chunk:i.handleMultiSegments(t)}:t[0]}))}getSegment(e){return this.appSegments.find((t=>t.type===e))}async getOrFindSegment(e){let t=this.getSegment(e);return void 0===t&&(await this.findAppSegments(0,[e]),t=this.getSegment(e)),t}}Ba(Sn,"type","jpeg"),La.set("jpeg",Sn);const Dn=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4];class In extends vn{parseHeader(){var e=this.chunk.getUint16();18761===e?this.le=!0:19789===e&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,i=new Map){let{pick:r,skip:o}=this.options[t];r=new Set(r);let s=r.size>0,a=0===o.size,n=this.chunk.getUint16(e);e+=2;for(let l=0;l<n;l++){let n=this.chunk.getUint16(e);if(s){if(r.has(n)&&(i.set(n,this.parseTag(e,n,t)),r.delete(n),0===r.size))break}else!a&&o.has(n)||i.set(n,this.parseTag(e,n,t));e+=12}return i}parseTag(e,t,i){let{chunk:r}=this,o=r.getUint16(e+2),s=r.getUint32(e+4),a=Dn[o];if(a*s<=4?e+=8:e=r.getUint32(e+8),(o<1||o>13)&&Ra(`Invalid TIFF value type. block: ${i.toUpperCase()}, tag: ${t.toString(16)}, type: ${o}, offset ${e}`),e>r.byteLength&&Ra(`Invalid TIFF value offset. block: ${i.toUpperCase()}, tag: ${t.toString(16)}, type: ${o}, offset ${e} is outside of chunk size ${r.byteLength}`),1===o)return r.getUint8Array(e,s);if(2===o)return""===(n=function(e){for(;e.endsWith("\0");)e=e.slice(0,-1);return e}(n=r.getString(e,s)).trim())?void 0:n;var n;if(7===o)return r.getUint8Array(e,s);if(1===s)return this.parseTagValue(o,e);{let t=new(function(e){switch(e){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:case 10:default:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 11:return Float32Array;case 12:return Float64Array}}(o))(s),i=a;for(let r=0;r<s;r++)t[r]=this.parseTagValue(o,e),e+=i;return t}}parseTagValue(e,t){let{chunk:i}=this;switch(e){case 1:return i.getUint8(t);case 3:return i.getUint16(t);case 4:case 13:return i.getUint32(t);case 5:return i.getUint32(t)/i.getUint32(t+4);case 6:return i.getInt8(t);case 8:return i.getInt16(t);case 9:return i.getInt32(t);case 10:return i.getInt32(t)/i.getInt32(t+4);case 11:return i.getFloat(t);case 12:return i.getDouble(t);default:Ra(`Invalid tiff type ${e}`)}}}class Cn extends In{static canHandle(e,t){return 225===e.getUint8(t+1)&&1165519206===e.getUint32(t+4)&&0===e.getUint16(t+8)}async parse(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&await this.parseIfd0Block(),e.exif.enabled&&await this.safeParse("parseExifBlock"),e.gps.enabled&&await this.safeParse("parseGpsBlock"),e.interop.enabled&&await this.safeParse("parseInteropBlock"),e.ifd1.enabled&&await this.safeParse("parseThumbnailBlock"),this.createOutput()}safeParse(e){let t=this[e]();return void 0!==t.catch&&(t=t.catch(this.handleError)),t}findIfd0Offset(){void 0===this.ifd0Offset&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(void 0===this.ifd1Offset){this.findIfd0Offset();let e=this.chunk.getUint16(this.ifd0Offset);this.ifd1Offset=this.chunk.getUint32(this.ifd0Offset+2+12*e)}}parseBlock(e,t){let i=new Map;return this[t]=i,this.parseTags(e,t,i),i}async parseIfd0Block(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&Ra("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&Ra(`IFD0 offset points to outside of file.\nthis.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,Na(this.options));let t=this.parseBlock(this.ifd0Offset,"ifd0");return 0!==t.size?(this.exifOffset=t.get(34665),this.interopOffset=t.get(40965),this.gpsOffset=t.get(34853),this.xmp=t.get(700),this.iptc=t.get(33723),this.icc=t.get(34675),this.options.sanitize&&(t.delete(34665),t.delete(40965),t.delete(34853),t.delete(700),t.delete(33723),t.delete(34675)),t):void 0}async parseExifBlock(){if(this.exif)return;if(this.ifd0||await this.parseIfd0Block(),void 0===this.exifOffset)return;this.file.tiff&&await this.file.ensureChunk(this.exifOffset,Na(this.options));let e=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=e.get(40965)),this.makerNote=e.get(37500),this.userComment=e.get(37510),this.options.sanitize&&(e.delete(40965),e.delete(37500),e.delete(37510)),this.unpack(e,41728),this.unpack(e,41729),e}unpack(e,t){let i=e.get(t);i&&1===i.length&&e.set(t,i[0])}async parseGpsBlock(){if(this.gps)return;if(this.ifd0||await this.parseIfd0Block(),void 0===this.gpsOffset)return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",Bn(...e.get(2),e.get(1))),e.set("longitude",Bn(...e.get(4),e.get(3)))),e}async parseInteropBlock(){if(!this.interop&&(this.ifd0||await this.parseIfd0Block(),void 0!==this.interopOffset||this.exif||await this.parseExifBlock(),void 0!==this.interopOffset))return this.parseBlock(this.interopOffset,"interop")}async parseThumbnailBlock(e=!1){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1}async extractThumbnail(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||await this.parseThumbnailBlock(!0),void 0===this.ifd1)return;let e=this.ifd1.get(513),t=this.ifd1.get(514);return this.chunk.getUint8Array(e,t)}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,t,i,r={};for(t of sn)if(e=this[t],!Ma(e))if(i=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if("ifd1"===t)continue;Object.assign(r,i)}else r[t]=i;return this.makerNote&&(r.makerNote=this.makerNote),this.userComment&&(r.userComment=this.userComment),r}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[i,r]of Object.entries(t))this.assignObjectToOutput(e,i,r)}}function Bn(e,t,i,r){var o=e+t/60+i/3600;return"S"!==r&&"W"!==r||(o*=-1),o}Ba(Cn,"type","tiff"),Ba(Cn,"headerLength",10),Ha.set("tiff",Cn);const Pn={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1};Object.assign({},Pn,{firstChunkSize:4e4,gps:[1,2,3,4]}),Object.assign({},Pn,{tiff:!1,ifd1:!0,mergeOutput:!1});const zn=Object.assign({},Pn,{firstChunkSize:4e4,ifd0:[274]}),Fn=Object.freeze({1:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:0,rad:0},2:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:0,rad:0},3:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:180,rad:180*Math.PI/180},4:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:180,rad:180*Math.PI/180},5:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:90,rad:90*Math.PI/180},6:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:90,rad:90*Math.PI/180},7:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:270,rad:270*Math.PI/180},8:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:270,rad:270*Math.PI/180}});let Tn=!0,An=!0;if("object"==typeof navigator){let e=navigator.userAgent;if(e.includes("iPad")||e.includes("iPhone")){let t=e.match(/OS (\d+)_(\d+)/);if(t){let[,e,i]=t,r=Number(e)+.1*Number(i);Tn=r<13.4,An=!1}}else if(e.includes("OS X 10")){let[,t]=e.match(/OS X 10[_.](\d+)/);Tn=An=Number(t)<15}if(e.includes("Chrome/")){let[,t]=e.match(/Chrome\/(\d+)/);Tn=An=Number(t)<81}else if(e.includes("Firefox/")){let[,t]=e.match(/Firefox\/(\d+)/);Tn=An=Number(t)<77}}class En extends $a{constructor(...e){super(...e),Ba(this,"ranges",new _n),0!==this.byteLength&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,i){if(0===e&&0===this.byteLength&&i){let e=new DataView(i.buffer||i,i.byteOffset,i.byteLength);this._swapDataView(e)}else{let i=e+t;if(i>this.byteLength){let{dataView:e}=this._extend(i);this._swapDataView(e)}}}_extend(e){let t;t=Ea?Aa.allocUnsafe(e):new Uint8Array(e);let i=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:i}}subarray(e,t,i=!1){return t=t||this._lengthToEnd(e),i&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,i=!1){i&&this._tryExtend(t,e.byteLength,e);let r=super.set(e,t);return this.ranges.add(t,r.byteLength),r}async ensureChunk(e,t){this.chunked&&(this.ranges.available(e,t)||await this.readChunk(e,t))}available(e,t){return this.ranges.available(e,t)}}class _n{constructor(){Ba(this,"list",[])}get length(){return this.list.length}add(e,t,i=0){let r=e+t,o=this.list.filter((t=>Mn(e,t.offset,r)||Mn(e,t.end,r)));if(o.length>0){e=Math.min(e,...o.map((e=>e.offset))),r=Math.max(r,...o.map((e=>e.end))),t=r-e;let i=o.shift();i.offset=e,i.length=t,i.end=r,this.list=this.list.filter((e=>!o.includes(e)))}else this.list.push({offset:e,length:t,end:r})}available(e,t){let i=e+t;return this.list.some((t=>t.offset<=e&&i<=t.end))}}function Mn(e,t,i){return e<=t&&t<=i}class Rn extends En{constructor(e,t){super(0),Ba(this,"chunksRead",0),this.input=e,this.options=t}async readWhole(){this.chunked=!1,await this.readChunk(this.nextChunkOffset)}async readChunked(){this.chunked=!0,await this.readChunk(0,this.options.firstChunkSize)}async readNextChunk(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let t=this.options.chunkSize,i=await this.readChunk(e,t);return!!i&&i.byteLength===t}async readChunk(e,t){if(this.chunksRead++,0!==(t=this.safeWrapAddress(e,t)))return this._readChunk(e,t)}safeWrapAddress(e,t){return void 0!==this.size&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(0!==this.ranges.list.length)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return void 0!==this.size&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}}Va.set("blob",class extends Rn{async readWhole(){this.chunked=!1;let e=await Ya(this.input);this._swapArrayBuffer(e)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}async _readChunk(e,t){let i=this.input.slice(e,t?e+t:void 0),r=await Ya(i);return this.set(r,e,!0)}});var Nn={strings:{generatingThumbnails:"Generating thumbnails..."}};const Un={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1};class On extends Bs{static VERSION="5.1.0";queue;queueProcessing;defaultThumbnailDimension;thumbnailType;constructor(e,t){if(super(e,{...Un,...t}),this.type="modifier",this.id=this.opts.id||"ThumbnailGenerator",this.title="Thumbnail Generator",this.queue=[],this.queueProcessing=!1,this.defaultThumbnailDimension=200,this.thumbnailType=this.opts.thumbnailType,this.defaultLocale=Nn,this.i18nInit(),this.opts.lazy&&this.opts.waitForThumbnailsBeforeUpload)throw new Error("ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.")}createThumbnail(e,t,i){if(null==e.data)throw new Error("File data is empty");const r=URL.createObjectURL(e.data),o=new Promise(((e,t)=>{const i=new Image;i.src=r,i.addEventListener("load",(()=>{URL.revokeObjectURL(r),e(i)})),i.addEventListener("error",(e=>{URL.revokeObjectURL(r),t(e.error||new Error("Could not create thumbnail"))}))})),s=async function(e){let t=await async function(e){let t=new gn(zn);await t.read(e);let i=await t.parse();if(i&&i.ifd0)return i.ifd0[274]}(e);return Object.assign({canvas:Tn,css:An},Fn[t])}(e.data).catch((()=>1));return Promise.all([o,s]).then((([e,r])=>{const o=this.getProportionalDimensions(e,t,i,r.deg),s=function(e,t){let i=e.width,r=e.height;90!==t.deg&&270!==t.deg||(i=e.height,r=e.width);const o=document.createElement("canvas");o.width=i,o.height=r;const s=o.getContext("2d");return s.translate(i/2,r/2),t.canvas&&(s.rotate(t.rad),s.scale(t.scaleX,t.scaleY)),s.drawImage(e,-e.width/2,-e.height/2,e.width,e.height),o}(e,r);return function(e,t,i){try{e.getContext("2d").getImageData(0,0,1,1)}catch(e){if(18===e.code)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return e.toBlob?new Promise((r=>{e.toBlob(r,t,i)})).then((e=>{if(null===e)throw new Error("cannot read image, probably an svg with external resources");return e})):Promise.resolve().then((()=>function(e){const t=wr.exec(e),i={}.mimeType??t?.[1]??"plain/text";let r;if(null!=t?.[2]){const e=atob(decodeURIComponent(t[3])),i=new Uint8Array(e.length);for(let t=0;t<e.length;t++)i[t]=e.charCodeAt(t);r=[i]}else null!=t?.[3]&&(r=[decodeURIComponent(t[3])]);return new Blob(r,{type:i})}(e.toDataURL(t,i)))).then((e=>{if(null===e)throw new Error("could not extract blob, probably an old browser");return e}))}(this.resizeImage(s,o.width,o.height),this.thumbnailType,80)})).then((e=>URL.createObjectURL(e)))}getProportionalDimensions(e,t,i,r){let o=e.width/e.height;if(90!==r&&270!==r||(o=e.height/e.width),null!=t){let i=t;return e.width<t&&(i=e.width),{width:i,height:Math.round(i/o)}}if(null!=i){let t=i;return e.height<i&&(t=e.height),{width:Math.round(t*o),height:t}}return{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/o)}}resizeImage(e,t,i){let r=function(e){const t=e.width/e.height,i=5e6,r=4096;let o=Math.floor(Math.sqrt(i*t)),s=Math.floor(i/Math.sqrt(i*t));if(o>r&&(o=r,s=Math.round(o/t)),s>r&&(s=r,o=Math.round(t*s)),e.width>o){const t=document.createElement("canvas");return t.width=o,t.height=s,t.getContext("2d").drawImage(e,0,0,o,s),t}return e}(e),o=Math.ceil(Math.log2(r.width/t));o<1&&(o=1);let s=t*2**(o-1),a=i*2**(o-1);for(;o--;){const e=document.createElement("canvas");e.width=s,e.height=a,e.getContext("2d").drawImage(r,0,0,s,a),r=e,s=Math.round(s/2),a=Math.round(a/2)}return r}setPreviewURL(e,t){this.uppy.setFileState(e,{preview:t})}addToQueue(e){this.queue.push(e),!1===this.queueProcessing&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){const e=this.uppy.getFile(this.queue.shift());return e?this.requestThumbnail(e).catch((()=>{})).then((()=>this.processQueue())):(this.uppy.log("[ThumbnailGenerator] file was removed before a thumbnail could be generated, but not removed from the queue. This is probably a bug","error"),Promise.resolve())}return this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated"),Promise.resolve()}requestThumbnail(e){return Or(e.type)&&!e.isRemote?this.createThumbnail(e,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then((t=>{this.setPreviewURL(e.id,t),this.uppy.log(`[ThumbnailGenerator] Generated thumbnail for ${e.id}`),this.uppy.emit("thumbnail:generated",this.uppy.getFile(e.id),t)})).catch((t=>{this.uppy.log(`[ThumbnailGenerator] Failed thumbnail for ${e.id}:`,"warning"),this.uppy.log(t,"warning"),this.uppy.emit("thumbnail:error",this.uppy.getFile(e.id),t)})):Promise.resolve()}onFileAdded=e=>{!e.preview&&e.data&&Or(e.type)&&!e.isRemote&&this.addToQueue(e.id)};onCancelRequest=e=>{const t=this.queue.indexOf(e.id);-1!==t&&this.queue.splice(t,1)};onFileRemoved=e=>{const t=this.queue.indexOf(e.id);-1!==t&&this.queue.splice(t,1),e.preview&&Ur(e.preview)&&URL.revokeObjectURL(e.preview)};onRestored=()=>{this.uppy.getFiles().filter((e=>e.isRestored)).forEach((e=>{e.preview&&!Ur(e.preview)||this.addToQueue(e.id)}))};onAllFilesRemoved=()=>{this.queue=[]};waitUntilAllProcessed=e=>{e.forEach((e=>{const t=this.uppy.getFile(e);this.uppy.emit("preprocess-progress",t,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})}));const t=()=>{e.forEach((e=>{const t=this.uppy.getFile(e);this.uppy.emit("preprocess-complete",t)}))};return new Promise((e=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",(()=>{t(),e()})):(t(),e())}))};install(){this.uppy.on("file-removed",this.onFileRemoved),this.uppy.on("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("thumbnail:cancel",this.onCancelRequest)):(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("file-added",this.onFileAdded),this.uppy.on("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.addPreProcessor(this.waitUntilAllProcessed)}uninstall(){this.uppy.off("file-removed",this.onFileRemoved),this.uppy.off("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("thumbnail:cancel",this.onCancelRequest)):(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("file-added",this.onFileAdded),this.uppy.off("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.removePreProcessor(this.waitUntilAllProcessed)}}class $n extends uo{fileInput=null;folderInput=null;mobilePhotoFileInput=null;mobileVideoFileInput=null;triggerFileInputClick=()=>{this.fileInput?.click()};triggerFolderInputClick=()=>{this.folderInput?.click()};triggerVideoCameraInputClick=()=>{this.mobileVideoFileInput?.click()};triggerPhotoCameraInputClick=()=>{this.mobilePhotoFileInput?.click()};onFileInputChange=e=>{this.props.handleInputChange(e),e.currentTarget.value=""};renderHiddenInput=(e,t)=>Mo("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:1!==this.props.maxNumberOfFiles,onChange:this.onFileInputChange,accept:this.props.allowedFileTypes?.join(", "),ref:t});renderHiddenCameraInput=(e,t,i)=>Mo("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${e}`,onChange:this.onFileInputChange,capture:""===t?"environment":t,accept:{photo:"image/*",video:"video/*"}[e],ref:i});renderMyDeviceAcquirer=()=>Mo("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice",children:Mo("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerFileInputClick,children:[Mo("div",{className:"uppy-DashboardTab-inner",children:Mo("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:Mo("path",{d:"M8.45 22.087l-1.305-6.674h17.678l-1.572 6.674H8.45zm4.975-12.412l1.083 1.765a.823.823 0 00.715.386h7.951V13.5H8.587V9.675h4.838zM26.043 13.5h-1.195v-2.598c0-.463-.336-.75-.798-.75h-8.356l-1.082-1.766A.823.823 0 0013.897 8H7.728c-.462 0-.815.256-.815.718V13.5h-.956a.97.97 0 00-.746.37.972.972 0 00-.19.81l1.724 8.565c.095.44.484.755.933.755H24c.44 0 .824-.3.929-.727l2.043-8.568a.972.972 0 00-.176-.825.967.967 0 00-.753-.38z",fill:"currentcolor","fill-rule":"evenodd"})})}),Mo("div",{className:"uppy-DashboardTab-name",children:this.props.i18n("myDevice")})]})});renderPhotoCamera=()=>Mo("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera",children:Mo("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerPhotoCameraInputClick,children:[Mo("div",{className:"uppy-DashboardTab-inner",children:Mo("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:Mo("path",{d:"M23.5 9.5c1.417 0 2.5 1.083 2.5 2.5v9.167c0 1.416-1.083 2.5-2.5 2.5h-15c-1.417 0-2.5-1.084-2.5-2.5V12c0-1.417 1.083-2.5 2.5-2.5h2.917l1.416-2.167C13 7.167 13.25 7 13.5 7h5c.25 0 .5.167.667.333L20.583 9.5H23.5zM16 11.417a4.706 4.706 0 00-4.75 4.75 4.704 4.704 0 004.75 4.75 4.703 4.703 0 004.75-4.75c0-2.663-2.09-4.75-4.75-4.75zm0 7.825c-1.744 0-3.076-1.332-3.076-3.074 0-1.745 1.333-3.077 3.076-3.077 1.744 0 3.074 1.333 3.074 3.076s-1.33 3.075-3.074 3.075z",fill:"#02B383","fill-rule":"nonzero"})})}),Mo("div",{className:"uppy-DashboardTab-name",children:this.props.i18n("takePictureBtn")})]})});renderVideoCamera=()=>Mo("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera",children:Mo("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerVideoCameraInputClick,children:[Mo("div",{className:"uppy-DashboardTab-inner",children:Mo("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32",children:Mo("path",{fill:"#FF675E",fillRule:"nonzero",d:"m21.254 14.277 2.941-2.588c.797-.313 1.243.818 1.09 1.554-.01 2.094.02 4.189-.017 6.282-.126.915-1.145 1.08-1.58.34l-2.434-2.142c-.192.287-.504 1.305-.738.468-.104-1.293-.028-2.596-.05-3.894.047-.312.381.823.426 1.069.063-.384.206-.744.362-1.09zm-12.939-3.73c3.858.013 7.717-.025 11.574.02.912.129 1.492 1.237 1.351 2.217-.019 2.412.04 4.83-.03 7.239-.17 1.025-1.166 1.59-2.029 1.429-3.705-.012-7.41.025-11.114-.019-.913-.129-1.492-1.237-1.352-2.217.018-2.404-.036-4.813.029-7.214.136-.82.83-1.473 1.571-1.454z "})})}),Mo("div",{className:"uppy-DashboardTab-name",children:this.props.i18n("recordVideoBtn")})]})});renderBrowseButton=(e,t)=>Mo("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":0===this.props.acquirers.length,children:e});renderDropPasteBrowseTagline=e=>{const t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),i=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),r=this.props.fileManagerSelectionType,o=r.charAt(0).toUpperCase()+r.slice(1);return Mo("div",{class:"uppy-Dashboard-AddFiles-title",children:this.props.disableLocalFiles?this.props.i18n("importFiles"):this.props.i18nArray(e>0?`dropPasteImport${o}`:`dropPaste${o}`,{browseFiles:t,browseFolders:i,browse:t})})};[Symbol.for("uppy test: disable unused locale key warning")](){this.props.i18nArray("dropPasteBoth"),this.props.i18nArray("dropPasteFiles"),this.props.i18nArray("dropPasteFolders"),this.props.i18nArray("dropPasteImportBoth"),this.props.i18nArray("dropPasteImportFiles"),this.props.i18nArray("dropPasteImportFolders")}renderAcquirer=e=>Mo("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id,children:Mo("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-cy":e.id,"aria-controls":`uppy-DashboardContent-panel--${e.id}`,"aria-selected":this.props.activePickerPanel?.id===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id),children:[Mo("div",{className:"uppy-DashboardTab-inner",children:e.icon()}),Mo("div",{className:"uppy-DashboardTab-name",children:e.name})]})});renderAcquirers=e=>{const t=[...e],i=t.splice(e.length-2,e.length);return Mo(co,{children:[t.map((e=>this.renderAcquirer(e))),Mo("span",{role:"presentation",style:{"white-space":"nowrap"},children:i.map((e=>this.renderAcquirer(e)))})]})};renderSourcesList=(e,t)=>{const{showNativePhotoCameraButton:i,showNativeVideoCameraButton:r}=this.props;let o=[];const s="myDevice";t||o.push({key:s,elements:this.renderMyDeviceAcquirer()}),i&&o.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),r&&o.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),o.push(...e.map((e=>({key:e.id,elements:this.renderAcquirer(e)})))),1===o.length&&o[0].key===s&&(o=[]);const a=[...o],n=a.splice(o.length-2,o.length);return Mo(co,{children:[this.renderDropPasteBrowseTagline(o.length),Mo("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist",children:[a.map((({key:e,elements:t})=>Mo(co,{children:t},e))),Mo("span",{role:"presentation",style:{"white-space":"nowrap"},children:n.map((({key:e,elements:t})=>Mo(co,{children:t},e)))})]})]})};renderPoweredByUppy(){const{i18nArray:e}=this.props,t=Mo("span",{children:[Mo("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11",children:Mo("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})}),Mo("span",{className:"uppy-Dashboard-poweredByUppy",children:"Uppy"})]});return Mo("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy",children:e("poweredBy",{uppy:t})})}render(){const{showNativePhotoCameraButton:e,showNativeVideoCameraButton:t,nativeCameraFacingMode:i}=this.props;return Mo("div",{className:"uppy-Dashboard-AddFiles",children:[this.renderHiddenInput(!1,(e=>{this.fileInput=e})),this.renderHiddenInput(!0,(e=>{this.folderInput=e})),e&&this.renderHiddenCameraInput("photo",i,(e=>{this.mobilePhotoFileInput=e})),t&&this.renderHiddenCameraInput("video",i,(e=>{this.mobileVideoFileInput=e})),this.renderSourcesList(this.props.acquirers,this.props.disableLocalFiles),Mo("div",{className:"uppy-Dashboard-AddFiles-info",children:[this.props.note&&Mo("div",{className:"uppy-Dashboard-note",children:this.props.note}),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy()]})]})}}const jn=e=>Mo("div",{className:Ia("uppy-Dashboard-AddFilesPanel",e.className),"data-uppy-panelType":"AddFiles","aria-hidden":!e.showAddFilesPanel,children:[Mo("div",{className:"uppy-DashboardContent-bar",children:[Mo("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:e.i18n("addingMoreFiles")}),Mo("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>e.toggleAddFilesPanel(!1),children:e.i18n("back")})]}),Mo($n,{...e})]});function Wn(e){const t=e.files[e.fileCardFor];return Mo("div",{className:Ia("uppy-DashboardContent-panel",e.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor",children:[Mo("div",{className:"uppy-DashboardContent-bar",children:[Mo("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:e.i18nArray("editing",{file:Mo("span",{className:"uppy-DashboardContent-titleFile",children:t.meta?t.meta.name:t.name})})}),Mo("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>{e.uppy.emit("file-editor:cancel",t),e.closeFileEditor()},children:e.i18n("cancel")}),Mo("button",{className:"uppy-DashboardContent-save",type:"button",onClick:e.saveFileEditor,children:e.i18n("save")})]}),Mo("div",{className:"uppy-DashboardContent-panelBody",children:e.editors.map((t=>e.uppy.getPlugin(t.id).render(e.state)))})]})}function Ln(e){const t={color:"#838999",icon:Mo("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:Mo("g",{fill:"#A7AFB7",fillRule:"nonzero",children:[Mo("path",{d:"M5.5 22a.5.5 0 0 1-.5-.5v-18a.5.5 0 0 1 .5-.5h10.719a.5.5 0 0 1 .367.16l3.281 3.556a.5.5 0 0 1 .133.339V21.5a.5.5 0 0 1-.5.5h-14zm.5-1h13V7.25L16 4H6v17z"}),Mo("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})]})})};if(!e)return t;const i=e.split("/")[0],r=e.split("/")[1];return"text"===i?{color:"#5a5e69",icon:Mo("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:Mo("path",{d:"M4.5 7h13a.5.5 0 1 1 0 1h-13a.5.5 0 0 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h10a.5.5 0 1 1 0 1h-10a.5.5 0 1 1 0-1z",fill:"#5A5E69",fillRule:"nonzero"})})}:"image"===i?{color:"#686de0",icon:Mo("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25",children:Mo("g",{fill:"#686DE0",fillRule:"evenodd",children:[Mo("path",{d:"M5 7v10h15V7H5zm0-1h15a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z",fillRule:"nonzero"}),Mo("path",{d:"M6.35 17.172l4.994-5.026a.5.5 0 0 1 .707 0l2.16 2.16 3.505-3.505a.5.5 0 0 1 .707 0l2.336 2.31-.707.72-1.983-1.97-3.505 3.505a.5.5 0 0 1-.707 0l-2.16-2.159-3.938 3.939-1.409.026z",fillRule:"nonzero"}),Mo("circle",{cx:"7.5",cy:"9.5",r:"1.5"})]})})}:"audio"===i?{color:"#068dbb",icon:Mo("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:Mo("path",{d:"M9.5 18.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V7.25a.5.5 0 0 1 .379-.485l9-2.25A.5.5 0 0 1 18.5 5v11.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V8.67l-8 2v7.97zm8-11v-2l-8 2v2l8-2zM7 19.64c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1zm9-2c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1z",fill:"#049BCF",fillRule:"nonzero"})})}:"video"===i?{color:"#19af67",icon:Mo("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:Mo("path",{d:"M16 11.834l4.486-2.691A1 1 0 0 1 22 10v6a1 1 0 0 1-1.514.857L16 14.167V17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v2.834zM15 9H5v8h10V9zm1 4l5 3v-6l-5 3z",fill:"#19AF67",fillRule:"nonzero"})})}:"application"===i&&"pdf"===r?{color:"#e25149",icon:Mo("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:Mo("path",{d:"M9.766 8.295c-.691-1.843-.539-3.401.747-3.726 1.643-.414 2.505.938 2.39 3.299-.039.79-.194 1.662-.537 3.148.324.49.66.967 1.055 1.51.17.231.382.488.629.757 1.866-.128 3.653.114 4.918.655 1.487.635 2.192 1.685 1.614 2.84-.566 1.133-1.839 1.084-3.416.249-1.141-.604-2.457-1.634-3.51-2.707a13.467 13.467 0 0 0-2.238.426c-1.392 4.051-4.534 6.453-5.707 4.572-.986-1.58 1.38-4.206 4.914-5.375.097-.322.185-.656.264-1.001.08-.353.306-1.31.407-1.737-.678-1.059-1.2-2.031-1.53-2.91zm2.098 4.87c-.033.144-.068.287-.104.427l.033-.01-.012.038a14.065 14.065 0 0 1 1.02-.197l-.032-.033.052-.004a7.902 7.902 0 0 1-.208-.271c-.197-.27-.38-.526-.555-.775l-.006.028-.002-.003c-.076.323-.148.632-.186.8zm5.77 2.978c1.143.605 1.832.632 2.054.187.26-.519-.087-1.034-1.113-1.473-.911-.39-2.175-.608-3.55-.608.845.766 1.787 1.459 2.609 1.894zM6.559 18.789c.14.223.693.16 1.425-.413.827-.648 1.61-1.747 2.208-3.206-2.563 1.064-4.102 2.867-3.633 3.62zm5.345-10.97c.088-1.793-.351-2.48-1.146-2.28-.473.119-.564 1.05-.056 2.405.213.566.52 1.188.908 1.859.18-.858.268-1.453.294-1.984z",fill:"#E2514A",fillRule:"nonzero"})})}:"application"===i&&-1!==["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(r)?{color:"#00C469",icon:Mo("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25",children:Mo("path",{d:"M10.45 2.05h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V2.55a.5.5 0 0 1 .5-.5zm2.05 1.024h1.05a.5.5 0 0 1 .5.5V3.6a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5v-.001zM10.45 0h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 3.074h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 1.024h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-1.656 3.074l-.82 5.946c.52.302 1.174.458 1.976.458.803 0 1.455-.156 1.975-.458l-.82-5.946h-2.311zm0-1.025h2.312c.512 0 .946.378 1.015.885l.82 5.946c.056.412-.142.817-.501 1.026-.686.398-1.515.597-2.49.597-.974 0-1.804-.199-2.49-.597a1.025 1.025 0 0 1-.5-1.026l.819-5.946c.07-.507.503-.885 1.015-.885zm.545 6.6a.5.5 0 0 1-.397-.561l.143-.999a.5.5 0 0 1 .495-.429h.74a.5.5 0 0 1 .495.43l.143.998a.5.5 0 0 1-.397.561c-.404.08-.819.08-1.222 0z",fill:"#00C469",fillRule:"nonzero"})})}:t}function Hn(e){const{tagName:t}=e.target;"INPUT"!==t&&"TEXTAREA"!==t?(e.preventDefault(),e.stopPropagation()):e.stopPropagation()}function Vn(e){const{file:t}=e;if(t.preview)return Mo("img",{draggable:!1,className:"uppy-Dashboard-Item-previewImg",alt:t.name,src:t.preview});const{color:i,icon:r}=Ln(t.type);return Mo("div",{className:"uppy-Dashboard-Item-previewIconWrap",children:[Mo("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:i},children:r}),Mo("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76",children:Mo("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})})]})}function Jn(e){const{computedMetaFields:t,requiredMetaFields:i,updateMeta:r,form:o,formState:s}=e,a={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return t.map((e=>{const t=`uppy-Dashboard-FileCard-input-${e.id}`,n=i.includes(e.id);return Mo("fieldset",{className:"uppy-Dashboard-FileCard-fieldset",children:[Mo("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:t,children:e.name}),void 0!==e.render?e.render({value:s[e.id],onChange:t=>r(t,e.id),fieldCSSClasses:a,required:n,form:o.id},po):Mo("input",{className:a.text,id:t,form:o.id,type:e.type||"text",required:n,value:s[e.id],placeholder:e.placeholder,onInput:t=>r(t.target.value,e.id),"data-uppy-super-focusable":!0})]},e.id)}))}function Kn(e){const{files:t,fileCardFor:i,toggleFileCard:r,saveFileCard:o,metaFields:s,requiredMetaFields:a,openFileEditor:n,i18n:l,i18nArray:d,className:p,canEditFile:h}=e,c=t[i],u=("function"==typeof s?s(t[i]):s)??[],f=h(c),m={};u.forEach((e=>{m[e.id]=c.meta[e.id]??""}));const[b,y]=Xo(m),g=es((e=>{e.preventDefault(),o(b,i)}),[o,b,i]),v=()=>{r(!1)},[w]=Xo((()=>{const e=document.createElement("form");return e.setAttribute("tabindex","-1"),e.id=ba(),e})),x=Zo(null);return Yo((()=>{const e=x.current?.getRootNode()??document;return e instanceof Document?e.body.appendChild(w):(ShadowRoot,e.appendChild(w)),w.addEventListener("submit",g),()=>{w.removeEventListener("submit",g),w.parentNode&&w.parentNode.removeChild(w)}}),[w,g]),Mo("div",{className:Ia("uppy-Dashboard-FileCard",p),"data-uppy-panelType":"FileCard",onDragOver:Hn,onDragLeave:Hn,onDrop:Hn,onPaste:Hn,ref:x,children:[Mo("div",{className:"uppy-DashboardContent-bar",children:[Mo("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:d("editing",{file:Mo("span",{className:"uppy-DashboardContent-titleFile",children:c.meta?c.meta.name:c.name})})}),Mo("button",{className:"uppy-DashboardContent-back",type:"button",form:w.id,title:l("finishEditingFile"),onClick:v,children:l("cancel")})]}),Mo("div",{className:"uppy-Dashboard-FileCard-inner",children:[Mo("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:Ln(c.type).color},children:[Mo(Vn,{file:c}),f&&Mo("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:e=>{g(e),n(c)},children:l("editImage")})]}),Mo("div",{className:"uppy-Dashboard-FileCard-info",children:Mo(Jn,{computedMetaFields:u,requiredMetaFields:a,updateMeta:(e,t)=>{y({...b,[t]:e})},form:w,formState:b})}),Mo("div",{className:"uppy-Dashboard-FileCard-actions",children:[Mo("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:w.id,children:l("saveChanges")}),Mo("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:v,form:w.id,children:l("cancel")})]})]})]})}function qn({file:e,uploadInProgressOrComplete:t,metaFields:i,canEditFile:r,i18n:o,onClick:s}){return!t&&i&&i.length>0||!t&&r(e)?Mo("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":o("editFileWithFilename",{file:e.meta.name}),title:o("editFileWithFilename",{file:e.meta.name}),onClick:()=>s(),children:Mo("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14",children:Mo("g",{fillRule:"evenodd",children:[Mo("path",{d:"M1.5 10.793h2.793A1 1 0 0 0 5 10.5L11.5 4a1 1 0 0 0 0-1.414L9.707.793a1 1 0 0 0-1.414 0l-6.5 6.5A1 1 0 0 0 1.5 8v2.793zm1-1V8L9 1.5l1.793 1.793-6.5 6.5H2.5z",fillRule:"nonzero"}),Mo("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),Mo("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})]})})}):null}function Gn({i18n:e,onClick:t,file:i}){return Mo("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":e("removeFile",{file:i.meta.name}),title:e("removeFile",{file:i.meta.name}),onClick:()=>t(),children:Mo("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18",children:[Mo("path",{d:"M9 0C4.034 0 0 4.034 0 9s4.034 9 9 9 9-4.034 9-9-4.034-9-9-9z"}),Mo("path",{fill:"#FFF",d:"M13 12.222l-.778.778L9 9.778 5.778 13 5 12.222 8.222 9 5 5.778 5.778 5 9 8.222 12.222 5l.778.778L9.778 9z"})]})})}function Xn({file:e,uppy:t,i18n:i}){return Mo("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":i("copyLink"),title:i("copyLink"),onClick:r=>(r=>{(function(e,t="Copy the URL below"){return new Promise((i=>{const r=document.createElement("textarea");r.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),r.value=e,document.body.appendChild(r),r.select();const o=()=>{document.body.removeChild(r),window.prompt(t,e),i()};try{return document.execCommand("copy")?(document.body.removeChild(r),i()):o()}catch(e){return document.body.removeChild(r),o()}}))})(e.uploadURL,i("copyLinkToClipboardFallback")).then((()=>{t.log("Link copied to clipboard."),t.info(i("copyLinkToClipboardSuccess"),"info",3e3)})).catch(t.log).then((()=>r.target.focus({preventScroll:!0})))})(r),children:Mo("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12",children:Mo("path",{d:"M7.94 7.703a2.613 2.613 0 0 1-.626 2.681l-.852.851a2.597 2.597 0 0 1-1.849.766A2.616 2.616 0 0 1 2.764 7.54l.852-.852a2.596 2.596 0 0 1 2.69-.625L5.267 7.099a1.44 1.44 0 0 0-.833.407l-.852.851a1.458 1.458 0 0 0 1.03 2.486c.39 0 .755-.152 1.03-.426l.852-.852c.231-.231.363-.522.406-.824l1.04-1.038zm4.295-5.937A2.596 2.596 0 0 0 10.387 1c-.698 0-1.355.272-1.849.766l-.852.851a2.614 2.614 0 0 0-.624 2.688l1.036-1.036c.041-.304.173-.6.407-.833l.852-.852c.275-.275.64-.426 1.03-.426a1.458 1.458 0 0 1 1.03 2.486l-.852.851a1.442 1.442 0 0 1-.824.406l-1.04 1.04a2.596 2.596 0 0 0 2.683-.628l.851-.85a2.616 2.616 0 0 0 0-3.697zm-6.88 6.883a.577.577 0 0 0 .82 0l3.474-3.474a.579.579 0 1 0-.819-.82L5.355 7.83a.579.579 0 0 0 0 .819z"})})})}function Yn(e){const{uppy:t,file:i,uploadInProgressOrComplete:r,canEditFile:o,metaFields:s,showLinkToFileUploadResult:a,showRemoveButton:n,i18n:l,toggleFileCard:d,openFileEditor:p}=e;return Mo("div",{className:"uppy-Dashboard-Item-actionWrapper",children:[Mo(qn,{i18n:l,file:i,uploadInProgressOrComplete:r,canEditFile:o,metaFields:s,onClick:()=>{s&&s.length>0?d(!0,i.id):p(i)}}),a&&i.uploadURL?Mo(Xn,{file:i,uppy:t,i18n:l}):null,n?Mo(Gn,{i18n:l,file:i,onClick:()=>t.removeFile(i.id)}):null]})}function Zn(e){const{file:t,toggleFileCard:i,i18n:r,metaFields:o}=e,{missingRequiredMetaFields:s}=t;if(!s?.length)return null;const a=s.map((e=>((e,t)=>{const i=("function"==typeof t?t():t).filter((t=>t.id===e));return i[0].name})(e,o))).join(", ");return Mo("div",{className:"uppy-Dashboard-Item-errorMessage",children:[r("missingRequiredMetaFields",{smart_count:s.length,fields:a})," ",Mo("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>i(!0,t.id),children:r("editFile")})]})}const Qn=e=>{const{author:t,name:i}=e.file.meta;return Mo("div",{className:"uppy-Dashboard-Item-name",title:i,children:Vr(i,e.isSingleFile&&e.containerHeight>=350?90:e.containerWidth<=352?35:e.containerWidth<=576?60:t?20:30)})},el=e=>{const{author:t}=e.file.meta,i="remote"in e.file?e.file.remote?.providerName:void 0;return t?Mo("div",{className:"uppy-Dashboard-Item-author",children:[Mo("a",{href:`${t.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",children:Vr(t.name,13)}),i?Mo(co,{children:[" · ",i," · "]}):null]}):null},tl=e=>e.file.size&&Mo("div",{className:"uppy-Dashboard-Item-statusSize",children:ws(e.file.size)}),il=e=>e.file.isGhost&&Mo("span",{children:[" • ",Mo("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:()=>e.toggleAddFilesPanel(!0),children:e.i18n("reSelect")})]}),rl=({file:e,onClick:t})=>e.error?Mo("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-errorDetails","aria-label":e.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:t,type:"button",children:"?"}):null;function ol(e){const{file:t,i18n:i,toggleFileCard:r,metaFields:o,toggleAddFilesPanel:s,isSingleFile:a,containerHeight:n,containerWidth:l}=e;return Mo("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":t.source,children:[Mo("div",{className:"uppy-Dashboard-Item-fileName",children:[Qn({file:t,isSingleFile:a,containerHeight:n,containerWidth:l}),Mo(rl,{file:t,onClick:()=>alert(t.error)})]}),Mo("div",{className:"uppy-Dashboard-Item-status",children:[el({file:t}),tl({file:t}),il({file:t,toggleAddFilesPanel:s,i18n:i})]}),Mo(Zn,{file:t,i18n:i,toggleFileCard:r,metaFields:o})]})}function sl(e){const{file:t,i18n:i,toggleFileCard:r,metaFields:o,showLinkToFileUploadResult:s}=e;return Mo("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:t.preview?"rgba(255, 255, 255, 0.5)":Ln(t.type).color},children:[s&&t.uploadURL&&Mo("a",{className:"uppy-Dashboard-Item-previewLink",href:t.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":t.meta.name,children:Mo("span",{hidden:!0,children:t.meta.name})}),Mo(Vn,{file:t}),Mo(Zn,{file:t,i18n:i,toggleFileCard:r,metaFields:o})]})}function al(e){return e.isUploaded?e.i18n("uploadComplete"):e.error?e.i18n("retryUpload"):e.resumableUploads?e.i18n(e.file.isPaused?"resumeUpload":"pauseUpload"):e.individualCancellation?e.i18n("cancelUpload"):""}function nl(e){return Mo("div",{className:"uppy-Dashboard-Item-progress",children:Mo("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":al(e),title:al(e),onClick:()=>function(e){e.isUploaded||(!e.error||e.hideRetryButton?e.resumableUploads&&!e.hidePauseResumeButton?e.uppy.pauseResume(e.file.id):e.individualCancellation&&!e.hideCancelButton&&e.uppy.removeFile(e.file.id):e.uppy.retryUpload(e.file.id))}(e),children:e.children})})}function ll({children:e}){return Mo("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle",children:e})}function dl({progress:e}){const t=2*Math.PI*15;return Mo("g",{children:[Mo("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),Mo("circle",{className:"uppy-Dashboard-Item-progressIcon--progress",r:"15",cx:"18",cy:"18",transform:"rotate(-90, 18, 18)",fill:"none","stroke-width":"2","stroke-dasharray":t,"stroke-dashoffset":t-t/100*e})]})}function pl(e){return e.file.progress.uploadStarted?void 0===e.file.progress.percentage?null:e.isUploaded?Mo("div",{className:"uppy-Dashboard-Item-progress",children:Mo("div",{className:"uppy-Dashboard-Item-progressIndicator",children:Mo(ll,{children:[Mo("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),Mo("polygon",{className:"uppy-Dashboard-Item-progressIcon--check",transform:"translate(2, 3)",points:"14 22.5 7 15.2457065 8.99985857 13.1732815 14 18.3547104 22.9729883 9 25 11.1005634"})]})})}):e.recoveredState?null:e.error&&!e.hideRetryButton?Mo(nl,{...e,children:Mo("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19",children:[Mo("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),Mo("path",{d:"M7.9 3H10v2H7.9z"}),Mo("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),Mo("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"})]})}):e.resumableUploads&&!e.hidePauseResumeButton?Mo(nl,{...e,children:Mo(ll,{children:[Mo(dl,{progress:e.file.progress.percentage}),e.file.isPaused?Mo("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):Mo("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)",children:[Mo("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),Mo("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})]})]})}):e.resumableUploads||!e.individualCancellation||e.hideCancelButton?Mo("div",{className:"uppy-Dashboard-Item-progress",children:Mo("div",{className:"uppy-Dashboard-Item-progressIndicator",children:Mo(ll,{children:Mo(dl,{progress:e.file.progress.percentage})})})}):Mo(nl,{...e,children:Mo(ll,{children:[Mo(dl,{progress:e.file.progress.percentage}),Mo("polygon",{className:"cancel",transform:"translate(2, 2)",points:"19.8856516 11.0625 16 14.9481516 12.1019737 11.0625 11.0625 12.1143484 14.9481516 16 11.0625 19.8980263 12.1019737 20.9375 16 17.0518484 19.8856516 20.9375 20.9375 19.8980263 17.0518484 16 20.9375 12"})]})}):null}class hl extends uo{componentDidMount(){const{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!function(e,t){if(e===t)return!0;if(!e||!t)return!1;const i=Object.keys(e),r=Object.keys(t),o=i.length;if(r.length!==o)return!1;for(let r=0;r<o;r++){const o=i[r];if(e[o]!==t[o]||!Object.prototype.hasOwnProperty.call(t,o))return!1}return!0}(this.props,e)}componentDidUpdate(){const{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}componentWillUnmount(){const{file:e}=this.props;e.preview||this.props.handleCancelThumbnail(e)}render(){const{file:e}=this.props,t=e.progress.preprocess||e.progress.postprocess,i=!!e.progress.uploadComplete&&!t&&!e.error,r=!!e.progress.uploadStarted||!!t,o=e.progress.uploadStarted&&!e.progress.uploadComplete||t,s=e.error||!1,{isGhost:a}=e;let n=(this.props.individualCancellation||!o)&&!i;return i&&this.props.showRemoveButtonAfterComplete&&(n=!0),Mo("div",{className:Ia({"uppy-Dashboard-Item":!0,"is-inprogress":o&&!this.props.recoveredState,"is-processing":t,"is-complete":i,"is-error":!!s,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":a}),id:`uppy_${e.id}`,role:this.props.role,children:[Mo("div",{className:"uppy-Dashboard-Item-preview",children:[Mo(sl,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),Mo(pl,{uppy:this.props.uppy,file:e,error:s,isUploaded:i,hideRetryButton:this.props.hideRetryButton,hideCancelButton:this.props.hideCancelButton,hidePauseResumeButton:this.props.hidePauseResumeButton,recoveredState:this.props.recoveredState,resumableUploads:this.props.resumableUploads,individualCancellation:this.props.individualCancellation,i18n:this.props.i18n})]}),Mo("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons",children:[Mo(ol,{file:e,containerWidth:this.props.containerWidth,containerHeight:this.props.containerHeight,i18n:this.props.i18n,toggleAddFilesPanel:this.props.toggleAddFilesPanel,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields,isSingleFile:this.props.isSingleFile}),Mo(Yn,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:n,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:r,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})]})]})}}function cl({id:e,i18n:t,uppy:i,files:r,resumableUploads:o,hideRetryButton:s,hidePauseResumeButton:a,hideCancelButton:n,showLinkToFileUploadResult:l,showRemoveButtonAfterComplete:d,metaFields:p,isSingleFile:h,toggleFileCard:c,handleRequestThumbnail:u,handleCancelThumbnail:f,recoveredState:m,individualCancellation:b,itemsPerRow:y,openFileEditor:g,canEditFile:v,toggleAddFilesPanel:w,containerWidth:x,containerHeight:k}){const S=1===y?71:200,D=Qo((()=>{const e=Object.keys(r);return m&&e.sort(((e,t)=>Number(r[t].isGhost)-Number(r[e].isGhost))),function(e,t){const i=[];let r=[];return e.forEach((e=>{r.length<t?r.push(e):(i.push(r),r=[e])})),r.length&&i.push(r),i}(e,y)}),[r,y,m]),I=y=>Mo("div",{class:"uppy-Dashboard-filesInner",role:"presentation",children:y.map((y=>Mo(hl,{uppy:i,id:e,i18n:t,resumableUploads:o,individualCancellation:b,hideRetryButton:s,hidePauseResumeButton:a,hideCancelButton:n,showLinkToFileUploadResult:l,showRemoveButtonAfterComplete:d,metaFields:p,recoveredState:m,isSingleFile:h,containerWidth:x,containerHeight:k,toggleFileCard:c,handleRequestThumbnail:u,handleCancelThumbnail:f,role:"listitem",openFileEditor:g,canEditFile:v,toggleAddFilesPanel:w,file:r[y]},y)))},y[0]);return h?Mo("div",{class:"uppy-Dashboard-files",children:I(D[0])}):Mo(ps,{class:"uppy-Dashboard-files",role:"list",data:D,renderRow:I,rowHeight:S})}class ul extends uo{ref={current:null};componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,300)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,300)}render(){const{children:e}=this.props;return Mo("div",{className:"uppy-Informer-animated",ref:this.ref,children:e})}}function fl(e){const t={};for(let o=0;o<e.length;o++)null!=e[o]&&(t[(i=e[o],r=o.toString(36),i?.key??r)]=e[o]);var i,r;return t}function ml(e,t){e=e||{},t=t||{};const i=i=>Object.hasOwn(t,i)?t[i]:e[i],r={};let o=[];for(const i in e)Object.hasOwn(t,i)?o.length&&(r[i]=o,o=[]):o.push(i);const s={};for(const e in t){if(Object.hasOwn(r,e))for(let t=0;t<r[e].length;t++)s[r[e][t]]=i(r[e][t]);s[e]=i(e)}for(let e=0;e<o.length;e++)s[o[e]]=i(o[e]);return s}class bl extends uo{constructor(e,t){super(e,t),this.refs={},this.state={children:fl(wo(wo(this.props.children))||[])},this.performAppear=this.performAppear.bind(this),this.performEnter=this.performEnter.bind(this),this.performLeave=this.performLeave.bind(this)}componentWillMount(){this.currentlyTransitioningKeys={},this.keysToAbortLeave=[],this.keysToEnter=[],this.keysToLeave=[]}componentDidMount(){const e=this.state.children;for(const t in e)e[t]&&this.performAppear(t)}componentWillReceiveProps(e){const t=fl(wo(e.children)||[]),i=this.state.children;let r;for(r in this.setState((e=>({children:ml(e.children,t)}))),t)if(Object.hasOwn(t,r)){const e=i&&Object.hasOwn(i,r);t[r]&&e&&this.currentlyTransitioningKeys[r]?(this.keysToEnter.push(r),this.keysToAbortLeave.push(r)):!t[r]||e||this.currentlyTransitioningKeys[r]||this.keysToEnter.push(r)}for(r in i)if(Object.hasOwn(i,r)){const e=t&&Object.hasOwn(t,r);!i[r]||e||this.currentlyTransitioningKeys[r]||this.keysToLeave.push(r)}}componentDidUpdate(){const{keysToEnter:e}=this;this.keysToEnter=[],e.forEach(this.performEnter);const{keysToLeave:t}=this;this.keysToLeave=[],t.forEach(this.performLeave)}_finishAbort(e){const t=this.keysToAbortLeave.indexOf(e);-1!==t&&this.keysToAbortLeave.splice(t,1)}performAppear(e){this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t?.componentWillAppear?t.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)}_handleDoneAppearing(e){const t=this.refs[e];t?.componentDidAppear&&t.componentDidAppear(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const i=fl(wo(this.props.children)||[]);i&&Object.hasOwn(i,e)||this.performLeave(e)}performEnter(e){this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t?.componentWillEnter?t.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)}_handleDoneEntering(e){const t=this.refs[e];t?.componentDidEnter&&t.componentDidEnter(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const i=fl(wo(this.props.children)||[]);i&&Object.hasOwn(i,e)||this.performLeave(e)}performLeave(e){if(-1!==this.keysToAbortLeave.indexOf(e))return;this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t?.componentWillLeave?t.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(-1!==this.keysToAbortLeave.indexOf(e))return;const t=this.refs[e];t?.componentDidLeave&&t.componentDidLeave(),delete this.currentlyTransitioningKeys[e];const i=fl(wo(this.props.children)||[]);if(i&&Object.hasOwn(i,e))this.performEnter(e);else{const t=Object.assign({},this.state.children);delete t[e],this.setState({children:t})}}render({childFactory:e,transitionLeave:t,transitionName:i,transitionAppear:r,transitionEnter:o,transitionLeaveTimeout:s,transitionEnterTimeout:a,transitionAppearTimeout:n,component:l,...d},{children:p}){const h=Object.entries(p).map((([t,i])=>{if(!i)return;const r=function(e,t){const i=e._ptgLinkedRefs||(e._ptgLinkedRefs={});return i[t]||(i[t]=i=>{e.refs[t]=i})}(this,t);return Eo(e(i),{ref:r,key:t})})).filter(Boolean);return po(l,d,h)}}bl.defaultProps={component:"span",childFactory:e=>e};class yl extends uo{render(){const{info:e}=this.props.uppy.getState();return Mo("div",{className:"uppy uppy-Informer",children:Mo(bl,{children:e.map((e=>Mo(ul,{children:Mo("p",{role:"alert",children:[e.message," ",e.details&&Mo("span",{"aria-label":e.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${e.message} \n\n ${e.details}`),children:"?"})]})},e.message)))})})}}function gl({activePickerPanel:e,className:t,hideAllPanels:i,i18n:r,state:o,uppy:s}){const a=Zo(null);return Mo("div",{className:Ia("uppy-DashboardContent-panel",t),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${e.id}`,onDragOver:Hn,onDragLeave:Hn,onDrop:Hn,onPaste:Hn,children:[Mo("div",{className:"uppy-DashboardContent-bar",children:[Mo("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:r("importFrom",{name:e.name})}),Mo("button",{className:"uppy-DashboardContent-back",type:"button",onClick:i,children:r("cancel")})]}),Mo("div",{ref:a,className:"uppy-DashboardContent-panelBody",children:s.getPlugin(e.id).render(o,a.current)})]})}const vl="preprocessing",wl="uploading";function xl({files:e,i18n:t,isAllComplete:i,isAllErrored:r,isAllPaused:o,inProgressNotPausedFiles:s,newFiles:a,processingFiles:n}){const l=function(e,t,i,r={}){if(e)return"error";if(t)return"complete";if(i)return"paused";let o="waiting";const s=Object.keys(r);for(let e=0;e<s.length;e++){const{progress:t}=r[s[e]];if(t.uploadStarted&&!t.uploadComplete)return wl;t.preprocess&&o!==wl&&(o=vl),t.postprocess&&o!==wl&&o!==vl&&(o="postprocessing")}return o}(r,i,o,e);switch(l){case"uploading":return t("uploadingXFiles",{smart_count:s.length});case"preprocessing":case"postprocessing":return t("processingXFiles",{smart_count:n.length});case"paused":return t("uploadPaused");case"waiting":return t("xFilesSelected",{smart_count:a.length});case"complete":return t("uploadComplete");case"error":return t("error")}}function kl(e){const{i18n:t,isAllComplete:i,hideCancelButton:r,maxNumberOfFiles:o,toggleAddFilesPanel:s,uppy:a}=e;let{allowNewUpload:n}=e;return n&&o&&(n=e.totalFileCount<e.maxNumberOfFiles),Mo("div",{className:"uppy-DashboardContent-bar",children:[i||r?Mo("div",{}):Mo("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>a.cancelAll(),children:t("cancel")}),Mo("div",{className:"uppy-DashboardContent-title",children:Mo(xl,{...e})}),n?Mo("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":t("addMoreFiles"),title:t("addMoreFiles"),onClick:()=>s(!0),children:[Mo("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15",children:Mo("path",{d:"M8 6.5h6a.5.5 0 0 1 .5.5v.5a.5.5 0 0 1-.5.5H8v6a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V8h-6a.5.5 0 0 1-.5-.5V7a.5.5 0 0 1 .5-.5h6v-6A.5.5 0 0 1 7 0h.5a.5.5 0 0 1 .5.5v6z"})}),Mo("span",{className:"uppy-DashboardContent-addMoreCaption",children:t("addMore")})]}):Mo("div",{})]})}const Sl="uppy-transition-slideDownUp";function Dl({children:e}){const[t,i]=Xo(null),[r,o]=Xo(""),s=Zo(),a=Zo(),n=Zo(),l=es((()=>{o(`${Sl}-enter`),cancelAnimationFrame(n.current),clearTimeout(a.current),a.current=void 0,n.current=requestAnimationFrame((()=>{o(`${Sl}-enter ${Sl}-enter-active`),s.current=setTimeout((()=>{o("")}),250)}))}),[]),d=es((()=>{o(`${Sl}-leave`),cancelAnimationFrame(n.current),clearTimeout(s.current),s.current=void 0,n.current=requestAnimationFrame((()=>{o(`${Sl}-leave ${Sl}-leave-active`),a.current=setTimeout((()=>{i(null),o("")}),250)}))}),[]);return Yo((()=>{const r=wo(e)[0];t!==r&&(r&&!t?l():!t||r||a.current||d(),i(r))}),[e,t,l,d]),Yo((()=>()=>{clearTimeout(s.current),clearTimeout(a.current),cancelAnimationFrame(n.current)}),[]),t?Eo(t,{className:Ia(r,t.props.className)}):null}var Il={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"};function Cl(e){const{newFiles:t,isUploadStarted:i,recoveredState:r,i18n:o,uploadState:s,isSomeGhost:a,startUpload:n}=e,l=Ia("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":s===Il.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":a}),d=o(t&&i&&!r?"uploadXNewFiles":"uploadXFiles",{smart_count:t});return Mo("button",{type:"button",className:l,"aria-label":o("uploadXFiles",{smart_count:t}),onClick:n,disabled:a,"data-uppy-super-focusable":!0,children:d})}function Bl(e){const{i18n:t,uppy:i}=e;return Mo("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":t("retryUpload"),onClick:()=>i.retryAll().catch((()=>{})),"data-uppy-super-focusable":!0,"data-cy":"retry",children:[Mo("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10",children:Mo("path",{d:"M4 2.408a2.75 2.75 0 1 0 2.75 2.75.626.626 0 0 1 1.25.018v.023a4 4 0 1 1-4-4.041V.25a.25.25 0 0 1 .389-.208l2.299 1.533a.25.25 0 0 1 0 .416l-2.3 1.533A.25.25 0 0 1 4 3.316v-.908z"})}),t("retry")]})}function Pl(e){const{i18n:t,uppy:i}=e;return Mo("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:t("cancel"),"aria-label":t("cancel"),onClick:()=>i.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0,children:Mo("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16",children:Mo("g",{fill:"none",fillRule:"evenodd",children:[Mo("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),Mo("path",{fill:"#FFF",d:"M9.283 8l2.567 2.567-1.283 1.283L8 9.283 5.433 11.85 4.15 10.567 6.717 8 4.15 5.433 5.433 4.15 8 6.717l2.567-2.567 1.283 1.283z"})]})})})}function zl(e){const{isAllPaused:t,i18n:i,isAllComplete:r,resumableUploads:o,uppy:s}=e,a=i(t?"resume":"pause");return Mo("button",{title:a,"aria-label":a,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:function(){r||(o?t?s.resumeAll():s.pauseAll():s.cancelAll())},"data-cy":"togglePauseResume","data-uppy-super-focusable":!0,children:Mo("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16",children:Mo("g",{fill:"none",fillRule:"evenodd",children:[Mo("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),Mo("path",{fill:"#FFF",d:t?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"})]})})})}function Fl(e){const{i18n:t,doneButtonHandler:i}=e;return Mo("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:i,"data-uppy-super-focusable":!0,children:t("done")})}function Tl(){return Mo("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14",children:Mo("path",{d:"M13.983 6.547c-.12-2.509-1.64-4.893-3.939-5.936-2.48-1.127-5.488-.656-7.556 1.094C.524 3.367-.398 6.048.162 8.562c.556 2.495 2.46 4.52 4.94 5.183 2.932.784 5.61-.602 7.256-3.015-1.493 1.993-3.745 3.309-6.298 2.868-2.514-.434-4.578-2.349-5.153-4.84a6.226 6.226 0 0 1 2.98-6.778C6.34.586 9.74 1.1 11.373 3.493c.407.596.693 1.282.842 1.988.127.598.073 1.197.161 1.794.078.525.543 1.257 1.15.864.525-.341.49-1.05.456-1.592-.007-.15.02.3 0 0",fillRule:"evenodd"})})}function Al(e){const{progress:t}=e,{value:i,mode:r,message:o}=t;return Mo("div",{className:"uppy-StatusBar-content",children:[Mo(Tl,{}),"determinate"===r?`${Math.round(100*i)}% · `:"",o]})}function El(e){const{numUploads:t,complete:i,totalUploadedSize:r,totalSize:o,totalETA:s,i18n:a}=e,n=t>1,l=ws(r);return Mo("div",{className:"uppy-StatusBar-statusSecondary",children:[n&&a("filesUploadedOfTotal",{complete:i,smart_count:t}),Mo("span",{className:"uppy-StatusBar-additionalInfo",children:[n&&" · ",null!=o?a("dataUploadedOfTotal",{complete:l,total:ws(o)}):a("dataUploadedOfUnknown",{complete:l})," · ",null!=s&&a("xTimeLeft",{time:$r(s)})]})]})}function _l(e){const{i18n:t,complete:i,numUploads:r}=e;return Mo("div",{className:"uppy-StatusBar-statusSecondary",children:t("filesUploadedOfTotal",{complete:i,smart_count:r})})}function Ml(e){const{i18n:t,newFiles:i,startUpload:r}=e,o=Ia("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return Mo("div",{className:"uppy-StatusBar-statusSecondary",children:[Mo("div",{className:"uppy-StatusBar-statusSecondaryHint",children:t("xMoreFilesAdded",{smart_count:i})}),Mo("button",{type:"button",className:o,"aria-label":t("uploadXFiles",{smart_count:i}),onClick:r,children:t("upload")})]})}function Rl(e){const{i18n:t,supportsUploadProgress:i,totalProgress:r,hideProgressDetails:o,isUploadStarted:s,isAllComplete:a,isAllPaused:n,newFiles:l,numUploads:d,complete:p,totalUploadedSize:h,totalSize:c,totalETA:u,startUpload:f}=e,m=l&&s;if(!s||a)return null;const b=t(n?"paused":"uploading");return Mo("div",{className:"uppy-StatusBar-content",title:b,children:[n?null:Mo(Tl,{}),Mo("div",{className:"uppy-StatusBar-status",children:[Mo("div",{className:"uppy-StatusBar-statusPrimary",children:i&&0!==r?`${b}: ${r}%`:b}),n||m||o?null:i?Mo(El,{numUploads:d,complete:p,totalUploadedSize:h,totalSize:c,totalETA:u,i18n:t}):Mo(_l,{i18n:t,complete:p,numUploads:d}),m?Mo(Ml,{i18n:t,newFiles:l,startUpload:f}):null]})]})}function Nl(e){const{i18n:t}=e;return Mo("div",{className:"uppy-StatusBar-content",role:"status",title:t("complete"),children:Mo("div",{className:"uppy-StatusBar-status",children:Mo("div",{className:"uppy-StatusBar-statusPrimary",children:[Mo("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11",children:Mo("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})}),t("complete")]})})})}function Ul(e){const{error:t,i18n:i,complete:r,numUploads:o}=e;return Mo("div",{className:"uppy-StatusBar-content",title:i("uploadFailed"),children:[Mo("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11",children:Mo("path",{d:"M4.278 5.5L0 1.222 1.222 0 5.5 4.278 9.778 0 11 1.222 6.722 5.5 11 9.778 9.778 11 5.5 6.722 1.222 11 0 9.778z"})}),Mo("div",{className:"uppy-StatusBar-status",children:[Mo("div",{className:"uppy-StatusBar-statusPrimary",children:[i("uploadFailed"),Mo("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":i("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:function(){const e=`${i("uploadFailed")} \n\n ${t}`;alert(e)},type:"button",children:"?"})]}),Mo(_l,{i18n:i,complete:r,numUploads:o})]})]})}function Ol(e){const t=[];let i,r="indeterminate";for(const{progress:o}of Object.values(e)){const{preprocess:e,postprocess:s}=o;null==i&&(e||s)&&({mode:r,message:i}=e||s),"determinate"===e?.mode&&t.push(e.value),"determinate"===s?.mode&&t.push(s.value)}return{mode:r,message:i,value:t.reduce(((e,i)=>e+i/t.length),0)}}const{STATE_ERROR:$l,STATE_WAITING:jl,STATE_PREPROCESSING:Wl,STATE_UPLOADING:Ll,STATE_POSTPROCESSING:Hl,STATE_COMPLETE:Vl}=Il;function Jl({newFiles:e,allowNewUpload:t,isUploadInProgress:i,isAllPaused:r,resumableUploads:o,error:s,hideUploadButton:a,hidePauseResumeButton:n=!1,hideCancelButton:l=!1,hideRetryButton:d=!1,recoveredState:p,uploadState:h,totalProgress:c,files:u,supportsUploadProgress:f,hideAfterFinish:m=!1,isSomeGhost:b,doneButtonHandler:y,isUploadStarted:g,i18n:v,startUpload:w,uppy:x,isAllComplete:k,hideProgressDetails:S,numUploads:D,complete:I,totalSize:C,totalETA:B,totalUploadedSize:P}){const z=function(){switch(h){case Hl:case Wl:{const e=Ol(u);return"determinate"===e.mode?100*e.value:c}case $l:return null;case Ll:return f?c:null;default:return c}}(),F=z??100,T=!s&&e&&(!i&&!r||p)&&t&&!a,A=!l&&h!==jl&&h!==Vl,E=o&&!n&&h===Ll,_=s&&!k&&!d,M=y&&h===Vl,R=Ia("uppy-StatusBar-progress",{"is-indeterminate":function(){switch(h){case Hl:case Wl:{const{mode:e}=Ol(u);return"indeterminate"===e}case Ll:return!f;default:return!1}}()}),N=Ia("uppy-StatusBar",`is-${h}`,{"has-ghosts":b}),U=(()=>{switch(h){case Wl:case Hl:return Mo(Al,{progress:Ol(u)});case Vl:return Mo(Nl,{i18n:v});case $l:return Mo(Ul,{error:s,i18n:v,numUploads:D,complete:I});case Ll:return Mo(Rl,{i18n:v,supportsUploadProgress:f,totalProgress:c,hideProgressDetails:S,isUploadStarted:g,isAllComplete:k,isAllPaused:r,newFiles:e,numUploads:D,complete:I,totalUploadedSize:P,totalSize:C,totalETA:B,startUpload:w});default:return null}})();return!(T||_||E||A||M)&&!U||h===Vl&&m?null:Mo("div",{className:N,children:[Mo("div",{className:R,style:{width:`${F}%`},role:"progressbar","aria-label":`${F}%`,"aria-valuetext":`${F}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":z}),U,Mo("div",{className:"uppy-StatusBar-actions",children:[T?Mo(Cl,{newFiles:e,isUploadStarted:g,recoveredState:p,i18n:v,isSomeGhost:b,startUpload:w,uploadState:h}):null,_?Mo(Bl,{i18n:v,uppy:x}):null,E?Mo(zl,{isAllPaused:r,i18n:v,isAllComplete:k,resumableUploads:o,uppy:x}):null,A?Mo(Pl,{i18n:v,uppy:x}):null,M?Mo(Fl,{i18n:v,doneButtonHandler:y}):null]})]})}function Kl(e,t,i,r){if(e)return Il.STATE_ERROR;if(t)return Il.STATE_COMPLETE;if(i)return Il.STATE_WAITING;let o=Il.STATE_WAITING;const s=Object.keys(r);for(let e=0;e<s.length;e++){const{progress:t}=r[s[e]];if(t.uploadStarted&&!t.uploadComplete)return Il.STATE_UPLOADING;t.preprocess&&(o=Il.STATE_PREPROCESSING),t.postprocess&&o!==Il.STATE_PREPROCESSING&&(o=Il.STATE_POSTPROCESSING)}return o}class ql extends uo{#A;#E;#_;#M;componentDidMount(){this.#A=performance.now(),this.#E=this.props.uppy.getFiles().reduce(((e,t)=>e+(t.progress.bytesUploaded||0)),0),this.props.uppy.on("upload",this.#R)}componentWillUnmount(){this.props.uppy.off("upload",this.#R)}#R=()=>{const{recoveredState:e}=this.props.uppy.getState();this.#_=null,this.#M=null,e?this.#E=Object.values(e.files).reduce(((e,{progress:t})=>e+(t.bytesUploaded||0)),0):(this.#A=performance.now(),this.#E=0)};#N(e){if(null==e.total||0===e.total)return null;const t=e.total-e.uploaded;if(t<=0)return null;this.#A??=performance.now();const i=performance.now()-this.#A;if(0===i)return Math.round((this.#M??0)/100)/10;if(null==this.#E)return this.#E=e.uploaded,null;const r=e.uploaded-this.#E;if(this.#E=e.uploaded,r<=0)return Math.round((this.#M??0)/100)/10;const o=r/i;if(!Number.isFinite(o)||o<=0)return null;const s=null==this.#_?o:xr(o,this.#_,2e3,i);if(!Number.isFinite(s)||s<=0)return null;this.#_=s;const a=t/s;if(!Number.isFinite(a)||a<0)return null;const n=Math.max((this.#M??0)-i,0),l=null==this.#M?a:xr(a,n,2e3,i);return!Number.isFinite(l)||l<0?null:(this.#M=l,this.#A=performance.now(),Math.round(l/100)/10)}startUpload=()=>{const{recoveredState:e}=this.props.uppy.getState();e?this.props.uppy.emit("restore-confirmed"):this.props.uppy.upload().catch((()=>{}))};render(){const{capabilities:e,files:t,allowNewUpload:i,totalProgress:r,error:o,recoveredState:s}=this.props.uppy.getState(),{newFiles:a,startedFiles:n,completeFiles:l,isUploadStarted:d,isAllComplete:p,isAllPaused:h,isUploadInProgress:c,isSomeGhost:u}=this.props.uppy.getObjectOfFilesPerState(),f=s?Object.values(t):a,m=!!e.resumableUploads,b=!1!==e.uploadProgress;let y=null,g=0;n.every((e=>null!=e.progress.bytesTotal&&0!==e.progress.bytesTotal))?(y=0,n.forEach((e=>{y+=e.progress.bytesTotal||0,g+=e.progress.bytesUploaded||0}))):n.forEach((e=>{g+=e.progress.bytesUploaded||0}));const v=this.#N({uploaded:g,total:y});return Mo(Jl,{error:o,uploadState:Kl(o,p,s,t||{}),allowNewUpload:i,totalProgress:r,totalSize:y,totalUploadedSize:g,isAllComplete:p,isAllPaused:h,isUploadStarted:d,isUploadInProgress:c,isSomeGhost:u,recoveredState:s,complete:l.length,newFiles:f.length,numUploads:n.length,totalETA:v,files:t,i18n:this.props.i18n,uppy:this.props.uppy,startUpload:this.startUpload,doneButtonHandler:this.props.doneButtonHandler,resumableUploads:m,supportsUploadProgress:b,hideProgressDetails:this.props.hideProgressDetails,hideUploadButton:this.props.hideUploadButton,hideRetryButton:this.props.hideRetryButton,hidePauseResumeButton:this.props.hidePauseResumeButton,hideCancelButton:this.props.hideCancelButton,hideAfterFinish:this.props.hideAfterFinish})}}var Gl={strings:{closeModal:"Close Modal",addMoreFiles:"Add more files",addingMoreFiles:"Adding more files",importFrom:"Import from %{name}",dashboardWindowTitle:"Uppy Dashboard Window (Press escape to close)",dashboardTitle:"Uppy Dashboard",copyLinkToClipboardSuccess:"Link copied to clipboard.",copyLinkToClipboardFallback:"Copy the URL below",copyLink:"Copy link",back:"Back",removeFile:"Remove file",editFile:"Edit file",editImage:"Edit image",editing:"Editing %{file}",error:"Error",finishEditingFile:"Finish editing file",saveChanges:"Save changes",myDevice:"My Device",dropHint:"Drop your files here",uploadComplete:"Upload complete",uploadPaused:"Upload paused",resumeUpload:"Resume upload",pauseUpload:"Pause upload",retryUpload:"Retry upload",cancelUpload:"Cancel upload",xFilesSelected:{0:"%{smart_count} file selected",1:"%{smart_count} files selected"},uploadingXFiles:{0:"Uploading %{smart_count} file",1:"Uploading %{smart_count} files"},processingXFiles:{0:"Processing %{smart_count} file",1:"Processing %{smart_count} files"},poweredBy:"Powered by %{uppy}",addMore:"Add more",editFileWithFilename:"Edit file %{file}",save:"Save",cancel:"Cancel",dropPasteFiles:"Drop files here or %{browseFiles}",dropPasteFolders:"Drop files here or %{browseFolders}",dropPasteBoth:"Drop files here, %{browseFiles} or %{browseFolders}",dropPasteImportFiles:"Drop files here, %{browseFiles} or import from:",dropPasteImportFolders:"Drop files here, %{browseFolders} or import from:",dropPasteImportBoth:"Drop files here, %{browseFiles}, %{browseFolders} or import from:",importFiles:"Import files from:",browseFiles:"browse files",browseFolders:"browse folders",recoveredXFiles:{0:"We could not fully recover 1 file. Please re-select it and resume the upload.",1:"We could not fully recover %{smart_count} files. Please re-select them and resume the upload."},recoveredAllFiles:"We restored all files. You can now resume the upload.",sessionRestored:"Session restored",reSelect:"Re-select",missingRequiredMetaFields:{0:"Missing required meta field: %{fields}.",1:"Missing required meta fields: %{fields}."},takePictureBtn:"Take Picture",recordVideoBtn:"Record Video",uploading:"Uploading",complete:"Complete",uploadFailed:"Upload failed",paused:"Paused",retry:"Retry",pause:"Pause",resume:"Resume",done:"Done",filesUploadedOfTotal:{0:"%{complete} of %{smart_count} file uploaded",1:"%{complete} of %{smart_count} files uploaded"},dataUploadedOfTotal:"%{complete} of %{total}",dataUploadedOfUnknown:"%{complete} of unknown",xTimeLeft:"%{time} left",uploadXFiles:{0:"Upload %{smart_count} file",1:"Upload %{smart_count} files"},uploadXNewFiles:{0:"Upload +%{smart_count} file",1:"Upload +%{smart_count} files"},upload:"Upload",xMoreFilesAdded:{0:"%{smart_count} more file added",1:"%{smart_count} more files added"},showErrorDetails:"Show error details"}};function Xl(e,t){if(t){const i=e.querySelector(`[data-uppy-paneltype="${t}"]`);if(i)return i}return e}function Yl(e,t){const i=t[0];i&&(i.focus(),e.preventDefault())}function Zl(e,t,i){const r=Xl(i,t),o=zr(r.querySelectorAll(kr)),s=o.indexOf(document.activeElement);!function(e){return e.contains(document.activeElement)}(r)?Yl(e,o):e.shiftKey&&0===s?function(e,t){const i=t[t.length-1];i&&(i.focus(),e.preventDefault())}(e,o):e.shiftKey||s!==o.length-1||Yl(e,o)}function Ql(){const e={};return e.promise=new Promise(((t,i)=>{e.resolve=t,e.reject=i})),e}const ed={target:"body",metaFields:[],thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:function(){return Mo("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30",children:Mo("path",{d:"M15 30c8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15C6.716 0 0 6.716 0 15c0 8.284 6.716 15 15 15zm4.258-12.676v6.846h-8.426v-6.846H5.204l9.82-12.364 9.82 12.364H19.26z"})})},showLinkToFileUploadResult:!1,hideProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,note:null,singleFileFullScreen:!0,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,showNativePhotoCameraButton:!1,showNativeVideoCameraButton:!1,theme:"light",autoOpen:null,disabled:!1,disableLocalFiles:!1,nativeCameraFacingMode:"",onDragLeave:()=>{},onDragOver:()=>{},onDrop:()=>{},plugins:[],doneButtonHandler:void 0,onRequestCloseModal:null,inline:!1,animateOpenClose:!0,browserBackButtonClose:!1,closeAfterFinish:!1,closeModalOnClickOutside:!1,disablePageScrollWhenModalOpen:!0,trigger:null,width:750,height:550};class td extends Bs{static VERSION="5.1.1";#U;modalName=`uppy-Dashboard-${ba()}`;superFocus=function(){let e=!1;return Ca(((t,i)=>{const r=Xl(t,i),o=r.contains(document.activeElement);if(o&&e)return;const s=r.querySelector("[data-uppy-super-focusable]");if(!o||s)if(s)s.focus({preventScroll:!0}),e=!0;else{const t=r.querySelector(kr);t?.focus({preventScroll:!0}),e=!1}}),260)}();ifFocusedOnUppyRecently=!1;dashboardIsDisabled;savedScrollPosition;savedActiveElement;resizeObserver;darkModeMediaQuery;makeDashboardInsidesVisibleAnywayTimeout;constructor(e,t){const i=t?.autoOpen??null;super(e,{...ed,...t,autoOpen:i}),this.id=this.opts.id||"Dashboard",this.title="Dashboard",this.type="orchestrator",this.defaultLocale=Gl,void 0===this.opts.doneButtonHandler&&(this.opts.doneButtonHandler=()=>{this.uppy.clear(),this.requestCloseModal()}),this.opts.onRequestCloseModal??=()=>this.closeModal(),this.i18nInit()}removeTarget=e=>{const t=this.getPluginState().targets.filter((t=>t.id!==e.id));this.setPluginState({targets:t})};addTarget=e=>{const t=e.id||e.constructor.name,i=e.title||t,r=e.type;if("acquirer"!==r&&"progressindicator"!==r&&"editor"!==r)return this.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;const o={id:t,name:i,type:r},s=this.getPluginState().targets.slice();return s.push(o),this.setPluginState({targets:s}),this.el};hideAllPanels=()=>{const e=this.getPluginState(),t={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};e.activePickerPanel===t.activePickerPanel&&e.showAddFilesPanel===t.showAddFilesPanel&&e.showFileEditor===t.showFileEditor&&e.activeOverlayType===t.activeOverlayType||(this.setPluginState(t),this.uppy.emit("dashboard:close-panel",e.activePickerPanel?.id))};showPanel=e=>{const{targets:t}=this.getPluginState(),i=t.find((t=>"acquirer"===t.type&&t.id===e));this.setPluginState({activePickerPanel:i,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",e)};canEditFile=e=>{const{targets:t}=this.getPluginState();return this.#O(t).some((t=>this.uppy.getPlugin(t.id).canEditFile(e)))};openFileEditor=e=>{const{targets:t}=this.getPluginState(),i=this.#O(t);this.setPluginState({showFileEditor:!0,fileCardFor:e.id||null,activeOverlayType:"FileEditor"}),i.forEach((t=>{this.uppy.getPlugin(t.id).selectFile(e)}))};closeFileEditor=()=>{const{metaFields:e}=this.getPluginState();this.setPluginState(e&&e.length>0?{showFileEditor:!1,activeOverlayType:"FileCard"}:{showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})};saveFileEditor=()=>{const{targets:e}=this.getPluginState();this.#O(e).forEach((e=>{this.uppy.getPlugin(e.id).save()})),this.closeFileEditor()};openModal=()=>{const{promise:e,resolve:t}=Ql();if(this.savedScrollPosition=window.pageYOffset,this.savedActiveElement=document.activeElement,this.opts.disablePageScrollWhenModalOpen&&document.body.classList.add("uppy-Dashboard-isFixed"),this.opts.animateOpenClose&&this.getPluginState().isClosing){const e=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",e,!1),t()};this.el.addEventListener("animationend",e,!1)}else this.setPluginState({isHidden:!1}),t();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),e};closeModal=e=>{const t=e?.manualClose??!0,{isHidden:i,isClosing:r}=this.getPluginState();if(i||r)return;const{promise:o,resolve:s}=Ql();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});const e=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",e,!1),s()};this.el.addEventListener("animationend",e,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),s();return document.removeEventListener("keydown",this.handleKeyDownInModal),t&&this.opts.browserBackButtonClose&&history.state?.[this.modalName]&&history.back(),this.uppy.emit("dashboard:modal-closed"),o};isModalOpen=()=>!this.getPluginState().isHidden||!1;requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal();setDarkModeCapability=e=>{const{capabilities:t}=this.uppy.getState();this.uppy.setState({capabilities:{...t,darkMode:e}})};handleSystemDarkModeChange=e=>{const t=e.matches;this.uppy.log("[Dashboard] Dark mode is "+(t?"on":"off")),this.setDarkModeCapability(t)};toggleFileCard=(e,t)=>{const i=this.uppy.getFile(t);this.uppy.emit(e?"dashboard:file-edit-start":"dashboard:file-edit-complete",i),this.setPluginState({fileCardFor:e?t:null,activeOverlayType:e?"FileCard":null})};toggleAddFilesPanel=e=>{this.setPluginState({showAddFilesPanel:e,activeOverlayType:e?"AddFiles":null})};addFiles=e=>{const t=e.map((e=>({source:this.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||e.webkitRelativePath||null}})));try{this.uppy.addFiles(t)}catch(e){this.uppy.log(e)}};startListeningToResize=()=>{this.resizeObserver=new ResizeObserver((e=>{const t=e[0],{width:i,height:r}=t.contentRect;this.setPluginState({containerWidth:i,containerHeight:r,areInsidesReadyToBeVisible:!0})})),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout((()=>{const e=this.getPluginState();e.areInsidesReadyToBeVisible||!this.opts.inline&&e.isHidden||(this.uppy.log("[Dashboard] resize event didn’t fire on time: defaulted to mobile layout","warning"),this.setPluginState({areInsidesReadyToBeVisible:!0}))}),1e3)};stopListeningToResize=()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)};recordIfFocusedOnUppyRecently=e=>{this.el.contains(e.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())};disableInteractiveElements=e=>{const t=this.#U??zr(this.el.querySelectorAll(["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'])).filter((e=>!e.classList.contains("uppy-Dashboard-close")));for(const i of t)"A"===i.tagName?i.setAttribute("aria-disabled",e):i.disabled=e;this.#U=e?t:null,this.dashboardIsDisabled=e};updateBrowserHistory=()=>{history.state?.[this.modalName]||history.pushState({...history.state,[this.modalName]:!0},""),window.addEventListener("popstate",this.handlePopState,!1)};handlePopState=e=>{!this.isModalOpen()||e.state&&e.state[this.modalName]||this.closeModal({manualClose:!1}),!this.isModalOpen()&&e.state?.[this.modalName]&&history.back()};handleKeyDownInModal=e=>{27===e.keyCode&&this.requestCloseModal(),9===e.keyCode&&Zl(e,this.getPluginState().activeOverlayType,this.el)};handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()};handlePaste=e=>{this.uppy.iteratePlugins((t=>{"acquirer"===t.type&&t.handleRootPaste?.(e)}));const t=zr(e.clipboardData.files);t.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(t))};handleInputChange=e=>{e.preventDefault();const t=zr(e.currentTarget.files||[]);t.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(t))};handleDragOver=e=>{e.preventDefault(),e.stopPropagation();const t=(()=>{let t=!0;return this.uppy.iteratePlugins((i=>{i.canHandleRootDrop?.(e)&&(t=!0)})),t})(),i=(()=>{const{types:t}=e.dataTransfer;return t.some((e=>"Files"===e))})();!t&&!i||this.opts.disabled||this.opts.disableLocalFiles&&(i||!t)||!this.uppy.getState().allowNewUpload?e.dataTransfer.dropEffect="none":(e.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver(e))};handleDragLeave=e=>{e.preventDefault(),e.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave(e)};handleDrop=async e=>{e.preventDefault(),e.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins((t=>{"acquirer"===t.type&&t.handleRootDrop?.(e)}));let t=!1;this.uppy.log("[Dashboard] Processing dropped files");const i=await async function(e,t){const i=t?.logDropError??Function.prototype;try{const t=[];for await(const r of async function*(e,t){const i=await Promise.all(Array.from(e.items,(async e=>{let i;return i??=Tr("function"==typeof e.getAsEntry?e.getAsEntry():e.webkitGetAsEntry(),t),{fileSystemHandle:i,lastResortFile:e.getAsFile()}})));for(const{lastResortFile:e,fileSystemHandle:r}of i)if(null!=r)try{yield*Ar(r,"",e)}catch(i){null!=e?yield e:t(i)}else null!=e&&(yield e)}(e,i))t.push(r);return t}catch{return function(e){const t=zr(e.files);return Promise.resolve(t)}(e)}}(e.dataTransfer,{logDropError:e=>{this.uppy.log(e,"error"),t||(this.uppy.info(e.message,"error"),t=!0)}});i.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(i)),this.opts.onDrop(e)};handleRequestThumbnail=e=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",e)};handleCancelThumbnail=e=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",e)};handleKeyDownInInline=e=>{9===e.keyCode&&function(e,t,i){null===t||Zl(e,t,i)}(e,this.getPluginState().activeOverlayType,this.el)};handlePasteOnBody=e=>{this.el.contains(document.activeElement)&&this.handlePaste(e)};handleComplete=({failed:e})=>{this.opts.closeAfterFinish&&!e?.length&&this.requestCloseModal()};#$=()=>{if(this.opts.disableThumbnailGenerator)return;const e=this.uppy.getFiles();if(1===e.length){const t=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);t?.setOptions({thumbnailWidth:600});const i={...e[0],preview:void 0};t?.requestThumbnail(i).then((()=>{t?.setOptions({thumbnailWidth:this.opts.thumbnailWidth})}))}};#j=e=>{const t=e[0],{metaFields:i}=this.getPluginState(),r=i&&i.length>0,o=this.canEditFile(t);r&&"metaEditor"===this.opts.autoOpen?this.toggleFileCard(!0,t.id):o&&"imageEditor"===this.opts.autoOpen&&this.openFileEditor(t)};initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){const e=Dr(this.opts.trigger);e?e.forEach((e=>e.addEventListener("click",this.openModal))):this.uppy.log("Dashboard modal trigger not found. Make sure `trigger` is set in Dashboard options, unless you are planning to call `dashboard.openModal()` method yourself","warning")}this.startListeningToResize(),document.addEventListener("paste",this.handlePasteOnBody),this.uppy.on("plugin-added",this.#W),this.uppy.on("plugin-remove",this.removeTarget),this.uppy.on("file-added",this.hideAllPanels),this.uppy.on("dashboard:modal-closed",this.hideAllPanels),this.uppy.on("complete",this.handleComplete),this.uppy.on("files-added",this.#$),this.uppy.on("file-removed",this.#$),document.addEventListener("focus",this.recordIfFocusedOnUppyRecently,!0),document.addEventListener("click",this.recordIfFocusedOnUppyRecently,!0),this.opts.inline&&this.el.addEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.on("files-added",this.#j)};removeEvents=()=>{const e=Dr(this.opts.trigger);!this.opts.inline&&e&&e.forEach((e=>e.removeEventListener("click",this.openModal))),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-added",this.#W),this.uppy.off("plugin-remove",this.removeTarget),this.uppy.off("file-added",this.hideAllPanels),this.uppy.off("dashboard:modal-closed",this.hideAllPanels),this.uppy.off("complete",this.handleComplete),this.uppy.off("files-added",this.#$),this.uppy.off("file-removed",this.#$),document.removeEventListener("focus",this.recordIfFocusedOnUppyRecently,!0),document.removeEventListener("click",this.recordIfFocusedOnUppyRecently,!0),this.opts.inline&&this.el.removeEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.off("files-added",this.#j)};superFocusOnEachUpdate=()=>{const e=this.el.contains(document.activeElement),t=document.activeElement===document.body||null===document.activeElement;0===this.uppy.getState().info.length&&(!this.opts.inline||e||t&&this.ifFocusedOnUppyRecently)?this.superFocus(this.el,this.getPluginState().activeOverlayType):this.superFocus.cancel()};afterUpdate=()=>{!this.opts.disabled||this.dashboardIsDisabled?(!this.opts.disabled&&this.dashboardIsDisabled&&this.disableInteractiveElements(!1),this.superFocusOnEachUpdate()):this.disableInteractiveElements(!0)};saveFileCard=(e,t)=>{this.uppy.setFileMeta(t,e),this.toggleFileCard(!1,t)};#L=e=>{const t=this.uppy.getPlugin(e.id);return{...e,icon:t.icon||this.opts.defaultPickerIcon,render:t.render}};#H=e=>{const t=this.uppy.getPlugin(e.id);return"function"!=typeof t.isSupported||t.isSupported()};#V=e=>e.filter((e=>"acquirer"===e.type&&this.#H(e))).map(this.#L);#J=e=>e.filter((e=>"progressindicator"===e.type)).map(this.#L);#O=e=>e.filter((e=>"editor"===e.type)).map(this.#L);render=e=>{const t=this.getPluginState(),{files:i,capabilities:r,allowNewUpload:o}=e,{newFiles:s,uploadStartedFiles:a,completeFiles:n,erroredFiles:l,inProgressFiles:d,inProgressNotPausedFiles:p,processingFiles:h,isUploadStarted:c,isAllComplete:u,isAllPaused:f}=this.uppy.getObjectOfFilesPerState(),m=this.#V(t.targets),b=this.#J(t.targets),y=this.#O(t.targets);let g;return g="auto"===this.opts.theme?r.darkMode?"dark":"light":this.opts.theme,["files","folders","both"].indexOf(this.opts.fileManagerSelectionType)<0&&(this.opts.fileManagerSelectionType="files",console.warn(`Unsupported option for "fileManagerSelectionType". Using default of "${this.opts.fileManagerSelectionType}".`)),function(e){const t=0===e.totalFileCount,i=1===e.totalFileCount,r=e.containerWidth>576,o=Ia({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":e.disabled,"uppy-Dashboard--animateOpenClose":e.animateOpenClose,"uppy-Dashboard--isClosing":e.isClosing,"uppy-Dashboard--isDraggingOver":e.isDraggingOver,"uppy-Dashboard--modal":!e.inline,"uppy-size--md":e.containerWidth>576,"uppy-size--lg":e.containerWidth>700,"uppy-size--xl":e.containerWidth>900,"uppy-size--height-md":e.containerHeight>330,"uppy-Dashboard--isAddFilesPanelVisible":e.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":e.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":e.singleFileFullScreen&&i&&e.containerHeight>330});let s=1;e.containerWidth>900?s=5:e.containerWidth>700?s=4:e.containerWidth>576&&(s=3);const a=e.showSelectedFiles&&!t,n=e.recoveredState?Object.keys(e.recoveredState.files).length:null,l=e.files?Object.keys(e.files).filter((t=>e.files[t].isGhost)).length:0;return Mo("div",{className:o,"data-uppy-theme":e.theme,"data-uppy-num-acquirers":e.acquirers.length,"data-uppy-drag-drop-supported":!e.disableLocalFiles&&Nr(),"aria-hidden":e.inline?"false":e.isHidden,"aria-disabled":e.disabled,"aria-label":e.i18n(e.inline?"dashboardTitle":"dashboardWindowTitle"),onPaste:e.handlePaste,onDragOver:e.handleDragOver,onDragLeave:e.handleDragLeave,onDrop:e.handleDrop,children:[Mo("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:e.handleClickOutside}),Mo("div",{className:"uppy-Dashboard-inner",role:e.inline?void 0:"dialog",style:{width:e.inline&&e.width?e.width:"",height:e.inline&&e.height?e.height:""},children:[e.inline?null:Mo("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":e.i18n("closeModal"),title:e.i18n("closeModal"),onClick:e.closeModal,children:Mo("span",{"aria-hidden":"true",children:"×"})}),Mo("div",{className:"uppy-Dashboard-innerWrap",children:[Mo("div",{className:"uppy-Dashboard-dropFilesHereHint",children:e.i18n("dropHint")}),a&&Mo(kl,{...e}),null!=n&&n>0&&Mo("div",{className:"uppy-Dashboard-serviceMsg",children:[Mo("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19",children:Mo("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd",children:[Mo("path",{d:"M12.857 1.43l10.234 17.056A1 1 0 0122.234 20H1.766a1 1 0 01-.857-1.514L11.143 1.429a1 1 0 011.714 0z",fill:"#FFD300"}),Mo("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),Mo("circle",{fill:"#000",cx:"12",cy:"17",r:"1"})]})}),Mo("strong",{className:"uppy-Dashboard-serviceMsg-title",children:e.i18n("sessionRestored")}),Mo("div",{className:"uppy-Dashboard-serviceMsg-text",children:l>0?e.i18n("recoveredXFiles",{smart_count:l}):e.i18n("recoveredAllFiles")})]}),a?Mo(cl,{id:e.id,i18n:e.i18n,uppy:e.uppy,files:e.files,resumableUploads:e.resumableUploads,hideRetryButton:e.hideRetryButton,hidePauseResumeButton:e.hidePauseResumeButton,hideCancelButton:e.hideCancelButton,showLinkToFileUploadResult:e.showLinkToFileUploadResult,showRemoveButtonAfterComplete:e.showRemoveButtonAfterComplete,metaFields:e.metaFields,toggleFileCard:e.toggleFileCard,handleRequestThumbnail:e.handleRequestThumbnail,handleCancelThumbnail:e.handleCancelThumbnail,recoveredState:e.recoveredState,individualCancellation:e.individualCancellation,openFileEditor:e.openFileEditor,canEditFile:e.canEditFile,toggleAddFilesPanel:e.toggleAddFilesPanel,isSingleFile:i,itemsPerRow:s,containerWidth:e.containerWidth,containerHeight:e.containerHeight}):Mo($n,{i18n:e.i18n,i18nArray:e.i18nArray,acquirers:e.acquirers,handleInputChange:e.handleInputChange,maxNumberOfFiles:e.maxNumberOfFiles,allowedFileTypes:e.allowedFileTypes,showNativePhotoCameraButton:e.showNativePhotoCameraButton,showNativeVideoCameraButton:e.showNativeVideoCameraButton,nativeCameraFacingMode:e.nativeCameraFacingMode,showPanel:e.showPanel,activePickerPanel:e.activePickerPanel,disableLocalFiles:e.disableLocalFiles,fileManagerSelectionType:e.fileManagerSelectionType,note:e.note,proudlyDisplayPoweredByUppy:e.proudlyDisplayPoweredByUppy}),Mo(Dl,{children:e.showAddFilesPanel?Mo(jn,{...e,isSizeMD:r},"AddFiles"):null}),Mo(Dl,{children:e.fileCardFor?Mo(Kn,{...e},"FileCard"):null}),Mo(Dl,{children:e.activePickerPanel?Mo(gl,{...e},"Picker"):null}),Mo(Dl,{children:e.showFileEditor?Mo(Wn,{...e},"Editor"):null}),Mo("div",{className:"uppy-Dashboard-progressindicators",children:[!e.disableInformer&&Mo(yl,{uppy:e.uppy}),!e.disableStatusBar&&Mo(ql,{uppy:e.uppy,i18n:e.i18n,hideProgressDetails:e.hideProgressDetails,hideUploadButton:e.hideUploadButton,hideRetryButton:e.hideRetryButton,hidePauseResumeButton:e.hidePauseResumeButton,hideCancelButton:e.hideCancelButton,hideAfterFinish:e.hideProgressAfterFinish,doneButtonHandler:e.doneButtonHandler}),!e.disableInformer&&Mo(yl,{uppy:e.uppy}),e.progressindicators.map((t=>e.uppy.getPlugin(t.id).render(e.state)))]})]})]})]})}({state:e,isHidden:t.isHidden,files:i,newFiles:s,uploadStartedFiles:a,completeFiles:n,erroredFiles:l,inProgressFiles:d,inProgressNotPausedFiles:p,processingFiles:h,isUploadStarted:c,isAllComplete:u,isAllPaused:f,totalFileCount:Object.keys(i).length,totalProgress:e.totalProgress,allowNewUpload:o,acquirers:m,theme:g,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:t.activePickerPanel,showFileEditor:t.showFileEditor,saveFileEditor:this.saveFileEditor,closeFileEditor:this.closeFileEditor,disableInteractiveElements:this.disableInteractiveElements,animateOpenClose:this.opts.animateOpenClose,isClosing:t.isClosing,progressindicators:b,editors:y,autoProceed:this.uppy.opts.autoProceed,id:this.id,closeModal:this.requestCloseModal,handleClickOutside:this.handleClickOutside,handleInputChange:this.handleInputChange,handlePaste:this.handlePaste,inline:this.opts.inline,showPanel:this.showPanel,hideAllPanels:this.hideAllPanels,i18n:this.i18n,i18nArray:this.i18nArray,uppy:this.uppy,note:this.opts.note,recoveredState:e.recoveredState,metaFields:t.metaFields,resumableUploads:r.resumableUploads||!1,individualCancellation:r.individualCancellation,isMobileDevice:r.isMobileDevice,fileCardFor:t.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:t.showAddFilesPanel,saveFileCard:this.saveFileCard,openFileEditor:this.openFileEditor,canEditFile:this.canEditFile,width:this.opts.width,height:this.opts.height,showLinkToFileUploadResult:this.opts.showLinkToFileUploadResult,fileManagerSelectionType:this.opts.fileManagerSelectionType,proudlyDisplayPoweredByUppy:this.opts.proudlyDisplayPoweredByUppy,showRemoveButtonAfterComplete:this.opts.showRemoveButtonAfterComplete,containerWidth:t.containerWidth,containerHeight:t.containerHeight,areInsidesReadyToBeVisible:t.areInsidesReadyToBeVisible,parentElement:this.el,allowedFileTypes:this.uppy.opts.restrictions.allowedFileTypes,maxNumberOfFiles:this.uppy.opts.restrictions.maxNumberOfFiles,requiredMetaFields:this.uppy.opts.restrictions.requiredMetaFields,showSelectedFiles:this.opts.showSelectedFiles,showNativePhotoCameraButton:this.opts.showNativePhotoCameraButton,showNativeVideoCameraButton:this.opts.showNativeVideoCameraButton,nativeCameraFacingMode:this.opts.nativeCameraFacingMode,singleFileFullScreen:this.opts.singleFileFullScreen,handleRequestThumbnail:this.handleRequestThumbnail,handleCancelThumbnail:this.handleCancelThumbnail,isDraggingOver:t.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop,disableInformer:this.opts.disableInformer,disableStatusBar:this.opts.disableStatusBar,hideProgressDetails:this.opts.hideProgressDetails,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,hideProgressAfterFinish:this.opts.hideProgressAfterFinish,doneButtonHandler:this.opts.doneButtonHandler})};#K=()=>{const{plugins:e}=this.opts;e.forEach((e=>{const t=this.uppy.getPlugin(e);t?t.mount(this,t):this.uppy.log(`[Uppy] Dashboard could not find plugin '${e}', make sure to uppy.use() the plugins you are specifying`,"warning")}))};#q=()=>{this.uppy.iteratePlugins(this.#W)};#W=e=>{e&&!e.opts?.target&&["acquirer","editor"].includes(e.type)&&(this.getPluginState().targets.some((t=>e.id===t.id))||e.mount(this,e))};#G(){const{thumbnailWidth:e,thumbnailHeight:t,thumbnailType:i,waitForThumbnailsBeforeUpload:r}=this.opts;return{thumbnailWidth:e,thumbnailHeight:t,thumbnailType:i,waitForThumbnailsBeforeUpload:r,lazy:!r}}setOptions(e){super.setOptions(e),this.uppy.getPlugin(this.#X())?.setOptions(this.#G())}#X(){return`${this.id}:ThumbnailGenerator`}install=()=>{this.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:void 0,showFileEditor:!1,metaFields:this.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});const{inline:e,closeAfterFinish:t}=this.opts;if(e&&t)throw new Error("[Dashboard] `closeAfterFinish: true` cannot be used on an inline Dashboard, because an inline Dashboard cannot be closed at all. Either set `inline: false`, or disable the `closeAfterFinish` option.");const{allowMultipleUploads:i,allowMultipleUploadBatches:r}=this.uppy.opts;(i||r)&&t&&this.uppy.log("[Dashboard] When using `closeAfterFinish`, we recommended setting the `allowMultipleUploadBatches` option to `false` in the Uppy constructor. See https://uppy.io/docs/uppy/#allowMultipleUploads-true","warning");const{target:o}=this.opts;o&&this.mount(o,this),this.opts.disableThumbnailGenerator||this.uppy.use(On,{id:this.#X(),...this.#G()}),this.darkModeMediaQuery="undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;const s=!!this.darkModeMediaQuery&&this.darkModeMediaQuery.matches;this.uppy.log("[Dashboard] Dark mode is "+(s?"on":"off")),this.setDarkModeCapability(s),"auto"===this.opts.theme&&this.darkModeMediaQuery?.addListener(this.handleSystemDarkModeChange),this.#K(),this.#q(),this.initEvents()};uninstall=()=>{if(!this.opts.disableThumbnailGenerator){const e=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);e&&this.uppy.removePlugin(e)}const{plugins:e}=this.opts;e.forEach((e=>{const t=this.uppy.getPlugin(e);t&&t.unmount()})),"auto"===this.opts.theme&&this.darkModeMediaQuery?.removeListener(this.handleSystemDarkModeChange),this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.unmount(),this.removeEvents()}}var id,rd={exports:{}},od=(id||(id=1,rd.exports=function(){function e(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,r)}return i}function t(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?e(Object(o),!0).forEach((function(e){var r,s,a;r=t,a=o[e],(s=i(s=e))in r?Object.defineProperty(r,s,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[s]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function i(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,i(o.key),o)}}function s(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?a(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=new Array(t);i<t;i++)r[i]=e[i];return r}var n="undefined"!=typeof window&&void 0!==window.document,l=n?window:{},d=!(!n||!l.document.documentElement)&&"ontouchstart"in l.document.documentElement,p=!!n&&"PointerEvent"in l,h="cropper",c="all",u="crop",f="move",m="zoom",b="e",y="w",g="s",v="n",w="ne",x="nw",k="se",S="sw",D="".concat(h,"-crop"),I="".concat(h,"-disabled"),C="".concat(h,"-hidden"),B="".concat(h,"-hide"),P="".concat(h,"-invisible"),z="".concat(h,"-modal"),F="".concat(h,"-move"),T="".concat(h,"Action"),A="".concat(h,"Preview"),E="crop",_="move",M="none",R="crop",N="cropend",U="cropmove",O="cropstart",$="dblclick",j=p?"pointerdown":d?"touchstart":"mousedown",W=p?"pointermove":d?"touchmove":"mousemove",L=p?"pointerup pointercancel":d?"touchend touchcancel":"mouseup",H="ready",V="resize",J="wheel",K="zoom",q="image/jpeg",G=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,X=/^data:/,Y=/^data:image\/jpeg;base64,/,Z=/^img|canvas$/i,Q={viewMode:0,dragMode:E,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:200,minContainerHeight:100,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},ee=Number.isNaN||l.isNaN;function te(e){return"number"==typeof e&&!ee(e)}var ie=function(e){return e>0&&e<1/0};function re(e){return void 0===e}function oe(e){return"object"===r(e)&&null!==e}var se=Object.prototype.hasOwnProperty;function ae(e){if(!oe(e))return!1;try{var t=e.constructor,i=t.prototype;return t&&i&&se.call(i,"isPrototypeOf")}catch(e){return!1}}function ne(e){return"function"==typeof e}var le=Array.prototype.slice;function de(e){return Array.from?Array.from(e):le.call(e)}function pe(e,t){return e&&ne(t)&&(Array.isArray(e)||te(e.length)?de(e).forEach((function(i,r){t.call(e,i,r,e)})):oe(e)&&Object.keys(e).forEach((function(i){t.call(e,e[i],i,e)}))),e}var he=Object.assign||function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return oe(e)&&i.length>0&&i.forEach((function(t){oe(t)&&Object.keys(t).forEach((function(i){e[i]=t[i]}))})),e},ce=/\.\d*(?:0|9){12}\d*$/;function ue(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return ce.test(e)?Math.round(e*t)/t:e}var fe=/^width|height|left|top|marginLeft|marginTop$/;function me(e,t){var i=e.style;pe(t,(function(e,t){fe.test(t)&&te(e)&&(e="".concat(e,"px")),i[t]=e}))}function be(e,t){if(t)if(te(e.length))pe(e,(function(e){be(e,t)}));else if(e.classList)e.classList.add(t);else{var i=e.className.trim();i?i.indexOf(t)<0&&(e.className="".concat(i," ").concat(t)):e.className=t}}function ye(e,t){t&&(te(e.length)?pe(e,(function(e){ye(e,t)})):e.classList?e.classList.remove(t):e.className.indexOf(t)>=0&&(e.className=e.className.replace(t,"")))}function ge(e,t,i){t&&(te(e.length)?pe(e,(function(e){ge(e,t,i)})):i?be(e,t):ye(e,t))}var ve=/([a-z\d])([A-Z])/g;function we(e){return e.replace(ve,"$1-$2").toLowerCase()}function xe(e,t){return oe(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute("data-".concat(we(t)))}function ke(e,t,i){oe(i)?e[t]=i:e.dataset?e.dataset[t]=i:e.setAttribute("data-".concat(we(t)),i)}var Se=/\s\s*/,De=function(){var e=!1;if(n){var t=!1,i=function(){},r=Object.defineProperty({},"once",{get:function(){return e=!0,t},set:function(e){t=e}});l.addEventListener("test",i,r),l.removeEventListener("test",i,r)}return e}();function Ie(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=i;t.trim().split(Se).forEach((function(t){if(!De){var s=e.listeners;s&&s[t]&&s[t][i]&&(o=s[t][i],delete s[t][i],0===Object.keys(s[t]).length&&delete s[t],0===Object.keys(s).length&&delete e.listeners)}e.removeEventListener(t,o,r)}))}function Ce(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=i;t.trim().split(Se).forEach((function(t){if(r.once&&!De){var s=e.listeners,a=void 0===s?{}:s;o=function(){delete a[t][i],e.removeEventListener(t,o,r);for(var s=arguments.length,n=new Array(s),l=0;l<s;l++)n[l]=arguments[l];i.apply(e,n)},a[t]||(a[t]={}),a[t][i]&&e.removeEventListener(t,a[t][i],r),a[t][i]=o,e.listeners=a}e.addEventListener(t,o,r)}))}function Be(e,t,i){var r;return ne(Event)&&ne(CustomEvent)?r=new CustomEvent(t,{detail:i,bubbles:!0,cancelable:!0}):(r=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,i),e.dispatchEvent(r)}function Pe(e){var t=e.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var ze=l.location,Fe=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Te(e){var t=e.match(Fe);return null!==t&&(t[1]!==ze.protocol||t[2]!==ze.hostname||t[3]!==ze.port)}function Ae(e){var t="timestamp=".concat((new Date).getTime());return e+(-1===e.indexOf("?")?"?":"&")+t}function Ee(e){var t=e.rotate,i=e.scaleX,r=e.scaleY,o=e.translateX,s=e.translateY,a=[];te(o)&&0!==o&&a.push("translateX(".concat(o,"px)")),te(s)&&0!==s&&a.push("translateY(".concat(s,"px)")),te(t)&&0!==t&&a.push("rotate(".concat(t,"deg)")),te(i)&&1!==i&&a.push("scaleX(".concat(i,")")),te(r)&&1!==r&&a.push("scaleY(".concat(r,")"));var n=a.length?a.join(" "):"none";return{WebkitTransform:n,msTransform:n,transform:n}}function _e(e,i){var r=e.pageX,o=e.pageY,s={endX:r,endY:o};return i?s:t({startX:r,startY:o},s)}function Me(e){var t=e.aspectRatio,i=e.height,r=e.width,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"contain",s=ie(r),a=ie(i);if(s&&a){var n=i*t;"contain"===o&&n>r||"cover"===o&&n<r?i=r/t:r=i*t}else s?i=r/t:a&&(r=i*t);return{width:r,height:i}}var Re=String.fromCharCode;var Ne=/^data:.*,/;function Ue(e){var t,i=new DataView(e);try{var r,o,s;if(255===i.getUint8(0)&&216===i.getUint8(1))for(var a=i.byteLength,n=2;n+1<a;){if(255===i.getUint8(n)&&225===i.getUint8(n+1)){o=n;break}n+=1}if(o){var l=o+10;if("Exif"===function(e,t,i){var r="";i+=t;for(var o=t;o<i;o+=1)r+=Re(e.getUint8(o));return r}(i,o+4,4)){var d=i.getUint16(l);if(((r=18761===d)||19789===d)&&42===i.getUint16(l+2,r)){var p=i.getUint32(l+4,r);p>=8&&(s=l+p)}}}if(s){var h,c,u=i.getUint16(s,r);for(c=0;c<u;c+=1)if(274===i.getUint16(h=s+12*c+2,r)){t=i.getUint16(h+=8,r),i.setUint16(h,1,r);break}}}catch(e){t=1}return t}var Oe={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var e=this.element,t=this.options,i=this.container,r=this.cropper,o=Number(t.minContainerWidth),s=Number(t.minContainerHeight);be(r,C),ye(e,C);var a={width:Math.max(i.offsetWidth,o>=0?o:200),height:Math.max(i.offsetHeight,s>=0?s:100)};this.containerData=a,me(r,{width:a.width,height:a.height}),be(e,C),ye(r,C)},initCanvas:function(){var e=this.containerData,t=this.imageData,i=this.options.viewMode,r=Math.abs(t.rotate)%180==90,o=r?t.naturalHeight:t.naturalWidth,s=r?t.naturalWidth:t.naturalHeight,a=o/s,n=e.width,l=e.height;e.height*a>e.width?3===i?n=e.height*a:l=e.width/a:3===i?l=e.width/a:n=e.height*a;var d={aspectRatio:a,naturalWidth:o,naturalHeight:s,width:n,height:l};this.canvasData=d,this.limited=1===i||2===i,this.limitCanvas(!0,!0),d.width=Math.min(Math.max(d.width,d.minWidth),d.maxWidth),d.height=Math.min(Math.max(d.height,d.minHeight),d.maxHeight),d.left=(e.width-d.width)/2,d.top=(e.height-d.height)/2,d.oldLeft=d.left,d.oldTop=d.top,this.initialCanvasData=he({},d)},limitCanvas:function(e,t){var i=this.options,r=this.containerData,o=this.canvasData,s=this.cropBoxData,a=i.viewMode,n=o.aspectRatio,l=this.cropped&&s;if(e){var d=Number(i.minCanvasWidth)||0,p=Number(i.minCanvasHeight)||0;a>1?(d=Math.max(d,r.width),p=Math.max(p,r.height),3===a&&(p*n>d?d=p*n:p=d/n)):a>0&&(d?d=Math.max(d,l?s.width:0):p?p=Math.max(p,l?s.height:0):l&&((p=s.height)*n>(d=s.width)?d=p*n:p=d/n));var h=Me({aspectRatio:n,width:d,height:p});p=h.height,o.minWidth=d=h.width,o.minHeight=p,o.maxWidth=1/0,o.maxHeight=1/0}if(t)if(a>(l?0:1)){var c=r.width-o.width,u=r.height-o.height;o.minLeft=Math.min(0,c),o.minTop=Math.min(0,u),o.maxLeft=Math.max(0,c),o.maxTop=Math.max(0,u),l&&this.limited&&(o.minLeft=Math.min(s.left,s.left+(s.width-o.width)),o.minTop=Math.min(s.top,s.top+(s.height-o.height)),o.maxLeft=s.left,o.maxTop=s.top,2===a&&(o.width>=r.width&&(o.minLeft=Math.min(0,c),o.maxLeft=Math.max(0,c)),o.height>=r.height&&(o.minTop=Math.min(0,u),o.maxTop=Math.max(0,u))))}else o.minLeft=-o.width,o.minTop=-o.height,o.maxLeft=r.width,o.maxTop=r.height},renderCanvas:function(e,t){var i=this.canvasData,r=this.imageData;if(t){var o=function(e){var t=e.width,i=e.height,r=e.degree;if(90==(r=Math.abs(r)%180))return{width:i,height:t};var o=r%90*Math.PI/180,s=Math.sin(o),a=Math.cos(o),n=t*a+i*s,l=t*s+i*a;return r>90?{width:l,height:n}:{width:n,height:l}}({width:r.naturalWidth*Math.abs(r.scaleX||1),height:r.naturalHeight*Math.abs(r.scaleY||1),degree:r.rotate||0}),s=o.width,a=o.height,n=i.width*(s/i.naturalWidth),l=i.height*(a/i.naturalHeight);i.left-=(n-i.width)/2,i.top-=(l-i.height)/2,i.width=n,i.height=l,i.aspectRatio=s/a,i.naturalWidth=s,i.naturalHeight=a,this.limitCanvas(!0,!1)}(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCanvas(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,me(this.canvas,he({width:i.width,height:i.height},Ee({translateX:i.left,translateY:i.top}))),this.renderImage(e),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(e){var t=this.canvasData,i=this.imageData,r=i.naturalWidth*(t.width/t.naturalWidth),o=i.naturalHeight*(t.height/t.naturalHeight);he(i,{width:r,height:o,left:(t.width-r)/2,top:(t.height-o)/2}),me(this.image,he({width:i.width,height:i.height},Ee(he({translateX:i.left,translateY:i.top},i)))),e&&this.output()},initCropBox:function(){var e=this.options,t=this.canvasData,i=e.aspectRatio||e.initialAspectRatio,r=Number(e.autoCropArea)||.8,o={width:t.width,height:t.height};i&&(t.height*i>t.width?o.height=o.width/i:o.width=o.height*i),this.cropBoxData=o,this.limitCropBox(!0,!0),o.width=Math.min(Math.max(o.width,o.minWidth),o.maxWidth),o.height=Math.min(Math.max(o.height,o.minHeight),o.maxHeight),o.width=Math.max(o.minWidth,o.width*r),o.height=Math.max(o.minHeight,o.height*r),o.left=t.left+(t.width-o.width)/2,o.top=t.top+(t.height-o.height)/2,o.oldLeft=o.left,o.oldTop=o.top,this.initialCropBoxData=he({},o)},limitCropBox:function(e,t){var i=this.options,r=this.containerData,o=this.canvasData,s=this.cropBoxData,a=this.limited,n=i.aspectRatio;if(e){var l=Number(i.minCropBoxWidth)||0,d=Number(i.minCropBoxHeight)||0,p=a?Math.min(r.width,o.width,o.width+o.left,r.width-o.left):r.width,h=a?Math.min(r.height,o.height,o.height+o.top,r.height-o.top):r.height;l=Math.min(l,r.width),d=Math.min(d,r.height),n&&(l&&d?d*n>l?d=l/n:l=d*n:l?d=l/n:d&&(l=d*n),h*n>p?h=p/n:p=h*n),s.minWidth=Math.min(l,p),s.minHeight=Math.min(d,h),s.maxWidth=p,s.maxHeight=h}t&&(a?(s.minLeft=Math.max(0,o.left),s.minTop=Math.max(0,o.top),s.maxLeft=Math.min(r.width,o.left+o.width)-s.width,s.maxTop=Math.min(r.height,o.top+o.height)-s.height):(s.minLeft=0,s.minTop=0,s.maxLeft=r.width-s.width,s.maxTop=r.height-s.height))},renderCropBox:function(){var e=this.options,t=this.containerData,i=this.cropBoxData;(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCropBox(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,e.movable&&e.cropBoxMovable&&ke(this.face,T,i.width>=t.width&&i.height>=t.height?f:c),me(this.cropBox,he({width:i.width,height:i.height},Ee({translateX:i.left,translateY:i.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Be(this.element,R,this.getData())}},$e={initPreview:function(){var e=this.element,t=this.crossOrigin,i=this.options.preview,r=t?this.crossOriginUrl:this.url,o=e.alt||"The image to preview",s=document.createElement("img");if(t&&(s.crossOrigin=t),s.src=r,s.alt=o,this.viewBox.appendChild(s),this.viewBoxImage=s,i){var a=i;"string"==typeof i?a=e.ownerDocument.querySelectorAll(i):i.querySelector&&(a=[i]),this.previews=a,pe(a,(function(e){var i=document.createElement("img");ke(e,A,{width:e.offsetWidth,height:e.offsetHeight,html:e.innerHTML}),t&&(i.crossOrigin=t),i.src=r,i.alt=o,i.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',e.innerHTML="",e.appendChild(i)}))}},resetPreview:function(){pe(this.previews,(function(e){var t=xe(e,A);me(e,{width:t.width,height:t.height}),e.innerHTML=t.html,function(e,t){if(oe(e[t]))try{delete e[t]}catch(i){e[t]=void 0}else if(e.dataset)try{delete e.dataset[t]}catch(i){e.dataset[t]=void 0}else e.removeAttribute("data-".concat(we(t)))}(e,A)}))},preview:function(){var e=this.imageData,t=this.canvasData,i=this.cropBoxData,r=i.width,o=i.height,s=e.width,a=e.height,n=i.left-t.left-e.left,l=i.top-t.top-e.top;this.cropped&&!this.disabled&&(me(this.viewBoxImage,he({width:s,height:a},Ee(he({translateX:-n,translateY:-l},e)))),pe(this.previews,(function(t){var i=xe(t,A),d=i.width,p=i.height,h=d,c=p,u=1;r&&(c=o*(u=d/r)),o&&c>p&&(h=r*(u=p/o),c=p),me(t,{width:h,height:c}),me(t.getElementsByTagName("img")[0],he({width:s*u,height:a*u},Ee(he({translateX:-n*u,translateY:-l*u},e))))})))}},je={bind:function(){var e=this.element,t=this.options,i=this.cropper;ne(t.cropstart)&&Ce(e,O,t.cropstart),ne(t.cropmove)&&Ce(e,U,t.cropmove),ne(t.cropend)&&Ce(e,N,t.cropend),ne(t.crop)&&Ce(e,R,t.crop),ne(t.zoom)&&Ce(e,K,t.zoom),Ce(i,j,this.onCropStart=this.cropStart.bind(this)),t.zoomable&&t.zoomOnWheel&&Ce(i,J,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Ce(i,$,this.onDblclick=this.dblclick.bind(this)),Ce(e.ownerDocument,W,this.onCropMove=this.cropMove.bind(this)),Ce(e.ownerDocument,L,this.onCropEnd=this.cropEnd.bind(this)),t.responsive&&Ce(window,V,this.onResize=this.resize.bind(this))},unbind:function(){var e=this.element,t=this.options,i=this.cropper;ne(t.cropstart)&&Ie(e,O,t.cropstart),ne(t.cropmove)&&Ie(e,U,t.cropmove),ne(t.cropend)&&Ie(e,N,t.cropend),ne(t.crop)&&Ie(e,R,t.crop),ne(t.zoom)&&Ie(e,K,t.zoom),Ie(i,j,this.onCropStart),t.zoomable&&t.zoomOnWheel&&Ie(i,J,this.onWheel,{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Ie(i,$,this.onDblclick),Ie(e.ownerDocument,W,this.onCropMove),Ie(e.ownerDocument,L,this.onCropEnd),t.responsive&&Ie(window,V,this.onResize)}},We={resize:function(){if(!this.disabled){var e,t,i=this.options,r=this.container,o=this.containerData,s=r.offsetWidth/o.width,a=r.offsetHeight/o.height,n=Math.abs(s-1)>Math.abs(a-1)?s:a;1!==n&&(i.restore&&(e=this.getCanvasData(),t=this.getCropBoxData()),this.render(),i.restore&&(this.setCanvasData(pe(e,(function(t,i){e[i]=t*n}))),this.setCropBoxData(pe(t,(function(e,i){t[i]=e*n})))))}},dblclick:function(){var e,t;this.disabled||this.options.dragMode===M||this.setDragMode((t=D,((e=this.dragBox).classList?e.classList.contains(t):e.className.indexOf(t)>-1)?_:E))},wheel:function(e){var t=this,i=Number(this.options.wheelZoomRatio)||.1,r=1;this.disabled||(e.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout((function(){t.wheeling=!1}),50),e.deltaY?r=e.deltaY>0?1:-1:e.wheelDelta?r=-e.wheelDelta/120:e.detail&&(r=e.detail>0?1:-1),this.zoom(-r*i,e)))},cropStart:function(e){var t=e.buttons,i=e.button;if(!(this.disabled||("mousedown"===e.type||"pointerdown"===e.type&&"mouse"===e.pointerType)&&(te(t)&&1!==t||te(i)&&0!==i||e.ctrlKey))){var r,o=this.options,s=this.pointers;e.changedTouches?pe(e.changedTouches,(function(e){s[e.identifier]=_e(e)})):s[e.pointerId||0]=_e(e),r=Object.keys(s).length>1&&o.zoomable&&o.zoomOnTouch?m:xe(e.target,T),G.test(r)&&!1!==Be(this.element,O,{originalEvent:e,action:r})&&(e.preventDefault(),this.action=r,this.cropping=!1,r===u&&(this.cropping=!0,be(this.dragBox,z)))}},cropMove:function(e){var t=this.action;if(!this.disabled&&t){var i=this.pointers;e.preventDefault(),!1!==Be(this.element,U,{originalEvent:e,action:t})&&(e.changedTouches?pe(e.changedTouches,(function(e){he(i[e.identifier]||{},_e(e,!0))})):he(i[e.pointerId||0]||{},_e(e,!0)),this.change(e))}},cropEnd:function(e){if(!this.disabled){var t=this.action,i=this.pointers;e.changedTouches?pe(e.changedTouches,(function(e){delete i[e.identifier]})):delete i[e.pointerId||0],t&&(e.preventDefault(),Object.keys(i).length||(this.action=""),this.cropping&&(this.cropping=!1,ge(this.dragBox,z,this.cropped&&this.options.modal)),Be(this.element,N,{originalEvent:e,action:t}))}}},Le={change:function(e){var i,r=this.canvasData,o=this.containerData,s=this.cropBoxData,a=this.pointers,n=this.action,l=this.options.aspectRatio,d=s.left,p=s.top,h=s.width,D=s.height,I=d+h,B=p+D,P=0,z=0,F=o.width,T=o.height,A=!0;!l&&e.shiftKey&&(l=h&&D?h/D:1),this.limited&&(z=s.minTop,F=(P=s.minLeft)+Math.min(o.width,r.width,r.left+r.width),T=z+Math.min(o.height,r.height,r.top+r.height));var E=a[Object.keys(a)[0]],_={x:E.endX-E.startX,y:E.endY-E.startY},M=function(e){switch(e){case b:I+_.x>F&&(_.x=F-I);break;case y:d+_.x<P&&(_.x=P-d);break;case v:p+_.y<z&&(_.y=z-p);break;case g:B+_.y>T&&(_.y=T-B)}};switch(n){case c:d+=_.x,p+=_.y;break;case b:if(_.x>=0&&(I>=F||l&&(p<=z||B>=T))){A=!1;break}M(b),(h+=_.x)<0&&(n=y,d-=h=-h),l&&(p+=(s.height-(D=h/l))/2);break;case v:if(_.y<=0&&(p<=z||l&&(d<=P||I>=F))){A=!1;break}M(v),p+=_.y,(D-=_.y)<0&&(n=g,p-=D=-D),l&&(d+=(s.width-(h=D*l))/2);break;case y:if(_.x<=0&&(d<=P||l&&(p<=z||B>=T))){A=!1;break}M(y),d+=_.x,(h-=_.x)<0&&(n=b,d-=h=-h),l&&(p+=(s.height-(D=h/l))/2);break;case g:if(_.y>=0&&(B>=T||l&&(d<=P||I>=F))){A=!1;break}M(g),(D+=_.y)<0&&(n=v,p-=D=-D),l&&(d+=(s.width-(h=D*l))/2);break;case w:if(l){if(_.y<=0&&(p<=z||I>=F)){A=!1;break}M(v),p+=_.y,h=(D-=_.y)*l}else M(v),M(b),_.x>=0?I<F?h+=_.x:_.y<=0&&p<=z&&(A=!1):h+=_.x,_.y<=0?p>z&&(D-=_.y,p+=_.y):(D-=_.y,p+=_.y);h<0&&D<0?(n=S,p-=D=-D,d-=h=-h):h<0?(n=x,d-=h=-h):D<0&&(n=k,p-=D=-D);break;case x:if(l){if(_.y<=0&&(p<=z||d<=P)){A=!1;break}M(v),p+=_.y,d+=s.width-(h=(D-=_.y)*l)}else M(v),M(y),_.x<=0?d>P?(h-=_.x,d+=_.x):_.y<=0&&p<=z&&(A=!1):(h-=_.x,d+=_.x),_.y<=0?p>z&&(D-=_.y,p+=_.y):(D-=_.y,p+=_.y);h<0&&D<0?(n=k,p-=D=-D,d-=h=-h):h<0?(n=w,d-=h=-h):D<0&&(n=S,p-=D=-D);break;case S:if(l){if(_.x<=0&&(d<=P||B>=T)){A=!1;break}M(y),d+=_.x,D=(h-=_.x)/l}else M(g),M(y),_.x<=0?d>P?(h-=_.x,d+=_.x):_.y>=0&&B>=T&&(A=!1):(h-=_.x,d+=_.x),_.y>=0?B<T&&(D+=_.y):D+=_.y;h<0&&D<0?(n=w,p-=D=-D,d-=h=-h):h<0?(n=k,d-=h=-h):D<0&&(n=x,p-=D=-D);break;case k:if(l){if(_.x>=0&&(I>=F||B>=T)){A=!1;break}M(b),D=(h+=_.x)/l}else M(g),M(b),_.x>=0?I<F?h+=_.x:_.y>=0&&B>=T&&(A=!1):h+=_.x,_.y>=0?B<T&&(D+=_.y):D+=_.y;h<0&&D<0?(n=x,p-=D=-D,d-=h=-h):h<0?(n=S,d-=h=-h):D<0&&(n=w,p-=D=-D);break;case f:this.move(_.x,_.y),A=!1;break;case m:this.zoom(function(e){var i=t({},e),r=0;return pe(e,(function(e,t){delete i[t],pe(i,(function(t){var i=Math.abs(e.startX-t.startX),o=Math.abs(e.startY-t.startY),s=Math.abs(e.endX-t.endX),a=Math.abs(e.endY-t.endY),n=Math.sqrt(i*i+o*o),l=(Math.sqrt(s*s+a*a)-n)/n;Math.abs(l)>Math.abs(r)&&(r=l)}))})),r}(a),e),A=!1;break;case u:if(!_.x||!_.y){A=!1;break}i=Pe(this.cropper),d=E.startX-i.left,p=E.startY-i.top,h=s.minWidth,D=s.minHeight,_.x>0?n=_.y>0?k:w:_.x<0&&(d-=h,n=_.y>0?S:x),_.y<0&&(p-=D),this.cropped||(ye(this.cropBox,C),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}A&&(s.width=h,s.height=D,s.left=d,s.top=p,this.action=n,this.renderCropBox()),pe(a,(function(e){e.startX=e.endX,e.startY=e.endY}))}},He={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&be(this.dragBox,z),ye(this.cropBox,C),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=he({},this.initialImageData),this.canvasData=he({},this.initialCanvasData),this.cropBoxData=he({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(he(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),ye(this.dragBox,z),be(this.cropBox,C)),this},replace:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!this.disabled&&e&&(this.isImg&&(this.element.src=e),t?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,pe(this.previews,(function(t){t.getElementsByTagName("img")[0].src=e})))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,ye(this.cropper,I)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,be(this.cropper,I)),this},destroy:function(){var e=this.element;return e[h]?(e[h]=void 0,this.isImg&&this.replaced&&(e.src=this.originalUrl),this.uncreate(),this):this},move:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,i=this.canvasData,r=i.left,o=i.top;return this.moveTo(re(e)?e:r+Number(e),re(t)?t:o+Number(t))},moveTo:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,i=this.canvasData,r=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.movable&&(te(e)&&(i.left=e,r=!0),te(t)&&(i.top=t,r=!0),r&&this.renderCanvas(!0)),this},zoom:function(e,t){var i=this.canvasData;return e=Number(e),this.zoomTo(i.width*(e=e<0?1/(1-e):1+e)/i.naturalWidth,null,t)},zoomTo:function(e,t,i){var r=this.options,o=this.canvasData,s=o.width,a=o.height,n=o.naturalWidth,l=o.naturalHeight;if((e=Number(e))>=0&&this.ready&&!this.disabled&&r.zoomable){var d=n*e,p=l*e;if(!1===Be(this.element,K,{ratio:e,oldRatio:s/n,originalEvent:i}))return this;if(i){var h=this.pointers,c=Pe(this.cropper),u=h&&Object.keys(h).length?function(e){var t=0,i=0,r=0;return pe(e,(function(e){t+=e.startX,i+=e.startY,r+=1})),{pageX:t/=r,pageY:i/=r}}(h):{pageX:i.pageX,pageY:i.pageY};o.left-=(u.pageX-c.left-o.left)/s*(d-s),o.top-=(u.pageY-c.top-o.top)/a*(p-a)}else ae(t)&&te(t.x)&&te(t.y)?(o.left-=(t.x-o.left)/s*(d-s),o.top-=(t.y-o.top)/a*(p-a)):(o.left-=(d-s)/2,o.top-=(p-a)/2);o.width=d,o.height=p,this.renderCanvas(!0)}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return te(e=Number(e))&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=e%360,this.renderCanvas(!0,!0)),this},scaleX:function(e){var t=this.imageData.scaleY;return this.scale(e,te(t)?t:1)},scaleY:function(e){var t=this.imageData.scaleX;return this.scale(te(t)?t:1,e)},scale:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,i=this.imageData,r=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.scalable&&(te(e)&&(i.scaleX=e,r=!0),te(t)&&(i.scaleY=t,r=!0),r&&this.renderCanvas(!0,!0)),this},getData:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=this.options,r=this.imageData,o=this.canvasData,s=this.cropBoxData;if(this.ready&&this.cropped){var a=r.width/r.naturalWidth;if(pe(e={x:s.left-o.left,y:s.top-o.top,width:s.width,height:s.height},(function(t,i){e[i]=t/a})),t){var n=Math.round(e.y+e.height),l=Math.round(e.x+e.width);e.x=Math.round(e.x),e.y=Math.round(e.y),e.width=l-e.x,e.height=n-e.y}}else e={x:0,y:0,width:0,height:0};return i.rotatable&&(e.rotate=r.rotate||0),i.scalable&&(e.scaleX=r.scaleX||1,e.scaleY=r.scaleY||1),e},setData:function(e){var t=this.options,i=this.imageData,r=this.canvasData,o={};if(this.ready&&!this.disabled&&ae(e)){var s=!1;t.rotatable&&te(e.rotate)&&e.rotate!==i.rotate&&(i.rotate=e.rotate,s=!0),t.scalable&&(te(e.scaleX)&&e.scaleX!==i.scaleX&&(i.scaleX=e.scaleX,s=!0),te(e.scaleY)&&e.scaleY!==i.scaleY&&(i.scaleY=e.scaleY,s=!0)),s&&this.renderCanvas(!0,!0);var a=i.width/i.naturalWidth;te(e.x)&&(o.left=e.x*a+r.left),te(e.y)&&(o.top=e.y*a+r.top),te(e.width)&&(o.width=e.width*a),te(e.height)&&(o.height=e.height*a),this.setCropBoxData(o)}return this},getContainerData:function(){return this.ready?he({},this.containerData):{}},getImageData:function(){return this.sized?he({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,t={};return this.ready&&pe(["left","top","width","height","naturalWidth","naturalHeight"],(function(i){t[i]=e[i]})),t},setCanvasData:function(e){var t=this.canvasData,i=t.aspectRatio;return this.ready&&!this.disabled&&ae(e)&&(te(e.left)&&(t.left=e.left),te(e.top)&&(t.top=e.top),te(e.width)?(t.width=e.width,t.height=e.width/i):te(e.height)&&(t.height=e.height,t.width=e.height*i),this.renderCanvas(!0)),this},getCropBoxData:function(){var e,t=this.cropBoxData;return this.ready&&this.cropped&&(e={left:t.left,top:t.top,width:t.width,height:t.height}),e||{}},setCropBoxData:function(e){var t,i,r=this.cropBoxData,o=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&ae(e)&&(te(e.left)&&(r.left=e.left),te(e.top)&&(r.top=e.top),te(e.width)&&e.width!==r.width&&(t=!0,r.width=e.width),te(e.height)&&e.height!==r.height&&(i=!0,r.height=e.height),o&&(t?r.height=r.width/o:i&&(r.width=r.height*o)),this.renderCropBox()),this},getCroppedCanvas:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var t=this.canvasData,i=function(e,t,i,r){var o=t.aspectRatio,a=t.naturalWidth,n=t.naturalHeight,l=t.rotate,d=void 0===l?0:l,p=t.scaleX,h=void 0===p?1:p,c=t.scaleY,u=void 0===c?1:c,f=i.aspectRatio,m=i.naturalWidth,b=i.naturalHeight,y=r.fillColor,g=void 0===y?"transparent":y,v=r.imageSmoothingEnabled,w=void 0===v||v,x=r.imageSmoothingQuality,k=void 0===x?"low":x,S=r.maxWidth,D=void 0===S?1/0:S,I=r.maxHeight,C=void 0===I?1/0:I,B=r.minWidth,P=void 0===B?0:B,z=r.minHeight,F=void 0===z?0:z,T=document.createElement("canvas"),A=T.getContext("2d"),E=Me({aspectRatio:f,width:D,height:C}),_=Me({aspectRatio:f,width:P,height:F},"cover"),M=Math.min(E.width,Math.max(_.width,m)),R=Math.min(E.height,Math.max(_.height,b)),N=Me({aspectRatio:o,width:D,height:C}),U=Me({aspectRatio:o,width:P,height:F},"cover"),O=Math.min(N.width,Math.max(U.width,a)),$=Math.min(N.height,Math.max(U.height,n)),j=[-O/2,-$/2,O,$];return T.width=ue(M),T.height=ue(R),A.fillStyle=g,A.fillRect(0,0,M,R),A.save(),A.translate(M/2,R/2),A.rotate(d*Math.PI/180),A.scale(h,u),A.imageSmoothingEnabled=w,A.imageSmoothingQuality=k,A.drawImage.apply(A,[e].concat(s(j.map((function(e){return Math.floor(ue(e))}))))),A.restore(),T}(this.image,this.imageData,t,e);if(!this.cropped)return i;var r=this.getData(e.rounded),o=r.x,a=r.y,n=r.width,l=r.height,d=i.width/Math.floor(t.naturalWidth);1!==d&&(o*=d,a*=d,n*=d,l*=d);var p=n/l,h=Me({aspectRatio:p,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),c=Me({aspectRatio:p,width:e.minWidth||0,height:e.minHeight||0},"cover"),u=Me({aspectRatio:p,width:e.width||(1!==d?i.width:n),height:e.height||(1!==d?i.height:l)}),f=u.width,m=u.height;f=Math.min(h.width,Math.max(c.width,f)),m=Math.min(h.height,Math.max(c.height,m));var b=document.createElement("canvas"),y=b.getContext("2d");b.width=ue(f),b.height=ue(m),y.fillStyle=e.fillColor||"transparent",y.fillRect(0,0,f,m);var g=e.imageSmoothingEnabled,v=e.imageSmoothingQuality;y.imageSmoothingEnabled=void 0===g||g,v&&(y.imageSmoothingQuality=v);var w,x,k,S,D,I,C=i.width,B=i.height,P=o,z=a;P<=-n||P>C?(P=0,w=0,k=0,D=0):P<=0?(k=-P,P=0,D=w=Math.min(C,n+P)):P<=C&&(k=0,D=w=Math.min(n,C-P)),w<=0||z<=-l||z>B?(z=0,x=0,S=0,I=0):z<=0?(S=-z,z=0,I=x=Math.min(B,l+z)):z<=B&&(S=0,I=x=Math.min(l,B-z));var F=[P,z,w,x];if(D>0&&I>0){var T=f/n;F.push(k*T,S*T,D*T,I*T)}return y.drawImage.apply(y,[i].concat(s(F.map((function(e){return Math.floor(ue(e))}))))),b},setAspectRatio:function(e){var t=this.options;return this.disabled||re(e)||(t.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var t=this.options,i=this.dragBox,r=this.face;if(this.ready&&!this.disabled){var o=e===E,s=t.movable&&e===_;t.dragMode=e=o||s?e:M,ke(i,T,e),ge(i,D,o),ge(i,F,s),t.cropBoxMovable||(ke(r,T,e),ge(r,D,o),ge(r,F,s))}return this}},Ve=l.Cropper,Je=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t||!Z.test(t.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=t,this.options=he({},Q,ae(i)&&i),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return t=e,i=[{key:"init",value:function(){var e,t=this.element,i=t.tagName.toLowerCase();if(!t[h]){if(t[h]=this,"img"===i){if(this.isImg=!0,e=t.getAttribute("src")||"",this.originalUrl=e,!e)return;e=t.src}else"canvas"===i&&window.HTMLCanvasElement&&(e=t.toDataURL());this.load(e)}}},{key:"load",value:function(e){var t,i,r,o,s=this;if(e){this.url=e,this.imageData={};var a=this.element,n=this.options;if(n.rotatable||n.scalable||(n.checkOrientation=!1),n.checkOrientation&&window.ArrayBuffer)if(X.test(e))Y.test(e)?this.read((t=e.replace(Ne,""),i=atob(t),r=new ArrayBuffer(i.length),pe(o=new Uint8Array(r),(function(e,t){o[t]=i.charCodeAt(t)})),r)):this.clone();else{var l=new XMLHttpRequest,d=this.clone.bind(this);this.reloading=!0,this.xhr=l,l.onabort=d,l.onerror=d,l.ontimeout=d,l.onprogress=function(){l.getResponseHeader("content-type")!==q&&l.abort()},l.onload=function(){s.read(l.response)},l.onloadend=function(){s.reloading=!1,s.xhr=null},n.checkCrossOrigin&&Te(e)&&a.crossOrigin&&(e=Ae(e)),l.open("GET",e,!0),l.responseType="arraybuffer",l.withCredentials="use-credentials"===a.crossOrigin,l.send()}else this.clone()}}},{key:"read",value:function(e){var t=this.options,i=this.imageData,r=Ue(e),o=0,s=1,a=1;if(r>1){this.url=function(e,t){for(var i=[],r=new Uint8Array(e);r.length>0;)i.push(Re.apply(null,de(r.subarray(0,8192)))),r=r.subarray(8192);return"data:".concat(t,";base64,").concat(btoa(i.join("")))}(e,q);var n=function(e){var t=0,i=1,r=1;switch(e){case 2:i=-1;break;case 3:t=-180;break;case 4:r=-1;break;case 5:t=90,r=-1;break;case 6:t=90;break;case 7:t=90,i=-1;break;case 8:t=-90}return{rotate:t,scaleX:i,scaleY:r}}(r);o=n.rotate,s=n.scaleX,a=n.scaleY}t.rotatable&&(i.rotate=o),t.scalable&&(i.scaleX=s,i.scaleY=a),this.clone()}},{key:"clone",value:function(){var e=this.element,t=this.url,i=e.crossOrigin,r=t;this.options.checkCrossOrigin&&Te(t)&&(i||(i="anonymous"),r=Ae(t)),this.crossOrigin=i,this.crossOriginUrl=r;var o=document.createElement("img");i&&(o.crossOrigin=i),o.src=r||t,o.alt=e.alt||"The image to crop",this.image=o,o.onload=this.start.bind(this),o.onerror=this.stop.bind(this),be(o,B),e.parentNode.insertBefore(o,e.nextSibling)}},{key:"start",value:function(){var e=this,t=this.image;t.onload=null,t.onerror=null,this.sizing=!0;var i=l.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(l.navigator.userAgent),r=function(t,i){he(e.imageData,{naturalWidth:t,naturalHeight:i,aspectRatio:t/i}),e.initialImageData=he({},e.imageData),e.sizing=!1,e.sized=!0,e.build()};if(!t.naturalWidth||i){var o=document.createElement("img"),s=document.body||document.documentElement;this.sizingImage=o,o.onload=function(){r(o.width,o.height),i||s.removeChild(o)},o.src=t.src,i||(o.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",s.appendChild(o))}else r(t.naturalWidth,t.naturalHeight)}},{key:"stop",value:function(){var e=this.image;e.onload=null,e.onerror=null,e.parentNode.removeChild(e),this.image=null}},{key:"build",value:function(){if(this.sized&&!this.ready){var e=this.element,t=this.options,i=this.image,r=e.parentNode,o=document.createElement("div");o.innerHTML='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>';var s=o.querySelector(".".concat(h,"-container")),a=s.querySelector(".".concat(h,"-canvas")),n=s.querySelector(".".concat(h,"-drag-box")),l=s.querySelector(".".concat(h,"-crop-box")),d=l.querySelector(".".concat(h,"-face"));this.container=r,this.cropper=s,this.canvas=a,this.dragBox=n,this.cropBox=l,this.viewBox=s.querySelector(".".concat(h,"-view-box")),this.face=d,a.appendChild(i),be(e,C),r.insertBefore(s,e.nextSibling),ye(i,B),this.initPreview(),this.bind(),t.initialAspectRatio=Math.max(0,t.initialAspectRatio)||NaN,t.aspectRatio=Math.max(0,t.aspectRatio)||NaN,t.viewMode=Math.max(0,Math.min(3,Math.round(t.viewMode)))||0,be(l,C),t.guides||be(l.getElementsByClassName("".concat(h,"-dashed")),C),t.center||be(l.getElementsByClassName("".concat(h,"-center")),C),t.background&&be(s,"".concat(h,"-bg")),t.highlight||be(d,P),t.cropBoxMovable&&(be(d,F),ke(d,T,c)),t.cropBoxResizable||(be(l.getElementsByClassName("".concat(h,"-line")),C),be(l.getElementsByClassName("".concat(h,"-point")),C)),this.render(),this.ready=!0,this.setDragMode(t.dragMode),t.autoCrop&&this.crop(),this.setData(t.data),ne(t.ready)&&Ce(e,H,t.ready,{once:!0}),Be(e,H)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var e=this.cropper.parentNode;e&&e.removeChild(this.cropper),ye(this.element,C)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],r=[{key:"noConflict",value:function(){return window.Cropper=Ve,e}},{key:"setDefaults",value:function(e){he(Q,ae(e)&&e)}}],i&&o(t.prototype,i),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,i,r}();return he(Je.prototype,Oe,$e,je,We,Le,He),Je}()),rd.exports),sd=ge(od);
764
+ /*!
765
+ * Cropper.js v1.6.2
766
+ * https://fengyuanchen.github.io/cropperjs
767
+ *
768
+ * Copyright 2015-present Chen Fengyuan
769
+ * Released under the MIT license
770
+ *
771
+ * Date: 2024-04-21T07:43:05.335Z
772
+ */class ad extends uo{imgElement;componentDidMount(){const{initCropper:e}=this.props;this.imgElement&&e(this.imgElement)}onRotate90Deg=()=>{this.props.rotateBy(-90)};onRotateGranular=e=>{const t=Number(e.target.value);this.props.rotateGranular(t)};renderGranularRotate(){const{i18n:e}=this.props,{angleGranular:t}=this.props;return Mo("label",{role:"tooltip","aria-label":`${t}º`,"data-microtip-position":"top",className:"uppy-ImageCropper-rangeWrapper",children:Mo("input",{className:"uppy-ImageCropper-range uppy-u-reset",type:"range",onInput:this.onRotateGranular,onChange:this.onRotateGranular,value:t,min:"-45",max:"45","aria-label":e("rotate")})})}renderRevert(){const{i18n:e}=this.props;return Mo("button",{"data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("revert"),onClick:()=>{this.props.reset()},children:Mo("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24",children:[Mo("path",{d:"M0 0h24v24H0z",fill:"none"}),Mo("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"})]})})}renderRotate(){const{i18n:e}=this.props;return Mo("button",{"data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("rotate"),onClick:this.onRotate90Deg,children:Mo("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24",children:[Mo("path",{d:"M0 0h24v24H0V0zm0 0h24v24H0V0z",fill:"none"}),Mo("path",{d:"M14 10a2 2 0 012 2v7a2 2 0 01-2 2H6a2 2 0 01-2-2v-7a2 2 0 012-2h8zm0 1.75H6a.25.25 0 00-.243.193L5.75 12v7a.25.25 0 00.193.243L6 19.25h8a.25.25 0 00.243-.193L14.25 19v-7a.25.25 0 00-.193-.243L14 11.75zM12 .76V4c2.3 0 4.61.88 6.36 2.64a8.95 8.95 0 012.634 6.025L21 13a1 1 0 01-1.993.117L19 13h-.003a6.979 6.979 0 00-2.047-4.95 6.97 6.97 0 00-4.652-2.044L12 6v3.24L7.76 5 12 .76z"})]})})}renderFlip(){const{i18n:e}=this.props;return Mo("button",{"data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("flipHorizontal"),onClick:()=>this.props.flipHorizontal(),children:Mo("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24",children:[Mo("path",{d:"M0 0h24v24H0z",fill:"none"}),Mo("path",{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"})]})})}renderZoomIn(){const{i18n:e}=this.props;return Mo("button",{"data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("zoomIn"),onClick:()=>this.props.zoom(.1),children:Mo("svg",{"aria-hidden":"true",className:"uppy-c-icon",height:"24",viewBox:"0 0 24 24",width:"24",children:[Mo("path",{d:"M0 0h24v24H0V0z",fill:"none"}),Mo("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),Mo("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})]})})}renderZoomOut(){const{i18n:e}=this.props;return Mo("button",{"data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("zoomOut"),onClick:()=>this.props.zoom(-.1),children:Mo("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24",children:[Mo("path",{d:"M0 0h24v24H0V0z",fill:"none"}),Mo("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"})]})})}renderCropSquare(){const{i18n:e}=this.props;return Mo("button",{"data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("aspectRatioSquare"),onClick:()=>this.props.setAspectRatio("1:1"),children:Mo("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24",children:[Mo("path",{d:"M0 0h24v24H0z",fill:"none"}),Mo("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})]})})}renderCropWidescreen(){const{i18n:e}=this.props;return Mo("button",{"data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("aspectRatioLandscape"),onClick:()=>this.props.setAspectRatio("16:9"),children:Mo("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24",children:[Mo("path",{d:"M 19,4.9999992 V 17.000001 H 4.9999998 V 6.9999992 H 19 m 0,-2 H 4.9999998 c -1.0999999,0 -1.9999999,0.9000001 -1.9999999,2 V 17.000001 c 0,1.1 0.9,2 1.9999999,2 H 19 c 1.1,0 2,-0.9 2,-2 V 6.9999992 c 0,-1.0999999 -0.9,-2 -2,-2 z"}),Mo("path",{fill:"none",d:"M0 0h24v24H0z"})]})})}renderCropWidescreenVertical(){const{i18n:e}=this.props;return Mo("button",{"data-microtip-position":"top",type:"button","aria-label":e("aspectRatioPortrait"),className:"uppy-u-reset uppy-c-btn",onClick:()=>this.props.setAspectRatio("9:16"),children:Mo("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24",children:[Mo("path",{d:"M 19.000001,19 H 6.999999 V 5 h 10.000002 v 14 m 2,0 V 5 c 0,-1.0999999 -0.9,-1.9999999 -2,-1.9999999 H 6.999999 c -1.1,0 -2,0.9 -2,1.9999999 v 14 c 0,1.1 0.9,2 2,2 h 10.000002 c 1.1,0 2,-0.9 2,-2 z"}),Mo("path",{d:"M0 0h24v24H0z",fill:"none"})]})})}render(){const{currentImage:e,objectUrl:t,opts:i}=this.props,{actions:r}=i;return Mo("div",{className:"uppy-ImageCropper",children:[Mo("div",{className:"uppy-ImageCropper-container",children:Mo("img",{className:"uppy-ImageCropper-image",alt:e.name,src:t,ref:e=>{this.imgElement=e}})}),Mo("div",{className:"uppy-ImageCropper-controls",children:[r.revert&&this.renderRevert(),r.rotate&&this.renderRotate(),r.granularRotate&&this.renderGranularRotate(),r.flip&&this.renderFlip(),r.zoomIn&&this.renderZoomIn(),r.zoomOut&&this.renderZoomOut(),r.cropSquare&&this.renderCropSquare(),r.cropWidescreen&&this.renderCropWidescreen(),r.cropWidescreenVertical&&this.renderCropWidescreenVertical()]})]})}}var nd={strings:{revert:"Reset",rotate:"Rotate 90°",zoomIn:"Zoom in",zoomOut:"Zoom out",flipHorizontal:"Flip horizontally",aspectRatioSquare:"Crop square",aspectRatioLandscape:"Crop landscape (16:9)",aspectRatioPortrait:"Crop portrait (9:16)"}};const ld={angle:0,angleGranular:0,isFlippedHorizontally:!1,aspectRatio:"free",cropperReady:!1},dd={viewMode:0,background:!1,autoCropArea:1,responsive:!0,minCropBoxWidth:70,minCropBoxHeight:70,croppedCanvasOptions:{},initialAspectRatio:0},pd={revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!0,cropWidescreen:!0,cropWidescreenVertical:!0},hd={quality:.8,actions:pd,cropperOptions:dd};class cd extends Bs{static VERSION="4.2.0";cropper=null;objectUrl=null;prevCropboxData=null;imgElement=null;cropstartHandler=null;cropendHandler=null;cropperReadyHandler=null;constructor(e,t){super(e,{...hd,...t,actions:{...pd,...t?.actions},cropperOptions:{...dd,...t?.cropperOptions}}),this.id=this.opts.id||"ImageEditor",this.title="Image Editor",this.type="editor",this.defaultLocale=nd,this.i18nInit()}canEditFile(e){if(!e.type||e.isRemote)return!1;const t=e.type.split("/")[1];return!!/^(jpe?g|gif|png|bmp|webp)$/.test(t)}save=()=>{const{currentImage:e}=this.getPluginState();if(!e)return;if(!this.cropper)return;const t=this.cropper.getCroppedCanvas({});t.width%2!=0&&this.cropper.setData({width:t.width-1}),t.height%2!=0&&this.cropper.setData({height:t.height-1}),this.cropper.getCroppedCanvas(this.opts.cropperOptions.croppedCanvasOptions).toBlob((t=>{if(!t)return;const i=e.id;if(!this.uppy.getFile(i))return;this.uppy.setFileState(i,{data:new File([t],e.name??this.i18n("unnamed"),{type:t.type}),size:t.size,preview:void 0});const r=this.uppy.getFile(i);r&&(this.uppy.emit("thumbnail:request",r),this.setPluginState({currentImage:r}),this.uppy.emit("file-editor:complete",r))}),e.type,this.opts.quality)};storeCropperInstance=e=>{this.cropper=e};selectFile=e=>{this.start(e)};resetEditorState=(e=this.getPluginState().currentImage)=>{this.setPluginState({currentImage:e,...ld,cropperReady:!!this.cropper})};rotateBy=e=>{if(!this.cropper)return;const{angle:t,angleGranular:i,isFlippedHorizontally:r}=this.getPluginState(),o=t-i+e;this.cropper.scale(r?-1:1),this.cropper.rotateTo(o);const s=this.cropper.getCanvasData(),a=function(e,t){const i=Math.min(e.width/t.width,e.height/t.height),r=t.width*i,o=t.height*i;return{width:r,height:o,left:(e.width-r)/2,top:(e.height-o)/2}}(this.cropper.getContainerData(),s);this.cropper.setCanvasData(a),this.cropper.setCropBoxData(a),this.setPluginState({angle:o,angleGranular:0})};rotateGranular=e=>{if(!this.cropper)return;const{angle:t,angleGranular:i,isFlippedHorizontally:r}=this.getPluginState(),o=t-i+e;this.cropper.rotateTo(o);const s=this.cropper.getImageData(),a=function(e,t,i){const r=Math.abs(i*(Math.PI/180));return Math.max((Math.sin(r)*e+Math.cos(r)*t)/t,(Math.sin(r)*t+Math.cos(r)*e)/e)}(s.naturalWidth,s.naturalHeight,e);this.cropper.scale(r?-a:a,a),this.setPluginState({angle:o,angleGranular:e})};flipHorizontal=()=>{if(!this.cropper)return;const{isFlippedHorizontally:e}=this.getPluginState();this.cropper.scaleX(-this.cropper.getData().scaleX||-1),this.setPluginState({isFlippedHorizontally:!e})};zoom=e=>{this.cropper&&this.cropper.zoom(e)};setAspectRatio=e=>{this.cropper&&(this.cropper.setAspectRatio({free:0,"1:1":1,"16:9":16/9,"9:16":9/16}[e]),this.setPluginState({aspectRatio:e}))};reset=()=>{this.cropper&&(this.cropper.reset(),this.cropper.setAspectRatio(this.opts.cropperOptions.initialAspectRatio||0),this.resetEditorState())};start=e=>{this.objectUrl&&(URL.revokeObjectURL(this.objectUrl),this.objectUrl=null);let t=e.data;if(!(t instanceof Blob)){const i=this.uppy.getFile(e.id);t=i?.data}t instanceof Blob?this.objectUrl=URL.createObjectURL(t):console.warn("[Uppy ImageEditor] Cannot edit file: file.data is not a Blob.","File:",e,"file.data:",e.data,"typeof file.data:",typeof e.data),this.uppy.emit("file-editor:start",e),this.resetEditorState(e)};stop=()=>{this.destroyCropper(),this.objectUrl&&(URL.revokeObjectURL(this.objectUrl),this.objectUrl=null),this.resetEditorState(null)};initCropper=e=>{this.cropper||(this.imgElement=e,this.cropper=new sd(e,this.opts.cropperOptions),this.cropstartHandler=()=>{this.cropper&&(this.prevCropboxData=this.cropper.getCropBoxData())},this.cropendHandler=e=>{if(!this.cropper||!this.prevCropboxData)return;const t=this.cropper.getCanvasData(),i=this.cropper.getCropBoxData();if("all"===e.detail.action){const e=(s=this.prevCropboxData,(o=i).left<(r=t).left?{left:r.left,width:s.width}:o.top<r.top?{top:r.top,height:s.height}:o.left+o.width>r.left+r.width?{left:r.left+r.width-s.width,width:s.width}:o.top+o.height>r.top+r.height?{top:r.top+r.height-s.height,height:s.height}:null);e&&this.cropper.setCropBoxData(e)}else{const e=function(e,t,i){return t.left<e.left?{left:e.left,width:i.left+i.width-e.left}:t.top<e.top?{top:e.top,height:i.top+i.height-e.top}:t.left+t.width>e.left+e.width?{left:i.left,width:e.left+e.width-i.left}:t.top+t.height>e.top+e.height?{top:i.top,height:e.top+e.height-i.top}:null}(t,i,this.prevCropboxData);e&&this.cropper.setCropBoxData(e)}var r,o,s},this.cropperReadyHandler=()=>{this.setPluginState({cropperReady:!0})},e.addEventListener("cropstart",this.cropstartHandler),e.addEventListener("cropend",this.cropendHandler),e.addEventListener("ready",this.cropperReadyHandler,{once:!0}))};destroyCropper=()=>{this.cropper&&(this.setPluginState({cropperReady:!1}),this.cropstartHandler&&this.imgElement&&this.imgElement.removeEventListener("cropstart",this.cropstartHandler),this.cropendHandler&&this.imgElement&&this.imgElement.removeEventListener("cropend",this.cropendHandler),this.cropperReadyHandler&&this.imgElement&&this.imgElement.removeEventListener("ready",this.cropperReadyHandler),this.cropper.destroy(),this.cropper=null,this.imgElement=null,this.cropstartHandler=null,this.cropendHandler=null,this.cropperReadyHandler=null,this.prevCropboxData=null)};getObjectUrl=()=>this.objectUrl;install(){this.resetEditorState(null);const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){const{currentImage:e}=this.getPluginState();if(e){const t=this.uppy.getFile(e.id);this.uppy.emit("file-editor:cancel",t)}this.stop(),this.unmount()}render(){const{currentImage:e,angleGranular:t}=this.getPluginState();return null===e||e.isRemote?null:Mo(ad,{currentImage:e,objectUrl:this.objectUrl??"",initCropper:this.initCropper,save:this.save,opts:this.opts,i18n:this.i18n,angleGranular:t,rotateBy:this.rotateBy,rotateGranular:this.rotateGranular,flipHorizontal:this.flipHorizontal,zoom:this.zoom,setAspectRatio:this.setAspectRatio,reset:this.reset})}}var ud,fd={exports:{}},md=function(){if(ud)return fd.exports;ud=1,fd.exports=r,fd.exports.isMobile=r,fd.exports.default=r;const e=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,t=/CrOS/,i=/android|ipad|playbook|silk/i;function r(r){r||(r={});let o=r.ua;if(o||"undefined"==typeof navigator||(o=navigator.userAgent),o&&o.headers&&"string"==typeof o.headers["user-agent"]&&(o=o.headers["user-agent"]),"string"!=typeof o)return!1;let s=e.test(o)&&!t.test(o)||!!r.tablet&&i.test(o);return!s&&r.tablet&&r.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==o.indexOf("Macintosh")&&-1!==o.indexOf("Safari")&&(s=!0),s}return fd.exports}();function bd(){return Mo("svg",{"aria-hidden":"true",focusable:"false",fill:"#0097DC",width:"66",height:"55",viewBox:"0 0 66 55",children:Mo("path",{d:"M57.3 8.433c4.59 0 8.1 3.51 8.1 8.1v29.7c0 4.59-3.51 8.1-8.1 8.1H8.7c-4.59 0-8.1-3.51-8.1-8.1v-29.7c0-4.59 3.51-8.1 8.1-8.1h9.45l4.59-7.02c.54-.54 1.35-1.08 2.16-1.08h16.2c.81 0 1.62.54 2.16 1.08l4.59 7.02h9.45zM33 14.64c-8.62 0-15.393 6.773-15.393 15.393 0 8.62 6.773 15.393 15.393 15.393 8.62 0 15.393-6.773 15.393-15.393 0-8.62-6.773-15.393-15.393-15.393zM33 40c-5.648 0-9.966-4.319-9.966-9.967 0-5.647 4.318-9.966 9.966-9.966s9.966 4.319 9.966 9.966C42.966 35.681 38.648 40 33 40z",fillRule:"evenodd"})})}function yd({onDiscard:e,i18n:t}){return Mo("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--discard",type:"button",title:t("discardRecordedFile"),"aria-label":t("discardRecordedFile"),onClick:e,"data-uppy-super-focusable":!0,children:Mo("svg",{width:"13",height:"13",viewBox:"0 0 13 13",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon",children:Mo("g",{fill:"#FFF",fillRule:"evenodd",children:[Mo("path",{d:"M.496 11.367L11.103.76l1.414 1.414L1.911 12.781z"}),Mo("path",{d:"M11.104 12.782L.497 2.175 1.911.76l10.607 10.606z"})]})})})}function gd({recording:e,onStartRecording:t,onStopRecording:i,i18n:r}){return Mo("button",e?{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:r("stopRecording"),"aria-label":r("stopRecording"),onClick:i,"data-uppy-super-focusable":!0,children:Mo("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100",children:Mo("rect",{x:"15",y:"15",width:"70",height:"70"})})}:{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:r("startRecording"),"aria-label":r("startRecording"),onClick:t,"data-uppy-super-focusable":!0,children:Mo("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100",children:Mo("circle",{cx:"50",cy:"50",r:"40"})})})}function vd({recordingLengthSeconds:e}){var t;return Mo("span",{children:(t=e,`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`)})}function wd({onSnapshot:e,i18n:t}){return Mo("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--picture",type:"button",title:t("takePicture"),"aria-label":t("takePicture"),onClick:e,"data-uppy-super-focusable":!0,children:bd()})}function xd({onSubmit:e,i18n:t}){return Mo("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--submit",type:"button",title:t("submitRecordedFile"),"aria-label":t("submitRecordedFile"),onClick:e,"data-uppy-super-focusable":!0,children:Mo("svg",{width:"12",height:"9",viewBox:"0 0 12 9",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon",children:Mo("path",{fill:"#fff",fillRule:"nonzero",d:"M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z"})})})}function kd({currentDeviceId:e,videoSources:t,onChangeVideoSource:i}){return Mo("div",{className:"uppy-Webcam-videoSource",children:Mo("select",{className:"uppy-u-reset uppy-Webcam-videoSource-select",onChange:e=>{i(e.target.value)},children:t.map((t=>Mo("option",{value:t.deviceId,selected:t.deviceId===e,children:t.label},t.deviceId)))})})}function Sd(e,t){return e.includes(t)}class Dd extends uo{videoElement;refs;componentDidMount(){const{onFocus:e}=this.props;e()}componentWillUnmount(){const{onStop:e}=this.props;e()}render(){const{src:e,recordedVideo:t,capturedSnapshot:i,recording:r,modes:o,supportsRecording:s,videoSources:a,showVideoSourceDropdown:n,showRecordingLength:l,onSubmit:d,i18n:p,mirror:h,onSnapshot:c,onStartRecording:u,onStopRecording:f,onDiscardRecordedMedia:m,recordingLengthSeconds:b}=this.props,y=!!t,g=!!i,v=y||g,w=!v&&s&&(Sd(o,"video-only")||Sd(o,"audio-only")||Sd(o,"video-audio")),x=!v&&Sd(o,"picture"),k=s&&l&&!y,S=n&&a&&a.length>1,D={playsInline:!0};return t?(D.muted=!1,D.controls=!0,D.src=t,this.videoElement&&(this.videoElement.srcObject=null)):(D.muted=!0,D.autoPlay=!0,D.srcObject=e),Mo("div",{className:"uppy uppy-Webcam-container",children:[Mo("div",{className:"uppy-Webcam-videoContainer",children:!i||r||t?Mo("video",{ref:e=>{this.videoElement=e},className:"uppy-Webcam-video "+(h?"uppy-Webcam-video--mirrored":""),...D}):Mo("div",{className:"uppy-Webcam-imageContainer",children:Mo("img",{src:i,className:"uppy-Webcam-video",alt:"capturedSnapshot"})})}),Mo("div",{className:"uppy-Webcam-footer",children:[Mo("div",{className:"uppy-Webcam-videoSourceContainer",children:S?kd(this.props):null}),Mo("div",{className:"uppy-Webcam-buttonContainer",children:[x&&Mo(wd,{onSnapshot:c,i18n:p}),w&&Mo(gd,{recording:r,onStartRecording:u,onStopRecording:f,i18n:p}),(y||g)&&Mo(xd,{onSubmit:d,i18n:p}),(y||g)&&Mo(yd,{onDiscard:m,i18n:p})]}),Mo("div",{className:"uppy-Webcam-recordingLength",children:k&&Mo(vd,{recordingLengthSeconds:b})})]})]})}}var Id={strings:{pluginNameCamera:"Camera",noCameraTitle:"Camera Not Available",noCameraDescription:"In order to take pictures or record video, please connect a camera device",recordingStoppedMaxSize:"Recording stopped because the file size is about to exceed the limit",submitRecordedFile:"Submit recorded file",discardRecordedFile:"Discard recorded file",smile:"Smile!",takePicture:"Take a picture",startRecording:"Begin video recording",stopRecording:"Stop video recording",recordingLength:"Recording length %{recording_length}",allowAccessTitle:"Please allow access to your camera",allowAccessDescription:"In order to take pictures or record video with your camera, please allow camera access for this site."}};function Cd({icon:e,i18n:t,hasCamera:i}){return Mo("div",{className:"uppy-Webcam-permissons",children:[Mo("div",{className:"uppy-Webcam-permissonsIcon",children:e()}),Mo("div",{className:"uppy-Webcam-title",children:t(i?"allowAccessTitle":"noCameraTitle")}),Mo("p",{children:t(i?"allowAccessDescription":"noCameraDescription")})]})}function Bd(e){return"."===e[0]?Cr[e.slice(1)]:e}function Pd(e){return/^video\/[^*]+$/.test(e)}function zd(e){return/^image\/[^*]+$/.test(e)}function Fd(e,t){return e.includes(t)}const Td={onBeforeSnapshot:()=>Promise.resolve(),countdown:!1,modes:["video-audio","video-only","audio-only","picture"],mirror:!0,showVideoSourceDropdown:!1,preferredImageMimeType:null,preferredVideoMimeType:null,showRecordingLength:!1,mobileNativeCamera:md.isMobile({tablet:!0})};class Ad extends Bs{static VERSION="5.1.0";#Y;mediaDevices;supportsUserMedia;protocol;capturedMediaFile;icon;webcamActive;stream=null;recorder=null;recordingChunks=null;recordingLengthTimer;captureInProgress=!1;constructor(e,t){super(e,{...Td,...t}),this.mediaDevices=navigator.mediaDevices,this.supportsUserMedia=!!this.mediaDevices,this.protocol=location.protocol.match(/https/i)?"https":"http",this.id=this.opts.id||"Webcam",this.type="acquirer",this.capturedMediaFile=null,this.icon=()=>Mo("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:Mo("path",{d:"M23.5 9.5c1.417 0 2.5 1.083 2.5 2.5v9.167c0 1.416-1.083 2.5-2.5 2.5h-15c-1.417 0-2.5-1.084-2.5-2.5V12c0-1.417 1.083-2.5 2.5-2.5h2.917l1.416-2.167C13 7.167 13.25 7 13.5 7h5c.25 0 .5.167.667.333L20.583 9.5H23.5zM16 11.417a4.706 4.706 0 00-4.75 4.75 4.704 4.704 0 004.75 4.75 4.703 4.703 0 004.75-4.75c0-2.663-2.09-4.75-4.75-4.75zm0 7.825c-1.744 0-3.076-1.332-3.076-3.074 0-1.745 1.333-3.077 3.076-3.077 1.744 0 3.074 1.333 3.074 3.076s-1.33 3.075-3.074 3.075z",fill:"#02B383",fillRule:"nonzero"})}),this.defaultLocale=Id,this.i18nInit(),this.title=this.i18n("pluginNameCamera"),this.#Y=this.opts.mirror,this.install=this.install.bind(this),this.setPluginState=this.setPluginState.bind(this),this.render=this.render.bind(this),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.takeSnapshot=this.takeSnapshot.bind(this),this.startRecording=this.startRecording.bind(this),this.stopRecording=this.stopRecording.bind(this),this.discardRecordedMedia=this.discardRecordedMedia.bind(this),this.submit=this.submit.bind(this),this.oneTwoThreeSmile=this.oneTwoThreeSmile.bind(this),this.focus=this.focus.bind(this),this.changeVideoSource=this.changeVideoSource.bind(this),this.webcamActive=!1,this.opts.countdown&&(this.opts.onBeforeSnapshot=this.oneTwoThreeSmile),this.setPluginState({hasCamera:!1,cameraReady:!1,cameraError:null,recordingLengthSeconds:0,videoSources:[],currentDeviceId:null,capturedSnapshot:null})}getStatus(){const{recordedVideo:e,capturedSnapshot:t,isRecording:i,cameraReady:r,cameraError:o}=this.getPluginState();return i?"recording":null!=e||null!=t?"captured":r?"ready":o?"error":"init"}setOptions(e){super.setOptions({...e,videoConstraints:{...this.opts.videoConstraints,...e?.videoConstraints}})}hasCameraCheck(){return this.mediaDevices?this.mediaDevices.enumerateDevices().then((e=>e.some((e=>"videoinput"===e.kind)))):Promise.resolve(!1)}isAudioOnly(){return 1===this.opts.modes.length&&"audio-only"===this.opts.modes[0]}getConstraints(e=null){const t=-1!==this.opts.modes.indexOf("video-audio")||-1!==this.opts.modes.indexOf("audio-only"),i=!this.isAudioOnly()&&(-1!==this.opts.modes.indexOf("video-audio")||-1!==this.opts.modes.indexOf("video-only")||-1!==this.opts.modes.indexOf("picture")),r={...this.opts.videoConstraints||{},...null!=e&&{deviceId:e}};return{audio:t,video:!!i&&r}}start(e=null){if(!this.supportsUserMedia)return Promise.reject(new Error("Webcam access not supported"));this.webcamActive=!0,this.opts.mirror&&(this.#Y=!0);const t=this.getConstraints(e?.deviceId);this.hasCameraCheck().then((i=>(this.setPluginState({hasCamera:i}),this.mediaDevices.getUserMedia(t).then((t=>{this.stream=t;let i=null;const r=this.isAudioOnly()?t.getAudioTracks():t.getVideoTracks();e&&e.deviceId?r.forEach((t=>{t.getSettings().deviceId===e.deviceId&&(i=t.getSettings().deviceId)})):i=r[0].getSettings().deviceId,this.updateVideoSources(),this.setPluginState({currentDeviceId:i,cameraReady:!0})})).catch((e=>{this.setPluginState({cameraReady:!1,cameraError:e}),this.uppy.info(e.message,"error")})))))}getMediaRecorderOptions(){const e={};if(MediaRecorder.isTypeSupported){const{restrictions:t}=this.uppy.opts;let i=[];this.opts.preferredVideoMimeType?i=[this.opts.preferredVideoMimeType]:t.allowedFileTypes&&(i=t.allowedFileTypes.map(Bd).filter(Pd));const r=i.filter((e=>MediaRecorder.isTypeSupported(e)&&_r(e)));r.length>0&&(e.mimeType=r[0])}return e}startRecording(){this.recorder=new MediaRecorder(this.stream,this.getMediaRecorderOptions()),this.recordingChunks=[];let e=!1;this.recorder.addEventListener("dataavailable",(t=>{this.recordingChunks.push(t.data);const{restrictions:i}=this.uppy.opts;if(this.recordingChunks.length>1&&null!=i.maxFileSize&&!e){const t=this.recordingChunks.reduce(((e,t)=>e+t.size),0);t>Math.max(0,i.maxFileSize-(t-this.recordingChunks[0].size)/(this.recordingChunks.length-1)*3)&&(e=!0,this.uppy.info(this.i18n("recordingStoppedMaxSize"),"warning",4e3),this.stopRecording())}})),this.recorder.start(500),this.opts.showRecordingLength&&(this.recordingLengthTimer=setInterval((()=>{const e=this.getPluginState().recordingLengthSeconds;this.setPluginState({recordingLengthSeconds:e+1})}),1e3)),this.setPluginState({isRecording:!0})}stopRecording(){return new Promise((e=>{this.recorder.addEventListener("stop",(()=>{e()})),this.recorder.stop(),this.opts.showRecordingLength&&(clearInterval(this.recordingLengthTimer),this.setPluginState({recordingLengthSeconds:0}))})).then((()=>(this.setPluginState({isRecording:!1}),this.getVideo()))).then((e=>{try{this.capturedMediaFile=e,this.setPluginState({recordedVideo:URL.createObjectURL(e.data)}),this.#Y=!1}catch(e){e.isRestriction||this.uppy.log(e)}})).then((()=>{this.recordingChunks=null,this.recorder=null}),(e=>{throw this.recordingChunks=null,this.recorder=null,e}))}discardRecordedMedia(){const{recordedVideo:e,capturedSnapshot:t}=this.getPluginState();e&&URL.revokeObjectURL(e),t&&URL.revokeObjectURL(t),this.setPluginState({recordedVideo:null,capturedSnapshot:null}),this.opts.mirror&&(this.#Y=!0),this.capturedMediaFile=null}submit(){try{this.capturedMediaFile&&this.uppy.addFile(this.capturedMediaFile)}catch(e){e.isRestriction||this.uppy.log(e,"error")}}async stop(){if(this.stream){const e=this.stream.getAudioTracks(),t=this.stream.getVideoTracks();e.concat(t).forEach((e=>e.stop()))}this.recorder&&await new Promise((e=>{this.recorder.addEventListener("stop",e,{once:!0}),this.recorder.stop(),this.opts.showRecordingLength&&clearInterval(this.recordingLengthTimer)})),this.recordingChunks=null,this.recorder=null,this.webcamActive=!1,this.stream=null,this.setPluginState({recordedVideo:null,capturedSnapshot:null,isRecording:!1,recordingLengthSeconds:0})}getVideoElement(){return this.el.querySelector(".uppy-Webcam-video")}oneTwoThreeSmile(){return new Promise(((e,t)=>{let i=this.opts.countdown;const r=setInterval((()=>{if(!this.webcamActive)return clearInterval(r),this.captureInProgress=!1,t(new Error("Webcam is not active"));i?(this.uppy.info(`${i}...`,"warning",800),i--):(clearInterval(r),this.uppy.info(this.i18n("smile"),"success",1500),setTimeout((()=>e()),1500))}),1e3)}))}async takeSnapshot(){if(!this.captureInProgress){this.captureInProgress=!0;try{await this.opts.onBeforeSnapshot()}catch(e){const t="object"==typeof e?e.message:e;throw this.uppy.info(t,"error",5e3),new Error(`onBeforeSnapshot: ${t}`)}try{const e=await this.getImage();if(this.capturedMediaFile=e,null==e.data)throw new Error("File data is empty");const t=URL.createObjectURL(e.data);this.setPluginState({capturedSnapshot:t}),this.captureInProgress=!1}catch(e){this.captureInProgress=!1,e.isRestriction||this.uppy.log(e)}}}async getImage(){const e=this.getVideoElement();if(!e)return Promise.reject(new Error("No video element found, likely due to the Webcam tab being closed."));const t=e.videoWidth,i=e.videoHeight,r=document.createElement("canvas");r.width=t,r.height=i,r.getContext("2d").drawImage(e,0,0);const{restrictions:o}=this.uppy.opts;let s=[];this.opts.preferredImageMimeType?s=[this.opts.preferredImageMimeType]:o.allowedFileTypes&&(s=o.allowedFileTypes.map(Bd).filter(zd));const a=s[0]||"image/jpeg",n=_r(a)||"jpg",l=`cam-${Date.now()}.${n}`;return function(e,t){return new Promise((i=>{e.toBlob(i,t,undefined)}))}(r,a).then((e=>({source:this.id,name:l,data:new Blob([e],{type:a}),type:a})))}getVideo(){const e=this.recordingChunks.find((e=>e.type?.length>0)).type,t=_r(e);if(!t)return Promise.reject(new Error(`Could not retrieve recording: Unsupported media type "${e}"`));const i=`webcam-${Date.now()}.${t}`,r=new Blob(this.recordingChunks,{type:e}),o={source:this.id,name:i,data:new Blob([r],{type:e}),type:e};return Promise.resolve(o)}focus(){this.opts.countdown&&setTimeout((()=>{this.uppy.info(this.i18n("smile"),"success",1500)}),1e3)}changeVideoSource(e){this.stop(),this.start({deviceId:e})}updateVideoSources(){this.mediaDevices.enumerateDevices().then((e=>{this.setPluginState({videoSources:e.filter((e=>"videoinput"===e.kind))})}))}render(){this.webcamActive||this.start();const e=this.getPluginState();return e.cameraReady&&e.hasCamera?Mo(Dd,{...e,onChangeVideoSource:this.changeVideoSource,onSnapshot:this.takeSnapshot,onStartRecording:this.startRecording,onStopRecording:this.stopRecording,onDiscardRecordedMedia:this.discardRecordedMedia,onSubmit:this.submit,onFocus:this.focus,onStop:this.stop,i18n:this.i18n,modes:this.opts.modes,showRecordingLength:this.opts.showRecordingLength,showVideoSourceDropdown:this.opts.showVideoSourceDropdown,supportsRecording:"function"==typeof MediaRecorder&&!!MediaRecorder.prototype&&"function"==typeof MediaRecorder.prototype.start,recording:e.isRecording,mirror:this.#Y,src:this.stream}):Mo(Cd,{icon:bd,i18n:this.i18n,hasCamera:e.hasCamera})}install(){const{mobileNativeCamera:e,modes:t,videoConstraints:i}=this.opts,{target:r}=this.opts;e&&r?this.getTargetPlugin(r)?.setOptions({showNativeVideoCameraButton:Fd(t,"video-only")||Fd(t,"video-audio"),showNativePhotoCameraButton:Fd(t,"picture"),nativeCameraFacingMode:i?.facingMode}):(this.setPluginState({cameraReady:!1,recordingLengthSeconds:0}),r&&this.mount(r,this),this.mediaDevices&&(this.updateVideoSources(),this.mediaDevices.ondevicechange=()=>{if(this.updateVideoSources(),this.stream){let e=!0;const{videoSources:t,currentDeviceId:i}=this.getPluginState();t.forEach((t=>{i===t.deviceId&&(e=!1)})),e&&(this.stop(),this.start())}}))}uninstall(){this.stop(),this.unmount()}onUnmount(){this.stop()}}const Ed={withStackTrace:!1},_d=(e,t,i=Ed)=>({data:t.isOk()?{type:"Ok",value:t.value}:{type:"Err",value:t.error},message:e,stack:i.withStackTrace?(new Error).stack:void 0});function Md(e,t,i,r){return new(i||(i=Promise))((function(t,o){function s(e){try{n(r.next(e))}catch(e){o(e)}}function a(e){try{n(r.throw(e))}catch(e){o(e)}}function n(e){var r;e.done?t(e.value):(r=e.value,r instanceof i?r:new i((function(e){e(r)}))).then(s,a)}n((r=r.apply(e,[])).next())}))}function Rd(e){return this instanceof Rd?(this.v=e,this):new Rd(e)}function Nd(e,t,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=i.apply(e,t||[]),s=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",(function(e){return function(t){return Promise.resolve(t).then(e,d)}})),r[Symbol.asyncIterator]=function(){return this},r;function a(e,t){o[e]&&(r[e]=function(t){return new Promise((function(i,r){s.push([e,t,i,r])>1||n(e,t)}))},t&&(r[e]=t(r[e])))}function n(e,t){try{!function(e){e.value instanceof Rd?Promise.resolve(e.value.v).then(l,d):p(s[0][2],e)}(o[e](t))}catch(e){p(s[0][3],e)}}function l(e){n("next",e)}function d(e){n("throw",e)}function p(e,t){e(t),s.shift(),s.length&&n(s[0][0],s[0][1])}}function Ud(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,i=e[Symbol.asyncIterator];return i?i.call(e):(e=function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],r=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(i){t[i]=e[i]&&function(t){return new Promise((function(r,o){!function(e,t,i,r){Promise.resolve(r).then((function(t){e({value:t,done:i})}),t)}(r,o,(t=e[i](t)).done,t.value)}))}}}"function"==typeof SuppressedError&&SuppressedError;class Od{constructor(e){this._promise=e}static fromSafePromise(e){const t=e.then((e=>new qd(e)));return new Od(t)}static fromPromise(e,t){const i=e.then((e=>new qd(e))).catch((e=>new Gd(t(e))));return new Od(i)}static fromThrowable(e,t){return(...i)=>new Od((()=>Md(this,0,void 0,(function*(){try{return new qd(yield e(...i))}catch(e){return new Gd(t?t(e):e)}})))())}static combine(e){return Wd(e)}static combineWithAllErrors(e){return Hd(e)}map(e){return new Od(this._promise.then((t=>Md(this,0,void 0,(function*(){return t.isErr()?new Gd(t.error):new qd(yield e(t.value))})))))}andThrough(e){return new Od(this._promise.then((t=>Md(this,0,void 0,(function*(){if(t.isErr())return new Gd(t.error);const i=yield e(t.value);return i.isErr()?new Gd(i.error):new qd(t.value)})))))}andTee(e){return new Od(this._promise.then((t=>Md(this,0,void 0,(function*(){if(t.isErr())return new Gd(t.error);try{yield e(t.value)}catch(e){}return new qd(t.value)})))))}orTee(e){return new Od(this._promise.then((t=>Md(this,0,void 0,(function*(){if(t.isOk())return new qd(t.value);try{yield e(t.error)}catch(e){}return new Gd(t.error)})))))}mapErr(e){return new Od(this._promise.then((t=>Md(this,0,void 0,(function*(){return t.isOk()?new qd(t.value):new Gd(yield e(t.error))})))))}andThen(e){return new Od(this._promise.then((t=>{if(t.isErr())return new Gd(t.error);const i=e(t.value);return i instanceof Od?i._promise:i})))}orElse(e){return new Od(this._promise.then((t=>Md(this,0,void 0,(function*(){return t.isErr()?e(t.error):new qd(t.value)})))))}match(e,t){return this._promise.then((i=>i.match(e,t)))}unwrapOr(e){return this._promise.then((t=>t.unwrapOr(e)))}safeUnwrap(){return Nd(this,arguments,(function*(){return yield Rd(yield Rd(yield*function(e){var t,i;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(i=!i)?{value:Rd(e[r](t)),done:!1}:o?o(t):t}:o}}(Ud(yield Rd(this._promise.then((e=>e.safeUnwrap())))))))}))}then(e,t){return this._promise.then(e,t)}[Symbol.asyncIterator](){return Nd(this,arguments,(function*(){const e=yield Rd(this._promise);return e.isErr()&&(yield yield Rd($d(e.error))),yield Rd(e.value)}))}}function $d(e){return new Od(Promise.resolve(new Gd(e)))}const jd=e=>{let t=Jd([]);for(const i of e){if(i.isErr()){t=Kd(i.error);break}t.map((e=>e.push(i.value)))}return t},Wd=e=>Od.fromSafePromise(Promise.all(e)).andThen(jd),Ld=e=>{let t=Jd([]);for(const i of e)i.isErr()&&t.isErr()?t.error.push(i.error):i.isErr()&&t.isOk()?t=Kd([i.error]):i.isOk()&&t.isOk()&&t.value.push(i.value);return t},Hd=e=>Od.fromSafePromise(Promise.all(e)).andThen(Ld);var Vd;function Jd(e){return new qd(e)}function Kd(e){return new Gd(e)}!function(e){e.fromThrowable=function(e,t){return(...i)=>{try{return Jd(e(...i))}catch(e){return Kd(t?t(e):e)}}},e.combine=function(e){return jd(e)},e.combineWithAllErrors=function(e){return Ld(e)}}(Vd||(Vd={}));class qd{constructor(e){this.value=e}isOk(){return!0}isErr(){return!this.isOk()}map(e){return Jd(e(this.value))}mapErr(e){return Jd(this.value)}andThen(e){return e(this.value)}andThrough(e){return e(this.value).map((()=>this.value))}andTee(e){try{e(this.value)}catch(e){}return Jd(this.value)}orTee(e){return Jd(this.value)}orElse(e){return Jd(this.value)}asyncAndThen(e){return e(this.value)}asyncAndThrough(e){return e(this.value).map((()=>this.value))}asyncMap(e){return Od.fromSafePromise(e(this.value))}unwrapOr(e){return this.value}match(e,t){return e(this.value)}safeUnwrap(){const e=this.value;return function*(){return e}()}_unsafeUnwrap(e){return this.value}_unsafeUnwrapErr(e){throw _d("Called `_unsafeUnwrapErr` on an Ok",this,e)}*[Symbol.iterator](){return this.value}}class Gd{constructor(e){this.error=e}isOk(){return!1}isErr(){return!this.isOk()}map(e){return Kd(this.error)}mapErr(e){return Kd(e(this.error))}andThrough(e){return Kd(this.error)}andTee(e){return Kd(this.error)}orTee(e){try{e(this.error)}catch(e){}return Kd(this.error)}andThen(e){return Kd(this.error)}orElse(e){return e(this.error)}asyncAndThen(e){return $d(this.error)}asyncAndThrough(e){return $d(this.error)}asyncMap(e){return $d(this.error)}unwrapOr(e){return e}match(e,t){return t(this.error)}safeUnwrap(){const e=this.error;return function*(){throw yield Kd(e),new Error("Do not use this generator out of `safeTry`")}()}_unsafeUnwrap(e){throw _d("Called `_unsafeUnwrap` on an Err",this,e)}_unsafeUnwrapErr(e){return this.error}*[Symbol.iterator](){return yield this,this}}const Xd=class{constructor(t){e(this,t),this.accept=["image/*"]}componentDidRender(){const e=(new wa).use(td,{inline:!0,target:this.uppy,theme:"auto"}).use(cd).use(Ad,{modes:["picture"],showVideoSourceDropdown:!0});e.setOptions({restrictions:{allowedFileTypes:this.accept}}),e.addUploader((async t=>{const i=e.getFilesByIds(t);e.emit("upload-start",i);for(const t of i)await this.toFile(t).asyncAndThen((e=>this.uploader(e))).match((()=>e.emit("upload-success",t,{status:201})),(i=>{e.emit("upload-error",t,new Error(i.title+" - "+i.detail))}))}))}toFile(e){return e.data instanceof File?Jd(e.data):e.data instanceof Blob?Jd(new File([e.data],e.name,{type:e.type})):Kd({type:"file",title:"Unknow data type",detail:"Expected file to be a File or Blob object"})}render(){return t("div",{key:"bba1889322d2bb688881bcab1797dbc2a325e4e3",class:"container",ref:e=>this.uppy=e})}};Xd.style=".uppy-Root{box-sizing:border-box;color:#333;font-family:-apple-system,system-ui,BlinkMacSystemFont,Segoe UI,Segoe UI Symbol,Segoe UI Emoji,Apple Color Emoji,Roboto,Helvetica,Arial,sans-serif;line-height:1;position:relative;text-align:left;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.uppy-Root[dir=rtl],[dir=rtl] .uppy-Root{text-align:right}.uppy-Root *,.uppy-Root :after,.uppy-Root :before{box-sizing:inherit}.uppy-Root [hidden]{display:none}.uppy-u-reset{all:initial;appearance:none;box-sizing:border-box;font-family:-apple-system,system-ui,BlinkMacSystemFont,Segoe UI,Segoe UI Symbol,Segoe UI Emoji,Apple Color Emoji,Roboto,Helvetica,Arial,sans-serif;line-height:1}[dir=rtl] .uppy-u-reset{text-align:right}.uppy-truncate-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.uppy-c-textInput{background-color:#fff;border:1px solid #ddd;border-radius:4px;font-family:inherit;font-size:14px;line-height:1.5;padding:6px 8px}.uppy-size--md .uppy-c-textInput{padding:8px 10px}.uppy-c-textInput:focus{border-color:#1269cf99;box-shadow:0 0 0 3px #1269cf26;outline:none}[data-uppy-theme=dark] .uppy-c-textInput{background-color:#333;border-color:#333;color:#eaeaea}[data-uppy-theme=dark] .uppy-c-textInput:focus{border-color:#525252;box-shadow:none}.uppy-c-icon{display:inline-block;max-height:100%;max-width:100%;overflow:hidden;fill:currentColor}.uppy-c-btn{align-items:center;color:inherit;display:inline-flex;font-family:inherit;font-size:inherit;font-weight:500;justify-content:center;line-height:1;transition-duration:.3s;transition-property:background-color,color;user-select:none;white-space:nowrap}.uppy-c-btn,[dir=rtl] .uppy-c-btn{text-align:center}.uppy-c-btn:not(:disabled):not(.disabled){cursor:pointer}.uppy-c-btn::-moz-focus-inner{border:0}.uppy-c-btn-primary{background-color:#1269cf;border-radius:4px;color:#fff;font-size:14px;padding:10px 18px}.uppy-c-btn-primary:not(:disabled):hover{background-color:#0e51a0}.uppy-c-btn-primary:focus{box-shadow:0 0 0 3px #1269cf66;outline:none}.uppy-size--md .uppy-c-btn-primary{padding:13px 22px}[data-uppy-theme=dark] .uppy-c-btn-primary{color:#eaeaea}[data-uppy-theme=dark] .uppy-c-btn-primary:focus{outline:none}[data-uppy-theme=dark] .uppy-c-btn-primary::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-c-btn-primary:focus{box-shadow:0 0 0 2px #aae1ffd9}.uppy-c-btn-primary.uppy-c-btn--disabled{background-color:#8eb2db}.uppy-c-btn-link{background-color:initial;border-radius:4px;color:#525252;font-size:14px;line-height:1;padding:10px 15px}.uppy-c-btn-link:hover{color:#333}.uppy-c-btn-link:focus{box-shadow:0 0 0 3px #1269cf40;outline:none}.uppy-size--md .uppy-c-btn-link{padding:13px 18px}[data-uppy-theme=dark] .uppy-c-btn-link{color:#eaeaea}[data-uppy-theme=dark] .uppy-c-btn-link:focus{outline:none}[data-uppy-theme=dark] .uppy-c-btn-link::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-c-btn-link:focus{box-shadow:0 0 0 2px #aae1ffd9}[data-uppy-theme=dark] .uppy-c-btn-link:hover{color:#939393}@charset \"UTF-8\";.uppy-ProviderBrowser-viewType--grid ul.uppy-ProviderBrowser-list,.uppy-ProviderBrowser-viewType--unsplash ul.uppy-ProviderBrowser-list{align-items:flex-start;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;padding:6px}.uppy-ProviderBrowser-viewType--grid ul.uppy-ProviderBrowser-list:after,.uppy-ProviderBrowser-viewType--unsplash ul.uppy-ProviderBrowser-list:after{content:\"\";flex:auto}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem,.uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem{margin:0;position:relative;width:50%}.uppy-size--md .uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem,.uppy-size--md .uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem{width:33.3333%}.uppy-size--lg .uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem,.uppy-size--lg .uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem{width:25%}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem:before,.uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem:before{content:\"\";display:block;padding-top:100%}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--selected img,.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--selected svg,.uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem--selected img,.uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem--selected svg{opacity:.85}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--disabled,.uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem--disabled{opacity:.5}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--noPreview .uppy-ProviderBrowserItem-inner,.uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem--noPreview .uppy-ProviderBrowserItem-inner{background-color:#93939333}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--noPreview .uppy-ProviderBrowserItem-inner,[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem--noPreview .uppy-ProviderBrowserItem-inner{background-color:#eaeaea33}.uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--noPreview svg,.uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem--noPreview svg{height:30%;width:30%;fill:#000000b3}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--grid li.uppy-ProviderBrowserItem--noPreview svg,[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--unsplash li.uppy-ProviderBrowserItem--noPreview svg{fill:#fffc}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-inner,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-inner{border-radius:4px;bottom:7px;height:calc(100% - 14px);left:7px;overflow:hidden;position:absolute;right:7px;text-align:center;top:7px;width:calc(100% - 14px)}@media (hover:none){.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-inner .uppy-ProviderBrowserItem-author,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-inner .uppy-ProviderBrowserItem-author{display:block}}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-inner,[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-inner{box-shadow:0 0 0 3px #aae1ffb3}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-inner img,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-inner img{border-radius:4px;height:100%;object-fit:cover;width:100%}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-author,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-author{background:#0000004d;bottom:0;color:#fff;display:none;font-size:12px;font-weight:500;left:0;margin:0;padding:5px;position:absolute;text-decoration:none;width:100%}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-author:hover,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-author:hover{background:#0006;text-decoration:underline}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-checkbox,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-checkbox{background-color:#1269cf;border-radius:50%;height:26px;opacity:0;position:absolute;right:16px;top:16px;width:26px;z-index:1002}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-checkbox:after,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-checkbox:after{height:7px;inset-inline-start:7px;top:8px;width:12px}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem--is-checked .uppy-ProviderBrowserItem-checkbox,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem--is-checked .uppy-ProviderBrowserItem-checkbox{opacity:1}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-checkbox--grid:focus+label .uppy-ProviderBrowserItem-author,.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-checkbox--grid:hover+label .uppy-ProviderBrowserItem-author,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-checkbox--grid:focus+label .uppy-ProviderBrowserItem-author,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-checkbox--grid:hover+label .uppy-ProviderBrowserItem-author{display:block}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-checkbox--grid:focus+label,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-checkbox--grid:focus+label{box-shadow:0 0 0 3px #1269cf80}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-checkbox--grid:focus+label:focus,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-checkbox--grid:focus+label:focus{outline:none}.uppy-ProviderBrowser-viewType--grid .uppy-ProviderBrowserItem-checkbox--grid:focus+label::-moz-focus-inner,.uppy-ProviderBrowser-viewType--unsplash .uppy-ProviderBrowserItem-checkbox--grid:focus+label::-moz-focus-inner{border:0}.uppy-ProviderBrowser-viewType--list{background-color:#fff}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--list{background-color:#1f1f1f}.uppy-ProviderBrowser-viewType--list li.uppy-ProviderBrowserItem{align-items:center;display:flex;margin:0;padding:7px 15px}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--list li.uppy-ProviderBrowserItem{color:#eaeaea}.uppy-ProviderBrowser-viewType--list li.uppy-ProviderBrowserItem--disabled{opacity:.6}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-checkbox{background-color:#fff;border:1px solid #cfcfcf;border-radius:3px;height:17px;margin-inline-end:15px;width:17px}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-checkbox:focus{border:1px solid #1269cf;box-shadow:0 0 0 3px #1269cf40;outline:none}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-checkbox:after{height:5px;inset-inline-start:3px;opacity:0;top:4px;width:9px}[data-uppy-theme=dark] .uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-checkbox:focus{border-color:#02baf2b3;box-shadow:0 0 0 3px #02baf233}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem--is-checked .uppy-ProviderBrowserItem-checkbox,.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem--is-partial .uppy-ProviderBrowserItem-checkbox{background-color:#1269cf;border-color:#1269cf}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem--is-checked .uppy-ProviderBrowserItem-checkbox:after,.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem--is-partial .uppy-ProviderBrowserItem-checkbox:after{opacity:1}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-inner{align-items:center;color:inherit;display:flex;font-family:-apple-system,system-ui,BlinkMacSystemFont,Segoe UI,Segoe UI Symbol,Segoe UI Emoji,Apple Color Emoji,Roboto,Helvetica,Arial,sans-serif;overflow:hidden;padding:2px;text-overflow:ellipsis;white-space:nowrap}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-inner:focus{outline:none;text-decoration:underline}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-inner img,.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-inner svg{margin-inline-end:8px}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-inner span{line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem--disabled .uppy-ProviderBrowserItem-inner{cursor:default}.uppy-ProviderBrowser-viewType--list .uppy-ProviderBrowserItem-iconWrap{margin-inline-end:7px;width:20px}.uppy-ProviderBrowserItem-checkbox{cursor:pointer;flex-shrink:0;position:relative}.uppy-ProviderBrowserItem-checkbox:disabled,.uppy-ProviderBrowserItem-checkbox:disabled:after{cursor:default}[data-uppy-theme=dark] .uppy-ProviderBrowserItem-checkbox{background-color:#1f1f1f;border-color:#939393}[data-uppy-theme=dark] .uppy-ProviderBrowserItem--is-checked .uppy-ProviderBrowserItem-checkbox{background-color:#333}.uppy-ProviderBrowserItem--is-checked .uppy-ProviderBrowserItem-checkbox:after{border-bottom:2px solid #eaeaea;border-left:2px solid #eaeaea;content:\"\";cursor:pointer;position:absolute;transform:rotate(-45deg)}.uppy-ProviderBrowserItem--is-partial .uppy-ProviderBrowserItem-checkbox:after{background-color:#eaeaea!important;content:\"\"!important;height:2px!important;left:20%!important;position:absolute!important;right:20%!important;top:50%!important;transform:translateY(-50%)!important}.uppy-SearchProvider{align-items:center;display:flex;flex:1;flex-direction:column;height:100%;justify-content:center;width:100%}[data-uppy-theme=dark] .uppy-SearchProvider{background-color:#1f1f1f}.uppy-SearchProvider-input{margin-bottom:15px;max-width:650px;width:90%}.uppy-size--md .uppy-SearchProvider-input{margin-bottom:20px}.uppy-SearchProvider-input::-webkit-search-cancel-button{display:none}.uppy-SearchProvider-searchButton{padding:13px 25px}.uppy-size--md .uppy-SearchProvider-searchButton{padding:13px 30px}.uppy-DashboardContent-panelBody{align-items:center;display:flex;flex:1;justify-content:center}[data-uppy-theme=dark] .uppy-DashboardContent-panelBody{background-color:#1f1f1f}.uppy-Provider-auth,.uppy-Provider-empty,.uppy-Provider-error,.uppy-Provider-loading{align-items:center;color:#939393;display:flex;flex:1;flex-flow:column wrap;justify-content:center}.uppy-Provider-empty{color:#939393}.uppy-Provider-authIcon svg{height:75px;width:100px}.uppy-Provider-authTitle{color:#757575;font-size:17px;font-weight:400;line-height:1.4;margin-bottom:30px;max-width:500px;padding:0 15px;text-align:center}.uppy-size--md .uppy-Provider-authTitle{font-size:20px}[data-uppy-theme=dark] .uppy-Provider-authTitle{color:#cfcfcf}.uppy-Provider-btn-google{align-items:center;background:#4285f4;display:flex;padding:8px 12px!important}.uppy-Provider-btn-google:hover{background-color:#1266f1}.uppy-Provider-btn-google:focus{box-shadow:0 0 0 3px #4285f466;outline:none}.uppy-Provider-btn-google svg{margin-right:8px}.uppy-Provider-breadcrumbs{color:#525252;flex:1;font-size:12px;margin-bottom:10px;text-align:start}.uppy-size--md .uppy-Provider-breadcrumbs{margin-bottom:0}[data-uppy-theme=dark] .uppy-Provider-breadcrumbs{color:#eaeaea}.uppy-Provider-breadcrumbsIcon{color:#525252;display:inline-block;line-height:1;margin-inline-end:4px;vertical-align:middle}.uppy-Provider-breadcrumbsIcon svg{height:13px;width:13px;fill:#525252}.uppy-Provider-breadcrumbs button{border-radius:3px;display:inline-block;line-height:inherit;padding:4px}.uppy-Provider-breadcrumbs button:focus{outline:none}.uppy-Provider-breadcrumbs button::-moz-focus-inner{border:0}.uppy-Provider-breadcrumbs button:hover{color:#0e51a0}.uppy-Provider-breadcrumbs button:focus{background-color:#dfe6f1}[data-uppy-theme=dark] .uppy-Provider-breadcrumbs button:focus{background-color:#333}.uppy-Provider-breadcrumbs button:not(:last-of-type){text-decoration:underline}.uppy-Provider-breadcrumbs button:last-of-type{color:#333;cursor:normal;font-weight:500;pointer-events:none}.uppy-Provider-breadcrumbs button:hover{cursor:pointer}[data-uppy-theme=dark] .uppy-Provider-breadcrumbs button{color:#eaeaea}.uppy-ProviderBrowser{display:flex;flex:1;flex-direction:column;font-size:14px;font-weight:400;height:100%}.uppy-ProviderBrowser-user{color:#333;font-weight:500;margin:0 8px 0 0}[data-uppy-theme=dark] .uppy-ProviderBrowser-user{color:#eaeaea}.uppy-ProviderBrowser-user:after{color:#939393;content:\"·\";font-weight:400;inset-inline-start:4px;position:relative}.uppy-ProviderBrowser-header{border-bottom:1px solid #eaeaea;position:relative;z-index:1001}[data-uppy-theme=dark] .uppy-ProviderBrowser-header{border-bottom:1px solid #333}.uppy-ProviderBrowser-headerBar{background-color:#fafafa;color:#757575;font-size:12px;line-height:1.4;padding:7px 15px;z-index:1001}.uppy-size--md .uppy-ProviderBrowser-headerBar{align-items:center;display:flex}[data-uppy-theme=dark] .uppy-ProviderBrowser-headerBar{background-color:#1f1f1f}.uppy-ProviderBrowser-headerBar--simple{display:block;justify-content:center;text-align:center}.uppy-ProviderBrowser-headerBar--simple .uppy-Provider-breadcrumbsWrap{display:inline-block;flex:none;vertical-align:middle}.uppy-ProviderBrowser-searchFilter{align-items:center;display:flex;height:30px;margin-bottom:15px;margin-top:15px;padding-left:8px;padding-right:8px;position:relative;width:100%}.uppy-ProviderBrowser-searchFilterInput{background-color:#eaeaea;border:0;border-radius:4px;color:#333;font-family:-apple-system,system-ui,BlinkMacSystemFont,Segoe UI,Segoe UI Symbol,Segoe UI Emoji,Apple Color Emoji,Roboto,Helvetica,Arial,sans-serif;font-size:13px;height:30px;line-height:1.4;outline:0;padding-inline-end:30px;padding-inline-start:30px;width:100%;z-index:1001}.uppy-ProviderBrowser-searchFilterInput::-webkit-search-cancel-button{display:none}[data-uppy-theme=dark] .uppy-ProviderBrowser-searchFilterInput{background-color:#1f1f1f;color:#eaeaea}.uppy-ProviderBrowser-searchFilterInput:focus{background-color:#cfcfcf;border:0}[data-uppy-theme=dark] .uppy-ProviderBrowser-searchFilterInput:focus{background-color:#333}.uppy-ProviderBrowser-searchFilterIcon{color:#757575;height:12px;inset-inline-start:16px;position:absolute;width:12px;z-index:1002}.uppy-ProviderBrowser-searchFilterInput::placeholder{color:#939393;opacity:1}.uppy-ProviderBrowser-searchFilterReset{border-radius:3px;color:#939393;cursor:pointer;height:22px;inset-inline-end:16px;padding:6px;position:absolute;width:22px;z-index:1002}.uppy-ProviderBrowser-searchFilterReset:focus{outline:none}.uppy-ProviderBrowser-searchFilterReset::-moz-focus-inner{border:0}.uppy-ProviderBrowser-searchFilterReset:focus{box-shadow:0 0 0 3px #1269cf80}.uppy-ProviderBrowser-searchFilterReset:hover{color:#757575}.uppy-ProviderBrowser-searchFilterReset svg{vertical-align:text-top}.uppy-ProviderBrowser-userLogout{border-radius:3px;color:#1269cf;cursor:pointer;line-height:inherit;padding:4px}.uppy-ProviderBrowser-userLogout:focus{outline:none}.uppy-ProviderBrowser-userLogout::-moz-focus-inner{border:0}.uppy-ProviderBrowser-userLogout:hover{color:#0e51a0}.uppy-ProviderBrowser-userLogout:focus{background-color:#dfe6f1}[data-uppy-theme=dark] .uppy-ProviderBrowser-userLogout:focus{background-color:#333}.uppy-ProviderBrowser-userLogout:hover{text-decoration:underline}[data-uppy-theme=dark] .uppy-ProviderBrowser-userLogout{color:#eaeaea}.uppy-ProviderBrowser-body{flex:1;position:relative}.uppy-ProviderBrowser-list{background-color:#fff;border-spacing:0;bottom:0;display:block;flex:1;height:100%;left:0;list-style:none;margin:0;overflow-x:hidden;overflow-y:auto;padding:0;position:absolute;right:0;top:0;width:100%;-webkit-overflow-scrolling:touch}[data-uppy-theme=dark] .uppy-ProviderBrowser-list{background-color:#1f1f1f}.uppy-ProviderBrowser-list:focus{outline:none}.uppy-ProviderBrowserItem-inner{cursor:pointer;font-size:13px;font-weight:500}.uppy-ProviderBrowser-footer{align-items:center;background-color:#fff;border-top:1px solid #eaeaea;display:flex;justify-content:space-between;padding:15px}.uppy-ProviderBrowser-footer button{margin-inline-end:8px}[data-uppy-theme=dark] .uppy-ProviderBrowser-footer{background-color:#1f1f1f;border-top:1px solid #333}.uppy-ProviderBrowser-footer-buttons{flex-shrink:0}.uppy-ProviderBrowser-footer-error{color:#e32437;line-height:18px}@media (max-width:426px){.uppy-ProviderBrowser-footer{align-items:stretch;flex-direction:column-reverse}.uppy-ProviderBrowser-footer-error{padding-bottom:10px}}.picker-dialog-bg{z-index:20000!important}.picker-dialog{z-index:20001!important}.uppy-Dashboard-Item-previewInnerWrap{align-items:center;border-radius:3px;box-shadow:0 0 2px 0 #0006;display:flex;flex-direction:column;height:100%;justify-content:center;overflow:hidden;position:relative;width:100%}.uppy-size--md .uppy-Dashboard-Item-previewInnerWrap{box-shadow:0 1px 2px #00000026}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-previewInnerWrap{box-shadow:none}.uppy-Dashboard-Item-previewInnerWrap:after{background-color:#000000a6;bottom:0;content:\"\";display:none;left:0;position:absolute;right:0;top:0;z-index:1001}.uppy-Dashboard-Item-previewLink{bottom:0;left:0;position:absolute;right:0;top:0;z-index:1002}.uppy-Dashboard-Item-previewLink:focus{box-shadow:inset 0 0 0 3px #579df0}[data-uppy-theme=dark] .uppy-Dashboard-Item-previewLink:focus{box-shadow:inset 0 0 0 3px #016c8d}.uppy-Dashboard-Item-preview img.uppy-Dashboard-Item-previewImg{border-radius:3px;height:100%;object-fit:cover;transform:translateZ(0);width:100%}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-preview img.uppy-Dashboard-Item-previewImg{height:auto;max-height:100%;max-width:100%;object-fit:contain;padding:10px;width:auto}.uppy-Dashboard-Item-progress{color:#fff;left:50%;position:absolute;text-align:center;top:50%;transform:translate(-50%,-50%);transition:all .35 ease;width:120px;z-index:1002}.uppy-Dashboard-Item-progressIndicator{color:#fff;display:inline-block;height:38px;opacity:.9;width:38px}.uppy-size--md .uppy-Dashboard-Item-progressIndicator{height:55px;width:55px}button.uppy-Dashboard-Item-progressIndicator{cursor:pointer}button.uppy-Dashboard-Item-progressIndicator:focus{outline:none}button.uppy-Dashboard-Item-progressIndicator::-moz-focus-inner{border:0}button.uppy-Dashboard-Item-progressIndicator:focus .uppy-Dashboard-Item-progressIcon--bg,button.uppy-Dashboard-Item-progressIndicator:focus .uppy-Dashboard-Item-progressIcon--retry{fill:#579df0}.uppy-Dashboard-Item-progressIcon--circle{height:100%;width:100%}.uppy-Dashboard-Item-progressIcon--bg{stroke:#fff6}.uppy-Dashboard-Item-progressIcon--progress{transition:stroke-dashoffset .5s ease-out;stroke:#fff}.uppy-Dashboard-Item-progressIcon--play{transition:all .2s;fill:#fff;stroke:#fff}.uppy-Dashboard-Item-progressIcon--cancel{transition:all .2s;fill:#fff}.uppy-Dashboard-Item-progressIcon--pause{transition:all .2s;fill:#fff;stroke:#fff}.uppy-Dashboard-Item-progressIcon--check{transition:all .2s;fill:#fff}.uppy-Dashboard-Item-progressIcon--retry{fill:#fff}.uppy-Dashboard-Item.is-complete .uppy-Dashboard-Item-progress{inset-inline-end:-8px;inset-inline-start:auto;top:-9px;transform:none;width:auto}.uppy-Dashboard-Item.is-error .uppy-Dashboard-Item-progressIndicator{height:18px;width:18px}.uppy-size--md .uppy-Dashboard-Item.is-error .uppy-Dashboard-Item-progressIndicator{height:28px;width:28px}.uppy-Dashboard-Item.is-complete .uppy-Dashboard-Item-progressIndicator{height:18px;opacity:1;width:18px}.uppy-size--md .uppy-Dashboard-Item.is-complete .uppy-Dashboard-Item-progressIndicator{height:22px;width:22px}.uppy-Dashboard-Item.is-processing .uppy-Dashboard-Item-progress{opacity:0}.uppy-Dashboard-Item-fileInfo{padding-inline-end:5px}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-fileInfo{padding-inline-end:10px}.uppy-size--md.uppy-Dashboard--singleFile .uppy-Dashboard-Item-fileInfo{padding-inline-end:15px}.uppy-Dashboard-Item-name{font-size:12px;font-weight:500;line-height:1.3;margin-bottom:5px;word-wrap:anywhere;word-break:break-all}[data-uppy-theme=dark] .uppy-Dashboard-Item-name{color:#eaeaea}.uppy-size--md.uppy-Dashboard--singleFile .uppy-Dashboard-Item-name{font-size:14px;line-height:1.4}.uppy-Dashboard-Item-fileName{align-items:baseline;display:flex}.uppy-Dashboard-Item-fileName button{margin-left:5px}.uppy-Dashboard-Item-author{color:#757575;display:inline-block;font-size:11px;font-weight:400;line-height:1;margin-bottom:5px;vertical-align:bottom}.uppy-Dashboard-Item-author a{color:#757575}.uppy-Dashboard-Item-status{color:#757575;font-size:11px;font-weight:400;line-height:1}[data-uppy-theme=dark] .uppy-Dashboard-Item-status{color:#bbb}.uppy-Dashboard-Item-statusSize{display:inline-block;margin-bottom:5px;text-transform:uppercase;vertical-align:bottom}.uppy-Dashboard-Item-reSelect{color:#1269cf;font-family:inherit;font-size:inherit;font-weight:600}.uppy-Dashboard-Item-errorMessage{background-color:#fdeff1;color:#a51523;font-size:11px;font-weight:500;line-height:1.3;padding:5px 6px}.uppy-Dashboard-Item-errorMessageBtn{color:#a51523;cursor:pointer;font-size:11px;font-weight:500;text-decoration:underline}.uppy-Dashboard-Item-preview .uppy-Dashboard-Item-errorMessage{display:none}.uppy-size--md .uppy-Dashboard-Item-preview .uppy-Dashboard-Item-errorMessage{border-bottom-left-radius:3px;border-bottom-right-radius:3px;border-top:1px solid #f7c2c8;bottom:0;display:block;left:0;line-height:1.4;padding:6px 8px;position:absolute;right:0}.uppy-Dashboard-Item-fileInfo .uppy-Dashboard-Item-errorMessage{border:1px solid #f7c2c8;border-radius:3px;display:inline-block;position:static}.uppy-size--md .uppy-Dashboard-Item-fileInfo .uppy-Dashboard-Item-errorMessage{display:none}.uppy-Dashboard-Item-action{color:#939393;cursor:pointer}.uppy-Dashboard-Item-action:focus{outline:none}.uppy-Dashboard-Item-action::-moz-focus-inner{border:0}.uppy-Dashboard-Item-action:focus{box-shadow:0 0 0 3px #1269cf80}.uppy-Dashboard-Item-action:hover{color:#1f1f1f;opacity:1}[data-uppy-theme=dark] .uppy-Dashboard-Item-action{color:#cfcfcf}[data-uppy-theme=dark] .uppy-Dashboard-Item-action:focus{outline:none}[data-uppy-theme=dark] .uppy-Dashboard-Item-action::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-Dashboard-Item-action:focus{box-shadow:0 0 0 2px #aae1ffd9}[data-uppy-theme=dark] .uppy-Dashboard-Item-action:hover{color:#eaeaea}.uppy-Dashboard-Item-action--remove{color:#1f1f1f;opacity:.95}.uppy-Dashboard-Item-action--remove:hover{color:#000;opacity:1}.uppy-size--md .uppy-Dashboard-Item-action--remove{height:18px;inset-inline-end:-8px;padding:0;position:absolute;top:-8px;width:18px;z-index:1002}.uppy-size--md .uppy-Dashboard-Item-action--remove:focus{border-radius:50%}.uppy-Dashboard--singleFile.uppy-size--height-md .uppy-Dashboard-Item-action--remove{inset-inline-end:8px;position:absolute;top:8px}[data-uppy-theme=dark] .uppy-Dashboard-Item-action--remove{color:#525252}[data-uppy-theme=dark] .uppy-Dashboard-Item-action--remove:hover{color:#333}.uppy-Dashboard:not(.uppy-size--md):not(.uppy-Dashboard--singleFile.uppy-size--height-md) .uppy-Dashboard-Item-actionWrapper{align-items:center;display:flex}.uppy-Dashboard:not(.uppy-size--md):not(.uppy-Dashboard--singleFile.uppy-size--height-md) .uppy-Dashboard-Item-action{height:22px;margin-left:3px;padding:3px;width:22px}.uppy-Dashboard:not(.uppy-size--md):not(.uppy-Dashboard--singleFile.uppy-size--height-md) .uppy-Dashboard-Item-action:focus{border-radius:3px}.uppy-size--md .uppy-Dashboard-Item-action--copyLink,.uppy-size--md .uppy-Dashboard-Item-action--edit{height:16px;padding:0;width:16px}.uppy-size--md .uppy-Dashboard-Item-action--copyLink:focus,.uppy-size--md .uppy-Dashboard-Item-action--edit:focus{border-radius:3px}.uppy-Dashboard-Item{align-items:center;border-bottom:1px solid #eaeaea;display:flex;padding:10px}.uppy-Dashboard:not(.uppy-Dashboard--singleFile) .uppy-Dashboard-Item{padding-inline-end:0}[data-uppy-theme=dark] .uppy-Dashboard-Item{border-bottom:1px solid #333}.uppy-size--md .uppy-Dashboard-Item{border-bottom:0;display:block;float:inline-start;height:215px;margin:5px 15px;padding:0;position:relative;width:calc(33.333% - 30px)}.uppy-size--lg .uppy-Dashboard-Item{height:190px;margin:5px 15px;padding:0;width:calc(25% - 30px)}.uppy-size--xl .uppy-Dashboard-Item{height:210px;padding:0;width:calc(20% - 30px)}.uppy-Dashboard--singleFile .uppy-Dashboard-Item{border-bottom:0;display:flex;flex-direction:column;height:100%;max-width:400px;padding:15px;position:relative;width:100%}.uppy-Dashboard-Item.is-ghost .uppy-Dashboard-Item-previewInnerWrap{opacity:.2}.uppy-Dashboard-Item.is-ghost .uppy-Dashboard-Item-name{opacity:.7}.uppy-Dashboard-Item.is-ghost .uppy-Dashboard-Item-preview:before{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='35' height='39' viewBox='0 0 35 39'%3E%3Cpath fill='%2523000' d='M1.708 38.66c1.709 0 3.417-3.417 6.834-3.417s5.125 3.417 8.61 3.417c3.348 0 5.056-3.417 8.473-3.417 4.305 0 5.125 3.417 6.833 3.417.889 0 1.709-.889 1.709-1.709v-19.68C34.167-5.757 0-5.757 0 17.271v19.68c0 .82.888 1.709 1.708 1.709m8.542-17.084a3.383 3.383 0 0 1-3.417-3.416 3.383 3.383 0 0 1 3.417-3.417 3.383 3.383 0 0 1 3.417 3.417 3.383 3.383 0 0 1-3.417 3.416m13.667 0A3.383 3.383 0 0 1 20.5 18.16a3.383 3.383 0 0 1 3.417-3.417 3.383 3.383 0 0 1 3.416 3.417 3.383 3.383 0 0 1-3.416 3.416'/%3E%3C/svg%3E\");background-position:50% 10px;background-repeat:no-repeat;background-size:25px;bottom:0;content:\"\";left:0;opacity:.5;position:absolute;right:0;top:0;z-index:1005}.uppy-size--md .uppy-Dashboard-Item.is-ghost .uppy-Dashboard-Item-preview:before{background-position:50% 50%;background-size:40px}.uppy-Dashboard--singleFile .uppy-Dashboard-Item.is-ghost .uppy-Dashboard-Item-preview:before{background-position:50% 50%;background-size:30%}.uppy-Dashboard-Item-preview{flex-grow:0;flex-shrink:0;height:50px;position:relative;width:50px}.uppy-size--md .uppy-Dashboard-Item-preview{height:140px;width:100%}.uppy-size--lg .uppy-Dashboard-Item-preview{height:120px}.uppy-size--xl .uppy-Dashboard-Item-preview{height:140px}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-preview{flex-grow:1;max-height:75%;width:100%}.uppy-Dashboard--singleFile.uppy-size--md .uppy-Dashboard-Item-preview{max-height:100%}.uppy-Dashboard-Item-fileInfoAndButtons{align-items:center;display:flex;flex-grow:1;justify-content:space-between;padding-inline-end:8px;padding-inline-start:12px}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-fileInfoAndButtons,.uppy-size--md .uppy-Dashboard-Item-fileInfoAndButtons{align-items:flex-start;padding:9px 0 0}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-fileInfoAndButtons{flex-grow:0;width:100%}.uppy-Dashboard-Item-fileInfo{flex-grow:1;flex-shrink:1}.uppy-Dashboard-Item-actionWrapper{flex-grow:0;flex-shrink:0}.uppy-Dashboard-Item.is-error .uppy-Dashboard-Item-previewInnerWrap:after,.uppy-Dashboard-Item.is-inprogress .uppy-Dashboard-Item-previewInnerWrap:after{display:block}.uppy-Dashboard-Item-errorDetails{appearance:none;background-color:#939393;border:none;border-radius:50%;color:#fff;cursor:help;flex-shrink:0;font-size:10px;font-weight:600;height:13px;inset-inline-start:2px;line-height:12px;position:relative;text-align:center;top:0;width:13px}.uppy-Dashboard-Item-errorDetails:after{line-height:1.3;word-wrap:break-word}.uppy-Dashboard-FileCard{background-color:#fff;border-radius:5px;bottom:0;box-shadow:0 0 10px 4px #0000001a;display:flex;flex-direction:column;height:100%;left:0;position:absolute;right:0;top:0;width:100%;z-index:1005}.uppy-Dashboard-FileCard .uppy-DashboardContent-bar{border-top-left-radius:5px;border-top-right-radius:5px}.uppy-Dashboard-FileCard .uppy-Dashboard-FileCard-actions{border-bottom-left-radius:5px;border-bottom-right-radius:5px}.uppy-Dashboard-FileCard-inner{display:flex;flex-direction:column;flex-grow:1;flex-shrink:1;height:100%;min-height:0}.uppy-Dashboard-FileCard-preview{align-items:center;border-bottom:1px solid #eaeaea;display:flex;flex-grow:0;flex-shrink:1;height:60%;justify-content:center;min-height:0;position:relative}[data-uppy-theme=dark] .uppy-Dashboard-FileCard-preview{background-color:#333;border-bottom:0}.uppy-Dashboard-FileCard-preview img.uppy-Dashboard-Item-previewImg{border-radius:3px;box-shadow:0 3px 20px #00000026;flex:0 0 auto;max-height:90%;max-width:90%;object-fit:cover}.uppy-Dashboard-FileCard-edit{background-color:#00000080;border-radius:50px;color:#fff;font-size:13px;inset-inline-end:10px;padding:7px 15px;position:absolute;top:10px}.uppy-Dashboard-FileCard-edit:focus{outline:none}.uppy-Dashboard-FileCard-edit::-moz-focus-inner{border:0}.uppy-Dashboard-FileCard-edit:focus{box-shadow:0 0 0 3px #1269cf80}.uppy-Dashboard-FileCard-edit:hover{background-color:#000c}.uppy-Dashboard-FileCard-info{flex-grow:0;flex-shrink:0;height:40%;overflow-y:auto;padding:30px 20px 20px;-webkit-overflow-scrolling:touch}[data-uppy-theme=dark] .uppy-Dashboard-FileCard-info{background-color:#1f1f1f}.uppy-Dashboard-FileCard-fieldset{border:0;font-size:0;margin:auto auto 12px;max-width:640px;padding:0}.uppy-Dashboard-FileCard-label{color:#525252;display:inline-block;font-size:12px;vertical-align:middle;width:22%}.uppy-size--md .uppy-Dashboard-FileCard-label{font-size:14px}[data-uppy-theme=dark] .uppy-Dashboard-FileCard-label{color:#eaeaea}.uppy-Dashboard-FileCard-input{display:inline-block;vertical-align:middle;width:78%}.uppy-Dashboard-FileCard-actions{align-items:center;background-color:#fafafa;border-top:1px solid #eaeaea;display:flex;flex-grow:0;flex-shrink:0;height:55px;padding:0 15px}.uppy-size--md .uppy-Dashboard-FileCard-actions{height:65px}[data-uppy-theme=dark] .uppy-Dashboard-FileCard-actions{background-color:#1f1f1f;border-top:1px solid #333}.uppy-Dashboard-FileCard-actionsBtn{margin-inline-end:10px}.uppy-Informer{bottom:60px;left:0;position:absolute;right:0;text-align:center;z-index:1005}.uppy-Informer span>div{margin-bottom:6px}.uppy-Informer-animated{opacity:0;transform:translateY(350%);transition:all .3s ease-in;z-index:-1000}.uppy-Informer p{background-color:#757575;border-radius:18px;color:#fff;display:inline-block;font-size:12px;font-weight:400;line-height:1.4;margin:0;max-width:90%;padding:6px 15px}.uppy-size--md .uppy-Informer p{font-size:14px;line-height:1.3;max-width:500px;padding:10px 20px}[data-uppy-theme=dark] .uppy-Informer p{background-color:#333}.uppy-Informer p span{background-color:#fff;border-radius:50%;color:#525252;display:inline-block;font-size:10px;height:13px;inset-inline-start:3px;line-height:12px;margin-inline-start:-1px;position:relative;top:-1px;vertical-align:middle;width:13px}.uppy-Informer p span:hover{cursor:help}.uppy-Informer p span:after{line-height:1.3;word-wrap:break-word}.uppy-Root [aria-label][role~=tooltip]{position:relative}.uppy-Root [aria-label][role~=tooltip]:after,.uppy-Root [aria-label][role~=tooltip]:before{-webkit-backface-visibility:hidden;backface-visibility:hidden;box-sizing:border-box;opacity:0;pointer-events:none;position:absolute;transform:translateZ(0);transform-origin:top;transition:all var(--microtip-transition-duration,.18s) var(--microtip-transition-easing,ease-in-out) var(--microtip-transition-delay,0s);will-change:transform;z-index:10}.uppy-Root [aria-label][role~=tooltip]:before{background-size:100% auto!important;content:\"\"}.uppy-Root [aria-label][role~=tooltip]:after{background:#111111e6;border-radius:4px;box-sizing:initial;color:#fff;content:attr(aria-label);font-size:var(--microtip-font-size,13px);font-weight:var(--microtip-font-weight,normal);padding:.5em 1em;text-transform:var(--microtip-text-transform,none);white-space:nowrap}.uppy-Root [aria-label][role~=tooltip]:focus:after,.uppy-Root [aria-label][role~=tooltip]:focus:before,.uppy-Root [aria-label][role~=tooltip]:hover:after,.uppy-Root [aria-label][role~=tooltip]:hover:before{opacity:1;pointer-events:auto}.uppy-Root [role~=tooltip][data-microtip-position|=top]:before{background:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(17, 17, 17, 0.9)' d='M2.658 0h32.004c-6 0-11.627 12.002-16.002 12.002S8.594 0 2.658 0'/%3E%3C/svg%3E\") no-repeat;bottom:100%;height:6px;left:50%;margin-bottom:5px;transform:translate3d(-50%,0,0);width:18px}.uppy-Root [role~=tooltip][data-microtip-position|=top]:after{bottom:100%;left:50%;margin-bottom:11px;transform:translate3d(-50%,0,0)}.uppy-Root [role~=tooltip][data-microtip-position=top]:hover:after,.uppy-Root [role~=tooltip][data-microtip-position|=top]:hover:before{transform:translate3d(-50%,-5px,0)}.uppy-Root [role~=tooltip][data-microtip-position=top-left]:after{bottom:100%;transform:translate3d(calc(-100% + 16px),0,0)}.uppy-Root [role~=tooltip][data-microtip-position=top-left]:hover:after{transform:translate3d(calc(-100% + 16px),-5px,0)}.uppy-Root [role~=tooltip][data-microtip-position=top-right]:after{bottom:100%;transform:translate3d(-16px,0,0)}.uppy-Root [role~=tooltip][data-microtip-position=top-right]:hover:after{transform:translate3d(-16px,-5px,0)}.uppy-Root [role~=tooltip][data-microtip-position|=bottom]:before{background:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='12'%3E%3Cpath fill='rgba(17, 17, 17, 0.9)' d='M33.342 12H1.338c6 0 11.627-12.002 16.002-12.002S27.406 12 33.342 12'/%3E%3C/svg%3E\") no-repeat;bottom:auto;height:6px;left:50%;margin-bottom:0;margin-top:5px;top:100%;transform:translate3d(-50%,-10px,0);width:18px}.uppy-Root [role~=tooltip][data-microtip-position|=bottom]:after{left:50%;margin-top:11px;top:100%;transform:translate3d(-50%,-10px,0)}.uppy-Root [role~=tooltip][data-microtip-position=bottom]:hover:after,.uppy-Root [role~=tooltip][data-microtip-position|=bottom]:hover:before{transform:translate3d(-50%,0,0)}.uppy-Root [role~=tooltip][data-microtip-position=bottom-left]:after{top:100%;transform:translate3d(calc(-100% + 16px),-10px,0)}.uppy-Root [role~=tooltip][data-microtip-position=bottom-left]:hover:after{transform:translate3d(calc(-100% + 16px),0,0)}.uppy-Root [role~=tooltip][data-microtip-position=bottom-right]:after{top:100%;transform:translate3d(-16px,-10px,0)}.uppy-Root [role~=tooltip][data-microtip-position=bottom-right]:hover:after{transform:translate3d(-16px,0,0)}.uppy-Root [role~=tooltip][data-microtip-position=left]:after,.uppy-Root [role~=tooltip][data-microtip-position=left]:before{bottom:auto;left:auto;right:100%;top:50%;transform:translate3d(10px,-50%,0)}.uppy-Root [role~=tooltip][data-microtip-position=left]:before{background:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='36'%3E%3Cpath fill='rgba(17, 17, 17, 0.9)' d='M0 33.342V1.338c0 6 12.002 11.627 12.002 16.002S0 27.406 0 33.342'/%3E%3C/svg%3E\") no-repeat;height:18px;margin-bottom:0;margin-right:5px;width:6px}.uppy-Root [role~=tooltip][data-microtip-position=left]:after{margin-right:11px}.uppy-Root [role~=tooltip][data-microtip-position=left]:hover:after,.uppy-Root [role~=tooltip][data-microtip-position=left]:hover:before{transform:translate3d(0,-50%,0)}.uppy-Root [role~=tooltip][data-microtip-position=right]:after,.uppy-Root [role~=tooltip][data-microtip-position=right]:before{bottom:auto;left:100%;top:50%;transform:translate3d(-10px,-50%,0)}.uppy-Root [role~=tooltip][data-microtip-position=right]:before{background:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='36'%3E%3Cpath fill='rgba(17, 17, 17, 0.9)' d='M12 2.658v32.004c0-6-12.002-11.627-12.002-16.002S12 8.594 12 2.658'/%3E%3C/svg%3E\") no-repeat;height:18px;margin-bottom:0;margin-left:5px;width:6px}.uppy-Root [role~=tooltip][data-microtip-position=right]:after{margin-left:11px}.uppy-Root [role~=tooltip][data-microtip-position=right]:hover:after,.uppy-Root [role~=tooltip][data-microtip-position=right]:hover:before{transform:translate3d(0,-50%,0)}.uppy-Root [role~=tooltip][data-microtip-size=small]:after{white-space:normal;width:80px}.uppy-Root [role~=tooltip][data-microtip-size=medium]:after{white-space:normal;width:150px}.uppy-Root [role~=tooltip][data-microtip-size=large]:after{white-space:normal;width:260px}.uppy-StatusBar{background-color:#fff;color:#fff;display:flex;font-size:12px;font-weight:400;height:46px;line-height:40px;position:relative;transition:height .2s;z-index:1001}[data-uppy-theme=dark] .uppy-StatusBar{background-color:#1f1f1f}.uppy-StatusBar:before{background-color:#eaeaea;bottom:0;content:\"\";height:2px;left:0;position:absolute;right:0;top:0;width:100%}[data-uppy-theme=dark] .uppy-StatusBar:before{background-color:#757575}.uppy-StatusBar[aria-hidden=true]{height:0;overflow-y:hidden}.uppy-StatusBar.is-complete .uppy-StatusBar-progress{background-color:#1bb240}.uppy-StatusBar.is-error .uppy-StatusBar-progress{background-color:#e32437}.uppy-StatusBar.is-complete .uppy-StatusBar-statusIndicator{color:#1bb240}.uppy-StatusBar.is-error .uppy-StatusBar-statusIndicator{color:#e32437}.uppy-StatusBar:not([aria-hidden=true]).is-waiting{background-color:#fff;border-top:1px solid #eaeaea;height:65px}[data-uppy-theme=dark] .uppy-StatusBar:not([aria-hidden=true]).is-waiting{background-color:#1f1f1f;border-top:1px solid #333}.uppy-StatusBar-progress{background-color:#1269cf;height:2px;position:absolute;transition:background-color,width .3s ease-out;z-index:1001}.uppy-StatusBar-progress.is-indeterminate{animation:uppy-StatusBar-ProgressStripes 1s linear infinite;background-image:linear-gradient(45deg,#0000004d 25%,#0000 0,#0000 50%,#0000004d 0,#0000004d 75%,#0000 0,#0000);background-size:64px 64px}@keyframes uppy-StatusBar-ProgressStripes{0%{background-position:0 0}to{background-position:64px 0}}.uppy-StatusBar.is-postprocessing .uppy-StatusBar-progress,.uppy-StatusBar.is-preprocessing .uppy-StatusBar-progress{background-color:#f6a623}.uppy-StatusBar.is-waiting .uppy-StatusBar-progress{display:none}.uppy-StatusBar-content{align-items:center;color:#333;display:flex;height:100%;padding-inline-start:10px;position:relative;text-overflow:ellipsis;white-space:nowrap;z-index:1002}.uppy-size--md .uppy-StatusBar-content{padding-inline-start:15px}[data-uppy-theme=dark] .uppy-StatusBar-content{color:#eaeaea}.uppy-StatusBar-status{display:flex;flex-direction:column;font-weight:400;justify-content:center;line-height:1.4;padding-inline-end:.3em}.uppy-StatusBar-statusPrimary{display:flex;font-weight:500;line-height:1}.uppy-StatusBar-statusPrimary button.uppy-StatusBar-details{margin-left:5px}[data-uppy-theme=dark] .uppy-StatusBar-statusPrimary{color:#eaeaea}.uppy-StatusBar-statusSecondary{color:#757575;display:inline-block;font-size:11px;line-height:1.2;margin-top:1px;white-space:nowrap}[data-uppy-theme=dark] .uppy-StatusBar-statusSecondary{color:#bbb}.uppy-StatusBar-statusSecondaryHint{display:inline-block;line-height:1;margin-inline-end:5px;vertical-align:middle}.uppy-size--md .uppy-StatusBar-statusSecondaryHint{margin-inline-end:8px}.uppy-StatusBar-statusIndicator{color:#525252;margin-inline-end:7px;position:relative;top:1px}.uppy-StatusBar-statusIndicator svg{vertical-align:text-bottom}.uppy-StatusBar-actions{align-items:center;bottom:0;display:flex;inset-inline-end:10px;position:absolute;top:0;z-index:1004}.uppy-StatusBar.is-waiting .uppy-StatusBar-actions{background-color:#fafafa;height:100%;padding:0 15px;position:static;width:100%}[data-uppy-theme=dark] .uppy-StatusBar.is-waiting .uppy-StatusBar-actions{background-color:#1f1f1f}.uppy-StatusBar:not([aria-hidden=true]).is-waiting.has-ghosts{flex-direction:column;height:90px}.uppy-size--md .uppy-StatusBar:not([aria-hidden=true]).is-waiting.has-ghosts{flex-direction:row;height:65px}.uppy-StatusBar:not([aria-hidden=true]).is-waiting.has-ghosts .uppy-StatusBar-actions{flex-direction:column;justify-content:center}.uppy-size--md .uppy-StatusBar:not([aria-hidden=true]).is-waiting.has-ghosts .uppy-StatusBar-actions{flex-direction:row;justify-content:normal}.uppy-StatusBar-actionCircleBtn{cursor:pointer;line-height:1;margin:3px;opacity:.9}.uppy-StatusBar-actionCircleBtn:focus{outline:none}.uppy-StatusBar-actionCircleBtn::-moz-focus-inner{border:0}.uppy-StatusBar-actionCircleBtn:focus{box-shadow:0 0 0 3px #1269cf80}[data-uppy-theme=dark] .uppy-StatusBar-actionCircleBtn:focus{outline:none}[data-uppy-theme=dark] .uppy-StatusBar-actionCircleBtn::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-StatusBar-actionCircleBtn:focus{box-shadow:0 0 0 2px #aae1ffd9}.uppy-StatusBar-actionCircleBtn:hover{opacity:1}.uppy-StatusBar-actionCircleBtn:focus{border-radius:50%}.uppy-StatusBar-actionCircleBtn svg{vertical-align:bottom}.uppy-StatusBar-actionBtn{color:#1269cf;display:inline-block;font-size:10px;line-height:inherit;vertical-align:middle}.uppy-size--md .uppy-StatusBar-actionBtn{font-size:11px}.uppy-StatusBar-actionBtn--disabled{opacity:.4}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--disabled{opacity:.7}.uppy-StatusBar-actionBtn--retry{background-color:#ff4b23;border-radius:8px;color:#fff;height:16px;line-height:1;margin-inline-end:6px;padding:1px 6px 3px 18px;position:relative}.uppy-StatusBar-actionBtn--retry:focus{outline:none}.uppy-StatusBar-actionBtn--retry::-moz-focus-inner{border:0}.uppy-StatusBar-actionBtn--retry:focus{box-shadow:0 0 0 3px #1269cf80}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--retry:focus{outline:none}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--retry::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--retry:focus{box-shadow:0 0 0 2px #aae1ffd9}.uppy-StatusBar-actionBtn--retry:hover{background-color:#f92d00}.uppy-StatusBar-actionBtn--retry svg{inset-inline-start:6px;position:absolute;top:3px}.uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload{background-color:#1bb240;color:#fff;font-size:14px;line-height:1;padding:15px 10px;width:100%}.uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload:hover{background-color:#189c38}[data-uppy-theme=dark] .uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload{background-color:#1c8b37}[data-uppy-theme=dark] .uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload:hover{background-color:#18762f}.uppy-size--md .uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload{padding:13px 22px;width:auto}.uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload.uppy-StatusBar-actionBtn--disabled:hover{background-color:#1bb240;cursor:not-allowed}[data-uppy-theme=dark] .uppy-StatusBar.is-waiting .uppy-StatusBar-actionBtn--upload.uppy-StatusBar-actionBtn--disabled:hover{background-color:#1c8b37}.uppy-StatusBar:not(.is-waiting) .uppy-StatusBar-actionBtn--upload{background-color:initial;color:#1269cf}.uppy-StatusBar-actionBtn--uploadNewlyAdded{border-radius:3px;padding-inline-end:3px;padding-bottom:1px;padding-inline-start:3px}.uppy-StatusBar-actionBtn--uploadNewlyAdded:focus{outline:none}.uppy-StatusBar-actionBtn--uploadNewlyAdded::-moz-focus-inner{border:0}.uppy-StatusBar-actionBtn--uploadNewlyAdded:focus{box-shadow:0 0 0 3px #1269cf80}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--uploadNewlyAdded:focus{outline:none}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--uploadNewlyAdded::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--uploadNewlyAdded:focus{box-shadow:0 0 0 2px #aae1ffd9}.uppy-StatusBar.is-postprocessing .uppy-StatusBar-actionBtn--uploadNewlyAdded,.uppy-StatusBar.is-preprocessing .uppy-StatusBar-actionBtn--uploadNewlyAdded{display:none}.uppy-StatusBar-actionBtn--done{border-radius:3px;line-height:1;padding:7px 8px}.uppy-StatusBar-actionBtn--done:focus{outline:none}.uppy-StatusBar-actionBtn--done::-moz-focus-inner{border:0}.uppy-StatusBar-actionBtn--done:hover{color:#0e51a0}.uppy-StatusBar-actionBtn--done:focus{background-color:#dfe6f1}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--done:focus{background-color:#333}[data-uppy-theme=dark] .uppy-StatusBar-actionBtn--done{color:#02baf2}.uppy-size--md .uppy-StatusBar-actionBtn--done{font-size:14px}.uppy-StatusBar-serviceMsg{color:#000;font-size:11px;line-height:1.1;padding-left:10px}.uppy-size--md .uppy-StatusBar-serviceMsg{font-size:14px;padding-left:15px}[data-uppy-theme=dark] .uppy-StatusBar-serviceMsg{color:#eaeaea}.uppy-StatusBar-serviceMsg-ghostsIcon{left:6px;opacity:.5;position:relative;top:2px;vertical-align:text-bottom;width:10px}.uppy-size--md .uppy-StatusBar-serviceMsg-ghostsIcon{left:10px;top:1px;width:15px}.uppy-StatusBar-details{appearance:none;background-color:#939393;border-radius:50%;color:#fff;cursor:help;display:inline-block;font-size:10px;font-weight:600;height:13px;inset-inline-start:2px;line-height:12px;position:relative;text-align:center;top:0;vertical-align:middle;width:13px}.uppy-StatusBar-details:after{line-height:1.3;word-wrap:break-word}.uppy-StatusBar-spinner{animation-duration:1s;animation-iteration-count:infinite;animation-name:uppy-StatusBar-spinnerAnimation;animation-timing-function:linear;fill:#1269cf;margin-inline-end:10px}.uppy-StatusBar.is-postprocessing .uppy-StatusBar-spinner,.uppy-StatusBar.is-preprocessing .uppy-StatusBar-spinner{fill:#f6a623}@keyframes uppy-StatusBar-spinnerAnimation{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.uppy-transition-slideDownUp-enter{opacity:.01;transform:translate3d(0,-105%,0);transition:transform .25s ease-in-out,opacity .25s ease-in-out}.uppy-transition-slideDownUp-enter.uppy-transition-slideDownUp-enter-active{opacity:1;transform:translateZ(0)}.uppy-transition-slideDownUp-leave{opacity:1;transform:translateZ(0);transition:transform .25s ease-in-out,opacity .25s ease-in-out}.uppy-transition-slideDownUp-leave.uppy-transition-slideDownUp-leave-active{opacity:.01;transform:translate3d(0,-105%,0)}@keyframes uppy-Dashboard-fadeIn{0%{opacity:0}to{opacity:1}}@keyframes uppy-Dashboard-fadeOut{0%{opacity:1}to{opacity:0}}@keyframes uppy-Dashboard-slideDownAndFadeIn{0%{opacity:0;transform:translate3d(-50%,-70%,0)}to{opacity:1;transform:translate3d(-50%,-50%,0)}}@keyframes uppy-Dashboard-slideDownAndFadeIn--small{0%{opacity:0;transform:translate3d(0,-20%,0)}to{opacity:1;transform:translateZ(0)}}@keyframes uppy-Dashboard-slideUpFadeOut{0%{opacity:1;transform:translate3d(-50%,-50%,0)}to{opacity:0;transform:translate3d(-50%,-70%,0)}}@keyframes uppy-Dashboard-slideUpFadeOut--small{0%{opacity:1;transform:translateZ(0)}to{opacity:0;transform:translate3d(0,-20%,0)}}.uppy-Dashboard--modal{z-index:1001}.uppy-Dashboard--modal[aria-hidden=true]{display:none}.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose>.uppy-Dashboard-inner{animation:uppy-Dashboard-slideDownAndFadeIn--small .3s cubic-bezier(0,0,.2,1)}@media only screen and (min-width:820px){.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose>.uppy-Dashboard-inner{animation:uppy-Dashboard-slideDownAndFadeIn .3s cubic-bezier(0,0,.2,1)}}.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose>.uppy-Dashboard-overlay{animation:uppy-Dashboard-fadeIn .3s cubic-bezier(0,0,.2,1)}.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose.uppy-Dashboard--isClosing>.uppy-Dashboard-inner{animation:uppy-Dashboard-slideUpFadeOut--small .3s cubic-bezier(0,0,.2,1)}@media only screen and (min-width:820px){.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose.uppy-Dashboard--isClosing>.uppy-Dashboard-inner{animation:uppy-Dashboard-slideUpFadeOut .3s cubic-bezier(0,0,.2,1)}}.uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose.uppy-Dashboard--isClosing>.uppy-Dashboard-overlay{animation:uppy-Dashboard-fadeOut .3s cubic-bezier(0,0,.2,1)}.uppy-Dashboard-isFixed{height:100vh;overflow:hidden}.uppy-Dashboard--modal .uppy-Dashboard-overlay{background-color:#00000080;bottom:0;left:0;position:fixed;right:0;top:0;z-index:1001}.uppy-Dashboard-inner{background-color:#f4f4f4;border:1px solid #eaeaea;border-radius:5px;max-height:100%;max-width:100%;outline:none;position:relative}.uppy-size--md .uppy-Dashboard-inner{min-height:auto}@media only screen and (min-width:820px){.uppy-Dashboard-inner{height:500px;width:650px}}.uppy-Dashboard--modal .uppy-Dashboard-inner{z-index:1002}[data-uppy-theme=dark] .uppy-Dashboard-inner{background-color:#1f1f1f}.uppy-Dashboard--isDisabled .uppy-Dashboard-inner{cursor:not-allowed}.uppy-Dashboard-innerWrap{border-radius:5px;display:flex;flex-direction:column;height:100%;opacity:0;overflow:hidden;position:relative}.uppy-Dashboard--isInnerWrapVisible .uppy-Dashboard-innerWrap{opacity:1}.uppy-Dashboard--isDisabled .uppy-Dashboard-innerWrap{cursor:not-allowed;filter:grayscale(100%);opacity:.6;user-select:none}.uppy-Dashboard--isDisabled .uppy-ProviderIconBg{fill:#9f9f9f}.uppy-Dashboard--isDisabled [aria-disabled],.uppy-Dashboard--isDisabled [disabled]{cursor:not-allowed;pointer-events:none}.uppy-Dashboard--modal .uppy-Dashboard-inner{border:none;bottom:15px;left:15px;position:fixed;right:15px;top:35px}@media only screen and (min-width:820px){.uppy-Dashboard--modal .uppy-Dashboard-inner{box-shadow:0 5px 15px 4px #00000026;left:50%;right:auto;top:50%;transform:translate(-50%,-50%)}}.uppy-Dashboard-close{color:#ffffffe6;cursor:pointer;display:block;font-size:27px;inset-inline-end:-2px;position:absolute;top:-33px;z-index:1005}.uppy-Dashboard-close:focus{outline:none}.uppy-Dashboard-close::-moz-focus-inner{border:0}.uppy-Dashboard-close:focus{color:#6eabf2}@media only screen and (min-width:820px){.uppy-Dashboard-close{font-size:35px;inset-inline-end:-35px;top:-10px}}.uppy-Dashboard-serviceMsg{background-color:#fffbf7;border-bottom:1px solid #edd4b9;border-top:1px solid #edd4b9;font-size:12px;font-weight:500;line-height:1.3;padding:12px 0;position:relative;top:-1px;z-index:1004}.uppy-size--md .uppy-Dashboard-serviceMsg{font-size:14px;line-height:1.4}[data-uppy-theme=dark] .uppy-Dashboard-serviceMsg{background-color:#1f1f1f;border-bottom:1px solid #333;border-top:1px solid #333;color:#eaeaea}.uppy-Dashboard-serviceMsg-title{display:block;line-height:1;margin-bottom:4px;padding-left:42px}.uppy-Dashboard-serviceMsg-text{padding:0 15px}.uppy-Dashboard-serviceMsg-actionBtn{color:#1269cf;font-size:inherit;font-weight:inherit;vertical-align:initial}[data-uppy-theme=dark] .uppy-Dashboard-serviceMsg-actionBtn{color:#02baf2e6}.uppy-Dashboard-serviceMsg-icon{left:15px;position:absolute;top:10px}.uppy-Dashboard-AddFiles{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;position:relative;text-align:center}[data-uppy-drag-drop-supported=true] .uppy-Dashboard-AddFiles{border:1px dashed #dfdfdf;border-radius:3px;height:calc(100% - 14px);margin:7px}.uppy-Dashboard-AddFilesPanel .uppy-Dashboard-AddFiles{border:none;height:calc(100% - 54px)}.uppy-Dashboard--modal .uppy-Dashboard-AddFiles{border-color:#cfcfcf}[data-uppy-theme=dark] .uppy-Dashboard-AddFiles{border-color:#757575}.uppy-Dashboard-AddFiles-info{display:none;margin-top:auto;padding-bottom:15px;padding-top:15px}.uppy-size--height-md .uppy-Dashboard-AddFiles-info{display:block}.uppy-size--md .uppy-Dashboard-AddFiles-info{bottom:25px;left:0;padding-bottom:0;padding-top:30px;position:absolute;right:0}[data-uppy-num-acquirers=\"0\"] .uppy-Dashboard-AddFiles-info{margin-top:0}.uppy-Dashboard-browse{color:#1269cf;cursor:pointer}.uppy-Dashboard-browse:focus{outline:none}.uppy-Dashboard-browse::-moz-focus-inner{border:0}.uppy-Dashboard-browse:focus,.uppy-Dashboard-browse:hover{border-bottom:1px solid #1269cf}[data-uppy-theme=dark] .uppy-Dashboard-browse{color:#02baf2e6}[data-uppy-theme=dark] .uppy-Dashboard-browse:focus,[data-uppy-theme=dark] .uppy-Dashboard-browse:hover{border-bottom:1px solid #02baf2}.uppy-Dashboard-browseBtn{display:block;font-size:14px;font-weight:500;margin-bottom:5px;margin-top:8px;width:100%}.uppy-size--md .uppy-Dashboard-browseBtn{font-size:15px;margin:15px auto;padding:13px 44px;width:auto}.uppy-Dashboard-AddFiles-list{display:flex;flex:1;flex-direction:column;margin-top:2px;overflow-y:auto;padding:2px 0;width:100%;-webkit-overflow-scrolling:touch}.uppy-size--md .uppy-Dashboard-AddFiles-list{flex:none;flex-direction:row;flex-wrap:wrap;justify-content:center;margin-top:15px;max-width:600px;overflow-y:visible;padding-top:0}.uppy-DashboardTab{border-bottom:1px solid #eaeaea;text-align:center;width:100%}[data-uppy-theme=dark] .uppy-DashboardTab{border-bottom:1px solid #333}.uppy-size--md .uppy-DashboardTab{border-bottom:none;display:inline-block;margin-bottom:10px;width:auto}.uppy-DashboardTab-btn{align-items:center;-webkit-appearance:none;appearance:none;background-color:initial;color:#525252;cursor:pointer;flex-direction:row;height:100%;justify-content:left;padding:12px 15px;width:100%}.uppy-DashboardTab-btn:focus{outline:none}.uppy-size--md .uppy-DashboardTab-btn{border-radius:5px;flex-direction:column;margin-inline-end:1px;padding:10px 3px;width:86px}[data-uppy-theme=dark] .uppy-DashboardTab-btn{color:#eaeaea}.uppy-DashboardTab-btn::-moz-focus-inner{border:0}.uppy-DashboardTab-btn:hover{background-color:#e9ecef}[data-uppy-theme=dark] .uppy-DashboardTab-btn:hover{background-color:#333}.uppy-DashboardTab-btn:active,.uppy-DashboardTab-btn:focus{background-color:#dfe6f1}[data-uppy-theme=dark] .uppy-DashboardTab-btn:active,[data-uppy-theme=dark] .uppy-DashboardTab-btn:focus{background-color:#525252}.uppy-DashboardTab-btn svg{display:inline-block;max-height:100%;max-width:100%;overflow:hidden;transition:transform .15s ease-in-out;vertical-align:text-top}.uppy-DashboardTab-inner{align-items:center;background-color:#fff;border-radius:8px;box-shadow:0 1px 1px 0 #0000001a,0 1px 2px 0 #0000001a,0 2px 3px 0 #00000005;display:flex;height:32px;justify-content:center;margin-inline-end:10px;width:32px}.uppy-size--md .uppy-DashboardTab-inner{margin-inline-end:0}[data-uppy-theme=dark] .uppy-DashboardTab-inner{background-color:#323232;box-shadow:0 1px 1px 0 #0003,0 1px 2px 0 #0003,0 2px 3px 0 #00000014}.uppy-DashboardTab-name{font-size:14px;font-weight:400}.uppy-size--md .uppy-DashboardTab-name{font-size:12px;line-height:15px;margin-bottom:0;margin-top:8px}.uppy-DashboardTab-iconMyDevice{color:#1269cf}[data-uppy-theme=dark] .uppy-DashboardTab-iconMyDevice{color:#02baf2}.uppy-DashboardTab-iconBox{color:#0061d5}[data-uppy-theme=dark] .uppy-DashboardTab-iconBox{color:#eaeaea}.uppy-DashboardTab-iconDropbox{color:#0061fe}[data-uppy-theme=dark] .uppy-DashboardTab-iconDropbox{color:#eaeaea}.uppy-DashboardTab-iconUnsplash{color:#111}[data-uppy-theme=dark] .uppy-DashboardTab-iconUnsplash{color:#eaeaea}.uppy-DashboardTab-iconWebdav{color:#111}[data-uppy-theme=dark] .uppy-DashboardTab-iconWebdav{color:#eaeaea}.uppy-DashboardTab-iconScreenRec{color:#2c3e50}[data-uppy-theme=dark] .uppy-DashboardTab-iconScreenRec{color:#eaeaea}.uppy-DashboardTab-iconAudio{color:#8030a3}[data-uppy-theme=dark] .uppy-DashboardTab-iconAudio{color:#bf6ee3}.uppy-Dashboard-input{height:.1px;opacity:0;overflow:hidden;position:absolute;width:.1px;z-index:-1}.uppy-DashboardContent-bar{align-items:center;background-color:#fafafa;border-bottom:1px solid #eaeaea;display:flex;flex-shrink:0;height:40px;justify-content:space-between;padding:0 10px;position:relative;width:100%;z-index:1004}.uppy-size--md .uppy-DashboardContent-bar{height:50px;padding:0 15px}[data-uppy-theme=dark] .uppy-DashboardContent-bar{background-color:#1f1f1f;border-bottom:1px solid #333}.uppy-DashboardContent-title{font-size:12px;font-weight:500;left:0;line-height:40px;margin:auto;max-width:170px;overflow-x:hidden;position:absolute;right:0;text-align:center;text-overflow:ellipsis;top:0;white-space:nowrap;width:100%}.uppy-size--md .uppy-DashboardContent-title{font-size:14px;line-height:50px;max-width:300px}[data-uppy-theme=dark] .uppy-DashboardContent-title{color:#eaeaea}.uppy-DashboardContent-back,.uppy-DashboardContent-save{-webkit-appearance:none;background:none;border:0;border-radius:3px;color:inherit;color:#1269cf;cursor:pointer;font-family:inherit;font-size:inherit;font-size:12px;font-weight:400;line-height:1;margin:0;margin-inline-start:-6px;padding:7px 6px}.uppy-DashboardContent-back:focus,.uppy-DashboardContent-save:focus{outline:none}.uppy-DashboardContent-back::-moz-focus-inner,.uppy-DashboardContent-save::-moz-focus-inner{border:0}.uppy-DashboardContent-back:hover,.uppy-DashboardContent-save:hover{color:#0e51a0}.uppy-DashboardContent-back:focus,.uppy-DashboardContent-save:focus{background-color:#dfe6f1}[data-uppy-theme=dark] .uppy-DashboardContent-back:focus,[data-uppy-theme=dark] .uppy-DashboardContent-save:focus{background-color:#333}.uppy-size--md .uppy-DashboardContent-back,.uppy-size--md .uppy-DashboardContent-save{font-size:14px}[data-uppy-theme=dark] .uppy-DashboardContent-back,[data-uppy-theme=dark] .uppy-DashboardContent-save{color:#02baf2}.uppy-DashboardContent-addMore{-webkit-appearance:none;background:none;border:0;border-radius:3px;color:inherit;color:#1269cf;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:500;height:29px;line-height:1;margin:0;margin-inline-end:-5px;padding:7px 8px;width:29px}.uppy-DashboardContent-addMore:focus{outline:none}.uppy-DashboardContent-addMore::-moz-focus-inner{border:0}.uppy-DashboardContent-addMore:hover{color:#0e51a0}.uppy-DashboardContent-addMore:focus{background-color:#dfe6f1}[data-uppy-theme=dark] .uppy-DashboardContent-addMore:focus{background-color:#333}.uppy-size--md .uppy-DashboardContent-addMore{font-size:14px;height:auto;margin-inline-end:-8px;width:auto}[data-uppy-theme=dark] .uppy-DashboardContent-addMore{color:#02baf2}.uppy-DashboardContent-addMore svg{margin-inline-end:4px;vertical-align:initial}.uppy-size--md .uppy-DashboardContent-addMore svg{height:11px;width:11px}.uppy-DashboardContent-addMoreCaption{display:none}.uppy-size--md .uppy-DashboardContent-addMoreCaption{display:inline}.uppy-DashboardContent-panel{background-color:#f5f5f5;flex:1}.uppy-Dashboard-AddFilesPanel,.uppy-DashboardContent-panel{border-radius:5px;bottom:0;display:flex;flex-direction:column;left:0;overflow:hidden;position:absolute;right:0;top:0;z-index:1005}.uppy-Dashboard-AddFilesPanel{background:#fafafa;background:linear-gradient(0deg,#fafafa 35%,#fafafad9);box-shadow:0 0 10px 5px #00000026}[data-uppy-theme=dark] .uppy-Dashboard-AddFilesPanel{background-color:#333;background-image:linear-gradient(0deg,#1f1f1f 35%,#1f1f1fd9)}.uppy-Dashboard--isAddFilesPanelVisible .uppy-Dashboard-files{filter:blur(2px)}.uppy-Dashboard-progress{bottom:0;height:12%;left:0;position:absolute;width:100%}.uppy-Dashboard-progressBarContainer.is-active{height:100%;left:0;position:absolute;top:0;width:100%;z-index:1004}.uppy-Dashboard-filesContainer{flex:1;margin:0;overflow-y:hidden;position:relative}.uppy-Dashboard-filesContainer:after{clear:both;content:\"\";display:table}.uppy-Dashboard-files{flex:1;margin:0;overflow-y:auto;padding:0 0 10px;-webkit-overflow-scrolling:touch}.uppy-size--md .uppy-Dashboard-files{padding-top:10px}.uppy-Dashboard--singleFile .uppy-Dashboard-filesInner{align-items:center;display:flex;height:100%;justify-content:center}.uppy-Dashboard-dropFilesHereHint{align-items:center;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath fill='%231269CF' d='M24 1v1C11.85 2 2 11.85 2 24s9.85 22 22 22 22-9.85 22-22S36.15 2 24 2zm0 0V0c13.254 0 24 10.746 24 24S37.254 48 24 48 0 37.254 0 24 10.746 0 24 0zm7.707 19.293a.999.999 0 1 1-1.414 1.414L25 16.414V34a1 1 0 1 1-2 0V16.414l-5.293 5.293a.999.999 0 1 1-1.414-1.414l7-7a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E\");background-position:50% 50%;background-repeat:no-repeat;border:1px dashed #1269cf;border-radius:3px;bottom:7px;color:#757575;display:flex;font-size:16px;justify-content:center;left:7px;padding-top:90px;position:absolute;right:7px;text-align:center;top:7px;visibility:hidden;z-index:2000}[data-uppy-theme=dark] .uppy-Dashboard-dropFilesHereHint{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath fill='%2302BAF2' d='M24 1v1C11.85 2 2 11.85 2 24s9.85 22 22 22 22-9.85 22-22S36.15 2 24 2zm0 0V0c13.254 0 24 10.746 24 24S37.254 48 24 48 0 37.254 0 24 10.746 0 24 0zm7.707 19.293a.999.999 0 1 1-1.414 1.414L25 16.414V34a1 1 0 1 1-2 0V16.414l-5.293 5.293a.999.999 0 1 1-1.414-1.414l7-7a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E\");border-color:#02baf2;color:#bbb}.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-Dashboard-dropFilesHereHint{pointer-events:none;visibility:visible}.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-Dashboard-files,.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-Dashboard-progressindicators,.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-Dashboard-serviceMsg,.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-DashboardContent-bar{opacity:.15}.uppy-Dashboard.uppy-Dashboard--isDraggingOver .uppy-Dashboard-AddFiles{opacity:.03}.uppy-Dashboard-AddFiles-title{color:#000;font-size:17px;font-weight:500;line-height:1.35;margin-bottom:5px;margin-top:15px;padding:0 15px;text-align:inline-start;width:100%}.uppy-size--md .uppy-Dashboard-AddFiles-title{font-size:21px;font-weight:400;margin-top:5px;max-width:480px;padding:0 35px;text-align:center}[data-uppy-num-acquirers=\"0\"] .uppy-Dashboard-AddFiles-title{text-align:center}[data-uppy-theme=dark] .uppy-Dashboard-AddFiles-title{color:#eaeaea}.uppy-Dashboard-AddFiles-title button{font-weight:500}.uppy-size--md .uppy-Dashboard-AddFiles-title button{font-weight:400}.uppy-Dashboard-note{color:#757575;font-size:14px;line-height:1.25;margin:auto;max-width:350px;padding:0 15px;text-align:center}.uppy-size--md .uppy-Dashboard-note{line-height:1.35;max-width:600px}[data-uppy-theme=dark] .uppy-Dashboard-note{color:#cfcfcf}a.uppy-Dashboard-poweredBy{color:#939393;display:inline-block;font-size:11px;margin-top:8px;text-align:center;text-decoration:none}.uppy-Dashboard-poweredByIcon{margin-left:1px;margin-right:1px;opacity:.9;position:relative;top:1px;vertical-align:text-top;fill:none;stroke:#939393}.uppy-Dashboard-Item-previewIcon{height:25px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:25px;z-index:100}.uppy-size--md .uppy-Dashboard-Item-previewIcon{height:38px;width:38px}.uppy-Dashboard-Item-previewIcon svg{height:100%;width:100%}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-previewIcon{height:100%;max-height:60%;max-width:60%;width:100%}.uppy-Dashboard-Item-previewIconWrap{height:76px;max-height:75%;position:relative}.uppy-Dashboard--singleFile .uppy-Dashboard-Item-previewIconWrap{height:100%;width:100%}.uppy-Dashboard-Item-previewIconBg{filter:drop-shadow(rgba(0,0,0,.1) 0 1px 1px);height:100%;width:100%}.uppy-Dashboard-upload{height:50px;position:relative;width:50px}.uppy-size--md .uppy-Dashboard-upload{height:60px;width:60px}.uppy-Dashboard-upload .uppy-c-icon{position:relative;top:1px;width:50%}.uppy-Dashboard-uploadCount{background-color:#1bb240;border-radius:50%;color:#fff;font-size:8px;height:16px;inset-inline-end:-12px;line-height:16px;position:absolute;top:-12px;width:16px}.uppy-size--md .uppy-Dashboard-uploadCount{font-size:9px;height:18px;line-height:18px;width:18px}.uppy-ImageCropper-range{-webkit-appearance:none;background:#0000;margin:8px 0;width:100%}.uppy-ImageCropper-range::-moz-focus-outer{border:0}.uppy-ImageCropper-range:focus{outline:0}.uppy-ImageCropper-range:focus::-webkit-slider-runnable-track{background:#fff3}.uppy-ImageCropper-range:focus::-ms-fill-lower,.uppy-ImageCropper-range:focus::-ms-fill-upper{background:#fff3}.uppy-ImageCropper-range::-webkit-slider-runnable-track{background:#fff3;border:0 solid #0000;border-radius:5px;box-shadow:0 0 0 #0000,0 0 0 #0d0d0d00;cursor:default;height:4px;transition:all .2s ease;width:100%}.uppy-ImageCropper-range::-webkit-slider-thumb{-webkit-appearance:none;background:#fff;border:0 solid #0000;border-radius:9px;box-shadow:0 0 4px #0003,0 0 0 #0d0d0d33;box-sizing:border-box;cursor:default;height:16px;margin-top:-6px;width:16px}.uppy-ImageCropper-range::-moz-range-track{background:#fff3;border:0 solid #0000;border-radius:5px;box-shadow:0 0 0 #0000,0 0 0 #0d0d0d00;cursor:default;height:2px;transition:all .2s ease;width:100%}.uppy-ImageCropper-range::-moz-range-thumb{background:#fff;border:0 solid #0000;border-radius:9px;box-shadow:0 0 4px #0003,0 0 0 #0d0d0d33;box-sizing:border-box;cursor:default;height:16px;width:16px}.uppy-ImageCropper-range::-ms-track{background:#0000;border-color:#0000;border-width:8px 0;color:#0000;cursor:default;height:4px;transition:all .2s ease;width:100%}.uppy-ImageCropper-range::-ms-fill-lower{background:#f2f2f233;border:0 solid #0000;border-radius:10px;box-shadow:0 0 0 #0000,0 0 0 #0d0d0d00}.uppy-ImageCropper-range::-ms-fill-upper{background:#fff3;border:0 solid #0000;border-radius:10px;box-shadow:0 0 0 #0000,0 0 0 #0d0d0d00}.uppy-ImageCropper-range::-ms-thumb{background:#fff;border:0 solid #0000;border-radius:9px;box-shadow:0 0 4px #0003,0 0 0 #0d0d0d33;box-sizing:border-box;cursor:default;height:16px;margin-top:1px;width:16px}.uppy-ImageCropper-range:disabled::-moz-range-thumb,.uppy-ImageCropper-range:disabled::-ms-fill-lower,.uppy-ImageCropper-range:disabled::-ms-fill-upper,.uppy-ImageCropper-range:disabled::-ms-thumb,.uppy-ImageCropper-range:disabled::-webkit-slider-runnable-track,.uppy-ImageCropper-range:disabled::-webkit-slider-thumb{cursor:not-allowed}.cropper-container{direction:ltr;font-size:0;line-height:0;position:relative;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cropper-container img{display:block;height:100%;image-orientation:0deg;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.cropper-canvas,.cropper-crop-box,.cropper-drag-box,.cropper-modal,.cropper-wrap-box{bottom:0;left:0;position:absolute;right:0;top:0}.cropper-canvas,.cropper-wrap-box{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:.5}.cropper-view-box{display:block;height:100%;outline:1px solid #39f;outline-color:#3399ffbf;overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:33.3333333333%;left:0;top:33.3333333333%;width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:33.3333333333%;top:0;width:33.3333333333%}.cropper-center{display:block;height:0;left:50%;opacity:.75;position:absolute;top:50%;width:0}.cropper-center:after,.cropper-center:before{background-color:#eee;content:\" \";display:block;position:absolute}.cropper-center:before{height:1px;left:-3px;top:0;width:7px}.cropper-center:after{height:7px;left:0;top:-3px;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;right:-3px;top:0;width:5px}.cropper-line.line-n{cursor:ns-resize;height:5px;left:0;top:-3px}.cropper-line.line-w{cursor:ew-resize;left:-3px;top:0;width:5px}.cropper-line.line-s{bottom:-3px;cursor:ns-resize;height:5px;left:0}.cropper-point{background-color:#39f;height:5px;opacity:.75;width:5px}.cropper-point.point-e{cursor:ew-resize;margin-top:-3px;right:-3px;top:50%}.cropper-point.point-n{cursor:ns-resize;left:50%;margin-left:-3px;top:-3px}.cropper-point.point-w{cursor:ew-resize;left:-3px;margin-top:-3px;top:50%}.cropper-point.point-s{bottom:-3px;cursor:s-resize;left:50%;margin-left:-3px}.cropper-point.point-ne{cursor:nesw-resize;right:-3px;top:-3px}.cropper-point.point-nw{cursor:nwse-resize;left:-3px;top:-3px}.cropper-point.point-sw{bottom:-3px;cursor:nesw-resize;left:-3px}.cropper-point.point-se{bottom:-3px;cursor:nwse-resize;height:20px;opacity:1;right:-3px;width:20px}@media (min-width:768px){.cropper-point.point-se{height:15px;width:15px}}@media (min-width:992px){.cropper-point.point-se{height:10px;width:10px}}@media (min-width:1200px){.cropper-point.point-se{height:5px;opacity:.75;width:5px}}.cropper-point.point-se:before{background-color:#39f;bottom:-50%;content:\" \";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC\")}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none!important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed}.uppy-ImageCropper{display:flex;flex-direction:column;height:100%;width:100%}.uppy-ImageCropper-container{flex-grow:1}.uppy-ImageCropper-image{display:block;max-height:400px;max-width:100%}.uppy-ImageCropper-controls{align-items:center;background-color:#0009;border-radius:5px;bottom:15px;color:#fff;display:flex;justify-content:center;left:50%;padding-top:38px;position:absolute;transform:translateX(-50%)}.uppy-size--md .uppy-ImageCropper-controls{padding-top:0}.uppy-ImageCropper-controls button{border-radius:5px;height:35px;width:35px}.uppy-ImageCropper-controls button svg{padding:3px}.uppy-size--md .uppy-ImageCropper-controls button{height:40px;width:40px}.uppy-size--md .uppy-ImageCropper-controls button svg{padding:1px}.uppy-ImageCropper-controls button:hover{background-color:#ffffff80}.uppy-ImageCropper-controls button:focus{background-color:#ffffff80;outline:none}.uppy-Dashboard:not(.uppy-size--md) .uppy-ImageCropper-rangeWrapper{height:38px;left:10px;position:absolute!important;right:10px;top:0}.uppy-size--md .uppy-ImageCropper-range{margin-left:5px;margin-right:5px;width:180px}.uppy-ImageCropper .cropper-point{height:8px;width:8px}.uppy-ImageCropper .cropper-view-box{background:repeating-conic-gradient(#bdbdbd33 0 25%,#fff 0 50%) 50%/16px 16px;outline:2px solid #39f}[data-uppy-theme=dark] .uppy-ImageCropper .cropper-view-box{background:repeating-conic-gradient(#2b2a2a 0 25%,#000 0 50%) 50%/16px 16px}.uppy-ImageCropper .cropper-modal{background-color:#fff;opacity:.9}[data-uppy-theme=dark] .uppy-ImageCropper .cropper-modal{background-color:#000;opacity:.7}.uppy-ImageCropper .cropper-face{opacity:0}.uppy-ImageCropper-range::-moz-range-track{height:4px}.uppy-ImageCropper-range:focus::-webkit-slider-runnable-track,.uppy-ImageCropper-range:hover::-webkit-slider-runnable-track{background:#ffffff80}.uppy-ImageCropper-range:focus::-ms-fill-lower,.uppy-ImageCropper-range:focus::-ms-fill-upper,.uppy-ImageCropper-range:hover::-ms-fill-lower,.uppy-ImageCropper-range:hover::-ms-fill-upper{background:#ffffff80}.uppy-ImageCropper-range:focus::-moz-range-track,.uppy-ImageCropper-range:hover::-moz-range-track{background:#ffffff80}.uppy-Webcam-container{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;width:100%}.uppy-Webcam-videoContainer{background-color:#333;flex:1;flex-grow:1;overflow:hidden;position:relative;text-align:center;width:100%}.uppy-Webcam-video{bottom:0;left:0;margin:auto;max-height:100%;max-width:100%;position:absolute;right:0;top:0}.uppy-Webcam-video--mirrored{transform:scaleX(-1)}.uppy-Webcam-imageContainer{height:100%;position:relative;width:100%}.uppy-Webcam-image{bottom:0;left:0;margin:auto;max-height:100%;max-width:100%;position:absolute;right:0;top:0}.uppy-Webcam-image--mirrored{transform:scaleX(-1)}.uppy-Webcam-footer{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between;min-height:75px;padding:20px;width:100%}.uppy-Webcam-videoSourceContainer{flex-grow:0;width:100%}.uppy-size--lg .uppy-Webcam-videoSourceContainer{margin:0;width:33%}.uppy-Webcam-videoSource-select{background-image:url(\"data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23757575%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E\");background-position:right .4em top 50%,0 0;background-repeat:no-repeat;background-size:.65em auto,100%;border:1px solid #757575;display:block;font-size:16px;line-height:1.2;margin:auto auto 10px;max-width:90%;padding:.4em 1em .3em .4em;text-overflow:ellipsis;white-space:nowrap;width:100%}.uppy-size--lg .uppy-Webcam-videoSource-select{font-size:14px;margin-bottom:0}.uppy-Webcam-videoSource-select::-ms-expand{display:none}.uppy-Webcam-buttonContainer{margin-left:25%;text-align:center;width:50%}.uppy-size--lg .uppy-Webcam-buttonContainer{margin-left:0;width:34%}.uppy-Webcam-recordingLength{color:#757575;flex-grow:0;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;text-align:right;width:25%}.uppy-size--lg .uppy-Webcam-recordingLength{width:33%}.uppy-Webcam-button{background-color:#e32437;border-radius:50%;color:#fff;cursor:pointer;height:45px;transition:all .3s;width:45px}.uppy-Webcam-button:focus{outline:none}.uppy-Webcam-button::-moz-focus-inner{border:0}.uppy-Webcam-button:focus{box-shadow:0 0 0 3px #1269cf80}.uppy-Webcam-button:hover{background-color:#d31b2d}[data-uppy-theme=dark] .uppy-Webcam-button:focus{outline:none}[data-uppy-theme=dark] .uppy-Webcam-button::-moz-focus-inner{border:0}[data-uppy-theme=dark] .uppy-Webcam-button:focus{box-shadow:0 0 0 2px #aae1ffd9}.uppy-Webcam-button--submit{background-color:#1269cf;margin:0 12px}.uppy-Webcam-button--submit:hover{background-color:#105db8}.uppy-Webcam-button svg{display:inline-block;height:30px;max-height:100%;max-width:100%;overflow:hidden;vertical-align:text-top;width:30px;fill:currentColor}.uppy-size--md .uppy-Webcam-button{height:60px;width:60px}.uppy-Webcam-button--picture{margin-right:12px}.uppy-Webcam-permissons{align-items:center;display:flex;flex:1;flex-flow:column wrap;height:100%;justify-content:center;padding:15px}.uppy-Webcam-permissons p{color:#939393;line-height:1.3;line-height:1.45;margin:0;max-width:450px;text-align:center}.uppy-Webcam-permissonsIcon svg{color:#bbb;height:75px;margin-bottom:30px;width:100px}.uppy-Webcam-title{color:#333;font-size:22px;font-weight:400;line-height:1.35;margin:0 0 5px;max-width:500px;padding:0 15px;text-align:center}[data-uppy-theme=dark] .uppy-Webcam-title{color:#eaeaea}.container{aspect-ratio:4 / 3;max-width:var(--max-width);max-height:var(--max-height);height:var(--height);width:var(--width);box-sizing:border-box;padding:0;.uppy-Root,.uppy-Dashboard{height:100%}}";var Yd=n`
773
+ :host {
774
+ display: inline-block;
775
+
776
+ --size: 3rem;
777
+ }
778
+
779
+ .avatar {
780
+ display: inline-flex;
781
+ align-items: center;
782
+ justify-content: center;
783
+ position: relative;
784
+ width: var(--size);
785
+ height: var(--size);
786
+ background-color: var(--sl-color-neutral-400);
787
+ font-family: var(--sl-font-sans);
788
+ font-size: calc(var(--size) * 0.5);
789
+ font-weight: var(--sl-font-weight-normal);
790
+ color: var(--sl-color-neutral-0);
791
+ user-select: none;
792
+ -webkit-user-select: none;
793
+ vertical-align: middle;
794
+ }
795
+
796
+ .avatar--circle,
797
+ .avatar--circle .avatar__image {
798
+ border-radius: var(--sl-border-radius-circle);
799
+ }
800
+
801
+ .avatar--rounded,
802
+ .avatar--rounded .avatar__image {
803
+ border-radius: var(--sl-border-radius-medium);
804
+ }
805
+
806
+ .avatar--square {
807
+ border-radius: 0;
808
+ }
809
+
810
+ .avatar__icon {
811
+ display: flex;
812
+ align-items: center;
813
+ justify-content: center;
814
+ position: absolute;
815
+ top: 0;
816
+ left: 0;
817
+ width: 100%;
818
+ height: 100%;
819
+ }
820
+
821
+ .avatar__initials {
822
+ line-height: 1;
823
+ text-transform: uppercase;
824
+ }
825
+
826
+ .avatar__image {
827
+ position: absolute;
828
+ top: 0;
829
+ left: 0;
830
+ width: 100%;
831
+ height: 100%;
832
+ object-fit: cover;
833
+ overflow: hidden;
834
+ }
835
+ `,Zd=class extends u{constructor(){super(...arguments),this.hasError=!1,this.image="",this.label="",this.initials="",this.loading="eager",this.shape="circle"}handleImageChange(){this.hasError=!1}handleImageLoadError(){this.hasError=!0,this.emit("sl-error")}render(){const e=f`
836
+ <img
837
+ part="image"
838
+ class="avatar__image"
839
+ src="${this.image}"
840
+ loading="${this.loading}"
841
+ alt=""
842
+ @error="${this.handleImageLoadError}"
843
+ />
844
+ `;let t=f``;return t=this.initials?f`<div part="initials" class="avatar__initials">${this.initials}</div>`:f`
845
+ <div part="icon" class="avatar__icon" aria-hidden="true">
846
+ <slot name="icon">
847
+ <sl-icon name="person-fill" library="system"></sl-icon>
848
+ </slot>
849
+ </div>
850
+ `,f`
851
+ <div
852
+ part="base"
853
+ class=${O({avatar:!0,"avatar--circle":"circle"===this.shape,"avatar--rounded":"rounded"===this.shape,"avatar--square":"square"===this.shape})}
854
+ role="img"
855
+ aria-label=${this.label}
856
+ >
857
+ ${this.image&&!this.hasError?e:t}
858
+ </div>
859
+ `}};Zd.styles=[p,Yd],Zd.dependencies={"sl-icon":m},h([b()],Zd.prototype,"hasError",2),h([c()],Zd.prototype,"image",2),h([c()],Zd.prototype,"label",2),h([c()],Zd.prototype,"initials",2),h([c()],Zd.prototype,"loading",2),h([c({reflect:!0})],Zd.prototype,"shape",2),h([y("image")],Zd.prototype,"handleImageChange",1),Zd.define("sl-avatar");const Qd=class{constructor(t){e(this,t),this.logout=r(this,"pod-os:logout",7),this.link=r(this,"pod-os:link",7)}onSelect(e){const{value:t}=e.detail.item;"logout"===t?this.logout.emit():"profile"===t?this.link.emit(this.webId):"dashboard"===t?this.link.emit("pod-os:dashboard"):"settings"===t&&this.link.emit("pod-os:settings")}render(){return this.webId?t("pos-resource",{uri:this.webId},t("sl-dropdown",null,t("button",{slot:"trigger","aria-label":"User menu"},t("pos-picture",{"no-upload":!0},t("sl-avatar",null))),t("sl-menu",null,t("sl-menu-item",{value:"dashboard"},"Dashboard"),t("sl-menu-item",{value:"profile"},t("pos-label",null)),t("sl-menu-item",{value:"settings"},"Settings"),t("sl-divider",null),t("sl-menu-item",{value:"logout"},"Logout")))):null}};Qd.style="button{display:flex;align-items:center;justify-content:center;padding:0;margin:0;border:none;background:none;cursor:pointer;border-radius:50%;pos-picture{--width:40px;--height:40px;--border-radius:50%}sl-avatar{--size:40px}}sl-dropdown{display:block}";export{L as pos_add_new_thing,Gt as pos_app,Xt as pos_app_browser,Zt as pos_app_dashboard,ei as pos_app_settings,ti as pos_description,ii as pos_dialog,fi as pos_error_toast,mi as pos_example_resources,bi as pos_getting_started,yi as pos_image,gi as pos_internal_router,vi as pos_label,wi as pos_login,xi as pos_login_form,Vi as pos_make_findable,qi as pos_navigation,Gi as pos_navigation_bar,Xi as pos_new_thing_form,Yi as pos_picture,Zi as pos_predicate,Qi as pos_resource,er as pos_rich_link,ar as pos_router,nr as pos_select_term,lr as pos_setting_offline_cache,hr as pos_share,ur as pos_tool_select,fr as pos_type_index_entries,vr as pos_type_router,Xd as pos_upload,Qd as pos_user_menu}