@uploadcare/file-uploader 1.28.0-alpha.1 → 1.28.0-alpha.666

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 (722) hide show
  1. package/dist/abstract/loadFileUploaderFrom.d.ts +4 -3
  2. package/dist/abstract/loadFileUploaderFrom.js +6 -7
  3. package/dist/env.d.ts +4 -2
  4. package/dist/env.js +6 -7
  5. package/dist/index.css +6 -9
  6. package/dist/index.d.ts +3099 -42
  7. package/dist/index.js +8 -1796
  8. package/dist/index.layered.css +7 -9
  9. package/dist/index.ssr.js +1609 -0
  10. package/dist/locales/file-uploader/ar.d.ts +2 -1
  11. package/dist/locales/file-uploader/ar.js +6 -142
  12. package/dist/locales/file-uploader/az.d.ts +2 -1
  13. package/dist/locales/file-uploader/az.js +6 -134
  14. package/dist/locales/file-uploader/ca.d.ts +2 -1
  15. package/dist/locales/file-uploader/ca.js +6 -136
  16. package/dist/locales/file-uploader/cs.d.ts +2 -1
  17. package/dist/locales/file-uploader/cs.js +6 -138
  18. package/dist/locales/file-uploader/da.d.ts +2 -1
  19. package/dist/locales/file-uploader/da.js +6 -134
  20. package/dist/locales/file-uploader/de.d.ts +2 -1
  21. package/dist/locales/file-uploader/de.js +6 -134
  22. package/dist/locales/file-uploader/el.d.ts +2 -1
  23. package/dist/locales/file-uploader/el.js +6 -134
  24. package/dist/locales/file-uploader/en.d.ts +2 -1
  25. package/dist/locales/file-uploader/en.js +6 -7
  26. package/dist/locales/file-uploader/es.d.ts +2 -1
  27. package/dist/locales/file-uploader/es.js +6 -136
  28. package/dist/locales/file-uploader/et.d.ts +2 -1
  29. package/dist/locales/file-uploader/et.js +6 -134
  30. package/dist/locales/file-uploader/fi.d.ts +2 -1
  31. package/dist/locales/file-uploader/fi.js +6 -134
  32. package/dist/locales/file-uploader/fr.d.ts +2 -1
  33. package/dist/locales/file-uploader/fr.js +6 -136
  34. package/dist/locales/file-uploader/he.d.ts +2 -1
  35. package/dist/locales/file-uploader/he.js +6 -136
  36. package/dist/locales/file-uploader/hy.d.ts +2 -1
  37. package/dist/locales/file-uploader/hy.js +6 -134
  38. package/dist/locales/file-uploader/is.d.ts +2 -1
  39. package/dist/locales/file-uploader/is.js +6 -134
  40. package/dist/locales/file-uploader/it.d.ts +2 -1
  41. package/dist/locales/file-uploader/it.js +6 -136
  42. package/dist/locales/file-uploader/ja.d.ts +2 -1
  43. package/dist/locales/file-uploader/ja.js +6 -134
  44. package/dist/locales/file-uploader/ka.d.ts +2 -1
  45. package/dist/locales/file-uploader/ka.js +6 -134
  46. package/dist/locales/file-uploader/kk.d.ts +2 -1
  47. package/dist/locales/file-uploader/kk.js +6 -134
  48. package/dist/locales/file-uploader/ko.d.ts +2 -1
  49. package/dist/locales/file-uploader/ko.js +6 -134
  50. package/dist/locales/file-uploader/lv.d.ts +2 -1
  51. package/dist/locales/file-uploader/lv.js +6 -136
  52. package/dist/locales/file-uploader/nb.d.ts +2 -1
  53. package/dist/locales/file-uploader/nb.js +6 -134
  54. package/dist/locales/file-uploader/nl.d.ts +2 -1
  55. package/dist/locales/file-uploader/nl.js +6 -134
  56. package/dist/locales/file-uploader/pl.d.ts +2 -1
  57. package/dist/locales/file-uploader/pl.js +6 -138
  58. package/dist/locales/file-uploader/pt.d.ts +2 -1
  59. package/dist/locales/file-uploader/pt.js +6 -136
  60. package/dist/locales/file-uploader/ro.d.ts +2 -1
  61. package/dist/locales/file-uploader/ro.js +6 -136
  62. package/dist/locales/file-uploader/ru.d.ts +2 -1
  63. package/dist/locales/file-uploader/ru.js +6 -138
  64. package/dist/locales/file-uploader/sk.d.ts +2 -1
  65. package/dist/locales/file-uploader/sk.js +6 -138
  66. package/dist/locales/file-uploader/sr.d.ts +2 -1
  67. package/dist/locales/file-uploader/sr.js +6 -136
  68. package/dist/locales/file-uploader/sv.d.ts +2 -1
  69. package/dist/locales/file-uploader/sv.js +6 -134
  70. package/dist/locales/file-uploader/tr.d.ts +2 -1
  71. package/dist/locales/file-uploader/tr.js +6 -134
  72. package/dist/locales/file-uploader/uk.d.ts +2 -1
  73. package/dist/locales/file-uploader/uk.js +6 -138
  74. package/dist/locales/file-uploader/vi.d.ts +2 -1
  75. package/dist/locales/file-uploader/vi.js +6 -134
  76. package/dist/locales/file-uploader/zh-TW.d.ts +2 -1
  77. package/dist/locales/file-uploader/zh-TW.js +6 -134
  78. package/dist/locales/file-uploader/zh.d.ts +2 -1
  79. package/dist/locales/file-uploader/zh.js +6 -134
  80. package/package.json +34 -40
  81. package/web/file-uploader.iife.min.d.ts +3241 -0
  82. package/web/file-uploader.iife.min.js +8 -697
  83. package/web/file-uploader.iife.min.js.LEGAL.txt +71 -0
  84. package/web/file-uploader.min.d.ts +3241 -0
  85. package/web/file-uploader.min.js +7 -1858
  86. package/web/file-uploader.min.js.LEGAL.txt +71 -0
  87. package/web/uc-basic.layered.min.css +7 -6046
  88. package/web/uc-basic.min.css +6 -5487
  89. package/web/uc-cloud-image-editor.layered.min.css +7 -1884
  90. package/web/uc-cloud-image-editor.min.css +6 -1675
  91. package/web/uc-cloud-image-editor.min.d.ts +3198 -0
  92. package/web/uc-cloud-image-editor.min.js +7 -456
  93. package/web/uc-cloud-image-editor.min.js.LEGAL.txt +70 -0
  94. package/web/uc-file-uploader-inline.layered.min.css +7 -4352
  95. package/web/uc-file-uploader-inline.min.css +6 -3836
  96. package/web/uc-file-uploader-inline.min.d.ts +3241 -0
  97. package/web/uc-file-uploader-inline.min.js +7 -1858
  98. package/web/uc-file-uploader-inline.min.js.LEGAL.txt +71 -0
  99. package/web/uc-file-uploader-minimal.layered.min.css +7 -4352
  100. package/web/uc-file-uploader-minimal.min.css +6 -3836
  101. package/web/uc-file-uploader-minimal.min.d.ts +3241 -0
  102. package/web/uc-file-uploader-minimal.min.js +7 -1858
  103. package/web/uc-file-uploader-minimal.min.js.LEGAL.txt +71 -0
  104. package/web/uc-file-uploader-regular.layered.min.css +7 -4352
  105. package/web/uc-file-uploader-regular.min.css +6 -3836
  106. package/web/uc-file-uploader-regular.min.d.ts +3241 -0
  107. package/web/uc-file-uploader-regular.min.js +7 -1858
  108. package/web/uc-file-uploader-regular.min.js.LEGAL.txt +71 -0
  109. package/web/uc-img.min.d.ts +75 -0
  110. package/web/uc-img.min.js +7 -894
  111. package/web/uc-img.min.js.LEGAL.txt +24 -0
  112. package/dist/ActivityHeader-R6Mlx-dA.js +0 -9
  113. package/dist/ActivityHeader.css +0 -23
  114. package/dist/ActivityHeader.layered.css +0 -24
  115. package/dist/CameraSource-DDwj1jCV.js +0 -511
  116. package/dist/CameraSource-n1tun2Df.js +0 -10
  117. package/dist/CameraSource.css +0 -180
  118. package/dist/CameraSource.layered.css +0 -209
  119. package/dist/CloudImageEditor-DcVoIRb3.js +0 -2163
  120. package/dist/CloudImageEditorActivity-Csij4nlC.js +0 -87
  121. package/dist/CloudImageEditorActivity-DD4NdU0P.js +0 -9
  122. package/dist/CloudImageEditorActivity.css +0 -14
  123. package/dist/CloudImageEditorActivity.layered.css +0 -15
  124. package/dist/Config-DKOromHY.js +0 -433
  125. package/dist/Config.css +0 -4
  126. package/dist/Config.layered.css +0 -5
  127. package/dist/ExternalSource-6MSUgxqy.js +0 -10
  128. package/dist/ExternalSource-DVEjSkPB.js +0 -253
  129. package/dist/ExternalSource.css +0 -98
  130. package/dist/ExternalSource.layered.css +0 -116
  131. package/dist/Icon-tXRTvEF2.js +0 -1810
  132. package/dist/Icon.css +0 -14
  133. package/dist/Icon.layered.css +0 -15
  134. package/dist/LitUploaderBlock-LxeOZ0ya.js +0 -998
  135. package/dist/UrlSource-BkyX00I2.js +0 -73
  136. package/dist/UrlSource-RI8TSD48.js +0 -10
  137. package/dist/UrlSource.css +0 -17
  138. package/dist/UrlSource.layered.css +0 -18
  139. package/dist/abstract/CTX.d.ts +0 -40
  140. package/dist/abstract/TypedCollection.d.ts +0 -47
  141. package/dist/abstract/TypedCollection.test.d.ts +0 -1
  142. package/dist/abstract/TypedData.d.ts +0 -12
  143. package/dist/abstract/TypedData.test.d.ts +0 -1
  144. package/dist/abstract/UploaderPublicApi.d.ts +0 -41
  145. package/dist/abstract/buildOutputCollectionState.d.ts +0 -3
  146. package/dist/abstract/customConfigOptions.d.ts +0 -65
  147. package/dist/abstract/defineComponents.d.ts +0 -1
  148. package/dist/abstract/features/ClipboardLayer.d.ts +0 -12
  149. package/dist/abstract/localeRegistry.d.ts +0 -5
  150. package/dist/abstract/managers/LocaleManager.d.ts +0 -10
  151. package/dist/abstract/managers/ModalManager.d.ts +0 -53
  152. package/dist/abstract/managers/SecureUploadsManager.d.ts +0 -7
  153. package/dist/abstract/managers/TelemetryManager.d.ts +0 -41
  154. package/dist/abstract/managers/ValidationManager.d.ts +0 -34
  155. package/dist/abstract/managers/__tests__/ModalManager.test.d.ts +0 -13
  156. package/dist/abstract/managers/__tests__/SecureUploadsManager.test.d.ts +0 -1
  157. package/dist/abstract/managers/a11y.d.ts +0 -9
  158. package/dist/abstract/managers/plugin/PluginManager.d.ts +0 -25
  159. package/dist/abstract/managers/plugin/PluginTypes.d.ts +0 -146
  160. package/dist/abstract/managers/plugin/index.d.ts +0 -2
  161. package/dist/abstract/sharedConfigKey.d.ts +0 -2
  162. package/dist/abstract/uploadEntrySchema.d.ts +0 -34
  163. package/dist/blocks/ActivityHeader/ActivityHeader.d.ts +0 -8
  164. package/dist/blocks/CameraSource/CameraSource.d.ts +0 -121
  165. package/dist/blocks/CameraSource/__tests__/calcCameraModes.test.d.ts +0 -1
  166. package/dist/blocks/CameraSource/calcCameraModes.d.ts +0 -5
  167. package/dist/blocks/CameraSource/constants.d.ts +0 -15
  168. package/dist/blocks/CloudImageEditor/index.d.ts +0 -1
  169. package/dist/blocks/CloudImageEditor/src/CloudImageEditorBlock.d.ts +0 -60
  170. package/dist/blocks/CloudImageEditor/src/CropFrame.d.ts +0 -56
  171. package/dist/blocks/CloudImageEditor/src/EditorAspectRatioButtonControl.d.ts +0 -24
  172. package/dist/blocks/CloudImageEditor/src/EditorButtonControl.d.ts +0 -14
  173. package/dist/blocks/CloudImageEditor/src/EditorCropButtonControl.d.ts +0 -13
  174. package/dist/blocks/CloudImageEditor/src/EditorFilterControl.d.ts +0 -35
  175. package/dist/blocks/CloudImageEditor/src/EditorImageCropper.d.ts +0 -56
  176. package/dist/blocks/CloudImageEditor/src/EditorImageFader.d.ts +0 -63
  177. package/dist/blocks/CloudImageEditor/src/EditorOperationControl.d.ts +0 -15
  178. package/dist/blocks/CloudImageEditor/src/EditorScroller.d.ts +0 -15
  179. package/dist/blocks/CloudImageEditor/src/EditorSlider.d.ts +0 -33
  180. package/dist/blocks/CloudImageEditor/src/EditorToolbar.d.ts +0 -68
  181. package/dist/blocks/CloudImageEditor/src/crop-utils.d.ts +0 -36
  182. package/dist/blocks/CloudImageEditor/src/crop-utils.test.d.ts +0 -1
  183. package/dist/blocks/CloudImageEditor/src/cropper-constants.d.ts +0 -10
  184. package/dist/blocks/CloudImageEditor/src/elements/button/BtnUi.d.ts +0 -31
  185. package/dist/blocks/CloudImageEditor/src/elements/line-loader/LineLoaderUi.d.ts +0 -19
  186. package/dist/blocks/CloudImageEditor/src/elements/presence-toggle/PresenceToggle.d.ts +0 -27
  187. package/dist/blocks/CloudImageEditor/src/elements/slider/SliderUi.d.ts +0 -38
  188. package/dist/blocks/CloudImageEditor/src/index.d.ts +0 -15
  189. package/dist/blocks/CloudImageEditor/src/lib/classNames.d.ts +0 -5
  190. package/dist/blocks/CloudImageEditor/src/lib/classNames.test.d.ts +0 -1
  191. package/dist/blocks/CloudImageEditor/src/lib/linspace.d.ts +0 -1
  192. package/dist/blocks/CloudImageEditor/src/lib/linspace.test.d.ts +0 -1
  193. package/dist/blocks/CloudImageEditor/src/lib/parseCropPreset.d.ts +0 -4
  194. package/dist/blocks/CloudImageEditor/src/lib/parseCropPreset.test.d.ts +0 -1
  195. package/dist/blocks/CloudImageEditor/src/lib/parseTabs.d.ts +0 -2
  196. package/dist/blocks/CloudImageEditor/src/lib/pick.d.ts +0 -1
  197. package/dist/blocks/CloudImageEditor/src/lib/pick.test.d.ts +0 -1
  198. package/dist/blocks/CloudImageEditor/src/lib/transformationUtils.d.ts +0 -7
  199. package/dist/blocks/CloudImageEditor/src/state.d.ts +0 -20
  200. package/dist/blocks/CloudImageEditor/src/svg-sprite.d.ts +0 -2
  201. package/dist/blocks/CloudImageEditor/src/toolbar-constants.d.ts +0 -61
  202. package/dist/blocks/CloudImageEditor/src/types.d.ts +0 -60
  203. package/dist/blocks/CloudImageEditor/src/util.d.ts +0 -2
  204. package/dist/blocks/CloudImageEditor/src/utils/parseFilterValue.d.ts +0 -7
  205. package/dist/blocks/CloudImageEditor/src/utils/parseFilterValue.test.d.ts +0 -1
  206. package/dist/blocks/CloudImageEditorActivity/CloudImageEditorActivity.d.ts +0 -25
  207. package/dist/blocks/Config/Config.d.ts +0 -60
  208. package/dist/blocks/Config/assertions.d.ts +0 -5
  209. package/dist/blocks/Config/computed-properties.d.ts +0 -24
  210. package/dist/blocks/Config/computed-properties.test.d.ts +0 -1
  211. package/dist/blocks/Config/initialConfig.d.ts +0 -6
  212. package/dist/blocks/Config/normalizeConfigValue.d.ts +0 -2
  213. package/dist/blocks/Config/validatorsType.d.ts +0 -18
  214. package/dist/blocks/Copyright/Copyright.d.ts +0 -10
  215. package/dist/blocks/DropArea/DropArea.d.ts +0 -47
  216. package/dist/blocks/DropArea/addDropzone.d.ts +0 -17
  217. package/dist/blocks/DropArea/getDropItems.d.ts +0 -12
  218. package/dist/blocks/ExternalSource/ExternalSource.d.ts +0 -45
  219. package/dist/blocks/ExternalSource/MessageBridge.d.ts +0 -11
  220. package/dist/blocks/ExternalSource/buildThemeDefinition.d.ts +0 -4
  221. package/dist/blocks/ExternalSource/query-string.d.ts +0 -1
  222. package/dist/blocks/ExternalSource/types.d.ts +0 -105
  223. package/dist/blocks/FileItem/FileItem.d.ts +0 -50
  224. package/dist/blocks/FileItem/FileItemConfig.d.ts +0 -10
  225. package/dist/blocks/FormInput/FormInput.d.ts +0 -18
  226. package/dist/blocks/Icon/Icon.d.ts +0 -19
  227. package/dist/blocks/Img/Img.d.ts +0 -14
  228. package/dist/blocks/Img/ImgBase.d.ts +0 -29
  229. package/dist/blocks/Img/ImgConfig.d.ts +0 -28
  230. package/dist/blocks/Img/configurations.d.ts +0 -11
  231. package/dist/blocks/Img/props-map.d.ts +0 -28
  232. package/dist/blocks/Img/utils/parseObjectToString.d.ts +0 -2
  233. package/dist/blocks/Modal/Modal.d.ts +0 -34
  234. package/dist/blocks/PluginActivityRenderer/PluginActivityRenderer.d.ts +0 -32
  235. package/dist/blocks/PluginActivityRenderer/index.d.ts +0 -1
  236. package/dist/blocks/ProgressBar/ProgressBar.d.ts +0 -21
  237. package/dist/blocks/ProgressBarCommon/ProgressBarCommon.d.ts +0 -17
  238. package/dist/blocks/Select/Select.d.ts +0 -18
  239. package/dist/blocks/SimpleBtn/SimpleBtn.d.ts +0 -15
  240. package/dist/blocks/SourceBtn/SourceBtn.d.ts +0 -23
  241. package/dist/blocks/SourceList/SourceList.d.ts +0 -24
  242. package/dist/blocks/Spinner/Spinner.d.ts +0 -9
  243. package/dist/blocks/StartFrom/StartFrom.d.ts +0 -12
  244. package/dist/blocks/Thumb/Thumb.d.ts +0 -35
  245. package/dist/blocks/UploadCtxProvider/EventEmitter.d.ts +0 -70
  246. package/dist/blocks/UploadCtxProvider/UploadCtxProvider.d.ts +0 -44
  247. package/dist/blocks/UploadList/UploadList.d.ts +0 -39
  248. package/dist/blocks/UrlSource/UrlSource.d.ts +0 -14
  249. package/dist/blocks/svg-backgrounds/svg-backgrounds.d.ts +0 -3
  250. package/dist/blocks/themes/uc-basic/svg-sprite.d.ts +0 -2
  251. package/dist/cameraPlugin-weRKO7eG.js +0 -8
  252. package/dist/cloud-image-editor-hhbyNWLG.js +0 -11
  253. package/dist/cloud-image-editor.css +0 -1380
  254. package/dist/cloud-image-editor.layered.css +0 -1549
  255. package/dist/cloudImageEditorPlugin-FjUgbMK3.js +0 -8
  256. package/dist/core.d.ts +0 -42
  257. package/dist/en-8OWEmZim.js +0 -135
  258. package/dist/env-mM-ksNPq.js +0 -8
  259. package/dist/externalSourcesPlugin-CMBmLT8S.js +0 -8
  260. package/dist/imageShrinkPlugin-BN6loiP2.js +0 -8
  261. package/dist/index-base.css +0 -2497
  262. package/dist/index-base.layered.css +0 -2837
  263. package/dist/instagramPlugin-CXRm8MGL.js +0 -8
  264. package/dist/lit/BaseComponent.d.ts +0 -12
  265. package/dist/lit/Constructor.d.ts +0 -1
  266. package/dist/lit/CssDataMixin.d.ts +0 -7
  267. package/dist/lit/LightDomMixin.d.ts +0 -8
  268. package/dist/lit/LitActivityBlock.d.ts +0 -53
  269. package/dist/lit/LitBlock.d.ts +0 -83
  270. package/dist/lit/LitSolutionBlock.d.ts +0 -21
  271. package/dist/lit/LitUploaderBlock.d.ts +0 -53
  272. package/dist/lit/PubSubCompat.d.ts +0 -18
  273. package/dist/lit/RegisterableElementMixin.d.ts +0 -7
  274. package/dist/lit/SharedState.d.ts +0 -119
  275. package/dist/lit/SymbioteCompatMixin.d.ts +0 -40
  276. package/dist/lit/TestModeController.d.ts +0 -16
  277. package/dist/lit/Uid.d.ts +0 -3
  278. package/dist/lit/activity-constants.d.ts +0 -11
  279. package/dist/lit/createDebugPrinter.d.ts +0 -3
  280. package/dist/lit/findBlockInCtx.d.ts +0 -3
  281. package/dist/lit/getOutputData.d.ts +0 -2
  282. package/dist/lit/hasBlockInCtx.d.ts +0 -3
  283. package/dist/lit/l10n.d.ts +0 -5
  284. package/dist/lit/parseCssPropertyValue.d.ts +0 -1
  285. package/dist/lit/shared-instances.d.ts +0 -65
  286. package/dist/loadFileUploaderFrom-Bfz8L3VB.js +0 -28
  287. package/dist/plugins/cameraPlugin.d.ts +0 -2
  288. package/dist/plugins/cloudImageEditorPlugin.d.ts +0 -2
  289. package/dist/plugins/externalSourcesPlugin.d.ts +0 -2
  290. package/dist/plugins/imageShrinkPlugin.d.ts +0 -2
  291. package/dist/plugins/instagramPlugin.d.ts +0 -2
  292. package/dist/plugins/unsplashPlugin.d.ts +0 -16
  293. package/dist/plugins/urlSourcePlugin.d.ts +0 -2
  294. package/dist/plugins-CGUls7EV.js +0 -278
  295. package/dist/solutions/adaptive-image/index.d.ts +0 -2
  296. package/dist/solutions/cloud-image-editor/CloudImageEditor.d.ts +0 -11
  297. package/dist/solutions/cloud-image-editor/index.d.ts +0 -5
  298. package/dist/solutions/file-uploader/inline/FileUploaderInline.d.ts +0 -20
  299. package/dist/solutions/file-uploader/inline/index.d.ts +0 -1
  300. package/dist/solutions/file-uploader/minimal/FileUploaderMinimal.d.ts +0 -23
  301. package/dist/solutions/file-uploader/minimal/index.d.ts +0 -1
  302. package/dist/solutions/file-uploader/regular/FileUploaderRegular.d.ts +0 -17
  303. package/dist/solutions/file-uploader/regular/index.d.ts +0 -1
  304. package/dist/types/dom.d.ts +0 -1
  305. package/dist/types/events.d.ts +0 -4
  306. package/dist/types/exported.d.ts +0 -492
  307. package/dist/types/index.d.ts +0 -5
  308. package/dist/urlSourcePlugin-_WdbEhq2.js +0 -8
  309. package/dist/utils/UID.d.ts +0 -5
  310. package/dist/utils/UID.test.d.ts +0 -1
  311. package/dist/utils/UploadSource.d.ts +0 -37
  312. package/dist/utils/WindowHeightTracker.d.ts +0 -9
  313. package/dist/utils/abilities.d.ts +0 -1
  314. package/dist/utils/applyStyles.d.ts +0 -1
  315. package/dist/utils/browser-info.d.ts +0 -12
  316. package/dist/utils/browser-info.test.d.ts +0 -1
  317. package/dist/utils/cdn-utils.d.ts +0 -53
  318. package/dist/utils/cdn-utils.test.d.ts +0 -1
  319. package/dist/utils/comma-separated.d.ts +0 -2
  320. package/dist/utils/debounce.d.ts +0 -3
  321. package/dist/utils/delay.d.ts +0 -1
  322. package/dist/utils/fileTypes.d.ts +0 -11
  323. package/dist/utils/fileTypes.test.d.ts +0 -1
  324. package/dist/utils/get-top-level-origin.d.ts +0 -1
  325. package/dist/utils/get-top-level-origin.test.d.ts +0 -1
  326. package/dist/utils/getLocaleDirection.d.ts +0 -1
  327. package/dist/utils/getPluralForm.d.ts +0 -1
  328. package/dist/utils/getPluralForm.test.d.ts +0 -1
  329. package/dist/utils/isPromiseLike.d.ts +0 -1
  330. package/dist/utils/isPromiseLike.test.d.ts +0 -1
  331. package/dist/utils/isSecureTokenExpired.d.ts +0 -8
  332. package/dist/utils/isSecureTokenExpired.test.d.ts +0 -1
  333. package/dist/utils/memoize.d.ts +0 -1
  334. package/dist/utils/memoize.test.d.ts +0 -1
  335. package/dist/utils/mixinClass.d.ts +0 -8
  336. package/dist/utils/parseCdnUrl.d.ts +0 -11
  337. package/dist/utils/parseCdnUrl.test.d.ts +0 -1
  338. package/dist/utils/parseShrink.d.ts +0 -7
  339. package/dist/utils/parseShrink.test.d.ts +0 -1
  340. package/dist/utils/preloadImage.d.ts +0 -10
  341. package/dist/utils/prettyBytes.d.ts +0 -11
  342. package/dist/utils/prettyBytes.test.d.ts +0 -1
  343. package/dist/utils/resizeImage.d.ts +0 -1
  344. package/dist/utils/stringToArray.d.ts +0 -1
  345. package/dist/utils/stringToArray.test.d.ts +0 -1
  346. package/dist/utils/template-utils.d.ts +0 -16
  347. package/dist/utils/template-utils.test.d.ts +0 -1
  348. package/dist/utils/throttle.d.ts +0 -3
  349. package/dist/utils/toKebabCase.d.ts +0 -2
  350. package/dist/utils/toKebabCase.test.d.ts +0 -1
  351. package/dist/utils/transparentPixelSrc.d.ts +0 -1
  352. package/dist/utils/uniqueArray.d.ts +0 -1
  353. package/dist/utils/uniqueArray.test.d.ts +0 -1
  354. package/dist/utils/userAgent.d.ts +0 -2
  355. package/dist/utils/validators/collection/index.d.ts +0 -2
  356. package/dist/utils/validators/collection/validateCollectionUploadError.d.ts +0 -2
  357. package/dist/utils/validators/collection/validateMultiple.d.ts +0 -2
  358. package/dist/utils/validators/file/index.d.ts +0 -4
  359. package/dist/utils/validators/file/validateFileType.d.ts +0 -2
  360. package/dist/utils/validators/file/validateIsImage.d.ts +0 -2
  361. package/dist/utils/validators/file/validateMaxSizeLimit.d.ts +0 -2
  362. package/dist/utils/validators/file/validateUploadError.d.ts +0 -2
  363. package/dist/utils/warnOnce.d.ts +0 -1
  364. package/dist/utils/wildcardRegexp.d.ts +0 -1
  365. package/dist/utils/wildcardRegexp.test.d.ts +0 -1
  366. package/dist/utils/withResolvers.d.ts +0 -5
  367. package/dist/utils/withResolvers.test.d.ts +0 -1
  368. package/web/ActivityHeader-BFdTdVfD.js +0 -9
  369. package/web/ActivityHeader-DQy6rII1.js +0 -9
  370. package/web/ActivityHeader-DvzMl0uj.js +0 -9
  371. package/web/ActivityHeader-i4x6_Fne.js +0 -9
  372. package/web/CameraSource-BAWIA4Wm.js +0 -508
  373. package/web/CameraSource-BqZCQcij.js +0 -11
  374. package/web/CameraSource-Brxr4tz4.js +0 -508
  375. package/web/CameraSource-BvBJ5Uzy.js +0 -508
  376. package/web/CameraSource-CkHzIE-h.js +0 -11
  377. package/web/CameraSource-D964yPLu.js +0 -508
  378. package/web/CameraSource-DE48Az-f.js +0 -11
  379. package/web/CameraSource-DyPebtRF.js +0 -478
  380. package/web/CameraSource-pj7Xo81m.js +0 -11
  381. package/web/CloudImageEditor-CTgUWB07.js +0 -2192
  382. package/web/CloudImageEditor-CxqV9Lwm.js +0 -2192
  383. package/web/CloudImageEditor-DoLWHpqV.js +0 -2192
  384. package/web/CloudImageEditor-Drywn265.js +0 -2192
  385. package/web/CloudImageEditor-MXcaDtMx.js +0 -2187
  386. package/web/CloudImageEditorActivity-BPzmfaJV.js +0 -85
  387. package/web/CloudImageEditorActivity-Br8pU5gd.js +0 -11
  388. package/web/CloudImageEditorActivity-Cw8b2CEz.js +0 -11
  389. package/web/CloudImageEditorActivity-Df1ySGq0.js +0 -86
  390. package/web/CloudImageEditorActivity-DinG5r0y.js +0 -11
  391. package/web/CloudImageEditorActivity-DmnLLINR.js +0 -85
  392. package/web/CloudImageEditorActivity-U90BGCek.js +0 -85
  393. package/web/CloudImageEditorActivity-dNLQZRZI.js +0 -11
  394. package/web/CloudImageEditorActivity-ur-hQ-6p.js +0 -85
  395. package/web/Config-8hlBNhvs.js +0 -455
  396. package/web/Config-BDZhPIyz.js +0 -455
  397. package/web/Config-CJVNrrjj.js +0 -455
  398. package/web/Config-DvkVtlQ7.js +0 -455
  399. package/web/ExternalSource-B9ycBFiD.js +0 -10
  400. package/web/ExternalSource-BE7HX47E.js +0 -250
  401. package/web/ExternalSource-BL5GSlol.js +0 -250
  402. package/web/ExternalSource-BXQY6Dlc.js +0 -10
  403. package/web/ExternalSource-BXxH3JCD.js +0 -250
  404. package/web/ExternalSource-BYSS-PPV.js +0 -245
  405. package/web/ExternalSource-C57a61QN.js +0 -10
  406. package/web/ExternalSource-CKfMtOgU.js +0 -250
  407. package/web/ExternalSource-DP6q8ylB.js +0 -10
  408. package/web/LitUploaderBlock-AX6jOdAS.js +0 -996
  409. package/web/LitUploaderBlock-BjAaoLl2.js +0 -996
  410. package/web/LitUploaderBlock-D8E5HuwH.js +0 -996
  411. package/web/LitUploaderBlock-Dl3ce0Tc.js +0 -996
  412. package/web/LitUploaderBlock-Oi33U0uf.js +0 -996
  413. package/web/UrlSource-B9SX3K0L.js +0 -10
  414. package/web/UrlSource-C3zB1rCb.js +0 -70
  415. package/web/UrlSource-C7bEU6Xv.js +0 -10
  416. package/web/UrlSource-CE389CBz.js +0 -70
  417. package/web/UrlSource-CnvAJ58Y.js +0 -10
  418. package/web/UrlSource-CqF0h6B-.js +0 -10
  419. package/web/UrlSource-D-971Nut.js +0 -70
  420. package/web/UrlSource-DhI3YCt5.js +0 -70
  421. package/web/UrlSource-hWV7jtB2.js +0 -70
  422. package/web/abstract/CTX.d.ts +0 -40
  423. package/web/abstract/TypedCollection.d.ts +0 -47
  424. package/web/abstract/TypedCollection.test.d.ts +0 -1
  425. package/web/abstract/TypedData.d.ts +0 -12
  426. package/web/abstract/TypedData.test.d.ts +0 -1
  427. package/web/abstract/UploaderPublicApi.d.ts +0 -41
  428. package/web/abstract/buildOutputCollectionState.d.ts +0 -3
  429. package/web/abstract/customConfigOptions.d.ts +0 -65
  430. package/web/abstract/defineComponents.d.ts +0 -1
  431. package/web/abstract/features/ClipboardLayer.d.ts +0 -12
  432. package/web/abstract/loadFileUploaderFrom.d.ts +0 -13
  433. package/web/abstract/localeRegistry.d.ts +0 -5
  434. package/web/abstract/managers/LocaleManager.d.ts +0 -10
  435. package/web/abstract/managers/ModalManager.d.ts +0 -53
  436. package/web/abstract/managers/SecureUploadsManager.d.ts +0 -7
  437. package/web/abstract/managers/TelemetryManager.d.ts +0 -41
  438. package/web/abstract/managers/ValidationManager.d.ts +0 -34
  439. package/web/abstract/managers/__tests__/ModalManager.test.d.ts +0 -13
  440. package/web/abstract/managers/__tests__/SecureUploadsManager.test.d.ts +0 -1
  441. package/web/abstract/managers/a11y.d.ts +0 -9
  442. package/web/abstract/managers/plugin/PluginManager.d.ts +0 -25
  443. package/web/abstract/managers/plugin/PluginTypes.d.ts +0 -146
  444. package/web/abstract/managers/plugin/index.d.ts +0 -2
  445. package/web/abstract/sharedConfigKey.d.ts +0 -2
  446. package/web/abstract/uploadEntrySchema.d.ts +0 -34
  447. package/web/blocks/ActivityHeader/ActivityHeader.d.ts +0 -8
  448. package/web/blocks/CameraSource/CameraSource.d.ts +0 -121
  449. package/web/blocks/CameraSource/__tests__/calcCameraModes.test.d.ts +0 -1
  450. package/web/blocks/CameraSource/calcCameraModes.d.ts +0 -5
  451. package/web/blocks/CameraSource/constants.d.ts +0 -15
  452. package/web/blocks/CloudImageEditor/index.d.ts +0 -1
  453. package/web/blocks/CloudImageEditor/src/CloudImageEditorBlock.d.ts +0 -60
  454. package/web/blocks/CloudImageEditor/src/CropFrame.d.ts +0 -56
  455. package/web/blocks/CloudImageEditor/src/EditorAspectRatioButtonControl.d.ts +0 -24
  456. package/web/blocks/CloudImageEditor/src/EditorButtonControl.d.ts +0 -14
  457. package/web/blocks/CloudImageEditor/src/EditorCropButtonControl.d.ts +0 -13
  458. package/web/blocks/CloudImageEditor/src/EditorFilterControl.d.ts +0 -35
  459. package/web/blocks/CloudImageEditor/src/EditorImageCropper.d.ts +0 -56
  460. package/web/blocks/CloudImageEditor/src/EditorImageFader.d.ts +0 -63
  461. package/web/blocks/CloudImageEditor/src/EditorOperationControl.d.ts +0 -15
  462. package/web/blocks/CloudImageEditor/src/EditorScroller.d.ts +0 -15
  463. package/web/blocks/CloudImageEditor/src/EditorSlider.d.ts +0 -33
  464. package/web/blocks/CloudImageEditor/src/EditorToolbar.d.ts +0 -68
  465. package/web/blocks/CloudImageEditor/src/crop-utils.d.ts +0 -36
  466. package/web/blocks/CloudImageEditor/src/crop-utils.test.d.ts +0 -1
  467. package/web/blocks/CloudImageEditor/src/cropper-constants.d.ts +0 -10
  468. package/web/blocks/CloudImageEditor/src/elements/button/BtnUi.d.ts +0 -31
  469. package/web/blocks/CloudImageEditor/src/elements/line-loader/LineLoaderUi.d.ts +0 -19
  470. package/web/blocks/CloudImageEditor/src/elements/presence-toggle/PresenceToggle.d.ts +0 -27
  471. package/web/blocks/CloudImageEditor/src/elements/slider/SliderUi.d.ts +0 -38
  472. package/web/blocks/CloudImageEditor/src/index.d.ts +0 -15
  473. package/web/blocks/CloudImageEditor/src/lib/classNames.d.ts +0 -5
  474. package/web/blocks/CloudImageEditor/src/lib/classNames.test.d.ts +0 -1
  475. package/web/blocks/CloudImageEditor/src/lib/linspace.d.ts +0 -1
  476. package/web/blocks/CloudImageEditor/src/lib/linspace.test.d.ts +0 -1
  477. package/web/blocks/CloudImageEditor/src/lib/parseCropPreset.d.ts +0 -4
  478. package/web/blocks/CloudImageEditor/src/lib/parseCropPreset.test.d.ts +0 -1
  479. package/web/blocks/CloudImageEditor/src/lib/parseTabs.d.ts +0 -2
  480. package/web/blocks/CloudImageEditor/src/lib/pick.d.ts +0 -1
  481. package/web/blocks/CloudImageEditor/src/lib/pick.test.d.ts +0 -1
  482. package/web/blocks/CloudImageEditor/src/lib/transformationUtils.d.ts +0 -7
  483. package/web/blocks/CloudImageEditor/src/state.d.ts +0 -20
  484. package/web/blocks/CloudImageEditor/src/svg-sprite.d.ts +0 -2
  485. package/web/blocks/CloudImageEditor/src/toolbar-constants.d.ts +0 -61
  486. package/web/blocks/CloudImageEditor/src/types.d.ts +0 -60
  487. package/web/blocks/CloudImageEditor/src/util.d.ts +0 -2
  488. package/web/blocks/CloudImageEditor/src/utils/parseFilterValue.d.ts +0 -7
  489. package/web/blocks/CloudImageEditor/src/utils/parseFilterValue.test.d.ts +0 -1
  490. package/web/blocks/CloudImageEditorActivity/CloudImageEditorActivity.d.ts +0 -25
  491. package/web/blocks/Config/Config.d.ts +0 -60
  492. package/web/blocks/Config/assertions.d.ts +0 -5
  493. package/web/blocks/Config/computed-properties.d.ts +0 -24
  494. package/web/blocks/Config/computed-properties.test.d.ts +0 -1
  495. package/web/blocks/Config/initialConfig.d.ts +0 -6
  496. package/web/blocks/Config/normalizeConfigValue.d.ts +0 -2
  497. package/web/blocks/Config/validatorsType.d.ts +0 -18
  498. package/web/blocks/Copyright/Copyright.d.ts +0 -10
  499. package/web/blocks/DropArea/DropArea.d.ts +0 -47
  500. package/web/blocks/DropArea/addDropzone.d.ts +0 -17
  501. package/web/blocks/DropArea/getDropItems.d.ts +0 -12
  502. package/web/blocks/ExternalSource/ExternalSource.d.ts +0 -45
  503. package/web/blocks/ExternalSource/MessageBridge.d.ts +0 -11
  504. package/web/blocks/ExternalSource/buildThemeDefinition.d.ts +0 -4
  505. package/web/blocks/ExternalSource/query-string.d.ts +0 -1
  506. package/web/blocks/ExternalSource/types.d.ts +0 -105
  507. package/web/blocks/FileItem/FileItem.d.ts +0 -50
  508. package/web/blocks/FileItem/FileItemConfig.d.ts +0 -10
  509. package/web/blocks/FormInput/FormInput.d.ts +0 -18
  510. package/web/blocks/Icon/Icon.d.ts +0 -19
  511. package/web/blocks/Img/Img.d.ts +0 -14
  512. package/web/blocks/Img/ImgBase.d.ts +0 -29
  513. package/web/blocks/Img/ImgConfig.d.ts +0 -28
  514. package/web/blocks/Img/configurations.d.ts +0 -11
  515. package/web/blocks/Img/props-map.d.ts +0 -28
  516. package/web/blocks/Img/utils/parseObjectToString.d.ts +0 -2
  517. package/web/blocks/Modal/Modal.d.ts +0 -34
  518. package/web/blocks/PluginActivityRenderer/PluginActivityRenderer.d.ts +0 -32
  519. package/web/blocks/PluginActivityRenderer/index.d.ts +0 -1
  520. package/web/blocks/ProgressBar/ProgressBar.d.ts +0 -21
  521. package/web/blocks/ProgressBarCommon/ProgressBarCommon.d.ts +0 -17
  522. package/web/blocks/Select/Select.d.ts +0 -18
  523. package/web/blocks/SimpleBtn/SimpleBtn.d.ts +0 -15
  524. package/web/blocks/SourceBtn/SourceBtn.d.ts +0 -23
  525. package/web/blocks/SourceList/SourceList.d.ts +0 -24
  526. package/web/blocks/Spinner/Spinner.d.ts +0 -9
  527. package/web/blocks/StartFrom/StartFrom.d.ts +0 -12
  528. package/web/blocks/Thumb/Thumb.d.ts +0 -35
  529. package/web/blocks/UploadCtxProvider/EventEmitter.d.ts +0 -70
  530. package/web/blocks/UploadCtxProvider/UploadCtxProvider.d.ts +0 -44
  531. package/web/blocks/UploadList/UploadList.d.ts +0 -39
  532. package/web/blocks/UrlSource/UrlSource.d.ts +0 -14
  533. package/web/blocks/svg-backgrounds/svg-backgrounds.d.ts +0 -3
  534. package/web/blocks/themes/uc-basic/svg-sprite.d.ts +0 -2
  535. package/web/cameraPlugin-DeedXMWV.js +0 -8
  536. package/web/cameraPlugin-Duy1QwjB.js +0 -8
  537. package/web/cameraPlugin-QS9SUOtO.js +0 -8
  538. package/web/cameraPlugin-bq8ggY04.js +0 -8
  539. package/web/cameraPlugin-cel9YgP_.js +0 -8
  540. package/web/cloud-image-editor-8DrVRZ7E.js +0 -12
  541. package/web/cloud-image-editor-BX50EK1U.js +0 -12
  542. package/web/cloud-image-editor-DSW3oWq-.js +0 -12
  543. package/web/cloud-image-editor-DuI2Lx4M.js +0 -12
  544. package/web/cloudImageEditorPlugin-5my6aD36.js +0 -8
  545. package/web/cloudImageEditorPlugin-Bk19DmJv.js +0 -8
  546. package/web/cloudImageEditorPlugin-CcdnmtBW.js +0 -8
  547. package/web/cloudImageEditorPlugin-DQJmDl03.js +0 -8
  548. package/web/cloudImageEditorPlugin-kojghfqw.js +0 -8
  549. package/web/constants-BCfCF0cJ.js +0 -4025
  550. package/web/core.d.ts +0 -42
  551. package/web/env.d.ts +0 -2
  552. package/web/externalSourcesPlugin-BTeRm5C0.js +0 -8
  553. package/web/externalSourcesPlugin-BXgVeojg.js +0 -8
  554. package/web/externalSourcesPlugin-BgLpuIK9.js +0 -8
  555. package/web/externalSourcesPlugin-DMc9zs4T.js +0 -8
  556. package/web/externalSourcesPlugin-Dm9vnTBv.js +0 -8
  557. package/web/imageShrinkPlugin-BdHgEGZH.js +0 -8
  558. package/web/imageShrinkPlugin-BjkMGfvT.js +0 -8
  559. package/web/imageShrinkPlugin-CCkGHL2w.js +0 -8
  560. package/web/imageShrinkPlugin-D4WjaRGo.js +0 -8
  561. package/web/imageShrinkPlugin-DqYGutVx.js +0 -8
  562. package/web/index.d.ts +0 -42
  563. package/web/instagramPlugin-BTMz0K2a.js +0 -8
  564. package/web/instagramPlugin-BbIKgTH7.js +0 -8
  565. package/web/instagramPlugin-CQQhsEJa.js +0 -8
  566. package/web/instagramPlugin-Cm7lWKae.js +0 -8
  567. package/web/instagramPlugin-DcclxM_d.js +0 -8
  568. package/web/lit/BaseComponent.d.ts +0 -12
  569. package/web/lit/Constructor.d.ts +0 -1
  570. package/web/lit/CssDataMixin.d.ts +0 -7
  571. package/web/lit/LightDomMixin.d.ts +0 -8
  572. package/web/lit/LitActivityBlock.d.ts +0 -53
  573. package/web/lit/LitBlock.d.ts +0 -83
  574. package/web/lit/LitSolutionBlock.d.ts +0 -21
  575. package/web/lit/LitUploaderBlock.d.ts +0 -53
  576. package/web/lit/PubSubCompat.d.ts +0 -18
  577. package/web/lit/RegisterableElementMixin.d.ts +0 -7
  578. package/web/lit/SharedState.d.ts +0 -119
  579. package/web/lit/SymbioteCompatMixin.d.ts +0 -40
  580. package/web/lit/TestModeController.d.ts +0 -16
  581. package/web/lit/Uid.d.ts +0 -3
  582. package/web/lit/activity-constants.d.ts +0 -11
  583. package/web/lit/createDebugPrinter.d.ts +0 -3
  584. package/web/lit/findBlockInCtx.d.ts +0 -3
  585. package/web/lit/getOutputData.d.ts +0 -2
  586. package/web/lit/hasBlockInCtx.d.ts +0 -3
  587. package/web/lit/l10n.d.ts +0 -5
  588. package/web/lit/parseCssPropertyValue.d.ts +0 -1
  589. package/web/lit/shared-instances.d.ts +0 -65
  590. package/web/locales/file-uploader/ar.d.ts +0 -137
  591. package/web/locales/file-uploader/az.d.ts +0 -129
  592. package/web/locales/file-uploader/ca.d.ts +0 -131
  593. package/web/locales/file-uploader/cs.d.ts +0 -133
  594. package/web/locales/file-uploader/da.d.ts +0 -129
  595. package/web/locales/file-uploader/de.d.ts +0 -129
  596. package/web/locales/file-uploader/el.d.ts +0 -129
  597. package/web/locales/file-uploader/en.d.ts +0 -129
  598. package/web/locales/file-uploader/es.d.ts +0 -131
  599. package/web/locales/file-uploader/et.d.ts +0 -129
  600. package/web/locales/file-uploader/fi.d.ts +0 -129
  601. package/web/locales/file-uploader/fr.d.ts +0 -131
  602. package/web/locales/file-uploader/he.d.ts +0 -131
  603. package/web/locales/file-uploader/hy.d.ts +0 -129
  604. package/web/locales/file-uploader/is.d.ts +0 -129
  605. package/web/locales/file-uploader/it.d.ts +0 -131
  606. package/web/locales/file-uploader/ja.d.ts +0 -129
  607. package/web/locales/file-uploader/ka.d.ts +0 -129
  608. package/web/locales/file-uploader/kk.d.ts +0 -129
  609. package/web/locales/file-uploader/ko.d.ts +0 -129
  610. package/web/locales/file-uploader/lv.d.ts +0 -131
  611. package/web/locales/file-uploader/nb.d.ts +0 -129
  612. package/web/locales/file-uploader/nl.d.ts +0 -129
  613. package/web/locales/file-uploader/pl.d.ts +0 -133
  614. package/web/locales/file-uploader/pt.d.ts +0 -131
  615. package/web/locales/file-uploader/ro.d.ts +0 -131
  616. package/web/locales/file-uploader/ru.d.ts +0 -133
  617. package/web/locales/file-uploader/sk.d.ts +0 -133
  618. package/web/locales/file-uploader/sr.d.ts +0 -131
  619. package/web/locales/file-uploader/sv.d.ts +0 -129
  620. package/web/locales/file-uploader/tr.d.ts +0 -129
  621. package/web/locales/file-uploader/uk.d.ts +0 -133
  622. package/web/locales/file-uploader/vi.d.ts +0 -129
  623. package/web/locales/file-uploader/zh-TW.d.ts +0 -129
  624. package/web/locales/file-uploader/zh.d.ts +0 -129
  625. package/web/plugins/cameraPlugin.d.ts +0 -2
  626. package/web/plugins/cloudImageEditorPlugin.d.ts +0 -2
  627. package/web/plugins/externalSourcesPlugin.d.ts +0 -2
  628. package/web/plugins/imageShrinkPlugin.d.ts +0 -2
  629. package/web/plugins/instagramPlugin.d.ts +0 -2
  630. package/web/plugins/unsplashPlugin.d.ts +0 -16
  631. package/web/plugins/urlSourcePlugin.d.ts +0 -2
  632. package/web/plugins-Bt7FXHKx.js +0 -562
  633. package/web/plugins-CaaolyMk.js +0 -562
  634. package/web/plugins-Cjgw5oWg.js +0 -562
  635. package/web/plugins-CzNtrVQB.js +0 -562
  636. package/web/plugins-DS0hIs2V.js +0 -563
  637. package/web/ref-BOnG19ns.js +0 -4040
  638. package/web/ref-BejJFG7m.js +0 -4040
  639. package/web/ref-DcRg7zo9.js +0 -4040
  640. package/web/ref-ZWPcLQB9.js +0 -4040
  641. package/web/solutions/adaptive-image/index.d.ts +0 -2
  642. package/web/solutions/cloud-image-editor/CloudImageEditor.d.ts +0 -11
  643. package/web/solutions/cloud-image-editor/index.d.ts +0 -5
  644. package/web/solutions/file-uploader/inline/FileUploaderInline.d.ts +0 -20
  645. package/web/solutions/file-uploader/inline/index.d.ts +0 -1
  646. package/web/solutions/file-uploader/minimal/FileUploaderMinimal.d.ts +0 -23
  647. package/web/solutions/file-uploader/minimal/index.d.ts +0 -1
  648. package/web/solutions/file-uploader/regular/FileUploaderRegular.d.ts +0 -17
  649. package/web/solutions/file-uploader/regular/index.d.ts +0 -1
  650. package/web/style-map-BmZdux7T.js +0 -37
  651. package/web/style-map-CZ6fSV6e.js +0 -37
  652. package/web/style-map-Dk7mLCrB.js +0 -37
  653. package/web/style-map-HkHnu9oA.js +0 -37
  654. package/web/style-map-tw1yUEaj.js +0 -37
  655. package/web/types/dom.d.ts +0 -1
  656. package/web/types/events.d.ts +0 -4
  657. package/web/types/exported.d.ts +0 -492
  658. package/web/types/index.d.ts +0 -5
  659. package/web/urlSourcePlugin-9lhcr02f.js +0 -8
  660. package/web/urlSourcePlugin-C-sLGhGb.js +0 -8
  661. package/web/urlSourcePlugin-DNXDpnRD.js +0 -8
  662. package/web/urlSourcePlugin-JnD0cnxb.js +0 -8
  663. package/web/urlSourcePlugin-hcMU2K6T.js +0 -8
  664. package/web/utils/UID.d.ts +0 -5
  665. package/web/utils/UID.test.d.ts +0 -1
  666. package/web/utils/UploadSource.d.ts +0 -37
  667. package/web/utils/WindowHeightTracker.d.ts +0 -9
  668. package/web/utils/abilities.d.ts +0 -1
  669. package/web/utils/applyStyles.d.ts +0 -1
  670. package/web/utils/browser-info.d.ts +0 -12
  671. package/web/utils/browser-info.test.d.ts +0 -1
  672. package/web/utils/cdn-utils.d.ts +0 -53
  673. package/web/utils/cdn-utils.test.d.ts +0 -1
  674. package/web/utils/comma-separated.d.ts +0 -2
  675. package/web/utils/debounce.d.ts +0 -3
  676. package/web/utils/delay.d.ts +0 -1
  677. package/web/utils/fileTypes.d.ts +0 -11
  678. package/web/utils/fileTypes.test.d.ts +0 -1
  679. package/web/utils/get-top-level-origin.d.ts +0 -1
  680. package/web/utils/get-top-level-origin.test.d.ts +0 -1
  681. package/web/utils/getLocaleDirection.d.ts +0 -1
  682. package/web/utils/getPluralForm.d.ts +0 -1
  683. package/web/utils/getPluralForm.test.d.ts +0 -1
  684. package/web/utils/isPromiseLike.d.ts +0 -1
  685. package/web/utils/isPromiseLike.test.d.ts +0 -1
  686. package/web/utils/isSecureTokenExpired.d.ts +0 -8
  687. package/web/utils/isSecureTokenExpired.test.d.ts +0 -1
  688. package/web/utils/memoize.d.ts +0 -1
  689. package/web/utils/memoize.test.d.ts +0 -1
  690. package/web/utils/mixinClass.d.ts +0 -8
  691. package/web/utils/parseCdnUrl.d.ts +0 -11
  692. package/web/utils/parseCdnUrl.test.d.ts +0 -1
  693. package/web/utils/parseShrink.d.ts +0 -7
  694. package/web/utils/parseShrink.test.d.ts +0 -1
  695. package/web/utils/preloadImage.d.ts +0 -10
  696. package/web/utils/prettyBytes.d.ts +0 -11
  697. package/web/utils/prettyBytes.test.d.ts +0 -1
  698. package/web/utils/resizeImage.d.ts +0 -1
  699. package/web/utils/stringToArray.d.ts +0 -1
  700. package/web/utils/stringToArray.test.d.ts +0 -1
  701. package/web/utils/template-utils.d.ts +0 -16
  702. package/web/utils/template-utils.test.d.ts +0 -1
  703. package/web/utils/throttle.d.ts +0 -3
  704. package/web/utils/toKebabCase.d.ts +0 -2
  705. package/web/utils/toKebabCase.test.d.ts +0 -1
  706. package/web/utils/transparentPixelSrc.d.ts +0 -1
  707. package/web/utils/uniqueArray.d.ts +0 -1
  708. package/web/utils/uniqueArray.test.d.ts +0 -1
  709. package/web/utils/userAgent.d.ts +0 -2
  710. package/web/utils/validators/collection/index.d.ts +0 -2
  711. package/web/utils/validators/collection/validateCollectionUploadError.d.ts +0 -2
  712. package/web/utils/validators/collection/validateMultiple.d.ts +0 -2
  713. package/web/utils/validators/file/index.d.ts +0 -4
  714. package/web/utils/validators/file/validateFileType.d.ts +0 -2
  715. package/web/utils/validators/file/validateIsImage.d.ts +0 -2
  716. package/web/utils/validators/file/validateMaxSizeLimit.d.ts +0 -2
  717. package/web/utils/validators/file/validateUploadError.d.ts +0 -2
  718. package/web/utils/warnOnce.d.ts +0 -1
  719. package/web/utils/wildcardRegexp.d.ts +0 -1
  720. package/web/utils/wildcardRegexp.test.d.ts +0 -1
  721. package/web/utils/withResolvers.d.ts +0 -5
  722. package/web/utils/withResolvers.test.d.ts +0 -1
@@ -1,1859 +1,8 @@
1
1
  /**
2
- * @license
3
- * Package: @uploadcare/file-uploader@1.28.0-alpha.1 (MIT)
4
- * License: https://github.com/uploadcare/blob/main/LICENSE
5
- * Built: 2026-03-02T20:26:14.841Z
6
- */
7
- import { $ as CancelError, At as __decorate, B as i, Bt as b, Ct as createOriginalUrl, Dt as defineLocale, Ft as LightDomMixin, G as applyTemplateData, H as LitBlock, It as CssDataMixin, J as EventType, K as PACKAGE_NAME, Lt as i$1, Mt as r, Nt as n, Ot as UID, Pt as RegisterableElementMixin, R as o, St as createCdnUrlModifiers, V as t, Vt as PubSub, Y as InternalEventType, Z as solutionBlockCtx, a as p, at as uploadFile, bt as stringToArray, c as Icon, i as h, jt as debounce, kt as SymbioteMixin, n as n$1, o as u, q as PACKAGE_VERSION, r as M, rt as UploadcareError, s as v, st as ModalEvents, t as e, xt as createCdnUrl, z as e$1, zt as E } from "./ref-BejJFG7m.js";
8
- import { c as UploadSource, m as defineComponents, s as ExternalUploadSource } from "./plugins-CaaolyMk.js";
9
- import { n as toKebabCase, t as Config } from "./Config-CJVNrrjj.js";
10
- import { n as LitActivityBlock, r as applyStyles, t as LitUploaderBlock } from "./LitUploaderBlock-Oi33U0uf.js";
11
- import { n as Select, t as CameraSource } from "./CameraSource-BvBJ5Uzy.js";
12
- import { n as Spinner, t as ExternalSource } from "./ExternalSource-BL5GSlol.js";
13
- import { b as preloadImage, x as TRANSPARENT_PIXEL_SRC, y as throttle } from "./CloudImageEditor-Drywn265.js";
14
- import { t as ActivityHeader } from "./ActivityHeader-i4x6_Fne.js";
15
- import { t as UrlSource } from "./UrlSource-DhI3YCt5.js";
16
- import "./style-map-CZ6fSV6e.js";
17
- import "./CloudImageEditorActivity-ur-hQ-6p.js";
18
- var BaseComponent = class extends RegisterableElementMixin(SymbioteMixin()(CssDataMixin(LightDomMixin(i$1)))) {};
19
- function loadFileUploaderFrom(g, B = !1) {
20
- return new Promise((V, H) => {
21
- if (typeof document != "object") {
22
- V(null);
23
- return;
24
- }
25
- if (typeof window == "object" && window.UC) {
26
- V(window.UC);
27
- return;
28
- }
29
- let U = document.createElement("script");
30
- U.async = !0, U.src = g, U.onerror = () => {
31
- H();
32
- }, U.onload = () => {
33
- let g = window.UC;
34
- B && defineComponents(g), V(g);
35
- }, document.head.appendChild(U);
36
- });
37
- }
38
- var svg_sprite_default = "<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 fill='none' viewBox='0 0 9 6' id='uc-icon-arrow-dropdown' xmlns='http://www.w3.org/2000/svg'><path stroke='currentColor' d='m1.5 1.667 3 2.666 3-2.666' opacity='.5'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-aspect-ratio' xmlns='http://www.w3.org/2000/svg'><path stroke='currentColor' d='M7.395 22.5H2.454v-5.25m14.824 5.25h4.94v-5.25m0-10.5V1.5h-4.94m-9.883 0H2.454v5.25'/></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 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 20 20' id='uc-icon-camera-full' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M2 4.667a2 2 0 0 0-2 2V16a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6.667a2 2 0 0 0-2-2h-2.667l-2-2.667H6.667l-2 2.667H2Zm8 10a3.667 3.667 0 1 0 0-7.334 3.667 3.667 0 0 0 0 7.334Z' fill='currentColor'/></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 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 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 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 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 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 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 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 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-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 24 24' id='uc-icon-microphone' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' clip-rule='evenodd' d='M7.5 4.781a4.5 4.5 0 0 1 9 0v6.469a4.5 4.5 0 1 1-9 0V4.781Zm4.5-3a3 3 0 0 0-3 3v6.469a3 3 0 1 0 6 0V4.781a3 3 0 0 0-3-3Zm-8.156 8.11a.75.75 0 0 1 .75.75 7.406 7.406 0 1 0 14.812 0 .75.75 0 0 1 1.5 0 8.907 8.907 0 0 1-8.156 8.875v2.703h3.258a.75.75 0 1 1 0 1.5H7.992a.75.75 0 0 1 0-1.5h3.258v-2.703a8.907 8.907 0 0 1-8.156-8.875.75.75 0 0 1 .75-.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-microphone-mute' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' clip-rule='evenodd' d='M7.5 4.781a4.5 4.5 0 0 1 9 0V6l3.524-3.524a.75.75 0 1 1 1.061 1.06L5.036 19.585a.75.75 0 0 1-1.06-1.06l1.656-1.657a8.88 8.88 0 0 1-2.538-6.227.75.75 0 0 1 1.5 0c0 2.009.8 3.83 2.1 5.166l1.771-1.772A4.483 4.483 0 0 1 7.5 11.25V4.781Zm2.037 8.182L15 7.5V4.781a3 3 0 1 0-6 0v6.469c0 .637.198 1.227.537 1.713Zm10.62-3.072a.75.75 0 0 1 .75.75 8.907 8.907 0 0 1-8.157 8.875v2.703h3.258a.75.75 0 1 1 0 1.5H7.992a.75.75 0 0 1 0-1.5h3.258v-2.703a8.855 8.855 0 0 1-3.035-.811.75.75 0 1 1 .638-1.358 7.406 7.406 0 0 0 10.553-6.707.75.75 0 0 1 .75-.75ZM15 10.81a.75.75 0 0 1 1.5 0v.439a4.5 4.5 0 0 1-5 4.473.75.75 0 1 1 .166-1.491A3 3 0 0 0 15 11.25v-.44Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-mobile-photo-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-mobile-video-camera' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' clip-rule='evenodd' d='M0 6.75a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v1.078L22.873 5A.75.75 0 0 1 24 5.648v12.704a.75.75 0 0 1-1.123.65L18 16.207v1.043a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V6.75Zm18 7.728 4.5 2.58V6.95L18 9.562v4.916ZM16.5 6.75a1.5 1.5 0 0 0-1.5-1.5H3a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h12a1.5 1.5 0 0 0 1.5-1.5V6.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-ngdrive' 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-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 fill='none' viewBox='0 0 10 10' id='uc-icon-pause' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' d='M1 0h2.5v10H1zM6.5 0H9v10H6.5z'/></symbol><symbol fill='none' viewBox='0 0 10 10' id='uc-icon-play' xmlns='http://www.w3.org/2000/svg'><path d='m1 0 9 5-9 5V0Z' fill='currentColor'/></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 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 fill='none' viewBox='0 0 20 20' id='uc-icon-square' xmlns='http://www.w3.org/2000/svg'><rect width='20' height='20' rx='4' fill='#fff'/></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 24 24' id='uc-icon-video-camera' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' clip-rule='evenodd' d='M0 6.75a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v1.078L22.873 5A.75.75 0 0 1 24 5.648v12.704a.75.75 0 0 1-1.123.65L18 16.207v1.043a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V6.75Zm18 7.728 4.5 2.58V6.95L18 9.562v4.916ZM16.5 6.75a1.5 1.5 0 0 0-1.5-1.5H3a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h12a1.5 1.5 0 0 0 1.5-1.5V6.75Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-video-camera-full' xmlns='http://www.w3.org/2000/svg'><path d='M2 3.333a2 2 0 0 0-2 2v9.334a2 2 0 0 0 2 2h10.938a2 2 0 0 0 2-2v-2.013L20 15.646V4.354l-5.063 3.03v-2.05a2 2 0 0 0-2-2H2Z' fill='currentColor'/></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></svg>", LitSolutionBlock = class extends LitBlock {
39
- constructor(...g) {
40
- super(...g), this.init$ = solutionBlockCtx(this);
41
- }
42
- static {
43
- this.styleAttrs = ["uc-wgt-common"];
44
- }
45
- initCallback() {
46
- super.initCallback(), this.a11y?.registerBlock(this), this.clipboardLayer?.registerBlock(this), this.sharedCtx.pub("*solution", this.tagName);
47
- }
48
- render() {
49
- return b`${o(svg_sprite_default)}`;
50
- }
51
- };
52
- const uniqueArray = (g) => [...new Set(g)], CSS_PREF = "--uc-img-", UNRESOLVED_ATTR = "unresolved", DEV_MODE = !window.location.host.trim() || window.location.host.includes(":") || window.location.hostname.includes("localhost"), ImgTypeEnum = Object.freeze({
53
- PREVIEW: "PREVIEW",
54
- MAIN: "MAIN"
55
- });
56
- var DEFAULT_CDN_BASE = "https://ucarecdn.com";
57
- const PROPS_MAP = Object.freeze({
58
- "dev-mode": {},
59
- pubkey: {},
60
- uuid: {},
61
- src: {},
62
- lazy: { default: 1 },
63
- intersection: {},
64
- breakpoints: {},
65
- "cdn-cname": { default: DEFAULT_CDN_BASE },
66
- "proxy-cname": {},
67
- "secure-delivery-proxy": {},
68
- "hi-res-support": { default: 1 },
69
- "ultra-res-support": {},
70
- format: {},
71
- "cdn-operations": {},
72
- progressive: {},
73
- quality: {},
74
- "is-background-for": {},
75
- "is-preview-blur": { default: 1 }
76
- });
77
- var ImgConfig = class extends CssDataMixin(RegisterableElementMixin(i$1)) {
78
- createRenderRoot() {
79
- return this;
80
- }
81
- constructor() {
82
- for (let g in super(), this._state = {}, this._subscribers = /* @__PURE__ */ new Map(), this._isnObserver = null, this._observed = null, PROPS_MAP) {
83
- let B = PROPS_MAP[g];
84
- this._state[CSS_PREF + g] = B?.default || "";
85
- }
86
- }
87
- $$(g) {
88
- return this._state[CSS_PREF + g];
89
- }
90
- set$$(g) {
91
- for (let B in g) {
92
- let V = CSS_PREF + B, H = g[B];
93
- this._state[V] = H, this._notify(V, H);
94
- }
95
- }
96
- sub$$(g, B) {
97
- let V = CSS_PREF + g;
98
- this._subscribers.has(V) || this._subscribers.set(V, /* @__PURE__ */ new Set()), this._subscribers.get(V)?.add(B);
99
- let H = this._state[V];
100
- H !== null && H !== "" && B(H);
101
- }
102
- _notify(g, B) {
103
- this._subscribers.has(g) && this._subscribers.get(g)?.forEach((g) => {
104
- B === null || B === "" || g(B);
105
- });
106
- }
107
- analyticsParams() {
108
- return `-/@clib/${PACKAGE_NAME}/${PACKAGE_VERSION}/uc-img/`;
109
- }
110
- initAttributes(g) {
111
- Array.from(this.attributes).forEach((B) => {
112
- let V = B;
113
- PROPS_MAP[V.name] || g.setAttribute(V.name, V.value);
114
- });
115
- }
116
- initIntersection(g, B) {
117
- this._isnObserver = new IntersectionObserver((V) => {
118
- V.forEach((V) => {
119
- V.isIntersecting && (B(), this._isnObserver?.unobserve(g));
120
- });
121
- }, {
122
- root: null,
123
- rootMargin: "0px"
124
- }), this._isnObserver.observe(g), this._observed ||= /* @__PURE__ */ new Set(), this._observed.add(g);
125
- }
126
- connectedCallback() {
127
- super.connectedCallback(), this._initCssProperties();
128
- }
129
- _initCssProperties() {
130
- for (let g in PROPS_MAP) {
131
- let B = CSS_PREF + g, V = this.getCssData(B, !0);
132
- V != null && (this._state[B] = V);
133
- }
134
- }
135
- disconnectedCallback() {
136
- super.disconnectedCallback(), this._isnObserver &&= (this._observed?.forEach((g) => {
137
- this._isnObserver?.unobserve(g);
138
- }), null), this._subscribers.clear();
139
- }
140
- static get observedAttributes() {
141
- return Object.keys(PROPS_MAP);
142
- }
143
- attributeChangedCallback(g, B, V) {
144
- window.setTimeout(() => {
145
- let B = CSS_PREF + g;
146
- this._state[B] = V, this._notify(B, V);
147
- });
148
- }
149
- };
150
- const parseObjectToString = (g) => Object.entries(g).filter(([g, B]) => B !== void 0 && B !== "").map(([g, B]) => g === "cdn-operations" || g === "analytics" ? B : `${g}/${B}`);
151
- var ImgBase = class extends ImgConfig {
152
- constructor(...g) {
153
- super(...g), this._img = new Image(), this._imgPreview = new Image();
154
- }
155
- _fmtAbs(g) {
156
- return !g.includes("//") && !DEV_MODE && (g = new URL(g, document.baseURI).href), g;
157
- }
158
- _validateSize(g) {
159
- if (!g) return;
160
- let B = g, V = B.match(/\d+/)?.[0], H = B.match(/[a-zA-Z]+/)?.[0];
161
- if (!V || !H) return;
162
- let U = parseInt(V, 10);
163
- return Number(U) > 5e3 && this._hasFormatJPG ? 5e3 + H : Number(U) > 3e3 && !this._hasFormatJPG ? 3e3 + H : g;
164
- }
165
- _getCdnModifiers(g, B) {
166
- return createCdnUrlModifiers(...parseObjectToString({
167
- format: this._getTypedCssValue("format"),
168
- quality: this._getTypedCssValue("quality"),
169
- resize: this._validateSize(g),
170
- blur: B,
171
- "cdn-operations": this._getTypedCssValue("cdn-operations") ?? void 0,
172
- analytics: this.analyticsParams()
173
- }));
174
- }
175
- _getTypedCssValue(g) {
176
- let B = this.$$(g);
177
- if (B == null || typeof B == "string" || typeof B == "number" || typeof B == "boolean") return B;
178
- }
179
- _getUrlBase(g = "", B = "") {
180
- let V = this.$$("src");
181
- if (V.startsWith("data:") || V.startsWith("blob:")) return V;
182
- if (DEV_MODE && V && !V.includes("//")) return this._proxyUrl(V);
183
- let H = this._getCdnModifiers(g, B), W = this.$$("cdn-cname"), G = W;
184
- if (V.startsWith(String(W))) return createCdnUrl(V, H);
185
- let K = this.$$("uuid");
186
- if (G && K || K) return this._proxyUrl(createCdnUrl(createOriginalUrl(G, K), H));
187
- let q = this.$$("proxy-cname");
188
- if (q) return this._proxyUrl(createCdnUrl(q, H, this._fmtAbs(V)));
189
- let J = this.$$("pubkey");
190
- if (J) return this._proxyUrl(createCdnUrl(`https://${J}.ucr.io/`, H, this._fmtAbs(V)));
191
- }
192
- _proxyUrl(g) {
193
- let B = this.$$("secure-delivery-proxy");
194
- return B ? applyTemplateData(B, { previewUrl: g }, { transform: (g) => window.encodeURIComponent(g) }) : g;
195
- }
196
- _getElSize(g, B = 1, V = !0) {
197
- let H = g.getBoundingClientRect(), U = B * Math.round(H.width), W = V ? "" : B * Math.round(H.height);
198
- return U || W ? `${U || ""}x${W || ""}` : null;
199
- }
200
- _setupEventProxy(g) {
201
- let B = (g) => {
202
- g.stopPropagation();
203
- let B = new Event(g.type, g);
204
- this.dispatchEvent(B);
205
- };
206
- for (let V of ["load", "error"]) g.addEventListener(V, B);
207
- }
208
- get img() {
209
- return this._hasPreviewImage || (this._setupConfigForImage({ elNode: this._img }), this.appendChild(this._img)), this._img;
210
- }
211
- get _currentImg() {
212
- return this._hasPreviewImage ? {
213
- type: ImgTypeEnum.PREVIEW,
214
- img: this._imgPreview
215
- } : {
216
- type: ImgTypeEnum.MAIN,
217
- img: this.img
218
- };
219
- }
220
- get _hasPreviewImage() {
221
- return this.$$("is-preview-blur");
222
- }
223
- get _bgSelector() {
224
- return this.$$("is-background-for");
225
- }
226
- get _breakpoints() {
227
- let g = this.$$("breakpoints");
228
- return g ? uniqueArray(stringToArray(g).map((g) => parseInt(g, 10))) : null;
229
- }
230
- get _hasFormatJPG() {
231
- return this.$$("format").toLowerCase() === "jpeg";
232
- }
233
- _renderBg(g) {
234
- let B = /* @__PURE__ */ new Set();
235
- B.add(`url("${this._getUrlBase(this._getElSize(g))}") 1x`), this.$$("hi-res-support") && B.add(`url("${this._getUrlBase(this._getElSize(g, 2))}") 2x`), this.$$("ultra-res-support") && B.add(`url("${this._getUrlBase(this._getElSize(g, 3))}") 3x`);
236
- let V = `image-set(${[...B].join(", ")})`;
237
- g.style.setProperty("background-image", V), g.style.setProperty("background-image", `-webkit-${V}`);
238
- }
239
- _getSrcset() {
240
- let g = /* @__PURE__ */ new Set();
241
- return this._breakpoints ? this._breakpoints.forEach((B) => {
242
- g.add(`${this._getUrlBase(`${B}x`)} ${this._validateSize(`${B}w`)}`), this.$$("hi-res-support") && g.add(`${this._getUrlBase(`${B * 2}x`)} ${this._validateSize(`${B * 2}w`)}`), this.$$("ultra-res-support") && g.add(`${this._getUrlBase(`${B * 3}x`)} ${this._validateSize(`${B * 3}w`)}`);
243
- }) : (g.add(`${this._getUrlBase(this._getElSize(this._currentImg.img))} 1x`), this.$$("hi-res-support") && g.add(`${this._getUrlBase(this._getElSize(this._currentImg.img, 2))} 2x`), this.$$("ultra-res-support") && g.add(`${this._getUrlBase(this._getElSize(this._currentImg.img, 3))} 3x`)), [...g].join();
244
- }
245
- _getSrc() {
246
- return this._getUrlBase();
247
- }
248
- get _srcUrlPreview() {
249
- return this._getUrlBase("100x", "100");
250
- }
251
- _renderBackground() {
252
- let g = this._bgSelector;
253
- [...document.querySelectorAll(g)].forEach((g) => {
254
- this.$$("intersection") ? this.initIntersection(g, () => {
255
- this._renderBg(g);
256
- }) : this._renderBg(g);
257
- });
258
- }
259
- _appendURL({ elNode: g, src: B, srcset: V }) {
260
- B && (g.src = B), V && (g.srcset = V);
261
- }
262
- _setupConfigForImage({ elNode: g }) {
263
- this._setupEventProxy(g), this.initAttributes(g);
264
- }
265
- _loaderImage({ src: g, srcset: B, elNode: V }) {
266
- return new Promise((H, U) => {
267
- this._setupConfigForImage({ elNode: V }), V.setAttribute(UNRESOLVED_ATTR, ""), V.addEventListener("load", () => {
268
- V.removeAttribute(UNRESOLVED_ATTR), H(V);
269
- }), V.addEventListener("error", () => {
270
- U(!1);
271
- }), this._appendURL({
272
- elNode: V,
273
- src: g,
274
- srcset: B
275
- });
276
- });
277
- }
278
- async _renderImage() {
279
- if (this.$$("intersection")) {
280
- this._hasPreviewImage && (this._setupConfigForImage({ elNode: this._imgPreview }), this.appendChild(this._imgPreview)), this.initIntersection(this._currentImg.img, async () => {
281
- this._hasPreviewImage && (this._imgPreview.src = this._srcUrlPreview);
282
- try {
283
- await this._loaderImage({
284
- src: this._getSrc(),
285
- srcset: this._getSrcset(),
286
- elNode: this._img
287
- }), this._hasPreviewImage && await this._imgPreview.remove(), this.appendChild(this._img);
288
- } catch {
289
- this._hasPreviewImage && await this._imgPreview?.remove(), this.appendChild(this._img);
290
- }
291
- });
292
- return;
293
- }
294
- try {
295
- this._hasPreviewImage && (await this._loaderImage({
296
- src: this._srcUrlPreview,
297
- elNode: this._imgPreview
298
- }), this.appendChild(this._imgPreview)), await this._loaderImage({
299
- src: this._getSrc(),
300
- srcset: this._getSrcset(),
301
- elNode: this._img
302
- }), this._hasPreviewImage && await this._imgPreview?.remove(), this.appendChild(this._img);
303
- } catch {
304
- this._hasPreviewImage && await this._imgPreview?.remove(), this.appendChild(this._img);
305
- }
306
- }
307
- init() {
308
- this._bgSelector ? this._renderBackground() : this._renderImage();
309
- }
310
- }, Img = class extends ImgBase {
311
- connectedCallback() {
312
- super.connectedCallback(), this.sub$$("src", () => {
313
- this.init();
314
- }), this.sub$$("uuid", () => {
315
- this.init();
316
- }), this.sub$$("lazy", (g) => {
317
- !this.$$("is-background-for") && !this.$$("is-preview-blur") && (this.img.loading = g ? "lazy" : "eager");
318
- });
319
- }
320
- }, LAST_ACTIVE_MODAL_ID = null, Modal = class extends LitBlock {
321
- constructor(...g) {
322
- super(...g), this.dialogEl = e(), this.strokes = !1, this.blockBodyScrolling = !1, this.closeDialog = () => {
323
- this.modalManager?.close(this.id), this.modalManager?.hasActiveModals || (document.body.style.overflow = "", this.$["*currentActivity"] = null);
324
- }, this._handleDialogClose = () => {
325
- this.closeDialog();
326
- }, this._handleDialogMouseDown = (g) => {
327
- this._mouseDownTarget = g.target;
328
- }, this._handleDialogMouseUp = (g) => {
329
- let B = g.target;
330
- B === this.dialogEl.value && B === this._mouseDownTarget && this.closeDialog();
331
- }, this._handleModalOpen = ({ id: g }) => {
332
- g === this.id ? (LAST_ACTIVE_MODAL_ID = g, this.show(), this.emit(EventType.MODAL_OPEN, { modalId: g }, { debounce: !0 })) : this.hide();
333
- }, this._handleModalClose = ({ id: g }) => {
334
- g === this.id && (this.hide(), this.emit(EventType.MODAL_CLOSE, {
335
- modalId: g,
336
- hasActiveModals: this.modalManager?.hasActiveModals
337
- }, { debounce: !0 }));
338
- }, this._handleModalCloseAll = (g) => {
339
- this.hide(), LAST_ACTIVE_MODAL_ID === this.id && this.emit(EventType.MODAL_CLOSE, {
340
- modalId: LAST_ACTIVE_MODAL_ID,
341
- hasActiveModals: this.modalManager?.hasActiveModals
342
- }, { debounce: !0 });
343
- };
344
- }
345
- static {
346
- this.styleAttrs = [...super.styleAttrs, "uc-modal"];
347
- }
348
- show() {
349
- let g = this.dialogEl.value;
350
- typeof g.showModal == "function" ? (this.setAttribute("aria-modal", "true"), g.showModal()) : g.setAttribute("open", ""), this.cfg.modalScrollLock && (document.body.style.overflow = "hidden");
351
- }
352
- hide() {
353
- let g = this.dialogEl.value;
354
- g && (typeof g.close == "function" ? (this.setAttribute("aria-modal", "false"), g.close()) : g.removeAttribute("open"));
355
- }
356
- initCallback() {
357
- super.initCallback(), this.modalManager?.registerModal(this.id, this), this.subConfigValue("modalBackdropStrokes", (g) => {
358
- g ? this.setAttribute("strokes", "") : this.removeAttribute("strokes");
359
- }), this.modalManager?.subscribe(ModalEvents.OPEN, this._handleModalOpen), this.modalManager?.subscribe(ModalEvents.CLOSE, this._handleModalClose), this.modalManager?.subscribe(ModalEvents.CLOSE_ALL, this._handleModalCloseAll);
360
- }
361
- disconnectedCallback() {
362
- super.disconnectedCallback(), document.body.style.overflow = "", this._mouseDownTarget = void 0, this.modalManager?.unsubscribe(ModalEvents.OPEN, this._handleModalOpen), this.modalManager?.unsubscribe(ModalEvents.CLOSE, this._handleModalClose), this.modalManager?.unsubscribe(ModalEvents.CLOSE_ALL, this._handleModalCloseAll);
363
- }
364
- _handleDialogRef(g) {
365
- this.dialogEl = { value: g }, this.dialogEl.value?.addEventListener("close", this._handleDialogClose), this.dialogEl.value?.addEventListener("mousedown", this._handleDialogMouseDown), this.dialogEl.value?.addEventListener("mouseup", this._handleDialogMouseUp);
366
- }
367
- render() {
368
- return b`
369
- <dialog ${n$1(this._handleDialogRef)}>
370
- ${this.yield("")}
371
- </dialog>
372
- `;
373
- }
374
- };
375
- __decorate([n({
376
- type: Boolean,
377
- noAccessor: !0
378
- })], Modal.prototype, "strokes", void 0), __decorate([n({
379
- type: Boolean,
380
- attribute: "block-body-scrolling",
381
- noAccessor: !0
382
- })], Modal.prototype, "blockBodyScrolling", void 0);
383
- var FormInput = class extends LitUploaderBlock {
384
- constructor(...g) {
385
- super(...g), this._validationInputElement = null, this._dynamicInputsContainer = null;
386
- }
387
- get _inputName() {
388
- return this.nameAttrValue ?? this.ctxName;
389
- }
390
- _createValidationInput() {
391
- let g = document.createElement("input");
392
- return g.type = "text", g.name = this._inputName, g.required = this.cfg.multipleMin > 0, g.tabIndex = -1, applyStyles(g, {
393
- opacity: 0,
394
- height: 0,
395
- width: 0
396
- }), g;
397
- }
398
- initCallback() {
399
- super.initCallback(), this._validationInputElement = this._createValidationInput(), this.appendChild(this._validationInputElement), this.sub("*collectionState", (g) => {
400
- if (!g) return;
401
- if (!this._dynamicInputsContainer) {
402
- let g = document.createElement("div");
403
- this.appendChild(g), this._dynamicInputsContainer = g;
404
- }
405
- if (!this._validationInputElement) {
406
- let g = this._createValidationInput();
407
- this.appendChild(g), this._validationInputElement = g;
408
- }
409
- if (this._dynamicInputsContainer.innerHTML = "", g.status === "uploading" || g.status === "idle") {
410
- this._validationInputElement.value = "", this._validationInputElement.setCustomValidity("");
411
- return;
412
- }
413
- if (g.status === "failed") {
414
- let B = g.errors[0]?.message;
415
- this._validationInputElement.value = "", this._validationInputElement.setCustomValidity(B ?? "");
416
- return;
417
- }
418
- let B = g.group ? g.group : null;
419
- if (B) {
420
- this._validationInputElement.value = B.cdnUrl ?? "", this._validationInputElement.setCustomValidity("");
421
- return;
422
- }
423
- let V = g.allEntries.map((g) => g.cdnUrl).filter((g) => typeof g == "string");
424
- if (!this.cfg.multiple && V.length === 1 && V[0]) {
425
- this._validationInputElement.value = V[0], this._validationInputElement.setCustomValidity("");
426
- return;
427
- }
428
- this._validationInputElement.remove(), this._validationInputElement = null;
429
- let H = new DocumentFragment();
430
- for (let g of V) {
431
- let B = document.createElement("input");
432
- B.type = "hidden", B.name = `${this._inputName}[]`, B.value = g, H.appendChild(B);
433
- }
434
- this._dynamicInputsContainer.replaceChildren(H);
435
- }, !1);
436
- }
437
- };
438
- __decorate([n({
439
- type: String,
440
- noAccessor: !0,
441
- attribute: "name"
442
- })], FormInput.prototype, "nameAttrValue", void 0);
443
- var Copyright = class extends LitBlock {
444
- initCallback() {
445
- super.initCallback(), this.subConfigValue("removeCopyright", (g) => {
446
- this.toggleAttribute("hidden", !!g);
447
- });
448
- }
449
- render() {
450
- return b`
451
- <a
452
- href="https://uploadcare.com/?utm_source=copyright&amp;utm_medium=referral&amp;utm_campaign=v4"
453
- target="_blank noopener"
454
- class="uc-credits"
455
- >Powered by Uploadcare</a
456
- >
457
- `;
458
- }
459
- }, ProgressBar = class extends LitBlock {
460
- constructor(...g) {
461
- super(...g), this.hasFileName = !1, this.value = 0, this.visible = !0, this._progressValue = 0, this._fakeProgressLineRef = e(), this._handleFakeProgressAnimation = () => {
462
- let g = this._fakeProgressLineRef.value;
463
- if (g) {
464
- if (!this.visible) {
465
- g.classList.add("uc-fake-progress--hidden");
466
- return;
467
- }
468
- this._progressValue > 0 && g.classList.add("uc-fake-progress--hidden");
469
- }
470
- };
471
- }
472
- firstUpdated(g) {
473
- super.firstUpdated(g), this._progressValue = this._normalizeProgressValue(this.value), this._updateProgressValueStyle(), this._fakeProgressLineRef.value?.addEventListener("animationiteration", this._handleFakeProgressAnimation);
474
- }
475
- updated(g) {
476
- if (super.updated(g), g.has("value")) {
477
- let g = this._normalizeProgressValue(this.value);
478
- if (!this.visible) this._progressValue = g;
479
- else {
480
- let B = Math.max(this._progressValue, g);
481
- B !== this._progressValue && (this._progressValue = B, this._updateProgressValueStyle());
482
- }
483
- }
484
- g.has("visible") && (this.classList.toggle("uc-progress-bar--hidden", !this.visible), this.visible ? this._updateProgressValueStyle() : this._progressValue = this._normalizeProgressValue(this.value));
485
- }
486
- disconnectedCallback() {
487
- super.disconnectedCallback(), this._fakeProgressLineRef.value?.removeEventListener("animationiteration", this._handleFakeProgressAnimation);
488
- }
489
- _normalizeProgressValue(g) {
490
- return Number.isFinite(g) ? Math.min(100, Math.max(0, g)) : 0;
491
- }
492
- _updateProgressValueStyle() {
493
- this.visible && this.style.setProperty("--l-progress-value", this._progressValue.toString());
494
- }
495
- render() {
496
- return b`
497
- <div ${n$1(this._fakeProgressLineRef)} class="uc-fake-progress"></div>
498
- <div class="uc-progress"></div>
499
- `;
500
- }
501
- };
502
- __decorate([n({
503
- type: Boolean,
504
- noAccessor: !0
505
- })], ProgressBar.prototype, "hasFileName", void 0), __decorate([n({ type: Number })], ProgressBar.prototype, "value", void 0), __decorate([n({
506
- type: Boolean,
507
- reflect: !0
508
- })], ProgressBar.prototype, "visible", void 0);
509
- var ProgressBarCommon = class extends LitUploaderBlock {
510
- constructor() {
511
- super(), this._visible = !1, this._value = 0, this.init$ = {
512
- ...this.init$,
513
- "*commonProgress": 0
514
- };
515
- }
516
- initCallback() {
517
- super.initCallback(), this._unobserveCollectionCb = this.uploadCollection.observeProperties(() => {
518
- this._visible = this.uploadCollection.items().some((g) => this.uploadCollection.read(g)?.getValue("isUploading") ?? !1);
519
- }), this.sub("*commonProgress", (g) => {
520
- this._value = g;
521
- });
522
- }
523
- updated(g) {
524
- super.updated(g), g.has("visible") && (this._visible ? this.setAttribute("active", "") : this.removeAttribute("active"));
525
- }
526
- disconnectedCallback() {
527
- super.disconnectedCallback(), this._unobserveCollectionCb?.(), this._unobserveCollectionCb = void 0;
528
- }
529
- render() {
530
- return b` <uc-progress-bar .value=${this._value} .visible=${this._visible}></uc-progress-bar> `;
531
- }
532
- };
533
- __decorate([r()], ProgressBarCommon.prototype, "_visible", void 0), __decorate([r()], ProgressBarCommon.prototype, "_value", void 0);
534
- var SourceBtn = class extends LitUploaderBlock {
535
- constructor(...g) {
536
- super(...g), this.couldBeCtxOwner = !0, this._iconName = "default", this._srcTypeKey = "";
537
- }
538
- willUpdate(g) {
539
- super.willUpdate(g), g.has("source") && this._applySource(this.source);
540
- }
541
- _applySource(g) {
542
- if (!g) {
543
- this._srcTypeKey = "", this._iconName = "default";
544
- return;
545
- }
546
- let { label: B, icon: V, id: H } = g;
547
- this._srcTypeKey = B, this._iconName = V ?? H ?? "default";
548
- }
549
- activate() {
550
- this.source && this.source.onClick();
551
- }
552
- render() {
553
- return b`
554
- <button type="button" @click=${this.activate}>
555
- <uc-icon name=${this._iconName}></uc-icon>
556
- <div class="uc-txt">${this.l10n(this._srcTypeKey)}</div>
557
- </button>
558
- `;
559
- }
560
- };
561
- __decorate([n({ attribute: !1 })], SourceBtn.prototype, "source", void 0), __decorate([r()], SourceBtn.prototype, "_iconName", void 0), __decorate([r()], SourceBtn.prototype, "_srcTypeKey", void 0);
562
- var SourceList = class extends LitUploaderBlock {
563
- constructor(...g) {
564
- super(...g), this._rawSourceList = [], this._sources = [], this.wrap = !1;
565
- }
566
- initCallback() {
567
- super.initCallback(), this.subConfigValue("sourceList", (g) => {
568
- this._rawSourceList = stringToArray(g), this._updateSources();
569
- });
570
- let g = this._sharedInstancesBag.pluginManager;
571
- g?.onPluginsChange && (this._unsubscribePlugins = g.onPluginsChange(() => this._updateSources()));
572
- }
573
- updated(g) {
574
- super.updated(g), this.cfg.sourceListWrap ? this.style.removeProperty("display") : this.style.display = "contents";
575
- }
576
- _updateSources() {
577
- let g = this._sharedInstancesBag.pluginManager?.snapshot().sources ?? [], B = new Map(g.map((g) => [g.id, g])), V = [];
578
- this._rawSourceList.forEach((g) => {
579
- let H = this._expandSource(g, B);
580
- if (H.length !== 1 || H[0] !== g) {
581
- for (let g of H) {
582
- let H = this._makeBuiltInSourceConfig(g);
583
- if (H) {
584
- V.push(H);
585
- continue;
586
- }
587
- let U = B.get(g);
588
- U && V.push(this._makePluginSourceConfig(U));
589
- }
590
- return;
591
- }
592
- let U = this._makeBuiltInSourceConfig(g);
593
- if (U) {
594
- V.push(U);
595
- return;
596
- }
597
- let W = B.get(g);
598
- W && V.push(this._makePluginSourceConfig(W));
599
- }), this._sources = V;
600
- }
601
- _expandSource(g, B) {
602
- let V = B.get(g);
603
- return V?.expand ? V.expand() : [g];
604
- }
605
- _makeBuiltInSourceConfig(g) {
606
- switch (g) {
607
- case UploadSource.LOCAL: return {
608
- id: g,
609
- label: `src-type-${g}`,
610
- icon: g,
611
- onClick: () => this.api.openSystemDialog()
612
- };
613
- default: break;
614
- }
615
- return null;
616
- }
617
- _makePluginSourceConfig(g) {
618
- return {
619
- id: g.id,
620
- label: g.label,
621
- icon: g.icon,
622
- onClick: () => g.onSelect()
623
- };
624
- }
625
- render() {
626
- return b`${this._sources.map((g) => b`<uc-source-btn role="listitem" .source=${g} data-source-id=${g.id}></uc-source-btn>`)}`;
627
- }
628
- disconnectedCallback() {
629
- this._unsubscribePlugins?.(), this._unsubscribePlugins = void 0, super.disconnectedCallback();
630
- }
631
- };
632
- __decorate([r()], SourceList.prototype, "_sources", void 0), __decorate([n({
633
- type: Boolean,
634
- attribute: "wrap",
635
- noAccessor: !0
636
- })], SourceList.prototype, "wrap", void 0);
637
- function generateThumb(g, B = 40) {
638
- if (g.type === "image/svg+xml") return URL.createObjectURL(g);
639
- let V = document.createElement("canvas"), H = V.getContext("2d");
640
- if (!H) return Promise.reject(/* @__PURE__ */ Error("Canvas context not supported"));
641
- let U = new Image(), W = new Promise((g, W) => {
642
- U.onload = () => {
643
- let G = U.height / U.width;
644
- G > 1 ? (V.width = B, V.height = B * G) : (V.height = B, V.width = B / G), H.fillStyle = "rgb(240, 240, 240)", H.fillRect(0, 0, V.width, V.height), H.drawImage(U, 0, 0, V.width, V.height), V.toBlob((B) => {
645
- if (!B) {
646
- W();
647
- return;
648
- }
649
- g(URL.createObjectURL(B));
650
- });
651
- }, U.onerror = (g) => {
652
- W(g);
653
- };
654
- });
655
- return U.src = URL.createObjectURL(g), W;
656
- }
657
- var FileItemConfig = class extends LitUploaderBlock {
658
- constructor(...g) {
659
- super(...g), this._entrySubs = /* @__PURE__ */ new Set(), this.entry = null;
660
- }
661
- withEntry(g) {
662
- return (...B) => {
663
- let V = this.entry;
664
- if (!V) {
665
- console.warn("No entry found");
666
- return;
667
- }
668
- return g(V, ...B);
669
- };
670
- }
671
- subEntry(g, B) {
672
- this.withEntry((g, B, V) => {
673
- let H = g.subscribe(B, (g) => {
674
- this.isConnected && V(g);
675
- });
676
- this._entrySubs.add(H);
677
- })(g, B);
678
- }
679
- reset() {
680
- for (let g of this._entrySubs) g();
681
- this._entrySubs = /* @__PURE__ */ new Set(), this.entry = null;
682
- }
683
- disconnectedCallback() {
684
- super.disconnectedCallback(), this._entrySubs = /* @__PURE__ */ new Set();
685
- }
686
- };
687
- function createSvgBlobUrl(g) {
688
- let B = new Blob([g], { type: "image/svg+xml" });
689
- return URL.createObjectURL(B);
690
- }
691
- function fileCssBg(g = "hsl(209, 21%, 65%)", B = 32, V = 32) {
692
- return createSvgBlobUrl(`
693
- <svg width="${B}" height="${V}" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
694
- <path fill-rule="evenodd" fill="${g}" 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"/>
695
- </svg>
696
- `);
697
- }
698
- var CDN_MAX_OUTPUT_DIMENSION = 3e3, Thumb = class extends FileItemConfig {
699
- constructor(...g) {
700
- super(...g), this.badgeIcon = "", this.uid = "", this._thumbUrl = "", this._renderedGridOnce = !1, this._thumbRect = null, this._isIntersecting = !1, this._firstViewMode = this.cfg.filesViewMode, this._generateThumbnail = this.withEntry(async (g, B = !1) => {
701
- let V = g.getValue("fileInfo"), H = g.getValue("isImage"), W = g.getValue("uuid"), G = g.getValue("thumbUrl"), K = this._calculateThumbSize(B);
702
- if (V && H && W) {
703
- let B = await this.proxyUrl(createCdnUrl(createOriginalUrl(this.cfg.cdnCname, W), createCdnUrlModifiers(g.getValue("cdnUrlModifiers"), "stretch/off", `scale_crop/${K}x${K}/center`)));
704
- if (G === B) return;
705
- let { promise: V } = preloadImage(B);
706
- V.then(() => {
707
- g.setValue("thumbUrl", B), G?.startsWith("blob:") && URL.revokeObjectURL(G);
708
- }).catch(async () => {
709
- if (!G?.startsWith("blob:")) try {
710
- let B = g.getValue("file");
711
- if (!B) return;
712
- let V = await generateThumb(B, K);
713
- g.setValue("thumbUrl", V);
714
- } catch (B) {
715
- this.telemetryManager.sendEventError(B, "thumbnail generation. Failed to generate thumb from file");
716
- let V = window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");
717
- g.setValue("thumbUrl", fileCssBg(V));
718
- }
719
- });
720
- return;
721
- }
722
- if (g.getValue("thumbUrl")) return;
723
- let q = g.getValue("file");
724
- if (q?.type.includes("image")) try {
725
- let B = await generateThumb(q, K);
726
- g.setValue("thumbUrl", B);
727
- } catch (B) {
728
- this.telemetryManager.sendEventError(B, "thumbnail generation. Failed to generate thumb from file");
729
- let V = window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");
730
- g.setValue("thumbUrl", fileCssBg(V));
731
- }
732
- else {
733
- let B = window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");
734
- g.setValue("thumbUrl", fileCssBg(B));
735
- }
736
- }), this._debouncedGenerateThumb = debounce(this._generateThumbnail.bind(this), 100);
737
- }
738
- _calculateThumbSize(g = !1) {
739
- g && (this._thumbRect = this.getBoundingClientRect());
740
- let B = Math.max(parseInt(String(this?._thumbRect?.height || 0), 10), parseInt(String(this?._thumbRect?.width || 0), 10), this.cfg.thumbSize);
741
- return window.devicePixelRatio > 1 && (B *= window.devicePixelRatio), Math.min(B, CDN_MAX_OUTPUT_DIMENSION);
742
- }
743
- _decodeImage(g, B) {
744
- return new Promise((V, H) => {
745
- let U = new Image();
746
- U.decoding = "async";
747
- let W = () => {
748
- U &&= (U.onload = null, U.onerror = null, U.src = TRANSPARENT_PIXEL_SRC, B?.removeEventListener("abort", G), null);
749
- }, G = () => {
750
- W(), H(new DOMException("Aborted", "AbortError"));
751
- };
752
- if (B) {
753
- if (B.aborted) {
754
- G();
755
- return;
756
- }
757
- B.addEventListener("abort", G, { once: !0 });
758
- }
759
- let K = () => {
760
- W(), V();
761
- }, q = (g) => {
762
- W(), H(g);
763
- };
764
- if (typeof U.decode == "function") {
765
- U.src = g, U.decode().then(K).catch(q);
766
- return;
767
- }
768
- U.onload = K, U.onerror = q, U.src = g;
769
- });
770
- }
771
- _cancelPendingThumbUpdate() {
772
- this._pendingThumbUpdate?.cancel(), this._pendingThumbUpdate = void 0;
773
- }
774
- _scheduleThumbUpdate(g) {
775
- if (this._cancelPendingThumbUpdate(), !g) {
776
- this._thumbUrl &&= "";
777
- return;
778
- }
779
- if (g === this._thumbUrl) return;
780
- let B = new AbortController(), V = {
781
- controller: B,
782
- cancel: () => {
783
- B.abort(), V.rafId !== void 0 && window.cancelAnimationFrame(V.rafId);
784
- }
785
- };
786
- this._pendingThumbUpdate = V, this._decodeImage(g, B.signal).then(() => {
787
- B.signal.aborted || (V.rafId = window.requestAnimationFrame(() => {
788
- B.signal.aborted || (this._thumbUrl = g);
789
- }));
790
- }).catch((g) => {
791
- B.signal.aborted || g instanceof DOMException && g.name === "AbortError" || console.warn("[Thumb] Failed to decode thumbnail image", g);
792
- });
793
- }
794
- _requestThumbGeneration(g = !1) {
795
- if (this.entry) {
796
- if (g) {
797
- this._generateThumbnail(!0);
798
- return;
799
- }
800
- this._isIntersecting && this._debouncedGenerateThumb();
801
- }
802
- }
803
- firstUpdated(g) {
804
- super.firstUpdated(g), this._bindToEntry();
805
- }
806
- updated(g) {
807
- super.updated(g), g.has("uid") && this._bindToEntry();
808
- }
809
- _observerCallback(g) {
810
- let [B] = g;
811
- B && (this._isIntersecting = B.isIntersecting, B.isIntersecting && (this._thumbRect = B.boundingClientRect, this._requestThumbGeneration(), this._observer?.disconnect()), B.intersectionRatio === 0 && this._debouncedGenerateThumb.cancel());
812
- }
813
- reset() {
814
- super.reset(), this._debouncedGenerateThumb.cancel(), this._cancelPendingThumbUpdate(), this._thumbUrl &&= "";
815
- }
816
- _bindToEntry() {
817
- let g = this.uid?.trim();
818
- if (!g) {
819
- this.entry && this.reset();
820
- return;
821
- }
822
- let B = this.uploadCollection?.read(g);
823
- if (!B || B === this.entry) return;
824
- this.reset(), this.entry = B;
825
- let V = () => {
826
- this._requestThumbGeneration();
827
- };
828
- this.subEntry("fileInfo", (g) => {
829
- g?.isImage && V();
830
- }), this.subEntry("thumbUrl", (g) => {
831
- this._scheduleThumbUpdate(g ?? void 0);
832
- }), this.subEntry("cdnUrlModifiers", V), this._requestThumbGeneration(!0);
833
- }
834
- initCallback() {
835
- super.initCallback(), this.subConfigValue("filesViewMode", (g) => {
836
- g === "grid" && !this._renderedGridOnce && (this._firstViewMode === "list" && this._requestThumbGeneration(!0), this._renderedGridOnce = !0);
837
- });
838
- }
839
- connectedCallback() {
840
- super.connectedCallback(), this._observer?.disconnect(), this._observer = new window.IntersectionObserver(this._observerCallback.bind(this), { threshold: .1 }), this._observer.observe(this);
841
- }
842
- disconnectedCallback() {
843
- super.disconnectedCallback(), this._debouncedGenerateThumb.cancel(), this._cancelPendingThumbUpdate(), this._observer?.disconnect();
844
- }
845
- render() {
846
- return b`
847
- <div class="uc-thumb">
848
- <img
849
- class="uc-thumb__img"
850
- src=${this._thumbUrl || "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="}
851
- role="img"
852
- alt="Preview of uploaded image"
853
- ?hidden=${!this._thumbUrl}
854
- draggable="false"
855
- />
856
- <div class="uc-badge">
857
- <uc-icon name=${this.badgeIcon}></uc-icon>
858
- </div>
859
- </div>
860
- `;
861
- }
862
- };
863
- __decorate([n({ type: String })], Thumb.prototype, "badgeIcon", void 0), __decorate([n({ attribute: !1 })], Thumb.prototype, "uid", void 0), __decorate([r()], Thumb.prototype, "_thumbUrl", void 0);
864
- var StartFrom = class extends LitActivityBlock {
865
- constructor(...g) {
866
- super(...g), this.historyTracked = !0, this.activityType = LitActivityBlock.activities.START_FROM;
867
- }
868
- initCallback() {
869
- super.initCallback(), this.registerActivity(this.activityType ?? "");
870
- }
871
- render() {
872
- return b` <div class="uc-content">${this.yield("")}</div> `;
873
- }
874
- }, UploadCtxProvider = class extends LitUploaderBlock {
875
- constructor(...g) {
876
- super(...g), this._unbindEventEmitter = null;
877
- }
878
- static {
879
- this.styleAttrs = ["uc-wgt-common"];
880
- }
881
- static {
882
- this.EventType = EventType;
883
- }
884
- initCallback() {
885
- super.initCallback(), this._unbindEventEmitter = this.eventEmitter.bindTarget(this);
886
- }
887
- disconnectedCallback() {
888
- super.disconnectedCallback(), this._unbindEventEmitter?.();
889
- }
890
- }, u$1 = (g, B, V) => {
891
- let H = /* @__PURE__ */ new Map();
892
- for (let U = B; U <= V; U++) H.set(g[U], U);
893
- return H;
894
- }, c = e$1(class extends i {
895
- constructor(g) {
896
- if (super(g), g.type !== t.CHILD) throw Error("repeat() can only be used in text expressions");
897
- }
898
- dt(g, B, V) {
899
- let H;
900
- V === void 0 ? V = B : B !== void 0 && (H = B);
901
- let U = [], W = [], G = 0;
902
- for (let B of g) U[G] = H ? H(B, G) : G, W[G] = V(B, G), G++;
903
- return {
904
- values: W,
905
- keys: U
906
- };
907
- }
908
- render(g, B, V) {
909
- return this.dt(g, B, V).values;
910
- }
911
- update(g, [B, V, H]) {
912
- let U = M(g), { values: W, keys: G } = this.dt(B, V, H);
913
- if (!Array.isArray(U)) return this.ut = G, W;
914
- let K = this.ut ??= [], q = [], J, Y, X = 0, Z = U.length - 1, Q = 0, $ = W.length - 1;
915
- for (; X <= Z && Q <= $;) if (U[X] === null) X++;
916
- else if (U[Z] === null) Z--;
917
- else if (K[X] === G[Q]) q[Q] = u(U[X], W[Q]), X++, Q++;
918
- else if (K[Z] === G[$]) q[$] = u(U[Z], W[$]), Z--, $--;
919
- else if (K[X] === G[$]) q[$] = u(U[X], W[$]), v(g, q[$ + 1], U[X]), X++, $--;
920
- else if (K[Z] === G[Q]) q[Q] = u(U[Z], W[Q]), v(g, U[X], U[Z]), Z--, Q++;
921
- else if (J === void 0 && (J = u$1(G, Q, $), Y = u$1(K, X, Z)), J.has(K[X])) if (J.has(K[Z])) {
922
- let B = Y.get(G[Q]), V = B === void 0 ? null : U[B];
923
- if (V === null) {
924
- let B = v(g, U[X]);
925
- u(B, W[Q]), q[Q] = B;
926
- } else q[Q] = u(V, W[Q]), v(g, U[X], V), U[B] = null;
927
- Q++;
928
- } else h(U[Z]), Z--;
929
- else h(U[X]), X++;
930
- for (; Q <= $;) {
931
- let B = v(g, q[$ + 1]);
932
- u(B, W[Q]), q[Q++] = B;
933
- }
934
- for (; X <= Z;) {
935
- let g = U[X++];
936
- g !== null && h(g);
937
- }
938
- return this.ut = G, p(g, q), E;
939
- }
940
- }), FileItemState = Object.freeze({
941
- FINISHED: Symbol("FINISHED"),
942
- FAILED: Symbol("FAILED"),
943
- UPLOADING: Symbol("UPLOADING"),
944
- VALIDATION: Symbol("VALIDATION"),
945
- QUEUED_UPLOADING: Symbol("QUEUED-UPLOADING"),
946
- QUEUED_VALIDATION: Symbol("QUEUED-VALIDATION"),
947
- IDLE: Symbol("IDLE")
948
- }), FileItem = class B extends FileItemConfig {
949
- constructor(...B) {
950
- super(...B), this.couldBeCtxOwner = !0, this._pauseRender = !0, this.uid = "", this._itemName = "", this._errorText = "", this._hint = "", this._progressValue = 0, this._progressVisible = !1, this._badgeIcon = "", this._isFinished = !1, this._isFailed = !1, this._isUploading = !1, this._isFocused = !1, this._showFileNames = !1, this._ariaLabelStatusFile = "", this._pluginFileActions = [], this._renderedOnce = !1, this._handleRemove = () => {
951
- this.telemetryManager.sendEvent({ payload: { metadata: {
952
- event: "remove-file",
953
- node: this.tagName
954
- } } }), this.uid && this.uploadCollection.hasItem(this.uid) && this.uploadCollection.remove(this.uid);
955
- }, this._handleUploadClick = () => {
956
- this._upload();
957
- }, this._debouncedCalculateState = debounce(() => this._calculateState(), 100), this._updateHintAndProgress = this.withEntry(throttle((g, B) => {
958
- let V = g.getValue("errors")?.[0]?.message ?? "", H = g.getValue("source"), U = g.getValue("externalUrl"), W = B === FileItemState.FINISHED, G = B === FileItemState.UPLOADING, K = B === FileItemState.QUEUED_UPLOADING, q = B === FileItemState.QUEUED_VALIDATION, J = B === FileItemState.VALIDATION, Y = g.getValue("fileName"), X = "";
959
- V ? X = "" : !W && U && H && Object.values(ExternalUploadSource).includes(H) && (X = this.l10n("waiting-for", { source: this.l10n(`src-type-${H}`) })), this._hint = X, this._errorText = V, this._progressVisible = G || K || q || J, this._progressValue = q || J ? 0 : g.getValue("uploadProgress"), this._ariaLabelStatusFile = Y ? this.l10n("a11y-file-item-status", {
960
- fileName: Y,
961
- status: this.l10n(B?.description?.toLocaleLowerCase() ?? "").toLocaleLowerCase()
962
- }) : "";
963
- }, 100)), this._upload = this.withEntry(async (B) => {
964
- if (!this.uploadCollection.read(B.uid) || B.getValue("fileInfo") || B.getValue("isUploading") || B.getValue("errors").length > 0 || B.getValue("isValidationPending")) return;
965
- let V = this.cfg.multiple ? this.cfg.multipleMax : 1;
966
- if (!(V && this.uploadCollection.size > V)) {
967
- B.setMultipleValues({
968
- isUploading: !0,
969
- errors: [],
970
- isQueuedForUploading: !0
971
- }), this._debouncedCalculateState();
972
- try {
973
- let g = new AbortController();
974
- B.setValue("abortController", g);
975
- let V = await this.$["*uploadQueue"].add(async () => {
976
- B.setValue("isQueuedForUploading", !1);
977
- let V = B.getValue("file");
978
- if (V instanceof File || V instanceof Blob) {
979
- let g = (this._sharedInstancesBag.pluginManager?.snapshot().fileHooks ?? []).filter((g) => g.type === "beforeUpload");
980
- for (let H of g) try {
981
- let { file: g, mimeType: U } = await H.handler({
982
- file: V,
983
- mimeType: B.getValue("mimeType")
984
- });
985
- V = g, U !== B.getValue("mimeType") && B.setValue("mimeType", U);
986
- } catch (g) {
987
- this.debugPrint(`File hook "beforeUpload" from plugin "${H.pluginId}" failed`, g);
988
- }
989
- }
990
- let H = V || B.getValue("externalUrl") || B.getValue("uuid");
991
- if (!H) throw Error("No file input");
992
- let U = {
993
- ...await this.getUploadClientOptions(),
994
- fileName: B.getValue("fileName") ?? void 0,
995
- source: B.getValue("source") ?? void 0,
996
- onProgress: (g) => {
997
- if (g.isComputable) {
998
- let V = g.value * 100;
999
- B.setValue("uploadProgress", V);
1000
- }
1001
- },
1002
- signal: g.signal,
1003
- metadata: await this.getMetadataFor(B.uid)
1004
- };
1005
- return this.debugPrint("upload options", H, U), uploadFile(H, U);
1006
- });
1007
- B.setMultipleValues({
1008
- fileInfo: V,
1009
- isQueuedForUploading: !1,
1010
- isUploading: !1,
1011
- fileName: V.originalFilename,
1012
- fileSize: V.size,
1013
- isImage: V.isImage ?? !1,
1014
- mimeType: V.contentInfo?.mime?.mime ?? V.mimeType,
1015
- uuid: V.uuid,
1016
- cdnUrl: B.getValue("cdnUrl") ?? V.cdnUrl,
1017
- cdnUrlModifiers: B.getValue("cdnUrlModifiers") ?? "",
1018
- uploadProgress: 100,
1019
- source: B.getValue("source") ?? null
1020
- }), B === this.entry && this._debouncedCalculateState();
1021
- } catch (V) {
1022
- this.telemetryManager.sendEventError(V, "file upload. Failed to upload file"), V instanceof CancelError && V.isCancel ? B.setMultipleValues({
1023
- isUploading: !1,
1024
- uploadProgress: 0
1025
- }) : V instanceof UploadcareError ? B.setMultipleValues({
1026
- isUploading: !1,
1027
- uploadProgress: 0,
1028
- uploadError: V
1029
- }) : (console.error("Unknown upload error", V), B.setMultipleValues({
1030
- isUploading: !1,
1031
- uploadProgress: 0,
1032
- uploadError: Error("Something went wrong", { cause: V })
1033
- })), B === this.entry && this._debouncedCalculateState();
1034
- }
1035
- }
1036
- });
1037
- }
1038
- _calculateState() {
1039
- let g = this.entry;
1040
- if (!g) return;
1041
- let B = FileItemState.IDLE;
1042
- g.getValue("errors").length > 0 ? B = FileItemState.FAILED : g.getValue("isQueuedForUploading") ? B = FileItemState.QUEUED_UPLOADING : g.getValue("isQueuedForValidation") ? B = FileItemState.QUEUED_VALIDATION : g.getValue("isValidationPending") ? B = FileItemState.VALIDATION : g.getValue("isUploading") ? B = FileItemState.UPLOADING : g.getValue("fileInfo") && (B = FileItemState.FINISHED), this._handleState(g, B);
1043
- }
1044
- _handleState(g, B) {
1045
- B === FileItemState.FAILED ? this._badgeIcon = "badge-error" : B === FileItemState.FINISHED && (this._badgeIcon = "badge-success"), B === FileItemState.UPLOADING && (this._isFocused = !1, this.removeAttribute("focused")), this._isFailed = B === FileItemState.FAILED, this._isUploading = B === FileItemState.UPLOADING, this._isFinished = B === FileItemState.FINISHED, this._updateHintAndProgress(B);
1046
- }
1047
- reset() {
1048
- super.reset(), this._debouncedCalculateState.cancel();
1049
- }
1050
- _observerCallback(g) {
1051
- let [B] = g;
1052
- B && B.isIntersecting && !this._renderedOnce && (this._pauseRender = !1, this._renderedOnce = !0);
1053
- }
1054
- _handleEntryId(g) {
1055
- this.reset();
1056
- let B = this.uploadCollection?.read(g);
1057
- if (this.entry = B, !B) {
1058
- this._updatePluginFileActions();
1059
- return;
1060
- }
1061
- this.subEntry("isQueuedForValidation", () => {
1062
- this._debouncedCalculateState();
1063
- }), this.subEntry("isValidationPending", () => {
1064
- this._debouncedCalculateState();
1065
- }), this.subEntry("uploadProgress", () => {
1066
- this._debouncedCalculateState();
1067
- }), this.subEntry("isQueuedForUploading", () => {
1068
- this._debouncedCalculateState();
1069
- }), this.subEntry("fileName", (g) => {
1070
- this._itemName = g || B.getValue("externalUrl") || this.l10n("file-no-name"), this._debouncedCalculateState();
1071
- }), this.subEntry("externalUrl", (g) => {
1072
- this._itemName = B.getValue("fileName") || g || this.l10n("file-no-name");
1073
- }), this.subEntry("fileInfo", () => {
1074
- this._debouncedCalculateState();
1075
- }), 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.subEntry("fileInfo", () => this._updatePluginFileActions()), this.subEntry("isUploading", () => this._updatePluginFileActions()), this.subEntry("errors", () => this._updatePluginFileActions()), this._calculateState(), this._updatePluginFileActions(), this._applyOnAddHooks(B);
1076
- }
1077
- async _applyOnAddHooks(g) {
1078
- let B = g.getValue("file");
1079
- if (!B) return;
1080
- let V = (this._sharedInstancesBag.pluginManager?.snapshot().fileHooks ?? []).filter((g) => g.type === "onAdd"), H = B, U = g.getValue("mimeType");
1081
- for (let g of V) try {
1082
- ({file: H, mimeType: U} = await g.handler({
1083
- file: H,
1084
- mimeType: U
1085
- }));
1086
- } catch (B) {
1087
- this.debugPrint(`File hook "onAdd" from plugin "${g.pluginId}" failed`, B);
1088
- }
1089
- H !== B && (g.setValue("file", H), g.setValue("fileSize", H.size)), U !== g.getValue("mimeType") && g.setValue("mimeType", U);
1090
- }
1091
- _updateShowFileNames(g) {
1092
- if (this.cfg.filesViewMode === "list") {
1093
- this._showFileNames = !0;
1094
- return;
1095
- }
1096
- this._showFileNames = g;
1097
- }
1098
- willUpdate(g) {
1099
- super.willUpdate(g), g.has("uid") && this._handleEntryId(this.uid);
1100
- }
1101
- _updatePluginFileActions() {
1102
- let g = this._sharedInstancesBag.pluginManager;
1103
- if (!g || !this.uid) {
1104
- this._pluginFileActions = [];
1105
- return;
1106
- }
1107
- let B = g.snapshot().fileActions, V = this.api.getOutputItem(this.uid);
1108
- if (!V) {
1109
- this._pluginFileActions = [];
1110
- return;
1111
- }
1112
- this._pluginFileActions = B.filter((g) => {
1113
- try {
1114
- return g.shouldRender(V);
1115
- } catch (B) {
1116
- return console.error(`Error in plugin file action shouldRender (${g.id}):`, B), !1;
1117
- }
1118
- });
1119
- }
1120
- _handlePluginFileAction(g) {
1121
- if (!this.uid) return;
1122
- let B = this.api.getOutputItem(this.uid);
1123
- if (B) try {
1124
- g.onClick(B);
1125
- } catch (B) {
1126
- console.error(`Error in plugin file action onClick (${g.id}):`, B);
1127
- }
1128
- }
1129
- initCallback() {
1130
- super.initCallback(), this._handleEntryId(this.uid), this.subConfigValue("filesViewMode", (g) => {
1131
- this._updateShowFileNames(this.cfg.gridShowFileNames), this.setAttribute("mode", g);
1132
- }), this.subConfigValue("gridShowFileNames", (g) => {
1133
- this._updateShowFileNames(g);
1134
- }), this.onclick = () => {
1135
- B.activeInstances.forEach((g) => {
1136
- g === this ? g.setAttribute("focused", "") : g.removeAttribute("focused");
1137
- });
1138
- }, this.sub("*uploadTrigger", (g) => {
1139
- this.entry && !g.has(this.entry.uid) || setTimeout(() => this.isConnected && this._upload());
1140
- });
1141
- let g = this._sharedInstancesBag.pluginManager;
1142
- g?.onPluginsChange && (this._unsubscribePlugins = g.onPluginsChange(() => this._updatePluginFileActions())), this._updatePluginFileActions(), B.activeInstances.add(this);
1143
- }
1144
- connectedCallback() {
1145
- super.connectedCallback(), this._observer = new window.IntersectionObserver(this._observerCallback.bind(this), { threshold: [0, 1] }), this._observer.observe(this);
1146
- }
1147
- disconnectedCallback() {
1148
- this._unsubscribePlugins?.(), this._unsubscribePlugins = void 0, super.disconnectedCallback(), this._observer?.disconnect(), B.activeInstances.delete(this), this.reset();
1149
- }
1150
- static {
1151
- this.activeInstances = /* @__PURE__ */ new Set();
1152
- }
1153
- shouldUpdate(g) {
1154
- return this._pauseRender ? !1 : super.shouldUpdate(g);
1155
- }
1156
- render() {
1157
- return b`
1158
- <div
1159
- class="uc-inner"
1160
- ?data-finished=${this._isFinished}
1161
- ?data-uploading=${this._isUploading}
1162
- ?data-failed=${this._isFailed}
1163
- ?data-focused=${this._isFocused}
1164
- >
1165
- <uc-thumb .uid=${this.uid} .badgeIcon=${this._badgeIcon}></uc-thumb>
1166
-
1167
- <div aria-atomic="true" aria-live="polite" class="uc-file-name-wrapper" aria-label=${this._ariaLabelStatusFile}>
1168
- <span class="uc-file-name" ?hidden=${!this._showFileNames}>${this._itemName}</span>
1169
- <span class="uc-file-error" ?hidden=${!this._errorText}>${this._errorText}</span>
1170
- <span class="uc-file-hint" ?hidden=${!this._hint}>${this._hint}</span>
1171
- </div>
1172
- <div class="uc-file-actions">
1173
- ${this._pluginFileActions.map((g) => b`
1174
- <button
1175
- type="button"
1176
- @click=${() => this._handlePluginFileAction(g)}
1177
- title=${g.id}
1178
- aria-label=${g.id}
1179
- class="uc-plugin-action-btn uc-mini-btn"
1180
- data-plugin-action-id=${g.id}
1181
- >
1182
- <uc-icon name=${g.icon}></uc-icon>
1183
- </button>
1184
- `)}
1185
- <button
1186
- type="button"
1187
- @click=${this._handleRemove}
1188
- title=${this.l10n("file-item-remove-button")}
1189
- aria-label=${this.l10n("file-item-remove-button")}
1190
- class="uc-remove-btn uc-mini-btn"
1191
- >
1192
- <uc-icon name="remove-file"></uc-icon>
1193
- </button>
1194
- <button type="button" class="uc-upload-btn uc-mini-btn" @click=${this._handleUploadClick}>
1195
- <uc-icon name="upload"></uc-icon>
1196
- </button>
1197
- </div>
1198
- <uc-progress-bar class="uc-progress-bar" .value=${this._progressValue} .visible=${this._progressVisible} ?hasFileName=${this._showFileNames}>
1199
- </uc-progress-bar>
1200
- </div>
1201
- `;
1202
- }
1203
- };
1204
- __decorate([r()], FileItem.prototype, "_pauseRender", void 0), __decorate([n({ attribute: !1 })], FileItem.prototype, "uid", void 0), __decorate([r()], FileItem.prototype, "_itemName", void 0), __decorate([r()], FileItem.prototype, "_errorText", void 0), __decorate([r()], FileItem.prototype, "_hint", void 0), __decorate([r()], FileItem.prototype, "_progressValue", void 0), __decorate([r()], FileItem.prototype, "_progressVisible", void 0), __decorate([r()], FileItem.prototype, "_badgeIcon", void 0), __decorate([r()], FileItem.prototype, "_isFinished", void 0), __decorate([r()], FileItem.prototype, "_isFailed", void 0), __decorate([r()], FileItem.prototype, "_isUploading", void 0), __decorate([r()], FileItem.prototype, "_isFocused", void 0), __decorate([r()], FileItem.prototype, "_showFileNames", void 0), __decorate([r()], FileItem.prototype, "_ariaLabelStatusFile", void 0), __decorate([r()], FileItem.prototype, "_pluginFileActions", void 0);
1205
- function checkIsDirectory(g) {
1206
- return new Promise((B) => {
1207
- typeof window.FileReader != "function" && B(!1);
1208
- try {
1209
- let V = new FileReader();
1210
- V.onerror = () => {
1211
- B(!0);
1212
- };
1213
- let H = (g) => {
1214
- g.type !== "loadend" && V.abort(), B(!1);
1215
- };
1216
- V.onloadend = H, V.onprogress = H, V.readAsDataURL(g);
1217
- } catch {
1218
- B(!1);
1219
- }
1220
- });
1221
- }
1222
- function readEntryContentAsync(g, B) {
1223
- return new Promise((V) => {
1224
- let H = 0, U = [], W = (g) => {
1225
- if (!g) {
1226
- console.warn("Unexpectedly received empty content entry", { scope: "drag-and-drop" }), V(null);
1227
- return;
1228
- }
1229
- g.isFile ? (H++, g.file((W) => {
1230
- H--;
1231
- let G = new File([W], W.name, { type: W.type || B });
1232
- U.push({
1233
- type: "file",
1234
- file: G,
1235
- fullPath: g.fullPath
1236
- }), H === 0 && V(U);
1237
- })) : g.isDirectory && G(g.createReader());
1238
- }, G = (g) => {
1239
- H++, g.readEntries((g) => {
1240
- H--;
1241
- for (let B of g) W(B);
1242
- H === 0 && V(U);
1243
- });
1244
- };
1245
- W(g);
1246
- });
1247
- }
1248
- function getDropItems(g) {
1249
- let B = [], V = [];
1250
- for (let H = 0; H < g.items.length; H++) {
1251
- let U = g.items[H];
1252
- if (U) if (U.kind === "file") {
1253
- let g = U.type, H = U;
1254
- if (typeof H.webkitGetAsEntry == "function" || typeof H.getAsEntry == "function") {
1255
- let U = typeof H.webkitGetAsEntry == "function" ? H.webkitGetAsEntry() : H.getAsEntry?.();
1256
- U && V.push(readEntryContentAsync(U, g).then((g) => {
1257
- g && B.push(...g);
1258
- }));
1259
- continue;
1260
- }
1261
- let W = U.getAsFile();
1262
- W && V.push(checkIsDirectory(W).then((g) => {
1263
- g || B.push({
1264
- type: "file",
1265
- file: W
1266
- });
1267
- }));
1268
- } else U.kind === "string" && /^text\/uri-list/.test(U.type) && V.push(new Promise((g) => {
1269
- U.getAsString((V) => {
1270
- B.push({
1271
- type: "url",
1272
- url: V
1273
- }), g();
1274
- });
1275
- }));
1276
- }
1277
- return Promise.all(V).then(() => B);
1278
- }
1279
- const DropzoneState = Object.freeze({
1280
- ACTIVE: 0,
1281
- INACTIVE: 1,
1282
- NEAR: 2,
1283
- OVER: 3
1284
- });
1285
- var RESET_EVENTS = ["focus"], NEAR_OFFSET = 100, nearnessRegistry = /* @__PURE__ */ new Map();
1286
- function distance(g, B) {
1287
- let V = Math.max(Math.min(g[0], B.x + B.width), B.x), H = Math.max(Math.min(g[1], B.y + B.height), B.y);
1288
- return Math.sqrt((g[0] - V) * (g[0] - V) + (g[1] - H) * (g[1] - H));
1289
- }
1290
- function addDropzone(g) {
1291
- let B = 0, V = document.body, H = /* @__PURE__ */ new Set(), U = (g) => {
1292
- H.add(g);
1293
- }, W = DropzoneState.INACTIVE, G = (B) => {
1294
- g.shouldIgnore() && B !== DropzoneState.INACTIVE || (W !== B && H.forEach((g) => {
1295
- g(B);
1296
- }), W = B);
1297
- }, K = () => B > 0;
1298
- U((B) => g.onChange(B));
1299
- let q = () => {
1300
- B = 0, G(DropzoneState.INACTIVE);
1301
- }, J = () => {
1302
- B += 1, W === DropzoneState.INACTIVE && G(DropzoneState.ACTIVE);
1303
- }, Y = () => {
1304
- --B, K() || G(DropzoneState.INACTIVE);
1305
- }, X = (g) => {
1306
- g.preventDefault(), B = 0, G(DropzoneState.INACTIVE);
1307
- }, Z = (V) => {
1308
- if (g.shouldIgnore()) return;
1309
- K() || (B += 1);
1310
- let H = [V.x, V.y], U = g.element.getBoundingClientRect(), W = Math.floor(distance(H, U)), q = W < NEAR_OFFSET, J = V.composedPath().includes(g.element);
1311
- nearnessRegistry.set(g.element, W);
1312
- let Y = Math.min(...nearnessRegistry.values()) === W;
1313
- J && Y ? (V.preventDefault(), G(DropzoneState.OVER)) : G(q && Y ? DropzoneState.NEAR : DropzoneState.ACTIVE);
1314
- }, Q = async (B) => {
1315
- if (g.shouldIgnore()) return;
1316
- B.preventDefault();
1317
- let { dataTransfer: V } = B;
1318
- if (!V) return;
1319
- let H = await getDropItems(V);
1320
- g.onItems(H), G(DropzoneState.INACTIVE);
1321
- };
1322
- return V.addEventListener("drop", X), V.addEventListener("dragleave", Y), V.addEventListener("dragenter", J), V.addEventListener("dragover", Z), g.element.addEventListener("drop", Q), RESET_EVENTS.forEach((g) => {
1323
- window.addEventListener(g, q);
1324
- }), () => {
1325
- nearnessRegistry.delete(g.element), V.removeEventListener("drop", X), V.removeEventListener("dragleave", Y), V.removeEventListener("dragenter", J), V.removeEventListener("dragover", Z), g.element.removeEventListener("drop", Q), RESET_EVENTS.forEach((g) => {
1326
- window.removeEventListener(g, q);
1327
- });
1328
- };
1329
- }
1330
- var dropAreaRegistry = /* @__PURE__ */ new Set(), DropArea = class extends LitUploaderBlock {
1331
- constructor(...g) {
1332
- super(...g), this.single = !1, this.ghost = !1, this.disabled = !1, this.clickable = !1, this.withIcon = !1, this.fullscreen = !1, this.initflow = !1, this._isEnabled = !0, this._isVisible = !0, this._destroyDropzone = null, this._destroyContentWrapperDropzone = null, this._contentWrapperRef = e(), this._handleAreaInteraction = (g) => {
1333
- if (g instanceof KeyboardEvent) {
1334
- if (g.code !== "Space" && g.code !== "Enter") return;
1335
- } else if (!(g instanceof MouseEvent)) return;
1336
- if (this.initflow) {
1337
- this.api.initFlow();
1338
- return;
1339
- }
1340
- this.api.openSystemDialog();
1341
- }, this._sourceListAllowsLocal = !0, this._clickableListenersAttached = !1;
1342
- }
1343
- static {
1344
- this.styleAttrs = [...super.styleAttrs, "uc-drop-area"];
1345
- }
1346
- get _localizedText() {
1347
- let g = this.text;
1348
- return typeof g == "string" && g.length > 0 ? this.l10n(g) || g : this.l10n("drop-files-here");
1349
- }
1350
- isActive() {
1351
- if (!this._isEnabled) return !1;
1352
- let g = this.getBoundingClientRect(), B = g.width > 0 && g.height > 0, V = g.top >= 0 && g.left >= 0 && g.bottom <= (window.innerHeight || document.documentElement.clientHeight) && g.right <= (window.innerWidth || document.documentElement.clientWidth), H = window.getComputedStyle(this), U = H.visibility !== "hidden" && H.display !== "none";
1353
- return B && U && V;
1354
- }
1355
- initCallback() {
1356
- super.initCallback(), dropAreaRegistry.add(this), this._updateIsEnabled(), this._updateVisibility(), this._updateClickableListeners(), this._updateDragStateAttribute(DropzoneState.INACTIVE), this._destroyDropzone = addDropzone({
1357
- element: this,
1358
- shouldIgnore: () => this._shouldIgnore(),
1359
- onChange: (g) => {
1360
- this._updateDragStateAttribute(g);
1361
- },
1362
- onItems: (g) => {
1363
- g.length && (g.forEach((g) => {
1364
- g.type === "url" ? this.api.addFileFromUrl(g.url, { source: UploadSource.DROP_AREA }) : g.type === "file" && this.api.addFileFromObject(g.file, {
1365
- source: UploadSource.DROP_AREA,
1366
- fullPath: g.fullPath
1367
- });
1368
- }), this.uploadCollection.size && (this.set$({ "*currentActivity": LitActivityBlock.activities.UPLOAD_LIST }), this.modalManager?.open(LitActivityBlock.activities.UPLOAD_LIST)));
1369
- }
1370
- }), this.updateComplete.then(() => this._setupContentWrapperDropzone()), this.subConfigValue("sourceList", (g) => {
1371
- this._sourceListAllowsLocal = stringToArray(g).includes(UploadSource.LOCAL), this._updateIsEnabled(), this._updateVisibility();
1372
- });
1373
- }
1374
- willUpdate(g) {
1375
- super.willUpdate(g), g.has("disabled") && (this._updateIsEnabled(), this._updateVisibility());
1376
- }
1377
- updated(g) {
1378
- super.updated(g), g.has("clickable") && this._updateClickableListeners();
1379
- }
1380
- _shouldIgnore() {
1381
- if (!this._isEnabled || !this._couldHandleFiles()) return !0;
1382
- if (!this.fullscreen) return !1;
1383
- let g = dropAreaRegistry;
1384
- return g.size === 0 ? !1 : [...g].filter((g) => g !== this).filter((g) => g.isActive()).length > 0;
1385
- }
1386
- _couldHandleFiles() {
1387
- let g = this.cfg.multiple, B = this.cfg.multipleMax, V = this.uploadCollection.size;
1388
- return !(g && B && V >= B || !g && V > 0);
1389
- }
1390
- _updateIsEnabled() {
1391
- this._isEnabled = this._sourceListAllowsLocal && !this.disabled;
1392
- }
1393
- _updateVisibility() {
1394
- let g = this._isEnabled || !this.querySelector("[data-default-slot]");
1395
- this._isVisible = g, this.hidden = !g;
1396
- }
1397
- _updateDragStateAttribute(g) {
1398
- let B = Object.entries(DropzoneState).find(([, B]) => B === g)?.[0].toLowerCase();
1399
- B && this.setAttribute("drag-state", B);
1400
- }
1401
- _setupContentWrapperDropzone() {
1402
- if (this._destroyContentWrapperDropzone) return;
1403
- let g = this._contentWrapperRef.value;
1404
- g && (this._destroyContentWrapperDropzone = addDropzone({
1405
- element: g,
1406
- onChange: (B) => {
1407
- let V = Object.entries(DropzoneState).find(([, g]) => g === B)?.[0].toLowerCase();
1408
- V && g.setAttribute("drag-state", V);
1409
- },
1410
- onItems: () => {},
1411
- shouldIgnore: () => this._shouldIgnore()
1412
- }));
1413
- }
1414
- _updateClickableListeners() {
1415
- this.clickable && !this._clickableListenersAttached ? (this.addEventListener("keydown", this._handleAreaInteraction), this.addEventListener("click", this._handleAreaInteraction), this._clickableListenersAttached = !0) : !this.clickable && this._clickableListenersAttached && (this.removeEventListener("keydown", this._handleAreaInteraction), this.removeEventListener("click", this._handleAreaInteraction), this._clickableListenersAttached = !1);
1416
- }
1417
- disconnectedCallback() {
1418
- super.disconnectedCallback(), dropAreaRegistry.delete(this), this._destroyDropzone?.(), this._destroyContentWrapperDropzone?.(), this._clickableListenersAttached &&= (this.removeEventListener("keydown", this._handleAreaInteraction), this.removeEventListener("click", this._handleAreaInteraction), !1);
1419
- }
1420
- render() {
1421
- return b`
1422
- ${this.yield("", b`<div data-default-slot hidden></div>
1423
- <div ${n$1(this._contentWrapperRef)} class="uc-content-wrapper" ?hidden=${!this._isVisible}>
1424
- <div class="uc-icon-container" ?hidden=${!this.withIcon}>
1425
- <uc-icon name="default"></uc-icon>
1426
- <uc-icon name="arrow-down"></uc-icon>
1427
- </div>
1428
- <span class="uc-text">${this._localizedText}</span>
1429
- </div>`)}
1430
- `;
1431
- }
1432
- };
1433
- __decorate([n({
1434
- type: Boolean,
1435
- noAccessor: !0
1436
- })], DropArea.prototype, "single", void 0), __decorate([n({
1437
- type: Boolean,
1438
- noAccessor: !0
1439
- })], DropArea.prototype, "ghost", void 0), __decorate([n({
1440
- type: Boolean,
1441
- reflect: !0
1442
- })], DropArea.prototype, "disabled", void 0), __decorate([n({
1443
- type: Boolean,
1444
- reflect: !0
1445
- })], DropArea.prototype, "clickable", void 0), __decorate([n({
1446
- type: Boolean,
1447
- attribute: "with-icon",
1448
- reflect: !0
1449
- })], DropArea.prototype, "withIcon", void 0), __decorate([n({
1450
- type: Boolean,
1451
- reflect: !0
1452
- })], DropArea.prototype, "fullscreen", void 0), __decorate([n({
1453
- type: Boolean,
1454
- reflect: !0
1455
- })], DropArea.prototype, "initflow", void 0), __decorate([n({ type: String })], DropArea.prototype, "text", void 0), __decorate([r()], DropArea.prototype, "_isEnabled", void 0), __decorate([r()], DropArea.prototype, "_isVisible", void 0);
1456
- var UploadList = class extends LitUploaderBlock {
1457
- constructor(...g) {
1458
- super(...g), this.couldBeCtxOwner = !0, this.historyTracked = !0, this.activityType = LitActivityBlock.activities.UPLOAD_LIST, this._doneBtnVisible = !1, this._doneBtnEnabled = !1, this._uploadBtnVisible = !1, this._addMoreBtnVisible = !1, this._addMoreBtnEnabled = !1, this._commonErrorMessage = null, this._hasFiles = !1, this._latestSummary = null, this._handleAdd = () => {
1459
- this.telemetryManager.sendEvent({
1460
- eventType: InternalEventType.ACTION_EVENT,
1461
- payload: { metadata: {
1462
- event: "add-more",
1463
- node: this.tagName
1464
- } }
1465
- }), this.api.initFlow(!0);
1466
- }, this._handleUpload = () => {
1467
- this.emit(EventType.UPLOAD_CLICK), this.api.uploadAll(), this._throttledHandleCollectionUpdate();
1468
- }, this._handleDone = () => {
1469
- this.emit(EventType.DONE_CLICK, this.api.getOutputCollectionState()), this.api.doneFlow();
1470
- }, this._handleCancel = () => {
1471
- this.telemetryManager.sendEvent({
1472
- eventType: InternalEventType.ACTION_EVENT,
1473
- payload: { metadata: {
1474
- event: "clear-all",
1475
- node: this.tagName
1476
- } }
1477
- }), this.uploadCollection.clearAll();
1478
- }, this._throttledHandleCollectionUpdate = throttle(() => {
1479
- this.isConnected && (this._updateUploadsState(), !this.couldOpenActivity && this.$["*currentActivity"] === this.activityType && this.historyBack(), this.cfg.confirmUpload || this.api.uploadAll());
1480
- }, 300);
1481
- }
1482
- get _headerText() {
1483
- return this._latestSummary ? this._getHeaderText(this._latestSummary) : "";
1484
- }
1485
- _updateUploadsState() {
1486
- let g = this.api.getOutputCollectionState(), B = {
1487
- total: g.totalCount,
1488
- succeed: g.successCount,
1489
- uploading: g.uploadingCount,
1490
- failed: g.failedCount,
1491
- validatingBeforeUploading: g.idleEntries.filter((g) => g.isValidationPending).length
1492
- }, V = !g.errors.some((g) => g.type === "TOO_MANY_FILES" || g.type === "TOO_FEW_FILES"), H = g.errors.some((g) => g.type === "TOO_MANY_FILES"), U = g.totalCount === (this.cfg.multiple ? this.cfg.multipleMax : 1), W = g.allEntries.some((g) => g.isValidationPending), G = B.failed === 0 && g.errors.length === 0 && !W, K = !1, q = !1, J = !1;
1493
- if (B.total - B.succeed - B.uploading - B.failed > 0 && V && G && this.cfg.confirmUpload) K = !0;
1494
- else {
1495
- q = !0;
1496
- let H = this.cfg.groupOutput ? !!g.group : !0;
1497
- J = B.total === B.succeed && V && G && H;
1498
- }
1499
- this._doneBtnVisible = q, this._doneBtnEnabled = J, this._uploadBtnVisible = K, this._addMoreBtnEnabled = B.total === 0 || !H && !U, this._addMoreBtnVisible = !U || this.cfg.multiple, this._hasFiles = B.total > 0, this._latestSummary = B;
1500
- }
1501
- _getHeaderText(g) {
1502
- let B = (B) => {
1503
- let V = g[B];
1504
- return B === "uploading" && (V += g.validatingBeforeUploading), this.l10n(`header-${B}`, { count: V });
1505
- };
1506
- return g.uploading > 0 || g.validatingBeforeUploading > 0 ? B("uploading") : g.failed > 0 ? B("failed") : g.succeed > 0 ? B("succeed") : B("total");
1507
- }
1508
- get couldOpenActivity() {
1509
- return this.cfg.showEmptyList || this.uploadCollection.size > 0;
1510
- }
1511
- initCallback() {
1512
- super.initCallback(), this.registerActivity(this.activityType), this.subConfigValue("multiple", this._throttledHandleCollectionUpdate), this.subConfigValue("multipleMin", this._throttledHandleCollectionUpdate), this.subConfigValue("multipleMax", this._throttledHandleCollectionUpdate), this.sub("*groupInfo", (g) => {
1513
- g && this._throttledHandleCollectionUpdate();
1514
- }), this.subConfigValue("filesViewMode", (g) => {
1515
- this.setAttribute("mode", g);
1516
- }), this.sub("*currentActivity", (g) => {
1517
- !this.couldOpenActivity && g === this.activityType && (this.$["*currentActivity"] = this.initActivity);
1518
- }), this.uploadCollection.observeProperties(this._throttledHandleCollectionUpdate), this.uploadCollection.observeCollection(this._throttledHandleCollectionUpdate), this.sub("*collectionErrors", (g) => {
1519
- let B = g.filter((g) => g.type !== "SOME_FILES_HAS_ERRORS")[0];
1520
- if (!B) {
1521
- this._commonErrorMessage = null;
1522
- return;
1523
- }
1524
- this._commonErrorMessage = B.message;
1525
- });
1526
- }
1527
- disconnectedCallback() {
1528
- super.disconnectedCallback(), this.has("*uploadCollection") && (this.uploadCollection.unobserveProperties(this._throttledHandleCollectionUpdate), this.uploadCollection.unobserveCollection(this._throttledHandleCollectionUpdate));
1529
- }
1530
- render() {
1531
- return b`
1532
- <uc-activity-header>
1533
- <span aria-live="polite" class="uc-header-text">${this._headerText}</span>
1534
- <button
1535
- type="button"
1536
- class="uc-mini-btn uc-close-btn"
1537
- @click=${this.$["*closeModal"]}
1538
- title=${this.l10n("a11y-activity-header-button-close")}
1539
- aria-label=${this.l10n("a11y-activity-header-button-close")}
1540
- >
1541
- <uc-icon name="close"></uc-icon>
1542
- </button>
1543
- </uc-activity-header>
1544
-
1545
- <div class="uc-no-files" ?hidden=${this._hasFiles}>
1546
- ${this.yield("empty", b`<span>${this.l10n("no-files")}</span>`)}
1547
- </div>
1548
-
1549
- <div class="uc-files">
1550
- <div class="uc-files-wrapper">
1551
- ${c(this.$["*uploadList"] ?? [], ({ uid: g }) => g, ({ uid: g }) => b`<uc-file-item .uid=${g}></uc-file-item>`)}
1552
- </div>
1553
- <button
1554
- type="button"
1555
- class="uc-add-more-btn uc-secondary-btn"
1556
- @click=${this._handleAdd}
1557
- ?disabled=${!this._addMoreBtnEnabled}
1558
- ?hidden=${!this._addMoreBtnVisible}
1559
- >
1560
- <uc-icon name="add"></uc-icon><span>${this.l10n("add-more")}</span>
1561
- </button>
1562
- </div>
1563
-
1564
- <div class="uc-common-error"
1565
- ?hidden=${!this._commonErrorMessage}
1566
- >
1567
- ${this._commonErrorMessage ?? ""}
1568
- </div>
1569
-
1570
- <div class="uc-toolbar">
1571
- <button type="button" class="uc-cancel-btn uc-secondary-btn" @click=${this._handleCancel}>${this.l10n("clear")}</button>
1572
- <div class="uc-toolbar-spacer"></div>
1573
- <button
1574
- type="button"
1575
- class="uc-add-more-btn uc-secondary-btn"
1576
- ?hidden=${!this._addMoreBtnVisible}
1577
- ?disabled=${!this._addMoreBtnEnabled}
1578
- @click=${this._handleAdd}
1579
- >
1580
- <uc-icon name="add"></uc-icon><span>${this.l10n("add-more")}</span>
1581
- </button>
1582
- <button
1583
- type="button"
1584
- class="uc-upload-btn uc-primary-btn"
1585
- ?hidden=${!this._uploadBtnVisible}
1586
- @click=${this._handleUpload}
1587
- >${this.l10n("upload")}</button>
1588
- <button
1589
- type="button"
1590
- class="uc-done-btn uc-primary-btn"
1591
- ?hidden=${!this._doneBtnVisible}
1592
- ?disabled=${!this._doneBtnEnabled}
1593
- @click=${this._handleDone}
1594
- >
1595
- ${this.l10n("done")}
1596
- </button>
1597
- </div>
1598
-
1599
- <uc-drop-area ghost></uc-drop-area>
1600
- `;
1601
- }
1602
- };
1603
- __decorate([r()], UploadList.prototype, "_doneBtnVisible", void 0), __decorate([r()], UploadList.prototype, "_doneBtnEnabled", void 0), __decorate([r()], UploadList.prototype, "_uploadBtnVisible", void 0), __decorate([r()], UploadList.prototype, "_addMoreBtnVisible", void 0), __decorate([r()], UploadList.prototype, "_addMoreBtnEnabled", void 0), __decorate([r()], UploadList.prototype, "_commonErrorMessage", void 0), __decorate([r()], UploadList.prototype, "_hasFiles", void 0), __decorate([r()], UploadList.prototype, "_latestSummary", void 0);
1604
- var SimpleBtn = class extends LitUploaderBlock {
1605
- constructor(...g) {
1606
- super(...g), this.couldBeCtxOwner = !0, this.dropzone = !0, this._buttonTextKey = "upload-file", this._handleClick = () => {
1607
- this.api.initFlow();
1608
- };
1609
- }
1610
- static {
1611
- this.styleAttrs = [...super.styleAttrs, "uc-simple-btn"];
1612
- }
1613
- initCallback() {
1614
- super.initCallback(), this.subConfigValue("multiple", (g) => {
1615
- this._buttonTextKey = g ? "upload-files" : "upload-file";
1616
- });
1617
- }
1618
- render() {
1619
- return b`
1620
- <uc-drop-area .disabled=${!this.dropzone}>
1621
- <button type="button" @click=${this._handleClick}>
1622
- <uc-icon name="upload"></uc-icon>
1623
- <span>${this.l10n(this._buttonTextKey)}</span>
1624
- ${this.yield("")}
1625
- <div class="uc-visual-drop-area">${this.l10n("drop-files-here")}</div>
1626
- </button>
1627
- </uc-drop-area>
1628
- `;
1629
- }
1630
- };
1631
- __decorate([n({
1632
- attribute: "dropzone",
1633
- type: Boolean
1634
- })], SimpleBtn.prototype, "dropzone", void 0), __decorate([r()], SimpleBtn.prototype, "_buttonTextKey", void 0);
1635
- var PluginActivityHost = class extends LitActivityBlock {
1636
- constructor(...g) {
1637
- super(...g), this.activityType = null, this._containerRef = e();
1638
- }
1639
- initCallback() {
1640
- this.activityType = this.registration?.id ?? null, super.initCallback(), this._ensureRegistered();
1641
- }
1642
- willUpdate(g) {
1643
- super.willUpdate(g), g.has("registration") && (this._ensureRegistered(), this.isActivityActive && (this._disposeActivity(), this._renderActivity()));
1644
- }
1645
- _ensureRegistered() {
1646
- this.registration && (this._isActivityRegistered() || this.registerActivity(this.activityType ?? "", {
1647
- onActivate: () => this._renderActivity(),
1648
- onDeactivate: () => this._disposeActivity()
1649
- }));
1650
- }
1651
- _renderActivity() {
1652
- let g = this._containerRef.value;
1653
- if (!g || !this.registration) return;
1654
- this._disposeActivity();
1655
- let B = this.$["*currentActivityParams"];
1656
- this._dispose = this.registration.render(g, B) ?? void 0;
1657
- }
1658
- _disposeActivity() {
1659
- this._dispose?.(), this._dispose = void 0;
1660
- let g = this._containerRef.value;
1661
- g && g.replaceChildren();
1662
- }
1663
- disconnectedCallback() {
1664
- this._disposeActivity(), super.disconnectedCallback();
1665
- }
1666
- render() {
1667
- return b`<div
1668
- style="display: flex; flex-direction: column; width: 100%; min-height: 0;"
1669
- ${n$1(this._containerRef)}
1670
- ></div>`;
1671
- }
1672
- };
1673
- __decorate([n({ attribute: !1 })], PluginActivityHost.prototype, "registration", void 0);
1674
- var PluginActivityRenderer = class extends LitBlock {
1675
- constructor(...g) {
1676
- super(...g), this.mode = "modal", this._activities = [];
1677
- }
1678
- initCallback() {
1679
- super.initCallback();
1680
- let g = this._sharedInstancesBag.pluginManager;
1681
- g?.onPluginsChange && (this._unsubscribePlugins = g.onPluginsChange(() => this._syncActivities())), this._syncActivities();
1682
- }
1683
- _syncActivities() {
1684
- let g = this._sharedInstancesBag.pluginManager;
1685
- if (!g) {
1686
- this._activities = [];
1687
- return;
1688
- }
1689
- this._activities = g.snapshot().activities;
1690
- }
1691
- disconnectedCallback() {
1692
- this._unsubscribePlugins?.(), this._unsubscribePlugins = void 0, super.disconnectedCallback();
1693
- }
1694
- render() {
1695
- return this.mode === "inline" ? b`${c(this._activities, (g) => g.id, (g) => b`<uc-plugin-activity-host .registration=${g}></uc-plugin-activity-host>`)}` : b`${c(this._activities, (g) => g.id, (g) => b`
1696
- <uc-modal id=${g.id} strokes block-body-scrolling>
1697
- <uc-plugin-activity-host .registration=${g}></uc-plugin-activity-host>
1698
- </uc-modal>
1699
- `)}`;
1700
- }
1701
- };
1702
- __decorate([n({ type: String })], PluginActivityRenderer.prototype, "mode", void 0), __decorate([r()], PluginActivityRenderer.prototype, "_activities", void 0);
1703
- var FileUploaderRegular = class extends LitSolutionBlock {
1704
- static {
1705
- this.styleAttrs = [...super.styleAttrs, "uc-file-uploader-regular"];
1706
- }
1707
- constructor() {
1708
- super(), this.headless = !1, this.init$ = { ...this.init$ };
1709
- }
1710
- initCallback() {
1711
- super.initCallback(), this.telemetryManager.sendEvent({ eventType: InternalEventType.INIT_SOLUTION });
1712
- }
1713
- render() {
1714
- return b`
1715
- ${super.render()}
1716
- <uc-simple-btn ?hidden=${this.headless}></uc-simple-btn>
1717
-
1718
- <uc-modal id="start-from" strokes block-body-scrolling>
1719
- <uc-start-from>
1720
- <uc-drop-area with-icon clickable></uc-drop-area>
1721
- <uc-source-list role="list" wrap></uc-source-list>
1722
- <button type="button" class="uc-secondary-btn" @click=${this.$["*historyBack"]}>${this.l10n("start-from-cancel")}</button>
1723
- <uc-copyright></uc-copyright>
1724
- </uc-start-from>
1725
- </uc-modal>
1726
-
1727
- <uc-modal id="upload-list" strokes block-body-scrolling>
1728
- <uc-upload-list></uc-upload-list>
1729
- </uc-modal>
1730
-
1731
- <uc-plugin-activity-renderer mode="modal"></uc-plugin-activity-renderer>
1732
- `;
1733
- }
1734
- };
1735
- __decorate([n({ type: Boolean })], FileUploaderRegular.prototype, "headless", void 0);
1736
- var FileUploaderInline = class extends LitSolutionBlock {
1737
- static {
1738
- this.styleAttrs = [...super.styleAttrs, "uc-file-uploader-inline"];
1739
- }
1740
- constructor() {
1741
- super(), this._couldCancel = !1, this._handleCancel = () => {
1742
- if (this._couldHistoryBack) {
1743
- let g = this.$["*historyBack"];
1744
- g?.();
1745
- return;
1746
- }
1747
- this._couldShowList && (this.$["*currentActivity"] = LitActivityBlock.activities.UPLOAD_LIST);
1748
- }, this.init$ = { ...this.init$ };
1749
- }
1750
- get _couldHistoryBack() {
1751
- let g = this.$["*history"];
1752
- return !g || g.length <= 1 ? !1 : g[g.length - 1] !== LitActivityBlock.activities.START_FROM;
1753
- }
1754
- get _couldShowList() {
1755
- let g = this.$["*uploadList"];
1756
- return this.cfg.showEmptyList || Array.isArray(g) && g.length > 0;
1757
- }
1758
- _getInitActivity() {
1759
- return this.getCssData("--cfg-init-activity") || LitActivityBlock.activities.START_FROM;
1760
- }
1761
- initCallback() {
1762
- super.initCallback(), this.telemetryManager.sendEvent({ eventType: InternalEventType.INIT_SOLUTION });
1763
- let g = this._getInitActivity();
1764
- this.sub("*currentActivity", (B) => {
1765
- B || (this.$["*currentActivity"] = g);
1766
- }), this.sub("*uploadList", (B) => {
1767
- Array.isArray(B) && B.length > 0 && this.$["*currentActivity"] === g && (this.$["*currentActivity"] = LitActivityBlock.activities.UPLOAD_LIST);
1768
- }), this.sub("*history", () => {
1769
- this._couldCancel = this._couldHistoryBack || this._couldShowList;
1770
- });
1771
- }
1772
- render() {
1773
- return b`
1774
- ${super.render()}
1775
- <uc-start-from>
1776
- <uc-drop-area with-icon clickable></uc-drop-area>
1777
- <uc-source-list role="list" wrap></uc-source-list>
1778
- <button
1779
- type="button"
1780
- class="uc-cancel-btn uc-secondary-btn"
1781
- @click=${this._handleCancel}
1782
- ?hidden=${!this._couldCancel}
1783
- >
1784
- ${this.l10n("start-from-cancel")}
1785
- </button>
1786
- <uc-copyright></uc-copyright>
1787
- </uc-start-from>
1788
- <uc-upload-list></uc-upload-list>
1789
- <uc-plugin-activity-renderer mode="inline"></uc-plugin-activity-renderer>
1790
- `;
1791
- }
1792
- };
1793
- __decorate([r()], FileUploaderInline.prototype, "_couldCancel", void 0);
1794
- var ACTIVE_CLASS = "active", EMPTY_CLASS = "", FileUploaderMinimal = class extends LitSolutionBlock {
1795
- static {
1796
- this.styleAttrs = [...super.styleAttrs, "uc-file-uploader-minimal"];
1797
- }
1798
- _getInitActivity() {
1799
- return this.getCssData("--cfg-init-activity") || LitActivityBlock.activities.START_FROM;
1800
- }
1801
- constructor() {
1802
- super(), this._singleUpload = !1, this._isHiddenStartFrom = !1, this._classUploadList = EMPTY_CLASS, this._classStartFrom = EMPTY_CLASS, this._handleModalOpen = (g) => {
1803
- g.id === LitActivityBlock.activities.CLOUD_IMG_EDIT && (this._classUploadList = ACTIVE_CLASS), this.$["*currentActivity"] === LitActivityBlock.activities.UPLOAD_LIST && (this._classUploadList = ACTIVE_CLASS, this._isHiddenStartFrom = !0);
1804
- let B = this.$["*uploadList"];
1805
- (!B || B.length <= 0) && (this._classStartFrom = ACTIVE_CLASS);
1806
- }, this._handleModalClose = (g) => {
1807
- g.id === this.$["*currentActivity"] && (this.$["*currentActivity"] = LitActivityBlock.activities.UPLOAD_LIST, this._isHiddenStartFrom = !1), g.id === LitActivityBlock.activities.CLOUD_IMG_EDIT && (this.$["*currentActivity"] = LitActivityBlock.activities.UPLOAD_LIST);
1808
- }, this.init$ = { ...this.init$ };
1809
- }
1810
- initCallback() {
1811
- super.initCallback(), this.telemetryManager.sendEvent({ eventType: InternalEventType.INIT_SOLUTION });
1812
- let g = this._getInitActivity();
1813
- this.sub("*currentActivity", (B) => {
1814
- B === LitActivityBlock.activities.UPLOAD_LIST && this.modalManager?.closeAll(), B || (this.$["*currentActivity"] = g);
1815
- }), this.sub("*uploadList", (B) => {
1816
- Array.isArray(B) && B.length > 0 ? (this.$["*currentActivity"] = LitActivityBlock.activities.UPLOAD_LIST, this._classStartFrom = EMPTY_CLASS) : (this._classUploadList = EMPTY_CLASS, this._isHiddenStartFrom = !1, this.$["*currentActivity"] = g);
1817
- }), this.subConfigValue("confirmUpload", (g) => {
1818
- g !== !1 && (this.cfg.confirmUpload = !1);
1819
- }), this.subConfigValue("filesViewMode", (g) => {
1820
- this.setAttribute("mode", g), this.subConfigValue("multiple", (B) => {
1821
- g === "grid" ? (B ? this.style.removeProperty("--uc-grid-col") : this.style.setProperty("--uc-grid-col", "1"), this._singleUpload = !B) : (this.style.removeProperty("--uc-grid-col"), this._singleUpload = !1);
1822
- });
1823
- }), this.modalManager?.subscribe(ModalEvents.OPEN, this._handleModalOpen), this.modalManager?.subscribe(ModalEvents.CLOSE, this._handleModalClose);
1824
- }
1825
- disconnectedCallback() {
1826
- super.disconnectedCallback(), this.modalManager?.unsubscribe(ModalEvents.OPEN, this._handleModalOpen), this.modalManager?.unsubscribe(ModalEvents.CLOSE, this._handleModalClose);
1827
- }
1828
- render() {
1829
- return b`
1830
- ${super.render()}
1831
- <uc-start-from ?hidden=${this._isHiddenStartFrom} class=${this._classStartFrom}>
1832
- <uc-drop-area
1833
- ?single=${this._singleUpload}
1834
- initflow
1835
- clickable
1836
- tabindex="0"
1837
- ><span>${this.l10n("choose-file")}</span></uc-drop-area>
1838
- <uc-copyright></uc-copyright>
1839
- </uc-start-from>
1840
- <uc-upload-list class=${this._classUploadList}></uc-upload-list>
1841
-
1842
- <uc-modal id="start-from" strokes block-body-scrolling>
1843
- <uc-start-from>
1844
- <uc-drop-area with-icon clickable></uc-drop-area>
1845
- <uc-source-list role="list" wrap></uc-source-list>
1846
- <button
1847
- type="button"
1848
- class="uc-secondary-btn"
1849
- @click=${this.$["*historyBack"]}
1850
- >${this.l10n("start-from-cancel")}</button>
1851
- </uc-start-from>
1852
- </uc-modal>
1853
-
1854
- <uc-plugin-activity-renderer mode="modal"></uc-plugin-activity-renderer>
1855
- `;
1856
- }
1857
- };
1858
- __decorate([r()], FileUploaderMinimal.prototype, "_singleUpload", void 0), __decorate([r()], FileUploaderMinimal.prototype, "_isHiddenStartFrom", void 0), __decorate([r()], FileUploaderMinimal.prototype, "_classUploadList", void 0), __decorate([r()], FileUploaderMinimal.prototype, "_classStartFrom", void 0);
1859
- export { LitActivityBlock as ActivityBlock, ActivityHeader, BaseComponent, LitBlock as Block, CameraSource, Config, Copyright, PubSub as Data, DropArea, ExternalSource, ExternalUploadSource, FileItem, FileUploaderInline, FileUploaderMinimal, FileUploaderRegular, FormInput, Icon, Img, Modal, ModalEvents, PACKAGE_NAME, PACKAGE_VERSION, PluginActivityHost, PluginActivityRenderer, ProgressBar, ProgressBarCommon, Select, SimpleBtn, LitSolutionBlock as SolutionBlock, SourceBtn, SourceList, Spinner, StartFrom, Thumb, UID, UploadCtxProvider, UploadList, UploadSource, LitUploaderBlock as UploaderBlock, UrlSource, defineComponents, defineLocale, loadFileUploaderFrom, toKebabCase };
2
+ * @license
3
+ * Package: @uploadcare/file-uploader@1.28.0-alpha.666 (MIT)
4
+ * License: https://github.com/uploadcare/blob/main/LICENSE
5
+ * Built: 2026-03-12T12:26:09.303Z
6
+ */
7
+ var $s=Object.defineProperty;var Il=Object.getOwnPropertyDescriptor;var Ds=(o,i)=>{for(var t in i)$s(o,t,{get:i[t],enumerable:true});};var p=(o,i,t,e)=>{for(var r=e>1?void 0:e?Il(i,t):i,s=o.length-1,n;s>=0;s--)(n=o[s])&&(r=(e?n(i,t,r):n(r))||r);return e&&r&&$s(i,t,r),r};var At=[],Yt=0,_i=4,Fs=o=>{let i=[],t={get(){return t.lc||t.listen(()=>{})(),t.value},lc:0,listen(e){return t.lc=i.push(e),()=>{for(let s=Yt+_i;s<At.length;)At[s]===e?At.splice(s,_i):s+=_i;let r=i.indexOf(e);~r&&(i.splice(r,1),--t.lc||t.off());}},notify(e,r){let s=!At.length;for(let n of i)At.push(n,t.value,e,r);if(s){for(Yt=0;Yt<At.length;Yt+=_i)At[Yt](At[Yt+1],At[Yt+2],At[Yt+3]);At.length=0;}},off(){},set(e){let r=t.value;r!==e&&(t.value=e,t.notify(r));},subscribe(e){let r=t.listen(e);return e(t.value),r},value:o};return t};function zi(o,i,t){let e=new Set(i).add(void 0);return o.listen((r,s,n)=>{e.has(n)&&t(r,s,n);})}function po(o,i,t){let e=zi(o,i,t);return t(o.value),e}var ho=(o={})=>{let i=Fs(o);return i.setKey=function(t,e){let r=i.value;typeof e>"u"&&t in i.value?(i.value={...i.value},delete i.value[t],i.notify(r,t)):i.value[t]!==e&&(i.value={...i.value,[t]:e},i.notify(r,t));},i};var H=class o{static{this.Gt=new Map;}constructor(i,t){this.J=i,this.ae=t;}get id(){return this.J}pub(i,t){i in this.ae.get()||console.warn(`PubSub#pub: Key "${String(i)}" not found`),this.ae.setKey(i,t);}sub(i,t,e=true){return (e?po:zi)(this.ae,[i],s=>{t(s[i]);})}read(i){return i in this.ae.get()||console.warn(`PubSub#read: Key "${String(i)}" not found`),this.ae.get()[i]}add(i,t,e=false){(!(i in this.ae.get())||e)&&this.ae.setKey(i,t);}has(i){return i in this.ae.get()}get store(){return this.ae.get()}static registerCtx(i,t){if(o.Gt.has(t))throw new Error(`PubSub: Context with id "${t}" already exists`);let e=ho(i);return o.Gt.set(t,e),new o(t,e)}static deleteCtx(i){o.Gt.delete(i);}static getCtx(i){let t=o.Gt.get(i);return t?new o(i,t):null}static hasCtx(i){return o.Gt.has(i)}};var Bi=globalThis,Ki=Bi.ShadowRoot&&(Bi.ShadyCSS===void 0||Bi.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ns=Symbol(),Vs=new WeakMap,Hi=class{constructor(i,t,e){if(this.Ec=true,e!==Ns)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=i,this.t=t;}get styleSheet(){let i=this.o,t=this.t;if(Ki&&i===void 0){let e=t!==void 0&&t.length===1;e&&(i=Vs.get(t)),i===void 0&&((this.o=i=new CSSStyleSheet).replaceSync(this.cssText),e&&Vs.set(t,i));}return i}toString(){return this.cssText}},_s=o=>new Hi(typeof o=="string"?o:o+"",void 0,Ns);var zs=(o,i)=>{if(Ki)o.adoptedStyleSheets=i.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of i){let e=document.createElement("style"),r=Bi.litNonce;r!==void 0&&e.setAttribute("nonce",r),e.textContent=t.cssText,o.appendChild(e);}},fo=Ki?o=>o:o=>o instanceof CSSStyleSheet?(i=>{let t="";for(let e of i.cssRules)t+=e.cssText;return _s(t)})(o):o;var{is:Ll,defineProperty:Pl,getOwnPropertyDescriptor:Ul,getOwnPropertyNames:Rl,getOwnPropertySymbols:$l,getPrototypeOf:Dl}=Object,ji=globalThis,Bs=ji.trustedTypes,Fl=Bs?Bs.emptyScript:"",Vl=ji.reactiveElementPolyfillSupport,oi=(o,i)=>o,si={toAttribute(o,i){switch(i){case Boolean:o=o?Fl:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o);}return o},fromAttribute(o,i){let t=o;switch(i){case Boolean:t=o!==null;break;case Number:t=o===null?null:Number(o);break;case Object:case Array:try{t=JSON.parse(o);}catch{t=null;}}return t}},Gi=(o,i)=>!Ll(o,i),Hs={attribute:true,type:String,converter:si,reflect:false,useDefault:false,hasChanged:Gi};Symbol.metadata??=Symbol("metadata"),ji.litPropertyMetadata??=new WeakMap;var _t=class extends HTMLElement{static addInitializer(i){this.Vr(),(this.l??=[]).push(i);}static get observedAttributes(){return this.finalize(),this.Ii&&[...this.Ii.keys()]}static createProperty(i,t=Hs){if(t.state&&(t.attribute=false),this.Vr(),this.prototype.hasOwnProperty(i)&&((t=Object.create(t)).wrapped=true),this.elementProperties.set(i,t),!t.noAccessor){let e=Symbol(),r=this.getPropertyDescriptor(i,e,t);r!==void 0&&Pl(this.prototype,i,r);}}static getPropertyDescriptor(i,t,e){let{get:r,set:s}=Ul(this.prototype,i)??{get(){return this[t]},set(n){this[t]=n;}};return {get:r,set(n){let a=r?.call(this);s?.call(this,n),this.requestUpdate(i,a,e);},configurable:true,enumerable:true}}static getPropertyOptions(i){return this.elementProperties.get(i)??Hs}static Vr(){if(this.hasOwnProperty(oi("elementProperties")))return;let i=Dl(this);i.finalize(),i.l!==void 0&&(this.l=[...i.l]),this.elementProperties=new Map(i.elementProperties);}static finalize(){if(this.hasOwnProperty(oi("finalized")))return;if(this.finalized=true,this.Vr(),this.hasOwnProperty(oi("properties"))){let t=this.properties,e=[...Rl(t),...$l(t)];for(let r of e)this.createProperty(r,t[r]);}let i=this[Symbol.metadata];if(i!==null){let t=litPropertyMetadata.get(i);if(t!==void 0)for(let[e,r]of t)this.elementProperties.set(e,r);}this.Ii=new Map;for(let[t,e]of this.elementProperties){let r=this._r(t,e);r!==void 0&&this.Ii.set(r,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(i){let t=[];if(Array.isArray(i)){let e=new Set(i.flat(1/0).reverse());for(let r of e)t.unshift(fo(r));}else i!==void 0&&t.push(fo(i));return t}static _r(i,t){let e=t.attribute;return e===false?void 0:typeof e=="string"?e:typeof i=="string"?i.toLowerCase():void 0}constructor(){super(),this.Oi=void 0,this.isUpdatePending=false,this.hasUpdated=false,this.yt=null,this.Cc();}Cc(){this.Br=new Promise(i=>this.enableUpdating=i),this.Fe=new Map,this.Sc(),this.requestUpdate(),this.constructor.l?.forEach(i=>i(this));}addController(i){(this.qt??=new Set).add(i),this.renderRoot!==void 0&&this.isConnected&&i.hostConnected?.();}removeController(i){this.qt?.delete(i);}Sc(){let i=new Map,t=this.constructor.elementProperties;for(let e of t.keys())this.hasOwnProperty(e)&&(i.set(e,this[e]),delete this[e]);i.size>0&&(this.Oi=i);}createRenderRoot(){let i=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return zs(i,this.constructor.elementStyles),i}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this.qt?.forEach(i=>i.hostConnected?.());}enableUpdating(i){}disconnectedCallback(){this.qt?.forEach(i=>i.hostDisconnected?.());}attributeChangedCallback(i,t,e){this.zr(i,e);}Ac(i,t){let e=this.constructor.elementProperties.get(i),r=this.constructor._r(i,e);if(r!==void 0&&e.reflect===true){let s=(e.converter?.toAttribute!==void 0?e.converter:si).toAttribute(t,e.type);this.yt=i,s==null?this.removeAttribute(r):this.setAttribute(r,s),this.yt=null;}}zr(i,t){let e=this.constructor,r=e.Ii.get(i);if(r!==void 0&&this.yt!==r){let s=e.getPropertyOptions(r),n=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:si;this.yt=r;let a=n.fromAttribute(t,s.type);this[r]=a??this.Hr?.get(r)??a,this.yt=null;}}requestUpdate(i,t,e,r=false,s){if(i!==void 0){let n=this.constructor;if(r===false&&(s=this[i]),e??=n.getPropertyOptions(i),!((e.hasChanged??Gi)(s,t)||e.useDefault&&e.reflect&&s===this.Hr?.get(i)&&!this.hasAttribute(n._r(i,e))))return;this.C(i,t,e);}this.isUpdatePending===false&&(this.Br=this.kc());}C(i,t,{useDefault:e,reflect:r,wrapped:s},n){e&&!(this.Hr??=new Map).has(i)&&(this.Hr.set(i,n??t??this[i]),s!==true||n!==void 0)||(this.Fe.has(i)||(this.hasUpdated||e||(t=void 0),this.Fe.set(i,t)),r===true&&this.yt!==i&&(this.zs??=new Set).add(i));}async kc(){this.isUpdatePending=true;try{await this.Br;}catch(t){Promise.reject(t);}let i=this.scheduleUpdate();return i!=null&&await i,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this.Oi){for(let[r,s]of this.Oi)this[r]=s;this.Oi=void 0;}let e=this.constructor.elementProperties;if(e.size>0)for(let[r,s]of e){let{wrapped:n}=s,a=this[r];n!==true||this.Fe.has(r)||a===void 0||this.C(r,void 0,s,a);}}let i=false,t=this.Fe;try{i=this.shouldUpdate(t),i?(this.willUpdate(t),this.qt?.forEach(e=>e.hostUpdate?.()),this.update(t)):this.Kr();}catch(e){throw i=false,this.Kr(),e}i&&this.Mc(t);}willUpdate(i){}Mc(i){this.qt?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(i)),this.updated(i);}Kr(){this.Fe=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.Br}shouldUpdate(i){return true}update(i){this.zs&&=this.zs.forEach(t=>this.Ac(t,this[t])),this.Kr();}updated(i){}firstUpdated(i){}};_t.elementStyles=[],_t.shadowRootOptions={mode:"open"},_t[oi("elementProperties")]=new Map,_t[oi("finalized")]=new Map,Vl?.({ReactiveElement:_t}),(ji.reactiveElementVersions??=[]).push("2.1.2");var go=globalThis,Ks=o=>o,qi=go.trustedTypes,js=qi?qi.createPolicy("lit-html",{createHTML:o=>o}):void 0,vo="$lit$",zt=`lit$${Math.random().toFixed(9).slice(2)}$`,yo="?"+zt,Nl=`<${yo}>`,he=document,ai=()=>he.createComment(""),li=o=>o===null||typeof o!="object"&&typeof o!="function",bo=Array.isArray,Xs=o=>bo(o)||typeof o?.[Symbol.iterator]=="function",mo=`[ \f\r]`,ni=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Gs=/-->/g,qs=/>/g,de=RegExp(`>|${mo}(?:([^\\s"'>=/]+)(${mo}*=${mo}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),Ws=/'/g,Zs=/"/g,Qs=/^(?:script|style|textarea|title)$/i,wo=o=>(i,...t)=>({Ne:o,strings:i,values:t}),v=wo(1),it=Symbol.for("lit-noChange"),U=Symbol.for("lit-nothing"),Ys=new WeakMap,pe=he.createTreeWalker(he,129);function Js(o,i){if(!bo(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return js!==void 0?js.createHTML(i):i}var tn=(o,i)=>{let t=o.length-1,e=[],r,s=i===2?"<svg>":i===3?"<math>":"",n=ni;for(let a=0;a<t;a++){let l=o[a],c,d,u=-1,h=0;for(;h<l.length&&(n.lastIndex=h,d=n.exec(l),d!==null);)h=n.lastIndex,n===ni?d[1]==="!--"?n=Gs:d[1]!==void 0?n=qs:d[2]!==void 0?(Qs.test(d[2])&&(r=RegExp("</"+d[2],"g")),n=de):d[3]!==void 0&&(n=de):n===de?d[0]===">"?(n=r??ni,u=-1):d[1]===void 0?u=-2:(u=n.lastIndex-d[2].length,c=d[1],n=d[3]===void 0?de:d[3]==='"'?Zs:Ws):n===Zs||n===Ws?n=de:n===Gs||n===qs?n=ni:(n=de,r=void 0);let f=n===de&&o[a+1].startsWith("/>")?" ":"";s+=n===ni?l+Nl:u>=0?(e.push(c),l.slice(0,u)+vo+l.slice(u)+zt+f):l+zt+(u===-2?a:f);}return [Js(o,s+(o[t]||"<?>")+(i===2?"</svg>":i===3?"</math>":"")),e]},ci=class o{constructor({strings:i,Ne:t},e){let r;this.parts=[];let s=0,n=0,a=i.length-1,l=this.parts,[c,d]=tn(i,t);if(this.el=o.createElement(c,e),pe.currentNode=this.el.content,t===2||t===3){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes);}for(;(r=pe.nextNode())!==null&&l.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(let u of r.getAttributeNames())if(u.endsWith(vo)){let h=d[n++],f=r.getAttribute(u).split(zt),g=/([.?@])?(.*)/.exec(h);l.push({type:1,index:s,name:g[2],strings:f,ctor:g[1]==="."?Zi:g[1]==="?"?Yi:g[1]==="@"?Xi:me}),r.removeAttribute(u);}else u.startsWith(zt)&&(l.push({type:6,index:s}),r.removeAttribute(u));if(Qs.test(r.tagName)){let u=r.textContent.split(zt),h=u.length-1;if(h>0){r.textContent=qi?qi.emptyScript:"";for(let f=0;f<h;f++)r.append(u[f],ai()),pe.nextNode(),l.push({type:2,index:++s});r.append(u[h],ai());}}}else if(r.nodeType===8)if(r.data===yo)l.push({type:2,index:s});else {let u=-1;for(;(u=r.data.indexOf(zt,u+1))!==-1;)l.push({type:7,index:s}),u+=zt.length-1;}s++;}}static createElement(i,t){let e=he.createElement("template");return e.innerHTML=i,e}};function fe(o,i,t=o,e){if(i===it)return i;let r=e!==void 0?t.Ic?.[e]:t.Oc,s=li(i)?void 0:i.jr;return r?.constructor!==s&&(r?.Hs?.(false),s===void 0?r=void 0:(r=new s(o),r.Gr(o,t,e)),e!==void 0?(t.Ic??=[])[e]=r:t.Oc=r),r!==void 0&&(i=fe(o,r.Pc(o,i.values),r,e)),i}var Wi=class{constructor(i,t){this.Ks=[],this.le=void 0,this.js=i,this.f=t;}get parentNode(){return this.f.parentNode}get W(){return this.f.W}u(i){let{el:{content:t},parts:e}=this.js,r=(i?.creationScope??he).importNode(t,true);pe.currentNode=r;let s=pe.nextNode(),n=0,a=0,l=e[0];for(;l!==void 0;){if(n===l.index){let c;l.type===2?c=new ke(s,s.nextSibling,this,i):l.type===1?c=new l.ctor(s,l.name,l.strings,this,i):l.type===6&&(c=new Qi(s,this,i)),this.Ks.push(c),l=e[++a];}n!==l?.index&&(s=pe.nextNode(),n++);}return pe.currentNode=he,r}p(i){let t=0;for(let e of this.Ks)e!==void 0&&(e.strings!==void 0?(e.ce(i,e,t),t+=e.strings.length-2):e.ce(i[t])),t++;}},ke=class o{get W(){return this.f?.W??this.Gs}constructor(i,t,e,r){this.type=2,this.r=U,this.le=void 0,this.ge=i,this.bt=t,this.f=e,this.options=r,this.Gs=r?.isConnected??true;}get parentNode(){let i=this.ge.parentNode,t=this.f;return t!==void 0&&i?.nodeType===11&&(i=t.parentNode),i}get startNode(){return this.ge}get endNode(){return this.bt}ce(i,t=this){i=fe(this,i,t),li(i)?i===U||i==null||i===""?(this.r!==U&&this.wt(),this.r=U):i!==this.r&&i!==it&&this.qs(i):i.Ne!==void 0?this.$(i):i.nodeType!==void 0?this.T(i):Xs(i)?this.k(i):this.qs(i);}O(i){return this.ge.parentNode.insertBefore(i,this.bt)}T(i){this.r!==i&&(this.wt(),this.r=this.O(i));}qs(i){this.r!==U&&li(this.r)?this.ge.nextSibling.data=i:this.T(he.createTextNode(i)),this.r=i;}$(i){let{values:t,Ne:e}=i,r=typeof e=="number"?this.Lc(i):(e.el===void 0&&(e.el=ci.createElement(Js(e.h,e.h[0]),this.options)),e);if(this.r?.js===r)this.r.p(t);else {let s=new Wi(r,this),n=s.u(this.options);s.p(t),this.T(n),this.r=s;}}Lc(i){let t=Ys.get(i.strings);return t===void 0&&Ys.set(i.strings,t=new ci(i)),t}k(i){bo(this.r)||(this.r=[],this.wt());let t=this.r,e,r=0;for(let s of i)r===t.length?t.push(e=new o(this.O(ai()),this.O(ai()),this,this.options)):e=t[r],e.ce(s),r++;r<t.length&&(this.wt(e&&e.bt.nextSibling,r),t.length=r);}wt(i=this.ge.nextSibling,t){for(this.Pi?.(false,true,t);i!==this.bt;){let e=Ks(i).nextSibling;Ks(i).remove(),i=e;}}setConnected(i){this.f===void 0&&(this.Gs=i,this.Pi?.(i));}},me=class{get tagName(){return this.element.tagName}get W(){return this.f.W}constructor(i,t,e,r,s){this.type=1,this.r=U,this.le=void 0,this.element=i,this.name=t,this.f=r,this.options=s,e.length>2||e[0]!==""||e[1]!==""?(this.r=Array(e.length-1).fill(new String),this.strings=e):this.r=U;}ce(i,t=this,e,r){let s=this.strings,n=false;if(s===void 0)i=fe(this,i,t,0),n=!li(i)||i!==this.r&&i!==it,n&&(this.r=i);else {let a=i,l,c;for(i=s[0],l=0;l<s.length-1;l++)c=fe(this,a[e+l],t,l),c===it&&(c=this.r[l]),n||=!li(c)||c!==this.r[l],c===U?i=U:i!==U&&(i+=(c??"")+s[l+1]),this.r[l]=c;}n&&!r&&this.j(i);}j(i){i===U?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,i??"");}},Zi=class extends me{constructor(){super(...arguments),this.type=3;}j(i){this.element[this.name]=i===U?void 0:i;}},Yi=class extends me{constructor(){super(...arguments),this.type=4;}j(i){this.element.toggleAttribute(this.name,!!i&&i!==U);}},Xi=class extends me{constructor(i,t,e,r,s){super(i,t,e,r,s),this.type=5;}ce(i,t=this){if((i=fe(this,i,t,0)??U)===it)return;let e=this.r,r=i===U&&e!==U||i.capture!==e.capture||i.once!==e.once||i.passive!==e.passive,s=i!==U&&(e===U||r);r&&this.element.removeEventListener(this.name,this,e),s&&this.element.addEventListener(this.name,this,i),this.r=i;}handleEvent(i){typeof this.r=="function"?this.r.call(this.options?.host??this.element,i):this.r.handleEvent(i);}},Qi=class{constructor(i,t,e){this.element=i,this.type=6,this.le=void 0,this.f=t,this.options=e;}get W(){return this.f.W}ce(i){fe(this,i);}},en={I:ke},_l=go.litHtmlPolyfillSupport;_l?.(ci,ke),(go.litHtmlVersions??=[]).push("3.3.2");var rn=(o,i,t)=>{let e=t?.renderBefore??i,r=e.Rc;if(r===void 0){let s=t?.renderBefore??null;e.Rc=r=new ke(i.insertBefore(ai(),s),s,void 0,t??{});}return r.ce(o),r};var To=globalThis,wt=class extends _t{constructor(){super(...arguments),this.renderOptions={host:this},this.qr=void 0;}createRenderRoot(){let i=super.createRenderRoot();return this.renderOptions.renderBefore??=i.firstChild,i}update(i){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(i),this.qr=rn(t,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this.qr?.setConnected(true);}disconnectedCallback(){super.disconnectedCallback(),this.qr?.setConnected(false);}render(){return it}};wt.Gp=true,wt.finalized=true,To.litElementHydrateSupport?.({LitElement:wt});var zl=To.litElementPolyfillSupport;zl?.({LitElement:wt});(To.litElementVersions??=[]).push("4.2.2");var Bl=/\\([0-9a-fA-F]{1,6} ?)/g;function Hl(o){return o.length<2?false:(o[0]==='"'||o[0]==="'")&&(o[o.length-1]==='"'||o[o.length-1]==="'")}function Kl(o){let i=o;return (i[0]==='"'||i[0]==="'")&&(i=i.slice(1)),(i[i.length-1]==='"'||i[i.length-1]==="'")&&(i=i.slice(0,-1)),i}function jl(o){let i="",t="";for(let e=0;e<o.length;e++){let r=o[e+1];o[e]==="\\"&&r==='"'?(i+='\\"',e++):o[e]==='"'&&t!=="\\"?i+='\\"':i+=o[e],t=o[e]??"";}return i}function on(o){let i=o;Hl(o)&&(i=Kl(i),i=i.replace(Bl,(t,e)=>String.fromCodePoint(parseInt(e.trim(),16))),i=i.replaceAll(`\\ `,"\\n"),i=jl(i),i='"'+i+'"');try{return JSON.parse(i)}catch{return}}function Me(o){class i extends o{constructor(){super(...arguments);this.Ws=null;this.Wr=null;}getCssData(r,s=false){let n=this.Ws??Object.create(null);if(!Object.keys(n).includes(r)||!n[r]){this.Wr||(this.Wr=window.getComputedStyle(this));let a=this.Wr.getPropertyValue(r).trim();try{n[r]=on(a);}catch(l){s||console.warn(`CSS Data error: ${r}`,l),n[r]=null;}}return this.Ws=n,n[r]}}return i}function Ji(o){class i extends o{constructor(){super(...arguments);this.willYield=true;this.Ve={};this._e=null;this.Li=false;}createRenderRoot(){return this}connectedCallback(){this._e||(this._e=Array.from(this.childNodes)),super.connectedCallback();}Uc(){if(this.Li)return;this.Li=true,this.Ve={};let r=Array.from(this.childNodes),s=r.length?r:this._e??[];for(let n of s){let a=this.Zs(n),l=this.Ve[a]??[];n instanceof Element&&(n.removeAttribute("slot"),n.removeAttribute("content-for")),l.push(n),this.Ve[a]=l;}this._e=null;}Zs(r){return r instanceof Comment&&r.nextSibling instanceof Element?this.Zs(r.nextSibling):"contentFor"in r?r.contentFor||"":r instanceof Element&&r.hasAttribute("content-for")&&r.getAttribute("content-for")||""}$c(r){return !r.textContent||!r.textContent.trim()}Dc(r){let s=this.Ve[r];return !s||s.every(n=>n instanceof Comment||n instanceof Text&&this.$c(n))}update(r){!this.hasUpdated&&this.willYield&&this.Uc(),super.update(r);}yield(r,s){if(r===""&&!this.Ve[r]&&!this.Li&&this._e?.length){let a=[];for(let l of this._e)l instanceof Element&&(l.removeAttribute("slot"),l.removeAttribute("content-for")),a.push(l);this.Ve[r]=a,this.Li=true,this._e=null;}let n=this.Ve[r];return v` ${n} ${this.Dc(r)?s:void 0} `}}return i}function Ie(o){class i extends o{static reg(e){let r=this,s=window.customElements.get(e);if(s){s!==r&&console.warn([`Element with tag name "${e}" 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(` `));return}window.customElements.define(e,r);}}return i}var Xt=class extends Event{constructor(i,t,e,r){super("context-request",{bubbles:true,composed:true}),this.context=i,this.contextTarget=t,this.callback=e,this.subscribe=r??false;}};var Oe=class{constructor(i,t,e,r){if(this.subscribe=false,this.provided=false,this.value=void 0,this.t=(s,n)=>{this.unsubscribe&&(this.unsubscribe!==n&&(this.provided=false,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=s,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=true,this.callback&&this.callback(s,n)),this.unsubscribe=n;},this.host=i,t.context!==void 0){let s=t;this.context=s.context,this.callback=s.callback,this.subscribe=s.subscribe??false;}else this.context=t,this.callback=e,this.subscribe=r??false;this.host.addController(this);}hostConnected(){this.dispatchRequest();}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0);}dispatchRequest(){this.host.dispatchEvent(new Xt(this.context,this.host,this.t,this.subscribe));}};var tr=class{get value(){return this.o}set value(i){this.setValue(i);}setValue(i,t=false){let e=t||!Object.is(i,this.o);this.o=i,e&&this.updateObservers();}constructor(i){this.subscriptions=new Map,this.updateObservers=()=>{for(let[t,{disposer:e}]of this.subscriptions)t(this.o,e);},i!==void 0&&(this.value=i);}addCallback(i,t,e){if(!e)return void i(this.value);this.subscriptions.has(i)||this.subscriptions.set(i,{disposer:()=>{this.subscriptions.delete(i);},consumerHost:t});let{disposer:r}=this.subscriptions.get(i);i(this.value,r);}clearCallbacks(){this.subscriptions.clear();}};var Eo=class extends Event{constructor(i,t){super("context-provider",{bubbles:true,composed:true}),this.context=i,this.contextTarget=t;}},Le=class extends tr{constructor(i,t,e){super(t.context!==void 0?t.initialValue:e),this.onContextRequest=r=>{if(r.context!==this.context)return;let s=r.contextTarget??r.composedPath()[0];s!==this.host&&(r.stopPropagation(),this.addCallback(r.callback,s,r.subscribe));},this.onProviderRequest=r=>{if(r.context!==this.context||(r.contextTarget??r.composedPath()[0])===this.host)return;let s=new Set;for(let[n,{consumerHost:a}]of this.subscriptions)s.has(n)||(s.add(n),a.dispatchEvent(new Xt(this.context,a,n,true)));r.stopPropagation();},this.host=i,t.context!==void 0?this.context=t.context:this.context=t,this.attachListeners(),this.host.addController?.(this);}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest);}hostConnected(){this.host.dispatchEvent(new Eo(this.context,this.host));}};var ql={attribute:true,type:String,converter:si,reflect:false,hasChanged:Gi},Wl=(o=ql,i,t)=>{let{kind:e,metadata:r}=t,s=globalThis.litPropertyMetadata.get(r);if(s===void 0&&globalThis.litPropertyMetadata.set(r,s=new Map),e==="setter"&&((o=Object.create(o)).wrapped=true),s.set(t.name,o),e==="accessor"){let{name:n}=t;return {set(a){let l=i.get.call(this);i.set.call(this,a),this.requestUpdate(n,l,o,true,a);},init(a){return a!==void 0&&this.C(n,void 0,o,a),a}}}if(e==="setter"){let{name:n}=t;return function(a){let l=this[n];i.call(this,a),this.requestUpdate(n,l,o,true,a);}}throw Error("Unsupported decorator location: "+e)};function y(o){return (i,t)=>typeof t=="object"?Wl(o,i,t):((e,r,s)=>{let n=r.hasOwnProperty(s);return r.constructor.createProperty(s,e),n?Object.getOwnPropertyDescriptor(r,s):void 0})(o,i,t)}function m(o){return y({...o,state:true,attribute:false})}function $(o,i){let t,e=((...r)=>{t&&clearTimeout(t),t=setTimeout(()=>o(...r),i);});return e.cancel=()=>{t&&clearTimeout(t);},e}var sn="ctx-name-context";function ir(){return function(o){class i extends o{constructor(...r){super(...r);this.ee=null;this.Wt=false;this.Zr=false;this.Yr=void 0;this.Tt=new Map;this.Zt=new Set;this.init$={};this.ctxOwner=false;this.Ri=void 0;this.Ui=false;this.ctxName=this.Ae;this.ke=false;this.Ri=this.getAttribute("ctx-name")||void 0,this.ctxName=this.Ae,this.Fc=new Oe(this,{context:sn,callback:s=>{if(!s){console.error("SymbioteMixin: Received invalid ctx-name from context");return}this.Qs=s,this.Xs();},subscribe:true});}static set template(r){console.error("Caution: static 'template' property is deprecated and has no effect. See https://github.com/uploadcare/file-uploader/releases/tag/v1.25.0 for details.");}get Ys(){return this.Ri}set Ys(r){let s=r??void 0;this.Ri!==s&&(this.Ri=s,this.Xs());}shouldUpdate(r){return this.ke?super.shouldUpdate(r):false}get Ae(){return this.Ys||this.Qs||void 0}Xs(){if(this.ctxName=this.Ae,!(!this.ctxName||this.Wt)){if(this.isConnected){this.Xr();return}this.Ui=true;}}willUpdate(r){super.willUpdate(r),this.ctxName=this.Ae,this.ctxName&&(this.Yr?this.Yr.setValue(this.ctxName):this.Yr=new Le(this,{context:sn,initialValue:this.ctxName}));}Js(){if(!(!this.ee||this.Tt.size===0)){for(let[r,{value:s,rewrite:n}]of this.Tt)this.ee.add(r,s,n);this.Tt.clear();}}en(){return !this.ee&&this.Ae&&this.Qr(),this.ee&&this.Js(),this.ee}$i(){let r=this.en();if(!r)throw new Error("SymbioteMixin: Shared context is not initialized.");return r}Qr(){let r=this.init$,s=this.Ae;if(!s){console.error("SymbioteMixin: ctx-name is required for components with shared properties (*)");return}if(!this.ee){this.ee=H.getCtx(s)??H.registerCtx(r,s);for(let[n,a]of Object.entries(this.init$))this.ee.add(n,a,this.ctxOwner);this.Js();}}get $(){return this.Ae&&this.Qr(),new Proxy({},{get:(r,s)=>{if(typeof s=="string")return this.ee?.read(s)},set:(r,s,n)=>(typeof s!="string"||this.ee?.pub(s,n),true)})}sub(r,s,n=true){let a=this.$i().sub(r,s,n);if(!a||typeof a!="function")return ()=>{};let l=a.bind(a),c=false,d=()=>{c||(c=true,l(),this.Zt.delete(d));};return this.Zt.add(d),d}pub(r,s){this.$i().pub(r,s);}set$(r){for(let[s,n]of Object.entries(r))this.pub(s,n);}get sharedCtx(){return this.$i()}has(r){return this.ee?.has(r)??false}add(r,s,n=false){let a=this.en();if(!a){if(!n&&this.Tt.has(r))return;this.Tt.set(r,{value:s,rewrite:n});return}this.Tt.delete(r),a.add(r,s,n);}add$(r,s=false){for(let[n,a]of Object.entries(r))this.add(n,a,s);}connectedCallback(){super.connectedCallback(),this.Wt?this.ke&&this.Zr&&(this.Zr=false,this.initCallback()):this.ctxName?(this.Ui=false,this.Xr()):this.Ui&&this.Ae&&(this.Ui=false,this.Xr());}Xr(){if(this.Wt)return;this.Wt=true,this.Qr();let r=this.init$;if(Object.keys(r).length>0){let s=this.$i();for(let[n,a]of Object.entries(r))s.read(n)===void 0&&s.pub(n,a),this.sub(n,$(async()=>{this.isConnected&&(await this.updateComplete,this.requestUpdate());},0),false);}this.initCallback(),this.ke=true,this.requestUpdate();}firstUpdated(r){super.firstUpdated(r);}disconnectedCallback(){this.Nc(),super.disconnectedCallback(),this.Wt&&(this.Zr=true);}Nc(){if(this.Zt.size!==0){for(let r of [...this.Zt])r();this.Zt.clear();}}initCallback(){}}return p([y({type:String,attribute:"ctx-name",noAccessor:true})],i.prototype,"Ys",1),p([m()],i.prototype,"Qs",2),p([m()],i.prototype,"ctxName",2),p([m()],i.prototype,"ke",2),i}}var Co=class extends Ie(ir()(Me(Ji(wt)))){};var pt=class o{static generateFastUid(){return `uid-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,11)}`}static generateRandomUUID(){let i=globalThis.crypto;return i&&typeof i.randomUUID=="function"?i.randomUUID():o.generateFastUid()}};var Zl=["UploaderBlock","ActivityBlock","Block","SolutionBlock"];function ht(o){for(let i in o){if(Zl.includes(i))continue;let t=[...i].reduce((e,r)=>(r.toUpperCase()===r&&(r=`-${r.toLowerCase()}`),e+=r,e),"");t.startsWith("-")&&(t=t.replace("-","")),t.startsWith("uc-")||(t=`uc-${t}`),o[i].reg&&o[i].reg(t);}}var xo="UC";function Yl(o,i=false){return new Promise((t,e)=>{if(typeof document!="object"){t(null);return}if(typeof window=="object"&&window[xo]){t(window[xo]);return}let r=document.createElement("script");r.async=true,r.src=o,r.onerror=()=>{e();},r.onload=()=>{let s=window[xo];i&&ht(s),t(s);},document.head.appendChild(r);})}var ui={"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":"{{count}} of {{total}} selected","select-all":"Select all","deselect-all":"Deselect all","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-mobile-video-camera":"Video","src-type-mobile-photo-camera":"Photo","src-type-facebook":"Facebook","src-type-dropbox":"Dropbox","src-type-gdrive":"Google Drive","src-type-ngdrive":"Google Drive","src-type-gphotos":"Google Photos","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-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 occurred. 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","file-item-remove-button":"Remove","a11y-editor-tab-filters":"Filters","a11y-editor-tab-tuning":"Tuning","a11y-editor-tab-crop":"Crop","a11y-activity-header-button-close":"Close",flip:"Flip",mirror:"Mirror","a11y-cloud-editor-apply-filter":"Apply {{name}} filter","a11y-cloud-editor-apply-crop":"Apply {{name}} operation","a11y-cloud-editor-apply-tuning":"Apply {{name}} tuning","a11y-cloud-editor-apply-aspect-ratio":"Apply operation {{name}} {{value}}",finished:"Finished",failed:"Failed",uploading:"Uploading",idle:"Idle","a11y-file-item-status":"File {{fileName}} in status {{status}}","waiting-for":"Waiting for {{source}}","queued-uploading":"Queued for upload","queued-validation":"Queued for validation",validation:"Validating","crop-to-shape":"Crop to {{value}}",custom:"Freeform","freeform-crop":"Freeform crop"};var So=new Map,nn=new Map,an=(o,i)=>{So.has(o)&&console.log(`Locale ${o} is already defined. Overwriting...`);let t={...ui,...i};return So.set(o,t),t},Xl=(o,i)=>{nn.set(o,i);},ln=(o,i)=>{typeof i=="function"?Xl(o,i):an(o,i);},cn=async o=>{let i=So.get(o);if(!i){let t=nn.get(o);if(!t)throw new Error(`Locale ${o} is not defined`);let e=await t();i=an(o,e);}return i};ln("en",ui);var O=o=>`*cfg/${o}`;var K=o=>o?o.split(",").map(i=>i.trim()).filter(Boolean):[],Bt=o=>o.join(",");var un=o=>{if(typeof o!="string"||!o)return "";let i=o.trim();return i.startsWith("-/")?i=i.slice(2):i.startsWith("/")&&(i=i.slice(1)),i.endsWith("/")&&(i=i.slice(0,i.length-1)),i},rr=(...o)=>o.filter(i=>typeof i=="string"&&!!i).map(i=>un(i)).join("/-/"),rt=(...o)=>{let i=rr(...o);return i?`-/${i}/`:""};function or(o){let i=new URL(o),t=i.pathname+i.search+i.hash,e=t.lastIndexOf("http"),r=t.lastIndexOf("/"),s="";return e>=0?s=t.slice(e):r>=0&&(s=t.slice(r+1)),s}function sr(o){let i=new URL(o),{pathname:t}=i,e=t.indexOf("/"),r=t.indexOf("/",e+1);return t.substring(e+1,r)}function Ao(o){let i=dn(o),t=new URL(i),e=t.pathname.indexOf("/-/");return e===-1?"":t.pathname.substring(e).slice(1)}function ko(o){return Ao(o).split("/-/").filter(Boolean).map(t=>un(t))}function dn(o){let i=new URL(o),t=or(o),e=pn(t)?hn(t).pathname:t;return i.pathname=i.pathname.replace(e,""),i.search="",i.hash="",i.toString()}function pn(o){return o.startsWith("http")}function hn(o){let i=new URL(o);return {pathname:`${i.origin}${i.pathname??""}`,search:i.search??"",hash:i.hash??""}}var W=(o,i,t)=>{let e=new URL(dn(o)),r=t??or(o),s=i??"";if(e.pathname.startsWith("//")&&(e.pathname=e.pathname.replace("//","/")),r&&pn(r)){let n=hn(r);e.pathname=`${e.pathname}${s}${n.pathname||""}`,e.search=n.search,e.hash=n.hash;}else e.pathname=`${e.pathname}${s}${r||""}`;return e.toString()},Qt=(o,i)=>{let t=new URL(o);return t.pathname=`${i}/`,t.toString()};var Z=(o,i=",")=>o.trim().split(i).map(t=>t.trim()).filter(t=>t.length>0);var di=Object.freeze({brightness:0,exposure:0,gamma:100,contrast:0,saturation:0,vibrance:0,warmth:0,enhance:0,filter:0,rotate:0,mirror:false,flip:false,crop:void 0}),mn=["enhance","brightness","exposure","gamma","contrast","saturation","vibrance","warmth","filter","mirror","flip","rotate","crop"];function Ql(o,i){if(typeof i=="number"){let t=i;return di[o]!==t?`${o}/${t}`:""}if(typeof i=="boolean"){let t=i;return di[o]!==t?`${o}`:""}if(o==="filter"&&i){let{name:t,amount:e}=i;return di.filter===e?"":`${o}/${t}/${e}`}if(o==="crop"&&i){let{dimensions:t,coords:e}=i;return `${o}/${t.join("x")}/${e.join(",")}`}return ""}function Jt(o){return rr(...mn.filter(i=>typeof o[i]<"u"&&o[i]!==null).map(i=>{let t=o[i];return Ql(i,t)}).filter(i=>!!i))}var nr=rr("format/auto","progressive/yes"),Ht=([o])=>typeof o<"u"?Number(o):void 0,fn=()=>true,Jl=([o,i])=>({name:o,amount:typeof i<"u"?Number(i):100}),tc=([o,i])=>{if(!/\d+x\d+/.test(o)||!/\d+,\d+/.test(i))throw new Error("Crop by aspect ratio, percentage or alignment shortcuts is not supported.");return {dimensions:Z(o,"x").map(Number),coords:Z(i).map(Number)}},ec=Object.freeze({enhance:Ht,brightness:Ht,exposure:Ht,gamma:Ht,contrast:Ht,saturation:Ht,vibrance:Ht,warmth:Ht,filter:Jl,mirror:fn,flip:fn,rotate:Ht,crop:o=>{let[i,t]=o,{dimensions:e,coords:r}=tc([i,t]);return {dimensions:e,coords:r}}});function Mo(o){let i={};for(let t of o){let[e,...r]=t.split("/");if(!e||!mn.includes(e))continue;let s=e,n=ec[s];try{let a=n(r);i[s]=a;}catch(a){console.warn([`Failed to parse URL operation "${t}". It will be ignored.`,a instanceof Error?`Error message: "${a.message}"`:a,"If you need this functionality, please feel free to open an issue at https://github.com/uploadcare/blocks/issues/new"].join(` `));}}return i}var B=Object.freeze({CROP:"crop",TUNING:"tuning",FILTERS:"filters"}),ot=Object.freeze([B.CROP,B.TUNING,B.FILTERS]),gn=Object.freeze(["brightness","exposure","gamma","contrast","saturation","vibrance","warmth","enhance"]),vn=Object.freeze(["adaris","briaril","calarel","carris","cynarel","cyren","elmet","elonni","enzana","erydark","fenralan","ferand","galen","gavin","gethriel","iorill","iothari","iselva","jadis","lavra","misiara","namala","nerion","nethari","pamaya","sarnar","sedis","sewen","sorahel","sorlen","tarian","thellassan","varriel","varven","vevera","virkas","yedis","yllara","zatvel","zevcen"]),yn=Object.freeze(["rotate","mirror","flip"]),Kt=di,kt=Object.freeze({brightness:{zero:Kt.brightness,range:[-100,100],keypointsNumber:2},exposure:{zero:Kt.exposure,range:[-500,500],keypointsNumber:2},gamma:{zero:Kt.gamma,range:[0,1e3],keypointsNumber:2},contrast:{zero:Kt.contrast,range:[-100,500],keypointsNumber:2},saturation:{zero:Kt.saturation,range:[-100,500],keypointsNumber:1},vibrance:{zero:Kt.vibrance,range:[-100,500],keypointsNumber:1},warmth:{zero:Kt.warmth,range:[-100,100],keypointsNumber:1},enhance:{zero:Kt.enhance,range:[0,100],keypointsNumber:1},filter:{zero:Kt.filter,range:[0,100],keypointsNumber:1}});var pi="https://ucarecdn.com",ic="https://upload.uploadcare.com",rc="https://social.uploadcare.com",oc="https://ucarecd.net",sc={pubkey:"",multiple:true,multipleMin:0,multipleMax:Number.MAX_SAFE_INTEGER,confirmUpload:false,imgOnly:false,accept:"",externalSourcesPreferredTypes:"",externalSourcesEmbedCss:"",store:"auto",cameraMirror:false,cameraCapture:"",sourceList:"local, url, camera, dropbox, gdrive",topLevelOrigin:"",maxLocalFileSizeBytes:0,thumbSize:76,showEmptyList:false,useLocalImageEditor:false,removeCopyright:false,cropPreset:"",imageShrink:"",modalScrollLock:true,modalBackdropStrokes:false,sourceListWrap:true,remoteTabSessionKey:"",cdnCname:pi,cdnCnamePrefixed:oc,baseUrl:ic,socialBaseUrl:rc,secureSignature:"",secureExpire:"",secureDeliveryProxy:"",retryThrottledRequestMaxTimes:3,retryNetworkErrorMaxTimes:3,multipartMinFileSize:26214400,multipartChunkSize:5242880,maxConcurrentRequests:10,multipartMaxConcurrentRequests:4,multipartMaxAttempts:3,checkForUrlDuplicates:false,saveUrlForRecurrentUploads:false,groupOutput:false,userAgentIntegration:"",debug:false,metadata:null,localeName:"en",localeDefinitionOverride:null,secureUploadsExpireThreshold:600*1e3,secureUploadsSignatureResolver:null,secureDeliveryProxyUrlResolver:null,iconHrefResolver:null,fileValidators:[],collectionValidators:[],validationTimeout:15*1e3,validationConcurrency:100,cameraModes:"photo, video",defaultCameraMode:null,enableAudioRecording:true,enableVideoRecording:null,maxVideoRecordingDuration:null,mediaRecorderOptions:null,filesViewMode:"list",gridShowFileNames:false,useCloudImageEditor:true,cloudImageEditorAutoOpen:false,cloudImageEditorTabs:Bt(ot),cloudImageEditorMaskHref:null,testMode:false,qualityInsights:true,pasteScope:"local",plugins:[]},J=Object.freeze(sc);var ar=(o,i)=>(...t)=>{let e=o();if(!e.read(O("debug")))return;let r=t;if(typeof t?.[0]=="function"){let n=t[0];r=n();}let s=[e.id,i].filter(Boolean);console.log(`[${s.join("][")}]`,...r);};var j=class{constructor(i){this.Jr=new Set;this.Be=null;this.m=ar(()=>this.i.ctx,this.constructor.name);this.i=i,this.e=i.ctx;}addSub(i){this.Jr.add(i);}get ze(){if(!this.Be){let i={};this.Be=new Proxy(i,{set:()=>{throw new Error("SharedInstance cfg proxy is read-only")},get:(t,e)=>{if(typeof e!="string")return;let r=O(e);return this.i.ctx.has(r)?this.i.ctx.read(r):J[e]}});}return this.Be}destroy(){for(let i of this.Jr)try{i();}catch{}this.Jr.clear();}},nc={modalManager:"*modalManager",pluginManager:"*pluginManager",telemetryManager:"*telemetryManager",localeManager:"*localeManager",a11y:"*a11y",clipboard:"*clipboard",blocksRegistry:"*blocksRegistry",eventEmitter:"*eventEmitter",uploadCollection:"*uploadCollection",secureUploadsManager:"*secureUploadsManager",api:"*publicApi",validationManager:"*validationManager"},Mt=(o,i,t=true)=>{let e=o.has(i),r=e?o.read(i):null;if(e&&r||!t)return r;throw new Error(`Unexpected error: shared instance for key "${String(i)}" is not available`)},bn=o=>({get ctx(){return o()},get modalManager(){return Mt(o(),"*modalManager",false)},get pluginManager(){return Mt(o(),"*pluginManager")},get telemetryManager(){return Mt(o(),"*telemetryManager")},get localeManager(){return Mt(o(),"*localeManager")},get a11y(){return Mt(o(),"*a11y")},get blocksRegistry(){return Mt(o(),"*blocksRegistry")},get eventEmitter(){return Mt(o(),"*eventEmitter")},get uploadCollection(){return Mt(o(),"*uploadCollection")},get secureUploadsManager(){return Mt(o(),"*secureUploadsManager",false)},get api(){return Mt(o(),"*publicApi")},get validationManager(){return Mt(o(),"*validationManager")},when(i,t){let e=nc[i],r=o(),s=r.has(e)?r.read(e):void 0;if(s)return t(s),()=>{};let n=r.sub(e,a=>{a&&(t(a),n());});return n},wait(i){return new Promise(t=>{let e=this.when(i,r=>{t(r),e();});})}});var Y=Object.freeze({ADD:"modal:add",DELETE:"modal:delete",OPEN:"modal:open",CLOSE:"modal:close",CLOSE_ALL:"modal:closeAll",DESTROY:"modal:destroy"}),lr=class extends j{constructor(){super(...arguments);this.He=new Map;this.ue=new Set;this.c=new Map;}registerModal(t,e){this.He.set(t,e),this.q(Y.ADD,{id:t,modal:e});}deleteModal(t){let e=this.He.get(t);return e?(this.He.delete(t),this.ue.delete(t),this.q(Y.DELETE,{id:t,modal:e}),true):false}open(t){let e=this.He.get(t);return e?(this.ue.add(t),this.q(Y.OPEN,{modal:e,id:t}),true):(this.m(`Modal with ID "${t}" not found`),false)}close(t){let e=this.He.get(t);return !e||!this.ue.has(t)?(this.m(`Modal with ID "${t}" not found or not active`),false):(this.ue.delete(t),this.q(Y.CLOSE,{id:t,modal:e}),true)}toggle(t){return this.He.has(t)?this.ue.has(t)?this.close(t):this.open(t):(this.m(`Modal with ID "${t}" not found`),false)}get hasActiveModals(){return this.ue.size>0}back(){if(this.ue.size===0)return this.m("No active modals to go back from"),false;let t=Array.from(this.ue).pop();return t?this.close(t):false}closeAll(){let t=this.ue.size;return this.ue.clear(),this.q(Y.CLOSE_ALL,{}),t}subscribe(t,e){return this.c.has(t)||this.c.set(t,new Set),this.c.get(t)?.add(e),()=>this.unsubscribe(t,e)}unsubscribe(t,e){this.c.has(t)&&this.c.get(t)?.delete(e);}q(t,e){if(this.c.has(t))for(let r of this.c.get(t)??new Set)try{r(e);}catch(s){this.i.telemetryManager.sendEventError(s,"modal subscriber"),this.m("Error in modal subscriber:",s);}}destroy(){super.destroy(),this.closeAll(),this.He.clear(),this.c.clear(),this.q(Y.DESTROY,{});}};var cr=o=>o.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)?.map(i=>i.toLowerCase()).join("-");function wn(o){return Object.prototype.toString.call(o)==="[object Object]"}var ac=/\W|_/g;function lc(o){return o.split(ac).map((i,t)=>i.charAt(0)[t>0?"toUpperCase":"toLowerCase"]()+i.slice(1)).join("")}function Tn(o,{ignoreKeys:i}={ignoreKeys:[]}){return Array.isArray(o)?o.map(t=>Gt(t,{ignoreKeys:i})):o}function Gt(o,{ignoreKeys:i}={ignoreKeys:[]}){if(Array.isArray(o))return Tn(o,{ignoreKeys:i});if(!wn(o))return o;let t={};for(let e of Object.keys(o)){let r=o[e];if(i.includes(e)){t[e]=r;continue}wn(r)?r=Gt(r,{ignoreKeys:i}):Array.isArray(r)&&(r=Tn(r,{ignoreKeys:i})),t[lc(e)]=r;}return t}var cc=o=>new Promise(i=>setTimeout(i,o));function $o({libraryName:o,libraryVersion:i,userAgent:t,publicKey:e="",integration:r=""}){let s="JavaScript";if(typeof t=="string")return t;if(typeof t=="function")return t({publicKey:e,libraryName:o,libraryVersion:i,languageName:s,integration:r});let n=[o,i,e].filter(Boolean).join("/"),a=[s,r].filter(Boolean).join("; ");return `${n} (${a})`}var uc={factor:2,time:100};function dc(o,i=uc){let t=0;function e(r){let s=Math.round(i.time*i.factor**t);return r({attempt:t,retry:a=>cc(a??s).then(()=>(t+=1,e(r)))})}return e(o)}var ge=class extends Error{},Pe=class o extends ge{originalProgressEvent;constructor(i){super(),this.name="NetworkError",this.message="Network error",Object.setPrototypeOf(this,o.prototype),this.originalProgressEvent=i;}},ur=(o,i)=>{o&&(o.aborted?Promise.resolve().then(i):o.addEventListener("abort",()=>i(),{once:true}));},te=class o extends ge{isCancel=true;constructor(i="Request canceled"){super(i),this.name="CancelError",Object.setPrototypeOf(this,o.prototype);}},pc=500,Cn=({check:o,interval:i=pc,timeout:t,signal:e})=>new Promise((r,s)=>{let n,a;ur(e,()=>{n&&clearTimeout(n),s(new te("Poll cancelled"));}),t&&(a=setTimeout(()=>{n&&clearTimeout(n),s(new te("Timed out"));},t));let l=()=>{try{Promise.resolve(o(e)).then(c=>{c?(a&&clearTimeout(a),r(c)):n=setTimeout(l,i);}).catch(c=>{a&&clearTimeout(a),s(c);});}catch(c){a&&clearTimeout(a),s(c);}};n=setTimeout(l,0);}),L={baseCDN:"https://ucarecdn.com",baseURL:"https://upload.uploadcare.com",retryThrottledRequestMaxTimes:1,retryNetworkErrorMaxTimes:3,multipartMinFileSize:25*1024*1024,multipartChunkSize:5*1024*1024,maxConcurrentRequests:4,pusherKey:"79ae88bd931ea68464d9"},dr="application/octet-stream",xn="original",ie=({method:o,url:i,data:t,headers:e={},signal:r,onProgress:s})=>new Promise((n,a)=>{let l=new XMLHttpRequest,c=o?.toUpperCase()||"GET",d=false;l.open(c,i,true),e&&Object.entries(e).forEach(u=>{let[h,f]=u;typeof f<"u"&&!Array.isArray(f)&&l.setRequestHeader(h,f);}),l.responseType="text",ur(r,()=>{d=true,l.abort(),a(new te);}),l.onload=()=>{if(l.status!=200)a(new Error(`Error ${l.status}: ${l.statusText}`));else {let u={method:c,url:i,data:t,headers:e||void 0,signal:r,onProgress:s},h=l.getAllResponseHeaders().trim().split(/[\r\n]+/),f={};h.forEach(function(w){let E=w.split(": "),T=E.shift(),A=E.join(": ");T&&typeof T<"u"&&(f[T]=A);});let g=l.response,b=l.status;n({request:u,data:g,headers:f,status:b});}},l.onerror=u=>{d||a(new Pe(u));},s&&typeof s=="function"&&(l.upload.onprogress=u=>{u.lengthComputable?s({isComputable:true,value:u.loaded/u.total}):s({isComputable:false});}),t?l.send(t):l.send();});function hc(o,...i){return o}var fc=({name:o})=>o?[o]:[],mc=hc,gc=()=>new FormData,Sn=o=>false,pr=o=>typeof Blob<"u"&&o instanceof Blob,hr=o=>typeof File<"u"&&o instanceof File,fr=o=>!!o&&typeof o=="object"&&!Array.isArray(o)&&"uri"in o&&typeof o.uri=="string",Ue=o=>pr(o)||hr(o)||Sn()||fr(o),vc=o=>typeof o=="string"||typeof o=="number"||typeof o>"u",yc=o=>!!o&&typeof o=="object"&&!Array.isArray(o),bc=o=>!!o&&typeof o=="object"&&"data"in o&&Ue(o.data);function An(o,i,t){if(Array.isArray(t))for(let e of t)An(o,`${i}[]`,e);else if(bc(t)){let{name:e,contentType:r}=t,s=mc(t.data,e,r??dr),n=fc({name:e});o.push([i,s,...n]);}else if(yc(t))for(let[e,r]of Object.entries(t))typeof r<"u"&&o.push([`${i}[${e}]`,String(r)]);else vc(t)&&t&&o.push([i,t.toString()]);}function wc(o){let i=[];for(let[t,e]of Object.entries(o))An(i,t,e);return i}function mr(o){let i=gc(),t=wc(o);for(let e of t){let[r,s,...n]=e;i.append(r,s,...n);}return i}var st=class o extends ge{code;request;response;headers;constructor(i,t,e,r,s){super(),this.name="UploadError",this.message=i,this.code=t,this.request=e,this.response=r,this.headers=s,Object.setPrototypeOf(this,o.prototype);}},Tc=o=>{let i=new URLSearchParams;for(let[t,e]of Object.entries(o))e&&typeof e=="object"&&!Array.isArray(e)?Object.entries(e).filter(r=>r[1]??false).forEach(r=>i.set(`${t}[${r[0]}]`,String(r[1]))):Array.isArray(e)?e.forEach(r=>{i.append(`${t}[]`,r);}):typeof e=="string"&&e?i.set(t,e):typeof e=="number"&&i.set(t,e.toString());return i.toString()},jt=(o,i,t)=>{let e=new URL(o);return e.pathname=(e.pathname+i).replace("//","/"),t&&(e.search=Tc(t)),e.toString()},Ec="6.18.4",Cc="UploadcareUploadClient",xc=Ec;function ye(o){return $o({libraryName:Cc,libraryVersion:xc,...o})}var Sc="RequestThrottledError",En=15e3,Ac=1e3;function kc(o){let{headers:i}=o||{};if(!i||typeof i["retry-after"]!="string")return En;let t=parseInt(i["retry-after"],10);return Number.isFinite(t)?t*1e3:En}function re(o,i){let{retryThrottledRequestMaxTimes:t,retryNetworkErrorMaxTimes:e}=i;return dc(({attempt:r,retry:s})=>o().catch(n=>{if("response"in n&&n?.code===Sc&&r<t)return s(kc(n));if(n instanceof Pe&&r<e)return s((r+1)*Ac);throw n}))}var kn=o=>{let i="";return (pr(o)||hr(o)||fr(o))&&(i=o.type),i||dr},Mn=o=>{let i="";return hr(o)&&o.name?i=o.name:pr(o)||Sn()?i="":fr(o)&&o.name&&(i=o.name),i||xn};function Do(o){return typeof o>"u"||o==="auto"?"auto":o?"1":"0"}function Mc(o,{publicKey:i,fileName:t,contentType:e,baseURL:r=L.baseURL,secureSignature:s,secureExpire:n,store:a,signal:l,onProgress:c,source:d="local",integration:u,userAgent:h,retryThrottledRequestMaxTimes:f=L.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:g=L.retryNetworkErrorMaxTimes,metadata:b}){return re(()=>ie({method:"POST",url:jt(r,"/base/",{jsonerrors:1}),headers:{"X-UC-User-Agent":ye({publicKey:i,integration:u,userAgent:h})},data:mr({file:{data:o,name:t||Mn(o),contentType:e||kn(o)},UPLOADCARE_PUB_KEY:i,UPLOADCARE_STORE:Do(a),signature:s,expire:n,source:d,metadata:b}),signal:l,onProgress:c}).then(({data:w,headers:E,request:T})=>{let A=Gt(JSON.parse(w));if("error"in A)throw new st(A.error.content,A.error.errorCode,T,A,E);return A}),{retryNetworkErrorMaxTimes:g,retryThrottledRequestMaxTimes:f})}var Lo;(function(o){o.Token="token",o.FileInfo="file_info";})(Lo||(Lo={}));function Ic(o,{publicKey:i,baseURL:t=L.baseURL,store:e,fileName:r,checkForUrlDuplicates:s,saveUrlForRecurrentUploads:n,secureSignature:a,secureExpire:l,source:c="url",signal:d,integration:u,userAgent:h,retryThrottledRequestMaxTimes:f=L.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:g=L.retryNetworkErrorMaxTimes,metadata:b}){return re(()=>ie({method:"POST",headers:{"X-UC-User-Agent":ye({publicKey:i,integration:u,userAgent:h})},url:jt(t,"/from_url/",{jsonerrors:1,pub_key:i,source_url:o,store:Do(e),filename:r,check_URL_duplicates:s?1:void 0,save_URL_duplicates:n?1:void 0,signature:a,expire:l,source:c,metadata:b}),signal:d}).then(({data:w,headers:E,request:T})=>{let A=Gt(JSON.parse(w));if("error"in A)throw new st(A.error.content,A.error.errorCode,T,A,E);return A}),{retryNetworkErrorMaxTimes:g,retryThrottledRequestMaxTimes:f})}var ct;(function(o){o.Unknown="unknown",o.Waiting="waiting",o.Progress="progress",o.Error="error",o.Success="success";})(ct||(ct={}));var Oc=o=>"status"in o&&o.status===ct.Error;function Lc(o,{publicKey:i,baseURL:t=L.baseURL,signal:e,integration:r,userAgent:s,retryThrottledRequestMaxTimes:n=L.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:a=L.retryNetworkErrorMaxTimes}={}){return re(()=>ie({method:"GET",headers:i?{"X-UC-User-Agent":ye({publicKey:i,integration:r,userAgent:s})}:void 0,url:jt(t,"/from_url/status/",{jsonerrors:1,token:o}),signal:e}).then(({data:l,headers:c,request:d})=>{let u=Gt(JSON.parse(l));if("error"in u&&!Oc(u))throw new st(u.error.content,u.error.errorCode,d,u,c);return u}),{retryNetworkErrorMaxTimes:a,retryThrottledRequestMaxTimes:n})}function Pc(o,{publicKey:i,baseURL:t=L.baseURL,jsonpCallback:e,secureSignature:r,secureExpire:s,signal:n,source:a,integration:l,userAgent:c,retryThrottledRequestMaxTimes:d=L.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:u=L.retryNetworkErrorMaxTimes}){return re(()=>ie({method:"POST",headers:{"X-UC-User-Agent":ye({publicKey:i,integration:l,userAgent:c})},url:jt(t,"/group/",{jsonerrors:1}),data:mr({files:o,callback:e,pub_key:i,signature:r,expire:s,source:a}),signal:n}).then(({data:h,headers:f,request:g})=>{let b=Gt(JSON.parse(h));if("error"in b)throw new st(b.error.content,b.error.errorCode,g,b,f);return b}),{retryNetworkErrorMaxTimes:u,retryThrottledRequestMaxTimes:d})}function In(o,{publicKey:i,baseURL:t=L.baseURL,signal:e,source:r,integration:s,userAgent:n,retryThrottledRequestMaxTimes:a=L.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:l=L.retryNetworkErrorMaxTimes}){return re(()=>ie({method:"GET",headers:{"X-UC-User-Agent":ye({publicKey:i,integration:s,userAgent:n})},url:jt(t,"/info/",{jsonerrors:1,pub_key:i,file_id:o,source:r}),signal:e}).then(({data:c,headers:d,request:u})=>{let h=Gt(JSON.parse(c));if("error"in h)throw new st(h.error.content,h.error.errorCode,u,h,d);return h}),{retryThrottledRequestMaxTimes:a,retryNetworkErrorMaxTimes:l})}function Uc(o,{publicKey:i,contentType:t,fileName:e,multipartChunkSize:r=L.multipartChunkSize,baseURL:s="",secureSignature:n,secureExpire:a,store:l,signal:c,source:d="local",integration:u,userAgent:h,retryThrottledRequestMaxTimes:f=L.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:g=L.retryNetworkErrorMaxTimes,metadata:b}){return re(()=>ie({method:"POST",url:jt(s,"/multipart/start/",{jsonerrors:1}),headers:{"X-UC-User-Agent":ye({publicKey:i,integration:u,userAgent:h})},data:mr({filename:e,size:o,content_type:t||dr,part_size:r,UPLOADCARE_STORE:Do(l),UPLOADCARE_PUB_KEY:i,signature:n,expire:a,source:d,metadata:b}),signal:c}).then(({data:w,headers:E,request:T})=>{let A=Gt(JSON.parse(w));if("error"in A)throw new st(A.error.content,A.error.errorCode,T,A,E);return A.parts=Object.keys(A.parts).map(yt=>A.parts[Number(yt)]),A}),{retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:g})}function Rc(o,i,{contentType:t,signal:e,onProgress:r,retryThrottledRequestMaxTimes:s=L.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:n=L.retryNetworkErrorMaxTimes}){return re(()=>ie({method:"PUT",url:i,data:o,onProgress:r,signal:e,headers:{"Content-Type":t||dr}}).then(a=>(r&&r({isComputable:true,value:1}),a)).then(({status:a})=>({code:a})),{retryThrottledRequestMaxTimes:s,retryNetworkErrorMaxTimes:n})}function $c(o,{publicKey:i,baseURL:t=L.baseURL,source:e="local",signal:r,integration:s,userAgent:n,retryThrottledRequestMaxTimes:a=L.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:l=L.retryNetworkErrorMaxTimes}){return re(()=>ie({method:"POST",url:jt(t,"/multipart/complete/",{jsonerrors:1}),headers:{"X-UC-User-Agent":ye({publicKey:i,integration:s,userAgent:n})},data:mr({uuid:o,UPLOADCARE_PUB_KEY:i,source:e}),signal:r}).then(({data:c,headers:d,request:u})=>{let h=Gt(JSON.parse(c));if("error"in h)throw new st(h.error.content,h.error.errorCode,u,h,d);return h}),{retryThrottledRequestMaxTimes:a,retryNetworkErrorMaxTimes:l})}function Fo(o,{publicKey:i,baseURL:t,source:e,integration:r,userAgent:s,retryThrottledRequestMaxTimes:n,retryNetworkErrorMaxTimes:a,signal:l,onProgress:c}){return Cn({check:d=>In(o,{publicKey:i,baseURL:t,signal:d,source:e,integration:r,userAgent:s,retryThrottledRequestMaxTimes:n,retryNetworkErrorMaxTimes:a}).then(u=>u.isReady?u:(c&&c({isComputable:true,value:1}),false)),signal:l})}function Dc(o){return "defaultEffects"in o}var ve=class{uuid;name;size;isStored;isImage;mimeType;cdnUrl;s3Url;originalFilename;imageInfo;videoInfo;contentInfo;metadata;s3Bucket;defaultEffects=null;constructor(i,{baseCDN:t=L.baseCDN,fileName:e}={}){let{uuid:r,s3Bucket:s}=i,n=jt(t,`${r}/`),a=s?jt(`https://${s}.s3.amazonaws.com/`,`${r}/${i.filename}`):null;this.uuid=r,this.name=e||i.filename,this.size=i.size,this.isStored=i.isStored,this.isImage=i.isImage,this.mimeType=i.mimeType,this.cdnUrl=n,this.originalFilename=i.originalFilename,this.imageInfo=i.imageInfo,this.videoInfo=i.videoInfo,this.contentInfo=i.contentInfo,this.metadata=i.metadata||null,this.s3Bucket=s||null,this.s3Url=a,Dc(i)&&(this.defaultEffects=i.defaultEffects);}},Fc=(o,{publicKey:i,fileName:t,baseURL:e,secureSignature:r,secureExpire:s,store:n,contentType:a,signal:l,onProgress:c,source:d,integration:u,userAgent:h,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:g,baseCDN:b,metadata:w})=>Mc(o,{publicKey:i,fileName:t,contentType:a,baseURL:e,secureSignature:r,secureExpire:s,store:n,signal:l,onProgress:c,source:d,integration:u,userAgent:h,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:g,metadata:w}).then(({file:E})=>Fo(E,{publicKey:i,baseURL:e,source:d,integration:u,userAgent:h,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:g,onProgress:c,signal:l})).then(E=>new ve(E,{baseCDN:b})),Vc=(o,{publicKey:i,fileName:t,baseURL:e,signal:r,onProgress:s,source:n,integration:a,userAgent:l,retryThrottledRequestMaxTimes:c,retryNetworkErrorMaxTimes:d,baseCDN:u})=>In(o,{publicKey:i,baseURL:e,signal:r,source:n,integration:a,userAgent:l,retryThrottledRequestMaxTimes:c,retryNetworkErrorMaxTimes:d}).then(h=>new ve(h,{baseCDN:u,fileName:t})).then(h=>(s&&s({isComputable:true,value:1}),h)),Nc=(o,{signal:i}={})=>{let t=null,e=null,r=o.map(()=>new AbortController),s=n=>()=>{e=n,r.forEach((a,l)=>l!==n&&a.abort());};return ur(i,()=>{r.forEach(n=>n.abort());}),Promise.all(o.map((n,a)=>{let l=s(a);return Promise.resolve().then(()=>n({stopRace:l,signal:r[a].signal})).then(c=>(l(),c)).catch(c=>(t=c,null))})).then(n=>{if(e===null)throw t;return n[e]})},_c=window.WebSocket,Po=class{events=Object.create({});emit(i,t){this.events[i]?.forEach(e=>e(t));}on(i,t){this.events[i]=this.events[i]||[],this.events[i].push(t);}off(i,t){t?this.events[i]=this.events[i].filter(e=>e!==t):this.events[i]=[];}},zc=(o,i)=>o==="success"?{status:ct.Success,...i}:o==="progress"?{status:ct.Progress,...i}:{status:ct.Error,...i},Uo=class{key;disconnectTime;ws=void 0;queue=[];isConnected=false;subscribers=0;emmitter=new Po;disconnectTimeoutId=null;constructor(i,t=3e4){this.key=i,this.disconnectTime=t;}connect(){if(this.disconnectTimeoutId&&clearTimeout(this.disconnectTimeoutId),!this.isConnected&&!this.ws){let i=`wss://ws.pusherapp.com/app/${this.key}?protocol=5&client=js&version=1.12.2`;this.ws=new _c(i),this.ws.addEventListener("error",t=>{this.emmitter.emit("error",new Error(t.message));}),this.emmitter.on("connected",()=>{this.isConnected=true,this.queue.forEach(t=>this.send(t.event,t.data)),this.queue=[];}),this.ws.addEventListener("message",t=>{let e=JSON.parse(t.data.toString());switch(e.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(e.channel,zc(e.event,JSON.parse(e.data)));}});}}disconnect(){let i=()=>{this.ws?.close(),this.ws=void 0,this.isConnected=false;};this.disconnectTime?this.disconnectTimeoutId=setTimeout(()=>{i();},this.disconnectTime):i();}send(i,t){let e=JSON.stringify({event:i,data:t});this.ws?.send(e);}subscribe(i,t){this.subscribers+=1,this.connect();let e=`task-status-${i}`,r={event:"pusher:subscribe",data:{channel:e}};this.emmitter.on(e,t),this.isConnected?this.send(r.event,r.data):this.queue.push(r);}unsubscribe(i){this.subscribers-=1;let t=`task-status-${i}`,e={event:"pusher:unsubscribe",data:{channel:t}};this.emmitter.off(t),this.isConnected?this.send(e.event,e.data):this.queue=this.queue.filter(r=>r.data.channel!==t),this.subscribers===0&&this.disconnect();}onError(i){return this.emmitter.on("error",i),()=>this.emmitter.off("error",i)}},Io=null,Vo=o=>{if(!Io){let i=typeof window>"u"?0:3e4;Io=new Uo(o,i);}return Io},Bc=o=>{Vo(o).connect();};function Hc({token:o,publicKey:i,baseURL:t,integration:e,userAgent:r,retryThrottledRequestMaxTimes:s,retryNetworkErrorMaxTimes:n,onProgress:a,signal:l}){return Cn({check:c=>Lc(o,{publicKey:i,baseURL:t,integration:e,userAgent:r,retryThrottledRequestMaxTimes:s,retryNetworkErrorMaxTimes:n,signal:c}).then(d=>{switch(d.status){case ct.Error:return new st(d.error,d.errorCode);case ct.Waiting:return false;case ct.Unknown:return new st(`Token "${o}" was not found.`);case ct.Progress:return a&&(d.total==="unknown"?a({isComputable:false}):a({isComputable:true,value:d.done/d.total})),false;case ct.Success:return a&&a({isComputable:true,value:d.done/d.total}),d;default:throw new Error("Unknown status")}}),signal:l})}var Kc=({token:o,pusherKey:i,signal:t,onProgress:e})=>new Promise((r,s)=>{let n=Vo(i),a=n.onError(s),l=()=>{a(),n.unsubscribe(o);};ur(t,()=>{l(),s(new te("pusher cancelled"));}),n.subscribe(o,c=>{switch(c.status){case ct.Progress:{e&&(c.total==="unknown"?e({isComputable:false}):e({isComputable:true,value:c.done/c.total}));break}case ct.Success:{l(),e&&e({isComputable:true,value:c.done/c.total}),r(c);break}case ct.Error:l(),s(new st(c.msg,c.error_code));}});}),jc=(o,{publicKey:i,fileName:t,baseURL:e,baseCDN:r,checkForUrlDuplicates:s,saveUrlForRecurrentUploads:n,secureSignature:a,secureExpire:l,store:c,signal:d,onProgress:u,source:h,integration:f,userAgent:g,retryThrottledRequestMaxTimes:b,pusherKey:w=L.pusherKey,metadata:E})=>Promise.resolve(Bc(w)).then(()=>Ic(o,{publicKey:i,fileName:t,baseURL:e,checkForUrlDuplicates:s,saveUrlForRecurrentUploads:n,secureSignature:a,secureExpire:l,store:c,signal:d,source:h,integration:f,userAgent:g,retryThrottledRequestMaxTimes:b,metadata:E})).catch(T=>(Vo(w)?.disconnect(),Promise.reject(T))).then(T=>T.type===Lo.FileInfo?T:Nc([({signal:A})=>Hc({token:T.token,publicKey:i,baseURL:e,integration:f,userAgent:g,retryThrottledRequestMaxTimes:b,onProgress:u,signal:A}),({signal:A})=>Kc({token:T.token,pusherKey:w,signal:A,onProgress:u})],{signal:d})).then(T=>{if(T instanceof st)throw T;return T}).then(T=>Fo(T.uuid,{publicKey:i,baseURL:e,integration:f,userAgent:g,retryThrottledRequestMaxTimes:b,onProgress:u,signal:d})).then(T=>new ve(T,{baseCDN:r})),Oo=new WeakMap,Gc=async o=>{if(Oo.has(o))return Oo.get(o);let i=await fetch(o.uri).then(t=>t.blob());return Oo.set(o,i),i},On=async o=>{if(hr(o)||pr(o))return o.size;if(fr(o))return (await Gc(o)).size;throw new Error("Unknown file type. Cannot determine file size.")},qc=(o,i=L.multipartMinFileSize)=>o>=i,Ln=o=>{let i="[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}",t=new RegExp(i);return !Ue(o)&&t.test(o)},No=o=>{let i="^(?:\\w+:)?\\/\\/([^\\s\\.]+\\.\\S{2}|localhost[\\:?\\d]*)\\S*$",t=new RegExp(i);return !Ue(o)&&t.test(o)},Wc=(o,i)=>new Promise((t,e)=>{let r=[],s=false,n=i.length,a=[...i],l=()=>{let c=i.length-a.length,d=a.shift();d&&d().then(u=>{s||(r[c]=u,n-=1,n?l():t(r));}).catch(u=>{s=true,e(u);});};for(let c=0;c<o;c++)l();}),Zc=(o,i,t,e)=>{let r=e*i,s=Math.min(r+e,t);return o.slice(r,s)},Yc=async(o,i,t)=>e=>Zc(o,e,i,t),Xc=(o,i,{publicKey:t,contentType:e,onProgress:r,signal:s,integration:n,retryThrottledRequestMaxTimes:a,retryNetworkErrorMaxTimes:l})=>Rc(o,i,{contentType:e,onProgress:r,signal:s,retryThrottledRequestMaxTimes:a,retryNetworkErrorMaxTimes:l}),Qc=async(o,{publicKey:i,fileName:t,fileSize:e,baseURL:r,secureSignature:s,secureExpire:n,store:a,signal:l,onProgress:c,source:d,integration:u,userAgent:h,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:g,contentType:b,multipartChunkSize:w=L.multipartChunkSize,maxConcurrentRequests:E=L.maxConcurrentRequests,baseCDN:T,metadata:A})=>{let yt=e??await On(o),bt,ue=(Q,lt)=>{if(!c)return;bt||(bt=Array(Q).fill(0));let St=Lt=>Lt.reduce((Nt,uo)=>Nt+uo,0);return Lt=>{Lt.isComputable&&(bt[lt]=Lt.value,c({isComputable:true,value:St(bt)/Q}));}};return b||=kn(o),Uc(yt,{publicKey:i,contentType:b,fileName:t||Mn(o),baseURL:r,secureSignature:s,secureExpire:n,store:a,signal:l,source:d,integration:u,userAgent:h,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:g,metadata:A,multipartChunkSize:w}).then(async({uuid:Q,parts:lt})=>{let St=await Yc(o,yt,w);return Promise.all([Q,Wc(E,lt.map((Lt,Nt)=>()=>Xc(St(Nt),Lt,{publicKey:i,contentType:b,onProgress:ue(lt.length,Nt),signal:l,integration:u,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:g})))])}).then(([Q])=>$c(Q,{publicKey:i,baseURL:r,source:d,integration:u,userAgent:h,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:g})).then(Q=>Q.isReady?Q:Fo(Q.uuid,{publicKey:i,baseURL:r,source:d,integration:u,userAgent:h,retryThrottledRequestMaxTimes:f,retryNetworkErrorMaxTimes:g,onProgress:c,signal:l})).then(Q=>new ve(Q,{baseCDN:T}))};async function _o(o,{publicKey:i,fileName:t,baseURL:e=L.baseURL,secureSignature:r,secureExpire:s,store:n,signal:a,onProgress:l,source:c,integration:d,userAgent:u,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:f,contentType:g,multipartMinFileSize:b,multipartChunkSize:w,maxConcurrentRequests:E,baseCDN:T=L.baseCDN,checkForUrlDuplicates:A,saveUrlForRecurrentUploads:yt,pusherKey:bt,metadata:ue}){if(Ue(o)){let Q=await On(o);return qc(Q,b)?Qc(o,{publicKey:i,contentType:g,multipartChunkSize:w,fileSize:Q,fileName:t,baseURL:e,secureSignature:r,secureExpire:s,store:n,signal:a,onProgress:l,source:c,integration:d,userAgent:u,maxConcurrentRequests:E,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:f,baseCDN:T,metadata:ue}):Fc(o,{publicKey:i,fileName:t,contentType:g,baseURL:e,secureSignature:r,secureExpire:s,store:n,signal:a,onProgress:l,source:c,integration:d,userAgent:u,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:f,baseCDN:T,metadata:ue})}if(No(o))return jc(o,{publicKey:i,fileName:t,baseURL:e,baseCDN:T,checkForUrlDuplicates:A,saveUrlForRecurrentUploads:yt,secureSignature:r,secureExpire:s,store:n,signal:a,onProgress:l,source:c,integration:d,userAgent:u,retryThrottledRequestMaxTimes:h,pusherKey:bt,metadata:ue});if(Ln(o))return Vc(o,{publicKey:i,fileName:t,baseURL:e,signal:a,onProgress:l,source:c,integration:d,userAgent:u,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:f,baseCDN:T});throw new TypeError(`File uploading from "${o}" is not supported`)}var Jc=(o,i)=>{try{let t=new URL(o),e=new URL(i);return t.protocol=e.protocol,t.hostname=e.hostname,t.port=e.port,t.toString()}catch{return o}},Ro=class{uuid;filesCount;totalSize;isStored;isImage;cdnUrl;files;createdAt;storedAt=null;constructor(i,{baseCDN:t=L.baseCDN}={}){this.uuid=i.id,this.filesCount=i.filesCount;let e=i.files.filter(Boolean);this.totalSize=Object.values(e).reduce((r,s)=>r+s.size,0),this.isStored=!!i.datetimeStored,this.isImage=!!Object.values(e).filter(r=>r.isImage).length,this.cdnUrl=Jc(i.cdnUrl,t),this.files=e.map(r=>new ve(r,{baseCDN:t})),this.createdAt=i.datetimeCreated,this.storedAt=i.datetimeStored;}},tu=o=>{for(let i of o)if(!Ue(i))return false;return true},eu=o=>{for(let i of o)if(!Ln(i))return false;return true},iu=o=>{for(let i of o)if(!No(i))return false;return true};function Pn(o,{publicKey:i,fileName:t,baseURL:e=L.baseURL,secureSignature:r,secureExpire:s,store:n,signal:a,onProgress:l,source:c,integration:d,userAgent:u,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:f,contentType:g,multipartChunkSize:b=L.multipartChunkSize,baseCDN:w=L.baseCDN,checkForUrlDuplicates:E,saveUrlForRecurrentUploads:T,jsonpCallback:A}){if(!tu(o)&&!iu(o)&&!eu(o))throw new TypeError(`Group uploading from "${o}" is not supported`);let yt,bt=true,ue=o.length,Q=(lt,St)=>{if(!l)return;yt||(yt=Array(lt).fill(0));let Lt=Nt=>Nt.reduce((uo,Ml)=>uo+Ml)/lt;return Nt=>{if(!Nt.isComputable||!bt){bt=false,l({isComputable:false});return}yt[St]=Nt.value,l({isComputable:true,value:Lt(yt)});}};return Promise.all(o.map((lt,St)=>Ue(lt)||No(lt)?_o(lt,{publicKey:i,fileName:t,baseURL:e,secureSignature:r,secureExpire:s,store:n,signal:a,onProgress:Q(ue,St),source:c,integration:d,userAgent:u,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:f,contentType:g,multipartChunkSize:b,baseCDN:w,checkForUrlDuplicates:E,saveUrlForRecurrentUploads:T}).then(Lt=>Lt.uuid):lt)).then(lt=>Pc(lt,{publicKey:i,baseURL:e,jsonpCallback:A,secureSignature:r,secureExpire:s,signal:a,source:c,integration:d,userAgent:u,retryThrottledRequestMaxTimes:h,retryNetworkErrorMaxTimes:f}).then(St=>new Ro(St,{baseCDN:w})).then(St=>(l&&l({isComputable:true,value:1}),St)))}var ee=class{Di=1;eo=[];Fi=0;to=new Map;io=new Map;constructor(i){this.Di=i;}run(){let i=this.Di-this.Fi;for(let t=0;t<i;t++){let e=this.eo.shift();if(!e)return;let r=this.to.get(e),s=this.io.get(e);if(!r||!s)throw new Error("Unexpected behavior: resolver or rejector is undefined");this.Fi+=1,e().finally(()=>{this.to.delete(e),this.io.delete(e),this.Fi-=1,this.run();}).then(n=>r(n)).catch(n=>s(n));}}add(i,{autoRun:t}={autoRun:true}){return new Promise((e,r)=>{this.to.set(i,e),this.io.set(i,r),this.eo.push(i),t&&this.run();})}get pending(){return this.eo.length}get running(){return this.Fi}set concurrency(i){this.Di=i,this.run();}get concurrency(){return this.Di}};var zo=()=>({}),Bo=o=>({...zo(),"*currentActivity":null,"*currentActivityParams":{},"*history":[],"*historyBack":null,"*closeModal":()=>{o.modalManager?.close(o.$["*currentActivity"]),o.pub("*currentActivity",null);}}),Ho=o=>({...Bo(o),"*commonProgress":0,"*uploadList":[],"*uploadQueue":new ee(1),"*collectionErrors":[],"*collectionState":null,"*groupInfo":null,"*uploadTrigger":new Set}),Un=o=>({...Ho(o),"*solution":null,"*lazyPlugins":null});var F=Object.freeze({START_FROM:"start-from",CAMERA:"camera",UPLOAD_LIST:"upload-list",URL:"url",CLOUD_IMG_EDIT:"cloud-image-edit",EXTERNAL:"external"});var gr=class extends j{constructor(t){super(t);this.scopes=new Set;this.listener=this.Vc.bind(this),window.addEventListener("paste",this.listener);}openUploadList(){this.i.api.setCurrentActivity(F.UPLOAD_LIST),this.i.api.setModalState(true);}async Vc(t){if(t.clipboardData){for(let e of this.scopes)if(e.isConnected)switch(this.ze.pasteScope){case "global":await this.handlePaste(t);break;case "local":if(!e.contains(t.target))continue;await this.handlePaste(t);break;default:continue}}}async handlePaste(t){if(!t.clipboardData)return;let e=Array.from(t.clipboardData.items),r=e.map(n=>n.getAsFile()).filter(n=>n!==null),s=e.filter(n=>n.kind==="string"&&n.type==="text/plain").map(n=>new Promise(a=>{n.getAsString(l=>{a(l);});}));r.length>0&&(r.forEach(n=>{this.i.api.addFileFromObject(n,{source:"clipboard"});}),this.openUploadList()),s.length>0&&((await Promise.all(s)).forEach(a=>{this.i.api.addFileFromUrl(a,{source:"clipboard"});}),this.openUploadList());}registerBlock(t){return this.scopes.add(t),()=>{this.scopes.delete(t);}}destroy(){super.destroy(),window.removeEventListener("paste",this.listener),this.scopes.clear();}};var ru={button:["toolbar"],checkbox:["toolbar"],menuitem:["menu","menubar"],option:["listbox"],tab:["tablist"]};function hi(o,i){i.tabIndex=0,i.focus(),o.tabIndex=-1;}function Ko(o){let i=o.role||o.type||o.tagName;if(!i)return null;let t=ru[i.toLowerCase()];if(!t)return null;for(let e of t){let r=o.closest(`[role=${e}]`);if(r)return r}}function jo(o,i){return i.role==="toolbar"?ou(i):i.querySelectorAll(`[role=${o.role}]`)}function ou(o){return [...o.querySelectorAll("*")].filter(t=>t.role==="button"||t.type==="button"||t.role==="checkbox"||t.type==="checkbox")}function su(o){let i=o.getAttribute("aria-orientation");if(i==="vertical")return false;if(i==="horizontal")return true;let t=o.role;return t==="menubar"||t==="tablist"||t==="toolbar"}function Rn(o){return i=>{let t=false,e=300,r=0,s="";function n(u){let h=Ko(u.target);if(!h){a();return}let f=jo(u.target,h),g=Array.from(f).indexOf(u.target),b="ArrowDown",w="ArrowUp";if(su(h)&&(i.document.dir==="rtl"?(b="ArrowLeft",w="ArrowRight"):(b="ArrowRight",w="ArrowLeft")),u.key===b)u.preventDefault(),hi(u.target,f[g+1]||f[0]);else if(u.key===w)u.preventDefault(),hi(u.target,f[g-1]||f[f.length-1]);else if(u.key==="Home")u.preventDefault(),hi(u.target,f[0]);else if(u.key==="End")u.preventDefault(),hi(u.target,f[f.length-1]);else if(u.key.length===1&&h.role!=="tablist"){let E=Date.now();E-r<=e?s+=u.key.toLowerCase():s=u.key.toLowerCase(),r=E;let T=Array.from(f).find(A=>A.textContent?.trim()?.toLowerCase()?.startsWith(s));T&&(u.preventDefault(),hi(u.target,T));}}function a(){t=false,i.removeEventListener("keydown",n);}function l(u){let h=Ko(u.target);if(h){t||(t=true,i.addEventListener("keydown",n));let f=jo(u.target,h);for(let g of f)g!==u.target&&g.setAttribute("tabindex",-1);}else t&&a();}function c(u){(!u.relatedTarget||u.relatedTarget===i.document)&&a();}function d(u){let h=Ko(u.target);if(h){let f=jo(u.target,h);for(let g of f)g!==u.target&&g.setAttribute("tabindex",-1);u.target.setAttribute("tabindex",0);}}return i.addEventListener("click",d),i.addEventListener("focusin",l),i.addEventListener("focusout",c),()=>{a(),i.removeEventListener("click",d),i.removeEventListener("focusin",l),i.removeEventListener("focusout",c);}}}function $n(){return o=>{let i,t;function e(s){if(s.target.getAttribute("aria-hidden")==="true"){i=s.target,i.setAttribute("aria-hidden","false"),t=i.hidden,t&&(i.hidden=false);let n=s.target.querySelector('a, button, select, textarea, input:not([type=radio]), [type=radio]:checked, [tabindex]:not([tabindex="-1"])');n&&(n.tabIndex=0);}}function r(s){i&&i.contains(s.target)&&(!s.relatedTarget||!i.contains(s.relatedTarget))&&(s.target.tabIndex=-1,i.setAttribute("aria-hidden","true"),t&&(i.hidden=true),i=null);}return o.addEventListener("keyuxJump",e),o.addEventListener("focusout",r),()=>{o.removeEventListener("keyuxJump",e),o.removeEventListener("focusout",r);}}}function Dn(){return o=>{let i=[];function t(l){let c=o.document.activeElement;c&&c!==o.document.body&&i.push(new WeakRef(c)),l.focus({focusVisible:true});}function e(){let l=i.pop();if(!l){o.document.activeElement.blur();return}let c=l.deref();c&&c.isConnected?c.focus():e();}let r=0,s;function n(l){clearInterval(s);let c=l.getAttribute("aria-controls");s=setInterval(()=>{if(r++>50){clearInterval(s);return}let d=o.document.getElementById(c);if(d){let u=d.querySelector('a, button, select, textarea, input:not([type=radio]), [type=radio]:checked, [tabindex]:not([tabindex="-1"])');u&&(clearInterval(s),d.dispatchEvent(new o.CustomEvent("keyuxJump",{bubbles:true})),t(u));}},50);}function a(l){l.target.getAttribute("aria-controls")&&l.key==="Enter"&&n(l.target),l.key==="Escape"&&e();}return o.addEventListener("keydown",a),()=>{o.removeEventListener("keydown",a);}}}function Fn(o){let i,t=o.split(" "),e;function r(a){a.key==="Enter"&&(a.target.tagName==="BUTTON"||a.target.tagName==="A")&&(s(),a.target.classList.add(...t),i=a.target,e=a.target);}function s(){i&&i.classList.remove(...t),e=null;}function n(a){a.clientX===0&&a.clientY===0&&e!==a.target&&(s(),a.target.classList.add(...t),i=a.target);}return a=>(a.addEventListener("click",n),a.addEventListener("keydown",r),a.addEventListener("keyup",s),()=>{a.removeEventListener("click",n),a.removeEventListener("keydown",r),a.removeEventListener("keyup",s);})}function Vn(o,i){let t=i.map(e=>e(o));return ()=>{t.forEach(e=>e());}}var Go=class{constructor(){this.te=new Map;this.ro=[];}addEventListener(i,t){let e=r=>{let s=r.target;s instanceof Node&&this.ro.some(n=>n===s||n.contains(s))&&t(r);};this.te.set(t,e),window.addEventListener(i,e);}removeEventListener(i,t){let e=this.te.get(t);e&&window.removeEventListener(i,e),this.te.delete(t);}get CustomEvent(){return window.CustomEvent}get document(){return window.document}get navigator(){return window.navigator}registerScope(i){this.ro.push(i);}destroy(){this.ro=[];for(let i of this.te.values())window.removeEventListener("keydown",i),window.removeEventListener("keyup",i);this.te.clear();}},vr=class{constructor(){this.Ni=new Go,this.tn=Vn(this.Ni,[Rn(),Fn("is-pressed"),Dn(),$n()]);}registerBlock(i){this.Ni.registerScope(i);}destroy(){this.tn?.(),this.Ni.destroy();}};var qt=o=>`*l10n/${o}`,nu="en",yr=class extends j{constructor(t){super(t);this.xt="";for(let[r,s]of Object.entries(ui)){let n=this.e.has(qt(r))?!this.e.read(qt(r)):true;this.e.add(qt(r),s,n);}let e=t.pluginManager;e?.onPluginsChange&&this.addSub(e.onPluginsChange(()=>{this.xt&&this.rn(this.xt);})),this.addSub(this.e.sub(O("localeName"),async r=>{if(!r)return;this.xt=r;let s=await cn(r);r!==nu&&this.xt!==r||(this.rn(r),this.sn(r,s));})),this.addSub(this.e.sub(O("localeDefinitionOverride"),r=>{if(!r)return;let s=r[this.xt];s&&this.sn(this.xt,s);}));}sn(t,e){let r=this.ze.localeDefinitionOverride?.[t];for(let[s,n]of Object.entries(e)){let a=r?.[s];this.e.add(qt(s),a??n,true);}}rn(t){let e=this.i.pluginManager;if(!e)return;let r=e.snapshot();for(let s of r.i18n){let{pluginId:n,...a}=s,l=a[t];if(l)for(let[c,d]of Object.entries(l))d!==void 0&&this.e.add(qt(c),d,true);}}};var au=()=>{let o=navigator.userAgent;return /Macintosh|Windows/.test(o)&&/Version\/[\d.]+.*Safari/.test(o)&&!/Chrome|Chromium|Edg|OPR/.test(o)},lu=()=>"capture"in document.createElement("input"),cu=()=>({safariDesktop:au()}),uu=()=>({htmlMediaCapture:lu()}),Nn=cu(),_n=uu();var fi="image/*",qo="video/*",du=["image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/avif","image/avif-sequence",".heif",".heifs",".heic",".heics",".avif",".avifs"],pu=()=>Nn.safariDesktop?[fi]:[fi,...du],mi=pu(),br=o=>o?o.filter(i=>typeof i=="string").flatMap(i=>Z(i)):[],Wo=(o,i)=>i.some(t=>{if(t.endsWith("*")){let e=t.replace("*","");return o.startsWith(e)}return o===t}),zn=(o,i)=>i.some(t=>t.startsWith(".")?o.toLowerCase().endsWith(t.toLowerCase()):false),Re=o=>{let i=o?.type;return i?Wo(i,mi):false};function Bn(o,i,t,e,r){return {registry:{registerSource:c=>o.addSource(e,c),registerActivity:c=>o.addActivity(e,c),registerFileAction:c=>o.addFileAction(e,c),registerFileHook:c=>o.addFileHook(e,c),registerIcon:c=>o.addIcon(e,c),registerI18n:c=>o.addI18n(e,c),registerConfig:c=>o.addConfig(e,c)},config:{get:c=>{let d=O(c);return i.read(d)},subscribe:(c,d)=>{let u=O(c),h=i.sub(u,f=>{d(f);});return r.push(h),h}},activity:{getParams:()=>i.read("*currentActivityParams"),subscribeToParams:c=>{let d=i.sub("*currentActivityParams",u=>{c(u);});return r.push(d),d}},files:{update:(c,d)=>{let u=t.uploadCollection?.read(c);u&&(d.file!==void 0&&(u.setValue("file",d.file),u.setValue("fileSize",d.file.size)),d.cdnUrl!==void 0&&u.setValue("cdnUrl",d.cdnUrl),d.cdnUrlModifiers!==void 0&&u.setValue("cdnUrlModifiers",d.cdnUrlModifiers),d.mimeType!==void 0&&u.setValue("mimeType",d.mimeType));}}}}var hu=async({entries:o,signal:i})=>(await Promise.all(o.map(async e=>{if(e.isEnabled())try{let r=await e.load();return i.aborted||!e.isEnabled()?void 0:r??void 0}catch(r){i.aborted||console.warn("Failed to load lazy plugin",r);return}}))).filter(e=>e!==void 0),wr=class{constructor(i,t){this.e=i;this.Bc=t;this.Yt=new Set;this.nn=this.e.sub("*lazyPlugins",e=>{this._c(e??[]);});}_c(i){for(let r of this.Yt)r();if(this.Yt.clear(),i.length===0)return;let t=new Set([O("plugins")]);for(let r of i)for(let s of r.configDeps)t.add(O(s));let e=()=>this.an(i);for(let r of t)this.Yt.add(this.e.sub(r,e,false));this.an(i);}an(i){this.oo?.abort();let t=new AbortController;this.oo=t;let e=n=>this.e.read(O(n)),r=e("plugins"),s=hu({entries:i.map(n=>({isEnabled:()=>n.isEnabled(e),load:n.load})),signal:t.signal}).then(n=>{if(!t.signal.aborted)return [...r,...n]});this.Bc(s);}destroy(){this.nn();for(let i of this.Yt)i();this.Yt.clear(),this.oo?.abort();}};var Tr=class{constructor(){this.Ke=new Map;}register(i,t){if(this.Ke.has(t.name)){console.warn(`[CustomConfig] Config option "${t.name}" is already registered`);return}let e={attribute:true,...t,pluginId:i};this.Ke.set(t.name,e);}unregister(i){this.Ke.delete(i);}unregisterByPlugin(i){for(let[t,e]of this.Ke)e.pluginId===i&&this.Ke.delete(t);}get(i){return this.Ke.get(i)}getAll(){return new Map(this.Ke)}};var Er=class{constructor(){this.je=[];this.ve=[];this.Vi=[];this._i=[];this.Bi=[];this.zi=[];this.config=new Tr;}Et(i,t){return {...t,pluginId:i}}addSource(i,t){return this.je.push(this.Et(i,t)),t}addActivity(i,t){return this.ve.push(this.Et(i,t)),t}addFileAction(i,t){return this.Vi.push(this.Et(i,t)),t}addFileHook(i,t){return this._i.push(this.Et(i,t)),t}addIcon(i,t){return this.Bi.push(this.Et(i,t)),t}addI18n(i,t){return this.zi.push(this.Et(i,t)),t}addConfig(i,t){this.config.register(i,t);}purge(i){this.je=this.je.filter(t=>t.pluginId!==i),this.ve=this.ve.filter(t=>t.pluginId!==i),this.Vi=this.Vi.filter(t=>t.pluginId!==i),this._i=this._i.filter(t=>t.pluginId!==i),this.Bi=this.Bi.filter(t=>t.pluginId!==i),this.zi=this.zi.filter(t=>t.pluginId!==i),this.config.unregisterByPlugin(i);}snapshot(){return {sources:[...this.je],activities:[...this.ve],fileActions:[...this.Vi],fileHooks:[...this._i],icons:[...this.Bi],i18n:[...this.zi]}}};var Cr=class extends j{constructor(t){super(t);this.Ge=new Map;this.c=new Set;this.so=Promise.resolve();this.registry=new Er;this.ln=new wr(this.e,e=>{this.so=this.so.then(()=>e).then(r=>{if(r)return this.zc(r)});});}get configRegistry(){return this.registry.config}pluginsReady(){return this.so}onPluginsChange(t){return this.c.add(t),()=>{this.c.delete(t);}}async zc(t){let e=new Set(this.Ge.keys()),r=new Set;for(let s of t){if(r.has(s.id)){this.m(`Plugin "${s.id}" is already in the list, skipping duplicate`);continue}if(r.add(s.id),!this.Ge.has(s.id))try{await this.Hc(s);}catch(n){this.registry.purge(s.id),this.ao(),this.m(`Plugin "${s.id}" setup failed`,n);}e.delete(s.id);}for(let s of e)this.lo(s);}async Hc(t){this.Ge.has(t.id)&&this.lo(t.id);let e=[],r=Bn(this.registry,this.e,this.i,t.id,e),s=this.i.api,n;try{n=await t.setup({pluginApi:r,uploaderApi:s})??void 0;}catch(a){for(let l of e)try{l();}catch(c){this.m("Failed to unsubscribe config listener",c);}throw a}this.Ge.set(t.id,{plugin:t,dispose:n,configSubscriptions:e}),this.ao();}lo(t){let e=this.Ge.get(t);if(e){this.registry.purge(t);for(let r of e.configSubscriptions)try{r();}catch(s){this.m("Failed to unsubscribe config listener",s);}e.dispose?.(),this.Ge.delete(t),this.ao();}}snapshot(){return this.registry.snapshot()}async runOnAddHooks(t){let e=t.getValue("file");if(!e)return;let r=this.registry.snapshot().fileHooks.filter(n=>n.type==="onAdd");if(r.length===0)return;let s=e;for(let n of r)try{({file:s}=await n.handler({file:s}));}catch(a){this.m(`File hook "onAdd" from plugin "${n.pluginId}" failed`,a);}s!==e&&(t.setValue("file",s),t.setValue("fileSize",s.size),t.setValue("mimeType",s.type||null),t.setValue("isImage",Re(s)),s instanceof File&&t.setValue("fileName",s.name));}destroy(){for(let t of Array.from(this.Ge.keys()))this.lo(t);this.ln.destroy(),super.destroy();}ao(){for(let t of this.c)try{t();}catch{}}};function fu(o){return o.replace(/[A-Z]/g,i=>`_${i.toLowerCase()}`).replace(/__/g,"_")}function Yo(o){return Array.isArray(o)?o.map(i=>typeof i=="object"&&i!==null?Yo(i):i):typeof o!="object"||o===null?o:Object.fromEntries(Object.entries(o).map(([i,t])=>{let e=fu(i);return typeof t=="object"&&t!==null?[e,Yo(t)]:[e,t]}))}function mu(o){return {ok:true,value:o}}function Zo(o){return {ok:false,error:o}}var gu="https://tlm.uploadcare.com/api/",Xo=class{constructor(i=gu){this.baseUrl=i;}async base(i,t={}){let e=`${this.baseUrl}${i}`;try{let r=await fetch(e,t);if(!r.ok)return Zo(new Error(`Got non-200 response from "${e}". Status: ${r.status.toString()}`));try{let s=await r.json();return mu(s)}catch(s){return Zo(new Error(`Error parsing JSON from "${e}". Error: ${s}`))}}catch(r){return Zo(new Error(`Error fetching data from "${e}". Error: ${r}`))}}async post(i,t,e={}){return await this.base(i,{...e,method:"POST",body:JSON.stringify(Yo(t)),headers:{"Content-Type":"application/json",...e.headers||{}}})}async get(i,t={}){return await this.base(i,{method:"GET",...t})}},vu=async(o,i)=>({success:true,data:i}),yu=async o=>vu(void 0,o),xr=class extends Xo{constructor(){super();}async sendEvent(i,t){let e=await yu(i);if(!e.success)throw console.error("TelemetryAPIService: events: body is invalid",e.error),new Error("TelemetryAPIService: events: body is invalid");return this.post("v1/events",i,t)}};var bu=20,D=Object.freeze({INIT_SOLUTION:"init-solution",CHANGE_CONFIG:"change-config",ACTION_EVENT:"action-event",ERROR_EVENT:"error-event"}),k=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"}),Sr=class extends j{constructor(){super(...arguments);this.Xt=new Map;this.Hi=new Set;this.te=new Map;}bindTarget(t){return this.Hi.add(t),()=>{this.Hi.delete(t);}}on(t,e){let r=this.te.get(t);return r||(r=new Set,this.te.set(t,r)),r.add(e),()=>this.te.get(t)?.delete(e)}cn(t,e){for(let s of this.Hi)s.dispatchEvent(new CustomEvent(t,{detail:e}));let r=this.te.get(t);if(r)for(let s of r)s(e);this.m?.(()=>{let s=e&&typeof e=="object"?{...e}:e;return [`event "${t}"`,s]});}emit(t,e,r={}){let{debounce:s}=r;if(typeof s!="number"&&!s){this.cn(t,typeof e=="function"?e():e);return}this.Xt.has(t)&&window.clearTimeout(this.Xt.get(t));let n=typeof s=="number"?s:bu,a=window.setTimeout(()=>{try{let l=typeof e=="function"?e():e;this.cn(t,l),this.Xt.delete(t);}catch(l){this.m?.(()=>`Error while getting payload for event "${t}"`,l);}},n);this.Xt.set(t,a);}destroy(){for(let t of this.Xt.values())window.clearTimeout(t);this.Hi.clear(),this.te.clear();}};var Hn="1.28.0-alpha.666";var Pt="blocks",Ut=Hn;var Ar=class extends j{constructor(t){super(t);this.Kc=pt.generateRandomUUID();this.Ct=structuredClone(J);this.co=false;this.uo=null;this.Me=false;this.un=new xr,this.St=new ee(10),this.addSub(this.e.sub(O("qualityInsights"),e=>{this.Me=!!e;}));for(let e of Object.keys(this.Ct))this.addSub(this.e.sub(O(e),r=>{this.Me&&(this.co&&this.Ct[e]!==r&&this.sendEvent({eventType:D.CHANGE_CONFIG}),this.jc(e,r));}));}Gc(t){t===D.INIT_SOLUTION&&!this.co&&(this.co=true);}jc(t,e){this.Ct[t]!==e&&(this.Ct[t]=e);}qc(t){let e=t.payload?{...t.payload}:{};e.activity&&(e.activity=void 0);let r={...t};return (t.eventType===D.INIT_SOLUTION||t.eventType===D.CHANGE_CONFIG)&&(r.config=this.Ct),{...r,appVersion:Ut,appName:Pt,sessionId:this.Kc,component:this.Wc,activity:this.Zc,projectPubkey:this.Ct.pubkey,userAgent:navigator.userAgent,eventType:r.eventType??"",eventTimestamp:this.Yc,payload:{location:this.Xc,...e}}}Qc(t){return !!(t&&[k.CHANGE,k.COMMON_UPLOAD_PROGRESS,k.FILE_ADDED,k.FILE_REMOVED,k.FILE_UPLOAD_START,k.FILE_UPLOAD_PROGRESS,k.FILE_UPLOAD_SUCCESS,k.FILE_UPLOAD_FAILED].includes(t))}sendEvent(t){if(!this.Me)return;let e=this.qc({eventType:t.eventType,payload:t.payload,config:t.config});this.Gc(t.eventType),!(this.Qc(t.eventType)||this.uo&&this.dn(this.uo,e))&&this.St.add(async()=>{this.uo=e,await this.un.sendEvent(e);});}sendEventError(t,e="unknown"){this.sendEvent({eventType:D.ERROR_EVENT,payload:{metadata:{event:"error",text:`Error in ${e}`,error:t.message}}});}sendEventCloudImageEditor(t,e,r={}){this.sendEvent({eventType:D.ACTION_EVENT,payload:{metadata:{tabId:e,node:t.currentTarget?.tagName,event:t.type,...r}}});}dn(t,e){if(JSON.stringify(t)===JSON.stringify(e))return true;if(typeof t!="object"||typeof e!="object"||t==null||e==null)return false;let r=Object.keys(t),s=Object.keys(e);if(r.length!==s.length)return false;for(let n of r)if(!Object.hasOwn(e,n)||!this.dn(t[n],e[n]))return false;return true}get Yc(){return Date.now()}get Wc(){if(!this.e.has("*solution"))return null;let t=this.e.read("*solution");return t?t.toLowerCase():null}get Zc(){return this.e.has("*currentActivity")?this.e.read("*currentActivity"):null}get Xc(){return location.origin}};var Kn=o=>{let i=new Intl.Locale(o),t="ltr",e=i.getTextInfo?.().direction;return e?t=e:i.textInfo?.direction&&(t=i.textInfo.direction),t};var Tu=o=>o;var jn="plural:";function $e(o,i={},t={}){let{openToken:e="{{",closeToken:r="}}",transform:s=Tu}=t;for(let n in i){let a=i[n],l=a?.toString(),c=typeof l=="string"?s(l):String(l);o=o.replaceAll(e+n+r,c);}return o}function Gn(o){let i=[],t=o.indexOf("{{");for(;t!==-1;){let e=o.indexOf("}}",t);if(e===-1)break;let r=o.substring(t+2,e);if(r.startsWith(jn)){let s=o.substring(t+2,e).replace(jn,""),n=s.substring(0,s.indexOf("(")),a=s.substring(s.indexOf("(")+1,s.indexOf(")"));i.push({variable:r,pluralKey:n,countVariable:a});}t=o.indexOf("{{",e);}return i}var qn="--uploadcare-blocks-window-height",gi=class o{static{this.clientsRegistry=new Set;}static{this.flush=$(()=>{document.documentElement.style.setProperty(qn,`${window.innerHeight}px`);},100);}static registerClient(i){o.clientsRegistry.size===0&&o.attachTracker(),o.clientsRegistry.add(i);}static unregisterClient(i){o.clientsRegistry.delete(i),o.clientsRegistry.size===0&&o.detachTracker();}static attachTracker(){window.addEventListener("resize",o.flush,{passive:true,capture:true}),o.flush();}static detachTracker(){window.removeEventListener("resize",o.flush,{capture:true}),document.documentElement.style.removeProperty(qn);}};var kr=(o,i)=>new Intl.PluralRules(o).select(i);var Eu=o=>(i,t)=>{let e=o(),r=e("locale-id")||"en",s=kr(r,t);return e(`${i}__${s}`)},Mr=o=>{let i=Eu(()=>t),t=(e,r={})=>{if(!e)return "";let n=o().read(qt(e))||e,a=Gn(n);for(let c of a)r[c.variable]=i(c.pluralKey,Number(r[c.countVariable]));return $e(n,r)};return t};var Cu=o=>o.tagName?.includes("-")??false,Ir=class{constructor(i){this.qe=new Set;this.Ki=new Map;this.pn=false;this.We=i,this.We.addController(this);}hostDisconnected(){this.ji?.(),this.ji=void 0,this.qe.clear(),this.Ki.clear();}hostUpdated(){if(!this.ji&&this.We.has(O("testMode"))){let i=this.We.subConfigValue("testMode",t=>{this.pn=!!t,this.hn();});this.ji=i;}this.Jc(),this.hn();}Jc(){let i=this.We,t=i.renderRoot??i;if(!t)return;let e=this.We,r=e.tagName?.toLowerCase(),s=Array.from(t.querySelectorAll("[data-testid]")).filter(n=>!Cu(n));for(let n of s)if(!(r&&n.closest(r)!==e)&&!this.qe.has(n)){let a=n.getAttribute("data-testid");if(!a)continue;this.qe.add(n),this.Ki.set(n,a);}for(let n of Array.from(this.qe))(!n.isConnected||r&&n.closest(r)!==e)&&(this.qe.delete(n),this.Ki.delete(n));}hn(){if(!this.qe.size)return;let i=this.We.testId||"";for(let t of this.qe){let e=this.Ki.get(t);e&&(this.pn?t.setAttribute("data-testid",`${i}--${e}`):t.removeAttribute("data-testid"));}}};var xu=Ie(ir()(Me(Ji(wt)))),C=class extends xu{constructor(){super();this.init$=zo();this.l10n=Mr(()=>this.sharedCtx);this.debugPrint=ar(()=>this.sharedCtx,this.constructor.name);this.i=bn(()=>this.sharedCtx);new Ir(this);}static{this.styleAttrs=[];}emit(t,e,r){let s=this.has("*eventEmitter")?this.$["*eventEmitter"]:void 0;if(!s)return;s.emit(t,e,r);let n=typeof e=="function"?e():e;this.telemetryManager.sendEvent({eventType:t,payload:n??void 0});}hasBlockInCtx(t){for(let e of this.blocksRegistry)if(t(e))return true;return false}connectedCallback(){this.constructor.styleAttrs.forEach(e=>{this.setAttribute(e,"");}),super.connectedCallback(),gi.registerClient(this);}initCallback(){this.Z("*blocksRegistry",()=>new Set),this.Z("*pluginManager",t=>new Cr(t)),this.Z("*eventEmitter",t=>new Sr(t)),this.Z("*localeManager",t=>new yr(t)),this.Z("*modalManager",t=>new lr(t)),this.Z("*a11y",()=>new vr),this.Z("*clipboard",t=>new gr(t)),this.Z("*telemetryManager",t=>new Ar(t)),this.sub(qt("locale-id"),t=>{let e=Kn(t);this.style.direction=e==="ltr"?"":e,this.requestUpdate();}),this.subConfigValue("testMode",t=>{if(!t||!this.testId){this.removeAttribute("data-testid");return}this.setAttribute("data-testid",this.testId);}),this.blocksRegistry.add(this);}get testId(){return window.customElements.getName(this.constructor)}get modalManager(){return this.ie("*modalManager",false)}get telemetryManager(){return this.ie("*telemetryManager")}get localeManager(){return this.ie("*localeManager")}get a11y(){return this.ie("*a11y")}get clipboardLayer(){return this.ie("*clipboard")}get blocksRegistry(){return this.ie("*blocksRegistry")}get eventEmitter(){return this.ie("*eventEmitter")}disconnectedCallback(){super.disconnectedCallback(),gi.unregisterClient(this);let t=this.blocksRegistry;t?.delete(this),t?.size===0&&setTimeout(()=>{this.isConnected||t?.size>0||this.destroyCtxCallback();},0);}destroyCtxCallback(){this.eu(),H.deleteCtx(this.ctxName);}mn(){let t="*sharedContextInstances";if(!this.has(t)||!this.$[t]){let e=new Map;this.add(t,e,true);}return this.$[t]}Z(t,e){let r=this.mn();if(!r.has(t)&&(!this.has(t)||!this.$[t])){let s=e(this.i);this.add(t,s,true),r.set(t,s);return}}eu(){let t=this.mn();for(let[e,r]of t.entries())r?.destroy?.(),this.pub(e,null);t.clear();}ie(t,e=true){if(this.has(t)&&this.$[t])return this.$[t];if(!e)return this.$[t];throw new Error(`Unexpected error: context manager for key "${String(t)}" is not available`)}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:sr(t),cdnUrlModifiers:Ao(t),fileName:or(t)})}catch(e){return console.error("Failed to resolve secure delivery proxy URL. Falling back to the default URL.",e),this.telemetryManager.sendEventError(e,"secureDeliveryProxyUrlResolver. Failed to resolve secure delivery proxy URL. Falling back to the default URL."),t}return this.cfg.secureDeliveryProxy?$e(this.cfg.secureDeliveryProxy,{previewUrl:t},{transform:e=>window.encodeURIComponent(e)}):t}get cfg(){if(!this.Be){let t={};this.Be=new Proxy(t,{set:(e,r,s)=>{if(typeof r!="string"||!(r in J))return false;let n=r,a=O(n);return this.has(a)||this.add(a,J[n]),this.$[a]=s,true},get:(e,r)=>{let s=O(r);return this.has(s)||this.add(s,J[r]),this.$[s]}});}return this.Be}subConfigValue(t,e){let r=O(t);return this.has(r)||this.add(r,J[t]),this.sub(r,e)}};var Rt={ATTRIBUTE:1,CHILD:2},ft=o=>(...i)=>({jr:o,values:i}),Tt=class{constructor(i){}get W(){return this.f.W}Gr(i,t,e){this.Gi=i,this.f=t,this.tu=e;}Pc(i,t){return this.update(i,t)}update(i,t){return this.render(...t)}};var be=class extends Tt{constructor(i){if(super(i),this.it=U,i.type!==Rt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(i){if(i===U||i==null)return this.gn=void 0,this.it=i;if(i===it)return i;if(typeof i!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(i===this.it)return this.gn;this.it=i;let t=[i];return t.raw=t,this.gn={Ne:this.constructor.resultType,strings:t,values:[]}}};be.directiveName="unsafeHTML",be.resultType=1;var vi=class extends be{};vi.directiveName="unsafeSVG",vi.resultType=2;var De=ft(vi);var Wn="<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 fill='none' viewBox='0 0 9 6' id='uc-icon-arrow-dropdown' xmlns='http://www.w3.org/2000/svg'><path stroke='currentColor' d='m1.5 1.667 3 2.666 3-2.666' opacity='.5'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-aspect-ratio' xmlns='http://www.w3.org/2000/svg'><path stroke='currentColor' d='M7.395 22.5H2.454v-5.25m14.824 5.25h4.94v-5.25m0-10.5V1.5h-4.94m-9.883 0H2.454v5.25'/></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 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 20 20' id='uc-icon-camera-full' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M2 4.667a2 2 0 0 0-2 2V16a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6.667a2 2 0 0 0-2-2h-2.667l-2-2.667H6.667l-2 2.667H2Zm8 10a3.667 3.667 0 1 0 0-7.334 3.667 3.667 0 0 0 0 7.334Z' fill='currentColor'/></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 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 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 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 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 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 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 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 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-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 24 24' id='uc-icon-microphone' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' clip-rule='evenodd' d='M7.5 4.781a4.5 4.5 0 0 1 9 0v6.469a4.5 4.5 0 1 1-9 0V4.781Zm4.5-3a3 3 0 0 0-3 3v6.469a3 3 0 1 0 6 0V4.781a3 3 0 0 0-3-3Zm-8.156 8.11a.75.75 0 0 1 .75.75 7.406 7.406 0 1 0 14.812 0 .75.75 0 0 1 1.5 0 8.907 8.907 0 0 1-8.156 8.875v2.703h3.258a.75.75 0 1 1 0 1.5H7.992a.75.75 0 0 1 0-1.5h3.258v-2.703a8.907 8.907 0 0 1-8.156-8.875.75.75 0 0 1 .75-.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-microphone-mute' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' clip-rule='evenodd' d='M7.5 4.781a4.5 4.5 0 0 1 9 0V6l3.524-3.524a.75.75 0 1 1 1.061 1.06L5.036 19.585a.75.75 0 0 1-1.06-1.06l1.656-1.657a8.88 8.88 0 0 1-2.538-6.227.75.75 0 0 1 1.5 0c0 2.009.8 3.83 2.1 5.166l1.771-1.772A4.483 4.483 0 0 1 7.5 11.25V4.781Zm2.037 8.182L15 7.5V4.781a3 3 0 1 0-6 0v6.469c0 .637.198 1.227.537 1.713Zm10.62-3.072a.75.75 0 0 1 .75.75 8.907 8.907 0 0 1-8.157 8.875v2.703h3.258a.75.75 0 1 1 0 1.5H7.992a.75.75 0 0 1 0-1.5h3.258v-2.703a8.855 8.855 0 0 1-3.035-.811.75.75 0 1 1 .638-1.358 7.406 7.406 0 0 0 10.553-6.707.75.75 0 0 1 .75-.75ZM15 10.81a.75.75 0 0 1 1.5 0v.439a4.5 4.5 0 0 1-5 4.473.75.75 0 1 1 .166-1.491A3 3 0 0 0 15 11.25v-.44Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-mobile-photo-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-mobile-video-camera' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' clip-rule='evenodd' d='M0 6.75a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v1.078L22.873 5A.75.75 0 0 1 24 5.648v12.704a.75.75 0 0 1-1.123.65L18 16.207v1.043a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V6.75Zm18 7.728 4.5 2.58V6.95L18 9.562v4.916ZM16.5 6.75a1.5 1.5 0 0 0-1.5-1.5H3a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h12a1.5 1.5 0 0 0 1.5-1.5V6.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-ngdrive' 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-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 fill='none' viewBox='0 0 10 10' id='uc-icon-pause' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' d='M1 0h2.5v10H1zM6.5 0H9v10H6.5z'/></symbol><symbol fill='none' viewBox='0 0 10 10' id='uc-icon-play' xmlns='http://www.w3.org/2000/svg'><path d='m1 0 9 5-9 5V0Z' fill='currentColor'/></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 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 fill='none' viewBox='0 0 20 20' id='uc-icon-square' xmlns='http://www.w3.org/2000/svg'><rect width='20' height='20' rx='4' fill='#fff'/></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 24 24' id='uc-icon-video-camera' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' clip-rule='evenodd' d='M0 6.75a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v1.078L22.873 5A.75.75 0 0 1 24 5.648v12.704a.75.75 0 0 1-1.123.65L18 16.207v1.043a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V6.75Zm18 7.728 4.5 2.58V6.95L18 9.562v4.916ZM16.5 6.75a1.5 1.5 0 0 0-1.5-1.5H3a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h12a1.5 1.5 0 0 0 1.5-1.5V6.75Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-video-camera-full' xmlns='http://www.w3.org/2000/svg'><path d='M2 3.333a2 2 0 0 0-2 2v9.334a2 2 0 0 0 2 2h10.938a2 2 0 0 0 2-2v-2.013L20 15.646V4.354l-5.063 3.03v-2.05a2 2 0 0 0-2-2H2Z' fill='currentColor'/></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></svg>";var Wt=class extends C{constructor(){super(...arguments);this.init$=Un(this);}static{this.styleAttrs=["uc-wgt-common"];}static{this.lazyPlugins=null;}initCallback(){super.initCallback(),this.a11y?.registerBlock(this),this.clipboardLayer?.registerBlock(this),this.sharedCtx.pub("*solution",this.tagName);let t=this.constructor.lazyPlugins;t&&this.sharedCtx.pub("*lazyPlugins",t);}render(){return v`${De(Wn)}`}};var Zn=o=>typeof o!="number"?0:Math.floor(o/1e3),Yn=(o,{threshold:i})=>{let{secureExpire:t}=o,e=Zn(Date.now()),r=Number(t),s=Zn(i);return e+s>=r};var Or=class extends j{constructor(){super(...arguments);this.Ze=null;}async getSecureToken(){let{secureSignature:t,secureExpire:e,secureUploadsSignatureResolver:r,secureUploadsExpireThreshold:s}=this.ze;if((t||e)&&r&&console.warn("Both secureSignature/secureExpire and secureUploadsSignatureResolver are set. secureUploadsSignatureResolver will be used."),r){if(!this.Ze||Yn(this.Ze,{threshold:s})){this.Ze?this.m("Secure signature is expired. Resolving a new one..."):this.m("Secure signature is not set yet.");try{let n=await r();n?!n.secureSignature||!n.secureExpire?console.error("Secure signature resolver returned an invalid result:",n):(this.m("Secure signature resolved:",n),this.m("Secure signature will expire in",new Date(Number(n.secureExpire)*1e3).toISOString()),this.Ze=n):(this.m("Secure signature resolver returned nothing."),this.Ze=null);}catch(n){console.error("Secure signature resolving failed. Falling back to the previous one.",n),this.i.telemetryManager.sendEventError(n,"secureUploadsSignatureResolver. Secure signature resolving failed. Falling back to the previous one.");}}return this.Ze}return t&&e?(this.m("Secure signature and expire are set. Using them...",{secureSignature:t,secureExpire:e}),{secureSignature:t,secureExpire:e}):null}destroy(){super.destroy(),this.Ze=null;}};var Qo=(o,i)=>{if(o.failedCount>0)return {type:"SOME_FILES_HAS_ERRORS",message:i.l10n("some-files-were-not-uploaded")}};var Jo=(o,i)=>{let t=o.totalCount,e=i.cfg.multiple?i.cfg.multipleMin:0,r=i.cfg.multiple?i.cfg.multipleMax:1;if(e&&t<e)return {type:"TOO_FEW_FILES",message:i.l10n("files-count-limit-error-too-few",{min:e,max:r,total:t}),payload:{total:t,min:e,max:r}};if(r&&t>r)return {type:"TOO_MANY_FILES",message:i.l10n("files-count-limit-error-too-many",{min:e,max:r,total:t}),payload:{total:t,min:e,max:r}}};var ts=(o,i)=>{let t=i.cfg.imgOnly,e=i.cfg.accept,r=br([...t?mi:[],e]);if(!r.length)return;let s=o.mimeType,n=o.name;if(!s||!n)return;let a=Wo(s,r),l=zn(n,r);if(!a&&!l)return {type:"FORBIDDEN_FILE_TYPE",message:i.l10n("file-type-not-allowed"),payload:{entry:o}}};var es=(o,i)=>{let t=i.cfg.imgOnly,e=o.isImage;if(!(!t||e)&&!(!o.fileInfo&&o.externalUrl)&&!(!o.fileInfo&&!o.mimeType))return {type:"NOT_AN_IMAGE",message:i.l10n("images-only-accepted"),payload:{entry:o}}};var $t=1e3,we=Object.freeze({AUTO:"auto",BYTE:"byte",KB:"kb",MB:"mb",GB:"gb",TB:"tb",PB:"pb"}),yi=o=>Math.ceil(o*100)/100,Xn=(o,i=we.AUTO)=>{let t=i===we.AUTO;if(i===we.BYTE||t&&o<$t**1){let r=kr("en-US",o)==="one"?"byte":"bytes";return `${o} ${r}`}return i===we.KB||t&&o<$t**2?`${yi(o/$t**1)} KB`:i===we.MB||t&&o<$t**3?`${yi(o/$t**2)} MB`:i===we.GB||t&&o<$t**4?`${yi(o/$t**3)} GB`:i===we.TB||t&&o<$t**5?`${yi(o/$t**4)} TB`:`${yi(o/$t**5)} PB`};var is=(o,i)=>{let t=i.cfg.maxLocalFileSizeBytes,e=o.size;if(t&&e&&e>t)return {type:"FILE_SIZE_EXCEEDED",message:i.l10n("files-max-size-limit-error",{maxFileSize:Xn(t)}),payload:{entry:o}}};var rs=(o,i)=>{let{internalId:t}=o;if(!i.v.hasItem(t))return;let r=i.v.read(t)?.getValue("uploadError");if(!r)return;if(r instanceof st)return {type:"UPLOAD_ERROR",message:r.message,payload:{entry:o,error:r}};if(r instanceof Pe)return {type:"NETWORK_ERROR",message:r.message,payload:{entry:o,error:r}};let s=r instanceof Error?r:new Error("Unknown error",{cause:r});return {type:"UNKNOWN_ERROR",message:s.message,payload:{entry:o,error:s}}};var Fe={FILE_VALIDATION_FAILED:"File validator execution has failed",FILE_VALIDATION_TIMEOUT:"File validator execution has timed out",COLLECTION_VALIDATION_FAILED:"Collection validator execution has failed",MISSING_ERROR_MESSAGE:"Missing message. We recommend adding message: value."},Su=o=>typeof o=="function"?{runOn:"change",validator:o}:o,Lr=class extends j{constructor(t){super(t);this.iu=[es,ts,is,rs];this.ru=[Jo,Qo];this.St=new ee(20);this.vn=$(()=>{this.St.run();},500);this.Ie=false;this.At=new Map;let e=$(()=>{this.runFileValidators("change"),this.runCollectionValidators();},0);this.addSub(this.e.sub(O("maxLocalFileSizeBytes"),e)),this.addSub(this.e.sub(O("multipleMin"),e)),this.addSub(this.e.sub(O("multipleMax"),e)),this.addSub(this.e.sub(O("multiple"),e)),this.addSub(this.e.sub(O("imgOnly"),e)),this.addSub(this.e.sub(O("accept"),e)),this.addSub(this.e.sub(O("validationConcurrency"),r=>{this.St.concurrency=r;}));}get v(){return this.i.uploadCollection}runFileValidators(t,e){if(this.Ie)return;let r=e??this.v.items();for(let s of r){let n=this.v.read(s);n&&this.ou(n,t);}}runCollectionValidators(){if(this.Ie)return;let t=this.i.api,e=t.getOutputCollectionState(),r=[],s=this.ze.collectionValidators;for(let n of [...this.ru,...s])try{let a=n(e,t);if(!a)continue;a&&(r.push(this.yn(a)),a.message||console.warn(Fe.MISSING_ERROR_MESSAGE));}catch(a){console.warn(Fe.COLLECTION_VALIDATION_FAILED,a);}this.e.pub("*collectionErrors",r),r.length>0&&this.i.eventEmitter.emit(k.COMMON_UPLOAD_FAILED,()=>t.getOutputCollectionState(),{debounce:true});}cleanupValidationForEntry(t){let e=this.At.get(t.uid);e&&(e.abortController?.abort(),this.At.delete(t.uid));}async ou(t,e){if(this.Ie)return;let r=this.i.api,s=this.bn(t),n=s.promise??Promise.resolve(),a=(async()=>{if(this.Ie||(await n,this.Ie))return;let l=this.su(t,e);if(l.length===0||!this.v.hasItem(t.uid))return;t.setMultipleValues({isQueuedForValidation:true,isValidationPending:true});let c=r.getOutputItem(t.uid),d=new AbortController;s.abortController=d;let u=this.ze.validationTimeout,h=this.wn(),f=new Set(l.map(w=>w.validator)),g=[];for(let w of h)if(!f.has(w.validator)){let E=s.lastErrorThrownByValidator.get(w.validator);E&&g.push(E);}let b=l.map(w=>async()=>{if(this.Ie)return;let E=setTimeout(()=>{s.skippedValidators.add(w.validator),d.abort(),console.warn(Fe.FILE_VALIDATION_TIMEOUT);},u);try{let T=await w.validator(c,r,{signal:d.signal});if(!T||d.signal.aborted){s.lastErrorThrownByValidator.set(w.validator,void 0);return}let A=this.yn(T);s.lastErrorThrownByValidator.set(w.validator,A),g.push(A),T.message||console.warn(Fe.MISSING_ERROR_MESSAGE);}catch(T){d.signal.aborted||(s.skippedValidators.add(w.validator),console.warn(Fe.FILE_VALIDATION_FAILED,T),this.i.telemetryManager.sendEventError(T,`file validator. ${Fe.FILE_VALIDATION_FAILED}`));}finally{clearTimeout(E),w.runOn!=="change"&&s.skippedValidators.add(w.validator);}});if(this.vn(),await this.St.add(async()=>{this.Ie||(t.setValue("isQueuedForValidation",false),await Promise.all(b.map(w=>w())).catch(()=>{}));},{autoRun:false}),d.signal.aborted){t.setMultipleValues({isQueuedForValidation:false,isValidationPending:false});return}t.setMultipleValues({isValidationPending:false,isQueuedForValidation:false,errors:g});})();s.promise=a;try{await a;}finally{s.promise===a&&(s.promise=void 0);}}yn(t){return {...t,type:t.type??"CUSTOM_ERROR"}}bn(t){let e=this.At.get(t.uid);if(e)return e;let r={abortController:void 0,skippedValidators:new WeakSet,promise:void 0,lastErrorThrownByValidator:new WeakMap};return this.At.set(t.uid,r),r}wn(){let t=this.ze.fileValidators;return [...this.iu,...t].map(Su)}su(t,e){let r=this.bn(t);return this.wn().filter(s=>!r.skippedValidators.has(s.validator)).filter(s=>s.runOn===e)}destroy(){this.Ie=true,this.vn.cancel();for(let t of this.At.values())t.abortController?.abort(),t.promise=void 0;this.At.clear();}};var Qn="[Typed State] Wrong property name: ",Pr=class{constructor(i){this.J=pt.generateFastUid(),this.Y=H.registerCtx(i,this.J);}get uid(){return this.J}setValue(i,t){if(!this.Y.has(i)){console.warn(`${Qn}${String(i)}`);return}this.Y.read(i)!==t&&this.Y.pub(i,t);}setMultipleValues(i){for(let[t,e]of Object.entries(i))this.setValue(t,e);}getValue(i){return this.Y.has(i)||console.warn(`${Qn}${String(i)}`),this.Y.read(i)}subscribe(i,t){return this.Y.sub(i,t)}destroy(){H.deleteCtx(this.J);}};var Ur=class o{constructor(i){this.Oe=Object.create(null);this.qi=new Set;this.Wi=new Set;this.ye=new Set;this.po=new Set;this.ho=new Set;this.kt=new Set;this.En=i.initialValue,this.J=pt.generateFastUid(),this.Y=H.registerCtx({},this.J),this.Tn=i.watchList||[];let t=Object.create(null);this.xn=(e,r)=>{this.Qt&&window.clearTimeout(this.Qt),t[e]||(t[e]=new Set),t[e].add(r),this.Qt=window.setTimeout(()=>{Object.keys(t).length!==0&&(this.qi.forEach(s=>{s({...t});}),t=Object.create(null));}),this.Cn();},i.handler&&this.observeCollection(i.handler);}static{this.nu=1e4;}q(){this.Jt&&window.clearTimeout(this.Jt),this.Jt=window.setTimeout(()=>{let i=new Set(this.ho),t=new Set(this.po);this.ho.clear(),this.po.clear();for(let e of this.Wi)e?.([...this.ye],i,t);this.Cn();});}Cn(){this.kt.size!==0&&(this.ei&&window.clearTimeout(this.ei),this.ei=window.setTimeout(()=>{let i=[...this.kt];this.kt.clear();for(let t of i)t.destroy();},o.nu));}observeCollection(i){return this.Wi.add(i),this.ye.size>0&&this.q(),()=>{this.unobserveCollection(i);}}unobserveCollection(i){this.Wi.delete(i);}add(i){let t=new Pr(this.En);for(let[e,r]of Object.entries(i))t.setValue(e,r);return this.ye.add(t.uid),this.q(),this.Y.add(t.uid,t),this.ho.add(t),this.Tn.forEach(e=>{this.Oe[t.uid]||(this.Oe[t.uid]=[]),this.Oe[t.uid]?.push(t.subscribe(e,()=>{this.xn(e,t.uid);}));}),t.uid}hasItem(i){return this.ye.has(i)}read(i){return this.Y.read(i)??null}readProp(i,t){let e=this.read(i);if(!e)throw new Error(`TypedCollection#readProp: Item with id ${i} not found`);return e.getValue(t)}publishProp(i,t,e){let r=this.read(i);if(!r)throw new Error(`TypedCollection#publishProp: Item with id ${i} not found`);r.setValue(t,e);}remove(i){let t=this.read(i);t&&(this.po.add(t),this.kt.add(t)),this.ye.delete(i),this.q(),this.Y.pub(i,void 0),this.Oe[i]?.forEach(e=>{e();}),delete this.Oe[i];}clearAll(){this.ye.forEach(i=>{this.remove(i);});}observeProperties(i){return this.qi.add(i),()=>{this.unobserveProperties(i);}}unobserveProperties(i){this.qi.delete(i);}findItems(i){let t=[];return this.ye.forEach(e=>{let r=this.read(e);r&&i(r)&&t.push(e);}),t}items(){return [...this.ye]}get size(){return this.ye.size}destroy(){this.Qt&&window.clearTimeout(this.Qt),this.Jt&&window.clearTimeout(this.Jt),this.ei&&window.clearTimeout(this.ei);for(let i of this.kt)i.destroy();this.kt.clear(),H.deleteCtx(this.J),this.qi=new Set,this.Wi=new Set;for(let i of Object.keys(this.Oe))this.Oe[i]?.forEach(t=>{t();}),delete this.Oe[i];}};var P=Object.freeze({PHOTO:"photo",VIDEO:"video"}),Et=Object.freeze({IDLE:"idle",SHOT:"shot",PLAY:"play",PAUSE:"pause",RESUME:"resume",STOP:"stop",RETAKE:"retake",ACCEPT:"accept"});var Jn=o=>({isVideoRecordingEnabled:K(o.cameraModes).includes(P.VIDEO),isPhotoEnabled:K(o.cameraModes).includes(P.PHOTO)});var ta=(o,i)=>{for(let t of o)if(i(t))return t};var os=(o,i,{timeout:t=1e3,onTimeout:e}={})=>new Promise(r=>{let s,n=setTimeout(()=>{cancelAnimationFrame(s),e?.();},t),a=()=>{for(let l of o)if(i(l)){clearTimeout(n),r(l);return}s=requestAnimationFrame(a);};a();});function Rr(o,i){for(let t in i)t.includes("-")?o.style.setProperty(t,String(i[t])):o.style[t]=String(i[t]);}var Au=/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/i,ku=new RegExp(`^/?(${Au.source})(?:/(-/(?:[^/]+/)+)?([^/]*))?$`,"i"),ea=({url:o,cdnBase:i})=>{let t=new URL(i),e=new URL(pi),r=new URL(o);if(t.host!==r.host&&e.host!==r.host)return null;let s=ku.exec(r.pathname);if(!s)return null;let[,n,a,l]=s;return n?{uuid:n,cdnUrlModifiers:a||"",filename:l||null}:null};var Ct=Object.freeze({FACEBOOK:"facebook",DROPBOX:"dropbox",GDRIVE:"gdrive",GPHOTOS:"gphotos",FLICKR:"flickr",VK:"vk",EVERNOTE:"evernote",BOX:"box",ONEDRIVE:"onedrive",HUDDLE:"huddle"}),Mu=Object.freeze({MOBILE_VIDEO_CAMERA:"mobile-video-camera",MOBILE_PHOTO_CAMERA:"mobile-photo-camera"}),N=Object.freeze({LOCAL:"local",DROP_AREA:"drop-area",CAMERA:"camera",EXTERNAL:"external",API:"js-api",URL:"url",...Mu,...Ct});var $r=o=>o.uploadCollection.items().map(e=>o.api.getOutputItem(e));function ia(o){let i=new Map;return (...e)=>{let r=JSON.stringify(e);if(i.has(r))return i.get(r);let s=o(...e);return i.set(r,s),s}}var ra=new Set;function Dr(o){ra.has(o)||(ra.add(o),console.warn(o));}function Iu(o){let i=false;return setTimeout(()=>{i=true;},0),e=>((...r)=>(i&&Dr(o),e(...r)))}function oa(o){let i={},t=o.ctx,e={progress:()=>t.read("*commonProgress"),errors:()=>t.read("*collectionErrors"),group:()=>t.read("*groupInfo"),totalCount:()=>o.uploadCollection.size,failedCount:()=>i.failedEntries.length,successCount:()=>i.successEntries.length,uploadingCount:()=>i.uploadingEntries.length,status:()=>i.isFailed?"failed":i.isUploading?"uploading":i.isSuccess?"success":"idle",isSuccess:()=>i.allEntries.length>0&&i.errors.length===0&&i.successEntries.length===i.allEntries.length,isUploading:()=>i.allEntries.some(s=>s.status==="uploading"),isFailed:()=>i.errors.length>0||i.failedEntries.length>0,allEntries:()=>$r(o),successEntries:()=>i.allEntries.filter(s=>s.status==="success"),failedEntries:()=>i.allEntries.filter(s=>s.status==="failed"),uploadingEntries:()=>i.allEntries.filter(s=>s.status==="uploading"),idleEntries:()=>i.allEntries.filter(s=>s.status==="idle")},r=Iu("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,n]of Object.entries(e)){let a=s,c=ia(r(n));Object.defineProperty(i,a,{get:c,enumerable:true});}return i}var Fr=class extends j{constructor(){super(...arguments);this.au=Mr(()=>this.e);this.addFileFromUrl=(t,{silent:e,fileName:r,source:s}={})=>{let n=this.v.add({externalUrl:t,fileName:r??null,silent:e??false,source:s??N.API});return this.getOutputItem(n)};this.addFileFromUuid=(t,{silent:e,fileName:r,source:s}={})=>{let n=this.v.add({uuid:t,fileName:r??null,silent:e??false,source:s??N.API});return this.getOutputItem(n)};this.addFileFromCdnUrl=(t,{silent:e,fileName:r,source:s}={})=>{let n=ea({url:t,cdnBase:this.cfg.cdnCname});if(!n)throw new Error("Invalid CDN URL");let a=this.v.add({uuid:n.uuid,cdnUrl:t,cdnUrlModifiers:n.cdnUrlModifiers,fileName:r??n.filename??null,silent:e??false,source:s??N.API});return this.getOutputItem(a)};this.addFileFromObject=(t,{silent:e,fileName:r,source:s,fullPath:n}={})=>{let a=this.v.add({file:t,isImage:Re(t),mimeType:t.type||null,fileName:r??t.name,fileSize:t.size,silent:e??false,source:s??N.API,fullPath:n??null});return this.getOutputItem(a)};this.removeFileByInternalId=t=>{if(!this.v.read(t))throw new Error(`File with internalId ${t} not found`);this.v.remove(t);};this.uploadAll=()=>{let t=this.v.items().filter(e=>{let r=this.v.read(e);return r?!r.getValue("isRemoved")&&!r.getValue("isUploading")&&!r.getValue("fileInfo")&&r.getValue("errors").length===0&&!r.getValue("isValidationPending")&&!r.getValue("isQueuedForValidation"):false});t.length!==0&&(this.e.pub("*uploadTrigger",new Set(t)),this.i.eventEmitter.emit(k.COMMON_UPLOAD_START,this.getOutputCollectionState()));};this.openSystemDialog=(t={})=>{let e=Bt(br([this.cfg.accept??"",...this.cfg.imgOnly?mi:[]])),r="uploadcare-file-input",s=document.createElement("input");if(s.setAttribute(r,""),Rr(s,{opacity:0,height:0,width:0,visibility:"hidden",position:"absolute",top:0,left:0}),s.type="file",s.multiple=this.cfg.multiple,t.captureCamera){s.capture=this.cfg.cameraCapture;let{isPhotoEnabled:n,isVideoRecordingEnabled:a}=Jn(this.cfg);t.modeCamera===P.PHOTO&&n?s.accept=fi:t.modeCamera===P.VIDEO&&a?s.accept=qo:s.accept=[fi,a&&qo].filter(Boolean).join(",");}else s.accept=e;s.addEventListener("change",()=>{s.files&&([...s.files].forEach(n=>{this.addFileFromObject(n,{source:t.captureCamera?N.CAMERA:N.LOCAL});}),this.e.pub("*currentActivity",F.UPLOAD_LIST),this.i.modalManager?.open(F.UPLOAD_LIST),s.remove());},{once:true}),document.querySelectorAll(`[${r}]`).forEach(n=>{n.remove();}),document.body.appendChild(s),s.dispatchEvent(new MouseEvent("click"));};this.initFlow=(t=false)=>{if(this.v.size>0&&!t)this.e.pub("*currentActivity",F.UPLOAD_LIST),this.i.modalManager?.open(F.UPLOAD_LIST);else if(this.Sn?.length===1){let e=this.Sn[0];this.fo().then(()=>{let r=this.i.pluginManager.snapshot().sources,s=r.find(n=>n.id===e);if(s){let n=s.expand?.()??[e];n.length===1?(r.find(l=>l.id===n[0])??s).onSelect():(this.e.pub("*currentActivity",F.START_FROM),this.i.modalManager?.open(F.START_FROM));return}this.e.read("*currentActivity")&&this.i.modalManager?.open(this.e.read("*currentActivity"));});}else this.e.pub("*currentActivity",F.START_FROM),this.i.modalManager?.open(F.START_FROM);};this.doneFlow=()=>{let t=ta(this.i.blocksRegistry,e=>"doneActivity"in e);t&&(this.e.pub("*currentActivity",t.doneActivity),this.e.pub("*history",t.doneActivity?[t.doneActivity]:[]),this.e.read("*currentActivity")||this.i.modalManager?.closeAll());};this.setCurrentActivity=(t,...e)=>{this.fo().then(()=>{this.e.pub("*currentActivityParams",e[0]??{}),this.e.pub("*currentActivity",t),os(this.i.blocksRegistry,r=>r.activityType===t,{onTimeout:()=>console.warn(`Activity type "${t}" not found in the context`),timeout:100});});};this.on=(t,e)=>this.i.eventEmitter.on(t,e);this.getCurrentActivity=()=>this.e.read("*currentActivity");this.historyBack=()=>{this.e.read("*historyBack")?.();};this.setModalState=t=>{this.fo().then(()=>{if(!t){this.i.modalManager?.close(this.e.read("*currentActivity")),this.e.pub("*currentActivity",null);return}let e=this.e.read("*currentActivity");if(!e){console.warn(`Can't open modal without current activity. Please use "setCurrentActivity" method first.`);return}return os(this.i.blocksRegistry,r=>r.activityType===e,{onTimeout:()=>console.warn(`Activity block "${e}" not found in the context`)}).then(()=>{this.i.modalManager?.open(e);})});};}get v(){return this.i.uploadCollection}get cfg(){return this.ze}get l10n(){return this.au}removeAllFiles(){this.v.clearAll();}getOutputItem(t){let e=H.getCtx(t);if(!e)throw new Error(`UploaderPublicApi#getOutputItem: Entry with ID "${t}" not found in the upload collection`);let r=e.store,s=r.fileInfo,n=r.isRemoved?"removed":r.errors.length>0?"failed":r.fileInfo?"success":r.isUploading?"uploading":"idle";return {uuid:s?.uuid??r.uuid??null,internalId:t,name:s?.originalFilename??r.fileName,size:s?.size??r.fileSize,isImage:s?.isImage??r.isImage,mimeType:s?.mimeType??r.mimeType,file:r.file,externalUrl:r.externalUrl,cdnUrlModifiers:r.cdnUrlModifiers,cdnUrl:r.cdnUrl??s?.cdnUrl??null,fullPath:r.fullPath,uploadProgress:r.uploadProgress,fileInfo:s??null,metadata:r.metadata??s?.metadata??null,isSuccess:n==="success",isUploading:n==="uploading",isFailed:n==="failed",isRemoved:n==="removed",isValidationPending:r.isValidationPending,errors:r.errors,status:n,source:r?.source}}getOutputCollectionState(){return oa(this.i)}async fo(){return (await this.i.wait("pluginManager")).pluginsReady()}get Sn(){let t=[];return this.cfg.sourceList&&(t=Z(this.cfg.sourceList)),t}};var sa={file:null,externalUrl:null,fileName:null,fileSize:null,lastModified:Date.now(),uploadProgress:0,uuid:null,isImage:false,mimeType:null,ctxName:null,cdnUrl:null,cdnUrlModifiers:null,fileInfo:null,isUploading:false,abortController:null,thumbUrl:null,silent:false,source:null,fullPath:null,metadata:null,errors:[],uploadError:null,isRemoved:false,isQueuedForUploading:false,isValidationPending:false,isQueuedForValidation:false};var bi=33.333333333333336,M=1,ss=24,na=6;function oe(o,i){for(let[t,e]of Object.entries(i))o.setAttributeNS(null,t,e.toString());}function mt(o,i={}){let t=document.createElementNS("http://www.w3.org/2000/svg",o);return oe(t,i),t}function aa(o,i,t){let{x:e,y:r,width:s,height:n}=o,a=i.includes("w")?0:1,l=i.includes("n")?0:1,c=a===0?-1:1,d=l===0?-1:1,u=[e+a*s+1.5*c,r+l*n+1.5*d-24*t*d],h=[e+a*s+1.5*c,r+l*n+1.5*d],f=[e+a*s-24*t*c+1.5*c,r+l*n+1.5*d],g=`M ${u[0]} ${u[1]} L ${h[0]} ${h[1]} L ${f[0]} ${f[1]}`,b=[h[0],h[1]];return {d:g,center:b}}function la(o,i,t){let{x:e,y:r,width:s,height:n}=o,a=i==="n"||i==="s",l=i==="w"||i==="e",c=a?.5:i==="w"?0:1,d=l?.5:i==="n"?0:1,u=i==="w"?-1:i==="e"?1:0,h=i==="n"?-1:i==="s"?1:0,f,g;a?(f=[e+c*s-34*t/2,r+d*n+1.5*h],g=[e+c*s+34*t/2,r+d*n+1.5*h]):(f=[e+c*s+1.5*u,r+d*n-34*t/2],g=[e+c*s+1.5*u,r+d*n+34*t/2]);let b=`M ${f[0]} ${f[1]} L ${g[0]} ${g[1]}`,w=[(f[0]+g[0])/2,(f[1]+g[1])/2];return {d:b,center:w}}function ca(o){return o===""?"move":["e","w"].includes(o)?"ew-resize":["n","s"].includes(o)?"ns-resize":["nw","se"].includes(o)?"nwse-resize":"nesw-resize"}function ua({rect:o,delta:[i,t],imageBox:e}){return Ne({...o,x:o.x+i,y:o.y+t},e)}function Ne(o,i){let{x:t}=o,{y:e}=o;return o.x<i.x?t=i.x:o.x+o.width>i.x+i.width&&(t=i.x+i.width-o.width),o.y<i.y?e=i.y:o.y+o.height>i.y+i.height&&(e=i.y+i.height-o.height),{...o,x:t,y:e}}function Ou({rect:o,delta:i,aspectRatio:t,imageBox:e}){let[,r]=i,{y:s,width:n,height:a}=o;s+=r,a-=r,t&&(n=a*t);let l=o.x+o.width/2-n/2;return s<=e.y&&(s=e.y,a=o.y+o.height-s,t&&(n=a*t,l=o.x+o.width/2-n/2)),l<=e.x&&(l=e.x,s=o.y+o.height-a),l+n>=e.x+e.width&&(l=Math.max(e.x,e.x+e.width-n),n=e.x+e.width-l,t&&(a=n/t),s=o.y+o.height-a),a<M&&(a=M,t&&(n=a*t,l=o.x+o.width/2-n/2),s=o.y+o.height-a),n<M&&(n=M,t&&(a=n/t,l=o.x+o.width/2-n/2),s=o.y+o.height-a),{x:l,y:s,width:n,height:a}}function Lu({rect:o,delta:i,aspectRatio:t,imageBox:e}){let[r]=i,{x:s,width:n,height:a}=o;s+=r,n-=r,t&&(a=n/t);let l=o.y+o.height/2-a/2;return s<=e.x&&(s=e.x,n=o.x+o.width-s,t&&(a=n/t,l=o.y+o.height/2-a/2)),l<=e.y&&(l=e.y,s=o.x+o.width-n),l+a>=e.y+e.height&&(l=Math.max(e.y,e.y+e.height-a),a=e.y+e.height-l,t&&(n=a*t),s=o.x+o.width-n),a<M&&(a=M,t&&(n=a*t),l=o.y+o.height/2-a/2,s=o.x+o.width-n),n<M&&(n=M,t&&(a=n/t),l=o.y+o.height/2-a/2,s=o.x+o.width-n),{x:s,y:l,width:n,height:a}}function Pu({rect:o,delta:i,aspectRatio:t,imageBox:e}){let[,r]=i,{y:s,width:n,height:a}=o;a+=r,t&&(n=a*t);let l=o.x+o.width/2-n/2;return s+a>=e.y+e.height&&(a=e.y+e.height-s,t&&(n=a*t),l=o.x+o.width/2-n/2),l<=e.x&&(l=e.x,s=o.y),l+n>=e.x+e.width&&(l=Math.max(e.x,e.x+e.width-n),n=e.x+e.width-l,t&&(a=n/t),s=o.y),a<M&&(a=M,t&&(n=a*t),l=o.x+o.width/2-n/2),n<M&&(n=M,t&&(a=n/t),l=o.x+o.width/2-n/2),{x:l,y:s,width:n,height:a}}function Uu({rect:o,delta:i,aspectRatio:t,imageBox:e}){let[r]=i,{x:s,width:n,height:a}=o;n+=r,t&&(a=n/t);let l=o.y+o.height/2-a/2;return s+n>=e.x+e.width&&(n=e.x+e.width-s,t&&(a=n/t),l=o.y+o.height/2-a/2),l<=e.y&&(l=e.y,s=o.x),l+a>=e.y+e.height&&(l=Math.max(e.y,e.y+e.height-a),a=e.y+e.height-l,t&&(n=a*t),s=o.x),a<M&&(a=M,t&&(n=a*t),l=o.y+o.height/2-a/2),n<M&&(n=M,t&&(a=n/t),l=o.y+o.height/2-a/2),{x:s,y:l,width:n,height:a}}function Ru({rect:o,delta:i,aspectRatio:t,imageBox:e}){let[r,s]=i,{x:n,y:a,width:l,height:c}=o;return n+r<e.x&&(r=e.x-n),a+s<e.y&&(s=e.y-a),n+=r,l-=r,a+=s,c-=s,t&&Math.abs(l/c)>t?(s=l/t-c,c+=s,a-=s,a<=e.y&&(c=c-(e.y-a),l=c*t,n=o.x+o.width-l,a=e.y)):t&&(r=c*t-l,l=l+r,n-=r,n<=e.x&&(l=l-(e.x-n),c=l/t,n=e.x,a=o.y+o.height-c)),c<M&&(c=M,t&&(l=c*t),n=o.x+o.width-l,a=o.y+o.height-c),l<M&&(l=M,t&&(c=l/t),n=o.x+o.width-l,a=o.y+o.height-c),{x:n,y:a,width:l,height:c}}function $u({rect:o,delta:i,aspectRatio:t,imageBox:e}){let[r,s]=i,{x:n,y:a,width:l,height:c}=o;return n+l+r>e.x+e.width&&(r=e.x+e.width-n-l),a+s<e.y&&(s=e.y-a),l+=r,a+=s,c-=s,t&&Math.abs(l/c)>t?(s=l/t-c,c+=s,a-=s,a<=e.y&&(c=c-(e.y-a),l=c*t,n=o.x,a=e.y)):t&&(r=c*t-l,l+=r,n+l>=e.x+e.width&&(l=e.x+e.width-n,c=l/t,n=e.x+e.width-l,a=o.y+o.height-c)),c<M&&(c=M,t&&(l=c*t),a=o.y+o.height-c),l<M&&(l=M,t&&(c=l/t),a=o.y+o.height-c),{x:n,y:a,width:l,height:c}}function Du({rect:o,delta:i,aspectRatio:t,imageBox:e}){let[r,s]=i,{x:n,y:a,width:l,height:c}=o;return n+r<e.x&&(r=e.x-n),a+c+s>e.y+e.height&&(s=e.y+e.height-a-c),n+=r,l-=r,c+=s,t&&Math.abs(l/c)>t?(s=l/t-c,c+=s,a+c>=e.y+e.height&&(c=e.y+e.height-a,l=c*t,n=o.x+o.width-l,a=e.y+e.height-c)):t&&(r=c*t-l,l+=r,n-=r,n<=e.x&&(l=l-(e.x-n),c=l/t,n=e.x,a=o.y)),c<M&&(c=M,t&&(l=c*t),n=o.x+o.width-l),l<M&&(l=M,t&&(c=l/t),n=o.x+o.width-l),{x:n,y:a,width:l,height:c}}function Fu({rect:o,delta:i,aspectRatio:t,imageBox:e}){let[r,s]=i,{x:n,y:a,width:l,height:c}=o;return n+l+r>e.x+e.width&&(r=e.x+e.width-n-l),a+c+s>e.y+e.height&&(s=e.y+e.height-a-c),l+=r,c+=s,t&&Math.abs(l/c)>t?(s=l/t-c,c+=s,a+c>=e.y+e.height&&(c=e.y+e.height-a,l=c*t,n=o.x,a=e.y+e.height-c)):t&&(r=c*t-l,l+=r,n+l>=e.x+e.width&&(l=e.x+e.width-n,c=l/t,n=e.x+e.width-l,a=o.y)),c<M&&(c=M,t&&(l=c*t)),l<M&&(l=M,t&&(c=l/t)),{x:n,y:a,width:l,height:c}}function da({direction:o,...i}){switch(o){case "n":return Ou(i);case "w":return Lu(i);case "s":return Pu(i);case "e":return Uu(i);case "nw":return Ru(i);case "ne":return $u(i);case "sw":return Du(i);case "se":return Fu(i);default:return i.rect}}function pa(o,[i,t]){return o.x<=i&&i<=o.x+o.width&&o.y<=t&&t<=o.y+o.height}function ha(o,i){return o.x>=i.x&&o.y>=i.y&&o.x+o.width<=i.x+i.width&&o.y+o.height<=i.y+i.height}function fa(o,i){return Math.abs(o.width/o.height-i)<.1}function _e({width:o,height:i},t){let e=t/90%2!==0;return {width:e?i:o,height:e?o:i}}function ma(o,i,t){let e=o/i,r,s;e>t?(r=Math.round(i*t),s=i):(r=o,s=Math.round(o/t));let n=Math.round((o-r)/2),a=Math.round((i-s)/2);return n+r>o&&(r=o-n),a+s>i&&(s=i-a),{x:n,y:a,width:r,height:s}}function ze(o){return {x:Math.round(o.x),y:Math.round(o.y),width:Math.round(o.width),height:Math.round(o.height)}}function se(o,i,t){return Math.min(Math.max(o,i),t)}var wi=["free"],Nr=o=>{let i=Z(o);if(!i||i.length===0)return [];let t=[];for(let e of i){let r=e.trim();if(!r)continue;let s=r.indexOf(":");if(s===-1&&!wi.includes(r)){console.warn(`Invalid crop preset: ${r}`);continue}let n=Number(r.slice(0,s)),a=Number(r.slice(s+1));if((!Number.isFinite(n)||!Number.isFinite(a)||n<=0||a<=0)&&!wi.includes(r)){console.warn(`Invalid crop preset: ${r}`);continue}t.push({id:pt.generateFastUid(),type:"aspect-ratio",width:wi.includes(r)?0:n,height:wi.includes(r)?0:a,hasFreeform:wi.includes(r)});}return t},ga=(o,i,t,e=.1)=>{let r=o/i,s=null,n=1/0;for(let a of t){let[l,c]=[a.width,a.height],d=l/c,u=Math.abs(r-d);u<n&&(n=u,s=a);}if(s){let[a,l]=[s.width,s.height],c=a/l;if(Math.abs(r-c)/c>e)return null}return s};function va(o){return $o({...o,libraryName:Pt,libraryVersion:Ut})}var ya="active",Be="___ACTIVITY_IS_ACTIVE___",ba,x=class o extends(ba=C,ba){constructor(){super(...arguments);this.historyTracked=false;this.activityType=null;this.init$=Bo(this);this.lu=$(this.cu.bind(this),10);}An(){let t=o.ti.get(this);this[Be]=false,this.removeAttribute(ya),t?.deactivateCallback?.();}uu(){let t=o.ti.get(this);this.$["*historyBack"]=this.historyBack.bind(this),this[Be]=true,this.setAttribute(ya,""),t?.activateCallback?.(),this.lu(),this.emit(k.ACTIVITY_CHANGE,{activity:this.activityType});}initCallback(){super.initCallback(),this.activityType&&(this.hasAttribute("activity")||this.setAttribute("activity",this.activityType),this.sub("*currentActivity",t=>{try{this.activityType!==t&&this[Be]?this.An():this.activityType===t&&!this[Be]&&this.uu();}catch(e){this.telemetryManager.sendEventError(e,`activity "${this.activityType}"`),console.error(`Error in activity "${this.activityType}". `,e);let r=this.$["*history"][this.$["*history"].length-1];this.$["*currentActivity"]=r??null;}t||(this.$["*history"]=[]);}));}cu(){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);}kn(){return !!this.activityType&&o.ti.has(this)}static{this.ti=new Map;}get isActivityActive(){return !!this[Be]}get couldOpenActivity(){return true}registerActivity(t,e={}){let{onActivate:r,onDeactivate:s}=e;o.ti.set(this,{activateCallback:r,deactivateCallback:s});}du(){this.isActivityActive&&this.An(),o.ti.delete(this);}disconnectedCallback(){super.disconnectedCallback(),this.kn()&&this.du();}get activityParams(){return this.$["*currentActivityParams"]}get initActivity(){return this.getCssData("--cfg-init-activity")??null}get doneActivity(){return this.getCssData("--cfg-done-activity")??null}historyBack(){let t=this.$["*history"];if(t){let e=t.pop();for(;e===this.activityType;)e=t.pop();let r=!!e;e&&(r=[...this.blocksRegistry].find(n=>n.activityType===e)?.couldOpenActivity??false),e=r?e:null,this.$["*currentActivity"]=e??null,e&&this.modalManager?.open(e),this.$["*history"]=t,e||this.modalManager?.closeAll();}}};x.activities=F;var R=class o extends x{constructor(){super(...arguments);this.couldBeCtxOwner=false;this.Zi=false;this.init$=Ho(this);this.vo=$(async()=>{if(this.getOutputData().length!==this.uploadCollection.size)return;let e=this.api.getOutputCollectionState();this.$["*collectionState"]=e,this.emit(k.CHANGE,()=>this.api.getOutputCollectionState(),{debounce:true}),this.cfg.groupOutput&&e.totalCount>0&&e.status==="success"&&this.gu(e);},300);this.fu=(t,e,r)=>{if(this.isConnected){(e.size||r.size)&&(this.$["*groupInfo"]=null),this.validationManager.runFileValidators("add",[...e].map(s=>s.uid));for(let s of e)s.getValue("silent")||this.emit(k.FILE_ADDED,this.api.getOutputItem(s.uid)),this.i.wait("pluginManager").then(n=>n.runOnAddHooks(s));this.validationManager.runCollectionValidators();for(let s of r){this.$["*uploadTrigger"].delete(s.uid),this.validationManager.cleanupValidationForEntry(s),s.getValue("abortController")?.abort(),s.setMultipleValues({isRemoved:true,abortController:null,isUploading:false,uploadProgress:0});let n=s?.getValue("thumbUrl");n&&URL.revokeObjectURL(n),this.emit(k.FILE_REMOVED,this.api.getOutputItem(s.uid));}this.$["*uploadList"]=t.map(s=>({uid:s})),this.On(),this.vo();}};this.mu=t=>{if(!this.isConnected)return;this.vo();let e=this.uploadCollection,r=[...new Set(Object.entries(t).filter(([s])=>["file","uploadError","fileInfo","cdnUrl","cdnUrlModifiers"].includes(s)).flatMap(([,s])=>[...s]))];if(r.length>0&&setTimeout(()=>{if(!this.isConnected)return;let s=r.filter(n=>t.fileInfo?.has(n)&&!!H.getCtx(n)?.store.fileInfo);s.length>0&&this.validationManager.runFileValidators("upload",s),this.validationManager.runFileValidators("change",r);}),t.uploadProgress){for(let s of t.uploadProgress){let n=H.getCtx(s);if(!n)continue;let{isUploading:a,silent:l}=n.store;a&&!l&&this.emit(k.FILE_UPLOAD_PROGRESS,this.api.getOutputItem(s));}this.On();}if(t.isUploading)for(let s of t.isUploading){let n=H.getCtx(s);if(!n)continue;let{isUploading:a,silent:l}=n.store;a&&!l&&this.emit(k.FILE_UPLOAD_START,this.api.getOutputItem(s));}if(t.fileInfo){for(let s of t.fileInfo){let n=H.getCtx(s);if(!n)continue;let{fileInfo:a,silent:l}=n.store;a&&!l&&this.emit(k.FILE_UPLOAD_SUCCESS,this.api.getOutputItem(s));}this.cfg.cropPreset&&this.vu();}if(t.errors){this.validationManager.runCollectionValidators();for(let a of t.errors){let l=H.getCtx(a);if(!l)continue;let{errors:c}=l.store;c.length>0&&(this.emit(k.FILE_UPLOAD_FAILED,this.api.getOutputItem(a)),this.emit(k.COMMON_UPLOAD_FAILED,()=>this.api.getOutputCollectionState(),{debounce:true}));}let s=e.findItems(a=>!!a.getValue("fileInfo")),n=e.findItems(a=>a.getValue("errors").length>0);e.size>0&&n.length===0&&e.size===s.length&&this.$["*collectionErrors"].length===0&&this.emit(k.COMMON_UPLOAD_SUCCESS,this.api.getOutputCollectionState());}t.cdnUrl&&([...t.cdnUrl].filter(n=>!!this.uploadCollection.read(n)?.getValue("cdnUrl")).forEach(n=>{this.emit(k.FILE_URL_CHANGED,this.api.getOutputItem(n));}),this.$["*groupInfo"]=null);};this.On=()=>{let t=0,r=[...this.$["*uploadTrigger"]].filter(n=>!!this.uploadCollection.read(n));r.forEach(n=>{let a=this.uploadCollection.readProp(n,"uploadProgress");typeof a=="number"&&(t+=a);});let s=r.length?Math.round(t/r.length):0;this.$["*commonProgress"]!==s&&(this.$["*commonProgress"]=s,this.emit(k.COMMON_UPLOAD_PROGRESS,this.api.getOutputCollectionState()));};}get pu(){return this.hasBlockInCtx(t=>t instanceof o?t.Zi&&t.isConnected&&t!==this:false)}initCallback(){super.initCallback(),this.Z("*uploadCollection",()=>new Ur({initialValue:sa,watchList:["file","uploadProgress","uploadError","fileInfo","errors","cdnUrl","isUploading","isValidationPending"]})),this.Z("*secureUploadsManager",t=>new Or(t)),this.Z("*validationManager",t=>new Lr(t)),this.Z("*publicApi",t=>new Fr(t)),!this.pu&&this.couldBeCtxOwner&&this.hu();}getAPI(){return this.api}get validationManager(){return this.ie("*validationManager")}get api(){return this.ie("*publicApi")}get uploadCollection(){return this.ie("*uploadCollection")}get secureUploadsManager(){return this.ie("*secureUploadsManager")}disconnectedCallback(){super.disconnectedCallback(),this.Zi&&this.Mn(),this.vo.cancel();}connectedCallback(){super.connectedCallback(),this.Zi&&this.In();}hu(){this.Zi=true,this.In(),this.subConfigValue("maxConcurrentRequests",t=>{this.$["*uploadQueue"].concurrency=Number(t)||1;});}In(){this.Mn(),this.mo=this.uploadCollection.observeCollection(this.fu),this.go=this.uploadCollection.observeProperties(this.mu);}Mn(){this.go?.(),this.mo?.(),this.go=void 0,this.mo=void 0;}async gu(t){let e=await this.getUploadClientOptions(),r=t.allEntries.map(l=>l.uuid+(l.cdnUrlModifiers?`/${l.cdnUrlModifiers}`:"")),s=new AbortController,n=await Pn(r,{...e,signal:s.signal});if(this.$["*collectionState"]!==t){s.abort();return}this.$["*groupInfo"]=n;let a=this.api.getOutputCollectionState();this.emit(k.GROUP_CREATED,a),this.emit(k.CHANGE,()=>this.api.getOutputCollectionState(),{debounce:true}),this.$["*collectionState"]=a;}vu(){let t=Nr(this.cfg.cropPreset);if(!t)return;let[e]=t,r=this.uploadCollection.findItems(s=>!!s.getValue("fileInfo")&&s.getValue("isImage")&&!s.getValue("cdnUrlModifiers")?.includes("/crop/")).map(s=>this.uploadCollection.read(s)).filter(Boolean);for(let s of r){let n=s.getValue("fileInfo");if(!n||!n.imageInfo){console.warn("Failed to get image info for entry",s.uid);continue}let{width:a,height:l}=n.imageInfo,c=typeof e?.width=="number"&&typeof e?.height=="number"&&e.width>0&&e.height>0?e.width/e.height:1,d=ma(a,l,c),u=rt(`crop/${d.width}x${d.height}/${d.x},${d.y}`,"preview"),h=s.getValue("cdnUrl");if(!h){console.warn("Failed to get cdnUrl for entry",s.uid);continue}s.setMultipleValues({cdnUrlModifiers:u,cdnUrl:W(h,u)});}}async getMetadataFor(t){let e=this.cfg.metadata||void 0;if(typeof e=="function"){let r=this.api.getOutputItem(t);return await e(r)}return e}async getUploadClientOptions(){let t=await this.secureUploadsManager.getSecureToken().catch(()=>null);return {store:this.cfg.store,publicKey:this.cfg.pubkey,baseCDN:this.cfg.cdnCname,baseURL:this.cfg.baseUrl,userAgent:va,integration:this.cfg.userAgentIntegration,secureSignature:t?.secureSignature,secureExpire:t?.secureExpire,retryThrottledRequestMaxTimes:this.cfg.retryThrottledRequestMaxTimes,retryNetworkErrorMaxTimes:this.cfg.retryNetworkErrorMaxTimes,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 $r(this.i)}};R.extSrcList=Object.freeze({...Ct});R.sourceTypes=Object.freeze({...N});var ne=class extends C{constructor(){super(...arguments);this.name="";this.Yi="";this.ii=null;this.Pn=null;}initCallback(){super.initCallback(),this.setAttribute("aria-hidden","true"),this.subConfigValue("iconHrefResolver",e=>{this.Pn=e,this.yo();});let t=this.i.pluginManager;t?.onPluginsChange&&(this.E=t.onPluginsChange(()=>this.yo()));}willUpdate(t){super.willUpdate(t),t.has("name")&&this.yo();}yo(){if(!this.name){this.Yi="",this.ii=null;return}let e=this.i.pluginManager?.snapshot().icons.find(n=>n.name===this.name);if(e){this.ii=e.svg,this.Yi="";return}this.ii=null;let r=`#uc-icon-${this.name}`,s=this.Pn?.(this.name);this.Yi=s??r;}render(){return this.ii?v`${this.yield("",v`${De(this.ii)}`)}`:v` ${this.yield("",v`<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><use href=${this.Yi}></use></svg>`)} `}disconnectedCallback(){this.E?.(),this.E=void 0,super.disconnectedCallback();}};p([y({type:String})],ne.prototype,"name",2),p([m()],ne.prototype,"Yi",2),p([m()],ne.prototype,"ii",2);var wa=o=>[...new Set(o)];var Te="--uc-img-",ns="unresolved";var as=!window.location.host.trim()||window.location.host.includes(":")||window.location.hostname.includes("localhost"),ls=3e3,cs=5e3,us=Object.freeze({PREVIEW:"PREVIEW",MAIN:"MAIN"});var Vu="https://ucarecdn.com",He=Object.freeze({"dev-mode":{},pubkey:{},uuid:{},src:{},lazy:{default:1},intersection:{},breakpoints:{},"cdn-cname":{default:Vu},"proxy-cname":{},"secure-delivery-proxy":{},"hi-res-support":{default:1},"ultra-res-support":{},format:{},"cdn-operations":{},progressive:{},quality:{},"is-background-for":{},"is-preview-blur":{default:1}});var _r=class extends Me(Ie(wt)){constructor(){super();this.Mt={};this.c=new Map;this.It=null;this.Xi=null;for(let t in He){let e=He[t];this.Mt[Te+t]=e?.default||"";}}createRenderRoot(){return this}$$(t){return this.Mt[Te+t]}set$$(t){for(let e in t){let r=Te+e,s=t[e];this.Mt[r]=s,this.q(r,s);}}sub$$(t,e){let r=Te+t;this.c.has(r)||this.c.set(r,new Set),this.c.get(r)?.add(e);let s=this.Mt[r];s!==null&&s!==""&&e(s);}q(t,e){this.c.has(t)&&this.c.get(t)?.forEach(r=>{e===null||e===""||r(e);});}analyticsParams(){return `-/@clib/${Pt}/${Ut}/uc-img/`}initAttributes(t){Array.from(this.attributes).forEach(e=>{let r=e;He[r.name]||t.setAttribute(r.name,r.value);});}initIntersection(t,e){let r={root:null,rootMargin:"0px"};this.It=new IntersectionObserver(s=>{s.forEach(n=>{n.isIntersecting&&(e(),this.It?.unobserve(t));});},r),this.It.observe(t),this.Xi||(this.Xi=new Set),this.Xi.add(t);}connectedCallback(){super.connectedCallback(),this.yu();}yu(){for(let t in He){let e=Te+t,r=this.getCssData(e,true);r!=null&&(this.Mt[e]=r);}}disconnectedCallback(){super.disconnectedCallback(),this.It&&(this.Xi?.forEach(t=>{this.It?.unobserve(t);}),this.It=null),this.c.clear();}static get observedAttributes(){return Object.keys(He)}attributeChangedCallback(t,e,r){window.setTimeout(()=>{let s=Te+t;this.Mt[s]=r,this.q(s,r);});}};var Ta=o=>Object.entries(o).filter(([i,t])=>t!==void 0&&t!=="").map(([i,t])=>i==="cdn-operations"||i==="analytics"?t:`${i}/${t}`);var Hr=class extends _r{constructor(){super(...arguments);this.be=new Image;this.de=new Image;}Ln(t){return !t.includes("//")&&!as&&(t=new URL(t,document.baseURI).href),t}Qi(t){if(!t)return;let e=t,r=e.match(/\d+/)?.[0],s=e.match(/[a-zA-Z]+/)?.[0];if(!r||!s)return;let n=parseInt(r,10);return Number(n)>cs&&this.Rn?cs+s:Number(n)>ls&&!this.Rn?ls+s:t}bu(t,e){let r={format:this.bo("format"),quality:this.bo("quality"),resize:this.Qi(t),blur:e,"cdn-operations":this.bo("cdn-operations")??void 0,analytics:this.analyticsParams()};return rt(...Ta(r))}bo(t){let e=this.$$(t);if(e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}re(t="",e=""){let r=this.$$("src");if(r.startsWith("data:")||r.startsWith("blob:"))return r;if(as&&r&&!r.includes("//"))return this.ri(r);let s=this.bu(t,e),n=this.$$("cdn-cname"),a=n;if(r.startsWith(String(n)))return W(r,s);let l=this.$$("uuid");if(a&&l)return this.ri(W(Qt(a,l),s));if(l)return this.ri(W(Qt(a,l),s));let c=this.$$("proxy-cname");if(c)return this.ri(W(c,s,this.Ln(r)));let d=this.$$("pubkey");if(d)return this.ri(W(`https://${d}.ucr.io/`,s,this.Ln(r)))}ri(t){let e=this.$$("secure-delivery-proxy");return e?$e(e,{previewUrl:t},{transform:r=>window.encodeURIComponent(r)}):t}Ot(t,e=1,r=true){let s=t.getBoundingClientRect(),n=e*Math.round(s.width),a=r?"":e*Math.round(s.height);return n||a?`${n||""}x${a||""}`:null}wu(t){let e=s=>{s.stopPropagation();let n=new Event(s.type,s);this.dispatchEvent(n);},r=["load","error"];for(let s of r)t.addEventListener(s,e);}get img(){return this.we||(this.wo({elNode:this.be}),this.appendChild(this.be)),this.be}get Ji(){return this.we?{type:us.PREVIEW,img:this.de}:{type:us.MAIN,img:this.img}}get we(){return this.$$("is-preview-blur")}get Un(){return this.$$("is-background-for")}get $n(){let t=this.$$("breakpoints");if(t){let e=Z(t);return wa(e.map(r=>parseInt(r,10)))}else return null}get Rn(){return this.$$("format").toLowerCase()==="jpeg"}Dn(t){let e=new Set;e.add(`url("${this.re(this.Ot(t))}") 1x`),this.$$("hi-res-support")&&e.add(`url("${this.re(this.Ot(t,2))}") ${2}x`),this.$$("ultra-res-support")&&e.add(`url("${this.re(this.Ot(t,3))}") ${3}x`);let r=`image-set(${[...e].join(", ")})`;t.style.setProperty("background-image",r),t.style.setProperty("background-image",`-webkit-${r}`);}Fn(){let t=new Set;return this.$n?this.$n.forEach(e=>{t.add(`${this.re(`${e}x`)} ${this.Qi(`${e}w`)}`),this.$$("hi-res-support")&&t.add(`${this.re(`${e*2}x`)} ${this.Qi(`${e*2}w`)}`),this.$$("ultra-res-support")&&t.add(`${this.re(`${e*3}x`)} ${this.Qi(`${e*3}w`)}`);}):(t.add(`${this.re(this.Ot(this.Ji.img))} 1x`),this.$$("hi-res-support")&&t.add(`${this.re(this.Ot(this.Ji.img,2))} 2x`),this.$$("ultra-res-support")&&t.add(`${this.re(this.Ot(this.Ji.img,3))} 3x`)),[...t].join()}Nn(){return this.re()}get Vn(){return this.re("100x","100")}Tu(){let t=this.Un;[...document.querySelectorAll(t)].forEach(e=>{this.$$("intersection")?this.initIntersection(e,()=>{this.Dn(e);}):this.Dn(e);});}xu({elNode:t,src:e,srcset:r}){e&&(t.src=e),r&&(t.srcset=r);}wo({elNode:t}){this.wu(t),this.initAttributes(t);}To({src:t,srcset:e,elNode:r}){return new Promise((s,n)=>{this.wo({elNode:r}),r.setAttribute(ns,""),r.addEventListener("load",()=>{r.removeAttribute(ns),s(r);}),r.addEventListener("error",()=>{n(false);}),this.xu({elNode:r,src:t,srcset:e});})}async Eu(){if(this.$$("intersection")){this.we&&(this.wo({elNode:this.de}),this.appendChild(this.de)),this.initIntersection(this.Ji.img,async()=>{this.we&&(this.de.src=this.Vn);try{await this.To({src:this.Nn(),srcset:this.Fn(),elNode:this.be}),this.we&&await this.de.remove(),this.appendChild(this.be);}catch{this.we&&await this.de?.remove(),this.appendChild(this.be);}});return}try{this.we&&(await this.To({src:this.Vn,elNode:this.de}),this.appendChild(this.de)),await this.To({src:this.Nn(),srcset:this.Fn(),elNode:this.be}),this.we&&await this.de?.remove(),this.appendChild(this.be);}catch{this.we&&await this.de?.remove(),this.appendChild(this.be);}}init(){this.Un?this.Tu():this.Eu();}};var ds=class extends Hr{connectedCallback(){super.connectedCallback(),this.sub$$("src",()=>{this.init();}),this.sub$$("uuid",()=>{this.init();}),this.sub$$("lazy",i=>{!this.$$("is-background-for")&&!this.$$("is-preview-blur")&&(this.img.loading=i?"lazy":"eager");});}};var{I:Nu}=en,Ea=o=>o;var xa=o=>o.strings===void 0,Ca=()=>document.createComment(""),Ke=(o,i,t)=>{let e=o.ge.parentNode,r=i===void 0?o.bt:i.ge;if(t===void 0){let s=e.insertBefore(Ca(),r),n=e.insertBefore(Ca(),r);t=new Nu(s,n,o,o.options);}else {let s=t.bt.nextSibling,n=t.f,a=n!==o;if(a){let l;t.Cu?.(o),t.f=o,t.Pi!==void 0&&(l=o.W)!==n.W&&t.Pi(l);}if(s!==r||a){let l=t.ge;for(;l!==s;){let c=Ea(l).nextSibling;Ea(e).insertBefore(l,r),l=c;}}}return t},ae=(o,i,t=o)=>(o.ce(i,t),o),_u={},Sa=(o,i=_u)=>o.r=i,Aa=o=>o.r,Kr=o=>{o.wt(),o.ge.remove();};var Ti=(o,i)=>{let t=o.le;if(t===void 0)return false;for(let e of t)e.Hs?.(i,false),Ti(e,i);return true},jr=o=>{let i,t;do{if((i=o.f)===void 0)break;t=i.le,t.delete(o),o=i;}while(t?.size===0)},ka=o=>{for(let i;i=o.f;o=i){let t=i.le;if(t===void 0)i.le=t=new Set;else if(t.has(o))break;t.add(o),Hu(i);}};function zu(o){this.le!==void 0?(jr(this),this.f=o,ka(this)):this.f=o;}function Bu(o,i=false,t=0){let e=this.r,r=this.le;if(r!==void 0&&r.size!==0)if(i)if(Array.isArray(e))for(let s=t;s<e.length;s++)Ti(e[s],false),jr(e[s]);else e!=null&&(Ti(e,false),jr(e));else Ti(this,o);}var Hu=o=>{o.type==Rt.CHILD&&(o.Pi??=Bu,o.Cu??=zu);},Gr=class extends Tt{constructor(){super(...arguments),this.le=void 0;}Gr(i,t,e){super.Gr(i,t,e),ka(this),this.isConnected=i.W;}Hs(i,t=true){i!==this.isConnected&&(this.isConnected=i,i?this.reconnected?.():this.disconnected?.()),t&&(Ti(this,i),jr(this));}setValue(i){if(xa(this.Gi))this.Gi.ce(i,this);else {let t=[...this.Gi.r];t[this.tu]=i,this.Gi.ce(t,this,0);}}disconnected(){}reconnected(){}};var S=()=>new hs,hs=class{},ps=new WeakMap,I=ft(class extends Gr{render(o){return U}update(o,[i]){let t=i!==this.G;return t&&this.G!==void 0&&this.rt(void 0),(t||this.lt!==this.ct)&&(this.G=i,this.ht=o.options?.host,this.rt(this.ct=o.element)),U}rt(o){if(this.isConnected||(o=void 0),typeof this.G=="function"){let i=this.ht??globalThis,t=ps.get(i);t===void 0&&(t=new WeakMap,ps.set(i,t)),t.get(this.G)!==void 0&&this.G.call(this.ht,void 0),t.set(this.G,o),o!==void 0&&this.G.call(this.ht,o);}else this.G.value=o;}get lt(){return typeof this.G=="function"?ps.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0);}reconnected(){this.rt(this.ct);}});var fs=null,Ei=class extends C{constructor(){super(...arguments);this.dialogEl=S();this.strokes=false;this.blockBodyScrolling=false;this.closeDialog=()=>{this.modalManager?.close(this.id),this.modalManager?.hasActiveModals||(document.body.style.overflow="",this.$["*currentActivity"]=null);};this.Su=()=>{this.closeDialog();};this.Au=t=>{this.xo=t.target;};this.ku=t=>{let e=t.target;e===this.dialogEl.value&&e===this.xo&&this.closeDialog();};this.oi=({id:t})=>{t===this.id?(fs=t,this.show(),this.emit(k.MODAL_OPEN,{modalId:t},{debounce:true})):this.hide();};this.si=({id:t})=>{t===this.id&&(this.hide(),this.emit(k.MODAL_CLOSE,{modalId:t,hasActiveModals:this.modalManager?.hasActiveModals},{debounce:true}));};this._n=t=>{this.hide(),fs===this.id&&this.emit(k.MODAL_CLOSE,{modalId:fs,hasActiveModals:this.modalManager?.hasActiveModals},{debounce:true});};}static{this.styleAttrs=[...super.styleAttrs,"uc-modal"];}async show(){await this.updateComplete;let t=this.dialogEl.value;typeof t.showModal=="function"?(this.setAttribute("aria-modal","true"),t.showModal()):t.setAttribute("open",""),this.cfg.modalScrollLock&&(document.body.style.overflow="hidden");}hide(){let t=this.dialogEl.value;t&&(typeof t.close=="function"?(this.setAttribute("aria-modal","false"),t.close()):t.removeAttribute("open"));}initCallback(){super.initCallback(),this.modalManager?.registerModal(this.id,this),this.subConfigValue("modalBackdropStrokes",t=>{t?this.setAttribute("strokes",""):this.removeAttribute("strokes");}),this.modalManager?.subscribe(Y.OPEN,this.oi),this.modalManager?.subscribe(Y.CLOSE,this.si),this.modalManager?.subscribe(Y.CLOSE_ALL,this._n);}disconnectedCallback(){super.disconnectedCallback(),document.body.style.overflow="",this.xo=void 0,this.modalManager?.unsubscribe(Y.OPEN,this.oi),this.modalManager?.unsubscribe(Y.CLOSE,this.si),this.modalManager?.unsubscribe(Y.CLOSE_ALL,this._n);}Mu(t){this.dialogEl={value:t},this.dialogEl.value?.addEventListener("close",this.Su),this.dialogEl.value?.addEventListener("mousedown",this.Au),this.dialogEl.value?.addEventListener("mouseup",this.ku);}render(){return v`<dialog ${I(this.Mu)}>${this.yield("")}</dialog>`}};p([y({type:Boolean,noAccessor:true})],Ei.prototype,"strokes",2),p([y({type:Boolean,attribute:"block-body-scrolling",noAccessor:true})],Ei.prototype,"blockBodyScrolling",2);var qr=class extends R{constructor(){super(...arguments);this.z=null;this.er=null;}get Bn(){return this.nameAttrValue??this.ctxName}zn(){let t=document.createElement("input");return t.type="text",t.name=this.Bn,t.required=this.cfg.multipleMin>0,t.tabIndex=-1,Rr(t,{opacity:0,height:0,width:0}),t}initCallback(){super.initCallback(),this.z=this.zn(),this.appendChild(this.z),this.sub("*collectionState",t=>{if(!t)return;if(!this.er){let n=document.createElement("div");this.appendChild(n),this.er=n;}if(!this.z){let n=this.zn();this.appendChild(n),this.z=n;}if(this.er.innerHTML="",t.status==="uploading"||t.status==="idle"){this.z.value="",this.z.setCustomValidity("");return}if(t.status==="failed"){let n=t.errors[0]?.message;this.z.value="",this.z.setCustomValidity(n??"");return}let e=t.group?t.group:null;if(e){this.z.value=e.cdnUrl??"",this.z.setCustomValidity("");return}let r=t.allEntries.map(n=>n.cdnUrl).filter(n=>typeof n=="string");if(!this.cfg.multiple&&r.length===1&&r[0]){this.z.value=r[0],this.z.setCustomValidity("");return}this.z.remove(),this.z=null;let s=new DocumentFragment;for(let n of r){let a=document.createElement("input");a.type="hidden",a.name=`${this.Bn}[]`,a.value=n,s.appendChild(a);}this.er.replaceChildren(s);},false);}};p([y({type:String,noAccessor:true,attribute:"name"})],qr.prototype,"nameAttrValue",2);var ms=class extends C{initCallback(){super.initCallback(),this.subConfigValue("removeCopyright",i=>{this.toggleAttribute("hidden",!!i);});}render(){return v`<a href="https://uploadcare.com/?utm_source=copyright&amp;utm_medium=referral&amp;utm_campaign=v4" target="_blank noopener" class="uc-credits" >Powered by Uploadcare</a >`}};var je=class extends C{constructor(){super(...arguments);this.hasFileName=false;this.value=0;this.visible=true;this.oe=0;this.tr=S();this.Hn=()=>{let t=this.tr.value;if(t){if(!this.visible){t.classList.add("uc-fake-progress--hidden");return}this.oe>0&&t.classList.add("uc-fake-progress--hidden");}};}firstUpdated(t){super.firstUpdated(t),this.oe=this.Eo(this.value),this.Co(),this.tr.value?.addEventListener("animationiteration",this.Hn);}updated(t){if(super.updated(t),t.has("value")){let e=this.Eo(this.value);if(!this.visible)this.oe=e;else {let r=Math.max(this.oe,e);r!==this.oe&&(this.oe=r,this.Co());}}t.has("visible")&&(this.classList.toggle("uc-progress-bar--hidden",!this.visible),this.visible?this.Co():this.oe=this.Eo(this.value));}disconnectedCallback(){super.disconnectedCallback(),this.tr.value?.removeEventListener("animationiteration",this.Hn);}Eo(t){return Number.isFinite(t)?Math.min(100,Math.max(0,t)):0}Co(){this.visible&&this.style.setProperty("--l-progress-value",this.oe.toString());}render(){return v`<div ${I(this.tr)} class="uc-fake-progress"></div><div class="uc-progress"></div>`}};p([y({type:Boolean,noAccessor:true})],je.prototype,"hasFileName",2),p([y({type:Number})],je.prototype,"value",2),p([y({type:Boolean,reflect:true})],je.prototype,"visible",2);var Ci=class extends R{constructor(){super();this.pe=false;this.Pt=0;this.init$={...this.init$,"*commonProgress":0};}initCallback(){super.initCallback(),this.So=this.uploadCollection.observeProperties(()=>{let t=this.uploadCollection.items().some(e=>this.uploadCollection.read(e)?.getValue("isUploading")??false);this.pe=t;}),this.sub("*commonProgress",t=>{this.Pt=t;});}updated(t){super.updated(t),t.has("visible")&&(this.pe?this.setAttribute("active",""):this.removeAttribute("active"));}disconnectedCallback(){super.disconnectedCallback(),this.So?.(),this.So=void 0;}render(){return v`<uc-progress-bar .value=${this.Pt} .visible=${this.pe}></uc-progress-bar>`}};p([m()],Ci.prototype,"pe",2),p([m()],Ci.prototype,"Pt",2);var Ge=class extends C{constructor(){super(...arguments);this.value="";this.disabled=false;this.options=[];this.Iu=t=>{if(this.disabled){t.preventDefault(),t.stopPropagation();return}t.preventDefault(),t.stopPropagation();let e=t.currentTarget;e&&(this.value=e.value,this.dispatchEvent(new Event("change")));};}render(){return v`<select @change=${this.Iu} .value=${this.value} ?disabled=${this.disabled}>${this.options.map(t=>v`<option value=${t.value}>${t.text}</option>`)}</select>`}};p([y({type:String,attribute:false})],Ge.prototype,"value",2),p([y({type:Boolean,reflect:true})],Ge.prototype,"disabled",2),p([y({type:Array,attribute:false})],Ge.prototype,"options",2);var qe=class extends R{constructor(){super(...arguments);this.couldBeCtxOwner=true;this.Ao="default";this.ko="";}willUpdate(t){super.willUpdate(t),t.has("source")&&this.Ou(this.source);}Ou(t){if(!t){this.ko="",this.Ao="default";return}let{label:e,icon:r,id:s}=t;this.ko=e,this.Ao=r??s??"default";}activate(){this.source&&this.source.onClick();}render(){return v`<button type="button" @click=${this.activate}><uc-icon name=${this.Ao}></uc-icon><div class="uc-txt">${this.l10n(this.ko)}</div></button>`}};p([y({attribute:false})],qe.prototype,"source",2),p([m()],qe.prototype,"Ao",2),p([m()],qe.prototype,"ko",2);var xi=class extends R{constructor(){super(...arguments);this.Kn=[];this.je=[];this.wrap=false;}initCallback(){super.initCallback(),this.subConfigValue("sourceList",e=>{this.Kn=Z(e),this.jn();});let t=this.i.pluginManager;t?.onPluginsChange&&(this.E=t.onPluginsChange(()=>this.jn()));}updated(t){super.updated(t),this.cfg.sourceListWrap?this.style.removeProperty("display"):this.style.display="contents";}jn(){let e=this.i.pluginManager?.snapshot().sources??[],r=new Map(e.map(n=>[n.id,n])),s=[];this.Kn.forEach(n=>{let a=this.Pu(n,r);if(a.length!==1||a[0]!==n){for(let d of a){let u=r.get(d);u&&s.push(this.Gn(u));}return}let c=r.get(n);c&&s.push(this.Gn(c));}),this.je=s;}Pu(t,e){let r=e.get(t);return r?.expand?r.expand():[t]}Gn(t){return {id:t.id,label:t.label,icon:t.icon,onClick:()=>t.onSelect()}}render(){return v`${this.je.map(t=>v`<uc-source-btn role="listitem" .source=${t} data-source-id=${t.id}></uc-source-btn>`)}`}disconnectedCallback(){this.E?.(),this.E=void 0,super.disconnectedCallback();}};p([m()],xi.prototype,"je",2),p([y({type:Boolean,attribute:"wrap",noAccessor:true})],xi.prototype,"wrap",2);var gs=class extends C{render(){return v`<div class="uc-spinner"></div>`}};var It="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=";function Ee(o){let i=new Image;return {promise:new Promise((r,s)=>{i.src=o,i.onload=()=>r(),i.onerror=n=>s(n);}),image:i,cancel:()=>{i.naturalWidth===0&&(i.src=It);}}}function Si(o){let i=[];for(let s of o){let n=Ee(s);i.push(n);}let t=i.map(s=>s.image);return {promise:Promise.allSettled(i.map(s=>s.promise)),images:t,cancel:()=>{i.forEach(s=>{s.cancel();});}}}function vs(o,i=40){if(o.type==="image/svg+xml")return URL.createObjectURL(o);let t=document.createElement("canvas"),e=t.getContext("2d");if(!e)return Promise.reject(new Error("Canvas context not supported"));let r=new Image,s=new Promise((n,a)=>{r.onload=()=>{let l=r.height/r.width;l>1?(t.width=i,t.height=i*l):(t.height=i,t.width=i/l),e.fillStyle="rgb(240, 240, 240)",e.fillRect(0,0,t.width,t.height),e.drawImage(r,0,0,t.width,t.height),t.toBlob(c=>{if(!c){a();return}let d=URL.createObjectURL(c);n(d);});},r.onerror=l=>{a(l);};});return r.src=URL.createObjectURL(o),s}var We=class extends R{constructor(){super(...arguments);this.ir=new Set;this.entry=null;}withEntry(t){return (...e)=>{let r=this.entry;if(!r){console.warn("No entry found");return}return t(r,...e)}}subEntry(t,e){this.withEntry((r,s,n)=>{let a=r.subscribe(s,l=>{this.isConnected&&n(l);});this.ir.add(a);})(t,e);}reset(){for(let t of this.ir)t();this.ir=new Set,this.entry=null;}disconnectedCallback(){super.disconnectedCallback(),this.ir=new Set;}};function Ku(o){let i=new Blob([o],{type:"image/svg+xml"});return URL.createObjectURL(i)}function Wr(o="hsl(209, 21%, 65%)",i=32,t=32){return Ku(`<svg width="${i}" height="${t}" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" fill="${o}" 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>`)}var ju=3e3,Ze=class extends We{constructor(){super(...arguments);this.badgeIcon="";this.uid="";this.Pe="";this.qn=false;this.rr=null;this.Wn=false;this.Lu=this.cfg.filesViewMode;this.Zn=this.withEntry(async(t,e=false)=>{let r=t.getValue("fileInfo"),s=t.getValue("isImage"),n=t.getValue("uuid"),a=t.getValue("thumbUrl"),l=this.Ru(e);if(r&&s&&n){let d=await this.proxyUrl(W(Qt(this.cfg.cdnCname,n),rt(t.getValue("cdnUrlModifiers"),"stretch/off",`scale_crop/${l}x${l}/center`)));if(a===d)return;let{promise:u}=Ee(d);u.then(()=>{t.setValue("thumbUrl",d),a?.startsWith("blob:")&&URL.revokeObjectURL(a);}).catch(async()=>{if(!a?.startsWith("blob:"))try{let h=t.getValue("file");if(!h)return;let f=await vs(h,l);t.setValue("thumbUrl",f);}catch(h){this.telemetryManager.sendEventError(h,"thumbnail generation. Failed to generate thumb from file");let f=window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");t.setValue("thumbUrl",Wr(f));}});return}if(t.getValue("thumbUrl"))return;let c=t.getValue("file");if(c?.type.includes("image"))try{let d=await vs(c,l);t.setValue("thumbUrl",d);}catch(d){this.telemetryManager.sendEventError(d,"thumbnail generation. Failed to generate thumb from file");let u=window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");t.setValue("thumbUrl",Wr(u));}else {let d=window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground");t.setValue("thumbUrl",Wr(d));}});this.or=$(this.Zn.bind(this),100);}Ru(t=false){t&&(this.rr=this.getBoundingClientRect());let e=Math.max(parseInt(String(this?.rr?.height||0),10),parseInt(String(this?.rr?.width||0),10),this.cfg.thumbSize);return window.devicePixelRatio>1&&(e*=window.devicePixelRatio),Math.min(e,ju)}Uu(t,e){return new Promise((r,s)=>{let n=new Image;n.decoding="async";let a=()=>{n&&(n.onload=null,n.onerror=null,n.src=It,e?.removeEventListener("abort",l),n=null);},l=()=>{a(),s(new DOMException("Aborted","AbortError"));};if(e){if(e.aborted){l();return}e.addEventListener("abort",l,{once:true});}let c=()=>{a(),r();},d=u=>{a(),s(u);};if(typeof n.decode=="function"){n.src=t,n.decode().then(c).catch(d);return}n.onload=c,n.onerror=d,n.src=t;})}Io(){this.Mo?.cancel(),this.Mo=void 0;}$u(t){if(this.Io(),!t){this.Pe&&(this.Pe="");return}if(t===this.Pe)return;let e=new AbortController,r={controller:e,cancel:()=>{e.abort(),r.rafId!==void 0&&window.cancelAnimationFrame(r.rafId);}};this.Mo=r,this.Uu(t,e.signal).then(()=>{e.signal.aborted||(r.rafId=window.requestAnimationFrame(()=>{e.signal.aborted||(this.Pe=t);}));}).catch(s=>{e.signal.aborted||s instanceof DOMException&&s.name==="AbortError"||console.warn("[Thumb] Failed to decode thumbnail image",s);});}sr(t=false){if(this.entry){if(t){this.Zn(true);return}this.Wn&&this.or();}}firstUpdated(t){super.firstUpdated(t),this.Yn();}updated(t){super.updated(t),t.has("uid")&&this.Yn();}ni(t){let[e]=t;e&&(this.Wn=e.isIntersecting,e.isIntersecting&&(this.rr=e.boundingClientRect,this.sr(),this.s?.disconnect()),e.intersectionRatio===0&&this.or.cancel());}reset(){super.reset(),this.or.cancel(),this.Io(),this.Pe&&(this.Pe="");}Yn(){let t=this.uid?.trim();if(!t){this.entry&&this.reset();return}let e=this.uploadCollection?.read(t);if(!e||e===this.entry)return;this.reset(),this.entry=e;let r=()=>{this.sr();};this.subEntry("fileInfo",s=>{s?.isImage&&r();}),this.subEntry("thumbUrl",s=>{this.$u(s??void 0);}),this.subEntry("cdnUrlModifiers",r),this.sr(true);}initCallback(){super.initCallback(),this.subConfigValue("filesViewMode",t=>{t==="grid"&&!this.qn&&(this.Lu==="list"&&this.sr(true),this.qn=true);});}connectedCallback(){super.connectedCallback(),this.s?.disconnect(),this.s=new window.IntersectionObserver(this.ni.bind(this),{threshold:.1}),this.s.observe(this);}disconnectedCallback(){super.disconnectedCallback(),this.or.cancel(),this.Io(),this.s?.disconnect();}render(){return v`<div class="uc-thumb"><img class="uc-thumb__img" src=${this.Pe||It} role="img" alt="Preview of uploaded image" ?hidden=${!this.Pe} draggable="false" /><div class="uc-badge"><uc-icon name=${this.badgeIcon}></uc-icon></div></div>`}};p([y({type:String})],Ze.prototype,"badgeIcon",2),p([y({attribute:false})],Ze.prototype,"uid",2),p([m()],Ze.prototype,"Pe",2);var ys=class extends x{};var bs=class extends x{constructor(){super(...arguments);this.historyTracked=true;this.activityType=x.activities.START_FROM;}initCallback(){super.initCallback(),this.registerActivity(this.activityType??"");}render(){return v`<div class="uc-content">${this.yield("")}</div>`}};var ws=class extends R{constructor(){super(...arguments);this.Xn=null;}static{this.styleAttrs=["uc-wgt-common"];}static{this.EventType=k;}initCallback(){super.initCallback(),this.Xn=this.eventEmitter.bindTarget(this);}disconnectedCallback(){super.disconnectedCallback(),this.Xn?.();}};var Ye=(o,i)=>{let t=false,e,r=0,s=((...n)=>{t?(e&&clearTimeout(e),e=setTimeout(()=>{Date.now()-r>=i&&(o(...n),r=Date.now());},Math.max(i-(Date.now()-r),0))):(o(...n),r=Date.now(),t=true);});return Object.defineProperty(s,"cancel",{configurable:false,writable:false,enumerable:false,value:()=>{e&&clearTimeout(e);}}),s};var Ma=(o,i,t)=>{let e=new Map;for(let r=i;r<=t;r++)e.set(o[r],r);return e},Ai=ft(class extends Tt{constructor(o){if(super(o),o.type!==Rt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(o,i,t){let e;t===void 0?t=i:i!==void 0&&(e=i);let r=[],s=[],n=0;for(let a of o)r[n]=e?e(a,n):n,s[n]=t(a,n),n++;return {values:s,keys:r}}render(o,i,t){return this.dt(o,i,t).values}update(o,[i,t,e]){let r=Aa(o),{values:s,keys:n}=this.dt(i,t,e);if(!Array.isArray(r))return this.ut=n,s;let a=this.ut??=[],l=[],c,d,u=0,h=r.length-1,f=0,g=s.length-1;for(;u<=h&&f<=g;)if(r[u]===null)u++;else if(r[h]===null)h--;else if(a[u]===n[f])l[f]=ae(r[u],s[f]),u++,f++;else if(a[h]===n[g])l[g]=ae(r[h],s[g]),h--,g--;else if(a[u]===n[g])l[g]=ae(r[u],s[g]),Ke(o,l[g+1],r[u]),u++,g--;else if(a[h]===n[f])l[f]=ae(r[h],s[f]),Ke(o,r[u],r[h]),h--,f++;else if(c===void 0&&(c=Ma(n,f,g),d=Ma(a,u,h)),c.has(a[u]))if(c.has(a[h])){let b=d.get(n[f]),w=b!==void 0?r[b]:null;if(w===null){let E=Ke(o,r[u]);ae(E,s[f]),l[f]=E;}else l[f]=ae(w,s[f]),Ke(o,r[u],w),r[b]=null;f++;}else Kr(r[h]),h--;else Kr(r[u]),u++;for(;f<=g;){let b=Ke(o,l[g+1]);ae(b,s[f]),l[f++]=b;}for(;u<=h;){let b=r[u++];b!==null&&Kr(b);}return this.ut=n,Sa(o,l),it}});var X=Object.freeze({FINISHED:Symbol("FINISHED"),FAILED:Symbol("FAILED"),UPLOADING:Symbol("UPLOADING"),VALIDATION:Symbol("VALIDATION"),QUEUED_UPLOADING:Symbol("QUEUED-UPLOADING"),QUEUED_VALIDATION:Symbol("QUEUED-VALIDATION"),IDLE:Symbol("IDLE")}),G=class G extends We{constructor(){super(...arguments);this.couldBeCtxOwner=true;this.Qn=true;this.uid="";this.Oo="";this.Po="";this.Lo="";this.oe=0;this.Jn=false;this.Ro="";this.ea=false;this.ta=false;this.ia=false;this.ra=false;this.nr=false;this.oa="";this.ar=[];this.sa=false;this.Du=()=>{this.telemetryManager.sendEvent({payload:{metadata:{event:"remove-file",node:this.tagName}}}),this.uid&&this.uploadCollection.hasItem(this.uid)&&this.uploadCollection.remove(this.uid);};this.Fu=()=>{this.na();};this.S=$(()=>this.aa(),100);this.Vu=this.withEntry(Ye((t,e)=>{let r=t.getValue("errors")?.[0]?.message??"",s=t.getValue("source"),n=t.getValue("externalUrl"),a=e===X.FINISHED,l=e===X.UPLOADING,c=e===X.QUEUED_UPLOADING,d=e===X.QUEUED_VALIDATION,u=e===X.VALIDATION,h=t.getValue("fileName"),f="";r?f="":!a&&n&&s&&Object.values(Ct).includes(s)&&(f=this.l10n("waiting-for",{source:this.l10n(`src-type-${s}`)})),this.Lo=f,this.Po=r,this.Jn=l||c||d||u,this.oe=d||u?0:t.getValue("uploadProgress"),this.oa=h?this.l10n("a11y-file-item-status",{fileName:h,status:this.l10n(e?.description?.toLocaleLowerCase()??"").toLocaleLowerCase()}):"";},100));this.na=this.withEntry(async t=>{if(!this.uploadCollection.read(t.uid)||t.getValue("fileInfo")||t.getValue("isUploading")||t.getValue("errors").length>0||t.getValue("isValidationPending"))return;let e=this.cfg.multiple?this.cfg.multipleMax:1;if(!(e&&this.uploadCollection.size>e)){t.setMultipleValues({isUploading:true,errors:[],isQueuedForUploading:true}),this.S();try{let r=new AbortController;t.setValue("abortController",r);let s=async()=>{t.setValue("isQueuedForUploading",!1);let a=t.getValue("file");if(a instanceof File||a instanceof Blob){let h=(this.i.pluginManager?.snapshot().fileHooks??[]).filter(f=>f.type==="beforeUpload");for(let f of h)try{let{file:g}=await f.handler({file:a});g!==a&&(a=g,t.setValue("mimeType",a.type||null),t.setValue("isImage",Re(a)),t.setValue("fileSize",a.size),a instanceof File&&t.setValue("fileName",a.name));}catch(g){this.debugPrint(`File hook "beforeUpload" from plugin "${f.pluginId}" failed`,g);}}let l=a||t.getValue("externalUrl")||t.getValue("uuid");if(!l)throw new Error("No file input");let d={...await this.getUploadClientOptions(),fileName:t.getValue("fileName")??void 0,source:t.getValue("source")??void 0,onProgress:u=>{if(u.isComputable){let h=u.value*100;t.setValue("uploadProgress",h);}},signal:r.signal,metadata:await this.getMetadataFor(t.uid)};return this.debugPrint("upload options",l,d),_o(l,d)},n=await this.$["*uploadQueue"].add(s);t.setMultipleValues({fileInfo:n,isQueuedForUploading:!1,isUploading:!1,fileName:n.originalFilename,fileSize:n.size,isImage:n.isImage??!1,mimeType:n.contentInfo?.mime?.mime??n.mimeType,uuid:n.uuid,cdnUrl:t.getValue("cdnUrl")??n.cdnUrl,cdnUrlModifiers:t.getValue("cdnUrlModifiers")??"",uploadProgress:100,source:t.getValue("source")??null}),t===this.entry&&this.S();}catch(r){let s=r instanceof te&&r.isCancel;s?t.setMultipleValues({isUploading:false,uploadProgress:0}):r instanceof ge?t.setMultipleValues({isUploading:false,uploadProgress:0,uploadError:r}):(console.error("Unknown upload error",r),t.setMultipleValues({isUploading:false,uploadProgress:0,uploadError:new Error("Something went wrong",{cause:r})})),t===this.entry&&this.S(),this.isConnected&&!s&&this.telemetryManager.sendEventError(r,"file upload. Failed to upload file");}}});}aa(){let t=this.entry;if(!t)return;let e=X.IDLE;t.getValue("errors").length>0?e=X.FAILED:t.getValue("isQueuedForUploading")?e=X.QUEUED_UPLOADING:t.getValue("isQueuedForValidation")?e=X.QUEUED_VALIDATION:t.getValue("isValidationPending")?e=X.VALIDATION:t.getValue("isUploading")?e=X.UPLOADING:t.getValue("fileInfo")&&(e=X.FINISHED),this.Nu(t,e);}Nu(t,e){e===X.FAILED?this.Ro="badge-error":e===X.FINISHED&&(this.Ro="badge-success"),e===X.UPLOADING&&(this.ra=false,this.removeAttribute("focused")),this.ta=e===X.FAILED,this.ia=e===X.UPLOADING,this.ea=e===X.FINISHED,this.Vu(e);}reset(){super.reset(),this.S.cancel();}ni(t){let[e]=t;e&&e.isIntersecting&&!this.sa&&(this.Qn=false,this.sa=true);}la(t){this.reset();let e=this.uploadCollection?.read(t);if(this.entry=e,!e){this.Ye();return}this.subEntry("isQueuedForValidation",()=>{this.S();}),this.subEntry("isValidationPending",()=>{this.S();}),this.subEntry("uploadProgress",()=>{this.S();}),this.subEntry("isQueuedForUploading",()=>{this.S();}),this.subEntry("fileName",r=>{this.Oo=r||e.getValue("externalUrl")||this.l10n("file-no-name"),this.S();}),this.subEntry("externalUrl",r=>{this.Oo=e.getValue("fileName")||r||this.l10n("file-no-name");}),this.subEntry("fileInfo",()=>{this.S();}),this.subEntry("errors",()=>this.S()),this.subEntry("isUploading",()=>this.S()),this.subEntry("fileSize",()=>this.S()),this.subEntry("mimeType",()=>this.S()),this.subEntry("isImage",()=>this.S()),this.subEntry("fileInfo",()=>this.Ye()),this.subEntry("isUploading",()=>this.Ye()),this.subEntry("errors",()=>this.Ye()),this.aa(),this.Ye();}ca(t){if(this.cfg.filesViewMode==="list"){this.nr=true;return}this.nr=t;}willUpdate(t){super.willUpdate(t),t.has("uid")&&this.la(this.uid);}Ye(){let t=this.i.pluginManager;if(!t||!this.uid){this.ar=[];return}let e=t.snapshot().fileActions,r=this.api.getOutputItem(this.uid);if(!r){this.ar=[];return}this.ar=e.filter(s=>{try{return s.shouldRender(r)}catch(n){return console.error(`Error in plugin file action shouldRender (${s.id}):`,n),false}});}_u(t){if(!this.uid)return;let e=this.api.getOutputItem(this.uid);if(e)try{t.onClick(e);}catch(r){console.error(`Error in plugin file action onClick (${t.id}):`,r);}}initCallback(){super.initCallback(),this.la(this.uid),this.subConfigValue("filesViewMode",e=>{this.ca(this.cfg.gridShowFileNames),this.setAttribute("mode",e);}),this.subConfigValue("gridShowFileNames",e=>{this.ca(e);}),this.onclick=()=>{G.activeInstances.forEach(e=>{e===this?e.setAttribute("focused",""):e.removeAttribute("focused");});},this.sub("*uploadTrigger",e=>{this.entry&&!e.has(this.entry.uid)||setTimeout(()=>this.isConnected&&this.na());});let t=this.i.pluginManager;t?.onPluginsChange&&(this.E=t.onPluginsChange(()=>this.Ye())),this.Ye(),G.activeInstances.add(this);}connectedCallback(){super.connectedCallback(),this.s=new window.IntersectionObserver(this.ni.bind(this),{threshold:[0,1]}),this.s.observe(this);}disconnectedCallback(){this.E?.(),this.E=void 0,super.disconnectedCallback(),this.s?.disconnect(),G.activeInstances.delete(this),this.reset();}static{this.activeInstances=new Set;}shouldUpdate(t){return this.Qn?false:super.shouldUpdate(t)}render(){return v`<div class="uc-inner" ?data-finished=${this.ea} ?data-uploading=${this.ia} ?data-failed=${this.ta} ?data-focused=${this.ra} ><uc-thumb .uid=${this.uid} .badgeIcon=${this.Ro}></uc-thumb><div aria-atomic="true" aria-live="polite" class="uc-file-name-wrapper" aria-label=${this.oa}><span class="uc-file-name" ?hidden=${!this.nr}>${this.Oo}</span><span class="uc-file-error" ?hidden=${!this.Po}>${this.Po}</span><span class="uc-file-hint" ?hidden=${!this.Lo}>${this.Lo}</span></div><div class="uc-file-actions">${this.ar.map(t=>v`<button type="button" @click=${()=>this._u(t)} title=${this.l10n(t.label)} aria-label=${this.l10n(t.label)} class="uc-plugin-action-btn uc-mini-btn" data-plugin-action-id=${t.id} ><uc-icon name=${t.icon}></uc-icon></button>`)}<button type="button" @click=${this.Du} title=${this.l10n("file-item-remove-button")} aria-label=${this.l10n("file-item-remove-button")} class="uc-remove-btn uc-mini-btn" ><uc-icon name="remove-file"></uc-icon></button><button type="button" class="uc-upload-btn uc-mini-btn" @click=${this.Fu}><uc-icon name="upload"></uc-icon></button></div><uc-progress-bar class="uc-progress-bar" .value=${this.oe} .visible=${this.Jn} ?hasFileName=${this.nr}></uc-progress-bar></div>`}};p([m()],G.prototype,"Qn",2),p([y({attribute:false})],G.prototype,"uid",2),p([m()],G.prototype,"Oo",2),p([m()],G.prototype,"Po",2),p([m()],G.prototype,"Lo",2),p([m()],G.prototype,"oe",2),p([m()],G.prototype,"Jn",2),p([m()],G.prototype,"Ro",2),p([m()],G.prototype,"ea",2),p([m()],G.prototype,"ta",2),p([m()],G.prototype,"ia",2),p([m()],G.prototype,"ra",2),p([m()],G.prototype,"nr",2),p([m()],G.prototype,"oa",2),p([m()],G.prototype,"ar",2);var Ts=G;function Gu(o){return new Promise(i=>{typeof window.FileReader!="function"&&i(false);try{let t=new FileReader;t.onerror=()=>{i(!0);};let e=r=>{r.type!=="loadend"&&t.abort(),i(!1);};t.onloadend=e,t.onprogress=e,t.readAsDataURL(o);}catch{i(false);}})}function qu(o,i){return new Promise(t=>{let e=0,r=[],s=a=>{if(!a){console.warn("Unexpectedly received empty content entry",{scope:"drag-and-drop"}),t(null);return}a.isFile?(e++,a.file(l=>{e--;let c=new File([l],l.name,{type:l.type||i});r.push({type:"file",file:c,fullPath:a.fullPath}),e===0&&t(r);})):a.isDirectory&&n(a.createReader());},n=a=>{e++,a.readEntries(l=>{e--;for(let c of l)s(c);e===0&&t(r);});};s(o);})}function Ia(o){let i=[],t=[];for(let e=0;e<o.items.length;e++){let r=o.items[e];if(r)if(r.kind==="file"){let s=r.type,n=r;if(typeof n.webkitGetAsEntry=="function"||typeof n.getAsEntry=="function"){let l=typeof n.webkitGetAsEntry=="function"?n.webkitGetAsEntry():n.getAsEntry?.();l&&t.push(qu(l,s).then(c=>{c&&i.push(...c);}));continue}let a=r.getAsFile();a&&t.push(Gu(a).then(l=>{l||i.push({type:"file",file:a});}));}else r.kind==="string"&&/^text\/uri-list/.test(r.type)&&t.push(new Promise(s=>{r.getAsString(n=>{i.push({type:"url",url:n}),s();});}));}return Promise.all(t).then(()=>i)}var nt=Object.freeze({ACTIVE:0,INACTIVE:1,NEAR:2,OVER:3}),Oa=["focus"],Wu=100,Es=new Map;function Zu(o,i){let t=Math.max(Math.min(o[0],i.x+i.width),i.x),e=Math.max(Math.min(o[1],i.y+i.height),i.y);return Math.sqrt((o[0]-t)*(o[0]-t)+(o[1]-e)*(o[1]-e))}function Cs(o){let i=0,t=document.body,e=new Set,r=g=>{e.add(g);},s=nt.INACTIVE,n=g=>{o.shouldIgnore()&&g!==nt.INACTIVE||(s!==g&&e.forEach(b=>{b(g);}),s=g);},a=()=>i>0;r(g=>o.onChange(g));let l=()=>{i=0,n(nt.INACTIVE);},c=()=>{i+=1,s===nt.INACTIVE&&n(nt.ACTIVE);},d=()=>{i-=1,a()||n(nt.INACTIVE);},u=g=>{g.preventDefault(),i=0,n(nt.INACTIVE);},h=g=>{if(o.shouldIgnore())return;a()||(i+=1);let b=[g.x,g.y],w=o.element.getBoundingClientRect(),E=Math.floor(Zu(b,w)),T=E<Wu,A=g.composedPath().includes(o.element);Es.set(o.element,E);let bt=Math.min(...Es.values())===E;A&&bt?(g.preventDefault(),n(nt.OVER)):n(T&&bt?nt.NEAR:nt.ACTIVE);},f=async g=>{if(o.shouldIgnore())return;g.preventDefault();let{dataTransfer:b}=g;if(!b)return;let w=await Ia(b);o.onItems(w),n(nt.INACTIVE);};return t.addEventListener("drop",u),t.addEventListener("dragleave",d),t.addEventListener("dragenter",c),t.addEventListener("dragover",h),o.element.addEventListener("drop",f),Oa.forEach(g=>{window.addEventListener(g,l);}),()=>{Es.delete(o.element),t.removeEventListener("drop",u),t.removeEventListener("dragleave",d),t.removeEventListener("dragenter",c),t.removeEventListener("dragover",h),o.element.removeEventListener("drop",f),Oa.forEach(g=>{window.removeEventListener(g,l);});}}var xs=new Set,gt=class extends R{constructor(){super(...arguments);this.single=false;this.ghost=false;this.disabled=false;this.clickable=false;this.withIcon=false;this.fullscreen=false;this.initflow=false;this.Me=true;this.ua=true;this.da=null;this.Uo=null;this.pa=S();this.Lt=t=>{if(t instanceof KeyboardEvent){if(t.code!=="Space"&&t.code!=="Enter")return}else if(!(t instanceof MouseEvent))return;if(this.initflow){this.api.initFlow();return}this.api.openSystemDialog();};this.ha=true;this.Rt=false;}static{this.styleAttrs=[...super.styleAttrs,"uc-drop-area"];}get Bu(){let t=this.text;return typeof t=="string"&&t.length>0?this.l10n(t)||t:this.l10n("drop-files-here")}isActive(){if(!this.Me)return false;let t=this.getBoundingClientRect(),e=t.width>0&&t.height>0,r=t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth),s=window.getComputedStyle(this),n=s.visibility!=="hidden"&&s.display!=="none";return e&&n&&r}initCallback(){super.initCallback(),xs.add(this),this.$o(),this.Do(),this.fa(),this.ma(nt.INACTIVE),this.da=Cs({element:this,shouldIgnore:()=>this.ga(),onChange:t=>{this.ma(t);},onItems:t=>{t.length&&(t.forEach(e=>{e.type==="url"?this.api.addFileFromUrl(e.url,{source:N.DROP_AREA}):e.type==="file"&&this.api.addFileFromObject(e.file,{source:N.DROP_AREA,fullPath:e.fullPath});}),this.uploadCollection.size&&(this.set$({"*currentActivity":x.activities.UPLOAD_LIST}),this.modalManager?.open(x.activities.UPLOAD_LIST)));}}),this.updateComplete.then(()=>this.zu()),this.subConfigValue("sourceList",t=>{let e=Z(t);this.ha=e.includes(N.LOCAL),this.$o(),this.Do();});}willUpdate(t){super.willUpdate(t),t.has("disabled")&&(this.$o(),this.Do());}updated(t){super.updated(t),t.has("clickable")&&this.fa();}ga(){if(!this.Me||!this.Hu())return true;if(!this.fullscreen)return false;let t=xs;return t.size===0?false:[...t].filter(s=>s!==this).filter(s=>s.isActive()).length>0}Hu(){let t=this.cfg.multiple,e=this.cfg.multipleMax,r=this.uploadCollection.size;return !(t&&e&&r>=e||!t&&r>0)}$o(){let t=this.ha&&!this.disabled;this.Me=t;}Do(){let t=this.Me||!this.querySelector("[data-default-slot]");this.ua=t,this.hidden=!t;}ma(t){let e=Object.entries(nt).find(([,r])=>r===t)?.[0].toLowerCase();e&&this.setAttribute("drag-state",e);}zu(){if(this.Uo)return;let t=this.pa.value;t&&(this.Uo=Cs({element:t,onChange:e=>{let r=Object.entries(nt).find(([,s])=>s===e)?.[0].toLowerCase();r&&t.setAttribute("drag-state",r);},onItems:()=>{},shouldIgnore:()=>this.ga()}));}fa(){this.clickable&&!this.Rt?(this.addEventListener("keydown",this.Lt),this.addEventListener("click",this.Lt),this.Rt=true):!this.clickable&&this.Rt&&(this.removeEventListener("keydown",this.Lt),this.removeEventListener("click",this.Lt),this.Rt=false);}disconnectedCallback(){super.disconnectedCallback(),xs.delete(this),this.da?.(),this.Uo?.(),this.Rt&&(this.removeEventListener("keydown",this.Lt),this.removeEventListener("click",this.Lt),this.Rt=false);}render(){return v` ${this.yield("",v`<div data-default-slot hidden></div><div ${I(this.pa)} class="uc-content-wrapper" ?hidden=${!this.ua}><div class="uc-icon-container" ?hidden=${!this.withIcon}><uc-icon name="default"></uc-icon><uc-icon name="arrow-down"></uc-icon></div><span class="uc-text">${this.Bu}</span></div>`)} `}};p([y({type:Boolean,noAccessor:true})],gt.prototype,"single",2),p([y({type:Boolean,noAccessor:true})],gt.prototype,"ghost",2),p([y({type:Boolean,reflect:true})],gt.prototype,"disabled",2),p([y({type:Boolean,reflect:true})],gt.prototype,"clickable",2),p([y({type:Boolean,attribute:"with-icon",reflect:true})],gt.prototype,"withIcon",2),p([y({type:Boolean,reflect:true})],gt.prototype,"fullscreen",2),p([y({type:Boolean,reflect:true})],gt.prototype,"initflow",2),p([y({type:String})],gt.prototype,"text",2),p([m()],gt.prototype,"Me",2),p([m()],gt.prototype,"ua",2);var Ot=class extends R{constructor(){super(...arguments);this.couldBeCtxOwner=true;this.historyTracked=true;this.activityType=x.activities.UPLOAD_LIST;this.va=false;this.ya=false;this.ba=false;this.Fo=false;this.No=false;this.lr=null;this.wa=false;this.Vo=null;this.Ta=()=>{this.telemetryManager.sendEvent({eventType:D.ACTION_EVENT,payload:{metadata:{event:"add-more",node:this.tagName}}}),this.api.initFlow(true);};this._o=()=>{this.emit(k.UPLOAD_CLICK),this.api.uploadAll(),this.Te();};this.Bo=()=>{this.emit(k.DONE_CLICK,this.api.getOutputCollectionState()),this.api.doneFlow();};this.xe=()=>{this.telemetryManager.sendEvent({eventType:D.ACTION_EVENT,payload:{metadata:{event:"clear-all",node:this.tagName}}}),this.uploadCollection.clearAll();};this.Te=Ye(()=>{this.isConnected&&(this.Gu(),!this.couldOpenActivity&&this.$["*currentActivity"]===this.activityType&&this.historyBack(),this.cfg.confirmUpload||this.api.uploadAll());},300);}get Ku(){return this.Vo?this.ju(this.Vo):""}Gu(){let t=this.api.getOutputCollectionState(),e={total:t.totalCount,succeed:t.successCount,uploading:t.uploadingCount,failed:t.failedCount,validatingBeforeUploading:t.idleEntries.filter(f=>f.isValidationPending).length},r=!t.errors.some(f=>f.type==="TOO_MANY_FILES"||f.type==="TOO_FEW_FILES"),s=t.errors.some(f=>f.type==="TOO_MANY_FILES"),n=t.totalCount===(this.cfg.multiple?this.cfg.multipleMax:1),a=t.allEntries.some(f=>f.isValidationPending),l=e.failed===0&&t.errors.length===0&&!a,c=false,d=false,u=false;if(e.total-e.succeed-e.uploading-e.failed>0&&r&&l&&this.cfg.confirmUpload)c=true;else {d=true;let f=this.cfg.groupOutput?!!t.group:true;u=e.total===e.succeed&&r&&l&&f;}this.va=d,this.ya=u,this.ba=c,this.No=e.total===0||!s&&!n,this.Fo=!n||this.cfg.multiple,this.wa=e.total>0,this.Vo=e;}ju(t){let e=r=>{let s=t[r];return r==="uploading"&&(s+=t.validatingBeforeUploading),this.l10n(`header-${r}`,{count:s})};return t.uploading>0||t.validatingBeforeUploading>0?e("uploading"):t.failed>0?e("failed"):t.succeed>0?e("succeed"):e("total")}get couldOpenActivity(){return this.cfg.showEmptyList||this.uploadCollection.size>0}initCallback(){super.initCallback(),this.registerActivity(this.activityType),this.subConfigValue("multiple",this.Te),this.subConfigValue("multipleMin",this.Te),this.subConfigValue("multipleMax",this.Te),this.sub("*groupInfo",t=>{t&&this.Te();}),this.subConfigValue("filesViewMode",t=>{this.setAttribute("mode",t);}),this.sub("*currentActivity",t=>{!this.couldOpenActivity&&t===this.activityType&&(this.$["*currentActivity"]=this.initActivity);}),this.uploadCollection.observeProperties(this.Te),this.uploadCollection.observeCollection(this.Te),this.sub("*collectionErrors",t=>{let e=t.filter(r=>r.type!=="SOME_FILES_HAS_ERRORS")[0];if(!e){this.lr=null;return}this.lr=e.message;});}disconnectedCallback(){super.disconnectedCallback(),this.has("*uploadCollection")&&(this.uploadCollection.unobserveProperties(this.Te),this.uploadCollection.unobserveCollection(this.Te));}render(){return v`<uc-activity-header><span aria-live="polite" class="uc-header-text">${this.Ku}</span><button type="button" class="uc-mini-btn uc-close-btn" @click=${this.$["*closeModal"]} title=${this.l10n("a11y-activity-header-button-close")} aria-label=${this.l10n("a11y-activity-header-button-close")} ><uc-icon name="close"></uc-icon></button></uc-activity-header><div class="uc-no-files" ?hidden=${this.wa}>${this.yield("empty",v`<span>${this.l10n("no-files")}</span>`)}</div><div class="uc-files"><div class="uc-files-wrapper">${Ai(this.$["*uploadList"]??[],({uid:t})=>t,({uid:t})=>v`<uc-file-item .uid=${t}></uc-file-item>`)}</div><button type="button" class="uc-add-more-btn uc-secondary-btn" @click=${this.Ta} ?disabled=${!this.No} ?hidden=${!this.Fo} ><uc-icon name="add"></uc-icon><span>${this.l10n("add-more")}</span></button></div><div class="uc-common-error" ?hidden=${!this.lr} >${this.lr??""}</div><div class="uc-toolbar"><button type="button" class="uc-cancel-btn uc-secondary-btn" @click=${this.xe}>${this.l10n("clear")}</button><div class="uc-toolbar-spacer"></div><button type="button" class="uc-add-more-btn uc-secondary-btn" ?hidden=${!this.Fo} ?disabled=${!this.No} @click=${this.Ta} ><uc-icon name="add"></uc-icon><span>${this.l10n("add-more")}</span></button><button type="button" class="uc-upload-btn uc-primary-btn" ?hidden=${!this.ba} @click=${this._o} >${this.l10n("upload")}</button><button type="button" class="uc-done-btn uc-primary-btn" ?hidden=${!this.va} ?disabled=${!this.ya} @click=${this.Bo} >${this.l10n("done")}</button></div><uc-drop-area ghost></uc-drop-area>`}};p([m()],Ot.prototype,"va",2),p([m()],Ot.prototype,"ya",2),p([m()],Ot.prototype,"ba",2),p([m()],Ot.prototype,"Fo",2),p([m()],Ot.prototype,"No",2),p([m()],Ot.prototype,"lr",2),p([m()],Ot.prototype,"wa",2),p([m()],Ot.prototype,"Vo",2);var Yu=[{test:o=>!!o.accept&&!!o.imgOnly,message:"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."},{test:o=>o.enableVideoRecording!==null,message:"The `enableVideoRecording` parameter is deprecated and will be removed in the next major release.\nPlease use the `cameraModes` parameter instead."},{test:o=>o.defaultCameraMode!==null,message:"The `defaultCameraMode` parameter is deprecated and will be removed in the next major release.\nPlease use the `cameraModes` parameter instead."}],La=$(o=>{for(let{test:i,message:t}of Yu)i(o)&&Dr(t);},0);var Pa=(o,i)=>{let t=new URL(i);return t.hostname=`${o}.${t.hostname}`,t.toString().replace(/\/$/,"")},Xu="0123456789abcdefghijklmnopqrstuvwxyz",Ua=o=>{if(o<=0n)return "0";let i="";for(;o>0n;){let t=o%36n;i=Xu[Number(t)]+i,o=o/36n;}return i},Ss=(o,i)=>{try{let t=new URL(o),e=new URL(i);return t.hostname.endsWith(e.hostname)}catch{return false}};var Qu=async o=>{let i=new TextEncoder().encode(o),t=await window.crypto.subtle.digest("SHA-256",i),e=Array.from(new Uint8Array(t)).map(r=>r.toString(16).padStart(2,"0")).join("");return BigInt(`0x${e}`)},Ju=10,td=async o=>{let i=await Qu(o);return Ua(i).slice(0,Ju)},Ra=async(o,i)=>{let t=await td(o);return Pa(t,i)};var $a=o=>o instanceof Promise||!!(o&&typeof o=="object"&&"then"in o&&typeof o.then=="function");var As=o=>o,ed=[As({key:"cameraModes",deps:["enableVideoRecording"],fn:({cameraModes:o,enableVideoRecording:i})=>{let t=i();if(t===null)return o();let e=K(o());return t&&!e.includes("video")?e=e.concat("video"):t||(e=e.filter(r=>r!=="video")),Bt(e)}}),As({key:"cameraModes",deps:["defaultCameraMode"],fn:({cameraModes:o,defaultCameraMode:i})=>{let t=i();if(t===null)return o();let e=K(o());return e=e.sort((r,s)=>r===t?-1:s===t?1:0),Bt(e)}}),As({key:"cdnCname",deps:["pubkey","cdnCnamePrefixed"],fn:({pubkey:o,cdnCname:i,cdnCnamePrefixed:t})=>{let e=o(),r=i(),s=t();return e&&(r===pi||Ss(r,s))?Ra(e,s):r}})],Da=({key:o,setValue:i,getValue:t,computationControllers:e})=>{for(let r of ed){if(!r.deps.includes(o))continue;let s={[r.key]:()=>t(r.key)};for(let l of r.deps)s[l]=()=>t(l);let n=new AbortController;e.get(r.fn)?.abort(),e.set(r.fn,n);let a;try{a=r.fn(s,{signal:n.signal});}catch(l){e.get(r.fn)===n&&e.delete(r.fn),console.error(`Failed to compute value for "${r.key}"`,l);return}$a(a)?a.then(l=>{n.signal.aborted||i(r.key,l);}).catch(l=>{n.signal.aborted||console.error(`Failed to compute value for "${r.key}"`,l);}).finally(()=>{e.get(r.fn)===n&&e.delete(r.fn);}):i(r.key,a);}};var V=o=>String(o),tt=o=>{let i=Number(o);if(Number.isNaN(i))throw new Error(`Invalid number: "${o}"`);return i},z=o=>{if(typeof o>"u"||o===null)return false;if(typeof o=="boolean")return o;if(o==="true"||o==="")return true;if(o==="false")return false;throw new Error(`Invalid boolean: "${o}"`)},Fa=o=>o==="auto"?o:z(o),Va=o=>{let i=V(o);if(i!=="user"&&i!=="environment"&&i!=="")throw new Error(`Invalid value: "${i}"`);return i},Na=o=>{let i=V(o);if(!Object.values(P).includes(i))throw new Error(`Invalid value: "${i}"`);return i},_a=o=>{let i=V(o),t=K(i);if(t.some(e=>!Object.values(P).includes(e)))throw new Error(`Invalid value: "${JSON.stringify(t)}"`);return i},za=o=>{let i=V(o);if(i==="local"||i==="global")return i;if(z(o)===false)return false;throw new Error(`Invalid value: "${i}"`)},Ba=o=>{if(typeof o=="object"&&!Array.isArray(o)||typeof o=="function")return o;throw new Error("Invalid metadata value. Must be an object or function.")},ks=o=>{if(typeof o=="object")return o;throw new Error("Invalid value. Must be an object.")},Zr=o=>{if(typeof o=="function")return o;throw new Error("Invalid value. Must be a function.")},Yr=o=>{if(Array.isArray(o))return o;throw new Error("Must be an array.")},Ha=o=>{let i=V(o);if(["grid","list"].includes(i))return i;throw new Error(`Invalid value: "${i}"`)};var id={pubkey:V,multiple:z,multipleMin:tt,multipleMax:tt,confirmUpload:z,imgOnly:z,accept:V,externalSourcesPreferredTypes:V,externalSourcesEmbedCss:V,store:Fa,cameraMirror:z,cameraCapture:Va,sourceList:V,topLevelOrigin:V,maxLocalFileSizeBytes:tt,thumbSize:tt,showEmptyList:z,useLocalImageEditor:z,useCloudImageEditor:z,cloudImageEditorTabs:V,removeCopyright:z,cropPreset:V,imageShrink:V,modalScrollLock:z,modalBackdropStrokes:z,sourceListWrap:z,remoteTabSessionKey:V,cdnCname:V,cdnCnamePrefixed:V,baseUrl:V,socialBaseUrl:V,secureSignature:V,secureExpire:V,secureDeliveryProxy:V,retryThrottledRequestMaxTimes:tt,retryNetworkErrorMaxTimes:tt,multipartMinFileSize:tt,multipartChunkSize:tt,maxConcurrentRequests:tt,multipartMaxConcurrentRequests:tt,multipartMaxAttempts:tt,checkForUrlDuplicates:z,saveUrlForRecurrentUploads:z,groupOutput:z,userAgentIntegration:V,debug:z,localeName:V,metadata:Ba,secureUploadsExpireThreshold:tt,localeDefinitionOverride:o=>ks(o),secureUploadsSignatureResolver:o=>Zr(o),secureDeliveryProxyUrlResolver:o=>Zr(o),iconHrefResolver:o=>Zr(o),plugins:o=>Yr(o),fileValidators:Yr,collectionValidators:Yr,validationTimeout:tt,validationConcurrency:tt,cameraModes:_a,defaultCameraMode:Na,enableAudioRecording:z,enableVideoRecording:z,mediaRecorderOptions:ks,maxVideoRecordingDuration:tt,filesViewMode:Ha,gridShowFileNames:z,cloudImageEditorAutoOpen:z,cloudImageEditorMaskHref:V,testMode:z,qualityInsights:z,pasteScope:za},Ka=(o,i)=>{if(!(typeof i>"u"||i===null))try{return id[o](i)}catch(t){return console.error(`Invalid value for config key "${o}".`,t),J[o]}};var Xr=[...new Set(["debug",...Object.keys(J)])],rd=["metadata","plugins","localeDefinitionOverride","secureUploadsSignatureResolver","secureDeliveryProxyUrlResolver","iconHrefResolver","fileValidators","collectionValidators","mediaRecorderOptions"],Ga=o=>rd.includes(o),Is=Xr.filter(o=>!Ga(o)),Ms={...Object.fromEntries(Is.map(o=>[cr(o),o])),...Object.fromEntries(Is.map(o=>[o.toLowerCase(),o]))},ja=o=>`__${o}`,Xe=class extends C{constructor(){super(...arguments);this.init$={...this.init$,...Object.fromEntries(Object.entries(J).map(([t,e])=>[O(t),e]))};this.qu=new Map;this.ur={};this.xa=new Set;this.Ut=new Map;}zo(t){return this.xa.has(t)}Ea(t){let e=this.i.pluginManager;if(e)return e.configRegistry.get(t)}Ca(t){return [...new Set([cr(t),t.toLowerCase()])]}Wu(t,e){if(Ga(t)||this.zo(t)&&this.Ea(t)?.attribute===false)return;let r=this.Ca(t);for(let s of r)typeof e>"u"||e===null?this.removeAttribute(s):this.getAttribute(s)!==e.toString()&&this.setAttribute(s,e.toString());}Zu(t,e){let r=O(t);if(this.$[r]!==e)if(typeof e>"u"||e===null){let s=J[t];this.$[r]=s!==void 0?s:e;}else this.$[r]=e;}Xe(t,e){let r;this.zo(t)?r=this.Ea(t)?.normalize?.(e)??e:r=Ka(t,e);let s=this,n=ja(t);s[n]!==r&&(this.Yu(t,s[n],r),s[n]=r,this.Wu(t,r),this.Zu(t,r),this.debugPrint(`"${t}"`,r),this.zo(t)||La(this.cfg));}dr(t){let e=this,r=ja(t);return e[r]??this.$[O(t)]}Yu(t,e,r){this.cfg.debug&&r!==e&&typeof r=="object"&&typeof e=="object"&&JSON.stringify(r)===JSON.stringify(e)&&(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:`,e),console.warn(`[uc-config] "${t}" new value:`,r));}Sa(t){let e=t.configRegistry.getAll();this.ur={},this.xa=new Set(e.keys());for(let[r,s]of this.Ut)e.has(r)||(s(),this.Ut.delete(r));for(let[r,s]of e){let a=O(r);if(s.attribute){let c=this.Ca(r);for(let d of c)this.ur[d]=r;}this.sharedCtx.has(a)||this.sharedCtx.add(a,s.defaultValue);let l=Object.getOwnPropertyDescriptor(this,r);if((!l||!l.set||!l.get)&&Object.defineProperty(this,r,{set:c=>{this.Xe(r,c);},get:()=>this.dr(r),enumerable:true,configurable:true}),!this.Ut.has(r)){let c=this.sub(a,d=>{this.Xe(r,d);},false);this.Ut.set(r,c);}}}Xu(){this.i.when("pluginManager",t=>{this.Sa(t),this.cr=t.onPluginsChange(()=>{this.Sa(t);});});}Qu(){this.ai=new MutationObserver(t=>{for(let e of t)if(e.type==="attributes"&&e.attributeName){let r=e.attributeName,s=e.oldValue,n=this.getAttribute(r);if(s===n||r in Ms)continue;r in this.ur&&this.attributeChangedCallback(r,s??"",n??"");}}),this.ai.observe(this,{attributes:true,attributeOldValue:true});}initCallback(){super.initCallback();let t=this;this.Xu(),this.Qu();for(let r of Is)this.sub(O(r),s=>{this.Xe(r,s);},false);for(let r of Xr){let s=t[r]??this.$[O(r)];s!==J[r]&&this.Xe(r,s);let n=Object.getOwnPropertyDescriptor(this,r);(!n||!n.set||!n.get)&&Object.defineProperty(this,r,{set:a=>{this.Xe(r,a);},get:()=>this.dr(r)});}let e=r=>{Da({key:r,setValue:this.Xe.bind(this),getValue:this.dr.bind(this),computationControllers:this.qu});};for(let r of Xr)this.sub(O(r),()=>e(r));}attributeChangedCallback(t,e,r){if(super.attributeChangedCallback(t,e,r),e===r)return;let s=this,n=Ms[t];n?s[n]=r:this.i.when("pluginManager",a=>{if(this.getAttribute(t)!==r)return;let l=this.ur[t],c=l?a.configRegistry.get(l):void 0;if(l&&c){let d=c.fromAttribute?c.fromAttribute(r):r;if(this.dr(l)===d)return;this.Xe(l,d);}});}disconnectedCallback(){super.disconnectedCallback(),this.cr&&(this.cr(),this.cr=void 0),this.ai&&(this.ai.disconnect(),this.ai=void 0);for(let t of this.Ut.values())t();this.Ut.clear();}static get observedAttributes(){let t=super.observedAttributes,e=Object.keys(Ms);return [...t,...e]}};for(let o of Xr)Xe.prototype[o]=void 0;var ki=class extends R{constructor(){super(...arguments);this.couldBeCtxOwner=true;this.dropzone=true;this.Aa="upload-file";this.Ju=()=>{this.api.initFlow();};}static{this.styleAttrs=[...super.styleAttrs,"uc-simple-btn"];}initCallback(){super.initCallback(),this.subConfigValue("multiple",t=>{this.Aa=t?"upload-files":"upload-file";});}render(){return v`<uc-drop-area .disabled=${!this.dropzone}><button type="button" @click=${this.Ju}><uc-icon name="upload"></uc-icon><span>${this.l10n(this.Aa)}</span>${this.yield("")}<div class="uc-visual-drop-area">${this.l10n("drop-files-here")}</div></button></uc-drop-area>`}};p([y({attribute:"dropzone",type:Boolean})],ki.prototype,"dropzone",2),p([m()],ki.prototype,"Aa",2);var Mi=class extends x{constructor(){super(...arguments);this.Ko=S();}initCallback(){this.activityType=this.registration?.id??null,this.ka(),super.initCallback();}willUpdate(t){super.willUpdate(t),t.has("registration")&&(this.ka(),this.isActivityActive&&(this.pr(),this.Ma()));}ka(){this.registration&&(this.kn()||this.registerActivity(this.activityType??"",{onActivate:()=>this.Ma(),onDeactivate:()=>this.pr()}));}async Ma(){await this.updateComplete;let t=this.Ko.value;if(!t||!this.registration)return;this.pr();let e=this.$["*currentActivityParams"];this.Ho=this.registration.render(t,e)??void 0;}pr(){let t=this.Ko.value;t&&(this.Ho?.(),this.Ho=void 0,t.replaceChildren());}disconnectedCallback(){this.pr(),super.disconnectedCallback();}render(){return v`<div style="display: flex; flex-direction: column; width: 100%; min-height: 0;" ${I(this.Ko)} ></div>`}};p([y({attribute:false})],Mi.prototype,"registration",2);var Qe=class extends C{constructor(){super(...arguments);this.mode="modal";this.ve=[];}initCallback(){super.initCallback();let t=this.i.pluginManager;t?.onPluginsChange&&(this.E=t.onPluginsChange(()=>this.Ia())),this.Ia();}Ia(){let t=this.i.pluginManager;if(!t){this.ve=[];return}this.ve=t.snapshot().activities;}disconnectedCallback(){this.E?.(),this.E=void 0,super.disconnectedCallback();}render(){return this.mode==="inline"?v`${Ai(this.ve,t=>t.id,t=>v`<uc-plugin-activity-host .registration=${t}></uc-plugin-activity-host>`)}`:v`${Ai(this.ve,t=>t.id,t=>v`<uc-modal id=${t.id} strokes block-body-scrolling><uc-plugin-activity-host .registration=${t}></uc-plugin-activity-host></uc-modal>`)}`}};p([y({type:String})],Qe.prototype,"mode",2),p([m()],Qe.prototype,"ve",2);function Ii(o,i,t){return o?i(o):t?.(o)}function qa(...o){return o.reduce((i,t)=>{if(typeof t=="string")return i[t]=true,i;for(let e of Object.keys(t))i[e]=t[e];return i},{})}function vt(...o){let i=qa(...o);return Object.keys(i).reduce((t,e)=>(i[e]&&t.push(e),t),[]).join(" ")}function Wa(o,...i){let t=qa(...i);for(let e of Object.keys(t))o.classList.toggle(e,!!t[e]);}var od=o=>ot.includes(o),Za=o=>{if(!o)return ot;let i=K(o).filter(od);return i.length===0?ot:i};function Ya(o){return {"*originalUrl":null,"*loadingOperations":new Map,"*faderEl":null,"*cropperEl":null,"*imgEl":null,"*imgContainerEl":null,"*networkProblems":false,"*imageSize":null,"*editorTransformations":{},"*cropPresetList":[],"*currentAspectRatio":null,"*tabList":ot,"*tabId":B.CROP,"*on.retryNetwork":()=>{let i=o.querySelectorAll("img");for(let t of i){let e=t.src;t.src=It,t.src=e;}o.$["*networkProblems"]=false;},"*on.apply":i=>{if(!i)return;let t=o.$["*originalUrl"];if(!t){console.warn("Original URL is null, cannot apply transformations");return}let e=rt(Jt(i),"preview"),r=W(t,e),s={originalUrl:t,cdnUrlModifiers:e,cdnUrl:r,transformations:i};o.dispatchEvent(new CustomEvent("apply",{detail:s,bubbles:true,composed:true})),o.remove();},"*on.cancel":()=>{o.remove(),o.dispatchEvent(new CustomEvent("cancel",{bubbles:true,composed:true}));}}}var Xa="<svg width='0' height='0' style='position:absolute'><symbol fill='none' viewBox='0 0 9 6' id='uc-icon-arrow-dropdown' xmlns='http://www.w3.org/2000/svg'><path stroke='currentColor' d='m1.5 1.667 3 2.666 3-2.666' opacity='.5'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-aspect-ratio' xmlns='http://www.w3.org/2000/svg'/><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 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 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 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 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 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 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 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 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 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 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 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='ruc-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(#ruc-icon-id__a)'/></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 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(#uuc-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(#uuc-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(#uuc-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(#uuc-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(#uuc-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(#uuc-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(#uuc-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(#uuc-icon-id__h)'/><defs><linearGradient id='uuc-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='uuc-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='uuc-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='uuc-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='uuc-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='uuc-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='uuc-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='uuc-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 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 Ce={transition:"uc-transition",visible:"uc-visible",hidden:"uc-hidden"},Je=class extends C{constructor(){super(...arguments);this.pe=false;this.Oa=Ce;this.Pa=Ce.visible;this.La=Ce.hidden;this.jo=false;this.Ra=false;}set visible(t){this.pe=t,this.Ua();}get visible(){return this.pe}set styles(t){this.Oa=t,this.jo=true,this.Pa=t.visible??Ce.visible,this.La=t.hidden??Ce.hidden;}get styles(){return this.Oa}Ua(){this.style.visibility=this.pe?"inherit":"hidden",Wa(this,{[Ce.transition]:!this.jo,[this.Pa]:this.pe,[this.La]:!this.pe}),this.toggleAttribute("inert",!this.pe);}ed(){this.Ra||(this.Ra=true,this.dispatchEvent(new CustomEvent("initial-render",{bubbles:true,composed:true})));}initCallback(){super.initCallback(),this.classList.toggle("uc-initial",true),this.jo||this.classList.add(Ce.transition),this.Ua(),setTimeout(()=>{this.classList.toggle("uc-initial",false),this.ed();},0);}};p([y({type:Boolean})],Je.prototype,"visible",1),p([y({attribute:false})],Je.prototype,"styles",1);var Oi=class extends C{constructor(){super(...arguments);this.active=false;this.Qe=S();this.Go=false;this.qo=()=>{let t=this.Qe.value;t&&(this.$a(t),this.Go&&this.active&&this.Wo());};}firstUpdated(t){super.firstUpdated(t),this.active&&this.Wo();}updated(t){super.updated(t),t.has("active")&&(this.active?this.Wo():this.td());}Wo(){let t=this.Qe.value;if(!t)return;this.Go=true;let{width:e}=this.getBoundingClientRect();t.removeEventListener("transitionend",this.qo),t.style.transition="transform 1s",t.style.opacity="1",t.style.transform=`translateX(${e}px)`,t.addEventListener("transitionend",this.qo,{once:true});}td(){let t=this.Qe.value;t&&(this.Go=false,t.removeEventListener("transitionend",this.qo),this.$a(t));}$a(t){t.style.transition="initial",t.style.opacity="0",t.style.transform="translateX(-101%)";}render(){return v`<div class="uc-inner"><div class="uc-line" ${I(this.Qe)}></div></div>`}};p([y({type:Boolean,reflect:true})],Oi.prototype,"active",2);var le=ft(class extends Tt{constructor(o){if(super(o),o.type!==Rt.ATTRIBUTE||o.name!=="class"||o.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(o){return " "+Object.keys(o).filter(i=>o[i]).join(" ")+" "}update(o,[i]){if(this.st===void 0){this.st=new Set,o.strings!==void 0&&(this.nt=new Set(o.strings.join(" ").split(/\s/).filter(e=>e!=="")));for(let e in i)i[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(i)}let t=o.element.classList;for(let e of this.st)e in i||(t.remove(e),this.st.delete(e));for(let e in i){let r=!!i[e];r===this.st.has(e)||this.nt?.has(e)||(r?(t.add(e),this.st.add(e)):(t.remove(e),this.st.delete(e)));}return it}});var q=o=>o??U;var xt=class extends C{constructor(){super(...arguments);this.text="";this.icon="";this.reverse=false;this.theme="default";this.ariaRole=void 0;this.ariaControls="";this.titleProp="";this.active=false;}firstUpdated(t){super.firstUpdated(t),this.Da(),this.Fa();}updated(t){super.updated(t),t.has("reverse")&&this.Da(),t.has("theme")&&this.Fa();}Da(){this.style.flexDirection=this.reverse?"row-reverse":"";}Fa(){this.theme&&this.theme!=="custom"&&(this.className=`uc-${this.theme}`);}get rd(){let t=this.Zo;return {"uc-icon":true,"uc-icon_left":!this.reverse,"uc-icon_right":this.reverse,"uc-icon_hidden":t,"uc-icon_single":this.od}}get Zo(){return !this.icon}get od(){return !this.text&&!this.Zo}render(){return v`<button type="button" role=${q(this.ariaRole||void 0)} aria-controls=${q(this.ariaControls||void 0)} aria-label=${q(this.l10n(this.titleProp))} title=${q(this.l10n(this.titleProp))} ><uc-icon class=${le(this.rd)} name=${q(this.icon||void 0)} ?hidden=${this.Zo} ></uc-icon><div class="uc-text">${this.text}</div></button>`}};p([y({type:String})],xt.prototype,"text",2),p([y({type:String})],xt.prototype,"icon",2),p([y({type:Boolean,reflect:true})],xt.prototype,"reverse",2),p([y({type:String,reflect:true})],xt.prototype,"theme",2),p([y({attribute:"aria-role"})],xt.prototype,"ariaRole",2),p([y({attribute:"aria-controls"})],xt.prototype,"ariaControls",2),p([y({attribute:"title-prop"})],xt.prototype,"titleProp",2),p([y({type:Boolean,noAccessor:true})],xt.prototype,"active",2);function Qa(o,i){let t={};for(let e of i){let r=o[e];(Object.hasOwn(o,e)||r!==void 0)&&(t[e]=r);}return t}function ti(o,i,t){let r=window.devicePixelRatio,s=Math.min(Math.ceil(i*r),3e3),n=r>=2?"lightest":"normal";return W(o,rt(nr,Jt(t),`quality/${n}`,`stretch/off/-/resize/${s}x`,`@clib/${Pt}/${Ut}/uc-cloud-image-editor/`))}var Li=class extends C{constructor(){super(...arguments);this.Na=`uc-backdrop-mask-${pt.generateFastUid()}`;this.fr=false;this.di=false;this.Ba=S();this.pi=false;this.hi=null;this.Ha=t=>{this.Ka(),this.fi&&(t.stopPropagation(),t.preventDefault(),this.fi=false);};this.ja=t=>{if(!this.fi||!this.hr||!this.Xo)return;t.stopPropagation(),t.preventDefault();let e=this.Le;if(!e)return;let{x:r,y:s}=e.getBoundingClientRect(),n=t.x-r,a=t.y-s,l=n-this.hr[0],c=a-this.hr[1],{direction:d}=this.Xo,u=this.hd(d,[l,c]);u&&(this.$["*cropBox"]=u);};this.Ga=t=>{if(!this.Ee)return;let e=Object.values(this.Ee).find(r=>{if(!r||this.Jo(r.direction))return false;let n=r.interactionNode.getBoundingClientRect(),a={x:n.x,y:n.y,width:n.width,height:n.height};return pa(a,[t.x,t.y])});this.Va=e,this.Ka();};}get Le(){return this.Ba.value??null}get fi(){return this.di}set fi(t){this.di!==t&&(this.di=t,this.Qo());}Qo(){this.ci&&this.ci.setAttribute("class",vt({"uc-guides--hidden":this.fr,"uc-guides--visible":!this.fr&&this.di,"uc-guides--semi-hidden":!this.fr&&!this.di}));}Jo(t){let e=this.$["*imageBox"];if(!e)return false;if(t===""&&e.height<=M&&e.width<=M)return true;let r=e.height<=M&&(t.includes("n")||t.includes("s")),s=e.width<=M&&(t.includes("e")||t.includes("w"));return r||s}sd(){let t=this.$["*cropBox"];if(!t)return;let{x:e,y:r,width:s,height:n}=t,a=this.Le;if(!a)return;let l=mt("mask",{id:this.Na}),c=mt("rect",{x:0,y:0,width:"100%",height:"100%",fill:"white"}),d=mt("rect",{x:e,y:r,width:s,height:n,fill:"black"});l.appendChild(c),l.appendChild(d);let u=mt("rect",{x:0,y:0,width:"100%",height:"100%",fill:"var(--color-image-background)","fill-opacity":.85,mask:`url(#${this.Na})`});a.appendChild(u),a.appendChild(l),this.li=l,this.Yo=d;}nd(){this.li&&(this.li.style.display="none",window.requestAnimationFrame(()=>{this.li&&(this.li.style.display="block");}));}ad(){let t=this.$["*cropBox"];if(!t)return;let{x:e,y:r,width:s,height:n}=t;this.Yo&&oe(this.Yo,{x:e,y:r,width:s,height:n});}ld(){let t=this.$["*cropBox"];if(!(!t||!this.ci||!this.Ee)){for(let e of Object.values(this.Ee)){if(!e)continue;let{direction:r,pathNode:s,interactionNode:n,groupNode:a}=e,l=r==="",c=r.length===2,{x:d,y:u,width:h,height:f}=t;if(l)oe(n,{x:d,y:u,width:h,height:f});else {let b=se(Math.min(h,f)/82/2,0,1),w=c?aa(t,r,b):la(t,r,b),E=w.center;if(!E)continue;let T=Math.max(ss*se(Math.min(h,f)/ss/3,0,1),na);oe(n,{x:E[0]-T,y:E[1]-T,width:T*2,height:T*2}),oe(s,{d:w.d});}let g=this.Jo(r);a.setAttribute("class",vt("uc-thumb",{"uc-thumb--hidden":g,"uc-thumb--visible":!g}));}oe(this.ci,{x:t.x-1*.5,y:t.y-1*.5,width:t.width+1,height:t.height+1});}}za(t,e){let r=mt("g");r.classList.add("uc-thumb"),r.setAttribute("with-effects","");let s=mt("rect",{fill:"transparent"}),n=mt("path",{stroke:"currentColor",fill:"none","stroke-width":3});r.appendChild(n),r.appendChild(s),t[e]={direction:e,pathNode:n,interactionNode:s,groupNode:r},e===""&&(r.style.cursor="move"),s.addEventListener("pointerdown",this.cd.bind(this,e));}ud(){let t={};for(let e=0;e<3;e++)for(let r=0;r<3;r++){let s=`${["n","","s"][e]}${["w","","e"][r]}`;s!==""&&this.za(t,s);}return this.za(t,""),t}dd(){let t=mt("svg"),e=mt("rect",{x:0,y:0,width:"100%",height:"100%",fill:"none",stroke:"currentColor","stroke-width":1,"stroke-opacity":.5});t.appendChild(e);for(let r=1;r<=2;r++){let s=mt("line",{x1:`${bi*r}%`,y1:"0%",x2:`${bi*r}%`,y2:"100%",stroke:"currentColor","stroke-width":1,"stroke-opacity":.3});t.appendChild(s);}for(let r=1;r<=2;r++){let s=mt("line",{x1:"0%",y1:`${bi*r}%`,x2:"100%",y2:`${bi*r}%`,stroke:"currentColor","stroke-width":1,"stroke-opacity":.3});t.appendChild(s);}return t.classList.add("uc-guides","uc-guides--semi-hidden"),t}pd(){let t=this.Le;if(!t)return;let e=document.createDocumentFragment(),r=this.dd();e.appendChild(r);let s=this.ud();for(let{groupNode:n}of Object.values(s))e.appendChild(n);t.appendChild(e),this.Ee=s,this.ci=r,this.Qo();}cd(t,e){if(!this.Ee)return;let r=this.Ee[t];if(!r||this.Jo(t))return;let s=this.$["*cropBox"],n=this.Le;if(!n)return;let{x:a,y:l}=n.getBoundingClientRect(),c=e.x-a,d=e.y-l;this.fi=true,this.Xo=r,this.hr=[c,d],this._a={...s};}hd(t,e){let[r,s]=e,n=this.$["*imageBox"],a=this._a??this.$["*cropBox"],l=this.$["*currentAspectRatio"],c=l?l.width/l.height:void 0;if(t===""?a=ua({rect:a,delta:[r,s],imageBox:n}):a=da({rect:a,delta:[r,s],direction:t,aspectRatio:c,imageBox:n}),!Object.values(a).every(d=>Number.isFinite(d)&&d>=0)){console.error("CropFrame is trying to create invalid rectangle",{payload:a});return}return Ne(ze(a),n)}Ka(){let t=this.Va,e=this.Le;e&&(e.style.cursor=t?ca(t.direction):"initial");}qa(t){if(this.ui){this.ui.setAttribute("href",t);return}let e=this.Le;if(!e){this.hi=t;return}this.hi=null;let r=document.createDocumentFragment(),s=mt("image",{href:t});s.setAttribute("class","uc-cloud-mask"),r.appendChild(s),e.appendChild(r),this.ui=s;}fd(){let t=this.$["*cropBox"];if(!t||!this.ui)return;let{x:e,y:r,width:s,height:n}=t;oe(this.ui,{x:e,y:r,height:n,width:s});}es(){this.pi&&(this.ad(),this.ld(),this.fd());}toggleThumbs(t){if(this.Ee)for(let e of Object.values(this.Ee)){if(!e)continue;let{groupNode:r}=e;r.setAttribute("class",vt("uc-thumb",{"uc-thumb--hidden":!t,"uc-thumb--visible":t}));}}initCallback(){super.initCallback(),this.sub("*imageBox",()=>{this.nd(),this.pi&&window.requestAnimationFrame(()=>{this.es();});}),this.sub("*cropBox",t=>{t&&(this.fr=t.height<=M||t.width<=M,this.Qo(),this.pi&&window.requestAnimationFrame(()=>{this.es();}));}),this.subConfigValue("cloudImageEditorMaskHref",t=>{t&&this.qa(t);}),document.addEventListener("pointermove",this.ja,true),document.addEventListener("pointerup",this.Ha,true);}firstUpdated(t){super.firstUpdated(t),this.md();}md(){let t=this.Le;if(!(!t||this.pi)){if(this.sd(),this.pd(),this.pi=true,t.addEventListener("pointermove",this.Ga,true),this.hi){let e=this.hi;this.hi=null,this.qa(e);}this.es();}}disconnectedCallback(){super.disconnectedCallback(),this.Le?.removeEventListener("pointermove",this.Ga,true),document.removeEventListener("pointermove",this.ja,true),document.removeEventListener("pointerup",this.Ha,true);}render(){return v`<svg class="uc-svg" xmlns="http://www.w3.org/2000/svg" ${I(this.Ba)}></svg>`}};p([m()],Li.prototype,"di",2);function nd(o){return o?[({dimensions:t,coords:e})=>[...t,...e].every(r=>Number.isInteger(r)&&Number.isFinite(r)),({dimensions:t,coords:e})=>t.every(r=>r>0)&&e.every(r=>r>=0)].every(t=>t(o)):true}var Pi=class extends C{constructor(){super();this.ctxOwner=true;this.Je={width:0,height:0};this.e=null;this._=false;this.se=null;this.Za=S();this.rs=S();this.init$={...this.init$,"*padding":20,"*operations":{rotate:0,mirror:false,flip:false},"*imageBox":{x:0,y:0,width:0,height:0},"*cropBox":{x:0,y:0,width:0,height:0}},this.Wa=$(this.Ya.bind(this),300),this.ts=Ye(()=>{!this.isConnected||!this._||(this.os(),this.Xa(),this.Qa(),this.ss(),this.ns());},100);}firstUpdated(t){super.firstUpdated(t),this.os();}Xa(){let t=this.$["*editorTransformations"],e=Qa(t,Object.keys(this.$["*operations"])),r={...this.$["*operations"],...e};this.$["*operations"]=r;}os(){let t=this.Za.value;if(!t)return;let e=t.getContext("2d"),r=this.offsetWidth,s=this.offsetHeight,n=window.devicePixelRatio;t.style.width=`${r}px`,t.style.height=`${s}px`,t.width=r*n,t.height=s*n,e?.scale(n,n),this.he=t,this.e=e;}Qa(){if(!this._||!this.se)return;let t=this.se,e=this.$["*padding"],r=this.$["*operations"],{rotate:s}=r,n={width:this.offsetWidth,height:this.offsetHeight},a=_e({width:t.naturalWidth,height:t.naturalHeight},s),l;if(a.width>n.width-e*2||a.height>n.height-e*2){let c=a.width/a.height,d=n.width/n.height;if(c>d){let u=n.width-e*2,h=u/c,f=0+e,g=e+(n.height-e*2)/2-h/2;l={x:f,y:g,width:u,height:h};}else {let u=n.height-e*2,h=u*c,f=e+(n.width-e*2)/2-h/2,g=0+e;l={x:f,y:g,width:h,height:u};}}else {let{width:c,height:d}=a,u=e+(n.width-e*2)/2-c/2,h=e+(n.height-e*2)/2-d/2;l={x:u,y:h,width:c,height:d};}this.$["*imageBox"]=ze(l);}ss(){let t=this.$["*cropBox"],e=this.$["*imageBox"],r=this.$["*operations"],{rotate:s}=r,n=this.$["*editorTransformations"].crop,{width:a,x:l,y:c}=e;if(n){let{dimensions:[h,f],coords:[g,b]}=n,{width:w}=_e(this.Je,s),E=a/w;t=Ne(ze({x:l+g*E,y:c+b*E,width:h*E,height:f*E}),e);}let d=this.$["*currentAspectRatio"],u=d?d.width/d.height:void 0;if(!ha(t,e)||u&&!fa(t,u)){let h=e.width/e.height,f=e.width,g=e.height;u&&(h>u?f=Math.min(e.height*u,e.width):g=Math.min(e.width/u,e.height)),t={x:e.x+e.width/2-f/2,y:e.y+e.height/2-g/2,width:f,height:g};}this.$["*cropBox"]=Ne(ze(t),e);}gd(){let t=this.e;if(!t)return;let e=this.se;if(!e)return;let r=this.$["*imageBox"],s=this.$["*operations"],{mirror:n,flip:a,rotate:l}=s,c=_e({width:r.width,height:r.height},l);t.save(),t.translate(r.x+r.width/2,r.y+r.height/2),t.rotate(l*Math.PI*-1/180),t.scale(n?-1:1,a?-1:1),t.drawImage(e,-c.width/2,-c.height/2,c.width,c.height),t.restore();}ns(){if(!this._||!this.se||!this.he||!this.e)return;let t=this.he;this.e.clearRect(0,0,t.width,t.height),this.gd();}vd({fromViewer:t}){this.se&&(this.rs.value?.toggleThumbs(true),this.yd(),setTimeout(()=>{this.className=vt({"uc-active_from_viewer":t,"uc-active_from_editor":!t,"uc-inactive_to_editor":false});}));}Ja(){let t=this.$["*cropBox"],e=this.$["*imageBox"],r=this.$["*operations"],{rotate:s}=r,{width:n,height:a}=e,{width:l,height:c}=_e(this.Je,s),{width:d,height:u}=t,h=n/l,f=a/c;return [se(Math.round(d/h),1,l),se(Math.round(u/f),1,c)]}bd(){let t=this.$["*cropBox"],e=this.$["*imageBox"],r=this.$["*operations"],{rotate:s}=r,{width:n,height:a,x:l,y:c}=e,{width:d,height:u}=_e(this.Je,s),{x:h,y:f}=t,g=n/d,b=a/u,w=this.Ja(),E={dimensions:w,coords:[se(Math.round((h-l)/g),0,d-w[0]),se(Math.round((f-c)/b),0,u-w[1])]};if(!nd(E)){console.error("Cropper is trying to create invalid crop object",{payload:E});return}if(!(w[0]===d&&w[1]===u))return E}Ya(){if(!this.isConnected||!this.Je)return;let t=this.$["*operations"],{rotate:e,mirror:r,flip:s}=t,n=this.bd(),l={...this.$["*editorTransformations"],crop:n,rotate:e,mirror:r,flip:s};this.$["*editorTransformations"]=l;}setValue(t,e){this.$["*operations"]={...this.$["*operations"],[t]:e},this._&&(this.Qa(),this.ss(),this.ns());}getValue(t){return this.$["*operations"][t]}async activate(t,{fromViewer:e}={}){if(!this._){this._=true,await this.updateComplete,this.os(),this.Je=t,this.removeEventListener("transitionend",this.tl);try{let r=this.$["*originalUrl"],s=this.$["*editorTransformations"];this.se=await this.wd(r,s),this.Xa(),this.ts(),this.vd({fromViewer:e});}catch(r){console.error("Failed to activate cropper",{error:r}),this.telemetryManager.sendEventError(r,"cloud editor image. Failed to activate cropper");}this.s=new ResizeObserver(r=>{let[s]=r;if(!s)return;s.contentRect.width>0&&s.contentRect.height>0&&this._&&this.se&&this.ts();}),this.s.observe(this);}}deactivate({reset:t=false}={}){this._&&(!t&&this.Ya(),this._=false,this.Td(),this.className=vt({"uc-active_from_viewer":false,"uc-active_from_editor":false,"uc-inactive_to_editor":true}),this.rs.value?.toggleThumbs(false),this.addEventListener("transitionend",this.tl,{once:true}),this.s?.disconnect());}Td(){let t=this.Ja(),e=this.$["*cropBox"],r=Math.min(this.offsetWidth,t[0])/e.width,s=Math.min(this.offsetHeight,t[1])/e.height,n=Math.min(r,s),a=e.x+e.width/2,l=e.y+e.height/2;this.style.transform=`scale(${n}) translate(${(this.offsetWidth/2-a)/n}px, ${(this.offsetHeight/2-l)/n}px)`,this.style.transformOrigin=`${a}px ${l}px`;}yd(){let t=this.$["*cropBox"],e=t.x+t.width/2,r=t.y+t.height/2;this.style.transform="scale(1)",this.style.transformOrigin=`${e}px ${r}px`;}tl(){this._||(this.se=null);}async wd(t,e){let r=this.offsetWidth;e={...e,crop:void 0,rotate:void 0,flip:void 0,mirror:void 0};let s=await this.proxyUrl(ti(t,r,e)),{promise:n,cancel:a,image:l}=Ee(s),c=this.$t(s);return l.addEventListener("load",c,{once:true}),l.addEventListener("error",c,{once:true}),this.b?.(),this.b=a,n.then(()=>l).catch(d=>(console.error("Failed to load image",{error:d}),this.$["*networkProblems"]=true,l))}$t(t){let e="crop",r=this.$["*loadingOperations"],s=r.get(e);return s||(s=new Map,r.set(e,s)),s.get(t)||(s.set(t,true),this.$["*loadingOperations"]=r),()=>{let n=r.get(e);n?.has(t)&&(n.delete(t),this.$["*loadingOperations"]=r);}}initCallback(){super.initCallback(),this.sub("*imageBox",()=>{this.ns();}),this.sub("*cropBox",()=>{this.se&&this.Wa();}),this.sub("*currentAspectRatio",()=>{this.ss();}),setTimeout(()=>{this.sub("*networkProblems",t=>{t||this._&&this.Je&&this.activate(this.Je,{fromViewer:false});});},0);}disconnectedCallback(){super.disconnectedCallback(),this.s?.disconnect(),this.se&&(this.se=null);}render(){return v`<canvas class="uc-canvas" ${I(this.Za)}></canvas><uc-crop-frame ${I(this.rs)}></uc-crop-frame>`}};p([m()],Pi.prototype,"se",2);function Os(o,i,t){let e=t,r=t-1,s=new Array(e);for(let n=r;n>=0;n-=1)s[n]=Math.ceil((n*i+(r-n)*o)/r);return s}function ad(o){return typeof o=="string"&&o in kt}function ld(o){let i=[];for(let t=0;t<o.length-1;t+=1){let e=o[t],r=o[t+1];typeof e=="number"&&typeof r=="number"&&i.push([e,r]);}return i}function cd(o,i,t){let e=ld(o).find(([n,a])=>n<=i&&i<=a);if(!e)return o.map(()=>0);let[r,s]=e;return o.map(n=>{let a=Math.abs(r-s)||1,l=Math.abs(i-r)/a;return r===n?i>t?1:1-l:s===n?i>=t?l:1:0})}function ud(o,i){return o.map((t,e)=>t<i?o.length-e:e)}function Ja(o,i){let t=kt[o].keypointsNumber,{range:e,zero:r}=kt[o];return [...new Set([...Os(e[0],r,t+1),...Os(r,e[1],t+1),r,i])].sort((s,n)=>s-n)}var Qr=class extends C{constructor(){super();this._=false;this.as=true;this.n="initial";this.il={};this.Re=[];this.ol=0;this.nl=S();this.mr=S();this.classList.add("uc-inactive_to_cropper"),this.sl=$(async(t,e,r)=>{let s=()=>!this.al(t,e)||this.Pt!==r||!!this.Re.find(c=>c.value===r);if(s())return;let n=await this.ll(t,r),a=new Image;a.src=n.src;let l=this.$t(n.src);a.addEventListener("load",l,{once:true}),a.addEventListener("error",l,{once:true}),n.image=a,a.classList.add("uc-fader-image"),a.addEventListener("load",()=>{if(s())return;let c=this.Re,d=c.findIndex(g=>g.value>r);d===-1&&(d=c.length);let h=c[d]?.image,f=this.mr.value;!f||h&&!f.contains(h)||(c.splice(d,0,n),h?f.insertBefore(a,h):f.appendChild(a),this.us(t,r));},{once:true}),a.addEventListener("error",()=>{this.$["*networkProblems"]=true;},{once:true});},600);}$t(t){let e=this.n,r=this.$["*loadingOperations"];r.has(e)||r.set(e,new Map);let s=r.get(e);return s&&!s.get(t)&&(s.set(t,true),this.$["*loadingOperations"]=r),()=>{let n=r.get(e);n?.has(t)&&(n.delete(t),this.$["*loadingOperations"]=r);}}cl(){window.cancelAnimationFrame(this.ol),this.ol=window.requestAnimationFrame(()=>{for(let t of this.Re){let{image:e}=t;e&&(e.style.opacity=t.opacity.toString(),e.style.zIndex=t.zIndex.toString());}});}et({url:t=this.rl,filter:e=this.g??void 0,operation:r,value:s}={}){if(!t)throw new Error("URL is not defined");let n={...this.il};r&&(r==="filter"?e&&typeof s=="number"&&(n.filter={name:e,amount:s}):typeof s=="number"&&(n[r]=s));let a=this.offsetWidth;return this.proxyUrl(ti(t,a,n))}async ll(t,e){return {src:await this.et({operation:t,value:e}),image:void 0,opacity:0,zIndex:0,value:e}}al(t,e){return this.n===t&&this.g===e}set(t){let e=typeof t=="string"?parseInt(t,10):t;!ad(this.n)||!Number.isFinite(e)||(this.us(this.n,e),this.sl(this.n,this.g,e));}us(t,e){this.n=t,this.Pt=e;let{zero:r}=kt[t],s=this.Re.map(l=>l.value),n=cd(s,e,r),a=ud(s,r);this.Re.forEach((l,c)=>{let d=n[c],u=a[c];typeof d=="number"&&(l.opacity=d),typeof u=="number"&&(l.zIndex=u);}),this.cl();}ul(){let t=new Image;return t.classList.add("uc-fader-image","uc-fader-image--preview"),t.style.opacity="0",t}async xd(){this.a=this.a||this.ul();let t=this.a;t&&this.dl(t);let e=this.Re.map(c=>c.src),{images:r,promise:s,cancel:n}=Si(e);r.forEach(c=>{let d=this.$t(c.src);c.addEventListener("load",d),c.addEventListener("error",d);}),this.ls=()=>{n(),this.ls=void 0;};let a=this.n,l=this.g;if(await s,this._&&this.al(a,l)){let c=this.mr.value;if(!c)return;c.replaceChildren(),this.Re.forEach((d,u)=>{let h=r[u];h&&(h.classList.add("uc-fader-image"),d.image=h,c.appendChild(h));}),this.cl();}}async setTransformations(t){if(this.il=t,this.a){let e=await this.et(),r=this.$t(e);this.a.src=e,this.a.addEventListener("load",r,{once:true}),this.a.addEventListener("error",r,{once:true}),this.a.style.opacity="1",this.a.addEventListener("error",()=>{this.$["*networkProblems"]=true;},{once:true});}}async preload({url:t,filter:e,operation:r,value:s}){if(!r||typeof s!="number")return;this.cs?.();let n=Ja(r,s),a=await Promise.all(n.map(c=>this.et({url:t,filter:e,operation:r,value:c}))),{cancel:l}=Si(a);this.cs=l;}Ed(t){let e=this.a||this.ul();if(this.dl(e),this.a=e,e.src===t){e.style.opacity="1",e.style.transform="scale(1)",this.className=vt({"uc-active_from_viewer":this.mi,"uc-active_from_cropper":!this.mi,"uc-inactive_to_cropper":false});return}e.style.opacity="0";let r=this.$t(t);e.addEventListener("error",r,{once:true}),e.src=t,e.addEventListener("load",()=>{r(),e&&(e.style.opacity="1",e.style.transform="scale(1)",this.className=vt({"uc-active_from_viewer":this.mi,"uc-active_from_cropper":!this.mi,"uc-inactive_to_cropper":false}));},{once:true}),e.addEventListener("error",()=>{this.$["*networkProblems"]=true;},{once:true});}async activate({url:t,operation:e,value:r,filter:s,fromViewer:n}){if(this._=true,this.as=false,await this.updateComplete,this.rl=t,this.n=e??"initial",this.Pt=r,this.g=s,this.mi=n,typeof r!="number"&&!s){let l=await this.et({operation:e,value:r});this.Ed(l),this.ds();return}!e||typeof r!="number"||(this.Re=await Promise.all(Ja(e,r).map(l=>this.ll(e,l))),this.us(e,r),this.xd());}deactivate({hide:t=true}={}){this._=false,this.ls?.(),this.cs?.(),t&&!this.as?(this.as=true,this.a&&(this.a.style.transform="scale(1)"),this.className=vt({"uc-active_from_viewer":false,"uc-active_from_cropper":false,"uc-inactive_to_cropper":true}),this.addEventListener("transitionend",()=>{this.ds();},{once:true})):this.ds();}dl(t){let e=this.nl.value;e&&(e.contains(t)||e.appendChild(t));}ds(){this.mr.value?.replaceChildren();}render(){return v`<div class="uc-fader-preview-host" ${I(this.nl)}></div><div class="uc-fader-layers-host" ${I(this.mr)}></div>`}};var tl="important",dd=" !"+tl,Se=ft(class extends Tt{constructor(o){if(super(o),o.type!==Rt.ATTRIBUTE||o.name!=="style"||o.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((i,t)=>{let e=o[t];return e==null?i:i+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${e};`},"")}update(o,[i]){let{style:t}=o.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(i)),this.render(i);for(let e of this.ft)i[e]==null&&(this.ft.delete(e),e.includes("-")?t.removeProperty(e):t[e]=null);for(let e in i){let r=i[e];if(r!=null){this.ft.add(e);let s=typeof r=="string"&&r.endsWith(dd);e.includes("-")||s?t.setProperty(e,s?r.slice(0,-11):r,s?tl:""):t[e]=r;}}return it}});var Ft=class extends C{constructor(){super();this.ps=0;this.Ue=S();this.hl=S();this.fl=S();this.disabled=false;this.min=0;this.max=100;this.defaultValue=0;this.zero=0;this.$e=0;this.Sd=t=>{t.stopPropagation();let e=this.ml(t);e!==null&&(this.hs(e),this.Cd("slider-input",e));};this.Ad=t=>{t.stopPropagation();let e=this.ml(t);e!==null&&this.hs(e);};this.gl=()=>{this.style.setProperty("--color-effect","var(--hover-color-rgb)");};this.vl=()=>{this.style.setProperty("--color-effect","var(--idle-color-rgb)");};this.setAttribute("with-effects","");}Cd(t,e){this.dispatchEvent(new CustomEvent(t,{detail:{value:e},bubbles:true,composed:true}));}firstUpdated(t){super.firstUpdated(t),this.ps=Number.parseInt(window.getComputedStyle(this).getPropertyValue("--l-thumb-size"),10)||0,this.yl(this.$e),this.fs(),this.s=new ResizeObserver(()=>{this.fs(),this.gr(this.$e);}),this.s.observe(this);let e=this.Ue.value;e?.addEventListener("focus",this.gl),e?.addEventListener("blur",this.vl),window.setTimeout(()=>{this.gr(this.$e);},0);}willUpdate(t){super.willUpdate(t),t.has("defaultValue")&&this.defaultValue!==this.$e&&this.hs(this.defaultValue),(t.has("min")||t.has("max"))&&this.hasUpdated&&(this.fs(),this.gr(this.$e)),t.has("zero")&&this.hasUpdated&&this.bl(this.$e);}gr(t){this.bl(t);let e=this.max-this.min;if(e===0)return;let{width:r}=this.getBoundingClientRect(),a=100/e*(t-this.min)*(r-this.ps)/100;window.requestAnimationFrame(()=>{let l=this.hl.value;l&&(l.style.transform=`translateX(${a}px)`);});}bl(t){if(!this.gi)return;let e=this.max-this.min;if(e===0)return;this.gi.style.opacity=t===this.zero?"0":"1";let{width:r}=this.getBoundingClientRect(),a=100/e*(this.zero-this.min)*(r-this.ps)/100;window.requestAnimationFrame(()=>{this.gi&&(this.gi.style.transform=`translateX(${a}px)`);});}fs(){let e=this.fl.value;if(!e)return;let{width:r}=e.getBoundingClientRect(),s=Math.ceil(r/2),n=Math.ceil(s/15)-2;if(this.pl===n)return;let a=document.createDocumentFragment(),l=document.createElement("div"),c=document.createElement("div");l.className="uc-minor-step",c.className="uc-border-step",a.appendChild(c);for(let u=0;u<n;u+=1)a.appendChild(l.cloneNode());a.appendChild(c.cloneNode());for(let u=0;u<n;u+=1)a.appendChild(l.cloneNode());a.appendChild(c.cloneNode());let d=document.createElement("div");d.className="uc-zero-dot",a.appendChild(d),this.gi=d,e.innerHTML="",e.appendChild(a),this.pl=n;}disconnectedCallback(){super.disconnectedCallback();let t=this.Ue.value;t?.removeEventListener("focus",this.gl),t?.removeEventListener("blur",this.vl),this.s?.disconnect(),this.s=void 0;}hs(t){Number.isFinite(t)&&(this.$e=t,this.hasUpdated&&(this.yl(t),this.gr(t)));}yl(t){let e=this.Ue.value;e&&(e.value=String(t));}ml(t){let e=t.currentTarget;if(!e)return null;let r=Number.parseInt(e.value,10);return Number.isFinite(r)?r:null}render(){return v`<div class="uc-steps" ${I(this.fl)}></div><div class="uc-thumb" ${I(this.hl)}></div><input class="uc-input" type="range" ${I(this.Ue)} .min=${String(this.min)} .max=${String(this.max)} .value=${String(this.$e)} ?disabled=${this.disabled} @input=${this.Sd} @change=${this.Ad} />`}};p([y({type:Boolean,reflect:true})],Ft.prototype,"disabled",2),p([y({type:Number})],Ft.prototype,"min",2),p([y({type:Number})],Ft.prototype,"max",2),p([y({type:Number,attribute:false})],Ft.prototype,"defaultValue",2),p([y({type:Number})],Ft.prototype,"zero",2),p([m()],Ft.prototype,"$e",2);var Vt="original",Ui=class extends C{constructor(){super(...arguments);this.state={operation:"filter",filter:void 0,originalUrl:"",disabled:false,min:0,max:100,value:0,defaultValue:0,zero:0};this.ms=t=>{let{value:e}=t.detail;this.$["*faderEl"]?.set(e),this.state={...this.state,value:e};};}setOperation(t,e){this.state={...this.state,operation:t,filter:e},this.kd();let r=this.$["*faderEl"],s=this.state.originalUrl||this.$["*originalUrl"];r&&s&&r.activate({url:s,operation:this.state.operation,value:this.state.filter===Vt?void 0:this.state.value,filter:this.state.filter===Vt?void 0:this.state.filter,fromViewer:false});}kd(){let t=this.state.operation,{range:e,zero:r}=kt[t],[s,n]=e;this.state={...this.state,min:s,max:n,zero:r};let l=this.$["*editorTransformations"][t];if(t==="filter"){let d=Number(n),u=l;if(u){let{name:h,amount:f}=u;d=h===this.state.filter?f:n;}this.state={...this.state,value:d,defaultValue:d};return}let c=typeof l<"u"?l:r;this.state={...this.state,value:c,defaultValue:c};}apply(){let e={...this.$["*editorTransformations"]};this.state.operation==="filter"?!this.state.filter||this.state.filter===Vt?delete e.filter:e.filter={name:this.state.filter,amount:this.state.value}:e[this.state.operation]=this.state.value,this.$["*editorTransformations"]=e;}cancel(){this.$["*faderEl"]?.deactivate({hide:false});}initCallback(){super.initCallback(),this.sub("*originalUrl",t=>{t&&(this.state={...this.state,originalUrl:t});});}updated(t){if(super.updated(t),t.has("state")){let e=`${this.state.filter??this.state.operation} ${this.state.value}`;this.$["*operationTooltip"]=e;}}render(){return v`<uc-slider-ui .disabled=${this.state.disabled} .min=${this.state.min} .max=${this.state.max} .defaultValue=${this.state.defaultValue} .zero=${this.state.zero} @slider-input=${this.ms} ></uc-slider-ui>`}};p([m()],Ui.prototype,"state",2);function ei(o){if(!o)return null;let i=o.match(/^([A-Za-z]+)\s+(\d+)$/);if(!i)return null;let[,t,e]=i;return !t||typeof e>"u"?null:{filter:t,value:Number(e)}}var at=class extends C{constructor(){super(...arguments);this.active=false;this.title="";this.icon="";this.titleProp="";}get buttonClasses(){let t=this.active;return {"uc-active":t,"uc-not_active":!t}}wl(){let t=this.buttonClasses;for(let[e,r]of Object.entries(t))this.classList.toggle(e,r);}onClick(t){}connectedCallback(){super.connectedCallback(),this.wl();}updated(t){super.updated(t),t.has("active")&&this.wl();}render(){let t=this.onClick,e=this.title;return v`<button role="option" type="button" aria-label=${q(this.titleProp)} title=${q(this.titleProp)} @click=${t} ><uc-icon name=${this.icon}></uc-icon><div class="uc-title" ?hidden=${!e}>${e}</div></button>`}};p([m()],at.prototype,"active",2),p([m()],at.prototype,"title",2),p([m()],at.prototype,"icon",2),p([m()],at.prototype,"titleProp",2);var Jr=12,to=16,pd=o=>{let i=12,t=12;return o.width/o.height>=1?(i=Jr,t=Math.round(Jr*o.height/o.width)):(t=Jr,i=Math.round(Jr*o.width/o.height)),{width:i,height:t}},eo=class extends at{initCallback(){super.initCallback(),this.icon="arrow-dropdown",this.sub("*currentAspectRatio",i=>{let t=this.Md(i);this.title=t,this.titleProp=t;});}onClick(){this.$["*showListAspectRatio"]=true;}Md(i){return i?i.hasFreeform?this.l10n("freeform-crop"):this.l10n("crop-to-shape",{value:`${i.width}:${i.height}`}):""}render(){let i=this.onClick,t=this.title;return v`<button role="option" type="button" class=${le(this.buttonClasses)} aria-label=${q(this.titleProp)} title=${q(this.titleProp)} @click=${i} ><div class="uc-title" ?hidden=${!t}>${t}</div><uc-icon name=${this.icon}></uc-icon></button>`}},Ri=class extends at{constructor(){super(...arguments);this.X=null;}get aspectRatio(){return this.X}set aspectRatio(t){if(this.X===t)return;let e=this.X;this.X=t,this.requestUpdate("aspectRatio",e),t?this.Tl(t):(this.removeAttribute("uc-aspect-ratio-freeform"),this.title="",this.titleProp="");}initCallback(){super.initCallback(),this.X&&this.Tl(this.X),this.sub("*currentAspectRatio",t=>{this.active=t&&t.id===this.X?.id||t?.width===this.X?.width&&t?.height===this.X?.height;});}onClick(){this.$["*currentAspectRatio"]?.id!==this.X?.id&&(this.$["*currentAspectRatio"]=this.X);}Tl(t){if(!this.isConnected)return;let e=!!t.hasFreeform;this.toggleAttribute("uc-aspect-ratio-freeform",e);let r=()=>{let n=e?this.l10n("custom"):`${t.width}:${t.height}`;return this.title=n,n},s=()=>{let n=this.l10n("a11y-cloud-editor-apply-aspect-ratio",{name:e?this.l10n("custom").toLowerCase():this.l10n("crop-to-shape",{value:`${t.width}:${t.height}`}).toLowerCase(),value:""});return this.titleProp=n,n};r(),s(),e||this.requestUpdate();}Id(){let t=this.X;if(!t||t.hasFreeform)return v`<uc-icon name=${this.icon}></uc-icon>`;let{width:e,height:r}=pd(t),s=(to-e)/2,n=(to-r)/2;return v`<uc-icon><svg viewBox="0 0 ${to} ${to}" aria-hidden="true" focusable="false" ><rect x=${s} y=${n} width=${e} height=${r} rx="2" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linejoin="round" ></rect></svg></uc-icon>`}render(){let t=this.onClick,e=this.title;return v`<button role="option" type="button" class=${le(this.buttonClasses)} aria-label=${q(this.titleProp)} title=${q(this.titleProp)} @click=${t} >${this.Id()}<div class="uc-title" ?hidden=${!e}>${e}</div></button>`}};p([y({attribute:false})],Ri.prototype,"aspectRatio",1);function hd(o){let i=o+90;return i=i>=360?0:i,i}function fd(o,i){if(o==="rotate")return hd(typeof i=="number"?i:0);if(o==="mirror"||o==="flip")return !i;throw new Error(`Unsupported operation: ${o}`)}var $i=class extends at{constructor(){super(...arguments);this.operation=void 0;}willUpdate(t){super.willUpdate(t),this.operation?(this.titleProp=this.l10n("a11y-cloud-editor-apply-crop",{name:this.l10n(this.operation).toLowerCase()}),this.icon=this.operation):(this.icon="",this.titleProp="");}onClick(t){if(!this.operation)return;let e=this.$["*cropperEl"],r=e.getValue(this.operation),s=fd(this.operation,r);this.telemetryManager.sendEventCloudImageEditor(t,this.$["*tabId"],{operation:this.operation,next:s,prev:r}),e.setValue(this.operation,s);}};p([y({type:String})],$i.prototype,"operation",2);var Zt=class extends at{constructor(){super(...arguments);this.n="";this.g="";this.vi="";this.vr=0;this.a=null;this.Ft=false;this.isOriginal=false;this.xl=20;}get filter(){return this.g}set filter(t){let e=t??"";if(this.g===e)return;let r=this.g;this.g=e,this.n="filter",this.isOriginal=e===Vt,this.icon=this.isOriginal?"original":"slider",this.xl=this.isOriginal?40:20,this.requestUpdate("filter",r),this.isConnected&&this.El(e);}onClick(t){if(this.active)this.isOriginal||(this.$["*sliderEl"].setOperation(this.n,this.g),this.$["*showSlider"]=true);else {let e=this.$["*sliderEl"];e.setOperation(this.n,this.g),e.apply();}this.telemetryManager.sendEventCloudImageEditor(t,this.$["*tabId"],{operation:ei(this.$["*operationTooltip"])}),this.$["*currentFilter"]=this.g;}Od(){let t=parseInt(window.getComputedStyle(this).getPropertyValue("--l-base-min-width"),10),e=Number.isFinite(t)&&t>0?t:this.xl||32,r=window.devicePixelRatio,s=Math.ceil(r*e),n=r>=2?"lightest":"normal",a=100,l={...this.$["*editorTransformations"]};return l[this.n]=this.g!==Vt?{name:this.g,amount:a}:void 0,W(this.vi,rt(nr,Jt(l),`quality/${n}`,`scale_crop/${s}x${s}/center`,`@clib/${Pt}/${Ut}/uc-cloud-image-editor/`))}async ni(t,e){t[0]?.isIntersecting?await this.gs(e):this.b?.();}initCallback(){super.initCallback(),this.s=new window.IntersectionObserver(this.ni.bind(this),{threshold:[0,1]});let t=this.$["*originalUrl"];this.vi=t??"",this.sub("*originalUrl",e=>{this.vi=e??"",!this.isOriginal&&this.vi&&this.isConnected&&!this.a&&(this.s?.observe(this),this.tt());}),this.isOriginal||(this.s?.observe(this),this.tt()),this.g&&this.El(this.g),this.sub("*currentFilter",e=>{this.active=!!(e&&e===this.g);}),this.sub("*networkProblems",async e=>{e||(this.a?await this.gs():this.tt());});}disconnectedCallback(){super.disconnectedCallback(),this.s?.disconnect(),this.b?.(),this.yr();}updated(t){super.updated(t),t.has("isOriginal")&&(this.isOriginal?this.s?.unobserve(this):(this.s?.observe(this),this.tt()));}El(t){if(!t){this.titleProp="";return}let e=this.l10n("a11y-cloud-editor-apply-filter",{name:t.toLowerCase()});this.titleProp=e;}async gs(t){if(!this.isConnected){t?.unobserve(this),this.b?.(),this.b=void 0;return}if(!this.vi){!this.Dt&&!this.De&&this.tt();return}let e=++this.vr,r="";try{r=await this.proxyUrl(this.Od());}catch(a){this.$["*networkProblems"]=true,console.error("Failed to resolve preview URL",{error:a});return}this.Ft=false,this.b?.();let{promise:s,cancel:n}=Ee(r);this.b=()=>{n(),this.vr===e&&(this.b=void 0);};try{if(await s,this.vr!==e||!this.isConnected)return;this.a=r,this.Ft=!0,this.yr(),(t??this.s)?.unobserve(this);}catch(a){this.$["*networkProblems"]=true,console.error("Failed to load image",{error:a}),this.tt();}finally{this.vr===e&&(this.b=void 0);}}tt(){if(!this.isConnected||this.a||this.Ft||this.isOriginal||this.$["*networkProblems"]){this.yr();return}this.De&&cancelAnimationFrame(this.De),this.De=requestAnimationFrame(()=>{if(this.De=void 0,!this.isConnected||this.a||this.Ft||this.isOriginal){this.yr();return}let t=this.getBoundingClientRect(),e=t.width>0&&t.height>0,r=window.innerWidth||document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight;if(e&&t.bottom>0&&t.right>0&&t.top<s&&t.left<r){this.gs();return}this.Dt=window.setTimeout(()=>{this.Dt=void 0,this.tt();},500);});}yr(){this.De&&(cancelAnimationFrame(this.De),this.De=void 0),this.Dt&&(window.clearTimeout(this.Dt),this.Dt=void 0);}get Pd(){return !!(this.Ft&&!this.active&&!this.isOriginal)}render(){let t=this.onClick,e={opacity:this.Pd?"1":"0"};this.a&&(e.backgroundImage=`url(${this.a})`);let r={opacity:this.active||this.isOriginal?"1":"0"};return v`<button role="option" type="button" class=${le(this.buttonClasses)} aria-label=${q(this.titleProp)} title=${q(this.titleProp)} @click=${t} ><div class="uc-preview" ?data-loaded=${this.Ft} style=${Se(e)}></div><uc-icon class=${le({"uc-original-icon":this.isOriginal})} name=${this.icon} style=${Se(r)} ></uc-icon></button>`}};p([m()],Zt.prototype,"a",2),p([m()],Zt.prototype,"Ft",2),p([m()],Zt.prototype,"isOriginal",2),p([m()],Zt.prototype,"xl",2),p([y({type:String})],Zt.prototype,"filter",1);var Di=class extends at{constructor(){super(...arguments);this.n="";}get operation(){return this.n}set operation(t){let e=t??"";if(this.n===e)return;let r=this.n;this.n=e,this.requestUpdate("operation",r),this.isConnected&&e&&this.Cl(e);}Cl(t){this.icon=t;let e=()=>{let s=this.l10n("a11y-cloud-editor-apply-tuning",{name:this.l10n(t).toLowerCase()});return this.titleProp=s,s},r=()=>{let s=this.l10n(t);return this.title=s,s};e(),r();}initCallback(){super.initCallback(),this.n&&this.Cl(this.n),this.sub("*editorTransformations",t=>{if(!this.n)return;let{zero:e}=kt[this.n],r=t[this.n],s=typeof r<"u"?r!==e:false;this.active=s;});}onClick(t){this.$["*sliderEl"]?.setOperation(this.n),this.$["*showSlider"]=true,this.$["*currentOperation"]=this.n,this.telemetryManager.sendEventCloudImageEditor(t,this.$["*tabId"],{operation:ei(this.$["*operationTooltip"])});}};p([y({type:String})],Di.prototype,"operation",1);var md=1,el=()=>{},Fi=class extends C{constructor(){super(...arguments);this.hiddenScrollbar=false;this.Sl=t=>{t.preventDefault();let{deltaY:e,deltaX:r}=t;if(Math.abs(r)>md){this.scrollLeft+=r;return}this.scrollLeft+=e;};}connectedCallback(){super.connectedCallback(),this.addEventListener("wheel",this.Sl,{passive:false}),this.addEventListener("scroll",el,{passive:true});}disconnectedCallback(){this.removeEventListener("wheel",this.Sl),this.removeEventListener("scroll",el),super.disconnectedCallback();}};p([y({type:Boolean,noAccessor:true,attribute:"hidden-scrollbar"})],Fi.prototype,"hiddenScrollbar",2);var ut=class extends C{constructor(){super(...arguments);this.yi=false;this.showMainToolbar=true;this.showSubToolbar=false;this.Al=true;this.tabList=[...ot];this.activeTab=B.CROP;this.br=true;this.vs=false;this.kl=null;this.Ml=0;this.Il=0;this.wr=S();this.Ol=S();this.tabToggleRefs={[B.CROP]:S(),[B.TUNING]:S(),[B.FILTERS]:S()};this.Pl=()=>{this.ot();};this.bi=[];this.Tr=$(t=>{this.yi=t;},500);this.xr=$(()=>{let t=this.$["*editorTransformations"],e=this.$["*currentOperation"],r="",s=false;if(this.$["*tabId"]===B.FILTERS)if(s=true,this.$["*currentFilter"]&&t?.filter?.name===this.$["*currentFilter"]){let n=t?.filter?.amount||100;r=`${this.$["*currentFilter"]} ${n}`;}else r=this.l10n(Vt);else if(this.showSubToolbar&&this.$["*tabId"]===B.TUNING&&e){s=true;let n=t?.[e]||kt[e].zero;r=`${this.l10n(e)} ${n}`;}s&&(this.$["*operationTooltip"]=r),this.vs=s;},0);this.Ld={hidden:"uc-sub-toolbar--top-hidden",visible:"uc-sub-toolbar--visible"};this.Rd={hidden:"uc-sub-toolbar--bottom-hidden",visible:"uc-sub-toolbar--visible"};this.Ud={hidden:"uc-tab-toggle--hidden",visible:"uc-tab-toggle--visible"};this.$d={hidden:"uc-tab-toggles--hidden",visible:"uc-tab-toggles--visible"};this.init$={...this.init$,"*sliderEl":null,"*showSlider":false,"*showListAspectRatio":false,"*currentFilter":Vt,"*currentOperation":null,"*operationTooltip":null};this.xe=t=>{this.telemetryManager.sendEventCloudImageEditor(t,this.$["*tabId"],{action:"cancel"}),this.b?.();let e=this.$["*on.cancel"];e?.();};this.xs=t=>{this.telemetryManager.sendEventCloudImageEditor(t,this.$["*tabId"],{action:"apply"});let e=this.$["*on.apply"];e?.(this.$["*editorTransformations"]);};this.Gd=t=>{this.telemetryManager.sendEventCloudImageEditor(t,this.$["*tabId"],{action:"apply-slider",operation:ei(this.$["*operationTooltip"])}),this.wr.value?.apply(),this.Ll();};this.qd=t=>{this.telemetryManager.sendEventCloudImageEditor(t,this.$["*tabId"],{action:"cancel-slider"}),this.wr.value?.cancel(),this.Ll();};this.Wd=t=>{let r=t.currentTarget?.getAttribute("data-id");r&&(this.telemetryManager.sendEventCloudImageEditor(t,r),this.ys(r,{fromViewer:false}));};}Ll(){this.$["*showSlider"]=false,this.$["*tabId"]===B.CROP&&(this.$["*showListAspectRatio"]=false),this.$["*tabId"]===B.TUNING&&(this.vs=false);}ys(t,{fromViewer:e=false,force:r=false}={}){this.$["*tabId"]!==t&&(this.$["*tabId"]=t),this.Rl(t,{fromViewer:e,force:r});}Rl(t,{fromViewer:e,force:r=false}){if(!r&&this.activeTab===t){this.ot();return}this.activeTab=t;let s=this.$["*faderEl"],n=this.$["*cropperEl"];t===B.CROP?(s?.deactivate(),this.$["*imageSize"]&&n?.activate(this.$["*imageSize"],{fromViewer:e})):(s?.activate({url:this.$["*originalUrl"],fromViewer:e}),n?.deactivate());for(let a of ot){let l=a===t,d=this.tabToggleRefs[a]?.value;d&&(d.active=l),l&&this.ot();}}ot(){let e=this.tabToggleRefs[this.activeTab]?.value,r=this.Ol.value;if(!e||!r)return;let s=e.offsetLeft,n=e.offsetWidth||Number(getComputedStyle(e).width.replace("px",""));(this.Ml!==s||this.Il!==n)&&(this.Ml=s,this.Il=n,r.style.transform=`translateX(${s}px)`,r.style.width=`${n}px`);}get bs(){return this.bi.length>=3}Dd(t){switch(t){case B.CROP:return this.Fd();case B.FILTERS:return this.Nd();case B.TUNING:return this.Vd();default:return []}}Fd(){let t=[];if(this.bs)t.push(()=>this._d());else for(let e of this.bi)t.push(()=>this.Ul(e));for(let e of yn)t.push(()=>this.Bd(e));return this.Ts(t)}Nd(){let e=[Vt,...vn].map(r=>()=>this.zd(r));return this.Ts(e)}Vd(){let t=gn.map(e=>()=>this.Hd(e));return this.Ts(t)}Ts(t){return t.length?t.map(r=>r()):[]}_d(){return v`<uc-editor-freeform-button-control></uc-editor-freeform-button-control>`}Ul(t){return v`<uc-editor-aspect-ratio-button-control .aspectRatio=${t}></uc-editor-aspect-ratio-button-control>`}Bd(t){return v`<uc-editor-crop-button-control .operation=${t}></uc-editor-crop-button-control>`}zd(t){return v`<uc-editor-filter-control .filter=${t}></uc-editor-filter-control>`}Hd(t){return v`<uc-editor-operation-control .operation=${t}></uc-editor-operation-control>`}Kd(){return this.bs?this.bi.map(t=>this.Ul(t)):[]}async jd(){if(this.$["*imgContainerEl"]&&this.$["*originalUrl"]){let t=this.$["*imgContainerEl"].offsetWidth,e=await this.proxyUrl(ti(this.$["*originalUrl"],t,this.$["*editorTransformations"]));this.b?.();let{cancel:r}=Si([e]);this.b=()=>{r(),this.b=void 0;};}}initCallback(){super.initCallback();let t=this.$["*cropPresetList"]??[];this.bi=[...t],this.sub("*cropPresetList",e=>{this.bi=[...e??[]];}),this.sub("*imageSize",e=>{e&&setTimeout(()=>{this.ys(this.$["*tabId"],{fromViewer:true});},0);}),this.sub("*editorTransformations",e=>{let r=e?.filter?.name;this.$["*currentFilter"]!==r&&(this.$["*currentFilter"]=r??"");}),this.sub("*currentFilter",()=>{this.xr();}),this.sub("*currentOperation",()=>{this.xr();}),this.sub("*tabId",e=>{this.Rl(e,{fromViewer:false,force:true}),this.xr();}),this.sub("*originalUrl",()=>{this.$["*faderEl"]?.deactivate();}),this.sub("*editorTransformations",e=>{this.jd(),this.$["*faderEl"]?.setTransformations(e);}),this.sub("*loadingOperations",e=>{let r=false;for(let[,s]of e.entries()){if(r)break;for(let[,n]of s.entries())if(n){r=true;break}}this.Tr(r);}),this.sub("*showSlider",e=>{e?(this.showSubToolbar=true,this.showMainToolbar=false,this.br=true):this.$["*showListAspectRatio"]||(this.showSubToolbar=false,this.showMainToolbar=true);}),this.sub("*showListAspectRatio",e=>{e?(this.showSubToolbar=true,this.showMainToolbar=false,this.br=false):this.$["*showSlider"]||(this.showSubToolbar=false,this.showMainToolbar=true);}),this.sub("*tabList",e=>{if(this.tabList=e,this.Al=e.length>1,!e.includes(this.$["*tabId"])&&e.length>0){let[r]=e;r&&this.ys(r,{fromViewer:false});return}this.ot();}),this.sub("*operationTooltip",e=>{this.kl=e;}),this.xr();}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.Pl);}firstUpdated(t){super.firstUpdated(t),this.Er(),this.ot();}updated(t){super.updated(t),(t.has("activeTab")||t.has("tabList"))&&this.updateComplete.then(()=>this.ot()),(t.has("showSubToolbar")||t.has("showMainToolbar"))&&this.Er();}disconnectedCallback(){window.removeEventListener("resize",this.Pl),super.disconnectedCallback(),this.$["*showSlider"]=false,this.$["*showListAspectRatio"]=false;}Er(){let t=this.wr.value;t&&(this.$["*sliderEl"]=t);}Zd(t){let e=this.tabList.includes(t),r=this.activeTab===t,s=this.tabList.indexOf(t),n=s>=0?Se({gridColumn:`${s+1}`}):U;return v`<uc-presence-toggle class="uc-tab-toggle" .visible=${e} .styles=${this.Ud}><uc-btn-ui theme="tab" data-id=${t} icon=${t} role="tab" aria-controls=${`tab_${t}`} aria-selected=${r?"true":"false"} title-prop=${`a11y-editor-tab-${t}`} .active=${r} style=${n} @click=${this.Wd} ${I(this.tabToggleRefs[t])} ></uc-btn-ui></uc-presence-toggle>`}Yd(t){let e=this.Dd(t);return v`<div id=${`tab_${t}`} class="uc-tab-content" ><uc-editor-scroller hidden-scrollbar><div class="uc-controls-list_align"><div role="listbox" aria-orientation="horizontal" class="uc-controls-list_inner">${e.length?e:U}</div></div></uc-editor-scroller></div>`}render(){let t=["uc-info-tooltip",this.vs?"uc-info-tooltip_visible":"uc-info-tooltip_hidden"].join(" "),e=this.bs;return v`<uc-line-loader-ui .active=${this.yi}></uc-line-loader-ui><div class="uc-info-tooltip_container"><div class="uc-info-tooltip_wrapper"><div class=${t}>${this.kl??""}</div></div></div><div class="uc-toolbar-container"><uc-presence-toggle role="tablist" class="uc-sub-toolbar" .visible=${this.showMainToolbar} .styles=${this.Ld} ><div class="uc-tab-content-row">${ot.map(r=>Ii(this.activeTab===r,()=>this.Yd(r)))}</div><div class="uc-controls-row"><uc-presence-toggle class="uc-tab-toggles" .visible=${this.Al} .styles=${this.$d} @initial-render=${()=>this.ot()} ><div class="uc-tab-toggles_indicator" ${I(this.Ol)} ></div>${ot.map(r=>this.Zd(r))}</uc-presence-toggle><uc-btn-ui style="order: -1" theme="secondary-icon" icon="closeMax" title-prop="cancel" @click=${this.xe} ></uc-btn-ui><uc-btn-ui theme="primary-icon" icon="done" title-prop="apply" @click=${this.xs}></uc-btn-ui></div></uc-presence-toggle><uc-presence-toggle class="uc-sub-toolbar" .visible=${this.showSubToolbar} .styles=${this.Rd}><div class="uc-slider" ?hidden=${!this.br}><uc-editor-slider ${I(this.wr)}></uc-editor-slider></div><div class="uc-list-aspect-ratio-container" ?hidden=${this.br||!e}>${e?v`<div class="uc-list-aspect-ratio">${this.Kd()}</div>`:U}</div><div class="uc-controls-row"><uc-btn-ui theme="secondary" @click=${this.qd} text=${this.l10n("cancel")}></uc-btn-ui><uc-btn-ui theme="primary" @click=${this.Gd} text=${this.l10n("apply")}></uc-btn-ui></div></uc-presence-toggle></div>`}};p([m()],ut.prototype,"yi",2),p([m()],ut.prototype,"showMainToolbar",2),p([m()],ut.prototype,"showSubToolbar",2),p([m()],ut.prototype,"Al",2),p([m()],ut.prototype,"tabList",2),p([m()],ut.prototype,"activeTab",2),p([m()],ut.prototype,"br",2),p([m()],ut.prototype,"vs",2),p([m()],ut.prototype,"kl",2),p([m()],ut.prototype,"bi",2);var il=Bt([...ot]),et=class extends C{constructor(){super(...arguments);this.ctxOwner=true;this.Xd="";this.et=It;this.Qd="";this.yi=false;this.uuid=null;this.cdnUrl=null;this.cropPreset="";this.tabs=il;this.$l=false;this.ke=false;this.Es=null;this.wi=null;this.Tr=$(t=>{this.yi=t;},300);this.Cr=S();this.Dl=S();this.Fl=S();this.Nl=S();this.Vl=()=>{this.Tr(false),this.et!==It&&(this.$["*networkProblems"]=false);};this._l=()=>{this.Tr(false),this.$["*networkProblems"]=true;};this.Jd=()=>{let t=this.$["*on.retryNetwork"];t?.();};this.init$={...this.init$,...Ya(this)};}static{this.styleAttrs=["uc-cloud-image-editor"];}ep(){this.ke||this.Es||(this.Es=this.updateComplete.then(()=>{this.Es=null,this.ke=true;}));}initCallback(){super.initCallback(),this.Bl(),this.zl();}Er(){let t=this.Fl.value;t&&(this.$["*faderEl"]=t);let e=this.Dl.value;e&&(this.$["*cropperEl"]=e);let r=this.Nl.value;r&&(this.$["*imgContainerEl"]=r);let s=this.Cr.value;s&&(this.$["*imgEl"]=s);}tp(){let t=this.Cr.value;t&&(t.addEventListener("load",this.Vl),t.addEventListener("error",this._l));}ip(){let t=this.Cr.value;t&&(t.removeEventListener("load",this.Vl),t.removeEventListener("error",this._l));}get rp(){let t=this.$["*tabId"];return vt("uc-image",{"uc-image_hidden_to_cropper":t===B.CROP,"uc-image_hidden_effects":t!==B.CROP})}Hl(){if(this.wi)return this.wi;let t=3e3;return this.wi=new Promise((e,r)=>{let s=()=>{window.clearTimeout(d),c.disconnect(),this.wi=null;},n=()=>{let{width:u,height:h}=this.getBoundingClientRect();return u>0&&h>0},a=()=>{s(),window.setTimeout(()=>e(),0);},l=()=>{let u=new Error("[cloud-image-editor] timeout waiting for non-zero container size");s(),this.isConnected&&console.error(u.message),r(u);},c=new ResizeObserver(u=>{let[h]=u;h&&h.contentRect.width>0&&h.contentRect.height>0&&a();}),d=window.setTimeout(()=>{l();},t);if(n()){a();return}c.observe(this);}),this.wi}firstUpdated(t){super.firstUpdated(t),this.Er(),this.tp(),this.initEditor();let e=!!(this.uuid||this.cdnUrl),r=t.has("uuid")||t.has("cdnUrl");e&&!r&&this.updateImage();}disconnectedCallback(){this.ip(),super.disconnectedCallback();}render(){let t=this.Qd??"",e=this.Xd??"",r=this.et||It,s=this.yi,n=this.$l;return v` ${De(Xa)}<div class="uc-wrapper uc-wrapper_desktop"><uc-presence-toggle class="uc-network_problems_splash" .visible=${n}><div class="uc-network_problems_content"><div class="uc-network_problems_icon"><uc-icon name="sad"></uc-icon></div><div class="uc-network_problems_text">Network error</div></div><div class="uc-network_problems_footer"><uc-btn-ui theme="primary" text="Retry" @click=${this.Jd}></uc-btn-ui></div></uc-presence-toggle><div class="uc-viewport"><div class="uc-file_type_outer"><div class="uc-file_type">${t}</div></div><div class="uc-image_container" ${I(this.Nl)}><img src=${r} class=${this.rp} ${I(this.Cr)} />${Ii(this.ke,()=>v`<uc-editor-image-cropper ${I(this.Dl)}></uc-editor-image-cropper>`)}<uc-editor-image-fader ${I(this.Fl)}></uc-editor-image-fader></div><div class="uc-info_pan">${e}</div></div><div class="uc-toolbar"><uc-line-loader-ui .active=${s}></uc-line-loader-ui><div class="uc-toolbar_content uc-toolbar_content__editor">${Ii(this.ke,()=>v`<uc-editor-toolbar></uc-editor-toolbar>`)}</div></div></div>`}updated(t){super.updated(t),t.has("uuid")&&this.uuid&&this.updateImage(),t.has("cdnUrl")&&this.cdnUrl&&this.updateImage(),t.has("tabs")&&this.Bl(),(t.has("cropPreset")||t.has("cdnUrl"))&&this.zl();}Bl(){let t=this.tabs||il;this.$["*tabList"]=Za(t);}zl(){let t=Nr(this.cropPreset??""),e=null;if(this.cdnUrl){let r=ko(this.cdnUrl),s=Mo(r);if(Array.isArray(s?.crop?.dimensions)){let[n,a]=s.crop.dimensions;e=ga(n,a,t,.1);}}this.$["*cropPresetList"]=t,this.$["*currentAspectRatio"]=e??t?.[0]??null;}async updateImage(){if(this.isConnected){try{await this.Hl();}catch{return}if(this.isConnected){if(this.cdnUrl){let t=this.cdnUrl,e=sr(t),r=Qt(t,e);if(r===this.$["*originalUrl"])return;this.$["*originalUrl"]=r;let s=ko(t),n=Mo(s);this.$["*editorTransformations"]=n;}else if(this.uuid){let t=Qt(this.cfg.cdnCname,this.uuid);if(t===this.$["*originalUrl"])return;this.$["*originalUrl"]=t,Object.keys(this.$["*editorTransformations"]).length>0&&(this.$["*editorTransformations"]={});}else throw new Error("No UUID nor CDN URL provided");this.$["*tabId"]===B.CROP?this.$["*cropperEl"]?.deactivate({reset:true}):this.$["*faderEl"]?.deactivate();try{let t=this.$["*originalUrl"],e=await this.proxyUrl(W(t,rt("json"))),r=await fetch(e).then(a=>a.json()),{width:s,height:n}=r;this.$["*imageSize"]={width:s,height:n},this.$["*tabId"]===B.CROP?this.$["*cropperEl"]?.activate(this.$["*imageSize"]):this.$["*faderEl"]?.activate({url:t});}catch(t){t&&(this.telemetryManager.sendEventError(t,"cloud editor image. Failed to load image info"),console.error("Failed to load image info",t));}this.ep();}}}async initEditor(){try{await this.Hl();}catch{return}this.classList.add("uc-editor_ON"),this.sub("*networkProblems",t=>{let e=!!t;this.$l=e;}),this.sub("*editorTransformations",t=>{if(Object.keys(t).length===0)return;let e=this.$["*originalUrl"],r=rt(Jt(t),"preview"),s=W(e,r),n={originalUrl:e,cdnUrlModifiers:r,cdnUrl:s,transformations:t};this.dispatchEvent(new CustomEvent("change",{detail:n,bubbles:true,composed:true}));},false);}};p([m()],et.prototype,"Xd",2),p([m()],et.prototype,"et",2),p([m()],et.prototype,"Qd",2),p([m()],et.prototype,"yi",2),p([y({type:String,reflect:true})],et.prototype,"uuid",2),p([y({type:String,attribute:"cdn-url",reflect:true})],et.prototype,"cdnUrl",2),p([y({type:String,attribute:"crop-preset",reflect:true})],et.prototype,"cropPreset",2),p([y({type:String,reflect:true})],et.prototype,"tabs",2),p([m()],et.prototype,"$l",2),p([m()],et.prototype,"ke",2);var Ls={};Ds(Ls,{CloudImageEditorActivity:()=>Vi});var io=class extends et{static{this.styleAttrs=[...super.styleAttrs,"uc-wgt-common"];}constructor(){super(),this.init$={...this.init$,"*solution":this.tagName};}initCallback(){super.initCallback(),this.telemetryManager.sendEvent({eventType:D.INIT_SOLUTION}),this.a11y?.registerBlock(this);}};var Vi=class extends R{constructor(){super(...arguments);this.Q=null;}get activityParams(){let t=super.activityParams;if("internalId"in t)return t;throw new Error("Cloud Image Editor activity params not found")}initCallback(){super.initCallback(),this.subConfigValue("cropPreset",t=>{this.Q&&this.Q.cropPreset!==t&&(this.Q={...this.Q,cropPreset:t});}),this.subConfigValue("cloudImageEditorTabs",t=>{this.Q&&this.Q.tabs!==t&&(this.Q={...this.Q,tabs:t});}),this.op();}disconnectedCallback(){super.disconnectedCallback(),this.sp();}xs(t){if(!this.Ti)return;this.debugPrint('editor event "apply"',t.detail);let e=t.detail;this.Ti.setMultipleValues({cdnUrl:e.cdnUrl,cdnUrlModifiers:e.cdnUrlModifiers}),this.modalManager?.close(x.activities.CLOUD_IMG_EDIT),this.historyBack();}xe(t){let e=t instanceof CustomEvent?t.detail:void 0;this.debugPrint('editor event "cancel"',e),this.modalManager?.close(x.activities.CLOUD_IMG_EDIT),this.historyBack();}handleChange(t){this.debugPrint('editor event "change"',t.detail);}op(){let{internalId:t}=this.activityParams,e=this.uploadCollection.read(t);if(!e)throw new Error(`Entry with internalId "${t}" not found`);this.Ti=e;let r=this.Ti.getValue("cdnUrl");if(!r)throw new Error(`Entry with internalId "${t}" hasn't uploaded yet`);this.Q=this.np(r);}sp(){this.Ti=void 0,this.Q=null;}render(){if(!this.Q)return U;let{cdnUrl:t,cropPreset:e,tabs:r}=this.Q;return v`<uc-cloud-image-editor cdn-url=${t} crop-preset=${q(e)} tabs=${q(r)} @apply=${this.xs} @cancel=${this.xe} @change=${this.handleChange} ></uc-cloud-image-editor>`}np(t){return {cdnUrl:t,cropPreset:this.cfg.cropPreset,tabs:this.cfg.cloudImageEditorTabs}}};p([m()],Vi.prototype,"Q",2);var ii=class extends R{constructor(){super(...arguments);this.Kl={importDisabled:true};this.Ue=S();this.ms=t=>{let e=t.target?.value??"";this.Kl={importDisabled:!e};};this._o=t=>{t.preventDefault(),this.telemetryManager.sendEvent({eventType:D.ACTION_EVENT,payload:{metadata:{event:"upload-from-url",node:this.tagName}}});let r=this.Ue.value?.value?.trim();r&&(this.api.addFileFromUrl(r,{source:N.URL}),this.$["*currentActivity"]=x.activities.UPLOAD_LIST,this.modalManager?.open(x.activities.UPLOAD_LIST));};}firstUpdated(){let t=this.Ue.value;t&&(t.value="",t.focus());}render(){return v`<uc-activity-header><button type="button" class="uc-mini-btn" @click=${this.historyBack} title=${this.l10n("back")} aria-label=${this.l10n("back")}><uc-icon name="back"></uc-icon></button><div><uc-icon name="url"></uc-icon><span>${this.l10n("caption-from-url")}</span></div><button type="button" class="uc-mini-btn uc-close-btn" @click=${this.$["*closeModal"]} title=${this.l10n("a11y-activity-header-button-close")} aria-label=${this.l10n("a11y-activity-header-button-close")} ><uc-icon name="close"></uc-icon></button></uc-activity-header><form class="uc-content" @submit=${this._o}><label><input ${I(this.Ue)} placeholder="https://" class="uc-url-input" type="text" @input=${this.ms} /></label><button type="submit" class="uc-url-upload-btn uc-primary-btn" ?disabled=${this.Kl.importDisabled} >${this.l10n("upload-url")}</button></form>`}};p([m()],ii.prototype,"Kl",2);var rl=()=>{let o=globalThis.top??globalThis.parent??globalThis.self;try{return o.location.origin}catch(i){return console.warn("Unable to access top-level window location:",i),globalThis.location.origin}};var gd=o=>o.replace(/[\\-\\[]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),ol=(o,i="i")=>{let t=o.split("*").map(gd);return new RegExp(`^${t.join(".+")}$`,i)};var vd=["--uc-font-family","--uc-font-size","--uc-line-height","--uc-button-size","--uc-preview-size","--uc-input-size","--uc-padding","--uc-radius","--uc-transition","--uc-background","--uc-foreground","--uc-primary","--uc-primary-hover","--uc-primary-transparent","--uc-primary-foreground","--uc-secondary","--uc-secondary-hover","--uc-secondary-foreground","--uc-muted","--uc-muted-foreground","--uc-destructive","--uc-destructive-foreground","--uc-border"],yd=(o,i)=>window.getComputedStyle(o).getPropertyValue(i).trim(),sl=o=>{let i={};for(let t of vd){let e=yd(o,t);e&&(i[t]=e);}return i};var bd=["selected-files-change","toolbar-state-change"],wd=o=>{if(!o||typeof o!="object"||!("type"in o))return false;let i=o.type;return !(typeof i!="string"||!bd.includes(i))},ro=class{constructor(i,t){this.Sr=new Map;this.Gl=i=>{if(i.source!==this.Cs)return;let t=i.data;if(!wd(t))return;let e=this.Sr.get(t.type);if(e)for(let r of e)r(t);};this.Cs=i,this.jl=t,window.addEventListener("message",this.Gl);}on(i,t){let e=this.Sr.get(i)??new Set;this.Sr.has(i)||this.Sr.set(i,e),e.add(t);}send(i){let t=this.jl();this.Cs.postMessage(i,t);}destroy(){window.removeEventListener("message",this.Gl);}};function nl(o){let i=[];for(let[t,e]of Object.entries(o))e==null||typeof e=="string"&&e.length===0||i.push(`${t}=${encodeURIComponent(e)}`);return i.join("&")}var Td={[Ct.GDRIVE]:"ngdrive"},dt=class extends R{constructor(){super(...arguments);this.couldBeCtxOwner=true;this.Nt=S();this.Ar=null;this.Ss=[];this.As=false;this.ks=false;this.Ms=false;this.Is=false;this.kr=false;this.Os=false;this.Ps="uc-hidden";this.ql=true;this.Bo=()=>{for(let t of this.Ss){let e=this.lp(t),{filename:r}=t,{externalSourceType:s}=this.activityParams;this.api.addFileFromUrl(e,{fileName:r,source:s});}this.$["*currentActivity"]=x.activities.UPLOAD_LIST,this.modalManager?.open(x.activities.UPLOAD_LIST);};this.xe=()=>{this.historyBack();};this.fp=()=>{this.ne?.send({type:"select-all"});};this.mp=()=>{this.ne?.send({type:"deselect-all"});};}get ap(){if(!this.Ar)return "";let{selectedCount:t,total:e}=this.Ar;return this.l10n("selected-count",{count:t,total:e})}get activityParams(){let t=super.activityParams;if("externalSourceType"in t)return t;throw new Error("External Source activity params not found")}initCallback(){super.initCallback();let{externalSourceType:t}=this.activityParams;t?this.Wl():console.error('Param "externalSourceType" is required for external source activity'),this.sub("*currentActivityParams",()=>{setTimeout(()=>{this.isConnected&&(this.Zl(),this.Wl());});}),this.subConfigValue("multiple",e=>{this.kr=e;}),this.subConfigValue("localeName",()=>{this.Yl();}),this.subConfigValue("externalSourcesEmbedCss",e=>{this.Xl(e);});}lp(t){if(t.alternatives){let e=Z(this.cfg.externalSourcesPreferredTypes);for(let r of e){let s=ol(r);for(let[n,a]of Object.entries(t.alternatives))if(s.test(n))return a}}return t.url}cp(t){this.ql=t.isVisible;}async up(t){if(this.cfg.multiple!==t.isMultipleMode){console.error("Multiple mode mismatch");return}this.dp(t.selectedCount,t.total),this.Ps=t.isReady?"":"uc-hidden",this.As=t.isReady,this.ks=t.isReady&&t.selectedFiles.length>0,this.kr=t.isMultipleMode&&t.total>0,this.Ms=t.selectedCount<t.total,this.Is=t.selectedCount===t.total,this.Ss=t.selectedFiles??[],this.Os=t.total>0;}Ql(){this.Xl(this.cfg.externalSourcesEmbedCss),this.pp(),this.Yl();}pp(){this.ne?.send({type:"set-theme-definition",theme:sl(this)});}Xl(t){this.ne?.send({type:"set-embed-css",css:t});}Yl(){this.ne?.send({type:"set-locale-definition",localeDefinition:this.cfg.localeName});}hp(){let{pubkey:t,remoteTabSessionKey:e,socialBaseUrl:r,multiple:s}=this.cfg,{externalSourceType:n}=this.activityParams,a=Td[n]??n,c={lang:this.l10n("social-source-lang")?.split("-")?.[0]||"en",public_key:t,images_only:"false",session_key:e,wait_for_theme:true,multiple:s.toString(),origin:this.cfg.topLevelOrigin||rl(),debug:this.cfg.debug},d=new URL(`/window4/${a}`,r);return d.search=nl(c),d.toString()}dp(t,e){this.Ar={selectedCount:t,total:e};}Wl(){let t=document.createElement("iframe");t.src=this.hp(),t.marginHeight=0,t.marginWidth=0,t.frameBorder="0",t.allowTransparency=true,t.addEventListener("load",this.Ql.bind(this)),t.addEventListener("load",this.Ql.bind(this)),this.Nt.value&&(this.Nt.value.innerHTML="",this.Nt.value.appendChild(t)),t.contentWindow&&(this.ne?.destroy(),this.ne=new ro(t.contentWindow,()=>this.cfg.socialBaseUrl),this.ne.on("selected-files-change",this.up.bind(this)),this.ne.on("toolbar-state-change",this.cp.bind(this)),this.Jl());}Zl(){this.ne?.destroy(),this.ne=void 0,this.Nt.value&&(this.Nt.value.innerHTML=""),this.Jl();}Jl(){this.Ss=[],this.As=false,this.ks=false,this.Ms=false,this.Is=false,this.kr=false,this.Os=false,this.Ps="uc-hidden",this.Ar=null;}disconnectedCallback(){super.disconnectedCallback(),this.Zl();}render(){return v`<uc-activity-header><button type="button" class="uc-mini-btn uc-close-btn" @click=${this.$["*historyBack"]} title=${this.l10n("a11y-activity-header-button-close")} aria-label=${this.l10n("a11y-activity-header-button-close")} ><uc-icon name="close"></uc-icon></button></uc-activity-header><div class="uc-content"><div ${I(this.Nt)} class="uc-iframe-wrapper"></div><div class="uc-toolbar" ?hidden=${!this.ql}><button type="button" class="uc-cancel-btn uc-secondary-btn" @click=${this.xe}>${this.l10n("cancel")}</button><div class="uc-selection-status-box" ?hidden=${!this.kr}><span>${this.ap}</span><button type="button" @click=${this.fp} ?hidden=${!this.Ms}>${this.l10n("select-all")}</button><button type="button" @click=${this.mp} ?hidden=${!this.Is}>${this.l10n("deselect-all")}</button></div><button type="button" class="uc-done-btn uc-primary-btn" @click=${this.Bo} ?disabled=${!this.ks} ?hidden=${!this.Os} ><uc-spinner ?hidden=${this.As}></uc-spinner><span class=${this.Ps}>${this.l10n("done")}</span></button></div></div>`}};p([m()],dt.prototype,"Ss",2),p([m()],dt.prototype,"As",2),p([m()],dt.prototype,"ks",2),p([m()],dt.prototype,"Ms",2),p([m()],dt.prototype,"Is",2),p([m()],dt.prototype,"kr",2),p([m()],dt.prototype,"Os",2),p([m()],dt.prototype,"Ps",2),p([m()],dt.prototype,"ql",2);var al=()=>typeof navigator.permissions<"u";var Ed={width:{ideal:1920},height:{ideal:1080},frameRate:{ideal:30}},Cd=["camera","microphone"];function oo(o){let i=Math.floor(o/60).toString().padStart(2,"0"),t=Math.floor(o%60).toString().padStart(2,"0");return `${i}:${t}`}var ll="image/jpeg",cl="video/webm",_=class extends R{constructor(){super(...arguments);this.couldBeCtxOwner=true;this.Mr=null;this.Ls=false;this.xi=[];this.fe=null;this.me=null;this.Ir=null;this.Or=null;this.w=null;this.Ei={};this.he=null;this.e=null;this.Vt=[];this._t=[];this.gp={};this.Pr=[];this.Lr=null;this.ec=()=>{this.tc(),this.Ci="pause";};this.ic=()=>{this.Ci="play",this.vp();};this.Si=S();this.Qe=S();this.K=S();this.rc=S();this.oc=0;this.sc=0;this.nc=null;this.Rr=true;this.Ur=true;this.yp=al();this.ac=[];this.at=true;this.Rs="";this.Bt=true;this.pt=true;this.zt=true;this.cc=[];this.mt=true;this.Us=true;this.gt=true;this.Ce=true;this.vt=true;this.Ht="camera-full";this.Ci="play";this.uc="microphone";this.$r="uc-shot-btn uc-camera-action";this.bp=()=>{if(this.telemetryManager.sendEvent({eventType:D.ACTION_EVENT,payload:{metadata:{event:"start-camera",node:this.tagName,tabId:this.w}}}),this.w===P.PHOTO&&this.wp(),this.w===P.VIDEO){if(this.fe?.state==="recording"){this.dc();return}this.Tp();}};this.xp=t=>{let e=t.target;e&&(this.Or=e.value,this.Kt());};this.Ep=t=>{let e=t.target;e&&(this.Ir=e.value,this.Kt());};this.Cp=()=>{this.Kt();};this.Sp=()=>{this.telemetryManager.sendEvent({eventType:D.ACTION_EVENT,payload:{metadata:{event:"shot-camera",node:this.tagName,tabId:this.w}}}),this.bp();};this.Ap=()=>{this.kp();};this.Mp=()=>{this.Ip();};this.Op=()=>{this.telemetryManager.sendEvent({eventType:D.ACTION_EVENT,payload:{metadata:{event:"retake-camera",node:this.tagName,tabId:this.w}}}),this.Pp();};this.Lp=()=>{this.telemetryManager.sendEvent({eventType:D.ACTION_EVENT,payload:{metadata:{event:"accept-camera",node:this.tagName,tabId:this.w}}}),this.Rp();};this.pc=t=>{let r=t.currentTarget?.getAttribute("data-id");r&&this.hc(r);};this.fc=()=>{let t=Math.floor((performance.now()-this.oc+this.sc)/1e3);if(typeof this.cfg.maxVideoRecordingDuration=="number"&&this.cfg.maxVideoRecordingDuration>0){let e=this.cfg.maxVideoRecordingDuration-t;if(e<=0){let s=this.Si.value;s&&(s.textContent=oo(e)),this.dc();return}let r=this.Si.value;r&&(r.textContent=oo(e));}else {let e=this.Si.value;e&&(e.textContent=oo(t));}this.jt=requestAnimationFrame(this.fc);};this.Up=()=>{this.oc=performance.now(),this.sc=0,this.fc();};this.mc=()=>{this.jt&&cancelAnimationFrame(this.jt);};this.tc=()=>{let t=this.K.value;if(!t)return;let e=t.currentTime,r=t.duration||1,s=this.Qe.value;s&&(s.style.transform=`scaleX(${e/r})`);let n=this.Si.value;n&&(n.textContent=oo(e)),this.jt=requestAnimationFrame(this.tc);};this.vp=()=>{this.jt&&cancelAnimationFrame(this.jt);};this.jt=null;this.Tp=()=>{try{this.xi=[],this.Ei={...this.cfg.mediaRecorderOptions};let{mimeType:t}=this.cfg.mediaRecorderOptions||{};t&&MediaRecorder.isTypeSupported(t)?this.Ei.mimeType=t:MediaRecorder.isTypeSupported(cl)?this.Ei.mimeType=cl:this.Ei.mimeType="video/mp4",this.me&&(this.fe=new MediaRecorder(this.me,this.Ei),this.fe.start(),this.fe.addEventListener("dataavailable",e=>{this.xi.push(e.data);}),this.Up(),this.classList.add("uc-recording"),this.Ai(Et.PLAY));}catch(t){console.error("Failed to start recording",t),this.telemetryManager.sendEventError(t,"camera recording. Failed to start recording");}};this.dc=()=>{this.fe?.addEventListener("stop",()=>{this.$p(),this.mc(),this.Ai(Et.STOP);}),this.fe?.stop(),this.classList.remove("uc-recording"),this.telemetryManager.sendEvent({eventType:D.ACTION_EVENT,payload:{metadata:{event:"stop-camera",node:this.tagName,tabId:this.w}}});};this.kp=()=>{if(this.fe?.state==="recording")return;let t=this.K.value;t&&(!t.paused&&!t.ended&&t.readyState>2?t.pause():t.paused&&t.play());};this.Ip=()=>{this.me?.getAudioTracks().forEach(t=>{t.enabled=!t.enabled,this.uc=t.enabled?"microphone":"microphone-mute",this.Us=!t.enabled;});};this.$p=()=>{try{let t=new Blob(this.xi,{type:this.fe?.mimeType}),e=URL.createObjectURL(t),r=this.K.value;if(!r)return;r.muted=!1,r.volume=1,this.ki(null),r.src=e,this.Dp(r);}catch(t){console.error("Failed to preview video",t),this.telemetryManager.sendEventError(t,"camera previewing. Failed to preview video");}};this.Pp=()=>{if(this.Ai(Et.RETAKE),this.w===P.VIDEO){this.ki(this.me);let t=this.K.value;t&&(t.muted=true);}this.K.value?.play?.();};this.Rp=()=>{if(this.Ai(Et.ACCEPT),this.w===P.PHOTO){this.he?.toBlob(s=>{if(!s)return;let n=this.gc("camera","jpeg",ll,s);this.vc(n);},ll);return}let t=new Blob(this.xi,{type:this.fe?.mimeType}),e=this.Fp(this.fe?.mimeType),r=this.gc("video",e,`video/${e}`,t);this.vc(r),this.xi=[];};this.Np=t=>{t===Et.SHOT&&(this.vt=true,this.pt=true,this.Ce=true,this.zt=false,this.at=true),(t===Et.RETAKE||t===Et.ACCEPT)&&(this.vt=!this.Se.includes(P.VIDEO),this.Ce=!this.Se.includes(P.PHOTO),this.pt=false,this.zt=true,this.at=this.Vt.length<=1);};this.Vp=t=>{t===Et.PLAY&&(this.Bt=false,this.Ce=true,this.at=true,this.mt=true,this.Ci="pause",this.Ht="square",this.$r="uc-shot-btn uc-camera-action uc-stop-record"),t===Et.STOP&&(this.Bt=false,this.pt=true,this.gt=true,this.zt=false),(t===Et.RETAKE||t===Et.ACCEPT)&&(this.Bt=true,this.vt=!this.Se.includes(P.VIDEO),this.Ce=!this.Se.includes(P.PHOTO),this.pt=false,this.zt=true,this.gt=!this.cfg.enableAudioRecording,this.Ht="video-camera-full",this.$r="uc-shot-btn uc-camera-action",this.mt=!this.cfg.enableAudioRecording||this._t.length<=1,this.at=this.Vt.length<=1);};this.Ai=t=>{this.w===P.PHOTO&&(t==="shot"||t==="retake"||t==="accept")&&this.Np(t),this.w===P.VIDEO&&(t==="play"||t==="stop"||t==="retake"||t==="accept"||t==="pause"||t==="resume")&&this.Vp(t);};this.hc=t=>{this.rc.value?.querySelectorAll("button").forEach(r=>{r.classList.toggle("uc-active",r.getAttribute("data-id")===t);}),t===P.PHOTO&&(this.Ht="camera-full",this.mt=true,this.gt=true),t===P.VIDEO&&(this.Ci="play",this.Ht="video-camera-full",this.mt=!this.cfg.enableAudioRecording||this._t.length<=1,this.gt=!this.cfg.enableAudioRecording),this.telemetryManager.sendEvent({eventType:D.ACTION_EVENT,payload:{metadata:{event:"camera-tab-switch",node:this.tagName,tabId:t}}}),this.w=t;};this.gc=(t,e,r,s)=>{let n=Date.now(),a=`${t}-${n}.${e}`;return new File([s],a,{lastModified:n,type:r})};this.vc=t=>{this.api.addFileFromObject(t,{source:N.CAMERA}),this.set$({"*currentActivity":x.activities.UPLOAD_LIST}),this.modalManager?.open(x.activities.UPLOAD_LIST);};this.Mi=$(t=>{this.classList.toggle("uc-initialized",t==="granted");let e=this.w===P.VIDEO&&this.cfg.enableAudioRecording,r=this.w===P.PHOTO?"camera-full":"video-camera-full";t==="granted"?(this.Rr=false,this.pt=false,this.Ce=!this.Se.includes(P.PHOTO),this.vt=!this.Se.includes(P.VIDEO),this.Ur=true,this.Bt=true,this.Ht=r,this.gt=!e,this.mt=!e):t==="prompt"?(this.Rs="camera-permissions-prompt",this.Rr=true,this.pt=true,this.Ce=true,this.Ur=false,this.Fs()):(this.Rs="camera-permissions-denied",this.Rr=true,this.Ur=false,this.Ce=!this.Se.includes(P.PHOTO),this.vt=!this.Se.includes(P.VIDEO),this.zt=true,this.$r="uc-shot-btn uc-camera-action",this.Fs());},300);this._p=()=>{if(!this.me)return false;let t=this.me?.getAudioTracks(),e=this.me?.getVideoTracks();return t.forEach(r=>{r.stop();}),e.forEach(r=>{r.stop();}),true};this.Fs=()=>{this.Ls&&(this.K.value&&(this.K.value.volume=0),this.Lr?.getTracks?.()?.[0]?.stop(),this.$s(this.K.value),this.ki(null),this._p(),this.mc(),this.Ls=false);};this.Kt=async()=>{let t={video:{...Ed},audio:this.cfg.enableAudioRecording?{}:false};this.Or&&(t.video={deviceId:{exact:this.Or}}),this.Ir&&this.cfg.enableAudioRecording&&(t.audio={deviceId:{exact:this.Ir}}),this.K.value&&(this.K.value.volume=0);try{this.Mi("prompt"),this.me=await navigator.mediaDevices.getUserMedia(t),this.me.addEventListener("inactive",()=>{this.Mi("denied");}),this.ki(this.me),this.Ls=!0,this.Mi("granted");}catch(e){this.Mi("denied"),console.log("Failed to capture camera",e),this.telemetryManager.sendEventError(e,"camera capturing. Failed to capture camera");}};this.yc=()=>{this.Kt();};this.Bp=async()=>{try{this.Dr();for(let t of Cd){let e=await navigator.permissions.query({name:t});this.gp[t]=e,e.addEventListener("change",this.yc),this.Pr.push(()=>{e.removeEventListener("change",this.yc);});}this.Mr=()=>{this.Dr();};}catch(t){this.Dr(),console.log("Failed to use permissions API. Fallback to manual request mode.",t),this.telemetryManager.sendEventError(t,"camera permissions. Failed to use permissions API"),this.Kt();}};this.zp=async()=>{try{await navigator.mediaDevices.getUserMedia({video:!0,audio:this.cfg.enableAudioRecording}),await this.Ns(),navigator.mediaDevices.addEventListener("devicechange",this.Ns);}catch(t){this.telemetryManager.sendEventError(t,"camera devices. Failed to get user media"),console.log("Failed to get user media",t);}};this.Ns=async()=>{try{let t=await navigator.mediaDevices.enumerateDevices();this.Vt=t.filter(e=>e.kind==="videoinput").map((e,r)=>({text:e.label.trim()||`${this.l10n("caption-camera")} ${r+1}`,value:e.deviceId})),this._t=this.cfg.enableAudioRecording?t.filter(e=>e.kind==="audioinput").map(e=>({text:e.label.trim(),value:e.deviceId})):[],this.ac=this.Vt,this.at=this.Vt.length<=1,this.Or=this.Vt[0]?.value??null,this.cc=this._t,this.mt=!this.cfg.enableAudioRecording||this._t.length<=1,this.Ir=this._t[0]?.value??null;}catch(t){this.telemetryManager.sendEventError(t,"camera devices. Failed to get devices"),console.log("Failed to get devices",t);}};this.Hp=async()=>{await this.Bp(),await this.zp(),await this.Kt(),this.bc(this.Se);};this.Kp=async()=>{this.Mr&&this.Mr(),window.chrome||this.Mi("denied"),this.Fs();};this.bc=t=>{this.vt=!t.includes(P.VIDEO),this.Ce=!t.includes(P.PHOTO);let e=t[0];e&&(!this.w||!t.includes(this.w))&&this.hc(e);};}Dp(t){this.$s(t),t.addEventListener("play",this.ec),t.addEventListener("pause",this.ic);}$s(t){t?.removeEventListener("play",this.ec),t?.removeEventListener("pause",this.ic);}ki(t){this.Lr!==t&&(this.Lr=t,this.Ds());}Ds(){let t=this.K.value;if(!t)return;let e=this.Lr??null;t.srcObject!==e&&(t.srcObject=e);}wp(){if(this.Ai("shot"),this.he=document.createElement("canvas"),this.e=this.he.getContext("2d"),!this.e)throw new Error("Failed to get canvas context");let t=this.K.value;if(!t)throw new Error("Video element not found");this.he.height=t.videoHeight,this.he.width=t.videoWidth,this.cfg.cameraMirror&&(this.e.translate(this.he.width,0),this.e.scale(-1,1)),this.e.drawImage(t,0,0),t.pause();}Fp(t){let e={mp4:"mp4",ogg:"ogg",webm:"webm",quicktime:"mov","x-matroska":"mkv"};if(t==="")return "webm";if(t){let r=t.split("/");if(r?.[0]==="video"){let n=r.slice(1).join("/")?.split(";")[0];if(n&&e[n])return e[n]}}return "avi"}get Se(){return Z(this.cfg.cameraModes).filter(t=>t===P.PHOTO||t===P.VIDEO)}Dr(){if(this.Pr.length!==0){for(let t of this.Pr)t();this.Pr=[],this.Mr=null;}}initCallback(){super.initCallback(),this.subConfigValue("cameraMirror",t=>{this.nc=t?"scaleX(-1)":null;}),this.subConfigValue("enableAudioRecording",t=>{this.gt=!t,this.Us=!t;}),this.subConfigValue("cameraModes",t=>{if(!this.isConnected)return;let e=K(t);this.bc(e.filter(r=>r===P.PHOTO||r===P.VIDEO));}),this.Hp();}firstUpdated(t){super.firstUpdated(t),this.Ds();}updated(t){super.updated(t),this.Ds();}jp(){this.Dr(),navigator.mediaDevices?.removeEventListener("devicechange",this.Ns),this.$s(this.K.value),this.ki(null);}disconnectedCallback(){super.disconnectedCallback(),this.Kp(),this.jp();}render(){return v`<uc-activity-header><button type="button" class="uc-mini-btn" @click=${this.$["*historyBack"]} title=${this.l10n("back")} ><uc-icon name="back"></uc-icon></button><div ?hidden=${!this.at}><uc-icon name="camera"></uc-icon><span>${this.l10n("caption-camera")}</span></div><uc-select class="uc-camera-select" .options=${this.ac} ?hidden=${this.at} @change=${this.xp} ></uc-select><button type="button" class="uc-mini-btn uc-close-btn" @click=${this.$["*closeModal"]} title=${this.l10n("a11y-activity-header-button-close")} aria-label=${this.l10n("a11y-activity-header-button-close")} ><uc-icon name="close"></uc-icon></button></uc-activity-header><div class="uc-content"><video muted autoplay playsinline style=${Se({transform:this.nc})} ?hidden=${this.Rr} ${I(this.K)} ></video><div class="uc-message-box" ?hidden=${this.Ur}><span>${this.l10n(this.Rs)}</span><button type="button" @click=${this.Cp} ?hidden=${this.yp} >${this.l10n("camera-permissions-request")}</button></div></div><div class="uc-controls"><div ${I(this.rc)} class="uc-switcher" ?hidden=${!this.Bt}><button data-id="photo" type="button" class="uc-switch uc-mini-btn" @click=${this.pc} ?hidden=${this.Ce} data-testid="tab-photo" ><uc-icon name="camera"></uc-icon></button><button data-id="video" type="button" class="uc-switch uc-mini-btn" @click=${this.pc} ?hidden=${this.vt} data-testid="tab-video" ><uc-icon name="video-camera"></uc-icon></button></div><button class="uc-secondary-btn uc-recording-timer" @click=${this.Ap} ?hidden=${this.Bt} data-testid="recording-timer" ><uc-icon name=${this.Ci}></uc-icon><span ${I(this.Si)}> 00:00 </span><span ${I(this.Qe)} class="uc-line"></span></button><div class="uc-camera-actions uc-camera-action" ?hidden=${this.zt} ><button type="button" class="uc-secondary-btn" @click=${this.Op}> Retake </button><button type="button" class="uc-primary-btn" @click=${this.Lp} data-testid="accept" > Accept </button></div><button type="button" data-testid="shot" @click=${this.Sp} class=${this.$r} ?hidden=${this.pt} ><uc-icon name=${this.Ht}></uc-icon></button><div class="uc-select"><button type="button" class="uc-mini-btn uc-btn-microphone" @click=${this.Mp} ?hidden=${this.gt} data-testid="toggle-microphone" ><uc-icon name=${this.uc}></uc-icon></button><uc-select class="uc-audio-select" .options=${this.cc} ?hidden=${this.mt} ?disabled=${this.Us} @change=${this.Ep} data-testid="audio-select" ></uc-select></div></div>`}};p([m()],_.prototype,"nc",2),p([m()],_.prototype,"Rr",2),p([m()],_.prototype,"Ur",2),p([m()],_.prototype,"yp",2),p([m()],_.prototype,"ac",2),p([m()],_.prototype,"at",2),p([m()],_.prototype,"Rs",2),p([m()],_.prototype,"Bt",2),p([m()],_.prototype,"pt",2),p([m()],_.prototype,"zt",2),p([m()],_.prototype,"cc",2),p([m()],_.prototype,"mt",2),p([m()],_.prototype,"Us",2),p([m()],_.prototype,"gt",2),p([m()],_.prototype,"Ce",2),p([m()],_.prototype,"vt",2),p([m()],_.prototype,"Ht",2),p([m()],_.prototype,"Ci",2),p([m()],_.prototype,"uc",2),p([m()],_.prototype,"$r",2);var ul={id:"camera",setup:async({pluginApi:o,uploaderApi:i})=>{ht({CameraSource:_}),o.registry.registerSource({id:"camera",label:"src-type-camera",icon:"camera",expand:()=>{if(!_n.htmlMediaCapture)return ["camera"];let t=K(o.config.get("cameraModes"));return t.length?t.map(e=>`mobile-${e}-camera`):["mobile-photo-camera"]},onSelect:()=>{i.setCurrentActivity(F.CAMERA),i.setModalState(true);}}),o.registry.registerSource({id:"mobile-photo-camera",label:"src-type-camera",icon:"camera",onSelect:()=>{i.openSystemDialog({captureCamera:true,modeCamera:"photo"});}}),o.registry.registerSource({id:"mobile-video-camera",label:"src-type-camera",icon:"camera",onSelect:()=>{i.openSystemDialog({captureCamera:true,modeCamera:"video"});}}),o.registry.registerActivity({id:F.CAMERA,render:t=>{let e=document.createElement("uc-camera-source");return t.append(e),()=>{t.replaceChildren();}}});}};var Ps={};Ds(Ps,{BtnUi:()=>xt,CloudImageEditor:()=>io,CloudImageEditorBlock:()=>et,Config:()=>Xe,CropFrame:()=>Li,EditorAspectRatioButtonControl:()=>Ri,EditorCropButtonControl:()=>$i,EditorFilterControl:()=>Zt,EditorFreeformButtonControl:()=>eo,EditorImageCropper:()=>Pi,EditorImageFader:()=>Qr,EditorOperationControl:()=>Di,EditorScroller:()=>Fi,EditorSlider:()=>Ui,EditorToolbar:()=>ut,Icon:()=>ne,LineLoaderUi:()=>Oi,PresenceToggle:()=>Je,SliderUi:()=>Ft,defineComponents:()=>ht});var xd="cloud-image-editor",Sd="<svg viewBox='0 0 24 24' 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'/></svg>",dl={id:xd,setup:async({pluginApi:o,uploaderApi:i})=>(ht({...Ps,...Ls}),o.registry.registerIcon({name:"edit-file",svg:Sd}),o.registry.registerFileAction({id:"edit-file",icon:"edit-file",label:"file-item-edit-button",shouldRender:e=>!!(e.isImage&&e.cdnUrl),onClick:e=>{i.setCurrentActivity?.(F.CLOUD_IMG_EDIT,{internalId:e.internalId}),i.setModalState?.(true);}}),o.registry.registerActivity({id:F.CLOUD_IMG_EDIT,render:e=>{let r=document.createElement("uc-cloud-image-editor-activity");return e.append(r),()=>{e.replaceChildren();}}}),i.on(k.FILE_UPLOAD_SUCCESS,e=>{if(!e.isImage)return;let r=o.config.get("cropPreset"),s=o.config.get("useCloudImageEditor"),n=o.config.get("cloudImageEditorAutoOpen"),a=i.v.size;s&&a===1&&(r||n)&&(i.setCurrentActivity?.(F.CLOUD_IMG_EDIT,{internalId:e.internalId}),i.setModalState?.(true));}))};var pl={id:"external-sources",setup:async({pluginApi:o,uploaderApi:i})=>{ht({ExternalSource:dt}),o.registry.registerActivity({id:F.EXTERNAL,render:t=>{let e=document.createElement("uc-external-source");return t.append(e),()=>{t.replaceChildren();}}});for(let t of Object.values(Ct))o.registry.registerSource({id:t,label:`src-type-${t}`,icon:t,onSelect:()=>{i.setCurrentActivity(F.EXTERNAL,{externalSourceType:t}),i.setModalState(true);}});}};var no=()=>{let o=[];return {stack:o,promiseReadJpegChunks:t=>new Promise((e,r)=>{let s=2,n=(c,d)=>{let u=new FileReader;u.addEventListener("load",()=>{d(new DataView(u.result));}),u.addEventListener("error",h=>{r(`Reader error: ${h}`);}),u.readAsArrayBuffer(c);},a=()=>n(t.slice(s,s+128),c=>{let d,u,h;for(d=u=0,h=c.byteLength;h>=0?u<h:u>h;d=h>=0?++u:--u)if(c.getUint8(d)===255){s+=d;break}l();}),l=()=>{let c=s;return n(t.slice(s,s+=4),d=>{if(d.byteLength!==4||d.getUint8(0)!==255){r("Corrupted");return}let u=d.getUint8(1);if(u===218){e(true);return}let h=d.getUint16(2)-2;return n(t.slice(s,s+=h),f=>{if(f.byteLength!==h){r("Corrupted");return}o.push({startPos:c,length:h,marker:u,view:f}),a();})})};FileReader&&DataView||r("Not Support"),n(t.slice(0,2),c=>{c.getUint16(0)!==65496&&r("Not jpeg"),a();});})}},Ad=async o=>{let i=[],{promiseReadJpegChunks:t,stack:e}=no();return await t(o),e.forEach(({marker:r,view:s})=>{r===226&&s.getUint32(0)===1229144927&&s.getUint32(4)===1347571526&&s.getUint32(8)===1229735168&&i.push(s);}),i},fl=async(o,i,t)=>{{let e=[],r=[],{promiseReadJpegChunks:s,stack:n}=no();await s(o),n.forEach(c=>{if(c.marker===i)return e.push(c.startPos),r.push(c.length)});let a=[o.slice(0,2)];for(let c of t){let d=new DataView(new ArrayBuffer(4));d.setUint16(0,65280+i),d.setUint16(2,c.byteLength+2),a.push(d.buffer),a.push(c);}let l=2;for(let c=0;c<e.length;c++)e[c]>l&&a.push(o.slice(l,e[c])),l=e[c]+r[c]+4;return a.push(o.slice(l,o.size)),new Blob(a,{type:o.type})}};var ml=(o,i)=>fl(o,226,i.map(t=>t.buffer)),kd=async o=>{try{return await ml(o,[])}catch(i){throw new Error(`Failed to strip ICC profile: ${i}`)}},Md=(o,i,t)=>new Promise((e,r)=>{let s=n=>{if(!n){r("Failed to convert canvas to blob");return}e(n);};o.toBlob(s,i,t),o.width=o.height=1;}),Ni=()=>{let o=document.createElement("canvas"),i=o.getContext("2d");return {canvas:o,ctx:i}},Id=o=>{let{ctx:t,canvas:e}=Ni();e.width=e.height=50,t.drawImage(o,0,0,50,50);let r=t.getImageData(0,0,50,50).data;e.width=e.height=1;for(let s=3;s<r.length;s+=4)if(r[s]<254)return true;return false},Od=async o=>{let i=null,{promiseReadJpegChunks:t,stack:e}=no();return await t(o),e.forEach(({marker:r,view:s})=>{if(!i&&r===225&&s.byteLength>=14&&s.getUint32(0)===1165519206&&s.getUint16(4)===0){i=s;return}}),i},Ld="data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QA6RXhpZgAATU0AKgAAAAgAAwESAAMAAAABAAYAAAEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAIBASIA/8QAJgABAAAAAAAAAAAAAAAAAAAAAxABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAAPwBH/9k=",so,Pd=()=>new Promise(o=>{if(so!==void 0)o(so);else {let i=new Image;i.addEventListener("load",()=>{so=i.naturalWidth<i.naturalHeight,i.src="//:0",o(so);}),i.src=Ld;}}),Ud=(o,i)=>{let t,e,r,s;if(!o||o.byteLength<14||o.getUint32(0)!==1165519206||o.getUint16(4)!==0)return;if(o.getUint16(6)===18761)e=true;else if(o.getUint16(6)===19789)e=false;else return;if(o.getUint16(8,e)!==42)return;r=8+o.getUint32(10,e);let n=o.getUint16(r-2,e);for(t=0,s=n;s>=0?t<s:t>s;s>=0?++t:--t){if(o.byteLength<r+10)return;o.getUint16(r,e)===274&&i(r+8,e),r+=12;}},Rd=(o,i)=>{Ud(o,(t,e)=>o.setUint16(t,i,e));},$d=async(o,i,t)=>(t&&Rd(i,1),fl(o,225,[i.buffer])),Dd=(o,i)=>new Promise((t,e)=>{i&&(o.src=i),o.complete?t(o):(o.addEventListener("load",()=>{t(o);}),o.addEventListener("error",()=>{e(new Error("Failed to load image. Probably not an image."));}));}),Fd=o=>Dd(new Image,o),Vd=[1,3],Nd=[192,193,194,195,197,198,199,201,202,203,205,206,207],hl={squareSide:[Math.floor(Math.sqrt(5*1e3*1e3)),4096,8192,11180,10836,11402,14188,16384],dimension:[4096,8192,16384,32767,65535]},_d=async o=>{let i=false,{promiseReadJpegChunks:t,stack:e}=no();return await t(o).then(()=>(e.forEach(({marker:r,view:s})=>{if(!i&&Nd.indexOf(r)>=0){let n=s.getUint8(5);Vd.indexOf(n)<0&&(i=true);}}),i)).catch(()=>i)},gl=(o,i)=>{let t={};return (...e)=>{let r=i(e,t);return r in t?t[r]:t[r]=o(...e)}},vl=(o,i)=>{let[t]=o,e=Object.keys(i).map(r=>parseInt(r,10)).sort((r,s)=>r-s);for(let r=0;r<e.length;r++){let s=e[r],n=!!i[s];if(s>t&&n||s<t&&!n)return s}return t},ce={R:55,G:110,B:165,A:255},zd=`rgba(${ce.R}, ${ce.G}, ${ce.B}, ${ce.A/255})`,yl=(o,i)=>{try{let t=[o-1,i-1,1,1],{canvas:e,ctx:r}=Ni();e.width=1,e.height=1;let{canvas:s,ctx:n}=Ni();s.width=o,s.height=i,n&&(n.fillStyle=zd,n.fillRect(...t),r.drawImage(s,o-1,i-1,1,1,0,0,1,1));let a=r&&r.getImageData(0,0,1,1).data,l=!1;return a&&(l=a[0]===ce.R&&a[1]===ce.G&&a[2]===ce.B&&a[3]===ce.A),s.width=s.height=1,l}catch{return console.error(`Failed to test for max canvas size of ${o}x${i}.`),false}};function bl(o){return (...i)=>new Promise(t=>{setTimeout(()=>{let e=o(...i);t(e);},0);})}var Bd=bl(gl(yl,vl)),Hd=bl(gl(yl,vl)),wl=async(o,i)=>{let t=hl.squareSide.find(n=>n*n>=o*i),e=hl.dimension.find(n=>n>=o&&n>=i);if(!t||!e)throw new Error("Not supported");let[r,s]=await Promise.all([Bd(t,t),Hd(e,1)]);if(r&&s)return true;throw new Error("Not supported")},Tl=async(o,i,t)=>{try{let{ctx:e,canvas:r}=Ni();return r.width=i,r.height=t,e.imageSmoothingQuality="high",e.drawImage(o,0,0,i,t),o instanceof HTMLImageElement&&(o.src="//:0"),o instanceof HTMLCanvasElement&&(o.width=o.height=1),r}catch(e){throw new Error("Canvas resize error",{cause:e})}},Kd=({img:o,targetW:i,targetH:t})=>Tl(o,i,t),jd=function({sourceW:o,targetW:i,targetH:t,step:e}){let r=[],s=i,n=t;do r.push([s,n]),s=Math.round(s/e),n=Math.round(n/e);while(s<o*e);return r.reverse()},Gd=({img:o,sourceW:i,targetW:t,targetH:e,step:r})=>{let s=jd({sourceW:i,targetW:t,targetH:e,step:r});return s.reduce((n,[a,l],c)=>n.then(d=>wl(a,l).then(()=>Tl(d,a,l)).catch(()=>{if(c===s.length-1)throw new Error("Not supported");return d})),Promise.resolve(o))},qd=()=>/iPad|iPhone|iPod/.test(navigator.platform)?true:navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform),Wd=navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform),Us=.71,Zd=(o,i)=>{if(o.width*Us*o.height*Us<i.size)throw new Error("Not required");let t=o.width,e=o.height,r=t/e,s=Math.floor(Math.sqrt(i.size*r)),n=Math.floor(i.size/Math.sqrt(i.size*r));return wl(s,n).then(()=>{let{ctx:a}=Ni();return "imageSmoothingQuality"in a&&!qd()&&!Wd?Kd({img:o,targetW:s,targetH:n}):Gd({img:o,sourceW:t,targetW:s,targetH:n,step:Us})}).catch(()=>Promise.reject("Not supported"))},El=async(o,i)=>{try{if(await _d(o))throw new Error("Should skipped");let e=await Promise.allSettled([Od(o),Pd(),Ad(o)]),s=!e.some(b=>b.status==="rejected"),[n,a,l]=e,c=await kd(o).catch(()=>o),d=await Fd(URL.createObjectURL(c));URL.revokeObjectURL(d.src);let u=await Zd(d,i),h="image/jpeg",f=i?.quality||.8;!s&&Id(u)&&(h="image/png",f=void 0);let g=await Md(u,h,f);if(s&&n.status==="fulfilled"&&n.value){let b=n.value,w=a.status==="fulfilled"?a.value:!1;g=await $d(g,b,w);}return s&&l.status==="fulfilled"&&l.value.length>0&&(g=await ml(g,l.value)),g}catch(t){let e;throw t instanceof Error&&(e=t.message),typeof t=="string"&&(e=t),new Error(`Failed to shrink image. ${e?`Message: "${e}".`:""}`,{cause:t})}};var Yd=/^([0-9]+)x([0-9]+)(?:\s+(\d{1,2}|100)%)?$/i,Cl=o=>{if(typeof o!="string")return false;let i=Yd.exec(o.toLocaleLowerCase())??[];if(i.length===0)return false;let t=Number(i[1])*Number(i[2]),e=16384*16384;return t>e?(console.warn(`Shrinked size can not be larger than ${Math.floor(e/1e3/1e3)}MP. You have set ${i[1]}x${i[2]} (${Math.ceil(t/1e3/100)/10}MP).`),false):{quality:i[3]?Number(i[3])/100:void 0,size:t}};var xl={id:"image-shrink",setup({pluginApi:o}){o.registry.registerFileHook({type:"beforeUpload",handler:async({file:i})=>{let t=o.config.get("imageShrink");if(!t)return {file:i};let e=Cl(t);if(!e)return console.warn("[ImageShrinkPlugin] Image shrink settings are invalid, skipping shrinking"),{file:i};try{return {file:await El(i,e)}}catch{return {file:i}}}});}};var Sl={id:"instagram",setup({pluginApi:o}){o.registry.registerSource({id:"instagram",label:"src-type-instagram",icon:"instagram",expand:()=>(console.error("Instagram source was removed because the Instagram Basic Display API hasn't been available since December 4, 2024. Official statement, see here: https://developers.facebook.com/blog/post/2024/09/04/update-on-instagram-basic-display-api/?locale=en_US"),[]),onSelect:()=>{}});}};var Al={id:N.LOCAL,setup:({pluginApi:o,uploaderApi:i})=>{o.registry.registerSource({id:N.LOCAL,label:"src-type-local",icon:"local",onSelect:()=>{i.openSystemDialog();}});}};var kl={id:"url-source",setup:async({pluginApi:o,uploaderApi:i})=>{ht({UrlSource:ii}),o.registry.registerActivity({id:F.URL,render:t=>{let e=document.createElement("uc-url-source");return t.append(e),()=>{t.replaceChildren();}}}),o.registry.registerSource({id:"url",label:"src-type-from-url",icon:"url",onSelect:()=>{i.setCurrentActivity(F.URL),i.setModalState(true);}});}};var ri=[{configDeps:["useCloudImageEditor"],isEnabled:o=>!!o("useCloudImageEditor"),load:()=>dl},{configDeps:["imageShrink"],isEnabled:o=>!!o("imageShrink"),load:()=>xl},{configDeps:["sourceList"],isEnabled:o=>K(o("sourceList")).includes(N.LOCAL),load:()=>Al},{configDeps:["sourceList"],isEnabled:o=>K(o("sourceList")).includes(N.CAMERA),load:()=>ul},{configDeps:["sourceList"],isEnabled:o=>K(o("sourceList")).includes("instagram"),load:()=>Sl},{configDeps:["sourceList"],isEnabled:o=>Object.values(Ct).some(i=>K(o("sourceList")).includes(i)),load:()=>pl},{configDeps:["sourceList"],isEnabled:o=>K(o("sourceList")).includes(N.URL),load:()=>kl}];var ao=class extends Wt{constructor(){super();this.headless=false;this.init$={...this.init$};}static{this.lazyPlugins=ri;}static{this.styleAttrs=[...super.styleAttrs,"uc-file-uploader-regular"];}initCallback(){super.initCallback(),this.telemetryManager.sendEvent({eventType:D.INIT_SOLUTION});}render(){return v` ${super.render()}<uc-simple-btn ?hidden=${this.headless}></uc-simple-btn><uc-modal id="start-from" strokes block-body-scrolling><uc-start-from><uc-drop-area with-icon clickable></uc-drop-area><uc-source-list role="list" wrap></uc-source-list><button type="button" class="uc-secondary-btn" @click=${this.$["*historyBack"]}>${this.l10n("start-from-cancel")}</button><uc-copyright></uc-copyright></uc-start-from></uc-modal><uc-modal id="upload-list" strokes block-body-scrolling><uc-upload-list></uc-upload-list></uc-modal><uc-plugin-activity-renderer mode="modal"></uc-plugin-activity-renderer>`}};p([y({type:Boolean})],ao.prototype,"headless",2);var lo=class extends Wt{constructor(){super();this.wc=false;this.xe=()=>{if(this.Tc){let t=this.$["*historyBack"];t?.();return}this.xc&&(this.$["*currentActivity"]=x.activities.UPLOAD_LIST);};this.init$={...this.init$};}static{this.lazyPlugins=ri;}static{this.styleAttrs=[...super.styleAttrs,"uc-file-uploader-inline"];}get Tc(){let t=this.$["*history"];return !t||t.length<=1?false:t[t.length-1]!==x.activities.START_FROM}get xc(){let t=this.$["*uploadList"];return this.cfg.showEmptyList||Array.isArray(t)&&t.length>0}Vs(){return this.getCssData("--cfg-init-activity")||x.activities.START_FROM}initCallback(){super.initCallback(),this.telemetryManager.sendEvent({eventType:D.INIT_SOLUTION});let t=this.Vs();this.sub("*currentActivity",e=>{e||(this.$["*currentActivity"]=t);}),this.sub("*uploadList",e=>{Array.isArray(e)&&e.length>0&&this.$["*currentActivity"]===t&&(this.$["*currentActivity"]=x.activities.UPLOAD_LIST);}),this.sub("*history",()=>{this.wc=this.Tc||this.xc;});}render(){return v` ${super.render()}<uc-start-from><uc-drop-area with-icon clickable></uc-drop-area><uc-source-list role="list" wrap></uc-source-list><button type="button" class="uc-cancel-btn uc-secondary-btn" @click=${this.xe} ?hidden=${!this.wc} >${this.l10n("start-from-cancel")}</button><uc-copyright></uc-copyright></uc-start-from><uc-upload-list></uc-upload-list><uc-plugin-activity-renderer mode="inline"></uc-plugin-activity-renderer>`}};p([m()],lo.prototype,"wc",2);var Rs="active",co="",Ae=class extends Wt{constructor(){super();this._s=false;this.Fr=false;this.Nr=co;this.Bs=co;this.oi=t=>{t.id===x.activities.CLOUD_IMG_EDIT&&(this.Nr=Rs),this.$["*currentActivity"]===x.activities.UPLOAD_LIST&&(this.Nr=Rs,this.Fr=true);let e=this.$["*uploadList"];(!e||e.length<=0)&&(this.Bs=Rs);};this.si=t=>{t.id===this.$["*currentActivity"]&&(this.$["*currentActivity"]=x.activities.UPLOAD_LIST,this.Fr=false),t.id===x.activities.CLOUD_IMG_EDIT&&(this.$["*currentActivity"]=x.activities.UPLOAD_LIST);};this.init$={...this.init$};}static{this.lazyPlugins=ri;}static{this.styleAttrs=[...super.styleAttrs,"uc-file-uploader-minimal"];}Vs(){return this.getCssData("--cfg-init-activity")||x.activities.START_FROM}initCallback(){super.initCallback(),this.telemetryManager.sendEvent({eventType:D.INIT_SOLUTION});let t=this.Vs();this.sub("*currentActivity",e=>{e===x.activities.UPLOAD_LIST&&this.modalManager?.closeAll(),e||(this.$["*currentActivity"]=t);}),this.sub("*uploadList",e=>{Array.isArray(e)&&e.length>0?(this.$["*currentActivity"]=x.activities.UPLOAD_LIST,this.Bs=co):(this.Nr=co,this.Fr=false,this.$["*currentActivity"]=t);}),this.subConfigValue("confirmUpload",e=>{e!==false&&(this.cfg.confirmUpload=false);}),this.subConfigValue("filesViewMode",e=>{this.setAttribute("mode",e),this.subConfigValue("multiple",r=>{e==="grid"?(r?this.style.removeProperty("--uc-grid-col"):this.style.setProperty("--uc-grid-col","1"),this._s=!r):(this.style.removeProperty("--uc-grid-col"),this._s=false);});}),this.modalManager?.subscribe(Y.OPEN,this.oi),this.modalManager?.subscribe(Y.CLOSE,this.si);}disconnectedCallback(){super.disconnectedCallback(),this.modalManager?.unsubscribe(Y.OPEN,this.oi),this.modalManager?.unsubscribe(Y.CLOSE,this.si);}render(){return v` ${super.render()}<uc-start-from ?hidden=${this.Fr} class=${this.Bs}><uc-drop-area ?single=${this._s} initflow clickable tabindex="0" ><span>${this.l10n("choose-file")}</span></uc-drop-area><uc-copyright></uc-copyright></uc-start-from><uc-upload-list class=${this.Nr}></uc-upload-list><uc-modal id="start-from" strokes block-body-scrolling><uc-start-from><uc-drop-area with-icon clickable></uc-drop-area><uc-source-list role="list" wrap></uc-source-list><button type="button" class="uc-secondary-btn" @click=${this.$["*historyBack"]} >${this.l10n("start-from-cancel")}</button></uc-start-from></uc-modal><uc-plugin-activity-renderer mode="modal"></uc-plugin-activity-renderer>`}};p([m()],Ae.prototype,"_s",2),p([m()],Ae.prototype,"Fr",2),p([m()],Ae.prototype,"Nr",2),p([m()],Ae.prototype,"Bs",2);/*! For license information please see uc-file-uploader-inline.min.js.LEGAL.txt */
8
+ export{x as ActivityBlock,ys as ActivityHeader,Co as BaseComponent,C as Block,xt as BtnUi,_ as CameraSource,io as CloudImageEditor,Vi as CloudImageEditorActivity,et as CloudImageEditorBlock,Xe as Config,ms as Copyright,Li as CropFrame,H as Data,gt as DropArea,Ri as EditorAspectRatioButtonControl,$i as EditorCropButtonControl,Zt as EditorFilterControl,eo as EditorFreeformButtonControl,Pi as EditorImageCropper,Qr as EditorImageFader,Di as EditorOperationControl,Fi as EditorScroller,Ui as EditorSlider,ut as EditorToolbar,dt as ExternalSource,Ct as ExternalUploadSource,Ts as FileItem,lo as FileUploaderInline,Ae as FileUploaderMinimal,ao as FileUploaderRegular,qr as FormInput,ne as Icon,ds as Img,Oi as LineLoaderUi,Ei as Modal,Y as ModalEvents,Pt as PACKAGE_NAME,Ut as PACKAGE_VERSION,Mi as PluginActivityHost,Qe as PluginActivityRenderer,Je as PresenceToggle,je as ProgressBar,Ci as ProgressBarCommon,Ge as Select,ki as SimpleBtn,Ft as SliderUi,Wt as SolutionBlock,qe as SourceBtn,xi as SourceList,gs as Spinner,bs as StartFrom,Ze as Thumb,pt as UID,ws as UploadCtxProvider,Ot as UploadList,N as UploadSource,R as UploaderBlock,ii as UrlSource,ht as defineComponents,ln as defineLocale,Yl as loadFileUploaderFrom,cr as toKebabCase};