comp-hub 0.25.17 → 0.25.18
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.
- package/dist/website/container/assets/{index-YhvDyci9.css → index-DZmjDb-3.css} +1 -1
- package/dist/website/container/index.html +2 -2
- package/dist/website/item/assets/@chenglou-BKD48OEU.js +4 -0
- package/dist/website/item/assets/@ctrl-C4Rzlq_k.js +1 -0
- package/dist/website/item/assets/@element-plus-5HYzMPHH.js +1 -0
- package/dist/website/item/assets/@floating-ui-BOzNIQbj.js +1 -0
- package/dist/website/item/assets/@iconify-BPgeTBo_.js +1 -0
- package/dist/website/item/assets/@iconify-vue-r3R3CCwl.js +1 -0
- package/dist/website/item/assets/@intlify-Dtb6NmBn.js +3 -0
- package/dist/website/item/assets/@profoundlogic-Dbp5Yy6B.js +5 -0
- package/dist/website/item/assets/@sxzz-CUumdR8o.js +1 -0
- package/dist/website/item/assets/@vue-C9QaczuC.js +1 -0
- package/dist/website/item/assets/@vueuse-C7-4JdfM.js +1 -0
- package/dist/website/item/assets/_plugin-vue_export-helper-BvSI8h28.js +12 -0
- package/dist/website/item/assets/async-validator-Cp9QasH9.js +12 -0
- package/dist/website/item/assets/axios-B8_nURbH.js +9 -0
- package/dist/website/item/assets/birpc-l0sNRNKZ.js +1 -0
- package/dist/website/item/assets/css-tree-BLHriVLA.js +12 -0
- package/dist/website/item/assets/dayjs-Z3PInbbQ.js +1 -0
- package/dist/website/item/assets/diff-l0sNRNKZ.js +1 -0
- package/dist/website/item/assets/diff2html-DT_q3g7v.js +101 -0
- package/dist/website/item/assets/{index-C3Gu6wLz.css → element-plus-Cfuf6lH-.css} +1 -1
- package/dist/website/item/assets/element-plus-DBucBpWn.js +39 -0
- package/dist/website/item/assets/highlight.js-l0sNRNKZ.js +1 -0
- package/dist/website/item/assets/hookable-l0sNRNKZ.js +1 -0
- package/dist/website/item/assets/idb-Dob3nYDb.js +1 -0
- package/dist/website/item/assets/index-6jb9FmNT.js +1 -0
- package/dist/website/item/assets/index-BGH8m-F2.js +1 -0
- package/dist/website/item/assets/index-BI_-2dUB.js +1 -0
- package/dist/website/item/assets/index-BpT42u6b.js +1 -0
- package/dist/website/item/assets/index-BqfcJOru.js +1 -0
- package/dist/website/item/assets/index-BwZfV1A2.js +1 -0
- package/dist/website/item/assets/index-CRGAlkC4.js +1 -0
- package/dist/website/item/assets/index-CUQTn5cW.js +2 -0
- package/dist/website/item/assets/index-DMv3RrWi.js +1 -0
- package/dist/website/item/assets/index-D__3WVgB.js +1 -0
- package/dist/website/item/assets/index-DeU4xv9o.js +1 -0
- package/dist/website/item/assets/index-DjpSekiX.js +1 -0
- package/dist/website/item/assets/index-ZnytBXEa.css +1 -0
- package/dist/website/item/assets/index-jliYxAXa.js +1 -0
- package/dist/website/item/assets/index.vue_vue_type_script_setup_true_lang-BP6wylOE.js +1 -0
- package/dist/website/item/assets/index.vue_vue_type_script_setup_true_lang-BXDFpHny.js +1 -0
- package/dist/website/item/assets/index.vue_vue_type_script_setup_true_lang-BpSg0Jae.js +1 -0
- package/dist/website/item/assets/index.vue_vue_type_script_setup_true_lang-DfVSdoBY.js +1 -0
- package/dist/website/item/assets/index.vue_vue_type_script_setup_true_lang-DjzNSY_4.js +1 -0
- package/dist/website/item/assets/index.vue_vue_type_script_setup_true_lang-Na9slT-l.js +1 -0
- package/dist/website/item/assets/lodash-es-3Olcxijv.js +1 -0
- package/dist/website/item/assets/lodash-unified-l0sNRNKZ.js +1 -0
- package/dist/website/item/assets/lz-string--7IMPK6S.js +1 -0
- package/dist/website/item/assets/memoize-one-BdPwpGay.js +1 -0
- package/dist/website/item/assets/normalize-wheel-es-BikNlmlf.js +1 -0
- package/dist/website/item/assets/perfect-debounce-l0sNRNKZ.js +1 -0
- package/dist/website/item/assets/pinia-Bzt0Q3uQ.js +1 -0
- package/dist/website/item/assets/prettier-l0sNRNKZ.js +1 -0
- package/dist/website/item/assets/source-map-js-B_zWzY07.js +1 -0
- package/dist/website/item/assets/useCompAttrs-C9FX019z.js +1 -0
- package/dist/website/item/assets/useCompAttrsLocal-ThVku9Cv.js +1 -0
- package/dist/website/item/assets/vue-i18n-DuHeSxKy.js +1 -0
- package/dist/website/item/assets/vue-l0sNRNKZ.js +1 -0
- package/dist/website/item/assets/vue-router-DPdvYShe.js +1 -0
- package/dist/website/item/index.html +21 -2
- package/dist/website/main/assets/@chenglou-BKD48OEU.js +4 -0
- package/dist/website/main/assets/@ctrl-C4Rzlq_k.js +1 -0
- package/dist/website/main/assets/@element-plus-MEP8kzQo.js +1 -0
- package/dist/website/main/assets/@floating-ui-BOzNIQbj.js +1 -0
- package/dist/website/main/assets/@form-create-feqGS1Jj.js +7 -0
- package/dist/website/main/assets/@iconify-C373lf0G.js +1 -0
- package/dist/website/main/assets/@iconify-vue-CB77QM-F.css +1 -0
- package/dist/website/main/assets/@iconify-vue-sb5-HV-8.js +1 -0
- package/dist/website/main/assets/@intlify-Dtb6NmBn.js +3 -0
- package/dist/website/main/assets/@nanostores-cuv3rP3V.js +1 -0
- package/dist/website/main/assets/@profoundlogic-Dbp5Yy6B.js +5 -0
- package/dist/website/main/assets/@socket.io-Dkula2eQ.js +1 -0
- package/dist/website/main/assets/@sxzz-CUumdR8o.js +1 -0
- package/dist/website/main/assets/@tanstack-B1C-iDkv.js +1 -0
- package/dist/website/main/assets/@transloadit-C1Ht0DUJ.js +1 -0
- package/dist/website/main/assets/@uppy-CVofWm7v.js +6 -0
- package/dist/website/main/assets/@viselect-CfuubPTw.js +1 -0
- package/dist/website/main/assets/@vue-fhDHgfUd.js +1 -0
- package/dist/website/main/assets/@vueuse-BzQM40cp.js +1 -0
- package/dist/website/main/assets/{index-Bn5vi5XZ.css → @xterm-DFuMZ0ql.css} +1 -1
- package/dist/website/main/assets/@xterm-DUvcnV0i.js +9 -0
- package/dist/website/main/assets/async-validator-Cp9QasH9.js +12 -0
- package/dist/website/main/assets/axios-CGPwGRlm.js +9 -0
- package/dist/website/main/assets/birpc-l0sNRNKZ.js +1 -0
- package/dist/website/main/assets/charenc-DuOFFKym.js +1 -0
- package/dist/website/main/assets/crypt-C-Yx0DM0.js +1 -0
- package/dist/website/main/assets/css-tree-l0sNRNKZ.js +1 -0
- package/dist/website/main/assets/dayjs-CODj3Ey3.js +1 -0
- package/dist/website/main/assets/diff-Czv1d0yF.js +13 -0
- package/dist/website/main/assets/diff2html-B2pszkCz.js +107 -0
- package/dist/website/main/assets/diff2html-BgE3edmZ.css +1 -0
- package/dist/website/main/assets/disable-devtool-D3c1TvAN.js +2 -0
- package/dist/website/main/assets/eastasianwidth-BD_cvthz.js +1 -0
- package/dist/website/main/assets/element-plus-BhtJKS0K.js +39 -0
- package/dist/website/main/assets/element-plus-CGVDl28_.css +1 -0
- package/dist/website/main/assets/engine.io-client-DI6V2dVR.js +1 -0
- package/dist/website/main/assets/engine.io-parser-DPmA-eyr.js +1 -0
- package/dist/website/main/assets/highlight-ZgkIHsf0.css +1 -0
- package/dist/website/main/assets/highlight.js-Bwl2mRDt.js +3 -0
- package/dist/website/main/assets/hookable-l0sNRNKZ.js +1 -0
- package/dist/website/main/assets/idb-Dob3nYDb.js +1 -0
- package/dist/website/main/assets/index-4HcRtHFq.js +1 -0
- package/dist/website/main/assets/index-B5Bwrnd-.js +5 -0
- package/dist/website/main/assets/index-BDXZ4YLt.js +1 -0
- package/dist/website/main/assets/index-BQWQEa7O.css +1 -0
- package/dist/website/main/assets/index-B_LYOd1t.js +1 -0
- package/dist/website/main/assets/index-Bb2JsGT0.js +1 -0
- package/dist/website/main/assets/index-BhuSlCh5.js +1 -0
- package/dist/website/main/assets/index-BoRu8JTf.js +1 -0
- package/dist/website/main/assets/index-BspcDgbz.js +1 -0
- package/dist/website/main/assets/index-C3llr0fI.js +1 -0
- package/dist/website/main/assets/index-CUFPwy3j.js +1 -0
- package/dist/website/main/assets/index-CZOyLdFS.js +1 -0
- package/dist/website/main/assets/index-Cc1ww5-S.css +1 -0
- package/dist/website/main/assets/index-CeIHQ-n9.js +2 -0
- package/dist/website/main/assets/index-CeKI74UL.css +1 -0
- package/dist/website/main/assets/index-Ck53ravL.js +1 -0
- package/dist/website/main/assets/index-CvX4ROQv.js +1 -0
- package/dist/website/main/assets/index-Cy4Bopc2.js +1 -0
- package/dist/website/main/assets/index-D7gG_u1W.css +1 -0
- package/dist/website/main/assets/index-DPOCYlI9.js +1 -0
- package/dist/website/main/assets/index-DULniEhb.js +1 -0
- package/dist/website/main/assets/index-DYDRL9IM.js +1 -0
- package/dist/website/main/assets/index-DYr8op9I.js +2 -0
- package/dist/website/main/assets/index-DYzYK94h.js +1 -0
- package/dist/website/main/assets/index-DuAc5XJp.js +1 -0
- package/dist/website/main/assets/index-Dy7LCL85.js +1 -0
- package/dist/website/main/assets/index-Dztu-Acq.js +1 -0
- package/dist/website/main/assets/index-Pi6tlbT4.js +4 -0
- package/dist/website/main/assets/index-aKfjhWt0.js +1 -0
- package/dist/website/main/assets/index-bJcpxaVy.js +1 -0
- package/dist/website/main/assets/index-kfXJiyp1.js +1 -0
- package/dist/website/main/assets/index-lBMHAV8o.js +1 -0
- package/dist/website/main/assets/index-qQdfohcs.js +1 -0
- package/dist/website/main/assets/index-rbkKq4oE.js +1 -0
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-C8gdKJNc.js +1 -0
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-CCmKpzaE.js +1 -0
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-CgWidmAh.js +1 -0
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-CoufeP0j.js +2 -0
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-Cpe0QxkJ.js +1 -0
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-CqPOOcKs.js +1 -0
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-js27NZ7Q.js +1 -0
- package/dist/website/main/assets/index.vue_vue_type_style_index_0_lang-DPWsMIUB.js +1 -0
- package/dist/website/main/assets/index.vue_vue_type_style_index_0_lang-MdS0xY-J.js +7 -0
- package/dist/website/main/assets/index.vue_vue_type_style_index_0_lang-y99hKbpl.js +1 -0
- package/dist/website/main/assets/is-buffer-BmA-AeVY.js +1 -0
- package/dist/website/main/assets/js-cookie-C2b7Ongr.js +1 -0
- package/dist/website/main/assets/lodash-DSEObR3Z.js +1 -0
- package/dist/website/main/assets/lodash-es-3Dei55BW.js +1 -0
- package/dist/website/main/assets/lodash-unified-l0sNRNKZ.js +1 -0
- package/dist/website/main/assets/lz-string-DrDDIr3t.js +1 -0
- package/dist/website/main/assets/marked-Ds7eXWqI.js +59 -0
- package/dist/website/main/assets/md5-BFcmaCA5.js +1 -0
- package/dist/website/main/assets/memoize-one-BdPwpGay.js +1 -0
- package/dist/website/main/assets/mime-match-DPWGxner.js +1 -0
- package/dist/website/main/assets/mitt-BN3yQH3p.js +1 -0
- package/dist/website/main/assets/namespace-emitter-D_6Athvt.js +1 -0
- package/dist/website/main/assets/nanoid-DKwX7yNB.js +1 -0
- package/dist/website/main/assets/nanostores-Bxb5zCO9.js +1 -0
- package/dist/website/main/assets/normalize-wheel-es-BikNlmlf.js +1 -0
- package/dist/website/main/assets/nprogress-BgDCIyLK.css +1 -0
- package/dist/website/main/assets/nprogress-DvYEeNZi.js +1 -0
- package/dist/website/main/assets/overlayscrollbars-B4ARb2Jg.js +1 -0
- package/dist/website/main/assets/path-browserify-VLxTPTS7.js +1 -0
- package/dist/website/main/assets/perfect-debounce-l0sNRNKZ.js +1 -0
- package/dist/website/main/assets/pinia-Dbinmd9o.js +1 -0
- package/dist/website/main/assets/preact-l0sNRNKZ.js +1 -0
- package/dist/website/main/assets/prettier-CXANtD9v.js +184 -0
- package/dist/website/main/assets/socket.io-client-6WpCnOvu.js +1 -0
- package/dist/website/main/assets/socket.io-parser-dKdiPQ_0.js +1 -0
- package/dist/website/main/assets/source-map-js-l0sNRNKZ.js +1 -0
- package/dist/website/main/assets/useCacheOssStore-B0MOdXBT.js +1 -0
- package/dist/website/main/assets/useCompEditStore-BPtseuS3.js +1 -0
- package/dist/website/main/assets/useCompEditStore-D1y6qk1p.css +1 -0
- package/dist/website/main/assets/useCompMetaLocalStore-CTrw6UOk.js +1 -0
- package/dist/website/main/assets/useCompMetaStore-CZbYI0xK.js +1 -0
- package/dist/website/main/assets/useKeyword-C1kuAWZi.js +1 -0
- package/dist/website/main/assets/useTeamHeaders-3RiOUcY_.js +1 -0
- package/dist/website/main/assets/useVscodeOpen-8UEdd_uq.js +1 -0
- package/dist/website/main/assets/vanilla-lazyload-CwDt0XVP.js +1 -0
- package/dist/website/main/assets/vue-advanced-cropper-B8N2632q.js +3 -0
- package/dist/website/main/assets/vue-demi-l0sNRNKZ.js +1 -0
- package/dist/website/main/assets/vue-i18n-Cl4PTbxU.js +1 -0
- package/dist/website/main/assets/vue-l0sNRNKZ.js +1 -0
- package/dist/website/main/assets/vue-router-Dq9LltUm.js +1 -0
- package/dist/website/main/assets/vue-sonner-tR0c75Mk.js +1 -0
- package/dist/website/main/assets/vuefinder-5wO4Y5ID.js +1 -0
- package/dist/website/main/assets/wildcard-Cd63L__x.js +1 -0
- package/dist/website/main/index.html +56 -2
- package/package.json +3 -2
- package/dist/website/item/assets/_plugin-vue_export-helper-ClmlufYy.js +0 -147
- package/dist/website/item/assets/index-A2e72bYf.js +0 -1
- package/dist/website/item/assets/index-B2r8sxRR.js +0 -1
- package/dist/website/item/assets/index-C6NEN46F.js +0 -1
- package/dist/website/item/assets/index-CXfvRuh5.js +0 -1
- package/dist/website/item/assets/index-CYfmDfPu.js +0 -13
- package/dist/website/item/assets/index-Ckv5tLxs.js +0 -1
- package/dist/website/item/assets/index-Cl6uqF-x.js +0 -1
- package/dist/website/item/assets/index-CmgpBuUf.js +0 -1
- package/dist/website/item/assets/index-CncfqGDl.js +0 -1
- package/dist/website/item/assets/index-DgLkaw9e.js +0 -1
- package/dist/website/item/assets/index-DuvgRKuL.js +0 -1
- package/dist/website/item/assets/index-IbpmdLUc.js +0 -1
- package/dist/website/item/assets/index-sGVojTNg.js +0 -1
- package/dist/website/item/assets/index-uCZVfQfS.js +0 -1
- package/dist/website/item/assets/index.vue_vue_type_script_setup_true_lang-BLB7nimS.js +0 -1
- package/dist/website/item/assets/index.vue_vue_type_script_setup_true_lang-BYSmp_n8.js +0 -1
- package/dist/website/item/assets/index.vue_vue_type_script_setup_true_lang-BYzW_ITp.js +0 -1
- package/dist/website/item/assets/index.vue_vue_type_script_setup_true_lang-BhO5mDgb.js +0 -1
- package/dist/website/item/assets/index.vue_vue_type_script_setup_true_lang-CFCH0Q76.js +0 -1
- package/dist/website/item/assets/index.vue_vue_type_script_setup_true_lang-SpXIpkkp.js +0 -1
- package/dist/website/item/assets/useCompAttrs-BL-bjaqx.js +0 -1
- package/dist/website/item/assets/useCompAttrsLocal-Bsj1Z8J3.js +0 -1
- package/dist/website/main/assets/cloud-upload-Cs5rs0fe.js +0 -1
- package/dist/website/main/assets/cloud-upload-j3Y0taC9.css +0 -1
- package/dist/website/main/assets/el-card-BAyktVMS.css +0 -1
- package/dist/website/main/assets/el-dropdown-item-BeIfAqTO.css +0 -1
- package/dist/website/main/assets/el-empty-S7fQQ3B8.css +0 -1
- package/dist/website/main/assets/el-link-CPQZ-olG.css +0 -1
- package/dist/website/main/assets/el-link-CYRikDCA.js +0 -1
- package/dist/website/main/assets/el-loading-Dq8WDDkr.css +0 -1
- package/dist/website/main/assets/el-table-column-B3ZEEuPD.css +0 -1
- package/dist/website/main/assets/el-table-column-R6urXTXE.js +0 -1
- package/dist/website/main/assets/en-C_Tot-hO.js +0 -1
- package/dist/website/main/assets/home-rounded-B4KVwSYb.css +0 -1
- package/dist/website/main/assets/home-rounded-B6ip0c7y.js +0 -1
- package/dist/website/main/assets/index-9cW7WZJA.js +0 -1
- package/dist/website/main/assets/index-B-U892j4.js +0 -1
- package/dist/website/main/assets/index-B6mD6Kkg.js +0 -1
- package/dist/website/main/assets/index-BGMqZ6s6.js +0 -1
- package/dist/website/main/assets/index-Bud_dtZv.js +0 -1
- package/dist/website/main/assets/index-BxyUlJIo.js +0 -1
- package/dist/website/main/assets/index-C1gpYuZp.js +0 -1
- package/dist/website/main/assets/index-C2bAlTIv.js +0 -4
- package/dist/website/main/assets/index-CDNB051F.js +0 -1
- package/dist/website/main/assets/index-CNq68i9N.js +0 -1
- package/dist/website/main/assets/index-CS-qmP9q.js +0 -1
- package/dist/website/main/assets/index-CWkqV3b7.js +0 -1
- package/dist/website/main/assets/index-C_6TIEqJ.css +0 -1
- package/dist/website/main/assets/index-CaxXecF0.js +0 -1
- package/dist/website/main/assets/index-CbOuvPyn.js +0 -1
- package/dist/website/main/assets/index-CgNgaeRC.css +0 -1
- package/dist/website/main/assets/index-ChNPGeka.js +0 -1
- package/dist/website/main/assets/index-CjHODTEb.js +0 -1
- package/dist/website/main/assets/index-Cpt-ElYb.js +0 -1
- package/dist/website/main/assets/index-Cqeo6XX0.js +0 -1
- package/dist/website/main/assets/index-CrjnxYdq.js +0 -1
- package/dist/website/main/assets/index-DMmk1-uH.js +0 -2
- package/dist/website/main/assets/index-DOlF0Z_P.css +0 -1
- package/dist/website/main/assets/index-DPvzUGF_.js +0 -2
- package/dist/website/main/assets/index-Dj51p5I8.css +0 -1
- package/dist/website/main/assets/index-DvpUuDIq.js +0 -1
- package/dist/website/main/assets/index-Dwbqz_We.js +0 -1
- package/dist/website/main/assets/index-DwsxPrpM.js +0 -1
- package/dist/website/main/assets/index-IFbOrHc6.js +0 -1
- package/dist/website/main/assets/index-JZJBRbnu.js +0 -1
- package/dist/website/main/assets/index-YQrh68OP.js +0 -361
- package/dist/website/main/assets/index-d6c7G8Rn.js +0 -1
- package/dist/website/main/assets/index-q7_pRGD0.js +0 -8
- package/dist/website/main/assets/index-r4XZ4Nw3.js +0 -1
- package/dist/website/main/assets/index-ze19z7zX.js +0 -1
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-6wuGCBaO.js +0 -2
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-BHtswZUO.js +0 -1
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-Bu8jevdr.js +0 -1
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-CUQttXIa.js +0 -1
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-CqTNk_HH.js +0 -1
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-DDwXMaNL.js +0 -1
- package/dist/website/main/assets/index.vue_vue_type_script_setup_true_lang-DOAvJ6sA.js +0 -1
- package/dist/website/main/assets/index.vue_vue_type_style_index_0_lang-CAzxiMOC.js +0 -59
- package/dist/website/main/assets/index.vue_vue_type_style_index_0_lang-Cl1itFTX.js +0 -1
- package/dist/website/main/assets/index.vue_vue_type_style_index_0_lang-DRm0zssd.js +0 -15
- package/dist/website/main/assets/kid-star-D1M-aC1C.css +0 -1
- package/dist/website/main/assets/kid-star-DCy2yzJb.js +0 -1
- package/dist/website/main/assets/md5-CtJDyuNs.js +0 -1
- package/dist/website/main/assets/settings-BMRZp14Y.js +0 -1
- package/dist/website/main/assets/settings-BhagQj3w.css +0 -1
- package/dist/website/main/assets/supervised-user-circle-CZYpyCV4.css +0 -1
- package/dist/website/main/assets/supervised-user-circle-v2VKksba.js +0 -1
- package/dist/website/main/assets/sync-saved-locally-rounded-BKS18Cgx.js +0 -1
- package/dist/website/main/assets/sync-saved-locally-rounded-wbwASI26.css +0 -1
- package/dist/website/main/assets/terminal-CysD-avl.js +0 -1
- package/dist/website/main/assets/terminal-DFt3N_TH.css +0 -1
- package/dist/website/main/assets/useCacheOssStore-E3m2bF9c.js +0 -1
- package/dist/website/main/assets/useCompEditStore-N2mMMlha.css +0 -1
- package/dist/website/main/assets/useCompEditStore-eTcWHaeG.js +0 -1
- package/dist/website/main/assets/useCompMetaLocalStore-BwKMTij9.js +0 -1
- package/dist/website/main/assets/useCompMetaStore-BWz1ZyX_.js +0 -1
- package/dist/website/main/assets/useKeyword-Dmz0UrKO.js +0 -1
- package/dist/website/main/assets/useTeamHeaders-kK4p3F9Z.js +0 -1
- package/dist/website/main/assets/useVscodeOpen-Bwp8Sbsw.js +0 -1
- package/dist/website/main/assets/zhCN-0_iHo67e.js +0 -1
- /package/dist/website/container/assets/{index-DY_KlG_O.js → index-C0I-xtR-.js} +0 -0
- /package/dist/website/item/assets/{_plugin-vue_export-helper-8dCw6Y2Z.css → @iconify-vue-8dCw6Y2Z.css} +0 -0
- /package/dist/website/main/assets/{v4-EwEgHOG0.js → uuid-EwEgHOG0.js} +0 -0
- /package/dist/website/main/assets/{index-m9r9dfRk.css → vuefinder-m9r9dfRk.css} +0 -0
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{c5 as Th,c6 as Mh,au as Kr,bZ as fn,d as fe,aI as Rh,k as Zt,q as U,aF as lt,o as _,c as C,n as K,a as f,F as _e,R as $e,aO as We,e as h,P as X,w as he,a4 as xe,b as ee,bn as et,bk as ue,s as Z,D as Re,b9 as Yr,ad as ve,ak as Rt,a7 as Ht,f as Me,t as P,ah as Xr,aS as Bs,c7 as Jn,G as wt,ax as ze,bo as $t,bj as Se,bC as ks,c8 as $n,i as qi,bG as On,aw as Ge,c9 as Us,a8 as pi,r as js,ca as Fh,bg as $h,cb as Hs,cc as ur,cd as Co,ce as di,cf as Oh,Z as Nc,cg as Ph,a0 as zh,W as Dh,as as Ih,aG as Eo,u as Lh,ch as Bh,V as Uh,j as jh,ci as Hh,ap as Nh,B as Vh,v as tl,z as il}from"./index-YQrh68OP.js";const Cs=Math.min,Ti=Math.max,Es=Math.round,Zn=Math.floor,Nt=t=>({x:t,y:t}),qh={left:"right",right:"left",bottom:"top",top:"bottom"};function nl(t,e,i){return Ti(t,Cs(e,i))}function Ns(t,e){return typeof t=="function"?t(e):t}function Fi(t){return t.split("-")[0]}function Vs(t){return t.split("-")[1]}function Vc(t){return t==="x"?"y":"x"}function qc(t){return t==="y"?"height":"width"}function hi(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Wc(t){return Vc(hi(t))}function Wh(t,e,i){i===void 0&&(i=!1);const n=Vs(t),s=Wc(t),o=qc(s);let r=s==="x"?n===(i?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(r=As(r)),[r,As(r)]}function Qh(t){const e=As(t);return[dr(t),e,dr(e)]}function dr(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const sl=["left","right"],ol=["right","left"],Kh=["top","bottom"],Yh=["bottom","top"];function Xh(t,e,i){switch(t){case"top":case"bottom":return i?e?ol:sl:e?sl:ol;case"left":case"right":return e?Kh:Yh;default:return[]}}function Gh(t,e,i,n){const s=Vs(t);let o=Xh(Fi(t),i==="start",n);return s&&(o=o.map(r=>r+"-"+s),e&&(o=o.concat(o.map(dr)))),o}function As(t){const e=Fi(t);return qh[e]+t.slice(e.length)}function Jh(t){return{top:0,right:0,bottom:0,left:0,...t}}function Zh(t){return typeof t!="number"?Jh(t):{top:t,right:t,bottom:t,left:t}}function Ts(t){const{x:e,y:i,width:n,height:s}=t;return{width:n,height:s,top:i,left:e,right:e+n,bottom:i+s,x:e,y:i}}function rl(t,e,i){let{reference:n,floating:s}=t;const o=hi(e),r=Wc(e),l=qc(r),a=Fi(e),c=o==="y",u=n.x+n.width/2-s.width/2,d=n.y+n.height/2-s.height/2,p=n[l]/2-s[l]/2;let v;switch(a){case"top":v={x:u,y:n.y-s.height};break;case"bottom":v={x:u,y:n.y+n.height};break;case"right":v={x:n.x+n.width,y:d};break;case"left":v={x:n.x-s.width,y:d};break;default:v={x:n.x,y:n.y}}switch(Vs(e)){case"start":v[r]-=p*(i&&c?-1:1);break;case"end":v[r]+=p*(i&&c?-1:1);break}return v}async function ef(t,e){var i;e===void 0&&(e={});const{x:n,y:s,platform:o,rects:r,elements:l,strategy:a}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:v=0}=Ns(e,t),m=Zh(v),y=l[p?d==="floating"?"reference":"floating":d],S=Ts(await o.getClippingRect({element:(i=await(o.isElement==null?void 0:o.isElement(y)))==null||i?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:a})),b=d==="floating"?{x:n,y:s,width:r.floating.width,height:r.floating.height}:r.reference,x=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),w=await(o.isElement==null?void 0:o.isElement(x))?await(o.getScale==null?void 0:o.getScale(x))||{x:1,y:1}:{x:1,y:1},k=Ts(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:b,offsetParent:x,strategy:a}):b);return{top:(S.top-k.top+m.top)/w.y,bottom:(k.bottom-S.bottom+m.bottom)/w.y,left:(S.left-k.left+m.left)/w.x,right:(k.right-S.right+m.right)/w.x}}const tf=50,nf=async(t,e,i)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:r}=i,l=r.detectOverflow?r:{...r,detectOverflow:ef},a=await(r.isRTL==null?void 0:r.isRTL(e));let c=await r.getElementRects({reference:t,floating:e,strategy:s}),{x:u,y:d}=rl(c,n,a),p=n,v=0;const m={};for(let g=0;g<o.length;g++){const y=o[g];if(!y)continue;const{name:S,fn:b}=y,{x,y:w,data:k,reset:E}=await b({x:u,y:d,initialPlacement:n,placement:p,strategy:s,middlewareData:m,rects:c,platform:l,elements:{reference:t,floating:e}});u=x??u,d=w??d,m[S]={...m[S],...k},E&&v<tf&&(v++,typeof E=="object"&&(E.placement&&(p=E.placement),E.rects&&(c=E.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:s}):E.rects),{x:u,y:d}=rl(c,p,a)),g=-1)}return{x:u,y:d,placement:p,strategy:s,middlewareData:m}};const sf=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var i,n;const{placement:s,middlewareData:o,rects:r,initialPlacement:l,platform:a,elements:c}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=Ns(t,e);if((i=o.arrow)!=null&&i.alignmentOffset)return{};const S=Fi(s),b=hi(l),x=Fi(l)===l,w=await(a.isRTL==null?void 0:a.isRTL(c.floating)),k=p||(x||!g?[As(l)]:Qh(l)),E=m!=="none";!p&&E&&k.push(...Gh(l,g,m,w));const O=[l,...k],F=await a.detectOverflow(e,y),j=[];let R=((n=o.flip)==null?void 0:n.overflows)||[];if(u&&j.push(F[S]),d){const I=Wh(s,r,w);j.push(F[I[0]],F[I[1]])}if(R=[...R,{placement:s,overflows:j}],!j.every(I=>I<=0)){var T,D;const I=(((T=o.flip)==null?void 0:T.index)||0)+1,W=O[I];if(W&&(!(d==="alignment"?b!==hi(W):!1)||R.every(z=>hi(z.placement)===b?z.overflows[0]>0:!0)))return{data:{index:I,overflows:R},reset:{placement:W}};let J=(D=R.filter(L=>L.overflows[0]<=0).sort((L,z)=>L.overflows[1]-z.overflows[1])[0])==null?void 0:D.placement;if(!J)switch(v){case"bestFit":{var M;const L=(M=R.filter(z=>{if(E){const $=hi(z.placement);return $===b||$==="y"}return!0}).map(z=>[z.placement,z.overflows.filter($=>$>0).reduce(($,H)=>$+H,0)]).sort((z,$)=>z[1]-$[1])[0])==null?void 0:M[0];L&&(J=L);break}case"initialPlacement":J=l;break}if(s!==J)return{reset:{placement:J}}}return{}}}},of=new Set(["left","top"]);async function rf(t,e){const{placement:i,platform:n,elements:s}=t,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),r=Fi(i),l=Vs(i),a=hi(i)==="y",c=of.has(r)?-1:1,u=o&&a?-1:1,d=Ns(e,t);let{mainAxis:p,crossAxis:v,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof m=="number"&&(v=l==="end"?m*-1:m),a?{x:v*u,y:p*c}:{x:p*c,y:v*u}}const af=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var i,n;const{x:s,y:o,placement:r,middlewareData:l}=e,a=await rf(e,t);return r===((i=l.offset)==null?void 0:i.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:s+a.x,y:o+a.y,data:{...a,placement:r}}}}},lf=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:i,y:n,placement:s,platform:o}=e,{mainAxis:r=!0,crossAxis:l=!1,limiter:a={fn:S=>{let{x:b,y:x}=S;return{x:b,y:x}}},...c}=Ns(t,e),u={x:i,y:n},d=await o.detectOverflow(e,c),p=hi(Fi(s)),v=Vc(p);let m=u[v],g=u[p];if(r){const S=v==="y"?"top":"left",b=v==="y"?"bottom":"right",x=m+d[S],w=m-d[b];m=nl(x,m,w)}if(l){const S=p==="y"?"top":"left",b=p==="y"?"bottom":"right",x=g+d[S],w=g-d[b];g=nl(x,g,w)}const y=a.fn({...e,[v]:m,[p]:g});return{...y,data:{x:y.x-i,y:y.y-n,enabled:{[v]:r,[p]:l}}}}}};function qs(){return typeof window<"u"}function on(t){return Qc(t)?(t.nodeName||"").toLowerCase():"#document"}function ft(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Qt(t){var e;return(e=(Qc(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Qc(t){return qs()?t instanceof Node||t instanceof ft(t).Node:!1}function Ot(t){return qs()?t instanceof Element||t instanceof ft(t).Element:!1}function ni(t){return qs()?t instanceof HTMLElement||t instanceof ft(t).HTMLElement:!1}function al(t){return!qs()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ft(t).ShadowRoot}function Pn(t){const{overflow:e,overflowX:i,overflowY:n,display:s}=Pt(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+i)&&s!=="inline"&&s!=="contents"}function cf(t){return/^(table|td|th)$/.test(on(t))}function Ws(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const uf=/transform|translate|scale|rotate|perspective|filter/,df=/paint|layout|strict|content/,ki=t=>!!t&&t!=="none";let Ao;function Gr(t){const e=Ot(t)?Pt(t):t;return ki(e.transform)||ki(e.translate)||ki(e.scale)||ki(e.rotate)||ki(e.perspective)||!Jr()&&(ki(e.backdropFilter)||ki(e.filter))||uf.test(e.willChange||"")||df.test(e.contain||"")}function hf(t){let e=yi(t);for(;ni(e)&&!Ki(e);){if(Gr(e))return e;if(Ws(e))return null;e=yi(e)}return null}function Jr(){return Ao==null&&(Ao=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ao}function Ki(t){return/^(html|body|#document)$/.test(on(t))}function Pt(t){return ft(t).getComputedStyle(t)}function Qs(t){return Ot(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function yi(t){if(on(t)==="html")return t;const e=t.assignedSlot||t.parentNode||al(t)&&t.host||Qt(t);return al(e)?e.host:e}function Kc(t){const e=yi(t);return Ki(e)?t.ownerDocument?t.ownerDocument.body:t.body:ni(e)&&Pn(e)?e:Kc(e)}function _n(t,e,i){var n;e===void 0&&(e=[]),i===void 0&&(i=!0);const s=Kc(t),o=s===((n=t.ownerDocument)==null?void 0:n.body),r=ft(s);if(o){const l=hr(r);return e.concat(r,r.visualViewport||[],Pn(s)?s:[],l&&i?_n(l):[])}else return e.concat(s,_n(s,[],i))}function hr(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Yc(t){const e=Pt(t);let i=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const s=ni(t),o=s?t.offsetWidth:i,r=s?t.offsetHeight:n,l=Es(i)!==o||Es(n)!==r;return l&&(i=o,n=r),{width:i,height:n,$:l}}function Zr(t){return Ot(t)?t:t.contextElement}function Wi(t){const e=Zr(t);if(!ni(e))return Nt(1);const i=e.getBoundingClientRect(),{width:n,height:s,$:o}=Yc(e);let r=(o?Es(i.width):i.width)/n,l=(o?Es(i.height):i.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}const ff=Nt(0);function Xc(t){const e=ft(t);return!Jr()||!e.visualViewport?ff:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function pf(t,e,i){return e===void 0&&(e=!1),!i||e&&i!==ft(t)?!1:e}function $i(t,e,i,n){e===void 0&&(e=!1),i===void 0&&(i=!1);const s=t.getBoundingClientRect(),o=Zr(t);let r=Nt(1);e&&(n?Ot(n)&&(r=Wi(n)):r=Wi(t));const l=pf(o,i,n)?Xc(o):Nt(0);let a=(s.left+l.x)/r.x,c=(s.top+l.y)/r.y,u=s.width/r.x,d=s.height/r.y;if(o){const p=ft(o),v=n&&Ot(n)?ft(n):n;let m=p,g=hr(m);for(;g&&n&&v!==m;){const y=Wi(g),S=g.getBoundingClientRect(),b=Pt(g),x=S.left+(g.clientLeft+parseFloat(b.paddingLeft))*y.x,w=S.top+(g.clientTop+parseFloat(b.paddingTop))*y.y;a*=y.x,c*=y.y,u*=y.x,d*=y.y,a+=x,c+=w,m=ft(g),g=hr(m)}}return Ts({width:u,height:d,x:a,y:c})}function Ks(t,e){const i=Qs(t).scrollLeft;return e?e.left+i:$i(Qt(t)).left+i}function Gc(t,e){const i=t.getBoundingClientRect(),n=i.left+e.scrollLeft-Ks(t,i),s=i.top+e.scrollTop;return{x:n,y:s}}function mf(t){let{elements:e,rect:i,offsetParent:n,strategy:s}=t;const o=s==="fixed",r=Qt(n),l=e?Ws(e.floating):!1;if(n===r||l&&o)return i;let a={scrollLeft:0,scrollTop:0},c=Nt(1);const u=Nt(0),d=ni(n);if((d||!d&&!o)&&((on(n)!=="body"||Pn(r))&&(a=Qs(n)),d)){const v=$i(n);c=Wi(n),u.x=v.x+n.clientLeft,u.y=v.y+n.clientTop}const p=r&&!d&&!o?Gc(r,a):Nt(0);return{width:i.width*c.x,height:i.height*c.y,x:i.x*c.x-a.scrollLeft*c.x+u.x+p.x,y:i.y*c.y-a.scrollTop*c.y+u.y+p.y}}function vf(t){return Array.from(t.getClientRects())}function gf(t){const e=Qt(t),i=Qs(t),n=t.ownerDocument.body,s=Ti(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=Ti(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let r=-i.scrollLeft+Ks(t);const l=-i.scrollTop;return Pt(n).direction==="rtl"&&(r+=Ti(e.clientWidth,n.clientWidth)-s),{width:s,height:o,x:r,y:l}}const ll=25;function _f(t,e){const i=ft(t),n=Qt(t),s=i.visualViewport;let o=n.clientWidth,r=n.clientHeight,l=0,a=0;if(s){o=s.width,r=s.height;const u=Jr();(!u||u&&e==="fixed")&&(l=s.offsetLeft,a=s.offsetTop)}const c=Ks(n);if(c<=0){const u=n.ownerDocument,d=u.body,p=getComputedStyle(d),v=u.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,m=Math.abs(n.clientWidth-d.clientWidth-v);m<=ll&&(o-=m)}else c<=ll&&(o+=c);return{width:o,height:r,x:l,y:a}}function yf(t,e){const i=$i(t,!0,e==="fixed"),n=i.top+t.clientTop,s=i.left+t.clientLeft,o=ni(t)?Wi(t):Nt(1),r=t.clientWidth*o.x,l=t.clientHeight*o.y,a=s*o.x,c=n*o.y;return{width:r,height:l,x:a,y:c}}function cl(t,e,i){let n;if(e==="viewport")n=_f(t,i);else if(e==="document")n=gf(Qt(t));else if(Ot(e))n=yf(e,i);else{const s=Xc(t);n={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return Ts(n)}function Jc(t,e){const i=yi(t);return i===e||!Ot(i)||Ki(i)?!1:Pt(i).position==="fixed"||Jc(i,e)}function wf(t,e){const i=e.get(t);if(i)return i;let n=_n(t,[],!1).filter(l=>Ot(l)&&on(l)!=="body"),s=null;const o=Pt(t).position==="fixed";let r=o?yi(t):t;for(;Ot(r)&&!Ki(r);){const l=Pt(r),a=Gr(r);!a&&l.position==="fixed"&&(s=null),(o?!a&&!s:!a&&l.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||Pn(r)&&!a&&Jc(t,r))?n=n.filter(u=>u!==r):s=l,r=yi(r)}return e.set(t,n),n}function bf(t){let{element:e,boundary:i,rootBoundary:n,strategy:s}=t;const r=[...i==="clippingAncestors"?Ws(e)?[]:wf(e,this._c):[].concat(i),n],l=cl(e,r[0],s);let a=l.top,c=l.right,u=l.bottom,d=l.left;for(let p=1;p<r.length;p++){const v=cl(e,r[p],s);a=Ti(v.top,a),c=Cs(v.right,c),u=Cs(v.bottom,u),d=Ti(v.left,d)}return{width:c-d,height:u-a,x:d,y:a}}function xf(t){const{width:e,height:i}=Yc(t);return{width:e,height:i}}function Sf(t,e,i){const n=ni(e),s=Qt(e),o=i==="fixed",r=$i(t,!0,o,e);let l={scrollLeft:0,scrollTop:0};const a=Nt(0);function c(){a.x=Ks(s)}if(n||!n&&!o)if((on(e)!=="body"||Pn(s))&&(l=Qs(e)),n){const v=$i(e,!0,o,e);a.x=v.x+e.clientLeft,a.y=v.y+e.clientTop}else s&&c();o&&!n&&s&&c();const u=s&&!n&&!o?Gc(s,l):Nt(0),d=r.left+l.scrollLeft-a.x-u.x,p=r.top+l.scrollTop-a.y-u.y;return{x:d,y:p,width:r.width,height:r.height}}function To(t){return Pt(t).position==="static"}function ul(t,e){if(!ni(t)||Pt(t).position==="fixed")return null;if(e)return e(t);let i=t.offsetParent;return Qt(t)===i&&(i=i.ownerDocument.body),i}function Zc(t,e){const i=ft(t);if(Ws(t))return i;if(!ni(t)){let s=yi(t);for(;s&&!Ki(s);){if(Ot(s)&&!To(s))return s;s=yi(s)}return i}let n=ul(t,e);for(;n&&cf(n)&&To(n);)n=ul(n,e);return n&&Ki(n)&&To(n)&&!Gr(n)?i:n||hf(t)||i}const kf=async function(t){const e=this.getOffsetParent||Zc,i=this.getDimensions,n=await i(t.floating);return{reference:Sf(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Cf(t){return Pt(t).direction==="rtl"}const Ef={convertOffsetParentRelativeRectToViewportRelativeRect:mf,getDocumentElement:Qt,getClippingRect:bf,getOffsetParent:Zc,getElementRects:kf,getClientRects:vf,getDimensions:xf,getScale:Wi,isElement:Ot,isRTL:Cf};function eu(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Af(t,e){let i=null,n;const s=Qt(t);function o(){var l;clearTimeout(n),(l=i)==null||l.disconnect(),i=null}function r(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),o();const c=t.getBoundingClientRect(),{left:u,top:d,width:p,height:v}=c;if(l||e(),!p||!v)return;const m=Zn(d),g=Zn(s.clientWidth-(u+p)),y=Zn(s.clientHeight-(d+v)),S=Zn(u),x={rootMargin:-m+"px "+-g+"px "+-y+"px "+-S+"px",threshold:Ti(0,Cs(1,a))||1};let w=!0;function k(E){const O=E[0].intersectionRatio;if(O!==a){if(!w)return r();O?r(!1,O):n=setTimeout(()=>{r(!1,1e-7)},1e3)}O===1&&!eu(c,t.getBoundingClientRect())&&r(),w=!1}try{i=new IntersectionObserver(k,{...x,root:s.ownerDocument})}catch{i=new IntersectionObserver(k,x)}i.observe(t)}return r(!0),o}function ea(t,e,i,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=n,c=Zr(t),u=s||o?[...c?_n(c):[],...e?_n(e):[]]:[];u.forEach(S=>{s&&S.addEventListener("scroll",i,{passive:!0}),o&&S.addEventListener("resize",i)});const d=c&&l?Af(c,i):null;let p=-1,v=null;r&&(v=new ResizeObserver(S=>{let[b]=S;b&&b.target===c&&v&&e&&(v.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=v)==null||x.observe(e)})),i()}),c&&!a&&v.observe(c),e&&v.observe(e));let m,g=a?$i(t):null;a&&y();function y(){const S=$i(t);g&&!eu(g,S)&&i(),g=S,m=requestAnimationFrame(y)}return i(),()=>{var S;u.forEach(b=>{s&&b.removeEventListener("scroll",i),o&&b.removeEventListener("resize",i)}),d?.(),(S=v)==null||S.disconnect(),v=null,a&&cancelAnimationFrame(m)}}const yn=af,wn=lf,bn=sf;const Yi=(t,e,i)=>{const n=new Map,s={platform:Ef,...i},o={...s.platform,_c:n};return nf(t,e,{...s,platform:o})};function Tf(t){return{all:t=t||new Map,on:function(e,i){var n=t.get(e);n?n.push(i):t.set(e,[i])},off:function(e,i){var n=t.get(e);n&&(i?n.splice(n.indexOf(i)>>>0,1):t.set(e,[]))},emit:function(e,i){var n=t.get(e);n&&n.slice().map(function(s){s(i)}),(n=t.get("*"))&&n.slice().map(function(s){s(e,i)})}}}function ce(t){let e=Kr();if(typeof window<"u"){let i=t.subscribe(n=>{e.value=n});Th()&&Mh(i)}else e.value=t.get();return e}let Et=[],oi=0;const es=4,gs=globalThis.nanostoresGlobal||={epoch:0},Xe=t=>{let e=[],i={get(){return i.lc||i.listen(()=>{})(),i.value},init:t,lc:0,listen(n){return i.lc=e.push(n),()=>{for(let o=oi+es;o<Et.length;)Et[o]===n?Et.splice(o,es):o+=es;let s=e.indexOf(n);~s&&(e.splice(s,1),--i.lc||i.off())}},notify(n,s){gs.epoch++;let o=!Et.length;for(let r of e)Et.push(r,i.value,n,s);if(o){for(oi=0;oi<Et.length;oi+=es)Et[oi](Et[oi+1],Et[oi+2],Et[oi+3]);Et.length=0}},off(){},set(n){let s=i.value;s!==n&&(i.value=n,i.notify(s))},subscribe(n){let s=i.listen(n);return n(i.value),s},value:t};return i},Mf=5,ts=6,is=10;let Rf=(t,e,i,n)=>(t.events=t.events||{},t.events[i+is]||(t.events[i+is]=n(s=>{t.events[i].reduceRight((o,r)=>(r(o),o),{shared:{},...s})})),t.events[i]=t.events[i]||[],t.events[i].push(e),()=>{let s=t.events[i],o=s.indexOf(e);s.splice(o,1),s.length||(delete t.events[i],t.events[i+is](),delete t.events[i+is])});const Ff=1e3;let tu=(t,e)=>Rf(t,n=>{let s=e(n);s&&t.events[ts].push(s)},Mf,n=>{let s=t.listen;t.listen=(...r)=>(!t.lc&&!t.active&&(t.active=!0,n()),s(...r));let o=t.off;return t.events[ts]=[],t.off=()=>{o(),setTimeout(()=>{if(t.active&&!t.lc){t.active=!1;for(let r of t.events[ts])r();t.events[ts]=[]}},Ff)},()=>{t.listen=s,t.off=o}}),$f=(t,e,i)=>{Array.isArray(t)||(t=[t]);let n,s,o=()=>{if(s===gs.epoch)return;s=gs.epoch;let c=t.map(u=>u.get());if(!n||c.some((u,d)=>u!==n[d])){n=c;let u=e(...c);u&&u.then&&u.t?u.then(d=>{n===c&&r.set(d)}):(r.set(u),s=gs.epoch)}},r=Xe(void 0),l=r.get;r.get=()=>(o(),l());let a=o;return tu(r,()=>{let c=t.map(u=>u.listen(a));return o(),()=>{for(let u of c)u()}}),r};const ci=(t,e)=>$f(t,e);let dl=t=>t,Xt={},fr={addEventListener(){},removeEventListener(){}};function Of(){try{return typeof localStorage<"u"}catch{return!1}}Of()&&(Xt=localStorage);let Pf={addEventListener(t,e,i){window.addEventListener("storage",e),window.addEventListener("pageshow",i)},removeEventListener(t,e,i){window.removeEventListener("storage",e),window.removeEventListener("pageshow",i)}};typeof window<"u"&&(fr=Pf);function iu(t,e,i={}){let n=i.encode||dl,s=i.decode||dl,o=Xt[t],r=Xe(t in Xt?s(o):e),l=r.set;r.set=u=>{o=n(u),typeof o>"u"?delete Xt[t]:Xt[t]=o,l(u)};function a(u){u.key===t?u.newValue===null?l(e):l(s(u.newValue)):t in Xt||l(e)}function c(){o!==Xt[t]&&r.set(t in Xt?s(Xt[t]):e)}return tu(r,()=>{if(c(),i.listen!==!1)return fr.addEventListener(t,a,c),()=>{fr.removeEventListener(t,a,c)}}),r}let pr=1;var zf=class{subscribers;toasts;dismissedToasts;constructor(){this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}subscribe=t=>(this.subscribers.push(t),()=>{const e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)});publish=t=>{this.subscribers.forEach(e=>e(t))};addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]};create=t=>{const{message:e,...i}=t,n=typeof t.id=="number"||t.id&&t.id?.length>0?t.id:pr++,s=this.toasts.find(r=>r.id===n),o=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(n)&&this.dismissedToasts.delete(n),s?this.toasts=this.toasts.map(r=>r.id===n?(this.publish({...r,...t,id:n,title:e}),{...r,...t,id:n,dismissible:o,title:e}):r):this.addToast({title:e,...i,dismissible:o,id:n}),n};dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(e=>e({id:t,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(i=>i({id:e.id,dismiss:!0}))}),t);message=(t,e)=>this.create({...e,message:t,type:"default"});error=(t,e)=>this.create({...e,type:"error",message:t});success=(t,e)=>this.create({...e,type:"success",message:t});info=(t,e)=>this.create({...e,type:"info",message:t});warning=(t,e)=>this.create({...e,type:"warning",message:t});loading=(t,e)=>this.create({...e,type:"loading",message:t});promise=(t,e)=>{if(!e)return;let i;e.loading!==void 0&&(i=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));const n=Promise.resolve(t instanceof Function?t():t);let s=i!==void 0,o;const r=n.then(async a=>{if(o=["resolve",a],fn(a))s=!1,this.create({id:i,type:"default",message:a});else if(If(a)&&!a.ok){s=!1;const u=typeof e.error=="function"?await e.error(`HTTP error! status: ${a.status}`):e.error,d=typeof e.description=="function"?await e.description(`HTTP error! status: ${a.status}`):e.description,v=typeof u=="object"&&!fn(u)?u:{message:u||"",id:i||""};this.create({id:i,type:"error",description:d,...v})}else if(a instanceof Error){s=!1;const u=typeof e.error=="function"?await e.error(a):e.error,d=typeof e.description=="function"?await e.description(a):e.description,v=typeof u=="object"&&!fn(u)?u:{message:u||"",id:i||""};this.create({id:i,type:"error",description:d,...v})}else if(e.success!==void 0){s=!1;const u=typeof e.success=="function"?await e.success(a):e.success,d=typeof e.description=="function"?await e.description(a):e.description,v=typeof u=="object"&&!fn(u)?u:{message:u||"",id:i||""};this.create({id:i,type:"success",description:d,...v})}}).catch(async a=>{if(o=["reject",a],e.error!==void 0){s=!1;const c=typeof e.error=="function"?await e.error(a):e.error,u=typeof e.description=="function"?await e.description(a):e.description,p=typeof c=="object"&&!fn(c)?c:{message:c||"",id:i||""};this.create({id:i,type:"error",description:u,...p})}}).finally(()=>{s&&(this.dismiss(i),i=void 0),e.finally?.()}),l=()=>new Promise((a,c)=>r.then(()=>o[0]==="reject"?c(o[1]):a(o[1])).catch(c));return typeof i!="string"&&typeof i!="number"?{unwrap:l}:Object.assign(i,{unwrap:l})};custom=(t,e)=>{const i=e?.id||pr++,n=this.toasts.find(o=>o.id===i),s=e?.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),n?this.toasts=this.toasts.map(o=>o.id===i?(this.publish({...o,component:t,dismissible:s,id:i,...e}),{...o,component:t,dismissible:s,id:i,...e}):o):this.addToast({component:t,dismissible:s,id:i,...e}),i};getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id))};const nt=new zf;function Df(t,e){const i=e?.id||pr++;return nt.create({message:t,id:i,type:"default",...e}),i}const If=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",Lf=Df,Bf=()=>nt.toasts,Uf=()=>nt.getActiveToasts(),ns=Object.assign(Lf,{success:nt.success,info:nt.info,warning:nt.warning,error:nt.error,custom:nt.custom,message:nt.message,promise:nt.promise,dismiss:nt.dismiss,loading:nt.loading},{getHistory:Bf,getToasts:Uf});function ss(t){return t.label!==void 0}const jf=3,nu="24px",su="16px",hl=4e3,Hf=356,Nf=14,Vf=45,ou=200;function qf(){const t=U(!1);return Zt(()=>{const e=()=>{t.value=document.hidden};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)}),{isDocumentHidden:t}}function ri(...t){return t.filter(Boolean).join(" ")}function Wf(t){const[e,i]=t.split("-"),n=[];return e&&n.push(e),i&&n.push(i),n}function Qf(t,e){const i={};return[t,e].forEach((n,s)=>{const o=s===1,r=o?"--mobile-offset":"--offset",l=o?su:nu;function a(c){["top","right","bottom","left"].forEach(u=>{i[`${r}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof n=="number"||typeof n=="string"?a(n):typeof n=="object"?["top","right","bottom","left"].forEach(c=>{n[c]===void 0?i[`${r}-${c}`]=l:i[`${r}-${c}`]=typeof n[c]=="number"?`${n[c]}px`:n[c]}):a(l)}),i}const Kf=["data-rich-colors","data-styled","data-mounted","data-promise","data-swiped","data-removed","data-visible","data-y-position","data-x-position","data-index","data-front","data-swiping","data-dismissible","data-type","data-invert","data-swipe-out","data-swipe-direction","data-expanded","data-testid"],Yf=["aria-label","data-disabled","data-close-button-position"];var Xf=fe({__name:"Toast",props:{toast:{},toasts:{},index:{},swipeDirections:{},expanded:{type:Boolean},invert:{type:Boolean},heights:{},gap:{},position:{},closeButtonPosition:{},visibleToasts:{},expandByDefault:{type:Boolean},closeButton:{type:Boolean},interacting:{type:Boolean},style:{},cancelButtonStyle:{},actionButtonStyle:{},duration:{},class:{},unstyled:{type:Boolean},descriptionClass:{},loadingIcon:{},classes:{},icons:{},closeButtonAriaLabel:{},defaultRichColors:{type:Boolean}},emits:["update:heights","update:height","removeToast"],setup(t,{emit:e}){const i=t,n=e,s=U(null),o=U(null),r=U(!1),l=U(!1),a=U(!1),c=U(!1),u=U(!1),d=U(0),p=U(0),v=U(i.toast.duration||i.duration||hl),m=U(null),g=U(null),y=Z(()=>i.index===0),S=Z(()=>i.index+1<=i.visibleToasts),b=Z(()=>i.toast.type),x=Z(()=>i.toast.dismissible!==!1),w=Z(()=>i.toast.class||""),k=Z(()=>i.descriptionClass||""),E=Z(()=>{const A=i.toast.position||i.position,G=i.heights.filter(N=>N.position===A).findIndex(N=>N.toastId===i.toast.id);return G>=0?G:0}),O=Z(()=>{const A=i.toast.position||i.position;return i.heights.filter(G=>G.position===A).reduce((G,N,ae)=>ae>=E.value?G:G+N.height,0)}),F=Z(()=>E.value*i.gap+O.value||0),j=Z(()=>i.toast.closeButton??i.closeButton),R=Z(()=>i.toast.duration||i.duration||hl),T=U(0),D=U(0),M=U(null),I=Z(()=>i.position.split("-")),W=Z(()=>I.value[0]),J=Z(()=>I.value[1]),L=Z(()=>typeof i.toast.title!="string"),z=Z(()=>typeof i.toast.description!="string"),{isDocumentHidden:$}=qf(),H=Z(()=>b.value&&b.value==="loading");Re(()=>{r.value=!0,v.value=R.value}),Zt(async()=>{if(!r.value||!g.value)return;await lt();const A=g.value,ie=A.style.height;A.style.height="auto";const G=A.getBoundingClientRect().height;A.style.height=ie,p.value=G,n("update:height",{toastId:i.toast.id,height:G,position:i.toast.position||i.position})});function B(){l.value=!0,d.value=F.value,setTimeout(()=>{n("removeToast",i.toast)},ou)}function Q(){if(H.value||!x.value)return{};B(),i.toast.onDismiss?.(i.toast)}function ne(A){A.button!==2&&(H.value||!x.value||(m.value=new Date,d.value=F.value,A.target.setPointerCapture(A.pointerId),A.target.tagName!=="BUTTON"&&(a.value=!0,M.value={x:A.clientX,y:A.clientY})))}function Y(){if(c.value||!x.value)return;M.value=null;const A=Number(g.value?.style.getPropertyValue("--swipe-amount-x").replace("px","")||0),ie=Number(g.value?.style.getPropertyValue("--swipe-amount-y").replace("px","")||0),G=new Date().getTime()-(m.value?.getTime()||0),N=s.value==="x"?A:ie,ae=Math.abs(N)/G;if(Math.abs(N)>=Vf||ae>.11){d.value=F.value,i.toast.onDismiss?.(i.toast),s.value==="x"?o.value=A>0?"right":"left":o.value=ie>0?"down":"up",B(),c.value=!0;return}else g.value?.style.setProperty("--swipe-amount-x","0px"),g.value?.style.setProperty("--swipe-amount-y","0px");u.value=!1,a.value=!1,s.value=null}function se(A){if(!M.value||!x.value||(window?.getSelection()?.toString()?.length??!1))return;const G=A.clientY-M.value.y,N=A.clientX-M.value.x,ae=i.swipeDirections??Wf(i.position);!s.value&&(Math.abs(N)>1||Math.abs(G)>1)&&(s.value=Math.abs(N)>Math.abs(G)?"x":"y");let le={x:0,y:0};const q=V=>1/(1.5+Math.abs(V)/20);if(s.value==="y"){if(ae.includes("top")||ae.includes("bottom"))if(ae.includes("top")&&G<0||ae.includes("bottom")&&G>0)le.y=G;else{const V=G*q(G);le.y=Math.abs(V)<Math.abs(G)?V:G}}else if(s.value==="x"&&(ae.includes("left")||ae.includes("right")))if(ae.includes("left")&&N<0||ae.includes("right")&&N>0)le.x=N;else{const V=N*q(N);le.x=Math.abs(V)<Math.abs(N)?V:N}(Math.abs(le.x)>0||Math.abs(le.y)>0)&&(u.value=!0),g.value?.style.setProperty("--swipe-amount-x",`${le.x}px`),g.value?.style.setProperty("--swipe-amount-y",`${le.y}px`)}Re(()=>{if(r.value=!0,!g.value)return;const A=g.value.getBoundingClientRect().height;p.value=A;const ie=[{toastId:i.toast.id,height:A,position:i.toast.position},...i.heights];n("update:heights",ie)}),Yr(()=>{g.value&&n("removeToast",i.toast)}),Zt(A=>{if(i.toast.promise&&b.value==="loading"||i.toast.duration===1/0||i.toast.type==="loading")return;let ie;const G=()=>{if(D.value<T.value){const ae=new Date().getTime()-T.value;v.value=v.value-ae}D.value=new Date().getTime()},N=()=>{v.value!==1/0&&(T.value=new Date().getTime(),ie=setTimeout(()=>{i.toast.onAutoClose?.(i.toast),B()},v.value))};i.expanded||i.interacting||$.value?G():N(),A(()=>{clearTimeout(ie)})}),ve(()=>i.toast.delete,A=>{A!==void 0&&A&&(B(),i.toast.onDismiss?.(i.toast))},{deep:!0});function te(){a.value=!1,s.value=null,M.value=null}return(A,ie)=>(_(),C("li",{tabindex:"0",ref_key:"toastRef",ref:g,class:ue(h(ri)(i.class,w.value,A.classes?.toast,A.toast.classes?.toast,A.classes?.[b.value],A.toast?.classes?.[b.value])),"data-sonner-toast":"","data-rich-colors":A.toast.richColors??A.defaultRichColors,"data-styled":!(A.toast.component||A.toast?.unstyled||A.unstyled),"data-mounted":r.value,"data-promise":!!A.toast.promise,"data-swiped":u.value,"data-removed":l.value,"data-visible":S.value,"data-y-position":W.value,"data-x-position":J.value,"data-index":A.index,"data-front":y.value,"data-swiping":a.value,"data-dismissible":x.value,"data-type":b.value,"data-invert":A.toast.invert||A.invert,"data-swipe-out":c.value,"data-swipe-direction":o.value,"data-expanded":!!(A.expanded||A.expandByDefault&&r.value),"data-testid":A.toast.testId,style:et({"--index":A.index,"--toasts-before":A.index,"--z-index":A.toasts.length-A.index,"--offset":`${l.value?d.value:F.value}px`,"--initial-height":A.expandByDefault?"auto":`${p.value}px`,...A.style,...i.toast.style}),onDragend:te,onPointerdown:ne,onPointerup:Y,onPointermove:se},[j.value&&!A.toast.component&&b.value!=="loading"?(_(),C("button",{key:0,"aria-label":A.closeButtonAriaLabel||"Close toast","data-disabled":H.value,"data-close-button":"true","data-close-button-position":A.closeButtonPosition,class:ue(h(ri)(A.classes?.closeButton,A.toast?.classes?.closeButton)),onClick:Q},[A.icons?.close?(_(),X(Rt(A.icons?.close),{key:0})):xe(A.$slots,"close-icon",{key:1})],10,Yf)):K("v-if",!0),A.toast.component?(_(),X(Rt(A.toast.component),We({key:1},A.toast.componentProps,{onCloseToast:Q,isPaused:A.$props.expanded||A.$props.interacting||h($)}),null,16,["isPaused"])):(_(),C(_e,{key:2},[b.value!=="default"||A.toast.icon||A.toast.promise?(_(),C("div",{key:0,"data-icon":"",class:ue(h(ri)(A.classes?.icon,A.toast?.classes?.icon))},[A.toast.icon?(_(),X(Rt(A.toast.icon),{key:0})):(_(),C(_e,{key:1},[b.value==="loading"?xe(A.$slots,"loading-icon",{key:0}):b.value==="success"?xe(A.$slots,"success-icon",{key:1}):b.value==="error"?xe(A.$slots,"error-icon",{key:2}):b.value==="warning"?xe(A.$slots,"warning-icon",{key:3}):b.value==="info"?xe(A.$slots,"info-icon",{key:4}):K("v-if",!0)],64))],2)):K("v-if",!0),f("div",{"data-content":"",class:ue(h(ri)(A.classes?.content,A.toast?.classes?.content))},[f("div",{"data-title":"",class:ue(h(ri)(A.classes?.title,A.toast.classes?.title))},[L.value?(_(),X(Rt(A.toast.title),Ht(We({key:0},A.toast.componentProps)),null,16)):(_(),C(_e,{key:1},[Me(P(A.toast.title),1)],64))],2),A.toast.description?(_(),C("div",{key:0,"data-description":"",class:ue(h(ri)(A.descriptionClass,k.value,A.classes?.description,A.toast.classes?.description))},[z.value?(_(),X(Rt(A.toast.description),Ht(We({key:0},A.toast.componentProps)),null,16)):(_(),C(_e,{key:1},[Me(P(A.toast.description),1)],64))],2)):K("v-if",!0)],2),A.toast.cancel?(_(),C("button",{key:1,style:et(A.toast.cancelButtonStyle||A.cancelButtonStyle),class:ue(h(ri)(A.classes?.cancelButton,A.toast.classes?.cancelButton)),"data-button":"","data-cancel":"",onClick:ie[0]||(ie[0]=G=>{h(ss)(A.toast.cancel)&&x.value&&(A.toast.cancel.onClick?.(G),B())})},P(h(ss)(A.toast.cancel)?A.toast.cancel?.label:A.toast.cancel),7)):K("v-if",!0),A.toast.action?(_(),C("button",{key:2,style:et(A.toast.actionButtonStyle||A.actionButtonStyle),class:ue(h(ri)(A.classes?.actionButton,A.toast.classes?.actionButton)),"data-button":"","data-action":"",onClick:ie[1]||(ie[1]=G=>{h(ss)(A.toast.action)&&(A.toast.action.onClick?.(G),!G.defaultPrevented&&B())})},P(h(ss)(A.toast.action)?A.toast.action?.label:A.toast.action),7)):K("v-if",!0)],64))],46,Kf))}}),Gf=Xf,zn=(t,e)=>{const i=t.__vccOpts||t;for(const[n,s]of e)i[n]=s;return i};const Jf={},Zf={xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stoke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"};function ep(t,e){return _(),C("svg",Zf,e[0]||(e[0]=[f("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1),f("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)]))}var tp=zn(Jf,[["render",ep]]);const ip=["data-visible"],np={class:"sonner-spinner"};var sp=fe({__name:"Loader",props:{visible:{type:Boolean}},setup(t){const e=Array(12).fill(0);return(i,n)=>(_(),C("div",{class:"sonner-loading-wrapper","data-visible":i.visible},[f("div",np,[(_(!0),C(_e,null,$e(h(e),s=>(_(),C("div",{key:`spinner-bar-${s}`,class:"sonner-loading-bar"}))),128))])],8,ip))}}),op=sp;const rp={},ap={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"};function lp(t,e){return _(),C("svg",ap,e[0]||(e[0]=[f("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z","clip-rule":"evenodd"},null,-1)]))}var cp=zn(rp,[["render",lp]]);const up={},dp={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"};function hp(t,e){return _(),C("svg",dp,e[0]||(e[0]=[f("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z","clip-rule":"evenodd"},null,-1)]))}var fp=zn(up,[["render",hp]]);const pp={},mp={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"};function vp(t,e){return _(),C("svg",mp,e[0]||(e[0]=[f("path",{"fill-rule":"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z","clip-rule":"evenodd"},null,-1)]))}var gp=zn(pp,[["render",vp]]);const _p={},yp={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"};function wp(t,e){return _(),C("svg",yp,e[0]||(e[0]=[f("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z","clip-rule":"evenodd"},null,-1)]))}var bp=zn(_p,[["render",wp]]);const xp=["aria-label"],Sp=["data-sonner-theme","dir","data-theme","data-rich-colors","data-y-position","data-x-position"],kp=typeof window<"u"&&typeof document<"u";function Cp(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}var Ep=fe({name:"Toaster",inheritAttrs:!1,__name:"Toaster",props:{id:{},invert:{type:Boolean,default:!1},theme:{default:"light"},position:{default:"bottom-right"},closeButtonPosition:{default:"top-left"},hotkey:{default:()=>["altKey","KeyT"]},richColors:{type:Boolean,default:!1},expand:{type:Boolean,default:!1},duration:{},gap:{default:Nf},visibleToasts:{default:jf},closeButton:{type:Boolean,default:!1},toastOptions:{default:()=>({})},class:{default:""},style:{},offset:{default:nu},mobileOffset:{default:su},dir:{default:"auto"},swipeDirections:{},icons:{},containerAriaLabel:{default:"Notifications"}},setup(t){const e=t,i=Rh(),n=U([]),s=Z(()=>e.id?n.value.filter(R=>R.toasterId===e.id):n.value.filter(R=>!R.toasterId));function o(R,T){return s.value.filter(D=>!D.position&&T===0||D.position===R)}const r=Z(()=>{const R=s.value.filter(T=>T.position).map(T=>T.position);return R.length>0?Array.from(new Set([e.position].concat(R))):[e.position]}),l=Z(()=>{const R={};return r.value.forEach(T=>{R[T]=n.value.filter(D=>D.position===T)}),R}),a=U([]),c=U({}),u=U(!1);Zt(()=>{r.value.forEach(R=>{R in c.value||(c.value[R]=!1)})});const d=U(e.theme!=="system"?e.theme:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),p=U(null),v=U(null),m=U(!1),g=e.hotkey.join("+").replace(/Key/g,"").replace(/Digit/g,"");function y(R){n.value.find(T=>T.id===R.id)?.delete||nt.dismiss(R.id),n.value=n.value.filter(({id:T})=>T!==R.id),setTimeout(()=>{n.value.find(T=>T.id===R.id)||(a.value=a.value.filter(T=>T.toastId!==R.id))},ou+50)}function S(R){m.value&&!R.currentTarget?.contains?.(R.relatedTarget)&&(m.value=!1,v.value&&(v.value.focus({preventScroll:!0}),v.value=null))}function b(R){R.target instanceof HTMLElement&&R.target.dataset.dismissible==="false"||m.value||(m.value=!0,v.value=R.relatedTarget)}function x(R){R.target&&R.target instanceof HTMLElement&&R.target.dataset.dismissible==="false"||(u.value=!0)}Zt(R=>{const T=nt.subscribe(D=>{if(D.dismiss){requestAnimationFrame(()=>{n.value=n.value.map(M=>M.id===D.id?{...M,delete:!0}:M)});return}lt(()=>{const M=n.value.findIndex(I=>I.id===D.id);M!==-1?n.value=[...n.value.slice(0,M),{...n.value[M],...D},...n.value.slice(M+1)]:n.value=[D,...n.value]})});R(T)}),Zt(R=>{if(typeof window>"u")return;if(e.theme!=="system"){d.value=e.theme;return}const T=window.matchMedia("(prefers-color-scheme: dark)"),D=I=>{d.value=I?"dark":"light"};D(T.matches);const M=I=>{D(I.matches)};try{T.addEventListener("change",M)}catch{T.addListener(M)}R(()=>{try{T.removeEventListener("change",M)}catch{T.removeListener(M)}})}),Zt(()=>{p.value&&v.value&&(v.value.focus({preventScroll:!0}),v.value=null,m.value=!1)}),Zt(()=>{n.value.length<=1&&Object.keys(c.value).forEach(R=>{c.value[R]=!1})}),Zt(R=>{function T(D){const M=e.hotkey.every(J=>D[J]||D.code===J),I=Array.isArray(p.value)?p.value[0]:p.value;M&&(r.value.forEach(J=>{c.value[J]=!0}),I?.focus());const W=document.activeElement===p.value||I?.contains(document.activeElement);D.code==="Escape"&&W&&r.value.forEach(J=>{c.value[J]=!1})}kp&&(document.addEventListener("keydown",T),R(()=>{document.removeEventListener("keydown",T)}))});function w(R){const T=R.currentTarget,D=T.getAttribute("data-y-position")+"-"+T.getAttribute("data-x-position");c.value[D]=!0}function k(R){if(!u.value){const T=R.currentTarget,D=T.getAttribute("data-y-position")+"-"+T.getAttribute("data-x-position");c.value[D]=!1}}function E(){Object.keys(c.value).forEach(R=>{c.value[R]=!1})}function O(){u.value=!1}function F(R){a.value=R}function j(R){const T=a.value.findIndex(D=>D.toastId===R.toastId);if(T!==-1)a.value[T]=R;else{const D=a.value.findIndex(M=>M.position===R.position);D!==-1?a.value.splice(D,0,R):a.value.unshift(R)}}return(R,T)=>(_(),C(_e,null,[K(" Remove item from normal navigation flow, only available via hotkey "),f("section",{"aria-label":`${R.containerAriaLabel} ${h(g)}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false"},[(_(!0),C(_e,null,$e(r.value,(D,M)=>(_(),C("ol",We({key:D,ref_for:!0,ref_key:"listRef",ref:p,"data-sonner-toaster":"","data-sonner-theme":d.value,class:e.class,dir:R.dir==="auto"?Cp():R.dir,tabIndex:-1,"data-theme":R.theme,"data-rich-colors":R.richColors,"data-y-position":D.split("-")[0],"data-x-position":D.split("-")[1],style:{"--front-toast-height":`${a.value[0]?.height||0}px`,"--width":`${h(Hf)}px`,"--gap":`${R.gap}px`,...R.style,...h(i).style,...h(Qf)(R.offset,R.mobileOffset)}},{ref_for:!0},R.$attrs,{onBlur:S,onFocus:b,onMouseenter:w,onMousemove:w,onMouseleave:k,onDragend:E,onPointerdown:x,onPointerup:O}),[(_(!0),C(_e,null,$e(o(D,M),(I,W)=>(_(),X(Gf,{key:I.id,heights:a.value,icons:R.icons,index:W,toast:I,defaultRichColors:R.richColors,duration:R.toastOptions?.duration??R.duration,class:ue(R.toastOptions?.class??""),descriptionClass:R.toastOptions?.descriptionClass,invert:R.invert,visibleToasts:R.visibleToasts,closeButton:R.toastOptions?.closeButton??R.closeButton,interacting:u.value,position:D,closeButtonPosition:R.toastOptions?.closeButtonPosition??R.closeButtonPosition,style:et(R.toastOptions?.style),unstyled:R.toastOptions?.unstyled,classes:R.toastOptions?.classes,cancelButtonStyle:R.toastOptions?.cancelButtonStyle,actionButtonStyle:R.toastOptions?.actionButtonStyle,"close-button-aria-label":R.toastOptions?.closeButtonAriaLabel,toasts:l.value[D],expandByDefault:R.expand,gap:R.gap,expanded:c.value[D]||!1,swipeDirections:e.swipeDirections,"onUpdate:heights":F,"onUpdate:height":j,onRemoveToast:y},{"close-icon":he(()=>[xe(R.$slots,"close-icon",{},()=>[ee(tp)])]),"loading-icon":he(()=>[xe(R.$slots,"loading-icon",{},()=>[ee(op,{visible:I.type==="loading"},null,8,["visible"])])]),"success-icon":he(()=>[xe(R.$slots,"success-icon",{},()=>[ee(cp)])]),"error-icon":he(()=>[xe(R.$slots,"error-icon",{},()=>[ee(bp)])]),"warning-icon":he(()=>[xe(R.$slots,"warning-icon",{},()=>[ee(gp)])]),"info-icon":he(()=>[xe(R.$slots,"info-icon",{},()=>[ee(fp)])]),_:2},1032,["heights","icons","index","toast","defaultRichColors","duration","class","descriptionClass","invert","visibleToasts","closeButton","interacting","position","closeButtonPosition","style","unstyled","classes","cancelButtonStyle","actionButtonStyle","close-button-aria-label","toasts","expandByDefault","gap","expanded","swipeDirections"]))),128))],16,Sp))),128))],8,xp)],2112))}}),Ap=Ep,Ys=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Tp=class extends Ys{#e;#t;#i;constructor(){super(),this.#i=t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#i)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#i=t,this.#t?.(),this.#t=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},ru=new Tp,Mp={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Rp=class{#e=Mp;#t=!1;setTimeoutProvider(t){this.#e=t}setTimeout(t,e){return this.#e.setTimeout(t,e)}clearTimeout(t){this.#e.clearTimeout(t)}setInterval(t,e){return this.#e.setInterval(t,e)}clearInterval(t){this.#e.clearInterval(t)}},mr=new Rp;function Fp(t){setTimeout(t,0)}var $p=typeof window>"u"||"Deno"in globalThis;function Tt(){}function Op(t,e){return typeof t=="function"?t(e):t}function Pp(t){return typeof t=="number"&&t>=0&&t!==1/0}function zp(t,e){return Math.max(t+(e||0)-Date.now(),0)}function vr(t,e){return typeof t=="function"?t(e):t}function Dp(t,e){return typeof t=="function"?t(e):t}function fl(t,e){const{type:i="all",exact:n,fetchStatus:s,predicate:o,queryKey:r,stale:l}=t;if(r){if(n){if(e.queryHash!==ta(r,e.options))return!1}else if(!Sn(e.queryKey,r))return!1}if(i!=="all"){const a=e.isActive();if(i==="active"&&!a||i==="inactive"&&a)return!1}return!(typeof l=="boolean"&&e.isStale()!==l||s&&s!==e.state.fetchStatus||o&&!o(e))}function pl(t,e){const{exact:i,status:n,predicate:s,mutationKey:o}=t;if(o){if(!e.options.mutationKey)return!1;if(i){if(xn(e.options.mutationKey)!==xn(o))return!1}else if(!Sn(e.options.mutationKey,o))return!1}return!(n&&e.state.status!==n||s&&!s(e))}function ta(t,e){return(e?.queryKeyHashFn||xn)(t)}function xn(t){return JSON.stringify(t,(e,i)=>gr(i)?Object.keys(i).sort().reduce((n,s)=>(n[s]=i[s],n),{}):i)}function Sn(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(i=>Sn(t[i],e[i])):!1}var Ip=Object.prototype.hasOwnProperty;function au(t,e,i=0){if(t===e)return t;if(i>500)return e;const n=ml(t)&&ml(e);if(!n&&!(gr(t)&&gr(e)))return e;const o=(n?t:Object.keys(t)).length,r=n?e:Object.keys(e),l=r.length,a=n?new Array(l):{};let c=0;for(let u=0;u<l;u++){const d=n?u:r[u],p=t[d],v=e[d];if(p===v){a[d]=p,(n?u<o:Ip.call(t,d))&&c++;continue}if(p===null||v===null||typeof p!="object"||typeof v!="object"){a[d]=v;continue}const m=au(p,v,i+1);a[d]=m,m===p&&c++}return o===l&&c===o?t:a}function ml(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function gr(t){if(!vl(t))return!1;const e=t.constructor;if(e===void 0)return!0;const i=e.prototype;return!(!vl(i)||!i.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function vl(t){return Object.prototype.toString.call(t)==="[object Object]"}function Lp(t){return new Promise(e=>{mr.setTimeout(e,t)})}function Bp(t,e,i){return typeof i.structuralSharing=="function"?i.structuralSharing(t,e):i.structuralSharing!==!1?au(t,e):e}function Up(t,e,i=0){const n=[...t,e];return i&&n.length>i?n.slice(1):n}function jp(t,e,i=0){const n=[e,...t];return i&&n.length>i?n.slice(0,-1):n}var ia=Symbol();function lu(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===ia?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function Hp(t,e,i){let n=!1,s;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(s??=e(),n||(n=!0,s.aborted?i():s.addEventListener("abort",i,{once:!0})),s)}),t}var cu=(()=>{let t=()=>$p;return{isServer(){return t()},setIsServer(e){t=e}}})();function Np(){let t,e;const i=new Promise((s,o)=>{t=s,e=o});i.status="pending",i.catch(()=>{});function n(s){Object.assign(i,s),delete i.resolve,delete i.reject}return i.resolve=s=>{n({status:"fulfilled",value:s}),t(s)},i.reject=s=>{n({status:"rejected",reason:s}),e(s)},i}var Vp=Fp;function qp(){let t=[],e=0,i=l=>{l()},n=l=>{l()},s=Vp;const o=l=>{e?t.push(l):s(()=>{i(l)})},r=()=>{const l=t;t=[],l.length&&s(()=>{n(()=>{l.forEach(a=>{i(a)})})})};return{batch:l=>{let a;e++;try{a=l()}finally{e--,e||r()}return a},batchCalls:l=>(...a)=>{o(()=>{l(...a)})},schedule:o,setNotifyFunction:l=>{i=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{s=l}}}var Je=qp(),Wp=class extends Ys{#e=!0;#t;#i;constructor(){super(),this.#i=t=>{if(typeof window<"u"&&window.addEventListener){const e=()=>t(!0),i=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",i)}}}}onSubscribe(){this.#t||this.setEventListener(this.#i)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#i=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(i=>{i(t)}))}isOnline(){return this.#e}},Ms=new Wp;function Qp(t){return Math.min(1e3*2**t,3e4)}function uu(t){return(t??"online")==="online"?Ms.isOnline():!0}var _r=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function du(t){let e=!1,i=0,n;const s=Np(),o=()=>s.status!=="pending",r=g=>{if(!o()){const y=new _r(g);p(y),t.onCancel?.(y)}},l=()=>{e=!0},a=()=>{e=!1},c=()=>ru.isFocused()&&(t.networkMode==="always"||Ms.isOnline())&&t.canRun(),u=()=>uu(t.networkMode)&&t.canRun(),d=g=>{o()||(n?.(),s.resolve(g))},p=g=>{o()||(n?.(),s.reject(g))},v=()=>new Promise(g=>{n=y=>{(o()||c())&&g(y)},t.onPause?.()}).then(()=>{n=void 0,o()||t.onContinue?.()}),m=()=>{if(o())return;let g;const y=i===0?t.initialPromise:void 0;try{g=y??t.fn()}catch(S){g=Promise.reject(S)}Promise.resolve(g).then(d).catch(S=>{if(o())return;const b=t.retry??(cu.isServer()?0:3),x=t.retryDelay??Qp,w=typeof x=="function"?x(i,S):x,k=b===!0||typeof b=="number"&&i<b||typeof b=="function"&&b(i,S);if(e||!k){p(S);return}i++,t.onFail?.(i,S),Lp(w).then(()=>c()?void 0:v()).then(()=>{e?p(S):m()})})};return{promise:s,status:()=>s.status,cancel:r,continue:()=>(n?.(),s),cancelRetry:l,continueRetry:a,canStart:u,start:()=>(u()?m():v().then(m),s)}}var hu=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Pp(this.gcTime)&&(this.#e=mr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(cu.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(mr.clearTimeout(this.#e),this.#e=void 0)}};function Kp(t){return{onFetch:(e,i)=>{const n=e.options,s=e.fetchOptions?.meta?.fetchMore?.direction,o=e.state.data?.pages||[],r=e.state.data?.pageParams||[];let l={pages:[],pageParams:[]},a=0;const c=async()=>{let u=!1;const d=m=>{Hp(m,()=>e.signal,()=>u=!0)},p=lu(e.options,e.fetchOptions),v=async(m,g,y)=>{if(u)return Promise.reject(e.signal.reason);if(g==null&&m.pages.length)return Promise.resolve(m);const b=(()=>{const E={client:e.client,queryKey:e.queryKey,pageParam:g,direction:y?"backward":"forward",meta:e.options.meta};return d(E),E})(),x=await p(b),{maxPages:w}=e.options,k=y?jp:Up;return{pages:k(m.pages,x,w),pageParams:k(m.pageParams,g,w)}};if(s&&o.length){const m=s==="backward",g=m?Yp:gl,y={pages:o,pageParams:r},S=g(n,y);l=await v(y,S,m)}else{const m=t??o.length;do{const g=a===0?r[0]??n.initialPageParam:gl(n,l);if(a>0&&g==null)break;l=await v(l,g),a++}while(a<m)}return l};e.options.persister?e.fetchFn=()=>e.options.persister?.(c,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},i):e.fetchFn=c}}}function gl(t,{pages:e,pageParams:i}){const n=e.length-1;return e.length>0?t.getNextPageParam(e[n],e,i[n],i):void 0}function Yp(t,{pages:e,pageParams:i}){return e.length>0?t.getPreviousPageParam?.(e[0],e,i[0],i):void 0}var Xp=class extends hu{#e;#t;#i;#n;#o;#s;#a;#r;constructor(t){super(),this.#r=!1,this.#a=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#o=t.client,this.#n=this.#o.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#t=yl(this.options),this.state=t.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#s?.promise}setOptions(t){if(this.options={...this.#a,...t},t?._type&&(this.#e=t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=yl(this.options);e.data!==void 0&&(this.setState(_l(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(t,e){const i=Bp(this.state.data,t,this.options);return this.#l({data:i,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),i}setState(t){this.#l({type:"setState",state:t})}cancel(t){const e=this.#s?.promise;return this.#s?.cancel(t),e?e.then(Tt).catch(Tt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Dp(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ia||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>vr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!zp(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#s&&(this.#r||this.#u()?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}#u(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(t,e){if(this.state.fetchStatus!=="idle"&&this.#s?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(t&&this.setOptions(t),!this.options.queryFn){const a=this.observers.find(c=>c.options.queryFn);a&&this.setOptions(a.options)}const i=new AbortController,n=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#r=!0,i.signal)})},s=()=>{const a=lu(this.options,e),u=(()=>{const d={client:this.#o,queryKey:this.queryKey,meta:this.meta};return n(d),d})();return this.#r=!1,this.options.persister?this.options.persister(a,u,this):a(u)},r=(()=>{const a={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:s};return n(a),a})();(this.#e==="infinite"?Kp(this.options.pages):this.options.behavior)?.onFetch(r,this),this.#i=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==r.fetchOptions?.meta)&&this.#l({type:"fetch",meta:r.fetchOptions?.meta}),this.#s=du({initialPromise:e?.initialPromise,fn:r.fetchFn,onCancel:a=>{a instanceof _r&&a.revert&&this.setState({...this.#i,fetchStatus:"idle"}),i.abort()},onFail:(a,c)=>{this.#l({type:"failed",failureCount:a,error:c})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:r.options.retry,retryDelay:r.options.retryDelay,networkMode:r.options.networkMode,canRun:()=>!0});try{const a=await this.#s.start();if(a===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(a),this.#n.config.onSuccess?.(a,this),this.#n.config.onSettled?.(a,this.state.error,this),a}catch(a){if(a instanceof _r){if(a.silent)return this.#s.promise;if(a.revert){if(this.state.data===void 0)throw a;return this.state.data}}throw this.#l({type:"error",error:a}),this.#n.config.onError?.(a,this),this.#n.config.onSettled?.(this.state.data,a,this),a}finally{this.scheduleGc()}}#l(t){const e=i=>{switch(t.type){case"failed":return{...i,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...Gp(i.data,this.options),fetchMeta:t.meta??null};case"success":const n={...i,..._l(t.data,t.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#i=t.manual?n:void 0,n;case"error":const s=t.error;return{...i,error:s,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...t.state}}};this.state=e(this.state),Je.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:t})})}};function Gp(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:uu(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function _l(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function yl(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,i=e!==void 0,n=i?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:i?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var Jp=class extends hu{#e;#t;#i;#n;constructor(t){super(),this.#e=t.client,this.mutationId=t.mutationId,this.#i=t.mutationCache,this.#t=[],this.state=t.state||Zp(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#t.includes(t)||(this.#t.push(t),this.clearGcTimeout(),this.#i.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#t=this.#t.filter(e=>e!==t),this.scheduleGc(),this.#i.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#i.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#o({type:"continue"})},i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#n=du({fn:()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(new Error("No mutationFn found")),onFail:(o,r)=>{this.#o({type:"failed",failureCount:o,error:r})},onPause:()=>{this.#o({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#i.canRun(this)});const n=this.state.status==="pending",s=!this.#n.canStart();try{if(n)e();else{this.#o({type:"pending",variables:t,isPaused:s}),this.#i.config.onMutate&&await this.#i.config.onMutate(t,this,i);const r=await this.options.onMutate?.(t,i);r!==this.state.context&&this.#o({type:"pending",context:r,variables:t,isPaused:s})}const o=await this.#n.start();return await this.#i.config.onSuccess?.(o,t,this.state.context,this,i),await this.options.onSuccess?.(o,t,this.state.context,i),await this.#i.config.onSettled?.(o,null,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(o,null,t,this.state.context,i),this.#o({type:"success",data:o}),o}catch(o){try{await this.#i.config.onError?.(o,t,this.state.context,this,i)}catch(r){Promise.reject(r)}try{await this.options.onError?.(o,t,this.state.context,i)}catch(r){Promise.reject(r)}try{await this.#i.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,i)}catch(r){Promise.reject(r)}try{await this.options.onSettled?.(void 0,o,t,this.state.context,i)}catch(r){Promise.reject(r)}throw this.#o({type:"error",error:o}),o}finally{this.#i.runNext(this)}}#o(t){const e=i=>{switch(t.type){case"failed":return{...i,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...i,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:t.error,failureCount:i.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),Je.batch(()=>{this.#t.forEach(i=>{i.onMutationUpdate(t)}),this.#i.notify({mutation:this,type:"updated",action:t})})}};function Zp(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var fu=class extends Ys{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#i=0}#e;#t;#i;build(e,i,n){const s=new Jp({client:e,mutationCache:this,mutationId:++this.#i,options:e.defaultMutationOptions(i),state:n});return this.add(s),s}add(e){this.#e.add(e);const i=os(e);if(typeof i=="string"){const n=this.#t.get(i);n?n.push(e):this.#t.set(i,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const i=os(e);if(typeof i=="string"){const n=this.#t.get(i);if(n)if(n.length>1){const s=n.indexOf(e);s!==-1&&n.splice(s,1)}else n[0]===e&&this.#t.delete(i)}}this.notify({type:"removed",mutation:e})}canRun(e){const i=os(e);if(typeof i=="string"){const s=this.#t.get(i)?.find(o=>o.state.status==="pending");return!s||s===e}else return!0}runNext(e){const i=os(e);return typeof i=="string"?this.#t.get(i)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Je.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const i={exact:!0,...e};return this.getAll().find(n=>pl(i,n))}findAll(e={}){return this.getAll().filter(i=>pl(e,i))}notify(e){Je.batch(()=>{this.listeners.forEach(i=>{i(e)})})}resumePausedMutations(){const e=this.getAll().filter(i=>i.state.isPaused);return Je.batch(()=>Promise.all(e.map(i=>i.continue().catch(Tt))))}};function os(t){return t.options.scope?.id}var pu=class extends Ys{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,i,n){const s=i.queryKey,o=i.queryHash??ta(s,i);let r=this.get(o);return r||(r=new Xp({client:e,queryKey:s,queryHash:o,options:e.defaultQueryOptions(i),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(r)),r}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const i=this.#e.get(e.queryHash);i&&(e.destroy(),i===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Je.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const i={exact:!0,...e};return this.getAll().find(n=>fl(i,n))}findAll(e={}){const i=this.getAll();return Object.keys(e).length>0?i.filter(n=>fl(e,n)):i}notify(e){Je.batch(()=>{this.listeners.forEach(i=>{i(e)})})}onFocus(){Je.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Je.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},em=class{#e;#t;#i;#n;#o;#s;#a;#r;constructor(e={}){this.#e=e.queryCache||new pu,this.#t=e.mutationCache||new fu,this.#i=e.defaultOptions||{},this.#n=new Map,this.#o=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#a=ru.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#r=Ms.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#a?.(),this.#a=void 0,this.#r?.(),this.#r=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const i=this.defaultQueryOptions({queryKey:e});return this.#e.get(i.queryHash)?.state.data}ensureQueryData(e){const i=this.defaultQueryOptions(e),n=this.#e.build(this,i),s=n.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(vr(i.staleTime,n))&&this.prefetchQuery(i),Promise.resolve(s))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:i,state:n})=>{const s=n.data;return[i,s]})}setQueryData(e,i,n){const s=this.defaultQueryOptions({queryKey:e}),r=this.#e.get(s.queryHash)?.state.data,l=Op(i,r);if(l!==void 0)return this.#e.build(this,s).setData(l,{...n,manual:!0})}setQueriesData(e,i,n){return Je.batch(()=>this.#e.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,i,n)]))}getQueryState(e){const i=this.defaultQueryOptions({queryKey:e});return this.#e.get(i.queryHash)?.state}removeQueries(e){const i=this.#e;Je.batch(()=>{i.findAll(e).forEach(n=>{i.remove(n)})})}resetQueries(e,i){const n=this.#e;return Je.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},i)))}cancelQueries(e,i={}){const n={revert:!0,...i},s=Je.batch(()=>this.#e.findAll(e).map(o=>o.cancel(n)));return Promise.all(s).then(Tt).catch(Tt)}invalidateQueries(e,i={}){return Je.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},i)))}refetchQueries(e,i={}){const n={...i,cancelRefetch:i.cancelRefetch??!0},s=Je.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let r=o.fetch(void 0,n);return n.throwOnError||(r=r.catch(Tt)),o.state.fetchStatus==="paused"?Promise.resolve():r}));return Promise.all(s).then(Tt)}fetchQuery(e){const i=this.defaultQueryOptions(e);i.retry===void 0&&(i.retry=!1);const n=this.#e.build(this,i);return n.isStaleByTime(vr(i.staleTime,n))?n.fetch(i):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Tt).catch(Tt)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Tt).catch(Tt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Ms.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#i}setDefaultOptions(e){this.#i=e}setQueryDefaults(e,i){this.#n.set(xn(e),{queryKey:e,defaultOptions:i})}getQueryDefaults(e){const i=[...this.#n.values()],n={};return i.forEach(s=>{Sn(e,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(e,i){this.#o.set(xn(e),{mutationKey:e,defaultOptions:i})}getMutationDefaults(e){const i=[...this.#o.values()],n={};return i.forEach(s=>{Sn(e,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const i={...this.#i.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return i.queryHash||(i.queryHash=ta(i.queryKey,i)),i.refetchOnReconnect===void 0&&(i.refetchOnReconnect=i.networkMode!=="always"),i.throwOnError===void 0&&(i.throwOnError=!!i.suspense),!i.networkMode&&i.persister&&(i.networkMode="offlineFirst"),i.queryFn===ia&&(i.enabled=!1),i}defaultMutationOptions(e){return e?._defaulted?e:{...this.#i.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};function yr(t,e,i="",n=0){if(e){const s=e(t,i,n);if(s===void 0&&Xr(t)||s!==void 0)return s}if(Array.isArray(t))return t.map((s,o)=>yr(s,e,String(o),n+1));if(typeof t=="object"&&im(t)){const s=Object.entries(t).map(([o,r])=>[o,yr(r,e,o,n+1)]);return Object.fromEntries(s)}return t}function tm(t,e){return yr(t,e)}function ge(t,e=!1){return tm(t,(i,n,s)=>{if(s===1&&n==="queryKey")return ge(i,!0);if(e&&nm(i))return ge(i(),e);if(Xr(i))return ge(h(i),e)})}function im(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function nm(t){return typeof t=="function"}var sm=class extends pu{find(t){return super.find(ge(t))}findAll(t={}){return super.findAll(ge(t))}},om=class extends fu{find(t){return super.find(ge(t))}findAll(t={}){return super.findAll(ge(t))}},rm=class extends em{constructor(t={}){const e={defaultOptions:t.defaultOptions,queryCache:t.queryCache||new sm,mutationCache:t.mutationCache||new om};super(e),this.isRestoring=U(!1)}isFetching(t={}){return super.isFetching(ge(t))}isMutating(t={}){return super.isMutating(ge(t))}getQueryData(t){return super.getQueryData(ge(t))}ensureQueryData(t){return super.ensureQueryData(ge(t))}getQueriesData(t){return super.getQueriesData(ge(t))}setQueryData(t,e,i={}){return super.setQueryData(ge(t),e,ge(i))}setQueriesData(t,e,i={}){return super.setQueriesData(ge(t),e,ge(i))}getQueryState(t){return super.getQueryState(ge(t))}removeQueries(t={}){return super.removeQueries(ge(t))}resetQueries(t={},e={}){return super.resetQueries(ge(t),ge(e))}cancelQueries(t={},e={}){return super.cancelQueries(ge(t),ge(e))}invalidateQueries(t={},e={}){const i=ge(t),n=ge(e);if(super.invalidateQueries({...i,refetchType:"none"},n),i.refetchType==="none")return Promise.resolve();const s={...i,type:i.refetchType??i.type??"active"};return lt().then(()=>super.refetchQueries(s,n))}refetchQueries(t={},e={}){return super.refetchQueries(ge(t),ge(e))}fetchQuery(t){return super.fetchQuery(ge(t))}prefetchQuery(t){return super.prefetchQuery(ge(t))}fetchInfiniteQuery(t){return super.fetchInfiniteQuery(ge(t))}prefetchInfiniteQuery(t){return super.prefetchInfiniteQuery(ge(t))}setDefaultOptions(t){super.setDefaultOptions(ge(t))}setQueryDefaults(t,e){super.setQueryDefaults(ge(t),ge(e))}getQueryDefaults(t){return super.getQueryDefaults(ge(t))}setMutationDefaults(t,e){super.setMutationDefaults(ge(t),ge(e))}getMutationDefaults(t){return super.getMutationDefaults(ge(t))}};class wr extends Error{cause;isNetworkError;request;constructor(e,i=null){super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=e,this.isNetworkError=!0,this.request=i}}class am{#e;#t=!1;#i;#n;constructor(e,i){this.#n=e,this.#i=()=>i(e)}progress(){this.#t||this.#n>0&&(clearTimeout(this.#e),this.#e=setTimeout(this.#i,this.#n))}done(){this.#t||(clearTimeout(this.#e),this.#e=void 0,this.#t=!0)}}const rs=()=>{};function lm(t,e={}){const{body:i=null,headers:n={},method:s="GET",onBeforeRequest:o=rs,onUploadProgress:r=rs,shouldRetry:l=()=>!0,onAfterResponse:a=rs,onTimeout:c=rs,responseType:u,retries:d=3,signal:p=null,timeout:v=3e4,withCredentials:m=!1}=e,g=b=>.3*2**(b-1)*1e3,y=new am(v,c);function S(b=0){return new Promise(async(x,w)=>{const k=new XMLHttpRequest,E=F=>{l(k)&&b<d?setTimeout(()=>{S(b+1).then(x,w)},g(b)):(y.done(),w(F))};k.open(s,t,!0),k.withCredentials=m,u&&(k.responseType=u),k.onload=async()=>{try{await a(k,b)}catch(F){F.request=k,E(F);return}k.status>=200&&k.status<300?(y.done(),x(k)):l(k)&&b<d?setTimeout(()=>{S(b+1).then(x,w)},g(b)):(y.done(),w(new wr(k.statusText,k)))},k.onerror=()=>E(new wr(k.statusText,k)),k.upload.onprogress=F=>{y.progress(),r(F)},n&&Object.keys(n).forEach(F=>{k.setRequestHeader(F,n[F])});function O(){k.abort(),w(new DOMException("Aborted","AbortError"))}if(p?.addEventListener("abort",O),p?.aborted){O();return}await o(k,b),k.send(i)})}return S()}const cm=t=>"error"in t&&!!t.error,um=t=>t.progress.uploadComplete;function dm(t){return t.filter(e=>!cm(e)&&!um(e))}function hm(t){return t.filter(e=>!e.progress?.uploadStarted||!e.isRestored)}function mu(t){const e=t.lastIndexOf(".");return e===-1||e===t.length-1?{name:t,extension:void 0}:{name:t.slice(0,e),extension:t.slice(e+1)}}const wl={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",msg:"application/vnd.ms-outlook",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function vu(t){if(t.type)return t.type;const e=t.name?mu(t.name).extension?.toLowerCase():null;return e&&e in wl?wl[e]:"application/octet-stream"}function fm(t){return t.charCodeAt(0).toString(32)}function bl(t){let e="";return t.replace(/[^A-Z0-9]/gi,i=>(e+=`-${fm(i)}`,"/"))+e}function pm(t,e){let i=e||"uppy";return typeof t.name=="string"&&(i+=`-${bl(t.name.toLowerCase())}`),t.type!==void 0&&(i+=`-${t.type}`),t.meta&&typeof t.meta.relativePath=="string"&&(i+=`-${bl(t.meta.relativePath.toLowerCase())}`),t.data?.size!==void 0&&(i+=`-${t.data.size}`),t.data.lastModified!==void 0&&(i+=`-${t.data.lastModified}`),i}function mm(t){return!t.isRemote||!t.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(t.remote.provider)}function vm(t,e){if(mm(t))return t.id;const i=vu(t);return pm({...t,type:i},e)}function xl(t,e){return t===!0?Object.keys(e):Array.isArray(t)?t:[]}function Mo(t){return t<10?`0${t}`:t.toString()}function _s(){const t=new Date,e=Mo(t.getHours()),i=Mo(t.getMinutes()),n=Mo(t.getSeconds());return`${e}:${i}:${n}`}function gm(t){return t?t.readyState===4&&t.status===0:!1}class _m{#e=[];#t=0;#i;#n=!1;constructor(e){const i=e?.concurrency;this.#i=typeof i!="number"||i===0?1/0:i}add(e){const i=new AbortController;let n,s;const o=new Promise((l,a)=>{n=l,s=a}),r={run:()=>e(i.signal),resolve:n,reject:s,controller:i};return i.signal.addEventListener("abort",()=>{const l=this.#e.indexOf(r);l!==-1&&(this.#e.splice(l,1),s(i.signal.reason??new DOMException("Aborted","AbortError")))},{once:!0}),o.abort=l=>{i.abort(l??new DOMException("Aborted","AbortError"))},o.abortOn=l=>{if(l){const a=()=>o.abort(l.reason);l.addEventListener("abort",a,{once:!0}),o.then(()=>l.removeEventListener("abort",a),()=>l.removeEventListener("abort",a))}return o},!this.#n&&this.#t<this.#i?this.#o(r):this.#e.push(r),o}#o(e){if(this.#t++,e.controller.signal.aborted){this.#t--,e.reject(e.controller.signal.reason??new DOMException("Aborted","AbortError")),this.#s();return}let i;try{i=e.run()}catch(n){i=Promise.reject(n)}i.then(n=>{e.controller.signal.aborted?e.reject(e.controller.signal.reason??new DOMException("Aborted","AbortError")):e.resolve(n)},n=>{e.reject(n)}).finally(()=>{this.#t--,this.#s()})}#s(){queueMicrotask(()=>{if(!(this.#n||this.#t>=this.#i))for(;this.#e.length>0;){const e=this.#e.shift();if(!e.controller.signal.aborted){this.#o(e);return}}})}pause(){this.#n=!0}resume(){this.#n=!1;const e=this.#i-this.#t;for(let i=0;i<e;i++)this.#s()}clear(e){const i=this.#e.splice(0),n=e??new DOMException("Cleared","AbortError");for(const s of i)s.controller.abort(n),s.reject(n)}get concurrency(){return this.#i}set concurrency(e){if(this.#i=typeof e!="number"||e===0?1/0:e,!this.#n){const i=this.#i-this.#t;for(let n=0;n<i;n++)this.#s()}}get pending(){return this.#e.length}get running(){return this.#t}get isPaused(){return this.#n}wrapPromiseFunction(e){return(...i)=>this.add(n=>e(...i))}}function ym(t,e,i){const n=[];return t.forEach(s=>typeof s!="string"?n.push(s):e[Symbol.split](s).forEach((o,r,l)=>{o!==""&&n.push(o),r<l.length-1&&n.push(i)})),n}function Sl(t,e){const i=/\$/g,n="$$$$";let s=[t];if(e==null)return s;for(const o of Object.keys(e))if(o!=="_"){let r=e[o];typeof r=="string"&&(r=i[Symbol.replace](r,n)),s=ym(s,new RegExp(`%\\{${o}\\}`,"g"),r)}return s}const wm=t=>{throw new Error(`missing string: ${t}`)};class gu{locale;constructor(e,{onMissingKey:i=wm}={}){this.locale={strings:{},pluralize(n){return n===1?0:1}},Array.isArray(e)?e.forEach(this.#t,this):this.#t(e),this.#e=i}#e;#t(e){if(!e?.strings)return;const i=this.locale;Object.assign(this.locale,{strings:{...i.strings,...e.strings},pluralize:e.pluralize||i.pluralize})}translate(e,i){return this.translateArray(e,i).join("")}translateArray(e,i){let n=this.locale.strings[e];if(n==null&&(this.#e(e),n=e),typeof n=="object"){if(i&&typeof i.smart_count<"u"){const o=this.locale.pluralize(i.smart_count);return Sl(n[o],i)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof n!="string")throw new Error("string was not a string");return Sl(n,i)}}class bm{uppy;opts;id;defaultLocale;i18n;i18nArray;type;VERSION;constructor(e,i){this.uppy=e,this.opts=i??{}}getPluginState(){const{plugins:e}=this.uppy.getState();return e?.[this.id]||{}}setPluginState(e){const{plugins:i}=this.uppy.getState();this.uppy.setState({plugins:{...i,[this.id]:{...i[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(void 0),this.i18nInit()}i18nInit(){const e=new gu([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState(void 0)}addTarget(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}}class xm{#e;#t=[];constructor(e){this.#e=e}on(e,i){return this.#t.push([e,i]),this.#e.on(e,i)}remove(){for(const[e,i]of this.#t.splice(0))this.#e.off(e,i)}onFilePause(e,i){this.on("upload-pause",(n,s)=>{e===n?.id&&i(s)})}onFileRemove(e,i){this.on("file-removed",n=>{e===n.id&&i(n.id)})}onPause(e,i){this.on("upload-pause",(n,s)=>{e===n?.id&&i(s)})}onRetry(e,i){this.on("upload-retry",n=>{e===n?.id&&i()})}onRetryAll(e,i){this.on("retry-all",()=>{this.#e.getFile(e)&&i()})}onPauseAll(e,i){this.on("pause-all",()=>{this.#e.getFile(e)&&i()})}onCancelAll(e,i){this.on("cancel-all",(...n)=>{this.#e.getFile(e)&&i(...n)})}onResumeAll(e,i){this.on("resume-all",()=>{this.#e.getFile(e)&&i()})}}const Sm={debug:()=>{},warn:()=>{},error:(...t)=>console.error(`[Uppy] [${_s()}]`,...t)},km={debug:(...t)=>console.debug(`[Uppy] [${_s()}]`,...t),warn:(...t)=>console.warn(`[Uppy] [${_s()}]`,...t),error:(...t)=>console.error(`[Uppy] [${_s()}]`,...t)};var Ro,kl;function Cm(){return kl||(kl=1,Ro=function(e){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);const i=e<0;let n=Math.abs(e);if(i&&(n=-n),n===0)return"0 B";const s=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],o=Math.min(Math.floor(Math.log(n)/Math.log(1024)),s.length-1),r=Number(n/1024**o),l=s[o];return`${r>=10||r%1===0?Math.round(r):r.toFixed(1)} ${l}`}),Ro}var Em=Cm();const as=Bs(Em);var Fo,Cl;function Am(){if(Cl)return Fo;Cl=1;function t(e,i){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=i,this.parts=e.split(i)}return t.prototype.match=function(e){var i=!0,n=this.parts,s,o=n.length,r;if(typeof e=="string"||e instanceof String)if(!this.hasWild&&this.text!=e)i=!1;else{for(r=(e||"").split(this.separator),s=0;i&&s<o;s++)n[s]!=="*"&&(s<r.length?i=n[s]===r[s]:i=!1);i=i&&r}else if(typeof e.splice=="function")for(i=[],s=e.length;s--;)this.match(e[s])&&(i[i.length]=e[s]);else if(typeof e=="object"){i={};for(var l in e)this.match(l)&&(i[l]=e[l])}return i},Fo=function(e,i,n){var s=new t(e,n||/[\/\.]/);return typeof i<"u"?s.match(i):s},Fo}var $o,El;function Tm(){if(El)return $o;El=1;var t=Am(),e=/[\/\+\.]/;return $o=function(i,n){function s(o){var r=t(o,i,e);return r&&r.length>=2}return n?s(n.split(";")[0]):s},$o}var Mm=Tm();const Rm=Bs(Mm),Fm={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};class Mt extends Error{isUserFacing;file;constructor(e,i){super(e),this.isUserFacing=i?.isUserFacing??!0,i?.file&&(this.file=i.file)}isRestriction=!0}class $m{getI18n;getOpts;constructor(e,i){this.getI18n=i,this.getOpts=()=>{const n=e();if(n.restrictions?.allowedFileTypes!=null&&!Array.isArray(n.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return n}}validateAggregateRestrictions(e,i){const{maxTotalFileSize:n,maxNumberOfFiles:s}=this.getOpts().restrictions;if(s&&e.filter(r=>!r.isGhost).length+i.length>s)throw new Mt(`${this.getI18n()("youCanOnlyUploadX",{smart_count:s})}`);if(n){const o=[...e,...i].reduce((r,l)=>r+(l.size??0),0);if(o>n)throw new Mt(this.getI18n()("aggregateExceedsSize",{sizeAllowed:as(n),size:as(o)}))}}validateSingleFile(e){const{maxFileSize:i,minFileSize:n,allowedFileTypes:s}=this.getOpts().restrictions;if(s&&!s.some(r=>r.includes("/")?e.type?Rm(e.type.replace(/;.*?$/,""),r):!1:r[0]==="."&&e.extension?e.extension.toLowerCase()===r.slice(1).toLowerCase():!1)){const r=s.join(", ");throw new Mt(this.getI18n()("youCanOnlyUploadFileTypes",{types:r}),{file:e})}if(i&&e.size!=null&&e.size>i)throw new Mt(this.getI18n()("exceedsSize",{size:as(i),file:e.name??this.getI18n()("unnamed")}),{file:e});if(n&&e.size!=null&&e.size<n)throw new Mt(this.getI18n()("inferiorSize",{size:as(n)}),{file:e})}validate(e,i){i.forEach(n=>{this.validateSingleFile(n)}),this.validateAggregateRestrictions(e,i)}validateMinNumberOfFiles(e){const{minNumberOfFiles:i}=this.getOpts().restrictions;if(i&&Object.keys(e).length<i)throw new Mt(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:i}))}getMissingRequiredMetaFields(e){const i=new Mt(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:e.name??this.getI18n()("unnamed")})),{requiredMetaFields:n}=this.getOpts().restrictions,s=[];for(const o of n)(!Object.hasOwn(e.meta,o)||e.meta[o]==="")&&s.push(o);return{missingFields:s,error:i}}}const Om="5.0.0",Pm={version:Om};class zm{static VERSION=Pm.version;state={};#e=new Set;getState(){return this.state}setState(e){const i={...this.state},n={...this.state,...e};this.state=n,this.#t(i,n,e)}subscribe(e){return this.#e.add(e),()=>{this.#e.delete(e)}}#t(...e){this.#e.forEach(i=>{i(...e)})}}var Oo,Al;function na(){if(Al)return Oo;Al=1;function t(e){var i=typeof e;return e!=null&&(i=="object"||i=="function")}return Oo=t,Oo}var Po,Tl;function Dm(){if(Tl)return Po;Tl=1;var t=typeof Jn=="object"&&Jn&&Jn.Object===Object&&Jn;return Po=t,Po}var zo,Ml;function _u(){if(Ml)return zo;Ml=1;var t=Dm(),e=typeof self=="object"&&self&&self.Object===Object&&self,i=t||e||Function("return this")();return zo=i,zo}var Do,Rl;function Im(){if(Rl)return Do;Rl=1;var t=_u(),e=function(){return t.Date.now()};return Do=e,Do}var Io,Fl;function Lm(){if(Fl)return Io;Fl=1;var t=/\s/;function e(i){for(var n=i.length;n--&&t.test(i.charAt(n)););return n}return Io=e,Io}var Lo,$l;function Bm(){if($l)return Lo;$l=1;var t=Lm(),e=/^\s+/;function i(n){return n&&n.slice(0,t(n)+1).replace(e,"")}return Lo=i,Lo}var Bo,Ol;function yu(){if(Ol)return Bo;Ol=1;var t=_u(),e=t.Symbol;return Bo=e,Bo}var Uo,Pl;function Um(){if(Pl)return Uo;Pl=1;var t=yu(),e=Object.prototype,i=e.hasOwnProperty,n=e.toString,s=t?t.toStringTag:void 0;function o(r){var l=i.call(r,s),a=r[s];try{r[s]=void 0;var c=!0}catch{}var u=n.call(r);return c&&(l?r[s]=a:delete r[s]),u}return Uo=o,Uo}var jo,zl;function jm(){if(zl)return jo;zl=1;var t=Object.prototype,e=t.toString;function i(n){return e.call(n)}return jo=i,jo}var Ho,Dl;function Hm(){if(Dl)return Ho;Dl=1;var t=yu(),e=Um(),i=jm(),n="[object Null]",s="[object Undefined]",o=t?t.toStringTag:void 0;function r(l){return l==null?l===void 0?s:n:o&&o in Object(l)?e(l):i(l)}return Ho=r,Ho}var No,Il;function Nm(){if(Il)return No;Il=1;function t(e){return e!=null&&typeof e=="object"}return No=t,No}var Vo,Ll;function Vm(){if(Ll)return Vo;Ll=1;var t=Hm(),e=Nm(),i="[object Symbol]";function n(s){return typeof s=="symbol"||e(s)&&t(s)==i}return Vo=n,Vo}var qo,Bl;function qm(){if(Bl)return qo;Bl=1;var t=Bm(),e=na(),i=Vm(),n=NaN,s=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,r=/^0o[0-7]+$/i,l=parseInt;function a(c){if(typeof c=="number")return c;if(i(c))return n;if(e(c)){var u=typeof c.valueOf=="function"?c.valueOf():c;c=e(u)?u+"":u}if(typeof c!="string")return c===0?c:+c;c=t(c);var d=o.test(c);return d||r.test(c)?l(c.slice(2),d?2:8):s.test(c)?n:+c}return qo=a,qo}var Wo,Ul;function Wm(){if(Ul)return Wo;Ul=1;var t=na(),e=Im(),i=qm(),n="Expected a function",s=Math.max,o=Math.min;function r(l,a,c){var u,d,p,v,m,g,y=0,S=!1,b=!1,x=!0;if(typeof l!="function")throw new TypeError(n);a=i(a)||0,t(c)&&(S=!!c.leading,b="maxWait"in c,p=b?s(i(c.maxWait)||0,a):p,x="trailing"in c?!!c.trailing:x);function w(M){var I=u,W=d;return u=d=void 0,y=M,v=l.apply(W,I),v}function k(M){return y=M,m=setTimeout(F,a),S?w(M):v}function E(M){var I=M-g,W=M-y,J=a-I;return b?o(J,p-W):J}function O(M){var I=M-g,W=M-y;return g===void 0||I>=a||I<0||b&&W>=p}function F(){var M=e();if(O(M))return j(M);m=setTimeout(F,E(M))}function j(M){return m=void 0,x&&u?w(M):(u=d=void 0,v)}function R(){m!==void 0&&clearTimeout(m),y=0,u=g=d=m=void 0}function T(){return m===void 0?v:j(e())}function D(){var M=e(),I=O(M);if(u=arguments,d=this,g=M,I){if(m===void 0)return k(g);if(b)return clearTimeout(m),m=setTimeout(F,a),w(g)}return m===void 0&&(m=setTimeout(F,a)),v}return D.cancel=R,D.flush=T,D}return Wo=r,Wo}var Qo,jl;function Qm(){if(jl)return Qo;jl=1;var t=Wm(),e=na(),i="Expected a function";function n(s,o,r){var l=!0,a=!0;if(typeof s!="function")throw new TypeError(i);return e(r)&&(l="leading"in r?!!r.leading:l,a="trailing"in r?!!r.trailing:a),t(s,o,{leading:l,maxWait:o,trailing:a})}return Qo=n,Qo}var Km=Qm();const Ym=Bs(Km);var Ko,Hl;function Xm(){return Hl||(Hl=1,Ko=function(){var e={},i=e._fns={};e.emit=function(r,l,a,c,u,d,p){var v=n(r);v.length&&s(r,v,[l,a,c,u,d,p])},e.on=function(r,l){i[r]||(i[r]=[]),i[r].push(l)},e.once=function(r,l){function a(){l.apply(this,arguments),e.off(r,a)}this.on(r,a)},e.off=function(r,l){var a=[];if(r&&l){var c=this._fns[r],u=0,d=c?c.length:0;for(u;u<d;u++)c[u]!==l&&a.push(c[u])}a.length?this._fns[r]=a:delete this._fns[r]};function n(o){var r=i[o]?i[o]:[],l=o.indexOf(":"),a=l===-1?[o]:[o.substring(0,l),o.substring(l+1)],c=Object.keys(i),u=0,d=c.length;for(u;u<d;u++){var p=c[u];if(p==="*"&&(r=r.concat(i[p])),a.length===2&&a[0]===p){r=r.concat(i[p]);break}}return r}function s(o,r,l){var a=0,c=r.length;for(a;a<c&&r[a];a++)r[a].event=o,r[a].apply(r[a],l)}return e}),Ko}var Gm=Xm();const Jm=Bs(Gm);let Zm="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",ev=(t=21)=>{let e="",i=t|0;for(;i--;)e+=Zm[Math.random()*64|0];return e};const tv="5.2.0",iv={version:tv};function nv(t,e){return e.name?e.name:t.split("/")[0]==="image"?`${t.split("/")[0]}.${t.split("/")[1]}`:"noname"}const sv={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",logIn:"Log in",pickFiles:"Pick files",pickPhotos:"Pick photos",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed",pleaseWait:"Please wait"}};function ov(t){if(t==null&&typeof navigator<"u"&&(t=navigator.userAgent),!t)return!0;const e=/Edge\/(\d+\.\d+)/.exec(t);if(!e)return!0;const n=e[1].split(".",2),s=parseInt(n[0],10),o=parseInt(n[1],10);return s<15||s===15&&o<15063||s>18||s===18&&o>=18218}const ls={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null};class sa{static VERSION=iv.version;#e=Object.create(null);#t;#i;#n=Jm();#o=new Set;#s=new Set;#a=new Set;defaultLocale;locale;opts;store;i18n;i18nArray;scheduledAutoProceed=null;wasOffline=!1;constructor(e){this.defaultLocale=sv;const i={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:Fm,meta:{},onBeforeFileAdded:(s,o)=>!Object.hasOwn(o,s.id),onBeforeUpload:s=>s,store:new zm,logger:Sm,infoTimeout:5e3},n={...i,...e};this.opts={...n,restrictions:{...i.restrictions,...e?.restrictions}},e?.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e?.debug&&(this.opts.logger=km),this.log(`Using Core v${sa.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...ls,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:ov(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),this.#t=new $m(()=>this.opts,()=>this.i18n),this.#i=this.store.subscribe((s,o,r)=>{this.emit("state-update",s,o,r),this.updateAll(o)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),this.#C()}emit(e,...i){this.#n.emit(e,...i)}on(e,i){return this.#n.on(e,i),this}once(e,i){return this.#n.once(e,i),this}off(e,i){return this.#n.off(e,i),this}updateAll(e){this.iteratePlugins(i=>{i.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){const i=this.getState().files;this.setState({files:{...i,...Object.fromEntries(Object.entries(e).map(([n,s])=>[n,{...i[n],...s}]))}})}setFileState(e,i){if(!this.getState().files[e])throw new Error(`Can’t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:i})}i18nInit(){const e=n=>this.log(`Missing i18n string: ${n}`,"error"),i=new gu([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=i.translate.bind(i),this.i18nArray=i.translateArray.bind(i),this.locale=i.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e?.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(i=>{i.setOptions(e)}),this.setState(void 0)}resetProgress(){const e={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null},i={...this.getState().files},n=Object.create(null);Object.keys(i).forEach(s=>{n[s]={...i[s],progress:{...i[s].progress,...e},tus:void 0,transloadit:void 0}}),this.setState({files:n,...ls})}clear(){const{capabilities:e,currentUploads:i}=this.getState();if(Object.keys(i).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState({...ls,files:{}})}addPreProcessor(e){this.#o.add(e)}removePreProcessor(e){return this.#o.delete(e)}addPostProcessor(e){this.#a.add(e)}removePostProcessor(e){return this.#a.delete(e)}addUploader(e){this.#s.add(e)}removeUploader(e){return this.#s.delete(e)}setMeta(e){const i={...this.getState().meta,...e},n={...this.getState().files};Object.keys(n).forEach(s=>{n[s]={...n[s],meta:{...n[s].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:i,files:n})}setFileMeta(e,i){const n={...this.getState().files};if(!n[e]){this.log(`Was trying to set metadata for a file that has been removed: ${e}`);return}const s={...n[e].meta,...i};n[e]={...n[e],meta:s},this.setState({files:n})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(i=>this.getFile(i))}getObjectOfFilesPerState(){const{files:e,totalProgress:i,error:n}=this.getState(),s=Object.values(e),o=[],r=[],l=[],a=[],c=[],u=[],d=[],p=[],v=[];for(const m of s){const{progress:g}=m;!g.uploadComplete&&g.uploadStarted&&(o.push(m),m.isPaused||p.push(m)),g.uploadStarted||r.push(m),(g.uploadStarted||g.preprocess||g.postprocess)&&l.push(m),g.uploadStarted&&a.push(m),m.isPaused&&c.push(m),g.uploadComplete&&u.push(m),m.error&&d.push(m),(g.preprocess||g.postprocess)&&v.push(m)}return{newFiles:r,startedFiles:l,uploadStartedFiles:a,pausedFiles:c,completeFiles:u,erroredFiles:d,inProgressFiles:o,inProgressNotPausedFiles:p,processingFiles:v,isUploadStarted:a.length>0,isAllComplete:i===100&&u.length===s.length&&v.length===0,isAllErrored:!!n&&d.length===s.length,isAllPaused:o.length!==0&&c.length===o.length,isUploadInProgress:o.length>0,isSomeGhost:s.some(m=>m.isGhost)}}#r(e){for(const r of e)r.isRestriction?this.emit("restriction-failed",r.file,r):this.emit("error",r,r.file),this.log(r,"warning");const i=e.filter(r=>r.isUserFacing),n=4,s=i.slice(0,n),o=i.slice(n);s.forEach(({message:r,details:l=""})=>{this.info({message:r,details:l},"error",this.opts.infoTimeout)}),o.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:o.length})})}validateRestrictions(e,i=this.getFiles()){try{this.#t.validate(i,[e])}catch(n){return n}return null}validateSingleFile(e){try{this.#t.validateSingleFile(e)}catch(i){return i.message}return null}validateAggregateRestrictions(e){const i=this.getFiles();try{this.#t.validateAggregateRestrictions(i,e)}catch(n){return n.message}return null}#u(e){const{missingFields:i,error:n}=this.#t.getMissingRequiredMetaFields(e);return i.length>0?(this.setFileState(e.id,{missingRequiredMetaFields:i,error:n.message}),this.log(n.message),this.emit("restriction-failed",e,n),!1):(i.length===0&&e.missingRequiredMetaFields&&this.setFileState(e.id,{missingRequiredMetaFields:[]}),!0)}#l(e){let i=!0;for(const n of Object.values(e))this.#u(n)||(i=!1);return i}#b(e){const{allowNewUpload:i}=this.getState();if(i===!1){const n=new Mt(this.i18n("noMoreFilesAllowed"),{file:e});throw this.#r([n]),n}}checkIfFileAlreadyExists(e){const{files:i}=this.getState();return!!(i[e]&&!i[e].isGhost)}#x(e){const i=e instanceof File?{name:e.name,type:e.type,size:e.size,data:e,meta:{},isRemote:!1,source:void 0,preview:void 0}:e,n=vu(i),s=nv(n,i),o=mu(s).extension,r=vm(i,this.getID()),l={...i.meta,name:s,type:n},a=Number.isFinite(i.data.size)?i.data.size:null;return{source:i.source||"",id:r,name:s,extension:o||"",meta:{...this.getState().meta,...l},type:n,progress:{percentage:0,bytesUploaded:!1,bytesTotal:a,uploadComplete:!1,uploadStarted:null},size:a,isGhost:!1,...i.isRemote?{isRemote:!0,remote:i.remote,data:i.data}:{isRemote:!1,data:i.data},preview:i.preview}}#p(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(e=>{e.isRestriction||this.log(e.stack||e.message||e)})},4))}#m(e){let{files:i}=this.getState(),n={...i};const s=[],o=[];for(const r of e)try{let l=this.#x(r);this.#b(l);const a=i[l.id],c=a?.isGhost;if(c&&!l.isRemote){if(l.data==null)throw new Error("File data is missing");l={...a,isGhost:!1,data:l.data},this.log(`Replaced the blob in the restored ghost file: ${l.name}, ${l.id}`)}const u=this.opts.onBeforeFileAdded(l,n);if(i=this.getState().files,n={...i,...n},!u&&this.checkIfFileAlreadyExists(l.id))throw new Mt(this.i18n("noDuplicates",{fileName:l.name??this.i18n("unnamed")}),{file:l});if(u===!1&&!c)throw new Mt("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:l});typeof u=="object"&&u!==null&&(l=u),this.#t.validateSingleFile(l),n[l.id]=l,s.push(l)}catch(l){o.push(l)}try{this.#t.validateAggregateRestrictions(Object.values(i),s)}catch(r){return o.push(r),{nextFilesState:i,validFilesToAdd:[],errors:o}}return{nextFilesState:n,validFilesToAdd:s,errors:o}}addFile(e){const{nextFilesState:i,validFilesToAdd:n,errors:s}=this.#m([e]),o=s.filter(l=>l.isRestriction);if(this.#r(o),s.length>0)throw s[0];this.setState({files:i});const[r]=n;return this.emit("file-added",r),this.emit("files-added",n),this.log(`Added file: ${r.name}, ${r.id}, mime type: ${r.type}`),this.#p(),r.id}addFiles(e){const{nextFilesState:i,validFilesToAdd:n,errors:s}=this.#m(e),o=s.filter(l=>l.isRestriction);this.#r(o);const r=s.filter(l=>!l.isRestriction);if(r.length>0){let l=`Multiple errors occurred while adding files:
|
|
2
|
-
`;if(r.forEach(a=>{l+=`
|
|
3
|
-
* ${a.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:r.length}),details:l},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(r,l);{const a=new Error(l);throw a.errors=r,a}}this.setState({files:i}),n.forEach(l=>{this.emit("file-added",l)}),this.emit("files-added",n),n.length>5?this.log(`Added batch of ${n.length} files`):Object.values(n).forEach(l=>{this.log(`Added file: ${l.name}
|
|
4
|
-
id: ${l.id}
|
|
5
|
-
type: ${l.type}`)}),n.length>0&&this.#p()}removeFiles(e){const{files:i,currentUploads:n}=this.getState(),s={...i},o={...n},r=Object.create(null);e.forEach(u=>{i[u]&&(r[u]=i[u],delete s[u])});function l(u){return r[u]===void 0}Object.keys(o).forEach(u=>{const d=n[u].fileIDs.filter(l);if(d.length===0){delete o[u];return}const{capabilities:p}=this.getState();if(d.length!==n[u].fileIDs.length&&!p.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");o[u]={...n[u],fileIDs:d}});const a={currentUploads:o,files:s};Object.keys(s).length===0&&(a.allowNewUpload=!0,a.error=null,a.recoveredState=null),this.setState(a),this.#d();const c=Object.keys(r);c.forEach(u=>{this.emit("file-removed",r[u])}),c.length>5?this.log(`Removed ${c.length} files`):this.log(`Removed files: ${c.join(", ")}`)}removeFile(e){this.removeFiles([e])}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;const i=this.getFile(e),s=!(i.isPaused||!1);return this.setFileState(e,{isPaused:s}),this.emit("upload-pause",i,s),s}pauseAll(){const e={...this.getState().files};Object.keys(e).filter(n=>!e[n].progress.uploadComplete&&e[n].progress.uploadStarted).forEach(n=>{const s={...e[n],isPaused:!0};e[n]=s}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter(n=>!e[n].progress.uploadComplete&&e[n].progress.uploadStarted).forEach(n=>{const s={...e[n],isPaused:!1,error:null};e[n]=s}),this.setState({files:e}),this.emit("resume-all")}#v(){const{files:e}=this.getState();return Object.keys(e).filter(i=>{const n=e[i];return n.error&&(!n.missingRequiredMetaFields||n.missingRequiredMetaFields.length===0)})}async#g(){const e=this.#v(),i={...this.getState().files};if(e.forEach(s=>{i[s]={...i[s],isPaused:!1,error:null}}),this.setState({files:i,error:null}),this.emit("retry-all",this.getFilesByIds(e)),e.length===0)return{successful:[],failed:[]};const n=this.#h(e,{forceAllowNewUpload:!0});return this.#f(n)}async retryAll(){const e=await this.#g();return this.emit("complete",e),e}cancelAll(){this.emit("cancel-all");const{files:e}=this.getState(),i=Object.keys(e);i.length&&this.removeFiles(i),this.setState(ls)}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));const i=this.#h([e],{forceAllowNewUpload:!0});return this.#f(i)}logout(){this.iteratePlugins(e=>{e.provider?.logout?.()})}#S=(e,i)=>{const n=e?this.getFile(e.id):void 0;if(e==null||!n){this.log(`Not setting progress for a file that has been removed: ${e?.id}`);return}if(n.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${e.id}`);return}const s={bytesTotal:i.bytesTotal,percentage:i.bytesTotal!=null&&Number.isFinite(i.bytesTotal)&&i.bytesTotal>0?Math.round(i.bytesUploaded/i.bytesTotal*100):void 0};n.progress.uploadStarted!=null?this.setFileState(e.id,{progress:{...n.progress,...s,bytesUploaded:i.bytesUploaded}}):this.setFileState(e.id,{progress:{...n.progress,...s}}),this.#d()};#_(){const e=this.#k();let i=null;e!=null&&(i=Math.round(e*100),i>100?i=100:i<0&&(i=0)),this.emit("progress",i??0),this.setState({totalProgress:i??0})}#d=Ym(()=>this.#_(),500,{leading:!0,trailing:!0});[Symbol.for("uppy test: updateTotalProgress")](){return this.#_()}#k(){const i=this.getFiles().filter(a=>a.progress.uploadStarted||a.progress.preprocess||a.progress.postprocess);if(i.length===0)return 0;if(i.every(a=>a.progress.uploadComplete))return 1;const n=a=>a.progress.bytesTotal!=null&&a.progress.bytesTotal!==0,s=i.filter(n),o=i.filter(a=>!n(a));if(s.every(a=>a.progress.uploadComplete)&&o.length>0&&!o.every(a=>a.progress.uploadComplete))return null;const r=s.reduce((a,c)=>a+(c.progress.bytesTotal??0),0),l=s.reduce((a,c)=>a+(c.progress.bytesUploaded||0),0);return r===0?0:l/r}#C(){const e=(s,o,r)=>{let l=s.message||"Unknown error";s.details&&(l+=` ${s.details}`),this.setState({error:l}),o!=null&&o.id in this.getState().files&&this.setFileState(o.id,{error:l,response:r})};this.on("error",e),this.on("upload-error",(s,o,r)=>{if(e(o,s,r),typeof o=="object"&&o.message){this.log(o.message,"error");const l=new Error(this.i18n("failedToUpload",{file:s?.name??""}));l.isUserFacing=!0,l.details=o.message,o.details&&(l.details+=` ${o.details}`),this.#r([l])}else this.#r([o])});let i=null;this.on("upload-stalled",(s,o)=>{const{message:r}=s,l=o.map(a=>a.meta.name).join(", ");i||(this.info({message:r,details:l},"warning",this.opts.infoTimeout),i=setTimeout(()=>{i=null},this.opts.infoTimeout)),this.log(`${r} ${l}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});const n=s=>{const o=s.filter(l=>{const a=l!=null&&this.getFile(l.id);return a||this.log(`Not setting progress for a file that has been removed: ${l?.id}`),a}),r=Object.fromEntries(o.map(l=>[l.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:l.size}}]));this.patchFilesState(r)};this.on("upload-start",n),this.on("upload-progress",this.#S),this.on("upload-success",(s,o)=>{if(s==null||!this.getFile(s.id)){this.log(`Not setting progress for a file that has been removed: ${s?.id}`);return}const r=this.getFile(s.id).progress,l=this.#a.size>0;this.setFileState(s.id,{progress:{...r,postprocess:l?{mode:"indeterminate"}:void 0,uploadComplete:!0,...!l&&{complete:!0},percentage:100,bytesUploaded:r.bytesTotal},response:o,uploadURL:o.uploadURL,isPaused:!1}),s.size==null&&this.setFileState(s.id,{size:o.bytesUploaded||r.bytesTotal}),this.#d()}),this.on("preprocess-progress",(s,o)=>{if(s==null||!this.getFile(s.id)){this.log(`Not setting progress for a file that has been removed: ${s?.id}`);return}this.setFileState(s.id,{progress:{...this.getFile(s.id).progress,preprocess:o}})}),this.on("preprocess-complete",s=>{if(s==null||!this.getFile(s.id)){this.log(`Not setting progress for a file that has been removed: ${s?.id}`);return}const o={...this.getState().files};o[s.id]={...o[s.id],progress:{...o[s.id].progress}},delete o[s.id].progress.preprocess,this.setState({files:o})}),this.on("postprocess-progress",(s,o)=>{if(s==null||!this.getFile(s.id)){this.log(`Not setting progress for a file that has been removed: ${s?.id}`);return}this.setFileState(s.id,{progress:{...this.getState().files[s.id].progress,postprocess:o}})}),this.on("postprocess-complete",s=>{const o=s&&this.getFile(s.id);if(o==null){this.log(`Not setting progress for a file that has been removed: ${s?.id}`);return}const{postprocess:r,...l}=o.progress;this.patchFilesState({[o.id]:{progress:{...l,complete:!0}}})}),this.on("restored",()=>{this.#d()}),this.on("dashboard:file-edit-complete",s=>{s&&this.#u(s)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",this.#c),window.addEventListener("offline",this.#c),setTimeout(this.#c,3e3))}updateOnlineStatus(){window.navigator.onLine??!0?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}#c=this.updateOnlineStatus.bind(this);getID(){return this.opts.id}use(e,...i){if(typeof e!="function"){const r=`Expected a plugin class, but got ${e===null?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(r)}const n=new e(this,...i),s=n.id;if(!s)throw new Error("Your plugin must have an id");if(!n.type)throw new Error("Your plugin must have a type");const o=this.getPlugin(s);if(o){const r=`Already found a plugin named '${o.id}'. Tried to use: '${s}'.
|
|
6
|
-
Uppy plugins must have unique \`id\` options.`;throw new Error(r)}return e.VERSION&&this.log(`Using ${s} v${e.VERSION}`),n.type in this.#e?this.#e[n.type].push(n):this.#e[n.type]=[n],n.install(),this.emit("plugin-added",n),this}getPlugin(e){for(const i of Object.values(this.#e)){const n=i.find(s=>s.id===e);if(n!=null)return n}}[Symbol.for("uppy test: getPlugins")](e){return this.#e[e]}iteratePlugins(e){Object.values(this.#e).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const i=this.#e[e.type],n=i.findIndex(r=>r.id===e.id);n!==-1&&i.splice(n,1);const o={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(o)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),this.#i(),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",this.#c),window.removeEventListener("offline",this.#c))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,i="info",n=3e3){const s=typeof e=="object";this.setState({info:[...this.getState().info,{type:i,message:s?e.message:e,details:s?e.details:null}]}),setTimeout(()=>this.hideInfo(),n),this.emit("info-visible")}log(e,i){const{logger:n}=this.opts;switch(i){case"error":n.error(e);break;case"warning":n.warn(e);break;default:n.debug(e);break}}#y=new Map;registerRequestClient(e,i){this.#y.set(e,i)}getRequestClientForFile(e){if(!("remote"in e&&e.remote))throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);const i=this.#y.get(e.remote.requestClientId);if(i==null)throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return i}async restore(e){this.log(`Core: Running restored upload "${e}"`);const i=await this.#f(e);return this.emit("complete",i),i}#h(e,i={}){const{forceAllowNewUpload:n=!1}=i,{allowNewUpload:s,currentUploads:o}=this.getState();if(!s&&!n)throw new Error("Cannot create a new upload: already uploading.");const r=ev();return this.emit("upload",r,this.getFilesByIds(e)),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:{...o,[r]:{fileIDs:e,step:0,result:{}}}}),r}[Symbol.for("uppy test: createUpload")](...e){return this.#h(...e)}#E(e){const{currentUploads:i}=this.getState();return i[e]}addResultData(e,i){if(!this.#E(e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}const{currentUploads:n}=this.getState(),s={...n[e],result:{...n[e].result,...i}};this.setState({currentUploads:{...n,[e]:s}})}#w(e){const{[e]:i,...n}=this.getState().currentUploads;this.setState({currentUploads:n})}async#f(e){const i=()=>{const{currentUploads:r}=this.getState();return r[e]};let n=i();if(!n)throw new Error("Nonexistent upload");const s=[...this.#o,...this.#s,...this.#a];try{for(let r=n.step||0;r<s.length;r++){const l=s[r];this.setState({currentUploads:{...this.getState().currentUploads,[e]:{...n,step:r}}});const{fileIDs:a}=n;if(await l(a,e),n=i(),!n)break}}catch(r){throw this.#w(e),r}if(n){n.fileIDs.forEach(c=>{const u=this.getFile(c);u?.progress.postprocess&&this.emit("postprocess-complete",u)});const r=n.fileIDs.map(c=>this.getFile(c)),l=r.filter(c=>!c.error),a=r.filter(c=>c.error);this.addResultData(e,{successful:l,failed:a,uploadID:e}),n=i()}let o;return n&&(o=n.result,this.#w(e)),o==null&&(this.log(`Not setting result for an upload that has been removed: ${e}`),o={successful:[],failed:[],uploadID:e}),o}async upload(){this.#e.uploader?.length||this.log("No uploader type plugins are used","warning");let{files:e}=this.getState();if(this.#v().length>0){const s=await this.#g();if(!(this.getFiles().filter(r=>r.progress.uploadStarted==null).length>0))return this.emit("complete",s),s;({files:e}=this.getState())}const n=this.opts.onBeforeUpload(e);if(n===!1)throw new Error("Not starting the upload because onBeforeUpload returned false");n&&typeof n=="object"&&(e=n,this.setState({files:e}));try{if(this.#t.validateMinNumberOfFiles(e),!this.#l(e))throw new Mt(this.i18n("missingRequiredMetaField"));const{currentUploads:s}=this.getState(),o=Object.values(s).flatMap(c=>c.fileIDs),r=Object.keys(e).filter(c=>{const u=this.getFile(c);return u&&!u.progress.uploadStarted&&!o.includes(c)}),l=this.#h(r),a=await this.#f(l);return this.emit("complete",a),a}catch(s){throw this.#r([s]),s}}}function Nl(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable}))),i.push.apply(i,n)}return i}function ke(t){for(var e=1;e<arguments.length;e++){var i=arguments[e]!=null?arguments[e]:{};e%2?Nl(Object(i),!0).forEach((function(n){_t(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Nl(Object(i)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))}))}return t}function _t(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function rv(t,e){if(t==null)return{};var i,n,s=(function(r,l){if(r==null)return{};var a,c,u={},d=Object.keys(r);for(c=0;c<d.length;c++)a=d[c],l.indexOf(a)>=0||(u[a]=r[a]);return u})(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(n=0;n<o.length;n++)i=o[n],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}function Oi(t){return(function(e){if(Array.isArray(e))return Yo(e)})(t)||(function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)})(t)||(function(e,i){if(e){if(typeof e=="string")return Yo(e,i);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yo(e,i)}})(t)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
7
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Yo(t,e){(e==null||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var Vl,av,cs,je=(Vl=function(t){(function(){var e={}.hasOwnProperty;function i(){for(var n=[],s=0;s<arguments.length;s++){var o=arguments[s];if(o){var r=typeof o;if(r==="string"||r==="number")n.push(o);else if(Array.isArray(o)){if(o.length){var l=i.apply(null,o);l&&n.push(l)}}else if(r==="object")if(o.toString===Object.prototype.toString)for(var a in o)e.call(o,a)&&o[a]&&n.push(a);else n.push(o.toString())}}return n.join(" ")}t.exports?(i.default=i,t.exports=i):window.classNames=i})()},Vl(cs={path:av,exports:{},require:function(t,e){return(function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")})(e==null&&cs.path)}},cs.exports),cs.exports),zt=function(t){return function(e,i){if(!e)return t;var n;typeof e=="string"?n=e:i=e;var s=t;return n&&(s+="__"+n),s+(i?Object.keys(i).reduce((function(o,r){var l=i[r];return l&&(o+=" "+(typeof l=="boolean"?s+"--"+r:s+"--"+r+"_"+l)),o}),""):"")}};function br(t,e,i){var n,s,o,r,l;function a(){var u=Date.now()-r;u<e&&u>=0?n=setTimeout(a,e-u):(n=null,i||(l=t.apply(o,s),o=s=null))}e==null&&(e=100);var c=function(){o=this,s=arguments,r=Date.now();var u=i&&!n;return n||(n=setTimeout(a,e)),u&&(l=t.apply(o,s),o=s=null),l};return c.clear=function(){n&&(clearTimeout(n),n=null)},c.flush=function(){n&&(l=t.apply(o,s),o=s=null,clearTimeout(n),n=null)},c}br.debounce=br;var xr=br,de=function(){return de=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var s in e=arguments[i])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},de.apply(this,arguments)};function wu(t,e){var i,n;return t&&e?(i=""+t+e[0].toUpperCase()+e.slice(1),n=t+"-"+e):(i=t||e,n=t||e),{name:i,classname:n}}function bu(t){return/^blob:/.test(t)}function ql(t){return bu(t)||(function(e){return/^data:/.test(e)})(t)}function Ii(t){return!!(t&&t.constructor&&t.call&&t.apply)}function qe(t){return t===void 0}function ys(t){return typeof t=="object"&&t!==null}function Sr(t,e,i){var n={};return ys(t)?(Object.keys(e).forEach((function(s){qe(t[s])?n[s]=e[s]:ys(e[s])?ys(t[s])?n[s]=Sr(t[s],e[s],i[s]):n[s]=t[s]?e[s]:i[s]:e[s]===!0||e[s]===!1?n[s]=!!t[s]:n[s]=t[s]})),n):t?e:i}function us(t){var e=Number(t);return Number.isNaN(e)?t:e}function Wl(t){return typeof(t=="number"||(function(e){return typeof e=="object"&&e!==null})(t)&&toString.call(t)=="[object Number]")&&!xu(t)}function xu(t){return t!=t}function Su(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}var gn=function(t,e){t===void 0&&(t={}),e===void 0&&(e={}),this.type="manipulateImage",this.move=t,this.scale=e},lv=function(t,e){e===void 0&&(e={}),this.type="resize",this.directions=t,this.params=e},oa=function(t){this.type="move",this.directions=t},cv=(function(){function t(e,i,n,s,o){this.type="drag",this.nativeEvent=e,this.position=n,this.previousPosition=s,this.element=i,this.anchor=o}return t.prototype.shift=function(){var e=this,i=e.element,n=e.anchor,s=e.position;if(i){var o=i.getBoundingClientRect(),r=o.left,l=o.top;return{left:s.left-r-n.left,top:s.top-l-n.top}}return{left:0,top:0}},t})(),ra={name:"DraggableElement",props:{classname:{type:String}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){if(!this.$refs.draggable)throw new Error('You should add ref "draggable" to your root element to use draggable mixin');this.touches=[],this.hovered=!1},methods:{onMouseOver:function(){this.hovered||(this.hovered=!0,this.$emit("enter"))},onMouseLeave:function(){this.hovered&&!this.touches.length&&(this.hovered=!1,this.$emit("leave"))},onTouchStart:function(t){t.cancelable&&!this.disabled&&t.touches.length===1&&(this.touches=Oi(t.touches),this.hovered||(this.$emit("enter"),this.hovered=!0),t.touches.length&&this.initAnchor(this.touches.reduce((function(e,i){return{clientX:e.clientX+i.clientX/t.touches.length,clientY:e.clientY+i.clientY/t.touches.length}}),{clientX:0,clientY:0})),t.preventDefault&&t.preventDefault(),t.stopPropagation())},onTouchEnd:function(){this.processEnd()},onTouchMove:function(t){this.touches.length&&(this.processMove(t,t.touches),t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation())},onMouseDown:function(t){if(!this.disabled){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()}},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.preventDefault())},onMouseUp:function(){this.processEnd()},initAnchor:function(t){var e=this.$refs.draggable.getBoundingClientRect(),i=e.left,n=e.right,s=e.bottom,o=e.top;this.anchor={left:t.clientX-i,top:t.clientY-o,bottom:s-t.clientY,right:n-t.clientX}},processMove:function(t,e){var i=Oi(e);if(this.touches.length){if(this.touches.length===1&&i.length===1){var n=this.$refs.draggable;this.$emit("drag",new cv(t,n,{left:i[0].clientX,top:i[0].clientY},{left:this.touches[0].clientX,top:this.touches[0].clientY},this.anchor))}this.touches=i}},processEnd:function(){this.touches.length&&this.$emit("drag-end"),this.hovered&&(this.$emit("leave"),this.hovered=!1),this.touches=[]}},emits:["drag","drag-end","leave","enter"]};ra.render=function(t,e,i,n,s,o){return _(),X("div",{ref:"draggable",class:i.classname,onTouchstart:e[1]||(e[1]=function(){return o.onTouchStart&&o.onTouchStart.apply(o,arguments)}),onMousedown:e[2]||(e[2]=function(){return o.onMouseDown&&o.onMouseDown.apply(o,arguments)}),onMouseover:e[3]||(e[3]=function(){return o.onMouseOver&&o.onMouseOver.apply(o,arguments)}),onMouseleave:e[4]||(e[4]=function(){return o.onMouseLeave&&o.onMouseLeave.apply(o,arguments)})},[xe(t.$slots,"default")],34)};var Xo=zt("vue-handler-wrapper"),ku={name:"HandlerWrapper",components:{DraggableElement:ra},props:{horizontalPosition:{type:String},verticalPosition:{type:String},disabled:{type:Boolean,default:!1}},computed:{classes:function(){var t;if(this.horizontalPosition||this.verticalPosition){var e,i=wu(this.horizontalPosition,this.verticalPosition);t=Xo((_t(e={},i.classname,!0),_t(e,"disabled",this.disabled),e))}else t=Xo({disabled:this.disabled});return{root:t,draggable:Xo("draggable")}}},emits:["leave","enter","drag","drag-end"]};ku.render=function(t,e,i,n,s,o){var r=wt("DraggableElement");return _(),X("div",{class:o.classes.root},[ee(r,{class:o.classes.draggable,onDrag:e[1]||(e[1]=function(l){return t.$emit("drag",l)}),onDragEnd:e[2]||(e[2]=function(l){return t.$emit("drag-end")}),onLeave:e[3]||(e[3]=function(l){return t.$emit("leave")}),onEnter:e[4]||(e[4]=function(l){return t.$emit("enter")})},{default:he((function(){return[xe(t.$slots,"default")]})),_:3},8,["class"])],2)};var uv=zt("vue-line-wrapper"),Cu={name:"LineWrapper",components:{DraggableElement:ra},props:{position:{type:String,required:!0},disabled:{type:Boolean,default:!1}},computed:{classname:function(){var t;return uv((_t(t={},this.position,!0),_t(t,"disabled",this.disabled),t))}},emits:["leave","enter","drag","drag-end"]};Cu.render=function(t,e,i,n,s,o){var r=wt("DraggableElement");return _(),X(r,{class:o.classname,onDrag:e[1]||(e[1]=function(l){return t.$emit("drag",l)}),onDragEnd:e[2]||(e[2]=function(l){return t.$emit("drag-end")}),onLeave:e[3]||(e[3]=function(l){return t.$emit("leave")}),onEnter:e[4]||(e[4]=function(l){return t.$emit("enter")})},{default:he((function(){return[xe(t.$slots,"default")]})),_:3},8,["class"])};var jt=["left","right","top","bottom"],dv=["left","right"],hv=["top","bottom"],fv=["left","top"],pv=["fill-area","fit-area","stencil","none"],Ql={left:0,top:0,width:0,height:0};function Kl(t,e,i){return!(i=i||["width","height","left","top"]).some((function(n){return t[n]!==e[n]}))}function Vt(t){return{left:t.left,top:t.top,right:t.left+t.width,bottom:t.top+t.height}}function Xi(t,e){return{left:t.left-e.left,top:t.top-e.top}}function Ke(t){return{left:t.left+t.width/2,top:t.top+t.height/2}}function kn(t,e){var i={left:0,top:0,right:0,bottom:0};return jt.forEach((function(n){var s=e[n],o=Vt(t)[n];i[n]=s!==void 0&&o!==void 0?n==="left"||n==="top"?Math.max(0,s-o):Math.max(0,o-s):0})),i}function Bt(t,e){return{left:t.left-e.left,top:t.top-e.top,width:t.width+e.left+e.right,height:t.height+e.top+e.bottom}}function Xs(t){return{left:-t.left,top:-t.top}}function rt(t,e){return de(de({},t),{left:t.left+e.left,top:t.top+e.top})}function bt(t,e,i,n){if(e!==1){if(i){var s=Ke(t);return{width:t.width*e,height:t.height*e,left:t.left+t.width*(1-e)/2+(i.left-s.left)*(1-e),top:t.top+t.height*(1-e)/2+(i.top-s.top)*(1-e)}}return{width:t.width*e,height:t.height*e,left:t.left+t.width*(1-e)/2,top:t.top+t.height*(1-e)/2}}return t}function Ce(t){return t.width/t.height}function Gi(t,e){return Math.min(e.right!==void 0&&e.left!==void 0?(e.right-e.left)/t.width:1/0,e.bottom!==void 0&&e.top!==void 0?(e.bottom-e.top)/t.height:1/0)}function Ji(t,e){var i={left:0,top:0},n=kn(t,e);return n.left&&n.left>0?i.left=n.left:n.right&&n.right>0&&(i.left=-n.right),n.top&&n.top>0?i.top=n.top:n.bottom&&n.bottom>0&&(i.top=-n.bottom),i}function Go(t,e){var i;return e.minimum&&t<e.minimum?i=e.minimum:e.maximum&&t>e.maximum&&(i=e.maximum),i}function Eu(t,e){var i=Ce(t),n=Ce(e);return e.width<1/0&&e.height<1/0?i>n?{width:e.width,height:e.width/i}:{width:e.height*i,height:e.height}:e.width<1/0?{width:e.width,height:e.width/i}:e.height<1/0?{width:e.height*i,height:e.height}:t}function Au(t,e){var i=e*Math.PI/180;return{width:Math.abs(t.width*Math.cos(i))+Math.abs(t.height*Math.sin(i)),height:Math.abs(t.width*Math.sin(i))+Math.abs(t.height*Math.cos(i))}}function ui(t,e){var i=e*Math.PI/180;return{left:t.left*Math.cos(i)-t.top*Math.sin(i),top:t.left*Math.sin(i)+t.top*Math.cos(i)}}function Gs(t,e){var i=kn(Ye(t,e),e);return i.left+i.right+i.top+i.bottom?i.left+i.right>i.top+i.bottom?Math.min((t.width+i.left+i.right)/t.width,Gi(t,e)):Math.min((t.height+i.top+i.bottom)/t.height,Gi(t,e)):1}function Ye(t,e,i){i===void 0&&(i=!1);var n=Ji(t,e);return rt(t,i?Xs(n):n)}function kr(t){return{width:t.right!==void 0&&t.left!==void 0?t.right-t.left:1/0,height:t.bottom!==void 0&&t.top!==void 0?t.bottom-t.top:1/0}}function mv(t,e){return de(de({},t),{minWidth:Math.min(e.width,t.minWidth),minHeight:Math.min(e.height,t.minHeight),maxWidth:Math.min(e.width,t.maxWidth),maxHeight:Math.min(e.height,t.maxHeight)})}function Tu(t,e,i){i===void 0&&(i=!0);var n={};return jt.forEach((function(s){var o=t[s],r=e[s];o!==void 0&&r!==void 0?n[s]=s==="left"||s==="top"?i?Math.max(o,r):Math.min(o,r):i?Math.min(o,r):Math.max(o,r):r!==void 0?n[s]=r:o!==void 0&&(n[s]=o)})),n}function Js(t,e){return Tu(t,e,!0)}function Yl(t){var e=t.size,i=t.aspectRatio,n=t.ignoreMinimum,s=t.sizeRestrictions;return!!((e.correctRatio||Ce(e)>=i.minimum&&Ce(e)<=i.maximum)&&e.height<=s.maxHeight&&e.width<=s.maxWidth&&e.width&&e.height&&(n||e.height>=s.minHeight&&e.width>=s.minWidth))}function Xl(t,e){return Math.pow(t.width-e.width,2)+Math.pow(t.height-e.height,2)}function ti(t){var e=t.width,i=t.height,n=t.sizeRestrictions,s={minimum:t.aspectRatio&&t.aspectRatio.minimum||0,maximum:t.aspectRatio&&t.aspectRatio.maximum||1/0},o={width:Math.max(n.minWidth,Math.min(n.maxWidth,e)),height:Math.max(n.minHeight,Math.min(n.maxHeight,i))};function r(c,u){return u===void 0&&(u=!1),c.reduce((function(d,p){return Yl({size:p,aspectRatio:s,sizeRestrictions:n,ignoreMinimum:u})&&(!d||Xl(p,{width:e,height:i})<Xl(d,{width:e,height:i}))?p:d}),null)}var l=[];s&&[s.minimum,s.maximum].forEach((function(c){c&&l.push({width:o.width,height:o.width/c,correctRatio:!0},{width:o.height*c,height:o.height,correctRatio:!0})})),Yl({size:o,aspectRatio:s,sizeRestrictions:n})&&l.push(o);var a=r(l)||r(l,!0);return a&&{width:a.width,height:a.height}}function Cr(t){var e=t.event,i=t.coordinates,n=t.positionRestrictions,s=n===void 0?{}:n,o=rt(i,e.directions);return rt(o,Ji(o,s))}function vv(t){var e=t.coordinates,i=t.transform,n=t.imageSize,s=t.sizeRestrictions,o=t.positionRestrictions,r=t.aspectRatio,l=t.visibleArea,a=function(u,d){return Cr({coordinates:u,positionRestrictions:o,event:new oa({left:d.left-u.left,top:d.top-u.top})})},c=de({},e);return(Array.isArray(i)?i:[i]).forEach((function(u){var d={};qe((d=typeof u=="function"?u({coordinates:c,imageSize:n,visibleArea:l}):u).width)&&qe(d.height)||(c=(function(p,v){var m=de(de(de({},p),ti({width:v.width,height:v.height,sizeRestrictions:s,aspectRatio:r})),{left:0,top:0});return a(m,{left:p.left,top:p.top})})(c,de(de({},c),d))),qe(d.left)&&qe(d.top)||(c=a(c,de(de({},c),d)))})),c}function gv(t){t.event;var e=t.getAreaRestrictions,i=t.boundaries,n=t.coordinates,s=t.visibleArea;t.aspectRatio;var o=t.stencilSize,r=t.sizeRestrictions,l=t.positionRestrictions;t.stencilReference;var a,c,u,d=de({},n),p=de({},s),v=de({},o);a=Ce(v),c=Ce(d),u===void 0&&(u=.001),(a===0||c===0?Math.abs(c-a)<u:Math.abs(c/a)<1+u&&Math.abs(c/a)>1-u)||(d=de(de({},d),ti({sizeRestrictions:r,width:d.width,height:d.height,aspectRatio:{minimum:Ce(v),maximum:Ce(v)}})));var m=Gs(p=bt(p,d.width*i.width/(p.width*v.width)),e({visibleArea:p,type:"resize"}));return m!==1&&(p=bt(p,m),d=bt(d,m)),p=Ye(p=rt(p,Xi(Ke(d),Ke(p))),e({visibleArea:p,type:"move"})),{coordinates:d=Ye(d,Js(Vt(p),l)),visibleArea:p}}function _v(t){var e=t.event,i=t.getAreaRestrictions,n=t.boundaries,s=t.coordinates,o=t.visibleArea;t.aspectRatio,t.stencilSize,t.sizeRestrictions;var r=t.positionRestrictions;t.stencilReference;var l=de({},s),a=de({},o);if(s&&o&&e.type!=="manipulateImage"){var c={width:0,height:0};a.width,n.width,Ce(n)>Ce(l)?(c.height=.8*n.height,c.width=c.height*Ce(l)):(c.width=.8*n.width,c.height=c.width*Ce(l));var u=Gs(a=bt(a,l.width*n.width/(a.width*c.width)),i({visibleArea:a,type:"resize"}));a=bt(a,u),u!==1&&(c.height/=u,c.width/=u),a=Ye(a=rt(a,Xi(Ke(l),Ke(a))),i({visibleArea:a,type:"move"})),l=Ye(l,Js(Vt(a),r))}return{coordinates:l,visibleArea:a}}function yv(t){var e=t.event,i=t.coordinates,n=t.visibleArea,s=t.getAreaRestrictions,o=de({},n),r=de({},i);if(e.type==="setCoordinates"){var l=Math.max(0,r.width-o.width),a=Math.max(0,r.height-o.height);l>a?o=bt(o,Math.min(r.width/o.width,Gi(o,s({visibleArea:o,type:"resize"})))):a>l&&(o=bt(o,Math.min(r.height/o.height,Gi(o,s({visibleArea:o,type:"resize"}))))),o=Ye(o=rt(o,Xs(Ji(r,Vt(o)))),s({visibleArea:o,type:"move"}))}return{visibleArea:o,coordinates:r}}function wv(t){var e=t.imageSize,i=t.visibleArea,n=t.coordinates,s=i||e;return{left:(i?i.left:0)+s.width/2-n.width/2,top:(i?i.top:0)+s.height/2-n.height/2}}function bv(t){var e=t.imageSize,i=t.visibleArea,n=t.aspectRatio,s=t.sizeRestrictions,o=i||e,r=Math.min(n.maximum||1/0,Math.max(n.minimum||0,Ce(o))),l=o.width<o.height?{width:.8*o.width,height:.8*o.width/r}:{height:.8*o.height,width:.8*o.height*r};return ti(de(de({},l),{aspectRatio:n,sizeRestrictions:s}))}function xv(t){var e,i,n=t.imageSize,s=t.visibleArea,o=t.boundaries,r=t.aspectRatio,l=t.sizeRestrictions,a=t.stencilSize,c=s||n;return Ce(c)>Ce(o)?i=(e=a.height*c.height/o.height)*Ce(a):e=(i=a.width*c.width/o.width)/Ce(a),ti({width:i,height:e,aspectRatio:r,sizeRestrictions:l})}function Sv(t){var e=t.getAreaRestrictions,i=t.coordinates,n=t.imageSize,s=Ce(t.boundaries);if(i){var o={height:Math.max(i.height,n.height),width:Math.max(i.width,n.width)},r=Eu({width:Ce(o)>s?o.width:o.height*s,height:Ce(o)>s?o.width/s:o.height},kr(e())),l={left:i.left+i.width/2-r.width/2,top:i.top+i.height/2-r.height/2,width:r.width,height:r.height},a=kn(i,Vt(de({left:0,top:0},n))),c={};return!a.left&&!a.right&&l.width<=n.width&&(c.left=0,c.right=n.width),!a.top&&!a.bottom&&l.height<=n.height&&(c.top=0,c.bottom=n.height),Ye(l,c)}var u=Ce(n);return r={height:u>s?n.height:n.width/s,width:u>s?n.height*s:n.width},{left:n.width/2-r.width/2,top:n.height/2-r.height/2,width:r.width,height:r.height}}function ds(t,e){return Tu(t,Vt(e))}function kv(t){var e=t.event,i=t.coordinates,n=t.visibleArea,s=t.sizeRestrictions,o=t.getAreaRestrictions,r=t.positionRestrictions,l=t.adjustStencil,a=e.scale,c=e.move,u=de({},n),d=de({},i),p=1,v=1,m=a.factor&&Math.abs(a.factor-1)>.001;u=rt(u,{left:c.left||0,top:c.top||0});var g={stencil:{minimum:Math.max(s.minWidth?s.minWidth/d.width:0,s.minHeight?s.minHeight/d.height:0),maximum:Math.min(s.maxWidth?s.maxWidth/d.width:1/0,s.maxHeight?s.maxHeight/d.height:1/0,Gi(d,r))},area:{maximum:Gi(u,o({visibleArea:u,type:"resize"}))}};a.factor&&m&&(a.factor<1?(v=Math.max(a.factor,g.stencil.minimum))>1&&(v=1):a.factor>1&&(v=Math.min(a.factor,Math.min(g.area.maximum,g.stencil.maximum)))<1&&(v=1)),v&&(u=bt(u,v,a.center));var y=i.left-n.left,S=n.width+n.left-(i.width+i.left),b=i.top-n.top,x=n.height+n.top-(i.height+i.top);return u=Ye(u=rt(u,Ji(u,{left:r.left!==void 0?r.left-y*v:void 0,top:r.top!==void 0?r.top-b*v:void 0,bottom:r.bottom!==void 0?r.bottom+x*v:void 0,right:r.right!==void 0?r.right+S*v:void 0})),o({visibleArea:u,type:"move"})),d.width=d.width*v,d.height=d.height*v,d.left=u.left+y*v,d.top=u.top+b*v,d=Ye(d,Js(Vt(u),r)),a.factor&&m&&l&&(a.factor>1?p=Math.min(g.area.maximum,a.factor)/v:a.factor<1&&(p=Math.max(d.height/u.height,d.width/u.width,a.factor/v)),p!==1&&(u=rt(u=Ye(u=bt(u,p,a.factor>1?a.center:Ke(d)),o({visibleArea:u,type:"move"})),Xs(Ji(d,Vt(u)))))),{coordinates:d,visibleArea:u}}function Cv(t){var e=t.aspectRatio,i=t.getAreaRestrictions,n=t.coordinates,s=t.visibleArea,o=t.sizeRestrictions,r=t.positionRestrictions,l=t.imageSize,a=t.previousImageSize,c=t.angle,u=de({},n),d=de({},s),p=ui(Ke(de({left:0,top:0},a)),c);return(u=de(de({},ti({sizeRestrictions:o,aspectRatio:e,width:u.width,height:u.height})),ui(Ke(u),c))).left-=p.left-l.width/2+u.width/2,u.top-=p.top-l.height/2+u.height/2,d=bt(d,Gs(d,i({visibleArea:d,type:"resize"}))),{coordinates:u=Ye(u,r),visibleArea:d=Ye(d=rt(d,Xi(Ke(u),Ke(n))),i({visibleArea:d,type:"move"}))}}function Ev(t){var e=t.flip,i=t.previousFlip,n=t.rotate,s=t.getAreaRestrictions,o=t.coordinates,r=t.visibleArea,l=t.imageSize,a=de({},o),c=de({},r),u=i.horizontal!==e.horizontal,d=i.vertical!==e.vertical;if(u||d){var p=ui({left:l.width/2,top:l.height/2},-n),v=ui(Ke(a),-n),m=ui({left:u?p.left-(v.left-p.left):v.left,top:d?p.top-(v.top-p.top):v.top},n);a=rt(a,Xi(m,Ke(a))),v=ui(Ke(c),-n),c=Ye(c=rt(c,Xi(m=ui({left:u?p.left-(v.left-p.left):v.left,top:d?p.top-(v.top-p.top):v.top},n),Ke(c))),s({visibleArea:c,type:"move"}))}return{coordinates:a,visibleArea:c}}function Gl(t){var e=t.directions,i=t.coordinates,n=t.positionRestrictions,s=n===void 0?{}:n,o=t.sizeRestrictions,r=t.preserveRatio,l=t.compensate,a=de({},e),c=Bt(i,a).width,u=Bt(i,a).height;c<0&&(a.left<0&&a.right<0?(a.left=-(i.width-o.minWidth)/(a.left/a.right),a.right=-(i.width-o.minWidth)/(a.right/a.left)):a.left<0?a.left=-(i.width-o.minWidth):a.right<0&&(a.right=-(i.width-o.minWidth))),u<0&&(a.top<0&&a.bottom<0?(a.top=-(i.height-o.minHeight)/(a.top/a.bottom),a.bottom=-(i.height-o.minHeight)/(a.bottom/a.top)):a.top<0?a.top=-(i.height-o.minHeight):a.bottom<0&&(a.bottom=-(i.height-o.minHeight)));var d=kn(Bt(i,a),s);l&&(d.left&&d.left>0&&d.right===0?(a.right+=d.left,a.left-=d.left):d.right&&d.right>0&&d.left===0&&(a.left+=d.right,a.right-=d.right),d.top&&d.top>0&&d.bottom===0?(a.bottom+=d.top,a.top-=d.top):d.bottom&&d.bottom>0&&d.top===0&&(a.top+=d.bottom,a.bottom-=d.bottom),d=kn(Bt(i,a),s));var p={width:1/0,height:1/0,left:1/0,right:1/0,top:1/0,bottom:1/0};if(jt.forEach((function(g){var y=d[g];y&&a[g]&&(p[g]=Math.max(0,1-y/a[g]))})),r){var v=Math.min.apply(null,jt.map((function(g){return p[g]})));v!==1/0&&jt.forEach((function(g){a[g]*=v}))}else jt.forEach((function(g){p[g]!==1/0&&(a[g]*=p[g])}));if(c=Bt(i,a).width,u=Bt(i,a).height,a.right+a.left&&(c>o.maxWidth?p.width=(o.maxWidth-i.width)/(a.right+a.left):c<o.minWidth&&(p.width=(o.minWidth-i.width)/(a.right+a.left))),a.bottom+a.top&&(u>o.maxHeight?p.height=(o.maxHeight-i.height)/(a.bottom+a.top):u<o.minHeight&&(p.height=(o.minHeight-i.height)/(a.bottom+a.top))),r){var m=Math.min(p.width,p.height);m!==1/0&&jt.forEach((function(g){a[g]*=m}))}else p.width!==1/0&&dv.forEach((function(g){a[g]*=p.width})),p.height!==1/0&&hv.forEach((function(g){a[g]*=p.height}));return a}function hs(t,e,i){return e==0&&i==0?t/2:e==0?0:i==0?t:t*Math.abs(e/(e+i))}var Av=zt("vue-simple-handler"),Tv=zt("vue-simple-handler-wrapper"),aa={name:"SimpleHandler",components:{HandlerWrapper:ku},props:{defaultClass:{type:String},hoverClass:{type:String},wrapperClass:{type:String},horizontalPosition:{type:String},verticalPosition:{type:String},disabled:{type:Boolean,default:!1}},data:function(){return{hover:!1}},computed:{classes:function(){var t,e=(_t(t={},this.horizontalPosition,!!this.horizontalPosition),_t(t,this.verticalPosition,!!this.verticalPosition),_t(t,"".concat(this.horizontalPosition,"-").concat(this.verticalPosition),!!(this.verticalPosition&&this.horizontalPosition)),_t(t,"hover",this.hover),t);return{default:je(Av(e),this.defaultClass,this.hover&&this.hoverClass),wrapper:je(Tv(e),this.wrapperClass)}}},methods:{onDrag:function(t){this.$emit("drag",t)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1},onDragEnd:function(){this.$emit("drag-end")}},emits:["drag","drag-end"]};aa.render=function(t,e,i,n,s,o){var r=wt("HandlerWrapper");return _(),X(r,{class:o.classes.wrapper,"vertical-position":i.verticalPosition,"horizontal-position":i.horizontalPosition,disabled:i.disabled,onDrag:o.onDrag,onDragEnd:o.onDragEnd,onEnter:o.onEnter,onLeave:o.onLeave},{default:he((function(){return[ee("div",{class:o.classes.default},null,2)]})),_:1},8,["class","vertical-position","horizontal-position","disabled","onDrag","onDragEnd","onEnter","onLeave"])};var Mv=zt("vue-simple-line"),Rv=zt("vue-simple-line-wrapper"),la={name:"SimpleLine",components:{LineWrapper:Cu},props:{defaultClass:{type:String},hoverClass:{type:String},wrapperClass:{type:String},position:{type:String},disabled:{type:Boolean,default:!1}},data:function(){return{hover:!1}},computed:{classes:function(){return{root:je(Mv(_t({},this.position,!0)),this.defaultClass,this.hover&&this.hoverClass),wrapper:je(Rv(_t({},this.position,!0)),this.wrapperClass)}}},methods:{onDrag:function(t){this.$emit("drag",t)},onEnter:function(){this.hover=!0},onLeave:function(){this.hover=!1},onDragEnd:function(){this.$emit("drag-end")}},emits:["drag","drag-end"]};la.render=function(t,e,i,n,s,o){var r=wt("LineWrapper");return _(),X(r,{class:o.classes.wrapper,position:i.position,disabled:i.disabled,onDrag:o.onDrag,onDragEnd:o.onDragEnd,onEnter:o.onEnter,onLeave:o.onLeave},{default:he((function(){return[ee("div",{class:o.classes.root},null,2)]})),_:1},8,["class","position","disabled","onDrag","onDragEnd","onEnter","onLeave"])};var Jo=zt("vue-bounding-box"),Fv=["east","west",null],$v=["south","north",null],Mu={name:"BoundingBox",props:{width:{type:Number},height:{type:Number},transitions:{type:Object},handlers:{type:Object,default:function(){return{eastNorth:!0,north:!0,westNorth:!0,west:!0,westSouth:!0,south:!0,eastSouth:!0,east:!0}}},handlersComponent:{type:[Object,String],default:function(){return aa}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}},lines:{type:Object,default:function(){return{west:!0,north:!0,east:!0,south:!0}}},linesComponent:{type:[Object,String],default:function(){return la}},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},resizable:{type:Boolean,default:!0}},data:function(){var t=[];return Fv.forEach((function(e){$v.forEach((function(i){if(e!==i){var n=wu(e,i),s=n.name,o=n.classname;t.push({name:s,classname:o,verticalDirection:i,horizontalDirection:e})}}))})),{points:t}},computed:{style:function(){var t={};return this.width&&this.height&&(t.width="".concat(this.width,"px"),t.height="".concat(this.height,"px"),this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction))),t},classes:function(){var t=this.handlersClasses,e=this.handlersWrappersClasses,i=this.linesClasses,n=this.linesWrappersClasses;return{root:Jo(),handlers:t,handlersWrappers:e,lines:i,linesWrappers:n}},lineNodes:function(){var t=this,e=[];return this.points.forEach((function(i){i.horizontalDirection&&i.verticalDirection||!t.lines[i.name]||e.push({name:i.name,component:t.linesComponent,class:je(t.classes.lines.default,t.classes.lines[i.name],!t.resizable&&t.classes.lines.disabled),wrapperClass:je(t.classes.linesWrappers.default,t.classes.linesWrappers[i.name],!t.resizable&&t.classes.linesWrappers.disabled),hoverClass:t.classes.lines.hover,verticalDirection:i.verticalDirection,horizontalDirection:i.horizontalDirection,disabled:!t.resizable})})),e},handlerNodes:function(){var t=this,e=[],i=this.width,n=this.height;return this.points.forEach((function(s){if(t.handlers[s.name]){var o={name:s.name,component:t.handlersComponent,class:je(t.classes.handlers.default,t.classes.handlers[s.name]),wrapperClass:je(t.classes.handlersWrappers.default,t.classes.handlersWrappers[s.name]),hoverClass:t.classes.handlers.hover,verticalDirection:s.verticalDirection,horizontalDirection:s.horizontalDirection,disabled:!t.resizable};if(i&&n){var r=s.horizontalDirection,l=s.verticalDirection,a=r==="east"?i:r==="west"?0:i/2,c=l==="south"?n:l==="north"?0:n/2;o.wrapperClass=Jo("handler"),o.wrapperStyle={transform:"translate(".concat(a,"px, ").concat(c,"px)")},t.transitions&&t.transitions.enabled&&(o.wrapperStyle.transition="".concat(t.transitions.time,"ms ").concat(t.transitions.timingFunction))}else o.wrapperClass=Jo("handler",_t({},s.classname,!0));e.push(o)}})),e}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[]},methods:{onEnd:function(){this.$emit("resize-end")},onHandlerDrag:function(t,e,i){var n,s=t.shift(),o=s.left,r=s.top,l={left:0,right:0,top:0,bottom:0};e==="west"?l.left-=o:e==="east"&&(l.right+=o),i==="north"?l.top-=r:i==="south"&&(l.bottom+=r),!i&&e?n="width":i&&!e&&(n="height"),this.resizable&&this.$emit("resize",new lv(l,{allowedDirections:{left:e==="west"||!e,right:e==="east"||!e,bottom:i==="south"||!i,top:i==="north"||!i},preserveAspectRatio:t.nativeEvent&&t.nativeEvent.shiftKey,respectDirection:n}))}},emits:["resize","resize-end"]};Mu.render=function(t,e,i,n,s,o){return _(),X("div",{ref:"box",class:o.classes.root,style:o.style},[xe(t.$slots,"default"),ee("div",null,[(_(!0),X(_e,null,$e(o.lineNodes,(function(r){return _(),X(Rt(r.component),{key:r.name,"default-class":r.class,"hover-class":r.hoverClass,"wrapper-class":r.wrapperClass,position:r.name,disabled:r.disabled,onDrag:function(l){return o.onHandlerDrag(l,r.horizontalDirection,r.verticalDirection)},onDragEnd:e[1]||(e[1]=function(l){return o.onEnd()})},null,8,["default-class","hover-class","wrapper-class","position","disabled","onDrag"])})),128))]),(_(!0),X(_e,null,$e(o.handlerNodes,(function(r){return _(),X("div",{key:r.name,style:r.wrapperStyle,class:r.wrapperClass},[(_(),X(Rt(r.component),{"default-class":r.class,"hover-class":r.hoverClass,"wrapper-class":r.wrapperClass,"horizontal-position":r.horizontalDirection,"vertical-position":r.verticalDirection,disabled:r.disabled,onDrag:function(l){return o.onHandlerDrag(l,r.horizontalDirection,r.verticalDirection)},onDragEnd:e[2]||(e[2]=function(l){return o.onEnd()})},null,8,["default-class","hover-class","wrapper-class","horizontal-position","vertical-position","disabled","onDrag"]))],6)})),128))],6)};var Ov=zt("vue-draggable-area"),Ru={name:"DraggableArea",props:{movable:{type:Boolean,default:!0},activationDistance:{type:Number,default:20}},computed:{classnames:function(){return{default:Ov()}}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},mounted:function(){this.touches=[],this.touchStarted=!1},methods:{onTouchStart:function(t){if(t.cancelable){var e=this.movable&&t.touches.length===1;e&&(this.touches=Oi(t.touches)),(this.touchStarted||e)&&(t.preventDefault(),t.stopPropagation())}},onTouchEnd:function(){this.touchStarted=!1,this.processEnd()},onTouchMove:function(t){this.touches.length>=1&&(this.touchStarted?(this.processMove(t,t.touches),t.preventDefault(),t.stopPropagation()):Su({x:this.touches[0].clientX,y:this.touches[0].clientY},{x:t.touches[0].clientX,y:t.touches[0].clientY})>this.activationDistance&&(this.initAnchor({clientX:t.touches[0].clientX,clientY:t.touches[0].clientY}),this.touchStarted=!0))},onMouseDown:function(t){if(this.movable&&t.button===0){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.initAnchor(e),t.stopPropagation()}},onMouseMove:function(t){this.touches.length&&(this.processMove(t,[{fake:!0,clientX:t.clientX,clientY:t.clientY}]),t.preventDefault&&t.cancelable&&t.preventDefault(),t.stopPropagation())},onMouseUp:function(){this.processEnd()},initAnchor:function(t){var e=this.$refs.container.getBoundingClientRect(),i=e.left,n=e.top;this.anchor={x:t.clientX-i,y:t.clientY-n}},processMove:function(t,e){var i=Oi(e);if(this.touches.length){var n=this.$refs.container.getBoundingClientRect(),s=n.left,o=n.top;this.touches.length===1&&i.length===1&&this.$emit("move",new oa({left:i[0].clientX-(s+this.anchor.x),top:i[0].clientY-(o+this.anchor.y)}))}},processEnd:function(){this.touches.length&&this.$emit("move-end"),this.touches=[]}},emits:["move","move-end"]};Ru.render=function(t,e,i,n,s,o){return _(),X("div",{ref:"container",onTouchstart:e[1]||(e[1]=function(){return o.onTouchStart&&o.onTouchStart.apply(o,arguments)}),onMousedown:e[2]||(e[2]=function(){return o.onMouseDown&&o.onMouseDown.apply(o,arguments)})},[xe(t.$slots,"default")],544)};function Zo(t){var e,i;return{rotate:t.rotate||0,flip:{horizontal:((e=t?.flip)===null||e===void 0?void 0:e.horizontal)||!1,vertical:((i=t?.flip)===null||i===void 0?void 0:i.vertical)||!1}}}function Pv(t){return new Promise((function(e,i){try{if(t)if(/^data:/i.test(t))e((function(a){a=a.replace(/^data:([^;]+);base64,/gim,"");for(var c=atob(a),u=c.length,d=new ArrayBuffer(u),p=new Uint8Array(d),v=0;v<u;v++)p[v]=c.charCodeAt(v);return d})(t));else if(/^blob:/i.test(t)){var n=new FileReader;n.onload=function(a){e(a.target.result)},o=t,r=function(a){n.readAsArrayBuffer(a)},(l=new XMLHttpRequest).open("GET",o,!0),l.responseType="blob",l.onload=function(){this.status!=200&&this.status!==0||r(this.response)},l.send()}else{var s=new XMLHttpRequest;s.onreadystatechange=function(){s.readyState===4&&(s.status===200||s.status===0?e(s.response):i("Warning: could not load an image to parse its orientation"),s=null)},s.onprogress=function(){s.getResponseHeader("content-type")!=="image/jpeg"&&s.abort()},s.withCredentials=!1,s.open("GET",t,!0),s.responseType="arraybuffer",s.send(null)}else i("Error: the image is empty")}catch(a){i(a)}var o,r,l}))}function Fu(t){var e=t.rotate,i=t.flip,n=t.scaleX,s=t.scaleY,o="";return o+=" rotate("+e+"deg) ",o+=" scaleX("+n*(i.horizontal?-1:1)+") ",o+=" scaleY("+s*(i.vertical?-1:1)+") "}function zv(t){try{var e,i=new DataView(t),n=void 0,s=void 0,o=void 0,r=void 0;if(i.getUint8(0)===255&&i.getUint8(1)===216)for(var l=i.byteLength,a=2;a+1<l;){if(i.getUint8(a)===255&&i.getUint8(a+1)===225){o=a;break}a++}if(o&&(n=o+10,(function(v,m,g){var y,S="";for(y=m,g+=m;y<g;y++)S+=String.fromCharCode(v.getUint8(y));return S})(i,o+4,4)==="Exif")){var c=i.getUint16(n);if(((s=c===18761)||c===19789)&&i.getUint16(n+2,s)===42){var u=i.getUint32(n+4,s);u>=8&&(r=n+u)}}if(r){for(var d=i.getUint16(r,s),p=0;p<d;p++)if(a=r+12*p+2,i.getUint16(a,s)===274){a+=8,e=i.getUint16(a,s),i.setUint16(a,1,s);break}}return e}catch{return null}}function Jl(t,e){var i=e.getBoundingClientRect(),n=i.left,s=i.top,o={left:0,top:0},r=0;return t.forEach((function(l){o.left+=(l.clientX-n)/t.length,o.top+=(l.clientY-s)/t.length})),t.forEach((function(l){r+=Su({x:o.left,y:o.top},{x:l.clientX-n,y:l.clientY-s})})),{centerMass:o,spread:r,count:t.length}}var $u={props:{touchMove:{type:Boolean,required:!0},mouseMove:{type:Boolean,required:!0},touchResize:{type:Boolean,required:!0},wheelResize:{type:[Boolean,Object],required:!0},eventsFilter:{type:Function,required:!1}},beforeMount:function(){window.addEventListener("mouseup",this.onMouseUp,{passive:!1}),window.addEventListener("mousemove",this.onMouseMove,{passive:!1}),window.addEventListener("touchmove",this.onTouchMove,{passive:!1}),window.addEventListener("touchend",this.onTouchEnd,{passive:!1})},beforeUnmount:function(){window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd)},created:function(){this.transforming=!1,this.debouncedProcessEnd=xr(this.processEnd),this.touches=[]},methods:{processMove:function(t,e){if(this.touches.length){if(this.touches.length===1&&e.length===1)this.$emit("move",new gn({left:this.touches[0].clientX-e[0].clientX,top:this.touches[0].clientY-e[0].clientY}));else if(this.touches.length>1&&this.touchResize){var i=Jl(e,this.$refs.container),n=this.oldGeometricProperties;n.count===i.count&&n.count>1&&this.$emit("resize",new gn({left:n.centerMass.left-i.centerMass.left,top:n.centerMass.top-i.centerMass.top},{factor:n.spread/i.spread,center:i.centerMass})),this.oldGeometricProperties=i}this.touches=e}},processEnd:function(){this.transforming&&(this.transforming=!1,this.$emit("transform-end"))},processStart:function(){this.transforming=!0,this.debouncedProcessEnd.clear()},processEvent:function(t){return this.eventsFilter?this.eventsFilter(t,this.transforming)!==!1:(t.preventDefault(),t.stopPropagation(),!0)},onTouchStart:function(t){if(t.cancelable&&(this.touchMove||this.touchResize&&t.touches.length>1)&&this.processEvent(t)){var e=this.$refs.container,i=e.getBoundingClientRect(),n=i.left,s=i.top,o=i.bottom,r=i.right;this.touches=Oi(t.touches).filter((function(l){return l.clientX>n&&l.clientX<r&&l.clientY>s&&l.clientY<o})),this.oldGeometricProperties=Jl(this.touches,e)}},onTouchEnd:function(t){t.touches.length===0&&(this.touches=[],this.processEnd())},onTouchMove:function(t){var e=this;if(this.touches.length){var i=Oi(t.touches).filter((function(n){return!n.identifier||e.touches.find((function(s){return s.identifier===n.identifier}))}));this.processEvent(t)&&(this.processMove(t,i),this.processStart())}},onMouseDown:function(t){if(this.mouseMove&&"buttons"in t&&t.buttons===1&&this.processEvent(t)){var e={fake:!0,clientX:t.clientX,clientY:t.clientY};this.touches=[e],this.processStart()}},onMouseMove:function(t){this.touches.length&&this.processEvent(t)&&this.processMove(t,[{clientX:t.clientX,clientY:t.clientY}])},onMouseUp:function(){this.touches=[],this.processEnd()},onWheel:function(t){if(this.wheelResize&&this.processEvent(t)){var e=this.$refs.container.getBoundingClientRect(),i=e.left,n=e.top,s=1+this.wheelResize.ratio*(r=t.deltaY||t.detail||t.wheelDelta,(l=+r)==0||xu(l)?l:l>0?1:-1),o={left:t.clientX-i,top:t.clientY-n};this.$emit("resize",new gn({},{factor:s,center:o})),this.touches.length||this.debouncedProcessEnd()}var r,l}},emits:["resize","move","transform-end"]};$u.render=function(t,e,i,n,s,o){return _(),X("div",{ref:"container",onTouchstart:e[1]||(e[1]=function(){return o.onTouchStart&&o.onTouchStart.apply(o,arguments)}),onMousedown:e[2]||(e[2]=function(){return o.onMouseDown&&o.onMouseDown.apply(o,arguments)}),onWheel:e[3]||(e[3]=function(){return o.onWheel&&o.onWheel.apply(o,arguments)})},[xe(t.$slots,"default")],544)};var Er={components:{TransformableImage:$u},props:{touchMove:{type:Boolean,required:!0},mouseMove:{type:Boolean,required:!0},touchResize:{type:Boolean,required:!0},wheelResize:{type:[Boolean,Object],required:!0}},emits:["resize","move"]};Er.render=function(t,e,i,n,s,o){var r=wt("transformable-image");return _(),X(r,{"touch-move":i.touchMove,"touch-resize":i.touchResize,"mouse-move":i.mouseMove,"wheel-resize":i.wheelResize,onMove:e[1]||(e[1]=function(l){return t.$emit("move",l)}),onResize:e[2]||(e[2]=function(l){return t.$emit("resize",l)})},{default:he((function(){return[xe(t.$slots,"default")]})),_:3},8,["touch-move","touch-resize","mouse-move","wheel-resize"])};var fs=zt("vue-preview"),Ou={props:{coordinates:{type:Object},transitions:{type:Object},image:{type:Object,default:function(){return{}}},imageClass:{type:String},width:{type:Number},height:{type:Number},fill:{type:Boolean}},data:function(){return{calculatedImageSize:{width:0,height:0},calculatedSize:{width:0,height:0}}},computed:{classes:function(){return{root:fs({fill:this.fill}),wrapper:fs("wrapper"),imageWrapper:fs("image-wrapper"),image:je(fs("image"),this.imageClass)}},style:function(){if(this.fill)return{};var t={};return this.width&&(t.width="".concat(this.size.width,"px")),this.height&&(t.height="".concat(this.size.height,"px")),this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),t},wrapperStyle:function(){var t={width:"".concat(this.size.width,"px"),height:"".concat(this.size.height,"px"),left:"calc(50% - ".concat(this.size.width/2,"px)"),top:"calc(50% - ".concat(this.size.height/2,"px)")};return this.transitions&&this.transitions.enabled&&(t.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),t},imageStyle:function(){if(this.coordinates&&this.image){var t=this.coordinates.width/this.size.width,e=ke(ke({rotate:0,flip:{horizontal:!1,vertical:!1}},this.image.transforms),{},{scaleX:1/t,scaleY:1/t}),i=this.imageSize.width,n=this.imageSize.height,s=Au({width:i,height:n},e.rotate),o={width:"".concat(i,"px"),height:"".concat(n,"px"),left:"0px",top:"0px"},r={rotate:{left:(i-s.width)*e.scaleX/2,top:(n-s.height)*e.scaleY/2},scale:{left:(1-e.scaleX)*i/2,top:(1-e.scaleY)*n/2}};return o.transform=`translate(
|
|
8
|
-
`.concat(-this.coordinates.left/t-r.rotate.left-r.scale.left,"px,").concat(-this.coordinates.top/t-r.rotate.top-r.scale.top,"px) ")+Fu(e),this.transitions&&this.transitions.enabled&&(o.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),o}return{}},size:function(){return{width:this.width||this.calculatedSize.width,height:this.height||this.calculatedSize.height}},imageSize:function(){return{width:this.image.width||this.calculatedImageSize.width,height:this.image.height||this.calculatedImageSize.height}}},watch:{image:function(t){(t.width||t.height)&&this.onChangeImage()}},mounted:function(){var t=this;this.onChangeImage(),this.$refs.image.addEventListener("load",(function(){t.refreshImage()})),window.addEventListener("resize",this.refresh),window.addEventListener("orientationchange",this.refresh)},unmounted:function(){window.removeEventListener("resize",this.refresh),window.removeEventListener("orientationchange",this.refresh)},methods:{refreshImage:function(){var t=this.$refs.image;this.calculatedImageSize.height=t.naturalHeight,this.calculatedImageSize.width=t.naturalWidth},refresh:function(){var t=this.$refs.root;this.width||(this.calculatedSize.width=t.clientWidth),this.height||(this.calculatedSize.height=t.clientHeight)},onChangeImage:function(){var t=this.$refs.image;t&&t.complete&&this.refreshImage(),this.refresh()}}};Ou.render=function(t,e,i,n,s,o){return _(),X("div",{ref:"root",class:o.classes.root,style:o.style},[ee("div",{ref:"wrapper",class:o.classes.wrapper,style:o.wrapperStyle},[ze(ee("img",{ref:"image",src:i.image&&i.image.src,class:o.classes.image,style:o.imageStyle},null,14,["src"]),[[$t,i.image&&i.image.src]])],6)],6)};var Pu={components:{Preview:Ou},inheritAttrs:!1};Pu.render=function(t,e,i,n,s,o){var r=wt("preview");return _(),X(r,We(t.$attrs,{fill:!0}),null,16)};var er=zt("vue-rectangle-stencil"),zu={name:"RectangleStencil",components:{StencilPreview:Pu,BoundingBox:Mu,DraggableArea:Ru},props:{image:{type:Object},coordinates:{type:Object},stencilCoordinates:{type:Object},handlers:{type:Object},handlersComponent:{type:[Object,String],default:function(){return aa}},lines:{type:Object},linesComponent:{type:[Object,String],default:function(){return la}},aspectRatio:{type:[Number,String]},minAspectRatio:{type:[Number,String]},maxAspectRatio:{type:[Number,String]},movable:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},transitions:{type:Object},movingClass:{type:String},resizingClass:{type:String},previewClass:{type:String},boundingBoxClass:{type:String},linesClasses:{type:Object,default:function(){return{}}},linesWrappersClasses:{type:Object,default:function(){return{}}},handlersClasses:{type:Object,default:function(){return{}}},handlersWrappersClasses:{type:Object,default:function(){return{}}}},data:function(){return{moving:!1,resizing:!1}},computed:{classes:function(){return{stencil:je(er({movable:this.movable,moving:this.moving,resizing:this.resizing}),this.moving&&this.movingClass,this.resizing&&this.resizingClass),preview:je(er("preview"),this.previewClass),boundingBox:je(er("bounding-box"),this.boundingBoxClass)}},style:function(){var t=this.stencilCoordinates,e=t.height,i=t.width,n=t.left,s=t.top,o={width:"".concat(i,"px"),height:"".concat(e,"px"),transform:"translate(".concat(n,"px, ").concat(s,"px)")};return this.transitions&&this.transitions.enabled&&(o.transition="".concat(this.transitions.time,"ms ").concat(this.transitions.timingFunction)),o}},methods:{onMove:function(t){this.$emit("move",t),this.moving=!0},onMoveEnd:function(){this.$emit("move-end"),this.moving=!1},onResize:function(t){this.$emit("resize",t),this.resizing=!0},onResizeEnd:function(){this.$emit("resize-end"),this.resizing=!1},aspectRatios:function(){return{minimum:this.aspectRatio||this.minAspectRatio,maximum:this.aspectRatio||this.maxAspectRatio}}},emits:["resize","resize-end","move","move-end"]};zu.render=function(t,e,i,n,s,o){var r=wt("stencil-preview"),l=wt("draggable-area"),a=wt("bounding-box");return _(),X("div",{class:o.classes.stencil,style:o.style},[ee(a,{width:i.stencilCoordinates.width,height:i.stencilCoordinates.height,transitions:i.transitions,class:o.classes.boundingBox,handlers:i.handlers,"handlers-component":i.handlersComponent,"handlers-classes":i.handlersClasses,"handlers-wrappers-classes":i.handlersWrappersClasses,lines:i.lines,"lines-component":i.linesComponent,"lines-classes":i.linesClasses,"lines-wrappers-classes":i.linesWrappersClasses,resizable:i.resizable,onResize:o.onResize,onResizeEnd:o.onResizeEnd},{default:he((function(){return[ee(l,{movable:i.movable,onMove:o.onMove,onMoveEnd:o.onMoveEnd},{default:he((function(){return[ee(r,{image:i.image,coordinates:i.coordinates,width:i.stencilCoordinates.width,height:i.stencilCoordinates.height,class:o.classes.preview,transitions:i.transitions},null,8,["image","coordinates","width","height","class","transitions"])]})),_:1},8,["movable","onMove","onMoveEnd"])]})),_:1},8,["width","height","transitions","class","handlers","handlers-component","handlers-classes","handlers-wrappers-classes","lines","lines-component","lines-classes","lines-wrappers-classes","resizable","onResize","onResizeEnd"])],6)};var Dv=["transitions"],Yt=zt("vue-advanced-cropper"),Du={name:"Cropper",components:{BackgroundWrapper:Er},props:{src:{type:String,default:null},stencilComponent:{type:[Object,String],default:function(){return zu}},backgroundWrapperComponent:{type:[Object,String],default:function(){return Er}},stencilProps:{type:Object,default:function(){return{}}},autoZoom:{type:Boolean,default:!1},imageClass:{type:String},boundariesClass:{type:String},backgroundClass:{type:String},foregroundClass:{type:String},minWidth:{type:[Number,String]},minHeight:{type:[Number,String]},maxWidth:{type:[Number,String]},maxHeight:{type:[Number,String]},debounce:{type:[Boolean,Number],default:500},transitions:{type:Boolean,default:!0},checkOrientation:{type:Boolean,default:!0},canvas:{type:[Object,Boolean],default:!0},crossOrigin:{type:[Boolean,String],default:void 0},transitionTime:{type:Number,default:300},imageRestriction:{type:String,default:"fit-area",validator:function(t){return pv.indexOf(t)!==-1}},roundResult:{type:Boolean,default:!0},defaultSize:{type:[Function,Object]},defaultPosition:{type:[Function,Object]},defaultVisibleArea:{type:[Function,Object]},defaultTransforms:{type:[Function,Object]},defaultBoundaries:{type:[Function,String],validator:function(t){return!(typeof t=="string"&&t!=="fill"&&t!=="fit")}},priority:{type:String,default:"coordinates"},stencilSize:{type:[Object,Function]},resizeImage:{type:[Boolean,Object],default:!0},moveImage:{type:[Boolean,Object],default:!0},autoZoomAlgorithm:{type:Function},resizeAlgorithm:{type:Function,default:function(t){var e=t.event,i=t.coordinates,n=t.aspectRatio,s=t.positionRestrictions,o=t.sizeRestrictions,r=de(de({},i),{right:i.left+i.width,bottom:i.top+i.height}),l=e.params||{},a=de({},e.directions),c=l.allowedDirections||{left:!0,right:!0,bottom:!0,top:!0};o.widthFrozen&&(a.left=0,a.right=0),o.heightFrozen&&(a.top=0,a.bottom=0),jt.forEach((function(w){c[w]||(a[w]=0)}));var u=Bt(r,a=Gl({coordinates:r,directions:a,sizeRestrictions:o,positionRestrictions:s})).width,d=Bt(r,a).height,p=l.preserveRatio?Ce(r):Go(u/d,n);if(p){var v=l.respectDirection;if(v||(v=r.width>=r.height||p===1?"width":"height"),v==="width"){var m=u/p-r.height;if(c.top&&c.bottom){var g=a.top,y=a.bottom;a.bottom=hs(m,y,g),a.top=hs(m,g,y)}else c.bottom?a.bottom=m:c.top?a.top=m:c.right?a.right=0:c.left&&(a.left=0)}else if(v==="height"){var S=r.width-d*p;if(c.left&&c.right){var b=a.left,x=a.right;a.left=-hs(S,b,x),a.right=-hs(S,x,b)}else c.left?a.left=-S:c.right?a.right=-S:c.top?a.top=0:c.bottom&&(a.bottom=0)}a=Gl({directions:a,coordinates:r,sizeRestrictions:o,positionRestrictions:s,preserveRatio:!0,compensate:l.compensate})}return u=Bt(r,a).width,d=Bt(r,a).height,(p=l.preserveRatio?Ce(r):Go(u/d,n))&&Math.abs(p-u/d)>.001&&jt.forEach((function(w){c[w]||(a[w]=0)})),Cr({event:new oa({left:-a.left,top:-a.top}),coordinates:{width:i.width+a.right+a.left,height:i.height+a.top+a.bottom,left:i.left,top:i.top},positionRestrictions:s})}},moveAlgorithm:{type:Function,default:Cr},initStretcher:{type:Function,default:function(t){var e=t.stretcher,i=t.imageSize,n=Ce(i);e.style.width=i.width+"px",e.style.height=e.clientWidth/n+"px",e.style.width=e.clientWidth+"px"}},fitCoordinates:{type:Function,default:function(t){var e=t.visibleArea,i=t.coordinates,n=t.aspectRatio,s=t.sizeRestrictions,o=t.positionRestrictions,r=de(de({},i),ti({width:i.width,height:i.height,aspectRatio:n,sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minHeight:Math.min(e.height,s.minHeight),minWidth:Math.min(e.width,s.minWidth)}}));return r=Ye(r=rt(r,Xi(Ke(i),Ke(r))),Js(Vt(e),o))}},fitVisibleArea:{type:Function,default:function(t){var e=t.visibleArea,i=t.boundaries,n=t.getAreaRestrictions,s=t.coordinates,o=de({},e);o.height=o.width/Ce(i),o.top+=(e.height-o.height)/2,(s.height-o.height>0||s.width-o.width>0)&&(o=bt(o,Math.max(s.height/o.height,s.width/o.width)));var r=Xs(Ji(s,Vt(o=bt(o,Gs(o,n({visibleArea:o,type:"resize"}))))));return o.width<s.width&&(r.left=0),o.height<s.height&&(r.top=0),o=Ye(o=rt(o,r),n({visibleArea:o,type:"move"}))}},areaRestrictionsAlgorithm:{type:Function,default:function(t){var e=t.visibleArea,i=t.boundaries,n=t.imageSize,s=t.imageRestriction,o=t.type,r={};return s==="fill-area"?r={left:0,top:0,right:n.width,bottom:n.height}:s==="fit-area"&&(Ce(i)>Ce(n)?(r={top:0,bottom:n.height},e&&o==="move"&&(e.width>n.width?(r.left=-(e.width-n.width)/2,r.right=n.width-r.left):(r.left=0,r.right=n.width))):(r={left:0,right:n.width},e&&o==="move"&&(e.height>n.height?(r.top=-(e.height-n.height)/2,r.bottom=n.height-r.top):(r.top=0,r.bottom=n.height)))),r}},sizeRestrictionsAlgorithm:{type:Function,default:function(t){return{minWidth:t.minWidth,minHeight:t.minHeight,maxWidth:t.maxWidth,maxHeight:t.maxHeight}}},positionRestrictionsAlgorithm:{type:Function,default:function(t){var e=t.imageSize,i={};return t.imageRestriction!=="none"&&(i={left:0,top:0,right:e.width,bottom:e.height}),i}}},data:function(){return{transitionsActive:!1,imageLoaded:!1,imageAttributes:{width:null,height:null,crossOrigin:null,src:null},defaultImageTransforms:{rotate:0,flip:{horizontal:!1,vertical:!1}},appliedImageTransforms:{rotate:0,flip:{horizontal:!1,vertical:!1}},boundaries:{width:0,height:0},visibleArea:null,coordinates:ke({},Ql)}},computed:{image:function(){return{src:this.imageAttributes.src,width:this.imageAttributes.width,height:this.imageAttributes.height,transforms:this.imageTransforms}},imageTransforms:function(){return{rotate:this.appliedImageTransforms.rotate,flip:{horizontal:this.appliedImageTransforms.flip.horizontal,vertical:this.appliedImageTransforms.flip.vertical},translateX:this.visibleArea?this.visibleArea.left/this.coefficient:0,translateY:this.visibleArea?this.visibleArea.top/this.coefficient:0,scaleX:1/this.coefficient,scaleY:1/this.coefficient}},imageSize:function(){var t=(function(e){return e*Math.PI/180})(this.imageTransforms.rotate);return{width:Math.abs(this.imageAttributes.width*Math.cos(t))+Math.abs(this.imageAttributes.height*Math.sin(t)),height:Math.abs(this.imageAttributes.width*Math.sin(t))+Math.abs(this.imageAttributes.height*Math.cos(t))}},initialized:function(){return!!(this.visibleArea&&this.imageLoaded)},settings:function(){var t=Sr(this.resizeImage,{touch:!0,wheel:{ratio:.1},adjustStencil:!0},{touch:!1,wheel:!1,adjustStencil:!1});return{moveImage:Sr(this.moveImage,{touch:!0,mouse:!0},{touch:!1,mouse:!1}),resizeImage:t}},coefficient:function(){return this.visibleArea?this.visibleArea.width/this.boundaries.width:0},areaRestrictions:function(){return this.imageLoaded?this.areaRestrictionsAlgorithm({imageSize:this.imageSize,imageRestriction:this.imageRestriction,boundaries:this.boundaries}):{}},transitionsOptions:function(){return{enabled:this.transitionsActive,timingFunction:"ease-in-out",time:350}},sizeRestrictions:function(){if(this.boundaries.width&&this.boundaries.height&&this.imageSize.width&&this.imageSize.height){var t=this.sizeRestrictionsAlgorithm({imageSize:this.imageSize,minWidth:qe(this.minWidth)?0:us(this.minWidth),minHeight:qe(this.minHeight)?0:us(this.minHeight),maxWidth:qe(this.maxWidth)?1/0:us(this.maxWidth),maxHeight:qe(this.maxHeight)?1/0:us(this.maxHeight)});if(t=(function(n){var s=n.areaRestrictions,o=n.sizeRestrictions,r=n.boundaries,l=n.positionRestrictions,a=de(de({},o),{minWidth:o.minWidth!==void 0?o.minWidth:0,minHeight:o.minHeight!==void 0?o.minHeight:0,maxWidth:o.maxWidth!==void 0?o.maxWidth:1/0,maxHeight:o.maxHeight!==void 0?o.maxHeight:1/0});l.left!==void 0&&l.right!==void 0&&(a.maxWidth=Math.min(a.maxWidth,l.right-l.left)),l.bottom!==void 0&&l.top!==void 0&&(a.maxHeight=Math.min(a.maxHeight,l.bottom-l.top));var c=kr(s),u=Eu(r,c);return c.width<1/0&&(!a.maxWidth||a.maxWidth>u.width)&&(a.maxWidth=Math.min(a.maxWidth,u.width)),c.height<1/0&&(!a.maxHeight||a.maxHeight>u.height)&&(a.maxHeight=Math.min(a.maxHeight,u.height)),a.minWidth>a.maxWidth&&(a.minWidth=a.maxWidth,a.widthFrozen=!0),a.minHeight>a.maxHeight&&(a.minHeight=a.maxHeight,a.heightFrozen=!0),a})({sizeRestrictions:t,areaRestrictions:this.getAreaRestrictions({visibleArea:this.visibleArea,type:"resize"}),imageSize:this.imageSize,boundaries:this.boundaries,positionRestrictions:this.positionRestrictions,imageRestriction:this.imageRestriction,visibleArea:this.visibleArea,stencilSize:this.getStencilSize()}),this.visibleArea&&this.stencilSize){var e=this.getStencilSize(),i=kr(this.getAreaRestrictions({visibleArea:this.visibleArea,type:"resize"}));t.maxWidth=Math.min(t.maxWidth,i.width*e.width/this.boundaries.width),t.maxHeight=Math.min(t.maxHeight,i.height*e.height/this.boundaries.height),t.maxWidth<t.minWidth&&(t.minWidth=t.maxWidth),t.maxHeight<t.minHeight&&(t.minHeight=t.maxHeight)}return t}return{minWidth:0,minHeight:0,maxWidth:0,maxHeight:0}},positionRestrictions:function(){return this.positionRestrictionsAlgorithm({imageSize:this.imageSize,imageRestriction:this.imageRestriction})},classes:function(){return{cropper:Yt(),image:je(Yt("image"),this.imageClass),stencil:Yt("stencil"),boundaries:je(Yt("boundaries"),this.boundariesClass),stretcher:je(Yt("stretcher")),background:je(Yt("background"),this.backgroundClass),foreground:je(Yt("foreground"),this.foregroundClass),imageWrapper:je(Yt("image-wrapper")),cropperWrapper:je(Yt("cropper-wrapper"))}},stencilCoordinates:function(){if(this.initialized){var t=this.coordinates,e=t.width,i=t.height,n=t.left,s=t.top;return{width:e/this.coefficient,height:i/this.coefficient,left:(n-this.visibleArea.left)/this.coefficient,top:(s-this.visibleArea.top)/this.coefficient}}return this.defaultCoordinates()},boundariesStyle:function(){var t={width:this.boundaries.width?"".concat(Math.round(this.boundaries.width),"px"):"auto",height:this.boundaries.height?"".concat(Math.round(this.boundaries.height),"px"):"auto",transition:"opacity ".concat(this.transitionTime,"ms"),pointerEvents:this.imageLoaded?"all":"none"};return this.imageLoaded||(t.opacity="0"),t},imageStyle:function(){var t=this.imageAttributes.width>this.imageAttributes.height?{width:Math.min(1024,this.imageAttributes.width),height:Math.min(1024,this.imageAttributes.width)/(this.imageAttributes.width/this.imageAttributes.height)}:{height:Math.min(1024,this.imageAttributes.height),width:Math.min(1024,this.imageAttributes.height)*(this.imageAttributes.width/this.imageAttributes.height)},e={left:(t.width-this.imageSize.width)/(2*this.coefficient),top:(t.height-this.imageSize.height)/(2*this.coefficient)},i={left:(1-1/this.coefficient)*t.width/2,top:(1-1/this.coefficient)*t.height/2},n=ke(ke({},this.imageTransforms),{},{scaleX:this.imageTransforms.scaleX*(this.imageAttributes.width/t.width),scaleY:this.imageTransforms.scaleY*(this.imageAttributes.height/t.height)}),s={width:"".concat(t.width,"px"),height:"".concat(t.height,"px"),left:"0px",top:"0px",transform:"translate(".concat(-e.left-i.left-this.imageTransforms.translateX,"px, ").concat(-e.top-i.top-this.imageTransforms.translateY,"px)")+Fu(n)};return this.transitionsOptions.enabled&&(s.transition="".concat(this.transitionsOptions.time,"ms ").concat(this.transitionsOptions.timingFunction)),s}},watch:{src:function(){this.onChangeImage()},stencilComponent:function(){var t=this;this.$nextTick((function(){t.resetCoordinates(),t.runAutoZoom("setCoordinates"),t.onChange()}))},minWidth:function(){this.onPropsChange()},maxWidth:function(){this.onPropsChange()},minHeight:function(){this.onPropsChange()},maxHeight:function(){this.onPropsChange()},imageRestriction:function(){this.reset()},stencilProps:function(t,e){["aspectRatio","minAspectRatio","maxAspectRatio"].find((function(i){return t[i]!==e[i]}))&&this.$nextTick(this.onPropsChange)}},created:function(){this.debouncedUpdate=xr(this.update,this.debounce),this.debouncedDisableTransitions=xr(this.disableTransitions,this.transitionsOptions.time),this.awaiting=!1},mounted:function(){this.$refs.image.addEventListener("load",this.onSuccessLoadImage),this.$refs.image.addEventListener("error",this.onFailLoadImage),this.onChangeImage(),window.addEventListener("resize",this.refresh),window.addEventListener("orientationchange",this.refresh)},unmounted:function(){window.removeEventListener("resize",this.refresh),window.removeEventListener("orientationchange",this.refresh),this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src),this.debouncedUpdate.clear(),this.debouncedDisableTransitions.clear()},methods:{getResult:function(){var t=this.initialized?this.prepareResult(ke({},this.coordinates)):this.defaultCoordinates(),e={rotate:this.imageTransforms.rotate%360,flip:ke({},this.imageTransforms.flip)};if(this.src&&this.imageLoaded){var i=this;return{image:this.image,coordinates:t,visibleArea:this.visibleArea?ke({},this.visibleArea):null,imageTransforms:e,get canvas(){return i.canvas?i.getCanvas():void 0}}}return{image:this.image,coordinates:t,visibleArea:this.visibleArea?ke({},this.visibleArea):null,canvas:void 0,imageTransforms:e}},zoom:function(t,e){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=i.transitions,s=n===void 0||n;this.onManipulateImage(new gn({},{factor:1/t,center:e}),{normalize:!1,transitions:s})},move:function(t,e){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=i.transitions,s=n===void 0||n;this.onManipulateImage(new gn({left:t||0,top:e||0}),{normalize:!1,transitions:s})},setCoordinates:function(t){var e=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=i.autoZoom,s=n===void 0||n,o=i.transitions,r=o===void 0||o;this.$nextTick((function(){e.imageLoaded?(e.transitionsActive||(r&&e.enableTransitions(),e.coordinates=e.applyTransform(t),s&&e.runAutoZoom("setCoordinates"),r&&e.debouncedDisableTransitions()),e.onChange()):e.delayedTransforms=t}))},refresh:function(){var t=this,e=this.$refs.image;if(this.src&&e)return this.initialized?this.updateVisibleArea().then((function(){t.onChange()})):this.resetVisibleArea().then((function(){t.onChange()}))},reset:function(){var t=this;return this.resetVisibleArea().then((function(){t.onChange(!1)}))},awaitRender:function(t){var e=this;this.awaiting||(this.awaiting=!0,this.$nextTick((function(){t(),e.awaiting=!1})))},prepareResult:function(t){return this.roundResult?(function(e){var i=e.coordinates,n=e.sizeRestrictions,s=e.positionRestrictions,o={width:Math.round(i.width),height:Math.round(i.height),left:Math.round(i.left),top:Math.round(i.top)};return o.width>n.maxWidth?o.width=Math.floor(i.width):o.width<n.minWidth&&(o.width=Math.ceil(i.width)),o.height>n.maxHeight?o.height=Math.floor(i.height):o.height<n.minHeight&&(o.height=Math.ceil(i.height)),Ye(o,s)})(ke(ke({},this.getPublicProperties()),{},{positionRestrictions:ds(this.positionRestrictions,this.visibleArea),coordinates:t})):t},processAutoZoom:function(t,e,i,n){var s=this.autoZoomAlgorithm;s||(s=this.stencilSize?gv:this.autoZoom?_v:yv);var o=s({event:{type:t,params:n},visibleArea:e,coordinates:i,boundaries:this.boundaries,aspectRatio:this.getAspectRatio(),positionRestrictions:this.positionRestrictions,getAreaRestrictions:this.getAreaRestrictions,sizeRestrictions:this.sizeRestrictions,stencilSize:this.getStencilSize()});return ke(ke({},o),{},{changed:!Kl(o.visibleArea,e)||!Kl(o.coordinates,i)})},runAutoZoom:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=e.transitions,n=i!==void 0&&i,s=rv(e,Dv),o=this.processAutoZoom(t,this.visibleArea,this.coordinates,s),r=o.visibleArea,l=o.coordinates,a=o.changed;n&&a&&this.enableTransitions(),this.visibleArea=r,this.coordinates=l,n&&a&&this.debouncedDisableTransitions()},normalizeEvent:function(t){return(function(e){var i=e.event,n=e.visibleArea,s=e.coefficient;if(i.type==="manipulateImage")return de(de({},i),{move:{left:i.move&&i.move.left?s*i.move.left:0,top:i.move&&i.move.top?s*i.move.top:0},scale:{factor:i.scale&&i.scale.factor?i.scale.factor:1,center:i.scale&&i.scale.center?{left:i.scale.center.left*s+n.left,top:i.scale.center.top*s+n.top}:null}});if(i.type==="resize"){var o=de(de({},i),{directions:de({},i.directions)});return jt.forEach((function(l){o.directions[l]*=s})),o}if(i.type==="move"){var r=de(de({},i),{directions:de({},i.directions)});return fv.forEach((function(l){r.directions[l]*=s})),r}return i})(ke(ke({},this.getPublicProperties()),{},{event:t}))},getCanvas:function(){if(this.$refs.canvas){var t=this.$refs.canvas,e=this.$refs.image,i=this.imageTransforms.rotate!==0||this.imageTransforms.flip.horizontal||this.imageTransforms.flip.vertical?(function(l,a,c){var u=c.rotate,d=c.flip,p={width:a.naturalWidth,height:a.naturalHeight},v=Au(p,u),m=l.getContext("2d");l.height=v.height,l.width=v.width,m.save();var g=ui(Ke(de({left:0,top:0},p)),u);return m.translate(-(g.left-v.width/2),-(g.top-v.height/2)),m.rotate(u*Math.PI/180),m.translate(d.horizontal?p.width:0,d.vertical?p.height:0),m.scale(d.horizontal?-1:1,d.vertical?-1:1),m.drawImage(a,0,0,p.width,p.height),m.restore(),l})(this.$refs.sourceCanvas,e,this.imageTransforms):e,n=ke({minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,maxArea:this.maxCanvasSize,imageSmoothingEnabled:!0,imageSmoothingQuality:"high",fillColor:"transparent"},this.canvas),s=function(l){return l.find((function(a){return c=a,!Number.isNaN(parseFloat(c))&&isFinite(c);var c}))},o=ti({sizeRestrictions:{minWidth:s([n.width,n.minWidth])||0,minHeight:s([n.height,n.minHeight])||0,maxWidth:s([n.width,n.maxWidth])||1/0,maxHeight:s([n.height,n.maxHeight])||1/0},width:this.coordinates.width,height:this.coordinates.height,aspectRatio:{minimum:this.coordinates.width/this.coordinates.height,maximum:this.coordinates.width/this.coordinates.height}});if(n.maxArea&&o.width*o.height>n.maxArea){var r=Math.sqrt(n.maxArea/(o.width*o.height));o={width:Math.round(r*o.width),height:Math.round(r*o.height)}}return(function(l,a,c,u,d){l.width=u?u.width:c.width,l.height=u?u.height:c.height;var p=l.getContext("2d");p.clearRect(0,0,l.width,l.height),d&&(d.imageSmoothingEnabled&&(p.imageSmoothingEnabled=d.imageSmoothingEnabled),d.imageSmoothingQuality&&(p.imageSmoothingQuality=d.imageSmoothingQuality),d.fillColor&&(p.fillStyle=d.fillColor,p.fillRect(0,0,l.width,l.height),p.save()));var v=c.left<0?-c.left:0,m=c.top<0?-c.top:0;p.drawImage(a,c.left+v,c.top+m,c.width,c.height,v*(l.width/c.width),m*(l.height/c.height),l.width,l.height)})(t,i,this.coordinates,o,n),t}},update:function(){this.$emit("change",this.getResult())},applyTransform:function(t){var e=arguments.length>1&&arguments[1]!==void 0&&arguments[1],i=this.visibleArea&&e?mv(this.sizeRestrictions,this.visibleArea):this.sizeRestrictions,n=this.visibleArea&&e?ds(this.positionRestrictions,this.visibleArea):this.positionRestrictions;return vv({transform:t,coordinates:this.coordinates,imageSize:this.imageSize,sizeRestrictions:i,positionRestrictions:n,aspectRatio:this.getAspectRatio(),visibleArea:this.visibleArea})},resetCoordinates:function(){var t=this;if(this.$refs.image){this.$refs.cropper,this.$refs.image;var e=this.defaultSize;e||(e=this.stencilSize?xv:bv);var i=this.sizeRestrictions;i.minWidth,i.minHeight,i.maxWidth,i.maxHeight;var n=Ii(e)?e({boundaries:this.boundaries,imageSize:this.imageSize,aspectRatio:this.getAspectRatio(),sizeRestrictions:this.sizeRestrictions,stencilSize:this.getStencilSize(),visibleArea:this.visibleArea}):e,s=this.defaultPosition||wv,o=[n,function(r){var l=r.coordinates;return ke({},Ii(s)?s({coordinates:l,imageSize:t.imageSize,visibleArea:t.visibleArea}):t.defaultPosition)}];this.delayedTransforms&&o.push.apply(o,Oi(Array.isArray(this.delayedTransforms)?this.delayedTransforms:[this.delayedTransforms])),this.coordinates=this.applyTransform(o,!0),this.delayedTransforms=null}},clearImage:function(){var t=this;this.imageLoaded=!1,setTimeout((function(){var e=t.$refs.stretcher;e&&(e.style.height="auto",e.style.width="auto"),t.coordinates=t.defaultCoordinates(),t.boundaries={width:0,height:0}}),this.transitionTime)},enableTransitions:function(){this.transitions&&(this.transitionsActive=!0)},disableTransitions:function(){this.transitionsActive=!1},updateBoundaries:function(){var t=this,e=this.$refs.stretcher,i=this.$refs.cropper;return this.initStretcher({cropper:i,stretcher:e,imageSize:this.imageSize}),this.$nextTick().then((function(){var n={cropper:i,imageSize:t.imageSize};if(Ii(t.defaultBoundaries)?t.boundaries=t.defaultBoundaries(n):t.defaultBoundaries==="fit"?t.boundaries=(function(s){var o=s.cropper,r=s.imageSize,l=o.clientHeight,a=o.clientWidth,c=l,u=r.width*l/r.height;return u>a&&(u=a,c=r.height*a/r.width),{width:u,height:c}})(n):t.boundaries=(function(s){var o=s.cropper;return{width:o.clientWidth,height:o.clientHeight}})(n),!t.boundaries.width||!t.boundaries.height)throw new Error("It's impossible to fit the cropper in the current container")}))},resetVisibleArea:function(){var t=this;return this.appliedImageTransforms=ke(ke({},this.defaultImageTransforms),{},{flip:ke({},this.defaultImageTransforms.flip)}),this.updateBoundaries().then((function(){t.priority!=="visible-area"&&(t.visibleArea=null,t.resetCoordinates());var e,i,n,s,o,r,l=t.defaultVisibleArea||Sv;t.visibleArea=Ii(l)?l({imageSize:t.imageSize,boundaries:t.boundaries,coordinates:t.priority!=="visible-area"?t.coordinates:null,getAreaRestrictions:t.getAreaRestrictions,stencilSize:t.getStencilSize()}):t.defaultVisibleArea,t.visibleArea=(e={visibleArea:t.visibleArea,boundaries:t.boundaries,getAreaRestrictions:t.getAreaRestrictions},i=e.visibleArea,n=e.boundaries,s=e.getAreaRestrictions,o=de({},i),r=Ce(n),o.width/o.height!==r&&(o.height=o.width/r),Ye(o,s({visibleArea:o,type:"move"}))),t.priority==="visible-area"?t.resetCoordinates():t.coordinates=t.fitCoordinates({visibleArea:t.visibleArea,coordinates:t.coordinates,aspectRatio:t.getAspectRatio(),positionRestrictions:t.positionRestrictions,sizeRestrictions:t.sizeRestrictions}),t.runAutoZoom("resetVisibleArea")})).catch((function(){t.visibleArea=null}))},updateVisibleArea:function(){var t=this;return this.updateBoundaries().then((function(){t.visibleArea=t.fitVisibleArea({imageSize:t.imageSize,boundaries:t.boundaries,visibleArea:t.visibleArea,coordinates:t.coordinates,getAreaRestrictions:t.getAreaRestrictions}),t.coordinates=t.fitCoordinates({visibleArea:t.visibleArea,coordinates:t.coordinates,aspectRatio:t.getAspectRatio(),positionRestrictions:t.positionRestrictions,sizeRestrictions:t.sizeRestrictions}),t.runAutoZoom("updateVisibleArea")})).catch((function(){t.visibleArea=null}))},onChange:function(){var t=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];t&&this.debounce?this.debouncedUpdate():this.update()},onChangeImage:function(){var t,e=this;if(this.imageLoaded=!1,this.delayedTransforms=null,this.src){if((function(s){if(ql(s))return!1;var o=window.location,r=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(s)||[],l={protocol:r[1]||"",host:r[2]||"",port:r[3]||""},a=function(c){return c.port||((c.protocol||o.protocol)==="http"?80:433)};return!(!l.protocol&&!l.host&&!l.port||l.protocol&&l.protocol==o.protocol&&l.host&&l.host==o.host&&l.host&&a(l)==a(o))})(this.src)){var i=qe(this.crossOrigin)?this.canvas:this.crossOrigin;i===!0&&(i="anonymous"),this.imageAttributes.crossOrigin=i||null}if(this.checkOrientation){var n=(t=this.src,new Promise((function(s){Pv(t).then((function(o){var r=zv(o);s(o?{source:t,arrayBuffer:o,orientation:r}:{source:t,arrayBuffer:null,orientation:null})})).catch((function(o){console.warn(o),s({source:t,arrayBuffer:null,orientation:null})}))})));setTimeout((function(){n.then(e.onParseImage)}),this.transitionTime)}else setTimeout((function(){e.onParseImage({source:e.src})}),this.transitionTime)}else this.clearImage()},onFailLoadImage:function(){this.imageAttributes.src&&(this.clearImage(),this.$emit("error"))},onSuccessLoadImage:function(){var t=this,e=this.$refs.image;e&&!this.imageLoaded&&(this.imageAttributes.height=e.naturalHeight,this.imageAttributes.width=e.naturalWidth,this.imageLoaded=!0,this.resetVisibleArea().then((function(){t.$emit("ready"),t.onChange(!1)})))},onParseImage:function(t){var e=this,i=t.source,n=t.arrayBuffer,s=t.orientation;this.imageAttributes.revoke&&this.imageAttributes.src&&URL.revokeObjectURL(this.imageAttributes.src),this.imageAttributes.revoke=!1,n&&s&&s>1?bu(i)||!ql(i)?(this.imageAttributes.src=URL.createObjectURL(new Blob([n])),this.imageAttributes.revoke=!0):this.imageAttributes.src=(function(o){for(var r=[],l=new Uint8Array(o);l.length>0;){var a=l.subarray(0,8192);r.push(String.fromCharCode.apply(null,Array.from?Array.from(a):a.slice())),l=l.subarray(8192)}return"data:image/jpeg;base64,"+btoa(r.join(""))})(n):this.imageAttributes.src=i,Ii(this.defaultTransforms)?this.appliedImageTransforms=Zo(this.defaultTransforms()):ys(this.defaultTransforms)?this.appliedImageTransforms=Zo(this.defaultTransforms):this.appliedImageTransforms=(function(o){var r=Zo({});if(o)switch(o){case 2:r.flip.horizontal=!0;break;case 3:r.rotate=-180;break;case 4:r.flip.vertical=!0;break;case 5:r.rotate=90,r.flip.vertical=!0;break;case 6:r.rotate=90;break;case 7:r.rotate=90,r.flip.horizontal=!0;break;case 8:r.rotate=-90}return r})(s),this.defaultImageTransforms=ke(ke({},this.appliedImageTransforms),{},{flip:ke({},this.appliedImageTransforms.flip)}),this.$nextTick((function(){var o=e.$refs.image;o&&o.complete&&((function(r){return!!r.naturalWidth})(o)?e.onSuccessLoadImage():e.onFailLoadImage())}))},onResizeEnd:function(){this.runAutoZoom("resize",{transitions:!0})},onMoveEnd:function(){this.runAutoZoom("move",{transitions:!0})},onMove:function(t){var e=this;this.transitionsOptions.enabled||this.awaitRender((function(){e.coordinates=e.moveAlgorithm(ke(ke({},e.getPublicProperties()),{},{positionRestrictions:ds(e.positionRestrictions,e.visibleArea),coordinates:e.coordinates,event:e.normalizeEvent(t)})),e.onChange()}))},onResize:function(t){var e=this;this.transitionsOptions.enabled||this.stencilSize&&!this.autoZoom||this.awaitRender((function(){var i=e.sizeRestrictions,n=Math.min(e.coordinates.width,e.coordinates.height,20*e.coefficient);e.coordinates=e.resizeAlgorithm(ke(ke({},e.getPublicProperties()),{},{positionRestrictions:ds(e.positionRestrictions,e.visibleArea),sizeRestrictions:{maxWidth:Math.min(i.maxWidth,e.visibleArea.width),maxHeight:Math.min(i.maxHeight,e.visibleArea.height),minWidth:Math.max(i.minWidth,n),minHeight:Math.max(i.minHeight,n)},event:e.normalizeEvent(t)})),e.onChange(),e.ticking=!1}))},onManipulateImage:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.transitionsOptions.enabled){var i=e.transitions,n=i!==void 0&&i,s=e.normalize,o=s===void 0||s;n&&this.enableTransitions();var r=kv(ke(ke({},this.getPublicProperties()),{},{event:o?this.normalizeEvent(t):t,getAreaRestrictions:this.getAreaRestrictions,imageRestriction:this.imageRestriction,adjustStencil:!this.stencilSize&&this.settings.resizeImage.adjustStencil})),l=r.visibleArea,a=r.coordinates;this.visibleArea=l,this.coordinates=a,this.runAutoZoom("manipulateImage"),this.onChange(),n&&this.debouncedDisableTransitions()}},onPropsChange:function(){this.coordinates=this.applyTransform(this.coordinates,!0),this.onChange(!1)},getAreaRestrictions:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.visibleArea,i=t.type,n=i===void 0?"move":i;return this.areaRestrictionsAlgorithm({boundaries:this.boundaries,imageSize:this.imageSize,imageRestriction:this.imageRestriction,visibleArea:e,type:n})},getAspectRatio:function(t){var e,i,n=this.stencilProps,s=n.aspectRatio,o=n.minAspectRatio,r=n.maxAspectRatio;if(this.$refs.stencil&&this.$refs.stencil.aspectRatios){var l=this.$refs.stencil.aspectRatios();e=l.minimum,i=l.maximum}if(qe(e)&&(e=qe(s)?o:s),qe(i)&&(i=qe(s)?r:s),!t&&(qe(e)||qe(i))){var a=this.getStencilSize(),c=a?Ce(a):null;qe(e)&&(e=Wl(c)?c:void 0),qe(i)&&(i=Wl(c)?c:void 0)}return{minimum:e,maximum:i}},getStencilSize:function(){if(this.stencilSize)return t={currentStencilSize:{width:this.stencilCoordinates.width,height:this.stencilCoordinates.height},stencilSize:this.stencilSize,boundaries:this.boundaries,coefficient:this.coefficient,coordinates:this.coordinates,aspectRatio:this.getAspectRatio(!0)},e=t.boundaries,i=t.stencilSize,n=t.aspectRatio,Go(Ce(s=Ii(i)?i({boundaries:e,aspectRatio:n}):i),n)&&(s=ti({sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minWidth:0,minHeight:0},width:s.width,height:s.height,aspectRatio:{minimum:n.minimum,maximum:n.maximum}})),(s.width>e.width||s.height>e.height)&&(s=ti({sizeRestrictions:{maxWidth:e.width,maxHeight:e.height,minWidth:0,minHeight:0},width:s.width,height:s.height,aspectRatio:{minimum:Ce(s),maximum:Ce(s)}})),s;var t,e,i,n,s},getPublicProperties:function(){return{coefficient:this.coefficient,visibleArea:this.visibleArea,coordinates:this.coordinates,boundaries:this.boundaries,sizeRestrictions:this.sizeRestrictions,positionRestrictions:this.positionRestrictions,aspectRatio:this.getAspectRatio(),imageRestriction:this.imageRestriction}},defaultCoordinates:function(){return ke({},Ql)},flip:function(t,e){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=i.transitions,s=n===void 0||n;if(!this.transitionsActive){s&&this.enableTransitions();var o=ke({},this.imageTransforms.flip),r=Ev({flip:{horizontal:t?!o.horizontal:o.horizontal,vertical:e?!o.vertical:o.vertical},previousFlip:o,rotate:this.imageTransforms.rotate,visibleArea:this.visibleArea,coordinates:this.coordinates,imageSize:this.imageSize,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}),l=r.visibleArea,a=r.coordinates;t&&(this.appliedImageTransforms.flip.horizontal=!this.appliedImageTransforms.flip.horizontal),e&&(this.appliedImageTransforms.flip.vertical=!this.appliedImageTransforms.flip.vertical),this.visibleArea=l,this.coordinates=a,this.onChange(),s&&this.debouncedDisableTransitions()}},rotate:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=e.transitions,n=i===void 0||i;if(!this.transitionsActive){n&&this.enableTransitions();var s=ke({},this.imageSize);this.appliedImageTransforms.rotate+=t;var o=Cv({visibleArea:this.visibleArea,coordinates:this.coordinates,previousImageSize:s,imageSize:this.imageSize,angle:t,positionRestrictions:this.positionRestrictions,sizeRestrictions:this.sizeRestrictions,getAreaRestrictions:this.getAreaRestrictions,aspectRatio:this.getAspectRatio()}),r=o.visibleArea,l=o.coordinates,a=this.processAutoZoom("rotateImage",r,l);r=a.visibleArea,l=a.coordinates,this.visibleArea=r,this.coordinates=l,this.onChange(),n&&this.debouncedDisableTransitions()}}},emits:["change","error","ready"]},Iv={key:0,ref:"canvas",style:{display:"none"}},Lv={key:1,ref:"sourceCanvas",style:{display:"none"}};Du.render=function(t,e,i,n,s,o){return _(),X("div",{ref:"cropper",class:o.classes.cropper},[ee("div",{ref:"stretcher",class:o.classes.stretcher},null,2),ee("div",{class:o.classes.boundaries,style:o.boundariesStyle},[(_(),X(Rt(i.backgroundWrapperComponent),{class:o.classes.cropperWrapper,"wheel-resize":o.settings.resizeImage.wheel,"touch-resize":o.settings.resizeImage.touch,"touch-move":o.settings.moveImage.touch,"mouse-move":o.settings.moveImage.mouse,onMove:o.onManipulateImage,onResize:o.onManipulateImage},{default:he((function(){return[ee("div",{class:o.classes.background,style:o.boundariesStyle},null,6),ee("div",{class:o.classes.imageWrapper},[ee("img",{ref:"image",crossorigin:s.imageAttributes.crossOrigin,src:s.imageAttributes.src,class:o.classes.image,style:o.imageStyle,onMousedown:e[1]||(e[1]=Se((function(){}),["prevent"]))},null,46,["crossorigin","src"])],2),ee("div",{class:o.classes.foreground,style:o.boundariesStyle},null,6),ze((_(),X(Rt(i.stencilComponent),We({ref:"stencil",image:o.image,coordinates:s.coordinates,"stencil-coordinates":o.stencilCoordinates,transitions:o.transitionsOptions},i.stencilProps,{onResize:o.onResize,onResizeEnd:o.onResizeEnd,onMove:o.onMove,onMoveEnd:o.onMoveEnd}),null,16,["image","coordinates","stencil-coordinates","transitions","onResize","onResizeEnd","onMove","onMoveEnd"])),[[$t,s.imageLoaded]]),i.canvas?(_(),X("canvas",Iv,null,512)):K("",!0),i.canvas?(_(),X("canvas",Lv,null,512)):K("",!0)]})),_:1},8,["class","wheel-resize","touch-resize","touch-move","mouse-move","onMove","onResize"]))],6)],2)};const wi=typeof window<"u",Iu=wi&&!("onscroll"in window)||typeof navigator<"u"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),Lu=wi&&window.devicePixelRatio>1,Bv={elements_selector:".lazy",container:Iu||wi?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},Bu=t=>Object.assign({},Bv,t),Zl=function(t,e){let i;const n="LazyLoad::Initialized",s=new t(e);try{i=new CustomEvent(n,{detail:{instance:s}})}catch{i=document.createEvent("CustomEvent"),i.initCustomEvent(n,!1,!1,{instance:s})}window.dispatchEvent(i)},Uv=(t,e)=>{if(e)if(e.length)for(let i,n=0;i=e[n];n+=1)Zl(t,i);else Zl(t,e)},ii="src",ca="srcset",ua="sizes",Uu="poster",Dn="llOriginalAttrs",ju="data",da="loading",Hu="loaded",Nu="applied",jv="entered",ha="error",Vu="native",qu="data-",Wu="ll-status",at=(t,e)=>t.getAttribute(qu+e),Hv=(t,e,i)=>{const n=qu+e;i!==null?t.setAttribute(n,i):t.removeAttribute(n)},In=t=>at(t,Wu),zi=(t,e)=>Hv(t,Wu,e),Zs=t=>zi(t,null),fa=t=>In(t)===null,Nv=t=>In(t)===da,Vv=t=>In(t)===ha,pa=t=>In(t)===Vu,qv=[da,Hu,Nu,ha],Wv=t=>qv.indexOf(In(t))>=0,bi=(t,e,i,n)=>{t&&typeof t=="function"&&(n===void 0?i===void 0?t(e):t(e,i):t(e,i,n))},rn=(t,e)=>{wi&&e!==""&&t.classList.add(e)},Ut=(t,e)=>{wi&&e!==""&&t.classList.remove(e)},Qv=t=>{t.llTempImage=document.createElement("IMG")},Kv=t=>{delete t.llTempImage},Qu=t=>t.llTempImage,eo=(t,e)=>{if(!e)return;const i=e._observer;i&&i.unobserve(t)},Yv=t=>{t.disconnect()},Xv=(t,e,i)=>{e.unobserve_entered&&eo(t,i)},ma=(t,e)=>{t&&(t.loadingCount+=e)},Gv=t=>{t&&(t.toLoadCount-=1)},Ku=(t,e)=>{t&&(t.toLoadCount=e)},Jv=t=>t.loadingCount>0,Zv=t=>t.toLoadCount>0,Yu=t=>{let e=[];for(let i,n=0;i=t.children[n];n+=1)i.tagName==="SOURCE"&&e.push(i);return e},va=(t,e)=>{const i=t.parentNode;i&&i.tagName==="PICTURE"&&Yu(i).forEach(e)},Xu=(t,e)=>{Yu(t).forEach(e)},to=[ii],Gu=[ii,Uu],Cn=[ii,ca,ua],Ju=[ju],io=t=>!!t[Dn],Zu=t=>t[Dn],ed=t=>delete t[Dn],Zi=(t,e)=>{if(io(t))return;const i={};e.forEach((n=>{i[n]=t.getAttribute(n)})),t[Dn]=i},eg=t=>{io(t)||(t[Dn]={backgroundImage:t.style.backgroundImage})},Pi=(t,e)=>{if(!io(t))return;const i=Zu(t);e.forEach((n=>{((s,o,r)=>{r?s.setAttribute(o,r):s.removeAttribute(o)})(t,n,i[n])}))},tg=t=>{if(!io(t))return;const e=Zu(t);t.style.backgroundImage=e.backgroundImage},td=(t,e,i)=>{rn(t,e.class_applied),zi(t,Nu),i&&(e.unobserve_completed&&eo(t,e),bi(e.callback_applied,t,i))},id=(t,e,i)=>{rn(t,e.class_loading),zi(t,da),i&&(ma(i,1),bi(e.callback_loading,t,i))},mi=(t,e,i)=>{i&&t.setAttribute(e,i)},ec=(t,e)=>{mi(t,ua,at(t,e.data_sizes)),mi(t,ca,at(t,e.data_srcset)),mi(t,ii,at(t,e.data_src))},ig=(t,e)=>{va(t,(i=>{Zi(i,Cn),ec(i,e)})),Zi(t,Cn),ec(t,e)},ng=(t,e)=>{Zi(t,to),mi(t,ii,at(t,e.data_src))},sg=(t,e)=>{Xu(t,(i=>{Zi(i,to),mi(i,ii,at(i,e.data_src))})),Zi(t,Gu),mi(t,Uu,at(t,e.data_poster)),mi(t,ii,at(t,e.data_src)),t.load()},og=(t,e)=>{Zi(t,Ju),mi(t,ju,at(t,e.data_src))},rg=(t,e,i)=>{const n=at(t,e.data_bg),s=at(t,e.data_bg_hidpi),o=Lu&&s?s:n;o&&(t.style.backgroundImage=`url("${o}")`,Qu(t).setAttribute(ii,o),id(t,e,i))},ag=(t,e,i)=>{const n=at(t,e.data_bg_multi),s=at(t,e.data_bg_multi_hidpi),o=Lu&&s?s:n;o&&(t.style.backgroundImage=o,td(t,e,i))},lg=(t,e,i)=>{const n=at(t,e.data_bg_set);if(!n)return;let s=n.split("|").map((o=>`image-set(${o})`));t.style.backgroundImage=s.join(),td(t,e,i)},nd={IMG:ig,IFRAME:ng,VIDEO:sg,OBJECT:og},cg=(t,e)=>{const i=nd[t.tagName];i&&i(t,e)},ug=(t,e,i)=>{const n=nd[t.tagName];n&&(n(t,e),id(t,e,i))},dg=["IMG","IFRAME","VIDEO","OBJECT"],hg=t=>dg.indexOf(t.tagName)>-1,sd=(t,e)=>{!e||Jv(e)||Zv(e)||bi(t.callback_finish,e)},tc=(t,e,i)=>{t.addEventListener(e,i),t.llEvLisnrs[e]=i},fg=(t,e,i)=>{t.removeEventListener(e,i)},ga=t=>!!t.llEvLisnrs,pg=(t,e,i)=>{ga(t)||(t.llEvLisnrs={});const n=t.tagName==="VIDEO"?"loadeddata":"load";tc(t,n,e),tc(t,"error",i)},Ar=t=>{if(!ga(t))return;const e=t.llEvLisnrs;for(let i in e){const n=e[i];fg(t,i,n)}delete t.llEvLisnrs},od=(t,e,i)=>{Kv(t),ma(i,-1),Gv(i),Ut(t,e.class_loading),e.unobserve_completed&&eo(t,i)},mg=(t,e,i,n)=>{const s=pa(e);od(e,i,n),rn(e,i.class_loaded),zi(e,Hu),bi(i.callback_loaded,e,n),s||sd(i,n)},vg=(t,e,i,n)=>{const s=pa(e);od(e,i,n),rn(e,i.class_error),zi(e,ha),bi(i.callback_error,e,n),i.restore_on_error&&Pi(e,Cn),s||sd(i,n)},Tr=(t,e,i)=>{const n=Qu(t)||t;ga(n)||pg(n,(s=>{mg(0,t,e,i),Ar(n)}),(s=>{vg(0,t,e,i),Ar(n)}))},Mr=(t,e,i)=>{hg(t)?((n,s,o)=>{Tr(n,s,o),ug(n,s,o)})(t,e,i):((n,s,o)=>{Qv(n),Tr(n,s,o),eg(n),rg(n,s,o),ag(n,s,o),lg(n,s,o)})(t,e,i)},gg=(t,e,i)=>{t.setAttribute("loading","lazy"),Tr(t,e,i),cg(t,e),zi(t,Vu)},ic=t=>{t.removeAttribute(ii),t.removeAttribute(ca),t.removeAttribute(ua)},_g=t=>{va(t,(e=>{ic(e)})),ic(t)},rd=t=>{va(t,(e=>{Pi(e,Cn)})),Pi(t,Cn)},yg=t=>{Xu(t,(e=>{Pi(e,to)})),Pi(t,Gu),t.load()},wg=t=>{Pi(t,to)},bg=t=>{Pi(t,Ju)},xg={IMG:rd,IFRAME:wg,VIDEO:yg,OBJECT:bg},Sg=(t,e)=>{(i=>{const n=xg[i.tagName];n?n(i):tg(i)})(t),((i,n)=>{fa(i)||pa(i)||(Ut(i,n.class_entered),Ut(i,n.class_exited),Ut(i,n.class_applied),Ut(i,n.class_loading),Ut(i,n.class_loaded),Ut(i,n.class_error))})(t,e),Zs(t),ed(t)},kg=(t,e,i,n)=>{i.cancel_on_exit&&Nv(t)&&t.tagName==="IMG"&&(Ar(t),_g(t),rd(t),Ut(t,i.class_loading),ma(n,-1),Zs(t),bi(i.callback_cancel,t,e,n))},Cg=(t,e,i,n)=>{const s=Wv(t);zi(t,jv),rn(t,i.class_entered),Ut(t,i.class_exited),Xv(t,i,n),bi(i.callback_enter,t,e,n),s||Mr(t,i,n)},Eg=(t,e,i,n)=>{fa(t)||(rn(t,i.class_exited),kg(t,e,i,n),bi(i.callback_exit,t,e,n))},Ag=["IMG","IFRAME","VIDEO"],ad=t=>t.use_native&&"loading"in HTMLImageElement.prototype,Tg=(t,e,i)=>{t.forEach((n=>{Ag.indexOf(n.tagName)!==-1&&gg(n,e,i)})),Ku(i,0)},Mg=t=>t.isIntersecting||t.intersectionRatio>0,Rg=(t,e)=>{e.forEach((i=>{t.observe(i)}))},Fg=(t,e)=>{Yv(t),Rg(t,e)},$g=(t,e)=>{ad(t)||(e._observer=new IntersectionObserver((i=>{((n,s,o)=>{n.forEach((r=>Mg(r)?Cg(r.target,r,s,o):Eg(r.target,r,s,o)))})(i,t,e)}),(i=>({root:i.container===document?null:i.container,rootMargin:i.thresholds||i.threshold+"px"}))(t)))},ld=t=>Array.prototype.slice.call(t),Rs=t=>t.container.querySelectorAll(t.elements_selector),Og=t=>ld(t).filter(fa),Pg=t=>Vv(t),zg=t=>ld(t).filter(Pg),nc=(t,e)=>Og(t||Rs(e)),Dg=(t,e)=>{zg(Rs(t)).forEach((i=>{Ut(i,t.class_error),Zs(i)})),e.update()},Ig=(t,e)=>{wi&&(e._onlineHandler=()=>{Dg(t,e)},window.addEventListener("online",e._onlineHandler))},Lg=t=>{wi&&window.removeEventListener("online",t._onlineHandler)},Ui=function(t,e){const i=Bu(t);this._settings=i,this.loadingCount=0,$g(i,this),Ig(i,this),this.update(e)};Ui.prototype={update:function(t){const e=this._settings,i=nc(t,e);Ku(this,i.length),Iu?this.loadAll(i):ad(e)?Tg(i,e,this):Fg(this._observer,i)},destroy:function(){this._observer&&this._observer.disconnect(),Lg(this),Rs(this._settings).forEach((t=>{ed(t)})),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(t){const e=this._settings;nc(t,e).forEach((i=>{eo(i,this),Mr(i,e,this)}))},restoreAll:function(){const t=this._settings;Rs(t).forEach((e=>{Sg(e,t)}))}},Ui.load=(t,e)=>{const i=Bu(e);Mr(t,i)},Ui.resetStatus=t=>{Zs(t)},wi&&Uv(Ui,window.lazyLoadOptions);const dt=(t,e)=>{const{o:i,i:n,u:s}=t;let o=i,r;const l=(u,d)=>{const p=o,v=u,m=d||(n?!n(p,v):p!==v);return(m||s)&&(o=v,r=p),[o,m,r]};return[e?u=>l(e(o,r),u):l,u=>[o,!!u,r]]},Bg=typeof window<"u"&&typeof HTMLElement<"u"&&!!window.document,ot=Bg?window:{},cd=Math.max,Ug=Math.min,Rr=Math.round,fi=Math.abs,sc=Math.sign,_a=ot.cancelAnimationFrame,En=ot.requestAnimationFrame,ya=ot.setTimeout,ud=ot.clearTimeout,no=t=>typeof ot[t]<"u"?ot[t]:void 0,jg=no("MutationObserver"),oc=no("IntersectionObserver"),ji=no("ResizeObserver"),vn=no("ScrollTimeline"),wa=t=>t===void 0,so=t=>t===null,vi=t=>typeof t=="number",an=t=>typeof t=="string",oo=t=>typeof t=="boolean",Dt=t=>typeof t=="function",xt=t=>Array.isArray(t),Fs=t=>typeof t=="object"&&!xt(t)&&!so(t),ba=t=>{const e=!!t&&t.length,i=vi(e)&&e>-1&&e%1==0;return xt(t)||!Dt(t)&&i?e>0&&Fs(t)?e-1 in t:!0:!1},An=t=>!!t&&t.constructor===Object,$s=t=>t instanceof HTMLElement,ro=t=>t instanceof Element;function Oe(t,e){if(ba(t))for(let i=0;i<t.length&&e(t[i],i,t)!==!1;i++);else t&&Oe(Object.keys(t),(i=>e(t[i],i,t)));return t}const dd=(t,e)=>t.indexOf(e)>=0,en=(t,e)=>t.concat(e),De=(t,e,i)=>(!an(e)&&ba(e)?Array.prototype.push.apply(t,e):t.push(e),t),xi=t=>Array.from(t||[]),xa=t=>xt(t)?t:!an(t)&&ba(t)?xi(t):[t],Os=t=>!!t&&!t.length,Ps=t=>xi(new Set(t)),pt=(t,e,i)=>{Oe(t,s=>s?s.apply(void 0,e||[]):!0),i||(t.length=0)},hd="paddingTop",fd="paddingRight",pd="paddingLeft",md="paddingBottom",vd="marginLeft",gd="marginRight",_d="marginBottom",Sa="overflowX",ka="overflowY",Ln="width",Bn="height",ei="visible",Ft="hidden",Mi="scroll",Hg=t=>{const e=String(t||"");return e?e[0].toUpperCase()+e.slice(1):""},ao=(t,e,i,n)=>{if(t&&e){let s=!0;return Oe(i,(o=>{const r=t[o],l=e[o];r!==l&&(s=!1)})),s}return!1},Ca=(t,e)=>ao(t,e,["w","h"]),ws=(t,e)=>ao(t,e,["x","y"]),Ng=(t,e)=>ao(t,e,["t","r","b","l"]),pe=(t,...e)=>t.bind(0,...e),Hi=t=>{let e;const i=t?ya:En,n=t?ud:_a;return[s=>{n(e),e=i((()=>s()),Dt(t)?t():t)},()=>n(e)]},rc=t=>{const e=Dt(t)?t():t;if(vi(e)){const i=e?ya:En,n=e?ud:_a;return s=>{const o=i((()=>s()),e);return()=>{n(o)}}}return e&&e._},yd=(t,e)=>{const{p:i,v:n,S:s,m:o}=e||{};let r,l,a,c;const u=function(g){l&&l(),r&&r(),c=l=r=a=void 0,t.apply(this,g)},d=m=>o&&a?o(a,m):m,p=()=>{l&&a&&u(d(a)||a)},v=function(){const g=xi(arguments),y=rc(i);if(y){const S=typeof s=="function"?s():s,b=rc(n),w=d(g)||g,k=u.bind(0,w);l&&l(),S&&!c?(k(),c=!0,l=y((()=>c=void 0))):(l=y(k),b&&!r&&(r=b(p))),a=w}else u(g)};return v.O=p,v},wd=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),st=t=>t?Object.keys(t):[],Ee=(t,e,i,n,s,o,r)=>{const l=[e,i,n,s,o,r];return(typeof t!="object"||so(t))&&!Dt(t)&&(t={}),Oe(l,(a=>{Oe(a,((c,u)=>{const d=a[u];if(t===d)return!0;const p=xt(d);if(d&&An(d)){const v=t[u];let m=v;p&&!xt(v)?m=[]:!p&&!An(v)&&(m={}),t[u]=Ee(m,d)}else t[u]=p?d.slice():d}))})),t},bd=(t,e)=>Oe(Ee({},t),((i,n,s)=>{i===void 0?delete s[n]:i&&An(i)&&(s[n]=bd(i))})),Ea=t=>!st(t).length,Tn=()=>{},xd=(t,e,i)=>cd(t,Ug(e,i)),Ri=t=>Ps((xt(t)?t:(t||"").split(" ")).filter((e=>e))),Aa=(t,e)=>t&&t.getAttribute(e),ac=(t,e)=>t&&t.hasAttribute(e),Gt=(t,e,i)=>{Oe(Ri(e),(n=>{t&&t.setAttribute(n,String(i||""))}))},Lt=(t,e)=>{Oe(Ri(e),(i=>t&&t.removeAttribute(i)))},lo=(t,e)=>{const i=Ri(Aa(t,e)),n=pe(Gt,t,e),s=(o,r)=>{const l=new Set(i);return Oe(Ri(o),(a=>{l[r](a)})),xi(l).join(" ")};return{C:o=>n(s(o,"delete")),$:o=>n(s(o,"add")),H:o=>{const r=Ri(o);return r.reduce(((l,a)=>l&&i.includes(a)),r.length>0)}}},Sd=(t,e,i)=>(lo(t,e).C(i),pe(Ta,t,e,i)),Ta=(t,e,i)=>(lo(t,e).$(i),pe(Sd,t,e,i)),zs=(t,e,i,n)=>(n?Ta:Sd)(t,e,i),Ma=(t,e,i)=>lo(t,e).H(i),kd=t=>lo(t,"class"),Cd=(t,e)=>{kd(t).C(e)},co=(t,e)=>(kd(t).$(e),pe(Cd,t,e)),Ed=(t,e)=>{const i=e?ro(e)&&e:document;return i?xi(i.querySelectorAll(t)):[]},Vg=(t,e)=>{const i=e?ro(e)&&e:document;return i&&i.querySelector(t)},Fr=(t,e)=>ro(t)&&t.matches(e),Ad=t=>Fr(t,"body"),$r=t=>t?xi(t.childNodes):[],Mn=t=>t&&t.parentElement,Ni=(t,e)=>ro(t)&&t.closest(e),Or=t=>document.activeElement,qg=(t,e,i)=>{const n=Ni(t,e),s=t&&Vg(i,n),o=Ni(s,e)===n;return n&&s?n===t||s===t||o&&Ni(Ni(t,i),e)!==n:!1},tn=t=>{Oe(xa(t),(e=>{const i=Mn(e);e&&i&&i.removeChild(e)}))},Ze=(t,e)=>pe(tn,t&&e&&Oe(xa(e),(i=>{i&&t.appendChild(i)})));let Td;const Wg=()=>Td,Qg=t=>{Td=t},Qi=t=>{const e=document.createElement("div");return Gt(e,"class",t),e},Ra=t=>{const e=Qi(),i=Wg(),n=t.trim();return e.innerHTML=i?i.createHTML(n):n,Oe($r(e),(s=>tn(s)))},lc=(t,e)=>t.getPropertyValue(e)||t[e]||"",Md=t=>{const e=t||0;return isFinite(e)?e:0},ps=t=>Md(parseFloat(t||"")),Pr=t=>Math.round(t*1e4)/1e4,Rd=t=>`${Pr(Md(t))}px`;function nn(t,e){t&&e&&Oe(e,((i,n)=>{try{const s=t.style,o=so(i)||oo(i)?"":vi(i)?Rd(i):i;n.indexOf("--")===0?s.setProperty(n,o):s[n]=o}catch{}}))}function qt(t,e,i){const n=an(e);let s=n?"":{};if(t){const o=ot.getComputedStyle(t,i)||t.style;s=n?lc(o,e):xi(e).reduce(((r,l)=>(r[l]=lc(o,l),r)),s)}return s}const cc=(t,e,i)=>{const n=e?`${e}-`:"",s=i?`-${i}`:"",o=`${n}top${s}`,r=`${n}right${s}`,l=`${n}bottom${s}`,a=`${n}left${s}`,c=qt(t,[o,r,l,a]);return{t:ps(c[o]),r:ps(c[r]),b:ps(c[l]),l:ps(c[a])}},tr=(t,e)=>`translate${Fs(t)?`(${t.x},${t.y})`:`${e?"X":"Y"}(${t})`}`,Kg=t=>!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length),Yg={w:0,h:0},uo=(t,e)=>e?{w:e[`${t}Width`],h:e[`${t}Height`]}:Yg,Xg=t=>uo("inner",t||ot),gi=pe(uo,"offset"),Fd=pe(uo,"client"),Ds=pe(uo,"scroll"),Fa=t=>{const e=parseFloat(qt(t,Ln))||0,i=parseFloat(qt(t,Bn))||0;return{w:e-Rr(e),h:i-Rr(i)}},ir=t=>t.getBoundingClientRect(),Gg=t=>!!t&&Kg(t),zr=t=>!!(t&&(t[Bn]||t[Ln])),$d=(t,e)=>{const i=zr(t);return!zr(e)&&i},uc=(t,e,i,n)=>{Oe(Ri(e),(s=>{t&&t.removeEventListener(s,i,n)}))},Pe=(t,e,i,n)=>{var s;const o=(s=n&&n.D)!=null?s:!0,r=n&&n.I||!1,l=n&&n.A||!1,a={passive:o,capture:r};return pe(pt,Ri(e).map((c=>{const u=l?d=>{uc(t,c,u,r),i&&i(d)}:i;return t&&t.addEventListener(c,u,a),pe(uc,t,c,u,r)})))},$a=t=>t.stopPropagation(),Dr=t=>t.preventDefault(),Od=t=>$a(t)||Dr(t),yt=(t,e)=>{const{x:i,y:n}=vi(e)?{x:e,y:e}:e||{};vi(i)&&(t.scrollLeft=i),vi(n)&&(t.scrollTop=n)},ht=t=>({x:t.scrollLeft,y:t.scrollTop}),Pd=()=>({T:{x:0,y:0},k:{x:0,y:0}}),Jg=(t,e)=>{const{T:i,k:n}=t,{w:s,h:o}=e,r=(d,p,v)=>{let m=sc(d)*v,g=sc(p)*v;if(m===g){const y=fi(d),S=fi(p);g=y>S?0:g,m=y<S?0:m}return m=m===g?0:m,[m+0,g+0]},[l,a]=r(i.x,n.x,s),[c,u]=r(i.y,n.y,o);return{T:{x:l,y:c},k:{x:a,y:u}}},nr=({T:t,k:e})=>{const i=(n,s)=>n===0&&n<=s;return{x:i(t.x,e.x),y:i(t.y,e.y)}},dc=({T:t,k:e},i)=>{const n=(s,o,r)=>xd(0,1,(s-r)/(s-o)||0);return{x:n(t.x,e.x,i.x),y:n(t.y,e.y,i.y)}},Ir=t=>{t&&t.focus&&t.focus({preventScroll:!0,focusVisible:!1})},hc=(t,e)=>{Oe(xa(e),t)},Lr=t=>{const e=new Map,i=(o,r)=>{if(o){const l=e.get(o);hc((a=>{l&&l[a?"delete":"clear"](a)}),r)}else e.forEach((l=>{l.clear()})),e.clear()},n=(o,r)=>{if(an(o)){const c=e.get(o)||new Set;return e.set(o,c),hc((u=>{Dt(u)&&c.add(u)}),r),pe(i,o,r)}oo(r)&&r&&i();const l=st(o),a=[];return Oe(l,(c=>{const u=o[c];u&&De(a,n(c,u))})),pe(pt,a)},s=(o,r)=>{Oe(xi(e.get(o)),(l=>{r&&!Os(r)?l.apply(0,r):l()}))};return n(t||{}),[n,i,s]},zd={},Dd={},Zg=t=>{Oe(t,(e=>Oe(e,((i,n)=>{zd[n]=e[n]}))))},Id=(t,e,i)=>st(t).map((n=>{const{static:s,instance:o}=t[n],[r,l,a]=i||[],c=i?o:s;if(c){const u=i?c(r,l,e):c(e);return(a||Dd)[n]=u}})),e_=(t,e)=>t[e],ln=t=>e_(Dd,t),t_="__osOptionsValidationPlugin",cn="data-overlayscrollbars",bs="os-environment",ms=`${bs}-scrollbar-hidden`,sr=`${cn}-initialize`,xs="noClipping",fc=`${cn}-body`,_i=cn,i_="host",Jt=`${cn}-viewport`,n_=Sa,s_=ka,o_="arrange",Ld="measuring",r_="scrolling",Bd="scrollbarHidden",a_="noContent",Br=`${cn}-padding`,pc=`${cn}-content`,Oa="os-size-observer",l_=`${Oa}-appear`,Pa=`${Oa}-listener`,c_=`${Pa}-scroll`,Ss=`${Pa}-item`,mc=`${Ss}-final`,u_="os-trinsic-observer",d_="os-theme-none",mt="os-scrollbar",h_=`${mt}-rtl`,f_=`${mt}-horizontal`,p_=`${mt}-vertical`,Ud=`${mt}-track`,za=`${mt}-handle`,m_=`${mt}-visible`,v_=`${mt}-cornerless`,vc=`${mt}-interaction`,gc=`${mt}-unusable`,Ur=`${mt}-auto-hide`,g_=`${Ur}-hidden`,_c=`${mt}-wheel`,__=`${Ud}-interactive`,y_=`${za}-interactive`,jd="__osSizeObserverPlugin",w_={[jd]:{static:()=>(t,e,i)=>{const s="scroll",o=Ra(`<div class="${Ss}" dir="ltr"><div class="${Ss}"><div class="${mc}"></div></div><div class="${Ss}"><div class="${mc}" style="width: 200%; height: 200%"></div></div></div>`),r=o[0],l=r.lastChild,a=r.firstChild,c=a?.firstChild;let u=gi(r),d=u,p=!1,v;const m=()=>{yt(a,3333333),yt(l,3333333)},g=b=>{v=0,p&&(u=d,e(b===!0))},y=b=>{d=gi(r),p=!b||!Ca(d,u),b?($a(b),p&&!v&&(_a(v),v=En(g))):g(b===!1),m()},S=[Ze(t,o),Pe(a,s,y),Pe(l,s,y)];return co(t,c_),nn(c,{[Ln]:3333333,[Bn]:3333333}),En(m),[i?pe(y,!1):m,S]}}},b_=(t,e)=>{const{M:i}=e,[n,s]=t("showNativeOverlaidScrollbars");return[n&&i.x&&i.y,s]},Vi=t=>t.indexOf(ei)===0,x_=t=>t.replace(`${ei}-`,""),jr=(t,e)=>{if(t==="auto")return e?Mi:Ft;const i=t||Ft;return[Ft,Mi,ei].includes(i)?i:Ft},S_=(t,e)=>{const{overflowX:i,overflowY:n}=qt(t,[Sa,ka]);return{x:jr(i,e.x),y:jr(n,e.y)}},Da="__osScrollbarsHidingPlugin",k_="__osClickScrollPlugin",yc=t=>JSON.stringify(t,((e,i)=>{if(Dt(i))throw 0;return i})),wc=(t,e)=>t?`${e}`.split(".").reduce(((i,n)=>i&&wd(i,n)?i[n]:void 0),t):void 0,C_=[0,33],Hd=[33,99],Nd=[222,666,!0],E_={paddingAbsolute:!1,showNativeOverlaidScrollbars:!1,update:{elementEvents:[["img","load"]],debounce:{mutation:C_,resize:null,event:Hd,env:Nd},attributes:null,ignoreMutation:null,flowDirectionStyles:null},overflow:{x:"scroll",y:"scroll"},scrollbars:{theme:"os-theme-dark",visibility:"auto",autoHide:"never",autoHideDelay:1300,autoHideSuspend:!1,dragScroll:!0,clickScroll:!1,pointers:["mouse","touch","pen"]}},Vd=(t,e)=>{const i={},n=en(st(e),st(t));return Oe(n,(s=>{const o=t[s],r=e[s];if(Fs(o)&&Fs(r))Ee(i[s]={},Vd(o,r)),Ea(i[s])&&delete i[s];else if(wd(e,s)&&r!==o){let l=!0;if(xt(o)||xt(r))try{yc(o)===yc(r)&&(l=!1)}catch{}l&&(i[s]=r)}})),i},or=(t,e,i)=>n=>[wc(t,n),i||wc(e,n)!==void 0];let qd;const A_=()=>qd,T_=t=>{qd=t};let rr;const M_=()=>{const t=(w,k,E)=>{Ze(document.body,w),Ze(document.body,w);const O=Fd(w),F=gi(w),j=Fa(k);return E&&tn(w),{x:F.h-O.h+j.h,y:F.w-O.w+j.w}},e=w=>{let k=!1;const E=co(w,ms);try{k=qt(w,"scrollbar-width")==="none"||qt(w,"display","::-webkit-scrollbar")==="none"}catch{}return E(),k},i=`.${bs}{scroll-behavior:auto!important;position:fixed;opacity:0;visibility:hidden;overflow:scroll;height:200px;width:200px;z-index:-1}.${bs} div{width:200%;height:200%;margin:10px 0}.${ms}{scrollbar-width:none!important}.${ms}::-webkit-scrollbar,.${ms}::-webkit-scrollbar-corner{appearance:none!important;display:none!important;width:0!important;height:0!important}`,s=Ra(`<div class="${bs}"><div></div><style>${i}</style></div>`)[0],o=s.firstChild,r=s.lastChild,l=A_();l&&(r.nonce=l);const[a,,c]=Lr(),[u,d]=dt({o:t(s,o),i:ws},pe(t,s,o,!0)),[p]=d(),v=e(s),m={x:p.x===0,y:p.y===0},g={elements:{host:null,padding:!v,viewport:w=>v&&Ad(w)&&w,content:!1},scrollbars:{slot:!0},cancel:{nativeScrollbarsOverlaid:!1,body:null}},y=Ee({},E_),S=pe(Ee,{},y),b=pe(Ee,{},g),x={U:p,M:m,P:v,J:!!vn,G:pe(a,"r"),K:b,Z:w=>Ee(g,w)&&b(),tt:S,nt:w=>Ee(y,w)&&S(),ot:Ee({},g),st:Ee({},y)};if(Lt(s,"style"),tn(s),Pe(ot,"resize",(()=>{c("r",[])})),Dt(ot.matchMedia)&&!v&&(!m.x||!m.y)){const w=k=>{const E=ot.matchMedia(`(resolution: ${ot.devicePixelRatio}dppx)`);Pe(E,"change",(()=>{k(),w(k)}),{A:!0})};w((()=>{const[k,E]=u();Ee(x.U,k),c("r",[E])}))}return x},Kt=()=>(rr||(rr=M_()),rr),R_=(t,e,i)=>{let n=!1;const s=i?new WeakMap:!1,o=()=>{n=!0},r=l=>{if(s&&i){const a=i.map((c=>{const[u,d]=c||[];return[d&&u?(l||Ed)(u,t):[],d]}));Oe(a,(c=>Oe(c[0],(u=>{const d=c[1],p=s.get(u)||[];if(t.contains(u)&&d){const m=Pe(u,d,(g=>{n?(m(),s.delete(u)):e(g)}));s.set(u,De(p,m))}else pt(p),s.delete(u)}))))}};return r(),[o,r]},bc=(t,e,i,n)=>{let s=!1;const{et:o,ct:r,rt:l,it:a,lt:c,ut:u}=n||{},[d,p]=R_(t,(()=>s&&i(!0)),l),v=o||[],m=r||[],g=en(v,m),y=(b,x)=>{if(!Os(x)){const w=c||Tn,k=u||Tn,E=[],O=[];let F=!1,j=!1;if(Oe(x,(R=>{const{attributeName:T,target:D,type:M,oldValue:I,addedNodes:W,removedNodes:J}=R,L=M==="attributes",z=M==="childList",$=t===D,H=L&&T,B=H&&Aa(D,T||""),Q=an(B)?B:null,ne=H&&I!==Q,Y=dd(m,T)&≠if(e&&(z||!$)){const se=L&&ne,te=se&&a&&Fr(D,a),ie=(te?!w(D,T,I,Q):!L||se)&&!k(R,!!te,t,n);Oe(W,(G=>De(E,G))),Oe(J,(G=>De(E,G))),j=j||ie}!e&&$&&ne&&!w(D,T,I,Q)&&(De(O,T),F=F||Y)})),p((R=>Ps(E).reduce(((T,D)=>(De(T,Ed(R,D)),Fr(D,R)?De(T,D):T)),[]))),e)return!b&&j&&i(!1),[!1];if(!Os(O)||F){const R=[Ps(O),F];return b||i.apply(0,R),R}}},S=new jg(pe(y,!1));return[()=>(S.observe(t,{attributes:!0,attributeOldValue:!0,attributeFilter:g,subtree:e,childList:e,characterData:e}),s=!0,()=>{s&&(d(),S.disconnect(),s=!1)}),()=>{if(s)return y(!0,S.takeRecords())}]};let Ci=null;const Wd=(t,e,i)=>{const{ft:n}=i||{},s=ln(jd),[o]=dt({o:!1,u:!0});return()=>{const r=[],a=Ra(`<div class="${Oa}"><div class="${Pa}"></div></div>`)[0],c=a.firstChild,u=d=>{const p=xt(d)&&!Os(d);let v=!1,m=!1;if(p){const g=d[0],[y,,S]=o(g.contentRect),b=zr(y);m=$d(y,S),v=!m&&!b}else m=d===!0;v||e({_t:!0,ft:m})};if(ji){if(!oo(Ci)){const m=new ji(Tn);m.observe(t,{get box(){Ci=!0}}),Ci=Ci||!1,m.disconnect()}const d=yd(u,{p:0,v:0}),p=m=>d(m),v=new ji(p);if(v.observe(Ci?t:c),De(r,[()=>{v.disconnect()},!Ci&&Ze(t,a)]),Ci){const m=new ji(p);m.observe(t,{box:"border-box"}),De(r,(()=>m.disconnect()))}}else if(s){const[d,p]=s(c,u,n);De(r,en([co(a,l_),Pe(a,"animationstart",d),Ze(t,a)],p))}else return Tn;return pe(pt,r)}},F_=(t,e)=>{let i;const n=a=>a.h===0||a.isIntersecting||a.intersectionRatio>0,s=Qi(u_),[o]=dt({o:!1}),r=(a,c)=>{if(a){const u=o(n(a)),[,d]=u;return d&&!c&&e(u)&&[u]}},l=(a,c)=>r(c.pop(),a);return[()=>{const a=[];if(oc)i=new oc(pe(l,!1),{root:t}),i.observe(s),De(a,(()=>{i.disconnect()}));else{const c=()=>{const u=gi(s);r(u)};De(a,Wd(s,c)()),c()}return pe(pt,De(a,Ze(t,s)))},()=>i&&l(!0,i.takeRecords())]},$_=(t,e,i,n)=>{let s,o,r,l,a,c,u,d;const p=`[${_i}]`,v=`[${Jt}]`,m=["id","class","style","open","wrap","cols","rows"],{dt:g,vt:y,L:S,gt:b,ht:x,V:w,bt:k,yt:E,wt:O,St:F}=t,j=A=>qt(A,"direction")==="rtl",R=()=>{let A,ie,G;const N=yd(n,{p:()=>A,v:()=>ie,S:()=>G,m(le,q){const[V]=le,[oe]=q;return[en(st(V),st(oe)).reduce(((re,ye)=>(re[ye]=V[ye]||oe[ye],re)),{})]}}),ae=(le,q)=>{if(xt(q)){const[V,oe,re]=q;A=V,ie=oe,G=re}else vi(q)?(A=q,ie=!1,G=!1):(A=!1,ie=!1,G=!1);N(le)};return ae.O=N.O,ae},T={Ot:!1,B:j(g)},D=Kt(),M=ln(Da),[I]=dt({i:Ca,o:{w:0,h:0}},(()=>{const A=M&&M.R(t,e,T,D,i).Y,G=!(k&&w)&&Ma(y,_i,xs),N=!w&&E(o_),ae=N&&ht(b),le=ae&&F(),q=O(Ld,G),V=N&&A&&A(),oe=Ds(S),re=Fa(S);return V&&V(),yt(b,ae),le&&le(),G&&q(),{w:oe.w+re.w,h:oe.h+re.h}})),W=R(),J=A=>{const ie=j(g);Ee(A,{Ct:d!==ie}),Ee(T,{B:ie}),d=ie},L=(A,ie)=>{const[G,N]=A,ae={$t:N};return Ee(T,{Ot:G}),ie||n(ae),ae},z=({_t:A,ft:ie})=>{const G=ie?n:W,N={_t:A||ie,ft:ie};J(N),G(N,o)},$=(A,ie)=>{const[,G]=I(),N={xt:G};return J(N),G&&!ie&&W(N,A?r:s),N},H=(A,ie,G)=>{const N={Ht:ie};return J(N),ie&&!G&&W(N,s),N},[B,Q]=x?F_(y,L):[],ne=!w&&Wd(y,z,{ft:!0}),[Y,se]=bc(y,!1,H,{ct:m,et:m}),te=w&&ji&&new ji((A=>{const ie=A[A.length-1].contentRect;z({_t:!0,ft:$d(ie,u)}),u=ie}));return[()=>{te&&te.observe(y);const A=ne&&ne(),ie=B&&B(),G=Y(),N=D.G((ae=>{const[,le]=I();W({Et:ae,xt:le,_t:k},l)}));return()=>{te&&te.disconnect(),A&&A(),ie&&ie(),c&&c(),G(),N()}},({Dt:A,zt:ie,It:G})=>{const N={},[ae]=A("update.ignoreMutation"),[le,q]=A("update.attributes"),[V,oe]=A("update.elementEvents"),[re,ye]=A("update.debounce"),we=oe||q,Ae=ie||G,Te=be=>Dt(ae)&&ae(be);if(we){a&&a(),c&&c();const[be,He]=bc(x||S,!0,$,{et:en(m,le||[]),rt:V,it:p,ut:(Ie,tt)=>{const{target:Fe,attributeName:Ne}=Ie;return(!tt&&Ne&&!w?qg(Fe,p,v):!1)||!!Ni(Fe,`.${mt}`)||!!Te(Ie)}});c=be(),a=He}if(ye&&(W.O(),xt(re)||vi(re)?(s=re,o=!1,r=Hd,l=Nd):An(re)?(s=re.mutation,o=re.resize,r=re.event,l=re.env):(s=!1,o=!1,r=!1,l=!1)),Ae){const be=se(),He=Q&&Q(),Ie=a&&a();be&&Ee(N,H(be[0],be[1],Ae)),He&&Ee(N,L(He[0],Ae)),Ie&&Ee(N,$(Ie[0],Ae))}return J(N),N},T]},Qd=(t,e)=>Dt(e)?e.apply(0,t):e,O_=(t,e,i,n)=>{const s=wa(n)?i:n;return Qd(t,s)||e.apply(0,t)},Kd=(t,e,i,n)=>{const s=wa(n)?i:n,o=Qd(t,s);return!!o&&($s(o)?o:e.apply(0,t))},P_=(t,e)=>{const{nativeScrollbarsOverlaid:i,body:n}=e||{},{M:s,P:o,K:r}=Kt(),{nativeScrollbarsOverlaid:l,body:a}=r().cancel,c=i??l,u=wa(n)?a:n,d=(s.x||s.y)&&c,p=t&&(so(u)?!o:u);return!!d||!!p},z_=(t,e,i,n)=>{const s="--os-viewport-percent",o="--os-scroll-percent",r="--os-scroll-direction",{K:l}=Kt(),{scrollbars:a}=l(),{slot:c}=a,{dt:u,vt:d,L:p,At:v,gt:m,bt:g,V:y}=e,{scrollbars:S}=v?{}:t,{slot:b}=S||{},x=[],w=[],k=[],E=Kd([u,d,p],(()=>y&&g?u:d),c,b),O=B=>{if(vn){let Q=null,ne=[];const Y=new vn({source:m,axis:B}),se=()=>{Q&&Q.cancel(),Q=null};return{Mt:A=>{const{Tt:ie}=i,G=nr(ie)[B],N=B==="x",ae=[tr(0,N),tr(`calc(-100% + 100cq${N?"w":"h"})`,N)],le=G?ae:ae.reverse();return ne[0]===le[0]&&ne[1]===le[1]||(ne=le,se(),Q=A.kt.animate({clear:["left"],transform:le},{timeline:Y})),se}}}},F={x:O("x"),y:O("y")},j=()=>{const{Rt:B,Vt:Q}=i,ne=(Y,se)=>xd(0,1,Y/(Y+se)||0);return{x:ne(Q.x,B.x),y:ne(Q.y,B.y)}},R=(B,Q,ne)=>{const Y=ne?co:Cd;Oe(B,(se=>{Y(se.Lt,Q)}))},T=(B,Q)=>{Oe(B,(ne=>{const[Y,se]=Q(ne);nn(Y,se)}))},D=(B,Q,ne)=>{const Y=oo(ne),se=Y?ne:!0,te=Y?!ne:!0;se&&R(w,B,Q),te&&R(k,B,Q)},M=()=>{const B=j(),Q=ne=>Y=>[Y.Lt,{[s]:Pr(ne)+""}];T(w,Q(B.x)),T(k,Q(B.y))},I=()=>{if(!vn){const{Tt:B}=i,Q=dc(B,ht(m)),ne=Y=>se=>[se.Lt,{[o]:Pr(Y)+""}];T(w,ne(Q.x)),T(k,ne(Q.y))}},W=()=>{const{Tt:B}=i,Q=nr(B),ne=Y=>se=>[se.Lt,{[r]:Y?"0":"1"}];T(w,ne(Q.x)),T(k,ne(Q.y)),vn&&(w.forEach(F.x.Mt),k.forEach(F.y.Mt))},J=()=>{if(y&&!g){const{Rt:B,Tt:Q}=i,ne=nr(Q),Y=dc(Q,ht(m)),se=te=>{const{Lt:A}=te,ie=Mn(A)===p&&A,G=(N,ae,le)=>{const q=ae*N;return Rd(le?q:-q)};return[ie,ie&&{transform:tr({x:G(Y.x,B.x,ne.x),y:G(Y.y,B.y,ne.y)})}]};T(w,se),T(k,se)}},L=B=>{const Q=B?"x":"y",Y=Qi(`${mt} ${B?f_:p_}`),se=Qi(Ud),te=Qi(za),A={Lt:Y,Pt:se,kt:te},ie=F[Q];return De(B?w:k,A),De(x,[Ze(Y,se),Ze(se,te),pe(tn,Y),ie&&ie.Mt(A),n(A,D,B)]),A},z=pe(L,!0),$=pe(L,!1),H=()=>(Ze(E,w[0].Lt),Ze(E,k[0].Lt),pe(pt,x));return z(),$(),[{Ut:M,Nt:I,qt:W,Bt:J,Ft:D,jt:{Xt:w,Yt:z,Wt:pe(T,w)},Jt:{Xt:k,Yt:$,Wt:pe(T,k)}},H]},D_=(t,e,i,n,s)=>(o,r,l)=>{const{vt:a,L:c,V:u,gt:d,Gt:p,St:v}=e,{Lt:m,Pt:g,kt:y}=o,[S,b]=Hi(333),[x,w]=Hi(444),k=F=>{Dt(d.scrollBy)&&d.scrollBy({behavior:"smooth",left:F.x,top:F.y})},E=()=>{const F="pointerup pointercancel lostpointercapture",j=`client${l?"X":"Y"}`,R=l?Ln:Bn,T=l?"left":"top",D=l?"w":"h",M=l?"x":"y",I=[];return Pe(g,"pointerdown",n((W=>{const J=Ni(W.target,`.${za}`)===y,L=J?y:g,z=t.scrollbars,$=z[J?"dragScroll":"clickScroll"],{button:H,isPrimary:B,pointerType:Q}=W,{pointers:ne}=z;if(H===0&&B&&$&&(ne||[]).includes(Q)){pt(I),w();const se=!J&&(W.shiftKey||$==="instant"),te=pe(ir,y),A=pe(ir,g),ie=(Fe,Ne)=>(Fe||te())[T]-(Ne||A())[T],G=Rr(ir(d)[R])/gi(d)[D]||1,N=ht(d)[M],ae=Fe=>{yt(d,{[M]:N+Fe})},le=Fe=>{const{Rt:Ne}=i,Le=gi(g)[D]-gi(y)[D],Ve=1/G*Fe/Le;ae(Ve*Ne[M])},q=W[j],V=te(),oe=A(),re=V[R],ye=ie(V,oe)+re/2,Ae=q-oe[T]-ye,Te=J?0:Ae,be=Fe=>{pt(tt),L.releasePointerCapture(Fe.pointerId)},He=J||se,Ie=v(),tt=[Pe(p,F,be),Pe(p,"selectstart",(Fe=>Dr(Fe)),{D:!1}),Pe(g,F,be),He&&Pe(g,"pointermove",(Fe=>le(Te+Fe[j]-q))),He&&(()=>{const Fe=ht(d);Ie();const Ne=ht(d),Le={x:Ne.x-Fe.x,y:Ne.y-Fe.y};(fi(Le.x)>3||fi(Le.y)>3)&&(v(),yt(d,Fe),k(Le),x(Ie))})];if(L.setPointerCapture(W.pointerId),se)le(Ae);else if(!J){const Fe=ln(k_);if(Fe){const{Vt:Ne}=i,Le=Fe(ae,le,pe(ie),Ae,Ne[M],$,!!l,(Ve=>{Ve?Ie():De(tt,Ie)}));De(tt,Le),De(I,pe(Le,!0))}}}})))};let O=!0;return pe(pt,[Pe(y,"pointermove pointerleave",n(s)),Pe(m,"pointerenter",n((()=>{r(vc,!0)}))),Pe(m,"pointerleave pointercancel",n((()=>{r(vc,!1)}))),Pe(m,"wheel",n((F=>{const{deltaX:j,deltaY:R,deltaMode:T}=F;O&&T===0&&Mn(m)===a&&k({x:j,y:R}),O=!1,r(_c,!0),S((()=>{O=!0,r(_c)})),Dr(F)})),{D:!1,I:!0}),!u&&Pe(m,"mousedown",n((()=>{const F=Or();(ac(F,Jt)||ac(F,_i)||F===document.body)&&ya(pe(Ir,c),25)}))),Pe(m,"pointerdown",(()=>{const F=Pe(p,"click",(R=>{j(),Od(R)}),{A:!0,I:!0,D:!1}),j=Pe(p,"pointerup pointercancel",(()=>{j(),setTimeout(F,150)}),{I:!0,D:!0})}),{I:!0,D:!0}),E(),b,w])},I_=(t,e,i,n,s,o,r)=>{let l,a,c,u,d,p=Tn,v=0;const m=["mouse","pen"],g=te=>A=>{i.Kt||te(A)},y=te=>m.includes(te.pointerType),[S,b]=Hi(),[x,w]=Hi(100),[k,E]=Hi(50),[O,F]=Hi((()=>v)),[j,R]=z_(t,o,s,D_(e,o,s,g,(te=>y(te)&&H()))),{vt:T,Qt:D,bt:M}=o,{Ft:I,Ut:W,Nt:J,qt:L,Bt:z}=j,$=(te,A)=>{F();const ie=G=>{i.Kt||I(g_,G)};if(te)ie();else{const G=c?!l:!0;v>0&&!A?O(pe(ie,G)):ie(G)}},H=()=>{(c?!l:!u)&&($(!0),x((()=>{$(!1)})))},B=te=>{y(te)&&(l=!0,!i.Kt&&c&&$(!0))},Q=te=>{y(te)&&(l=!1,!i.Kt&&c&&$(!1))},ne=te=>{I(Ur,te,!0),I(Ur,te,!1)},Y=[F,w,E,b,()=>p(),Pe(T,"pointerover",B,{A:!0}),Pe(T,"pointerenter",B),Pe(T,"pointerleave",Q),Pe(T,"pointermove",g((te=>{y(te)&&a&&H()}))),Pe(D,"scroll",g((te=>{S((()=>{J(),H()})),r(te),z()})))],se=ln(Da);return[()=>pe(pt,De(Y,R())),({Dt:te,It:A,Zt:ie,tn:G})=>{const{nn:N,sn:ae,en:le,cn:q}=G||{},{Ct:V,ft:oe}=ie||{},{B:re}=n,{M:ye,P:we}=Kt(),{rn:Ae,j:Te}=s,[be,He]=te("showNativeOverlaidScrollbars"),[Ie,tt]=te("scrollbars.theme"),[Fe,Ne]=te("scrollbars.visibility"),[Le,Ve]=te("scrollbars.autoHide"),[Ct,Hn]=te("scrollbars.autoHideSuspend"),[Nn]=te("scrollbars.autoHideDelay"),[Si,un]=te("scrollbars.dragScroll"),[yo,wo]=te("scrollbars.clickScroll"),[Vn,bo]=te("overflow"),gt=oe&&!A,xo=N||ae||q||V||A,qn=le||Ne||bo,So=be&&ye.x&&ye.y,Di=!we&&!se,ko=So||Di,Wn=(dn,hn,Qn)=>{const si=dn.includes(Mi)&&(Fe===ei||Fe==="auto"&&hn===Mi);return I(m_,si,Qn),si};if(v=Nn,(He||Di)&&I(d_,ko),tt&&(I(d),I(Ie,!0),d=Ie),(Hn||gt)&&(ne(!Ct),gt&&Ct&&(Te.x||Te.y?(p(),k((()=>{p=Pe(D,Mi,g(pe(ne,!0)),{A:!0})}))):ne(!0))),Ve&&(a=Le==="move",c=Le==="leave",u=Le==="never",$(u,!0)),un&&I(y_,Si),wo&&I(__,!!yo),qn){const dn=Wn(Vn.x,Ae.x,!0),hn=Wn(Vn.y,Ae.y,!1);I(v_,!(dn&&hn))}xo&&(J(),W(),z(),q&&L(),I(gc,!Te.x,!0),I(gc,!Te.y,!1),I(h_,re&&!M))},{},j]},L_=t=>{const e=Kt(),{K:i,P:n}=e,{elements:s}=i(),{padding:o,viewport:r,content:l}=s,a=$s(t),c=a?{}:t,{elements:u}=c,{padding:d,viewport:p,content:v}=u||{},m=a?t:c.target,g=Ad(m),y=m.ownerDocument,S=y.documentElement,b=()=>y.defaultView||ot,x=pe(O_,[m]),w=pe(Kd,[m]),k=pe(Qi,""),E=pe(x,k,r),O=pe(w,k,l),F=V=>{const oe=gi(V),re=Ds(V),ye=qt(V,Sa),we=qt(V,ka);return re.w-oe.w>0&&!Vi(ye)||re.h-oe.h>0&&!Vi(we)},j=E(p),R=j===m,T=R&&g,D=!R&&O(v),M=!R&&j===D,I=T?S:j,W=T?I:m,J=!R&&w(k,o,d),L=!M&&D,z=[L,I,J,W].map((V=>$s(V)&&!Mn(V)&&V)),$=V=>V&&dd(z,V),H=!$(I)&&F(I)?I:m,B=T?S:I,ne={dt:m,vt:W,L:I,ln:J,ht:L,gt:B,Qt:T?y:I,an:g?S:H,Gt:y,bt:g,At:a,V:R,un:b,yt:V=>Ma(I,Jt,V),wt:(V,oe)=>zs(I,Jt,V,oe),St:()=>zs(B,Jt,r_,!0)},{dt:Y,vt:se,ln:te,L:A,ht:ie}=ne,G=[()=>{Lt(se,[_i,sr]),Lt(Y,sr),g&&Lt(S,[sr,_i])}];let N=$r([ie,A,te,se,Y].find((V=>V&&!$(V))));const ae=T?Y:ie||A,le=pe(pt,G);return[ne,()=>{const V=b(),oe=Or(),re=be=>{Ze(Mn(be),$r(be)),tn(be)},ye=be=>Pe(be,"focusin focusout focus blur",Od,{I:!0,D:!1}),we="tabindex",Ae=Aa(A,we),Te=ye(oe);return Gt(se,_i,R?"":i_),Gt(te,Br,""),Gt(A,Jt,""),Gt(ie,pc,""),R||(Gt(A,we,Ae||"-1"),g&&Gt(S,fc,"")),Ze(ae,N),Ze(se,te),Ze(te||se,!R&&A),Ze(A,ie),De(G,[Te,()=>{const be=Or(),He=$(A),Ie=He&&be===A?Y:be,tt=ye(Ie);Lt(te,Br),Lt(ie,pc),Lt(A,Jt),g&&Lt(S,fc),Ae?Gt(A,we,Ae):Lt(A,we),$(ie)&&re(ie),He&&re(A),$(te)&&re(te),Ir(Ie),tt()}]),n&&!R&&(Ta(A,Jt,Bd),De(G,pe(Lt,A,Jt))),Ir(!R&&g&&oe===Y&&V.top===V?A:oe),Te(),N=0,le},le]},B_=({ht:t})=>({Zt:e,fn:i,It:n})=>{const{$t:s}=e||{},{Ot:o}=i;t&&(s||n)&&nn(t,{[Bn]:o&&"100%"})},U_=({vt:t,ln:e,L:i,V:n},s)=>{const[o,r]=dt({i:Ng,o:cc()},pe(cc,t,"padding",""));return({Dt:l,Zt:a,fn:c,It:u})=>{let[d,p]=r(u);const{P:v}=Kt(),{_t:m,xt:g,Ct:y}=a||{},{B:S}=c,[b,x]=l("paddingAbsolute");(m||p||(u||g))&&([d,p]=o(u));const k=!n&&(x||y||p);if(k){const E=!b||!e&&!v,O=d.r+d.l,F=d.t+d.b,j={[gd]:E&&!S?-O:0,[_d]:E?-F:0,[vd]:E&&S?-O:0,top:E?-d.t:0,right:E?S?-d.r:"auto":0,left:E?S?"auto":-d.l:0,[Ln]:E&&`calc(100% + ${O}px)`},R={[hd]:E?d.t:0,[fd]:E?d.r:0,[md]:E?d.b:0,[pd]:E?d.l:0};nn(e||i,j),nn(i,R),Ee(s,{ln:d,_n:!E,F:e?R:Ee({},j,R)})}return{dn:k}}},j_=(t,e)=>{const i=Kt(),{vt:n,ln:s,L:o,V:r,Qt:l,gt:a,bt:c,wt:u,un:d}=t,{P:p}=i,v=c&&r,m=pe(cd,0),g={display:()=>!1,direction:Y=>Y!=="ltr",flexDirection:Y=>Y.endsWith("-reverse"),writingMode:Y=>Y!=="horizontal-tb"},y=st(g),S={i:Ca,o:{w:0,h:0}},b={i:ws,o:{}},x=Y=>{u(Ld,!v&&Y)},w=()=>qt(o,y),k=(Y,se)=>{const te=!st(Y).length,A=!se&&y.some((Ae=>{const Te=Y[Ae];return an(Te)&&g[Ae](Te)}));if(te&&!A||!Gg(o))return{T:{x:0,y:0},k:{x:1,y:1}};x(!0);const G=ht(a),N=Pe(l,Mi,(Ae=>{const Te=ht(a);Ae.isTrusted&&Te.x===G.x&&Te.y===G.y&&$a(Ae)}),{I:!0,A:!0}),ae=u(a_,!0);yt(a,{x:0,y:0}),ae();const le=ht(a),q=Ds(a);yt(a,{x:q.w,y:q.h});const V=ht(a),oe={x:V.x-le.x,y:V.y-le.y};yt(a,{x:-q.w,y:-q.h});const re=ht(a),ye={x:re.x-le.x,y:re.y-le.y},we={x:fi(oe.x)>=fi(ye.x)?V.x:re.x,y:fi(oe.y)>=fi(ye.y)?V.y:re.y};return yt(a,G),En((()=>N())),{T:le,k:we}},E=(Y,se)=>{const te=ot.devicePixelRatio%1!==0?1:0,A={w:m(Y.w-se.w),h:m(Y.h-se.h)};return{w:A.w>te?A.w:0,h:A.h>te?A.h:0}},O=(Y,se)=>{const te=(A,ie,G,N)=>{const ae=A===ei?Ft:x_(A),le=Vi(A),q=Vi(G);return!ie&&!N?Ft:le&&q?ei:le?ie&&N?ae:ie?ei:Ft:ie?ae:q&&N?ei:Ft};return{x:te(se.x,Y.x,se.y,Y.y),y:te(se.y,Y.y,se.x,Y.x)}},F=Y=>{const se=A=>[ei,Ft,Mi].map((ie=>ne(jr(ie),A))),te=se(!0).concat(se()).join(" ");u(te),u(st(Y).map((A=>ne(Y[A],A==="x"))).join(" "),!0)},[j,R]=dt(S,pe(Fa,o)),[T,D]=dt(S,pe(Ds,o)),[M,I]=dt(S),[W]=dt(b),[J,L]=dt(S),[z]=dt(b),[$]=dt({i:(Y,se)=>ao(Y,se,Ps(en(st(Y),st(se)))),o:{}}),[H,B]=dt({i:(Y,se)=>ws(Y.T,se.T)&&ws(Y.k,se.k),o:Pd()}),Q=ln(Da),ne=(Y,se)=>`${se?n_:s_}${Hg(Y)}`;return({Dt:Y,Zt:se,fn:te,It:A},{dn:ie})=>{const{_t:G,Ht:N,xt:ae,Ct:le,ft:q,Et:V}=se||{},oe=Q&&Q.R(t,e,te,i,Y),{X:re,Y:ye,W:we}=oe||{},[Ae,Te]=b_(Y,i),[be,He]=Y("overflow"),Ie=Vi(be.x),tt=Vi(be.y),Fe=G||ie||ae||le||V||Te;let Ne=R(A),Le=D(A),Ve=I(A),Ct=L(A);if(Te&&p&&u(Bd,!Ae),Fe){Ma(n,_i,xs)&&x(!0);const Za=ye&&ye(),[Kn]=Ne=j(A),[Yn]=Le=T(A),Xn=Fd(o),Gn=v&&Xg(d()),Ah={w:m(Yn.w+Kn.w),h:m(Yn.h+Kn.h)},el={w:m((Gn?Gn.w:Xn.w+m(Xn.w-Yn.w))+Kn.w),h:m((Gn?Gn.h:Xn.h+m(Xn.h-Yn.h))+Kn.h)};Za&&Za(),Ct=J(el),Ve=M(E(Ah,el),A)}const[Hn,Nn]=Ct,[Si,un]=Ve,[yo,wo]=Le,[Vn,bo]=Ne,[gt,xo]=W({x:Si.w>0,y:Si.h>0}),qn=Ie&&tt&&(gt.x||gt.y)||Ie&>.x&&!gt.y||tt&>.y&&!gt.x,So=ie||le||V||bo||wo||Nn||un||He||Te||Fe||N&&v,[Di]=Y("update.flowDirectionStyles"),[ko,Wn]=$(Di?Di(o):w(),A),dn=le||q||Wn||xo||A,[hn,Qn]=dn?H(k(ko,!!Di),A):B();let si=O(gt,be);x(!1),So&&(F(si),si=S_(o,gt),we&&re&&(re(si,yo,Vn),nn(o,we(si))));const[Ch,Eh]=z(si);return zs(n,_i,xs,qn),zs(s,Br,xs,qn),Ee(e,{rn:Ch,Vt:{x:Hn.w,y:Hn.h},Rt:{x:Si.w,y:Si.h},j:gt,Tt:Jg(hn,Si)}),{en:Eh,nn:Nn,sn:un,cn:Qn||un}}},H_=t=>{const[e,i,n]=L_(t),s={ln:{t:0,r:0,b:0,l:0},_n:!1,F:{[gd]:0,[_d]:0,[vd]:0,[hd]:0,[fd]:0,[md]:0,[pd]:0},Vt:{x:0,y:0},Rt:{x:0,y:0},rn:{x:Ft,y:Ft},j:{x:!1,y:!1},Tt:Pd()},{dt:o,gt:r,V:l,St:a}=e,{P:c,M:u}=Kt(),d=!c&&(u.x||u.y),p=[B_(e),U_(e,s),j_(e,s)];return[i,v=>{const m={},y=d&&ht(r),S=y&&a();return Oe(p,(b=>{Ee(m,b(v,m)||{})})),yt(r,y),S&&S(),l||yt(o,0),m},s,e,n]},N_=(t,e,i,n)=>{let s=!1;const o={Kt:!1,pn:!1},r=or(e,{}),[l,a,c,u,d]=H_(t),[p,v,m]=$_(u,c,r,(w=>{x({},w)})),[g,y,,S]=I_(t,e,o,m,c,u,n),b=w=>st(w).some((k=>!!w[k])),x=(w,k)=>{const{Kt:E,pn:O}=o;if(O||E&&s)return!1;const{vn:F,It:j,zt:R}=w,T=F||{},D=!!j||!s,M={Dt:or(e,T,D),vn:T,It:D},I=k||v(Ee({},M,{zt:R})),W=a(Ee({},M,{fn:m,Zt:I}));y(Ee({},M,{Zt:I,tn:W}));const J=b(I),L=b(W),z=J||L||!Ea(T)||D;return s=!0,z&&i(w,{Zt:I,tn:W}),z};return[()=>{const{an:w,gt:k,St:E}=u,O=ht(w),F=[p(),l(),g(),()=>{o.pn=!0}],j=E();return yt(k,O),j(),pe(pt,F)},x,w=>{const k=o.Kt;o.Kt=w,!w&&k!==w&&x({It:!0,zt:!0})},()=>{y({Dt:or(e,{},!1),vn:{},It:!1})},()=>({gn:o,hn:m,bn:c}),{yn:u,wn:S},d]},Ia=new WeakMap,V_=(t,e)=>{Ia.set(t,e)},q_=t=>{Ia.delete(t)},Yd=t=>Ia.get(t),St=(t,e,i)=>{const{tt:n}=Kt(),s=$s(t),o=s?t:t.target,r=Yd(o);if(e&&!r){const l=[],a={},c=D=>{const M=bd(D),I=ln(t_);return I?I(M,!0):M},u=Ee({},n(),c(e)),[d,p,v]=Lr(),[m,g,y]=Lr(i),S=(D,M)=>{y(D,M),v(D,M)},[b,x,w,k,E,O,F]=N_(t,u,(({vn:D,It:M},{Zt:I,tn:W})=>{const{_t:J,Ct:L,$t:z,xt:$,Ht:H,ft:B}=I,{nn:Q,sn:ne,en:Y,cn:se}=W;S("updated",[T,{updateHints:{sizeChanged:!!J,directionChanged:!!L,heightIntrinsicChanged:!!z,overflowEdgeChanged:!!Q,overflowAmountChanged:!!ne,overflowStyleChanged:!!Y,scrollCoordinatesChanged:!!se,contentMutation:!!$,hostMutation:!!H,appear:!!B},changedOptions:D||{},force:!!M}])}),(D=>S("scroll",[T,D]))),j=D=>{const{gn:M}=E(),{pn:I}=M;I||(q_(o),pt(l),S("destroyed",[T,D]),p(),g())},T={options(D,M){if(D){const I=M?n():{},W=Vd(u,Ee(I,c(D)));Ea(W)||(Ee(u,W),x({vn:W}))}return Ee({},u)},on:m,off:(D,M)=>{D&&M&&g(D,M)},state(){const{gn:D,hn:M,bn:I}=E(),{pn:W,Kt:J}=D,{B:L}=M,{Vt:z,Rt:$,rn:H,j:B,ln:Q,_n:ne,Tt:Y}=I;return Ee({},{overflowEdge:z,overflowAmount:$,overflowStyle:H,hasOverflow:B,scrollCoordinates:{start:Y.T,end:Y.k},padding:Q,paddingAbsolute:ne,directionRTL:L,sleeping:J,destroyed:W})},elements(){const{dt:D,vt:M,ln:I,L:W,ht:J,gt:L,Qt:z}=O.yn,{jt:$,Jt:H}=O.wn,B=ne=>{const{kt:Y,Pt:se,Lt:te}=ne;return{scrollbar:te,track:se,handle:Y}},Q=ne=>{const{Xt:Y,Yt:se}=ne,te=B(Y[0]);return Ee({},te,{clone:()=>{const A=B(se());return k(),A}})};return Ee({},{target:D,host:M,padding:I||W,viewport:W,content:J||W,scrollOffsetElement:L,scrollEventElement:z,scrollbarHorizontal:Q($),scrollbarVertical:Q(H)})},update:D=>x({It:D,zt:!0}),destroy:pe(j,!1),sleep:w,plugin:D=>a[st(D)[0]]};return De(l,[F]),V_(o,T),Id(zd,St,[T,d,a]),P_(O.yn.bt,!s&&t.cancel)?(j(!0),T):(De(l,b()),S("initialized",[T]),T.update(),T)}return r};St.plugin=t=>{const e=xt(t),i=e?t:[t],n=i.map((s=>Id(s,St)[0]));return Zg(i),e?n:n[0]};St.valid=t=>{const e=t&&t.elements,i=Dt(e)&&e();return An(i)&&!!Yd(i.target)};St.env=()=>{const{U:t,M:e,P:i,J:n,ot:s,st:o,K:r,Z:l,tt:a,nt:c}=Kt();return Ee({},{scrollbarsSize:t,scrollbarsOverlaid:e,scrollbarsHiding:i,scrollTimeline:n,staticDefaultInitialization:s,staticDefaultOptions:o,getDefaultInitialization:r,setDefaultInitialization:l,getDefaultOptions:a,setDefaultOptions:c})};St.nonce=T_;St.trustedTypePolicy=Qg;class W_{constructor(){this._listeners=new Map,this.on=this.addEventListener,this.off=this.removeEventListener,this.emit=this.dispatchEvent}addEventListener(e,i){const n=this._listeners.get(e)??new Set;return this._listeners.set(e,n),n.add(i),this}removeEventListener(e,i){var n;return(n=this._listeners.get(e))==null||n.delete(i),this}dispatchEvent(e,...i){let n=!0;for(const s of this._listeners.get(e)??[])n=s(...i)!==!1&&n;return n}unbindAllListeners(){this._listeners.clear()}}const xc=(t,e="px")=>typeof t=="number"?t+e:t,ai=({style:t},e,i)=>{if(typeof e=="object")for(const[n,s]of Object.entries(e))s!==void 0&&(t[n]=xc(s));else i!==void 0&&(t[e]=xc(i))},Sc=(t=0,e=0,i=0,n=0)=>{const s={x:t,y:e,width:i,height:n,top:e,left:t,right:t+i,bottom:e+n};return{...s,toJSON:()=>JSON.stringify(s)}},Q_=t=>{let e,i=-1,n=!1;return{next:(...s)=>{e=s,n||(n=!0,i=requestAnimationFrame(()=>{t(...e),n=!1}))},cancel:()=>{cancelAnimationFrame(i),n=!1}}},kc=(t,e,i="touch")=>{switch(i){case"center":{const n=e.left+e.width/2,s=e.top+e.height/2;return n>=t.left&&n<=t.right&&s>=t.top&&s<=t.bottom}case"cover":return e.left>=t.left&&e.top>=t.top&&e.right<=t.right&&e.bottom<=t.bottom;case"touch":return t.right>=e.left&&t.left<=e.right&&t.bottom>=e.top&&t.top<=e.bottom}},K_=()=>matchMedia("(hover: none), (pointer: coarse)").matches,Y_=()=>"safari"in window,Hr=t=>Array.isArray(t)?t:[t],Xd=t=>(e,i,n,s={})=>{(e instanceof HTMLCollection||e instanceof NodeList)&&(e=Array.from(e)),i=Hr(i),e=Hr(e);for(const o of e)if(o)for(const r of i)o[t](r,n,{capture:!1,...s})},li=Xd("addEventListener"),At=Xd("removeEventListener"),vs=t=>{var e;const{clientX:i,clientY:n,target:s}=((e=t.touches)==null?void 0:e[0])??t;return{x:i,y:n,target:s}},Li=(t,e=document)=>Hr(t).map(i=>typeof i=="string"?Array.from(e.querySelectorAll(i)):i instanceof Element?i:null).flat().filter(Boolean),X_=(t,e)=>e.some(i=>typeof i=="number"?t.button===i:typeof i=="object"?i.button!==t.button?!1:i.modifiers.every(n=>{switch(n){case"alt":return t.altKey;case"ctrl":return t.ctrlKey||t.metaKey;case"shift":return t.shiftKey}}):!1),{abs:Ei,max:Cc,min:Ec,ceil:Ac}=Math,Tc=(t=[])=>({stored:t,selected:[],touched:[],changed:{added:[],removed:[]}}),Gd=class extends W_{constructor(e){var i,n,s,o,r;super(),this._selection=Tc(),this._targetBoundaryScrolled=!0,this._selectables=[],this._areaLocation={y1:0,x2:0,y2:0,x1:0},this._areaRect=Sc(),this._singleClick=!0,this._scrollAvailable=!0,this._scrollingActive=!1,this._scrollSpeed={x:0,y:0},this._scrollDelta={x:0,y:0},this._lastMousePosition={x:0,y:0},this.enable=this._toggleStartEvents,this.disable=this._toggleStartEvents.bind(this,!1),this._options={selectionAreaClass:"selection-area",selectionContainerClass:void 0,selectables:[],document:window.document,startAreas:["html"],boundaries:["html"],container:"body",...e,behaviour:{overlap:"invert",intersect:"touch",triggers:[0],...e.behaviour,startThreshold:(i=e.behaviour)!=null&&i.startThreshold?typeof e.behaviour.startThreshold=="number"?e.behaviour.startThreshold:{x:10,y:10,...e.behaviour.startThreshold}:{x:10,y:10},scrolling:{speedDivider:10,manualSpeed:750,...(n=e.behaviour)==null?void 0:n.scrolling,startScrollMargins:{x:0,y:0,...(o=(s=e.behaviour)==null?void 0:s.scrolling)==null?void 0:o.startScrollMargins}}},features:{range:!0,touch:!0,deselectOnBlur:!1,...e.features,singleTap:{allow:!0,intersect:"native",...(r=e.features)==null?void 0:r.singleTap}}};for(const u of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))typeof this[u]=="function"&&(this[u]=this[u].bind(this));const{document:l,selectionAreaClass:a,selectionContainerClass:c}=this._options;this._area=l.createElement("div"),this._clippingElement=l.createElement("div"),this._clippingElement.appendChild(this._area),this._area.classList.add(a),c&&this._clippingElement.classList.add(c),ai(this._area,{willChange:"top, left, bottom, right, width, height",top:0,left:0,position:"fixed"}),ai(this._clippingElement,{overflow:"hidden",position:"fixed",transform:"translate3d(0, 0, 0)",pointerEvents:"none",zIndex:"1"}),this._frame=Q_(u=>{this._recalculateSelectionAreaRect(),this._updateElementSelection(),this._emitEvent("move",u),this._redrawSelectionArea()}),this.enable()}_toggleStartEvents(e=!0){const{document:i,features:n}=this._options,s=e?li:At;s(i,"mousedown",this._onTapStart),n.touch&&s(i,"touchstart",this._onTapStart,{passive:!1})}_onTapStart(e,i=!1){const{x:n,y:s,target:o}=vs(e),{document:r,startAreas:l,boundaries:a,features:c,behaviour:u}=this._options,d=o.getBoundingClientRect();if(e instanceof MouseEvent&&!X_(e,u.triggers))return;const p=Li(l,r),v=Li(a,r);this._targetElement=v.find(S=>kc(S.getBoundingClientRect(),d));const m=e.composedPath(),g=p.find(S=>m.includes(S));if(this._targetBoundary=v.find(S=>m.includes(S)),!this._targetElement||!g||!this._targetBoundary||!i&&this._emitEvent("beforestart",e)===!1)return;this._areaLocation={x1:n,y1:s,x2:0,y2:0};const y=r.scrollingElement??r.body;this._scrollDelta={x:y.scrollLeft,y:y.scrollTop},this._singleClick=!0,this.clearSelection(!1,!0),li(r,["touchmove","mousemove"],this._delayedTapMove,{passive:!1}),li(r,["mouseup","touchcancel","touchend"],this._onTapStop),li(r,"scroll",this._onScroll),c.deselectOnBlur&&(this._targetBoundaryScrolled=!1,li(this._targetBoundary,"scroll",this._onStartAreaScroll))}_onSingleTap(e){const{singleTap:{intersect:i},range:n}=this._options.features,s=vs(e);let o;if(i==="native")o=s.target;else if(i==="touch"){this.resolveSelectables();const{x:l,y:a}=s;o=this._selectables.find(c=>{const{right:u,left:d,top:p,bottom:v}=c.getBoundingClientRect();return l<u&&l>d&&a<v&&a>p})}if(!o)return;for(this.resolveSelectables();!this._selectables.includes(o);)if(o.parentElement)o=o.parentElement;else{this._targetBoundaryScrolled||this.clearSelection();return}const{stored:r}=this._selection;if(this._emitEvent("start",e),e.shiftKey&&n&&this._latestElement){const l=this._latestElement,[a,c]=l.compareDocumentPosition(o)&4?[o,l]:[l,o],u=[...this._selectables.filter(d=>d.compareDocumentPosition(a)&4&&d.compareDocumentPosition(c)&2),a,c];this.select(u),this._latestElement=l}else r.includes(o)&&(r.length===1||e.ctrlKey||r.every(l=>this._selection.stored.includes(l)))?this.deselect(o):(this.select(o),this._latestElement=o)}_delayedTapMove(e){const{container:i,document:n,behaviour:{startThreshold:s}}=this._options,{x1:o,y1:r}=this._areaLocation,{x:l,y:a}=vs(e);if(typeof s=="number"&&Ei(l+a-(o+r))>=s||typeof s=="object"&&Ei(l-o)>=s.x||Ei(a-r)>=s.y){if(At(n,["mousemove","touchmove"],this._delayedTapMove,{passive:!1}),this._emitEvent("beforedrag",e)===!1){At(n,["mouseup","touchcancel","touchend"],this._onTapStop);return}li(n,["mousemove","touchmove"],this._onTapMove,{passive:!1}),ai(this._area,"display","block"),Li(i,n)[0].appendChild(this._clippingElement),this.resolveSelectables(),this._singleClick=!1,this._targetRect=this._targetElement.getBoundingClientRect(),this._scrollAvailable=this._targetElement.scrollHeight!==this._targetElement.clientHeight||this._targetElement.scrollWidth!==this._targetElement.clientWidth,this._scrollAvailable&&(li(this._targetElement,"wheel",this._wheelScroll,{passive:!1}),li(this._options.document,"keydown",this._keyboardScroll,{passive:!1}),this._selectables=this._selectables.filter(c=>this._targetElement.contains(c))),this._setupSelectionArea(),this._emitEvent("start",e),this._onTapMove(e)}this._handleMoveEvent(e)}_setupSelectionArea(){const{_clippingElement:e,_targetElement:i,_area:n}=this,s=this._targetRect=i.getBoundingClientRect();this._scrollAvailable?(ai(e,{top:s.top,left:s.left,width:s.width,height:s.height}),ai(n,{marginTop:-s.top,marginLeft:-s.left})):(ai(e,{top:0,left:0,width:"100%",height:"100%"}),ai(n,{marginTop:0,marginLeft:0}))}_onTapMove(e){const{_scrollSpeed:i,_areaLocation:n,_options:s,_frame:o}=this,{speedDivider:r}=s.behaviour.scrolling,l=this._targetElement,{x:a,y:c}=vs(e);if(n.x2=a,n.y2=c,this._lastMousePosition.x=a,this._lastMousePosition.y=c,this._scrollAvailable&&!this._scrollingActive&&(i.y||i.x)){this._scrollingActive=!0;const u=()=>{if(!i.x&&!i.y){this._scrollingActive=!1;return}const{scrollTop:d,scrollLeft:p}=l;i.y&&(l.scrollTop+=Ac(i.y/r),n.y1-=l.scrollTop-d),i.x&&(l.scrollLeft+=Ac(i.x/r),n.x1-=l.scrollLeft-p),o.next(e),requestAnimationFrame(u)};requestAnimationFrame(u)}else o.next(e);this._handleMoveEvent(e)}_handleMoveEvent(e){const{features:i}=this._options;(i.touch&&K_()||this._scrollAvailable&&Y_())&&e.preventDefault()}_onScroll(){const{_scrollDelta:e,_options:{document:i}}=this,{scrollTop:n,scrollLeft:s}=i.scrollingElement??i.body;this._areaLocation.x1+=e.x-s,this._areaLocation.y1+=e.y-n,e.x=s,e.y=n,this._setupSelectionArea(),this._frame.next(null)}_onStartAreaScroll(){this._targetBoundaryScrolled=!0,At(this._targetElement,"scroll",this._onStartAreaScroll)}_wheelScroll(e){const{manualSpeed:i}=this._options.behaviour.scrolling,n=e.deltaY?e.deltaY>0?1:-1:0,s=e.deltaX?e.deltaX>0?1:-1:0;this._scrollSpeed.y+=n*i,this._scrollSpeed.x+=s*i,this._onTapMove(e),e.preventDefault()}_keyboardScroll(e){const{manualSpeed:i}=this._options.behaviour.scrolling,n=e.key==="ArrowLeft"?-1:e.key==="ArrowRight"?1:0,s=e.key==="ArrowUp"?-1:e.key==="ArrowDown"?1:0;this._scrollSpeed.x+=Math.sign(n)*i,this._scrollSpeed.y+=Math.sign(s)*i,e.preventDefault(),this._onTapMove({clientX:this._lastMousePosition.x,clientY:this._lastMousePosition.y,preventDefault:()=>{}})}_recalculateSelectionAreaRect(){const{_scrollSpeed:e,_areaLocation:i,_targetElement:n,_options:s}=this,{scrollTop:o,scrollHeight:r,clientHeight:l,scrollLeft:a,scrollWidth:c,clientWidth:u}=n,d=this._targetRect,{x1:p,y1:v}=i;let{x2:m,y2:g}=i;const{behaviour:{scrolling:{startScrollMargins:y}}}=s;m<d.left+y.x?(e.x=a?-Ei(d.left-m+y.x):0,m=m<d.left?d.left:m):m>d.right-y.x?(e.x=c-a-u?Ei(d.left+d.width-m-y.x):0,m=m>d.right?d.right:m):e.x=0,g<d.top+y.y?(e.y=o?-Ei(d.top-g+y.y):0,g=g<d.top?d.top:g):g>d.bottom-y.y?(e.y=r-o-l?Ei(d.top+d.height-g-y.y):0,g=g>d.bottom?d.bottom:g):e.y=0;const S=Ec(p,m),b=Ec(v,g),x=Cc(p,m),w=Cc(v,g);this._areaRect=Sc(S,b,x-S,w-b)}_redrawSelectionArea(){const{x:e,y:i,width:n,height:s}=this._areaRect,{style:o}=this._area;o.left=`${e}px`,o.top=`${i}px`,o.width=`${n}px`,o.height=`${s}px`}_onTapStop(e,i){var n;const{document:s,features:o}=this._options,{_singleClick:r}=this;At(this._targetElement,"scroll",this._onStartAreaScroll),At(s,["mousemove","touchmove"],this._delayedTapMove),At(s,["touchmove","mousemove"],this._onTapMove),At(s,["mouseup","touchcancel","touchend"],this._onTapStop),At(s,"scroll",this._onScroll),this._keepSelection(),e&&r&&o.singleTap.allow?this._onSingleTap(e):!r&&!i&&(this._updateElementSelection(),this._emitEvent("stop",e)),this._scrollSpeed.x=0,this._scrollSpeed.y=0,At(this._targetElement,"wheel",this._wheelScroll,{passive:!0}),At(this._options.document,"keydown",this._keyboardScroll,{passive:!0}),this._clippingElement.remove(),(n=this._frame)==null||n.cancel(),ai(this._area,"display","none")}_updateElementSelection(){const{_selectables:e,_options:i,_selection:n,_areaRect:s}=this,{stored:o,selected:r,touched:l}=n,{intersect:a,overlap:c}=i.behaviour,u=c==="invert",d=[],p=[],v=[];for(let g=0;g<e.length;g++){const y=e[g];if(kc(s,y.getBoundingClientRect(),a)){if(r.includes(y))o.includes(y)&&!l.includes(y)&&l.push(y);else if(u&&o.includes(y)){v.push(y);continue}else p.push(y);d.push(y)}}u&&p.push(...o.filter(g=>!r.includes(g)));const m=c==="keep";for(let g=0;g<r.length;g++){const y=r[g];!d.includes(y)&&!(m&&o.includes(y))&&v.push(y)}n.selected=d,n.changed={added:p,removed:v},this._latestElement=void 0}_emitEvent(e,i){return this.emit(e,{event:i,store:this._selection,selection:this})}_keepSelection(){const{_options:e,_selection:i}=this,{selected:n,changed:s,touched:o,stored:r}=i,l=n.filter(a=>!r.includes(a));switch(e.behaviour.overlap){case"drop":{i.stored=[...l,...r.filter(a=>!o.includes(a))];break}case"invert":{i.stored=[...l,...r.filter(a=>!s.removed.includes(a))];break}case"keep":{i.stored=[...r,...n.filter(a=>!r.includes(a))];break}}}trigger(e,i=!0){this._onTapStart(e,i)}resolveSelectables(){this._selectables=Li(this._options.selectables,this._options.document)}clearSelection(e=!0,i=!1){const{selected:n,stored:s,changed:o}=this._selection;o.added=[],o.removed.push(...n,...e?s:[]),i||(this._emitEvent("move",null),this._emitEvent("stop",null)),this._selection=Tc(e?[]:s)}getSelection(){return this._selection.stored}getSelectionArea(){return this._area}getSelectables(){return this._selectables}setAreaLocation(e){Object.assign(this._areaLocation,e),this._redrawSelectionArea()}getAreaLocation(){return this._areaLocation}cancel(e=!1){this._onTapStop(null,!e)}destroy(){this.cancel(),this.disable(),this._clippingElement.remove(),super.unbindAllListeners()}select(e,i=!1){const{changed:n,selected:s,stored:o}=this._selection,r=Li(e,this._options.document).filter(l=>!s.includes(l)&&!o.includes(l));return o.push(...r),s.push(...r),n.added.push(...r),n.removed=[],this._latestElement=void 0,i||(this._emitEvent("move",null),this._emitEvent("stop",null)),r}deselect(e,i=!1){const{selected:n,stored:s,changed:o}=this._selection,r=Li(e,this._options.document).filter(l=>n.includes(l)||s.includes(l));this._selection.stored=s.filter(l=>!r.includes(l)),this._selection.selected=n.filter(l=>!r.includes(l)),this._selection.changed.added=[],this._selection.changed.removed.push(...r.filter(l=>!o.removed.includes(l))),this._latestElement=void 0,i||(this._emitEvent("move",null),this._emitEvent("stop",null))}};Gd.version="3.9.0";let G_=Gd;const J_="5.2.0",Z_={version:J_},e0={strings:{uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it."}};function t0(t,e){let i=e;return i||(i=new Error("Upload error")),typeof i=="string"&&(i=new Error(i)),i instanceof Error||(i=Object.assign(new Error("Upload error"),{data:i})),gm(t)?(i=new wr(i,t),i):(i.request=t,i)}function Mc(t){return t.data.slice(0,t.data.size,t.meta.type)}const i0={formData:!0,fieldName:"file",method:"post",allowedMetaFields:!0,bundle:!1,headers:{},timeout:30*1e3,limit:5,withCredentials:!1,responseType:""};class n0 extends bm{static VERSION=Z_.version;#e;#t;uploaderEvents;constructor(e,i){if(super(e,{...i0,fieldName:i.bundle?"files[]":"file",...i}),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.defaultLocale=e0,this.i18nInit(),this.#t=new _m({concurrency:this.opts.limit}),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");if(this.opts.bundle&&typeof this.opts.headers=="function")throw new Error("`opts.headers` can not be a function when the `bundle: true` option is set.");if(i?.allowedMetaFields===void 0&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");this.uploaderEvents=Object.create(null),this.#e=n=>async(s,o)=>{try{const r=await lm(s,{...o,onBeforeRequest:(c,u)=>this.opts.onBeforeRequest?.(c,u,n),shouldRetry:this.opts.shouldRetry,onAfterResponse:this.opts.onAfterResponse,onTimeout:c=>{const u=Math.ceil(c/1e3),d=new Error(this.i18n("uploadStalled",{seconds:u}));this.uppy.emit("upload-stalled",d,n)},onUploadProgress:c=>{if(c.lengthComputable)for(const{id:u}of n){const d=this.uppy.getFile(u);d!=null&&this.uppy.emit("upload-progress",d,{uploadStarted:d.progress.uploadStarted??0,bytesUploaded:c.loaded/c.total*d.size,bytesTotal:d.size})}}});let l=await this.opts.getResponseData?.(r);if(r.responseType==="json")l??=r.response;else try{l??=JSON.parse(r.responseText)}catch(c){throw new Error("@uppy/xhr-upload expects a JSON response (with a `url` property). To parse non-JSON responses, use `getResponseData` to turn your response into JSON.",{cause:c})}const a=typeof l?.url=="string"?l.url:void 0;for(const{id:c}of n)this.uppy.emit("upload-success",this.uppy.getFile(c),{status:r.status,body:l,uploadURL:a});return r}catch(r){if(r.name==="AbortError")return;const l=r.request;for(const a of n)this.uppy.emit("upload-error",this.uppy.getFile(a.id),t0(l,r),l);throw r}}}getOptions(e){const i=this.uppy.getState().xhrUpload,{headers:n}=this.opts,s={...this.opts,...i||{},...e.xhrUpload||{},headers:{}};return typeof n=="function"?s.headers=n(e):Object.assign(s.headers,this.opts.headers),i&&Object.assign(s.headers,i.headers),e.xhrUpload&&Object.assign(s.headers,e.xhrUpload.headers),s}addMetadata(e,i,n){xl(n.allowedMetaFields,i).forEach(o=>{const r=i[o];Array.isArray(r)?r.forEach(l=>e.append(o,l)):e.append(o,r)})}createFormDataUpload(e,i){const n=new FormData;this.addMetadata(n,e.meta,i);const s=Mc(e);return e.name?n.append(i.fieldName,s,e.meta.name):n.append(i.fieldName,s),n}createBundledUpload(e,i){const n=new FormData,{meta:s}=this.uppy.getState();return this.addMetadata(n,s,i),e.forEach(o=>{const r=this.getOptions(o),l=Mc(o);o.name?n.append(r.fieldName,l,o.name):n.append(r.fieldName,l)}),n}async#i(e){const i=new xm(this.uppy),n=new AbortController;i.onFileRemove(e.id,()=>n.abort()),i.onCancelAll(e.id,()=>n.abort());try{await this.#t.add(async s=>{const o=this.getOptions(e),r=this.#e([e]),l=o.formData?this.createFormDataUpload(e,o):e.data,a=typeof o.endpoint=="string"?o.endpoint:await o.endpoint(e);return r(a,{...o,body:l,signal:AbortSignal.any([s,n.signal])})})}catch(s){if(s.name==="AbortError")return;throw s}finally{i.remove()}}async#n(e){const i=new AbortController;function n(){i.abort()}this.uppy.once("cancel-all",n);try{await this.#t.add(async s=>{const o=this.uppy.getState().xhrUpload??{},r=this.#e(e),l=this.createBundledUpload(e,{...this.opts,...o}),a=typeof this.opts.endpoint=="string"?this.opts.endpoint:await this.opts.endpoint(e);return r(a,{...this.opts,body:l,signal:AbortSignal.any([s,i.signal])})})}catch(s){if(s.name==="AbortError")return;throw s}finally{this.uppy.off("cancel-all",n)}}#o(e){const i=this.getOptions(e),n=xl(i.allowedMetaFields,e.meta);return{...e.remote?.body,protocol:"multipart",endpoint:i.endpoint,size:e.data.size,fieldname:i.fieldName,metadata:Object.fromEntries(n.map(s=>[s,e.meta[s]])),httpMethod:i.method,useFormData:i.formData,headers:i.headers}}async#s(e){await Promise.allSettled(e.map(i=>{if(i.isRemote){const n=()=>this.#t,s=new AbortController,o=r=>{r.id===i.id&&s.abort()};return this.uppy.on("file-removed",o),this.uppy.getRequestClientForFile(i).uploadRemoteFile(i,this.#o(i),{signal:s.signal,getQueue:n}).finally(()=>{this.uppy.off("file-removed",o)})}return this.#i(i)}))}#a=async e=>{if(e.length===0){this.uppy.log("[XHRUpload] No files to upload!");return}this.opts.limit===0&&this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),this.uppy.log("[XHRUpload] Uploading...");const i=this.uppy.getFilesByIds(e),n=dm(i),s=hm(n);if(this.uppy.emit("upload-start",s),this.opts.bundle){if(n.some(r=>r.isRemote))throw new Error("Can’t upload remote files when the `bundle: true` option is set");if(typeof this.opts.headers=="function")throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");await this.#n(n)}else await this.#s(n)};install(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}this.uppy.addUploader(this.#a)}uninstall(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(this.#a)}}const La=new Map,Nr=Symbol("ServiceContainerId");function s0(t,e){La.set(t,e)}function o0(t){La.delete(t)}function me(t){const e=t??ks(Nr);if(!e)throw new Error("No VueFinder app instance found. Make sure VueFinder component is mounted and provide the id explicitly or use within a VueFinder component tree.");const i=La.get(e);if(!i)throw new Error(`VueFinder app instance with id "${e}" was not found. Make sure the VueFinder component with id="${e}" is mounted.`);return i}function r0(t){const e=localStorage.getItem(t+"_storage"),i=js(JSON.parse(e??"{}"));ve(i,n);function n(){Object.keys(i).length?localStorage.setItem(t+"_storage",JSON.stringify(i)):localStorage.removeItem(t+"_storage")}function s(l,a){i[l]=a}function o(l){delete i[l]}function r(){Object.keys(i).forEach(l=>o(l))}return{getStore:(l,a=null)=>l in i?i[l]:a,setStore:s,removeStore:o,clearStore:r}}function ct(t,e="An error occurred"){if(!t)return e;if(typeof t=="string")return t||e;if(t instanceof Error)return t.message||e;if(typeof t=="object"&&t!==null){const i=t;if(typeof i.message=="string"&&i.message)return i.message;if(typeof i.error=="string"&&i.error)return i.error}return e}function Jd(t,e){return iu(t,e,{encode:JSON.stringify,decode:JSON.parse})}function a0(t){if(!t?.config?.get)return!0;try{return!!t.config.get("notificationsEnabled")}catch{return!0}}function Bi(t,e,i){const n={type:e,message:i};if(t?.emitter?.emit?.("vf-notify",n),!!a0(t))switch(e){case"success":ns.success(i);break;case"error":ns.error(i);break;case"warning":ns.warning(i);break;default:ns.info(i);break}}function ut(t){return{success(e){Bi(t,"success",e)},error(e){Bi(t,"error",e)},info(e){Bi(t,"info",e)},warning(e){Bi(t,"warning",e)},emit(e,i){Bi(t,e,i)}}}const ar=new Map;async function lr(t,e){const i=e[t];return typeof i=="function"?(await i()).default:i}function l0(t,e,i,n,s){const o=ut({emitter:i,config:s}),r="vuefinder_locale",l="global";let a;if(ar.has(l))a=ar.get(l),e&&e!==a.get()&&a.set(e);else{const w=localStorage.getItem(r)?JSON.parse(localStorage.getItem(r)):null;a=Jd(r,e||w||"en"),ar.set(l,a)}const c="vuefinder_translations",u=w=>{try{const k=localStorage.getItem(c);if(k)return JSON.parse(k)[w]||null}catch{}return null},d=(w,k)=>{try{const E=localStorage.getItem(c),O=E?JSON.parse(E):{};O[w]=k,localStorage.setItem(c,JSON.stringify(O))}catch{}},p=ce(a),v=String(p.value),m=u(v),g=U(m||{});let y=!1;!m&&Object.keys(n).length>0&&lr(v,n).then(w=>{g.value=w,d(v,w)}).catch(()=>{}),ve(p,async(w,k)=>{if(k&&w===k)return;if(!y){y=!0;const O=u(String(w));if(O)g.value=O;else if(Object.keys(n).length>0)try{const F=await lr(String(w),n);g.value=F,d(String(w),F)}catch{}return}const E=u(String(w));if(E)g.value=E;else try{const O=await lr(String(w),n);g.value=O,d(String(w),O)}catch(O){const F=ct(O,"Locale cannot be loaded!");o.error(F);return}Object.values(n).length>1&&(o.success("The language is set to "+w),i.emit("vf-language-saved"))},{immediate:!1});const S=(w,...k)=>k.length?S(w=w.replace("%s",String(k.shift())),...k):w;function b(w,...k){return g.value&&Object.prototype.hasOwnProperty.call(g.value,w)?S(g.value[w]||w,...k):S(w,...k)}const x=Z({get:()=>p.value,set:w=>{a.set(w)}});return js({t:b,locale:x,localeAtom:a})}const c0=["edit","newfile","newfolder","preview","archive","unarchive","search","rename","upload","delete","fullscreen","download","language","move","copy","history","theme","pinned"],Zd={simple:{search:!0,preview:!0,rename:!0,upload:!0,delete:!0,newfile:!0,newfolder:!0,download:!0},advanced:c0.reduce((t,e)=>(t[e]=!0,t),{})};function Rc(){return Zd.advanced}function eh(t){return t?t==="simple"||t==="advanced"?{...Zd[t]}:{...Rc(),...t}:Rc()}const u0="4.1.2";function Ba(t,e,i,n,s){return e=Math,i=e.log,n=1024,s=i(t)/i(n)|0,(t/e.pow(n,s)).toFixed(0)+" "+(s?"KMGTPEZY"[--s]+"iB":"B")}function th(t,e,i,n,s){return e=Math,i=e.log,n=1e3,s=i(t)/i(n)|0,(t/e.pow(n,s)).toFixed(0)+" "+(s?"KMGTPEZY"[--s]+"B":"B")}function d0(t){if(typeof t=="number")return t;const e={k:1,m:2,g:3,t:4},i=/(\d+(?:\.\d+)?)\s?(k|m|g|t)?b?/i.exec(t);if(!i)return 0;const n=parseFloat(i[1]||"0"),s=(i[2]||"").toLowerCase(),o=e[s]??0;return Math.round(n*Math.pow(1024,o))}function h0(t){const e=Kr(null),i=U(!1),n=U(),s=U(!1);return{visible:i,type:e,data:n,open:(o,r=null)=>{t.get("fullScreen")||(document.querySelector("body").style.overflow="hidden"),i.value=!0,e.value=o,n.value=r},close:()=>{t.get("fullScreen")||(document.querySelector("body").style.overflow=""),i.value=!1,e.value=null},setEditMode:o=>{s.value=o},editMode:s}}const Is={view:"grid",theme:"silver",fullScreen:!1,showTreeView:!1,showHiddenFiles:!0,metricUnits:!1,showThumbnails:!0,persist:!1,path:"",pinnedFolders:[],notificationsEnabled:!0,expandTreeByDefault:!1,expandedTreePaths:[]},Ls={initialPath:null,maxFileSize:null,loadingIndicator:"circular",showMenuBar:!0,showToolbar:!0,gridItemWidth:96,gridItemHeight:80,gridItemGap:8,gridIconSize:48,listItemHeight:32,listItemGap:2,listIconSize:16,notificationPosition:"bottom-center",notificationDuration:3e3,notificationVisibleToasts:4,notificationRichColors:!0},f0=new Set(Object.keys(Ls));function p0(t){return t||"silver"}function ih(t){return f0.has(t)}function Fc(t){const e={},i={},n=t;for(const s in n)if(ih(s))i[s]=n[s];else if(s in Is){const o=s;e[o]=n[s]}return{persistenceConfig:e,nonPersistenceConfig:i}}function $c(t,e){const i={...Is,...e,...t};return i.theme=p0(i.theme),i}function Oc(t,e){return{...Ls,...e,...t}}const m0=(t,e={})=>{const i=`vuefinder_config_${t}`,{persistenceConfig:n,nonPersistenceConfig:s}=Fc(e),o=$c(n,Is),r=Oc(s,Ls),l=iu(i,o,{encode:JSON.stringify,decode:JSON.parse}),a=Xe(r),c=ci([l,a],(m,g)=>({...m,...g})),u=(m={})=>{const g=l.get(),y=a.get(),{persistenceConfig:S,nonPersistenceConfig:b}=Fc(m),x=$c(S,g),w=Oc(b,y);l.set(x),a.set(w)},d=m=>ih(m)?a.get()[m]:l.get()[m],p=()=>({...l.get(),...a.get()}),v=(m,g)=>{const y=l.get();typeof m=="object"&&m!==null?l.set({...y,...m}):l.set({...y,[m]:g})};return{state:c,init:u,get:d,set:v,toggle:m=>{const g=l.get();v(m,!g[m])},all:p,reset:()=>{l.set({...Is}),a.set({...Ls})}}};function v0(t,e){if(typeof t=="string"&&typeof e=="string")return t.toLowerCase().localeCompare(e.toLowerCase());const i=Number(t)||0,n=Number(e)||0;return i===n?0:i<n?-1:1}const g0=()=>{const t=Xe(""),e=Xe([]),i=Xe(!1),n=Xe([]),s=Xe({active:!1,column:"",order:""}),o=Xe({kind:"all",showHidden:!1}),r=Xe(new Set),l=Xe({type:"copy",path:"",items:new Set}),a=Xe(null),c=Xe(0),u=Xe(!1),d=Xe([]),p=Xe(-1),v=ci([t],q=>{const V=(q??"").trim(),oe=V.indexOf("://"),re=oe>=0?V.slice(0,oe):"",ye=(oe>=0?V.slice(oe+3):V).split("/").filter(Boolean);let we="";const Ae=ye.map(Te=>(we=we?`${we}/${Te}`:Te,{basename:Te,name:Te,path:re?`${re}://${we}`:we,type:"dir"}));return{storage:re,breadcrumb:Ae,path:V}}),m=ci([n,s,o],(q,V,oe)=>{let re=q;oe.kind==="files"?re=re.filter(be=>be.type==="file"):oe.kind==="folders"&&(re=re.filter(be=>be.type==="dir")),oe.showHidden||(re=re.filter(be=>!be.basename.startsWith(".")));const{active:ye,column:we,order:Ae}=V;if(!ye||!we)return re;const Te=Ae==="asc"?1:-1;return re.slice().sort((be,He)=>v0(be[we],He[we])*Te)}),g=ci([n,r],(q,V)=>V.size===0?[]:q.filter(oe=>V.has(oe.path))),y=(q,V)=>{const oe=t.get();if((V??!0)&&oe!==q){const re=d.get(),ye=p.get();ye<re.length-1&&re.splice(ye+1),re.length===0&&oe&&re.push(oe),re.push(q),d.set([...re]),p.set(re.length-1)}t.set(q)},S=q=>{n.set(q??[])},b=q=>{e.set(q??[])},x=(q,V)=>{s.set({active:!0,column:q,order:V})},w=q=>{const V=s.get();V.active&&V.column===q?s.set({active:V.order==="asc",column:q,order:"desc"}):s.set({active:!0,column:q,order:"asc"})},k=()=>{s.set({active:!1,column:"",order:""})},E=(q,V)=>{o.set({kind:q,showHidden:V})},O=()=>{o.set({kind:"all",showHidden:!1})},F=(q,V="multiple")=>{const oe=new Set(r.get());V==="single"&&oe.clear(),oe.add(q),r.set(oe)},j=(q,V="multiple")=>{const oe=new Set(r.get());V==="single"&&oe.clear(),q.forEach(re=>oe.add(re)),r.set(oe)},R=q=>{const V=new Set(r.get());V.delete(q),r.set(V)},T=q=>r.get().has(q),D=(q,V="multiple")=>{const oe=new Set(r.get());oe.has(q)?oe.delete(q):(V==="single"&&oe.clear(),oe.add(q)),r.set(oe)},M=(q="multiple",V)=>{if(q==="single"){const oe=n.get()[0];if(oe){const re=oe.path;r.set(new Set([re])),c.set(1)}}else{if(V?.selectionFilterType||V?.selectionFilterMimeIncludes&&V.selectionFilterMimeIncludes.length>0){const oe=n.get().filter(re=>{const ye=V.selectionFilterType,we=V.selectionFilterMimeIncludes;return ye==="files"&&re.type==="dir"||ye==="dirs"&&re.type==="file"?!1:we&&Array.isArray(we)&&we.length>0&&re.type!=="dir"?re.mime_type?we.some(Ae=>re.mime_type?.startsWith(Ae)):!1:!0}).map(re=>re.path);r.set(new Set(oe))}else{const oe=new Set(n.get().map(re=>re.path));r.set(oe)}J(r.get().size)}},I=()=>{r.set(new Set),c.set(0)},W=q=>{const V=new Set(q??[]);r.set(V),c.set(V.size)},J=q=>{c.set(q)},L=q=>{u.set(!!q)},z=()=>u.get(),$=(q,V)=>{const oe=n.get().filter(re=>V.has(re.path));l.set({type:q,path:v.get().path,items:new Set(oe)})},H=q=>ci([l],V=>V.type==="cut"&&Array.from(V.items).some(oe=>oe.path===q)),B=q=>ci([l],V=>V.type==="copy"&&Array.from(V.items).some(oe=>oe.path===q));return{files:n,storages:e,currentPath:t,sort:s,filter:o,selectedKeys:r,selectedCount:c,loading:u,draggedItem:a,clipboardItems:l,path:v,sortedFiles:m,selectedItems:g,setPath:y,setFiles:S,setStorages:b,setSort:x,toggleSort:w,clearSort:k,setFilter:E,clearFilter:O,select:F,selectMultiple:j,deselect:R,toggleSelect:D,selectAll:M,isSelected:T,clearSelection:I,setSelection:W,setSelectedCount:J,setLoading:L,isLoading:z,setClipboard:$,createIsCut:H,createIsCopied:B,isCut:q=>{const V=H(q);return ce(V).value??!1},isCopied:q=>{const V=B(q);return ce(V).value??!1},clearClipboard:()=>{l.set({type:"copy",path:"",items:new Set})},getClipboard:()=>l.get(),setDraggedItem:q=>{a.set(q)},getDraggedItem:()=>a.get(),clearDraggedItem:()=>{a.set(null)},setReadOnly:q=>{i.set(q)},getReadOnly:()=>i.get(),isReadOnly:q=>i.get()?!0:q.read_only??!1,goBack:()=>{const q=d.get(),V=p.get();if(V>0){const oe=V-1,re=q[oe];re&&(p.set(oe),y(re,!1))}},goForward:()=>{const q=d.get(),V=p.get();if(V<q.length-1){const oe=V+1,re=q[oe];re&&(p.set(oe),y(re,!1))}},canGoBack:ci([p],q=>q>0),canGoForward:ci([d,p],(q,V)=>V<q.length-1),navigationHistory:d,historyIndex:p}};class nh{validateParam(e,i){if(e==null)throw new Error(`${i} is required`)}validatePath(e){if(!e)throw new Error("Path must be a non-empty string")}parsePath(e){if(!e)return{};if(e.includes("://")){const[i,...n]=e.split("://");return{storage:i,path:n.join("://")}}return{path:e}}combinePath(e,i){return e&&i?`${e}://${i}`:i||""}}function Vr(t,e,i){const n=`HTTP ${e}: ${i}`;if(!t)return n;try{const s=JSON.parse(t);if(s.message)return s.message;if(s.error){if(typeof s.error=="string")return s.error;if(s.error.message)return s.error.message}if(s.errors&&Array.isArray(s.errors)&&s.errors.length>0){const o=s.errors.map(r=>r.message).filter(r=>!!r);if(o.length>0)return o.join(", ")}return s.detail?s.detail:s.title?s.title:t}catch{return t||n}}class ho extends nh{config;static DEFAULT_URLS={list:"",upload:"/upload",delete:"/delete",rename:"/rename",copy:"/copy",move:"/move",archive:"/archive",unarchive:"/unarchive",createFile:"/create-file",createFolder:"/create-folder",preview:"/preview",download:"/download",search:"/search",save:"/save"};constructor(e){super();const i={...ho.DEFAULT_URLS,...e.url||{}};this.config={...e,baseURL:e.baseURL||"",url:i}}setBaseURL(e){this.config.baseURL=e||""}setToken(e){this.config.token=e}configureUploader(e,i){const n=this.getHeaders();delete n["Content-Type"],e.use(n0,{endpoint:`${this.config.baseURL}${this.config.url.upload}`,fieldName:"file",bundle:!1,headers:n,formData:!0}),e.on("upload",()=>{const s=i.getTargetPath();e.getFiles().forEach(o=>{e.setFileMeta(o.id,{path:s})})})}getHeaders(){const e={"Content-Type":"application/json",...this.config.headers};return this.config.token&&(e.Authorization=`Bearer ${this.config.token}`),e}async request(e,i={}){const n=`${this.config.baseURL}${e}`,s=await fetch(n,{...i,headers:{...this.getHeaders(),...i.headers}});if(!s.ok){const o=await s.text(),r=Vr(o,s.status,s.statusText);throw new Error(r)}return(s.headers.get("content-type")||"").includes("application/json")?await s.json():await s.text()}async list(e){const i=new URLSearchParams;e?.path&&i.append("path",e.path);const n=i.toString()?`${this.config.url.list}?${i.toString()}`:this.config.url.list;return await this.request(n,{method:"GET"})}async delete(e){return this.validateParam(e.items,"items"),this.validateParam(e.path,"path"),await this.request(this.config.url.delete,{method:"POST",body:JSON.stringify({path:e.path,items:e.items})})}async rename(e){return this.validateParam(e.path,"path"),this.validateParam(e.item,"item"),this.validateParam(e.name,"name"),this.validatePath(e.path),await this.request(this.config.url.rename,{method:"POST",body:JSON.stringify({path:e.path,item:e.item,name:e.name})})}async copy(e){return this.validateParam(e.sources,"sources"),this.validateParam(e.destination,"destination"),e.path&&this.validatePath(e.path),await this.request(this.config.url.copy,{method:"POST",body:JSON.stringify({sources:e.sources,destination:e.destination,path:e.path})})}async move(e){return this.validateParam(e.sources,"sources"),this.validateParam(e.destination,"destination"),e.path&&this.validatePath(e.path),await this.request(this.config.url.move,{method:"POST",body:JSON.stringify({sources:e.sources,destination:e.destination,path:e.path})})}async archive(e){return this.validateParam(e.items,"items"),this.validateParam(e.name,"name"),this.validateParam(e.path,"path"),await this.request(this.config.url.archive,{method:"POST",body:JSON.stringify({items:e.items,path:e.path,name:e.name})})}async unarchive(e){return this.validateParam(e.item,"item"),this.validateParam(e.path,"path"),await this.request(this.config.url.unarchive,{method:"POST",body:JSON.stringify({item:e.item,path:e.path})})}async createFile(e){return this.validateParam(e.name,"name"),this.validateParam(e.path,"path"),await this.request(this.config.url.createFile,{method:"POST",body:JSON.stringify({path:e.path,name:e.name})})}async createFolder(e){return this.validateParam(e.name,"name"),this.validateParam(e.path,"path"),await this.request(this.config.url.createFolder,{method:"POST",body:JSON.stringify({path:e.path,name:e.name})})}getPreviewUrl(e){this.validatePath(e.path);const i=new URLSearchParams({path:e.path});return`${this.config.baseURL}${this.config.url.preview}?${i.toString()}`}async getContent(e){this.validatePath(e.path);const i=new URLSearchParams({path:e.path}),n=`${this.config.baseURL}${this.config.url.preview}?${i.toString()}`,s=await fetch(n,{headers:this.getHeaders()});if(!s.ok){const o=await s.text(),r=Vr(o,s.status,s.statusText);throw new Error(r)}return{content:await s.text(),mimeType:s.headers.get("Content-Type")||void 0}}getDownloadUrl(e){this.validatePath(e.path);const i=new URLSearchParams({path:e.path});return`${this.config.baseURL}${this.config.url.download}?${i.toString()}`}async search(e){const i=this.config.url.search,n=new URLSearchParams;e.path&&n.set("path",e.path),e.filter&&n.set("filter",e.filter),e.deep&&n.set("deep","1"),e.size&&e.size!=="all"&&n.set("size",e.size);const s=n.toString()?`${i}?${n.toString()}`:i;return(await this.request(s,{method:"GET"})).files||[]}async save(e){return this.validateParam(e.path,"path"),await this.request(this.config.url.save,{method:"POST",body:JSON.stringify({path:e.path,content:e.content}),headers:this.getHeaders()})}}const Pc={list:t=>["adapter","list",t],search:(t,e,i,n)=>["adapter","search",t,e,i,n],delete:t=>["adapter","delete",t],rename:()=>["adapter","rename"],copy:()=>["adapter","copy"],move:()=>["adapter","move"],archive:()=>["adapter","archive"],unarchive:()=>["adapter","unarchive"],createFile:()=>["adapter","createFile"],createFolder:()=>["adapter","createFolder"]};class _0{driver;queryClient;config;onBeforeOpen;onAfterOpen;constructor(e,i={}){this.driver=e,this.onBeforeOpen=i.onBeforeOpen,this.onAfterOpen=i.onAfterOpen,this.queryClient=i.queryClient||new rm({defaultOptions:{queries:{refetchOnWindowFocus:i.refetchOnWindowFocus??!1,staleTime:i.staleTime??300*1e3,retry:i.retry??2},mutations:{retry:i.retry??1}}}),this.config={queryClient:this.queryClient,refetchOnWindowFocus:i.refetchOnWindowFocus??!1,staleTime:i.staleTime??300*1e3,cacheTime:i.cacheTime??600*1e3,retry:i.retry??2,onBeforeOpen:this.onBeforeOpen??(()=>{}),onAfterOpen:this.onAfterOpen??(()=>{})}}getDriver(){return this.driver}getQueryClient(){return this.queryClient}async list(e){const i=Pc.list(e);return await this.queryClient.fetchQuery({queryKey:i,queryFn:()=>this.driver.list({path:e}),staleTime:this.config.staleTime})}async open(e){this.onBeforeOpen&&this.onBeforeOpen();const i=await this.list(e);return this.onAfterOpen&&this.onAfterOpen(i),i}async delete(e){const i=await this.driver.delete(e);return this.invalidateListQueries(),i}async rename(e){const i=await this.driver.rename(e);return this.invalidateListQueries(),i}async copy(e){const i=await this.driver.copy(e);return this.invalidateListQueries(),i}async move(e){const i=await this.driver.move(e);return this.invalidateListQueries(),i}async archive(e){const i=await this.driver.archive(e);return this.invalidateListQueries(),i}async unarchive(e){const i=await this.driver.unarchive(e);return this.invalidateListQueries(),i}async createFile(e){const i=await this.driver.createFile(e);return this.invalidateListQueries(),i}async createFolder(e){const i=await this.driver.createFolder(e);return this.invalidateListQueries(),i}async getContent(e){const i=["adapter","content",e.path];return await this.queryClient.fetchQuery({queryKey:i,queryFn:()=>this.driver.getContent(e),staleTime:this.config.staleTime})}getPreviewUrl(e){return this.driver.getPreviewUrl(e)}getDownloadUrl(e){return this.driver.getDownloadUrl(e)}async search(e){const i=Pc.search(e.path,e.filter,e.deep,e.size);return await this.queryClient.fetchQuery({queryKey:i,queryFn:()=>this.driver.search(e),staleTime:this.config.staleTime})}async save(e){const i=await this.driver.save(e);return this.invalidateListQueries(),i}invalidateListQueries(){this.queryClient.invalidateQueries({queryKey:["adapter"],exact:!1})}invalidateListQuery(e){this.queryClient.invalidateQueries({queryKey:["adapter","list",e],exact:!0})}clearCache(){this.queryClient.clear()}}function y0(t){const e=ce(t.state);return{current:Z(()=>e.value.theme||"silver"),set:i=>{t.set("theme",i)}}}const w0=(t,e)=>{const i=r0(t.id??"vf"),n=Tf(),s=e.i18n,o=t.locale??e.locale,r=m0(t.id??"vf",t.config??{}),l=g0();if(!t.driver)throw new Error("Driver is required for VueFinder");const a=new _0(t.driver);return js({version:u0,config:r,theme:(()=>{const c=y0(r);return{current:c.current,set:c.set}})(),fs:l,root:null,debug:t.debug??!1,emitter:n,storage:i,i18n:l0(i,o,n,s,r),modal:h0(r),adapter:Fh(a),features:eh(t.features),selectionMode:t.selectionMode||"multiple",selectionFilterType:Z(()=>t.selectionFilterType||"both"),selectionFilterMimeIncludes:Z(()=>t.selectionFilterMimeIncludes||[]),treeViewData:[],filesize:r.get("metricUnits")?th:Ba,contextMenuItems:t.contextMenuItems,customUploader:t.customUploader})},b0=["data-theme"],x0={class:"vuefinder__modal-layout__container"},S0={class:"vuefinder__modal-layout__content"},k0={key:0,class:"vuefinder__modal-layout__footer"},C0={key:0,class:"vuefinder__modal-drag-overlay"},E0={class:"vuefinder__modal-drag-message"},vt=fe({__name:"ModalLayout",props:{showDragOverlay:{type:Boolean},dragOverlayText:{}},setup(t){const e=U(null),i=me();i.config;const n=t;Re(()=>{const o=document.querySelector(".v-f-modal input");o&&o.focus(),lt(()=>{if(document.querySelector(".v-f-modal input")&&window.innerWidth<768&&e.value){const r=e.value.getBoundingClientRect().bottom+16;window.scrollTo({top:r,left:0,behavior:"smooth"})}})});const s=o=>{o.target.classList.contains("vuefinder__modal-layout__wrapper")&&(o.preventDefault(),o.stopPropagation())};return(o,r)=>(_(),C("div",{"data-theme":h(i).theme.current,class:"vuefinder__themer vuefinder__modal-layout","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",tabindex:"0",onKeyup:r[1]||(r[1]=On(l=>h(i).modal.close(),["esc"]))},[r[2]||(r[2]=f("div",{class:"vuefinder__modal-layout__overlay"},null,-1)),f("div",x0,[f("div",{class:"vuefinder__modal-layout__wrapper",onContextmenu:s,onMousedown:r[0]||(r[0]=Se(l=>h(i).modal.close(),["self"]))},[f("div",{ref_key:"modalBody",ref:e,class:"vuefinder__modal-layout__body"},[f("div",S0,[xe(o.$slots,"default")]),o.$slots.buttons?(_(),C("div",k0,[xe(o.$slots,"buttons")])):K("",!0)],512)],32)]),n.showDragOverlay?(_(),C("div",C0,[f("div",E0,P(n.dragOverlayText||"Drag and drop the files/folders to here."),1)])):K("",!0)],40,b0))}}),A0={class:"vuefinder__modal-header"},T0={class:"vuefinder__modal-header__icon-container"},M0={id:"modal-title",class:"vuefinder__modal-header__title"},kt=fe({__name:"ModalHeader",props:{title:{},icon:{}},setup(t){return(e,i)=>(_(),C("div",A0,[f("div",T0,[(_(),X(Rt(t.icon),{class:"vuefinder__modal-header__icon"}))]),f("div",M0,P(t.title),1)]))}}),R0={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.8",viewBox:"0 0 24 24"};function F0(t,e){return _(),C("svg",R0,[...e[0]||(e[0]=[f("circle",{cx:"12",cy:"12",r:"9"},null,-1),f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 8.2h.01M10.75 11.25H12v4.5m0 0h1.25m-1.25 0h-2"},null,-1)])])}const sh={render:F0},$0={class:"vuefinder__about-modal__content"},O0={class:"vuefinder__about-modal__main"},P0={class:"vuefinder__about-modal__tab-content"},z0={class:"vuefinder__about-modal__lead"},D0={class:"vuefinder__about-modal__description"},I0={class:"vuefinder__about-modal__links"},L0={href:"https://vuefinder.ozdemir.be",class:"vuefinder__about-modal__link-btn",target:"_blank",rel:"noopener noreferrer"},B0={class:"vuefinder__about-modal__meta"},U0={class:"vuefinder__about-modal__meta-item"},j0={class:"vuefinder__about-modal__meta-label"},H0={class:"vuefinder__about-modal__meta-value"},N0={class:"vuefinder__about-modal__meta-item"},V0={class:"vuefinder__about-modal__meta-label"},oh=fe({__name:"ModalAbout",setup(t){const e=me(),{t:i}=e.i18n;return(n,s)=>(_(),X(vt,null,{buttons:he(()=>[f("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:s[0]||(s[0]=o=>h(e).modal.close())},P(h(i)("Close")),1)]),default:he(()=>[f("div",$0,[ee(kt,{icon:h(sh),title:"Vuefinder "+h(e).version},null,8,["icon","title"]),f("div",O0,[f("div",P0,[f("div",z0,P(h(i)("A modern, customizable file manager component built for Vue.")),1),f("div",D0,P(h(i)("If you like it, please follow and ⭐ star on GitHub.")),1),f("div",I0,[f("a",L0,P(h(i)("Project Home")),1),s[1]||(s[1]=f("a",{href:"https://github.com/n1crack/vuefinder",class:"vuefinder__about-modal__link-btn",target:"_blank",rel:"noopener noreferrer"}," GitHub ",-1))]),f("div",B0,[f("div",U0,[f("span",j0,P(h(i)("Version")),1),f("span",H0,P(h(e).version),1)]),f("div",N0,[f("span",V0,P(h(i)("License")),1),s[2]||(s[2]=f("span",{class:"vuefinder__about-modal__meta-value"},"MIT",-1))])])])])])]),_:1}))}}),q0={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",viewBox:"0 0 24 24"};function W0(t,e){return _(),C("svg",q0,[...e[0]||(e[0]=[f("path",{d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21q.512.078 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48 48 0 0 0-3.478-.397m-12 .562q.51-.089 1.022-.165m0 0a48 48 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a52 52 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a49 49 0 0 0-7.5 0"},null,-1)])])}const rh={render:W0},Q0={class:"vuefinder__delete-modal__content"},K0={class:"vuefinder__delete-modal__form"},Y0={class:"vuefinder__delete-modal__description"},X0={class:"vuefinder__delete-modal__files vf-scrollbar"},G0={key:0,class:"vuefinder__delete-modal__icon vuefinder__delete-modal__icon--dir",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},J0={key:1,class:"vuefinder__delete-modal__icon",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},Z0={class:"vuefinder__delete-modal__file-name"},ey={class:"vuefinder__delete-modal__confirmation"},ty={class:"vuefinder__delete-modal__confirmation-label"},iy={class:"vuefinder__delete-modal__confirmation-text"},ny=["disabled"],fo=fe({__name:"ModalDelete",setup(t){const e=me(),i=ut(e),{t:n}=e.i18n,s=e.fs,o=ce(s.path),r=U(e.modal.data.items),l=U(!1),a=()=>{r.value.length&&l.value&&e.adapter.delete({path:o.value.path,items:r.value.map(({path:c,type:u})=>({path:c,type:u}))}).then(c=>{i.success(n("Files deleted.")),e.fs.setFiles(c.files),e.modal.close()}).catch(c=>{i.error(ct(c,n("Failed to delete files")))})};return(c,u)=>(_(),X(vt,null,{buttons:he(()=>[f("div",ey,[f("label",ty,[ze(f("input",{"onUpdate:modelValue":u[0]||(u[0]=d=>l.value=d),type:"checkbox",class:"vuefinder__delete-modal__checkbox"},null,512),[[Us,l.value]]),f("span",iy,P(h(n)("I'm sure delete it, This action cannot be undone.")),1)])]),f("button",{type:"button",class:"vf-btn vf-btn-danger",disabled:!l.value,onClick:a},P(h(n)("Yes, Delete!")),9,ny),f("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:u[1]||(u[1]=d=>h(e).modal.close())},P(h(n)("Cancel")),1)]),default:he(()=>[f("div",null,[ee(kt,{icon:h(rh),title:h(n)("Delete files")},null,8,["icon","title"]),f("div",Q0,[f("div",K0,[f("p",Y0,P(h(n)("Are you sure you want to delete these files?")),1),f("div",X0,[(_(!0),C(_e,null,$e(r.value,d=>(_(),C("p",{key:d.path,class:"vuefinder__delete-modal__file"},[d.type==="dir"?(_(),C("svg",G0,[...u[2]||(u[2]=[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)])])):(_(),C("svg",J0,[...u[3]||(u[3]=[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)])])),f("span",Z0,P(d.basename),1)]))),128))])])])])]),_:1}))}}),sy={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",viewBox:"0 0 24 24"};function oy(t,e){return _(),C("svg",sy,[...e[0]||(e[0]=[f("path",{d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"},null,-1)])])}const ah={render:oy},ry={class:"vuefinder__rename-modal__content"},ay={class:"vuefinder__rename-modal__item"},ly={class:"vuefinder__rename-modal__item-info"},cy={key:0,class:"vuefinder__rename-modal__icon vuefinder__rename-modal__icon--dir",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},uy={key:1,class:"vuefinder__rename-modal__icon",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},dy={class:"vuefinder__rename-modal__item-name"},po=fe({__name:"ModalRename",setup(t){const e=me(),i=ut(e),{t:n}=e.i18n,s=e.fs,o=ce(s.path),r=U(e.modal.data.items[0]),l=U(r.value.basename),a=()=>{l.value!=r.value.basename&&e.adapter.rename({path:o.value.path,item:r.value.path,name:l.value}).then(c=>{i.success(n("%s is renamed.",l.value)),e.fs.setFiles(c.files),e.modal.close()}).catch(c=>{i.error(ct(c,n("Failed to rename")))})};return(c,u)=>(_(),X(vt,null,{buttons:he(()=>[f("button",{type:"button",class:"vf-btn vf-btn-primary",onClick:a},P(h(n)("Rename")),1),f("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:u[1]||(u[1]=d=>h(e).modal.close())},P(h(n)("Cancel")),1)]),default:he(()=>[f("div",null,[ee(kt,{icon:h(ah),title:h(n)("Rename")},null,8,["icon","title"]),f("div",ry,[f("div",ay,[f("p",ly,[r.value.type==="dir"?(_(),C("svg",cy,[...u[2]||(u[2]=[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)])])):(_(),C("svg",uy,[...u[3]||(u[3]=[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)])])),f("span",dy,P(r.value.basename),1)]),ze(f("input",{"onUpdate:modelValue":u[0]||(u[0]=d=>l.value=d),class:"vuefinder__rename-modal__input",placeholder:"Name",type:"text",onKeyup:On(a,["enter"])},null,544),[[$n,l.value]])])])])]),_:1}))}});function It(){const t=me(),e=Z(()=>t.features);return{enabled:i=>e.value[i]??!1}}const hy={class:"vuefinder__text-preview"},fy={class:"vuefinder__text-preview__header"},py=["title"],my={class:"vuefinder__text-preview__actions"},vy={key:0,class:"vuefinder__text-preview__content"},gy={key:1},_y=fe({__name:"Text",emits:["success"],setup(t,{emit:e}){const i=e,n=U(""),s=U(""),o=U(null),r=U(!1),l=me(),a=ut(l),{enabled:c}=It(),{t:u}=l.i18n;Re(async()=>{try{const v=await l.adapter.getContent({path:l.modal.data.item.path});n.value=v.content,i("success")}catch(v){ct(v,"Failed to load text content"),i("success")}});const d=()=>{r.value=!r.value,s.value=n.value,l.modal.setEditMode(r.value)},p=async()=>{try{const v=l.modal.data.item.path;await l.adapter.save({path:v,content:s.value}),n.value=s.value,a.success(u("Updated.")),i("success"),r.value=!r.value}catch(v){a.error(ct(v,u("Failed to save file")))}};return(v,m)=>(_(),C("div",hy,[f("div",fy,[f("div",{id:"modal-title",class:"vuefinder__text-preview__title",title:h(l).modal.data.item.path},P(h(l).modal.data.item.basename),9,py),f("div",my,[r.value?(_(),C("button",{key:0,class:"vuefinder__text-preview__save-button",onClick:p},P(h(u)("Save")),1)):K("",!0),h(c)("edit")?(_(),C("button",{key:1,class:"vuefinder__text-preview__edit-button",onClick:m[0]||(m[0]=g=>d())},P(r.value?h(u)("Cancel"):h(u)("Edit")),1)):K("",!0)])]),f("div",null,[r.value?(_(),C("div",gy,[ze(f("textarea",{ref_key:"editInput",ref:o,"onUpdate:modelValue":m[1]||(m[1]=g=>s.value=g),class:"vuefinder__text-preview__textarea",name:"text",cols:"30",rows:"10"},null,512),[[$n,s.value]])])):(_(),C("pre",vy,P(n.value),1))])]))}}),Ua=async(t,e)=>{if(e){if(e.isFile){const i=await new Promise(n=>{e.file(n)});t(e,i)}if(e.isDirectory){const i=e.createReader(),n=await new Promise(s=>{i.readEntries(s)});for(const s of n)await Ua(t,s)}}},Ue={PENDING:0,CANCELED:1,UPLOADING:2,ERROR:3,DONE:10};function lh(t){const e=me(),{t:i}=e.i18n,n=e.fs,s=ce(n.path),o=e.config,r=U({QUEUE_ENTRY_STATUS:Ue}),l=U(null),a=U(null),c=U(null),u=U(null),d=U(null),p=U([]),v=U(""),m=U(!1),g=U(!1),y=U(null);let S;const b=L=>{L.preventDefault(),L.stopPropagation(),g.value=!0},x=L=>{L.preventDefault(),L.stopPropagation(),g.value=!0},w=L=>{L.preventDefault(),L.stopPropagation(),(!L.relatedTarget||L.relatedTarget===document.body)&&(g.value=!1)},k=L=>{L.preventDefault(),L.stopPropagation(),g.value=!1;const z=/^[/\\](.+)/,$=L.dataTransfer;$&&($.items&&$.items.length?Array.from($.items).forEach(H=>{if(H.kind==="file"){const B=H.webkitGetAsEntry?.();if(B)Ua((Q,ne)=>{const Y=z.exec(Q?.fullPath||"");O(ne,Y?Y[1]:ne.name)},B);else{const Q=H.getAsFile?.();Q&&O(Q)}}}):$.files&&$.files.length&&Array.from($.files).forEach(H=>O(H)))},E=L=>p.value.findIndex(z=>z.id===L),O=(L,z)=>S.addFile({name:z||L.name,type:L.type,data:L,source:"Local"}),F=L=>L.status===Ue.DONE?"text-green-600":L.status===Ue.ERROR||L.status===Ue.CANCELED?"text-red-600":"",j=L=>L.status===Ue.DONE?"✓":L.status===Ue.ERROR||L.status===Ue.CANCELED?"!":"...",R=()=>u.value?.click(),T=()=>e.modal.close(),D=L=>{if(m.value||!p.value.filter(z=>z.status!==Ue.DONE).length){m.value||(v.value=i("Please select file to upload first."));return}v.value="",y.value=L||s.value,S.upload()},M=()=>{S.cancelAll(),p.value.forEach(L=>{L.status!==Ue.DONE&&(L.status=Ue.CANCELED,L.statusName=i("Canceled"))}),m.value=!1},I=L=>{m.value||(S.removeFile(L.id),p.value.splice(E(L.id),1))},W=L=>{if(!m.value)if(S.cancelAll(),L){const z=p.value.filter($=>$.status!==Ue.DONE);p.value=[],z.forEach($=>O($.originalFile,$.name))}else p.value=[]},J=L=>{L.forEach(z=>{O(z)})};return Re(()=>{S=new sa({debug:e.debug,restrictions:{maxFileSize:d0(o.get("maxFileSize")??"10mb")},locale:e.i18n.t("uppy"),onBeforeFileAdded:(H,B)=>{if(B[H.id]!=null){const Q=E(H.id);p.value[Q]?.status===Ue.PENDING&&(v.value=S.i18n("noDuplicates",{fileName:H.name})),p.value=p.value.filter(ne=>ne.id!==H.id)}return p.value.push({id:H.id,name:H.name,size:e.filesize(H.size),status:Ue.PENDING,statusName:i("Pending upload"),percent:null,originalFile:H.data}),!0}});const L={getTargetPath:()=>(y.value||s.value).path};if(t)t(S,L);else if(e.adapter.getDriver().configureUploader)e.adapter.getDriver().configureUploader(S,L);else throw new Error("No uploader configured");S.on("restriction-failed",(H,B)=>{const Q=p.value[E(H.id)];Q&&I(Q),v.value=B.message}),S.on("upload-start",H=>{H.forEach(B=>{const Q=p.value[E(B.id)];Q&&(Q.status=Ue.UPLOADING,Q.statusName=i("Uploading"),Q.percent="0%")})}),S.on("upload-progress",(H,B)=>{const Q=B.bytesTotal??1,ne=Math.floor(B.bytesUploaded/Q*100),Y=E(H.id);Y!==-1&&p.value[Y]&&(p.value[Y].percent=`${ne}%`)}),S.on("upload-success",H=>{const B=p.value[E(H.id)];B&&(B.status=Ue.DONE,B.statusName=i("Done"))}),S.on("upload-error",(H,B)=>{const Q=p.value[E(H.id)];Q&&(Q.percent=null,Q.status=Ue.ERROR,Q.statusName=B?.isNetworkError?i("Network Error, Unable establish connection to the server or interrupted."):B?.message||i("Unknown Error"))}),S.on("error",H=>{v.value=H.message,m.value=!1}),S.on("complete",H=>{m.value=!1;const B=y.value||s.value;e.adapter.invalidateListQuery(B.path),e.adapter.open(B.path);const Q=p.value.filter(ne=>ne.status===Ue.DONE&&H.successful.includes(ne.id)).map(ne=>ne.name);e.emitter.emit("vf-upload-complete",Q)}),u.value?.addEventListener("click",()=>a.value?.click()),d.value?.addEventListener("click",()=>c.value?.click());const z={capture:!0};document.addEventListener("dragover",b,z),document.addEventListener("dragenter",x,z),document.addEventListener("dragleave",w,z),document.addEventListener("drop",k,z);const $=H=>{const B=H.target,Q=B.files;if(Q){for(const ne of Q)O(ne);B.value=""}};a.value?.addEventListener("change",$),c.value?.addEventListener("change",$)}),Ge(()=>{const L={capture:!0};document.removeEventListener("dragover",b,L),document.removeEventListener("dragenter",x,L),document.removeEventListener("dragleave",w,L),document.removeEventListener("drop",k,L)}),{container:l,internalFileInput:a,internalFolderInput:c,pickFiles:u,pickFolders:d,queue:p,message:v,uploading:m,hasFilesInDropArea:g,definitions:r,openFileSelector:R,upload:D,cancel:M,remove:I,clear:W,close:T,getClassNameForEntry:F,getIconForEntry:j,addExternalFiles:J}}const yy={class:"vuefinder__image-preview"},wy={class:"vuefinder__image-preview__header"},by=["title"],xy={class:"vuefinder__image-preview__actions"},Sy={class:"vuefinder__image-preview__image-container"},ky=["src"],Cy=fe({name:"ImagePreview",__name:"Image",emits:["success"],setup(t,{emit:e}){const i=e,n=me(),s=ut(n),{enabled:o}=It(),{t:r}=n.i18n,l=U(!1),a=U(n.modal.data.item.previewUrl??n.adapter.getPreviewUrl({path:n.modal.data.item.path})),c=U(a.value),{addExternalFiles:u,upload:d,queue:p}=lh(n.customUploader),v=n.fs,m=ce(v.path),g=qi("cropperRef"),y=async()=>{l.value=!l.value,n.modal.setEditMode(l.value)},S=async()=>{const b=g.value?.getResult({size:{width:795,height:341},fillColor:"#ffffff"})?.canvas;if(!b)return;let x=b;if(b.width>1200||b.height>1200){const F=Math.min(1200/b.width,1200/b.height),j=document.createElement("canvas");j.width=Math.floor(b.width*F),j.height=Math.floor(b.height*F);const R=j.getContext("2d");R&&(R.drawImage(b,0,0,j.width,j.height),x=j)}const w=n.modal.data.item.basename,k=w.split(".").pop()?.toLowerCase()||"jpg",E=k==="png"?"image/png":k==="gif"?"image/gif":"image/jpeg",O=await new Promise(F=>{x.toBlob(j=>F(j),E)});if(!O){s.error(r("Failed to save image"));return}try{const F=new File([O],w,{type:E}),j=n.modal.data.item.path.split("/");j.pop();const R={path:j.join("/")||(m.value?.path??"")};u([F]),await new Promise(I=>setTimeout(I,100));const T=p.value.find(I=>I.name===F.name);if(!T)throw new Error("File was not added to upload queue");d(R);let D=0;for(;D<150;){await new Promise(W=>setTimeout(W,200));const I=p.value.find(W=>W.id===T.id);if(I?.status===Ue.DONE)break;if(I?.status===Ue.ERROR)throw new Error(I.statusName||"Upload failed");D++}s.success(r("Updated.")),await fetch(a.value,{cache:"reload",mode:"no-cors"});const M=n.root?.querySelector?.('[data-src="'+a.value+'"]');M&&M instanceof HTMLElement&&Ui.resetStatus(M),n.emitter.emit("vf-refresh-thumbnails"),await y(),i("success")}catch(F){s.error(ct(F,r("Failed to save image")))}};return Re(()=>{i("success")}),(b,x)=>(_(),C("div",yy,[f("div",wy,[f("h3",{id:"modal-title",class:"vuefinder__image-preview__title",title:h(n).modal.data.item.path},P(h(n).modal.data.item.basename),9,by),f("div",xy,[l.value?(_(),C("button",{key:0,class:"vuefinder__image-preview__crop-button",onClick:S},P(h(r)("Crop")),1)):K("",!0),h(o)("edit")?(_(),C("button",{key:1,class:"vuefinder__image-preview__edit-button",onClick:x[0]||(x[0]=w=>y())},P(l.value?h(r)("Cancel"):h(r)("Edit")),1)):K("",!0)])]),f("div",Sy,[l.value?(_(),X(h(Du),{key:1,ref_key:"cropperRef",ref:g,class:"h-full w-full",crossorigin:"anonymous",src:c.value,"auto-zoom":!0,priority:"image",transitions:!0},null,8,["src"])):(_(),C("img",{key:0,style:{},src:h(n).modal.data.item.previewUrl??h(n).adapter.getPreviewUrl({path:h(n).modal.data.item.path}),class:"vuefinder__image-preview__image h-full w-full"},null,8,ky))])]))}}),Ey={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function Ay(t,e){return _(),C("svg",Ey,[...e[0]||(e[0]=[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 0 0 2-2V9.414a1 1 0 0 0-.293-.707l-5.414-5.414A1 1 0 0 0 12.586 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2"},null,-1)])])}const Rn={render:Ay},Ty={class:"vuefinder__default-preview"},My={class:"vuefinder__default-preview__content"},Ry={class:"vuefinder__default-preview__header"},Fy=["title"],$y={class:"vuefinder__default-preview__icon-container"},Oy=["title"],Py=fe({__name:"Default",emits:["success"],setup(t,{emit:e}){const i=me(),n=e;return Re(()=>{n("success")}),(s,o)=>(_(),C("div",Ty,[f("div",My,[f("div",Ry,[f("h3",{id:"modal-title",class:"vuefinder__default-preview__title",title:h(i).modal.data.item.path},P(h(i).modal.data.item.basename),9,Fy)]),f("div",$y,[ee(h(Rn),{class:"vuefinder__default-preview__file-icon"}),f("div",{id:"modal-title",class:"vuefinder__default-preview__file-name",title:h(i).modal.data.item.path},P(h(i).modal.data.item.basename),9,Oy)])])]))}}),zy={class:"vuefinder__video-preview"},Dy=["title"],Iy={class:"vuefinder__video-preview__video",preload:"metadata",controls:""},Ly=["src"],By=fe({__name:"Video",emits:["success"],setup(t,{emit:e}){const i=me(),n=e,s=()=>i.adapter.getPreviewUrl({path:i.modal.data.item.path});return Re(()=>{n("success")}),(o,r)=>(_(),C("div",zy,[f("h3",{id:"modal-title",class:"vuefinder__video-preview__title",title:h(i).modal.data.item.path},P(h(i).modal.data.item.basename),9,Dy),f("div",null,[f("video",Iy,[f("source",{src:s(),type:"video/mp4"},null,8,Ly),r[0]||(r[0]=Me(" Your browser does not support the video tag. ",-1))])])]))}}),Uy={class:"vuefinder__audio-preview"},jy=["title"],Hy={class:"vuefinder__audio-preview__audio",controls:""},Ny=["src"],Vy=fe({__name:"Audio",emits:["success"],setup(t,{emit:e}){const i=e,n=me(),s=()=>{const o=me();return o.adapter.getPreviewUrl({path:o.modal.data.item.path})};return Re(()=>{i("success")}),(o,r)=>(_(),C("div",Uy,[f("h3",{id:"modal-title",class:"vuefinder__audio-preview__title",title:h(n).modal.data.item.path},P(h(n).modal.data.item.basename),9,jy),f("div",null,[f("audio",Hy,[f("source",{src:s(),type:"audio/mpeg"},null,8,Ny),r[0]||(r[0]=Me(" Your browser does not support the audio element. ",-1))])])]))}}),qy={class:"vuefinder__pdf-preview"},Wy=["title"],Qy=["data"],Ky=["src"],Yy=fe({__name:"Pdf",emits:["success"],setup(t,{emit:e}){const i=me(),n=e,s=()=>{const o=me();return o.adapter.getPreviewUrl({path:o.modal.data.item.path})};return Re(()=>{n("success")}),(o,r)=>(_(),C("div",qy,[f("h3",{id:"modal-title",class:"vuefinder__pdf-preview__title",title:h(i).modal.data.item.path},P(h(i).modal.data.item.basename),9,Wy),f("div",null,[f("object",{class:"vuefinder__pdf-preview__object",data:s(),type:"application/pdf",width:"100%",height:"100%"},[f("iframe",{class:"vuefinder__pdf-preview__iframe",src:s(),width:"100%",height:"100%"}," Your browser does not support PDFs ",8,Ky)],8,Qy)])]))}});function Xy(t,e=null){return new Date(t*1e3).toLocaleString(e??navigator.language??"en-US")}const Gy={key:0,class:"vuefinder__preview-modal__nav-overlay"},Jy=["disabled","title"],Zy=["disabled","title"],ew={class:"vuefinder__preview-modal__content"},tw={key:0},iw={class:"vuefinder__preview-modal__loading"},nw={key:0,class:"vuefinder__preview-modal__loading-indicator"},sw={class:"vuefinder__preview-modal__details"},ow={class:"font-bold"},rw={class:"pl-2 font-bold"},aw={key:0,class:"vuefinder__preview-modal__note"},lw=["download","href"],Un=fe({__name:"ModalPreview",setup(t){const e=me(),{enabled:i}=It(),{t:n}=e.i18n,s=U(!1),o=b=>{const x=(b||"").split("/").pop()||"",w=x.lastIndexOf(".");return w>=0?x.slice(w+1).toLowerCase():""},r=(b,x)=>x?b==="image"?new Set(["png","jpg","jpeg","gif","webp","svg","bmp","ico","avif"]).has(x):b==="video"?new Set(["mp4","webm","ogg","ogv","mov","m4v"]).has(x):b==="audio"?new Set(["mp3","wav","ogg","oga","m4a","flac","aac"]).has(x):b==="text"?new Set(["txt","md","json","js","ts","css","scss","html","xml","csv","log","yml","yaml"]).has(x):b==="application/pdf"?x==="pdf":!1:!1,l=b=>{const x=e.modal.data.item.mime_type;if(x&&typeof x=="string")return x.startsWith(b);const w=o(e.modal.data.item.path);return r(b,w)},a=i("preview");a||(s.value=!0);const c=Z(()=>e.modal.data.item),u=ce(e.fs.sortedFiles),d=Z(()=>u.value.filter(b=>b.type==="file")),p=Z(()=>d.value.findIndex(b=>b.path===c.value.path)),v=Z(()=>p.value>0),m=Z(()=>p.value<d.value.length-1),g=()=>{if(e.modal.editMode||!v.value)return;const b=d.value[p.value-1];b&&(e.fs.clearSelection(),e.fs.select(b.path),e.modal.data.item=b)},y=()=>{if(e.modal.editMode||!m.value)return;const b=d.value[p.value+1];b&&(e.fs.clearSelection(),e.fs.select(b.path),e.modal.data.item=b)},S=b=>{if(b.key==="Escape"){b.preventDefault(),b.stopPropagation(),e.modal.close();return}(b.key==="ArrowLeft"||b.key==="ArrowRight")&&(b.preventDefault(),b.stopPropagation(),b.key==="ArrowLeft"?g():y())};return Re(()=>{const b=document.querySelector(".vuefinder__preview-modal");b&&b.focus()}),(b,x)=>(_(),X(vt,null,{buttons:he(()=>[f("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:x[6]||(x[6]=w=>h(e).modal.close())},P(h(n)("Close")),1),h(i)("download")?(_(),C("a",{key:0,target:"_blank",class:"vf-btn vf-btn-primary",download:h(e).adapter.getDownloadUrl(h(e).modal.data.item),href:h(e).adapter.getDownloadUrl(h(e).modal.data.item)},P(h(n)("Download")),9,lw)):K("",!0)]),default:he(()=>[f("div",{class:"vuefinder__preview-modal",tabindex:"0",onKeydown:S},[h(e).modal.editMode?K("",!0):(_(),C("div",Gy,[f("button",{disabled:!v.value,class:"vuefinder__preview-modal__nav-side vuefinder__preview-modal__nav-side--left",title:h(n)("Previous file"),onClick:g},[...x[7]||(x[7]=[f("svg",{class:"vuefinder__preview-modal__nav-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[f("polyline",{points:"15,18 9,12 15,6"})],-1)])],8,Jy),f("button",{disabled:!m.value,class:"vuefinder__preview-modal__nav-side vuefinder__preview-modal__nav-side--right",title:h(n)("Next file"),onClick:y},[...x[8]||(x[8]=[f("svg",{class:"vuefinder__preview-modal__nav-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[f("polyline",{points:"9,18 15,12 9,6"})],-1)])],8,Zy)])),f("div",ew,[h(a)?(_(),C("div",tw,[l("text")?(_(),X(_y,{key:`text-${c.value.path}`,onSuccess:x[0]||(x[0]=w=>s.value=!0)})):l("image")?(_(),X(Cy,{key:`image-${c.value.path}`,onSuccess:x[1]||(x[1]=w=>s.value=!0)})):l("video")?(_(),X(By,{key:`video-${c.value.path}`,onSuccess:x[2]||(x[2]=w=>s.value=!0)})):l("audio")?(_(),X(Vy,{key:`audio-${c.value.path}`,onSuccess:x[3]||(x[3]=w=>s.value=!0)})):l("application/pdf")?(_(),X(Yy,{key:`pdf-${c.value.path}`,onSuccess:x[4]||(x[4]=w=>s.value=!0)})):(_(),X(Py,{key:`default-${c.value.path}`,onSuccess:x[5]||(x[5]=w=>s.value=!0)}))])):K("",!0),f("div",iw,[s.value===!1?(_(),C("div",nw,[x[9]||(x[9]=f("svg",{class:"vuefinder__preview-modal__spinner",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[f("circle",{class:"vuefinder__preview-modal__spinner-circle",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),f("path",{class:"vuefinder__preview-modal__spinner-path",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)),f("span",null,P(h(n)("Loading")),1)])):K("",!0)])])],32),f("div",sw,[f("div",null,[f("span",ow,P(h(n)("File Size"))+": ",1),Me(P(h(e).filesize(h(e).modal.data.item.file_size)),1)]),f("div",null,[f("span",rw,P(h(n)("Last Modified"))+": ",1),Me(" "+P(h(Xy)(h(e).modal.data.item.last_modified)),1)])]),h(i)("download")?(_(),C("div",aw,[f("span",null,P(h(n)(`Download doesn't work? You can try right-click "Download" button, select "Save link as...".`)),1)])):K("",!0)]),_:1}))}}),cw={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"};function uw(t,e){return _(),C("svg",cw,[...e[0]||(e[0]=[f("path",{stroke:"none",d:"M0 0h24v24H0z"},null,-1),f("path",{d:"M13 19H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h4l3 3h7a2 2 0 0 1 2 2v4M16 22l5-5M21 21.5V17h-4.5"},null,-1)])])}const dw={render:uw},hw={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function fw(t,e){return _(),C("svg",hw,[...e[0]||(e[0]=[f("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M8 16H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v2m-6 12h8a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-8a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2"},null,-1)])])}const ja={render:fw},pw={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function mw(t,e){return _(),C("svg",pw,[...e[0]||(e[0]=[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-6l-2-2H5a2 2 0 0 0-2 2"},null,-1)])])}const Wt={render:mw},vw={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24"};function gw(t,e){return _(),C("svg",vw,[...e[0]||(e[0]=[f("path",{stroke:"none",d:"M0 0h24v24H0z"},null,-1),f("path",{d:"M12 5v14M5 12h14"},null,-1)])])}const mo={render:gw},_w={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24"};function yw(t,e){return _(),C("svg",_w,[...e[0]||(e[0]=[f("path",{stroke:"none",d:"M0 0h24v24H0z"},null,-1),f("path",{d:"M5 12h14"},null,-1)])])}const vo={render:yw},ww={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",class:"h-5 w-5",viewBox:"0 0 24 24"};function bw(t,e){return _(),C("svg",ww,[...e[0]||(e[0]=[f("path",{stroke:"none",d:"M0 0h24v24H0z"},null,-1),f("path",{d:"m15 4.5-4 4L7 10l-1.5 1.5 7 7L14 17l1.5-4 4-4M9 15l-4.5 4.5M14.5 4 20 9.5"},null,-1)])])}const Ha={render:bw},xw={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function Sw(t,e){return _(),C("svg",xw,[...e[0]||(e[0]=[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"},null,-1)])])}const Na={render:Sw},kw={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24"};function Cw(t,e){return _(),C("svg",kw,[...e[0]||(e[0]=[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 9.776q.168-.026.344-.026h15.812q.176 0 .344.026m-16.5 0a2.25 2.25 0 0 0-1.883 2.542l.857 6a2.25 2.25 0 0 0 2.227 1.932H19.05a2.25 2.25 0 0 0 2.227-1.932l.857-6a2.25 2.25 0 0 0-1.883-2.542m-16.5 0V6A2.25 2.25 0 0 1 6 3.75h3.879a1.5 1.5 0 0 1 1.06.44l2.122 2.12a1.5 1.5 0 0 0 1.06.44H18A2.25 2.25 0 0 1 20.25 9v.776"},null,-1)])])}const Va={render:Cw},Ew={class:"vuefinder__modal-tree__folder-item"},Aw={class:"vuefinder__modal-tree__folder-content"},Tw={key:1,class:"vuefinder__modal-tree__folder-spacer"},Mw={class:"vuefinder__modal-tree__folder-text"},Rw={key:0,class:"vuefinder__modal-tree__subfolders"},Fw={key:0,class:"vuefinder__modal-tree__more-note"},$w=300,Ow=fe({__name:"ModalTreeFolderItem",props:{folder:{},storage:{},modelValue:{},expandedFolders:{},modalTreeData:{},currentPath:{}},emits:["update:modelValue","selectAndClose","toggleFolder"],setup(t,{emit:e}){const i=me(),{t:n}=i.i18n,s=i.fs,o=U({}),r=t,l=e;ce(s.path);const a=Z(()=>{const O=`${r.storage}:${r.folder.path}`;return r.expandedFolders[O]||!1}),c=Z(()=>r.modelValue?.path===r.folder.path),u=Z(()=>r.currentPath?.path===r.folder.path),d=Z(()=>r.modalTreeData[r.folder.path]||[]),p=Z(()=>{const O=d.value,F=o.value[r.folder.path]||50;return O.length>F?O.slice(0,F):O}),v=Z(()=>d.value.length),m=Z(()=>o.value[r.folder.path]||50),g=Z(()=>v.value>m.value),y=()=>{o.value[r.folder.path]=(m.value||50)+50},S=Z(()=>d.value.length>0||r.folder.type==="dir"),b=()=>{l("toggleFolder",r.storage,r.folder.path)},x=()=>{l("update:modelValue",r.folder)},w=()=>{l("update:modelValue",r.folder),l("selectAndClose",r.folder)};let k=0;const E=()=>{const O=Date.now();O-k<$w?w():x(),k=O};return(O,F)=>{const j=wt("ModalTreeFolderItem",!0);return _(),C("div",Ew,[f("div",Aw,[S.value?(_(),C("div",{key:0,class:"vuefinder__modal-tree__folder-toggle",onClick:b},[a.value?(_(),X(h(vo),{key:1,class:"vuefinder__modal-tree__folder-toggle-icon"})):(_(),X(h(mo),{key:0,class:"vuefinder__modal-tree__folder-toggle-icon"}))])):(_(),C("div",Tw)),f("div",{class:ue(["vuefinder__modal-tree__folder-link",{"vuefinder__modal-tree__folder-link--selected":c.value,"vuefinder__modal-tree__folder-link--current":u.value}]),onClick:x,onDblclick:w,onTouchend:E},[a.value?(_(),X(h(Va),{key:1,class:"vuefinder__item-icon__folder--open vuefinder__modal-tree__folder-icon"})):(_(),X(h(Wt),{key:0,class:"vuefinder__modal-tree__folder-icon vuefinder__item-icon__folder"})),f("span",Mw,P(t.folder.basename),1)],34)]),a.value&&S.value?(_(),C("div",Rw,[(_(!0),C(_e,null,$e(p.value,R=>(_(),X(j,{key:R.path,folder:R,storage:t.storage,"model-value":t.modelValue,"expanded-folders":t.expandedFolders,"modal-tree-data":t.modalTreeData,"current-path":t.currentPath,"onUpdate:modelValue":F[0]||(F[0]=T=>O.$emit("update:modelValue",T)),onSelectAndClose:F[1]||(F[1]=T=>O.$emit("selectAndClose",T)),onToggleFolder:F[2]||(F[2]=(T,D)=>O.$emit("toggleFolder",T,D))},null,8,["folder","storage","model-value","expanded-folders","modal-tree-data","current-path"]))),128)),g.value?(_(),C("div",Fw,[f("div",{class:"vuefinder__modal-tree__load-more",onClick:y},P(h(n)("load more")),1)])):K("",!0)])):K("",!0)])}}}),Pw={class:"vuefinder__modal-tree"},zw={class:"vuefinder__modal-tree__header"},Dw={class:"vuefinder__modal-tree__title"},Iw={key:0,class:"vuefinder__modal-tree__section"},Lw={class:"vuefinder__modal-tree__section-title"},Bw={class:"vuefinder__modal-tree__list"},Uw=["onClick","onDblclick","onTouchend"],jw={class:"vuefinder__modal-tree__text"},Hw={class:"vuefinder__modal-tree__text-storage"},Nw={class:"vuefinder__modal-tree__section-title"},Vw={class:"vuefinder__modal-tree__list"},qw={class:"vuefinder__modal-tree__storage-item"},Ww={class:"vuefinder__modal-tree__storage-content"},Qw=["onClick"],Kw=["onClick","onDblclick","onTouchend"],Yw={class:"vuefinder__modal-tree__storage-text"},Xw={key:0,class:"vuefinder__modal-tree__subfolders"},Gw={key:0,class:"vuefinder__modal-tree__more-note"},Jw=["onClick"],zc=300,qa=fe({__name:"ModalTreeSelector",props:{modelValue:{},showPinnedFolders:{type:Boolean},currentPath:{}},emits:["update:modelValue","selectAndClose"],setup(t,{emit:e}){const i=me(),{t:n}=i.i18n,s=i.fs,o=i.config,r=e,l=ce(s.sortedFiles),a=ce(s.storages),c=Z(()=>a.value||[]),u=ce(s.path),d=U(null),p=U({}),v=U({}),m=U({});ve(l,M=>{const I=M.filter(J=>J.type==="dir"),W=u.value?.path||"";W&&(v.value[W]=I.map(J=>({...J,type:"dir"})))});const g=(M,I)=>{const W=`${M}:${I}`;p.value={...p.value,[W]:!p.value[W]},p.value[W]&&!v.value[I]&&i.adapter.list(I).then(J=>{const L=(J.files||[]).filter(z=>z.type==="dir");v.value[I]=L.map(z=>({...z,type:"dir"}))})},y=M=>v.value[M]||[],S=M=>m.value[M]||50,b=M=>{const I=y(M),W=S(M);return I.length>W?I.slice(0,W):I},x=M=>y(M).length,w=M=>x(M)>S(M),k=M=>{m.value[M]=S(M)+50},E=M=>{M&&r("update:modelValue",M)},O=M=>{M&&(r("update:modelValue",M),r("selectAndClose",M))},F=M=>{const I={storage:M,path:M+"://",basename:M,type:"dir",extension:"",file_size:null,last_modified:null,mime_type:null,visibility:"public",dir:M+"://"};r("update:modelValue",I)},j=M=>{const I={storage:M,path:M+"://",basename:M,type:"dir",extension:"",file_size:null,last_modified:null,mime_type:null,visibility:"public",dir:M+"://"};r("update:modelValue",I),r("selectAndClose",I)};let R=0;const T=M=>{if(!M)return;const I=Date.now();I-R<zc?O(M):E(M),R=I},D=M=>{const I=Date.now();I-R<zc?j(M):F(M),R=I};return Re(()=>{d.value&&St(d.value,{overflow:{x:"hidden"},scrollbars:{theme:"vf-scrollbars-theme"}})}),(M,I)=>(_(),C("div",Pw,[f("div",zw,[f("div",Dw,P(h(n)("Select Target Folder")),1)]),f("div",{ref_key:"modalContentElement",ref:d,class:"vuefinder__modal-tree__content"},[t.showPinnedFolders&&h(i).features.pinned&&h(o).get("pinnedFolders").length?(_(),C("div",Iw,[f("div",Lw,P(h(n)("Pinned Folders")),1),f("div",Bw,[(_(!0),C(_e,null,$e(h(o).get("pinnedFolders"),W=>(_(),C("div",{key:W.path,class:ue(["vuefinder__modal-tree__item",{"vuefinder__modal-tree__item--selected":t.modelValue?.path===W.path}]),onClick:J=>E(W),onDblclick:J=>O(W),onTouchend:J=>T(W)},[ee(h(Wt),{class:"vuefinder__modal-tree__icon vuefinder__item-icon__folder"}),f("div",jw,P(W.basename),1),f("div",Hw,P(W.storage),1),ee(h(Ha),{class:"vuefinder__modal-tree__icon vuefinder__modal-tree__icon--pin"})],42,Uw))),128))])])):K("",!0),f("div",Nw,P(h(n)("Storages")),1),(_(!0),C(_e,null,$e(c.value,W=>(_(),C("div",{key:W,class:"vuefinder__modal-tree__section"},[f("div",Vw,[f("div",qw,[f("div",Ww,[f("div",{class:"vuefinder__modal-tree__storage-toggle",onClick:Se(J=>g(W,W+"://"),["stop"])},[p.value[`${W}:${W}://`]?(_(),X(h(vo),{key:1,class:"vuefinder__modal-tree__toggle-icon"})):(_(),X(h(mo),{key:0,class:"vuefinder__modal-tree__toggle-icon"}))],8,Qw),f("div",{class:ue(["vuefinder__modal-tree__storage-link",{"vuefinder__modal-tree__storage-link--selected":t.modelValue?.path===W+"://"}]),onClick:J=>F(W),onDblclick:J=>j(W),onTouchend:J=>D(W)},[ee(h(Na),{class:"vuefinder__modal-tree__storage-icon"}),f("span",Yw,P(W),1)],42,Kw)]),p.value[`${W}:${W}://`]?(_(),C("div",Xw,[(_(!0),C(_e,null,$e(b(W+"://"),J=>(_(),X(Ow,{key:J.path,folder:J,storage:W,"model-value":t.modelValue,"expanded-folders":p.value,"modal-tree-data":v.value,"current-path":t.currentPath,"onUpdate:modelValue":E,onSelectAndClose:O,onToggleFolder:g},null,8,["folder","storage","model-value","expanded-folders","modal-tree-data","current-path"]))),128)),w(W+"://")?(_(),C("div",Gw,[f("div",{class:"vuefinder__modal-tree__load-more",onClick:J=>k(W+"://")},P(h(n)("load more")),9,Jw)])):K("",!0)])):K("",!0)])])]))),128))],512)]))}}),Zw=["title"],qr=fe({__name:"Message",props:{error:{type:Boolean}},emits:["hidden"],setup(t,{emit:e}){const i=e,n=me(),{t:s}=n.i18n,o=U(!1),r=U(null),l=U(r.value?.innerHTML);ve(l,()=>o.value=!1);const a=()=>{i("hidden"),o.value=!0};return(c,u)=>(_(),C("div",null,[o.value?K("",!0):(_(),C("div",{key:0,ref_key:"strMessage",ref:r,class:ue(["vuefinder__message",t.error?"vuefinder__message--error":"vuefinder__message--success"])},[xe(c.$slots,"default"),f("div",{class:"vuefinder__message__close",title:h(s)("Close"),onClick:a},[...u[0]||(u[0]=[f("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"vuefinder__message__icon"},[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)])],8,Zw)],2))]))}}),eb={class:"vuefinder__move-modal__content"},tb={class:"vuefinder__move-modal__description"},ib={class:"vuefinder__move-modal__files vf-scrollbar"},nb={class:"vuefinder__move-modal__file-name"},sb={class:"vuefinder__move-modal__target-title"},ob={class:"vuefinder__move-modal__target-container"},rb={class:"vuefinder__move-modal__target-path"},ab={class:"vuefinder__move-modal__target-storage"},lb={key:0,class:"vuefinder__move-modal__destination-folder"},cb={class:"vuefinder__move-modal__target-badge"},ub={key:0,class:"vuefinder__move-modal__options"},db={class:"vuefinder__move-modal__checkbox-label"},hb={class:"vuefinder__move-modal__checkbox-text"},fb=["disabled"],pb={class:"vuefinder__move-modal__selected-items"},ch=fe({__name:"ModalTransfer",props:{copy:{type:Boolean}},setup(t){const e=me(),i=ut(e),{enabled:n}=It(),{t:s}=e.i18n,o=t,r=U(e.modal.data.items.from),l=U(e.modal.data.items.to),a=U(""),c=U(o.copy||!n("move")),u=Z(()=>c.value?"copy":"move"),d=U(!1),p=ce(e.fs.path),v=Z(()=>c.value?s("Copy files"):s("Move files")),m=Z(()=>c.value?s("Are you sure you want to copy these files?"):s("Are you sure you want to move these files?")),g=Z(()=>c.value?s("Yes, Copy!"):s("Yes, Move!")),y=E=>{E&&(l.value=E)},S=E=>{E&&(l.value=E,d.value=!1)},b=Z(()=>{const E=l.value;return E?r.value.some(O=>!!(E.path===O.path||O.path.startsWith(E.path+"/")||O.type==="dir"&&E.path.startsWith(O.path+"/"))):!0}),x=Z(()=>{if(!b.value)return"";const E=l.value;return E?r.value.find(O=>E.path===O.path||O.path.startsWith(E.path+"/")||O.type==="dir"&&E.path.startsWith(O.path+"/"))?s("Cannot move/copy item to itself or its parent/child directory"):s("Invalid destination directory"):s("Please select a destination directory")}),w=()=>{const E=l.value.path;if(!E)return{storage:"local",path:""};if(E.endsWith("://"))return{storage:E.replace("://",""),path:""};const O=E.split("://");return{storage:O[0]||"local",path:O[1]||""}},k=async()=>{if(r.value.length)try{const{files:E}=await e.adapter[u.value]({path:p.value.path,sources:r.value.map(({path:O})=>O),destination:l.value.path});e.fs.setFiles(E),e.modal.close()}catch(E){i.error(ct(E,s("Failed to transfer files")))}};return(E,O)=>(_(),X(vt,null,{buttons:he(()=>[f("button",{type:"button",class:"vf-btn vf-btn-primary",disabled:b.value,onClick:k},P(g.value),9,fb),f("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:O[4]||(O[4]=F=>h(e).modal.close())},P(h(s)("Cancel")),1),f("div",pb,P(h(s)("%s item(s) selected.",r.value.length)),1)]),default:he(()=>[f("div",null,[ee(kt,{icon:c.value?h(ja):h(dw),title:v.value},null,8,["icon","title"]),f("div",eb,[f("p",tb,P(m.value),1),f("div",ib,[(_(!0),C(_e,null,$e(r.value,F=>(_(),C("div",{key:F.path,class:"vuefinder__move-modal__file"},[f("div",null,[F.type==="dir"?(_(),X(h(Wt),{key:0,class:"vuefinder__move-modal__icon vuefinder__move-modal__icon--dir"})):(_(),X(h(Rn),{key:1,class:"vuefinder__move-modal__icon"}))]),f("div",nb,P(F.path),1)]))),128))]),f("h4",sb,P(h(s)("Target Directory")),1),f("div",ob,[f("div",{class:"vuefinder__move-modal__target-display",onClick:O[0]||(O[0]=F=>d.value=!d.value)},[f("div",rb,[f("span",ab,P(w().storage)+"://",1),w().path?(_(),C("span",lb,P(w().path),1)):K("",!0)]),f("span",cb,P(h(s)("Browse")),1)])]),f("div",{class:ue(["vuefinder__move-modal__tree-selector",d.value?"vuefinder__move-modal__tree-selector--expanded":"vuefinder__move-modal__tree-selector--collapsed"])},[ee(qa,{modelValue:l.value,"onUpdate:modelValue":[O[1]||(O[1]=F=>l.value=F),y],"show-pinned-folders":!0,onSelectAndClose:S},null,8,["modelValue"])],2),h(n)("copy")&&h(n)("move")?(_(),C("div",ub,[f("label",db,[ze(f("input",{"onUpdate:modelValue":O[2]||(O[2]=F=>c.value=F),type:"checkbox",class:"vuefinder__move-modal__checkbox"},null,512),[[Us,c.value]]),f("span",hb,P(h(s)("Create a copy instead of moving")),1)])])):K("",!0),x.value?(_(),X(qr,{key:1,error:""},{default:he(()=>[Me(P(x.value),1)]),_:1})):K("",!0),a.value.length&&!x.value?(_(),X(qr,{key:2,error:"",onHidden:O[3]||(O[3]=F=>a.value="")},{default:he(()=>[Me(P(a.value),1)]),_:1})):K("",!0)])])]),_:1}))}}),sn=fe({__name:"ModalMove",setup(t){return(e,i)=>(_(),X(ch,{copy:!1}))}}),Wa=fe({__name:"ModalCopy",setup(t){return(e,i)=>(_(),X(ch,{copy:!0}))}}),mb=(t,e=0,i=!1)=>{let n;return(...s)=>{i&&!n&&t(...s),clearTimeout(n),n=setTimeout(()=>{t(...s)},e)}},uh=(t,e,i)=>{const n=U(t);return Oh((s,o)=>({get(){return s(),n.value},set:mb(r=>{n.value=r,o()},e,!1)}))},vb={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20"};function gb(t,e){return _(),C("svg",vb,[...e[0]||(e[0]=[f("path",{d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607"},null,-1)])])}const Qa={render:gb},_b={xmlns:"http://www.w3.org/2000/svg",fill:"none",class:"animate-spin p-0.5 h-5 w-5 text-white ml-auto",viewBox:"0 0 24 24"};function yb(t,e){return _(),C("svg",_b,[...e[0]||(e[0]=[f("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4",class:"opacity-25 stroke-blue-900"},null,-1),f("path",{fill:"currentColor",d:"M4 12a8 8 0 0 1 8-8V0C5.373 0 0 5.373 0 12zm2 5.291A7.96 7.96 0 0 1 4 12H0c0 3.042 1.135 5.824 3 7.938z",class:"opacity-75"},null,-1)])])}const go={render:yb},wb={class:"vuefinder__search-modal__search-input"},bb=["value","placeholder","disabled"],xb={key:0,class:"vuefinder__search-modal__loading"},Sb=fe({name:"SearchInput",__name:"SearchInput",props:{modelValue:{},isSearching:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue","keydown"],setup(t,{expose:e,emit:i}){const n=i,s=me(),{t:o}=s.i18n,r=U(null),l=c=>{const u=c.target;n("update:modelValue",u.value)},a=c=>{n("keydown",c)};return e({focus:()=>{r.value&&r.value.focus()}}),(c,u)=>(_(),C("div",wb,[ee(h(Qa),{class:"vuefinder__search-modal__search-icon"}),f("input",{ref_key:"searchInput",ref:r,value:t.modelValue,type:"text",placeholder:h(o)("Search files"),disabled:t.disabled,class:"vuefinder__search-modal__input",onKeydown:a,onKeyup:u[0]||(u[0]=Se(()=>{},["stop"])),onInput:l},null,40,bb),t.isSearching?(_(),C("div",xb,[ee(h(go),{class:"vuefinder__search-modal__loading-icon"})])):K("",!0)]))}}),kb={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24"};function Cb(t,e){return _(),C("svg",kb,[...e[0]||(e[0]=[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87q.11.06.22.127c.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a8 8 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a7 7 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a7 7 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a7 7 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124q.108-.066.22-.128c.332-.183.582-.495.644-.869z"},null,-1),f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0"},null,-1)])])}const dh={render:Cb},Eb=["disabled","title"],Ab=["data-theme"],Tb={class:"vuefinder__search-modal__dropdown-content"},Mb={class:"vuefinder__search-modal__dropdown-section"},Rb={class:"vuefinder__search-modal__dropdown-title"},Fb={class:"vuefinder__search-modal__dropdown-options"},$b={key:0,class:"vuefinder__search-modal__dropdown-option-check"},Ob={key:0,class:"vuefinder__search-modal__dropdown-option-check"},Pb={key:0,class:"vuefinder__search-modal__dropdown-option-check"},zb={key:0,class:"vuefinder__search-modal__dropdown-option-check"},Db=fe({name:"SearchOptionsDropdown",__name:"SearchOptionsDropdown",props:{visible:{type:Boolean},disabled:{type:Boolean,default:!1},sizeFilter:{},selectedOption:{}},emits:["update:visible","update:sizeFilter","update:selectedOption","keydown"],setup(t,{expose:e,emit:i}){const n=t,s=i,o=me(),{t:r}=o.i18n,l=U(null),a=U(null);let c=null;const u=g=>{if(s("update:selectedOption",g),g.startsWith("size-")){const y=g.split("-")[1];s("update:sizeFilter",y)}},d=async()=>{n.disabled||(n.visible?(s("update:visible",!1),c&&(c(),c=null)):(s("update:visible",!0),await lt(),await p()))},p=async()=>{if(!(!l.value||!a.value)&&(await lt(),!(!l.value||!a.value))){Object.assign(a.value.style,{position:"fixed",zIndex:"10001",opacity:"0",transform:"translateY(-8px)",transition:"opacity 150ms ease-out, transform 150ms ease-out"});try{const{x:g,y}=await Yi(l.value,a.value,{placement:"bottom-start",strategy:"fixed",middleware:[yn(8),bn({padding:16}),wn({padding:16})]});Object.assign(a.value.style,{left:`${g}px`,top:`${y}px`}),requestAnimationFrame(()=>{a.value&&Object.assign(a.value.style,{opacity:"1",transform:"translateY(0)"})})}catch(g){console.warn("Floating UI initial positioning error:",g);return}try{c=ea(l.value,a.value,async()=>{if(!(!l.value||!a.value))try{const{x:g,y}=await Yi(l.value,a.value,{placement:"bottom-start",strategy:"fixed",middleware:[yn(8),bn({padding:16}),wn({padding:16})]});Object.assign(a.value.style,{left:`${g}px`,top:`${y}px`})}catch(g){console.warn("Floating UI positioning error:",g)}})}catch(g){console.warn("Floating UI autoUpdate setup error:",g),c=null}}},v=g=>{if(!n.visible)return;const y=["size-all","size-small","size-medium","size-large"],S=y.findIndex(b=>b===n.selectedOption);if(g.key==="ArrowDown"){g.preventDefault();const b=(S+1)%y.length;s("update:selectedOption",y[b]||null)}else if(g.key==="ArrowUp"){g.preventDefault();const b=S<=0?y.length-1:S-1;s("update:selectedOption",y[b]||null)}else g.key==="Enter"?(g.preventDefault(),n.selectedOption?.startsWith("size-")&&s("update:sizeFilter",n.selectedOption.split("-")[1])):g.key==="Escape"&&(g.preventDefault(),s("update:visible",!1),c&&(c(),c=null))},m=()=>{c&&(c(),c=null)};return ve(()=>n.visible,g=>{!g&&c&&(c(),c=null)}),Ge(()=>{m()}),e({cleanup:m}),(g,y)=>(_(),C(_e,null,[f("button",{ref_key:"dropdownBtn",ref:l,class:ue(["vuefinder__search-modal__dropdown-btn",{"vuefinder__search-modal__dropdown-btn--active":t.visible}]),disabled:t.disabled,title:h(r)("Search Options"),onClick:Se(d,["stop"])},[ee(h(dh),{class:"vuefinder__search-modal__dropdown-icon"})],10,Eb),(_(),X(Hs,{to:"body"},[t.visible?(_(),C("div",{key:0,ref_key:"dropdownContent",ref:a,class:"vuefinder__themer vuefinder__search-modal__dropdown vuefinder__search-modal__dropdown--visible","data-theme":h(o).theme.current,tabindex:"-1",onClick:y[4]||(y[4]=Se(()=>{},["stop"])),onKeydown:v},[f("div",Tb,[f("div",Mb,[f("div",Rb,P(h(r)("File Size")),1),f("div",Fb,[f("div",{class:ue(["vuefinder__search-modal__dropdown-option",{"vuefinder__search-modal__dropdown-option--selected":t.sizeFilter==="all"}]),onClick:y[0]||(y[0]=Se(S=>u("size-all"),["stop"]))},[f("span",null,P(h(r)("All Files")),1),t.sizeFilter==="all"?(_(),C("div",$b,[...y[5]||(y[5]=[f("svg",{viewBox:"0 0 16 16",fill:"currentColor"},[f("path",{d:"M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"})],-1)])])):K("",!0)],2),f("div",{class:ue(["vuefinder__search-modal__dropdown-option",{"vuefinder__search-modal__dropdown-option--selected":t.sizeFilter==="small"}]),onClick:y[1]||(y[1]=Se(S=>u("size-small"),["stop"]))},[f("span",null,P(h(r)("Small (< 1MB)")),1),t.sizeFilter==="small"?(_(),C("div",Ob,[...y[6]||(y[6]=[f("svg",{viewBox:"0 0 16 16",fill:"currentColor"},[f("path",{d:"M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"})],-1)])])):K("",!0)],2),f("div",{class:ue(["vuefinder__search-modal__dropdown-option",{"vuefinder__search-modal__dropdown-option--selected":t.sizeFilter==="medium"}]),onClick:y[2]||(y[2]=Se(S=>u("size-medium"),["stop"]))},[f("span",null,P(h(r)("Medium (1-10MB)")),1),t.sizeFilter==="medium"?(_(),C("div",Pb,[...y[7]||(y[7]=[f("svg",{viewBox:"0 0 16 16",fill:"currentColor"},[f("path",{d:"M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"})],-1)])])):K("",!0)],2),f("div",{class:ue(["vuefinder__search-modal__dropdown-option",{"vuefinder__search-modal__dropdown-option--selected":t.sizeFilter==="large"}]),onClick:y[3]||(y[3]=Se(S=>u("size-large"),["stop"]))},[f("span",null,P(h(r)("Large (> 10MB)")),1),t.sizeFilter==="large"?(_(),C("div",zb,[...y[8]||(y[8]=[f("svg",{viewBox:"0 0 16 16",fill:"currentColor"},[f("path",{d:"M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"})],-1)])])):K("",!0)],2)])])])],40,Ab)):K("",!0)]))],64))}});function hh(t,e=40){const i=t.match(/^([^:]+:\/\/)(.*)$/);if(!i)return t;const n=i[1],s=i[2]??"",o=s.split("/").filter(Boolean),r=o.pop();if(!r)return n+s;let l=`${n}${o.join("/")}${o.length?"/":""}${r}`;if(l.length<=e)return l;const a=r.split(/\.(?=[^\.]+$)/),c=a[0]??"",u=a[1]??"",d=c.length>10?`${c.slice(0,6)}...${c.slice(-5)}`:c,p=u?`${d}.${u}`:d;return l=`${n}${o.join("/")}${o.length?"/":""}${p}`,l.length>e&&(l=`${n}.../${p}`),l}async function fh(t){try{await navigator.clipboard.writeText(t)}catch{const e=document.createElement("textarea");e.value=t,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}}async function Fn(t){await fh(t)}async function Ib(t){await fh(t)}const Lb={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 448 512"};function Bb(t,e){return _(),C("svg",Lb,[...e[0]||(e[0]=[f("path",{d:"M8 256a56 56 0 1 1 112 0 56 56 0 1 1-112 0m160 0a56 56 0 1 1 112 0 56 56 0 1 1-112 0m216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112"},null,-1)])])}const ph={render:Bb},Ub=["title"],jb={class:"vuefinder__search-modal__result-icon"},Hb={class:"vuefinder__search-modal__result-content"},Nb={class:"vuefinder__search-modal__result-name"},Vb={key:0,class:"vuefinder__search-modal__result-size"},qb=["title"],Wb=["title"],Qb=["data-item-dropdown","data-theme"],Kb={class:"vuefinder__search-modal__item-dropdown-content"},Yb=fe({name:"SearchResultItem",__name:"SearchResultItem",props:{item:{},index:{},selectedIndex:{},expandedPaths:{},activeDropdown:{},selectedItemDropdownOption:{}},emits:["select","selectWithDropdown","togglePathExpansion","toggleItemDropdown","update:selectedItemDropdownOption","copyPath","openContainingFolder","preview"],setup(t,{emit:e}){const i=t,n=e,s=me(),{t:o}=s.i18n,r=U(null);let l=null,a=null,c=[],u=null;ve(()=>i.activeDropdown,O=>{l&&(l(),l=null),a&&(c.forEach(F=>{F===window?window.removeEventListener("scroll",a,!0):F.removeEventListener("scroll",a,!0)}),a=null,c=[]),u&&(document.removeEventListener("mousedown",u,!0),document.removeEventListener("touchstart",u,!0),u=null),O===i.item.path&&r.value&<(()=>{S(i.item.path,r.value),p(),v()})});const d=O=>{const F=[];let j=O;for(;j&&j!==document.body&&j!==document.documentElement;){const R=window.getComputedStyle(j),T=R.overflow+R.overflowX+R.overflowY;(T.includes("scroll")||T.includes("auto"))&&F.push(j),j=j.parentElement}return F},p=()=>{if(i.activeDropdown!==i.item.path)return;const O=d(r.value);c=[window,...O],a=()=>{i.activeDropdown===i.item.path&&n("toggleItemDropdown",i.item.path,new MouseEvent("click"))};const F=a;F&&c.forEach(j=>{j===window?window.addEventListener("scroll",F,!0):j.addEventListener("scroll",F,!0)})},v=()=>{i.activeDropdown===i.item.path&&(u=O=>{if(i.activeDropdown!==i.item.path)return;const F=O.target;if(!F)return;const j=document.querySelector(`[data-item-dropdown="${i.item.path}"]`);if(j&&j.contains(F)||r.value&&r.value.contains(F))return;const R=s.root;if(R&&R.contains(F)){n("toggleItemDropdown",i.item.path,new MouseEvent("click"));return}const T=document.querySelector(".vuefinder__modal-layout");if(T&&T.contains(F)){n("toggleItemDropdown",i.item.path,new MouseEvent("click"));return}n("toggleItemDropdown",i.item.path,new MouseEvent("click"))},setTimeout(()=>{u&&(document.addEventListener("mousedown",u,!0),document.addEventListener("touchstart",u,!0))},100))};Ge(()=>{l&&(l(),l=null),a&&(c.forEach(O=>{O===window?window.removeEventListener("scroll",a,!0):O.removeEventListener("scroll",a,!0)}),a=null,c=[]),u&&(document.removeEventListener("mousedown",u,!0),document.removeEventListener("touchstart",u,!0),u=null)});const m=O=>i.expandedPaths.has(O),g=O=>O.type==="dir"||!O.file_size?"":Ba(O.file_size),y=(O,F)=>{F.stopPropagation(),n("toggleItemDropdown",O,F)},S=async(O,F)=>{const j=document.querySelector(`[data-item-dropdown="${O}"]`);if(!(!j||!F)&&(await lt(),!(!j||!F))){Object.assign(j.style,{position:"fixed",zIndex:"10001",opacity:"0",transform:"translateY(-8px)",transition:"opacity 150ms ease-out, transform 150ms ease-out"});try{const{x:R,y:T}=await Yi(F,j,{placement:"left-start",strategy:"fixed",middleware:[yn(8),bn({padding:16}),wn({padding:16})]});Object.assign(j.style,{left:`${R}px`,top:`${T}px`}),requestAnimationFrame(()=>{j&&Object.assign(j.style,{opacity:"1",transform:"translateY(0)"})})}catch(R){console.warn("Floating UI initial positioning error:",R);return}try{l=ea(F,j,async()=>{if(!(!F||!j))try{const{x:R,y:T}=await Yi(F,j,{placement:"left-start",strategy:"fixed",middleware:[yn(8),bn({padding:16}),wn({padding:16})]});Object.assign(j.style,{left:`${R}px`,top:`${T}px`})}catch(R){console.warn("Floating UI positioning error:",R)}})}catch(R){console.warn("Floating UI autoUpdate setup error:",R),l=null}}},b=O=>{n("update:selectedItemDropdownOption",O)},x=async O=>{await Fn(O.path),n("copyPath",O)},w=O=>{n("openContainingFolder",O)},k=O=>{n("preview",O)},E=O=>{if(!i.activeDropdown)return;const F=["copy-path","open-folder","preview"],j=i.selectedItemDropdownOption,R=F.findIndex(T=>j?.includes(T));if(O.key==="ArrowDown"){O.preventDefault();const T=(R+1)%F.length;n("update:selectedItemDropdownOption",`${F[T]||""}-${i.activeDropdown}`)}else if(O.key==="ArrowUp"){O.preventDefault();const T=R<=0?F.length-1:R-1;n("update:selectedItemDropdownOption",`${F[T]||""}-${i.activeDropdown}`)}else O.key==="Enter"?(O.preventDefault(),j&&(j.includes("copy-path")?x(i.item):j.includes("open-folder")?w(i.item):j.includes("preview")&&k(i.item))):O.key==="Escape"&&(O.preventDefault(),n("update:selectedItemDropdownOption",null))};return(O,F)=>(_(),C("div",{class:ue(["vuefinder__search-modal__result-item",{"vuefinder__search-modal__result-item--selected":t.index===t.selectedIndex}]),title:t.item.basename,onClick:F[9]||(F[9]=j=>n("select",t.index))},[f("div",jb,[t.item.type==="dir"?(_(),X(h(Wt),{key:0})):(_(),X(h(Rn),{key:1}))]),f("div",Hb,[f("div",Nb,[Me(P(t.item.basename)+" ",1),g(t.item)?(_(),C("span",Vb,P(g(t.item)),1)):K("",!0)]),f("div",{class:"vuefinder__search-modal__result-path",title:t.item.path,onClick:F[0]||(F[0]=Se(j=>{n("select",t.index),n("togglePathExpansion",t.item.path)},["stop"]))},P(m(t.item.path)?t.item.path:h(hh)(t.item.path)),9,qb)]),f("button",{ref_key:"buttonElementRef",ref:r,class:"vuefinder__search-modal__result-actions",title:h(o)("More actions"),onClick:F[1]||(F[1]=j=>{n("selectWithDropdown",t.index),y(t.item.path,j)})},[ee(h(ph),{class:"vuefinder__search-modal__result-actions-icon"})],8,Wb),(_(),X(Hs,{to:"body"},[t.activeDropdown===t.item.path?(_(),C("div",{key:0,"data-item-dropdown":t.item.path,class:"vuefinder__themer vuefinder__search-modal__item-dropdown vuefinder__search-modal__item-dropdown--visible","data-theme":h(s).theme.current,tabindex:"-1",onClick:F[8]||(F[8]=Se(()=>{},["stop"])),onKeydown:E},[f("div",Kb,[f("div",{class:ue(["vuefinder__search-modal__item-dropdown-option",{"vuefinder__search-modal__item-dropdown-option--selected":t.selectedItemDropdownOption===`copy-path-${t.item.path}`}]),onClick:F[2]||(F[2]=j=>{b(`copy-path-${t.item.path}`),x(t.item)}),onFocus:F[3]||(F[3]=j=>b(`copy-path-${t.item.path}`))},[ee(h(ja),{class:"vuefinder__search-modal__item-dropdown-icon"}),f("span",null,P(h(o)("Copy Path")),1)],34),f("div",{class:ue(["vuefinder__search-modal__item-dropdown-option",{"vuefinder__search-modal__item-dropdown-option--selected":t.selectedItemDropdownOption===`open-folder-${t.item.path}`}]),onClick:F[4]||(F[4]=j=>{b(`open-folder-${t.item.path}`),w(t.item)}),onFocus:F[5]||(F[5]=j=>b(`open-folder-${t.item.path}`))},[ee(h(Wt),{class:"vuefinder__search-modal__item-dropdown-icon"}),f("span",null,P(h(o)("Open Containing Folder")),1)],34),f("div",{class:ue(["vuefinder__search-modal__item-dropdown-option",{"vuefinder__search-modal__item-dropdown-option--selected":t.selectedItemDropdownOption===`preview-${t.item.path}`}]),onClick:F[6]||(F[6]=j=>{b(`preview-${t.item.path}`),k(t.item)}),onFocus:F[7]||(F[7]=j=>b(`preview-${t.item.path}`))},[ee(h(Rn),{class:"vuefinder__search-modal__item-dropdown-icon"}),f("span",null,P(h(o)("Preview")),1)],34)])],40,Qb)):K("",!0)]))],10,Ub))}}),Xb={key:0,class:"vuefinder__search-modal__searching"},Gb={class:"vuefinder__search-modal__loading-icon"},Jb={key:1,class:"vuefinder__search-modal__no-results"},Zb={key:2,class:"vuefinder__search-modal__results-list"},e1={class:"vuefinder__search-modal__results-header"},Ai=60,Dc=5,t1=fe({name:"SearchResultsList",__name:"SearchResultsList",props:{searchResults:{},isSearching:{type:Boolean},selectedIndex:{},expandedPaths:{},activeDropdown:{},selectedItemDropdownOption:{},resultsEnter:{type:Boolean}},emits:["selectResultItem","selectResultItemWithDropdown","togglePathExpansion","toggleItemDropdown","update:selectedItemDropdownOption","copyPath","openContainingFolder","preview"],setup(t,{expose:e,emit:i}){const n=t,s=i,o=me(),{t:r}=o.i18n,l=qi("scrollableContainer"),a=Z(()=>n.searchResults.length>0),c=Z(()=>n.searchResults.length),u=U(0),d=U(600),p=Z(()=>n.searchResults.length*Ai),v=Z(()=>{const x=Math.max(0,Math.floor(u.value/Ai)-Dc),w=Math.min(n.searchResults.length,Math.ceil((u.value+d.value)/Ai)+Dc);return{start:x,end:w}}),m=Z(()=>{const{start:x,end:w}=v.value;return n.searchResults.slice(x,w).map((k,E)=>({item:k,index:x+E,top:(x+E)*Ai}))}),g=x=>{const w=x.target;u.value=w.scrollTop},y=()=>{l.value&&(d.value=l.value.clientHeight)},S=()=>{if(n.selectedIndex>=0&&l.value){const x=n.selectedIndex*Ai,w=x+Ai,k=l.value.scrollTop,E=l.value.clientHeight,O=k+E;let F=k;x<k?F=x:w>O&&(F=w-E),F!==k&&l.value.scrollTo({top:F,behavior:"smooth"})}},b=()=>{l.value&&(l.value.scrollTop=0,u.value=0)};return Re(()=>{y(),window.addEventListener("resize",y)}),Ge(()=>{window.removeEventListener("resize",y)}),ve(()=>l.value,()=>{y()}),e({scrollSelectedIntoView:S,resetScroll:b,getContainerHeight:()=>d.value,scrollTop:()=>u.value}),(x,w)=>(_(),C("div",{class:ue(["vuefinder__search-modal__results",{"vuefinder__search-modal__results--enter":t.resultsEnter}])},[t.isSearching?(_(),C("div",Xb,[f("div",Gb,[ee(h(go),{class:"vuefinder__search-modal__loading-icon"})]),f("span",null,P(h(r)("Searching...")),1)])):a.value?(_(),C("div",Zb,[f("div",e1,[f("span",null,P(h(r)("Found %s results",c.value)),1)]),f("div",{ref_key:"scrollableContainer",ref:l,class:"vuefinder__search-modal__results-scrollable",onScroll:g},[f("div",{class:"vuefinder__search-modal__results-items",style:et({height:`${p.value}px`,position:"relative"})},[(_(!0),C(_e,null,$e(m.value,k=>(_(),C("div",{key:k.item.path,style:et({position:"absolute",top:`${k.top}px`,left:"0",width:"100%",height:`${Ai}px`})},[ee(Yb,{item:k.item,index:k.index,"selected-index":t.selectedIndex,"expanded-paths":t.expandedPaths,"active-dropdown":t.activeDropdown,"selected-item-dropdown-option":t.selectedItemDropdownOption,onSelect:w[0]||(w[0]=E=>s("selectResultItem",E)),onSelectWithDropdown:w[1]||(w[1]=E=>s("selectResultItemWithDropdown",E)),onTogglePathExpansion:w[2]||(w[2]=E=>s("togglePathExpansion",E)),onToggleItemDropdown:w[3]||(w[3]=(E,O)=>s("toggleItemDropdown",E,O)),"onUpdate:selectedItemDropdownOption":w[4]||(w[4]=E=>s("update:selectedItemDropdownOption",E)),onCopyPath:w[5]||(w[5]=E=>s("copyPath",E)),onOpenContainingFolder:w[6]||(w[6]=E=>s("openContainingFolder",E)),onPreview:w[7]||(w[7]=E=>s("preview",E))},null,8,["item","index","selected-index","expanded-paths","active-dropdown","selected-item-dropdown-option"])],4))),128))],4)],544)])):(_(),C("div",Jb,[f("span",null,P(h(r)("No results found")),1)]))],2))}}),i1={class:"vuefinder__search-modal"},n1={class:"vuefinder__search-modal__content"},s1={class:"vuefinder__search-modal__search-bar"},o1={class:"vuefinder__search-modal__search-location"},r1=["title"],a1=["disabled"],l1={key:0,class:"vuefinder__search-modal__folder-selector"},c1={class:"vuefinder__search-modal__folder-selector-content"},u1={key:1,class:"vuefinder__search-modal__instructions"},d1={class:"vuefinder__search-modal__instructions-text"},Ka=fe({name:"ModalSearch",__name:"ModalSearch",setup(t){const e=me(),i=ut(e),{t:n}=e.i18n,s=e.fs,o=U(null),r=U(null),l=U(null),a=uh("",300),c=U([]),u=U(!1),d=U(-1),p=U(!1),v=U(!1),m=U(null),g=U("all"),y=U(!1),S=U(`size-${g.value}`),b=U(null),x=U(new Set),w=U(null),k=ce(s.path),E=$=>{x.value.has($)?x.value.delete($):x.value.add($)},O=($,H)=>{H&&typeof H.stopPropagation=="function"&&H.stopPropagation(),w.value===$?w.value=null:w.value=$},F=()=>{w.value=null},j=$=>{try{const H=$.dir||`${$.storage}://`;e.adapter.open(H),e.modal.close(),F()}catch{i.error(n("Failed to open containing folder"))}},R=$=>{e.modal.open(Un,{storage:k?.value?.storage??"local",item:$}),F()},T=$=>{d.value=$,F()},D=$=>{d.value=$},M=async $=>{await Fn($.path),F()};ve(a,async $=>{$.trim()?(await I($.trim()),d.value=0):(c.value=[],u.value=!1,d.value=-1)}),ve(g,async $=>{S.value=`size-${$}`,a.value.trim()&&!v.value&&(await I(a.value.trim()),d.value=0)}),ve(y,async()=>{a.value.trim()&&!v.value&&(await I(a.value.trim()),d.value=0)});const I=async $=>{if($){u.value=!0;try{const H=m.value?.path||k?.value?.path,B=await e.adapter.search({path:H,filter:$,deep:y.value,size:g.value});c.value=B||[],u.value=!1}catch(H){i.error(ct(H,n("Search failed"))),c.value=[],u.value=!1}}};Re(()=>{document.addEventListener("click",z),S.value=`size-${g.value}`});const W=()=>{v.value?(v.value=!1,a.value.trim()&&(I(a.value.trim()),d.value=0)):(p.value=!1,v.value=!0)},J=$=>{$&&(m.value=$)},L=$=>{$&&(J($),v.value=!1,a.value.trim()&&(I(a.value.trim()),d.value=0))};Ge(()=>{document.removeEventListener("click",z),r.value&&r.value.cleanup()});const z=$=>{const H=$.target;if(p.value&&(H.closest(".vuefinder__search-modal__dropdown")||(p.value=!1,lt(()=>{o.value&&o.value.focus()}))),w.value){const B=H.closest(".vuefinder__search-modal__item-dropdown"),Q=H.closest(".vuefinder__search-modal__result-item");!B&&!Q&&F()}};return($,H)=>(_(),X(vt,{class:"vuefinder__search-modal-layout"},{default:he(()=>[f("div",i1,[ee(kt,{icon:h(Qa),title:h(n)("Search files")},null,8,["icon","title"]),f("div",n1,[f("div",s1,[ee(Sb,{ref_key:"searchInputRef",ref:o,modelValue:h(a),"onUpdate:modelValue":H[0]||(H[0]=B=>Xr(a)?a.value=B:null),"is-searching":u.value,disabled:v.value},null,8,["modelValue","is-searching","disabled"]),ee(Db,{ref_key:"searchOptionsDropdownRef",ref:r,visible:p.value,"onUpdate:visible":H[1]||(H[1]=B=>p.value=B),"size-filter":g.value,"onUpdate:sizeFilter":H[2]||(H[2]=B=>g.value=B),"selected-option":S.value,"onUpdate:selectedOption":H[3]||(H[3]=B=>S.value=B),disabled:v.value},null,8,["visible","size-filter","selected-option","disabled"])]),f("div",{class:"vuefinder__search-modal__options",onClick:H[7]||(H[7]=Se(()=>{},["stop"]))},[f("div",o1,[f("button",{class:ue(["vuefinder__search-modal__location-btn",{"vuefinder__search-modal__location-btn--open":v.value}]),onClick:Se(W,["stop"])},[ee(h(Wt),{class:"vuefinder__search-modal__location-icon"}),f("span",{class:"vuefinder__search-modal__location-text",title:m.value?.path||h(k).path},P(h(hh)(m.value?.path||h(k).path)),9,r1),H[10]||(H[10]=f("svg",{class:"vuefinder__search-modal__location-arrow",viewBox:"0 0 16 16",fill:"currentColor"},[f("path",{d:"M4.427 7.427l3.396 3.396a.25.25 0 00.354 0l3.396-3.396A.25.25 0 0011.396 7H4.604a.25.25 0 00-.177.427z"})],-1))],2)]),f("label",{class:"vuefinder__search-modal__deep-search",onClick:H[6]||(H[6]=Se(()=>{},["stop"]))},[ze(f("input",{"onUpdate:modelValue":H[4]||(H[4]=B=>y.value=B),type:"checkbox",disabled:v.value,class:"vuefinder__search-modal__checkbox",onClick:H[5]||(H[5]=Se(()=>{},["stop"]))},null,8,a1),[[Us,y.value]]),f("span",null,P(h(n)("Include subfolders")),1)])]),v.value?(_(),C("div",l1,[f("div",c1,[ee(qa,{modelValue:m.value,"onUpdate:modelValue":[H[8]||(H[8]=B=>m.value=B),J],"show-pinned-folders":!0,"current-path":h(k),onSelectAndClose:L},null,8,["modelValue","current-path"])])])):K("",!0),!h(a).trim()&&!v.value?(_(),C("div",u1,[f("p",d1,P(h(n)("Start typing to search files. Use options to filter or include subfolders.")),1)])):K("",!0),h(a).trim()&&!v.value?(_(),X(t1,{key:2,ref_key:"searchResultsListRef",ref:l,"search-results":c.value,"is-searching":u.value,"selected-index":d.value,"expanded-paths":x.value,"active-dropdown":w.value,"selected-item-dropdown-option":b.value,"results-enter":!0,onSelectResultItem:T,onSelectResultItemWithDropdown:D,onTogglePathExpansion:E,onToggleItemDropdown:O,"onUpdate:selectedItemDropdownOption":H[9]||(H[9]=B=>b.value=B),onCopyPath:M,onOpenContainingFolder:j,onPreview:R},null,8,["search-results","is-searching","selected-index","expanded-paths","active-dropdown","selected-item-dropdown-option"])):K("",!0)])])]),_:1}))}}),h1={props:{on:{type:String,required:!0}},setup(t,{emit:e,slots:i}){const n=me(),s=U(!1),{t:o}=n.i18n;let r=null;const l=()=>{r&&clearTimeout(r),s.value=!0,r=setTimeout(()=>{s.value=!1},2e3)};return Re(()=>{n.emitter.on(t.on,l)}),Ge(()=>{r&&clearTimeout(r)}),{shown:s,t:o}}},f1=(t,e)=>{const i=t.__vccOpts||t;for(const[n,s]of e)i[n]=s;return i},p1={key:1};function m1(t,e,i,n,s,o){return _(),C("div",{class:ue(["vuefinder__action-message",{"vuefinder__action-message--hidden":!n.shown}])},[t.$slots.default?xe(t.$slots,"default",{key:0}):(_(),C("span",p1,P(n.t("Saved.")),1))],2)}const Ic=f1(h1,[["render",m1]]),v1=[{name:"silver",displayName:"Silver"},{name:"valorite",displayName:"Valorite"},{name:"midnight",displayName:"Midnight"},{name:"latte",displayName:"Latte"},{name:"rose",displayName:"Rose"},{name:"mythril",displayName:"Mythril"},{name:"lime",displayName:"lime"},{name:"sky",displayName:"Sky"},{name:"ocean",displayName:"Oceanic"},{name:"palenight",displayName:"Palenight"},{name:"arctic",displayName:"Arctic"},{name:"code",displayName:"Code"}],g1={class:"vuefinder__settings-modal__content"},_1={class:"vuefinder__settings-modal__main"},y1={class:"vuefinder__settings-modal__sections"},w1={key:0,class:"vuefinder__settings-modal__section"},b1={for:"theme",class:"vuefinder__settings-modal__label"},x1={class:"vuefinder__settings-modal__input-group"},S1=["value"],k1=["value"],C1={key:1,class:"vuefinder__settings-modal__section"},E1={for:"language",class:"vuefinder__settings-modal__label"},A1={class:"vuefinder__settings-modal__input-group"},T1=["value"],M1={class:"vuefinder__settings-modal__reset-section"},R1={class:"vuefinder__settings-modal__reset-content"},F1={class:"vuefinder__settings-modal__reset-title"},$1={class:"vuefinder__settings-modal__reset-description"},mh=fe({__name:"ModalSettings",setup(t){const e=me(),{enabled:i}=It(),n=e.config,{clearStore:s}=e.storage,{t:o,localeAtom:r}=e.i18n,l=ce(r),a=Z({get:()=>String(l.value||"en"),set:g=>r.set(g||"en")}),c=ce(n.state),u=Z(()=>c.value.theme||"silver"),d=async()=>{n.reset(),s(),localStorage.removeItem("vuefinder_locale"),localStorage.removeItem("vuefinder_translations"),location.reload()},p=g=>{n.set("theme",g),e.emitter.emit("vf-theme-saved")},{i18n:v}=ks("VueFinderOptions"),m=Object.fromEntries(Object.entries({ar:"Arabic (العربيّة)",zhCN:"Chinese-Simplified (简体中文)",zhTW:"Chinese-Traditional (繁體中文)",nl:"Dutch (Nederlands)",en:"English",fr:"French (Français)",de:"German (Deutsch)",he:"Hebrew (עִברִית)",hi:"Hindi (हिंदी)",it:"Italian (Italiano)",ja:"Japanese (日本語)",fa:"Persian (فارسی)",pl:"Polish (Polski)",pt:"Portuguese (Português)",ru:"Russian (Pусский)",es:"Spanish (Español)",sv:"Swedish (Svenska)",tr:"Turkish (Türkçe)"}).filter(([g])=>Object.keys(v).includes(g)));return(g,y)=>(_(),X(vt,null,{buttons:he(()=>[f("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:y[2]||(y[2]=S=>h(e).modal.close())},P(h(o)("Close")),1)]),default:he(()=>[f("div",g1,[ee(kt,{icon:h(dh),title:h(o)("Settings")},null,8,["icon","title"]),f("div",_1,[f("div",y1,[h(i)("theme")?(_(),C("div",w1,[f("label",b1,[Me(P(h(o)("Theme"))+" ",1),ee(Ic,{class:"vuefinder__settings-modal__message",on:"vf-theme-saved"},{default:he(()=>[Me(P(h(o)("Saved.")),1)]),_:1})]),f("div",x1,[f("select",{id:"theme",value:u.value,class:"vuefinder__settings-modal__select",onChange:y[0]||(y[0]=S=>p(S.target?.value))},[(_(!0),C(_e,null,$e(h(v1),S=>(_(),C("option",{key:S.name,value:S.name},P(S.displayName),9,k1))),128))],40,S1)])])):K("",!0),Object.keys(h(m)).length>1?(_(),C("div",C1,[f("label",E1,[Me(P(h(o)("Language"))+" ",1),ee(Ic,{class:"vuefinder__settings-modal__message",on:"vf-language-saved"},{default:he(()=>[Me(P(h(o)("Saved.")),1)]),_:1})]),f("div",A1,[ze(f("select",{id:"language","onUpdate:modelValue":y[1]||(y[1]=S=>a.value=S),class:"vuefinder__settings-modal__select"},[(_(!0),C(_e,null,$e(h(m),(S,b)=>(_(),C("option",{key:b,value:b},P(S),9,T1))),128))],512),[[ur,a.value]])])])):K("",!0)]),f("div",M1,[f("div",R1,[f("div",F1,P(h(o)("Reset")),1),f("div",$1,P(h(o)("Reset all settings to default")),1)]),f("button",{type:"button",class:"vuefinder__settings-modal__reset-button",onClick:d},P(h(o)("Reset Settings")),1)])])])]),_:1}))}}),it={ESCAPE:"Escape",DELETE:"Delete",ENTER:"Enter",BACKSLASH:"Backslash",KEY_A:"KeyA",KEY_E:"KeyE",KEY_F:"KeyF",SPACE:"Space",KEY_C:"KeyC",KEY_X:"KeyX",KEY_V:"KeyV",KEY_S:"KeyS",KEY_R:"KeyR"};function O1(){const t=me(),e=ut(t),i=t.fs,n=t.config,{enabled:s}=It(),o=ce(i.path),r=ce(i.selectedItems),l=a=>{if(a.code===it.ESCAPE&&(t.modal.close(),t.root.focus()),!t.modal.visible){if(a.metaKey&&a.code===it.KEY_R&&!a.shiftKey&&(t.adapter.invalidateListQuery(o.value.path),t.adapter.open(o.value.path),a.preventDefault()),a.metaKey&&a.shiftKey&&a.code===it.KEY_R&&s("rename")&&r.value.length===1&&(t.modal.open(po,{items:r.value}),a.preventDefault()),a.code===it.DELETE&&r.value.length!==0&&t.modal.open(fo,{items:r.value}),a.metaKey&&a.code===it.BACKSLASH&&t.modal.open(oh),a.metaKey&&a.code===it.KEY_F&&s("search")&&(t.modal.open(Ka),a.preventDefault()),a.metaKey&&a.code===it.KEY_E&&(n.toggle("showTreeView"),a.preventDefault()),a.metaKey&&a.code===it.KEY_S&&(t.modal.open(mh),a.preventDefault()),a.metaKey&&a.code===it.ENTER&&(n.toggle("fullScreen"),t.root.focus()),a.metaKey&&a.code===it.KEY_A&&(i.selectAll(t.selectionMode||"multiple",t),a.preventDefault()),a.code===it.SPACE&&r.value.length===1&&r.value[0]?.type!=="dir"&&t.modal.open(Un,{storage:i.path.get().storage,item:r.value[0]}),a.metaKey&&a.code===it.KEY_C&&s("copy")){if(r.value.length===0){e.error(t.i18n.t("No items selected"));return}i.setClipboard("copy",new Set(r.value.map(c=>c.path))),e.success(r.value.length===1?t.i18n.t("Item copied to clipboard"):t.i18n.t("%s items copied to clipboard",r.value.length)),a.preventDefault()}if(a.metaKey&&a.code===it.KEY_X&&s("copy")){if(r.value.length===0){e.error(t.i18n.t("No items selected"));return}i.setClipboard("cut",new Set(r.value.map(c=>c.path))),e.success(r.value.length===1?t.i18n.t("Item cut to clipboard"):t.i18n.t("%s items cut to clipboard",r.value.length)),a.preventDefault()}if(a.metaKey&&a.code===it.KEY_V&&s("copy")){if(i.getClipboard().items.size===0){e.error(t.i18n.t("No items in clipboard"));return}if(i.getClipboard().path===i.path.get().path){e.error(t.i18n.t("Cannot paste items to the same directory"));return}if(i.getClipboard().type==="cut"){t.modal.open(sn,{items:{from:Array.from(i.getClipboard().items),to:i.path.get()}}),i.clearClipboard();return}if(i.getClipboard().type==="copy"){t.modal.open(Wa,{items:{from:Array.from(i.getClipboard().items),to:i.path.get()}});return}a.preventDefault()}}};Re(async()=>{if(await lt(),!t.root){console.warn("app.root is not available. Event listeners will not be attached.");return}t.root.addEventListener("keydown",l)}),Yr(()=>{t.root&&t.root.removeEventListener("keydown",l)})}function P1(){const t=U(!1),e=U([]);return{isDraggingExternal:t,externalFiles:e,handleDragEnter:i=>{i.preventDefault(),i.stopPropagation();const n=i.dataTransfer?.items;n&&Array.from(n).some(s=>s.kind==="file")&&(t.value=!0,i.isExternalDrag=!0)},handleDragOver:i=>{t.value&&i.dataTransfer&&(i.dataTransfer.dropEffect="copy",i.preventDefault(),i.stopPropagation())},handleDragLeave:i=>{i.preventDefault();const n=i.currentTarget.getBoundingClientRect(),s=i.clientX,o=i.clientY;(s<n.left||s>n.right||o<n.top||o>n.bottom)&&(t.value=!1)},handleDrop:async i=>{i.preventDefault(),i.stopPropagation(),t.value=!1;const n=i.dataTransfer?.items;if(n){const s=Array.from(n).filter(o=>o.kind==="file");if(s.length>0){e.value=[];for(const o of s){const r=o.webkitGetAsEntry?.();if(r)await Ua((l,a)=>{e.value.push({name:a.name,size:a.size,type:a.type,lastModified:new Date(a.lastModified),file:a})},r);else{const l=o.getAsFile();l&&e.value.push({name:l.name,size:l.size,type:l.type,lastModified:new Date(l.lastModified),file:l})}}return e.value}}return[]},clearExternalFiles:()=>{e.value=[]}}}const z1={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"};function D1(t,e){return _(),C("svg",z1,[...e[0]||(e[0]=[f("path",{d:"M12 10.5v6m3-3H9m4.06-7.19-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44z"},null,-1)])])}const vh={render:D1},I1={class:"vuefinder__new-folder-modal__content"},L1={class:"vuefinder__new-folder-modal__form"},B1={class:"vuefinder__new-folder-modal__description"},U1=["placeholder"],Ya=fe({__name:"ModalNewFolder",setup(t){const e=me(),i=ut(e),{t:n}=e.i18n,s=e.fs,o=ce(s.path),r=U(""),l=()=>{r.value!==""&&e.adapter.createFolder({path:o.value.path,name:r.value}).then(a=>{i.success(n("%s is created.",r.value)),e.fs.setFiles(a.files),e.modal.close()}).catch(a=>{i.error(ct(a,n("Failed to create folder")))})};return(a,c)=>(_(),X(vt,null,{buttons:he(()=>[f("button",{type:"button",class:"vf-btn vf-btn-primary",onClick:l},P(h(n)("Create")),1),f("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:c[1]||(c[1]=u=>h(e).modal.close())},P(h(n)("Cancel")),1)]),default:he(()=>[f("div",null,[ee(kt,{icon:h(vh),title:h(n)("New Folder")},null,8,["icon","title"]),f("div",I1,[f("div",L1,[f("p",B1,P(h(n)("Create a new folder")),1),ze(f("input",{"onUpdate:modelValue":c[0]||(c[0]=u=>r.value=u),class:"vuefinder__new-folder-modal__input",placeholder:h(n)("Folder Name"),type:"text",autofocus:"",onKeyup:On(l,["enter"])},null,40,U1),[[$n,r.value]])])])])]),_:1}))}}),j1={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"};function H1(t,e){return _(),C("svg",j1,[...e[0]||(e[0]=[f("path",{d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m3.75 9v6m3-3H9m1.5-12H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9"},null,-1)])])}const gh={render:H1},N1={class:"vuefinder__new-file-modal__content"},V1={class:"vuefinder__new-file-modal__form"},q1={class:"vuefinder__new-file-modal__description"},W1=["placeholder"],_h=fe({__name:"ModalNewFile",setup(t){const e=me(),i=ut(e),{t:n}=e.i18n,s=e.fs,o=ce(s.path),r=U(""),l=()=>{r.value!==""&&e.adapter.createFile({path:o.value.path,name:r.value}).then(a=>{i.success(n("%s is created.",r.value)),e.fs.setFiles(a.files),e.modal.close()}).catch(a=>{i.error(ct(a,n("Failed to create file")))})};return(a,c)=>(_(),X(vt,null,{buttons:he(()=>[f("button",{type:"button",class:"vf-btn vf-btn-primary",onClick:l},P(h(n)("Create")),1),f("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:c[1]||(c[1]=u=>h(e).modal.close())},P(h(n)("Cancel")),1)]),default:he(()=>[f("div",null,[ee(kt,{icon:h(gh),title:h(n)("New File")},null,8,["icon","title"]),f("div",N1,[f("div",V1,[f("p",q1,P(h(n)("Create a new file")),1),ze(f("input",{"onUpdate:modelValue":c[0]||(c[0]=u=>r.value=u),class:"vuefinder__new-file-modal__input",placeholder:h(n)("File Name"),type:"text",onKeyup:On(l,["enter"])},null,40,W1),[[$n,r.value]])])])])]),_:1}))}}),Q1={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"};function K1(t,e){return _(),C("svg",Q1,[...e[0]||(e[0]=[f("path",{d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"},null,-1)])])}const yh={render:K1};function Wr(t,e=14){const i=`((?=([\\w\\W]{0,${e}}))([\\w\\W]{${e+1},})([\\w\\W]{8,}))`;return t.replace(new RegExp(i),"$2..$4")}const Y1={class:"vuefinder__upload-modal__content relative"},X1={class:"vuefinder__upload-modal__target-section"},G1={class:"vuefinder__upload-modal__target-label"},J1={class:"vuefinder__upload-modal__target-container"},Z1={class:"vuefinder__upload-modal__target-path"},e2={class:"vuefinder__upload-modal__target-storage"},t2={key:0,class:"vuefinder__upload-modal__target-folder"},i2={class:"vuefinder__upload-modal__target-badge"},n2={class:"vuefinder__upload-modal__drag-hint"},s2={class:"vuefinder__upload-modal__file-list vf-scrollbar"},o2=["textContent"],r2={class:"vuefinder__upload-modal__file-info"},a2={class:"vuefinder__upload-modal__file-name hidden md:block"},l2={class:"vuefinder__upload-modal__file-name md:hidden"},c2={key:0,class:"ml-auto"},u2=["title","disabled","onClick"],d2={key:0,class:"py-2"},h2=["aria-expanded"],f2={key:0,class:"vuefinder__upload-actions__menu absolute right-0 bottom-full left-0 mb-2"},p2=["disabled"],m2=["aria-expanded"],v2={key:0,class:"vuefinder__upload-actions__menu"},Xa=fe({__name:"ModalUpload",setup(t){const e=me(),{t:i}=e.i18n,n=e.fs,s=ce(n.path),o=U(s.value),r=U(!1),l=()=>{const L=o.value.path;if(!L)return{storage:"local",path:""};if(L.endsWith("://"))return{storage:L.replace("://",""),path:""};const z=L.split("://");return{storage:z[0]||"local",path:z[1]||""}},a=L=>{L&&(o.value=L)},c=L=>{L&&(o.value=L,r.value=!1)},{container:u,internalFileInput:d,internalFolderInput:p,pickFiles:v,queue:m,message:g,uploading:y,hasFilesInDropArea:S,definitions:b,openFileSelector:x,upload:w,cancel:k,remove:E,clear:O,close:F,getClassNameForEntry:j,getIconForEntry:R,addExternalFiles:T}=lh(e.customUploader),D=()=>{w(o.value)};Re(()=>{e.emitter.on("vf-external-files-dropped",L=>{T(L)})}),Ge(()=>{e.emitter.off("vf-external-files-dropped")});const M=U(!1),I=U(null),W=U(null),J=L=>{if(!M.value)return;const z=L.target,$=I.value?.contains(z)??!1,H=W.value?.contains(z)??!1;!$&&!H&&(M.value=!1)};return Re(()=>document.addEventListener("click",J)),Ge(()=>document.removeEventListener("click",J)),(L,z)=>(_(),X(vt,{"show-drag-overlay":h(S),"drag-overlay-text":h(i)("Drag and drop the files/folders to here.")},{buttons:he(()=>[f("div",{ref_key:"actionsMenuMobileRef",ref:I,class:"relative mb-2 w-full sm:hidden"},[f("div",{class:ue(["vuefinder__upload-actions","vuefinder__upload-actions--block",M.value?"vuefinder__upload-actions--ring":""])},[f("button",{type:"button",class:"vuefinder__upload-actions__main",onClick:z[3]||(z[3]=$=>h(x)())},P(h(i)("Select Files")),1),f("button",{type:"button",class:"vuefinder__upload-actions__trigger","aria-haspopup":"menu","aria-expanded":M.value?"true":"false",onClick:z[4]||(z[4]=Se($=>M.value=!M.value,["stop"]))},[...z[17]||(z[17]=[f("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor"},[f("path",{"fill-rule":"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.06 1.06l-4.24 4.24a.75.75 0 01-1.06 0L5.21 8.29a.75.75 0 01.02-1.08z","clip-rule":"evenodd"})],-1)])],8,h2)],2),M.value?(_(),C("div",f2,[f("div",{class:"vuefinder__upload-actions__item",onClick:z[5]||(z[5]=$=>{h(x)(),M.value=!1})},P(h(i)("Select Files")),1),f("div",{class:"vuefinder__upload-actions__item",onClick:z[6]||(z[6]=$=>{h(p)?.click(),M.value=!1})},P(h(i)("Select Folders")),1),z[18]||(z[18]=f("div",{class:"vuefinder__upload-actions__separator"},null,-1)),f("div",{class:ue(["vuefinder__upload-actions__item",h(y)?"disabled":""]),onClick:z[7]||(z[7]=$=>h(y)?null:(h(O)(!1),M.value=!1))},P(h(i)("Clear all")),3),f("div",{class:ue(["vuefinder__upload-actions__item",h(y)?"disabled":""]),onClick:z[8]||(z[8]=$=>h(y)?null:(h(O)(!0),M.value=!1))},P(h(i)("Clear only successful")),3)])):K("",!0)],512),f("button",{type:"button",class:"vf-btn vf-btn-primary",disabled:h(y)||!h(m).length,onClick:Se(D,["prevent"])},P(h(i)("Upload")),9,p2),h(y)?(_(),C("button",{key:0,type:"button",class:"vf-btn vf-btn-secondary",onClick:z[9]||(z[9]=Se((...$)=>h(k)&&h(k)(...$),["prevent"]))},P(h(i)("Cancel")),1)):(_(),C("button",{key:1,type:"button",class:"vf-btn vf-btn-secondary",onClick:z[10]||(z[10]=Se((...$)=>h(F)&&h(F)(...$),["prevent"]))},P(h(i)("Close")),1)),f("div",{ref_key:"actionsMenuDesktopRef",ref:W,class:"relative mr-auto hidden sm:block"},[f("div",{class:ue(["vuefinder__upload-actions",M.value?"vuefinder__upload-actions--ring":""])},[f("button",{ref_key:"pickFiles",ref:v,type:"button",class:"vuefinder__upload-actions__main"},P(h(i)("Select Files")),513),f("button",{type:"button",class:"vuefinder__upload-actions__trigger","aria-haspopup":"menu","aria-expanded":M.value?"true":"false",onClick:z[11]||(z[11]=Se($=>M.value=!M.value,["stop"]))},[...z[19]||(z[19]=[f("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor"},[f("path",{"fill-rule":"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.06 1.06l-4.24 4.24a.75.75 0 01-1.06 0L5.21 8.29a.75.75 0 01.02-1.08z","clip-rule":"evenodd"})],-1)])],8,m2)],2),M.value?(_(),C("div",v2,[f("div",{class:"vuefinder__upload-actions__item",onClick:z[12]||(z[12]=$=>{h(x)(),M.value=!1})},P(h(i)("Select Files")),1),f("div",{class:"vuefinder__upload-actions__item",onClick:z[13]||(z[13]=$=>{h(p)?.click(),M.value=!1})},P(h(i)("Select Folders")),1),z[20]||(z[20]=f("div",{class:"vuefinder__upload-actions__separator"},null,-1)),f("div",{class:ue(["vuefinder__upload-actions__item",h(y)?"disabled":""]),onClick:z[14]||(z[14]=$=>h(y)?null:(h(O)(!1),M.value=!1))},P(h(i)("Clear all")),3),f("div",{class:ue(["vuefinder__upload-actions__item",h(y)?"disabled":""]),onClick:z[15]||(z[15]=$=>h(y)?null:(h(O)(!0),M.value=!1))},P(h(i)("Clear only successful")),3)])):K("",!0)],512)]),default:he(()=>[f("div",null,[ee(kt,{icon:h(yh),title:h(i)("Upload Files")},null,8,["icon","title"]),f("div",Y1,[f("div",X1,[f("div",G1,P(h(i)("Target Directory")),1),f("div",J1,[f("div",{class:"vuefinder__upload-modal__target-display",onClick:z[0]||(z[0]=$=>r.value=!r.value)},[f("div",Z1,[f("span",e2,P(l().storage)+"://",1),l().path?(_(),C("span",t2,P(l().path),1)):K("",!0)]),f("span",i2,P(h(i)("Browse")),1)])]),f("div",{class:ue(["vuefinder__upload-modal__tree-selector",r.value?"vuefinder__upload-modal__tree-selector--expanded":"vuefinder__upload-modal__tree-selector--collapsed"])},[ee(qa,{modelValue:o.value,"onUpdate:modelValue":[z[1]||(z[1]=$=>o.value=$),a],"show-pinned-folders":!0,onSelectAndClose:c},null,8,["modelValue"])],2)]),f("div",n2,P(h(i)("You can drag & drop files anywhere while this modal is open.")),1),f("div",{ref_key:"container",ref:u,class:"hidden"},null,512),f("div",s2,[(_(!0),C(_e,null,$e(h(m),$=>(_(),C("div",{key:$.id,class:"vuefinder__upload-modal__file-entry"},[f("span",{class:ue(["vuefinder__upload-modal__file-icon",h(j)($)])},[f("span",{class:"vuefinder__upload-modal__file-icon-text",textContent:P(h(R)($))},null,8,o2)],2),f("div",r2,[f("div",a2,P(h(Wr)($.name,40))+" ("+P($.size)+") ",1),f("div",l2,P(h(Wr)($.name,16))+" ("+P($.size)+") ",1),f("div",{class:ue(["vuefinder__upload-modal__file-status",h(j)($)])},[Me(P($.statusName)+" ",1),$.status===h(b).QUEUE_ENTRY_STATUS.UPLOADING?(_(),C("b",c2,P($.percent),1)):K("",!0)],2)]),f("button",{type:"button",class:ue(["vuefinder__upload-modal__file-remove",h(y)?"disabled":""]),title:h(i)("Delete"),disabled:h(y),onClick:H=>h(E)($)},[...z[16]||(z[16]=[f("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"vuefinder__upload-modal__file-remove-icon"},[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)])],10,u2)]))),128)),h(m).length?K("",!0):(_(),C("div",d2,P(h(i)("No files selected!")),1))]),h(g).length?(_(),X(qr,{key:0,error:"",onHidden:z[2]||(z[2]=$=>g.value="")},{default:he(()=>[Me(P(h(g)),1)]),_:1})):K("",!0)])]),f("input",{ref_key:"internalFileInput",ref:d,type:"file",multiple:"",class:"hidden"},null,512),f("input",{ref_key:"internalFolderInput",ref:p,type:"file",multiple:"",webkitdirectory:"",class:"hidden"},null,512)]),_:1},8,["show-drag-overlay","drag-overlay-text"]))}}),g2={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"};function _2(t,e){return _(),C("svg",g2,[...e[0]||(e[0]=[f("path",{d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5m6 4.125 2.25 2.25m0 0 2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125"},null,-1)])])}const wh={render:_2},y2={class:"vuefinder__unarchive-modal__content"},w2={class:"vuefinder__unarchive-modal__items"},b2={key:0,class:"vuefinder__unarchive-modal__icon vuefinder__unarchive-modal__icon--dir",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},x2={key:1,class:"vuefinder__unarchive-modal__icon vuefinder__unarchive-modal__icon--file",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},S2={class:"vuefinder__unarchive-modal__item-name"},k2={class:"vuefinder__unarchive-modal__info"},Ga=fe({__name:"ModalUnarchive",setup(t){const e=me(),i=ut(e),n=e.fs,s=ce(n.path),{t:o}=e.i18n,r=U(e.modal.data.items[0]),l=U([]),a=()=>{e.adapter.unarchive({item:r.value.path,path:s.value.path}).then(c=>{i.success(o("The file unarchived.")),e.fs.setFiles(c.files),e.modal.close()}).catch(c=>{i.error(ct(c,o("Failed to unarchive")))})};return(c,u)=>(_(),X(vt,null,{buttons:he(()=>[f("button",{type:"button",class:"vf-btn vf-btn-primary",onClick:a},P(h(o)("Unarchive")),1),f("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:u[0]||(u[0]=d=>h(e).modal.close())},P(h(o)("Cancel")),1)]),default:he(()=>[f("div",null,[ee(kt,{icon:h(wh),title:h(o)("Unarchive")},null,8,["icon","title"]),f("div",y2,[f("div",w2,[(_(!0),C(_e,null,$e(l.value,d=>(_(),C("p",{key:d.path,class:"vuefinder__unarchive-modal__item"},[d.type==="dir"?(_(),C("svg",b2,[...u[1]||(u[1]=[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)])])):(_(),C("svg",x2,[...u[2]||(u[2]=[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)])])),f("span",S2,P(d.basename),1)]))),128)),f("p",k2,P(h(o)("The archive will be unarchived at"))+" ("+P(h(s).path)+") ",1)])])])]),_:1}))}}),C2={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",viewBox:"0 0 24 24"};function E2(t,e){return _(),C("svg",C2,[...e[0]||(e[0]=[f("path",{d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125"},null,-1)])])}const bh={render:E2},A2={class:"vuefinder__archive-modal__content"},T2={class:"vuefinder__archive-modal__form"},M2={class:"vuefinder__archive-modal__files vf-scrollbar"},R2={key:0,class:"vuefinder__archive-modal__icon vuefinder__archive-modal__icon--dir",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},F2={key:1,class:"vuefinder__archive-modal__icon",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1"},$2={class:"vuefinder__archive-modal__file-name"},O2=["placeholder"],Ja=fe({__name:"ModalArchive",setup(t){const e=me(),i=ut(e),{t:n}=e.i18n,s=e.fs,o=ce(s.path),r=U(""),l=U(e.modal.data.items),a=()=>{l.value.length&&e.adapter.archive({path:o.value.path,items:l.value.map(({path:c,type:u})=>({path:c,type:u})),name:r.value}).then(c=>{i.success(n("The file(s) archived.")),e.fs.setFiles(c.files),e.modal.close()}).catch(c=>{i.error(ct(c,n("Failed to archive files")))})};return(c,u)=>(_(),X(vt,null,{buttons:he(()=>[f("button",{type:"button",class:"vf-btn vf-btn-primary",onClick:a},P(h(n)("Archive")),1),f("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:u[1]||(u[1]=d=>h(e).modal.close())},P(h(n)("Cancel")),1)]),default:he(()=>[f("div",null,[ee(kt,{icon:h(bh),title:h(n)("Archive the files")},null,8,["icon","title"]),f("div",A2,[f("div",T2,[f("div",M2,[(_(!0),C(_e,null,$e(l.value,d=>(_(),C("p",{key:d.path,class:"vuefinder__archive-modal__file"},[d.type==="dir"?(_(),C("svg",R2,[...u[2]||(u[2]=[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},null,-1)])])):(_(),C("svg",F2,[...u[3]||(u[3]=[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"},null,-1)])])),f("span",$2,P(d.basename),1)]))),128))]),ze(f("input",{"onUpdate:modelValue":u[0]||(u[0]=d=>r.value=d),class:"vuefinder__archive-modal__input",placeholder:h(n)("Archive name. (.zip file will be created)"),type:"text",onKeyup:On(a,["enter"])},null,40,O2),[[$n,r.value]])])])])]),_:1}))}}),P2={class:"vuefinder__about-modal__content"},z2={class:"vuefinder__about-modal__main"},D2={class:"vuefinder__about-modal__shortcuts"},I2={class:"vuefinder__about-modal__shortcut"},L2={key:0,class:"vuefinder__about-modal__shortcut"},B2={key:1,class:"vuefinder__about-modal__shortcut"},U2={class:"vuefinder__about-modal__shortcut"},j2={class:"vuefinder__about-modal__shortcut"},H2={key:2,class:"vuefinder__about-modal__shortcut"},N2={key:3,class:"vuefinder__about-modal__shortcut"},V2={key:4,class:"vuefinder__about-modal__shortcut"},q2={key:5,class:"vuefinder__about-modal__shortcut"},W2={class:"vuefinder__about-modal__shortcut"},Q2={class:"vuefinder__about-modal__shortcut"},K2={key:6,class:"vuefinder__about-modal__shortcut"},Y2={key:7,class:"vuefinder__about-modal__shortcut"},X2=fe({__name:"ModalShortcuts",setup(t){const e=me(),{enabled:i}=It(),{t:n}=e.i18n;return(s,o)=>(_(),X(vt,null,{buttons:he(()=>[f("button",{type:"button",class:"vf-btn vf-btn-secondary",onClick:o[0]||(o[0]=r=>h(e).modal.close())},P(h(n)("Close")),1)]),default:he(()=>[f("div",P2,[ee(kt,{icon:h(sh),title:h(n)("Shortcuts")},null,8,["icon","title"]),f("div",z2,[f("div",D2,[f("div",I2,[f("div",null,P(h(n)("Refresh")),1),o[1]||(o[1]=f("div",null,[f("kbd",null,"⌘"),Me(" + "),f("kbd",null,"R")],-1))]),h(i)("rename")?(_(),C("div",L2,[f("div",null,P(h(n)("Rename")),1),o[2]||(o[2]=f("div",null,[f("kbd",null,"⌘"),Me(" + "),f("kbd",null,"Shift"),Me(" + "),f("kbd",null,"R")],-1))])):K("",!0),h(i)("delete")?(_(),C("div",B2,[f("div",null,P(h(n)("Delete")),1),o[3]||(o[3]=f("kbd",null,"Del",-1))])):K("",!0),f("div",U2,[f("div",null,P(h(n)("Escape")),1),o[4]||(o[4]=f("kbd",null,"Esc",-1))]),f("div",j2,[f("div",null,P(h(n)("Select All")),1),o[5]||(o[5]=f("div",null,[f("kbd",null,"⌘"),Me(" + "),f("kbd",null,"A")],-1))]),h(i)("copy")?(_(),C("div",H2,[f("div",null,P(h(n)("Cut")),1),o[6]||(o[6]=f("div",null,[f("kbd",null,"⌘"),Me(" + "),f("kbd",null,"X")],-1))])):K("",!0),h(i)("copy")?(_(),C("div",N2,[f("div",null,P(h(n)("Copy")),1),o[7]||(o[7]=f("div",null,[f("kbd",null,"⌘"),Me(" + "),f("kbd",null,"C")],-1))])):K("",!0),h(i)("copy")?(_(),C("div",V2,[f("div",null,P(h(n)("Paste")),1),o[8]||(o[8]=f("div",null,[f("kbd",null,"⌘"),Me(" + "),f("kbd",null,"V")],-1))])):K("",!0),h(i)("search")?(_(),C("div",q2,[f("div",null,P(h(n)("Search")),1),o[9]||(o[9]=f("div",null,[f("kbd",null,"⌘"),Me(" + "),f("kbd",null,"F")],-1))])):K("",!0),f("div",W2,[f("div",null,P(h(n)("Toggle Sidebar")),1),o[10]||(o[10]=f("div",null,[f("kbd",null,"⌘"),Me(" + "),f("kbd",null,"E")],-1))]),f("div",Q2,[f("div",null,P(h(n)("Open Settings")),1),o[11]||(o[11]=f("div",null,[f("kbd",null,"⌘"),Me(" + "),f("kbd",null,"S")],-1))]),h(i)("fullscreen")?(_(),C("div",K2,[f("div",null,P(h(n)("Toggle Full Screen")),1),o[12]||(o[12]=f("div",null,[f("kbd",null,"⌘"),Me(" + "),f("kbd",null,"Enter")],-1))])):K("",!0),h(i)("preview")?(_(),C("div",Y2,[f("div",null,P(h(n)("Preview")),1),o[13]||(o[13]=f("kbd",null,"Space",-1))])):K("",!0)])])])]),_:1}))}}),G2={class:"vuefinder__menubar__container"},J2=["onClick","onMouseenter"],Z2={class:"vuefinder__menubar__label"},ex=["onMouseenter"],tx=["onClick"],ix={key:0,class:"vuefinder__menubar__dropdown__label"},nx={key:1,class:"vuefinder__menubar__dropdown__checkmark"},sx=fe({__name:"MenuBar",setup(t){const e=me(),i=ut(e),{enabled:n}=It(),{t:s}=e?.i18n||{t:x=>x},o=e?.fs,r=e?.config,l=ce(r.state),a=ce(o.selectedItems),c=ce(o?.storages||[]),u=U(null),d=U(!1),p=Z(()=>window.opener!==null||window.name!==""||window.history.length<=1),v=Z(()=>[{id:"file",label:s("File"),items:[{id:"new-folder",label:s("New Folder"),action:()=>e?.modal?.open(Ya,{items:a.value}),hidden:()=>!n("newfolder")},{id:"new-file",label:s("New File"),action:()=>e?.modal?.open(_h,{items:a.value}),hidden:()=>!n("newfile")},{type:"separator",hidden:()=>!n("newfolder")&&!n("newfile")||!n("upload")},{id:"upload",label:s("Upload"),action:()=>e?.modal?.open(Xa,{items:a.value}),hidden:()=>!n("upload")},{type:"separator",hidden:()=>!n("search")},{id:"search",label:s("Search"),action:()=>e.modal.open(Ka),hidden:()=>!n("search")},{type:"separator",hidden:()=>!n("archive")&&!n("unarchive")},{id:"archive",label:s("Archive"),action:()=>{a.value.length>0&&e?.modal?.open(Ja,{items:a.value})},enabled:()=>a.value.length>0,hidden:()=>!n("archive")},{id:"unarchive",label:s("Unarchive"),action:()=>{a.value.length===1&&a.value[0]?.mime_type==="application/zip"&&e?.modal?.open(Ga,{items:a.value})},enabled:()=>a.value.length===1&&a.value[0]?.mime_type==="application/zip",hidden:()=>!n("unarchive")},{type:"separator",hidden:()=>!n("preview")},{id:"preview",label:s("Preview"),action:()=>{a.value.length===1&&a.value[0]?.type!=="dir"&&e?.modal?.open(Un,{storage:o?.path?.get()?.storage,item:a.value[0]})},enabled:()=>a.value.length===1&&a.value[0]?.type!=="dir",hidden:()=>!n("preview")},...p.value?[{type:"separator"},{id:"exit",label:s("Exit"),action:()=>{try{window.close()}catch{}},enabled:()=>!0}]:[]]},{id:"edit",label:s("Edit"),items:[...e?.selectionMode==="multiple"?[{id:"select-all",label:s("Select All"),action:()=>o?.selectAll(e?.selectionMode||"multiple",e),enabled:()=>!0},{id:"deselect",label:s("Deselect All"),action:()=>o?.clearSelection(),enabled:()=>a.value.length>0},{type:"separator"}]:[],...n("copy")?[{id:"cut",label:s("Cut"),action:()=>{a.value.length>0&&o?.setClipboard("cut",new Set(a.value.map(x=>x.path)))},enabled:()=>a.value.length>0},{id:"copy",label:s("Copy"),action:()=>{a.value.length>0&&o?.setClipboard("copy",new Set(a.value.map(x=>x.path)))},enabled:()=>a.value.length>0},{id:"paste",label:s("Paste"),action:()=>{const x=o?.getClipboard();x?.items?.size>0&&e?.modal?.open(x.type==="cut"?sn:Wa,{items:{from:Array.from(x.items),to:o?.path?.get()}})},enabled:()=>o?.getClipboard()?.items?.size>0}]:[],...n("move")?[{id:"move",label:s("Move files"),action:()=>{if(a.value.length>0){const x=e?.fs,w={storage:x?.path?.get()?.storage||"",path:x?.path?.get()?.path||"",type:"dir"};e?.modal?.open(sn,{items:{from:a.value,to:w}})}},enabled:()=>a.value.length>0},{type:"separator"}]:[],{id:"copy-path",label:s("Copy Path"),action:async()=>{if(a.value.length===1){const x=a.value[0];await Fn(x.path)}else{const x=o?.path?.get();x?.path&&await Fn(x.path)}},enabled:()=>!0},{id:"copy-download-url",label:s("Copy Download URL"),action:async()=>{if(a.value.length===1){const x=a.value[0];o?.path?.get()?.storage;const w=e?.adapter?.getDownloadUrl({path:x.path});w&&await Ib(w)}},enabled:()=>a.value.length===1&&a.value[0]?.type!=="dir"},{type:"separator",hidden:()=>!n("rename")&&!n("delete")},{id:"rename",label:s("Rename"),action:()=>{a.value.length===1&&e?.modal?.open(po,{items:a.value})},enabled:()=>a.value.length===1,hidden:()=>!n("rename")},{id:"delete",label:s("Delete"),action:()=>{a.value.length>0&&e?.modal?.open(fo,{items:a.value})},enabled:()=>a.value.length>0,hidden:()=>!n("delete")}]},{id:"view",label:s("View"),items:[{id:"refresh",label:s("Refresh"),action:()=>{e.adapter.invalidateListQuery(o.path.get().path),e.adapter.open(o.path.get().path)},enabled:()=>!0},{type:"separator"},{id:"grid-view",label:s("Grid View"),action:()=>r?.set("view","grid"),enabled:()=>!0,checked:()=>l.value?.view==="grid"},{id:"list-view",label:s("List View"),action:()=>r?.set("view","list"),enabled:()=>!0,checked:()=>l.value?.view==="list"},{type:"separator"},{id:"tree-view",label:s("Tree View"),action:()=>r?.toggle("showTreeView"),enabled:()=>!0,checked:()=>l.value?.showTreeView},{id:"thumbnails",label:s("Show Thumbnails"),action:()=>r?.toggle("showThumbnails"),enabled:()=>!0,checked:()=>l.value?.showThumbnails},{id:"show-hidden-files",label:s("Show Hidden Files"),action:()=>r?.toggle("showHiddenFiles"),enabled:()=>!0,checked:()=>l.value?.showHiddenFiles},{type:"separator",hidden:()=>!n("fullscreen")},{id:"fullscreen",label:s("Full Screen"),action:()=>r?.toggle("fullScreen"),enabled:()=>n("fullscreen"),checked:()=>l.value?.fullScreen,hidden:()=>!n("fullscreen")},{type:"separator"},{id:"persist-path",label:s("Persist Path"),action:()=>{r?.toggle("persist"),e.emitter.emit("vf-persist-path-saved")},enabled:()=>!0,checked:()=>l.value?.persist},{id:"metric-units",label:s("Metric Units"),action:()=>{r?.toggle("metricUnits"),e.filesize=r?.get("metricUnits")?th:Ba,e.emitter.emit("vf-metric-units-saved")},enabled:()=>!0,checked:()=>l.value?.metricUnits}]},{id:"go",label:s("Go"),items:[...n("history")?[{id:"forward",label:s("Forward"),action:()=>{o?.goForward();const x=o?.path?.get();x?.path&&e?.adapter.open(x.path)},enabled:()=>o?.canGoForward?.get()??!1},{id:"back",label:s("Back"),action:()=>{o?.goBack();const x=o?.path?.get();x?.path&&e?.adapter.open(x.path)},enabled:()=>o?.canGoBack?.get()??!1}]:[],{id:"open-containing-folder",label:s("Open containing folder"),action:()=>{const x=o?.path?.get();if(x?.breadcrumb&&x.breadcrumb.length>1){const w=x.breadcrumb[x.breadcrumb.length-2]?.path??`${x.storage}://`;e?.adapter.open(w)}},enabled:()=>{const x=o?.path?.get();return x?.breadcrumb&&x.breadcrumb.length>1}},{type:"separator"},...(c.value||[]).map(x=>({id:`storage-${x}`,label:x,action:()=>{const w=`${x}://`;e?.adapter.open(w)},enabled:()=>!0})),{type:"separator"},{id:"go-to-folder",label:s("Go to Folder"),action:async()=>{const x=prompt(s("Enter folder path:"));if(x){if(!x.includes("://")){alert(s("Invalid path format. Path must be in format: storage://path/to/folder"));return}const w=x.indexOf("://"),k=x.slice(0,w);if(!c.value||!c.value.includes(k)){alert(s('Invalid storage. Storage "%s" is not available.',k));return}try{await e?.adapter.open(x)}catch(E){const O=ct(E,s("Failed to navigate to folder"));i.error(O),e.fs.setLoading(!1)}}},enabled:()=>!0}]},{id:"help",label:s("Help"),items:[{id:"settings",label:s("Settings"),action:()=>e?.modal?.open(mh),enabled:()=>!0},{id:"shortcuts",label:s("Shortcuts"),action:()=>e?.modal?.open(X2),enabled:()=>!0},{id:"about",label:s("About"),action:()=>e?.modal?.open(oh),enabled:()=>!0}]}]),m=x=>{u.value===x?y():(u.value=x,d.value=!0)},g=x=>{d.value&&(u.value=x)},y=()=>{u.value=null,d.value=!1},S=x=>{y(),x()},b=x=>{x.target.closest(".vuefinder__menubar")||y()};return Re(()=>{document.addEventListener("click",b)}),Ge(()=>{document.removeEventListener("click",b)}),(x,w)=>(_(),C("div",{class:"vuefinder__menubar",onClick:w[0]||(w[0]=Se(()=>{},["stop"]))},[f("div",G2,[(_(!0),C(_e,null,$e(v.value,k=>(_(),C("div",{key:k.id,class:ue(["vuefinder__menubar__item",{"vuefinder__menubar__item--active":u.value===k.id}]),onClick:E=>m(k.id),onMouseenter:E=>g(k.id)},[f("span",Z2,P(k.label),1),u.value===k.id?(_(),C("div",{key:0,class:"vuefinder__menubar__dropdown",onMouseenter:E=>g(k.id)},[(_(!0),C(_e,null,$e(k.items,E=>(_(),C("div",{key:E.id||E.type,class:ue(["vuefinder__menubar__dropdown__item",{"vuefinder__menubar__dropdown__item--separator":E.type==="separator","vuefinder__menubar__dropdown__item--disabled":E.enabled&&!E.enabled(),"vuefinder__menubar__dropdown__item--checked":E.checked&&E.checked(),"vuefinder__menubar__dropdown__item--hidden":E.hidden&&E.hidden()}]),onClick:Se(O=>E.type!=="separator"&&E.enabled&&E.enabled()?S(E.action):null,["stop"])},[E.type!=="separator"?(_(),C("span",ix,P(E.label),1)):K("",!0),E.checked&&E.checked()?(_(),C("span",nx," ✓ ")):K("",!0)],10,tx))),128))],40,ex)):K("",!0)],42,J2))),128))])]))}}),ox={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",viewBox:"0 0 24 24"};function rx(t,e){return _(),C("svg",ox,[...e[0]||(e[0]=[f("path",{d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"},null,-1)])])}const ax={render:rx},lx={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto vf-toolbar-icon",viewBox:"0 0 24 24"};function cx(t,e){return _(),C("svg",lx,[...e[0]||(e[0]=[f("path",{d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"},null,-1)])])}const ux={render:cx},dx={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"};function hx(t,e){return _(),C("svg",dx,[...e[0]||(e[0]=[f("path",{d:"M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25zm0 9.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18zM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25zm0 9.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18z"},null,-1)])])}const fx={render:hx},px={xmlns:"http://www.w3.org/2000/svg",fill:"none","stroke-width":"1.5",class:"h-6 w-6 md:h-8 md:w-8 m-auto",viewBox:"0 0 24 24"};function mx(t,e){return _(),C("svg",px,[...e[0]||(e[0]=[f("path",{d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 0 1 0 3.75H5.625a1.875 1.875 0 0 1 0-3.75"},null,-1)])])}const vx={render:mx},gx={fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function _x(t,e){return _(),C("svg",gx,[...e[0]||(e[0]=[f("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M3 4a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v2.586a1 1 0 0 1-.293.707l-6.414 6.414a1 1 0 0 0-.293.707V17l-4 4v-6.586a1 1 0 0 0-.293-.707L3.293 7.293A1 1 0 0 1 3 6.586z"},null,-1)])])}const yx={render:_x},wx={class:"vuefinder__toolbar"},bx={class:"vuefinder__toolbar__actions"},xx=["title"],Sx=["title"],kx=["title"],Cx=["title"],Ex=["title"],Ax=["title"],Tx=["title"],Mx={class:"vuefinder__toolbar__controls"},Rx=["title"],Fx={class:"vuefinder__toolbar__control vuefinder__toolbar__dropdown-container"},$x=["title"],Ox={class:"relative"},Px={key:0,class:"vuefinder__toolbar__filter-indicator"},zx={key:0,class:"vuefinder__toolbar__dropdown"},Dx={class:"vuefinder__toolbar__dropdown-content"},Ix={class:"vuefinder__toolbar__dropdown-section"},Lx={class:"vuefinder__toolbar__dropdown-label"},Bx={class:"vuefinder__toolbar__dropdown-row"},Ux={value:"name"},jx={value:"size"},Hx={value:"modified"},Nx={value:""},Vx={value:"asc"},qx={value:"desc"},Wx={class:"vuefinder__toolbar__dropdown-section"},Qx={class:"vuefinder__toolbar__dropdown-label"},Kx={class:"vuefinder__toolbar__dropdown-options"},Yx={class:"vuefinder__toolbar__dropdown-option"},Xx={class:"vuefinder__toolbar__option-text"},Gx={class:"vuefinder__toolbar__dropdown-option"},Jx={class:"vuefinder__toolbar__option-text"},Zx={class:"vuefinder__toolbar__dropdown-option"},eS={class:"vuefinder__toolbar__option-text"},tS={class:"vuefinder__toolbar__dropdown-toggle"},iS={for:"showHidden",class:"vuefinder__toolbar__toggle-label"},nS={class:"vuefinder__toolbar__dropdown-reset"},sS=["title"],oS=["title"],rS=fe({name:"VfToolbar",__name:"Toolbar",setup(t){const e=me(),{enabled:i}=It(),{t:n}=e.i18n,s=e.fs,o=e.config,r=ce(o.state),l=ce(s.selectedItems),a=ce(s.sort),c=ce(s.filter);ve(()=>r.value.fullScreen,()=>{const y=document.querySelector("body");y&&(y.style.overflow=r.value.fullScreen?"hidden":"")},{immediate:!0});const u=U(!1),d=y=>{y.target.closest(".vuefinder__toolbar__dropdown-container")||(u.value=!1)};Re(()=>{const y=document.querySelector("body");y&&r.value.fullScreen&&setTimeout(()=>y.style.overflow="hidden"),document.addEventListener("click",d)}),Ge(()=>{document.removeEventListener("click",d)});const p=U({sortBy:"name",sortOrder:"",filterKind:"all",showHidden:r.value.showHiddenFiles});ve(()=>p.value.sortBy,y=>{if(!p.value.sortOrder){s.clearSort();return}y==="name"?s.setSort("basename",p.value.sortOrder):y==="size"?s.setSort("file_size",p.value.sortOrder):y==="modified"&&s.setSort("last_modified",p.value.sortOrder)}),ve(()=>p.value.sortOrder,y=>{if(!y){s.clearSort();return}p.value.sortBy==="name"?s.setSort("basename",y):p.value.sortBy==="size"?s.setSort("file_size",y):p.value.sortBy==="modified"&&s.setSort("last_modified",y)}),ve(a,y=>{y.active?(y.column==="basename"?p.value.sortBy="name":y.column==="file_size"?p.value.sortBy="size":y.column==="last_modified"&&(p.value.sortBy="modified"),p.value.sortOrder=y.order):p.value.sortOrder=""},{immediate:!0}),ve(()=>p.value.filterKind,y=>{s.setFilter(y,r.value.showHiddenFiles)}),ve(()=>p.value.showHidden,y=>{o.set("showHiddenFiles",y),s.setFilter(p.value.filterKind,y)}),ve(c,y=>{p.value.filterKind=y.kind},{immediate:!0}),ve(()=>r.value.showHiddenFiles,y=>{p.value.showHidden=y,s.setFilter(p.value.filterKind,y)},{immediate:!0});const v=()=>o.set("view",r.value.view==="grid"?"list":"grid"),m=Z(()=>c.value.kind!=="all"||!r.value.showHiddenFiles||a.value.active),g=()=>{p.value={sortBy:"name",sortOrder:"",filterKind:"all",showHidden:!0},o.set("showHiddenFiles",!0),s.clearSort(),s.clearFilter()};return(y,S)=>(_(),C("div",wx,[f("div",bx,[h(i)("newfolder")?(_(),C("div",{key:0,class:"mx-1.5",title:h(n)("New Folder"),onClick:S[0]||(S[0]=b=>h(e).modal.open(Ya,{items:h(l)}))},[ee(h(vh))],8,xx)):K("",!0),h(i)("newfile")?(_(),C("div",{key:1,class:"mx-1.5",title:h(n)("New File"),onClick:S[1]||(S[1]=b=>h(e).modal.open(_h,{items:h(l)}))},[ee(h(gh))],8,Sx)):K("",!0),h(i)("rename")?(_(),C("div",{key:2,class:"mx-1.5",title:h(n)("Rename"),onClick:S[2]||(S[2]=b=>h(l).length!==1||h(e).modal.open(po,{items:h(l)}))},[ee(h(ah),{class:ue(h(l).length===1?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,kx)):K("",!0),h(i)("delete")?(_(),C("div",{key:3,class:"mx-1.5",title:h(n)("Delete"),onClick:S[3]||(S[3]=b=>!h(l).length||h(e).modal.open(fo,{items:h(l)}))},[ee(h(rh),{class:ue(h(l).length?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,Cx)):K("",!0),h(i)("upload")?(_(),C("div",{key:4,class:"mx-1.5",title:h(n)("Upload"),onClick:S[4]||(S[4]=b=>h(e).modal.open(Xa,{items:h(l)}))},[ee(h(yh))],8,Ex)):K("",!0),h(i)("unarchive")&&h(l).length===1&&h(l)[0].mime_type==="application/zip"?(_(),C("div",{key:5,class:"mx-1.5",title:h(n)("Unarchive"),onClick:S[5]||(S[5]=b=>!h(l).length||h(e).modal.open(Ga,{items:h(l)}))},[ee(h(wh),{class:ue(h(l).length?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,Ax)):K("",!0),h(i)("archive")?(_(),C("div",{key:6,class:"mx-1.5",title:h(n)("Archive"),onClick:S[6]||(S[6]=b=>!h(l).length||h(e).modal.open(Ja,{items:h(l)}))},[ee(h(bh),{class:ue(h(l).length?"vf-toolbar-icon":"vf-toolbar-icon-disabled")},null,8,["class"])],8,Tx)):K("",!0)]),f("div",Mx,[h(i)("search")?(_(),C("div",{key:0,class:"mx-1.5",title:h(n)("Search Files"),onClick:S[7]||(S[7]=b=>h(e).modal.open(Ka))},[ee(h(Qa),{class:"vf-toolbar-icon text-(--vf-bg-primary)"})],8,Rx)):K("",!0),f("div",Fx,[f("div",{title:h(n)("Filter"),class:"vuefinder__toolbar__dropdown-trigger",onClick:S[8]||(S[8]=b=>u.value=!u.value)},[f("div",Ox,[ee(h(yx),{class:"vf-toolbar-icon vuefinder__toolbar__icon h-6 w-6"}),m.value?(_(),C("div",Px)):K("",!0)])],8,$x),u.value?(_(),C("div",zx,[f("div",Dx,[f("div",Ix,[f("div",Lx,P(h(n)("Sorting")),1),f("div",Bx,[ze(f("select",{"onUpdate:modelValue":S[9]||(S[9]=b=>p.value.sortBy=b),class:"vuefinder__toolbar__dropdown-select"},[f("option",Ux,P(h(n)("Name")),1),f("option",jx,P(h(n)("Size")),1),f("option",Hx,P(h(n)("Date")),1)],512),[[ur,p.value.sortBy]]),ze(f("select",{"onUpdate:modelValue":S[10]||(S[10]=b=>p.value.sortOrder=b),class:"vuefinder__toolbar__dropdown-select"},[f("option",Nx,P(h(n)("None")),1),f("option",Vx,P(h(n)("Asc")),1),f("option",qx,P(h(n)("Desc")),1)],512),[[ur,p.value.sortOrder]])])]),f("div",Wx,[f("div",Qx,P(h(n)("Show")),1),f("div",Kx,[f("label",Yx,[ze(f("input",{"onUpdate:modelValue":S[11]||(S[11]=b=>p.value.filterKind=b),type:"radio",name:"filterKind",value:"all",class:"vuefinder__toolbar__radio"},null,512),[[Co,p.value.filterKind]]),f("span",Xx,P(h(n)("All items")),1)]),f("label",Gx,[ze(f("input",{"onUpdate:modelValue":S[12]||(S[12]=b=>p.value.filterKind=b),type:"radio",name:"filterKind",value:"files",class:"vuefinder__toolbar__radio"},null,512),[[Co,p.value.filterKind]]),f("span",Jx,P(h(n)("Files only")),1)]),f("label",Zx,[ze(f("input",{"onUpdate:modelValue":S[13]||(S[13]=b=>p.value.filterKind=b),type:"radio",name:"filterKind",value:"folders",class:"vuefinder__toolbar__radio"},null,512),[[Co,p.value.filterKind]]),f("span",eS,P(h(n)("Folders only")),1)])])]),f("div",tS,[f("label",iS,P(h(n)("Show hidden files")),1),ze(f("input",{id:"showHidden","onUpdate:modelValue":S[14]||(S[14]=b=>p.value.showHidden=b),type:"checkbox",class:"vuefinder__toolbar__checkbox"},null,512),[[Us,p.value.showHidden]])]),f("div",nS,[f("button",{class:"vuefinder__toolbar__reset-button",onClick:g},P(h(n)("Reset")),1)])])])):K("",!0)]),h(i)("fullscreen")?(_(),C("div",{key:1,class:"mx-1.5",title:h(n)("Toggle Full Screen"),onClick:S[15]||(S[15]=b=>h(o).toggle("fullScreen"))},[h(r).fullScreen?(_(),X(h(ux),{key:0,class:"vf-toolbar-icon"})):(_(),X(h(ax),{key:1,class:"vf-toolbar-icon"}))],8,sS)):K("",!0),f("div",{class:"mx-1.5",title:h(n)("Change View"),onClick:S[16]||(S[16]=b=>v())},[h(r).view==="grid"?(_(),X(h(fx),{key:0,class:"vf-toolbar-icon"})):K("",!0),h(r).view==="list"?(_(),X(h(vx),{key:1,class:"vf-toolbar-icon"})):K("",!0)],8,oS)])]))}}),aS={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"vuefinder__breadcrumb__refresh-icon",viewBox:"-40 -40 580 580"};function lS(t,e){return _(),C("svg",aS,[...e[0]||(e[0]=[f("path",{d:"M463.5 224h8.5c13.3 0 24-10.7 24-24V72c0-9.7-5.8-18.5-14.8-22.2S461.9 48.1 455 55l-41.6 41.6c-87.6-86.5-228.7-86.2-315.8 1-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2S334.3 224 344 224z"},null,-1)])])}const cS={render:lS},uS={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"h-6 w-6 p-0.5 rounded",viewBox:"0 0 20 20"};function dS(t,e){return _(),C("svg",uS,[...e[0]||(e[0]=[f("path",{"fill-rule":"evenodd",d:"M5.293 9.707a1 1 0 0 1 0-1.414l4-4a1 1 0 0 1 1.414 0l4 4a1 1 0 0 1-1.414 1.414L11 7.414V15a1 1 0 1 1-2 0V7.414L6.707 9.707a1 1 0 0 1-1.414 0",class:"pointer-events-none","clip-rule":"evenodd"},null,-1)])])}const hS={render:dS},fS={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"vuefinder__breadcrumb__close-icon",viewBox:"0 0 24 24"};function pS(t,e){return _(),C("svg",fS,[...e[0]||(e[0]=[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18 18 6M6 6l12 12"},null,-1)])])}const mS={render:pS},vS={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20"};function gS(t,e){return _(),C("svg",vS,[...e[0]||(e[0]=[f("path",{d:"M10.707 2.293a1 1 0 0 0-1.414 0l-7 7a1 1 0 0 0 1.414 1.414L4 10.414V17a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-6.586l.293.293a1 1 0 0 0 1.414-1.414z",class:"pointer-events-none"},null,-1)])])}const _S={render:gS},yS={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-width":"1.5",class:"w-6 h-6 cursor-pointer",viewBox:"0 0 24 24"};function wS(t,e){return _(),C("svg",yS,[...e[0]||(e[0]=[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18 18 6M6 6l12 12"},null,-1)])])}const bS={render:wS},xS={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24"};function SS(t,e){return _(),C("svg",xS,[...e[0]||(e[0]=[f("path",{stroke:"none",d:"M0 0h24v24H0z"},null,-1),f("path",{d:"M9 6h11M12 12h8M15 18h5M5 6v.01M8 12v.01M11 18v.01"},null,-1)])])}const kS={render:SS},CS={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function ES(t,e){return _(),C("svg",CS,[...e[0]||(e[0]=[f("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7h12m0 0-4-4m4 4-4 4m0 6H4m0 0 4 4m-4-4 4-4"},null,-1)])])}const AS={render:ES};function jn(t,e=[]){const i="vfDragEnterCounter",n=t.fs,s=ce(n.selectedItems);function o(d,p){return!!(!d||d.type!=="dir"||d.path.startsWith(p)||s.value.some(v=>v.path===p?!1:!!d.path.startsWith(v.path)))}function r(d,p){if(d.isExternalDrag)return;if(!(t.features?.move??!1)){d.dataTransfer&&(d.dataTransfer.dropEffect="none",d.dataTransfer.effectAllowed="none");return}d.preventDefault();const v=n.getDraggedItem();o(p,v)?d.dataTransfer&&(d.dataTransfer.dropEffect="none",d.dataTransfer.effectAllowed="none"):(d.dataTransfer&&(d.dataTransfer.dropEffect="copy",d.dataTransfer.effectAllowed="all"),d.currentTarget.classList.add(...e))}function l(d){if(d.isExternalDrag||!(t.features?.move??!1))return;d.preventDefault();const p=d.currentTarget,v=Number(p.dataset[i]||0);p.dataset[i]=String(v+1)}function a(d){if(d.isExternalDrag||!(t.features?.move??!1))return;d.preventDefault();const p=d.currentTarget,v=Number(p.dataset[i]||0)-1;v<=0?(delete p.dataset[i],p.classList.remove(...e)):p.dataset[i]=String(v)}function c(d,p){if(d.isExternalDrag||!(t.features?.move??!1)||!p)return;d.preventDefault();const v=d.currentTarget;delete v.dataset[i],v.classList.remove(...e);const m=d.dataTransfer?.getData("items")||"[]",g=JSON.parse(m).map(y=>n.sortedFiles.get().find(S=>S.path===y));n.clearDraggedItem(),t.modal.open(sn,{items:{from:g,to:p}})}function u(d){return{dragover:p=>r(p,d),dragenter:l,dragleave:a,drop:p=>c(p,d)}}return{events:u}}const TS={class:"vuefinder__breadcrumb__container"},MS=["title"],RS=["title"],FS=["title"],$S=["title"],OS={class:"vuefinder__breadcrumb__path-container"},PS={class:"vuefinder__breadcrumb__list"},zS={key:0,class:"vuefinder__breadcrumb__hidden-list"},DS={class:"relative"},IS=["title","onClick"],LS=["title"],BS={class:"vuefinder__breadcrumb__path-mode"},US={class:"vuefinder__breadcrumb__path-mode-content"},jS=["title"],HS={class:"vuefinder__breadcrumb__path-text"},NS=["title"],VS=["data-theme"],qS=["onClick"],WS={class:"vuefinder__breadcrumb__hidden-item-content"},QS={class:"vuefinder__breadcrumb__hidden-item-text"},KS=fe({__name:"Breadcrumb",setup(t){const e=me(),i=ut(e),{t:n}=e.i18n,s=e.fs,o=e.config,r=ce(o.state),l=ce(s.path),a=ce(s.loading),c=U(null),u=uh(0,100),d=U(5),p=U(!1),v=U(!1),m=Z(()=>l.value?.breadcrumb??[]);function g(L,z){return L.length>z?[L.slice(-z),L.slice(0,-z)]:[L,[]]}const y=Z(()=>g(m.value,d.value)[0]),S=Z(()=>g(m.value,d.value)[1]);ve(u,()=>{if(!c.value)return;const L=c.value.children;let z=0,$=0;const H=5,B=1;d.value=H,lt(()=>{for(let Q=L.length-1;Q>=0;Q--){const ne=L[Q];if(z+ne.offsetWidth>u.value-40)break;z+=parseInt(ne.offsetWidth.toString(),10),$++}$<B&&($=B),$>H&&($=H),d.value=$})});const b=()=>{c.value&&(u.value=c.value.offsetWidth)},x=U(null);Re(()=>{x.value=new ResizeObserver(b),c.value&&x.value.observe(c.value)}),Ge(()=>{x.value&&x.value.disconnect()});const w=jn(e,["vuefinder__drag-over"]);function k(L=null){L??=m.value.length-2;const z={basename:l.value?.storage??"local",extension:"",path:(l.value?.storage??"local")+"://",storage:l.value?.storage??"local",type:"dir",file_size:null,last_modified:null,mime_type:null,visibility:""};return m.value[L]??z}const E=()=>{e.adapter.invalidateListQuery(l.value.path),e.adapter.open(l.value.path)},O=()=>{y.value.length>0&&e.adapter.open(m.value[m.value.length-2]?.path??(l.value?.storage??"local")+"://")},F=L=>{e.adapter.open(L.path),p.value=!1},j=()=>{p.value&&(p.value=!1)},R={mounted(L,z){L.clickOutsideEvent=function($){L===$.target||L.contains($.target)||z.value()},document.body.addEventListener("click",L.clickOutsideEvent)},beforeUnmount(L){document.body.removeEventListener("click",L.clickOutsideEvent)}},T=()=>{o.toggle("showTreeView")},D=U({x:0,y:0}),M=(L,z=null)=>{if(L.currentTarget instanceof HTMLElement){const{x:$,y:H,height:B}=L.currentTarget.getBoundingClientRect();D.value={x:$,y:H+B}}p.value=z??!p.value},I=()=>{v.value=!v.value},W=async()=>{await Fn(l.value?.path||""),i.success(n("Path copied to clipboard"))},J=()=>{v.value=!1};return(L,z)=>(_(),C("div",TS,[f("span",{title:h(n)("Toggle Tree View")},[ee(h(kS),{class:ue(["vuefinder__breadcrumb__toggle-tree",h(r).showTreeView?"vuefinder__breadcrumb__toggle-tree--active":""]),onClick:T},null,8,["class"])],8,MS),f("span",{title:h(n)("Go up a directory")},[ee(h(hS),We({class:m.value.length?"vuefinder__breadcrumb__go-up--active":"vuefinder__breadcrumb__go-up--inactive"},di(m.value.length?h(w).events(k()):{}),{onClick:O}),null,16,["class"])],8,RS),h(s).isLoading()?(_(),C("span",{key:1,title:h(n)("Cancel")},[ee(h(mS),{onClick:z[0]||(z[0]=$=>h(e).emitter.emit("vf-fetch-abort"))})],8,$S)):(_(),C("span",{key:0,title:h(n)("Refresh")},[ee(h(cS),{onClick:E})],8,FS)),ze(f("div",OS,[f("div",null,[ee(h(_S),We({class:"vuefinder__breadcrumb__home-icon"},di(h(w).events(k(-1))),{onClick:z[1]||(z[1]=Se($=>h(e).adapter.open(h(l).storage+"://"),["stop"]))}),null,16)]),f("div",PS,[S.value.length?ze((_(),C("div",zS,[z[3]||(z[3]=f("div",{class:"vuefinder__breadcrumb__separator"},"/",-1)),f("div",DS,[f("span",{class:"vuefinder__breadcrumb__hidden-toggle",onDragenter:z[2]||(z[2]=$=>M($,!0)),onClick:Se(M,["stop"])},[ee(h(ph),{class:"vuefinder__breadcrumb__hidden-toggle-icon"})],32)])])),[[R,j]]):K("",!0)]),f("div",{ref_key:"breadcrumbContainer",ref:c,class:"vuefinder__breadcrumb__visible-list pointer-events-none"},[(_(!0),C(_e,null,$e(y.value,($,H)=>(_(),C("div",{key:H},[z[4]||(z[4]=f("span",{class:"vuefinder__breadcrumb__separator"},"/",-1)),f("span",We({class:"vuefinder__breadcrumb__item pointer-events-auto",title:$.basename},di(h(w).events($),!0),{onClick:Se(B=>h(e).adapter.open($.path),["stop"])}),P($.name),17,IS)]))),128))],512),h(o).get("loadingIndicator")==="circular"&&h(a)?(_(),X(h(go),{key:0})):K("",!0),f("span",{title:h(n)("Toggle Path Copy Mode"),onClick:I},[ee(h(AS),{class:"vuefinder__breadcrumb__toggle-icon"})],8,LS)],512),[[$t,!v.value]]),ze(f("div",BS,[f("div",US,[f("div",{title:h(n)("Copy Path")},[ee(h(ja),{class:"vuefinder__breadcrumb__copy-icon",onClick:W})],8,jS),f("div",HS,P(h(l).path),1),f("div",{title:h(n)("Exit")},[ee(h(bS),{class:"vuefinder__breadcrumb__exit-icon",onClick:J})],8,NS)])],512),[[$t,v.value]]),(_(),X(Hs,{to:"body"},[f("div",null,[ze(f("div",{style:et({position:"absolute",top:D.value.y+"px",left:D.value.x+"px"}),class:"vuefinder__themer vuefinder__breadcrumb__hidden-dropdown","data-theme":h(e).theme.current},[(_(!0),C(_e,null,$e(S.value,($,H)=>(_(),C("div",We({key:H,class:"vuefinder__breadcrumb__hidden-item"},di(h(w).events($),!0),{onClick:B=>F($)}),[f("div",WS,[f("span",null,[ee(h(Wt),{class:"vuefinder__breadcrumb__hidden-item-icon"})]),f("span",QS,P($.name),1)])],16,qS))),128))],12,VS),[[$t,p.value]])])]))]))}}),YS={xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"};function XS(t,e){return _(),C("svg",YS,[...e[0]||(e[0]=[f("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 21h10a2 2 0 0 0 2-2V9.414a1 1 0 0 0-.293-.707l-5.414-5.414A1 1 0 0 0 12.586 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2"},null,-1)])])}const Lc={render:XS},GS={class:"vuefinder__drag-item__container"},JS={class:"vuefinder__drag-item__count"},ZS=fe({__name:"DragItem",props:{count:{}},setup(t){const e=t;return(i,n)=>(_(),C("div",GS,[e.count>1?(_(),X(h(Lc),{key:0,class:"vuefinder__drag-item__icon translate-x-1 translate-y-1"})):K("",!0),ee(h(Lc),{class:"vuefinder__drag-item__icon"}),f("div",JS,P(e.count),1)]))}}),ek={key:2,class:"vuefinder__item-icon__extension"},Bc=fe({__name:"ItemIcon",props:{item:{},ext:{type:Boolean},small:{type:Boolean},view:{}},setup(t){const e=t,i=me(),n=ce(i.config.state),s=Z(()=>e.small!==void 0?e.small?"small":"large":e.view==="list"?"small":"large"),o=Z(()=>{const l=s.value,a=n.value?.listIconSize,c=n.value?.gridIconSize;return n.value?.gridItemWidth,n.value?.gridItemHeight,e.view==="list"||l==="small"?{"--vf-icon-size":`${a??16}px`}:{"--vf-icon-size":`${c??48}px`}}),r={app:i,config:n.value,item:e.item,view:e.view};return(l,a)=>(_(),C("div",{class:ue(["vuefinder__item-icon",{"vuefinder__item-icon--small":s.value==="small","vuefinder__item-icon--large":s.value==="large","vuefinder__item-icon--grid":t.view==="grid","vuefinder__item-icon--list":t.view==="list"}]),style:et(o.value)},[xe(l.$slots,"icon",Ht(pi(r)),()=>[t.item.type==="dir"?(_(),X(h(Wt),{key:0,class:"vuefinder__item-icon__folder"})):(_(),X(h(Rn),{key:1,class:"vuefinder__item-icon__file"})),t.ext&&t.item.type!=="dir"&&t.item.extension?(_(),C("div",ek,P(t.item.extension.substring(0,3)),1)):K("",!0)])],6))}}),tk={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"};function ik(t,e){return _(),C("svg",tk,[...e[0]||(e[0]=[f("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),f("path",{d:"M12 2a5 5 0 0 1 5 5v3a3 3 0 0 1 3 3v6a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3v-6a3 3 0 0 1 3-3V7a5 5 0 0 1 5-5m0 12a2 2 0 0 0-1.995 1.85L10 16a2 2 0 1 0 2-2m0-10a3 3 0 0 0-3 3v3h6V7a3 3 0 0 0-3-3"},null,-1)])])}const Uc={render:ik},nk=["data-key","data-row","data-col","draggable"],sk={key:0},ok={class:"vuefinder__explorer__item-grid-content"},rk=["data-src","alt"],ak={class:"vuefinder__explorer__item-title"},lk={key:1,class:"vuefinder__explorer__item-list-content"},ck={class:"vuefinder__explorer__item-list-name"},uk={class:"vuefinder__explorer__item-list-icon"},dk={class:"vuefinder__explorer__item-name"},hk={key:0,class:"vuefinder__explorer__item-path"},fk={key:1,class:"vuefinder__explorer__item-size"},pk={key:0},mk={key:2,class:"vuefinder__explorer__item-date"},vk=fe({__name:"FileItem",props:{item:{},view:{},showThumbnails:{type:Boolean},isSelected:{type:Boolean},isDragging:{type:Boolean},rowIndex:{},colIndex:{},showPath:{type:Boolean},explorerId:{}},emits:["click","dblclick","contextmenu","dragstart","dragend"],setup(t,{emit:e}){const i=t,n=e,s=me(),o=s.fs,r=s.config,l=Z(()=>{const T=s.selectionFilterType;return!T||T==="both"?!0:T==="files"&&i.item.type==="file"||T==="dirs"&&i.item.type==="dir"}),a=Z(()=>{const T=s.selectionFilterMimeIncludes;return!T||!T.length||i.item.type==="dir"?!0:i.item.mime_type?T.some(D=>i.item.mime_type?.startsWith(D)):!1}),c=Z(()=>l.value&&a.value),u=Z(()=>["file-item-"+i.explorerId,i.view==="grid"?"vf-explorer-item-grid":"vf-explorer-item-list",i.isSelected?"vf-explorer-selected":"",c.value?"":"vf-explorer-item--unselectable"]),d=Z(()=>({opacity:i.isDragging||o.isCut(i.item.path)||!c.value?.5:""})),p=U(null);let v=!1,m=null,g=null,y=!1;const{enabled:S}=It(),b=typeof window<"u"&&("ontouchstart"in window||navigator.maxTouchPoints>0),x=Z(()=>b?!1:S("move")),w=()=>{m&&(clearTimeout(m),m=null),g=null},k=T=>{w(),g=T,y=!1,T.stopPropagation(),m=setTimeout(()=>{!g||m===null||(y=!0,g.cancelable&&g.preventDefault(),g.stopPropagation(),n("contextmenu",g),w())},500)},E=T=>{if(y){T.preventDefault(),T.stopPropagation(),w();return}setTimeout(()=>{y||(w(),R(T))},100)},O=T=>{if(!g)return;const D=g.touches[0]||g.changedTouches[0],M=T.touches[0]||T.changedTouches[0];if(D&&M){const I=Math.abs(M.clientX-D.clientX),W=Math.abs(M.clientY-D.clientY);(I>15||W>15)&&w()}},F=T=>{b&&T.type!=="click"||n("click",T)},j=T=>{if(y)return T.preventDefault(),T.stopPropagation(),!1;n("dragstart",T)},R=T=>{if(!v)v=!0,n("click",T),p.value=setTimeout(()=>{v=!1},300);else return v=!1,n("dblclick",T),!1};return(T,D)=>(_(),C("div",{class:ue(u.value),style:et(d.value),"data-key":t.item.path,"data-row":t.rowIndex,"data-col":t.colIndex,draggable:x.value,onTouchstartCapture:D[1]||(D[1]=M=>k(M)),onTouchendCapture:D[2]||(D[2]=M=>E(M)),onTouchmoveCapture:O,onTouchcancelCapture:D[3]||(D[3]=()=>w()),onClick:F,onDblclick:D[4]||(D[4]=M=>n("dblclick",M)),onContextmenu:D[5]||(D[5]=Se(M=>n("contextmenu",M),["prevent","stop"])),onDragstart:j,onDragend:D[6]||(D[6]=M=>n("dragend",M))},[t.view==="grid"?(_(),C("div",sk,[h(o).isReadOnly(t.item)?(_(),X(h(Uc),{key:0,class:"vuefinder__item--readonly vuefinder__item--readonly--left",title:"Read Only"})):K("",!0),f("div",ok,[(t.item.mime_type??"").startsWith("image")&&t.showThumbnails?(_(),C("img",{key:0,src:"data:image/png;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",class:"vuefinder__explorer__item-thumbnail lazy","data-src":t.item.previewUrl??h(s).adapter.getPreviewUrl({path:t.item.path}),alt:t.item.basename,onTouchstart:D[0]||(D[0]=M=>M.preventDefault())},null,40,rk)):(_(),X(Bc,{key:1,item:t.item,ext:!0,view:t.view},{icon:he(M=>[xe(T.$slots,"icon",Ht(pi(M)))]),_:3},8,["item","view"]))]),f("span",ak,P(h(Wr)(t.item.basename)),1)])):(_(),C("div",lk,[f("div",ck,[f("div",uk,[ee(Bc,{item:t.item,view:t.view},{icon:he(M=>[xe(T.$slots,"icon",Ht(pi(M)))]),_:3},8,["item","view"])]),f("span",dk,P(t.item.basename),1),f("div",null,[h(o).isReadOnly(t.item)?(_(),X(h(Uc),{key:0,class:"vuefinder__item--readonly vuefinder__item--readonly--list",title:"Read Only"})):K("",!0)])]),t.showPath?(_(),C("div",hk,P(t.item.path),1)):K("",!0),t.showPath?K("",!0):(_(),C("div",fk,[t.item.file_size?(_(),C("div",pk,P(h(s).filesize(t.item.file_size)),1)):K("",!0)])),!t.showPath&&t.item.last_modified?(_(),C("div",mk,P(new Date(t.item.last_modified*1e3).toLocaleString()),1)):K("",!0)])),h(S)("pinned")&&h(r).get("pinnedFolders").find(M=>M.path===t.item.path)?(_(),X(h(Ha),{key:2,class:"vuefinder__item--pinned"})):K("",!0)],46,nk))}}),gk=["data-row"],jc=fe({__name:"FileRow",props:{rowIndex:{},rowHeight:{},view:{},itemsPerRow:{},items:{},showThumbnails:{type:Boolean},showPath:{type:Boolean},isDraggingItem:{type:Function},isSelected:{type:Function},dragNDropEvents:{type:Function},explorerId:{}},emits:["click","dblclick","contextmenu","dragstart","dragend"],setup(t,{emit:e}){const i=t,n=e,s=Z(()=>[i.view==="grid"?"vf-explorer-item-grid-row":"vf-explorer-item-list-row","pointer-events-none"]),o=Z(()=>({position:"absolute",top:0,left:0,width:"100%",height:`${i.rowHeight}px`,transform:`translateY(${i.rowIndex*i.rowHeight}px)`})),r=Z(()=>i.view==="grid"?{gridTemplateColumns:`repeat(${i.itemsPerRow||1}, 1fr)`}:{gridTemplateColumns:"1fr"});return(l,a)=>(_(),C("div",{class:ue(s.value),"data-row":t.rowIndex,style:et(o.value)},[f("div",{class:ue(["grid justify-self-start",{"w-full":t.view==="list"}]),style:et(r.value)},[(_(!0),C(_e,null,$e(t.items,(c,u)=>(_(),X(vk,We({key:c.path,item:c,view:t.view,"show-thumbnails":t.showThumbnails,"show-path":t.showPath,"is-selected":t.isSelected(c.path),"is-dragging":t.isDraggingItem(c.path),"row-index":t.rowIndex,"col-index":u,"explorer-id":t.explorerId},di(t.dragNDropEvents(c)),{onClick:a[0]||(a[0]=d=>n("click",d)),onDblclick:a[1]||(a[1]=d=>n("dblclick",d)),onContextmenu:a[2]||(a[2]=d=>n("contextmenu",d)),onDragstart:a[3]||(a[3]=d=>n("dragstart",d)),onDragend:a[4]||(a[4]=d=>n("dragend",d))}),{icon:he(d=>[xe(l.$slots,"icon",We({ref_for:!0},d))]),_:3},16,["item","view","show-thumbnails","show-path","is-selected","is-dragging","row-index","col-index","explorer-id"]))),128))],6)],14,gk))}}),_k={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20"};function yk(t,e){return _(),C("svg",_k,[...e[0]||(e[0]=[f("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 0 1 1.414 0L10 10.586l3.293-3.293a1 1 0 1 1 1.414 1.414l-4 4a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 0-1.414","clip-rule":"evenodd"},null,-1)])])}const wk={render:yk},bk={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20"};function xk(t,e){return _(),C("svg",bk,[...e[0]||(e[0]=[f("path",{"fill-rule":"evenodd",d:"M14.707 12.707a1 1 0 0 1-1.414 0L10 9.414l-3.293 3.293a1 1 0 0 1-1.414-1.414l4-4a1 1 0 0 1 1.414 0l4 4a1 1 0 0 1 0 1.414","clip-rule":"evenodd"},null,-1)])])}const Sk={render:xk},cr=fe({__name:"SortIcon",props:{direction:{}},setup(t){return(e,i)=>(_(),C("div",null,[t.direction==="asc"?(_(),X(h(wk),{key:0,class:"vuefinder__explorer__sort-icon"})):K("",!0),t.direction==="desc"?(_(),X(h(Sk),{key:1,class:"vuefinder__explorer__sort-icon"})):K("",!0)]))}}),kk={class:"vuefinder__explorer__header"},Ck=fe({__name:"ExplorerHeader",setup(t){const e=me(),i=e.fs,{t:n}=e.i18n,s=ce(i.sort);return(o,r)=>(_(),C("div",kk,[f("div",{class:"vuefinder__explorer__sort-button vuefinder__explorer__sort-button--name vf-sort-button",onClick:r[0]||(r[0]=l=>h(i).toggleSort("basename"))},[Me(P(h(n)("Name"))+" ",1),ze(ee(cr,{direction:h(s).order},null,8,["direction"]),[[$t,h(s).active&&h(s).column==="basename"]])]),f("div",{class:"vuefinder__explorer__sort-button vuefinder__explorer__sort-button--size vf-sort-button",onClick:r[1]||(r[1]=l=>h(i).toggleSort("file_size"))},[Me(P(h(n)("Size"))+" ",1),ze(ee(cr,{direction:h(s).order},null,8,["direction"]),[[$t,h(s).active&&h(s).column==="file_size"]])]),f("div",{class:"vuefinder__explorer__sort-button vuefinder__explorer__sort-button--date vf-sort-button",onClick:r[2]||(r[2]=l=>h(i).toggleSort("last_modified"))},[Me(P(h(n)("Date"))+" ",1),ze(ee(cr,{direction:h(s).order},null,8,["direction"]),[[$t,h(s).active&&h(s).column==="last_modified"]])])]))}});function Ek(t,e){const{scrollContainer:i,itemWidth:n=100,rowHeight:s,overscan:o=2,containerPadding:r=48,lockItemsPerRow:l}=e,a=t,c=()=>typeof s=="number"?s:s.value,u=()=>n?typeof n=="number"?n:n.value:100,d=()=>r?typeof r=="number"?r:r.value:0,p=U(0),v=U(6),m=U(600);let g=null;const y=Z(()=>Math.ceil(a.value.length/v.value)),S=Z(()=>y.value*c()),b=Z(()=>{const T=c(),D=Math.max(0,Math.floor(p.value/T)-o),M=Math.min(y.value,Math.ceil((p.value+m.value)/T)+o);return{start:D,end:M}}),x=Z(()=>{const{start:T,end:D}=b.value;return Array.from({length:D-T},(M,I)=>T+I)}),w=()=>m.value,k=()=>typeof l=="object"?l.value:!1,E=()=>{if(k()){v.value=1;return}if(i.value){const T=d(),D=i.value.clientWidth-T,M=u();M>0&&(v.value=Math.max(Math.floor(D/M),2))}},O=T=>{const D=T.target;p.value=D.scrollTop};ve(()=>a.value.length,()=>{E()}),n&&typeof n!="number"&&ve(n,()=>{E()}),r&&typeof r!="number"&&ve(r,()=>{E()}),s&&typeof s!="number"&&ve(s,()=>{});const F=(T,D)=>{if(!T||!Array.isArray(T))return[];const M=D*v.value;return T.slice(M,M+v.value)},j=(T,D,M,I,W)=>{if(!T||!Array.isArray(T))return[];const J=[];for(let L=D;L<=M;L++)for(let z=I;z<=W;z++){const $=L*v.value+z;$<T.length&&T[$]&&J.push(T[$])}return J},R=T=>({row:Math.floor(T/v.value),col:T%v.value});return Re(async()=>{await lt(),i.value&&(m.value=i.value.clientHeight||600),E(),window.addEventListener("resize",()=>{i.value&&(m.value=i.value.clientHeight||600),E()}),i.value&&"ResizeObserver"in window&&(g=new ResizeObserver(T=>{const D=T[0];D&&(m.value=Math.round(D.contentRect.height)),E()}),g.observe(i.value))}),Ge(()=>{window.removeEventListener("resize",E),g&&(g.disconnect(),g=null)}),{scrollTop:p,itemsPerRow:v,totalRows:y,totalHeight:S,visibleRange:b,visibleRows:x,updateItemsPerRow:E,handleScroll:O,getRowItems:F,getItemsInRange:j,getItemPosition:R,getContainerHeight:w}}function Ak(t){const{itemsPerRow:e,totalHeight:i,getItemsInRange:n,getKey:s,selectionObject:o,rowHeight:r,itemWidth:l,osInstance:a}=t,c=()=>typeof l=="number"?l:l.value,u=Math.floor(Math.random()*2**32).toString(),d=me(),p=d.fs,v=ce(p.selectedKeys),m=ce(p.sortedFiles),g=Z(()=>{const z=new Map;return m.value&&m.value.forEach($=>{z.set(s($),$)}),z}),y=U(new Set),S=U(!1),b=U(!1),x=z=>z.map($=>$.getAttribute("data-key")).filter($=>!!$),w=z=>{z.selection.clearSelection(!0,!0)},k=z=>{if(v.value&&v.value.size>0){const $=document.querySelectorAll(`.file-item-${u}[data-key]`),H=new Map;$.forEach(Q=>{const ne=Q.getAttribute("data-key");ne&&H.set(ne,Q)});const B=[];v.value.forEach(Q=>{const ne=H.get(Q);ne&&E(Q)&&B.push(ne)}),B.forEach(Q=>{z.selection.select(Q,!0)})}},E=z=>{const $=g.value.get(z);if(!$)return!1;const H=d.selectionFilterType,B=d.selectionFilterMimeIncludes;return H==="files"&&$.type==="dir"||H==="dirs"&&$.type==="file"?!1:B&&Array.isArray(B)&&B.length>0?$.type==="dir"?!0:$.mime_type?B.some(Q=>$.mime_type?.startsWith(Q)):!1:!0},O=z=>{if(d.selectionMode==="single")return!1;S.value=!1,!z.event?.metaKey&&!z.event?.ctrlKey&&(b.value=!0),z.selection.resolveSelectables(),w(z),k(z)},F=U(0),j=({event:z,selection:$})=>{F.value=(o.value?.getAreaLocation().y1??0)-(d.root.getBoundingClientRect().top??0);const H=document.querySelector(".selection-area-container");if(H&&(H.dataset.theme=d.theme.current),d.selectionMode==="single")return;const B=z;B&&"type"in B&&B.type==="touchend"&&B.preventDefault();const Q=z;!Q?.ctrlKey&&!Q?.metaKey&&(p.clearSelection(),$.clearSelection(!0,!0)),y.value.clear()},R=z=>{if(d.selectionMode==="single")return;const $=x(z.store.changed.added),H=x(z.store.changed.removed);b.value=!1,S.value=!0,$.forEach(B=>{v.value&&!v.value.has(B)&&E(B)&&(y.value.add(B),p.select(B,d.selectionMode||"multiple"))}),H.forEach(B=>{document.querySelector(`[data-key="${B}"]`)&&g.value.has(B)&&y.value.delete(B),p.deselect(B)}),z.selection.resolveSelectables(),k(z)},T=()=>{y.value.clear()},D=z=>{if(!z.event)return;const $=document.querySelector(".scroller-"+u);if(!$)return;const H=$.getBoundingClientRect(),B=H.left,Q=H.top;let ne=$.scrollTop;if(a?.value){const{viewport:Ve}=a.value.elements();Ve&&(ne=Ve.scrollTop)}const Y=o.value?.getAreaLocation();if(!Y)return;const se=Math.min(Y.x1,Y.x2),te=ne+Math.min(Y.y1,Y.y2),A=Math.max(Y.x1,Y.x2),ie=ne+Math.max(Y.y1,Y.y2),G=4,N=c();let ae=Math.floor((se-B-G)/N),le=Math.floor((A-B-G)/N);const q=se-B-G-ae*N,V=A-B-G-le*N;q>N-G&&(ae=ae+1),V<G&&(le=le-1);const oe=Math.max(0,ae),re=Math.min(e.value-1,le);let ye=Math.floor((te-Q-G)/r.value),we=Math.floor((ie-Q-G)/r.value);const Ae=te-Q-G-ye*r.value,Te=ie-Q-G-we*r.value,be=Math.floor((i.value-G)/r.value);Ae>r.value-G&&(ye=ye+1),Te<G&&(we=we-1);const He=Math.max(0,ye),Ie=Math.min(we,be),tt=n(m.value,He,Ie,oe,re),Fe=document.querySelectorAll(`.file-item-${u}[data-key]`),Ne=new Map;Fe.forEach(Ve=>{const Ct=Ve.getAttribute("data-key");Ct&&Ne.set(Ct,Ve)});const Le=[];if(tt.forEach(Ve=>{const Ct=s(Ve);Ne.get(Ct)||Le.push(Ct)}),Le.length>0){const Ve=d.selectionMode||"multiple";p.selectMultiple(Le,Ve)}},M=z=>{D(z),w(z),k(z),p.setSelectedCount(v.value?.size||0),S.value=!1},I=()=>{let z=[".scroller-"+u];if(a?.value){const{viewport:$}=a.value.elements();$&&(z=$)}o.value=new G_({selectables:[".file-item-"+u+":not(.vf-explorer-item--unselectable)"],boundaries:z,selectionContainerClass:"selection-area-container",behaviour:{overlap:"invert",intersect:"touch",startThreshold:0,triggers:[0],scrolling:{speedDivider:10,manualSpeed:750,startScrollMargins:{x:0,y:10}}},features:{touch:!0,range:!0,deselectOnBlur:!0,singleTap:{allow:!1,intersect:"native"}}}),o.value.on("beforestart",O),o.value.on("start",j),o.value.on("move",R),o.value.on("stop",M)},W=()=>{o.value&&(o.value.destroy(),o.value=null)},J=()=>{o.value&&(Array.from(v.value??new Set).forEach(z=>{E(z)||p.deselect(z)}),W(),I())},L=z=>{b.value&&(o.value?.clearSelection(),T(),b.value=!1);const $=z;!y.value.size&&!b.value&&!$?.ctrlKey&&!$?.metaKey&&(p.clearSelection(),o.value?.clearSelection())};return Re(()=>{const z=$=>{!$.buttons&&S.value&&(S.value=!1)};document.addEventListener("dragleave",z),Ge(()=>{document.removeEventListener("dragleave",z)})}),{explorerId:u,isDragging:S,initializeSelectionArea:I,updateSelectionArea:J,handleContentClick:L}}function Tk(t){const e=i=>{if(!i)return{typeAllowed:!1,mimeAllowed:!1};const n=t.selectionFilterType,s=t.selectionFilterMimeIncludes,o=!n||n==="both"||n==="files"&&i.type==="file"||n==="dirs"&&i.type==="dir";let r=!0;return s&&Array.isArray(s)&&s.length>0&&(i.type==="dir"?r=!0:i.mime_type?r=s.some(l=>i.mime_type.startsWith(l)):r=!1),{typeAllowed:o,mimeAllowed:r}};return{isItemSelectable:e,canSelectItem:i=>{const{typeAllowed:n,mimeAllowed:s}=e(i);return n&&s}}}function Mk(t){const e=i=>({item:i,defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}});return{createCancelableEvent:e,openItem:(i,n,s)=>{const o=e(i);if(i.type==="file"&&n){if(t.emitter.emit("vf-file-dclick",o),o.defaultPrevented)return}else if(i.type==="dir"&&s&&(t.emitter.emit("vf-folder-dclick",o),o.defaultPrevented))return;const r=t.contextMenuItems?.find(l=>l.show(t,{items:[i],target:i,searchQuery:""}));r&&r.action(t,[i])}}}function Rk(t,e,i,n,s,o,r){const l=t.fs,{canSelectItem:a}=Tk(t),{openItem:c}=Mk(t),u=p=>{const v=p.target?.closest(".file-item-"+e);if(!v)return null;const m=String(v.getAttribute("data-key")),g=i.value?.find(y=>y.path===m);return{key:m,item:g}},d=()=>{const p=n.value;return i.value?.filter(v=>p?.has(v.path))||[]};return{handleItemClick:p=>{const v=u(p);if(!v)return;const{key:m,item:g}=v,y=p;if(!a(g))return;const S=t.selectionMode||"multiple";!y?.ctrlKey&&!y?.metaKey&&(p.type!=="touchstart"||!l.isSelected(m))&&(l.clearSelection(),s.value?.clearSelection(!0,!0)),s.value?.resolveSelectables(),p.type==="touchstart"&&l.isSelected(m)?l.select(m,S):l.toggleSelect(m,S),l.setSelectedCount(n.value?.size||0)},handleItemDblClick:p=>{const v=u(p);if(!v)return;const{item:m}=v;a(m)&&m&&c(m,o,r)},handleItemContextMenu:p=>{p.preventDefault(),p.stopPropagation();const v=u(p);if(!v)return;const{key:m,item:g}=v;a(g)&&(n.value?.has(m)||(l.clearSelection(),l.select(m)),t.emitter.emit("vf-contextmenu-show",{event:p,items:d(),target:g}))},handleContentContextMenu:p=>{p.preventDefault(),t.emitter.emit("vf-contextmenu-show",{event:p,items:d()})},getSelectedItems:d}}function Fk(t,e){const i=U(null);return Re(()=>{if(St.plugin([w_]),t.value){const n=St(t.value,{scrollbars:{theme:"vf-scrollbars-theme"}},{initialized:s=>{i.value=s;const{viewport:o}=s.elements();o&&o.addEventListener("scroll",e)},updated:s=>{const{viewport:o}=s.elements()}});i.value=n}}),Ge(()=>{if(i.value){const{viewport:n}=i.value.elements();n&&n.removeEventListener("scroll",e),i.value.destroy(),i.value=null}}),{osInstance:i}}function $k(t,e){const i=U(null);return Re(()=>{t.value&&(i.value=new Ui({elements_selector:".lazy",container:t.value})),e?.emitter&&e.emitter.on("vf-refresh-thumbnails",()=>{i.value&&i.value.update()})}),Ph(()=>{i.value&&i.value.update()}),Ge(()=>{i.value&&(i.value.destroy(),i.value=null)}),{vfLazyLoad:i}}const Ok={class:"vuefinder__explorer__container"},Pk={key:0,class:"vuefinder__linear-loader"},zk=fe({__name:"Explorer",props:{onFileDclick:{type:Function},onFolderDclick:{type:Function}},setup(t){const e=t,i=me(),n=jn(i,["vuefinder__drag-over"]),s=qi("dragImage"),o=Kr(null),r=qi("scrollContainer"),l=qi("scrollContent"),a=i.fs,c=i.config,u=ce(c.state),d=ce(a.sortedFiles),p=ce(a.selectedKeys),v=ce(a.loading),m=N=>p.value?.has(N)??!1,g=Z(()=>{if(u.value?.view==="grid"){const le=u.value?.gridItemHeight??80,q=u.value?.gridItemGap??8;return le+q*2}const N=u.value?.listItemHeight??32,ae=u.value?.listItemGap??2;return N+ae*2}),y=Z(()=>{if(u.value?.view==="grid"){const N=u.value?.gridItemWidth??96,ae=u.value?.gridItemGap??8;return N+ae*2}return 104}),S=Z(()=>u.value?.view==="grid"?(u.value?.gridItemGap??8)*2:0),{t:b}=i.i18n,{itemsPerRow:x,totalHeight:w,visibleRows:k,handleScroll:E,getRowItems:O,getItemsInRange:F,updateItemsPerRow:j}=Ek(Z(()=>d.value??[]),{scrollContainer:r,itemWidth:y,rowHeight:g,overscan:2,containerPadding:S,lockItemsPerRow:Z(()=>u.value.view==="list")}),{osInstance:R}=Fk(r,E),{explorerId:T,isDragging:D,initializeSelectionArea:M,updateSelectionArea:I,handleContentClick:W}=Ak({itemsPerRow:x,totalHeight:w,getItemsInRange:F,getKey:N=>N.path,selectionObject:o,rowHeight:g,itemWidth:y,osInstance:R}),J=U(null),L=N=>{if(!N||!J.value)return!1;const ae=p.value?.has(J.value)??!1;return D.value&&(ae?p.value?.has(N)??!1:N===J.value)};ve(()=>c.get("view"),N=>{N==="list"?x.value=1:j()},{immediate:!0}),ve(x,N=>{c.get("view")==="list"&&N!==1&&(x.value=1)});const z=N=>d.value?.[N];$k(r,i);const{handleItemClick:$,handleItemDblClick:H,handleItemContextMenu:B,handleContentContextMenu:Q}=Rk(i,T,d,p,o,e.onFileDclick,e.onFolderDclick);Re(()=>{const N=()=>{o.value||M(),o.value&&o.value.on("beforestart",({event:ae})=>{const le=ae?.target===l.value;if(!ae?.metaKey&&!ae?.ctrlKey&&!ae?.altKey&&!le)return!1})};if(R.value)N();else{const ae=setInterval(()=>{R.value&&(clearInterval(ae),N())},50);setTimeout(()=>{clearInterval(ae),o.value||N()},500)}ve(()=>[i.selectionFilterType,i.selectionFilterMimeIncludes],I,{deep:!0})});const ne=N=>{if(!(i.features?.move??!1)||N.altKey||N.ctrlKey||N.metaKey)return N.preventDefault(),!1;D.value=!0;const ae=N.target?.closest(".file-item-"+T);if(J.value=ae?String(ae.dataset.key):null,N.dataTransfer&&J.value){N.dataTransfer.setDragImage(s.value,0,15),N.dataTransfer.effectAllowed="all",N.dataTransfer.dropEffect="copy";const le=p.value?.has(J.value)?Array.from(p.value):[J.value];N.dataTransfer.setData("items",JSON.stringify(le)),a.setDraggedItem(J.value)}},Y=()=>{J.value=null};let se=null,te=null;const A=N=>{N.target?.closest(".file-item-"+T)||(te=N,se&&clearTimeout(se),se=setTimeout(()=>{te&&(te.cancelable&&te.preventDefault(),te.stopPropagation(),Q(te)),te=null,se=null},500))},ie=N=>{se&&(clearTimeout(se),se=null),te=null},G=N=>{if(!te)return;const ae=te.touches[0]||te.changedTouches[0],le=N.touches[0]||N.changedTouches[0];if(ae&&le){const q=Math.abs(le.clientX-ae.clientX),V=Math.abs(le.clientY-ae.clientY);(q>15||V>15)&&(se&&(clearTimeout(se),se=null),te=null)}};return(N,ae)=>(_(),C("div",Ok,[h(u).view==="list"?(_(),X(Ck,{key:0})):K("",!0),f("div",{ref_key:"scrollContainer",ref:r,class:ue(["vuefinder__explorer__selector-area","scroller-"+h(T)])},[h(c).get("loadingIndicator")==="linear"&&h(v)?(_(),C("div",Pk)):K("",!0),f("div",{ref_key:"scrollContent",ref:l,class:"scrollContent vuefinder__explorer__scroll-content",style:et({height:`${h(w)}px`,position:"relative",width:"100%"}),onContextmenu:ae[0]||(ae[0]=Se((...le)=>h(Q)&&h(Q)(...le),["self","prevent"])),onClick:ae[1]||(ae[1]=Se((...le)=>h(W)&&h(W)(...le),["self"])),onTouchstartCapture:Se(A,["self"]),onTouchendCapture:Se(ie,["self"]),onTouchmoveCapture:Se(G,["self"]),onTouchcancelCapture:Se(ie,["self"])},[f("div",{ref_key:"dragImage",ref:s,class:"vuefinder__explorer__drag-item"},[ee(ZS,{count:J.value&&h(p).has(J.value)?h(p).size:1},null,8,["count"])],512),h(u).view==="grid"?(_(!0),C(_e,{key:0},$e(h(k),le=>(_(),X(jc,{key:le,"row-index":le,"row-height":g.value,view:"grid","items-per-row":h(x),items:h(O)(h(d),le),"show-thumbnails":h(u).showThumbnails,"is-dragging-item":L,"is-selected":m,"drag-n-drop-events":q=>h(n).events(q),"explorer-id":h(T),onClick:h($),onDblclick:h(H),onContextmenu:h(B),onDragstart:ne,onDragend:Y},{icon:he(q=>[xe(N.$slots,"icon",We({ref_for:!0},q))]),_:3},8,["row-index","row-height","items-per-row","items","show-thumbnails","drag-n-drop-events","explorer-id","onClick","onDblclick","onContextmenu"]))),128)):(_(!0),C(_e,{key:1},$e(h(k),le=>(_(),X(jc,{key:le,"row-index":le,"row-height":g.value,view:"list",items:z(le)?[z(le)]:[],"is-dragging-item":L,"is-selected":m,"drag-n-drop-events":q=>h(n).events(q),"explorer-id":h(T),onClick:h($),onDblclick:h(H),onContextmenu:h(B),onDragstart:ne,onDragend:Y},{icon:he(q=>[xe(N.$slots,"icon",We({ref_for:!0},q))]),_:3},8,["row-index","row-height","items","drag-n-drop-events","explorer-id","onClick","onDblclick","onContextmenu"]))),128))],36)],2)]))}}),Dk=["href","download"],Ik=["onClick"],Lk=fe({__name:"ContextMenu",setup(t){const e=me(),i=U(null),n=U([]);let s=null,o=null,r=null,l=[],a=null;const c=js({active:!1,items:[],positions:{}});e.emitter.on("vf-context-selected",v=>{n.value=v});const u=v=>v.link(e,n.value),d=v=>{e.emitter.emit("vf-contextmenu-hide"),v.action(e,n.value)};e.emitter.on("vf-contextmenu-show",v=>{const{event:m,items:g,target:y=null}=v||{};c.items=(e.contextMenuItems||[]).filter(S=>S.show(e,{items:g,target:y})).sort((S,b)=>{const x=S.order??1/0,w=b.order??1/0;return x-w}),y?g.length>1&&g.some(S=>S.path===y.path)?e.emitter.emit("vf-context-selected",g):e.emitter.emit("vf-context-selected",[y]):e.emitter.emit("vf-context-selected",[]),p(m)}),e.emitter.on("vf-contextmenu-hide",()=>{c.active=!1,s&&(s(),s=null),r&&(l.forEach(v=>{v===window?window.removeEventListener("scroll",r,!0):v.removeEventListener("scroll",r,!0)}),r=null,l=[]),a&&(document.removeEventListener("mousedown",a,!0),document.removeEventListener("touchstart",a,!0),a=null),o=null,c.positions={}});const p=async v=>{s&&(s(),s=null);const m=(w=>{if("clientX"in w&&"clientY"in w)return{x:w.clientX,y:w.clientY};const k="touches"in w&&w.touches[0]||"changedTouches"in w&&w.changedTouches[0];return k?{x:k.clientX,y:k.clientY}:{x:0,y:0}})(v);if(o={getBoundingClientRect:()=>({width:0,height:0,x:m.x,y:m.y,top:m.y,left:m.x,right:m.x,bottom:m.y})},c.positions={position:"fixed",zIndex:"10001",opacity:"0",visibility:"hidden",left:"-9999px",top:"-9999px"},c.active=!0,await lt(),!i.value||!o)return;await new Promise(w=>{requestAnimationFrame(()=>{requestAnimationFrame(w)})});const g=[yn(8),bn({padding:16,fallbackPlacements:["left-start","right-end","left-end","top-start","bottom-start"]}),wn({padding:16})];let y=0,S=0;try{const w=await Yi(o,i.value,{placement:"right-start",strategy:"fixed",middleware:g});y=w.x,S=w.y}catch(w){console.warn("[ContextMenu] Floating UI initial positioning error:",w);return}c.positions={position:"fixed",zIndex:"10001",left:`${y}px`,top:`${S}px`,opacity:"0",visibility:"visible",transform:"translateY(-8px)",transition:"opacity 150ms ease-out, transform 150ms ease-out"},requestAnimationFrame(()=>{i.value&&(c.positions={...c.positions,opacity:"1",transform:"translateY(0)"})});const b=(w=>{const k=[];let E=w;for(;E&&E!==document.body&&E!==document.documentElement;){const O=window.getComputedStyle(E),F=O.overflow+O.overflowX+O.overflowY;(F.includes("scroll")||F.includes("auto"))&&k.push(E),E=E.parentElement}return k})(i.value);l=[window,...b],r=()=>{c.active&&e.emitter.emit("vf-contextmenu-hide")};const x=r;x&&l.forEach(w=>{w===window?window.addEventListener("scroll",x,!0):w.addEventListener("scroll",x,!0)}),a=w=>{if(!c.active)return;const k=w.target;if(!k||i.value&&i.value.contains(k))return;const E=e.root;E&&E.contains(k)||e.emitter.emit("vf-contextmenu-hide")},setTimeout(()=>{a&&(document.addEventListener("mousedown",a,!0),document.addEventListener("touchstart",a,!0))},100),setTimeout(()=>{if(!(!i.value||!o))try{s=ea(o,i.value,async()=>{if(!(!o||!i.value))try{const{x:w,y:k}=await Yi(o,i.value,{placement:"right-start",strategy:"fixed",middleware:g});c.positions={...c.positions,left:`${w}px`,top:`${k}px`}}catch(w){console.warn("Floating UI positioning error:",w)}})}catch(w){console.warn("Floating UI autoUpdate setup error:",w),s=null}},200)};return Ge(()=>{s&&(s(),s=null),r&&(l.forEach(v=>{v===window?window.removeEventListener("scroll",r,!0):v.removeEventListener("scroll",r,!0)}),r=null,l=[]),a&&(document.removeEventListener("mousedown",a,!0),document.removeEventListener("touchstart",a,!0),a=null),o=null}),(v,m)=>ze((_(),C("ul",{ref_key:"contextmenu",ref:i,class:ue([{"vuefinder__context-menu--active":c.active,"vuefinder__context-menu--inactive":!c.active},"vuefinder__context-menu"]),style:et(c.positions)},[(_(!0),C(_e,null,$e(c.items,g=>(_(),C("li",{key:g.title,class:"vuefinder__context-menu__item"},[g.link?(_(),C("a",{key:0,class:"vuefinder__context-menu__link",target:"_blank",href:u(g),download:u(g),onClick:m[0]||(m[0]=y=>h(e).emitter.emit("vf-contextmenu-hide"))},[f("span",null,P(g.title(h(e).i18n)),1)],8,Dk)):(_(),C("div",{key:1,class:"vuefinder__context-menu__action",onClick:y=>d(g)},[f("span",null,P(g.title(h(e).i18n)),1)],8,Ik))]))),128))],6)),[[$t,c.active]])}}),Bk={class:"vuefinder__status-bar__wrapper"},Uk={class:"vuefinder__status-bar__storage"},jk=["title"],Hk={class:"vuefinder__status-bar__storage-icon"},Nk=["value"],Vk=["value"],qk={class:"vuefinder__status-bar__info space-x-2"},Wk={key:0},Qk={key:1},Kk={key:0,class:"vuefinder__status-bar__size"},Yk={class:"vuefinder__status-bar__actions"},Xk=fe({__name:"Statusbar",setup(t){const e=me(),{t:i}=e.i18n,n=e.fs,s=ce(n.sortedFiles),o=ce(n.path),r=ce(n.selectedCount),l=ce(n.storages),a=ce(n.selectedItems),c=ce(n.path),u=y=>{const S=y.target.value;e.adapter.open(S+"://")},d=Z(()=>!a.value||a.value.length===0?0:a.value.reduce((y,S)=>y+(S.file_size||0),0)),p=Z(()=>l.value),v=Z(()=>s.value),m=Z(()=>r.value||0),g=Z(()=>a.value||[]);return(y,S)=>(_(),C("div",Bk,[f("div",Uk,[f("div",{class:"vuefinder__status-bar__storage-container",title:h(i)("Storage")},[f("div",Hk,[ee(h(Na))]),f("select",{name:"vuefinder-media-selector",value:h(o).storage,class:"vuefinder__status-bar__storage-select",tabindex:"-1",onChange:u},[(_(!0),C(_e,null,$e(p.value,b=>(_(),C("option",{key:b,value:b},P(b),9,Vk))),128))],40,Nk),S[0]||(S[0]=f("span",{class:"vuefinder__status-bar__storage-caret","aria-hidden":"true"},null,-1))],8,jk),f("div",qk,[m.value===0?(_(),C("span",Wk,P(v.value.length)+" "+P(h(i)("items")),1)):(_(),C("span",Qk,[Me(P(m.value)+" "+P(h(i)("selected"))+" ",1),d.value?(_(),C("span",Kk,P(h(e).filesize(d.value)),1)):K("",!0)]))])]),f("div",Yk,[xe(y.$slots,"actions",{path:h(c).path,count:m.value||0,selected:g.value})])]))}}),Gk={xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",class:"h-5 w-5",viewBox:"0 0 24 24"};function Jk(t,e){return _(),C("svg",Gk,[...e[0]||(e[0]=[f("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),f("path",{d:"M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2m3.6 5.2a1 1 0 0 0-1.4.2L12 10.333 9.8 7.4a1 1 0 1 0-1.6 1.2l2.55 3.4-2.55 3.4a1 1 0 1 0 1.6 1.2l2.2-2.933 2.2 2.933a1 1 0 0 0 1.6-1.2L13.25 12l2.55-3.4a1 1 0 0 0-.2-1.4"},null,-1)])])}const Zk={render:Jk};function xh(t,e){const i=t.findIndex(n=>n.path===e.path);i>-1?t[i]=e:t.push(e)}const eC={class:"vuefinder__folder-loader-indicator"},tC={key:1,class:"vuefinder__folder-loader-indicator--icon"},Sh=fe({__name:"FolderLoaderIndicator",props:zh({storage:{},path:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,i=me(),n=Nc(t,"modelValue"),s=U(!1);ve(()=>n.value,()=>o());const o=async()=>{s.value=!0;try{const r=(await i.adapter.list(e.path)).files.filter(l=>l.type==="dir");xh(i.treeViewData,{path:e.path,type:"dir",folders:r})}catch(r){ct(r,"Failed to fetch subfolders")}finally{s.value=!1}};return(r,l)=>(_(),C("div",eC,[s.value?(_(),X(h(go),{key:0,class:"vuefinder__folder-loader-indicator--loading"})):(_(),C("div",tC,[n.value?(_(),X(h(vo),{key:0,class:"vuefinder__folder-loader-indicator--minus"})):K("",!0),n.value?K("",!0):(_(),X(h(mo),{key:1,class:"vuefinder__folder-loader-indicator--plus"}))]))]))}}),iC={key:0},nC={class:"vuefinder__treesubfolderlist__no-folders"},sC={class:"vuefinder__treesubfolderlist__item-content"},oC=["onClick"],rC=["title","onDblclick","onClick"],aC={class:"vuefinder__treesubfolderlist__item-icon"},lC={class:"vuefinder__treesubfolderlist__subfolder"},cC={key:1,class:"vuefinder__treesubfolderlist__more-note"},uC=fe({__name:"TreeSubfolderList",props:{storage:{},path:{}},setup(t){const e=me(),i=e.fs,n=jn(e,["vuefinder__drag-over"]),s=U({}),o=e.config,r=ce(o.state),{t:l}=e.i18n,a=ce(i.path),c=t,u=U(null),d=U(50);Re(()=>{c.path===c.storage+"://"&&u.value&&St(u.value,{scrollbars:{theme:"vf-scrollbars-theme"}})});const p=Z(()=>{const b=e.treeViewData.find(x=>x.path===c.path)?.folders||[];return b.length>d.value?b.slice(0,d.value):b}),v=Z(()=>e.treeViewData.find(b=>b.path===c.path)?.folders?.length||0),m=Z(()=>v.value>d.value),g=Z(()=>`${c.storage}://`),y=(b,x)=>b===x||b.startsWith(`${x}/`);ve(p,b=>{const x=r.value.expandTreeByDefault&&c.path===g.value,w=r.value.expandedTreePaths||[];b.forEach(k=>{const E=w.some(O=>y(O,k.path));(x||E)&&s.value[k.path]===void 0&&(s.value[k.path]=!0)})},{immediate:!0});const S=()=>{d.value+=50};return(b,x)=>{const w=wt("TreeSubfolderList",!0);return _(),C("ul",{ref_key:"parentSubfolderList",ref:u,class:"vuefinder__treesubfolderlist__container"},[p.value.length?K("",!0):(_(),C("li",iC,[f("div",nC,P(h(l)("No folders")),1)])),(_(!0),C(_e,null,$e(p.value,k=>(_(),C("li",{key:k.path,class:"vuefinder__treesubfolderlist__item"},[f("div",sC,[f("div",{class:"vuefinder__treesubfolderlist__item-toggle",onClick:E=>s.value[k.path]=!s.value[k.path]},[ee(Sh,{modelValue:s.value[k.path],"onUpdate:modelValue":E=>s.value[k.path]=E,storage:t.storage,path:k.path},null,8,["modelValue","onUpdate:modelValue","storage","path"])],8,oC),f("div",We({class:"vuefinder__treesubfolderlist__item-link",title:k.path},di(h(n).events({...k,dir:k.path,extension:"",file_size:null,last_modified:null,mime_type:null,visibility:"public"}),!0),{onDblclick:E=>s.value[k.path]=!s.value[k.path],onClick:E=>h(e).adapter.open(k.path)}),[f("div",aC,[h(a)?.path===k.path?(_(),X(h(Va),{key:0,class:"vuefinder__item-icon__folder--open"})):(_(),X(h(Wt),{key:1,class:"vuefinder__item-icon__folder"}))]),f("div",{class:ue(["vuefinder__treesubfolderlist__item-text",{"vuefinder__treesubfolderlist__item-text--active":h(a).path===k.path}])},P(k.basename),3)],16,rC)]),f("div",lC,[ze(ee(w,{storage:c.storage,path:k.path},null,8,["storage","path"]),[[$t,s.value[k.path]]])])]))),128)),m.value?(_(),C("li",cC,[f("div",{class:"vuefinder__treesubfolderlist__load-more",onClick:S},P(h(l)("load more")),1)])):K("",!0)],512)}}}),dC=fe({__name:"TreeStorageItem",props:{storage:{}},setup(t){const e=me(),i=e.fs,n=e.config,s=t,o=ce(n.state),r=Z(()=>{const v=o.value.expandedTreePaths||[],m=`${s.storage}://`;return v.some(g=>g===m||g.startsWith(`${m}`))}),l=U(o.value.expandTreeByDefault||r.value),a=jn(e,["vuefinder__drag-over"]),c=ce(i.path),u=Z(()=>s.storage===c.value?.storage);ve(()=>({expandTreeByDefault:o.value.expandTreeByDefault,hasExpandedPathInStorage:r.value}),v=>{(v.expandTreeByDefault||v.hasExpandedPathInStorage)&&(l.value=!0)});const d={storage:s.storage,path:s.storage+"://",dir:s.storage+"://",type:"dir",basename:s.storage,extension:"",file_size:null,last_modified:null,mime_type:null,visibility:"public"};function p(v){v===c.value?.storage?l.value=!l.value:e.adapter.open(v+"://")}return(v,m)=>(_(),C(_e,null,[f("div",{class:"vuefinder__treestorageitem__header",onClick:m[2]||(m[2]=g=>p(t.storage))},[f("div",We({class:["vuefinder__treestorageitem__info",u.value?"vuefinder__treestorageitem__info--active":""]},di(h(a).events(d),!0)),[f("div",{class:ue(["vuefinder__treestorageitem__icon",u.value?"vuefinder__treestorageitem__icon--active":""])},[ee(h(Na))],2),f("div",null,P(t.storage),1)],16),f("div",{class:"vuefinder__treestorageitem__loader",onClick:m[1]||(m[1]=Se(g=>l.value=!l.value,["stop"]))},[ee(Sh,{modelValue:l.value,"onUpdate:modelValue":m[0]||(m[0]=g=>l.value=g),storage:t.storage,path:t.storage+"://"},null,8,["modelValue","storage","path"])])]),ze(ee(uC,{storage:t.storage,path:t.storage+"://",class:"vuefinder__treestorageitem__subfolder"},null,8,["storage","path"]),[[$t,l.value]])],64))}}),hC={class:"vuefinder__folder-indicator"},fC={class:"vuefinder__folder-indicator--icon"},pC=fe({__name:"FolderIndicator",props:{modelValue:{type:Boolean},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=Nc(t,"modelValue");return(i,n)=>(_(),C("div",hC,[f("div",fC,[e.value?(_(),X(h(vo),{key:0,class:"vuefinder__folder-indicator--minus"})):K("",!0),e.value?K("",!0):(_(),X(h(mo),{key:1,class:"vuefinder__folder-indicator--plus"}))])]))}}),mC={key:0,class:"vuefinder__treeview__header"},vC={class:"vuefinder__treeview__pinned-label"},gC={class:"vuefinder__treeview__pin-text text-nowrap"},_C={key:0,class:"vuefinder__treeview__pinned-list"},yC=["onClick"],wC=["title"],bC=["onClick"],xC={key:0},SC={class:"vuefinder__treeview__no-pinned"},kC=fe({__name:"TreeView",setup(t){const e=me(),{enabled:i}=It(),{t:n}=e.i18n,{getStore:s,setStore:o}=e.storage,r=e.fs,l=e.config,a=ce(l.state),c=ce(r.sortedFiles),u=ce(r.storages),d=Z(()=>u.value||[]),p=ce(r.path),v=jn(e,["vuefinder__drag-over"]),m=U(190),g=U(s("pinned-folders-opened",!0));ve(g,x=>o("pinned-folders-opened",x));const y=x=>{const w=l.get("pinnedFolders");l.set("pinnedFolders",w.filter(k=>k.path!==x.path))},S=x=>{const w=x.clientX,k=x.target.parentElement;if(!k)return;const E=k.getBoundingClientRect().width;k.classList.remove("transition-[width]"),k.classList.add("transition-none");const O=j=>{m.value=E+j.clientX-w,m.value<50&&(m.value=0,l.set("showTreeView",!1)),m.value>50&&l.set("showTreeView",!0)},F=()=>{const j=k.getBoundingClientRect();m.value=j.width,k.classList.add("transition-[width]"),k.classList.remove("transition-none"),window.removeEventListener("mousemove",O),window.removeEventListener("mouseup",F)};window.addEventListener("mousemove",O),window.addEventListener("mouseup",F)},b=U(null);return Re(()=>{b.value&&St(b.value,{overflow:{x:"hidden"},scrollbars:{theme:"vf-scrollbars-theme"}})}),ve(c,x=>{const w=x.filter(k=>k.type==="dir");xh(e.treeViewData,{path:p.value.path||"",folders:w.map(k=>({storage:k.storage,path:k.path,basename:k.basename,type:"dir"}))})}),(x,w)=>(_(),C(_e,null,[f("div",{class:ue(["vuefinder__treeview__overlay",h(a).showTreeView?"vuefinder__treeview__backdrop":"hidden"]),onClick:w[0]||(w[0]=k=>h(l).toggle("showTreeView"))},null,2),f("div",{style:et(h(a).showTreeView?"min-width:100px;max-width:75%; width: "+m.value+"px":"width: 0"),class:"vuefinder__treeview__container"},[f("div",{ref_key:"treeViewScrollElement",ref:b,class:"vuefinder__treeview__scroll"},[h(i)("pinned")?(_(),C("div",mC,[f("div",{class:"vuefinder__treeview__pinned-toggle",onClick:w[2]||(w[2]=k=>g.value=!g.value)},[f("div",vC,[ee(h(Ha),{class:"vuefinder__treeview__pin-icon"}),f("div",gC,P(h(n)("Pinned Folders")),1)]),ee(pC,{modelValue:g.value,"onUpdate:modelValue":w[1]||(w[1]=k=>g.value=k)},null,8,["modelValue"])]),g.value?(_(),C("ul",_C,[(_(!0),C(_e,null,$e(h(a).pinnedFolders,k=>(_(),C("li",{key:k.path,class:"vuefinder__treeview__pinned-item"},[f("div",We({class:"vuefinder__treeview__pinned-folder"},di(h(v).events(k),!0),{onClick:E=>h(e).adapter.open(k.path)}),[h(p).path!==k.path?(_(),X(h(Wt),{key:0,class:"vuefinder__treeview__folder-icon vuefinder__item-icon__folder"})):K("",!0),h(p).path===k.path?(_(),X(h(Va),{key:1,class:"vuefinder__item-icon__folder--open vuefinder__treeview__open-folder-icon"})):K("",!0),f("div",{title:k.path,class:ue(["vuefinder__treeview__folder-name",{"vuefinder__treeview__folder-name--active":h(p).path===k.path}])},P(k.basename),11,wC)],16,yC),f("div",{class:"vuefinder__treeview__remove-folder",onClick:E=>y(k)},[ee(h(Zk),{class:"vuefinder__treeview__remove-icon"})],8,bC)]))),128)),h(a).pinnedFolders.length?K("",!0):(_(),C("li",xC,[f("div",SC,P(h(n)("No folders pinned")),1)]))])):K("",!0)])):K("",!0),(_(!0),C(_e,null,$e(d.value,k=>(_(),C("div",{key:k,class:"vuefinder__treeview__storage"},[ee(dC,{storage:k},null,8,["storage"])]))),128))],512),f("div",{class:"vuefinder__treeview__resize-handle",onMousedown:S},null,32)],4)],64))}}),Qe={new_folder:"new_folder",selectAll:"selectAll",pinFolder:"pinFolder",unpinFolder:"unpinFolder",delete:"delete",refresh:"refresh",preview:"preview",open:"open",openDir:"openDir",download:"download",archive:"archive",unarchive:"unarchive",rename:"rename",move:"move",copy:"copy",paste:"paste"};function CC(t){return t.items.length>1&&t.items.some(e=>e.path===t.target?.path)?"many":t.target?"one":"none"}function Be(t){const e=Object.assign({needsSearchQuery:!1},t);return(i,n)=>!(e.needsSearchQuery!==!!n.searchQuery||e.target!==void 0&&e.target!==CC(n)||e.targetType!==void 0&&e.targetType!==n.target?.type||e.mimeType!==void 0&&e.mimeType!==n.target?.mime_type||e.feature!==void 0&&!(i.features[e.feature]??!1))}function pn(...t){return(e,i)=>t.some(n=>n(e,i))}function mn(...t){return(e,i)=>t.every(n=>n(e,i))}const _o=[{id:Qe.openDir,title:({t})=>t("Open containing folder"),action:(t,e)=>{const i=e[0];i&&t.adapter.open(i.dir)},show:Be({target:"one",needsSearchQuery:!0}),order:10},{id:Qe.refresh,title:({t})=>t("Refresh"),action:t=>{const e=t.fs;t.adapter.invalidateListQuery(e.path.get().path),t.adapter.open(e.path.get().path)},show:pn(Be({target:"none"}),Be({target:"many"})),order:20},{id:Qe.selectAll,title:({t})=>t("Select All"),action:t=>{t.fs.selectAll(t.selectionMode||"multiple")},show:(t,e)=>t.selectionMode==="multiple"&&Be({target:"none"})(t,e),order:30},{id:Qe.new_folder,title:({t})=>t("New Folder"),action:t=>t.modal.open(Ya),show:Be({target:"none",feature:"newfolder"}),order:40},{id:Qe.open,title:({t})=>t("Open"),action:(t,e)=>{e[0]&&t.adapter.open(e[0].path)},show:Be({target:"one",targetType:"dir"}),order:50},{id:Qe.pinFolder,title:({t})=>t("Pin Folder"),action:(t,e)=>{const i=t.config,n=i.get("pinnedFolders"),s=n.concat(e.filter(o=>n.findIndex(r=>r.path===o.path)===-1));i.set("pinnedFolders",s)},show:mn(Be({target:"one",targetType:"dir",feature:"pinned"}),(t,e)=>t.config.get("pinnedFolders").findIndex(i=>i.path===e.target?.path)===-1),order:60},{id:Qe.unpinFolder,title:({t})=>t("Unpin Folder"),action:(t,e)=>{const i=t.config,n=i.get("pinnedFolders");i.set("pinnedFolders",n.filter(s=>!e.find(o=>o.path===s.path)))},show:mn(Be({target:"one",targetType:"dir",feature:"pinned"}),(t,e)=>t.config.get("pinnedFolders").findIndex(i=>i.path===e.target?.path)!==-1),order:70},{id:Qe.preview,title:({t})=>t("Preview"),action:(t,e)=>t.modal.open(Un,{storage:e[0]?.storage,item:e[0]}),show:mn(Be({target:"one",feature:"preview"}),(t,e)=>e.target?.type!=="dir"),order:80},{id:Qe.download,link:(t,e)=>{if(e[0])return t.adapter.getDownloadUrl(e[0])},title:({t})=>t("Download"),action:()=>{},show:mn(Be({target:"one",feature:"download"}),(t,e)=>e.target?.type!=="dir"),order:90},{id:Qe.rename,title:({t})=>t("Rename"),action:(t,e)=>t.modal.open(po,{items:e}),show:Be({target:"one",feature:"rename"}),order:100},{id:Qe.move,title:({t})=>t("Move files"),action:(t,e)=>{const i=t.fs,n={storage:i.path.get().storage||"",path:i.path.get().path||"",type:"dir"};t.modal.open(sn,{items:{from:e,to:n}})},show:pn(Be({target:"one",feature:"move"}),Be({target:"many",feature:"move"})),order:110},{id:Qe.copy,title:({t})=>t("Copy"),action:(t,e)=>{e.length>0&&t.fs.setClipboard("copy",new Set(e.map(i=>i.path)))},show:pn(Be({target:"one",feature:"copy"}),Be({target:"many",feature:"copy"})),order:120},{id:Qe.paste,title:({t})=>t("Paste"),action:(t,e)=>{const i=t.fs.getClipboard();if(i?.items?.size>0){const n=t.fs.path.get();let s=n.path,o=n.storage;e.length===1&&e[0]?.type==="dir"&&(s=e[0].path,o=e[0].storage);const r={storage:o||"",path:s||"",type:"dir"};t.modal.open(i.type==="cut"?sn:Wa,{items:{from:Array.from(i.items),to:r}})}},show:(t,e)=>t.features?.copy??!1?t.fs.getClipboard()?.items?.size>0:!1,order:130},{id:Qe.archive,title:({t})=>t("Archive"),action:(t,e)=>t.modal.open(Ja,{items:e}),show:pn(Be({target:"many",feature:"archive"}),mn(Be({target:"one",feature:"archive"}),(t,e)=>e.target?.mime_type!=="application/zip")),order:140},{id:Qe.unarchive,title:({t})=>t("Unarchive"),action:(t,e)=>t.modal.open(Ga,{items:e}),show:Be({target:"one",feature:"unarchive",mimeType:"application/zip"}),order:150},{id:Qe.delete,title:({t})=>t("Delete"),action:(t,e)=>{t.modal.open(fo,{items:e})},show:pn(Be({feature:"delete",target:"one"}),Be({feature:"delete",target:"many"})),order:160}],EC=["data-theme"],AC={key:0,class:"vuefinder__external-drop-overlay vuefinder__external-drop-overlay--relative"},TC={class:"vuefinder__external-drop-message"},MC={class:"vuefinder__main__content"},RC=fe({__name:"VueFinderView",props:{id:{},driver:{},config:{},features:{},debug:{type:Boolean},locale:{},contextMenuItems:{},selectionMode:{},selectionFilterType:{},selectionFilterMimeIncludes:{},onError:{type:Function},onSelect:{type:Function},onPathChange:{type:Function},onUploadComplete:{type:Function},onDeleteComplete:{type:Function},onNotify:{type:Function},onReady:{type:Function},onFileDclick:{type:Function},onFolderDclick:{type:Function},customUploader:{type:Function}},emits:["select","path-change","upload-complete","delete-complete","notify","error","ready","file-dclick","folder-dclick","update:locale"],setup(t,{emit:e}){const i=e,n=t,s=me(),o=qi("root"),r=s.config;ve(()=>n.features,b=>{const x=eh(b);Object.keys(s.features).forEach(w=>{delete s.features[w]}),Object.assign(s.features,x)},{deep:!0});const l=s.fs,a=ce(s.i18n.localeAtom),c=ce(r.state),u=Z(()=>{const b=c.value;return{"--vf-grid-item-width":`${b.gridItemWidth}px`,"--vf-grid-item-height":`${b.gridItemHeight}px`,"--vf-grid-item-gap":`${b.gridItemGap}px`,"--vf-grid-icon-size":`${b.gridIconSize}px`,"--vf-list-item-height":`${b.listItemHeight}px`,"--vf-list-item-gap":`${b.listItemGap}px`,"--vf-list-icon-size":`${b.listIconSize}px`}});O1();const{isDraggingExternal:d,handleDragEnter:p,handleDragOver:v,handleDragLeave:m,handleDrop:g}=P1();function y(b){l.setPath(b.dirname),r.get("persist")&&r.set("path",b.dirname),l.setReadOnly(b.read_only??!1),s.modal.close(),l.setFiles(b.files),l.clearSelection(),l.setSelectedCount(0),l.setStorages(b.storages)}s.adapter.onBeforeOpen=()=>{l.setLoading(!0)},s.adapter.onAfterOpen=b=>{y(b),l.setLoading(!1)},s.emitter.on("vf-upload-complete",b=>{i("upload-complete",b)}),s.emitter.on("vf-delete-complete",b=>{i("delete-complete",b)}),s.emitter.on("vf-notify",b=>{i("notify",b)}),s.emitter.on("vf-file-dclick",b=>{i("file-dclick",b)}),s.emitter.on("vf-folder-dclick",b=>{i("folder-dclick",b)}),ve(()=>n.config?.theme,b=>{b&&r.set("theme",h(b))},{immediate:!0}),ve(a,(b,x)=>{b!==x&&i("update:locale",String(b))},{immediate:!1}),Re(()=>{s.root=o.value,ve(()=>r.get("path"),x=>{s.adapter.open(x)});const b=r.get("persist")?r.get("path"):r.get("initialPath")??"";l.setPath(b),s.adapter.open(b),l.path.listen(x=>{i("path-change",x.path)}),l.selectedItems.listen(x=>{i("select",x)}),i("ready")});const S=async b=>{const x=await g(b);x.length>0&&(s.modal.open(Xa),setTimeout(()=>{s.emitter.emit("vf-external-files-dropped",x.map(w=>w.file))},100))};return(b,x)=>(_(),C("div",{ref_key:"root",ref:o,tabindex:"0",class:ue(["vuefinder vuefinder__main vuefinder__themer",{"vuefinder--dragging-external":h(d)}]),"data-theme":h(s).theme.current,style:et(u.value),onDragenter:x[2]||(x[2]=(...w)=>h(p)&&h(p)(...w)),onDragover:x[3]||(x[3]=(...w)=>h(v)&&h(v)(...w)),onDragleave:x[4]||(x[4]=(...w)=>h(m)&&h(m)(...w)),onDrop:S},[f("div",{class:ue(h(s).theme.current),style:{height:"100%",width:"100%"}},[f("div",{class:ue([h(c)?.fullScreen?"vuefinder__main__fixed":"vuefinder__main__relative","vuefinder__main__container"]),onMousedown:x[0]||(x[0]=w=>h(s).emitter.emit("vf-contextmenu-hide")),onTouchstart:x[1]||(x[1]=w=>h(s).emitter.emit("vf-contextmenu-hide"))},[h(d)?(_(),C("div",AC,[f("div",TC,P(h(s).i18n.t("Drag and drop the files/folders to here.")),1)])):K("",!0),h(c).showMenuBar?(_(),X(sx,{key:1})):K("",!0),h(c).showToolbar?(_(),X(rS,{key:2})):K("",!0),ee(KS),f("div",MC,[ee(kC),ee(zk,{"on-file-dclick":n.onFileDclick,"on-folder-dclick":n.onFolderDclick},{icon:he(w=>[xe(b.$slots,"icon",Ht(pi(w)))]),_:3},8,["on-file-dclick","on-folder-dclick"])]),ee(Xk,null,{actions:he(w=>[xe(b.$slots,"status-bar",Ht(pi(w)))]),_:3})],34),(_(),X(Hs,{to:"body"},[ee($h,{name:"fade"},{default:he(()=>[h(s).modal.visible?(_(),X(Rt(h(s).modal.type),{key:0})):K("",!0)]),_:1})])),ee(Lk,{items:h(_o)},null,8,["items"]),h(c).notificationsEnabled?(_(),X(h(Ap),{key:0,position:h(c).notificationPosition,duration:h(c).notificationDuration,"visible-toasts":h(c).notificationVisibleToasts,"rich-colors":h(c).notificationRichColors},null,8,["position","duration","visible-toasts","rich-colors"])):K("",!0)],2)],46,EC))}}),Qr=fe({__name:"VueFinderProvider",props:{id:{},driver:{},config:{},features:{},debug:{type:Boolean,default:!1},locale:{},contextMenuItems:{default:()=>_o},selectionMode:{default:"multiple"},selectionFilterType:{default:"both"},selectionFilterMimeIncludes:{default:()=>[]},onError:{},onSelect:{},onPathChange:{},onUploadComplete:{},onDeleteComplete:{},onNotify:{},onReady:{},onFileDclick:{},onFolderDclick:{},customUploader:{}},setup(t){const e=t,i=e.id??ks(Nr);if(!i)throw new Error('VueFinderProvider requires an "id" prop.');const n=w0(e,ks("VueFinderOptions")||{});return ve(()=>e.config,s=>{if(s){const o={};for(const r in s){const l=h(s[r]);l!==void 0&&(o[r]=l)}n.config.init(o)}},{deep:!0,immediate:!0}),ve(()=>e.locale,s=>{s&&n.i18n.localeAtom&&n.i18n.localeAtom.get()!==s&&n.i18n.localeAtom.set(s)},{immediate:!0}),s0(i,n),Dh(Nr,i),Yr(()=>{o0(i)}),(s,o)=>(_(),X(RC,Ht(pi(e)),{icon:he(r=>[xe(s.$slots,"icon",Ht(pi(r)))]),"status-bar":he(r=>[xe(s.$slots,"status-bar",Ht(pi(r)))]),_:3},16))}});function kh(t){const e=me(t),i=s=>s||e.fs.path.get().path||"",n=s=>{Array.isArray(s.files)&&e.fs.setFiles(s.files)};return{async refresh(){const s=e.fs.path.get().path||"";e.adapter.invalidateListQuery(s),await e.adapter.open(s)},async open(s){await e.adapter.open(s)},preview(s){const o=(e.fs.files.get()||[]).find(r=>r.path===s);!o||o.type!=="file"||e.modal.open(Un,{storage:o.storage,item:o})},notify(s,o){Bi(e,s,o)},getPath(){return e.fs.path.get().path||""},select(s){const o=new Set((e.fs.files.get()||[]).map(l=>l.path)),r=(s||[]).filter(l=>o.has(l));e.fs.setSelection(r)},selectOne(s){new Set((e.fs.files.get()||[]).map(o=>o.path)).has(s)&&e.fs.setSelection([s])},clearSelection(){e.fs.clearSelection()},getSelectedPaths(){return(e.fs.selectedItems.get()||[]).map(s=>s.path)},async createFolder(s,o){const r=await e.adapter.createFolder({path:i(o),name:s});n(r)},async createFile(s,o){const r=await e.adapter.createFile({path:i(o),name:s});n(r)},async delete(s,o){const r=i(o),l=new Map((e.fs.files.get()||[]).map(u=>[u.path,u])),a=(s||[]).map(u=>l.get(u)).filter(u=>!!u).map(u=>({path:u.path,type:u.type})),c=await e.adapter.delete({path:r,items:a});n(c)},async rename(s,o,r){const l=await e.adapter.rename({path:i(r),item:s,name:o});n(l)},async copy(s,o,r){const l=await e.adapter.copy({path:i(r),sources:s,destination:o});n(l)},async move(s,o,r){const l=await e.adapter.move({path:i(r),sources:s,destination:o});n(l)},getFiles(){return e.fs.files.get()||[]},getStorages(){return e.fs.storages.get()||[]},isLoading(){return e.fs.isLoading()},isReadOnly(){return e.fs.getReadOnly()}}}const Hc={install(t,e={}){e.i18n=e.i18n??{};const[i]=Object.keys(e.i18n);e.locale=e.locale??i??"en",t.provide("VueFinderOptions",e),t.component("VueFinder",Qr)}},FC=Object.freeze(Object.defineProperty({__proto__:null,BaseAdapter:nh,ContextMenuIds:Qe,RemoteDriver:ho,VueFinder:Qr,VueFinderPlugin:Hc,VueFinderProvider:Qr,contextMenuItems:_o,createLocaleAtom:Jd,default:Hc,parseBackendError:Vr,useVueFinder:kh},Symbol.toStringTag,{value:"Module"}));async function $C(){const t=Ih()?.appContext.app;if(t){const{default:e}=await Eo(async()=>{const{default:i}=await Promise.resolve().then(()=>FC);return{default:i}},void 0);t.config.globalProperties.$isVueFinderPluginInstalled||(t.use(e,{i18n:{zhCN:()=>Eo(()=>import("./zhCN-0_iHo67e.js"),[]),en:()=>Eo(()=>import("./en-C_Tot-hO.js"),[])}}),t.config.globalProperties.$isVueFinderPluginInstalled=!0)}}const OC={class:"size-full"},BC=fe({__name:"index",emits:["select"],async setup(t,{emit:e}){let i,n;const{locale:s,t:o}=Lh(),r={zh:"zhCN",en:"en"},l=Z(()=>r[s.value]),a=U(null),c=U(!0);[i,n]=Bh(()=>$C()),await i,n();const u=Uh(),d=jh(`${Hh}_${u.path}`,""),p=e,v=Nh(),g=`${Vh.useLocalPrefix(!1)}/api/v1/vuefinder`,y=new ho({baseURL:g,url:{list:"/list"}}),S=U(d.value||tl.FILE_MANAGER_DIRNAME),b=Z(()=>({selectionMode:"single",driver:y,features:{search:!1,upload:!1,delete:!1,rename:!1,preview:!1,edit:!1,archive:!1,unarchive:!1,newfile:!1,newfolder:!1,fullscreen:!1,download:!1,language:!0,move:!1,copy:!1,history:!1,theme:!1,pinned:!1},contextMenuItems:[..._o,{id:"select-folder",title:()=>o("file.select"),action:(w,k)=>{if(k.length>1){il.error(o("file.multiSelect"));return}const{type:E="dir"}=k[0];if(E!=="dir"){il.error(o("file.onlyDir"));return}p("select",k[0])},show:(w,k)=>{const{target:E,items:O}=k;return O.length>1?!1:E?.type==="dir"}}],config:{initialPath:S.value,theme:v.value?"valorite":"silver"}}));function x(w){d.value=w,!w&&a.value&&(c.value=!1,lt(()=>{c.value=!0,S.value=tl.FILE_MANAGER_DIRNAME,a.value?.refresh()}))}return Re(()=>{a.value=kh("vueFinder")}),(w,k)=>{const E=wt("VueFinder");return _(),C("div",OC,[c.value?(_(),X(E,We({key:0,id:"vueFinder",locale:l.value},b.value,{onPathChange:x}),null,16,["locale"])):K("",!0)])}}});export{BC as default};
|