@uploadcare/file-uploader 1.3.0-alpha.4 → 1.3.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 (216) hide show
  1. package/README.md +4 -4
  2. package/abstract/ActivityBlock.d.ts +1 -1
  3. package/abstract/ActivityBlock.d.ts.map +1 -1
  4. package/abstract/ActivityBlock.js +0 -2
  5. package/abstract/Block.d.ts +11 -4
  6. package/abstract/Block.d.ts.map +1 -1
  7. package/abstract/Block.js +16 -26
  8. package/abstract/CTX.d.ts +7 -7
  9. package/abstract/CTX.d.ts.map +1 -1
  10. package/abstract/CTX.js +1 -1
  11. package/abstract/LocaleManager.d.ts +3 -3
  12. package/abstract/SecureUploadsManager.d.ts +2 -2
  13. package/abstract/SecureUploadsManager.d.ts.map +1 -1
  14. package/abstract/SolutionBlock.d.ts +2 -2
  15. package/abstract/SolutionBlock.d.ts.map +1 -1
  16. package/abstract/TypedCollection.d.ts +1 -1
  17. package/abstract/TypedCollection.d.ts.map +1 -1
  18. package/abstract/TypedCollection.js +4 -4
  19. package/abstract/TypedData.d.ts +2 -2
  20. package/abstract/TypedData.d.ts.map +1 -1
  21. package/abstract/TypedData.js +4 -4
  22. package/abstract/UploaderBlock.d.ts +5 -5
  23. package/abstract/UploaderBlock.d.ts.map +1 -1
  24. package/abstract/UploaderBlock.js +5 -5
  25. package/abstract/UploaderPublicApi.d.ts +21 -22
  26. package/abstract/UploaderPublicApi.d.ts.map +1 -1
  27. package/abstract/UploaderPublicApi.js +3 -3
  28. package/abstract/ValidationManager.d.ts +3 -3
  29. package/abstract/ValidationManager.d.ts.map +1 -1
  30. package/abstract/a11y.d.ts +2 -2
  31. package/abstract/a11y.d.ts.map +1 -1
  32. package/abstract/buildOutputCollectionState.d.ts +1 -1
  33. package/abstract/buildOutputCollectionState.d.ts.map +1 -1
  34. package/abstract/defineComponents.d.ts.map +1 -1
  35. package/abstract/defineComponents.js +0 -5
  36. package/abstract/l10nProcessor.d.ts.map +1 -1
  37. package/abstract/l10nProcessor.js +3 -3
  38. package/abstract/loadFileUploaderFrom.d.ts.map +1 -1
  39. package/abstract/localeRegistry.d.ts.map +1 -1
  40. package/abstract/sharedConfigKey.d.ts.map +1 -1
  41. package/abstract/uploadEntrySchema.d.ts +2 -2
  42. package/abstract/uploadEntrySchema.d.ts.map +1 -1
  43. package/abstract/uploadEntrySchema.js +1 -1
  44. package/blocks/CameraSource/CameraSource.d.ts.map +1 -1
  45. package/blocks/CameraSource/CameraSource.js +11 -12
  46. package/blocks/CloudImageEditor/src/CloudImageEditorBlock.d.ts.map +1 -1
  47. package/blocks/CloudImageEditor/src/CropFrame.d.ts +11 -11
  48. package/blocks/CloudImageEditor/src/CropFrame.d.ts.map +1 -1
  49. package/blocks/CloudImageEditor/src/CropFrame.js +1 -2
  50. package/blocks/CloudImageEditor/src/EditorButtonControl.d.ts.map +1 -1
  51. package/blocks/CloudImageEditor/src/EditorButtonControl.js +2 -3
  52. package/blocks/CloudImageEditor/src/EditorCropButtonControl.js +1 -1
  53. package/blocks/CloudImageEditor/src/EditorFilterControl.d.ts.map +1 -1
  54. package/blocks/CloudImageEditor/src/EditorFilterControl.js +8 -4
  55. package/blocks/CloudImageEditor/src/EditorImageCropper.d.ts +3 -3
  56. package/blocks/CloudImageEditor/src/EditorImageCropper.js +2 -2
  57. package/blocks/CloudImageEditor/src/EditorImageFader.d.ts +1 -1
  58. package/blocks/CloudImageEditor/src/EditorImageFader.d.ts.map +1 -1
  59. package/blocks/CloudImageEditor/src/EditorOperationControl.js +1 -1
  60. package/blocks/CloudImageEditor/src/EditorScroller.d.ts.map +1 -1
  61. package/blocks/CloudImageEditor/src/EditorScroller.js +1 -2
  62. package/blocks/CloudImageEditor/src/EditorSlider.d.ts.map +1 -1
  63. package/blocks/CloudImageEditor/src/EditorSlider.js +2 -3
  64. package/blocks/CloudImageEditor/src/EditorToolbar.d.ts +1 -1
  65. package/blocks/CloudImageEditor/src/EditorToolbar.d.ts.map +1 -1
  66. package/blocks/CloudImageEditor/src/EditorToolbar.js +14 -15
  67. package/blocks/CloudImageEditor/src/crop-utils.d.ts +14 -14
  68. package/blocks/CloudImageEditor/src/crop-utils.d.ts.map +1 -1
  69. package/blocks/CloudImageEditor/src/css/common.css +2 -2
  70. package/blocks/CloudImageEditor/src/elements/button/BtnUi.d.ts.map +1 -1
  71. package/blocks/CloudImageEditor/src/elements/button/BtnUi.js +5 -5
  72. package/blocks/CloudImageEditor/src/elements/line-loader/LineLoaderUi.d.ts.map +1 -1
  73. package/blocks/CloudImageEditor/src/elements/line-loader/LineLoaderUi.js +1 -2
  74. package/blocks/CloudImageEditor/src/elements/presence-toggle/PresenceToggle.d.ts.map +1 -1
  75. package/blocks/CloudImageEditor/src/elements/presence-toggle/PresenceToggle.js +2 -3
  76. package/blocks/CloudImageEditor/src/elements/slider/SliderUi.d.ts.map +1 -1
  77. package/blocks/CloudImageEditor/src/elements/slider/SliderUi.js +2 -3
  78. package/blocks/CloudImageEditor/src/lib/FocusVisible.d.ts +15 -0
  79. package/blocks/CloudImageEditor/src/lib/FocusVisible.d.ts.map +1 -0
  80. package/blocks/CloudImageEditor/src/lib/FocusVisible.js +33 -0
  81. package/blocks/CloudImageEditor/src/lib/applyFocusVisiblePolyfill.d.ts +10 -0
  82. package/blocks/CloudImageEditor/src/lib/applyFocusVisiblePolyfill.d.ts.map +1 -0
  83. package/blocks/CloudImageEditor/src/lib/applyFocusVisiblePolyfill.js +256 -0
  84. package/blocks/CloudImageEditor/src/lib/parseCropPreset.d.ts +1 -1
  85. package/blocks/CloudImageEditor/src/lib/transformationUtils.d.ts +3 -3
  86. package/blocks/CloudImageEditor/src/lib/transformationUtils.d.ts.map +1 -1
  87. package/blocks/CloudImageEditor/src/state.d.ts +4 -4
  88. package/blocks/CloudImageEditor/src/template.d.ts.map +1 -1
  89. package/blocks/CloudImageEditor/src/template.js +4 -5
  90. package/blocks/CloudImageEditor/src/types.d.ts +2 -2
  91. package/blocks/CloudImageEditor/src/types.d.ts.map +1 -1
  92. package/blocks/CloudImageEditorActivity/CloudImageEditorActivity.d.ts +3 -3
  93. package/blocks/CloudImageEditorActivity/CloudImageEditorActivity.d.ts.map +1 -1
  94. package/blocks/CloudImageEditorActivity/CloudImageEditorActivity.js +1 -2
  95. package/blocks/Config/Config.d.ts +11 -3
  96. package/blocks/Config/Config.d.ts.map +1 -1
  97. package/blocks/Config/initialConfig.d.ts +1 -1
  98. package/blocks/Config/normalizeConfigValue.d.ts.map +1 -1
  99. package/blocks/Copyright/Copyright.d.ts.map +1 -1
  100. package/blocks/Copyright/Copyright.js +1 -2
  101. package/blocks/DropArea/DropArea.d.ts +2 -2
  102. package/blocks/DropArea/DropArea.d.ts.map +1 -1
  103. package/blocks/DropArea/DropArea.js +5 -5
  104. package/blocks/DropArea/addDropzone.d.ts.map +1 -1
  105. package/blocks/DropArea/getDropItems.d.ts +2 -2
  106. package/blocks/DropArea/getDropItems.d.ts.map +1 -1
  107. package/blocks/ExternalSource/ExternalSource.d.ts +5 -5
  108. package/blocks/ExternalSource/ExternalSource.d.ts.map +1 -1
  109. package/blocks/ExternalSource/ExternalSource.js +9 -9
  110. package/blocks/ExternalSource/buildStyles.js +2 -2
  111. package/blocks/ExternalSource/query-string.d.ts.map +1 -1
  112. package/blocks/FileItem/FileItem.d.ts +3 -3
  113. package/blocks/FileItem/FileItem.d.ts.map +1 -1
  114. package/blocks/FileItem/FileItem.js +11 -12
  115. package/blocks/Icon/Icon.d.ts +1 -0
  116. package/blocks/Icon/Icon.d.ts.map +1 -1
  117. package/blocks/Icon/Icon.js +5 -3
  118. package/blocks/Img/ImgBase.js +9 -9
  119. package/blocks/Img/ImgConfig.d.ts +2 -2
  120. package/blocks/Img/ImgConfig.d.ts.map +1 -1
  121. package/blocks/Img/ImgConfig.js +3 -3
  122. package/blocks/Img/utils/parseObjectToString.js +1 -1
  123. package/blocks/Modal/Modal.d.ts.map +1 -1
  124. package/blocks/Modal/Modal.js +1 -2
  125. package/blocks/ProgressBar/ProgressBar.d.ts.map +1 -1
  126. package/blocks/ProgressBar/ProgressBar.js +1 -2
  127. package/blocks/ProgressBarCommon/ProgressBarCommon.d.ts.map +1 -1
  128. package/blocks/ProgressBarCommon/ProgressBarCommon.js +1 -2
  129. package/blocks/Range/Range.d.ts +16 -0
  130. package/blocks/Range/Range.d.ts.map +1 -0
  131. package/blocks/Range/Range.js +44 -0
  132. package/blocks/Range/range.css +65 -0
  133. package/blocks/Select/Select.d.ts.map +1 -1
  134. package/blocks/Select/Select.js +9 -14
  135. package/blocks/SimpleBtn/SimpleBtn.d.ts +2 -2
  136. package/blocks/SimpleBtn/SimpleBtn.d.ts.map +1 -1
  137. package/blocks/SimpleBtn/SimpleBtn.js +3 -4
  138. package/blocks/SourceBtn/SourceBtn.d.ts +2 -2
  139. package/blocks/SourceBtn/SourceBtn.d.ts.map +1 -1
  140. package/blocks/SourceBtn/SourceBtn.js +4 -4
  141. package/blocks/SourceList/SourceList.d.ts.map +1 -1
  142. package/blocks/SourceList/SourceList.js +4 -5
  143. package/blocks/StartFrom/StartFrom.d.ts.map +1 -1
  144. package/blocks/StartFrom/StartFrom.js +1 -2
  145. package/blocks/UploadCtxProvider/EventEmitter.d.ts +19 -19
  146. package/blocks/UploadCtxProvider/EventEmitter.d.ts.map +1 -1
  147. package/blocks/UploadCtxProvider/UploadCtxProvider.d.ts +4 -4
  148. package/blocks/UploadCtxProvider/UploadCtxProvider.d.ts.map +1 -1
  149. package/blocks/UploadList/UploadList.d.ts +2 -2
  150. package/blocks/UploadList/UploadList.d.ts.map +1 -1
  151. package/blocks/UploadList/UploadList.js +11 -10
  152. package/blocks/UrlSource/UrlSource.d.ts.map +1 -1
  153. package/blocks/UrlSource/UrlSource.js +6 -7
  154. package/blocks/themes/uc-basic/index.css +1 -0
  155. package/blocks/utils/debounce.d.ts +1 -3
  156. package/blocks/utils/debounce.d.ts.map +1 -1
  157. package/blocks/utils/throttle.d.ts +1 -3
  158. package/blocks/utils/throttle.d.ts.map +1 -1
  159. package/blocks/utils/userAgent.d.ts +1 -1
  160. package/blocks/utils/userAgent.d.ts.map +1 -1
  161. package/env.d.ts +1 -1
  162. package/env.js +1 -1
  163. package/index.d.ts +1 -1
  164. package/index.js +1 -1
  165. package/index.ssr.d.ts +2 -116
  166. package/index.ssr.d.ts.map +1 -1
  167. package/index.ssr.js +79 -190
  168. package/package.json +8 -10
  169. package/solutions/file-uploader/inline/FileUploaderInline.d.ts +2 -2
  170. package/solutions/file-uploader/inline/FileUploaderInline.d.ts.map +1 -1
  171. package/solutions/file-uploader/inline/FileUploaderInline.js +5 -5
  172. package/solutions/file-uploader/minimal/FileUploaderMinimal.d.ts.map +1 -1
  173. package/solutions/file-uploader/minimal/FileUploaderMinimal.js +1 -2
  174. package/solutions/file-uploader/regular/FileUploaderRegular.d.ts +2 -2
  175. package/solutions/file-uploader/regular/FileUploaderRegular.d.ts.map +1 -1
  176. package/solutions/file-uploader/regular/FileUploaderRegular.js +3 -6
  177. package/types/jsx.d.ts +3 -9
  178. package/utils/getPluralForm.d.ts.map +1 -1
  179. package/utils/isSecureTokenExpired.d.ts +1 -1
  180. package/utils/memoize.d.ts.map +1 -1
  181. package/utils/mixinClass.d.ts +1 -3
  182. package/utils/mixinClass.d.ts.map +1 -1
  183. package/utils/prettyBytes.d.ts.map +1 -1
  184. package/utils/template-utils.d.ts.map +1 -1
  185. package/utils/toKebabCase.d.ts.map +1 -1
  186. package/utils/uniqueArray.d.ts.map +1 -1
  187. package/utils/validators/collection/validateCollectionUploadError.d.ts +1 -1
  188. package/utils/validators/collection/validateMultiple.d.ts +1 -1
  189. package/utils/validators/file/validateFileType.d.ts +1 -1
  190. package/utils/validators/file/validateIsImage.d.ts +1 -1
  191. package/utils/validators/file/validateMaxSizeLimit.d.ts +1 -1
  192. package/utils/validators/file/validateUploadError.d.ts +1 -1
  193. package/utils/waitForAttribute.d.ts +6 -12
  194. package/utils/waitForAttribute.d.ts.map +1 -1
  195. package/utils/waitForAttribute.js +8 -38
  196. package/utils/waitForAttribute.test.js +47 -10
  197. package/web/file-uploader.iife.min.js +4 -4
  198. package/web/file-uploader.min.js +4 -4
  199. package/web/uc-basic.min.css +1 -1
  200. package/web/uc-cloud-image-editor.min.css +1 -1
  201. package/web/uc-cloud-image-editor.min.js +4 -4
  202. package/web/uc-file-uploader-inline.min.css +1 -1
  203. package/web/uc-file-uploader-inline.min.js +4 -4
  204. package/web/uc-file-uploader-minimal.min.js +3 -3
  205. package/web/uc-file-uploader-regular.min.css +1 -1
  206. package/web/uc-file-uploader-regular.min.js +4 -4
  207. package/web/uc-img.min.js +3 -3
  208. package/abstract/bindCompatibilityFallbackProcessor.d.ts +0 -3
  209. package/abstract/bindCompatibilityFallbackProcessor.d.ts.map +0 -1
  210. package/abstract/bindCompatibilityFallbackProcessor.js +0 -16
  211. package/utils/withResolvers.d.ts +0 -7
  212. package/utils/withResolvers.d.ts.map +0 -1
  213. package/utils/withResolvers.js +0 -17
  214. package/utils/withResolvers.test.d.ts +0 -2
  215. package/utils/withResolvers.test.d.ts.map +0 -1
  216. package/utils/withResolvers.test.js +0 -27
@@ -23,6 +23,6 @@
23
23
  * SOFTWARE.
24
24
  *
25
25
  */
26
- var ys=Object.defineProperty;var bs=Object.getPrototypeOf;var _s=Reflect.get;var ws=(i,e,t)=>e in i?ys(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var u=(i,e,t)=>(ws(i,typeof e!="symbol"?e+"":e,t),t),Ge=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var b=(i,e,t)=>(Ge(i,e,"read from private field"),t?t.call(i):e.get(i)),E=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},k=(i,e,t,r)=>(Ge(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t);var O=(i,e,t)=>(Ge(i,e,"access private method"),t),ne=(i,e,t)=>_s(bs(i),t,e);var vs=["Symbiote","BaseComponent","UploaderBlock","ActivityBlock","Block","SolutionBlock"];function Cs(i){for(let e in i){if(vs.includes(e))continue;let t=[...e].reduce((r,s)=>(s.toUpperCase()===s&&(s="-"+s.toLowerCase()),r+=s),"");t.startsWith("-")&&(t=t.replace("-","")),t.startsWith("uc-")||(t="uc-"+t),i[e].reg&&i[e].reg(t)}}var Nt={"locale-id":"en","social-source-lang":"en","upload-file":"Upload file","upload-files":"Upload files","choose-file":"Choose file","choose-files":"Choose files","drop-files-here":"Drop files here","select-file-source":"Select file source",selected:"Selected",upload:"Upload","add-more":"Add more",cancel:"Cancel","start-from-cancel":"Cancel",clear:"Clear","camera-shot":"Shot","upload-url":"Import","upload-url-placeholder":"Paste link here","edit-image":"Edit image","edit-detail":"Details",back:"Back",done:"Done",ok:"Ok","remove-from-list":"Remove",no:"No",yes:"Yes","confirm-your-action":"Confirm your action","are-you-sure":"Are you sure?","selected-count":"Selected:","upload-error":"Upload error","validation-error":"Validation error","no-files":"No files selected",browse:"Browse","not-uploaded-yet":"Not uploaded yet...",file__one:"file",file__other:"files",error__one:"error",error__other:"errors","header-uploading":"Uploading {{count}} {{plural:file(count)}}","header-failed":"{{count}} {{plural:error(count)}}","header-succeed":"{{count}} {{plural:file(count)}} uploaded","header-total":"{{count}} {{plural:file(count)}} selected","src-type-local":"From device","src-type-from-url":"From link","src-type-camera":"Camera","src-type-draw":"Draw","src-type-facebook":"Facebook","src-type-dropbox":"Dropbox","src-type-gdrive":"Google Drive","src-type-gphotos":"Google Photos","src-type-instagram":"Instagram","src-type-flickr":"Flickr","src-type-vk":"VK","src-type-evernote":"Evernote","src-type-box":"Box","src-type-onedrive":"Onedrive","src-type-huddle":"Huddle","src-type-other":"Other","caption-from-url":"Import from link","caption-camera":"Camera","caption-draw":"Draw","caption-edit-file":"Edit file","file-no-name":"No name...","toggle-fullscreen":"Toggle fullscreen","toggle-guides":"Toggle guides",rotate:"Rotate","flip-vertical":"Flip vertical","flip-horizontal":"Flip horizontal",apply:"Apply",brightness:"Brightness",contrast:"Contrast",saturation:"Saturation",exposure:"Exposure",gamma:"Gamma",vibrance:"Vibrance",warmth:"Warmth",enhance:"Enhance",original:"Original",resize:"Resize image",crop:"Crop","select-color":"Select color",text:"Text",draw:"Draw","cancel-edit":"Cancel edit","tab-view":"Preview","tab-details":"Details","file-name":"Name","file-size":"Size","cdn-url":"CDN URL","file-size-unknown":"Unknown","camera-permissions-denied":"Camera access denied","camera-permissions-prompt":"Please allow access to the camera","camera-permissions-request":"Request access","files-count-limit-error-title":"Files count limit overflow","files-count-limit-error-too-few":"You\u2019ve chosen {{total}} {{plural:file(total)}}. At least {{min}} {{plural:file(min)}} required.","files-count-limit-error-too-many":"You\u2019ve chosen too many files. {{max}} {{plural:file(max)}} is maximum.","files-max-size-limit-error":"File is too big. Max file size is {{maxFileSize}}.","has-validation-errors":"File validation error ocurred. Please, check your files before upload.","images-only-accepted":"Only image files are accepted.","file-type-not-allowed":"Uploading of these file types is not allowed.","some-files-were-not-uploaded":"Some files were not uploaded.","file-item-edit-button":"Edit button","file-item-remove-button":"Remove button"};var le=new Map,We=new Map,Fr=(i,e)=>{le.has(i)&&console.log(`Locale ${i} is already defined. Overwriting...`),le.set(i,{...Nt,...e})},As=(i,e)=>{We.set(i,e)},$r=(i,e)=>{typeof e=="function"?As(i,e):Fr(i,e)},Nr=async i=>{if(!le.has(i)){if(!We.has(i))throw new Error(`Locale ${i} is not defined`);let t=await We.get(i)();Fr(i,t)}return le.get(i)};$r("en",Nt);var p=Object.freeze({BIND_ATTR:"bind",ATTR_BIND_PX:"@",SHARED_CTX_PX:"*",PARENT_CTX_PX:"^",NAMED_CTX_SPLTR:"/",COMPUTED_PX:"+",CSS_DATA_PX:"--",CTX_NAME_ATTR:"ctx",CTX_OWNER_ATTR:"ctx-owner",CSS_CTX_PROP:"--ctx",EL_REF_ATTR:"ref",AUTO_TAG_PX:"sym",LIST_ATTR:"itemize",LIST_ITEM_TAG_ATTR:"item-tag",SET_LATER_KEY:"__toSetLater__",USE_TPL_ATTR:"use-template",DEFAULT_SLOT_KEY:"__default__",TEXT_NODE_SKIP_ATTR:"skip-text-nodes",TEXT_NODE_OPEN_TOKEN:"{{",TEXT_NODE_CLOSE_TOKEN:"}}"});function Es(i){let e=t=>{var r;for(let s in t)((r=t[s])==null?void 0:r.constructor)===Object&&(t[s]=e(t[s]));return{...t}};return e(i)}var Ut,Lt,mt,gt,kt,ae,Vr,$=class ${constructor(e){E(this,Ut,void 0);E(this,Lt,void 0);E(this,mt,void 0);e.constructor===Object?this.store=Es(e):(k(this,mt,!0),this.store=e),this.callbackMap=Object.create(null)}read(e){var t,r;if(!b(this,mt)&&!this.store.hasOwnProperty(e))return O(t=$,gt,kt).call(t,"read",e),null;if(typeof e=="string"&&e.startsWith(p.COMPUTED_PX)){let s=this.store[e];if((s==null?void 0:s.constructor)!==Function){O(r=$,gt,kt).call(r,"compute",e);return}this.__computedMap||(this.__computedMap={});let o=s();return Object.keys(this.__computedMap).includes(e)||(this.__computedMap[e]=o,this.notify(e)),o}else return this.store[e]}has(e){return b(this,mt)?this.store[e]!==void 0:this.store.hasOwnProperty(e)}add(e,t,r=!1){!r&&Object.keys(this.store).includes(e)||(this.store[e]=t,this.notify(e))}pub(e,t){var r,s;if(!b(this,mt)&&!this.store.hasOwnProperty(e)){O(r=$,gt,kt).call(r,"publish",e);return}if(e!=null&&e.startsWith(p.COMPUTED_PX)&&t.constructor!==Function){O(s=$,gt,kt).call(s,"publish computed",e);return}!(this.store[e]===null||t===null)&&typeof this.store[e]!=typeof t&&console.warn(`Symbiote PubSub: type warning for "${e}" [${typeof this.store[e]} -> ${typeof t}]`),this.store[e]=t,this.notify(e)}get proxy(){if(!b(this,Lt)){let e=Object.create(null);k(this,Lt,new Proxy(e,{set:(t,r,s)=>(this.pub(r,s),!0),get:(t,r)=>{this.read(r)}}))}return b(this,Lt)}multiPub(e){for(let t in e)this.pub(t,e[t])}notify(e){var r;let t=e==null?void 0:e.startsWith(p.COMPUTED_PX);if(this.callbackMap[e]){let s=this.read(e);this.callbackMap[e].forEach(o=>{o(s)}),t&&(this.__computedMap[e]=s)}!t&&O(r=$,ae,Vr).call(r,this,e)}sub(e,t,r=!0){var s;return!b(this,mt)&&!this.store.hasOwnProperty(e)?(O(s=$,gt,kt).call(s,"subscribe",e),null):(this.callbackMap[e]||(this.callbackMap[e]=new Set),this.callbackMap[e].add(t),r&&t(this.read(e)),{remove:()=>{this.callbackMap[e].delete(t),this.callbackMap[e].size||delete this.callbackMap[e]},callback:t})}set uid(e){!b(this,Ut)&&k(this,Ut,e)}get uid(){return b(this,Ut)}static registerCtx(e,t=Symbol()){let r=$.globalStore.get(t);return r?console.warn('PubSub: context UID "'+t+'" is already in use'):(r=new $(e),r.uid=t,$.globalStore.set(t,r)),r}static deleteCtx(e){$.globalStore.delete(e)}static getCtx(e,t=!0){return $.globalStore.get(e)||(t&&console.warn('PubSub: wrong context UID - "'+e+'"'),null)}};Ut=new WeakMap,Lt=new WeakMap,mt=new WeakMap,gt=new WeakSet,kt=function(e,t){console.warn(`Symbiote PubSub: cannot ${e}. Prop name: `+t)},ae=new WeakSet,Vr=function(e,t){this.globalStore.forEach(r=>{r.__computedMap&&Object.keys(r.__computedMap).forEach(s=>{if(r===e&&t===s)return;let o=`__${s}_timeout`;r[o]&&window.clearTimeout(r[o]),r[o]=window.setTimeout(()=>{let n=r.read(s);n!==r.__computedMap[s]&&(r.__computedMap[s]=n,r.notify(s))})})})},E($,gt),E($,ae);var S=$;S.globalStore=new Map;var ot=S;var zr="1234567890QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm",xs=zr.length-1,nt=class{static generate(e="XXXXXXXXX-XXX"){let t="";for(let r=0;r<e.length;r++)t+=e[r]==="-"?e[r]:zr.charAt(Math.random()*xs);return t}};function Vt(i,e,t){let r=!0,s,o=e.split(".");return o.forEach((n,l)=>{l<o.length-1?i=i[n]:s=n}),i?i[s]=t:r=!1,r}function Ke(i){let e;return i.constructor===CSSStyleSheet?e=i:i.constructor===String&&(e=new CSSStyleSheet,e.replaceSync(i)),e}function jr(i,e){[...i.querySelectorAll(`[${p.LIST_ATTR}]`)].filter(t=>!t.matches(`[${p.LIST_ATTR}] [${p.LIST_ATTR}]`)).forEach(t=>{var n;let r=t.getAttribute(p.LIST_ITEM_TAG_ATTR),s;for(r&&(s=window.customElements.get(r)),s||(s=class extends e.Symbiote{constructor(){super(),r||(this.style.display="contents")}},s.template=((n=t.querySelector("template"))==null?void 0:n.innerHTML)||t.innerHTML,s.reg(r));t.firstChild;)t.firstChild.remove();let o=t.getAttribute(p.LIST_ATTR);e.sub(o,l=>{if(!l){for(;t.firstChild;)t.firstChild.remove();return}let a=[...t.children],c,d=h=>{h.forEach((m,g)=>{if(a[g])if(a[g].set$)a[g].set$(m);else for(let y in m)a[g][y]=m[y];else{c||(c=new DocumentFragment);let y=new s;Object.assign((y==null?void 0:y.init$)||y,m),c.appendChild(y)}}),c&&t.appendChild(c);let f=a.slice(h.length,a.length);for(let m of f)m.remove()};if(l.constructor===Array)d(l);else if(l.constructor===Object){let h=[];for(let f in l){let m=l[f];Object.defineProperty(m,"_KEY_",{value:f,enumerable:!0}),h.push(m)}d(h)}else console.warn("Symbiote list data type error:"),console.log(l)}),t.removeAttribute(p.LIST_ATTR),t.removeAttribute(p.LIST_ITEM_TAG_ATTR)})}function Ts(i,e){[...i.querySelectorAll(`[${p.EL_REF_ATTR}]`)].forEach(t=>{let r=t.getAttribute(p.EL_REF_ATTR);e.ref[r]=t,t.removeAttribute(p.EL_REF_ATTR)})}function Ss(i,e){[...i.querySelectorAll(`[${p.BIND_ATTR}]`)].forEach(t=>{t.getAttribute(p.BIND_ATTR).split(";").forEach(o=>{if(!o)return;let n=o.split(":").map(d=>d.trim()),l=n[0],a;l.indexOf(p.ATTR_BIND_PX)===0&&(a=!0,l=l.replace(p.ATTR_BIND_PX,""));let c=n[1].split(",").map(d=>d.trim());for(let d of c){let h;d.startsWith("!!")?(h="double",d=d.replace("!!","")):d.startsWith("!")&&(h="single",d=d.replace("!","")),!e.has(d)&&e.allowTemplateInits&&(d.startsWith(p.ATTR_BIND_PX)?e.add(d,e.getAttribute(d.replace(p.ATTR_BIND_PX,""))):e.add(d,null)),e.sub(d,f=>{h==="double"?f=!!f:h==="single"&&(f=!f),a?(f==null?void 0:f.constructor)===Boolean?f?t.setAttribute(l,""):t.removeAttribute(l):t.setAttribute(l,f):Vt(t,l,f)||(t[p.SET_LATER_KEY]||(t[p.SET_LATER_KEY]=Object.create(null)),t[p.SET_LATER_KEY][l]=f)},!(e.ssrMode&&(l==="textContent"||a)))}}),t.removeAttribute(p.BIND_ATTR)})}function Os(i){let e,t=[],r=document.createTreeWalker(i,NodeFilter.SHOW_TEXT,{acceptNode:s=>{var o;return!((o=s.parentElement)!=null&&o.hasAttribute(p.TEXT_NODE_SKIP_ATTR))&&s.textContent.includes(p.TEXT_NODE_OPEN_TOKEN)&&s.textContent.includes(p.TEXT_NODE_CLOSE_TOKEN)&&1}});for(;e=r.nextNode();)t.push(e);return t}var Is=function(i,e){Os(i).forEach(r=>{let s=[],o;for(;r.textContent.includes(p.TEXT_NODE_CLOSE_TOKEN);)r.textContent.startsWith(p.TEXT_NODE_OPEN_TOKEN)?(o=r.textContent.indexOf(p.TEXT_NODE_CLOSE_TOKEN)+p.TEXT_NODE_CLOSE_TOKEN.length,r.splitText(o),s.push(r)):(o=r.textContent.indexOf(p.TEXT_NODE_OPEN_TOKEN),r.splitText(o)),r=r.nextSibling;s.forEach(n=>{let l=n.textContent.replace(p.TEXT_NODE_OPEN_TOKEN,"").replace(p.TEXT_NODE_CLOSE_TOKEN,"");n.textContent="",!e.has(l)&&e.allowTemplateInits&&(l.startsWith(p.ATTR_BIND_PX)?(e.add(l,e.getAttribute(l.replace(p.ATTR_BIND_PX,""))),e.initAttributeObserver()):e.add(l,null)),e.sub(l,a=>{n.textContent=a})})})},Br=[jr,Ts,Ss,Is];var ce="'",Mt='"',ks=/\\([0-9a-fA-F]{1,6} ?)/g;function Us(i){return(i[0]===Mt||i[0]===ce)&&(i[i.length-1]===Mt||i[i.length-1]===ce)}function Ls(i){return(i[0]===Mt||i[0]===ce)&&(i=i.slice(1)),(i[i.length-1]===Mt||i[i.length-1]===ce)&&(i=i.slice(0,-1)),i}function Ms(i){let e="",t="";for(var r=0;r<i.length;r++){let s=i[r+1];i[r]==="\\"&&s==='"'?(e+='\\"',r++):i[r]==='"'&&t!=="\\"?e+='\\"':e+=i[r],t=i[r]}return e}function Hr(i){let e=i;Us(i)&&(e=Ls(e),e=e.replace(ks,(t,r)=>String.fromCodePoint(parseInt(r.trim(),16))),e=e.replaceAll(`\\
27
- `,"\\n"),e=Ms(e),e=Mt+e+Mt);try{return JSON.parse(e)}catch{throw new Error(`Failed to parse CSS property value: ${e}. Original input: ${i}`)}}var Ps=[p.LIST_ATTR,p.LIST_ITEM_TAG_ATTR,p.EL_REF_ATTR,p.USE_TPL_ATTR,p.CTX_NAME_ATTR,p.CTX_OWNER_ATTR];function U(i,...e){let t="";return i.forEach((r,s)=>{var o;if(t+=r,((o=e[s])==null?void 0:o.constructor)===Object){let n="";for(let l in e[s])Ps.includes(l)?t+=` ${l}="${e[s][l]}"`:n+=`${l}:${e[s][l]};`;n&&(t+=` ${p.BIND_ATTR}="${n}"`)}else e[s]&&(t+=e[s])}),t}function K(i,...e){let t="",r=new CSSStyleSheet;return i.forEach((s,o)=>{t+=s+e[o]}),K.processors.forEach(s=>{t=s(t)}),K.clearProcessors(),r.replaceSync(t),r}K.processors=[];K.clearProcessors=function(){K.processors=[]};K.useProcessor=function(...i){return K.processors=[...K.processors,...i],K};var Xr=0,zt,Et,jt,yt,Pt,Bt,bt,tt,xt,Tt,L,Ht,Ze,lt,At,ue,Gr,he,Wr,Xt,Ye,de,Kr,Gt,Je,X=class X extends HTMLElement{constructor(){super();E(this,Ht);E(this,ue);E(this,he);E(this,Xt);E(this,de);E(this,Gt);E(this,zt,void 0);E(this,Et,void 0);E(this,jt,void 0);E(this,yt,void 0);E(this,Pt,void 0);E(this,Bt,void 0);E(this,bt,void 0);E(this,tt,void 0);E(this,xt,void 0);E(this,Tt,void 0);E(this,L,this.constructor);u(this,"updateCssData",()=>{var t;this.dropCssDataCache(),(t=b(this,Tt))==null||t.forEach(r=>{let s=this.getCssData(O(this,Gt,Je).call(this,r),!0);s!==null&&this.$[r]!==s&&(this.$[r]=s)})});this.init$=Object.create(null),this.cssInit$=Object.create(null),this.tplProcessors=new Set,this.ref=Object.create(null),this.allSubs=new Set,this.pauseRender=!1,this.renderShadow=!1,this.readyToDestroy=!0,this.processInnerHtml=!1,this.ssrMode=!1,this.allowCustomTemplate=!1,this.ctxOwner=!1,this.isVirtual=!1,this.allowTemplateInits=!0}get Symbiote(){return X}initCallback(){}renderCallback(){}render(t,r=this.renderShadow){let s;if((r||b(this,L).shadowStyleSheets)&&!this.shadowRoot&&this.attachShadow({mode:"open"}),this.allowCustomTemplate){let n=this.getAttribute(p.USE_TPL_ATTR);if(n){let l=this.getRootNode(),a=(l==null?void 0:l.querySelector(n))||document.querySelector(n);a?t=a.content.cloneNode(!0):console.warn(`Symbiote template "${n}" is not found...`)}}if(this.processInnerHtml||this.ssrMode)for(let n of this.tplProcessors)n(this,this);if(t||b(this,L).template){if(b(this,L).template&&!b(this,L).__tpl&&(b(this,L).__tpl=document.createElement("template"),b(this,L).__tpl.innerHTML=b(this,L).template),(t==null?void 0:t.constructor)===DocumentFragment)s=t;else if((t==null?void 0:t.constructor)===String){let n=document.createElement("template");n.innerHTML=t,s=n.content.cloneNode(!0)}else b(this,L).__tpl&&(s=b(this,L).__tpl.content.cloneNode(!0));for(let n of this.tplProcessors)n(s,this)}let o=()=>{var n;s&&this.isVirtual?this.replaceWith(s):s&&(r&&this.shadowRoot.appendChild(s)||this.appendChild(s)),O(this,Ht,Ze).call(this),(n=this.renderCallback)==null||n.call(this)};b(this,L).shadowStyleSheets&&(r=!0,this.shadowRoot.adoptedStyleSheets=[...b(this,L).shadowStyleSheets]),o()}addTemplateProcessor(t){this.tplProcessors.add(t)}get autoCtxName(){return b(this,Et)||(k(this,Et,nt.generate()),this.style.setProperty(p.CSS_CTX_PROP,`'${b(this,Et)}'`)),b(this,Et)}get cssCtxName(){return this.getCssData(p.CSS_CTX_PROP,!0)}get ctxName(){var r;let t=((r=this.getAttribute(p.CTX_NAME_ATTR))==null?void 0:r.trim())||this.cssCtxName||b(this,jt)||this.autoCtxName;return k(this,jt,t),t}get localCtx(){return b(this,yt)||k(this,yt,ot.registerCtx({})),b(this,yt)}get sharedCtx(){return ot.getCtx(this.ctxName,!1)||ot.registerCtx({},this.ctxName)}sub(t,r,s=!0){var l;let o=a=>{b(this,Xt,Ye)||r(a)},n=O(l=X,lt,At).call(l,t,this);n.ctx.has(n.name)?this.allSubs.add(n.ctx.sub(n.name,o,s)):window.setTimeout(()=>{this.allSubs.add(n.ctx.sub(n.name,o,s))})}notify(t){var s;let r=O(s=X,lt,At).call(s,t,this);r.ctx.notify(r.name)}has(t){var s;let r=O(s=X,lt,At).call(s,t,this);return r.ctx.has(r.name)}add(t,r,s=!1){var n;let o=O(n=X,lt,At).call(n,t,this);o.ctx.add(o.name,r,s)}add$(t,r=!1){for(let s in t)this.add(s,t[s],r)}get $(){if(!b(this,Pt)){let t=Object.create(null);k(this,Pt,new Proxy(t,{set:(r,s,o)=>{var l;let n=O(l=X,lt,At).call(l,s,this);return n.ctx.pub(n.name,o),!0},get:(r,s)=>{var n;let o=O(n=X,lt,At).call(n,s,this);return o.ctx.read(o.name)}}))}return b(this,Pt)}set$(t,r=!1){for(let s in t){let o=t[s];r||![String,Number,Boolean].includes(o==null?void 0:o.constructor)?this.$[s]=o:this.$[s]!==o&&(this.$[s]=o)}}initAttributeObserver(){this.attributeMutationObserver||(this.attributeMutationObserver=new MutationObserver(t=>{for(let r of t)if(r.type==="attributes"){let s=p.ATTR_BIND_PX+r.attributeName;this.has(s)&&(this.$[s]=this.getAttribute(r.attributeName))}}),this.attributeMutationObserver.observe(this,{attributes:!0}))}connectedCallback(){O(this,de,Kr).call(this)}destroyCallback(){}disconnectedCallback(){this.connectedOnce&&(this.dropCssDataCache(),this.readyToDestroy&&(b(this,bt)&&window.clearTimeout(b(this,bt)),k(this,bt,window.setTimeout(()=>{this.destroyCallback(),this.attributeMutationObserver&&this.attributeMutationObserver.disconnect();for(let t of this.allSubs)t.remove(),this.allSubs.delete(t);b(this,yt)&&ot.deleteCtx(b(this,yt).uid);for(let t of this.tplProcessors)this.tplProcessors.delete(t)},100))))}static reg(t,r=!1){t||(Xr++,t=`${p.AUTO_TAG_PX}-${Xr}`),this.__tag=t;let s=window.customElements.get(t);if(s){!r&&s!==this&&console.warn([`Element with tag name "${t}" already registered.`,`You're trying to override it with another class "${this.name}".`,"This is most likely a mistake.","New element will not be registered."].join(`
28
- `));return}window.customElements.define(t,r?class extends this{}:this)}static get is(){return this.__tag||this.reg(),this.__tag}static bindAttributes(t){this.observedAttributes=[...new Set((this.observedAttributes||[]).concat(Object.keys(t)))],this.__attrDesc=t}attributeChangedCallback(t,r,s){var n;if(r===s)return;let o=(n=b(this,L).__attrDesc)==null?void 0:n[t];o?b(this,Bt)?this.$[o]=s:this.init$[o]=s:this[t]=s}getCssData(t,r=!1){if(b(this,tt)||k(this,tt,Object.create(null)),!Object.keys(b(this,tt)).includes(t)){b(this,xt)||k(this,xt,window.getComputedStyle(this));let s=b(this,xt).getPropertyValue(t).trim();try{b(this,tt)[t]=Hr(s)}catch{!r&&console.warn(`CSS Data error: ${t}`),b(this,tt)[t]=null}}return b(this,tt)[t]}bindCssData(t,r=""){b(this,Tt)||k(this,Tt,new Set),b(this,Tt).add(t);let s=this.getCssData(O(this,Gt,Je).call(this,t),!0);s===null&&(s=r),t.startsWith(p.CSS_DATA_PX)?this.localCtx.add(t,s):this.add(t,s)}dropCssDataCache(){k(this,tt,null),k(this,xt,null)}defineAccessor(t,r,s){let o="#"+t;this[o]=this[t],Object.defineProperty(this,t,{set:n=>{this[o]=n,s?window.setTimeout(()=>{r==null||r(n)}):r==null||r(n)},get:()=>this[o]}),this[t]=this[o]}static addRootStyles(t){this.rootStyleSheets||(this.rootStyleSheets=[]),this.rootStyleSheets.push(Ke(t))}static addShadowStyles(t){this.shadowStyleSheets||(this.shadowStyleSheets=[]),this.shadowStyleSheets.push(Ke(t))}static set rootStyles(t){this.rootStyleSheets=[],this.addRootStyles(t)}static set shadowStyles(t){this.shadowStyleSheets=[],this.addShadowStyles(t)}};zt=new WeakMap,Et=new WeakMap,jt=new WeakMap,yt=new WeakMap,Pt=new WeakMap,Bt=new WeakMap,bt=new WeakMap,tt=new WeakMap,xt=new WeakMap,Tt=new WeakMap,L=new WeakMap,Ht=new WeakSet,Ze=function(){var t;b(this,zt)||(k(this,zt,!0),(t=this.initCallback)==null||t.call(this))},lt=new WeakSet,At=function(t,r){var n;let s,o;if(t.startsWith(p.SHARED_CTX_PX))s=r.sharedCtx,o=t.replace(p.SHARED_CTX_PX,"");else if(t.startsWith(p.PARENT_CTX_PX)){o=t.replace(p.PARENT_CTX_PX,"");let l=r;for(;l&&!((n=l==null?void 0:l.has)!=null&&n.call(l,o));)l=l.parentElement||l.parentNode||l.host;s=(l==null?void 0:l.localCtx)||r.localCtx}else if(t.includes(p.NAMED_CTX_SPLTR)){let l=t.split(p.NAMED_CTX_SPLTR);s=ot.getCtx(l[0]),o=l[1]}else t.startsWith(p.CSS_DATA_PX)?(s=r.localCtx,o=t,s.has(o)||r.bindCssData(o)):(s=r.localCtx,o=t);return{ctx:s,name:o}},ue=new WeakSet,Gr=function(){return this.ctxOwner||this.hasAttribute(p.CTX_OWNER_ATTR)&&this.getAttribute(p.CTX_OWNER_ATTR)!=="false"},he=new WeakSet,Wr=function(){let t=b(this,L).__attrDesc;if(t)for(let r of Object.values(t))Object.keys(this.init$).includes(r)||(this.init$[r]="");for(let r in this.init$)if(r.startsWith(p.SHARED_CTX_PX))this.sharedCtx.add(r.replace(p.SHARED_CTX_PX,""),this.init$[r],b(this,ue,Gr));else if(r.startsWith(p.ATTR_BIND_PX))this.localCtx.add(r,this.getAttribute(r.replace(p.ATTR_BIND_PX,""))||this.init$[r]),this.initAttributeObserver();else if(r.includes(p.NAMED_CTX_SPLTR)){let s=r.split(p.NAMED_CTX_SPLTR),o=s[0].trim(),n=s[1].trim();if(o&&n){let l=ot.getCtx(o,!1);l||(l=ot.registerCtx({},o)),l.add(n,this.init$[r])}}else this.localCtx.add(r,this.init$[r]);for(let r in this.cssInit$)this.bindCssData(r,this.cssInit$[r]);k(this,Bt,!0)},Xt=new WeakSet,Ye=function(){return!this.isVirtual&&!this.isConnected},de=new WeakSet,Kr=function(){var t;if(!b(this,Xt,Ye)){if(b(this,bt)&&window.clearTimeout(b(this,bt)),!this.connectedOnce){let r=(t=this.getAttribute(p.CTX_NAME_ATTR))==null?void 0:t.trim();if(r&&this.style.setProperty(p.CSS_CTX_PROP,`'${r}'`),O(this,he,Wr).call(this),this[p.SET_LATER_KEY]){for(let s in this[p.SET_LATER_KEY])Vt(this,s,this[p.SET_LATER_KEY][s]);delete this[p.SET_LATER_KEY]}this.initChildren=[...this.childNodes];for(let s of Br)this.addTemplateProcessor(s);if(this.pauseRender)O(this,Ht,Ze).call(this);else{if(b(this,L).rootStyleSheets){let s=this.getRootNode();if(!s)return;let o=new Set([...s.adoptedStyleSheets,...b(this,L).rootStyleSheets]);s.adoptedStyleSheets=[...o]}this.render()}}this.connectedOnce=!0}},Gt=new WeakSet,Je=function(t){return t.split("--").map((r,s)=>s===0?"":r).join("--")},E(X,lt),u(X,"__tpl"),u(X,"template");var qe=X,Qe=qe;function tr(i,e){for(let t in e)t.includes("-")?i.style.setProperty(t,e[t]):i.style[t]=e[t]}function q(i,e){let t,r=(...s)=>{clearTimeout(t),t=setTimeout(()=>i(...s),e)};return r.cancel=()=>{clearTimeout(t)},r}var T=Object.freeze({FILE_ADDED:"file-added",FILE_REMOVED:"file-removed",FILE_UPLOAD_START:"file-upload-start",FILE_UPLOAD_PROGRESS:"file-upload-progress",FILE_UPLOAD_SUCCESS:"file-upload-success",FILE_UPLOAD_FAILED:"file-upload-failed",FILE_URL_CHANGED:"file-url-changed",MODAL_OPEN:"modal-open",MODAL_CLOSE:"modal-close",DONE_CLICK:"done-click",UPLOAD_CLICK:"upload-click",ACTIVITY_CHANGE:"activity-change",COMMON_UPLOAD_START:"common-upload-start",COMMON_UPLOAD_PROGRESS:"common-upload-progress",COMMON_UPLOAD_SUCCESS:"common-upload-success",COMMON_UPLOAD_FAILED:"common-upload-failed",CHANGE:"change",GROUP_CREATED:"group-created"}),fe=class{constructor(e){u(this,"_timeoutStore",new Map);u(this,"_targets",new Set);u(this,"_debugPrint",null);this._debugPrint=e}bindTarget(e){this._targets.add(e)}unbindTarget(e){this._targets.delete(e)}_dispatch(e,t){var r;for(let s of this._targets)s.dispatchEvent(new CustomEvent(e,{detail:t}));(r=this._debugPrint)==null||r.call(this,()=>{let s=t&&typeof t=="object"?{...t}:t;return[`event "${e}"`,s]})}emit(e,t,{debounce:r}={}){if(typeof r!="number"&&!r){this._dispatch(e,typeof t=="function"?t():t);return}this._timeoutStore.has(e)&&window.clearTimeout(this._timeoutStore.get(e));let s=typeof r=="number"?r:20,o=window.setTimeout(()=>{this._dispatch(e,typeof t=="function"?t():t),this._timeoutStore.delete(e)},s);this._timeoutStore.set(e,o)}};function qr(i,e){if(e.shadowRoot)return;let t=[...i.querySelectorAll("slot")];if(!t.length)return;let r={};t.forEach(s=>{let o=s.getAttribute("name")||p.DEFAULT_SLOT_KEY;r[o]={slot:s,fr:document.createDocumentFragment()}}),e.initChildren.forEach(s=>{var n;let o=p.DEFAULT_SLOT_KEY;s instanceof Element&&s.hasAttribute("slot")&&(o=s.getAttribute("slot"),s.removeAttribute("slot")),(n=r[o])==null||n.fr.appendChild(s)}),Object.values(r).forEach(s=>{if(s.fr.childNodes.length)s.slot.parentNode.replaceChild(s.fr,s.slot);else if(s.slot.childNodes.length){let o=document.createDocumentFragment();o.append(...s.slot.childNodes),s.slot.parentNode.replaceChild(o,s.slot)}else s.slot.remove()})}var Rs=i=>{if(typeof i!="string"||!i)return"";let e=i.trim();return e.startsWith("-/")?e=e.slice(2):e.startsWith("/")&&(e=e.slice(1)),e.endsWith("/")&&(e=e.slice(0,e.length-1)),e},er=(...i)=>i.filter(e=>typeof e=="string"&&e).map(e=>Rs(e)).join("/-/"),pe=(...i)=>{let e=er(...i);return e?`-/${e}/`:""};function me(i){let e=new URL(i),t=e.pathname+e.search+e.hash,r=t.lastIndexOf("http"),s=t.lastIndexOf("/"),o="";return r>=0?o=t.slice(r):s>=0&&(o=t.slice(s+1)),o}function Zr(i){let e=new URL(i),{pathname:t}=e,r=t.indexOf("/"),s=t.indexOf("/",r+1);return t.substring(r+1,s)}function Yr(i){let e=Jr(i),t=new URL(e),r=t.pathname.indexOf("/-/");return r===-1?"":t.pathname.substring(r).slice(1)}function Jr(i){let e=new URL(i),t=me(i),r=Qr(t)?ti(t).pathname:t;return e.pathname=e.pathname.replace(r,""),e.search="",e.hash="",e.toString()}function Qr(i){return i.startsWith("http")}function ti(i){let e=new URL(i);return{pathname:e.origin+e.pathname||"",search:e.search||"",hash:e.hash||""}}var ge=(i,e,t)=>{let r=new URL(Jr(i));if(t=t||me(i),r.pathname.startsWith("//")&&(r.pathname=r.pathname.replace("//","/")),Qr(t)){let s=ti(t);r.pathname=r.pathname+(e||"")+(s.pathname||""),r.search=s.search,r.hash=s.hash}else r.pathname=r.pathname+(e||"")+(t||"");return r.toString()},ei=(i,e)=>{let t=new URL(i);return t.pathname=e+"/",t.toString()};var at=(i,e=",")=>i.trim().split(e).map(t=>t.trim()).filter(t=>t.length>0);var et=Object.freeze({brightness:0,exposure:0,gamma:100,contrast:0,saturation:0,vibrance:0,warmth:0,enhance:0,filter:0,rotate:0,mirror:!1,flip:!1,crop:void 0});var Wl=er("format/auto","progressive/yes"),ct=([i])=>typeof i!="undefined"?Number(i):void 0,ri=()=>!0,Ds=([i,e])=>({name:i,amount:typeof e!="undefined"?Number(e):100}),Fs=([i,e])=>{if(!/\d+x\d+/.test(i)||!/\d+,\d+/.test(e))throw new Error("Crop by aspect ratio, percentage or alignment shortcuts is not supported.");return{dimensions:at(i,"x").map(Number),coords:at(e).map(Number)}},Kl=Object.freeze({enhance:ct,brightness:ct,exposure:ct,gamma:ct,contrast:ct,saturation:ct,vibrance:ct,warmth:ct,filter:Ds,mirror:ri,flip:ri,rotate:ct,crop:Fs});var rr=Object.freeze({CROP:"crop",TUNING:"tuning",FILTERS:"filters"}),ii=[rr.CROP,rr.TUNING,rr.FILTERS];var Yl=Object.freeze({brightness:{zero:et.brightness,range:[-100,100],keypointsNumber:2},exposure:{zero:et.exposure,range:[-500,500],keypointsNumber:2},gamma:{zero:et.gamma,range:[0,1e3],keypointsNumber:2},contrast:{zero:et.contrast,range:[-100,500],keypointsNumber:2},saturation:{zero:et.saturation,range:[-100,500],keypointsNumber:1},vibrance:{zero:et.vibrance,range:[-100,500],keypointsNumber:1},warmth:{zero:et.warmth,range:[-100,100],keypointsNumber:1},enhance:{zero:et.enhance,range:[0,100],keypointsNumber:1},filter:{zero:et.filter,range:[0,100],keypointsNumber:1}});var ye=i=>i?i.join(","):"";var $s="https://ucarecdn.com",Ns="https://upload.uploadcare.com",Vs="https://social.uploadcare.com",Z={pubkey:"",multiple:!0,multipleMin:0,multipleMax:Number.MAX_SAFE_INTEGER,confirmUpload:!1,imgOnly:!1,accept:"",externalSourcesPreferredTypes:"",store:"auto",cameraMirror:!1,cameraCapture:"",sourceList:"local, url, camera, dropbox, gdrive",cloudImageEditorTabs:ye(ii),maxLocalFileSizeBytes:0,thumbSize:76,showEmptyList:!1,useLocalImageEditor:!1,useCloudImageEditor:!0,removeCopyright:!1,cropPreset:"",imageShrink:"",modalScrollLock:!0,modalBackdropStrokes:!1,sourceListWrap:!0,remoteTabSessionKey:"",cdnCname:$s,baseUrl:Ns,socialBaseUrl:Vs,secureSignature:"",secureExpire:"",secureDeliveryProxy:"",retryThrottledRequestMaxTimes:1,multipartMinFileSize:26214400,multipartChunkSize:5242880,maxConcurrentRequests:10,multipartMaxConcurrentRequests:4,multipartMaxAttempts:3,checkForUrlDuplicates:!1,saveUrlForRecurrentUploads:!1,groupOutput:!1,userAgentIntegration:"",debug:!1,metadata:null,localeName:"en",localeDefinitionOverride:null,secureUploadsExpireThreshold:10*60*1e3,secureUploadsSignatureResolver:null,secureDeliveryProxyUrlResolver:null,iconHrefResolver:null,fileValidators:[],collectionValidators:[]};var si="--uploadcare-blocks-window-height",St=class{static registerClient(e){this.clientsRegistry.size===0&&this.attachTracker(),this.clientsRegistry.add(e)}static unregisterClient(e){this.clientsRegistry.delete(e),this.clientsRegistry.size===0&&this.detachTracker()}static attachTracker(){window.addEventListener("resize",this.flush,{passive:!0,capture:!0}),this.flush()}static detachTracker(){window.removeEventListener("resize",this.flush,{capture:!0}),document.documentElement.style.removeProperty(si)}};u(St,"clientsRegistry",new Set),u(St,"flush",q(()=>{document.documentElement.style.setProperty(si,`${window.innerHeight}px`)},100));var oi=i=>{var r;let e=new Intl.Locale(i),t="ltr";return typeof e.getTextInfo=="function"&&e.getTextInfo().direction?t=e.getTextInfo().direction:"textInfo"in e&&((r=e.textInfo)!=null&&r.direction)&&(t=e.textInfo.direction),t};var be=(i,e)=>new Intl.PluralRules(i).select(e);var zs=i=>i,ir="{{",li="}}",ni="plural:";function sr(i,e,t={}){var n;let{openToken:r=ir,closeToken:s=li,transform:o=zs}=t;for(let l in e){let a=(n=e[l])==null?void 0:n.toString();i=i.replaceAll(r+l+s,typeof a=="string"?o(a):a)}return i}function ai(i){let e=[],t=i.indexOf(ir);for(;t!==-1;){let r=i.indexOf(li,t),s=i.substring(t+2,r);if(s.startsWith(ni)){let o=i.substring(t+2,r).replace(ni,""),n=o.substring(0,o.indexOf("(")),l=o.substring(o.indexOf("(")+1,o.indexOf(")"));e.push({variable:s,pluralKey:n,countVariable:l})}t=i.indexOf(ir,r)}return e}function ci(){let i,e,t=new Promise((r,s)=>{i=r,e=s});return{resolve:i,reject:e,promise:t}}var ui=async({element:i,attribute:e,timeout:t=300})=>{let{promise:r,resolve:s}=ci(),o=i.getAttribute(e);if(o!==null)return s({success:!0,value:o,attribute:e}),r;let n=new MutationObserver(c=>{let d=c[c.length-1];a(d)});n.observe(i,{attributes:!0,attributeFilter:[e]});let l=setTimeout(()=>{n.disconnect(),s({success:!1,attribute:e})},t),a=c=>{let d=i.getAttribute(e);c.type==="attributes"&&c.attributeName===e&&d!==null&&(clearTimeout(l),n.disconnect(),s({success:!0,value:d,attribute:e}))};return r};function hi(i){return Object.prototype.toString.call(i)==="[object Object]"}var js=/\W|_/g;function Bs(i){return i.split(js).map((e,t)=>e.charAt(0)[t>0?"toUpperCase":"toLowerCase"]()+e.slice(1)).join("")}function di(i,{ignoreKeys:e}={ignoreKeys:[]}){return Array.isArray(i)?i.map(t=>dt(t,{ignoreKeys:e})):i}function dt(i,{ignoreKeys:e}={ignoreKeys:[]}){if(Array.isArray(i))return di(i,{ignoreKeys:e});if(!hi(i))return i;let t={};for(let r of Object.keys(i)){let s=i[r];if(e.includes(r)){t[r]=s;continue}hi(s)?s=dt(s,{ignoreKeys:e}):Array.isArray(s)&&(s=di(s,{ignoreKeys:e})),t[Bs(r)]=s}return t}var Hs=i=>new Promise(e=>setTimeout(e,i));function hr({libraryName:i,libraryVersion:e,userAgent:t,publicKey:r="",integration:s=""}){let o="JavaScript";if(typeof t=="string")return t;if(typeof t=="function")return t({publicKey:r,libraryName:i,libraryVersion:e,languageName:o,integration:s});let n=[i,e,r].filter(Boolean).join("/"),l=[o,s].filter(Boolean).join("; ");return`${n} (${l})`}var Xs={factor:2,time:100};function Gs(i,e=Xs){let t=0;function r(s){let o=Math.round(e.time*e.factor**t);return s({attempt:t,retry:l=>Hs(l!=null?l:o).then(()=>(t+=1,r(s)))})}return r(i)}var Wt=class extends Error{},Rt=class i extends Wt{constructor(t){super();u(this,"originalProgressEvent");this.name="NetworkError",this.message="Network error",Object.setPrototypeOf(this,i.prototype),this.originalProgressEvent=t}},we=(i,e)=>{i&&(i.aborted?Promise.resolve().then(e):i.addEventListener("abort",()=>e(),{once:!0}))},_t=class i extends Wt{constructor(t="Request canceled"){super(t);u(this,"isCancel",!0);this.name="CancelError",Object.setPrototypeOf(this,i.prototype)}},Ws=500,pi=({check:i,interval:e=Ws,timeout:t,signal:r})=>new Promise((s,o)=>{let n,l;we(r,()=>{n&&clearTimeout(n),o(new _t("Poll cancelled"))}),t&&(l=setTimeout(()=>{n&&clearTimeout(n),o(new _t("Timed out"))},t));let a=()=>{try{Promise.resolve(i(r)).then(c=>{c?(l&&clearTimeout(l),s(c)):n=setTimeout(a,e)}).catch(c=>{l&&clearTimeout(l),o(c)})}catch(c){l&&clearTimeout(l),o(c)}};n=setTimeout(a,0)}),v={baseCDN:"https://ucarecdn.com",baseURL:"https://upload.uploadcare.com",maxContentLength:50*1024*1024,retryThrottledRequestMaxTimes:1,retryNetworkErrorMaxTimes:3,multipartMinFileSize:25*1024*1024,multipartChunkSize:5*1024*1024,multipartMinLastPartSize:1024*1024,maxConcurrentRequests:4,pollingTimeoutMilliseconds:1e4,pusherKey:"79ae88bd931ea68464d9"},ve="application/octet-stream",mi="original",wt=({method:i,url:e,data:t,headers:r={},signal:s,onProgress:o})=>new Promise((n,l)=>{let a=new XMLHttpRequest,c=(i==null?void 0:i.toUpperCase())||"GET",d=!1;a.open(c,e,!0),r&&Object.entries(r).forEach(h=>{let[f,m]=h;typeof m!="undefined"&&!Array.isArray(m)&&a.setRequestHeader(f,m)}),a.responseType="text",we(s,()=>{d=!0,a.abort(),l(new _t)}),a.onload=()=>{if(a.status!=200)l(new Error(`Error ${a.status}: ${a.statusText}`));else{let h={method:c,url:e,data:t,headers:r||void 0,signal:s,onProgress:o},f=a.getAllResponseHeaders().trim().split(/[\r\n]+/),m={};f.forEach(function(C){let A=C.split(": "),w=A.shift(),_=A.join(": ");w&&typeof w!="undefined"&&(m[w]=_)});let g=a.response,y=a.status;n({request:h,data:g,headers:m,status:y})}},a.onerror=h=>{d||l(new Rt(h))},o&&typeof o=="function"&&(a.upload.onprogress=h=>{h.lengthComputable?o({isComputable:!0,value:h.loaded/h.total}):o({isComputable:!1})}),t?a.send(t):a.send()});function Ks(i,...e){return i}var qs=({name:i})=>i?[i]:[],Zs=Ks,Ys=()=>new FormData,gi=i=>!1,Ce=i=>typeof Blob!="undefined"&&i instanceof Blob,Ae=i=>typeof File!="undefined"&&i instanceof File,Ee=i=>!!i&&typeof i=="object"&&!Array.isArray(i)&&"uri"in i&&typeof i.uri=="string",Dt=i=>Ce(i)||Ae(i)||gi()||Ee(i),Js=i=>typeof i=="string"||typeof i=="number"||typeof i=="undefined",Qs=i=>!!i&&typeof i=="object"&&!Array.isArray(i),to=i=>!!i&&typeof i=="object"&&"data"in i&&Dt(i.data);function yi(i,e,t){if(Array.isArray(t))for(let r of t)yi(i,`${e}[]`,r);else if(to(t)){let{name:r,contentType:s}=t,o=Zs(t.data,r,s!=null?s:ve),n=qs({name:r,contentType:s});i.push([e,o,...n])}else if(Qs(t))for(let[r,s]of Object.entries(t))typeof s!="undefined"&&i.push([`${e}[${r}]`,String(s)]);else Js(t)&&t&&i.push([e,t.toString()])}function eo(i){let e=[];for(let[t,r]of Object.entries(i))yi(e,t,r);return e}function xe(i){let e=Ys(),t=eo(i);for(let r of t){let[s,o,...n]=r;e.append(s,o,...n)}return e}var N=class i extends Wt{constructor(t,r,s,o,n){super();u(this,"code");u(this,"request");u(this,"response");u(this,"headers");this.name="UploadError",this.message=t,this.code=r,this.request=s,this.response=o,this.headers=n,Object.setPrototypeOf(this,i.prototype)}},ro=i=>{let e=new URLSearchParams;for(let[t,r]of Object.entries(i))r&&typeof r=="object"&&!Array.isArray(r)?Object.entries(r).filter(s=>{var o;return(o=s[1])!=null?o:!1}).forEach(s=>e.set(`${t}[${s[0]}]`,String(s[1]))):Array.isArray(r)?r.forEach(s=>{e.append(`${t}[]`,s)}):typeof r=="string"&&r?e.set(t,r):typeof r=="number"&&e.set(t,r.toString());return e.toString()},ut=(i,e,t)=>{let r=new URL(i);return r.pathname=(r.pathname+e).replace("//","/"),t&&(r.search=ro(t)),r.toString()},io="6.14.1",so="UploadcareUploadClient",oo=io;function Ot(i){return hr({libraryName:so,libraryVersion:oo,...i})}var no="RequestThrottledError",fi=15e3,lo=1e3;function ao(i){let{headers:e}=i||{};if(!e||typeof e["retry-after"]!="string")return fi;let t=parseInt(e["retry-after"],10);return Number.isFinite(t)?t*1e3:fi}function vt(i,e){let{retryThrottledRequestMaxTimes:t,retryNetworkErrorMaxTimes:r}=e;return Gs(({attempt:s,retry:o})=>i().catch(n=>{if("response"in n&&(n==null?void 0:n.code)===no&&s<t)return o(ao(n));if(n instanceof Rt&&s<r)return o((s+1)*lo);throw n}))}var bi=i=>{let e="";return(Ce(i)||Ae(i)||Ee(i))&&(e=i.type),e||ve},_i=i=>{let e="";return Ae(i)&&i.name?e=i.name:Ce(i)||gi()?e="":Ee(i)&&i.name&&(e=i.name),e||mi};function dr(i){return typeof i=="undefined"||i==="auto"?"auto":i?"1":"0"}function co(i,{publicKey:e,fileName:t,contentType:r,baseURL:s=v.baseURL,secureSignature:o,secureExpire:n,store:l,signal:a,onProgress:c,source:d="local",integration:h,userAgent:f,retryThrottledRequestMaxTimes:m=v.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:g=v.retryNetworkErrorMaxTimes,metadata:y}){return vt(()=>wt({method:"POST",url:ut(s,"/base/",{jsonerrors:1}),headers:{"X-UC-User-Agent":Ot({publicKey:e,integration:h,userAgent:f})},data:xe({signature:o,expire:n,file:{data:i,name:t||_i(i),contentType:r||bi(i)},UPLOADCARE_PUB_KEY:e,UPLOADCARE_STORE:dr(l),source:d,metadata:y}),signal:a,onProgress:c}).then(({data:C,headers:A,request:w})=>{let _=dt(JSON.parse(C));if("error"in _)throw new N(_.error.content,_.error.errorCode,w,_,A);return _}),{retryNetworkErrorMaxTimes:g,retryThrottledRequestMaxTimes:m})}var lr;(function(i){i.Token="token",i.FileInfo="file_info"})(lr||(lr={}));function uo(i,{publicKey:e,baseURL:t=v.baseURL,store:r,fileName:s,checkForUrlDuplicates:o,saveUrlForRecurrentUploads:n,secureSignature:l,secureExpire:a,source:c="url",signal:d,integration:h,userAgent:f,retryThrottledRequestMaxTimes:m=v.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:g=v.retryNetworkErrorMaxTimes,metadata:y}){return vt(()=>wt({method:"POST",headers:{"X-UC-User-Agent":Ot({publicKey:e,integration:h,userAgent:f})},url:ut(t,"/from_url/",{jsonerrors:1,pub_key:e,source_url:i,store:dr(r),filename:s,check_URL_duplicates:o?1:void 0,save_URL_duplicates:n?1:void 0,signature:l,expire:a,source:c,metadata:y}),signal:d}).then(({data:C,headers:A,request:w})=>{let _=dt(JSON.parse(C));if("error"in _)throw new N(_.error.content,_.error.errorCode,w,_,A);return _}),{retryNetworkErrorMaxTimes:g,retryThrottledRequestMaxTimes:m})}var j;(function(i){i.Unknown="unknown",i.Waiting="waiting",i.Progress="progress",i.Error="error",i.Success="success"})(j||(j={}));var ho=i=>"status"in i&&i.status===j.Error;function fo(i,{publicKey:e,baseURL:t=v.baseURL,signal:r,integration:s,userAgent:o,retryThrottledRequestMaxTimes:n=v.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:l=v.retryNetworkErrorMaxTimes}={}){return vt(()=>wt({method:"GET",headers:e?{"X-UC-User-Agent":Ot({publicKey:e,integration:s,userAgent:o})}:void 0,url:ut(t,"/from_url/status/",{jsonerrors:1,token:i}),signal:r}).then(({data:a,headers:c,request:d})=>{let h=dt(JSON.parse(a));if("error"in h&&!ho(h))throw new N(h.error.content,h.error.errorCode,d,h,c);return h}),{retryNetworkErrorMaxTimes:l,retryThrottledRequestMaxTimes:n})}function po(i,{publicKey:e,baseURL:t=v.baseURL,jsonpCallback:r,secureSignature:s,secureExpire:o,signal:n,source:l,integration:a,userAgent:c,retryThrottledRequestMaxTimes:d=v.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:h=v.retryNetworkErrorMaxTimes}){return vt(()=>wt({method:"POST",headers:{"X-UC-User-Agent":Ot({publicKey:e,integration:a,userAgent:c})},url:ut(t,"/group/",{jsonerrors:1}),data:xe({files:i,callback:r,pub_key:e,signature:s,expire:o,source:l}),signal:n}).then(({data:f,headers:m,request:g})=>{let y=dt(JSON.parse(f));if("error"in y)throw new N(y.error.content,y.error.errorCode,g,y,m);return y}),{retryNetworkErrorMaxTimes:h,retryThrottledRequestMaxTimes:d})}function wi(i,{publicKey:e,baseURL:t=v.baseURL,signal:r,source:s,integration:o,userAgent:n,retryThrottledRequestMaxTimes:l=v.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:a=v.retryNetworkErrorMaxTimes}){return vt(()=>wt({method:"GET",headers:{"X-UC-User-Agent":Ot({publicKey:e,integration:o,userAgent:n})},url:ut(t,"/info/",{jsonerrors:1,pub_key:e,file_id:i,source:s}),signal:r}).then(({data:c,headers:d,request:h})=>{let f=dt(JSON.parse(c));if("error"in f)throw new N(f.error.content,f.error.errorCode,h,f,d);return f}),{retryThrottledRequestMaxTimes:l,retryNetworkErrorMaxTimes:a})}function mo(i,{publicKey:e,contentType:t,fileName:r,multipartChunkSize:s=v.multipartChunkSize,baseURL:o="",secureSignature:n,secureExpire:l,store:a,signal:c,source:d="local",integration:h,userAgent:f,retryThrottledRequestMaxTimes:m=v.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:g=v.retryNetworkErrorMaxTimes,metadata:y}){return vt(()=>wt({method:"POST",url:ut(o,"/multipart/start/",{jsonerrors:1}),headers:{"X-UC-User-Agent":Ot({publicKey:e,integration:h,userAgent:f})},data:xe({filename:r||mi,size:i,content_type:t||ve,part_size:s,UPLOADCARE_STORE:dr(a),UPLOADCARE_PUB_KEY:e,signature:n,expire:l,source:d,metadata:y}),signal:c}).then(({data:C,headers:A,request:w})=>{let _=dt(JSON.parse(C));if("error"in _)throw new N(_.error.content,_.error.errorCode,w,_,A);return _.parts=Object.keys(_.parts).map(M=>_.parts[Number(M)]),_}),{retryThrottledRequestMaxTimes:m,retryNetworkErrorMaxTimes:g})}function go(i,e,{contentType:t,signal:r,onProgress:s,retryThrottledRequestMaxTimes:o=v.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:n=v.retryNetworkErrorMaxTimes}){return vt(()=>wt({method:"PUT",url:e,data:i,onProgress:s,signal:r,headers:{"Content-Type":t||ve}}).then(l=>(s&&s({isComputable:!0,value:1}),l)).then(({status:l})=>({code:l})),{retryThrottledRequestMaxTimes:o,retryNetworkErrorMaxTimes:n})}function yo(i,{publicKey:e,baseURL:t=v.baseURL,source:r="local",signal:s,integration:o,userAgent:n,retryThrottledRequestMaxTimes:l=v.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:a=v.retryNetworkErrorMaxTimes}){return vt(()=>wt({method:"POST",url:ut(t,"/multipart/complete/",{jsonerrors:1}),headers:{"X-UC-User-Agent":Ot({publicKey:e,integration:o,userAgent:n})},data:xe({uuid:i,UPLOADCARE_PUB_KEY:e,source:r}),signal:s}).then(({data:c,headers:d,request:h})=>{let f=dt(JSON.parse(c));if("error"in f)throw new N(f.error.content,f.error.errorCode,h,f,d);return f}),{retryThrottledRequestMaxTimes:l,retryNetworkErrorMaxTimes:a})}function fr(i,{publicKey:e,baseURL:t,source:r,integration:s,userAgent:o,retryThrottledRequestMaxTimes:n,retryNetworkErrorMaxTimes:l,signal:a,onProgress:c}){return pi({check:d=>wi(i,{publicKey:e,baseURL:t,signal:d,source:r,integration:s,userAgent:o,retryThrottledRequestMaxTimes:n,retryNetworkErrorMaxTimes:l}).then(h=>h.isReady?h:(c&&c({isComputable:!0,value:1}),!1)),signal:a})}function bo(i){return"defaultEffects"in i}var ht=class{constructor(e,{baseCDN:t=v.baseCDN,fileName:r}={}){u(this,"uuid");u(this,"name",null);u(this,"size",null);u(this,"isStored",null);u(this,"isImage",null);u(this,"mimeType",null);u(this,"cdnUrl",null);u(this,"s3Url",null);u(this,"originalFilename",null);u(this,"imageInfo",null);u(this,"videoInfo",null);u(this,"contentInfo",null);u(this,"metadata",null);u(this,"s3Bucket",null);u(this,"defaultEffects",null);let{uuid:s,s3Bucket:o}=e,n=ut(t,`${s}/`),l=o?ut(`https://${o}.s3.amazonaws.com/`,`${s}/${e.filename}`):null;this.uuid=s,this.name=r||e.filename,this.size=e.size,this.isStored=e.isStored,this.isImage=e.isImage,this.mimeType=e.mimeType,this.cdnUrl=n,this.originalFilename=e.originalFilename,this.imageInfo=e.imageInfo,this.videoInfo=e.videoInfo,this.contentInfo=e.contentInfo,this.metadata=e.metadata||null,this.s3Bucket=o||null,this.s3Url=l,bo(e)&&(this.defaultEffects=e.defaultEffects)}},_o=(i,{publicKey:e,fileName:t,baseURL:r,secureSignature:s,secureExpire:o,store:n,contentType:l,signal:a,onProgress:c,source:d,integration:h,userAgent:f,retryThrottledRequestMaxTimes:m,retryNetworkErrorMaxTimes:g,baseCDN:y,metadata:C})=>co(i,{publicKey:e,fileName:t,contentType:l,baseURL:r,secureSignature:s,secureExpire:o,store:n,signal:a,onProgress:c,source:d,integration:h,userAgent:f,retryThrottledRequestMaxTimes:m,retryNetworkErrorMaxTimes:g,metadata:C}).then(({file:A})=>fr(A,{publicKey:e,baseURL:r,source:d,integration:h,userAgent:f,retryThrottledRequestMaxTimes:m,retryNetworkErrorMaxTimes:g,onProgress:c,signal:a})).then(A=>new ht(A,{baseCDN:y})),wo=(i,{publicKey:e,fileName:t,baseURL:r,signal:s,onProgress:o,source:n,integration:l,userAgent:a,retryThrottledRequestMaxTimes:c,retryNetworkErrorMaxTimes:d,baseCDN:h})=>wi(i,{publicKey:e,baseURL:r,signal:s,source:n,integration:l,userAgent:a,retryThrottledRequestMaxTimes:c,retryNetworkErrorMaxTimes:d}).then(f=>new ht(f,{baseCDN:h,fileName:t})).then(f=>(o&&o({isComputable:!0,value:1}),f)),vo=(i,{signal:e}={})=>{let t=null,r=null,s=i.map(()=>new AbortController),o=n=>()=>{r=n,s.forEach((l,a)=>a!==n&&l.abort())};return we(e,()=>{s.forEach(n=>n.abort())}),Promise.all(i.map((n,l)=>{let a=o(l);return Promise.resolve().then(()=>n({stopRace:a,signal:s[l].signal})).then(c=>(a(),c)).catch(c=>(t=c,null))})).then(n=>{if(r===null)throw t;return n[r]})},Co=window.WebSocket,ar=class{constructor(){u(this,"events",Object.create({}))}emit(e,t){var r;(r=this.events[e])==null||r.forEach(s=>s(t))}on(e,t){this.events[e]=this.events[e]||[],this.events[e].push(t)}off(e,t){t?this.events[e]=this.events[e].filter(r=>r!==t):this.events[e]=[]}},Ao=(i,e)=>i==="success"?{status:j.Success,...e}:i==="progress"?{status:j.Progress,...e}:{status:j.Error,...e},cr=class{constructor(e,t=3e4){u(this,"key");u(this,"disconnectTime");u(this,"ws");u(this,"queue",[]);u(this,"isConnected",!1);u(this,"subscribers",0);u(this,"emmitter",new ar);u(this,"disconnectTimeoutId",null);this.key=e,this.disconnectTime=t}connect(){if(this.disconnectTimeoutId&&clearTimeout(this.disconnectTimeoutId),!this.isConnected&&!this.ws){let e=`wss://ws.pusherapp.com/app/${this.key}?protocol=5&client=js&version=1.12.2`;this.ws=new Co(e),this.ws.addEventListener("error",t=>{this.emmitter.emit("error",new Error(t.message))}),this.emmitter.on("connected",()=>{this.isConnected=!0,this.queue.forEach(t=>this.send(t.event,t.data)),this.queue=[]}),this.ws.addEventListener("message",t=>{let r=JSON.parse(t.data.toString());switch(r.event){case"pusher:connection_established":{this.emmitter.emit("connected",void 0);break}case"pusher:ping":{this.send("pusher:pong",{});break}case"progress":case"success":case"fail":this.emmitter.emit(r.channel,Ao(r.event,JSON.parse(r.data)))}})}}disconnect(){let e=()=>{var t;(t=this.ws)==null||t.close(),this.ws=void 0,this.isConnected=!1};this.disconnectTime?this.disconnectTimeoutId=setTimeout(()=>{e()},this.disconnectTime):e()}send(e,t){var s;let r=JSON.stringify({event:e,data:t});(s=this.ws)==null||s.send(r)}subscribe(e,t){this.subscribers+=1,this.connect();let r=`task-status-${e}`,s={event:"pusher:subscribe",data:{channel:r}};this.emmitter.on(r,t),this.isConnected?this.send(s.event,s.data):this.queue.push(s)}unsubscribe(e){this.subscribers-=1;let t=`task-status-${e}`,r={event:"pusher:unsubscribe",data:{channel:t}};this.emmitter.off(t),this.isConnected?this.send(r.event,r.data):this.queue=this.queue.filter(s=>s.data.channel!==t),this.subscribers===0&&this.disconnect()}onError(e){return this.emmitter.on("error",e),()=>this.emmitter.off("error",e)}},or=null,pr=i=>{if(!or){let e=typeof window=="undefined"?0:3e4;or=new cr(i,e)}return or},Eo=i=>{pr(i).connect()};function xo({token:i,publicKey:e,baseURL:t,integration:r,userAgent:s,retryThrottledRequestMaxTimes:o,retryNetworkErrorMaxTimes:n,onProgress:l,signal:a}){return pi({check:c=>fo(i,{publicKey:e,baseURL:t,integration:r,userAgent:s,retryThrottledRequestMaxTimes:o,retryNetworkErrorMaxTimes:n,signal:c}).then(d=>{switch(d.status){case j.Error:return new N(d.error,d.errorCode);case j.Waiting:return!1;case j.Unknown:return new N(`Token "${i}" was not found.`);case j.Progress:return l&&(d.total==="unknown"?l({isComputable:!1}):l({isComputable:!0,value:d.done/d.total})),!1;case j.Success:return l&&l({isComputable:!0,value:d.done/d.total}),d;default:throw new Error("Unknown status")}}),signal:a})}var To=({token:i,pusherKey:e,signal:t,onProgress:r})=>new Promise((s,o)=>{let n=pr(e),l=n.onError(o),a=()=>{l(),n.unsubscribe(i)};we(t,()=>{a(),o(new _t("pusher cancelled"))}),n.subscribe(i,c=>{switch(c.status){case j.Progress:{r&&(c.total==="unknown"?r({isComputable:!1}):r({isComputable:!0,value:c.done/c.total}));break}case j.Success:{a(),r&&r({isComputable:!0,value:c.done/c.total}),s(c);break}case j.Error:a(),o(new N(c.msg,c.error_code))}})}),So=(i,{publicKey:e,fileName:t,baseURL:r,baseCDN:s,checkForUrlDuplicates:o,saveUrlForRecurrentUploads:n,secureSignature:l,secureExpire:a,store:c,signal:d,onProgress:h,source:f,integration:m,userAgent:g,retryThrottledRequestMaxTimes:y,pusherKey:C=v.pusherKey,metadata:A})=>Promise.resolve(Eo(C)).then(()=>uo(i,{publicKey:e,fileName:t,baseURL:r,checkForUrlDuplicates:o,saveUrlForRecurrentUploads:n,secureSignature:l,secureExpire:a,store:c,signal:d,source:f,integration:m,userAgent:g,retryThrottledRequestMaxTimes:y,metadata:A})).catch(w=>{let _=pr(C);return _==null||_.disconnect(),Promise.reject(w)}).then(w=>w.type===lr.FileInfo?w:vo([({signal:_})=>xo({token:w.token,publicKey:e,baseURL:r,integration:m,userAgent:g,retryThrottledRequestMaxTimes:y,onProgress:h,signal:_}),({signal:_})=>To({token:w.token,pusherKey:C,signal:_,onProgress:h})],{signal:d})).then(w=>{if(w instanceof N)throw w;return w}).then(w=>fr(w.uuid,{publicKey:e,baseURL:r,integration:m,userAgent:g,retryThrottledRequestMaxTimes:y,onProgress:h,signal:d})).then(w=>new ht(w,{baseCDN:s})),nr=new WeakMap,Oo=async i=>{if(nr.has(i))return nr.get(i);let e=await fetch(i.uri).then(t=>t.blob());return nr.set(i,e),e},vi=async i=>{if(Ae(i)||Ce(i))return i.size;if(Ee(i))return(await Oo(i)).size;throw new Error("Unknown file type. Cannot determine file size.")},Io=(i,e=v.multipartMinFileSize)=>i>=e,Ci=i=>{let e="[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}",t=new RegExp(e);return!Dt(i)&&t.test(i)},mr=i=>{let e="^(?:\\w+:)?\\/\\/([^\\s\\.]+\\.\\S{2}|localhost[\\:?\\d]*)\\S*$",t=new RegExp(e);return!Dt(i)&&t.test(i)},ko=(i,e)=>new Promise((t,r)=>{let s=[],o=!1,n=e.length,l=[...e],a=()=>{let c=e.length-l.length,d=l.shift();d&&d().then(h=>{o||(s[c]=h,n-=1,n?a():t(s))}).catch(h=>{o=!0,r(h)})};for(let c=0;c<i;c++)a()}),Uo=(i,e,t,r)=>{let s=r*e,o=Math.min(s+r,t);return i.slice(s,o)},Lo=async(i,e,t)=>r=>Uo(i,r,e,t),Mo=(i,e,{publicKey:t,contentType:r,onProgress:s,signal:o,integration:n,retryThrottledRequestMaxTimes:l,retryNetworkErrorMaxTimes:a})=>go(i,e,{publicKey:t,contentType:r,onProgress:s,signal:o,integration:n,retryThrottledRequestMaxTimes:l,retryNetworkErrorMaxTimes:a}),Po=async(i,{publicKey:e,fileName:t,fileSize:r,baseURL:s,secureSignature:o,secureExpire:n,store:l,signal:a,onProgress:c,source:d,integration:h,userAgent:f,retryThrottledRequestMaxTimes:m,retryNetworkErrorMaxTimes:g,contentType:y,multipartChunkSize:C=v.multipartChunkSize,maxConcurrentRequests:A=v.maxConcurrentRequests,baseCDN:w,metadata:_})=>{let M=r!=null?r:await vi(i),H,J=(P,z)=>{if(!c)return;H||(H=Array(P).fill(0));let W=Q=>Q.reduce((st,Xe)=>st+Xe,0);return Q=>{Q.isComputable&&(H[z]=Q.value,c({isComputable:!0,value:W(H)/P}))}};return y||(y=bi(i)),mo(M,{publicKey:e,contentType:y,fileName:t||_i(i),baseURL:s,secureSignature:o,secureExpire:n,store:l,signal:a,source:d,integration:h,userAgent:f,retryThrottledRequestMaxTimes:m,retryNetworkErrorMaxTimes:g,metadata:_}).then(async({uuid:P,parts:z})=>{let W=await Lo(i,M,C);return Promise.all([P,ko(A,z.map((Q,st)=>()=>Mo(W(st),Q,{publicKey:e,contentType:y,onProgress:J(z.length,st),signal:a,integration:h,retryThrottledRequestMaxTimes:m,retryNetworkErrorMaxTimes:g})))])}).then(([P])=>yo(P,{publicKey:e,baseURL:s,source:d,integration:h,userAgent:f,retryThrottledRequestMaxTimes:m,retryNetworkErrorMaxTimes:g})).then(P=>P.isReady?P:fr(P.uuid,{publicKey:e,baseURL:s,source:d,integration:h,userAgent:f,retryThrottledRequestMaxTimes:m,retryNetworkErrorMaxTimes:g,onProgress:c,signal:a})).then(P=>new ht(P,{baseCDN:w}))};async function gr(i,{publicKey:e,fileName:t,baseURL:r=v.baseURL,secureSignature:s,secureExpire:o,store:n,signal:l,onProgress:a,source:c,integration:d,userAgent:h,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:m,contentType:g,multipartMinFileSize:y,multipartChunkSize:C,maxConcurrentRequests:A,baseCDN:w=v.baseCDN,checkForUrlDuplicates:_,saveUrlForRecurrentUploads:M,pusherKey:H,metadata:J}){if(Dt(i)){let P=await vi(i);return Io(P,y)?Po(i,{publicKey:e,contentType:g,multipartChunkSize:C,fileSize:P,fileName:t,baseURL:r,secureSignature:s,secureExpire:o,store:n,signal:l,onProgress:a,source:c,integration:d,userAgent:h,maxConcurrentRequests:A,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:m,baseCDN:w,metadata:J}):_o(i,{publicKey:e,fileName:t,contentType:g,baseURL:r,secureSignature:s,secureExpire:o,store:n,signal:l,onProgress:a,source:c,integration:d,userAgent:h,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:m,baseCDN:w,metadata:J})}if(mr(i))return So(i,{publicKey:e,fileName:t,baseURL:r,baseCDN:w,checkForUrlDuplicates:_,saveUrlForRecurrentUploads:M,secureSignature:s,secureExpire:o,store:n,signal:l,onProgress:a,source:c,integration:d,userAgent:h,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:m,pusherKey:H,metadata:J});if(Ci(i))return wo(i,{publicKey:e,fileName:t,baseURL:r,signal:l,onProgress:a,source:c,integration:d,userAgent:h,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:m,baseCDN:w});throw new TypeError(`File uploading from "${i}" is not supported`)}var ur=class{constructor(e,{baseCDN:t=v.baseCDN}={}){u(this,"uuid");u(this,"filesCount");u(this,"totalSize");u(this,"isStored");u(this,"isImage");u(this,"cdnUrl");u(this,"files");u(this,"createdAt");u(this,"storedAt",null);this.uuid=e.id,this.filesCount=e.filesCount;let r=e.files.filter(Boolean);this.totalSize=Object.values(r).reduce((s,o)=>s+o.size,0),this.isStored=!!e.datetimeStored,this.isImage=!!Object.values(r).filter(s=>s.isImage).length,this.cdnUrl=e.cdnUrl,this.files=r.map(s=>new ht(s,{baseCDN:t})),this.createdAt=e.datetimeCreated,this.storedAt=e.datetimeStored}},Ro=i=>{for(let e of i)if(!Dt(e))return!1;return!0},Do=i=>{for(let e of i)if(!Ci(e))return!1;return!0},Fo=i=>{for(let e of i)if(!mr(e))return!1;return!0};function Ai(i,{publicKey:e,fileName:t,baseURL:r=v.baseURL,secureSignature:s,secureExpire:o,store:n,signal:l,onProgress:a,source:c,integration:d,userAgent:h,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:m,contentType:g,multipartChunkSize:y=v.multipartChunkSize,baseCDN:C=v.baseCDN,checkForUrlDuplicates:A,saveUrlForRecurrentUploads:w,jsonpCallback:_}){if(!Ro(i)&&!Fo(i)&&!Do(i))throw new TypeError(`Group uploading from "${i}" is not supported`);let M,H=!0,J=i.length,P=(z,W)=>{if(!a)return;M||(M=Array(z).fill(0));let Q=st=>st.reduce((Xe,gs)=>Xe+gs)/z;return st=>{if(!st.isComputable||!H){H=!1,a({isComputable:!1});return}M[W]=st.value,a({isComputable:!0,value:Q(M)})}};return Promise.all(i.map((z,W)=>Dt(z)||mr(z)?gr(z,{publicKey:e,fileName:t,baseURL:r,secureSignature:s,secureExpire:o,store:n,signal:l,onProgress:P(J,W),source:c,integration:d,userAgent:h,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:m,contentType:g,multipartChunkSize:y,baseCDN:C,checkForUrlDuplicates:A,saveUrlForRecurrentUploads:w}).then(Q=>Q.uuid):z)).then(z=>po(z,{publicKey:e,baseURL:r,jsonpCallback:_,secureSignature:s,secureExpire:o,signal:l,source:c,integration:d,userAgent:h,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:m}).then(W=>new ur(W,{baseCDN:C})).then(W=>(a&&a({isComputable:!0,value:1}),W)))}var _e=class{constructor(e){u(this,"_concurrency",1);u(this,"_pending",[]);u(this,"_running",0);u(this,"_resolvers",new Map);u(this,"_rejectors",new Map);this._concurrency=e}_run(){let e=this._concurrency-this._running;for(let t=0;t<e;t++){let r=this._pending.shift();if(!r)return;let s=this._resolvers.get(r),o=this._rejectors.get(r);if(!s||!o)throw new Error("Unexpected behavior: resolver or rejector is undefined");this._running+=1,r().finally(()=>{this._resolvers.delete(r),this._rejectors.delete(r),this._running-=1,this._run()}).then(n=>s(n)).catch(n=>o(n))}}add(e){return new Promise((t,r)=>{this._resolvers.set(e,t),this._rejectors.set(e,r),this._pending.push(e),this._run()})}get pending(){return this._pending.length}get running(){return this._running}set concurrency(e){this._concurrency=e,this._run()}get concurrency(){return this._concurrency}};var yr=()=>({}),br=i=>({...yr(),"*currentActivity":null,"*currentActivityParams":{},"*history":[],"*historyBack":null,"*closeModal":()=>{i.set$({"*currentActivity":null,"*modalActive":!1})}}),Te=i=>({...br(i),"*commonProgress":0,"*uploadList":[],"*focusedEntry":null,"*uploadQueue":new _e(1),"*collectionErrors":[],"*collectionState":null,"*groupInfo":null,"*uploadTrigger":new Set,"*secureUploadsManager":null});var ft=i=>`*l10n/${i}`,$o="en",Se=class{constructor(e){u(this,"_blockInstance",null);u(this,"_localeName","");u(this,"_callbacks",new Set);u(this,"_boundBlocks",new Map);this._blockInstance=e;for(let[t,r]of Object.entries(Nt))this._blockInstance.add(ft(t),r,!1);setTimeout(()=>{e.subConfigValue("localeName",async t=>{var o;if(!this._blockInstance||!t)return;this._localeName=t;let r=await Nr(t);if(t!==$o&&this._localeName!==t)return;let s=(o=this._blockInstance.cfg.localeDefinitionOverride)==null?void 0:o[t];for(let[n,l]of Object.entries(r)){let a=s==null?void 0:s[n];this._blockInstance.add(ft(n),a!=null?a:l,!0);for(let c of this._callbacks)c()}}),e.subConfigValue("localeDefinitionOverride",t=>{var s;if(!t)return;let r=t[this._localeName];if(r)for(let[o,n]of Object.entries(r)){(s=this._blockInstance)==null||s.add(ft(o),n,!0);for(let l of this._callbacks)l()}})})}onLocaleChange(e){let t=q(e,0);return this._callbacks.add(t),()=>{this._callbacks.delete(t)}}bindL10n(e,t,r){var o,n,l;e.$[t]=r(),this._boundBlocks.has(e)||this._boundBlocks.set(e,new Map),(n=(o=this._boundBlocks.get(e))==null?void 0:o.get(t))==null||n();let s=this.onLocaleChange(()=>{e.$[t]=r()});(l=this._boundBlocks.get(e))==null||l.set(t,s)}destroyL10nBindings(e){let t=this._boundBlocks.get(e);if(t){for(let r of t.values())r();this._boundBlocks.delete(e)}}destroy(){this._callbacks.clear()}};var No={button:["toolbar"],checkbox:["toolbar"],menuitem:["menu","menubar"],option:["listbox"],tab:["tablist"]};function Kt(i,e){e.tabIndex=0,e.focus(),i.tabIndex=-1}function _r(i){let e=i.role||i.type||i.tagName;if(!e)return null;let t=No[e.toLowerCase()];if(!t)return null;for(let r of t){let s=i.closest(`[role=${r}]`);if(s)return s}}function wr(i,e){return e.role==="toolbar"?Vo(e):e.querySelectorAll(`[role=${i.role}]`)}function Vo(i){return[...i.querySelectorAll("*")].filter(t=>t.role==="button"||t.type==="button"||t.role==="checkbox"||t.type==="checkbox")}function zo(i){let e=i.getAttribute("aria-orientation");if(e==="vertical")return!1;if(e==="horizontal")return!0;let t=i.role;return t==="menubar"||t==="tablist"||t==="toolbar"}function Ei(i){return e=>{let t=!1,r=(i==null?void 0:i.searchDelayMs)||300,s=0,o="";function n(h){let f=_r(h.target);if(!f){l();return}let m=wr(h.target,f),g=Array.from(m).indexOf(h.target),y="ArrowDown",C="ArrowUp";if(zo(f)&&(e.document.dir==="rtl"?(y="ArrowLeft",C="ArrowRight"):(y="ArrowRight",C="ArrowLeft")),h.key===y)h.preventDefault(),Kt(h.target,m[g+1]||m[0]);else if(h.key===C)h.preventDefault(),Kt(h.target,m[g-1]||m[m.length-1]);else if(h.key==="Home")h.preventDefault(),Kt(h.target,m[0]);else if(h.key==="End")h.preventDefault(),Kt(h.target,m[m.length-1]);else if(h.key.length===1&&f.role!=="tablist"){let A=Date.now();A-s<=r?o+=h.key.toLowerCase():o=h.key.toLowerCase(),s=A;let w=Array.from(m).find(_=>{var M,H,J;return(J=(H=(M=_.textContent)==null?void 0:M.trim())==null?void 0:H.toLowerCase())==null?void 0:J.startsWith(o)});w&&(h.preventDefault(),Kt(h.target,w))}}function l(){t=!1,e.removeEventListener("keydown",n)}function a(h){let f=_r(h.target);if(f){t||(t=!0,e.addEventListener("keydown",n));let m=wr(h.target,f);for(let g of m)g!==h.target&&g.setAttribute("tabindex",-1)}else t&&l()}function c(h){(!h.relatedTarget||h.relatedTarget===e.document)&&l()}function d(h){let f=_r(h.target);if(f){let m=wr(h.target,f);for(let g of m)g!==h.target&&g.setAttribute("tabindex",-1);h.target.setAttribute("tabindex",0)}}return e.addEventListener("click",d),e.addEventListener("focusin",a),e.addEventListener("focusout",c),()=>{l(),e.removeEventListener("click",d),e.removeEventListener("focusin",a),e.removeEventListener("focusout",c)}}}function xi(){return i=>{let e,t;function r(o){if(o.target.getAttribute("aria-hidden")==="true"){e=o.target,e.setAttribute("aria-hidden","false"),t=e.hidden,t&&(e.hidden=!1);let n=o.target.querySelector('a, button, select, textarea, input:not([type=radio]), [type=radio]:checked, [tabindex]:not([tabindex="-1"])');n&&(n.tabIndex=0)}}function s(o){e&&e.contains(o.target)&&(!o.relatedTarget||!e.contains(o.relatedTarget))&&(o.target.tabIndex=-1,e.setAttribute("aria-hidden","true"),t&&(e.hidden=!0),e=null)}return i.addEventListener("keyuxJump",r),i.addEventListener("focusout",s),()=>{i.removeEventListener("keyuxJump",r),i.removeEventListener("focusout",s)}}}function Ti(){return i=>{let e=[];function t(c){let d=i.document.activeElement;d&&d!==i.document.body&&e.push(new WeakRef(d)),c.focus({focusVisible:!0})}function r(){let c=e.pop();if(!c){i.document.activeElement.blur();return}let d=c.deref();d&&d.isConnected?d.focus():r()}let s=0,o;function n(c){clearInterval(o);let d=c.getAttribute("aria-controls");d&&(o=setInterval(()=>{if(s++>50){clearInterval(o);return}let h=i.document.getElementById(d);if(h){let f=h.querySelector('a, button, select, textarea, input:not([type=radio]), [type=radio]:checked, [tabindex]:not([tabindex="-1"])');f&&(clearInterval(o),h.dispatchEvent(new i.CustomEvent("keyuxJump",{bubbles:!0})),t(f))}},50))}function l(c){c.clientX===0&&c.clientY===0&&n(c.target)}function a(c){c.target.tagName==="INPUT"&&c.key==="Enter"&&n(c.target),c.key==="Escape"&&r()}return i.addEventListener("click",l),i.addEventListener("keydown",a),()=>{i.removeEventListener("click",l),i.removeEventListener("keydown",a)}}}function Si(i){let e,t=i.split(" ");function r(){e&&e.classList.remove(...t)}function s(o){o.clientX===0&&o.clientY===0&&(r(),o.target.classList.add(...t),e=o.target)}return o=>(o.addEventListener("keyup",r),o.addEventListener("click",s),()=>{o.removeEventListener("keyup",r),o.removeEventListener("click",s)})}function Oi(i,e){let t=e.map(r=>r(i));return()=>{t.forEach(r=>r())}}var vr=class{constructor(){u(this,"_listeners",new Map);u(this,"_scope",[])}addEventListener(e,t){let r=s=>{let o=s.target;o&&this._scope.some(n=>n===s.target||n.contains(o))&&t(s)};this._listeners.set(t,r),window.addEventListener(e,r)}removeEventListener(e,t){let r=this._listeners.get(t);r&&window.removeEventListener(e,r),this._listeners.delete(t)}get CustomEvent(){return window.CustomEvent}get document(){return window.document}get navigator(){return window.navigator}registerScope(e){this._scope.push(e)}destroy(){this._scope=[],this._listeners.forEach((e,t)=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",e),this._listeners.delete(t)})}},Oe=class{constructor(){u(this,"_destroyKeyUX");u(this,"_scopedWindow");this._scopedWindow=new vr,this._destroyKeyUX=Oi(this._scopedWindow,[Ei(),Si("is-pressed"),Ti(),xi()])}registerBlock(e){this._scopedWindow.registerScope(e)}destroy(){var e;(e=this._destroyKeyUX)==null||e.call(this),this._scopedWindow.destroy()}};function Ii(i,e){[...i.querySelectorAll("[l10n]")].forEach(t=>{let r=t.getAttribute("l10n");if(!r)return;let s="textContent",o=!1;if(r.includes(":")){let a=r.split(":");s=a[0],r=a[1],s.startsWith("@")&&(s=s.slice(1),o=!0)}let n=r;e.has(n)&&e.sub(n,a=>{if(!a)return;e.l10nProcessorSubs.has(n)||e.l10nProcessorSubs.set(n,new Set);let c=e.l10nProcessorSubs.get(n);c==null||c.forEach(f=>{f.remove(),c.delete(f),e.allSubs.delete(f)});let d=ft(a).replace("*","");e.sharedCtx.has(d)||e.sharedCtx.add(d,a);let h=e.sharedCtx.sub(d,()=>{t[s]=e.l10n(a)});c==null||c.add(h),e.allSubs.add(h),t.removeAttribute("l10n")});let l=ft(r);e.has(l)||e.add(l,""),e.sub(l,()=>{r=r,o?t.setAttribute(s,e.l10n(r)):t[s]=e.l10n(r)}),t.removeAttribute("l10n")})}var B=i=>`*cfg/${i}`;var Cr="set";function ki(i){[...i.querySelectorAll(`[${Cr}]`)].forEach(e=>{let t=e.getAttribute(Cr);t&&(e.removeAttribute(Cr),e.setAttribute(p.BIND_ATTR,t))})}var jo="uc-",Ui="ctx-name",D=class extends Qe{constructor(){super();u(this,"requireCtxName",!1);u(this,"activityType",null);u(this,"init$",yr());this.l10nProcessorSubs=new Map,this.addTemplateProcessor(Ii),this.addTemplateProcessor(qr),this.tplProcessors=new Set([ki,...this.tplProcessors])}l10n(t,r={}){if(!t)return"";let s=this.$[ft(t)]||t,o=ai(s);for(let l of o)r[l.variable]=this.pluralize(l.pluralKey,Number(r[l.countVariable]));return sr(s,r)}pluralize(t,r){let s=this.l10n("locale-id")||"en",o=be(s,r);return this.l10n(`${t}__${o}`)}bindL10n(t,r){var s;(s=this.localeManager)==null||s.bindL10n(this,t,r)}emit(t,r,s){let o=this.has("*eventEmitter")&&this.$["*eventEmitter"];o&&o.emit(t,r,s)}hasBlockInCtx(t){for(let r of this.blocksRegistry)if(t(r))return!0;return!1}setOrAddState(t,r){this.add$({[t]:r},!0)}connectedCallback(){this.constructor.styleAttrs.forEach(r=>{this.setAttribute(r,"")}),this.hasAttribute("retpl")&&(this.constructor.template=null,this.processInnerHtml=!0),this.requireCtxName?ui({element:this,attribute:Ui}).then(r=>{if(r.success){let s=r.value;this.style.setProperty(p.CSS_CTX_PROP,`'${s}'`),this.setAttribute(p.CTX_NAME_ATTR,s),super.connectedCallback()}else console.error(`Attribute "${Ui}" is required and it is not set.`)}):super.connectedCallback(),St.registerClient(this)}disconnectedCallback(){super.disconnectedCallback(),St.unregisterClient(this)}initCallback(){this.has("*blocksRegistry")||this.add("*blocksRegistry",new Set),this.$["*blocksRegistry"].add(this),this.has("*eventEmitter")||this.add("*eventEmitter",new fe(this.debugPrint.bind(this))),this.has("*localeManager")||this.add("*localeManager",new Se(this)),this.has("*a11y")||this.add("*a11y",new Oe),this.sub(ft("locale-id"),r=>{let s=oi(r);this.style.direction=s==="ltr"?"":s})}get localeManager(){return this.has("*localeManager")?this.$["*localeManager"]:null}get a11y(){return this.has("*a11y")?this.$["*a11y"]:null}get blocksRegistry(){return this.$["*blocksRegistry"]}destroyCallback(){var r;let t=this.blocksRegistry;t==null||t.delete(this),(r=this.localeManager)==null||r.destroyL10nBindings(this),this.l10nProcessorSubs=new Map,S.deleteCtx(this.localCtx.uid),(t==null?void 0:t.size)===0&&setTimeout(()=>{this.destroyCtxCallback()},0)}destroyCtxCallback(){var t;S.deleteCtx(this.ctxName),(t=this.localeManager)==null||t.destroy()}async proxyUrl(t){if(this.cfg.secureDeliveryProxy&&this.cfg.secureDeliveryProxyUrlResolver&&console.warn("Both secureDeliveryProxy and secureDeliveryProxyUrlResolver are set. The secureDeliveryProxyUrlResolver will be used."),this.cfg.secureDeliveryProxyUrlResolver)try{return await this.cfg.secureDeliveryProxyUrlResolver(t,{uuid:Zr(t),cdnUrlModifiers:Yr(t),fileName:me(t)})}catch(r){return console.error("Failed to resolve secure delivery proxy URL. Falling back to the default URL.",r),t}return this.cfg.secureDeliveryProxy?sr(this.cfg.secureDeliveryProxy,{previewUrl:t},{transform:r=>window.encodeURIComponent(r)}):t}get cfg(){if(!this.__cfgProxy){let t=Object.create(null);this.__cfgProxy=new Proxy(t,{set:(r,s,o)=>{if(typeof s!="string")return!1;let n=B(s);return this.has(n)||this.add(n,Z[s]),this.$[n]=o,!0},get:(r,s)=>{let o=B(s);return this.has(o)||this.add(o,Z[s]),this.$[B(s)]}})}return this.__cfgProxy}subConfigValue(t,r){let s=B(t);this.has(s)||this.add(s,Z[t]),this.sub(s,r)}debugPrint(...t){if(!this.cfg.debug)return;let r=t;if(typeof(t==null?void 0:t[0])=="function"){let s=t[0];r=s()}console.log(`[${this.ctxName}]`,...r)}static reg(t){if(!t){super.reg();return}t.startsWith(jo)&&super.reg(t)}};u(D,"StateConsumerScope",null),u(D,"styleAttrs",[]);var Li="active",qt="___ACTIVITY_IS_ACTIVE___",pt=class pt extends D{constructor(){super(...arguments);u(this,"historyTracked",!1);u(this,"init$",br(this));u(this,"_debouncedHistoryFlush",q(this._historyFlush.bind(this),10))}_deactivate(){var r;let t=pt._activityCallbacks.get(this);this[qt]=!1,this.removeAttribute(Li),(r=t==null?void 0:t.deactivateCallback)==null||r.call(t)}_activate(){var r;let t=pt._activityCallbacks.get(this);this.$["*historyBack"]=this.historyBack.bind(this),this[qt]=!0,this.setAttribute(Li,""),(r=t==null?void 0:t.activateCallback)==null||r.call(t),this._debouncedHistoryFlush(),this.emit(T.ACTIVITY_CHANGE,{activity:this.activityType})}initCallback(){super.initCallback(),this.hasAttribute("current-activity")&&this.sub("*currentActivity",t=>{this.setAttribute("current-activity",t)}),this.activityType&&(this.hasAttribute("activity")||this.setAttribute("activity",this.activityType),this.sub("*currentActivity",t=>{this.activityType,this.activityType!==t&&this[qt]?this._deactivate():this.activityType===t&&!this[qt]&&this._activate(),t||(this.$["*history"]=[])}),this.has("*modalActive")&&this.sub("*modalActive",t=>{!t&&this.activityType===this.$["*currentActivity"]&&(this.$["*currentActivity"]=null)}))}_historyFlush(){let t=this.$["*history"];t&&(t.length>10&&(t=t.slice(t.length-11,t.length-1)),this.historyTracked&&t[t.length-1]!==this.activityType&&t.push(this.activityType),this.$["*history"]=t)}_isActivityRegistered(){return this.activityType&&pt._activityCallbacks.has(this)}get isActivityActive(){return this[qt]}get couldOpenActivity(){return!0}registerActivity(t,r={}){let{onActivate:s,onDeactivate:o}=r;pt._activityCallbacks.set(this,{activateCallback:s,deactivateCallback:o})}unregisterActivity(){this.isActivityActive&&this._deactivate(),pt._activityCallbacks.delete(this)}destroyCallback(){super.destroyCallback(),this._isActivityRegistered()&&this.unregisterActivity();let t=this.$["*currentActivity"];!![...this.blocksRegistry].find(s=>s instanceof pt&&s.activityType===t)||(this.$["*currentActivity"]=null,this.setOrAddState("*modalActive",!1))}get activityKey(){return this.ctxName+this.activityType}get activityParams(){return this.$["*currentActivityParams"]}get initActivity(){return this.getCssData("--cfg-init-activity")}get doneActivity(){return this.getCssData("--cfg-done-activity")}historyBack(){var r;let t=this.$["*history"];if(t){let s=t.pop();for(;s===this.activityType;)s=t.pop();let o=!!s;if(s){let n=[...this.blocksRegistry].find(l=>l.activityType===s);o=(r=n==null?void 0:n.couldOpenActivity)!=null?r:!1}s=o?s:void 0,this.$["*currentActivity"]=s,this.$["*history"]=t,s||this.setOrAddState("*modalActive",!1)}}};u(pt,"_activityCallbacks",new Map);var x=pt;x.activities=Object.freeze({START_FROM:"start-from",CAMERA:"camera",DRAW:"draw",UPLOAD_LIST:"upload-list",URL:"url",CLOUD_IMG_EDIT:"cloud-image-edit",EXTERNAL:"external",DETAILS:"details"});var Mi="<svg width='0' height='0' style='position:absolute'><symbol viewBox='0 0 24 24' id='uc-icon-about' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.152 14.12v.1h1.523v-.1c.007-.409.053-.752.138-1.028.086-.277.22-.517.405-.72.188-.202.434-.397.735-.586.32-.191.593-.412.82-.66.232-.249.41-.531.533-.847.125-.32.187-.678.187-1.076 0-.579-.137-1.085-.41-1.518a2.717 2.717 0 0 0-1.14-1.018c-.49-.245-1.062-.367-1.715-.367-.597 0-1.142.114-1.636.34-.49.228-.884.564-1.182 1.008-.299.44-.46.98-.485 1.619h1.62c.024-.377.118-.684.282-.922a1.48 1.48 0 0 1 .617-.532c.25-.114.51-.17.784-.17.301 0 .575.063.82.191.248.124.447.302.597.533.149.23.223.504.223.82 0 .263-.05.502-.149.72a1.91 1.91 0 0 1-.405.574 3.48 3.48 0 0 1-.575.453 4.22 4.22 0 0 0-.847.66c-.234.242-.415.558-.543.949-.125.39-.19.916-.197 1.577Zm.053 3.03c.21.206.46.31.75.31.196 0 .374-.049.534-.144a1.1 1.1 0 0 0 .383-.384c.1-.163.15-.343.15-.538a1 1 0 0 0-.32-.746 1.019 1.019 0 0 0-.746-.314c-.291 0-.542.105-.751.314-.21.206-.314.455-.314.746 0 .295.104.547.314.756ZM24 12c0 6.627-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0s12 5.373 12 12Zm-1.5 0c0 5.799-4.701 10.5-10.5 10.5S1.5 17.799 1.5 12 6.201 1.5 12 1.5 22.5 6.201 22.5 12Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-add' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12.75 21a.75.75 0 0 1-1.5 0v-8.25H3a.75.75 0 0 1 0-1.5h8.25V3a.75.75 0 0 1 1.5 0v8.25H21a.75.75 0 0 1 0 1.5h-8.25V21Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-arrow-down' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.5 23.03a.75.75 0 0 0 .999 0l9.29-8.276a.75.75 0 0 0-.998-1.12l-8.042 7.164V1.53a.75.75 0 0 0-1.5 0v19.267l-8.04-7.163a.75.75 0 0 0-.998 1.12z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-back' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M20.251 12a.75.75 0 0 1-.75.75H6.067l5.72 5.85a.75.75 0 1 1-1.072 1.05L4.136 12.92a1.292 1.292 0 0 1 0-1.842l6.579-6.728a.75.75 0 1 1 1.072 1.048l-5.72 5.851H19.5a.75.75 0 0 1 .75.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-badge-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13.6 18.4a1.6 1.6 0 1 1-3.2 0 1.6 1.6 0 0 1 3.2 0zM12 4.5A1.5 1.5 0 0 1 13.5 6v7a1.5 1.5 0 0 1-3 0V6A1.5 1.5 0 0 1 12 4.5z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-badge-success' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m10.5 18.204 7.6-8.183a1.5 1.5 0 0 0-2.2-2.042l-5.4 5.817-2.4-2.586a1.5 1.5 0 1 0-2.2 2.041l4.6 4.953Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-box' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M1.01 4.148a.75.75 0 0 1 .75.75v4.348a4.437 4.437 0 0 1 2.988-1.153c1.734 0 3.23.992 3.978 2.438a4.478 4.478 0 0 1 3.978-2.438c2.49 0 4.488 2.044 4.488 4.543 0 2.5-1.999 4.544-4.488 4.544a4.478 4.478 0 0 1-3.978-2.438 4.478 4.478 0 0 1-3.978 2.438C2.26 17.18.26 15.135.26 12.636V4.898a.75.75 0 0 1 .75-.75Zm.75 8.488c0 1.692 1.348 3.044 2.988 3.044s2.989-1.352 2.989-3.044c0-1.691-1.349-3.043-2.989-3.043S1.76 10.945 1.76 12.636Zm10.944-3.043c-1.64 0-2.988 1.352-2.988 3.043 0 1.692 1.348 3.044 2.988 3.044s2.988-1.352 2.988-3.044c0-1.69-1.348-3.043-2.988-3.043Zm4.328-1.23a.75.75 0 0 1 1.052.128l2.333 2.983 2.333-2.983a.75.75 0 0 1 1.181.924l-2.562 3.277 2.562 3.276a.75.75 0 1 1-1.181.924l-2.333-2.983-2.333 2.983a.75.75 0 1 1-1.181-.924l2.562-3.276-2.562-3.277a.75.75 0 0 1 .129-1.052Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-brightness' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M15 10a5 5 0 0 1-5 5m5-5a5 5 0 0 0-5-5m5 5h-5m0 5a5 5 0 0 1 0-10m0 10V5m0 15v-3M2.93 2.929 5.05 5.05M0 10h3m-.07 7.071 2.12-2.121M10 0v3m7.07 14.071-2.12-2.121M20 10h-3m.07-7.071L14.95 5.05m-.626 2.45H10m4.324 5H10'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-camera' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M7.65 2.55a.75.75 0 0 1 .6-.3h7.5a.75.75 0 0 1 .6.3l2.025 2.7H21a3 3 0 0 1 3 3v10.5a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V8.25a3 3 0 0 1 3-3h2.625zm.975 1.2L6.6 6.45a.75.75 0 0 1-.6.3H3a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h18a1.5 1.5 0 0 0 1.5-1.5V8.25a1.5 1.5 0 0 0-1.5-1.5h-3a.75.75 0 0 1-.6-.3l-2.025-2.7zm3.375 6a3.375 3.375 0 1 0 0 6.75 3.375 3.375 0 0 0 0-6.75zm-4.875 3.375a4.875 4.875 0 1 1 9.75 0 4.875 4.875 0 0 1-9.75 0z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-close' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M4.604 4.604a.75.75 0 0 1 1.06 0L12 10.939l6.335-6.335a.75.75 0 1 1 1.061 1.06L13.061 12l6.335 6.335a.75.75 0 1 1-1.06 1.061L12 13.061l-6.335 6.335a.75.75 0 0 1-1.061-1.06L10.939 12 4.604 5.665a.75.75 0 0 1 0-1.061z'/></symbol><symbol fill='currentColor' viewBox='0 0 20 20' id='uc-icon-closeMax' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='M8.232 10 3.585 5.353l1.768-1.768L10 8.232l4.648-4.647 1.767 1.768L11.768 10l4.647 4.648-1.767 1.767L10 11.768l-4.647 4.647-1.768-1.767L8.232 10Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-collapse' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M3.116 12a.75.75 0 0 1 .75-.75h16.268a.75.75 0 0 1 0 1.5H3.866a.75.75 0 0 1-.75-.75Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-contrast' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M2 10a8 8 0 1 0 16 0 8 8 0 1 0-16 0m8-8v16m8-8h-8m7.598 2.5H10m6.24 2.5H10m7.6-7.5H10M16.242 5H10'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-crop' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M20 14H7.005C6.45 14 6 13.55 6 12.995V0M0 6h13.067c.515 0 .933.418.933.933V20M14.5.4 13 2l1.5 1.6M13 2h2a3 3 0 0 1 3 3v2M5.5 19.6 7 18l-1.5-1.6M7 18H5a3 3 0 0 1-3-3v-2'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-default' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.501.392a.75.75 0 0 1 .998 0l6.704 5.972a.75.75 0 0 1-.998 1.12l-5.455-4.86v13.439a.75.75 0 0 1-1.5 0V2.625l-5.454 4.86a.75.75 0 1 1-.998-1.12zM.857 16.73a.75.75 0 0 1 .75.75v4.914h20.786v-4.914a.75.75 0 0 1 1.5 0v5.664a.75.75 0 0 1-.75.75H.857a.75.75 0 0 1-.75-.75v-5.664a.75.75 0 0 1 .75-.75z'/></symbol><symbol fill='currentColor' viewBox='0 0 20 20' id='uc-icon-done' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='m18.057 6.333-9.365 9.125a1.25 1.25 0 0 1-1.768-.023L1.92 10.296l1.791-1.744 4.132 4.243 8.47-8.253 1.744 1.79Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-dropbox' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.019 1.92a.75.75 0 0 1 .806 0L12 5.219l5.176-3.297a.75.75 0 0 1 .806 0l5.577 3.553a.75.75 0 0 1 0 1.265l-4.574 2.914 4.574 2.914a.75.75 0 0 1 0 1.265l-5.577 3.554a.75.75 0 0 1-.806 0L12 14.089l-5.175 3.297a.75.75 0 0 1-.806 0L.44 13.833a.75.75 0 0 1 0-1.266l4.575-2.914L.44 6.74a.75.75 0 0 1 0-1.265zm.403 8.616L2.24 13.2l4.182 2.664 4.181-2.664zm6.975 2.664 4.182 2.664L21.76 13.2l-4.181-2.664zm2.776-3.547L12 12.311 7.828 9.653 12 6.995zm1.406-.882 4.181-2.664-4.181-2.664-4.182 2.664zm-6.976-2.664L6.422 3.443 2.24 6.107 6.422 8.77zM5.791 18.544a.75.75 0 0 1 1.035-.23l5.175 3.297 5.175-3.297a.75.75 0 1 1 .806 1.265l-5.578 3.554a.75.75 0 0 1-.806 0L6.02 19.579a.75.75 0 0 1-.23-1.035z'/></symbol><symbol fill='currentColor' viewBox='0 0 25 24' id='uc-icon-edit-file' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='M18.558 2.804a.78.78 0 0 0-.557.235l-.008.007-2.472 2.46 3.847 3.848 2.46-2.473.004-.003a.78.78 0 0 0 0-1.108l-.004-.003-2.712-2.728a.78.78 0 0 0-.558-.235Zm-.248 7.613-3.852-3.852-8.93 8.887-1.516 5.41 5.41-1.515 8.888-8.93Zm-.636-8.934a2.28 2.28 0 0 1 2.512.505l2.702 2.717.002.002a2.278 2.278 0 0 1 0 3.234l-.002.002-12.541 12.602a.75.75 0 0 1-.33.193l-6.884 1.928a.75.75 0 0 1-.925-.924l1.928-6.885a.75.75 0 0 1 .193-.33l12.603-12.54a2.28 2.28 0 0 1 .742-.504Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-edit-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M18.558 2.804a.78.78 0 0 0-.557.235l-.008.007-2.472 2.46 3.847 3.848 2.46-2.473.004-.003a.78.78 0 0 0 0-1.108l-.004-.003-2.712-2.728a.78.78 0 0 0-.558-.235Zm-.248 7.613-3.852-3.852-8.93 8.887-1.516 5.41 5.41-1.515 8.888-8.93Zm-.636-8.934a2.28 2.28 0 0 1 2.512.505l2.702 2.717.002.002a2.278 2.278 0 0 1 0 3.234l-.002.002-12.541 12.602a.75.75 0 0 1-.33.193l-6.884 1.928a.75.75 0 0 1-.925-.924l1.928-6.885a.75.75 0 0 1 .193-.33l12.603-12.54a2.28 2.28 0 0 1 .742-.504Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-enhance' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M19 13h-2m0 0a4 4 0 0 1-4-4m4 4a4 4 0 0 0-4 4m0-8V7m0 2a4 4 0 0 1-4 4m-2 0h2m0 0a4 4 0 0 1 4 4m0 0v2M8 8.5H6.5m0 0a2 2 0 0 1-2-2m2 2a2 2 0 0 0-2 2m0-4V5m0 1.5a2 2 0 0 1-2 2M1 8.5h1.5m0 0a2 2 0 0 1 2 2m0 0V12M12 3h-1m0 0a1 1 0 0 1-1-1m1 1a1 1 0 0 0-1 1m0-2V1m0 1a1 1 0 0 1-1 1M8 3h1m0 0a1 1 0 0 1 1 1m0 0v1'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13 13h-2V7h2m0 10h-2v-2h2M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-evernote' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M9.804 2.27v-.048c.055-.263.313-.562.85-.562h.44c.142 0 .325.014.526.033.066.009.124.023.267.06l.13.032h.002c.319.079.515.275.644.482a1.461 1.461 0 0 1 .16.356l.004.012a.75.75 0 0 0 .603.577l1.191.207a1988.512 1988.512 0 0 0 2.332.402c.512.083 1.1.178 1.665.442.64.3 1.19.795 1.376 1.77.548 2.931.657 5.829.621 8a39.233 39.233 0 0 1-.125 2.602 17.518 17.518 0 0 1-.092.849.735.735 0 0 0-.024.112c-.378 2.705-1.269 3.796-2.04 4.27-.746.457-1.53.451-2.217.447h-.192c-.46 0-1.073-.23-1.581-.635-.518-.412-.763-.87-.763-1.217 0-.45.188-.688.355-.786.161-.095.436-.137.796.087a.75.75 0 1 0 .792-1.274c-.766-.476-1.64-.52-2.345-.108-.7.409-1.098 1.188-1.098 2.08 0 .996.634 1.84 1.329 2.392.704.56 1.638.96 2.515.96l.185.002c.667.009 1.874.025 3.007-.67 1.283-.786 2.314-2.358 2.733-5.276a4.213 4.213 0 0 0 .056-.335c.023-.184.051-.445.079-.772.055-.655.111-1.585.13-2.704.037-2.234-.074-5.239-.647-8.301v-.002c-.294-1.544-1.233-2.391-2.215-2.85-.777-.363-1.623-.496-2.129-.576a8.872 8.872 0 0 1-.25-.041l-.006-.001-1.99-.345-.761-.132a2.93 2.93 0 0 0-.182-.338A2.532 2.532 0 0 0 12.379.329l-.091-.023a3.967 3.967 0 0 0-.493-.103L11.769.2a7.846 7.846 0 0 0-.675-.04h-.44c-.733 0-1.368.284-1.795.742L2.416 7.431c-.468.428-.751 1.071-.751 1.81 0 .02 0 .041.003.062l.003.034c.017.21.038.468.096.796.107.715.275 1.47.391 1.994.029.13.055.245.075.342l.002.008c.258 1.141.641 1.94.978 2.466.168.263.323.456.444.589a2.808 2.808 0 0 0 .192.194c1.536 1.562 3.713 2.196 5.731 2.08.13-.005.35-.032.537-.073a2.627 2.627 0 0 0 .652-.24c.425-.26.75-.661.992-1.046.184-.294.342-.61.473-.915a3.8 3.8 0 0 0 .627.493 5.022 5.022 0 0 0 1.97.709l.023.002.018.003.11.016c.088.014.205.035.325.058l.056.014c.088.022.164.04.235.061a1.736 1.736 0 0 1 .145.048l.03.014c.765.34 1.302 1.09 1.302 1.871a.75.75 0 0 0 1.5 0c0-1.456-.964-2.69-2.18-3.235a3.595 3.595 0 0 0-.679-.217l-.063-.015a10.616 10.616 0 0 0-.606-.105l-.02-.003-.03-.003h-.002a3.542 3.542 0 0 1-1.331-.485c-.471-.298-.788-.692-.828-1.234a.75.75 0 0 0-1.48-.106l-.001.003-.004.017a8.23 8.23 0 0 1-.092.352 9.963 9.963 0 0 1-.298.892c-.132.34-.29.68-.47.966-.174.276-.339.454-.478.549a1.178 1.178 0 0 1-.221.072 1.949 1.949 0 0 1-.241.036h-.013l-.032.002c-1.684.1-3.423-.437-4.604-1.65a.746.746 0 0 0-.053-.05L4.84 14.6a1.348 1.348 0 0 1-.07-.073 2.99 2.99 0 0 1-.293-.392c-.242-.379-.558-1.014-.778-1.985a54.1 54.1 0 0 0-.083-.376 27.494 27.494 0 0 1-.367-1.872l-.003-.02a6.791 6.791 0 0 1-.08-.67c.004-.277.086-.475.2-.609l.067-.067a.63.63 0 0 1 .292-.145h.05c.18 0 1.095.055 2.013.115l1.207.08.534.037a.747.747 0 0 0 .052.002c.782 0 1.349-.206 1.759-.585l.005-.005c.553-.52.622-1.225.622-1.76V6.24l-.026-.565A774.97 774.97 0 0 1 9.885 4.4c-.042-.961-.081-1.939-.081-2.13ZM4.995 6.953a251.126 251.126 0 0 1 2.102.137l.508.035c.48-.004.646-.122.715-.185.07-.068.146-.209.147-.649l-.024-.548a791.69 791.69 0 0 1-.095-2.187L4.995 6.953Zm16.122 9.996Zm-5.479-5.323a.75.75 0 0 0 1.014.31 2.04 2.04 0 0 1 .304-.089 1.84 1.84 0 0 1 .544-.039c.215.023.321.06.37.085.033.016.039.026.047.04a.75.75 0 0 0 1.289-.767c-.337-.567-.906-.783-1.552-.85a3.334 3.334 0 0 0-1.002.062c-.27.056-.531.14-.705.234a.75.75 0 0 0-.31 1.014Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-expand' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m12 8.337-8.47 8.47a.75.75 0 0 1-1.06-1.06l8.605-8.606a1.29 1.29 0 0 1 1.85 0l8.605 8.605a.75.75 0 1 1-1.06 1.06L12 8.338Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-exposure' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M10 20v-3M2.93 2.929 5.05 5.05M0 10h3m-.07 7.071 2.12-2.121M10 0v3m7.07 14.071-2.12-2.121M20 10h-3m.07-7.071L14.95 5.05M5 10a5 5 0 1 0 10 0 5 5 0 1 0-10 0'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-external-source-placeholder' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.341 3.27a10.5 10.5 0 0 1 5.834-1.77.75.75 0 0 0 0-1.5 12 12 0 1 0 12 12 .75.75 0 0 0-1.5 0A10.5 10.5 0 1 1 6.34 3.27Zm14.145 1.48a.75.75 0 1 0-1.06-1.062L9.925 13.19V7.95a.75.75 0 1 0-1.5 0V15c0 .414.336.75.75.75h7.05a.75.75 0 0 0 0-1.5h-5.24l9.501-9.5Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-facebook' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12 1.5C6.201 1.5 1.5 6.201 1.5 12c0 4.943 3.416 9.089 8.016 10.204v-6.108H7.383a.75.75 0 0 1-.75-.75v-3.281a.75.75 0 0 1 .75-.75h2.133V9.393c0-.958.225-2.511 1.38-3.65 1.194-1.177 3.174-1.718 6.254-1.056a.75.75 0 0 1 .592.733v2.754a.75.75 0 0 1-.75.75c-.692 0-1.203.026-1.584.082-.387.057-.578.137-.675.202-.109.073-.237.205-.237 1.029v1.078h2.39a.75.75 0 0 1 .742.866l-.516 3.281a.75.75 0 0 1-.74.634h-1.876v6.106C19.09 21.082 22.5 16.939 22.5 12c0-5.799-4.701-10.5-10.5-10.5zM0 12C0 5.373 5.373 0 12 0s12 5.373 12 12c0 5.995-4.395 10.961-10.138 11.856a.75.75 0 0 1-.866-.74v-7.77a.75.75 0 0 1 .75-.75h1.984l.28-1.781h-2.264a.75.75 0 0 1-.75-.75v-1.828c0-.829.089-1.729.9-2.274.363-.244.807-.37 1.293-.441a9.623 9.623 0 0 1 1.053-.086V6.04c-2.41-.405-3.645.132-4.293.771-.737.728-.933 1.793-.933 2.582v2.672a.75.75 0 0 1-.75.75H8.133v1.78h2.133a.75.75 0 0 1 .75.75v7.772a.75.75 0 0 1-.865.741C4.4 22.968 0 18 0 12z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M2.895 1.201c0-.473.383-.857.857-.857h8.4c.227 0 .445.09.606.251l8.4 8.4c.16.16.25.379.25.606v13.2a.857.857 0 0 1-.856.857h-16.8a.857.857 0 0 1-.857-.857zm1.714.857v19.886h15.085V10.458h-7.542a.857.857 0 0 1-.858-.857V2.058zm8.4 1.213 5.473 5.473H13.01z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-filters' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M4.5 6.5a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0m-3.5 6a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0m7 0a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-flickr' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M5.959 7.926c-2.298 0-4.14 1.834-4.14 4.073 0 2.241 1.842 4.075 4.14 4.075 2.302 0 4.145-1.834 4.145-4.075 0-2.238-1.843-4.073-4.145-4.073Zm-5.64 4.073c0-3.086 2.533-5.573 5.64-5.573 3.11 0 5.645 2.486 5.645 5.573 0 3.089-2.535 5.575-5.645 5.575-3.107 0-5.64-2.487-5.64-5.575Zm18.07-4.073c-2.301 0-4.144 1.835-4.144 4.073 0 2.24 1.843 4.075 4.145 4.075 2.299 0 4.141-1.834 4.141-4.075 0-2.239-1.842-4.073-4.141-4.073Zm-5.644 4.073c0-3.087 2.535-5.573 5.645-5.573 3.108 0 5.641 2.487 5.641 5.573 0 3.088-2.533 5.575-5.641 5.575-3.11 0-5.645-2.486-5.645-5.575Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-flip' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M19.6 5 18 3.5 16.4 5m3.2 10L18 16.5 16.4 15M18 3.523v12.954M3.3 8.5h10.654c.301 0 .415-.395.159-.554L3.459 1.286A.3.3 0 0 0 3 1.542V8.2a.3.3 0 0 0 .3.3zm0 3h10.654c.301 0 .415.395.159.554l-10.654 6.66A.3.3 0 0 1 3 18.458v-6.66a.3.3 0 0 1 .3-.3z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-gamma' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M17 3C9 6 2.5 11.5 2.5 17.5m0 0h1m-1 0v-1m14 1h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3-14v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-gdrive' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M7.736 1.818a.75.75 0 0 1 .647-.37h7.587a.75.75 0 0 1 .655.383l7.233 12.946a.75.75 0 0 1-.003.737l-3.794 6.66a.75.75 0 0 1-.651.378H4.59a.75.75 0 0 1-.651-.378l-3.794-6.66a.75.75 0 0 1 .005-.75zm.64 1.876L1.663 15.148l2.93 5.145 6.655-11.581zm3.736 6.526-2.398 4.173H14.5zm4.116 4.173h5.697L15.53 2.947H9.677zm5.685 1.5H8.852l-2.966 5.16h13.088z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-gphotos' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12.51 0c-.702 0-1.272.57-1.272 1.273V7.35A6.381 6.381 0 0 0 0 11.489c0 .703.57 1.273 1.273 1.273H7.35A6.381 6.381 0 0 0 11.488 24c.704 0 1.274-.57 1.274-1.273V16.65A6.381 6.381 0 0 0 24 12.51c0-.703-.57-1.273-1.273-1.273H16.65A6.381 6.381 0 0 0 12.511 0Zm.252 11.232V1.53a4.857 4.857 0 0 1 0 9.702Zm-1.53.006H1.53a4.857 4.857 0 0 1 9.702 0Zm1.536 1.524a4.857 4.857 0 0 0 9.702 0h-9.702Zm-6.136 4.857c0-2.598 2.04-4.72 4.606-4.85v9.7a4.857 4.857 0 0 1-4.606-4.85Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-huddle' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.204 2.002c-.252.23-.357.486-.357.67V21.07c0 .15.084.505.313.812.208.28.499.477.929.477.519 0 .796-.174.956-.365.178-.212.286-.535.286-.924v-.013l.117-6.58c.004-1.725 1.419-3.883 3.867-3.883 1.33 0 2.332.581 2.987 1.364.637.762.95 1.717.95 2.526v6.47c0 .392.11.751.305.995.175.22.468.41 1.008.41.52 0 .816-.198 1.002-.437.207-.266.31-.633.31-.969V14.04c0-2.81-1.943-5.108-4.136-5.422a5.971 5.971 0 0 0-3.183.41c-.912.393-1.538.96-1.81 1.489a.75.75 0 0 1-1.417-.344v-7.5c0-.587-.47-1.031-1.242-1.031-.315 0-.638.136-.885.36ZM5.194.892A2.844 2.844 0 0 1 7.09.142c1.328 0 2.742.867 2.742 2.53v5.607a6.358 6.358 0 0 1 1.133-.629 7.47 7.47 0 0 1 3.989-.516c3.056.436 5.425 3.482 5.425 6.906v6.914c0 .602-.177 1.313-.627 1.89-.47.605-1.204 1.016-2.186 1.016-.96 0-1.698-.37-2.179-.973-.46-.575-.633-1.294-.633-1.933v-6.469c0-.456-.19-1.071-.602-1.563-.394-.471-.986-.827-1.836-.827-1.447 0-2.367 1.304-2.367 2.39v.014l-.117 6.58c-.001.64-.177 1.333-.637 1.881-.48.57-1.2.9-2.105.9-.995 0-1.7-.5-2.132-1.081-.41-.552-.61-1.217-.61-1.708V2.672c0-.707.366-1.341.847-1.78Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-info' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11 9h2V7h-2m1 13c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2m-1 15h2v-6h-2v6Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-instagram' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.225 12a5.775 5.775 0 1 1 11.55 0 5.775 5.775 0 0 1-11.55 0zM12 7.725a4.275 4.275 0 1 0 0 8.55 4.275 4.275 0 0 0 0-8.55zm6.425-.75a1.4 1.4 0 1 0 0-2.8 1.4 1.4 0 0 0 0 2.8zm-6.467-6.8h.084c2.152 0 3.823 0 5.152.132 1.35.134 2.427.41 3.362 1.013a7.15 7.15 0 0 1 2.124 2.124c.604.935.88 2.012 1.013 3.362.132 1.329.132 3 .132 5.152v.084c0 2.152 0 3.823-.132 5.152-.134 1.35-.41 2.427-1.013 3.362a7.15 7.15 0 0 1-2.124 2.124c-.935.604-2.012.88-3.362 1.013-1.329.132-3 .132-5.152.132h-.084c-2.152 0-3.824 0-5.153-.132-1.35-.134-2.427-.409-3.36-1.013a7.15 7.15 0 0 1-2.125-2.124C.716 19.62.44 18.544.307 17.194c-.132-1.329-.132-3-.132-5.152v-.084c0-2.152 0-3.823.132-5.152.133-1.35.409-2.427 1.013-3.362A7.15 7.15 0 0 1 3.444 1.32C4.378.716 5.456.44 6.805.307c1.33-.132 3-.132 5.153-.132zM6.953 1.799c-1.234.123-2.043.36-2.695.78A5.65 5.65 0 0 0 2.58 4.26c-.42.65-.657 1.46-.78 2.695C1.676 8.2 1.675 9.797 1.675 12s0 3.8.124 5.046c.123 1.235.36 2.044.78 2.696a5.649 5.649 0 0 0 1.68 1.678c.65.421 1.46.658 2.694.78 1.247.124 2.844.125 5.047.125s3.8 0 5.046-.124c1.235-.123 2.044-.36 2.695-.78a5.648 5.648 0 0 0 1.68-1.68c.42-.65.657-1.46.78-2.694.123-1.247.124-2.844.124-5.047s-.001-3.8-.125-5.046c-.122-1.235-.359-2.044-.78-2.695a5.65 5.65 0 0 0-1.679-1.68c-.651-.42-1.46-.657-2.695-.78-1.246-.123-2.843-.124-5.046-.124-2.203 0-3.8 0-5.047.124z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-local' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M3 3.75a1.5 1.5 0 0 0-1.5 1.5v13.5a1.5 1.5 0 0 0 1.5 1.5h18a1.5 1.5 0 0 0 1.5-1.5V9A1.5 1.5 0 0 0 21 7.5h-9a.75.75 0 0 1-.643-.364L9.325 3.75zm-3 1.5a3 3 0 0 1 3-3h6.75a.75.75 0 0 1 .643.364L12.425 6H21a3 3 0 0 1 3 3v9.75a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-mirror' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M5 .4 3.5 2 5 3.6M15 .4 16.5 2 15 3.6M3.52 2h12.957M8.5 16.7V6.046c0-.301-.394-.415-.554-.159L1.287 16.541a.3.3 0 0 0 .255.459H8.2a.3.3 0 0 0 .3-.3zm3 0V6.046c0-.301.395-.415.555-.159l6.659 10.654a.3.3 0 0 1-.255.459H11.8a.3.3 0 0 1-.3-.3z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-onedrive' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13.616 4.147a7.689 7.689 0 0 0-7.642 3.285A6.299 6.299 0 0 0 1.455 17.3c.684.894 2.473 2.658 5.17 2.658h12.141c.95 0 1.882-.256 2.697-.743.815-.486 1.514-1.247 1.964-2.083a5.26 5.26 0 0 0-3.713-7.612 7.69 7.69 0 0 0-6.098-5.373ZM3.34 17.15c.674.63 1.761 1.308 3.284 1.308h12.142a3.76 3.76 0 0 0 2.915-1.383l-7.494-4.489L3.34 17.15Zm10.875-6.25 2.47-1.038a5.239 5.239 0 0 1 1.427-.389 6.19 6.19 0 0 0-10.3-1.952 6.338 6.338 0 0 1 2.118.813l4.285 2.567Zm4.55.033c-.512 0-1.019.104-1.489.307l-.006.003-1.414.594 6.521 3.906a3.76 3.76 0 0 0-3.357-4.8l-.254-.01ZM4.097 9.617A4.799 4.799 0 0 1 6.558 8.9c.9 0 1.84.25 2.587.713l3.4 2.037-10.17 4.28a4.799 4.799 0 0 1 1.721-6.312Z'/></symbol><symbol viewBox='0 0 40 40' id='uc-icon-original' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.5' d='M0 40 40 0'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-remove-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.955 3.3A2.969 2.969 0 0 0 8.998 6h5.914a2.97 2.97 0 0 0-2.957-2.7zM16.416 6a4.47 4.47 0 0 0-8.922 0h-2.32a.755.755 0 0 0-.111.008H3.075a.75.75 0 1 0 0 1.5h1.35V19.35a2.85 2.85 0 0 0 2.85 2.85h9.45a2.85 2.85 0 0 0 2.85-2.85V7.508h1.35a.75.75 0 0 0 0-1.5h-1.989A.754.754 0 0 0 18.825 6zM5.925 7.508V19.35a1.35 1.35 0 0 0 1.35 1.35h9.45a1.35 1.35 0 0 0 1.35-1.35V7.508z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-rotate' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M13.5.4 12 2l1.5 1.6M12.023 2H14.4A3.6 3.6 0 0 1 18 5.6V8M4 17h9a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-sad' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M2 17c4.418-4 11.582-4 16 0M16.5 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-11 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-saturation' xmlns='http://www.w3.org/2000/svg'><defs><linearGradient id='apuc-icon-id__a' x1='10.001' y1='1' x2='10.001' y2='19' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient></defs><circle cx='10.001' cy='10' r='9' transform='rotate(90 10 10)' fill='url(#apuc-icon-id__a)'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-select' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m7 10 5 5 5-5H7Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-slider' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M0 10h11m0 0a2 2 0 1 0 4 0m-4 0a2 2 0 1 1 4 0m0 0h5'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-tuning' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M8 10h11M1 10h4M1 4.5h11m3 0h4m-18 11h11m3 0h4m-7-11a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0M5 10a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0m7 5.5a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-upload' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.501.392a.75.75 0 0 1 .998 0l6.704 5.972a.75.75 0 0 1-.998 1.12l-5.455-4.86v13.439a.75.75 0 0 1-1.5 0V2.625l-5.454 4.86a.75.75 0 1 1-.998-1.12zM.857 16.73a.75.75 0 0 1 .75.75v4.914h20.786v-4.914a.75.75 0 0 1 1.5 0v5.664a.75.75 0 0 1-.75.75H.857a.75.75 0 0 1-.75-.75v-5.664a.75.75 0 0 1 .75-.75z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-upload-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13 13h-2V7h2m0 10h-2v-2h2M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-url' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M19.11 3.67c-1.71-1.709-4.578-1.682-6.408.148l-2.22 2.22a.75.75 0 0 1-1.062-1.06l2.222-2.221C14.018.381 17.836.276 20.17 2.61l1.22 1.22c2.335 2.334 2.23 6.153-.147 8.529l-2.22 2.22a.75.75 0 0 1-1.062-1.06l2.222-2.221c1.83-1.83 1.856-4.698.147-6.408zm-3.36 4.58a.75.75 0 0 1 0 1.06l-6.439 6.44a.75.75 0 0 1-1.06-1.06l6.439-6.44a.75.75 0 0 1 1.06 0zM6.04 9.42a.75.75 0 0 1 0 1.061l-2.222 2.222c-1.83 1.83-1.856 4.698-.147 6.407l1.22 1.22c1.71 1.71 4.578 1.683 6.408-.147l2.221-2.221a.75.75 0 1 1 1.06 1.06l-2.22 2.222c-2.377 2.376-6.195 2.481-8.53.147l-1.22-1.22c-2.334-2.334-2.228-6.153.148-8.53l2.221-2.22a.75.75 0 0 1 1.06 0z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-vibrance' xmlns='http://www.w3.org/2000/svg'><path d='M2.125 5.64A8.96 8.96 0 0 0 1.001 10a8.96 8.96 0 0 0 1.124 4.36V5.64z' fill='url(#asuc-icon-id__a)'/><path d='M2.875 15.499V4.502a9.053 9.053 0 0 1 1.75-1.72v14.437a9.05 9.05 0 0 1-1.75-1.72z' fill='url(#asuc-icon-id__b)'/><path d='M5.375 17.722c.548.33 1.134.601 1.75.809V1.469a8.956 8.956 0 0 0-1.75.81v15.443z' fill='url(#asuc-icon-id__c)'/><path d='M7.875 1.253v17.495c.564.136 1.15.22 1.75.244V1.008a9 9 0 0 0-1.75.245z' fill='url(#asuc-icon-id__d)'/><path d='M10.375 1.008v17.984a9 9 0 0 0 1.75-.244V1.252a9 9 0 0 0-1.75-.244z' fill='url(#asuc-icon-id__e)'/><path d='M12.875 1.469V18.53a8.957 8.957 0 0 0 1.75-.808V2.277a8.957 8.957 0 0 0-1.75-.808z' fill='url(#asuc-icon-id__f)'/><path d='M15.375 2.78v14.44a9.053 9.053 0 0 0 1.75-1.72v-11a9.054 9.054 0 0 0-1.75-1.72z' fill='url(#asuc-icon-id__g)'/><path d='M17.875 5.638v8.724A8.959 8.959 0 0 0 19.001 10a8.96 8.96 0 0 0-1.126-4.362z' fill='url(#asuc-icon-id__h)'/><defs><linearGradient id='asuc-icon-id__a' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='asuc-icon-id__b' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='asuc-icon-id__c' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='asuc-icon-id__d' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='asuc-icon-id__e' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='asuc-icon-id__f' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='asuc-icon-id__g' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='asuc-icon-id__h' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient></defs></symbol><symbol viewBox='0 0 24 24' id='uc-icon-vk' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.341 3.27a10.5 10.5 0 0 1 5.834-1.77.75.75 0 0 0 0-1.5 12 12 0 1 0 12 12 .75.75 0 0 0-1.5 0A10.5 10.5 0 1 1 6.34 3.27Zm14.145 1.48a.75.75 0 1 0-1.06-1.062L9.925 13.19V7.95a.75.75 0 1 0-1.5 0V15c0 .414.336.75.75.75h7.05a.75.75 0 0 0 0-1.5h-5.24l9.501-9.5Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-warmth' xmlns='http://www.w3.org/2000/svg'><path d='m7.5 13.05.429.42.171-.175v-.244h-.6zm5 0h-.6v.245l.172.175.428-.42zM8.1 3.5c0-1.05.85-1.9 1.9-1.9V.4a3.1 3.1 0 0 0-3.1 3.1h1.2zm0 9.55V3.5H6.9v9.55h1.2zm-1 2.45c0-.79.315-1.506.829-2.03l-.858-.84A4.088 4.088 0 0 0 5.9 15.5h1.2zm2.9 2.9a2.9 2.9 0 0 1-2.9-2.9H5.9a4.1 4.1 0 0 0 4.1 4.1v-1.2zm2.9-2.9a2.9 2.9 0 0 1-2.9 2.9v1.2a4.1 4.1 0 0 0 4.1-4.1h-1.2zm-.829-2.03c.514.524.829 1.24.829 2.03h1.2c0-1.117-.447-2.13-1.171-2.87l-.858.84zM11.9 3.5v9.55h1.2V3.5h-1.2zM10 1.6c1.05 0 1.9.85 1.9 1.9h1.2A3.1 3.1 0 0 0 10 .4v1.2z' fill='currentColor'/><path d='M10 14V8' stroke='currentColor' stroke-width='1.2' stroke-linecap='round'/><path d='M14 3h3m-3 3h3m-3 3h3m-8 6.5a1 1 0 1 0 2 0 1 1 0 1 0-2 0' stroke='currentColor' stroke-width='1.2'/></symbol></svg>";var Zt=class extends D{constructor(){super(...arguments);u(this,"requireCtxName",!0);u(this,"init$",Te(this));u(this,"_template",null)}initCallback(){var t;super.initCallback(),(t=this.a11y)==null||t.registerBlock(this)}static set template(t){this._template=Mi+t+"<slot></slot>"}static get template(){return this._template}};u(Zt,"styleAttrs",["uc-wgt-common"]);var Yt=class Yt extends Zt{initCallback(){super.initCallback();let e=this.ref.uBlock;this.sub("*currentActivity",t=>{t||(this.$["*currentActivity"]=e.initActivity||x.activities.START_FROM)}),this.sub("*uploadList",t=>{(t==null?void 0:t.length)>0?this.$["*currentActivity"]=x.activities.UPLOAD_LIST:this.$["*currentActivity"]=e.initActivity||x.activities.START_FROM}),this.subConfigValue("sourceList",t=>{t!=="local"&&(this.cfg.sourceList="local")}),this.subConfigValue("confirmUpload",t=>{t!==!1&&(this.cfg.confirmUpload=!1)})}};u(Yt,"styleAttrs",[...ne(Yt,Yt,"styleAttrs"),"uc-file-uploader-minimal"]);var Ie=Yt;Ie.template=U`<uc-start-from><uc-drop-area tabindex="0" clickable l10n="choose-file"></uc-drop-area><uc-copyright></uc-copyright></uc-start-from><uc-upload-list ref="uBlock"></uc-upload-list>`;var ke=class extends x{constructor(){super(...arguments);u(this,"historyTracked",!0);u(this,"activityType","start-from")}initCallback(){super.initCallback(),this.registerActivity(this.activityType)}};ke.template=U`<div class="uc-content"><slot></slot></div>`;function Pi(i,e,t){let r=i/e,s,o;r>t?(s=Math.round(e*t),o=e):(s=i,o=Math.round(i/t));let n=Math.round((i-s)/2),l=Math.round((e-o)/2);return n+s>i&&(s=i-n),l+o>e&&(o=e-l),{x:n,y:l,width:s,height:o}}var Ri=i=>{if(!i)return[];let[e,t]=i.split(":").map(Number);if(!Number.isFinite(e)||!Number.isFinite(t)){console.error(`Invalid crop preset: ${i}`);return}return[{type:"aspect-ratio",width:e,height:t}]};var Di="blocks",Fi="1.2.0";function $i(i){return hr({...i,libraryName:Di,libraryVersion:Fi})}var Ni=i=>Math.floor(i/1e3),Vi=(i,{threshold:e})=>{let{secureExpire:t}=i,r=Ni(Date.now()),s=Number(t),o=Ni(e);return r+o>=s};var Ue=class{constructor(e){u(this,"_block");u(this,"_secureToken",null);this._block=e}_debugPrint(...e){this._block.debugPrint("[secure-uploads]",...e)}async getSecureToken(){let{secureSignature:e,secureExpire:t,secureUploadsSignatureResolver:r}=this._block.cfg;if((e||t)&&r&&console.warn("Both secureSignature/secureExpire and secureUploadsSignatureResolver are set. secureUploadsSignatureResolver will be used."),r){if(!this._secureToken||Vi(this._secureToken,{threshold:this._block.cfg.secureUploadsExpireThreshold})){this._secureToken?this._debugPrint("Secure signature is expired. Resolving a new one..."):this._debugPrint("Secure signature is not set yet.");try{let s=await r();s?!s.secureSignature||!s.secureExpire?console.error("Secure signature resolver returned an invalid result:",s):(this._debugPrint("Secure signature resolved:",s),this._debugPrint("Secure signature will expire in",new Date(Number(s.secureExpire)*1e3).toISOString()),this._secureToken=s):(this._debugPrint("Secure signature resolver returned nothing."),this._secureToken=null)}catch(s){console.error("Secure signature resolving failed. Falling back to the previous one.",s)}}return this._secureToken}return e&&t?(this._debugPrint("Secure signature and expire are set. Using them...",{secureSignature:e,secureExpire:t}),{secureSignature:e,secureExpire:t}):null}};var zi="[Typed State] Wrong property name: ",Bo="[Typed State] Wrong property type: ",Le=class{constructor(e,t){this.__typedSchema=e,this.__ctxId=t||nt.generate(),this.__schema=Object.keys(e).reduce((r,s)=>(r[s]=e[s].value,r),{}),this.__data=S.registerCtx(this.__schema,this.__ctxId)}get uid(){return this.__ctxId}setValue(e,t){if(!this.__typedSchema.hasOwnProperty(e)){console.warn(zi+e);return}let r=this.__typedSchema[e];if((t==null?void 0:t.constructor)===r.type||t instanceof r.type||r.nullable&&t===null){this.__data.pub(e,t);return}console.warn(Bo+e)}setMultipleValues(e){for(let t in e)this.setValue(t,e[t])}getValue(e){if(!this.__typedSchema.hasOwnProperty(e)){console.warn(zi+e);return}return this.__data.read(e)}subscribe(e,t){return this.__data.sub(e,t)}remove(){S.deleteCtx(this.__ctxId)}};var Me=class{constructor(e){this.__typedSchema=e.typedSchema,this.__ctxId=e.ctxName||nt.generate(),this.__data=S.registerCtx({},this.__ctxId),this.__watchList=e.watchList||[],this.__subsMap=Object.create(null),this.__propertyObservers=new Set,this.__collectionObservers=new Set,this.__items=new Set,this.__removed=new Set,this.__added=new Set;let t=Object.create(null);this.__notifyObservers=(r,s)=>{this.__observeTimeout&&window.clearTimeout(this.__observeTimeout),t[r]||(t[r]=new Set),t[r].add(s),this.__observeTimeout=window.setTimeout(()=>{Object.keys(t).length!==0&&(this.__propertyObservers.forEach(o=>{o({...t})}),t=Object.create(null))})}}notify(){this.__notifyTimeout&&window.clearTimeout(this.__notifyTimeout),this.__notifyTimeout=window.setTimeout(()=>{let e=new Set(this.__added),t=new Set(this.__removed);this.__added.clear(),this.__removed.clear();for(let r of this.__collectionObservers)r==null||r([...this.__items],e,t)})}observeCollection(e){return this.__collectionObservers.add(e),this.__items.size>0&&this.notify(),()=>{this.unobserveCollection(e)}}unobserveCollection(e){var t;(t=this.__collectionObservers)==null||t.delete(e)}add(e){let t=new Le(this.__typedSchema);for(let r in e)t.setValue(r,e[r]);return this.__items.add(t.uid),this.notify(),this.__data.add(t.uid,t),this.__added.add(t),this.__watchList.forEach(r=>{this.__subsMap[t.uid]||(this.__subsMap[t.uid]=[]),this.__subsMap[t.uid].push(t.subscribe(r,()=>{this.__notifyObservers(r,t.uid)}))}),t.uid}read(e){return this.__data.read(e)}readProp(e,t){return this.read(e).getValue(t)}publishProp(e,t,r){this.read(e).setValue(t,r)}remove(e){this.__removed.add(this.__data.read(e)),this.__items.delete(e),this.notify(),this.__data.pub(e,null),delete this.__subsMap[e]}clearAll(){this.__items.forEach(e=>{this.remove(e)})}observeProperties(e){return this.__propertyObservers.add(e),()=>{this.unobserveProperties(e)}}unobserveProperties(e){var t;(t=this.__propertyObservers)==null||t.delete(e)}findItems(e){let t=[];return this.__items.forEach(r=>{let s=this.read(r);e(s)&&t.push(r)}),t}items(){return[...this.__items]}get size(){return this.__items.size}destroy(){S.deleteCtx(this.__ctxId),this.__propertyObservers=null,this.__collectionObservers=null;for(let e in this.__subsMap)this.__subsMap[e].forEach(t=>{t.remove()}),delete this.__subsMap[e]}};var rt=Object.freeze({LOCAL:"local",DROP_AREA:"drop-area",URL_TAB:"url-tab",CAMERA:"camera",EXTERNAL:"external",API:"js-api"});var Jt=["image/*","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/avif","image/avif-sequence",".heif",".heifs",".heic",".heics",".avif",".avifs"],Pe=i=>i?i.filter(e=>typeof e=="string").map(e=>at(e)).flat():[],Ar=(i,e)=>e.some(t=>t.endsWith("*")?(t=t.replace("*",""),i.startsWith(t)):i===t),ji=(i,e)=>e.some(t=>t.startsWith(".")?i.toLowerCase().endsWith(t.toLowerCase()):!1),Bi=i=>{let e=i==null?void 0:i.type;return e?Ar(e,Jt):!1};var Ho=/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/i,Xo=new RegExp(`^/?(${Ho.source})(?:/(-/(?:[^/]+/)+)?([^/]*))?$`,"i"),Hi=({url:i,cdnBase:e})=>{let t=new URL(e),r=new URL(i);if(t.host!==r.host)return null;let[,s,o,n]=Xo.exec(r.pathname);return{uuid:s,cdnUrlModifiers:o||"",filename:n||null}};var Xi=i=>{let e=new Map;return(...t)=>{let r=JSON.stringify(t);if(e.has(r))return e.get(r);let s=i(...t);return e.set(r,s),s}};var Gi=new Set;function Wi(i){Gi.has(i)||(Gi.add(i),console.warn(i))}function Go(i){let e=!1;return setTimeout(()=>{e=!0},0),r=>(...s)=>(e&&Wi(i),r(...s))}function Ki(i){let e={progress:()=>i.$["*commonProgress"],errors:()=>i.$["*collectionErrors"],group:()=>i.$["*groupInfo"],totalCount:()=>i.uploadCollection.size,failedCount:()=>t.failedEntries.length,successCount:()=>t.successEntries.length,uploadingCount:()=>t.uploadingEntries.length,status:()=>t.isFailed?"failed":t.isUploading?"uploading":t.isSuccess?"success":"idle",isSuccess:()=>t.allEntries.length>0&&t.errors.length===0&&t.successEntries.length===t.allEntries.length,isUploading:()=>t.allEntries.some(s=>s.status==="uploading"),isFailed:()=>t.errors.length>0||t.failedEntries.length>0,allEntries:()=>i.getOutputData(),successEntries:()=>t.allEntries.filter(s=>s.status==="success"),failedEntries:()=>t.allEntries.filter(s=>s.status==="failed"),uploadingEntries:()=>t.allEntries.filter(s=>s.status==="uploading"),idleEntries:()=>t.allEntries.filter(s=>s.status==="idle")},t={},r=Go("You're trying to access the OutputCollectionState asynchronously. In this case, the data you retrieve will be newer than it was when the OutputCollectionState was created or when the event was dispatched. If you want to retain the state at a specific moment in time, you should use the spread operator like this: `{...outputCollectionState}` or `{...e.detail}`");for(let[s,o]of Object.entries(e)){let n=s,a=Xi(r(o));Object.defineProperty(t,n,{get:a,enumerable:!0})}return t}var Re=class{constructor(e){u(this,"_ctx");u(this,"addFileFromUrl",(e,{silent:t,fileName:r,source:s}={})=>{let o=this._uploadCollection.add({externalUrl:e,fileName:r!=null?r:null,silent:t!=null?t:!1,source:s!=null?s:rt.API});return this.getOutputItem(o)});u(this,"addFileFromUuid",(e,{silent:t,fileName:r,source:s}={})=>{let o=this._uploadCollection.add({uuid:e,fileName:r!=null?r:null,silent:t!=null?t:!1,source:s!=null?s:rt.API});return this.getOutputItem(o)});u(this,"addFileFromCdnUrl",(e,{silent:t,fileName:r,source:s}={})=>{var l;let o=Hi({url:e,cdnBase:this.cfg.cdnCname});if(!o)throw new Error("Invalid CDN URL");let n=this._uploadCollection.add({uuid:o.uuid,cdnUrl:e,cdnUrlModifiers:o.cdnUrlModifiers,fileName:(l=r!=null?r:o.filename)!=null?l:null,silent:t!=null?t:!1,source:s!=null?s:rt.API});return this.getOutputItem(n)});u(this,"addFileFromObject",(e,{silent:t,fileName:r,source:s,fullPath:o}={})=>{let n=this._uploadCollection.add({file:e,isImage:Bi(e),mimeType:e.type,fileName:r!=null?r:e.name,fileSize:e.size,silent:t!=null?t:!1,source:s!=null?s:rt.API,fullPath:o!=null?o:null});return this.getOutputItem(n)});u(this,"removeFileByInternalId",e=>{if(!this._uploadCollection.read(e))throw new Error(`File with internalId ${e} not found`);this._uploadCollection.remove(e)});u(this,"uploadAll",()=>{let e=this._uploadCollection.items().filter(t=>{let r=this._uploadCollection.read(t);return!r.getValue("isRemoved")&&!r.getValue("isUploading")&&!r.getValue("fileInfo")});e.length!==0&&(this._ctx.$["*uploadTrigger"]=new Set(e),this._ctx.emit(T.COMMON_UPLOAD_START,this.getOutputCollectionState()))});u(this,"openSystemDialog",(e={})=>{var s;let t=ye(Pe([(s=this.cfg.accept)!=null?s:"",...this.cfg.imgOnly?Jt:[]]));this.cfg.accept&&this.cfg.imgOnly&&console.warn("There could be a mistake.\nBoth `accept` and `imgOnly` parameters are set.\nThe value of `accept` will be concatenated with the internal image mime types list.");let r=document.createElement("input");r.type="file",r.multiple=this.cfg.multiple,e.captureCamera?(r.capture=this.cfg.cameraCapture,r.accept="image/*"):r.accept=t,r.dispatchEvent(new MouseEvent("click")),r.onchange=()=>{[...r.files].forEach(o=>this.addFileFromObject(o,{source:e.captureCamera?rt.CAMERA:rt.LOCAL})),this._ctx.$["*currentActivity"]=x.activities.UPLOAD_LIST,this._ctx.setOrAddState("*modalActive",!0),r.value=""}});u(this,"getOutputItem",e=>{var n,l,a,c,d,h,f,m,g,y;let t=S.getCtx(e).store,r=t.fileInfo,s=t.isRemoved?"removed":t.errors.length>0?"failed":t.fileInfo?"success":t.isUploading?"uploading":"idle";return{uuid:(l=(n=r==null?void 0:r.uuid)!=null?n:t.uuid)!=null?l:null,internalId:e,name:(a=r==null?void 0:r.originalFilename)!=null?a:t.fileName,size:(c=r==null?void 0:r.size)!=null?c:t.fileSize,isImage:(d=r==null?void 0:r.isImage)!=null?d:t.isImage,mimeType:(h=r==null?void 0:r.mimeType)!=null?h:t.mimeType,file:t.file,externalUrl:t.externalUrl,cdnUrlModifiers:t.cdnUrlModifiers,cdnUrl:(m=(f=t.cdnUrl)!=null?f:r==null?void 0:r.cdnUrl)!=null?m:null,fullPath:t.fullPath,uploadProgress:t.uploadProgress,fileInfo:r!=null?r:null,metadata:(y=(g=t.metadata)!=null?g:r==null?void 0:r.metadata)!=null?y:null,isSuccess:s==="success",isUploading:s==="uploading",isFailed:s==="failed",isRemoved:s==="removed",errors:t.errors,status:s}});u(this,"getOutputCollectionState",()=>Ki(this._ctx));u(this,"initFlow",(e=!1)=>{var t;if(this._uploadCollection.size>0&&!e)this._ctx.set$({"*currentActivity":x.activities.UPLOAD_LIST}),this._ctx.setOrAddState("*modalActive",!0);else if(((t=this._sourceList)==null?void 0:t.length)===1){let r=this._sourceList[0];if(r==="local"){this._ctx.$["*currentActivity"]=x.activities.UPLOAD_LIST,this.openSystemDialog();return}let s=this._ctx.$["*blocksRegistry"],o=l=>"type"in l&&l.type===r,n=[...s].find(o);n==null||n.activate(),this._ctx.$["*currentActivity"]&&this._ctx.setOrAddState("*modalActive",!0)}else this._ctx.set$({"*currentActivity":x.activities.START_FROM}),this._ctx.setOrAddState("*modalActive",!0)});u(this,"doneFlow",()=>{this._ctx.set$({"*currentActivity":this._ctx.doneActivity,"*history":this._ctx.doneActivity?[this._ctx.doneActivity]:[]}),this._ctx.$["*currentActivity"]||this._ctx.setOrAddState("*modalActive",!1)});u(this,"setCurrentActivity",(e,t={})=>{if(this._ctx.hasBlockInCtx(r=>r.activityType===e)){this._ctx.set$({"*currentActivityParams":t,"*currentActivity":e});return}console.warn(`Activity type "${e}" not found in the context`)});u(this,"setModalState",e=>{if(e&&!this._ctx.$["*currentActivity"]){console.warn(`Can't open modal without current activity. Please use "setCurrentActivity" method first.`);return}this._ctx.setOrAddState("*modalActive",e)});this._ctx=e}get _uploadCollection(){return this._ctx.uploadCollection}get cfg(){return this._ctx.cfg}get l10n(){return this._ctx.l10n.bind(this._ctx)}removeAllFiles(){this._uploadCollection.clearAll()}get _sourceList(){let e=[];return this.cfg.sourceList&&(e=at(this.cfg.sourceList)),e}};var Er=(i,e)=>{let t=e.cfg.imgOnly,r=i.isImage;if(!(!t||r)&&!(!i.fileInfo&&i.externalUrl)&&!(!i.fileInfo&&!i.mimeType))return{type:"NOT_AN_IMAGE",message:e.l10n("images-only-accepted"),payload:{entry:i}}};var xr=(i,e)=>{let t=e.cfg.imgOnly,r=e.cfg.accept,s=Pe([...t?Jt:[],r]);if(!s.length)return;let o=i.mimeType,n=i.name;if(!o||!n)return;let l=Ar(o,s),a=ji(n,s);if(!l&&!a)return{type:"FORBIDDEN_FILE_TYPE",message:e.l10n("file-type-not-allowed"),payload:{entry:i}}};var it=1e3,It=Object.freeze({AUTO:"auto",BYTE:"byte",KB:"kb",MB:"mb",GB:"gb",TB:"tb",PB:"pb"}),Qt=i=>Math.ceil(i*100)/100,qi=(i,e=It.AUTO)=>{let t=e===It.AUTO;if(e===It.BYTE||t&&i<it**1){let r=be("en-US",i),s={one:"byte",other:"bytes"}[r];return`${i} ${s}`}return e===It.KB||t&&i<it**2?`${Qt(i/it**1)} KB`:e===It.MB||t&&i<it**3?`${Qt(i/it**2)} MB`:e===It.GB||t&&i<it**4?`${Qt(i/it**3)} GB`:e===It.TB||t&&i<it**5?`${Qt(i/it**4)} TB`:`${Qt(i/it**5)} PB`};var Tr=(i,e)=>{let t=e.cfg.maxLocalFileSizeBytes,r=i.size;if(t&&r&&r>t)return{type:"FILE_SIZE_EXCEEDED",message:e.l10n("files-max-size-limit-error",{maxFileSize:qi(t)}),payload:{entry:i}}};var Sr=(i,e)=>{let{internalId:t}=i,r=e._uploadCollection.read(t),s=r==null?void 0:r.getValue("uploadError");if(!s)return;if(s instanceof N)return{type:"UPLOAD_ERROR",message:s.message,payload:{entry:i,error:s}};if(s instanceof Rt)return{type:"NETWORK_ERROR",message:s.message,payload:{entry:i,error:s}};let o=s instanceof Error?s:new Error("Unknown error",{cause:s});return{type:"UNKNOWN_ERROR",message:o.message,payload:{entry:i,error:o}}};var Or=(i,e)=>{if(i.failedCount>0)return{type:"SOME_FILES_HAS_ERRORS",message:e.l10n("some-files-were-not-uploaded")}};var Ir=(i,e)=>{let t=i.totalCount,r=e.cfg.multiple?e.cfg.multipleMin:0,s=e.cfg.multiple?e.cfg.multipleMax:1;if(r&&t<r)return{type:"TOO_FEW_FILES",message:e.l10n("files-count-limit-error-too-few",{min:r,max:s,total:t}),payload:{total:t,min:r,max:s}};if(s&&t>s)return{type:"TOO_MANY_FILES",message:e.l10n("files-count-limit-error-too-many",{min:r,max:s,total:t}),payload:{total:t,min:r,max:s}}};var De={file:"File validator execution has failed",collection:"Collection validator execution has failed",message:"Missing message. We recommend adding message: value."},Fe=class{constructor(e){u(this,"_blockInstance");u(this,"_fileValidators",[Er,xr,Tr,Sr]);u(this,"_collectionValidators",[Ir,Or]);this._blockInstance=e,this._uploadCollection=this._blockInstance.uploadCollection;let t=()=>{this.runFileValidators(),this.runCollectionValidators()};this._blockInstance.subConfigValue("maxLocalFileSizeBytes",t),this._blockInstance.subConfigValue("multipleMin",t),this._blockInstance.subConfigValue("multipleMax",t),this._blockInstance.subConfigValue("multiple",t),this._blockInstance.subConfigValue("imgOnly",t),this._blockInstance.subConfigValue("accept",t)}runFileValidators(e){let t=e!=null?e:this._uploadCollection.items();for(let r of t){let s=this._uploadCollection.read(r);s&&this._runFileValidatorsForEntry(s)}}runCollectionValidators(){let e=this._blockInstance.api.getOutputCollectionState(),t=[];for(let r of[...this._collectionValidators,...this._addCustomTypeToValidators(this._blockInstance.cfg.collectionValidators)])try{let s=r(e,this._blockInstance.api);if(!s)continue;s&&(t.push(s),s.message||console.warn(De.message))}catch(s){console.warn(De.collection,s)}this._blockInstance.$["*collectionErrors"]=t,t.length>0&&this._blockInstance.emit(T.COMMON_UPLOAD_FAILED,()=>this._blockInstance.api.getOutputCollectionState(),{debounce:!0})}_runFileValidatorsForEntry(e){let t=this._blockInstance.api.getOutputItem(e.uid),r=[];for(let s of[...this._fileValidators,...this._addCustomTypeToValidators(this._blockInstance.cfg.fileValidators)])try{let o=s(t,this._blockInstance.api);if(!o)continue;o&&(r.push(o),o.message||console.warn(De.message))}catch(o){console.warn(De.file,o)}e.setValue("errors",r)}_addCustomTypeToValidators(e){return e.map(t=>(...r)=>{let s=t(...r);return s?{...s,type:"CUSTOM_ERROR"}:void 0})}};var Zi=Object.freeze({file:{type:File,value:null},externalUrl:{type:String,value:null},fileName:{type:String,value:null,nullable:!0},fileSize:{type:Number,value:null,nullable:!0},lastModified:{type:Number,value:Date.now()},uploadProgress:{type:Number,value:0},uuid:{type:String,value:null},isImage:{type:Boolean,value:!1},mimeType:{type:String,value:null,nullable:!0},ctxName:{type:String,value:null},cdnUrl:{type:String,value:null},cdnUrlModifiers:{type:String,value:null},fileInfo:{type:ht,value:null},isUploading:{type:Boolean,value:!1},abortController:{type:AbortController,value:null,nullable:!0},thumbUrl:{type:String,value:null,nullable:!0},silent:{type:Boolean,value:!1},source:{type:String,value:null,nullable:!0},fullPath:{type:String,value:null,nullable:!0},metadata:{type:Object,value:null,nullable:!0},errors:{type:Array,value:[]},uploadError:{type:Error,value:null,nullable:!0},isRemoved:{type:Boolean,value:!1}});var F=class i extends x{constructor(){super(...arguments);u(this,"couldBeCtxOwner",!1);u(this,"isCtxOwner",!1);u(this,"init$",Te(this));u(this,"_flushOutputItems",q(async()=>{if(this.getOutputData().length!==this.uploadCollection.size)return;let r=this.api.getOutputCollectionState();this.$["*collectionState"]=r,this.emit(T.CHANGE,()=>this.api.getOutputCollectionState(),{debounce:!0}),this.cfg.groupOutput&&r.totalCount>0&&r.status==="success"&&this._createGroup(r)},300));u(this,"_handleCollectionUpdate",(t,r,s)=>{var o;(r.size||s.size)&&(this.$["*groupInfo"]=null),this.validationManager.runFileValidators(),this.validationManager.runCollectionValidators();for(let n of r)n.getValue("silent")||this.emit(T.FILE_ADDED,this.api.getOutputItem(n.uid));for(let n of s)this.$["*uploadTrigger"].delete(n.uid),(o=n.getValue("abortController"))==null||o.abort(),n.setMultipleValues({isRemoved:!0,abortController:null,isUploading:!1,uploadProgress:0}),URL.revokeObjectURL(n==null?void 0:n.getValue("thumbUrl")),this.emit(T.FILE_REMOVED,this.api.getOutputItem(n.uid));this.$["*uploadList"]=t.map(n=>({uid:n})),this._flushCommonUploadProgress(),this._flushOutputItems()});u(this,"_handleCollectionPropertiesUpdate",t=>{this._flushOutputItems();let r=this.uploadCollection,s=[...new Set(Object.entries(t).filter(([o])=>["uploadError","fileInfo"].includes(o)).map(([,o])=>[...o]).flat())];if(s.length>0&&setTimeout(()=>{this.validationManager.runFileValidators(s)}),t.uploadProgress){for(let o of t.uploadProgress){let{isUploading:n,silent:l}=S.getCtx(o).store;n&&!l&&this.emit(T.FILE_UPLOAD_PROGRESS,this.api.getOutputItem(o))}this._flushCommonUploadProgress()}if(t.isUploading)for(let o of t.isUploading){let{isUploading:n,silent:l}=S.getCtx(o).store;n&&!l&&this.emit(T.FILE_UPLOAD_START,this.api.getOutputItem(o))}if(t.fileInfo){for(let o of t.fileInfo){let{fileInfo:n,silent:l}=S.getCtx(o).store;n&&!l&&this.emit(T.FILE_UPLOAD_SUCCESS,this.api.getOutputItem(o))}this.cfg.cropPreset&&this.setInitialCrop()}if(t.errors){for(let l of t.errors){let{errors:a}=S.getCtx(l).store;a.length>0&&(this.emit(T.FILE_UPLOAD_FAILED,this.api.getOutputItem(l)),this.emit(T.COMMON_UPLOAD_FAILED,()=>this.api.getOutputCollectionState(),{debounce:!0}))}let o=r.findItems(l=>!!l.getValue("fileInfo")),n=r.findItems(l=>l.getValue("errors").length>0);r.size>0&&n.length===0&&r.size===o.length&&this.$["*collectionErrors"].length===0&&this.emit(T.COMMON_UPLOAD_SUCCESS,this.api.getOutputCollectionState())}t.cdnUrl&&([...t.cdnUrl].filter(n=>{var l;return!!((l=this.uploadCollection.read(n))!=null&&l.getValue("cdnUrl"))}).forEach(n=>{this.emit(T.FILE_URL_CHANGED,this.api.getOutputItem(n))}),this.$["*groupInfo"]=null)});u(this,"_flushCommonUploadProgress",()=>{let t=0,s=[...this.$["*uploadTrigger"]].filter(n=>!!this.uploadCollection.read(n));s.forEach(n=>{let l=this.uploadCollection.readProp(n,"uploadProgress");t+=l});let o=s.length?Math.round(t/s.length):0;this.$["*commonProgress"]!==o&&(this.$["*commonProgress"]=o,this.emit(T.COMMON_UPLOAD_PROGRESS,this.api.getOutputCollectionState()))})}get hasCtxOwner(){return this.hasBlockInCtx(t=>t instanceof i?t.isCtxOwner&&t.isConnected&&t!==this:!1)}initCallback(){if(super.initCallback(),!this.has("*uploadCollection")){let t=new Me({typedSchema:Zi,watchList:["uploadProgress","uploadError","fileInfo","errors","cdnUrl","isUploading"]});this.add("*uploadCollection",t)}this.has("*publicApi")||this.add("*publicApi",new Re(this)),this.has("*validationManager")||this.add("*validationManager",new Fe(this)),!this.hasCtxOwner&&this.couldBeCtxOwner&&this.initCtxOwner()}get validationManager(){if(!this.has("*validationManager"))throw new Error("Unexpected error: ValidationManager is not initialized");return this.$["*validationManager"]}get api(){if(!this.has("*publicApi"))throw new Error("Unexpected error: UploaderPublicApi is not initialized");return this.$["*publicApi"]}getAPI(){return this.api}get uploadCollection(){if(!this.has("*uploadCollection"))throw new Error("Unexpected error: TypedCollection is not initialized");return this.$["*uploadCollection"]}destroyCtxCallback(){var t,r;(t=this._unobserveCollectionProperties)==null||t.call(this),(r=this._unobserveCollection)==null||r.call(this),this.uploadCollection.destroy(),this.$["*uploadCollection"]=null,super.destroyCtxCallback()}initCtxOwner(){this.isCtxOwner=!0,this._unobserveCollection=this.uploadCollection.observeCollection(this._handleCollectionUpdate),this._unobserveCollectionProperties=this.uploadCollection.observeProperties(this._handleCollectionPropertiesUpdate),this.subConfigValue("maxConcurrentRequests",t=>{this.$["*uploadQueue"].concurrency=Number(t)||1}),this.$["*secureUploadsManager"]||(this.$["*secureUploadsManager"]=new Ue(this)),this.has("*modalActive")&&this.sub("*modalActive",t=>{t&&!this.$["*currentActivity"]&&(this.$["*modalActive"]=!1)})}async _createGroup(t){let r=await this.getUploadClientOptions(),s=t.allEntries.map(a=>a.uuid+(a.cdnUrlModifiers?`/${a.cdnUrlModifiers}`:"")),o=new AbortController,n=await Ai(s,{...r,signal:o.signal});if(this.$["*collectionState"]!==t){o.abort();return}this.$["*groupInfo"]=n;let l=this.api.getOutputCollectionState();this.emit(T.GROUP_CREATED,l),this.emit(T.CHANGE,()=>this.api.getOutputCollectionState(),{debounce:!0}),this.$["*collectionState"]=l}setInitialCrop(){let t=Ri(this.cfg.cropPreset);if(t){let[r]=t,s=this.uploadCollection.findItems(o=>{var n;return o.getValue("fileInfo")&&o.getValue("isImage")&&!((n=o.getValue("cdnUrlModifiers"))!=null&&n.includes("/crop/"))}).map(o=>this.uploadCollection.read(o));for(let o of s){let n=o.getValue("fileInfo"),{width:l,height:a}=n.imageInfo,c=r.width/r.height,d=Pi(l,a,c),h=pe(`crop/${d.width}x${d.height}/${d.x},${d.y}`,"preview");o.setMultipleValues({cdnUrlModifiers:h,cdnUrl:ge(o.getValue("cdnUrl"),h)}),this.uploadCollection.size===1&&this.cfg.useCloudImageEditor&&this.hasBlockInCtx(f=>f.activityType===x.activities.CLOUD_IMG_EDIT)&&(this.$["*focusedEntry"]=o,this.$["*currentActivity"]=x.activities.CLOUD_IMG_EDIT)}}}async getMetadataFor(t){let r=this.cfg.metadata||void 0;if(typeof r=="function"){let s=this.api.getOutputItem(t);return await r(s)}return r}async getUploadClientOptions(){let r=await this.$["*secureUploadsManager"].getSecureToken().catch(()=>null);return{store:this.cfg.store,publicKey:this.cfg.pubkey,baseCDN:this.cfg.cdnCname,baseURL:this.cfg.baseUrl,userAgent:$i,integration:this.cfg.userAgentIntegration,secureSignature:r==null?void 0:r.secureSignature,secureExpire:r==null?void 0:r.secureExpire,retryThrottledRequestMaxTimes:this.cfg.retryThrottledRequestMaxTimes,multipartMinFileSize:this.cfg.multipartMinFileSize,multipartChunkSize:this.cfg.multipartChunkSize,maxConcurrentRequests:this.cfg.multipartMaxConcurrentRequests,multipartMaxAttempts:this.cfg.multipartMaxAttempts,checkForUrlDuplicates:!!this.cfg.checkForUrlDuplicates,saveUrlForRecurrentUploads:!!this.cfg.saveUrlForRecurrentUploads}}getOutputData(){return this.uploadCollection.items().map(s=>this.api.getOutputItem(s))}};F.extSrcList=Object.freeze({FACEBOOK:"facebook",DROPBOX:"dropbox",GDRIVE:"gdrive",GPHOTOS:"gphotos",INSTAGRAM:"instagram",FLICKR:"flickr",VK:"vk",EVERNOTE:"evernote",BOX:"box",ONEDRIVE:"onedrive",HUDDLE:"huddle"});F.sourceTypes=Object.freeze({LOCAL:"local",URL:"url",CAMERA:"camera",DRAW:"draw",...F.extSrcList});var R=i=>String(i),Y=i=>{let e=Number(i);if(Number.isNaN(e))throw new Error(`Invalid number: "${i}"`);return e},I=i=>{if(typeof i=="undefined"||i===null)return!1;if(typeof i=="boolean")return i;if(i==="true"||i==="")return!0;if(i==="false")return!1;throw new Error(`Invalid boolean: "${i}"`)},Wo=i=>i==="auto"?i:I(i),Ko=i=>{let e=R(i);if(e!=="user"&&e!=="environment"&&e!=="")throw new Error(`Invalid "cameraCapture" value: "${e}"`);return e},qo=i=>{if(typeof i=="object"&&!Array.isArray(i)||typeof i=="function")return i;throw new Error("Invalid metadata value. Must be an object or function.")},Zo=i=>{if(typeof i=="object")return i;throw new Error("Invalid value. Must be an object.")},kr=i=>{if(typeof i=="function")return i;throw new Error("Invalid value. Must be a function.")},Yi=i=>{if(Array.isArray(i))return i;throw new Error("Must be an array.")},Yo={pubkey:R,multiple:I,multipleMin:Y,multipleMax:Y,confirmUpload:I,imgOnly:I,accept:R,externalSourcesPreferredTypes:R,store:Wo,cameraMirror:I,cameraCapture:Ko,sourceList:R,maxLocalFileSizeBytes:Y,thumbSize:Y,showEmptyList:I,useLocalImageEditor:I,useCloudImageEditor:I,cloudImageEditorTabs:R,removeCopyright:I,cropPreset:R,imageShrink:R,modalScrollLock:I,modalBackdropStrokes:I,sourceListWrap:I,remoteTabSessionKey:R,cdnCname:R,baseUrl:R,socialBaseUrl:R,secureSignature:R,secureExpire:R,secureDeliveryProxy:R,retryThrottledRequestMaxTimes:Y,multipartMinFileSize:Y,multipartChunkSize:Y,maxConcurrentRequests:Y,multipartMaxConcurrentRequests:Y,multipartMaxAttempts:Y,checkForUrlDuplicates:I,saveUrlForRecurrentUploads:I,groupOutput:I,userAgentIntegration:R,debug:I,localeName:R,metadata:qo,secureUploadsExpireThreshold:Y,localeDefinitionOverride:Zo,secureUploadsSignatureResolver:kr,secureDeliveryProxyUrlResolver:kr,iconHrefResolver:kr,fileValidators:Yi,collectionValidators:Yi},Ji=(i,e)=>{if(!(typeof e=="undefined"||e===null))try{return Yo[i](e)}catch(t){return console.error(`Invalid value for config key "${i}".`,t),Z[i]}};function Jo(i){return new Promise(e=>{typeof window.FileReader!="function"&&e(!1);try{let t=new FileReader;t.onerror=()=>{e(!0)};let r=s=>{s.type!=="loadend"&&t.abort(),e(!1)};t.onloadend=r,t.onprogress=r,t.readAsDataURL(i)}catch{e(!1)}})}function Qo(i,e){return new Promise(t=>{let r=0,s=[],o=l=>{l||(console.warn("Unexpectedly received empty content entry",{scope:"drag-and-drop"}),t(null)),l.isFile?(r++,l.file(a=>{r--;let c=new File([a],a.name,{type:a.type||e});s.push({type:"file",file:c,fullPath:l.fullPath}),r===0&&t(s)})):l.isDirectory&&n(l.createReader())},n=l=>{r++,l.readEntries(a=>{r--;for(let c of a)o(c);r===0&&t(s)})};o(i)})}function Qi(i){let e=[],t=[];for(let r=0;r<i.items.length;r++){let s=i.items[r];if(s)if(s.kind==="file"){let o=s.type;if(typeof s.webkitGetAsEntry=="function"||typeof s.getAsEntry=="function"){let l=typeof s.webkitGetAsEntry=="function"?s.webkitGetAsEntry():s.getAsEntry();t.push(Qo(l,o).then(a=>{a&&e.push(...a)}));continue}let n=s.getAsFile();n&&t.push(Jo(n).then(l=>{l||e.push({type:"file",file:n})}))}else s.kind==="string"&&s.type.match("^text/uri-list")&&t.push(new Promise(o=>{s.getAsString(n=>{e.push({type:"url",url:n}),o(void 0)})}))}return Promise.all(t).then(()=>e)}var V={ACTIVE:0,INACTIVE:1,NEAR:2,OVER:3},ts=["focus"],tn=100,Ur=new Map;function en(i,e){let t=Math.max(Math.min(i[0],e.x+e.width),e.x),r=Math.max(Math.min(i[1],e.y+e.height),e.y);return Math.sqrt((i[0]-t)*(i[0]-t)+(i[1]-r)*(i[1]-r))}function Lr(i){let e=0,t=document.body,r=new Set,s=g=>r.add(g),o=V.INACTIVE,n=g=>{i.shouldIgnore()&&g!==V.INACTIVE||(o!==g&&r.forEach(y=>y(g)),o=g)},l=()=>e>0;s(g=>i.onChange(g));let a=()=>{e=0,n(V.INACTIVE)},c=()=>{e+=1,o===V.INACTIVE&&n(V.ACTIVE)},d=()=>{e-=1,l()||n(V.INACTIVE)},h=g=>{g.preventDefault(),e=0,n(V.INACTIVE)},f=g=>{if(i.shouldIgnore())return;l()||(e+=1);let y=[g.x,g.y],C=i.element.getBoundingClientRect(),A=Math.floor(en(y,C)),w=A<tn,_=g.composedPath().includes(i.element);Ur.set(i.element,A);let M=Math.min(...Ur.values())===A;_&&M?(g.preventDefault(),n(V.OVER)):n(w&&M?V.NEAR:V.ACTIVE)},m=async g=>{if(i.shouldIgnore())return;g.preventDefault();let y=await Qi(g.dataTransfer);i.onItems(y),n(V.INACTIVE)};return t.addEventListener("drop",h),t.addEventListener("dragleave",d),t.addEventListener("dragenter",c),t.addEventListener("dragover",f),i.element.addEventListener("drop",m),ts.forEach(g=>{window.addEventListener(g,a)}),()=>{Ur.delete(i.element),t.removeEventListener("drop",h),t.removeEventListener("dragleave",d),t.removeEventListener("dragenter",c),t.removeEventListener("dragover",f),i.element.removeEventListener("drop",m),ts.forEach(g=>{window.removeEventListener(g,a)})}}var es="uc-drop-area",Ft=`${es}/registry`,te=class te extends F{constructor(){super(),this.init$={...this.init$,state:V.INACTIVE,withIcon:!1,isClickable:!1,isFullscreen:!1,isEnabled:!0,isVisible:!0,text:"",[Ft]:null}}isActive(){if(!this.$.isEnabled)return!1;let e=this.getBoundingClientRect(),t=e.width>0&&e.height>0,r=e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth),s=window.getComputedStyle(this),o=s.visibility!=="hidden"&&s.display!=="none";return t&&o&&r}initCallback(){super.initCallback(),this.bindL10n("text",()=>this.l10n("drop-files-here")),this.$[Ft]||(this.$[Ft]=new Set),this.$[Ft].add(this),this.defineAccessor("disabled",t=>{this.set$({isEnabled:!I(t)})}),this.defineAccessor("clickable",t=>{this.set$({isClickable:I(t)})}),this.defineAccessor("with-icon",t=>{this.set$({withIcon:I(t)})}),this.defineAccessor("fullscreen",t=>{this.set$({isFullscreen:I(t)})}),this.defineAccessor("text",t=>{typeof t=="string"?this.bindL10n("text",()=>this.l10n(t)||t):this.bindL10n("text",()=>this.l10n("drop-files-here"))}),this._destroyDropzone=Lr({element:this,shouldIgnore:()=>this._shouldIgnore(),onChange:t=>{this.$.state=t},onItems:t=>{t.length&&(t.forEach(r=>{r.type==="url"?this.api.addFileFromUrl(r.url,{source:rt.DROP_AREA}):r.type==="file"&&this.api.addFileFromObject(r.file,{source:rt.DROP_AREA,fullPath:r.fullPath})}),this.uploadCollection.size&&(this.set$({"*currentActivity":x.activities.UPLOAD_LIST}),this.setOrAddState("*modalActive",!0)))}});let e=this.ref["content-wrapper"];e&&(this._destroyContentWrapperDropzone=Lr({element:e,onChange:t=>{var s;let r=(s=Object.entries(V).find(([,o])=>o===t))==null?void 0:s[0].toLowerCase();r&&e.setAttribute("drag-state",r)},onItems:()=>{},shouldIgnore:()=>this._shouldIgnore()})),this.sub("state",t=>{var s;let r=(s=Object.entries(V).find(([,o])=>o===t))==null?void 0:s[0].toLowerCase();r&&this.setAttribute("drag-state",r)}),this.subConfigValue("sourceList",t=>{let r=at(t);this.$.isEnabled=r.includes(F.sourceTypes.LOCAL),this.$.isVisible=this.$.isEnabled||!this.querySelector("[data-default-slot]")}),this.sub("isVisible",t=>{this.toggleAttribute("hidden",!t)}),this.sub("isClickable",t=>{this.toggleAttribute("clickable",t)}),this.$.isClickable&&(this._onAreaClicked=t=>{t.type==="keydown"?(t.code==="Space"||t.code==="Enter")&&this.api.openSystemDialog():t.type==="click"&&this.api.openSystemDialog()},this.addEventListener("keydown",this._onAreaClicked),this.addEventListener("click",this._onAreaClicked))}_shouldIgnore(){return!this.$.isEnabled||!this._couldHandleFiles()?!0:this.$.isFullscreen?[...this.$[Ft]].filter(r=>r!==this).filter(r=>r.isActive()).length>0:!1}_couldHandleFiles(){let e=this.cfg.multiple,t=this.cfg.multipleMax,r=this.uploadCollection.size;return!(e&&t&&r>=t||!e&&r>0)}destroyCallback(){var t,r;super.destroyCallback();let e=this.$[Ft];e&&(e.delete(this),e.size===0&&S.deleteCtx(es)),(t=this._destroyDropzone)==null||t.call(this),(r=this._destroyContentWrapperDropzone)==null||r.call(this),this._onAreaClicked&&(this.removeEventListener("keydown",this._onAreaClicked),this.removeEventListener("click",this._onAreaClicked))}};u(te,"styleAttrs",[...ne(te,te,"styleAttrs"),"uc-drop-area"]);var ee=te;ee.template=U`<slot><div data-default-slot hidden></div><div ref="content-wrapper" class="uc-content-wrapper" bind="@hidden: !isVisible"><div class="uc-icon-container" bind="@hidden: !withIcon"><uc-icon name="default"></uc-icon><uc-icon name="arrow-down"></uc-icon></div><span class="uc-text">{{text}}</span></div></slot>`;ee.bindAttributes({"with-icon":null,clickable:null,text:null,fullscreen:null,disabled:null});var rs=(i,e)=>{let t,r,s,o=(...n)=>{t?(clearTimeout(r),r=setTimeout(()=>{Date.now()-s>=e&&(i(...n),s=Date.now())},Math.max(e-(Date.now()-s),0))):(i(...n),s=Date.now(),t=!0)};return Object.defineProperty(o,"cancel",{configurable:!1,writable:!1,enumerable:!1,value:()=>{clearTimeout(r)}}),o};var $e=class extends F{constructor(){super();u(this,"couldBeCtxOwner",!0);u(this,"historyTracked",!0);u(this,"activityType",x.activities.UPLOAD_LIST);u(this,"_throttledHandleCollectionUpdate",rs(()=>{this.isConnected&&(this._updateUploadsState(),!this.couldOpenActivity&&this.$["*currentActivity"]===this.activityType&&this.historyBack())},300));this.init$={...this.init$,doneBtnVisible:!1,doneBtnEnabled:!1,uploadBtnVisible:!1,addMoreBtnVisible:!1,addMoreBtnEnabled:!1,headerText:"",commonErrorMessage:"",hasFiles:!1,onAdd:()=>{this.api.initFlow(!0)},onUpload:()=>{this.emit(T.UPLOAD_CLICK),this.api.uploadAll(),this._throttledHandleCollectionUpdate()},onDone:()=>{this.emit(T.DONE_CLICK,this.api.getOutputCollectionState()),this.api.doneFlow()},onCancel:()=>{this.uploadCollection.clearAll()}}}_updateUploadsState(){let t=this.api.getOutputCollectionState(),r={total:t.totalCount,succeed:t.successCount,uploading:t.uploadingCount,failed:t.failedCount},s=!t.errors.some(f=>f.type==="TOO_MANY_FILES"||f.type==="TOO_FEW_FILES"),o=t.errors.some(f=>f.type==="TOO_MANY_FILES"),n=t.totalCount===(this.cfg.multiple?this.cfg.multipleMax:1),l=r.failed===0&&t.errors.length===0,a=!1,c=!1,d=!1;if(r.total-r.succeed-r.uploading-r.failed>0&&s)a=!0;else{c=!0;let f=this.cfg.groupOutput?!!t.group:!0;d=r.total===r.succeed&&s&&l&&f}this.set$({doneBtnVisible:c,doneBtnEnabled:d,uploadBtnVisible:a,addMoreBtnEnabled:r.total===0||!o&&!n,addMoreBtnVisible:!n||this.cfg.multiple}),this.bindL10n("headerText",()=>this._getHeaderText(r))}_getHeaderText(t){let r=s=>{let o=t[s];return this.l10n(`header-${s}`,{count:o})};return t.uploading>0?r("uploading"):t.failed>0?r("failed"):t.succeed>0?r("succeed"):r("total")}get couldOpenActivity(){return this.cfg.showEmptyList||this.uploadCollection.size>0}initCallback(){super.initCallback(),this.registerActivity(this.activityType),this.subConfigValue("multiple",this._throttledHandleCollectionUpdate),this.subConfigValue("multipleMin",this._throttledHandleCollectionUpdate),this.subConfigValue("multipleMax",this._throttledHandleCollectionUpdate),this.sub("*groupInfo",t=>{t&&this._throttledHandleCollectionUpdate()}),this.sub("*currentActivity",t=>{!this.couldOpenActivity&&t===this.activityType&&(this.$["*currentActivity"]=this.initActivity)}),this.uploadCollection.observeProperties(this._throttledHandleCollectionUpdate),this.sub("*uploadList",t=>{this._throttledHandleCollectionUpdate(),this.set$({hasFiles:t.length>0}),this.cfg.confirmUpload||this.api.uploadAll()},!1),this.sub("*collectionErrors",t=>{let r=t.filter(s=>s.type!=="SOME_FILES_HAS_ERRORS")[0];if(!r){this.set$({commonErrorMessage:null});return}this.set$({commonErrorMessage:r.message})})}destroyCallback(){super.destroyCallback(),this.uploadCollection.unobserveProperties(this._throttledHandleCollectionUpdate)}};$e.template=U`<uc-activity-header><span class="uc-header-text">{{headerText}}</span><button type="button" class="uc-mini-btn uc-close-btn" bind="onclick: *closeModal"><uc-icon name="close"></uc-icon></button></uc-activity-header><div class="uc-no-files" bind="@hidden: hasFiles"><slot name="empty"><span l10n="no-files"></span></slot></div><div class="uc-files" itemize="*uploadList" item-tag="uc-file-item"></div><div class="uc-common-error" bind="@hidden: !commonErrorMessage; textContent: commonErrorMessage;"></div><div class="uc-toolbar"><button type="button" class="uc-cancel-btn uc-secondary-btn" bind="onclick: onCancel;" l10n="clear"></button><div class="uc-toolbar-spacer"></div><button type="button" class="uc-add-more-btn uc-secondary-btn" bind="onclick: onAdd; @disabled: !addMoreBtnEnabled; @hidden: !addMoreBtnVisible" ><uc-icon name="add"></uc-icon><span l10n="add-more"></span></button><button type="button" class="uc-upload-btn uc-primary-btn" bind="@hidden: !uploadBtnVisible; onclick: onUpload;" l10n="upload" ></button><button type="button" class="uc-done-btn uc-primary-btn" bind="@hidden: !doneBtnVisible; onclick: onDone; @disabled: !doneBtnEnabled" l10n="done" ></button></div><uc-drop-area ghost></uc-drop-area>`;var Ve=()=>{let i=[];return{stack:i,promiseReadJpegChunks:t=>new Promise((r,s)=>{let o=2,n=(c,d)=>{let h=new FileReader;h.addEventListener("load",()=>{d(new DataView(h.result))}),h.addEventListener("error",f=>{s(`Reader error: ${f}`)}),h.readAsArrayBuffer(c)},l=()=>n(t.slice(o,o+128),c=>{let d,h,f;for(d=h=0,f=c.byteLength;f>=0?h<f:h>f;d=f>=0?++h:--h)if(c.getUint8(d)===255){o+=d;break}a()}),a=()=>{let c=o;return n(t.slice(o,o+=4),d=>{if(d.byteLength!==4||d.getUint8(0)!==255){s("Corrupted");return}let h=d.getUint8(1);if(h===218){r(!0);return}let f=d.getUint16(2)-2;return n(t.slice(o,o+=f),m=>{if(m.byteLength!==f){s("Corrupted");return}i.push({startPos:c,length:f,marker:h,view:m}),l()})})};FileReader&&DataView||s("Not Support"),n(t.slice(0,2),c=>{c.getUint16(0)!==65496&&s("Not jpeg"),l()})})}},rn=async i=>{let e=[],{promiseReadJpegChunks:t,stack:r}=Ve();return await t(i),r.forEach(({marker:s,view:o})=>{s===226&&o.getUint32(0)===1229144927&&o.getUint32(4)===1347571526&&o.getUint32(8)===1229735168&&e.push(o)}),e},ss=async(i,e,t)=>{{let r=[],s=[],{promiseReadJpegChunks:o,stack:n}=Ve();await o(i),n.forEach(c=>{if(c.marker===e)return r.push(c.startPos),s.push(c.length)});let l=[i.slice(0,2)];for(let c of t){let d=new DataView(new ArrayBuffer(4));d.setUint16(0,65280+e),d.setUint16(2,c.byteLength+2),l.push(d.buffer),l.push(c)}let a=2;for(let c=0;c<r.length;c++)r[c]>a&&l.push(i.slice(a,r[c])),a=r[c]+s[c]+4;return l.push(i.slice(a,i.size)),new Blob(l,{type:i.type})}};var os=(i,e)=>ss(i,226,e.map(t=>t.buffer)),sn=async i=>{try{return await os(i,[])}catch(e){throw new Error(`Failed to strip ICC profile: ${e}`)}},on=(i,e,t)=>new Promise((r,s)=>{let o=n=>{if(!n){s("Failed to convert canvas to blob");return}r(n)};i.toBlob(o,e,t),i.width=i.height=1}),re=()=>{let i=document.createElement("canvas"),e=i.getContext("2d");return{canvas:i,ctx:e}},nn=i=>{let{ctx:t,canvas:r}=re();r.width=r.height=50,t.drawImage(i,0,0,50,50);let s=t.getImageData(0,0,50,50).data;r.width=r.height=1;for(let o=3;o<s.length;o+=4)if(s[o]<254)return!0;return!1},ln=async i=>{let e=null,{promiseReadJpegChunks:t,stack:r}=Ve();return await t(i),r.forEach(({marker:s,view:o})=>{if(!e&&s===225&&o.byteLength>=14&&o.getUint32(0)===1165519206&&o.getUint16(4)===0){e=o;return}}),e},an="data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QA6RXhpZgAATU0AKgAAAAgAAwESAAMAAAABAAYAAAEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAIBASIA/8QAJgABAAAAAAAAAAAAAAAAAAAAAxABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAAPwBH/9k=",Ne,cn=()=>new Promise(i=>{if(Ne!==void 0)i(Ne);else{let e=new Image;e.addEventListener("load",()=>{Ne=e.naturalWidth<e.naturalHeight,e.src="//:0",i(Ne)}),e.src=an}}),un=(i,e)=>{let t,r,s,o;if(!i||i.byteLength<14||i.getUint32(0)!==1165519206||i.getUint16(4)!==0)return;if(i.getUint16(6)===18761)r=!0;else if(i.getUint16(6)===19789)r=!1;else return;if(i.getUint16(8,r)!==42)return;s=8+i.getUint32(10,r);let n=i.getUint16(s-2,r);for(t=0,o=n;o>=0?t<o:t>o;o>=0?++t:--t){if(i.byteLength<s+10)return;i.getUint16(s,r)===274&&e(s+8,r),s+=12}},hn=(i,e)=>{un(i,(t,r)=>i.setUint16(t,e,r))},dn=async(i,e,t)=>(t&&hn(e,1),ss(i,225,[e.buffer])),fn=(i,e)=>new Promise((t,r)=>{e&&(i.src=e),i.complete?t(i):(i.addEventListener("load",()=>{t(i)}),i.addEventListener("error",()=>{r(new Error("Failed to load image. Probably not an image."))}))}),pn=i=>fn(new Image,i),mn=[1,3],gn=[192,193,194,195,197,198,199,201,202,203,205,206,207],is={squareSide:[Math.floor(Math.sqrt(5*1e3*1e3)),4096,8192,11180,10836,11402,14188,16384],dimension:[4096,8192,16384,32767,65535]},yn=async i=>{let e=!1,{promiseReadJpegChunks:t,stack:r}=Ve();return await t(i).then(()=>(r.forEach(({marker:s,view:o})=>{if(!e&&gn.indexOf(s)>=0){let n=o.getUint8(5);mn.indexOf(n)<0&&(e=!0)}}),e)).catch(()=>e)},ns=(i,e)=>{let t={};return(...r)=>{let s=e(r,t);return s in t?t[s]:t[s]=i(...r)}},ls=(i,e)=>{let[t]=i,r=Object.keys(e).map(s=>parseInt(s,10)).sort((s,o)=>s-o);for(let s=0;s<r.length;s++){let o=r[s],n=!!e[o];if(o>t&&n||o<t&&!n)return o}return t},Ct={R:55,G:110,B:165,A:255},bn=`rgba(${Ct.R}, ${Ct.G}, ${Ct.B}, ${Ct.A/255})`,as=(i,e)=>{try{let t=[i-1,e-1,1,1],{canvas:r,ctx:s}=re();r.width=1,r.height=1;let{canvas:o,ctx:n}=re();o.width=i,o.height=e,n&&(n.fillStyle=bn,n.fillRect(...t),s.drawImage(o,i-1,e-1,1,1,0,0,1,1));let l=s&&s.getImageData(0,0,1,1).data,a=!1;return l&&(a=l[0]===Ct.R&&l[1]===Ct.G&&l[2]===Ct.B&&l[3]===Ct.A),o.width=o.height=1,a}catch{return console.error(`Failed to test for max canvas size of ${i}x${e}.`),!1}};function cs(i){return(...e)=>new Promise(t=>{setTimeout(()=>{let r=i(...e);t(r)},0)})}var _n=cs(ns(as,ls)),wn=cs(ns(as,ls)),us=async(i,e)=>{let t=is.squareSide.find(n=>n*n>=i*e),r=is.dimension.find(n=>n>=i&&n>=e);if(!t||!r)throw new Error("Not supported");let[s,o]=await Promise.all([_n(t,t),wn(r,1)]);if(s&&o)return!0;throw new Error("Not supported")},hs=async(i,e,t)=>{try{let{ctx:r,canvas:s}=re();return s.width=e,s.height=t,r.imageSmoothingQuality="high",r.drawImage(i,0,0,e,t),i instanceof HTMLImageElement&&(i.src="//:0"),i instanceof HTMLCanvasElement&&(i.width=i.height=1),s}catch(r){throw new Error("Canvas resize error",{cause:r})}},vn=({img:i,targetW:e,targetH:t})=>hs(i,e,t),Cn=function({sourceW:i,targetW:e,targetH:t,step:r}){let s=[],o=e,n=t;do s.push([o,n]),o=Math.round(o/r),n=Math.round(n/r);while(o<i*r);return s.reverse()},An=({img:i,sourceW:e,targetW:t,targetH:r,step:s})=>Cn({sourceW:e,targetW:t,targetH:r,step:s}).reduce((n,[l,a])=>n.then(c=>us(l,a).then(()=>hs(c,l,a)).catch(()=>c)),Promise.resolve(i)),En=()=>/iPad|iPhone|iPod/.test(navigator.platform)?!0:navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform),xn=navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform),Mr=.71,Tn=(i,e)=>{if(i.width*Mr*i.height*Mr<e.size)throw new Error("Not required");let t=i.width,r=i.height,s=t/r,o=Math.floor(Math.sqrt(e.size*s)),n=Math.floor(e.size/Math.sqrt(e.size*s));return us(o,n).then(()=>{let{ctx:l}=re();return"imageSmoothingQuality"in l&&!En()&&!xn?vn({img:i,targetW:o,targetH:n}):An({img:i,sourceW:t,targetW:o,targetH:n,step:Mr})}).catch(()=>Promise.reject("Not supported"))},ds=async(i,e)=>{try{if(await yn(i))throw new Error("Should skipped");let r=await Promise.allSettled([ln(i),cn(),rn(i)]),o=!r.some(y=>y.status==="rejected"),[n,l,a]=r,c=await sn(i).catch(()=>i),d=await pn(URL.createObjectURL(c));URL.revokeObjectURL(d.src);let h=await Tn(d,e),f="image/jpeg",m=(e==null?void 0:e.quality)||.8;!o&&nn(h)&&(f="image/png",m=void 0);let g=await on(h,f,m);if(o&&n.status==="fulfilled"&&n.value){let y=n.value,C=l.status==="fulfilled"?l.value:!1;g=await dn(g,y,C)}return o&&a.status==="fulfilled"&&a.value.length>0&&(g=await os(g,a.value)),g}catch(t){let r;throw t instanceof Error&&(r=t.message),typeof t=="string"&&(r=t),new Error(`Failed to shrink image. ${r?`Message: "${r}".`:""}`,{cause:t})}};function Sn(i){let e=new Blob([i],{type:"image/svg+xml"});return URL.createObjectURL(e)}function Pr(i="hsl(209, 21%, 65%)",e=32,t=32){return Sn(`<svg width="${e}" height="${t}" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" fill="${i}" d="M9.68848 8.70068C9.68848 8.42454 9.91233 8.20068 10.1885 8.20068H15.0885C15.2211 8.20068 15.3483 8.25336 15.442 8.34713L20.342 13.2471C20.4358 13.3409 20.4885 13.4681 20.4885 13.6007V21.3007C20.4885 21.5768 20.2646 21.8007 19.9885 21.8007H10.1885C9.91233 21.8007 9.68848 21.5768 9.68848 21.3007V8.70068ZM10.6885 9.20068V20.8007H19.4885V14.1007L15.0885 14.1007C14.8123 14.1007 14.5885 13.8768 14.5885 13.6007L14.5885 9.20068H10.6885ZM15.5885 9.90779L18.7814 13.1007L15.5885 13.1007L15.5885 9.90779Z"/></svg>`)}function fs(i,e=40){if(i.type==="image/svg+xml")return URL.createObjectURL(i);let t=document.createElement("canvas"),r=t.getContext("2d"),s=new Image,o=new Promise((n,l)=>{s.onload=()=>{let a=s.height/s.width;a>1?(t.width=e,t.height=e*a):(t.height=e,t.width=e/a),r.fillStyle="rgb(240, 240, 240)",r.fillRect(0,0,t.width,t.height),r.drawImage(s,0,0,t.width,t.height),t.toBlob(c=>{if(!c){l();return}let d=URL.createObjectURL(c);n(d)})},s.onerror=a=>{l(a)}});return s.src=URL.createObjectURL(i),o}var On=/^([0-9]+)x([0-9]+)(?:\s+(\d{1,2}|100)%)?$/i,ps=i=>{let e=On.exec(i==null?void 0:i.toLocaleLowerCase())||[];if(!e.length)return!1;let t=e[1]*e[2],r=16384*16384;return t>r?(console.warn(`Shrinked size can not be larger than ${Math.floor(r/1e3/1e3)}MP. You have set ${e[1]}x${e[2]} (${Math.ceil(t/1e3/100)/10}MP).`),!1):{quality:e[3]?e[3]/100:void 0,size:t}};var G=Object.freeze({FINISHED:Symbol(0),FAILED:Symbol(1),UPLOADING:Symbol(2),IDLE:Symbol(3)}),ie=class i extends F{constructor(){super();u(this,"couldBeCtxOwner",!0);u(this,"pauseRender",!0);u(this,"_entrySubs",new Set);u(this,"_entry",null);u(this,"_isIntersecting",!1);u(this,"_debouncedGenerateThumb",q(this._generateThumbnail.bind(this),100));u(this,"_debouncedCalculateState",q(this._calculateState.bind(this),100));u(this,"_renderedOnce",!1);this.init$={...this.init$,uid:"",itemName:"",errorText:"",thumbUrl:"",progressValue:0,progressVisible:!1,badgeIcon:"",isFinished:!1,isFailed:!1,isUploading:!1,isFocused:!1,isEditable:!1,state:G.IDLE,onEdit:()=>{this.set$({"*focusedEntry":this._entry}),this.hasBlockInCtx(t=>t.activityType===x.activities.DETAILS)?this.$["*currentActivity"]=x.activities.DETAILS:this.$["*currentActivity"]=x.activities.CLOUD_IMG_EDIT},onRemove:()=>{this.uploadCollection.remove(this.$.uid)},onUpload:()=>{this.upload()}}}_reset(){for(let t of this._entrySubs)t.remove();this._debouncedGenerateThumb.cancel(),this._debouncedCalculateState.cancel(),this._entrySubs=new Set,this._entry=null}_observerCallback(t){let[r]=t;this._isIntersecting=r.isIntersecting,r.isIntersecting&&!this._renderedOnce&&(this.render(),this._renderedOnce=!0),r.intersectionRatio===0?this._debouncedGenerateThumb.cancel():this._debouncedGenerateThumb()}_calculateState(){if(!this._entry)return;let t=this._entry,r=G.IDLE;t.getValue("errors").length>0?r=G.FAILED:t.getValue("isUploading")?r=G.UPLOADING:t.getValue("fileInfo")&&(r=G.FINISHED),this.$.state=r}async _generateThumbnail(){var r;if(!this._entry)return;let t=this._entry;if(t.getValue("fileInfo")&&t.getValue("isImage")){let s=this.cfg.thumbSize,o=await this.proxyUrl(ge(ei(this.cfg.cdnCname,this._entry.getValue("uuid")),pe(t.getValue("cdnUrlModifiers"),`scale_crop/${s}x${s}/center`))),n=t.getValue("thumbUrl");n!==o&&(t.setValue("thumbUrl",o),n!=null&&n.startsWith("blob:")&&URL.revokeObjectURL(n));return}if(!t.getValue("thumbUrl"))if((r=t.getValue("file"))!=null&&r.type.includes("image"))try{let s=await fs(t.getValue("file"),this.cfg.thumbSize);t.setValue("thumbUrl",s)}catch{let o=window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");t.setValue("thumbUrl",Pr(o))}else{let s=window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");t.setValue("thumbUrl",Pr(s))}}_subEntry(t,r){let s=this._entry.subscribe(t,o=>{this.isConnected&&r(o)});this._entrySubs.add(s)}_handleEntryId(t){var s;this._reset();let r=(s=this.uploadCollection)==null?void 0:s.read(t);this._entry=r,r&&(this._subEntry("uploadProgress",o=>{this.$.progressValue=o}),this._subEntry("fileName",o=>{this.$.itemName=o||r.getValue("externalUrl")||this.l10n("file-no-name"),this._debouncedCalculateState()}),this._subEntry("externalUrl",o=>{this.$.itemName=r.getValue("fileName")||o||this.l10n("file-no-name")}),this._subEntry("fileInfo",o=>{this._debouncedCalculateState(),o&&this._isIntersecting&&this._debouncedGenerateThumb()}),this._subEntry("cdnUrlModifiers",()=>{this._isIntersecting&&this._debouncedGenerateThumb()}),this._subEntry("thumbUrl",o=>{this.$.thumbUrl=o?`url(${o})`:""}),this._subEntry("errors",()=>this._debouncedCalculateState()),this._subEntry("isUploading",()=>this._debouncedCalculateState()),this._subEntry("fileSize",()=>this._debouncedCalculateState()),this._subEntry("mimeType",()=>this._debouncedCalculateState()),this._subEntry("isImage",()=>this._debouncedCalculateState()),this._isIntersecting&&this._debouncedGenerateThumb())}initCallback(){super.initCallback(),this.sub("uid",t=>{this._handleEntryId(t)}),this.sub("state",t=>{this._handleState(t)}),this.subConfigValue("useCloudImageEditor",()=>this._debouncedCalculateState()),this.onclick=()=>{i.activeInstances.forEach(t=>{t===this?t.setAttribute("focused",""):t.removeAttribute("focused")})},this.sub("*uploadTrigger",t=>{t.has(this._entry.uid)&&setTimeout(()=>this.isConnected&&this.upload())}),i.activeInstances.add(this)}_handleState(t){var r,s,o,n,l;t===G.FAILED?this.$.badgeIcon="badge-error":t===G.FINISHED&&(this.$.badgeIcon="badge-success"),t===G.UPLOADING?this.$.isFocused=!1:this.$.progressValue=0,this.set$({isFailed:t===G.FAILED,isUploading:t===G.UPLOADING,isFinished:t===G.FINISHED,progressVisible:t===G.UPLOADING,isEditable:this.cfg.useCloudImageEditor&&((r=this._entry)==null?void 0:r.getValue("isImage"))&&((s=this._entry)==null?void 0:s.getValue("cdnUrl")),errorText:(l=(n=(o=this._entry.getValue("errors"))==null?void 0:o[0])==null?void 0:n.message)!=null?l:""})}destroyCallback(){super.destroyCallback(),i.activeInstances.delete(this),this._reset()}connectedCallback(){super.connectedCallback(),this._observer=new window.IntersectionObserver(this._observerCallback.bind(this),{threshold:[0,1]}),this._observer.observe(this)}disconnectedCallback(){var t;super.disconnectedCallback(),this._debouncedGenerateThumb.cancel(),(t=this._observer)==null||t.disconnect()}_settingsOfShrink(){return ps(this.cfg.imageShrink)}_processShrink(t){return ds(t,this._settingsOfShrink())}async upload(){var s,o,n,l,a;let t=this._entry;if(!this.uploadCollection.read(t.uid)||t.getValue("fileInfo")||t.getValue("isUploading")||t.getValue("errors").length>0)return;let r=this.cfg.multiple?this.cfg.multipleMax:1;if(!(r&&this.uploadCollection.size>r)){this._debouncedCalculateState(),t.setValue("isUploading",!0),t.setValue("errors",[]);try{let c=new AbortController;t.setValue("abortController",c);let d=async()=>{let f=t.getValue("file");f&&this.cfg.imageShrink&&(f=await this._processShrink(f).catch(()=>f));let m=f||t.getValue("externalUrl")||t.getValue("uuid"),y={...await this.getUploadClientOptions(),fileName:t.getValue("fileName"),source:t.getValue("source"),onProgress:C=>{if(C.isComputable){let A=C.value*100;t.setValue("uploadProgress",A)}},signal:c.signal,metadata:await this.getMetadataFor(t.uid)};return this.debugPrint("upload options",m,y),gr(m,y)},h=await this.$["*uploadQueue"].add(d);t.setMultipleValues({fileInfo:h,isUploading:!1,fileName:h.originalFilename,fileSize:h.size,isImage:h.isImage,mimeType:(n=(o=(s=h.contentInfo)==null?void 0:s.mime)==null?void 0:o.mime)!=null?n:h.mimeType,uuid:h.uuid,cdnUrl:(l=t.getValue("cdnUrl"))!=null?l:h.cdnUrl,cdnUrlModifiers:(a=t.getValue("cdnUrlModifiers"))!=null?a:"",uploadProgress:100}),t===this._entry&&this._debouncedCalculateState()}catch(c){c instanceof _t&&c.isCancel?t.setMultipleValues({isUploading:!1,uploadProgress:0}):t.setMultipleValues({isUploading:!1,uploadProgress:0,uploadError:c}),t===this._entry&&this._debouncedCalculateState()}}}};ie.template=U`<div class="uc-inner" bind="@finished: isFinished; @uploading: isUploading; @failed: isFailed; @focused: isFocused"><div class="uc-thumb" bind="style.backgroundImage: thumbUrl"><div class="uc-badge"><uc-icon bind="@name: badgeIcon"></uc-icon></div></div><div class="uc-file-name-wrapper"><span class="uc-file-name" bind="@title: itemName">{{itemName}}</span><span class="uc-file-error" bind="@hidden: !errorText">{{errorText}}</span></div><div class="uc-file-actions"><button type="button" l10n="@title:file-item-edit-button" class="uc-edit-btn uc-mini-btn" bind="onclick: onEdit; @hidden: !isEditable" ><uc-icon name="edit-file"></uc-icon></button><button type="button" l10n="@title:file-item-remove-button" class="uc-remove-btn uc-mini-btn" bind="onclick: onRemove;" ><uc-icon name="remove-file"></uc-icon></button><button type="button" class="uc-upload-btn uc-mini-btn" bind="onclick: onUpload;"><uc-icon name="upload"></uc-icon></button></div><uc-progress-bar class="uc-progress-bar" bind="value: progressValue; visible: progressVisible;"></uc-progress-bar></div>`;ie.activeInstances=new Set;var se=class extends D{constructor(){super(),this.init$={...this.init$,name:"",href:""}}initCallback(){super.initCallback(),this.sub("name",e=>{if(!e)return;let t=`#uc-icon-${e}`;this.subConfigValue("iconHrefResolver",r=>{if(r){let s=r(e);t=s!=null?s:t}this.$.href=t})})}};se.template=U`<svg ref="svg" xmlns="http://www.w3.org/2000/svg"><use bind="@href: href;"></use></svg>`;se.bindAttributes({name:"name"});var ze=class extends D{constructor(){super(...arguments);u(this,"_value",0);u(this,"init$",{...this.init$,width:0,opacity:0})}initCallback(){super.initCallback(),this.defineAccessor("value",t=>{if(t===void 0)return;let r=this._value;if(this._value=t,t===0&&r>0){this.ref.line.addEventListener("transitionend",()=>{this.style.setProperty("--l-width",this._value.toString())});return}this.style.setProperty("--l-width",this._value.toString())}),this.defineAccessor("visible",t=>{this.ref.line.classList.toggle("uc-progress--hidden",!t)})}};ze.template=U`<div ref="line" class="uc-progress"></div>`;var je=class extends D{initCallback(){super.initCallback(),this.subConfigValue("removeCopyright",e=>{this.toggleAttribute("hidden",!!e)})}};u(je,"template",U`<a href="https://uploadcare.com/?utm_source=copyright&utm_medium=referral&utm_campaign=v4" target="_blank noopener" class="uc-credits" >Powered by Uploadcare</a >`);var Rr=class extends F{constructor(){super(...arguments);u(this,"requireCtxName",!0)}_createValidationInput(){let t=document.createElement("input");return t.type="text",t.name=this.ctxName,t.required=this.cfg.multipleMin>0,t.tabIndex=-1,tr(t,{opacity:0,height:0,width:0}),t}initCallback(){super.initCallback(),this._validationInputElement=this._createValidationInput(),this.appendChild(this._validationInputElement),this.sub("*collectionState",t=>{var r;{if(this._dynamicInputsContainer||(this._dynamicInputsContainer=document.createElement("div"),this.appendChild(this._dynamicInputsContainer)),!this._validationInputElement){let l=this._createValidationInput();this.appendChild(l),this._validationInputElement=l}if(this._dynamicInputsContainer.innerHTML="",t.status==="uploading"||t.status==="idle"){this._validationInputElement.value="",this._validationInputElement.setCustomValidity("");return}if(t.status==="failed"){let l=(r=t.errors[0])==null?void 0:r.message;this._validationInputElement.value="",this._validationInputElement.setCustomValidity(l);return}let s=t.group?t.group:null;if(s){this._validationInputElement.value=s.cdnUrl,this._validationInputElement.setCustomValidity("");return}let o=t.allEntries.map(l=>l.cdnUrl);if(!this.cfg.multiple&&o.length===1){this._validationInputElement.value=o[0],this._validationInputElement.setCustomValidity("");return}this._validationInputElement.remove(),this._validationInputElement=null;let n=new DocumentFragment;for(let l of o){let a=document.createElement("input");a.type="hidden",a.name=`${this.ctxName}[]`,a.value=l,n.appendChild(a)}this._dynamicInputsContainer.replaceChildren(n)}},!1)}};var Be=i=>{var e;return(e=i.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))==null?void 0:e.map(t=>t.toLowerCase()).join("-")};var Dr=[...new Set(["debug",...Object.keys(Z)])],In=["metadata","localeDefinitionOverride","secureUploadsSignatureResolver","secureDeliveryProxyUrlResolver","iconHrefResolver","fileValidators","collectionValidators"],kn=i=>In.includes(i),$t=Dr.filter(i=>!kn(i)),Un={...Object.fromEntries($t.map(i=>[Be(i),i])),...Object.fromEntries($t.map(i=>[i.toLowerCase(),i]))},Ln={...Object.fromEntries($t.map(i=>[Be(i),B(i)])),...Object.fromEntries($t.map(i=>[i.toLowerCase(),B(i)]))},ms=i=>"__"+i,oe=class extends D{constructor(){super();u(this,"requireCtxName",!0);this.init$={...this.init$,...Object.fromEntries(Object.entries(Z).map(([t,r])=>[B(t),r]))}}_flushValueToAttribute(t,r){if($t.includes(t)){let s=[...new Set([Be(t),t.toLowerCase()])];for(let o of s)typeof r=="undefined"||r===null?this.removeAttribute(o):this.getAttribute(o)!==r.toString()&&this.setAttribute(o,r.toString())}}_flushValueToState(t,r){this.$[B(t)]!==r&&(typeof r=="undefined"||r===null?this.$[B(t)]=Z[t]:this.$[B(t)]=r)}_setValue(t,r){let s=this,o=Ji(t,r),n=ms(t);s[n]!==o&&(this._assertSameValueDifferentReference(t,s[n],o),s[n]=o,this._flushValueToAttribute(t,o),this._flushValueToState(t,o),this.debugPrint(`[uc-config] "${t}"`,o))}_getValue(t){let r=this,s=ms(t);return r[s]}_assertSameValueDifferentReference(t,r,s){this.cfg.debug&&s!==r&&typeof s=="object"&&typeof r=="object"&&JSON.stringify(s)===JSON.stringify(r)&&(console.warn(`[uc-config] Option "${t}" value is the same as the previous one but the reference is different`),console.warn("[uc-config] You should avoid changing the reference of the object to prevent unnecessary calculations"),console.warn(`[uc-config] "${t}" previous value:`,r),console.warn(`[uc-config] "${t}" new value:`,s))}initCallback(){var r;super.initCallback();let t=this;for(let s of $t)this.sub(B(s),o=>{this._setValue(s,o)},!1);for(let s of Dr){let o=(r=t[s])!=null?r:this.$[B(s)];o!==Z[s]&&this._setValue(s,o),Object.defineProperty(this,s,{set:n=>{this._setValue(s,n)},get:()=>this._getValue(s)})}}attributeChangedCallback(t,r,s){if(r===s)return;let o=this,n=Un[t];o[n]=s}};oe.bindAttributes(Ln);for(let i of Dr)oe.prototype[i]=void 0;var Mn=oe;var He=class extends F{constructor(){super(...arguments);u(this,"requireCtxName",!0)}initCallback(){super.initCallback(),this.$["*eventEmitter"].bindTarget(this)}destroyCallback(){super.destroyCallback(),this.$["*eventEmitter"].unbindTarget(this)}};He.EventType=T;var Pn=He;export{Mn as Config,je as Copyright,ee as DropArea,ie as FileItem,Ie as FileUploaderMinimal,Rr as FormInput,se as Icon,ze as ProgressBar,ke as StartFrom,Pn as UploadCtxProvider,$e as UploadList,Cs as defineComponents,$r as defineLocale};
26
+ var Ui=Object.defineProperty;var Ii=Object.getPrototypeOf;var ki=Reflect.get;var Li=(r,e,t)=>e in r?Ui(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var d=(r,e,t)=>(Li(r,typeof e!="symbol"?e+"":e,t),t);var Mt=(r,e,t)=>ki(Ii(r),t,e);function Mi(r){for(let e in r){let t=[...e].reduce((i,s)=>(s.toUpperCase()===s&&(s="-"+s.toLowerCase()),i+=s),"");t.startsWith("-")&&(t=t.replace("-","")),t.startsWith("uc-")||(t="uc-"+t),r[e].reg&&r[e].reg(t)}}var yt={"locale-id":"en","social-source-lang":"en","upload-file":"Upload file","upload-files":"Upload files","choose-file":"Choose file","choose-files":"Choose files","drop-files-here":"Drop files here","select-file-source":"Select file source",selected:"Selected",upload:"Upload","add-more":"Add more",cancel:"Cancel","start-from-cancel":"Cancel",clear:"Clear","camera-shot":"Shot","upload-url":"Import","upload-url-placeholder":"Paste link here","edit-image":"Edit image","edit-detail":"Details",back:"Back",done:"Done",ok:"Ok","remove-from-list":"Remove",no:"No",yes:"Yes","confirm-your-action":"Confirm your action","are-you-sure":"Are you sure?","selected-count":"Selected:","upload-error":"Upload error","validation-error":"Validation error","no-files":"No files selected",browse:"Browse","not-uploaded-yet":"Not uploaded yet...",file__one:"file",file__other:"files",error__one:"error",error__other:"errors","header-uploading":"Uploading {{count}} {{plural:file(count)}}","header-failed":"{{count}} {{plural:error(count)}}","header-succeed":"{{count}} {{plural:file(count)}} uploaded","header-total":"{{count}} {{plural:file(count)}} selected","src-type-local":"From device","src-type-from-url":"From link","src-type-camera":"Camera","src-type-draw":"Draw","src-type-facebook":"Facebook","src-type-dropbox":"Dropbox","src-type-gdrive":"Google Drive","src-type-gphotos":"Google Photos","src-type-instagram":"Instagram","src-type-flickr":"Flickr","src-type-vk":"VK","src-type-evernote":"Evernote","src-type-box":"Box","src-type-onedrive":"Onedrive","src-type-huddle":"Huddle","src-type-other":"Other","caption-from-url":"Import from link","caption-camera":"Camera","caption-draw":"Draw","caption-edit-file":"Edit file","file-no-name":"No name...","toggle-fullscreen":"Toggle fullscreen","toggle-guides":"Toggle guides",rotate:"Rotate","flip-vertical":"Flip vertical","flip-horizontal":"Flip horizontal",apply:"Apply",brightness:"Brightness",contrast:"Contrast",saturation:"Saturation",exposure:"Exposure",gamma:"Gamma",vibrance:"Vibrance",warmth:"Warmth",enhance:"Enhance",original:"Original",resize:"Resize image",crop:"Crop","select-color":"Select color",text:"Text",draw:"Draw","cancel-edit":"Cancel edit","tab-view":"Preview","tab-details":"Details","file-name":"Name","file-size":"Size","cdn-url":"CDN URL","file-size-unknown":"Unknown","camera-permissions-denied":"Camera access denied","camera-permissions-prompt":"Please allow access to the camera","camera-permissions-request":"Request access","files-count-limit-error-title":"Files count limit overflow","files-count-limit-error-too-few":"You\u2019ve chosen {{total}} {{plural:file(total)}}. At least {{min}} {{plural:file(min)}} required.","files-count-limit-error-too-many":"You\u2019ve chosen too many files. {{max}} {{plural:file(max)}} is maximum.","files-max-size-limit-error":"File is too big. Max file size is {{maxFileSize}}.","has-validation-errors":"File validation error ocurred. Please, check your files before upload.","images-only-accepted":"Only image files are accepted.","file-type-not-allowed":"Uploading of these file types is not allowed.","some-files-were-not-uploaded":"Some files were not uploaded.","file-item-edit-button":"Edit button","file-item-remove-button":"Remove button"};var Pt=new Map,ge=new Map,er=(r,e)=>{Pt.has(r)&&console.log(`Locale ${r} is already defined. Overwriting...`),Pt.set(r,{...yt,...e})},Pi=(r,e)=>{ge.set(r,e)},rr=(r,e)=>{typeof e=="function"?Pi(r,e):er(r,e)},ir=async r=>{if(!Pt.has(r)){if(!ge.has(r))throw new Error(`Locale ${r} is not defined`);let t=await ge.get(r)();er(r,t)}return Pt.get(r)};rr("en",yt);function V(r,e){let t,i=(...s)=>{clearTimeout(t),t=setTimeout(()=>r(...s),e)};return i.cancel=()=>{clearTimeout(t)},i}var x=Object.freeze({FILE_ADDED:"file-added",FILE_REMOVED:"file-removed",FILE_UPLOAD_START:"file-upload-start",FILE_UPLOAD_PROGRESS:"file-upload-progress",FILE_UPLOAD_SUCCESS:"file-upload-success",FILE_UPLOAD_FAILED:"file-upload-failed",FILE_URL_CHANGED:"file-url-changed",MODAL_OPEN:"modal-open",MODAL_CLOSE:"modal-close",DONE_CLICK:"done-click",UPLOAD_CLICK:"upload-click",ACTIVITY_CHANGE:"activity-change",COMMON_UPLOAD_START:"common-upload-start",COMMON_UPLOAD_PROGRESS:"common-upload-progress",COMMON_UPLOAD_SUCCESS:"common-upload-success",COMMON_UPLOAD_FAILED:"common-upload-failed",CHANGE:"change",GROUP_CREATED:"group-created"}),Rt=class{constructor(e){d(this,"_timeoutStore",new Map);d(this,"_targets",new Set);d(this,"_debugPrint",null);this._debugPrint=e}bindTarget(e){this._targets.add(e)}unbindTarget(e){this._targets.delete(e)}_dispatch(e,t){var i;for(let s of this._targets)s.dispatchEvent(new CustomEvent(e,{detail:t}));(i=this._debugPrint)==null||i.call(this,()=>{let s=t&&typeof t=="object"?{...t}:t;return[`event "${e}"`,s]})}emit(e,t,{debounce:i}={}){if(typeof i!="number"&&!i){this._dispatch(e,typeof t=="function"?t():t);return}this._timeoutStore.has(e)&&window.clearTimeout(this._timeoutStore.get(e));let s=typeof i=="number"?i:20,o=window.setTimeout(()=>{this._dispatch(e,typeof t=="function"?t():t),this._timeoutStore.delete(e)},s);this._timeoutStore.set(e,o)}};var Ri=Object.defineProperty,Fi=(r,e,t)=>e in r?Ri(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,be=(r,e,t)=>(Fi(r,typeof e!="symbol"?e+"":e,t),t);function Di(r){let e=t=>{var i;for(let s in t)((i=t[s])==null?void 0:i.constructor)===Object&&(t[s]=e(t[s]));return{...t}};return e(r)}var v=class{constructor(r){r.constructor===Object?this.store=Di(r):(this._storeIsProxy=!0,this.store=r),this.callbackMap=Object.create(null)}static warn(r,e){console.warn(`Symbiote Data: cannot ${r}. Prop name: `+e)}read(r){return!this._storeIsProxy&&!this.store.hasOwnProperty(r)?(v.warn("read",r),null):this.store[r]}has(r){return this._storeIsProxy?this.store[r]!==void 0:this.store.hasOwnProperty(r)}add(r,e,t=!1){!t&&Object.keys(this.store).includes(r)||(this.store[r]=e,this.notify(r))}pub(r,e){if(!this._storeIsProxy&&!this.store.hasOwnProperty(r)){v.warn("publish",r);return}this.store[r]=e,this.notify(r)}multiPub(r){for(let e in r)this.pub(e,r[e])}notify(r){this.callbackMap[r]&&this.callbackMap[r].forEach(e=>{e(this.store[r])})}sub(r,e,t=!0){return!this._storeIsProxy&&!this.store.hasOwnProperty(r)?(v.warn("subscribe",r),null):(this.callbackMap[r]||(this.callbackMap[r]=new Set),this.callbackMap[r].add(e),t&&e(this.store[r]),{remove:()=>{this.callbackMap[r].delete(e),this.callbackMap[r].size||delete this.callbackMap[r]},callback:e})}static registerCtx(r,e=Symbol()){let t=v.globalStore.get(e);return t?console.warn('State: context UID "'+e+'" already in use'):(t=new v(r),v.globalStore.set(e,t)),t}static deleteCtx(r){v.globalStore.delete(r)}static getCtx(r,e=!0){return v.globalStore.get(r)||(e&&console.warn('State: wrong context UID - "'+r+'"'),null)}};v.globalStore=new Map;var b=Object.freeze({BIND_ATTR:"set",ATTR_BIND_PRFX:"@",EXT_DATA_CTX_PRFX:"*",NAMED_DATA_CTX_SPLTR:"/",CTX_NAME_ATTR:"ctx-name",CTX_OWNER_ATTR:"ctx-owner",CSS_CTX_PROP:"--ctx-name",EL_REF_ATTR:"ref",AUTO_TAG_PRFX:"sym",REPEAT_ATTR:"repeat",REPEAT_ITEM_TAG_ATTR:"repeat-item-tag",SET_LATER_KEY:"__toSetLater__",USE_TPL:"use-template",ROOT_STYLE_ATTR_NAME:"sym-component"}),nr="1234567890QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm",$i=nr.length-1,_t=class{static generate(r="XXXXXXXXX-XXX"){let e="";for(let t=0;t<r.length;t++)e+=r[t]==="-"?r[t]:nr.charAt(Math.random()*$i);return e}};function lr(r,e,t){let i=!0,s,o=e.split(".");return o.forEach((n,l)=>{l<o.length-1?r=r[n]:s=n}),r?r[s]=t:i=!1,i}function Ni(r){return r.split("-").map((e,t)=>e&&t?e[0].toUpperCase()+e.slice(1):e).join("").split("_").map((e,t)=>e&&t?e.toUpperCase():e).join("")}function Vi(r,e){[...r.querySelectorAll(`[${b.REPEAT_ATTR}]`)].forEach(t=>{let i=t.getAttribute(b.REPEAT_ITEM_TAG_ATTR),s;if(i&&(s=window.customElements.get(i)),!s){s=class extends e.BaseComponent{constructor(){super(),i||(this.style.display="contents")}};let n=t.innerHTML;s.template=n,s.reg(i)}for(;t.firstChild;)t.firstChild.remove();let o=t.getAttribute(b.REPEAT_ATTR);e.sub(o,n=>{if(!n){for(;t.firstChild;)t.firstChild.remove();return}let l=[...t.children],a,c=h=>{h.forEach((f,m)=>{if(l[m])if(l[m].set$)setTimeout(()=>{l[m].set$(f)});else for(let p in f)l[m][p]=f[p];else{a||(a=new DocumentFragment);let p=new s;Object.assign(p.init$,f),a.appendChild(p)}}),a&&t.appendChild(a);let u=l.slice(h.length,l.length);for(let f of u)f.remove()};if(n.constructor===Array)c(n);else if(n.constructor===Object){let h=[];for(let u in n){let f=n[u];Object.defineProperty(f,"_KEY_",{value:u,enumerable:!0}),h.push(f)}c(h)}else console.warn("Symbiote repeat data type error:"),console.log(n)}),t.removeAttribute(b.REPEAT_ATTR),t.removeAttribute(b.REPEAT_ITEM_TAG_ATTR)})}var sr="__default__";function zi(r,e){if(e.shadowRoot)return;let t=[...r.querySelectorAll("slot")];if(!t.length)return;let i={};t.forEach(s=>{let o=s.getAttribute("name")||sr;i[o]={slot:s,fr:document.createDocumentFragment()}}),e.initChildren.forEach(s=>{var o;let n=sr;s instanceof Element&&s.hasAttribute("slot")&&(n=s.getAttribute("slot"),s.removeAttribute("slot")),(o=i[n])==null||o.fr.appendChild(s)}),Object.values(i).forEach(s=>{if(s.fr.childNodes.length)s.slot.parentNode.replaceChild(s.fr,s.slot);else if(s.slot.childNodes.length){let o=document.createDocumentFragment();o.append(...s.slot.childNodes),s.slot.parentNode.replaceChild(o,s.slot)}else s.slot.remove()})}function ji(r,e){[...r.querySelectorAll(`[${b.EL_REF_ATTR}]`)].forEach(t=>{let i=t.getAttribute(b.EL_REF_ATTR);e.ref[i]=t,t.removeAttribute(b.EL_REF_ATTR)})}function Bi(r,e){[...r.querySelectorAll(`[${b.BIND_ATTR}]`)].forEach(t=>{let s=t.getAttribute(b.BIND_ATTR).split(";");[...t.attributes].forEach(o=>{if(o.name.startsWith("-")&&o.value){let n=Ni(o.name.replace("-",""));s.push(n+":"+o.value),t.removeAttribute(o.name)}}),s.forEach(o=>{if(!o)return;let n=o.split(":").map(h=>h.trim()),l=n[0],a;l.indexOf(b.ATTR_BIND_PRFX)===0&&(a=!0,l=l.replace(b.ATTR_BIND_PRFX,""));let c=n[1].split(",").map(h=>h.trim());for(let h of c){let u;h.startsWith("!!")?(u="double",h=h.replace("!!","")):h.startsWith("!")&&(u="single",h=h.replace("!","")),e.sub(h,f=>{u==="double"?f=!!f:u==="single"&&(f=!f),a?(f==null?void 0:f.constructor)===Boolean?f?t.setAttribute(l,""):t.removeAttribute(l):t.setAttribute(l,f):lr(t,l,f)||(t[b.SET_LATER_KEY]||(t[b.SET_LATER_KEY]=Object.create(null)),t[b.SET_LATER_KEY][l]=f)})}}),t.removeAttribute(b.BIND_ATTR)})}var Ft="{{",bt="}}",Hi="skip-text";function Gi(r){let e,t=[],i=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,{acceptNode:s=>{var o;return!((o=s.parentElement)!=null&&o.hasAttribute(Hi))&&s.textContent.includes(Ft)&&s.textContent.includes(bt)&&1}});for(;e=i.nextNode();)t.push(e);return t}var Xi=function(r,e){Gi(r).forEach(i=>{let s=[],o;for(;i.textContent.includes(bt);)i.textContent.startsWith(Ft)?(o=i.textContent.indexOf(bt)+bt.length,i.splitText(o),s.push(i)):(o=i.textContent.indexOf(Ft),i.splitText(o)),i=i.nextSibling;s.forEach(n=>{let l=n.textContent.replace(Ft,"").replace(bt,"");n.textContent="",e.sub(l,a=>{n.textContent=a})})})},Wi=[Vi,zi,ji,Bi,Xi],Dt="'",ht='"',qi=/\\([0-9a-fA-F]{1,6} ?)/g;function Ki(r){return(r[0]===ht||r[0]===Dt)&&(r[r.length-1]===ht||r[r.length-1]===Dt)}function Zi(r){return(r[0]===ht||r[0]===Dt)&&(r=r.slice(1)),(r[r.length-1]===ht||r[r.length-1]===Dt)&&(r=r.slice(0,-1)),r}function Yi(r){let e="",t="";for(var i=0;i<r.length;i++){let s=r[i+1];r[i]==="\\"&&s==='"'?(e+='\\"',i++):r[i]==='"'&&t!=="\\"?e+='\\"':e+=r[i],t=r[i]}return e}function Ji(r){let e=r;Ki(r)&&(e=Zi(e),e=e.replace(qi,(t,i)=>String.fromCodePoint(parseInt(i.trim(),16))),e=e.replaceAll(`\\
27
+ `,"\\n"),e=Yi(e),e=ht+e+ht);try{return JSON.parse(e)}catch{throw new Error(`Failed to parse CSS property value: ${e}. Original input: ${r}`)}}var or=0,dt=null,K=null,it=class extends HTMLElement{constructor(){super(),be(this,"updateCssData",()=>{var r;this.dropCssDataCache(),(r=this.__boundCssProps)==null||r.forEach(e=>{let t=this.getCssData(this.__extractCssName(e),!0);t!==null&&this.$[e]!==t&&(this.$[e]=t)})}),this.init$=Object.create(null),this.cssInit$=Object.create(null),this.tplProcessors=new Set,this.ref=Object.create(null),this.allSubs=new Set,this.pauseRender=!1,this.renderShadow=!1,this.readyToDestroy=!0,this.processInnerHtml=!1,this.allowCustomTemplate=!1,this.ctxOwner=!1}get BaseComponent(){return it}initCallback(){}__initCallback(){var r;this.__initialized||(this.__initialized=!0,(r=this.initCallback)==null||r.call(this))}render(r,e=this.renderShadow){let t;if((e||this.constructor.__shadowStylesUrl)&&!this.shadowRoot&&this.attachShadow({mode:"open"}),this.allowCustomTemplate){let s=this.getAttribute(b.USE_TPL);if(s){let o=this.getRootNode(),n=(o==null?void 0:o.querySelector(s))||document.querySelector(s);n?r=n.content.cloneNode(!0):console.warn(`Symbiote template "${s}" is not found...`)}}if(this.processInnerHtml)for(let s of this.tplProcessors)s(this,this);if(r||this.constructor.template){if(this.constructor.template&&!this.constructor.__tpl&&(this.constructor.__tpl=document.createElement("template"),this.constructor.__tpl.innerHTML=this.constructor.template),(r==null?void 0:r.constructor)===DocumentFragment)t=r;else if((r==null?void 0:r.constructor)===String){let s=document.createElement("template");s.innerHTML=r,t=s.content.cloneNode(!0)}else this.constructor.__tpl&&(t=this.constructor.__tpl.content.cloneNode(!0));for(let s of this.tplProcessors)s(t,this)}let i=()=>{t&&(e&&this.shadowRoot.appendChild(t)||this.appendChild(t)),this.__initCallback()};if(this.constructor.__shadowStylesUrl){e=!0;let s=document.createElement("link");s.rel="stylesheet",s.href=this.constructor.__shadowStylesUrl,s.onload=i,this.shadowRoot.prepend(s)}else i()}addTemplateProcessor(r){this.tplProcessors.add(r)}get autoCtxName(){return this.__autoCtxName||(this.__autoCtxName=_t.generate(),this.style.setProperty(b.CSS_CTX_PROP,`'${this.__autoCtxName}'`)),this.__autoCtxName}get cssCtxName(){return this.getCssData(b.CSS_CTX_PROP,!0)}get ctxName(){var r;let e=((r=this.getAttribute(b.CTX_NAME_ATTR))==null?void 0:r.trim())||this.cssCtxName||this.__cachedCtxName||this.autoCtxName;return this.__cachedCtxName=e,e}get localCtx(){return this.__localCtx||(this.__localCtx=v.registerCtx({},this)),this.__localCtx}get nodeCtx(){return v.getCtx(this.ctxName,!1)||v.registerCtx({},this.ctxName)}static __parseProp(r,e){let t,i;if(r.startsWith(b.EXT_DATA_CTX_PRFX))t=e.nodeCtx,i=r.replace(b.EXT_DATA_CTX_PRFX,"");else if(r.includes(b.NAMED_DATA_CTX_SPLTR)){let s=r.split(b.NAMED_DATA_CTX_SPLTR);t=v.getCtx(s[0]),i=s[1]}else t=e.localCtx,i=r;return{ctx:t,name:i}}sub(r,e,t=!0){let i=o=>{this.isConnected&&e(o)},s=it.__parseProp(r,this);s.ctx.has(s.name)?this.allSubs.add(s.ctx.sub(s.name,i,t)):window.setTimeout(()=>{this.allSubs.add(s.ctx.sub(s.name,i,t))})}notify(r){let e=it.__parseProp(r,this);e.ctx.notify(e.name)}has(r){let e=it.__parseProp(r,this);return e.ctx.has(e.name)}add(r,e,t=!1){let i=it.__parseProp(r,this);i.ctx.add(i.name,e,t)}add$(r,e=!1){for(let t in r)this.add(t,r[t],e)}get $(){if(!this.__stateProxy){let r=Object.create(null);this.__stateProxy=new Proxy(r,{set:(e,t,i)=>{let s=it.__parseProp(t,this);return s.ctx.pub(s.name,i),!0},get:(e,t)=>{let i=it.__parseProp(t,this);return i.ctx.read(i.name)}})}return this.__stateProxy}set$(r,e=!1){for(let t in r){let i=r[t];e||![String,Number,Boolean].includes(i==null?void 0:i.constructor)?this.$[t]=i:this.$[t]!==i&&(this.$[t]=i)}}get __ctxOwner(){return this.ctxOwner||this.hasAttribute(b.CTX_OWNER_ATTR)&&this.getAttribute(b.CTX_OWNER_ATTR)!=="false"}__initDataCtx(){let r=this.constructor.__attrDesc;if(r)for(let e of Object.values(r))Object.keys(this.init$).includes(e)||(this.init$[e]="");for(let e in this.init$)if(e.startsWith(b.EXT_DATA_CTX_PRFX))this.nodeCtx.add(e.replace(b.EXT_DATA_CTX_PRFX,""),this.init$[e],this.__ctxOwner);else if(e.includes(b.NAMED_DATA_CTX_SPLTR)){let t=e.split(b.NAMED_DATA_CTX_SPLTR),i=t[0].trim(),s=t[1].trim();if(i&&s){let o=v.getCtx(i,!1);o||(o=v.registerCtx({},i)),o.add(s,this.init$[e])}}else this.localCtx.add(e,this.init$[e]);for(let e in this.cssInit$)this.bindCssData(e,this.cssInit$[e]);this.__dataCtxInitialized=!0}connectedCallback(){var r;if(this.isConnected){if(this.__disconnectTimeout&&window.clearTimeout(this.__disconnectTimeout),!this.connectedOnce){let e=(r=this.getAttribute(b.CTX_NAME_ATTR))==null?void 0:r.trim();if(e&&this.style.setProperty(b.CSS_CTX_PROP,`'${e}'`),this.__initDataCtx(),this[b.SET_LATER_KEY]){for(let t in this[b.SET_LATER_KEY])lr(this,t,this[b.SET_LATER_KEY][t]);delete this[b.SET_LATER_KEY]}this.initChildren=[...this.childNodes];for(let t of Wi)this.addTemplateProcessor(t);if(this.pauseRender)this.__initCallback();else if(this.constructor.__rootStylesLink){let t=this.getRootNode();if(!t)return;if(t==null?void 0:t.querySelector(`link[${b.ROOT_STYLE_ATTR_NAME}="${this.constructor.is}"]`)){this.render();return}let s=this.constructor.__rootStylesLink.cloneNode(!0);s.setAttribute(b.ROOT_STYLE_ATTR_NAME,this.constructor.is),s.onload=()=>{this.render()},t.nodeType===Node.DOCUMENT_NODE?t.head.appendChild(s):t.prepend(s)}else this.render()}this.connectedOnce=!0}}destroyCallback(){}disconnectedCallback(){this.connectedOnce&&(this.dropCssDataCache(),this.readyToDestroy&&(this.__disconnectTimeout&&window.clearTimeout(this.__disconnectTimeout),this.__disconnectTimeout=window.setTimeout(()=>{this.destroyCallback();for(let r of this.allSubs)r.remove(),this.allSubs.delete(r);for(let r of this.tplProcessors)this.tplProcessors.delete(r);K==null||K.delete(this.updateCssData),K!=null&&K.size||(dt==null||dt.disconnect(),dt=null,K=null)},100)))}static reg(r,e=!1){r||(or++,r=`${b.AUTO_TAG_PRFX}-${or}`),this.__tag=r;let t=window.customElements.get(r);if(t){!e&&t!==this&&console.warn([`Element with tag name "${r}" already registered.`,`You're trying to override it with another class "${this.name}".`,"This is most likely a mistake.","New element will not be registered."].join(`
28
+ `));return}window.customElements.define(r,e?class extends this{}:this)}static get is(){return this.__tag||this.reg(),this.__tag}static bindAttributes(r){this.observedAttributes=Object.keys(r),this.__attrDesc=r}attributeChangedCallback(r,e,t){var i;if(e===t)return;let s=(i=this.constructor.__attrDesc)==null?void 0:i[r];s?this.__dataCtxInitialized?this.$[s]=t:this.init$[s]=t:this[r]=t}getCssData(r,e=!1){if(this.__cssDataCache||(this.__cssDataCache=Object.create(null)),!Object.keys(this.__cssDataCache).includes(r)){this.__computedStyle||(this.__computedStyle=window.getComputedStyle(this));let t=this.__computedStyle.getPropertyValue(r).trim();try{this.__cssDataCache[r]=Ji(t)}catch{!e&&console.warn(`CSS Data error: ${r}`),this.__cssDataCache[r]=null}}return this.__cssDataCache[r]}__extractCssName(r){return r.split("--").map((e,t)=>t===0?"":e).join("--")}__initStyleAttrObserver(){K||(K=new Set),K.add(this.updateCssData),dt||(dt=new MutationObserver(r=>{r[0].type==="attributes"&&K.forEach(e=>{e()})}),dt.observe(document,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}))}bindCssData(r,e=""){this.__boundCssProps||(this.__boundCssProps=new Set),this.__boundCssProps.add(r);let t=this.getCssData(this.__extractCssName(r),!0);t===null&&(t=e),this.add(r,t),this.__initStyleAttrObserver()}dropCssDataCache(){this.__cssDataCache=null,this.__computedStyle=null}defineAccessor(r,e,t){let i="__"+r;this[i]=this[r],Object.defineProperty(this,r,{set:s=>{this[i]=s,t?window.setTimeout(()=>{e==null||e(s)}):e==null||e(s)},get:()=>this[i]}),this[r]=this[i]}static set shadowStyles(r){let e=new Blob([r],{type:"text/css"});this.__shadowStylesUrl=URL.createObjectURL(e)}static set rootStyles(r){if(!this.__rootStylesLink){let e=new Blob([r],{type:"text/css"}),t=URL.createObjectURL(e),i=document.createElement("link");i.href=t,i.rel="stylesheet",this.__rootStylesLink=i}}},_e=it;be(_e,"template");var ye=class{static _print(r){console.warn(r)}static setDefaultTitle(r){this.defaultTitle=r}static setRoutingMap(r){Object.assign(this.appMap,r);for(let e in this.appMap)!this.defaultRoute&&this.appMap[e].default===!0?this.defaultRoute=e:!this.errorRoute&&this.appMap[e].error===!0&&(this.errorRoute=e)}static set routingEventName(r){this.__routingEventName=r}static get routingEventName(){return this.__routingEventName||"sym-on-route"}static readAddressBar(){let r={route:null,options:{}};return window.location.search.split(this.separator).forEach(t=>{if(t.includes("?"))r.route=t.replace("?","");else if(t.includes("=")){let i=t.split("=");r.options[i[0]]=decodeURI(i[1])}else r.options[t]=!0}),r}static notify(){let r=this.readAddressBar(),e=this.appMap[r.route];if(e&&e.title&&(document.title=e.title),r.route===null&&this.defaultRoute){this.applyRoute(this.defaultRoute);return}else if(!e&&this.errorRoute){this.applyRoute(this.errorRoute);return}else if(!e&&this.defaultRoute){this.applyRoute(this.defaultRoute);return}else if(!e){this._print(`Route "${r.route}" not found...`);return}let t=new CustomEvent(ye.routingEventName,{detail:{route:r.route,options:Object.assign(e||{},r.options)}});window.dispatchEvent(t)}static reflect(r,e={}){let t=this.appMap[r];if(!t){this._print("Wrong route: "+r);return}let i="?"+r;for(let o in e)e[o]===!0?i+=this.separator+o:i+=this.separator+o+`=${e[o]}`;let s=t.title||this.defaultTitle||"";window.history.pushState(null,s,i),document.title=s}static applyRoute(r,e={}){this.reflect(r,e),this.notify()}static setSeparator(r){this._separator=r}static get separator(){return this._separator||"&"}static createRouterData(r,e){this.setRoutingMap(e);let t=v.registerCtx({route:null,options:null,title:null},r);return window.addEventListener(this.routingEventName,i=>{var s;t.multiPub({route:i.detail.route,options:i.detail.options,title:((s=i.detail.options)==null?void 0:s.title)||this.defaultTitle||""})}),ye.notify(),this.initPopstateListener(),t}static initPopstateListener(){this.__onPopstate||(this.__onPopstate=()=>{this.notify()},window.addEventListener("popstate",this.__onPopstate))}static removePopstateListener(){window.removeEventListener("popstate",this.__onPopstate),this.__onPopstate=null}};ye.appMap=Object.create(null);function ar(r,e){for(let t in e)t.includes("-")?r.style.setProperty(t,e[t]):r.style[t]=e[t]}var cr="idb-store-ready",Qi="symbiote-db",ts="symbiote-idb-update_",es=class{_notifyWhenReady(r=null){window.dispatchEvent(new CustomEvent(cr,{detail:{dbName:this.name,storeName:this.storeName,event:r}}))}get _updEventName(){return ts+this.name}_getUpdateEvent(r){return new CustomEvent(this._updEventName,{detail:{key:this.name,newValue:r}})}_notifySubscribers(r){window.localStorage.removeItem(this.name),window.localStorage.setItem(this.name,r),window.dispatchEvent(this._getUpdateEvent(r))}constructor(r,e){this.name=r,this.storeName=e,this.version=1,this.request=window.indexedDB.open(this.name,this.version),this.request.onupgradeneeded=t=>{this.db=t.target.result,this.objStore=this.db.createObjectStore(e,{keyPath:"_key"}),this.objStore.transaction.oncomplete=i=>{this._notifyWhenReady(i)}},this.request.onsuccess=t=>{this.db=t.target.result,this._notifyWhenReady(t)},this.request.onerror=t=>{console.error(t)},this._subscriptionsMap={},this._updateHandler=t=>{t.key===this.name&&this._subscriptionsMap[t.newValue]&&this._subscriptionsMap[t.newValue].forEach(async s=>{s(await this.read(t.newValue))})},this._localUpdateHandler=t=>{this._updateHandler(t.detail)},window.addEventListener("storage",this._updateHandler),window.addEventListener(this._updEventName,this._localUpdateHandler)}read(r){let t=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).get(r);return new Promise((i,s)=>{t.onsuccess=o=>{var n;(n=o.target.result)!=null&&n._value?i(o.target.result._value):(i(null),console.warn(`IDB: cannot read "${r}"`))},t.onerror=o=>{s(o)}})}write(r,e,t=!1){let i={_key:r,_value:e},o=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).put(i);return new Promise((n,l)=>{o.onsuccess=a=>{t||this._notifySubscribers(r),n(a.target.result)},o.onerror=a=>{l(a)}})}delete(r,e=!1){let i=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).delete(r);return new Promise((s,o)=>{i.onsuccess=n=>{e||this._notifySubscribers(r),s(n)},i.onerror=n=>{o(n)}})}getAll(){let e=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).getAll();return new Promise((t,i)=>{e.onsuccess=s=>{let o=s.target.result;t(o.map(n=>n._value))},e.onerror=s=>{i(s)}})}subscribe(r,e){this._subscriptionsMap[r]||(this._subscriptionsMap[r]=new Set);let t=this._subscriptionsMap[r];return t.add(e),{remove:()=>{t.delete(e),t.size||delete this._subscriptionsMap[r]}}}stop(){window.removeEventListener("storage",this._updateHandler),this._subscriptionsMap=null,ur.clear(this.name)}},ur=class{static get readyEventName(){return cr}static open(r=Qi,e="store"){let t=r+"/"+e;return this._reg[t]||(this._reg[t]=new es(r,e)),this._reg[t]}static clear(r){window.indexedDB.deleteDatabase(r);for(let e in this._reg)e.split("/")[0]===r&&delete this._reg[e]}};be(ur,"_reg",Object.create(null));var rs=r=>{if(typeof r!="string"||!r)return"";let e=r.trim();return e.startsWith("-/")?e=e.slice(2):e.startsWith("/")&&(e=e.slice(1)),e.endsWith("/")&&(e=e.slice(0,e.length-1)),e},ve=(...r)=>r.filter(e=>typeof e=="string"&&e).map(e=>rs(e)).join("/-/"),$t=(...r)=>{let e=ve(...r);return e?`-/${e}/`:""};function Nt(r){let e=new URL(r),t=e.pathname+e.search+e.hash,i=t.lastIndexOf("http"),s=t.lastIndexOf("/"),o="";return i>=0?o=t.slice(i):s>=0&&(o=t.slice(s+1)),o}function dr(r){let e=new URL(r),{pathname:t}=e,i=t.indexOf("/"),s=t.indexOf("/",i+1);return t.substring(i+1,s)}function hr(r){let e=fr(r),t=new URL(e),i=t.pathname.indexOf("/-/");return i===-1?"":t.pathname.substring(i).slice(1)}function fr(r){let e=new URL(r),t=Nt(r),i=pr(t)?mr(t).pathname:t;return e.pathname=e.pathname.replace(i,""),e.search="",e.hash="",e.toString()}function pr(r){return r.startsWith("http")}function mr(r){let e=new URL(r);return{pathname:e.origin+e.pathname||"",search:e.search||"",hash:e.hash||""}}var Vt=(r,e,t)=>{let i=new URL(fr(r));if(t=t||Nt(r),i.pathname.startsWith("//")&&(i.pathname=i.pathname.replace("//","/")),pr(t)){let s=mr(t);i.pathname=i.pathname+(e||"")+(s.pathname||""),i.search=s.search,i.hash=s.hash}else i.pathname=i.pathname+(e||"")+(t||"");return i.toString()},gr=(r,e)=>{let t=new URL(r);return t.pathname=e+"/",t.toString()};var Z=(r,e=",")=>r.trim().split(e).map(t=>t.trim()).filter(t=>t.length>0);var G=Object.freeze({brightness:0,exposure:0,gamma:100,contrast:0,saturation:0,vibrance:0,warmth:0,enhance:0,filter:0,rotate:0,mirror:!1,flip:!1,crop:void 0});var An=ve("format/auto","progressive/yes"),Y=([r])=>typeof r!="undefined"?Number(r):void 0,yr=()=>!0,is=([r,e])=>({name:r,amount:typeof e!="undefined"?Number(e):100}),ss=([r,e])=>{if(!/\d+x\d+/.test(r)||!/\d+,\d+/.test(e))throw new Error("Crop by aspect ratio, percentage or alignment shortcuts is not supported.");return{dimensions:Z(r,"x").map(Number),coords:Z(e).map(Number)}},En=Object.freeze({enhance:Y,brightness:Y,exposure:Y,gamma:Y,contrast:Y,saturation:Y,vibrance:Y,warmth:Y,filter:is,mirror:yr,flip:yr,rotate:Y,crop:ss});var we=Object.freeze({CROP:"crop",TUNING:"tuning",FILTERS:"filters"}),br=[we.CROP,we.TUNING,we.FILTERS];var Tn=Object.freeze({brightness:{zero:G.brightness,range:[-100,100],keypointsNumber:2},exposure:{zero:G.exposure,range:[-500,500],keypointsNumber:2},gamma:{zero:G.gamma,range:[0,1e3],keypointsNumber:2},contrast:{zero:G.contrast,range:[-100,500],keypointsNumber:2},saturation:{zero:G.saturation,range:[-100,500],keypointsNumber:1},vibrance:{zero:G.vibrance,range:[-100,500],keypointsNumber:1},warmth:{zero:G.warmth,range:[-100,100],keypointsNumber:1},enhance:{zero:G.enhance,range:[0,100],keypointsNumber:1},filter:{zero:G.filter,range:[0,100],keypointsNumber:1}});var zt=r=>r?r.join(","):"";var os="https://ucarecdn.com",ns="https://upload.uploadcare.com",ls="https://social.uploadcare.com",z={pubkey:"",multiple:!0,multipleMin:0,multipleMax:Number.MAX_SAFE_INTEGER,confirmUpload:!1,imgOnly:!1,accept:"",externalSourcesPreferredTypes:"",store:"auto",cameraMirror:!1,cameraCapture:"",sourceList:"local, url, camera, dropbox, gdrive",cloudImageEditorTabs:zt(br),maxLocalFileSizeBytes:0,thumbSize:76,showEmptyList:!1,useLocalImageEditor:!1,useCloudImageEditor:!0,removeCopyright:!1,cropPreset:"",imageShrink:"",modalScrollLock:!0,modalBackdropStrokes:!1,sourceListWrap:!0,remoteTabSessionKey:"",cdnCname:os,baseUrl:ns,socialBaseUrl:ls,secureSignature:"",secureExpire:"",secureDeliveryProxy:"",retryThrottledRequestMaxTimes:1,multipartMinFileSize:26214400,multipartChunkSize:5242880,maxConcurrentRequests:10,multipartMaxConcurrentRequests:4,multipartMaxAttempts:3,checkForUrlDuplicates:!1,saveUrlForRecurrentUploads:!1,groupOutput:!1,userAgentIntegration:"",debug:!1,metadata:null,localeName:"en",localeDefinitionOverride:null,secureUploadsExpireThreshold:10*60*1e3,secureUploadsSignatureResolver:null,secureDeliveryProxyUrlResolver:null,iconHrefResolver:null,fileValidators:[],collectionValidators:[]};var _r="--uploadcare-blocks-window-height",at=class{static registerClient(e){this.clientsRegistry.size===0&&this.attachTracker(),this.clientsRegistry.add(e)}static unregisterClient(e){this.clientsRegistry.delete(e),this.clientsRegistry.size===0&&this.detachTracker()}static attachTracker(){window.addEventListener("resize",this.flush,{passive:!0,capture:!0}),this.flush()}static detachTracker(){window.removeEventListener("resize",this.flush,{capture:!0}),document.documentElement.style.removeProperty(_r)}};d(at,"clientsRegistry",new Set),d(at,"flush",V(()=>{document.documentElement.style.setProperty(_r,`${window.innerHeight}px`)},100));var vr=r=>{var i;let e=new Intl.Locale(r),t="ltr";return typeof e.getTextInfo=="function"&&e.getTextInfo().direction?t=e.getTextInfo().direction:"textInfo"in e&&((i=e.textInfo)!=null&&i.direction)&&(t=e.textInfo.direction),t};var jt=(r,e)=>new Intl.PluralRules(r).select(e);var as=r=>r,Ce="{{",Cr="}}",wr="plural:";function Ae(r,e,t={}){var n;let{openToken:i=Ce,closeToken:s=Cr,transform:o=as}=t;for(let l in e){let a=(n=e[l])==null?void 0:n.toString();r=r.replaceAll(i+l+s,typeof a=="string"?o(a):a)}return r}function Ar(r){let e=[],t=r.indexOf(Ce);for(;t!==-1;){let i=r.indexOf(Cr,t),s=r.substring(t+2,i);if(s.startsWith(wr)){let o=r.substring(t+2,i).replace(wr,""),n=o.substring(0,o.indexOf("(")),l=o.substring(o.indexOf("(")+1,o.indexOf(")"));e.push({variable:s,pluralKey:n,countVariable:l})}t=r.indexOf(Ce,i)}return e}var Er=({element:r,attribute:e,onSuccess:t,onTimeout:i,timeout:s=300})=>{let o=r.getAttribute(e);if(o!==null){t(o);return}let n=new MutationObserver(c=>{let h=c[c.length-1];a(h)});n.observe(r,{attributes:!0,attributeFilter:[e]});let l=setTimeout(()=>{n.disconnect(),i()},s),a=c=>{let h=r.getAttribute(e);c.type==="attributes"&&c.attributeName===e&&h!==null&&(clearTimeout(l),n.disconnect(),t(h))}};function xr(r){return Object.prototype.toString.call(r)==="[object Object]"}var cs=/\W|_/g;function us(r){return r.split(cs).map((e,t)=>e.charAt(0)[t>0?"toUpperCase":"toLowerCase"]()+e.slice(1)).join("")}function Sr(r,{ignoreKeys:e}={ignoreKeys:[]}){return Array.isArray(r)?r.map(t=>tt(t,{ignoreKeys:e})):r}function tt(r,{ignoreKeys:e}={ignoreKeys:[]}){if(Array.isArray(r))return Sr(r,{ignoreKeys:e});if(!xr(r))return r;let t={};for(let i of Object.keys(r)){let s=r[i];if(e.includes(i)){t[i]=s;continue}xr(s)?s=tt(s,{ignoreKeys:e}):Array.isArray(s)&&(s=Sr(s,{ignoreKeys:e})),t[us(i)]=s}return t}var ds=r=>new Promise(e=>setTimeout(e,r));function Ie({libraryName:r,libraryVersion:e,userAgent:t,publicKey:i="",integration:s=""}){let o="JavaScript";if(typeof t=="string")return t;if(typeof t=="function")return t({publicKey:i,libraryName:r,libraryVersion:e,languageName:o,integration:s});let n=[r,e,i].filter(Boolean).join("/"),l=[o,s].filter(Boolean).join("; ");return`${n} (${l})`}var hs={factor:2,time:100};function fs(r,e=hs){let t=0;function i(s){let o=Math.round(e.time*e.factor**t);return s({attempt:t,retry:l=>ds(l!=null?l:o).then(()=>(t+=1,i(s)))})}return i(r)}var vt=class extends Error{},ft=class r extends vt{constructor(t){super();d(this,"originalProgressEvent");this.name="NetworkError",this.message="Network error",Object.setPrototypeOf(this,r.prototype),this.originalProgressEvent=t}},Ht=(r,e)=>{r&&(r.aborted?Promise.resolve().then(e):r.addEventListener("abort",()=>e(),{once:!0}))},st=class r extends vt{constructor(t="Request canceled"){super(t);d(this,"isCancel",!0);this.name="CancelError",Object.setPrototypeOf(this,r.prototype)}},ps=500,Or=({check:r,interval:e=ps,timeout:t,signal:i})=>new Promise((s,o)=>{let n,l;Ht(i,()=>{n&&clearTimeout(n),o(new st("Poll cancelled"))}),t&&(l=setTimeout(()=>{n&&clearTimeout(n),o(new st("Timed out"))},t));let a=()=>{try{Promise.resolve(r(i)).then(c=>{c?(l&&clearTimeout(l),s(c)):n=setTimeout(a,e)}).catch(c=>{l&&clearTimeout(l),o(c)})}catch(c){l&&clearTimeout(l),o(c)}};n=setTimeout(a,0)}),w={baseCDN:"https://ucarecdn.com",baseURL:"https://upload.uploadcare.com",maxContentLength:50*1024*1024,retryThrottledRequestMaxTimes:1,retryNetworkErrorMaxTimes:3,multipartMinFileSize:25*1024*1024,multipartChunkSize:5*1024*1024,multipartMinLastPartSize:1024*1024,maxConcurrentRequests:4,pollingTimeoutMilliseconds:1e4,pusherKey:"79ae88bd931ea68464d9"},Gt="application/octet-stream",Ur="original",ot=({method:r,url:e,data:t,headers:i={},signal:s,onProgress:o})=>new Promise((n,l)=>{let a=new XMLHttpRequest,c=(r==null?void 0:r.toUpperCase())||"GET",h=!1;a.open(c,e,!0),i&&Object.entries(i).forEach(u=>{let[f,m]=u;typeof m!="undefined"&&!Array.isArray(m)&&a.setRequestHeader(f,m)}),a.responseType="text",Ht(s,()=>{h=!0,a.abort(),l(new st)}),a.onload=()=>{if(a.status!=200)l(new Error(`Error ${a.status}: ${a.statusText}`));else{let u={method:c,url:e,data:t,headers:i||void 0,signal:s,onProgress:o},f=a.getAllResponseHeaders().trim().split(/[\r\n]+/),m={};f.forEach(function(C){let A=C.split(": "),_=A.shift(),y=A.join(": ");_&&typeof _!="undefined"&&(m[_]=y)});let p=a.response,g=a.status;n({request:u,data:p,headers:m,status:g})}},a.onerror=u=>{h||l(new ft(u))},o&&typeof o=="function"&&(a.upload.onprogress=u=>{u.lengthComputable?o({isComputable:!0,value:u.loaded/u.total}):o({isComputable:!1})}),t?a.send(t):a.send()});function ms(r,...e){return r}var gs=({name:r})=>r?[r]:[],ys=ms,bs=()=>new FormData,Ir=r=>!1,Xt=r=>typeof Blob!="undefined"&&r instanceof Blob,Wt=r=>typeof File!="undefined"&&r instanceof File,qt=r=>!!r&&typeof r=="object"&&!Array.isArray(r)&&"uri"in r&&typeof r.uri=="string",pt=r=>Xt(r)||Wt(r)||Ir()||qt(r),_s=r=>typeof r=="string"||typeof r=="number"||typeof r=="undefined",vs=r=>!!r&&typeof r=="object"&&!Array.isArray(r),ws=r=>!!r&&typeof r=="object"&&"data"in r&&pt(r.data);function kr(r,e,t){if(Array.isArray(t))for(let i of t)kr(r,`${e}[]`,i);else if(ws(t)){let{name:i,contentType:s}=t,o=ys(t.data,i,s!=null?s:Gt),n=gs({name:i,contentType:s});r.push([e,o,...n])}else if(vs(t))for(let[i,s]of Object.entries(t))typeof s!="undefined"&&r.push([`${e}[${i}]`,String(s)]);else _s(t)&&t&&r.push([e,t.toString()])}function Cs(r){let e=[];for(let[t,i]of Object.entries(r))kr(e,t,i);return e}function Kt(r){let e=bs(),t=Cs(r);for(let i of t){let[s,o,...n]=i;e.append(s,o,...n)}return e}var L=class r extends vt{constructor(t,i,s,o,n){super();d(this,"code");d(this,"request");d(this,"response");d(this,"headers");this.name="UploadError",this.message=t,this.code=i,this.request=s,this.response=o,this.headers=n,Object.setPrototypeOf(this,r.prototype)}},As=r=>{let e=new URLSearchParams;for(let[t,i]of Object.entries(r))i&&typeof i=="object"&&!Array.isArray(i)?Object.entries(i).filter(s=>{var o;return(o=s[1])!=null?o:!1}).forEach(s=>e.set(`${t}[${s[0]}]`,String(s[1]))):Array.isArray(i)?i.forEach(s=>{e.append(`${t}[]`,s)}):typeof i=="string"&&i?e.set(t,i):typeof i=="number"&&e.set(t,i.toString());return e.toString()},J=(r,e,t)=>{let i=new URL(r);return i.pathname=(i.pathname+e).replace("//","/"),t&&(i.search=As(t)),i.toString()},Es="6.14.1",xs="UploadcareUploadClient",Ss=Es;function ct(r){return Ie({libraryName:xs,libraryVersion:Ss,...r})}var Ts="RequestThrottledError",Tr=15e3,Os=1e3;function Us(r){let{headers:e}=r||{};if(!e||typeof e["retry-after"]!="string")return Tr;let t=parseInt(e["retry-after"],10);return Number.isFinite(t)?t*1e3:Tr}function nt(r,e){let{retryThrottledRequestMaxTimes:t,retryNetworkErrorMaxTimes:i}=e;return fs(({attempt:s,retry:o})=>r().catch(n=>{if("response"in n&&(n==null?void 0:n.code)===Ts&&s<t)return o(Us(n));if(n instanceof ft&&s<i)return o((s+1)*Os);throw n}))}var Lr=r=>{let e="";return(Xt(r)||Wt(r)||qt(r))&&(e=r.type),e||Gt},Mr=r=>{let e="";return Wt(r)&&r.name?e=r.name:Xt(r)||Ir()?e="":qt(r)&&r.name&&(e=r.name),e||Ur};function ke(r){return typeof r=="undefined"||r==="auto"?"auto":r?"1":"0"}function Is(r,{publicKey:e,fileName:t,contentType:i,baseURL:s=w.baseURL,secureSignature:o,secureExpire:n,store:l,signal:a,onProgress:c,source:h="local",integration:u,userAgent:f,retryThrottledRequestMaxTimes:m=w.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:p=w.retryNetworkErrorMaxTimes,metadata:g}){return nt(()=>ot({method:"POST",url:J(s,"/base/",{jsonerrors:1}),headers:{"X-UC-User-Agent":ct({publicKey:e,integration:u,userAgent:f})},data:Kt({file:{data:r,name:t||Mr(r),contentType:i||Lr(r)},UPLOADCARE_PUB_KEY:e,UPLOADCARE_STORE:ke(l),signature:o,expire:n,source:h,metadata:g}),signal:a,onProgress:c}).then(({data:C,headers:A,request:_})=>{let y=tt(JSON.parse(C));if("error"in y)throw new L(y.error.content,y.error.errorCode,_,y,A);return y}),{retryNetworkErrorMaxTimes:p,retryThrottledRequestMaxTimes:m})}var Se;(function(r){r.Token="token",r.FileInfo="file_info"})(Se||(Se={}));function ks(r,{publicKey:e,baseURL:t=w.baseURL,store:i,fileName:s,checkForUrlDuplicates:o,saveUrlForRecurrentUploads:n,secureSignature:l,secureExpire:a,source:c="url",signal:h,integration:u,userAgent:f,retryThrottledRequestMaxTimes:m=w.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:p=w.retryNetworkErrorMaxTimes,metadata:g}){return nt(()=>ot({method:"POST",headers:{"X-UC-User-Agent":ct({publicKey:e,integration:u,userAgent:f})},url:J(t,"/from_url/",{jsonerrors:1,pub_key:e,source_url:r,store:ke(i),filename:s,check_URL_duplicates:o?1:void 0,save_URL_duplicates:n?1:void 0,signature:l,expire:a,source:c,metadata:g}),signal:h}).then(({data:C,headers:A,request:_})=>{let y=tt(JSON.parse(C));if("error"in y)throw new L(y.error.content,y.error.errorCode,_,y,A);return y}),{retryNetworkErrorMaxTimes:p,retryThrottledRequestMaxTimes:m})}var R;(function(r){r.Unknown="unknown",r.Waiting="waiting",r.Progress="progress",r.Error="error",r.Success="success"})(R||(R={}));var Ls=r=>"status"in r&&r.status===R.Error;function Ms(r,{publicKey:e,baseURL:t=w.baseURL,signal:i,integration:s,userAgent:o,retryThrottledRequestMaxTimes:n=w.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:l=w.retryNetworkErrorMaxTimes}={}){return nt(()=>ot({method:"GET",headers:e?{"X-UC-User-Agent":ct({publicKey:e,integration:s,userAgent:o})}:void 0,url:J(t,"/from_url/status/",{jsonerrors:1,token:r}),signal:i}).then(({data:a,headers:c,request:h})=>{let u=tt(JSON.parse(a));if("error"in u&&!Ls(u))throw new L(u.error.content,u.error.errorCode,h,u,c);return u}),{retryNetworkErrorMaxTimes:l,retryThrottledRequestMaxTimes:n})}function Ps(r,{publicKey:e,baseURL:t=w.baseURL,jsonpCallback:i,secureSignature:s,secureExpire:o,signal:n,source:l,integration:a,userAgent:c,retryThrottledRequestMaxTimes:h=w.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:u=w.retryNetworkErrorMaxTimes}){return nt(()=>ot({method:"POST",headers:{"X-UC-User-Agent":ct({publicKey:e,integration:a,userAgent:c})},url:J(t,"/group/",{jsonerrors:1}),data:Kt({files:r,callback:i,pub_key:e,signature:s,expire:o,source:l}),signal:n}).then(({data:f,headers:m,request:p})=>{let g=tt(JSON.parse(f));if("error"in g)throw new L(g.error.content,g.error.errorCode,p,g,m);return g}),{retryNetworkErrorMaxTimes:u,retryThrottledRequestMaxTimes:h})}function Pr(r,{publicKey:e,baseURL:t=w.baseURL,signal:i,source:s,integration:o,userAgent:n,retryThrottledRequestMaxTimes:l=w.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:a=w.retryNetworkErrorMaxTimes}){return nt(()=>ot({method:"GET",headers:{"X-UC-User-Agent":ct({publicKey:e,integration:o,userAgent:n})},url:J(t,"/info/",{jsonerrors:1,pub_key:e,file_id:r,source:s}),signal:i}).then(({data:c,headers:h,request:u})=>{let f=tt(JSON.parse(c));if("error"in f)throw new L(f.error.content,f.error.errorCode,u,f,h);return f}),{retryThrottledRequestMaxTimes:l,retryNetworkErrorMaxTimes:a})}function Rs(r,{publicKey:e,contentType:t,fileName:i,multipartChunkSize:s=w.multipartChunkSize,baseURL:o="",secureSignature:n,secureExpire:l,store:a,signal:c,source:h="local",integration:u,userAgent:f,retryThrottledRequestMaxTimes:m=w.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:p=w.retryNetworkErrorMaxTimes,metadata:g}){return nt(()=>ot({method:"POST",url:J(o,"/multipart/start/",{jsonerrors:1}),headers:{"X-UC-User-Agent":ct({publicKey:e,integration:u,userAgent:f})},data:Kt({filename:i||Ur,size:r,content_type:t||Gt,part_size:s,UPLOADCARE_STORE:ke(a),UPLOADCARE_PUB_KEY:e,signature:n,expire:l,source:h,metadata:g}),signal:c}).then(({data:C,headers:A,request:_})=>{let y=tt(JSON.parse(C));if("error"in y)throw new L(y.error.content,y.error.errorCode,_,y,A);return y.parts=Object.keys(y.parts).map(T=>y.parts[Number(T)]),y}),{retryThrottledRequestMaxTimes:m,retryNetworkErrorMaxTimes:p})}function Fs(r,e,{contentType:t,signal:i,onProgress:s,retryThrottledRequestMaxTimes:o=w.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:n=w.retryNetworkErrorMaxTimes}){return nt(()=>ot({method:"PUT",url:e,data:r,onProgress:s,signal:i,headers:{"Content-Type":t||Gt}}).then(l=>(s&&s({isComputable:!0,value:1}),l)).then(({status:l})=>({code:l})),{retryThrottledRequestMaxTimes:o,retryNetworkErrorMaxTimes:n})}function Ds(r,{publicKey:e,baseURL:t=w.baseURL,source:i="local",signal:s,integration:o,userAgent:n,retryThrottledRequestMaxTimes:l=w.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:a=w.retryNetworkErrorMaxTimes}){return nt(()=>ot({method:"POST",url:J(t,"/multipart/complete/",{jsonerrors:1}),headers:{"X-UC-User-Agent":ct({publicKey:e,integration:o,userAgent:n})},data:Kt({uuid:r,UPLOADCARE_PUB_KEY:e,source:i}),signal:s}).then(({data:c,headers:h,request:u})=>{let f=tt(JSON.parse(c));if("error"in f)throw new L(f.error.content,f.error.errorCode,u,f,h);return f}),{retryThrottledRequestMaxTimes:l,retryNetworkErrorMaxTimes:a})}function Le(r,{publicKey:e,baseURL:t,source:i,integration:s,userAgent:o,retryThrottledRequestMaxTimes:n,retryNetworkErrorMaxTimes:l,signal:a,onProgress:c}){return Or({check:h=>Pr(r,{publicKey:e,baseURL:t,signal:h,source:i,integration:s,userAgent:o,retryThrottledRequestMaxTimes:n,retryNetworkErrorMaxTimes:l}).then(u=>u.isReady?u:(c&&c({isComputable:!0,value:1}),!1)),signal:a})}function $s(r){return"defaultEffects"in r}var Q=class{constructor(e,{baseCDN:t=w.baseCDN,fileName:i}={}){d(this,"uuid");d(this,"name",null);d(this,"size",null);d(this,"isStored",null);d(this,"isImage",null);d(this,"mimeType",null);d(this,"cdnUrl",null);d(this,"s3Url",null);d(this,"originalFilename",null);d(this,"imageInfo",null);d(this,"videoInfo",null);d(this,"contentInfo",null);d(this,"metadata",null);d(this,"s3Bucket",null);d(this,"defaultEffects",null);let{uuid:s,s3Bucket:o}=e,n=J(t,`${s}/`),l=o?J(`https://${o}.s3.amazonaws.com/`,`${s}/${e.filename}`):null;this.uuid=s,this.name=i||e.filename,this.size=e.size,this.isStored=e.isStored,this.isImage=e.isImage,this.mimeType=e.mimeType,this.cdnUrl=n,this.originalFilename=e.originalFilename,this.imageInfo=e.imageInfo,this.videoInfo=e.videoInfo,this.contentInfo=e.contentInfo,this.metadata=e.metadata||null,this.s3Bucket=o||null,this.s3Url=l,$s(e)&&(this.defaultEffects=e.defaultEffects)}},Ns=(r,{publicKey:e,fileName:t,baseURL:i,secureSignature:s,secureExpire:o,store:n,contentType:l,signal:a,onProgress:c,source:h,integration:u,userAgent:f,retryThrottledRequestMaxTimes:m,retryNetworkErrorMaxTimes:p,baseCDN:g,metadata:C})=>Is(r,{publicKey:e,fileName:t,contentType:l,baseURL:i,secureSignature:s,secureExpire:o,store:n,signal:a,onProgress:c,source:h,integration:u,userAgent:f,retryThrottledRequestMaxTimes:m,retryNetworkErrorMaxTimes:p,metadata:C}).then(({file:A})=>Le(A,{publicKey:e,baseURL:i,source:h,integration:u,userAgent:f,retryThrottledRequestMaxTimes:m,retryNetworkErrorMaxTimes:p,onProgress:c,signal:a})).then(A=>new Q(A,{baseCDN:g})),Vs=(r,{publicKey:e,fileName:t,baseURL:i,signal:s,onProgress:o,source:n,integration:l,userAgent:a,retryThrottledRequestMaxTimes:c,retryNetworkErrorMaxTimes:h,baseCDN:u})=>Pr(r,{publicKey:e,baseURL:i,signal:s,source:n,integration:l,userAgent:a,retryThrottledRequestMaxTimes:c,retryNetworkErrorMaxTimes:h}).then(f=>new Q(f,{baseCDN:u,fileName:t})).then(f=>(o&&o({isComputable:!0,value:1}),f)),zs=(r,{signal:e}={})=>{let t=null,i=null,s=r.map(()=>new AbortController),o=n=>()=>{i=n,s.forEach((l,a)=>a!==n&&l.abort())};return Ht(e,()=>{s.forEach(n=>n.abort())}),Promise.all(r.map((n,l)=>{let a=o(l);return Promise.resolve().then(()=>n({stopRace:a,signal:s[l].signal})).then(c=>(a(),c)).catch(c=>(t=c,null))})).then(n=>{if(i===null)throw t;return n[i]})},js=window.WebSocket,Te=class{constructor(){d(this,"events",Object.create({}))}emit(e,t){var i;(i=this.events[e])==null||i.forEach(s=>s(t))}on(e,t){this.events[e]=this.events[e]||[],this.events[e].push(t)}off(e,t){t?this.events[e]=this.events[e].filter(i=>i!==t):this.events[e]=[]}},Bs=(r,e)=>r==="success"?{status:R.Success,...e}:r==="progress"?{status:R.Progress,...e}:{status:R.Error,...e},Oe=class{constructor(e,t=3e4){d(this,"key");d(this,"disconnectTime");d(this,"ws");d(this,"queue",[]);d(this,"isConnected",!1);d(this,"subscribers",0);d(this,"emmitter",new Te);d(this,"disconnectTimeoutId",null);this.key=e,this.disconnectTime=t}connect(){if(this.disconnectTimeoutId&&clearTimeout(this.disconnectTimeoutId),!this.isConnected&&!this.ws){let e=`wss://ws.pusherapp.com/app/${this.key}?protocol=5&client=js&version=1.12.2`;this.ws=new js(e),this.ws.addEventListener("error",t=>{this.emmitter.emit("error",new Error(t.message))}),this.emmitter.on("connected",()=>{this.isConnected=!0,this.queue.forEach(t=>this.send(t.event,t.data)),this.queue=[]}),this.ws.addEventListener("message",t=>{let i=JSON.parse(t.data.toString());switch(i.event){case"pusher:connection_established":{this.emmitter.emit("connected",void 0);break}case"pusher:ping":{this.send("pusher:pong",{});break}case"progress":case"success":case"fail":this.emmitter.emit(i.channel,Bs(i.event,JSON.parse(i.data)))}})}}disconnect(){let e=()=>{var t;(t=this.ws)==null||t.close(),this.ws=void 0,this.isConnected=!1};this.disconnectTime?this.disconnectTimeoutId=setTimeout(()=>{e()},this.disconnectTime):e()}send(e,t){var s;let i=JSON.stringify({event:e,data:t});(s=this.ws)==null||s.send(i)}subscribe(e,t){this.subscribers+=1,this.connect();let i=`task-status-${e}`,s={event:"pusher:subscribe",data:{channel:i}};this.emmitter.on(i,t),this.isConnected?this.send(s.event,s.data):this.queue.push(s)}unsubscribe(e){this.subscribers-=1;let t=`task-status-${e}`,i={event:"pusher:unsubscribe",data:{channel:t}};this.emmitter.off(t),this.isConnected?this.send(i.event,i.data):this.queue=this.queue.filter(s=>s.data.channel!==t),this.subscribers===0&&this.disconnect()}onError(e){return this.emmitter.on("error",e),()=>this.emmitter.off("error",e)}},Ee=null,Me=r=>{if(!Ee){let e=typeof window=="undefined"?0:3e4;Ee=new Oe(r,e)}return Ee},Hs=r=>{Me(r).connect()};function Gs({token:r,publicKey:e,baseURL:t,integration:i,userAgent:s,retryThrottledRequestMaxTimes:o,retryNetworkErrorMaxTimes:n,onProgress:l,signal:a}){return Or({check:c=>Ms(r,{publicKey:e,baseURL:t,integration:i,userAgent:s,retryThrottledRequestMaxTimes:o,retryNetworkErrorMaxTimes:n,signal:c}).then(h=>{switch(h.status){case R.Error:return new L(h.error,h.errorCode);case R.Waiting:return!1;case R.Unknown:return new L(`Token "${r}" was not found.`);case R.Progress:return l&&(h.total==="unknown"?l({isComputable:!1}):l({isComputable:!0,value:h.done/h.total})),!1;case R.Success:return l&&l({isComputable:!0,value:h.done/h.total}),h;default:throw new Error("Unknown status")}}),signal:a})}var Xs=({token:r,pusherKey:e,signal:t,onProgress:i})=>new Promise((s,o)=>{let n=Me(e),l=n.onError(o),a=()=>{l(),n.unsubscribe(r)};Ht(t,()=>{a(),o(new st("pusher cancelled"))}),n.subscribe(r,c=>{switch(c.status){case R.Progress:{i&&(c.total==="unknown"?i({isComputable:!1}):i({isComputable:!0,value:c.done/c.total}));break}case R.Success:{a(),i&&i({isComputable:!0,value:c.done/c.total}),s(c);break}case R.Error:a(),o(new L(c.msg,c.error_code))}})}),Ws=(r,{publicKey:e,fileName:t,baseURL:i,baseCDN:s,checkForUrlDuplicates:o,saveUrlForRecurrentUploads:n,secureSignature:l,secureExpire:a,store:c,signal:h,onProgress:u,source:f,integration:m,userAgent:p,retryThrottledRequestMaxTimes:g,pusherKey:C=w.pusherKey,metadata:A})=>Promise.resolve(Hs(C)).then(()=>ks(r,{publicKey:e,fileName:t,baseURL:i,checkForUrlDuplicates:o,saveUrlForRecurrentUploads:n,secureSignature:l,secureExpire:a,store:c,signal:h,source:f,integration:m,userAgent:p,retryThrottledRequestMaxTimes:g,metadata:A})).catch(_=>{let y=Me(C);return y==null||y.disconnect(),Promise.reject(_)}).then(_=>_.type===Se.FileInfo?_:zs([({signal:y})=>Gs({token:_.token,publicKey:e,baseURL:i,integration:m,userAgent:p,retryThrottledRequestMaxTimes:g,onProgress:u,signal:y}),({signal:y})=>Xs({token:_.token,pusherKey:C,signal:y,onProgress:u})],{signal:h})).then(_=>{if(_ instanceof L)throw _;return _}).then(_=>Le(_.uuid,{publicKey:e,baseURL:i,integration:m,userAgent:p,retryThrottledRequestMaxTimes:g,onProgress:u,signal:h})).then(_=>new Q(_,{baseCDN:s})),xe=new WeakMap,qs=async r=>{if(xe.has(r))return xe.get(r);let e=await fetch(r.uri).then(t=>t.blob());return xe.set(r,e),e},Rr=async r=>{if(Wt(r)||Xt(r))return r.size;if(qt(r))return(await qs(r)).size;throw new Error("Unknown file type. Cannot determine file size.")},Ks=(r,e=w.multipartMinFileSize)=>r>=e,Fr=r=>{let e="[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}",t=new RegExp(e);return!pt(r)&&t.test(r)},Pe=r=>{let e="^(?:\\w+:)?\\/\\/([^\\s\\.]+\\.\\S{2}|localhost[\\:?\\d]*)\\S*$",t=new RegExp(e);return!pt(r)&&t.test(r)},Zs=(r,e)=>new Promise((t,i)=>{let s=[],o=!1,n=e.length,l=[...e],a=()=>{let c=e.length-l.length,h=l.shift();h&&h().then(u=>{o||(s[c]=u,n-=1,n?a():t(s))}).catch(u=>{o=!0,i(u)})};for(let c=0;c<r;c++)a()}),Ys=(r,e,t,i)=>{let s=i*e,o=Math.min(s+i,t);return r.slice(s,o)},Js=async(r,e,t)=>i=>Ys(r,i,e,t),Qs=(r,e,{publicKey:t,contentType:i,onProgress:s,signal:o,integration:n,retryThrottledRequestMaxTimes:l,retryNetworkErrorMaxTimes:a})=>Fs(r,e,{publicKey:t,contentType:i,onProgress:s,signal:o,integration:n,retryThrottledRequestMaxTimes:l,retryNetworkErrorMaxTimes:a}),to=async(r,{publicKey:e,fileName:t,fileSize:i,baseURL:s,secureSignature:o,secureExpire:n,store:l,signal:a,onProgress:c,source:h,integration:u,userAgent:f,retryThrottledRequestMaxTimes:m,retryNetworkErrorMaxTimes:p,contentType:g,multipartChunkSize:C=w.multipartChunkSize,maxConcurrentRequests:A=w.maxConcurrentRequests,baseCDN:_,metadata:y})=>{let T=i!=null?i:await Rr(r),D,B=(O,P)=>{if(!c)return;D||(D=Array(O).fill(0));let N=H=>H.reduce((q,me)=>q+me,0);return H=>{H.isComputable&&(D[P]=H.value,c({isComputable:!0,value:N(D)/O}))}};return g||(g=Lr(r)),Rs(T,{publicKey:e,contentType:g,fileName:t||Mr(r),baseURL:s,secureSignature:o,secureExpire:n,store:l,signal:a,source:h,integration:u,userAgent:f,retryThrottledRequestMaxTimes:m,retryNetworkErrorMaxTimes:p,metadata:y}).then(async({uuid:O,parts:P})=>{let N=await Js(r,T,C);return Promise.all([O,Zs(A,P.map((H,q)=>()=>Qs(N(q),H,{publicKey:e,contentType:g,onProgress:B(P.length,q),signal:a,integration:u,retryThrottledRequestMaxTimes:m,retryNetworkErrorMaxTimes:p})))])}).then(([O])=>Ds(O,{publicKey:e,baseURL:s,source:h,integration:u,userAgent:f,retryThrottledRequestMaxTimes:m,retryNetworkErrorMaxTimes:p})).then(O=>O.isReady?O:Le(O.uuid,{publicKey:e,baseURL:s,source:h,integration:u,userAgent:f,retryThrottledRequestMaxTimes:m,retryNetworkErrorMaxTimes:p,onProgress:c,signal:a})).then(O=>new Q(O,{baseCDN:_}))};async function Re(r,{publicKey:e,fileName:t,baseURL:i=w.baseURL,secureSignature:s,secureExpire:o,store:n,signal:l,onProgress:a,source:c,integration:h,userAgent:u,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:m,contentType:p,multipartMinFileSize:g,multipartChunkSize:C,maxConcurrentRequests:A,baseCDN:_=w.baseCDN,checkForUrlDuplicates:y,saveUrlForRecurrentUploads:T,pusherKey:D,metadata:B}){if(pt(r)){let O=await Rr(r);return Ks(O,g)?to(r,{publicKey:e,contentType:p,multipartChunkSize:C,fileSize:O,fileName:t,baseURL:i,secureSignature:s,secureExpire:o,store:n,signal:l,onProgress:a,source:c,integration:h,userAgent:u,maxConcurrentRequests:A,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:m,baseCDN:_,metadata:B}):Ns(r,{publicKey:e,fileName:t,contentType:p,baseURL:i,secureSignature:s,secureExpire:o,store:n,signal:l,onProgress:a,source:c,integration:h,userAgent:u,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:m,baseCDN:_,metadata:B})}if(Pe(r))return Ws(r,{publicKey:e,fileName:t,baseURL:i,baseCDN:_,checkForUrlDuplicates:y,saveUrlForRecurrentUploads:T,secureSignature:s,secureExpire:o,store:n,signal:l,onProgress:a,source:c,integration:h,userAgent:u,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:m,pusherKey:D,metadata:B});if(Fr(r))return Vs(r,{publicKey:e,fileName:t,baseURL:i,signal:l,onProgress:a,source:c,integration:h,userAgent:u,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:m,baseCDN:_});throw new TypeError(`File uploading from "${r}" is not supported`)}var Ue=class{constructor(e,{baseCDN:t=w.baseCDN}={}){d(this,"uuid");d(this,"filesCount");d(this,"totalSize");d(this,"isStored");d(this,"isImage");d(this,"cdnUrl");d(this,"files");d(this,"createdAt");d(this,"storedAt",null);this.uuid=e.id,this.filesCount=e.filesCount;let i=e.files.filter(Boolean);this.totalSize=Object.values(i).reduce((s,o)=>s+o.size,0),this.isStored=!!e.datetimeStored,this.isImage=!!Object.values(i).filter(s=>s.isImage).length,this.cdnUrl=e.cdnUrl,this.files=i.map(s=>new Q(s,{baseCDN:t})),this.createdAt=e.datetimeCreated,this.storedAt=e.datetimeStored}},eo=r=>{for(let e of r)if(!pt(e))return!1;return!0},ro=r=>{for(let e of r)if(!Fr(e))return!1;return!0},io=r=>{for(let e of r)if(!Pe(e))return!1;return!0};function Dr(r,{publicKey:e,fileName:t,baseURL:i=w.baseURL,secureSignature:s,secureExpire:o,store:n,signal:l,onProgress:a,source:c,integration:h,userAgent:u,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:m,contentType:p,multipartChunkSize:g=w.multipartChunkSize,baseCDN:C=w.baseCDN,checkForUrlDuplicates:A,saveUrlForRecurrentUploads:_,jsonpCallback:y}){if(!eo(r)&&!io(r)&&!ro(r))throw new TypeError(`Group uploading from "${r}" is not supported`);let T,D=!0,B=r.length,O=(P,N)=>{if(!a)return;T||(T=Array(P).fill(0));let H=q=>q.reduce((me,Oi)=>me+Oi)/P;return q=>{if(!q.isComputable||!D){D=!1,a({isComputable:!1});return}T[N]=q.value,a({isComputable:!0,value:H(T)})}};return Promise.all(r.map((P,N)=>pt(P)||Pe(P)?Re(P,{publicKey:e,fileName:t,baseURL:i,secureSignature:s,secureExpire:o,store:n,signal:l,onProgress:O(B,N),source:c,integration:h,userAgent:u,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:m,contentType:p,multipartChunkSize:g,baseCDN:C,checkForUrlDuplicates:A,saveUrlForRecurrentUploads:_}).then(H=>H.uuid):P)).then(P=>Ps(P,{publicKey:e,baseURL:i,jsonpCallback:y,secureSignature:s,secureExpire:o,signal:l,source:c,integration:h,userAgent:u,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:m}).then(N=>new Ue(N,{baseCDN:C})).then(N=>(a&&a({isComputable:!0,value:1}),N)))}var Bt=class{constructor(e){d(this,"_concurrency",1);d(this,"_pending",[]);d(this,"_running",0);d(this,"_resolvers",new Map);d(this,"_rejectors",new Map);this._concurrency=e}_run(){let e=this._concurrency-this._running;for(let t=0;t<e;t++){let i=this._pending.shift();if(!i)return;let s=this._resolvers.get(i),o=this._rejectors.get(i);if(!s||!o)throw new Error("Unexpected behavior: resolver or rejector is undefined");this._running+=1,i().finally(()=>{this._resolvers.delete(i),this._rejectors.delete(i),this._running-=1,this._run()}).then(n=>s(n)).catch(n=>o(n))}}add(e){return new Promise((t,i)=>{this._resolvers.set(e,t),this._rejectors.set(e,i),this._pending.push(e),this._run()})}get pending(){return this._pending.length}get running(){return this._running}set concurrency(e){this._concurrency=e,this._run()}get concurrency(){return this._concurrency}};var Fe=()=>({}),De=r=>({...Fe(),"*currentActivity":null,"*currentActivityParams":{},"*history":[],"*historyBack":null,"*closeModal":()=>{r.set$({"*currentActivity":null,"*modalActive":!1})}}),Zt=r=>({...De(r),"*commonProgress":0,"*uploadList":[],"*focusedEntry":null,"*uploadQueue":new Bt(1),"*collectionErrors":[],"*collectionState":null,"*groupInfo":null,"*uploadTrigger":new Set,"*secureUploadsManager":null});var et=r=>`*l10n/${r}`,so="en",Yt=class{constructor(e){d(this,"_blockInstance",null);d(this,"_localeName","");d(this,"_callbacks",new Set);d(this,"_boundBlocks",new Map);this._blockInstance=e;for(let[t,i]of Object.entries(yt))this._blockInstance.add(et(t),i,!1);setTimeout(()=>{e.subConfigValue("localeName",async t=>{var o;if(!this._blockInstance||!t)return;this._localeName=t;let i=await ir(t);if(t!==so&&this._localeName!==t)return;let s=(o=this._blockInstance.cfg.localeDefinitionOverride)==null?void 0:o[t];for(let[n,l]of Object.entries(i)){let a=s==null?void 0:s[n];this._blockInstance.add(et(n),a!=null?a:l,!0);for(let c of this._callbacks)c()}}),e.subConfigValue("localeDefinitionOverride",t=>{var s;if(!t)return;let i=t[this._localeName];if(i)for(let[o,n]of Object.entries(i)){(s=this._blockInstance)==null||s.add(et(o),n,!0);for(let l of this._callbacks)l()}})})}onLocaleChange(e){let t=V(e,0);return this._callbacks.add(t),()=>{this._callbacks.delete(t)}}bindL10n(e,t,i){var o,n,l;e.$[t]=i(),this._boundBlocks.has(e)||this._boundBlocks.set(e,new Map),(n=(o=this._boundBlocks.get(e))==null?void 0:o.get(t))==null||n();let s=this.onLocaleChange(()=>{e.$[t]=i()});(l=this._boundBlocks.get(e))==null||l.set(t,s)}destroyL10nBindings(e){let t=this._boundBlocks.get(e);if(t){for(let i of t.values())i();this._boundBlocks.delete(e)}}destroy(){this._callbacks.clear()}};function $r(r,e){[...r.querySelectorAll("[l10n]")].forEach(t=>{let i=t.getAttribute("l10n");if(!i)return;let s="textContent",o=!1;if(i.includes(":")){let a=i.split(":");s=a[0],i=a[1],s.startsWith("@")&&(s=s.slice(1),o=!0)}let n=i;e.has(n)&&e.sub(n,a=>{if(!a)return;e.l10nProcessorSubs.has(n)||e.l10nProcessorSubs.set(n,new Set);let c=e.l10nProcessorSubs.get(n);c==null||c.forEach(f=>{f.remove(),c.delete(f),e.allSubs.delete(f)});let h=et(a).replace("*","");e.nodeCtx.has(h)||e.nodeCtx.add(h,a);let u=e.nodeCtx.sub(h,()=>{t[s]=e.l10n(a)});c==null||c.add(u),e.allSubs.add(u),t.removeAttribute("l10n")});let l=et(i);e.has(l)||e.add(l,""),e.sub(l,()=>{i=i,o?t.setAttribute(s,e.l10n(i)):t[s]=e.l10n(i)}),t.removeAttribute("l10n")})}var F=r=>`*cfg/${r}`;var oo={button:["toolbar"],checkbox:["toolbar"],menuitem:["menu","menubar"],option:["listbox"],tab:["tablist"]};function wt(r,e){e.tabIndex=0,e.focus(),r.tabIndex=-1}function $e(r){let e=r.role||r.type||r.tagName;if(!e)return null;let t=oo[e.toLowerCase()];if(!t)return null;for(let i of t){let s=r.closest(`[role=${i}]`);if(s)return s}}function Ne(r,e){return e.role==="toolbar"?no(e):e.querySelectorAll(`[role=${r.role}]`)}function no(r){return[...r.querySelectorAll("*")].filter(t=>t.role==="button"||t.type==="button"||t.role==="checkbox"||t.type==="checkbox")}function lo(r){let e=r.getAttribute("aria-orientation");if(e==="vertical")return!1;if(e==="horizontal")return!0;let t=r.role;return t==="menubar"||t==="tablist"||t==="toolbar"}function Nr(r){return e=>{let t=!1,i=(r==null?void 0:r.searchDelayMs)||300,s=0,o="";function n(u){let f=$e(u.target);if(!f){l();return}let m=Ne(u.target,f),p=Array.from(m).indexOf(u.target),g="ArrowDown",C="ArrowUp";if(lo(f)&&(e.document.dir==="rtl"?(g="ArrowLeft",C="ArrowRight"):(g="ArrowRight",C="ArrowLeft")),u.key===g)u.preventDefault(),wt(u.target,m[p+1]||m[0]);else if(u.key===C)u.preventDefault(),wt(u.target,m[p-1]||m[m.length-1]);else if(u.key==="Home")u.preventDefault(),wt(u.target,m[0]);else if(u.key==="End")u.preventDefault(),wt(u.target,m[m.length-1]);else if(u.key.length===1&&f.role!=="tablist"){let A=Date.now();A-s<=i?o+=u.key.toLowerCase():o=u.key.toLowerCase(),s=A;let _=Array.from(m).find(y=>{var T,D,B;return(B=(D=(T=y.textContent)==null?void 0:T.trim())==null?void 0:D.toLowerCase())==null?void 0:B.startsWith(o)});_&&(u.preventDefault(),wt(u.target,_))}}function l(){t=!1,e.removeEventListener("keydown",n)}function a(u){let f=$e(u.target);if(f){t||(t=!0,e.addEventListener("keydown",n));let m=Ne(u.target,f);for(let p of m)p!==u.target&&p.setAttribute("tabindex",-1)}else t&&l()}function c(u){(!u.relatedTarget||u.relatedTarget===e.document)&&l()}function h(u){let f=$e(u.target);if(f){let m=Ne(u.target,f);for(let p of m)p!==u.target&&p.setAttribute("tabindex",-1);u.target.setAttribute("tabindex",0)}}return e.addEventListener("click",h),e.addEventListener("focusin",a),e.addEventListener("focusout",c),()=>{l(),e.removeEventListener("click",h),e.removeEventListener("focusin",a),e.removeEventListener("focusout",c)}}}function Vr(){return r=>{let e,t;function i(o){if(o.target.getAttribute("aria-hidden")==="true"){e=o.target,e.setAttribute("aria-hidden","false"),t=e.hidden,t&&(e.hidden=!1);let n=o.target.querySelector('a, button, select, textarea, input:not([type=radio]), [type=radio]:checked, [tabindex]:not([tabindex="-1"])');n&&(n.tabIndex=0)}}function s(o){e&&e.contains(o.target)&&(!o.relatedTarget||!e.contains(o.relatedTarget))&&(o.target.tabIndex=-1,e.setAttribute("aria-hidden","true"),t&&(e.hidden=!0),e=null)}return r.addEventListener("keyuxJump",i),r.addEventListener("focusout",s),()=>{r.removeEventListener("keyuxJump",i),r.removeEventListener("focusout",s)}}}function zr(){return r=>{let e=[];function t(c){let h=r.document.activeElement;h&&h!==r.document.body&&e.push(new WeakRef(h)),c.focus({focusVisible:!0})}function i(){let c=e.pop();if(!c){r.document.activeElement.blur();return}let h=c.deref();h&&h.isConnected?h.focus():i()}let s=0,o;function n(c){clearInterval(o);let h=c.getAttribute("aria-controls");h&&(o=setInterval(()=>{if(s++>50){clearInterval(o);return}let u=r.document.getElementById(h);if(u){let f=u.querySelector('a, button, select, textarea, input:not([type=radio]), [type=radio]:checked, [tabindex]:not([tabindex="-1"])');f&&(clearInterval(o),u.dispatchEvent(new r.CustomEvent("keyuxJump",{bubbles:!0})),t(f))}},50))}function l(c){c.clientX===0&&c.clientY===0&&n(c.target)}function a(c){c.target.tagName==="INPUT"&&c.key==="Enter"&&n(c.target),c.key==="Escape"&&i()}return r.addEventListener("click",l),r.addEventListener("keydown",a),()=>{r.removeEventListener("click",l),r.removeEventListener("keydown",a)}}}function jr(r){let e,t=r.split(" ");function i(){e&&e.classList.remove(...t)}function s(o){o.clientX===0&&o.clientY===0&&(i(),o.target.classList.add(...t),e=o.target)}return o=>(o.addEventListener("keyup",i),o.addEventListener("click",s),()=>{o.removeEventListener("keyup",i),o.removeEventListener("click",s)})}function Br(r,e){let t=e.map(i=>i(r));return()=>{t.forEach(i=>i())}}var Ve=class{constructor(){d(this,"_listeners",new Map);d(this,"_scope",[])}addEventListener(e,t){let i=s=>{let o=s.target;o&&this._scope.some(n=>n===s.target||n.contains(o))&&t(s)};this._listeners.set(t,i),window.addEventListener(e,i)}removeEventListener(e,t){let i=this._listeners.get(t);i&&window.removeEventListener(e,i),this._listeners.delete(t)}get CustomEvent(){return window.CustomEvent}get document(){return window.document}get navigator(){return window.navigator}registerScope(e){this._scope.push(e)}destroy(){this._scope=[],this._listeners.forEach((e,t)=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",e),this._listeners.delete(t)})}},Jt=class{constructor(){d(this,"_destroyKeyUX");d(this,"_scopedWindow");this._scopedWindow=new Ve,this._destroyKeyUX=Br(this._scopedWindow,[Nr(),jr("is-pressed"),zr(),Vr()])}registerBlock(e){this._scopedWindow.registerScope(e)}destroy(){var e;(e=this._destroyKeyUX)==null||e.call(this),this._scopedWindow.destroy()}};var ao="uc-",I=class extends _e{constructor(){super();d(this,"requireCtxName",!1);d(this,"activityType",null);d(this,"init$",Fe());this.l10nProcessorSubs=new Map,this.addTemplateProcessor($r)}l10n(t,i={}){if(!t)return"";let s=this.$[et(t)]||t,o=Ar(s);for(let l of o)i[l.variable]=this.pluralize(l.pluralKey,Number(i[l.countVariable]));return Ae(s,i)}pluralize(t,i){let s=this.l10n("locale-id")||"en",o=jt(s,i);return this.l10n(`${t}__${o}`)}bindL10n(t,i){var s;(s=this.localeManager)==null||s.bindL10n(this,t,i)}emit(t,i,s){let o=this.has("*eventEmitter")&&this.$["*eventEmitter"];o&&o.emit(t,i,s)}hasBlockInCtx(t){for(let i of this.blocksRegistry)if(t(i))return!0;return!1}setOrAddState(t,i){this.add$({[t]:i},!0)}connectedCallback(){this.constructor.styleAttrs.forEach(i=>{this.setAttribute(i,"")}),this.hasAttribute("retpl")&&(this.constructor.template=null,this.processInnerHtml=!0),this.requireCtxName?Er({element:this,attribute:"ctx-name",onSuccess:()=>{super.connectedCallback()},onTimeout:()=>{console.error("Attribute `ctx-name` is required and it is not set.")}}):super.connectedCallback(),at.registerClient(this)}disconnectedCallback(){super.disconnectedCallback(),at.unregisterClient(this)}initCallback(){this.has("*blocksRegistry")||this.add("*blocksRegistry",new Set),this.$["*blocksRegistry"].add(this),this.has("*eventEmitter")||this.add("*eventEmitter",new Rt(this.debugPrint.bind(this))),this.has("*localeManager")||this.add("*localeManager",new Yt(this)),this.has("*a11y")||this.add("*a11y",new Jt),this.sub(et("locale-id"),i=>{let s=vr(i);this.style.direction=s==="ltr"?"":s})}get localeManager(){return this.has("*localeManager")?this.$["*localeManager"]:null}get a11y(){return this.has("*a11y")?this.$["*a11y"]:null}get blocksRegistry(){return this.$["*blocksRegistry"]}destroyCallback(){var i;let t=this.blocksRegistry;t==null||t.delete(this),(i=this.localeManager)==null||i.destroyL10nBindings(this),this.l10nProcessorSubs=new Map,v.deleteCtx(this),(t==null?void 0:t.size)===0&&setTimeout(()=>{this.destroyCtxCallback()},0)}destroyCtxCallback(){var t;v.deleteCtx(this.ctxName),(t=this.localeManager)==null||t.destroy()}async proxyUrl(t){if(this.cfg.secureDeliveryProxy&&this.cfg.secureDeliveryProxyUrlResolver&&console.warn("Both secureDeliveryProxy and secureDeliveryProxyUrlResolver are set. The secureDeliveryProxyUrlResolver will be used."),this.cfg.secureDeliveryProxyUrlResolver)try{return await this.cfg.secureDeliveryProxyUrlResolver(t,{uuid:dr(t),cdnUrlModifiers:hr(t),fileName:Nt(t)})}catch(i){return console.error("Failed to resolve secure delivery proxy URL. Falling back to the default URL.",i),t}return this.cfg.secureDeliveryProxy?Ae(this.cfg.secureDeliveryProxy,{previewUrl:t},{transform:i=>window.encodeURIComponent(i)}):t}get cfg(){if(!this.__cfgProxy){let t=Object.create(null);this.__cfgProxy=new Proxy(t,{set:(i,s,o)=>{if(typeof s!="string")return!1;let n=F(s);return this.has(n)||this.add(n,z[s]),this.$[n]=o,!0},get:(i,s)=>{let o=F(s);return this.has(o)||this.add(o,z[s]),this.$[F(s)]}})}return this.__cfgProxy}subConfigValue(t,i){let s=F(t);this.has(s)||this.add(s,z[t]),this.sub(s,i)}debugPrint(...t){if(!this.cfg.debug)return;let i=t;if(typeof(t==null?void 0:t[0])=="function"){let s=t[0];i=s()}console.log(`[${this.ctxName}]`,...i)}static reg(t){if(!t){super.reg();return}t.startsWith(ao)&&super.reg(t)}};d(I,"StateConsumerScope",null),d(I,"styleAttrs",[]);var Hr="active",Ct="___ACTIVITY_IS_ACTIVE___",rt=class rt extends I{constructor(){super(...arguments);d(this,"historyTracked",!1);d(this,"init$",De(this));d(this,"_debouncedHistoryFlush",V(this._historyFlush.bind(this),10))}_deactivate(){var i;let t=rt._activityCallbacks.get(this);this[Ct]=!1,this.removeAttribute(Hr),(i=t==null?void 0:t.deactivateCallback)==null||i.call(t)}_activate(){var i;let t=rt._activityCallbacks.get(this);this.$["*historyBack"]=this.historyBack.bind(this),this[Ct]=!0,this.setAttribute(Hr,""),(i=t==null?void 0:t.activateCallback)==null||i.call(t),this._debouncedHistoryFlush(),this.emit(x.ACTIVITY_CHANGE,{activity:this.activityType})}initCallback(){super.initCallback(),this.hasAttribute("current-activity")&&this.sub("*currentActivity",t=>{this.setAttribute("current-activity",t)}),this.activityType&&(this.hasAttribute("activity")||this.setAttribute("activity",this.activityType),this.sub("*currentActivity",t=>{this.activityType!==t&&this[Ct]?this._deactivate():this.activityType===t&&!this[Ct]&&this._activate(),t||(this.$["*history"]=[])}),this.has("*modalActive")&&this.sub("*modalActive",t=>{!t&&this.activityType===this.$["*currentActivity"]&&(this.$["*currentActivity"]=null)}))}_historyFlush(){let t=this.$["*history"];t&&(t.length>10&&(t=t.slice(t.length-11,t.length-1)),this.historyTracked&&t[t.length-1]!==this.activityType&&t.push(this.activityType),this.$["*history"]=t)}_isActivityRegistered(){return this.activityType&&rt._activityCallbacks.has(this)}get isActivityActive(){return this[Ct]}get couldOpenActivity(){return!0}registerActivity(t,i={}){let{onActivate:s,onDeactivate:o}=i;rt._activityCallbacks.set(this,{activateCallback:s,deactivateCallback:o})}unregisterActivity(){this.isActivityActive&&this._deactivate(),rt._activityCallbacks.delete(this)}destroyCallback(){super.destroyCallback(),this._isActivityRegistered()&&this.unregisterActivity();let t=this.$["*currentActivity"];!![...this.blocksRegistry].find(s=>s instanceof rt&&s.activityType===t)||(this.$["*currentActivity"]=null,this.setOrAddState("*modalActive",!1))}get activityKey(){return this.ctxName+this.activityType}get activityParams(){return this.$["*currentActivityParams"]}get initActivity(){return this.getCssData("--cfg-init-activity")}get doneActivity(){return this.getCssData("--cfg-done-activity")}historyBack(){var i;let t=this.$["*history"];if(t){let s=t.pop();for(;s===this.activityType;)s=t.pop();let o=!!s;if(s){let n=[...this.blocksRegistry].find(l=>l.activityType===s);o=(i=n==null?void 0:n.couldOpenActivity)!=null?i:!1}s=o?s:void 0,this.$["*currentActivity"]=s,this.$["*history"]=t,s||this.setOrAddState("*modalActive",!1)}}};d(rt,"_activityCallbacks",new Map);var E=rt;E.activities=Object.freeze({START_FROM:"start-from",CAMERA:"camera",DRAW:"draw",UPLOAD_LIST:"upload-list",URL:"url",CLOUD_IMG_EDIT:"cloud-image-edit",EXTERNAL:"external",DETAILS:"details"});var Gr="<svg width='0' height='0' style='position:absolute'><symbol viewBox='0 0 24 24' id='uc-icon-about' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.152 14.12v.1h1.523v-.1c.007-.409.053-.752.138-1.028.086-.277.22-.517.405-.72.188-.202.434-.397.735-.586.32-.191.593-.412.82-.66.232-.249.41-.531.533-.847.125-.32.187-.678.187-1.076 0-.579-.137-1.085-.41-1.518a2.717 2.717 0 0 0-1.14-1.018c-.49-.245-1.062-.367-1.715-.367-.597 0-1.142.114-1.636.34-.49.228-.884.564-1.182 1.008-.299.44-.46.98-.485 1.619h1.62c.024-.377.118-.684.282-.922a1.48 1.48 0 0 1 .617-.532c.25-.114.51-.17.784-.17.301 0 .575.063.82.191.248.124.447.302.597.533.149.23.223.504.223.82 0 .263-.05.502-.149.72a1.91 1.91 0 0 1-.405.574 3.48 3.48 0 0 1-.575.453 4.22 4.22 0 0 0-.847.66c-.234.242-.415.558-.543.949-.125.39-.19.916-.197 1.577Zm.053 3.03c.21.206.46.31.75.31.196 0 .374-.049.534-.144a1.1 1.1 0 0 0 .383-.384c.1-.163.15-.343.15-.538a1 1 0 0 0-.32-.746 1.019 1.019 0 0 0-.746-.314c-.291 0-.542.105-.751.314-.21.206-.314.455-.314.746 0 .295.104.547.314.756ZM24 12c0 6.627-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0s12 5.373 12 12Zm-1.5 0c0 5.799-4.701 10.5-10.5 10.5S1.5 17.799 1.5 12 6.201 1.5 12 1.5 22.5 6.201 22.5 12Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-add' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12.75 21a.75.75 0 0 1-1.5 0v-8.25H3a.75.75 0 0 1 0-1.5h8.25V3a.75.75 0 0 1 1.5 0v8.25H21a.75.75 0 0 1 0 1.5h-8.25V21Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-arrow-down' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.5 23.03a.75.75 0 0 0 .999 0l9.29-8.276a.75.75 0 0 0-.998-1.12l-8.042 7.164V1.53a.75.75 0 0 0-1.5 0v19.267l-8.04-7.163a.75.75 0 0 0-.998 1.12z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-back' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M20.251 12a.75.75 0 0 1-.75.75H6.067l5.72 5.85a.75.75 0 1 1-1.072 1.05L4.136 12.92a1.292 1.292 0 0 1 0-1.842l6.579-6.728a.75.75 0 1 1 1.072 1.048l-5.72 5.851H19.5a.75.75 0 0 1 .75.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-badge-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13.6 18.4a1.6 1.6 0 1 1-3.2 0 1.6 1.6 0 0 1 3.2 0zM12 4.5A1.5 1.5 0 0 1 13.5 6v7a1.5 1.5 0 0 1-3 0V6A1.5 1.5 0 0 1 12 4.5z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-badge-success' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m10.5 18.204 7.6-8.183a1.5 1.5 0 0 0-2.2-2.042l-5.4 5.817-2.4-2.586a1.5 1.5 0 1 0-2.2 2.041l4.6 4.953Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-box' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M1.01 4.148a.75.75 0 0 1 .75.75v4.348a4.437 4.437 0 0 1 2.988-1.153c1.734 0 3.23.992 3.978 2.438a4.478 4.478 0 0 1 3.978-2.438c2.49 0 4.488 2.044 4.488 4.543 0 2.5-1.999 4.544-4.488 4.544a4.478 4.478 0 0 1-3.978-2.438 4.478 4.478 0 0 1-3.978 2.438C2.26 17.18.26 15.135.26 12.636V4.898a.75.75 0 0 1 .75-.75Zm.75 8.488c0 1.692 1.348 3.044 2.988 3.044s2.989-1.352 2.989-3.044c0-1.691-1.349-3.043-2.989-3.043S1.76 10.945 1.76 12.636Zm10.944-3.043c-1.64 0-2.988 1.352-2.988 3.043 0 1.692 1.348 3.044 2.988 3.044s2.988-1.352 2.988-3.044c0-1.69-1.348-3.043-2.988-3.043Zm4.328-1.23a.75.75 0 0 1 1.052.128l2.333 2.983 2.333-2.983a.75.75 0 0 1 1.181.924l-2.562 3.277 2.562 3.276a.75.75 0 1 1-1.181.924l-2.333-2.983-2.333 2.983a.75.75 0 1 1-1.181-.924l2.562-3.276-2.562-3.277a.75.75 0 0 1 .129-1.052Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-brightness' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M15 10a5 5 0 0 1-5 5m5-5a5 5 0 0 0-5-5m5 5h-5m0 5a5 5 0 0 1 0-10m0 10V5m0 15v-3M2.93 2.929 5.05 5.05M0 10h3m-.07 7.071 2.12-2.121M10 0v3m7.07 14.071-2.12-2.121M20 10h-3m.07-7.071L14.95 5.05m-.626 2.45H10m4.324 5H10'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-camera' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M7.65 2.55a.75.75 0 0 1 .6-.3h7.5a.75.75 0 0 1 .6.3l2.025 2.7H21a3 3 0 0 1 3 3v10.5a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V8.25a3 3 0 0 1 3-3h2.625zm.975 1.2L6.6 6.45a.75.75 0 0 1-.6.3H3a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h18a1.5 1.5 0 0 0 1.5-1.5V8.25a1.5 1.5 0 0 0-1.5-1.5h-3a.75.75 0 0 1-.6-.3l-2.025-2.7zm3.375 6a3.375 3.375 0 1 0 0 6.75 3.375 3.375 0 0 0 0-6.75zm-4.875 3.375a4.875 4.875 0 1 1 9.75 0 4.875 4.875 0 0 1-9.75 0z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-close' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M4.604 4.604a.75.75 0 0 1 1.06 0L12 10.939l6.335-6.335a.75.75 0 1 1 1.061 1.06L13.061 12l6.335 6.335a.75.75 0 1 1-1.06 1.061L12 13.061l-6.335 6.335a.75.75 0 0 1-1.061-1.06L10.939 12 4.604 5.665a.75.75 0 0 1 0-1.061z'/></symbol><symbol fill='currentColor' viewBox='0 0 20 20' id='uc-icon-closeMax' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='M8.232 10 3.585 5.353l1.768-1.768L10 8.232l4.648-4.647 1.767 1.768L11.768 10l4.647 4.648-1.767 1.767L10 11.768l-4.647 4.647-1.768-1.767L8.232 10Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-collapse' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M3.116 12a.75.75 0 0 1 .75-.75h16.268a.75.75 0 0 1 0 1.5H3.866a.75.75 0 0 1-.75-.75Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-contrast' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M2 10a8 8 0 1 0 16 0 8 8 0 1 0-16 0m8-8v16m8-8h-8m7.598 2.5H10m6.24 2.5H10m7.6-7.5H10M16.242 5H10'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-crop' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M20 14H7.005C6.45 14 6 13.55 6 12.995V0M0 6h13.067c.515 0 .933.418.933.933V20M14.5.4 13 2l1.5 1.6M13 2h2a3 3 0 0 1 3 3v2M5.5 19.6 7 18l-1.5-1.6M7 18H5a3 3 0 0 1-3-3v-2'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-default' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.501.392a.75.75 0 0 1 .998 0l6.704 5.972a.75.75 0 0 1-.998 1.12l-5.455-4.86v13.439a.75.75 0 0 1-1.5 0V2.625l-5.454 4.86a.75.75 0 1 1-.998-1.12zM.857 16.73a.75.75 0 0 1 .75.75v4.914h20.786v-4.914a.75.75 0 0 1 1.5 0v5.664a.75.75 0 0 1-.75.75H.857a.75.75 0 0 1-.75-.75v-5.664a.75.75 0 0 1 .75-.75z'/></symbol><symbol fill='currentColor' viewBox='0 0 20 20' id='uc-icon-done' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='m18.057 6.333-9.365 9.125a1.25 1.25 0 0 1-1.768-.023L1.92 10.296l1.791-1.744 4.132 4.243 8.47-8.253 1.744 1.79Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-dropbox' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.019 1.92a.75.75 0 0 1 .806 0L12 5.219l5.176-3.297a.75.75 0 0 1 .806 0l5.577 3.553a.75.75 0 0 1 0 1.265l-4.574 2.914 4.574 2.914a.75.75 0 0 1 0 1.265l-5.577 3.554a.75.75 0 0 1-.806 0L12 14.089l-5.175 3.297a.75.75 0 0 1-.806 0L.44 13.833a.75.75 0 0 1 0-1.266l4.575-2.914L.44 6.74a.75.75 0 0 1 0-1.265zm.403 8.616L2.24 13.2l4.182 2.664 4.181-2.664zm6.975 2.664 4.182 2.664L21.76 13.2l-4.181-2.664zm2.776-3.547L12 12.311 7.828 9.653 12 6.995zm1.406-.882 4.181-2.664-4.181-2.664-4.182 2.664zm-6.976-2.664L6.422 3.443 2.24 6.107 6.422 8.77zM5.791 18.544a.75.75 0 0 1 1.035-.23l5.175 3.297 5.175-3.297a.75.75 0 1 1 .806 1.265l-5.578 3.554a.75.75 0 0 1-.806 0L6.02 19.579a.75.75 0 0 1-.23-1.035z'/></symbol><symbol fill='currentColor' viewBox='0 0 25 24' id='uc-icon-edit-file' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='M18.558 2.804a.78.78 0 0 0-.557.235l-.008.007-2.472 2.46 3.847 3.848 2.46-2.473.004-.003a.78.78 0 0 0 0-1.108l-.004-.003-2.712-2.728a.78.78 0 0 0-.558-.235Zm-.248 7.613-3.852-3.852-8.93 8.887-1.516 5.41 5.41-1.515 8.888-8.93Zm-.636-8.934a2.28 2.28 0 0 1 2.512.505l2.702 2.717.002.002a2.278 2.278 0 0 1 0 3.234l-.002.002-12.541 12.602a.75.75 0 0 1-.33.193l-6.884 1.928a.75.75 0 0 1-.925-.924l1.928-6.885a.75.75 0 0 1 .193-.33l12.603-12.54a2.28 2.28 0 0 1 .742-.504Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-edit-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M18.558 2.804a.78.78 0 0 0-.557.235l-.008.007-2.472 2.46 3.847 3.848 2.46-2.473.004-.003a.78.78 0 0 0 0-1.108l-.004-.003-2.712-2.728a.78.78 0 0 0-.558-.235Zm-.248 7.613-3.852-3.852-8.93 8.887-1.516 5.41 5.41-1.515 8.888-8.93Zm-.636-8.934a2.28 2.28 0 0 1 2.512.505l2.702 2.717.002.002a2.278 2.278 0 0 1 0 3.234l-.002.002-12.541 12.602a.75.75 0 0 1-.33.193l-6.884 1.928a.75.75 0 0 1-.925-.924l1.928-6.885a.75.75 0 0 1 .193-.33l12.603-12.54a2.28 2.28 0 0 1 .742-.504Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-enhance' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M19 13h-2m0 0a4 4 0 0 1-4-4m4 4a4 4 0 0 0-4 4m0-8V7m0 2a4 4 0 0 1-4 4m-2 0h2m0 0a4 4 0 0 1 4 4m0 0v2M8 8.5H6.5m0 0a2 2 0 0 1-2-2m2 2a2 2 0 0 0-2 2m0-4V5m0 1.5a2 2 0 0 1-2 2M1 8.5h1.5m0 0a2 2 0 0 1 2 2m0 0V12M12 3h-1m0 0a1 1 0 0 1-1-1m1 1a1 1 0 0 0-1 1m0-2V1m0 1a1 1 0 0 1-1 1M8 3h1m0 0a1 1 0 0 1 1 1m0 0v1'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13 13h-2V7h2m0 10h-2v-2h2M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-evernote' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M9.804 2.27v-.048c.055-.263.313-.562.85-.562h.44c.142 0 .325.014.526.033.066.009.124.023.267.06l.13.032h.002c.319.079.515.275.644.482a1.461 1.461 0 0 1 .16.356l.004.012a.75.75 0 0 0 .603.577l1.191.207a1988.512 1988.512 0 0 0 2.332.402c.512.083 1.1.178 1.665.442.64.3 1.19.795 1.376 1.77.548 2.931.657 5.829.621 8a39.233 39.233 0 0 1-.125 2.602 17.518 17.518 0 0 1-.092.849.735.735 0 0 0-.024.112c-.378 2.705-1.269 3.796-2.04 4.27-.746.457-1.53.451-2.217.447h-.192c-.46 0-1.073-.23-1.581-.635-.518-.412-.763-.87-.763-1.217 0-.45.188-.688.355-.786.161-.095.436-.137.796.087a.75.75 0 1 0 .792-1.274c-.766-.476-1.64-.52-2.345-.108-.7.409-1.098 1.188-1.098 2.08 0 .996.634 1.84 1.329 2.392.704.56 1.638.96 2.515.96l.185.002c.667.009 1.874.025 3.007-.67 1.283-.786 2.314-2.358 2.733-5.276a4.213 4.213 0 0 0 .056-.335c.023-.184.051-.445.079-.772.055-.655.111-1.585.13-2.704.037-2.234-.074-5.239-.647-8.301v-.002c-.294-1.544-1.233-2.391-2.215-2.85-.777-.363-1.623-.496-2.129-.576a8.872 8.872 0 0 1-.25-.041l-.006-.001-1.99-.345-.761-.132a2.93 2.93 0 0 0-.182-.338A2.532 2.532 0 0 0 12.379.329l-.091-.023a3.967 3.967 0 0 0-.493-.103L11.769.2a7.846 7.846 0 0 0-.675-.04h-.44c-.733 0-1.368.284-1.795.742L2.416 7.431c-.468.428-.751 1.071-.751 1.81 0 .02 0 .041.003.062l.003.034c.017.21.038.468.096.796.107.715.275 1.47.391 1.994.029.13.055.245.075.342l.002.008c.258 1.141.641 1.94.978 2.466.168.263.323.456.444.589a2.808 2.808 0 0 0 .192.194c1.536 1.562 3.713 2.196 5.731 2.08.13-.005.35-.032.537-.073a2.627 2.627 0 0 0 .652-.24c.425-.26.75-.661.992-1.046.184-.294.342-.61.473-.915a3.8 3.8 0 0 0 .627.493 5.022 5.022 0 0 0 1.97.709l.023.002.018.003.11.016c.088.014.205.035.325.058l.056.014c.088.022.164.04.235.061a1.736 1.736 0 0 1 .145.048l.03.014c.765.34 1.302 1.09 1.302 1.871a.75.75 0 0 0 1.5 0c0-1.456-.964-2.69-2.18-3.235a3.595 3.595 0 0 0-.679-.217l-.063-.015a10.616 10.616 0 0 0-.606-.105l-.02-.003-.03-.003h-.002a3.542 3.542 0 0 1-1.331-.485c-.471-.298-.788-.692-.828-1.234a.75.75 0 0 0-1.48-.106l-.001.003-.004.017a8.23 8.23 0 0 1-.092.352 9.963 9.963 0 0 1-.298.892c-.132.34-.29.68-.47.966-.174.276-.339.454-.478.549a1.178 1.178 0 0 1-.221.072 1.949 1.949 0 0 1-.241.036h-.013l-.032.002c-1.684.1-3.423-.437-4.604-1.65a.746.746 0 0 0-.053-.05L4.84 14.6a1.348 1.348 0 0 1-.07-.073 2.99 2.99 0 0 1-.293-.392c-.242-.379-.558-1.014-.778-1.985a54.1 54.1 0 0 0-.083-.376 27.494 27.494 0 0 1-.367-1.872l-.003-.02a6.791 6.791 0 0 1-.08-.67c.004-.277.086-.475.2-.609l.067-.067a.63.63 0 0 1 .292-.145h.05c.18 0 1.095.055 2.013.115l1.207.08.534.037a.747.747 0 0 0 .052.002c.782 0 1.349-.206 1.759-.585l.005-.005c.553-.52.622-1.225.622-1.76V6.24l-.026-.565A774.97 774.97 0 0 1 9.885 4.4c-.042-.961-.081-1.939-.081-2.13ZM4.995 6.953a251.126 251.126 0 0 1 2.102.137l.508.035c.48-.004.646-.122.715-.185.07-.068.146-.209.147-.649l-.024-.548a791.69 791.69 0 0 1-.095-2.187L4.995 6.953Zm16.122 9.996Zm-5.479-5.323a.75.75 0 0 0 1.014.31 2.04 2.04 0 0 1 .304-.089 1.84 1.84 0 0 1 .544-.039c.215.023.321.06.37.085.033.016.039.026.047.04a.75.75 0 0 0 1.289-.767c-.337-.567-.906-.783-1.552-.85a3.334 3.334 0 0 0-1.002.062c-.27.056-.531.14-.705.234a.75.75 0 0 0-.31 1.014Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-expand' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m12 8.337-8.47 8.47a.75.75 0 0 1-1.06-1.06l8.605-8.606a1.29 1.29 0 0 1 1.85 0l8.605 8.605a.75.75 0 1 1-1.06 1.06L12 8.338Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-exposure' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M10 20v-3M2.93 2.929 5.05 5.05M0 10h3m-.07 7.071 2.12-2.121M10 0v3m7.07 14.071-2.12-2.121M20 10h-3m.07-7.071L14.95 5.05M5 10a5 5 0 1 0 10 0 5 5 0 1 0-10 0'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-external-source-placeholder' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.341 3.27a10.5 10.5 0 0 1 5.834-1.77.75.75 0 0 0 0-1.5 12 12 0 1 0 12 12 .75.75 0 0 0-1.5 0A10.5 10.5 0 1 1 6.34 3.27Zm14.145 1.48a.75.75 0 1 0-1.06-1.062L9.925 13.19V7.95a.75.75 0 1 0-1.5 0V15c0 .414.336.75.75.75h7.05a.75.75 0 0 0 0-1.5h-5.24l9.501-9.5Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-facebook' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12 1.5C6.201 1.5 1.5 6.201 1.5 12c0 4.943 3.416 9.089 8.016 10.204v-6.108H7.383a.75.75 0 0 1-.75-.75v-3.281a.75.75 0 0 1 .75-.75h2.133V9.393c0-.958.225-2.511 1.38-3.65 1.194-1.177 3.174-1.718 6.254-1.056a.75.75 0 0 1 .592.733v2.754a.75.75 0 0 1-.75.75c-.692 0-1.203.026-1.584.082-.387.057-.578.137-.675.202-.109.073-.237.205-.237 1.029v1.078h2.39a.75.75 0 0 1 .742.866l-.516 3.281a.75.75 0 0 1-.74.634h-1.876v6.106C19.09 21.082 22.5 16.939 22.5 12c0-5.799-4.701-10.5-10.5-10.5zM0 12C0 5.373 5.373 0 12 0s12 5.373 12 12c0 5.995-4.395 10.961-10.138 11.856a.75.75 0 0 1-.866-.74v-7.77a.75.75 0 0 1 .75-.75h1.984l.28-1.781h-2.264a.75.75 0 0 1-.75-.75v-1.828c0-.829.089-1.729.9-2.274.363-.244.807-.37 1.293-.441a9.623 9.623 0 0 1 1.053-.086V6.04c-2.41-.405-3.645.132-4.293.771-.737.728-.933 1.793-.933 2.582v2.672a.75.75 0 0 1-.75.75H8.133v1.78h2.133a.75.75 0 0 1 .75.75v7.772a.75.75 0 0 1-.865.741C4.4 22.968 0 18 0 12z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M2.895 1.201c0-.473.383-.857.857-.857h8.4c.227 0 .445.09.606.251l8.4 8.4c.16.16.25.379.25.606v13.2a.857.857 0 0 1-.856.857h-16.8a.857.857 0 0 1-.857-.857zm1.714.857v19.886h15.085V10.458h-7.542a.857.857 0 0 1-.858-.857V2.058zm8.4 1.213 5.473 5.473H13.01z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-filters' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M4.5 6.5a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0m-3.5 6a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0m7 0a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-flickr' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M5.959 7.926c-2.298 0-4.14 1.834-4.14 4.073 0 2.241 1.842 4.075 4.14 4.075 2.302 0 4.145-1.834 4.145-4.075 0-2.238-1.843-4.073-4.145-4.073Zm-5.64 4.073c0-3.086 2.533-5.573 5.64-5.573 3.11 0 5.645 2.486 5.645 5.573 0 3.089-2.535 5.575-5.645 5.575-3.107 0-5.64-2.487-5.64-5.575Zm18.07-4.073c-2.301 0-4.144 1.835-4.144 4.073 0 2.24 1.843 4.075 4.145 4.075 2.299 0 4.141-1.834 4.141-4.075 0-2.239-1.842-4.073-4.141-4.073Zm-5.644 4.073c0-3.087 2.535-5.573 5.645-5.573 3.108 0 5.641 2.487 5.641 5.573 0 3.088-2.533 5.575-5.641 5.575-3.11 0-5.645-2.486-5.645-5.575Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-flip' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M19.6 5 18 3.5 16.4 5m3.2 10L18 16.5 16.4 15M18 3.523v12.954M3.3 8.5h10.654c.301 0 .415-.395.159-.554L3.459 1.286A.3.3 0 0 0 3 1.542V8.2a.3.3 0 0 0 .3.3zm0 3h10.654c.301 0 .415.395.159.554l-10.654 6.66A.3.3 0 0 1 3 18.458v-6.66a.3.3 0 0 1 .3-.3z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-gamma' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M17 3C9 6 2.5 11.5 2.5 17.5m0 0h1m-1 0v-1m14 1h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3-14v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-gdrive' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M7.736 1.818a.75.75 0 0 1 .647-.37h7.587a.75.75 0 0 1 .655.383l7.233 12.946a.75.75 0 0 1-.003.737l-3.794 6.66a.75.75 0 0 1-.651.378H4.59a.75.75 0 0 1-.651-.378l-3.794-6.66a.75.75 0 0 1 .005-.75zm.64 1.876L1.663 15.148l2.93 5.145 6.655-11.581zm3.736 6.526-2.398 4.173H14.5zm4.116 4.173h5.697L15.53 2.947H9.677zm5.685 1.5H8.852l-2.966 5.16h13.088z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-gphotos' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12.51 0c-.702 0-1.272.57-1.272 1.273V7.35A6.381 6.381 0 0 0 0 11.489c0 .703.57 1.273 1.273 1.273H7.35A6.381 6.381 0 0 0 11.488 24c.704 0 1.274-.57 1.274-1.273V16.65A6.381 6.381 0 0 0 24 12.51c0-.703-.57-1.273-1.273-1.273H16.65A6.381 6.381 0 0 0 12.511 0Zm.252 11.232V1.53a4.857 4.857 0 0 1 0 9.702Zm-1.53.006H1.53a4.857 4.857 0 0 1 9.702 0Zm1.536 1.524a4.857 4.857 0 0 0 9.702 0h-9.702Zm-6.136 4.857c0-2.598 2.04-4.72 4.606-4.85v9.7a4.857 4.857 0 0 1-4.606-4.85Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-huddle' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.204 2.002c-.252.23-.357.486-.357.67V21.07c0 .15.084.505.313.812.208.28.499.477.929.477.519 0 .796-.174.956-.365.178-.212.286-.535.286-.924v-.013l.117-6.58c.004-1.725 1.419-3.883 3.867-3.883 1.33 0 2.332.581 2.987 1.364.637.762.95 1.717.95 2.526v6.47c0 .392.11.751.305.995.175.22.468.41 1.008.41.52 0 .816-.198 1.002-.437.207-.266.31-.633.31-.969V14.04c0-2.81-1.943-5.108-4.136-5.422a5.971 5.971 0 0 0-3.183.41c-.912.393-1.538.96-1.81 1.489a.75.75 0 0 1-1.417-.344v-7.5c0-.587-.47-1.031-1.242-1.031-.315 0-.638.136-.885.36ZM5.194.892A2.844 2.844 0 0 1 7.09.142c1.328 0 2.742.867 2.742 2.53v5.607a6.358 6.358 0 0 1 1.133-.629 7.47 7.47 0 0 1 3.989-.516c3.056.436 5.425 3.482 5.425 6.906v6.914c0 .602-.177 1.313-.627 1.89-.47.605-1.204 1.016-2.186 1.016-.96 0-1.698-.37-2.179-.973-.46-.575-.633-1.294-.633-1.933v-6.469c0-.456-.19-1.071-.602-1.563-.394-.471-.986-.827-1.836-.827-1.447 0-2.367 1.304-2.367 2.39v.014l-.117 6.58c-.001.64-.177 1.333-.637 1.881-.48.57-1.2.9-2.105.9-.995 0-1.7-.5-2.132-1.081-.41-.552-.61-1.217-.61-1.708V2.672c0-.707.366-1.341.847-1.78Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-info' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11 9h2V7h-2m1 13c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2m-1 15h2v-6h-2v6Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-instagram' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.225 12a5.775 5.775 0 1 1 11.55 0 5.775 5.775 0 0 1-11.55 0zM12 7.725a4.275 4.275 0 1 0 0 8.55 4.275 4.275 0 0 0 0-8.55zm6.425-.75a1.4 1.4 0 1 0 0-2.8 1.4 1.4 0 0 0 0 2.8zm-6.467-6.8h.084c2.152 0 3.823 0 5.152.132 1.35.134 2.427.41 3.362 1.013a7.15 7.15 0 0 1 2.124 2.124c.604.935.88 2.012 1.013 3.362.132 1.329.132 3 .132 5.152v.084c0 2.152 0 3.823-.132 5.152-.134 1.35-.41 2.427-1.013 3.362a7.15 7.15 0 0 1-2.124 2.124c-.935.604-2.012.88-3.362 1.013-1.329.132-3 .132-5.152.132h-.084c-2.152 0-3.824 0-5.153-.132-1.35-.134-2.427-.409-3.36-1.013a7.15 7.15 0 0 1-2.125-2.124C.716 19.62.44 18.544.307 17.194c-.132-1.329-.132-3-.132-5.152v-.084c0-2.152 0-3.823.132-5.152.133-1.35.409-2.427 1.013-3.362A7.15 7.15 0 0 1 3.444 1.32C4.378.716 5.456.44 6.805.307c1.33-.132 3-.132 5.153-.132zM6.953 1.799c-1.234.123-2.043.36-2.695.78A5.65 5.65 0 0 0 2.58 4.26c-.42.65-.657 1.46-.78 2.695C1.676 8.2 1.675 9.797 1.675 12s0 3.8.124 5.046c.123 1.235.36 2.044.78 2.696a5.649 5.649 0 0 0 1.68 1.678c.65.421 1.46.658 2.694.78 1.247.124 2.844.125 5.047.125s3.8 0 5.046-.124c1.235-.123 2.044-.36 2.695-.78a5.648 5.648 0 0 0 1.68-1.68c.42-.65.657-1.46.78-2.694.123-1.247.124-2.844.124-5.047s-.001-3.8-.125-5.046c-.122-1.235-.359-2.044-.78-2.695a5.65 5.65 0 0 0-1.679-1.68c-.651-.42-1.46-.657-2.695-.78-1.246-.123-2.843-.124-5.046-.124-2.203 0-3.8 0-5.047.124z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-local' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M3 3.75a1.5 1.5 0 0 0-1.5 1.5v13.5a1.5 1.5 0 0 0 1.5 1.5h18a1.5 1.5 0 0 0 1.5-1.5V9A1.5 1.5 0 0 0 21 7.5h-9a.75.75 0 0 1-.643-.364L9.325 3.75zm-3 1.5a3 3 0 0 1 3-3h6.75a.75.75 0 0 1 .643.364L12.425 6H21a3 3 0 0 1 3 3v9.75a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-mirror' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M5 .4 3.5 2 5 3.6M15 .4 16.5 2 15 3.6M3.52 2h12.957M8.5 16.7V6.046c0-.301-.394-.415-.554-.159L1.287 16.541a.3.3 0 0 0 .255.459H8.2a.3.3 0 0 0 .3-.3zm3 0V6.046c0-.301.395-.415.555-.159l6.659 10.654a.3.3 0 0 1-.255.459H11.8a.3.3 0 0 1-.3-.3z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-onedrive' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13.616 4.147a7.689 7.689 0 0 0-7.642 3.285A6.299 6.299 0 0 0 1.455 17.3c.684.894 2.473 2.658 5.17 2.658h12.141c.95 0 1.882-.256 2.697-.743.815-.486 1.514-1.247 1.964-2.083a5.26 5.26 0 0 0-3.713-7.612 7.69 7.69 0 0 0-6.098-5.373ZM3.34 17.15c.674.63 1.761 1.308 3.284 1.308h12.142a3.76 3.76 0 0 0 2.915-1.383l-7.494-4.489L3.34 17.15Zm10.875-6.25 2.47-1.038a5.239 5.239 0 0 1 1.427-.389 6.19 6.19 0 0 0-10.3-1.952 6.338 6.338 0 0 1 2.118.813l4.285 2.567Zm4.55.033c-.512 0-1.019.104-1.489.307l-.006.003-1.414.594 6.521 3.906a3.76 3.76 0 0 0-3.357-4.8l-.254-.01ZM4.097 9.617A4.799 4.799 0 0 1 6.558 8.9c.9 0 1.84.25 2.587.713l3.4 2.037-10.17 4.28a4.799 4.799 0 0 1 1.721-6.312Z'/></symbol><symbol viewBox='0 0 40 40' id='uc-icon-original' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.5' d='M0 40 40 0'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-remove-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.955 3.3A2.969 2.969 0 0 0 8.998 6h5.914a2.97 2.97 0 0 0-2.957-2.7zM16.416 6a4.47 4.47 0 0 0-8.922 0h-2.32a.755.755 0 0 0-.111.008H3.075a.75.75 0 1 0 0 1.5h1.35V19.35a2.85 2.85 0 0 0 2.85 2.85h9.45a2.85 2.85 0 0 0 2.85-2.85V7.508h1.35a.75.75 0 0 0 0-1.5h-1.989A.754.754 0 0 0 18.825 6zM5.925 7.508V19.35a1.35 1.35 0 0 0 1.35 1.35h9.45a1.35 1.35 0 0 0 1.35-1.35V7.508z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-rotate' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M13.5.4 12 2l1.5 1.6M12.023 2H14.4A3.6 3.6 0 0 1 18 5.6V8M4 17h9a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-sad' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M2 17c4.418-4 11.582-4 16 0M16.5 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-11 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-saturation' xmlns='http://www.w3.org/2000/svg'><defs><linearGradient id='apuc-icon-id__a' x1='10.001' y1='1' x2='10.001' y2='19' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient></defs><circle cx='10.001' cy='10' r='9' transform='rotate(90 10 10)' fill='url(#apuc-icon-id__a)'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-select' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m7 10 5 5 5-5H7Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-slider' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M0 10h11m0 0a2 2 0 1 0 4 0m-4 0a2 2 0 1 1 4 0m0 0h5'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-tuning' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M8 10h11M1 10h4M1 4.5h11m3 0h4m-18 11h11m3 0h4m-7-11a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0M5 10a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0m7 5.5a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-upload' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.501.392a.75.75 0 0 1 .998 0l6.704 5.972a.75.75 0 0 1-.998 1.12l-5.455-4.86v13.439a.75.75 0 0 1-1.5 0V2.625l-5.454 4.86a.75.75 0 1 1-.998-1.12zM.857 16.73a.75.75 0 0 1 .75.75v4.914h20.786v-4.914a.75.75 0 0 1 1.5 0v5.664a.75.75 0 0 1-.75.75H.857a.75.75 0 0 1-.75-.75v-5.664a.75.75 0 0 1 .75-.75z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-upload-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13 13h-2V7h2m0 10h-2v-2h2M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-url' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M19.11 3.67c-1.71-1.709-4.578-1.682-6.408.148l-2.22 2.22a.75.75 0 0 1-1.062-1.06l2.222-2.221C14.018.381 17.836.276 20.17 2.61l1.22 1.22c2.335 2.334 2.23 6.153-.147 8.529l-2.22 2.22a.75.75 0 0 1-1.062-1.06l2.222-2.221c1.83-1.83 1.856-4.698.147-6.408zm-3.36 4.58a.75.75 0 0 1 0 1.06l-6.439 6.44a.75.75 0 0 1-1.06-1.06l6.439-6.44a.75.75 0 0 1 1.06 0zM6.04 9.42a.75.75 0 0 1 0 1.061l-2.222 2.222c-1.83 1.83-1.856 4.698-.147 6.407l1.22 1.22c1.71 1.71 4.578 1.683 6.408-.147l2.221-2.221a.75.75 0 1 1 1.06 1.06l-2.22 2.222c-2.377 2.376-6.195 2.481-8.53.147l-1.22-1.22c-2.334-2.334-2.228-6.153.148-8.53l2.221-2.22a.75.75 0 0 1 1.06 0z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-vibrance' xmlns='http://www.w3.org/2000/svg'><path d='M2.125 5.64A8.96 8.96 0 0 0 1.001 10a8.96 8.96 0 0 0 1.124 4.36V5.64z' fill='url(#asuc-icon-id__a)'/><path d='M2.875 15.499V4.502a9.053 9.053 0 0 1 1.75-1.72v14.437a9.05 9.05 0 0 1-1.75-1.72z' fill='url(#asuc-icon-id__b)'/><path d='M5.375 17.722c.548.33 1.134.601 1.75.809V1.469a8.956 8.956 0 0 0-1.75.81v15.443z' fill='url(#asuc-icon-id__c)'/><path d='M7.875 1.253v17.495c.564.136 1.15.22 1.75.244V1.008a9 9 0 0 0-1.75.245z' fill='url(#asuc-icon-id__d)'/><path d='M10.375 1.008v17.984a9 9 0 0 0 1.75-.244V1.252a9 9 0 0 0-1.75-.244z' fill='url(#asuc-icon-id__e)'/><path d='M12.875 1.469V18.53a8.957 8.957 0 0 0 1.75-.808V2.277a8.957 8.957 0 0 0-1.75-.808z' fill='url(#asuc-icon-id__f)'/><path d='M15.375 2.78v14.44a9.053 9.053 0 0 0 1.75-1.72v-11a9.054 9.054 0 0 0-1.75-1.72z' fill='url(#asuc-icon-id__g)'/><path d='M17.875 5.638v8.724A8.959 8.959 0 0 0 19.001 10a8.96 8.96 0 0 0-1.126-4.362z' fill='url(#asuc-icon-id__h)'/><defs><linearGradient id='asuc-icon-id__a' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='asuc-icon-id__b' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='asuc-icon-id__c' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='asuc-icon-id__d' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='asuc-icon-id__e' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='asuc-icon-id__f' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='asuc-icon-id__g' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='asuc-icon-id__h' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient></defs></symbol><symbol viewBox='0 0 24 24' id='uc-icon-vk' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.341 3.27a10.5 10.5 0 0 1 5.834-1.77.75.75 0 0 0 0-1.5 12 12 0 1 0 12 12 .75.75 0 0 0-1.5 0A10.5 10.5 0 1 1 6.34 3.27Zm14.145 1.48a.75.75 0 1 0-1.06-1.062L9.925 13.19V7.95a.75.75 0 1 0-1.5 0V15c0 .414.336.75.75.75h7.05a.75.75 0 0 0 0-1.5h-5.24l9.501-9.5Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-warmth' xmlns='http://www.w3.org/2000/svg'><path d='m7.5 13.05.429.42.171-.175v-.244h-.6zm5 0h-.6v.245l.172.175.428-.42zM8.1 3.5c0-1.05.85-1.9 1.9-1.9V.4a3.1 3.1 0 0 0-3.1 3.1h1.2zm0 9.55V3.5H6.9v9.55h1.2zm-1 2.45c0-.79.315-1.506.829-2.03l-.858-.84A4.088 4.088 0 0 0 5.9 15.5h1.2zm2.9 2.9a2.9 2.9 0 0 1-2.9-2.9H5.9a4.1 4.1 0 0 0 4.1 4.1v-1.2zm2.9-2.9a2.9 2.9 0 0 1-2.9 2.9v1.2a4.1 4.1 0 0 0 4.1-4.1h-1.2zm-.829-2.03c.514.524.829 1.24.829 2.03h1.2c0-1.117-.447-2.13-1.171-2.87l-.858.84zM11.9 3.5v9.55h1.2V3.5h-1.2zM10 1.6c1.05 0 1.9.85 1.9 1.9h1.2A3.1 3.1 0 0 0 10 .4v1.2z' fill='currentColor'/><path d='M10 14V8' stroke='currentColor' stroke-width='1.2' stroke-linecap='round'/><path d='M14 3h3m-3 3h3m-3 3h3m-8 6.5a1 1 0 1 0 2 0 1 1 0 1 0-2 0' stroke='currentColor' stroke-width='1.2'/></symbol></svg>";var At=class extends I{constructor(){super(...arguments);d(this,"requireCtxName",!0);d(this,"init$",Zt(this));d(this,"_template",null)}initCallback(){var t;super.initCallback(),(t=this.a11y)==null||t.registerBlock(this)}static set template(t){this._template=Gr+t+"<slot></slot>"}static get template(){return this._template}};d(At,"styleAttrs",["uc-wgt-common"]);var Et=class Et extends At{initCallback(){super.initCallback();let e=this.ref.uBlock;this.sub("*currentActivity",t=>{t||(this.$["*currentActivity"]=e.initActivity||E.activities.START_FROM)}),this.sub("*uploadList",t=>{(t==null?void 0:t.length)>0?this.$["*currentActivity"]=E.activities.UPLOAD_LIST:this.$["*currentActivity"]=e.initActivity||E.activities.START_FROM}),this.subConfigValue("sourceList",t=>{t!=="local"&&(this.cfg.sourceList="local")}),this.subConfigValue("confirmUpload",t=>{t!==!1&&(this.cfg.confirmUpload=!1)})}};d(Et,"styleAttrs",[...Mt(Et,Et,"styleAttrs"),"uc-file-uploader-minimal"]);var Qt=Et;Qt.template=`<uc-start-from><uc-drop-area tabindex="0" clickable l10n="choose-file"></uc-drop-area><uc-copyright></uc-copyright></uc-start-from><uc-upload-list ref="uBlock"></uc-upload-list>`;var te=class extends E{constructor(){super(...arguments);d(this,"historyTracked",!0);d(this,"activityType","start-from")}initCallback(){super.initCallback(),this.registerActivity(this.activityType)}};te.template='<div class="uc-content"><slot></slot></div>';function Xr(r,e,t){let i=r/e,s,o;i>t?(s=Math.round(e*t),o=e):(s=r,o=Math.round(r/t));let n=Math.round((r-s)/2),l=Math.round((e-o)/2);return n+s>r&&(s=r-n),l+o>e&&(o=e-l),{x:n,y:l,width:s,height:o}}var Wr=r=>{if(!r)return[];let[e,t]=r.split(":").map(Number);if(!Number.isFinite(e)||!Number.isFinite(t)){console.error(`Invalid crop preset: ${r}`);return}return[{type:"aspect-ratio",width:e,height:t}]};var qr="blocks",Kr="1.3.0";function Zr(r){return Ie({...r,libraryName:qr,libraryVersion:Kr})}var Yr=r=>Math.floor(r/1e3),Jr=(r,{threshold:e})=>{let{secureExpire:t}=r,i=Yr(Date.now()),s=Number(t),o=Yr(e);return i+o>=s};var ee=class{constructor(e){d(this,"_block");d(this,"_secureToken",null);this._block=e}_debugPrint(...e){this._block.debugPrint("[secure-uploads]",...e)}async getSecureToken(){let{secureSignature:e,secureExpire:t,secureUploadsSignatureResolver:i}=this._block.cfg;if((e||t)&&i&&console.warn("Both secureSignature/secureExpire and secureUploadsSignatureResolver are set. secureUploadsSignatureResolver will be used."),i){if(!this._secureToken||Jr(this._secureToken,{threshold:this._block.cfg.secureUploadsExpireThreshold})){this._secureToken?this._debugPrint("Secure signature is expired. Resolving a new one..."):this._debugPrint("Secure signature is not set yet.");try{let s=await i();s?!s.secureSignature||!s.secureExpire?console.error("Secure signature resolver returned an invalid result:",s):(this._debugPrint("Secure signature resolved:",s),this._debugPrint("Secure signature will expire in",new Date(Number(s.secureExpire)*1e3).toISOString()),this._secureToken=s):(this._debugPrint("Secure signature resolver returned nothing."),this._secureToken=null)}catch(s){console.error("Secure signature resolving failed. Falling back to the previous one.",s)}}return this._secureToken}return e&&t?(this._debugPrint("Secure signature and expire are set. Using them...",{secureSignature:e,secureExpire:t}),{secureSignature:e,secureExpire:t}):null}};var Qr="[Typed State] Wrong property name: ",co="[Typed State] Wrong property type: ",re=class{constructor(e,t){this.__typedSchema=e,this.__ctxId=t||_t.generate(),this.__schema=Object.keys(e).reduce((i,s)=>(i[s]=e[s].value,i),{}),this.__data=v.registerCtx(this.__schema,this.__ctxId)}get uid(){return this.__ctxId}setValue(e,t){if(!this.__typedSchema.hasOwnProperty(e)){console.warn(Qr+e);return}let i=this.__typedSchema[e];if((t==null?void 0:t.constructor)===i.type||t instanceof i.type||i.nullable&&t===null){this.__data.pub(e,t);return}console.warn(co+e)}setMultipleValues(e){for(let t in e)this.setValue(t,e[t])}getValue(e){if(!this.__typedSchema.hasOwnProperty(e)){console.warn(Qr+e);return}return this.__data.read(e)}subscribe(e,t){return this.__data.sub(e,t)}remove(){v.deleteCtx(this.__ctxId)}};var ie=class{constructor(e){this.__typedSchema=e.typedSchema,this.__ctxId=e.ctxName||_t.generate(),this.__data=v.registerCtx({},this.__ctxId),this.__watchList=e.watchList||[],this.__subsMap=Object.create(null),this.__propertyObservers=new Set,this.__collectionObservers=new Set,this.__items=new Set,this.__removed=new Set,this.__added=new Set;let t=Object.create(null);this.__notifyObservers=(i,s)=>{this.__observeTimeout&&window.clearTimeout(this.__observeTimeout),t[i]||(t[i]=new Set),t[i].add(s),this.__observeTimeout=window.setTimeout(()=>{Object.keys(t).length!==0&&(this.__propertyObservers.forEach(o=>{o({...t})}),t=Object.create(null))})}}notify(){this.__notifyTimeout&&window.clearTimeout(this.__notifyTimeout),this.__notifyTimeout=window.setTimeout(()=>{let e=new Set(this.__added),t=new Set(this.__removed);this.__added.clear(),this.__removed.clear();for(let i of this.__collectionObservers)i==null||i([...this.__items],e,t)})}observeCollection(e){return this.__collectionObservers.add(e),this.__items.size>0&&this.notify(),()=>{this.unobserveCollection(e)}}unobserveCollection(e){var t;(t=this.__collectionObservers)==null||t.delete(e)}add(e){let t=new re(this.__typedSchema);for(let i in e)t.setValue(i,e[i]);return this.__items.add(t.uid),this.notify(),this.__data.add(t.uid,t),this.__added.add(t),this.__watchList.forEach(i=>{this.__subsMap[t.uid]||(this.__subsMap[t.uid]=[]),this.__subsMap[t.uid].push(t.subscribe(i,()=>{this.__notifyObservers(i,t.uid)}))}),t.uid}read(e){return this.__data.read(e)}readProp(e,t){return this.read(e).getValue(t)}publishProp(e,t,i){this.read(e).setValue(t,i)}remove(e){this.__removed.add(this.__data.read(e)),this.__items.delete(e),this.notify(),this.__data.pub(e,null),delete this.__subsMap[e]}clearAll(){this.__items.forEach(e=>{this.remove(e)})}observeProperties(e){return this.__propertyObservers.add(e),()=>{this.unobserveProperties(e)}}unobserveProperties(e){var t;(t=this.__propertyObservers)==null||t.delete(e)}findItems(e){let t=[];return this.__items.forEach(i=>{let s=this.read(i);e(s)&&t.push(i)}),t}items(){return[...this.__items]}get size(){return this.__items.size}destroy(){v.deleteCtx(this.__ctxId),this.__propertyObservers=null,this.__collectionObservers=null;for(let e in this.__subsMap)this.__subsMap[e].forEach(t=>{t.remove()}),delete this.__subsMap[e]}};var X=Object.freeze({LOCAL:"local",DROP_AREA:"drop-area",URL_TAB:"url-tab",CAMERA:"camera",EXTERNAL:"external",API:"js-api"});var xt=["image/*","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/avif","image/avif-sequence",".heif",".heifs",".heic",".heics",".avif",".avifs"],se=r=>r?r.filter(e=>typeof e=="string").map(e=>Z(e)).flat():[],ze=(r,e)=>e.some(t=>t.endsWith("*")?(t=t.replace("*",""),r.startsWith(t)):r===t),ti=(r,e)=>e.some(t=>t.startsWith(".")?r.toLowerCase().endsWith(t.toLowerCase()):!1),ei=r=>{let e=r==null?void 0:r.type;return e?ze(e,xt):!1};var uo=/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/i,ho=new RegExp(`^/?(${uo.source})(?:/(-/(?:[^/]+/)+)?([^/]*))?$`,"i"),ri=({url:r,cdnBase:e})=>{let t=new URL(e),i=new URL(r);if(t.host!==i.host)return null;let[,s,o,n]=ho.exec(i.pathname);return{uuid:s,cdnUrlModifiers:o||"",filename:n||null}};var ii=r=>{let e=new Map;return(...t)=>{let i=JSON.stringify(t);if(e.has(i))return e.get(i);let s=r(...t);return e.set(i,s),s}};var si=new Set;function oi(r){si.has(r)||(si.add(r),console.warn(r))}function fo(r){let e=!1;return setTimeout(()=>{e=!0},0),i=>(...s)=>(e&&oi(r),i(...s))}function ni(r){let e={progress:()=>r.$["*commonProgress"],errors:()=>r.$["*collectionErrors"],group:()=>r.$["*groupInfo"],totalCount:()=>r.uploadCollection.size,failedCount:()=>t.failedEntries.length,successCount:()=>t.successEntries.length,uploadingCount:()=>t.uploadingEntries.length,status:()=>t.isFailed?"failed":t.isUploading?"uploading":t.isSuccess?"success":"idle",isSuccess:()=>t.allEntries.length>0&&t.errors.length===0&&t.successEntries.length===t.allEntries.length,isUploading:()=>t.allEntries.some(s=>s.status==="uploading"),isFailed:()=>t.errors.length>0||t.failedEntries.length>0,allEntries:()=>r.getOutputData(),successEntries:()=>t.allEntries.filter(s=>s.status==="success"),failedEntries:()=>t.allEntries.filter(s=>s.status==="failed"),uploadingEntries:()=>t.allEntries.filter(s=>s.status==="uploading"),idleEntries:()=>t.allEntries.filter(s=>s.status==="idle")},t={},i=fo("You're trying to access the OutputCollectionState asynchronously. In this case, the data you retrieve will be newer than it was when the OutputCollectionState was created or when the event was dispatched. If you want to retain the state at a specific moment in time, you should use the spread operator like this: `{...outputCollectionState}` or `{...e.detail}`");for(let[s,o]of Object.entries(e)){let n=s,a=ii(i(o));Object.defineProperty(t,n,{get:a,enumerable:!0})}return t}var oe=class{constructor(e){d(this,"_ctx");d(this,"addFileFromUrl",(e,{silent:t,fileName:i,source:s}={})=>{let o=this._uploadCollection.add({externalUrl:e,fileName:i!=null?i:null,silent:t!=null?t:!1,source:s!=null?s:X.API});return this.getOutputItem(o)});d(this,"addFileFromUuid",(e,{silent:t,fileName:i,source:s}={})=>{let o=this._uploadCollection.add({uuid:e,fileName:i!=null?i:null,silent:t!=null?t:!1,source:s!=null?s:X.API});return this.getOutputItem(o)});d(this,"addFileFromCdnUrl",(e,{silent:t,fileName:i,source:s}={})=>{var l;let o=ri({url:e,cdnBase:this.cfg.cdnCname});if(!o)throw new Error("Invalid CDN URL");let n=this._uploadCollection.add({uuid:o.uuid,cdnUrl:e,cdnUrlModifiers:o.cdnUrlModifiers,fileName:(l=i!=null?i:o.filename)!=null?l:null,silent:t!=null?t:!1,source:s!=null?s:X.API});return this.getOutputItem(n)});d(this,"addFileFromObject",(e,{silent:t,fileName:i,source:s,fullPath:o}={})=>{let n=this._uploadCollection.add({file:e,isImage:ei(e),mimeType:e.type,fileName:i!=null?i:e.name,fileSize:e.size,silent:t!=null?t:!1,source:s!=null?s:X.API,fullPath:o!=null?o:null});return this.getOutputItem(n)});d(this,"removeFileByInternalId",e=>{if(!this._uploadCollection.read(e))throw new Error(`File with internalId ${e} not found`);this._uploadCollection.remove(e)});d(this,"uploadAll",()=>{let e=this._uploadCollection.items().filter(t=>{let i=this._uploadCollection.read(t);return!i.getValue("isRemoved")&&!i.getValue("isUploading")&&!i.getValue("fileInfo")});e.length!==0&&(this._ctx.$["*uploadTrigger"]=new Set(e),this._ctx.emit(x.COMMON_UPLOAD_START,this.getOutputCollectionState()))});d(this,"openSystemDialog",(e={})=>{var s;let t=zt(se([(s=this.cfg.accept)!=null?s:"",...this.cfg.imgOnly?xt:[]]));this.cfg.accept&&this.cfg.imgOnly&&console.warn("There could be a mistake.\nBoth `accept` and `imgOnly` parameters are set.\nThe value of `accept` will be concatenated with the internal image mime types list.");let i=document.createElement("input");i.type="file",i.multiple=this.cfg.multiple,e.captureCamera?(i.capture=this.cfg.cameraCapture,i.accept="image/*"):i.accept=t,i.dispatchEvent(new MouseEvent("click")),i.onchange=()=>{[...i.files].forEach(o=>this.addFileFromObject(o,{source:e.captureCamera?X.CAMERA:X.LOCAL})),this._ctx.$["*currentActivity"]=E.activities.UPLOAD_LIST,this._ctx.setOrAddState("*modalActive",!0),i.value=""}});d(this,"getOutputItem",e=>{var n,l,a,c,h,u,f,m,p,g;let t=v.getCtx(e).store,i=t.fileInfo,s=t.isRemoved?"removed":t.errors.length>0?"failed":t.fileInfo?"success":t.isUploading?"uploading":"idle";return{uuid:(l=(n=i==null?void 0:i.uuid)!=null?n:t.uuid)!=null?l:null,internalId:e,name:(a=i==null?void 0:i.originalFilename)!=null?a:t.fileName,size:(c=i==null?void 0:i.size)!=null?c:t.fileSize,isImage:(h=i==null?void 0:i.isImage)!=null?h:t.isImage,mimeType:(u=i==null?void 0:i.mimeType)!=null?u:t.mimeType,file:t.file,externalUrl:t.externalUrl,cdnUrlModifiers:t.cdnUrlModifiers,cdnUrl:(m=(f=t.cdnUrl)!=null?f:i==null?void 0:i.cdnUrl)!=null?m:null,fullPath:t.fullPath,uploadProgress:t.uploadProgress,fileInfo:i!=null?i:null,metadata:(g=(p=t.metadata)!=null?p:i==null?void 0:i.metadata)!=null?g:null,isSuccess:s==="success",isUploading:s==="uploading",isFailed:s==="failed",isRemoved:s==="removed",errors:t.errors,status:s}});d(this,"getOutputCollectionState",()=>ni(this._ctx));d(this,"initFlow",(e=!1)=>{var t;if(this._uploadCollection.size>0&&!e)this._ctx.set$({"*currentActivity":E.activities.UPLOAD_LIST}),this._ctx.setOrAddState("*modalActive",!0);else if(((t=this._sourceList)==null?void 0:t.length)===1){let i=this._sourceList[0];if(i==="local"){this._ctx.$["*currentActivity"]=E.activities.UPLOAD_LIST,this.openSystemDialog();return}let s=this._ctx.$["*blocksRegistry"],o=l=>"type"in l&&l.type===i,n=[...s].find(o);n==null||n.activate(),this._ctx.$["*currentActivity"]&&this._ctx.setOrAddState("*modalActive",!0)}else this._ctx.set$({"*currentActivity":E.activities.START_FROM}),this._ctx.setOrAddState("*modalActive",!0)});d(this,"doneFlow",()=>{this._ctx.set$({"*currentActivity":this._ctx.doneActivity,"*history":this._ctx.doneActivity?[this._ctx.doneActivity]:[]}),this._ctx.$["*currentActivity"]||this._ctx.setOrAddState("*modalActive",!1)});d(this,"setCurrentActivity",(e,t={})=>{if(this._ctx.hasBlockInCtx(i=>i.activityType===e)){this._ctx.set$({"*currentActivityParams":t,"*currentActivity":e});return}console.warn(`Activity type "${e}" not found in the context`)});d(this,"setModalState",e=>{if(e&&!this._ctx.$["*currentActivity"]){console.warn(`Can't open modal without current activity. Please use "setCurrentActivity" method first.`);return}this._ctx.setOrAddState("*modalActive",e)});this._ctx=e}get _uploadCollection(){return this._ctx.uploadCollection}get cfg(){return this._ctx.cfg}get l10n(){return this._ctx.l10n.bind(this._ctx)}removeAllFiles(){this._uploadCollection.clearAll()}get _sourceList(){let e=[];return this.cfg.sourceList&&(e=Z(this.cfg.sourceList)),e}};var je=(r,e)=>{let t=e.cfg.imgOnly,i=r.isImage;if(!(!t||i)&&!(!r.fileInfo&&r.externalUrl)&&!(!r.fileInfo&&!r.mimeType))return{type:"NOT_AN_IMAGE",message:e.l10n("images-only-accepted"),payload:{entry:r}}};var Be=(r,e)=>{let t=e.cfg.imgOnly,i=e.cfg.accept,s=se([...t?xt:[],i]);if(!s.length)return;let o=r.mimeType,n=r.name;if(!o||!n)return;let l=ze(o,s),a=ti(n,s);if(!l&&!a)return{type:"FORBIDDEN_FILE_TYPE",message:e.l10n("file-type-not-allowed"),payload:{entry:r}}};var W=1e3,ut=Object.freeze({AUTO:"auto",BYTE:"byte",KB:"kb",MB:"mb",GB:"gb",TB:"tb",PB:"pb"}),St=r=>Math.ceil(r*100)/100,li=(r,e=ut.AUTO)=>{let t=e===ut.AUTO;if(e===ut.BYTE||t&&r<W**1){let i=jt("en-US",r),s={one:"byte",other:"bytes"}[i];return`${r} ${s}`}return e===ut.KB||t&&r<W**2?`${St(r/W**1)} KB`:e===ut.MB||t&&r<W**3?`${St(r/W**2)} MB`:e===ut.GB||t&&r<W**4?`${St(r/W**3)} GB`:e===ut.TB||t&&r<W**5?`${St(r/W**4)} TB`:`${St(r/W**5)} PB`};var He=(r,e)=>{let t=e.cfg.maxLocalFileSizeBytes,i=r.size;if(t&&i&&i>t)return{type:"FILE_SIZE_EXCEEDED",message:e.l10n("files-max-size-limit-error",{maxFileSize:li(t)}),payload:{entry:r}}};var Ge=(r,e)=>{let{internalId:t}=r,i=e._uploadCollection.read(t),s=i==null?void 0:i.getValue("uploadError");if(!s)return;if(s instanceof L)return{type:"UPLOAD_ERROR",message:s.message,payload:{entry:r,error:s}};if(s instanceof ft)return{type:"NETWORK_ERROR",message:s.message,payload:{entry:r,error:s}};let o=s instanceof Error?s:new Error("Unknown error",{cause:s});return{type:"UNKNOWN_ERROR",message:o.message,payload:{entry:r,error:o}}};var Xe=(r,e)=>{if(r.failedCount>0)return{type:"SOME_FILES_HAS_ERRORS",message:e.l10n("some-files-were-not-uploaded")}};var We=(r,e)=>{let t=r.totalCount,i=e.cfg.multiple?e.cfg.multipleMin:0,s=e.cfg.multiple?e.cfg.multipleMax:1;if(i&&t<i)return{type:"TOO_FEW_FILES",message:e.l10n("files-count-limit-error-too-few",{min:i,max:s,total:t}),payload:{total:t,min:i,max:s}};if(s&&t>s)return{type:"TOO_MANY_FILES",message:e.l10n("files-count-limit-error-too-many",{min:i,max:s,total:t}),payload:{total:t,min:i,max:s}}};var ne={file:"File validator execution has failed",collection:"Collection validator execution has failed",message:"Missing message. We recommend adding message: value."},le=class{constructor(e){d(this,"_blockInstance");d(this,"_fileValidators",[je,Be,He,Ge]);d(this,"_collectionValidators",[We,Xe]);this._blockInstance=e,this._uploadCollection=this._blockInstance.uploadCollection;let t=()=>{this.runFileValidators(),this.runCollectionValidators()};this._blockInstance.subConfigValue("maxLocalFileSizeBytes",t),this._blockInstance.subConfigValue("multipleMin",t),this._blockInstance.subConfigValue("multipleMax",t),this._blockInstance.subConfigValue("multiple",t),this._blockInstance.subConfigValue("imgOnly",t),this._blockInstance.subConfigValue("accept",t)}runFileValidators(e){let t=e!=null?e:this._uploadCollection.items();for(let i of t){let s=this._uploadCollection.read(i);s&&this._runFileValidatorsForEntry(s)}}runCollectionValidators(){let e=this._blockInstance.api.getOutputCollectionState(),t=[];for(let i of[...this._collectionValidators,...this._addCustomTypeToValidators(this._blockInstance.cfg.collectionValidators)])try{let s=i(e,this._blockInstance.api);if(!s)continue;s&&(t.push(s),s.message||console.warn(ne.message))}catch(s){console.warn(ne.collection,s)}this._blockInstance.$["*collectionErrors"]=t,t.length>0&&this._blockInstance.emit(x.COMMON_UPLOAD_FAILED,()=>this._blockInstance.api.getOutputCollectionState(),{debounce:!0})}_runFileValidatorsForEntry(e){let t=this._blockInstance.api.getOutputItem(e.uid),i=[];for(let s of[...this._fileValidators,...this._addCustomTypeToValidators(this._blockInstance.cfg.fileValidators)])try{let o=s(t,this._blockInstance.api);if(!o)continue;o&&(i.push(o),o.message||console.warn(ne.message))}catch(o){console.warn(ne.file,o)}e.setValue("errors",i)}_addCustomTypeToValidators(e){return e.map(t=>(...i)=>{let s=t(...i);return s?{...s,type:"CUSTOM_ERROR"}:void 0})}};var ai=Object.freeze({file:{type:File,value:null},externalUrl:{type:String,value:null},fileName:{type:String,value:null,nullable:!0},fileSize:{type:Number,value:null,nullable:!0},lastModified:{type:Number,value:Date.now()},uploadProgress:{type:Number,value:0},uuid:{type:String,value:null},isImage:{type:Boolean,value:!1},mimeType:{type:String,value:null,nullable:!0},ctxName:{type:String,value:null},cdnUrl:{type:String,value:null},cdnUrlModifiers:{type:String,value:null},fileInfo:{type:Q,value:null},isUploading:{type:Boolean,value:!1},abortController:{type:AbortController,value:null,nullable:!0},thumbUrl:{type:String,value:null,nullable:!0},silent:{type:Boolean,value:!1},source:{type:String,value:!1,nullable:!0},fullPath:{type:String,value:null,nullable:!0},metadata:{type:Object,value:null,nullable:!0},errors:{type:Array,value:[]},uploadError:{type:Error,value:null,nullable:!0},isRemoved:{type:Boolean,value:!1}});var k=class r extends E{constructor(){super(...arguments);d(this,"couldBeCtxOwner",!1);d(this,"isCtxOwner",!1);d(this,"init$",Zt(this));d(this,"_flushOutputItems",V(async()=>{if(this.getOutputData().length!==this.uploadCollection.size)return;let i=this.api.getOutputCollectionState();this.$["*collectionState"]=i,this.emit(x.CHANGE,()=>this.api.getOutputCollectionState(),{debounce:!0}),this.cfg.groupOutput&&i.totalCount>0&&i.status==="success"&&this._createGroup(i)},300));d(this,"_handleCollectionUpdate",(t,i,s)=>{var o;(i.size||s.size)&&(this.$["*groupInfo"]=null),this.validationManager.runFileValidators(),this.validationManager.runCollectionValidators();for(let n of i)n.getValue("silent")||this.emit(x.FILE_ADDED,this.api.getOutputItem(n.uid));for(let n of s)this.$["*uploadTrigger"].delete(n.uid),(o=n.getValue("abortController"))==null||o.abort(),n.setMultipleValues({isRemoved:!0,abortController:null,isUploading:!1,uploadProgress:0}),URL.revokeObjectURL(n==null?void 0:n.getValue("thumbUrl")),this.emit(x.FILE_REMOVED,this.api.getOutputItem(n.uid));this.$["*uploadList"]=t.map(n=>({uid:n})),this._flushCommonUploadProgress(),this._flushOutputItems()});d(this,"_handleCollectionPropertiesUpdate",t=>{this._flushOutputItems();let i=this.uploadCollection,s=[...new Set(Object.entries(t).filter(([o])=>["uploadError","fileInfo"].includes(o)).map(([,o])=>[...o]).flat())];if(s.length>0&&setTimeout(()=>{this.validationManager.runFileValidators(s)}),t.uploadProgress){for(let o of t.uploadProgress){let{isUploading:n,silent:l}=v.getCtx(o).store;n&&!l&&this.emit(x.FILE_UPLOAD_PROGRESS,this.api.getOutputItem(o))}this._flushCommonUploadProgress()}if(t.isUploading)for(let o of t.isUploading){let{isUploading:n,silent:l}=v.getCtx(o).store;n&&!l&&this.emit(x.FILE_UPLOAD_START,this.api.getOutputItem(o))}if(t.fileInfo){for(let o of t.fileInfo){let{fileInfo:n,silent:l}=v.getCtx(o).store;n&&!l&&this.emit(x.FILE_UPLOAD_SUCCESS,this.api.getOutputItem(o))}this.cfg.cropPreset&&this.setInitialCrop()}if(t.errors){for(let l of t.errors){let{errors:a}=v.getCtx(l).store;a.length>0&&(this.emit(x.FILE_UPLOAD_FAILED,this.api.getOutputItem(l)),this.emit(x.COMMON_UPLOAD_FAILED,()=>this.api.getOutputCollectionState(),{debounce:!0}))}let o=i.findItems(l=>!!l.getValue("fileInfo")),n=i.findItems(l=>l.getValue("errors").length>0);i.size>0&&n.length===0&&i.size===o.length&&this.$["*collectionErrors"].length===0&&this.emit(x.COMMON_UPLOAD_SUCCESS,this.api.getOutputCollectionState())}t.cdnUrl&&([...t.cdnUrl].filter(n=>{var l;return!!((l=this.uploadCollection.read(n))!=null&&l.getValue("cdnUrl"))}).forEach(n=>{this.emit(x.FILE_URL_CHANGED,this.api.getOutputItem(n))}),this.$["*groupInfo"]=null)});d(this,"_flushCommonUploadProgress",()=>{let t=0,s=[...this.$["*uploadTrigger"]].filter(n=>!!this.uploadCollection.read(n));s.forEach(n=>{let l=this.uploadCollection.readProp(n,"uploadProgress");t+=l});let o=s.length?Math.round(t/s.length):0;this.$["*commonProgress"]!==o&&(this.$["*commonProgress"]=o,this.emit(x.COMMON_UPLOAD_PROGRESS,this.api.getOutputCollectionState()))})}get hasCtxOwner(){return this.hasBlockInCtx(t=>t instanceof r?t.isCtxOwner&&t.isConnected&&t!==this:!1)}initCallback(){if(super.initCallback(),!this.has("*uploadCollection")){let t=new ie({typedSchema:ai,watchList:["uploadProgress","uploadError","fileInfo","errors","cdnUrl","isUploading"]});this.add("*uploadCollection",t)}this.has("*publicApi")||this.add("*publicApi",new oe(this)),this.has("*validationManager")||this.add("*validationManager",new le(this)),!this.hasCtxOwner&&this.couldBeCtxOwner&&this.initCtxOwner()}get validationManager(){if(!this.has("*validationManager"))throw new Error("Unexpected error: ValidationManager is not initialized");return this.$["*validationManager"]}get api(){if(!this.has("*publicApi"))throw new Error("Unexpected error: UploaderPublicApi is not initialized");return this.$["*publicApi"]}getAPI(){return this.api}get uploadCollection(){if(!this.has("*uploadCollection"))throw new Error("Unexpected error: TypedCollection is not initialized");return this.$["*uploadCollection"]}destroyCtxCallback(){var t,i;(t=this._unobserveCollectionProperties)==null||t.call(this),(i=this._unobserveCollection)==null||i.call(this),this.uploadCollection.destroy(),this.$["*uploadCollection"]=null,super.destroyCtxCallback()}initCtxOwner(){this.isCtxOwner=!0,this._unobserveCollection=this.uploadCollection.observeCollection(this._handleCollectionUpdate),this._unobserveCollectionProperties=this.uploadCollection.observeProperties(this._handleCollectionPropertiesUpdate),this.subConfigValue("maxConcurrentRequests",t=>{this.$["*uploadQueue"].concurrency=Number(t)||1}),this.$["*secureUploadsManager"]||(this.$["*secureUploadsManager"]=new ee(this)),this.has("*modalActive")&&this.sub("*modalActive",t=>{t&&!this.$["*currentActivity"]&&(this.$["*modalActive"]=!1)})}async _createGroup(t){let i=await this.getUploadClientOptions(),s=t.allEntries.map(a=>a.uuid+(a.cdnUrlModifiers?`/${a.cdnUrlModifiers}`:"")),o=new AbortController,n=await Dr(s,{...i,signal:o.signal});if(this.$["*collectionState"]!==t){o.abort();return}this.$["*groupInfo"]=n;let l=this.api.getOutputCollectionState();this.emit(x.GROUP_CREATED,l),this.emit(x.CHANGE,()=>this.api.getOutputCollectionState(),{debounce:!0}),this.$["*collectionState"]=l}setInitialCrop(){let t=Wr(this.cfg.cropPreset);if(t){let[i]=t,s=this.uploadCollection.findItems(o=>{var n;return o.getValue("fileInfo")&&o.getValue("isImage")&&!((n=o.getValue("cdnUrlModifiers"))!=null&&n.includes("/crop/"))}).map(o=>this.uploadCollection.read(o));for(let o of s){let n=o.getValue("fileInfo"),{width:l,height:a}=n.imageInfo,c=i.width/i.height,h=Xr(l,a,c),u=$t(`crop/${h.width}x${h.height}/${h.x},${h.y}`,"preview");o.setMultipleValues({cdnUrlModifiers:u,cdnUrl:Vt(o.getValue("cdnUrl"),u)}),this.uploadCollection.size===1&&this.cfg.useCloudImageEditor&&this.hasBlockInCtx(f=>f.activityType===E.activities.CLOUD_IMG_EDIT)&&(this.$["*focusedEntry"]=o,this.$["*currentActivity"]=E.activities.CLOUD_IMG_EDIT)}}}async getMetadataFor(t){let i=this.cfg.metadata||void 0;if(typeof i=="function"){let s=this.api.getOutputItem(t);return await i(s)}return i}async getUploadClientOptions(){let i=await this.$["*secureUploadsManager"].getSecureToken().catch(()=>null);return{store:this.cfg.store,publicKey:this.cfg.pubkey,baseCDN:this.cfg.cdnCname,baseURL:this.cfg.baseUrl,userAgent:Zr,integration:this.cfg.userAgentIntegration,secureSignature:i==null?void 0:i.secureSignature,secureExpire:i==null?void 0:i.secureExpire,retryThrottledRequestMaxTimes:this.cfg.retryThrottledRequestMaxTimes,multipartMinFileSize:this.cfg.multipartMinFileSize,multipartChunkSize:this.cfg.multipartChunkSize,maxConcurrentRequests:this.cfg.multipartMaxConcurrentRequests,multipartMaxAttempts:this.cfg.multipartMaxAttempts,checkForUrlDuplicates:!!this.cfg.checkForUrlDuplicates,saveUrlForRecurrentUploads:!!this.cfg.saveUrlForRecurrentUploads}}getOutputData(){return this.uploadCollection.items().map(s=>this.api.getOutputItem(s))}};k.extSrcList=Object.freeze({FACEBOOK:"facebook",DROPBOX:"dropbox",GDRIVE:"gdrive",GPHOTOS:"gphotos",INSTAGRAM:"instagram",FLICKR:"flickr",VK:"vk",EVERNOTE:"evernote",BOX:"box",ONEDRIVE:"onedrive",HUDDLE:"huddle"});k.sourceTypes=Object.freeze({LOCAL:"local",URL:"url",CAMERA:"camera",DRAW:"draw",...k.extSrcList});var U=r=>String(r),j=r=>{let e=Number(r);if(Number.isNaN(e))throw new Error(`Invalid number: "${r}"`);return e},S=r=>{if(typeof r=="undefined"||r===null)return!1;if(typeof r=="boolean")return r;if(r==="true"||r==="")return!0;if(r==="false")return!1;throw new Error(`Invalid boolean: "${r}"`)},po=r=>r==="auto"?r:S(r),mo=r=>{let e=U(r);if(e!=="user"&&e!=="environment"&&e!=="")throw new Error(`Invalid "cameraCapture" value: "${e}"`);return e},go=r=>{if(typeof r=="object"&&!Array.isArray(r)||typeof r=="function")return r;throw new Error("Invalid metadata value. Must be an object or function.")},yo=r=>{if(typeof r=="object")return r;throw new Error("Invalid value. Must be an object.")},qe=r=>{if(typeof r=="function")return r;throw new Error("Invalid value. Must be a function.")},ci=r=>{if(Array.isArray(r))return r;throw new Error("Must be an array.")},bo={pubkey:U,multiple:S,multipleMin:j,multipleMax:j,confirmUpload:S,imgOnly:S,accept:U,externalSourcesPreferredTypes:U,store:po,cameraMirror:S,cameraCapture:mo,sourceList:U,maxLocalFileSizeBytes:j,thumbSize:j,showEmptyList:S,useLocalImageEditor:S,useCloudImageEditor:S,cloudImageEditorTabs:U,removeCopyright:S,cropPreset:U,imageShrink:U,modalScrollLock:S,modalBackdropStrokes:S,sourceListWrap:S,remoteTabSessionKey:U,cdnCname:U,baseUrl:U,socialBaseUrl:U,secureSignature:U,secureExpire:U,secureDeliveryProxy:U,retryThrottledRequestMaxTimes:j,multipartMinFileSize:j,multipartChunkSize:j,maxConcurrentRequests:j,multipartMaxConcurrentRequests:j,multipartMaxAttempts:j,checkForUrlDuplicates:S,saveUrlForRecurrentUploads:S,groupOutput:S,userAgentIntegration:U,debug:S,localeName:U,metadata:go,secureUploadsExpireThreshold:j,localeDefinitionOverride:yo,secureUploadsSignatureResolver:qe,secureDeliveryProxyUrlResolver:qe,iconHrefResolver:qe,fileValidators:ci,collectionValidators:ci},ui=(r,e)=>{if(!(typeof e=="undefined"||e===null))try{return bo[r](e)}catch(t){return console.error(`Invalid value for config key "${r}".`,t),z[r]}};function _o(r){return new Promise(e=>{typeof window.FileReader!="function"&&e(!1);try{let t=new FileReader;t.onerror=()=>{e(!0)};let i=s=>{s.type!=="loadend"&&t.abort(),e(!1)};t.onloadend=i,t.onprogress=i,t.readAsDataURL(r)}catch{e(!1)}})}function vo(r,e){return new Promise(t=>{let i=0,s=[],o=l=>{l||(console.warn("Unexpectedly received empty content entry",{scope:"drag-and-drop"}),t(null)),l.isFile?(i++,l.file(a=>{i--;let c=new File([a],a.name,{type:a.type||e});s.push({type:"file",file:c,fullPath:l.fullPath}),i===0&&t(s)})):l.isDirectory&&n(l.createReader())},n=l=>{i++,l.readEntries(a=>{i--;for(let c of a)o(c);i===0&&t(s)})};o(r)})}function di(r){let e=[],t=[];for(let i=0;i<r.items.length;i++){let s=r.items[i];if(s)if(s.kind==="file"){let o=s.type;if(typeof s.webkitGetAsEntry=="function"||typeof s.getAsEntry=="function"){let l=typeof s.webkitGetAsEntry=="function"?s.webkitGetAsEntry():s.getAsEntry();t.push(vo(l,o).then(a=>{a&&e.push(...a)}));continue}let n=s.getAsFile();n&&t.push(_o(n).then(l=>{l||e.push({type:"file",file:n})}))}else s.kind==="string"&&s.type.match("^text/uri-list")&&t.push(new Promise(o=>{s.getAsString(n=>{e.push({type:"url",url:n}),o(void 0)})}))}return Promise.all(t).then(()=>e)}var M={ACTIVE:0,INACTIVE:1,NEAR:2,OVER:3},hi=["focus"],wo=100,Ke=new Map;function Co(r,e){let t=Math.max(Math.min(r[0],e.x+e.width),e.x),i=Math.max(Math.min(r[1],e.y+e.height),e.y);return Math.sqrt((r[0]-t)*(r[0]-t)+(r[1]-i)*(r[1]-i))}function Ze(r){let e=0,t=document.body,i=new Set,s=p=>i.add(p),o=M.INACTIVE,n=p=>{r.shouldIgnore()&&p!==M.INACTIVE||(o!==p&&i.forEach(g=>g(p)),o=p)},l=()=>e>0;s(p=>r.onChange(p));let a=()=>{e=0,n(M.INACTIVE)},c=()=>{e+=1,o===M.INACTIVE&&n(M.ACTIVE)},h=()=>{e-=1,l()||n(M.INACTIVE)},u=p=>{p.preventDefault(),e=0,n(M.INACTIVE)},f=p=>{if(r.shouldIgnore())return;l()||(e+=1);let g=[p.x,p.y],C=r.element.getBoundingClientRect(),A=Math.floor(Co(g,C)),_=A<wo,y=p.composedPath().includes(r.element);Ke.set(r.element,A);let T=Math.min(...Ke.values())===A;y&&T?(p.preventDefault(),n(M.OVER)):n(_&&T?M.NEAR:M.ACTIVE)},m=async p=>{if(r.shouldIgnore())return;p.preventDefault();let g=await di(p.dataTransfer);r.onItems(g),n(M.INACTIVE)};return t.addEventListener("drop",u),t.addEventListener("dragleave",h),t.addEventListener("dragenter",c),t.addEventListener("dragover",f),r.element.addEventListener("drop",m),hi.forEach(p=>{window.addEventListener(p,a)}),()=>{Ke.delete(r.element),t.removeEventListener("drop",u),t.removeEventListener("dragleave",h),t.removeEventListener("dragenter",c),t.removeEventListener("dragover",f),r.element.removeEventListener("drop",m),hi.forEach(p=>{window.removeEventListener(p,a)})}}var fi="uc-drop-area",mt=`${fi}/registry`,Tt=class Tt extends k{constructor(){super(),this.init$={...this.init$,state:M.INACTIVE,withIcon:!1,isClickable:!1,isFullscreen:!1,isEnabled:!0,isVisible:!0,text:"",[mt]:null}}isActive(){if(!this.$.isEnabled)return!1;let e=this.getBoundingClientRect(),t=e.width>0&&e.height>0,i=e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth),s=window.getComputedStyle(this),o=s.visibility!=="hidden"&&s.display!=="none";return t&&o&&i}initCallback(){super.initCallback(),this.bindL10n("text",()=>this.l10n("drop-files-here")),this.$[mt]||(this.$[mt]=new Set),this.$[mt].add(this),this.defineAccessor("disabled",t=>{this.set$({isEnabled:!S(t)})}),this.defineAccessor("clickable",t=>{this.set$({isClickable:S(t)})}),this.defineAccessor("with-icon",t=>{this.set$({withIcon:S(t)})}),this.defineAccessor("fullscreen",t=>{this.set$({isFullscreen:S(t)})}),this.defineAccessor("text",t=>{typeof t=="string"?this.bindL10n("text",()=>this.l10n(t)||t):this.bindL10n("text",()=>this.l10n("drop-files-here"))}),this._destroyDropzone=Ze({element:this,shouldIgnore:()=>this._shouldIgnore(),onChange:t=>{this.$.state=t},onItems:t=>{t.length&&(t.forEach(i=>{i.type==="url"?this.api.addFileFromUrl(i.url,{source:X.DROP_AREA}):i.type==="file"&&this.api.addFileFromObject(i.file,{source:X.DROP_AREA,fullPath:i.fullPath})}),this.uploadCollection.size&&(this.set$({"*currentActivity":E.activities.UPLOAD_LIST}),this.setOrAddState("*modalActive",!0)))}});let e=this.ref["content-wrapper"];e&&(this._destroyContentWrapperDropzone=Ze({element:e,onChange:t=>{var s;let i=(s=Object.entries(M).find(([,o])=>o===t))==null?void 0:s[0].toLowerCase();i&&e.setAttribute("drag-state",i)},onItems:()=>{},shouldIgnore:()=>this._shouldIgnore()})),this.sub("state",t=>{var s;let i=(s=Object.entries(M).find(([,o])=>o===t))==null?void 0:s[0].toLowerCase();i&&this.setAttribute("drag-state",i)}),this.subConfigValue("sourceList",t=>{let i=Z(t);this.$.isEnabled=i.includes(k.sourceTypes.LOCAL),this.$.isVisible=this.$.isEnabled||!this.querySelector("[data-default-slot]")}),this.sub("isVisible",t=>{this.toggleAttribute("hidden",!t)}),this.sub("isClickable",t=>{this.toggleAttribute("clickable",t)}),this.$.isClickable&&(this._onAreaClicked=t=>{t.type==="keydown"?(t.code==="Space"||t.code==="Enter")&&this.api.openSystemDialog():t.type==="click"&&this.api.openSystemDialog()},this.addEventListener("keydown",this._onAreaClicked),this.addEventListener("click",this._onAreaClicked))}_shouldIgnore(){return!this.$.isEnabled||!this._couldHandleFiles()?!0:this.$.isFullscreen?[...this.$[mt]].filter(i=>i!==this).filter(i=>i.isActive()).length>0:!1}_couldHandleFiles(){let e=this.cfg.multiple,t=this.cfg.multipleMax,i=this.uploadCollection.size;return!(e&&t&&i>=t||!e&&i>0)}destroyCallback(){var t,i;super.destroyCallback();let e=this.$[mt];e&&(e.delete(this),e.size===0&&v.deleteCtx(fi)),(t=this._destroyDropzone)==null||t.call(this),(i=this._destroyContentWrapperDropzone)==null||i.call(this),this._onAreaClicked&&(this.removeEventListener("keydown",this._onAreaClicked),this.removeEventListener("click",this._onAreaClicked))}};d(Tt,"styleAttrs",[...Mt(Tt,Tt,"styleAttrs"),"uc-drop-area"]);var Ot=Tt;Ot.template=`<slot><div data-default-slot hidden></div><div ref="content-wrapper" class="uc-content-wrapper" set="@hidden: !isVisible"><div class="uc-icon-container" set="@hidden: !withIcon"><uc-icon name="default"></uc-icon><uc-icon name="arrow-down"></uc-icon></div><span class="uc-text">{{text}}</span></div></slot>`;Ot.bindAttributes({"with-icon":null,clickable:null,text:null,fullscreen:null,disabled:null});var pi=(r,e)=>{let t,i,s,o=(...n)=>{t?(clearTimeout(i),i=setTimeout(()=>{Date.now()-s>=e&&(r(...n),s=Date.now())},Math.max(e-(Date.now()-s),0))):(r(...n),s=Date.now(),t=!0)};return Object.defineProperty(o,"cancel",{configurable:!1,writable:!1,enumerable:!1,value:()=>{clearTimeout(i)}}),o};var ae=class extends k{constructor(){super();d(this,"couldBeCtxOwner",!0);d(this,"historyTracked",!0);d(this,"activityType",E.activities.UPLOAD_LIST);d(this,"_throttledHandleCollectionUpdate",pi(()=>{this.isConnected&&(this._updateUploadsState(),!this.couldOpenActivity&&this.$["*currentActivity"]===this.activityType&&this.historyBack())},300));this.init$={...this.init$,doneBtnVisible:!1,doneBtnEnabled:!1,uploadBtnVisible:!1,addMoreBtnVisible:!1,addMoreBtnEnabled:!1,headerText:"",commonErrorMessage:"",hasFiles:!1,onAdd:()=>{this.api.initFlow(!0)},onUpload:()=>{this.emit(x.UPLOAD_CLICK),this.api.uploadAll(),this._throttledHandleCollectionUpdate()},onDone:()=>{this.emit(x.DONE_CLICK,this.api.getOutputCollectionState()),this.api.doneFlow()},onCancel:()=>{this.uploadCollection.clearAll()}}}_updateUploadsState(){let t=this.api.getOutputCollectionState(),i={total:t.totalCount,succeed:t.successCount,uploading:t.uploadingCount,failed:t.failedCount},s=!t.errors.some(f=>f.type==="TOO_MANY_FILES"||f.type==="TOO_FEW_FILES"),o=t.errors.some(f=>f.type==="TOO_MANY_FILES"),n=t.totalCount===(this.cfg.multiple?this.cfg.multipleMax:1),l=i.failed===0&&t.errors.length===0,a=!1,c=!1,h=!1;if(i.total-i.succeed-i.uploading-i.failed>0&&s)a=!0;else{c=!0;let f=this.cfg.groupOutput?!!t.group:!0;h=i.total===i.succeed&&s&&l&&f}this.set$({doneBtnVisible:c,doneBtnEnabled:h,uploadBtnVisible:a,addMoreBtnEnabled:i.total===0||!o&&!n,addMoreBtnVisible:!n||this.cfg.multiple}),this.bindL10n("headerText",()=>this._getHeaderText(i))}_getHeaderText(t){let i=s=>{let o=t[s];return this.l10n(`header-${s}`,{count:o})};return t.uploading>0?i("uploading"):t.failed>0?i("failed"):t.succeed>0?i("succeed"):i("total")}get couldOpenActivity(){return this.cfg.showEmptyList||this.uploadCollection.size>0}initCallback(){super.initCallback(),this.registerActivity(this.activityType),this.subConfigValue("multiple",this._throttledHandleCollectionUpdate),this.subConfigValue("multipleMin",this._throttledHandleCollectionUpdate),this.subConfigValue("multipleMax",this._throttledHandleCollectionUpdate),this.sub("*groupInfo",t=>{t&&this._throttledHandleCollectionUpdate()}),this.sub("*currentActivity",t=>{!this.couldOpenActivity&&t===this.activityType&&(this.$["*currentActivity"]=this.initActivity)}),this.uploadCollection.observeProperties(this._throttledHandleCollectionUpdate),this.sub("*uploadList",t=>{this._throttledHandleCollectionUpdate(),this.set$({hasFiles:t.length>0}),this.cfg.confirmUpload||this.api.uploadAll()},!1),this.sub("*collectionErrors",t=>{let i=t.filter(s=>s.type!=="SOME_FILES_HAS_ERRORS")[0];if(!i){this.set$({commonErrorMessage:null});return}this.set$({commonErrorMessage:i.message})})}destroyCallback(){super.destroyCallback(),this.uploadCollection.unobserveProperties(this._throttledHandleCollectionUpdate)}};ae.template=`<uc-activity-header><span class="uc-header-text">{{headerText}}</span><button type="button" class="uc-mini-btn uc-close-btn" set="onclick: *closeModal"><uc-icon name="close"></uc-icon></button></uc-activity-header><div class="uc-no-files" set="@hidden: hasFiles"><slot name="empty"><span l10n="no-files"></span></slot></div><div class="uc-files" repeat="*uploadList" repeat-item-tag="uc-file-item"></div><div class="uc-common-error" set="@hidden: !commonErrorMessage; textContent: commonErrorMessage;"></div><div class="uc-toolbar"><button type="button" class="uc-cancel-btn uc-secondary-btn" set="onclick: onCancel;" l10n="clear"></button><div class="uc-toolbar-spacer"></div><button type="button" class="uc-add-more-btn uc-secondary-btn" set="onclick: onAdd; @disabled: !addMoreBtnEnabled; @hidden: !addMoreBtnVisible" ><uc-icon name="add"></uc-icon><span l10n="add-more"></span></button><button type="button" class="uc-upload-btn uc-primary-btn" set="@hidden: !uploadBtnVisible; onclick: onUpload;" l10n="upload" ></button><button type="button" class="uc-done-btn uc-primary-btn" set="@hidden: !doneBtnVisible; onclick: onDone; @disabled: !doneBtnEnabled" l10n="done" ></button></div><uc-drop-area ghost></uc-drop-area>`;var ue=()=>{let r=[];return{stack:r,promiseReadJpegChunks:t=>new Promise((i,s)=>{let o=2,n=(c,h)=>{let u=new FileReader;u.addEventListener("load",()=>{h(new DataView(u.result))}),u.addEventListener("error",f=>{s(`Reader error: ${f}`)}),u.readAsArrayBuffer(c)},l=()=>n(t.slice(o,o+128),c=>{let h,u,f;for(h=u=0,f=c.byteLength;f>=0?u<f:u>f;h=f>=0?++u:--u)if(c.getUint8(h)===255){o+=h;break}a()}),a=()=>{let c=o;return n(t.slice(o,o+=4),h=>{if(h.byteLength!==4||h.getUint8(0)!==255){s("Corrupted");return}let u=h.getUint8(1);if(u===218){i(!0);return}let f=h.getUint16(2)-2;return n(t.slice(o,o+=f),m=>{if(m.byteLength!==f){s("Corrupted");return}r.push({startPos:c,length:f,marker:u,view:m}),l()})})};FileReader&&DataView||s("Not Support"),n(t.slice(0,2),c=>{c.getUint16(0)!==65496&&s("Not jpeg"),l()})})}},Ao=async r=>{let e=[],{promiseReadJpegChunks:t,stack:i}=ue();return await t(r),i.forEach(({marker:s,view:o})=>{s===226&&o.getUint32(0)===1229144927&&o.getUint32(4)===1347571526&&o.getUint32(8)===1229735168&&e.push(o)}),e},gi=async(r,e,t)=>{{let i=[],s=[],{promiseReadJpegChunks:o,stack:n}=ue();await o(r),n.forEach(c=>{if(c.marker===e)return i.push(c.startPos),s.push(c.length)});let l=[r.slice(0,2)];for(let c of t){let h=new DataView(new ArrayBuffer(4));h.setUint16(0,65280+e),h.setUint16(2,c.byteLength+2),l.push(h.buffer),l.push(c)}let a=2;for(let c=0;c<i.length;c++)i[c]>a&&l.push(r.slice(a,i[c])),a=i[c]+s[c]+4;return l.push(r.slice(a,r.size)),new Blob(l,{type:r.type})}};var yi=(r,e)=>gi(r,226,e.map(t=>t.buffer)),Eo=async r=>{try{return await yi(r,[])}catch(e){throw new Error(`Failed to strip ICC profile: ${e}`)}},xo=(r,e,t)=>new Promise((i,s)=>{let o=n=>{if(!n){s("Failed to convert canvas to blob");return}i(n)};r.toBlob(o,e,t),r.width=r.height=1}),Ut=()=>{let r=document.createElement("canvas"),e=r.getContext("2d");return{canvas:r,ctx:e}},So=r=>{let{ctx:t,canvas:i}=Ut();i.width=i.height=50,t.drawImage(r,0,0,50,50);let s=t.getImageData(0,0,50,50).data;i.width=i.height=1;for(let o=3;o<s.length;o+=4)if(s[o]<254)return!0;return!1},To=async r=>{let e=null,{promiseReadJpegChunks:t,stack:i}=ue();return await t(r),i.forEach(({marker:s,view:o})=>{if(!e&&s===225&&o.byteLength>=14&&o.getUint32(0)===1165519206&&o.getUint16(4)===0){e=o;return}}),e},Oo="data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QA6RXhpZgAATU0AKgAAAAgAAwESAAMAAAABAAYAAAEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAIBASIA/8QAJgABAAAAAAAAAAAAAAAAAAAAAxABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAAPwBH/9k=",ce,Uo=()=>new Promise(r=>{if(ce!==void 0)r(ce);else{let e=new Image;e.addEventListener("load",()=>{ce=e.naturalWidth<e.naturalHeight,e.src="//:0",r(ce)}),e.src=Oo}}),Io=(r,e)=>{let t,i,s,o;if(!r||r.byteLength<14||r.getUint32(0)!==1165519206||r.getUint16(4)!==0)return;if(r.getUint16(6)===18761)i=!0;else if(r.getUint16(6)===19789)i=!1;else return;if(r.getUint16(8,i)!==42)return;s=8+r.getUint32(10,i);let n=r.getUint16(s-2,i);for(t=0,o=n;o>=0?t<o:t>o;o>=0?++t:--t){if(r.byteLength<s+10)return;r.getUint16(s,i)===274&&e(s+8,i),s+=12}},ko=(r,e)=>{Io(r,(t,i)=>r.setUint16(t,e,i))},Lo=async(r,e,t)=>(t&&ko(e,1),gi(r,225,[e.buffer])),Mo=(r,e)=>new Promise((t,i)=>{e&&(r.src=e),r.complete?t(r):(r.addEventListener("load",()=>{t(r)}),r.addEventListener("error",()=>{i(new Error("Failed to load image. Probably not an image."))}))}),Po=r=>Mo(new Image,r),Ro=[1,3],Fo=[192,193,194,195,197,198,199,201,202,203,205,206,207],mi={squareSide:[Math.floor(Math.sqrt(5*1e3*1e3)),4096,8192,11180,10836,11402,14188,16384],dimension:[4096,8192,16384,32767,65535]},Do=async r=>{let e=!1,{promiseReadJpegChunks:t,stack:i}=ue();return await t(r).then(()=>(i.forEach(({marker:s,view:o})=>{if(!e&&Fo.indexOf(s)>=0){let n=o.getUint8(5);Ro.indexOf(n)<0&&(e=!0)}}),e)).catch(()=>e)},bi=(r,e)=>{let t={};return(...i)=>{let s=e(i,t);return s in t?t[s]:t[s]=r(...i)}},_i=(r,e)=>{let[t]=r,i=Object.keys(e).map(s=>parseInt(s,10)).sort((s,o)=>s-o);for(let s=0;s<i.length;s++){let o=i[s],n=!!e[o];if(o>t&&n||o<t&&!n)return o}return t},lt={R:55,G:110,B:165,A:255},$o=`rgba(${lt.R}, ${lt.G}, ${lt.B}, ${lt.A/255})`,vi=(r,e)=>{try{let t=[r-1,e-1,1,1],{canvas:i,ctx:s}=Ut();i.width=1,i.height=1;let{canvas:o,ctx:n}=Ut();o.width=r,o.height=e,n&&(n.fillStyle=$o,n.fillRect(...t),s.drawImage(o,r-1,e-1,1,1,0,0,1,1));let l=s&&s.getImageData(0,0,1,1).data,a=!1;return l&&(a=l[0]===lt.R&&l[1]===lt.G&&l[2]===lt.B&&l[3]===lt.A),o.width=o.height=1,a}catch{return console.error(`Failed to test for max canvas size of ${r}x${e}.`),!1}};function wi(r){return(...e)=>new Promise(t=>{setTimeout(()=>{let i=r(...e);t(i)},0)})}var No=wi(bi(vi,_i)),Vo=wi(bi(vi,_i)),Ci=async(r,e)=>{let t=mi.squareSide.find(n=>n*n>=r*e),i=mi.dimension.find(n=>n>=r&&n>=e);if(!t||!i)throw new Error("Not supported");let[s,o]=await Promise.all([No(t,t),Vo(i,1)]);if(s&&o)return!0;throw new Error("Not supported")},Ai=async(r,e,t)=>{try{let{ctx:i,canvas:s}=Ut();return s.width=e,s.height=t,i.imageSmoothingQuality="high",i.drawImage(r,0,0,e,t),r instanceof HTMLImageElement&&(r.src="//:0"),r instanceof HTMLCanvasElement&&(r.width=r.height=1),s}catch(i){throw new Error("Canvas resize error",{cause:i})}},zo=({img:r,targetW:e,targetH:t})=>Ai(r,e,t),jo=function({sourceW:r,targetW:e,targetH:t,step:i}){let s=[],o=e,n=t;do s.push([o,n]),o=Math.round(o/i),n=Math.round(n/i);while(o<r*i);return s.reverse()},Bo=({img:r,sourceW:e,targetW:t,targetH:i,step:s})=>jo({sourceW:e,targetW:t,targetH:i,step:s}).reduce((n,[l,a])=>n.then(c=>Ci(l,a).then(()=>Ai(c,l,a)).catch(()=>c)),Promise.resolve(r)),Ho=()=>/iPad|iPhone|iPod/.test(navigator.platform)?!0:navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform),Go=navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform),Ye=.71,Xo=(r,e)=>{if(r.width*Ye*r.height*Ye<e.size)throw new Error("Not required");let t=r.width,i=r.height,s=t/i,o=Math.floor(Math.sqrt(e.size*s)),n=Math.floor(e.size/Math.sqrt(e.size*s));return Ci(o,n).then(()=>{let{ctx:l}=Ut();return"imageSmoothingQuality"in l&&!Ho()&&!Go?zo({img:r,targetW:o,targetH:n}):Bo({img:r,sourceW:t,targetW:o,targetH:n,step:Ye})}).catch(()=>Promise.reject("Not supported"))},Ei=async(r,e)=>{try{if(await Do(r))throw new Error("Should skipped");let i=await Promise.allSettled([To(r),Uo(),Ao(r)]),o=!i.some(g=>g.status==="rejected"),[n,l,a]=i,c=await Eo(r).catch(()=>r),h=await Po(URL.createObjectURL(c));URL.revokeObjectURL(h.src);let u=await Xo(h,e),f="image/jpeg",m=(e==null?void 0:e.quality)||.8;!o&&So(u)&&(f="image/png",m=void 0);let p=await xo(u,f,m);if(o&&n.status==="fulfilled"&&n.value){let g=n.value,C=l.status==="fulfilled"?l.value:!1;p=await Lo(p,g,C)}return o&&a.status==="fulfilled"&&a.value.length>0&&(p=await yi(p,a.value)),p}catch(t){let i;throw t instanceof Error&&(i=t.message),typeof t=="string"&&(i=t),new Error(`Failed to shrink image. ${i?`Message: "${i}".`:""}`,{cause:t})}};function Wo(r){let e=new Blob([r],{type:"image/svg+xml"});return URL.createObjectURL(e)}function Je(r="hsl(209, 21%, 65%)",e=32,t=32){return Wo(`<svg width="${e}" height="${t}" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" fill="${r}" d="M9.68848 8.70068C9.68848 8.42454 9.91233 8.20068 10.1885 8.20068H15.0885C15.2211 8.20068 15.3483 8.25336 15.442 8.34713L20.342 13.2471C20.4358 13.3409 20.4885 13.4681 20.4885 13.6007V21.3007C20.4885 21.5768 20.2646 21.8007 19.9885 21.8007H10.1885C9.91233 21.8007 9.68848 21.5768 9.68848 21.3007V8.70068ZM10.6885 9.20068V20.8007H19.4885V14.1007L15.0885 14.1007C14.8123 14.1007 14.5885 13.8768 14.5885 13.6007L14.5885 9.20068H10.6885ZM15.5885 9.90779L18.7814 13.1007L15.5885 13.1007L15.5885 9.90779Z"/></svg>`)}function xi(r,e=40){if(r.type==="image/svg+xml")return URL.createObjectURL(r);let t=document.createElement("canvas"),i=t.getContext("2d"),s=new Image,o=new Promise((n,l)=>{s.onload=()=>{let a=s.height/s.width;a>1?(t.width=e,t.height=e*a):(t.height=e,t.width=e/a),i.fillStyle="rgb(240, 240, 240)",i.fillRect(0,0,t.width,t.height),i.drawImage(s,0,0,t.width,t.height),t.toBlob(c=>{if(!c){l();return}let h=URL.createObjectURL(c);n(h)})},s.onerror=a=>{l(a)}});return s.src=URL.createObjectURL(r),o}var qo=/^([0-9]+)x([0-9]+)(?:\s+(\d{1,2}|100)%)?$/i,Si=r=>{let e=qo.exec(r==null?void 0:r.toLocaleLowerCase())||[];if(!e.length)return!1;let t=e[1]*e[2],i=16384*16384;return t>i?(console.warn(`Shrinked size can not be larger than ${Math.floor(i/1e3/1e3)}MP. You have set ${e[1]}x${e[2]} (${Math.ceil(t/1e3/100)/10}MP).`),!1):{quality:e[3]?e[3]/100:void 0,size:t}};var $=Object.freeze({FINISHED:Symbol(0),FAILED:Symbol(1),UPLOADING:Symbol(2),IDLE:Symbol(3)}),It=class r extends k{constructor(){super();d(this,"couldBeCtxOwner",!0);d(this,"pauseRender",!0);d(this,"_entrySubs",new Set);d(this,"_entry",null);d(this,"_isIntersecting",!1);d(this,"_debouncedGenerateThumb",V(this._generateThumbnail.bind(this),100));d(this,"_debouncedCalculateState",V(this._calculateState.bind(this),100));d(this,"_renderedOnce",!1);this.init$={...this.init$,uid:"",itemName:"",errorText:"",thumbUrl:"",progressValue:0,progressVisible:!1,badgeIcon:"",isFinished:!1,isFailed:!1,isUploading:!1,isFocused:!1,isEditable:!1,state:$.IDLE,onEdit:()=>{this.set$({"*focusedEntry":this._entry}),this.hasBlockInCtx(t=>t.activityType===E.activities.DETAILS)?this.$["*currentActivity"]=E.activities.DETAILS:this.$["*currentActivity"]=E.activities.CLOUD_IMG_EDIT},onRemove:()=>{this.uploadCollection.remove(this.$.uid)},onUpload:()=>{this.upload()}}}_reset(){for(let t of this._entrySubs)t.remove();this._debouncedGenerateThumb.cancel(),this._debouncedCalculateState.cancel(),this._entrySubs=new Set,this._entry=null}_observerCallback(t){let[i]=t;this._isIntersecting=i.isIntersecting,i.isIntersecting&&!this._renderedOnce&&(this.render(),this._renderedOnce=!0),i.intersectionRatio===0?this._debouncedGenerateThumb.cancel():this._debouncedGenerateThumb()}_calculateState(){if(!this._entry)return;let t=this._entry,i=$.IDLE;t.getValue("errors").length>0?i=$.FAILED:t.getValue("isUploading")?i=$.UPLOADING:t.getValue("fileInfo")&&(i=$.FINISHED),this.$.state=i}async _generateThumbnail(){var i;if(!this._entry)return;let t=this._entry;if(t.getValue("fileInfo")&&t.getValue("isImage")){let s=this.cfg.thumbSize,o=await this.proxyUrl(Vt(gr(this.cfg.cdnCname,this._entry.getValue("uuid")),$t(t.getValue("cdnUrlModifiers"),`scale_crop/${s}x${s}/center`))),n=t.getValue("thumbUrl");n!==o&&(t.setValue("thumbUrl",o),n!=null&&n.startsWith("blob:")&&URL.revokeObjectURL(n));return}if(!t.getValue("thumbUrl"))if((i=t.getValue("file"))!=null&&i.type.includes("image"))try{let s=await xi(t.getValue("file"),this.cfg.thumbSize);t.setValue("thumbUrl",s)}catch{let o=window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");t.setValue("thumbUrl",Je(o))}else{let s=window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");t.setValue("thumbUrl",Je(s))}}_subEntry(t,i){let s=this._entry.subscribe(t,o=>{this.isConnected&&i(o)});this._entrySubs.add(s)}_handleEntryId(t){var s;this._reset();let i=(s=this.uploadCollection)==null?void 0:s.read(t);this._entry=i,i&&(this._subEntry("uploadProgress",o=>{this.$.progressValue=o}),this._subEntry("fileName",o=>{this.$.itemName=o||i.getValue("externalUrl")||this.l10n("file-no-name"),this._debouncedCalculateState()}),this._subEntry("externalUrl",o=>{this.$.itemName=i.getValue("fileName")||o||this.l10n("file-no-name")}),this._subEntry("fileInfo",o=>{this._debouncedCalculateState(),o&&this._isIntersecting&&this._debouncedGenerateThumb()}),this._subEntry("cdnUrlModifiers",()=>{this._isIntersecting&&this._debouncedGenerateThumb()}),this._subEntry("thumbUrl",o=>{this.$.thumbUrl=o?`url(${o})`:""}),this._subEntry("errors",()=>this._debouncedCalculateState()),this._subEntry("isUploading",()=>this._debouncedCalculateState()),this._subEntry("fileSize",()=>this._debouncedCalculateState()),this._subEntry("mimeType",()=>this._debouncedCalculateState()),this._subEntry("isImage",()=>this._debouncedCalculateState()),this._isIntersecting&&this._debouncedGenerateThumb())}initCallback(){super.initCallback(),this.sub("uid",t=>{this._handleEntryId(t)}),this.sub("state",t=>{this._handleState(t)}),this.subConfigValue("useCloudImageEditor",()=>this._debouncedCalculateState()),this.onclick=()=>{r.activeInstances.forEach(t=>{t===this?t.setAttribute("focused",""):t.removeAttribute("focused")})},this.sub("*uploadTrigger",t=>{t.has(this._entry.uid)&&setTimeout(()=>this.isConnected&&this.upload())}),r.activeInstances.add(this)}_handleState(t){var i,s,o,n;t===$.FAILED?this.$.badgeIcon="badge-error":t===$.FINISHED&&(this.$.badgeIcon="badge-success"),t===$.UPLOADING?this.$.isFocused=!1:this.$.progressValue=0,this.set$({isFailed:t===$.FAILED,isUploading:t===$.UPLOADING,isFinished:t===$.FINISHED,progressVisible:t===$.UPLOADING,isEditable:this.cfg.useCloudImageEditor&&((i=this._entry)==null?void 0:i.getValue("isImage"))&&((s=this._entry)==null?void 0:s.getValue("cdnUrl")),errorText:(n=(o=this._entry.getValue("errors"))==null?void 0:o[0])==null?void 0:n.message})}destroyCallback(){super.destroyCallback(),r.activeInstances.delete(this),this._reset()}connectedCallback(){super.connectedCallback(),this._observer=new window.IntersectionObserver(this._observerCallback.bind(this),{threshold:[0,1]}),this._observer.observe(this)}disconnectedCallback(){var t;super.disconnectedCallback(),this._debouncedGenerateThumb.cancel(),(t=this._observer)==null||t.disconnect()}_settingsOfShrink(){return Si(this.cfg.imageShrink)}_processShrink(t){return Ei(t,this._settingsOfShrink())}async upload(){var s,o,n,l,a;let t=this._entry;if(!this.uploadCollection.read(t.uid)||t.getValue("fileInfo")||t.getValue("isUploading")||t.getValue("errors").length>0)return;let i=this.cfg.multiple?this.cfg.multipleMax:1;if(!(i&&this.uploadCollection.size>i)){this._debouncedCalculateState(),t.setValue("isUploading",!0),t.setValue("errors",[]);try{let c=new AbortController;t.setValue("abortController",c);let h=async()=>{let f=t.getValue("file");f&&this.cfg.imageShrink&&(f=await this._processShrink(f).catch(()=>f));let m=f||t.getValue("externalUrl")||t.getValue("uuid"),g={...await this.getUploadClientOptions(),fileName:t.getValue("fileName"),source:t.getValue("source"),onProgress:C=>{if(C.isComputable){let A=C.value*100;t.setValue("uploadProgress",A)}},signal:c.signal,metadata:await this.getMetadataFor(t.uid)};return this.debugPrint("upload options",m,g),Re(m,g)},u=await this.$["*uploadQueue"].add(h);t.setMultipleValues({fileInfo:u,isUploading:!1,fileName:u.originalFilename,fileSize:u.size,isImage:u.isImage,mimeType:(n=(o=(s=u.contentInfo)==null?void 0:s.mime)==null?void 0:o.mime)!=null?n:u.mimeType,uuid:u.uuid,cdnUrl:(l=t.getValue("cdnUrl"))!=null?l:u.cdnUrl,cdnUrlModifiers:(a=t.getValue("cdnUrlModifiers"))!=null?a:"",uploadProgress:100}),t===this._entry&&this._debouncedCalculateState()}catch(c){c instanceof st&&c.isCancel?t.setMultipleValues({isUploading:!1,uploadProgress:0}):t.setMultipleValues({isUploading:!1,uploadProgress:0,uploadError:c}),t===this._entry&&this._debouncedCalculateState()}}}};It.template=`<div class="uc-inner" set="@finished: isFinished; @uploading: isUploading; @failed: isFailed; @focused: isFocused"><div class="uc-thumb" set="style.backgroundImage: thumbUrl"><div class="uc-badge"><uc-icon set="@name: badgeIcon"></uc-icon></div></div><div class="uc-file-name-wrapper"><span class="uc-file-name" set="@title: itemName">{{itemName}}</span><span class="uc-file-error" set="@hidden: !errorText">{{errorText}}</span></div><div class="uc-file-actions"><button type="button" l10n="@title:file-item-edit-button" class="uc-edit-btn uc-mini-btn" set="onclick: onEdit; @hidden: !isEditable" ><uc-icon name="edit-file"></uc-icon></button><button type="button" l10n="@title:file-item-remove-button" class="uc-remove-btn uc-mini-btn" set="onclick: onRemove;" ><uc-icon name="remove-file"></uc-icon></button><button type="button" class="uc-upload-btn uc-mini-btn" set="onclick: onUpload;"><uc-icon name="upload"></uc-icon></button></div><uc-progress-bar class="uc-progress-bar" set="value: progressValue; visible: progressVisible;"></uc-progress-bar></div>`;It.activeInstances=new Set;var kt=class extends I{constructor(){super(),this.init$={...this.init$,name:"",href:"",title:""}}initCallback(){super.initCallback(),this.sub("name",e=>{if(!e)return;let t=`#uc-icon-${e}`;this.subConfigValue("iconHrefResolver",i=>{if(i){let s=i(e);t=s!=null?s:t}this.$.href=t})})}};kt.template=`<svg ref="svg" xmlns="http://www.w3.org/2000/svg"><title>{{title}}</title><use set="@href: href;"></use></svg>`;kt.bindAttributes({name:"name",title:"title"});var de=class extends I{constructor(){super(...arguments);d(this,"_value",0);d(this,"init$",{...this.init$,width:0,opacity:0})}initCallback(){super.initCallback(),this.defineAccessor("value",t=>{if(t===void 0)return;let i=this._value;if(this._value=t,t===0&&i>0){this.ref.line.addEventListener("transitionend",()=>{this.style.setProperty("--l-width",this._value.toString())});return}this.style.setProperty("--l-width",this._value.toString())}),this.defineAccessor("visible",t=>{this.ref.line.classList.toggle("uc-progress--hidden",!t)})}};de.template='<div ref="line" class="uc-progress"></div>';var he=class extends I{initCallback(){super.initCallback(),this.subConfigValue("removeCopyright",e=>{this.toggleAttribute("hidden",!!e)})}};d(he,"template",`<a href="https://uploadcare.com/?utm_source=copyright&utm_medium=referral&utm_campaign=v4" target="_blank noopener" class="uc-credits" >Powered by Uploadcare</a >`);var Qe=class extends k{constructor(){super(...arguments);d(this,"requireCtxName",!0)}_createValidationInput(){let t=document.createElement("input");return t.type="text",t.name=this.ctxName,t.required=this.cfg.multipleMin>0,t.tabIndex=-1,ar(t,{opacity:0,height:0,width:0}),t}initCallback(){super.initCallback(),this._validationInputElement=this._createValidationInput(),this.appendChild(this._validationInputElement),this.sub("*collectionState",t=>{var i;{if(this._dynamicInputsContainer||(this._dynamicInputsContainer=document.createElement("div"),this.appendChild(this._dynamicInputsContainer)),!this._validationInputElement){let l=this._createValidationInput();this.appendChild(l),this._validationInputElement=l}if(this._dynamicInputsContainer.innerHTML="",t.status==="uploading"||t.status==="idle"){this._validationInputElement.value="",this._validationInputElement.setCustomValidity("");return}if(t.status==="failed"){let l=(i=t.errors[0])==null?void 0:i.message;this._validationInputElement.value="",this._validationInputElement.setCustomValidity(l);return}let s=t.group?t.group:null;if(s){this._validationInputElement.value=s.cdnUrl,this._validationInputElement.setCustomValidity("");return}let o=t.allEntries.map(l=>l.cdnUrl);if(!this.cfg.multiple&&o.length===1){this._validationInputElement.value=o[0],this._validationInputElement.setCustomValidity("");return}this._validationInputElement.remove(),this._validationInputElement=null;let n=new DocumentFragment;for(let l of o){let a=document.createElement("input");a.type="hidden",a.name=`${this.ctxName}[]`,a.value=l,n.appendChild(a)}this._dynamicInputsContainer.replaceChildren(n)}},!1)}};var fe=r=>{var e;return(e=r.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g))==null?void 0:e.map(t=>t.toLowerCase()).join("-")};var tr=[...new Set(["debug",...Object.keys(z)])],Ko=["metadata","localeDefinitionOverride","secureUploadsSignatureResolver","secureDeliveryProxyUrlResolver","iconHrefResolver","fileValidators","collectionValidators"],Zo=r=>Ko.includes(r),gt=tr.filter(r=>!Zo(r)),Yo={...Object.fromEntries(gt.map(r=>[fe(r),r])),...Object.fromEntries(gt.map(r=>[r.toLowerCase(),r]))},Jo={...Object.fromEntries(gt.map(r=>[fe(r),F(r)])),...Object.fromEntries(gt.map(r=>[r.toLowerCase(),F(r)]))},Ti=r=>"__"+r,Lt=class extends I{constructor(){super();d(this,"requireCtxName",!0);this.init$={...this.init$,...Object.fromEntries(Object.entries(z).map(([t,i])=>[F(t),i]))}}_flushValueToAttribute(t,i){if(gt.includes(t)){let s=[...new Set([fe(t),t.toLowerCase()])];for(let o of s)typeof i=="undefined"||i===null?this.removeAttribute(o):this.getAttribute(o)!==i.toString()&&this.setAttribute(o,i.toString())}}_flushValueToState(t,i){this.$[F(t)]!==i&&(typeof i=="undefined"||i===null?this.$[F(t)]=z[t]:this.$[F(t)]=i)}_setValue(t,i){let s=this,o=ui(t,i),n=Ti(t);s[n]!==o&&(this._assertSameValueDifferentReference(t,s[n],o),s[n]=o,this._flushValueToAttribute(t,o),this._flushValueToState(t,o),this.debugPrint(`[uc-config] "${t}"`,o))}_getValue(t){let i=this,s=Ti(t);return i[s]}_assertSameValueDifferentReference(t,i,s){this.cfg.debug&&s!==i&&typeof s=="object"&&typeof i=="object"&&JSON.stringify(s)===JSON.stringify(i)&&(console.warn(`[uc-config] Option "${t}" value is the same as the previous one but the reference is different`),console.warn("[uc-config] You should avoid changing the reference of the object to prevent unnecessary calculations"),console.warn(`[uc-config] "${t}" previous value:`,i),console.warn(`[uc-config] "${t}" new value:`,s))}initCallback(){var i;super.initCallback();let t=this;for(let s of gt)this.sub(F(s),o=>{this._setValue(s,o)},!1);for(let s of tr){let o=(i=t[s])!=null?i:this.$[F(s)];o!==z[s]&&this._setValue(s,o),Object.defineProperty(this,s,{set:n=>{this._setValue(s,n)},get:()=>this._getValue(s)})}}attributeChangedCallback(t,i,s){if(i===s)return;let o=this,n=Yo[t];o[n]=s}};Lt.bindAttributes(Jo);for(let r of tr)Lt.prototype[r]=void 0;var Qo=Lt;var pe=class extends k{constructor(){super(...arguments);d(this,"requireCtxName",!0)}initCallback(){super.initCallback(),this.$["*eventEmitter"].bindTarget(this)}destroyCallback(){super.destroyCallback(),this.$["*eventEmitter"].unbindTarget(this)}};pe.EventType=x;var tn=pe;export{Qo as Config,he as Copyright,Ot as DropArea,It as FileItem,Qt as FileUploaderMinimal,Qe as FormInput,kt as Icon,de as ProgressBar,te as StartFrom,tn as UploadCtxProvider,ae as UploadList,Mi as defineComponents,rr as defineLocale};