adminizer 4.1.0-commit.d8a06d3 → 4.1.1
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/Readme.md +46 -0
- package/assets/{VanillaJSONEditor-D-Lx670g.js → VanillaJSONEditor-DfRefswH.js} +104 -104
- package/assets/add-CJ1-zeA1.js +1 -0
- package/assets/add-form-CbNl0wdS.js +1 -0
- package/assets/add-group-form-Bt_Dx9wm.js +1 -0
- package/assets/add-group-pIFJV5qL.js +1 -0
- package/assets/add-user-D2US8hL_.js +1 -0
- package/assets/add-user-form-Bt8Jy6S2.js +1 -0
- package/assets/{app-WTooYWC3.css → app-B6cCPfWk.css} +1 -1
- package/assets/app-layout-B86jl9bH.js +1 -0
- package/assets/app-shell-CiGyzQ0C.js +1 -0
- package/assets/app-sidebar-Bz-SRwBg.js +1 -0
- package/assets/app-sidebar-header-7CNCx7Rs.js +11 -0
- package/assets/app.js +45 -37
- package/assets/breadcrumbs-_jhtTcOi.js +1 -0
- package/assets/catalog-CON6moaA.js +16 -0
- package/assets/catalog-Cc6Mk9sX.css +1 -0
- package/assets/checkbox-CQdZw5mb.js +1 -0
- package/assets/dashboard-es9ZT8qk.js +3 -0
- package/assets/{date-picker-DI1cCO7K.js → date-picker-Dz-d-YWX.js} +2 -2
- package/assets/debounce-qdyXyOeG.js +1 -0
- package/assets/del-modal-D0mrZvki.js +11 -0
- package/assets/dialog-stack-BiMbfm58.js +1 -0
- package/assets/dropdown-menu-BSBcRiXx.js +1 -0
- package/assets/{field-renderer-DVHZF6HS.js → field-renderer-B6hFAeiU.js} +3 -3
- package/assets/form-Buslty7y.js +1 -0
- package/assets/form-aqiRmPix.js +1 -0
- package/assets/{geo-json-BjiyTtMu.js → geo-json-BKmYmu3d.js} +2 -2
- package/assets/{handsontable-4mjU_b0n.js → handsontable-B8xVeMAQ.js} +5 -5
- package/assets/home-Dr72Jk-w.js +2 -0
- package/assets/icon-B-a7xg54.js +1 -0
- package/assets/index-B68_akQe.js +1 -0
- package/assets/index-B7-xTDyy.js +1 -0
- package/assets/index-BJFFlCSo.js +1 -0
- package/assets/{index-Cw5o84pO.js → index-BOuMo_nl.js} +3 -3
- package/assets/index-BzOcGsBq.js +1 -0
- package/assets/index-CFbQ2Rv0.js +1 -0
- package/assets/{index-D5ir9iUV.js → index-Cq31rrfZ.js} +1 -1
- package/assets/{index-Cgp8OfuI.js → index-D5UDXTFs.js} +1 -1
- package/assets/index-oxIQWAdI.js +41 -0
- package/assets/init-user-5H689LP0.js +1 -0
- package/assets/input-CSJjrf2i.js +1 -0
- package/assets/input-error-CK92Shhm.js +1 -0
- package/assets/label-Muj0-Efy.js +1 -0
- package/assets/list-Cvh7zbyG.js +1 -0
- package/assets/list-table-Bs_vbQiV.js +52 -0
- package/assets/login-DliJrjMQ.js +6 -0
- package/assets/manifest.json +575 -673
- package/assets/material-icon-BRS58Qpk.js +1 -0
- package/assets/module-CjG21VCT.js +1 -0
- package/assets/{monaco-editor-CJs0_GlD.js → monaco-editor-9fDiyfuW.js} +2 -2
- package/assets/{multi-select-BvRpAW8r.js → multi-select-CMQIJ0JT.js} +2 -2
- package/assets/nav-footer-IGMn9NiE.js +1 -0
- package/assets/nav-main-DBE4rMiZ.js +1 -0
- package/assets/nav-user-CjyLRyq-.js +1 -0
- package/assets/pagination-render-DUAq2klc.js +1 -0
- package/assets/popover-C_cww-4_.js +1 -0
- package/assets/register-UzQn3J0g.js +1 -0
- package/assets/{select-BWepUw-9.js → select-DzBno-dc.js} +2 -2
- package/assets/{sidebar-CAHsHdjM.js → sidebar-Dc4iqfu-.js} +2 -2
- package/assets/skeleton-Dkmj2o2Z.js +1 -0
- package/assets/sonner-De1t71Gj.js +1 -0
- package/assets/{toast-editor-CMK7QtF1.js → toast-editor-1Pul3oMs.js} +2 -2
- package/assets/tooltip-CwPrC-HD.js +1 -0
- package/assets/use-appearance-J8J2w43p.js +1 -0
- package/assets/use-window-size-DLSEoR6e.js +1 -0
- package/assets/{user-info-DFrmpJ4y.js → user-info-8RyDk7qh.js} +2 -2
- package/assets/user-menu-content-CpxTLH56.js +6 -0
- package/assets/welcome-BYKI6yO-.js +1 -0
- package/controllers/add.js +8 -8
- package/controllers/catalog/Catalog.d.ts +1 -1
- package/controllers/catalog/Catalog.js +40 -35
- package/controllers/catalog/FrontentCatalogAdapter.d.ts +36 -26
- package/controllers/catalog/FrontentCatalogAdapter.js +71 -72
- package/controllers/edit.js +8 -11
- package/controllers/list.js +2 -2
- package/controllers/login.js +16 -7
- package/controllers/navigation/edit.js +1 -1
- package/controllers/remove.js +1 -1
- package/controllers/view.js +1 -1
- package/helpers/JsUtils.d.ts +1 -0
- package/helpers/JsUtils.js +3 -0
- package/helpers/accessRightsHelper.d.ts +3 -0
- package/helpers/accessRightsHelper.js +27 -4
- package/helpers/controllerHelper.js +39 -18
- package/helpers/fieldsHelper.d.ts +3 -2
- package/helpers/fieldsHelper.js +5 -1
- package/helpers/inertiaAddHelper.d.ts +4 -5
- package/helpers/inertiaAddHelper.js +25 -7
- package/helpers/inertiaFromHelper.js +1 -1
- package/helpers/inertiaMenuHelper.d.ts +1 -1
- package/helpers/inertiaMenuHelper.js +1 -1
- package/helpers/menuHelper.d.ts +8 -3
- package/helpers/menuHelper.js +26 -17
- package/index.d.ts +2 -6
- package/index.js +5 -6
- package/interfaces/adminpanelConfig.d.ts +35 -30
- package/interfaces/global.d.ts +5 -2
- package/interfaces/types.d.ts +1 -1
- package/lib/Adminizer.d.ts +9 -3
- package/lib/Adminizer.js +32 -16
- package/lib/media-manager/Items.js +0 -3
- package/lib/requestProcessor.js +10 -3
- package/lib/v4/DataAccessor.d.ts +3 -1
- package/lib/v4/DataAccessor.js +43 -18
- package/lib/v4/I18n.js +2 -0
- package/lib/{catalog → v4/catalog}/AbstractCatalog.d.ts +89 -60
- package/lib/{catalog → v4/catalog}/AbstractCatalog.js +59 -54
- package/lib/v4/catalog/Navigation.d.ts +43 -0
- package/lib/v4/catalog/Navigation.js +457 -0
- package/lib/{controls → v4/controls}/AbstractControls.d.ts +1 -1
- package/lib/{controls → v4/controls}/codeEditor/MonacoEditor.d.ts +1 -1
- package/lib/{controls → v4/controls}/geojsoneditor/GeoEditor.d.ts +1 -1
- package/lib/{controls → v4/controls}/jsoneditor/JsonEditor.d.ts +1 -1
- package/lib/{controls → v4/controls}/markdown/ToastUiEditor.d.ts +1 -1
- package/lib/{controls → v4/controls}/table/Handsontable.d.ts +1 -1
- package/lib/{controls → v4/controls}/wysiwyg/CKeditor.d.ts +1 -1
- package/lib/{datatable → v4/datatable}/NodeTable.d.ts +3 -3
- package/lib/{datatable → v4/datatable}/NodeTable.js +8 -5
- package/lib/v4/model/AbstractModel.d.ts +5 -1
- package/lib/v4/model/AbstractModel.js +2 -1
- package/lib/v4/model/ModelHandler.js +1 -3
- package/lib/v4/model/adapter/sequelize.d.ts +8 -0
- package/lib/v4/model/adapter/sequelize.js +274 -133
- package/lib/v4/model/adapter/waterline.js +5 -2
- package/lib/{widgets → v4/widgets}/abstractLink.d.ts +1 -1
- package/lib/{widgets → v4/widgets}/abstractWidgetBase.d.ts +1 -1
- package/lib/{widgets → v4/widgets}/widgetHandler.d.ts +11 -4
- package/lib/{widgets → v4/widgets}/widgetHandler.js +1 -1
- package/models/NavigationAP.d.ts +2 -3
- package/models/NavigationAP.js +5 -6
- package/models/UserAP.d.ts +2 -3
- package/package.json +17 -6
- package/system/Router.js +8 -11
- package/system/bindAccessRights.js +0 -4
- package/system/bindControls.js +6 -6
- package/system/bindDev.js +1 -0
- package/system/bindInertia.js +9 -4
- package/system/bindMediaManager.js +0 -1
- package/system/bindModels.js +9 -6
- package/system/bindNavigation.d.ts +2 -0
- package/system/bindNavigation.js +42 -42
- package/system/bindReqFunctions.js +0 -1
- package/system/defaults.js +13 -6
- package/translations/ar.json +70 -1
- package/translations/cn.json +70 -1
- package/translations/de.json +71 -3
- package/translations/en.json +70 -102
- package/translations/es.json +70 -1
- package/translations/fr.json +70 -1
- package/translations/hi.json +70 -1
- package/translations/jp.json +70 -1
- package/translations/ko.json +70 -1
- package/translations/pt.json +70 -1
- package/translations/ru.json +71 -103
- package/translations/ua.json +70 -1
- package/translations/uz.json +72 -0
- package/translations/vi.json +70 -1
- package/assets/add-BP_u3Tjl.js +0 -1
- package/assets/add-form-nffmiYTh.js +0 -1
- package/assets/add-group-D4vcHlm-.js +0 -1
- package/assets/add-group-form-gNJW11-q.js +0 -1
- package/assets/add-user-DWh3Nas0.js +0 -1
- package/assets/add-user-form-BJ0FsZYJ.js +0 -1
- package/assets/app-layout-DYsRFUuP.js +0 -1
- package/assets/app-shell-Dd9Eknik.js +0 -1
- package/assets/app-sidebar-BOmu6-Sl.js +0 -1
- package/assets/app-sidebar-header-CoXSzWxk.js +0 -11
- package/assets/breadcrumbs-BmAq4fHT.js +0 -1
- package/assets/button-C9B_5Jf_.js +0 -1
- package/assets/checkbox-Fg27sL_1.js +0 -1
- package/assets/compiler-runtime-hB6dAw2d.js +0 -9
- package/assets/dashboard-BACj996r.js +0 -3
- package/assets/dropdown-menu-Bhj17ENm.js +0 -1
- package/assets/form-BgWdwvz1.js +0 -1
- package/assets/form-DgtErfln.js +0 -1
- package/assets/home-CHntBHJa.js +0 -2
- package/assets/icon-Dt0vBgDO.js +0 -1
- package/assets/index-B8BS9wMC.js +0 -1
- package/assets/index-BC0yfOHo.js +0 -1
- package/assets/index-BKCgnGj_.js +0 -1
- package/assets/index-BbXEMx9n.js +0 -1
- package/assets/index-BykbU6Ee.js +0 -41
- package/assets/index-CaJgc5EZ.js +0 -1
- package/assets/index-DrWfGwtf.js +0 -1
- package/assets/init-user-JfCKJ5Ce.js +0 -1
- package/assets/input-CvRbIbk4.js +0 -1
- package/assets/input-error-DMK7cAt7.js +0 -1
- package/assets/label-CSLFe9Bz.js +0 -1
- package/assets/list-B2Oa5O_Q.js +0 -1
- package/assets/list-table-DA9MhywL.js +0 -62
- package/assets/login-DQwGtdis.js +0 -6
- package/assets/material-icon-BJg8o_fs.js +0 -1
- package/assets/module-DWXp59Vg.js +0 -1
- package/assets/nav-footer-Bs4dmN1d.js +0 -1
- package/assets/nav-main-Bq3IMk4C.js +0 -1
- package/assets/nav-user-CbB22J5O.js +0 -1
- package/assets/pagination-render-DuXDDbC_.js +0 -1
- package/assets/popover-DtoGI2b1.js +0 -1
- package/assets/register-BSogVF0h.js +0 -1
- package/assets/skeleton-COOcAA8f.js +0 -1
- package/assets/sonner-BI0IFOQN.js +0 -1
- package/assets/tooltip-DHwpLKOI.js +0 -1
- package/assets/use-appearance-DRfIqTgw.js +0 -1
- package/assets/use-window-size-h0Sh_NvX.js +0 -1
- package/assets/user-menu-content-DPXQdERj.js +0 -6
- package/assets/utils-DjqsqOe8.js +0 -1
- package/assets/welcome-B4WCIXKf.js +0 -1
- package/controllers/processInstallFinalize.d.ts +0 -1
- package/controllers/processInstallFinalize.js +0 -16
- package/controllers/processInstallStep.d.ts +0 -0
- package/controllers/processInstallStep.js +0 -122
- package/lib/catalog/Navigation.d.ts +0 -0
- package/lib/catalog/Navigation.js +0 -532
- package/lib/installStepper/InstallStepAbstract.d.ts +0 -52
- package/lib/installStepper/InstallStepAbstract.js +0 -69
- package/lib/installStepper/finalizeStep.d.ts +0 -21
- package/lib/installStepper/finalizeStep.js +0 -48
- package/lib/installStepper/installStepper.d.ts +0 -40
- package/lib/installStepper/installStepper.js +0 -195
- package/models/MediaManagerAP.d.ts +0 -62
- package/models/MediaManagerAP.js +0 -45
- package/models/MediaManagerAssociationsAP.d.ts +0 -38
- package/models/MediaManagerAssociationsAP.js +0 -27
- package/models/MediaManagerMetaAP.d.ts +0 -30
- package/models/MediaManagerMetaAP.js +0 -21
- package/system/bindInstallStepper.d.ts +0 -2
- package/system/bindInstallStepper.js +0 -23
- /package/lib/{catalog → v4/catalog}/CatalogHandler.d.ts +0 -0
- /package/lib/{catalog → v4/catalog}/CatalogHandler.js +0 -0
- /package/lib/{controls → v4/controls}/AbstractControls.js +0 -0
- /package/lib/{controls → v4/controls}/ControlsHandler.d.ts +0 -0
- /package/lib/{controls → v4/controls}/ControlsHandler.js +0 -0
- /package/lib/{controls → v4/controls}/codeEditor/MonacoEditor.js +0 -0
- /package/lib/{controls → v4/controls}/geojsoneditor/GeoEditor.js +0 -0
- /package/lib/{controls → v4/controls}/jsoneditor/JsonEditor.js +0 -0
- /package/lib/{controls → v4/controls}/markdown/ToastUiEditor.js +0 -0
- /package/lib/{controls → v4/controls}/table/Handsontable.js +0 -0
- /package/lib/{controls → v4/controls}/wysiwyg/CKeditor.js +0 -0
- /package/lib/{inertia → v4/inertia}/flash.d.ts +0 -0
- /package/lib/{inertia → v4/inertia}/flash.js +0 -0
- /package/lib/{inertia → v4/inertia}/inertiaAdapter.d.ts +0 -0
- /package/lib/{inertia → v4/inertia}/inertiaAdapter.js +0 -0
- /package/lib/{widgets → v4/widgets}/abstractAction.d.ts +0 -0
- /package/lib/{widgets → v4/widgets}/abstractAction.js +0 -0
- /package/lib/{widgets → v4/widgets}/abstractCustom.d.ts +0 -0
- /package/lib/{widgets → v4/widgets}/abstractCustom.js +0 -0
- /package/lib/{widgets → v4/widgets}/abstractInfo.d.ts +0 -0
- /package/lib/{widgets → v4/widgets}/abstractInfo.js +0 -0
- /package/lib/{widgets → v4/widgets}/abstractLink.js +0 -0
- /package/lib/{widgets → v4/widgets}/abstractSwitch.d.ts +0 -0
- /package/lib/{widgets → v4/widgets}/abstractSwitch.js +0 -0
- /package/lib/{widgets → v4/widgets}/abstractWidgetBase.js +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{r as h,j as m,g as od,W,c as Pe,a as Oa,b as ad,u as ge,R as cd,d as Ma,B as Ke,e as ee,f as ld}from"./app.js";import{A as ud}from"./app-layout-B86jl9bH.js";import{r as dd,d as fd}from"./debounce-qdyXyOeG.js";import{S as Si,a as Ci,b as Ei,c as Di,d as Pi}from"./select-DzBno-dc.js";import{I as zr}from"./input-CSJjrf2i.js";import{S as yr}from"./skeleton-Dkmj2o2Z.js";import Hn from"./material-icon-BRS58Qpk.js";import{C as hd}from"./chevron-right-D5q8rF7h.js";import{L as at}from"./loader-circle-Utah5tGx.js";import{P as pd,D as gd,B as md}from"./del-modal-D0mrZvki.js";import{u as vd,c as B,a as yd,b as xd,o as bd,s as Td,f as wd,d as Sd,e as Cd,h as Ed,l as Dd,g as Pd,i as Od,j as Md}from"./index-CFbQ2Rv0.js";import{c as on,u as Fe,a as Wr}from"./index-Cq31rrfZ.js";import{u as Ia}from"./index-B7-xTDyy.js";import{h as Id,u as Rd,R as Ad}from"./index-oxIQWAdI.js";import{P as tr}from"./index-BzOcGsBq.js";import{D as Nd,a as xr,b as _d,c as Ld}from"./dialog-stack-BiMbfm58.js";import Ms from"./add-form-CbNl0wdS.js";import{L as Ct}from"./label-Muj0-Efy.js";import{C as Ra}from"./checkbox-CQdZw5mb.js";import{c as Aa}from"./createLucideIcon-BFG25zNo.js";import{t as Is,T as kd}from"./sonner-De1t71Gj.js";import{D as jd,a as Vd,b as Fd,c as Bd}from"./dropdown-menu-BSBcRiXx.js";import"./sidebar-Dc4iqfu-.js";import"./index-BOuMo_nl.js";import"./index-B68_akQe.js";import"./tooltip-CwPrC-HD.js";import"./index-D5UDXTFs.js";import"./app-shell-CiGyzQ0C.js";import"./app-sidebar-Bz-SRwBg.js";import"./nav-main-DBE4rMiZ.js";import"./index-BJFFlCSo.js";import"./chevrons-up-down-kALltqHV.js";import"./app-sidebar-header-7CNCx7Rs.js";import"./breadcrumbs-_jhtTcOi.js";import"./nav-user-CjyLRyq-.js";import"./user-info-8RyDk7qh.js";import"./user-menu-content-CpxTLH56.js";import"./icon-B-a7xg54.js";import"./use-appearance-J8J2w43p.js";import"./index-DwctwfU0.js";import"./chevron-down-B5XuAFRu.js";import"./check-LAUWAnlX.js";import"./trash-2-BoK5Xp2F.js";import"./field-renderer-B6hFAeiU.js";import"./dynamic-controls-CSVVCONh.js";import"./multi-select-CMQIJ0JT.js";import"./popover-C_cww-4_.js";import"./search-BspystAk.js";import"./form-state-702tb_BV.js";import"./input-error-CK92Shhm.js";import"./move-left-BhKZRPb4.js";/**
|
|
2
|
+
* @license lucide-react v0.485.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const $d=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],Ud=Aa("ban",$d);/**
|
|
7
|
+
* @license lucide-react v0.485.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const Hd=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Na=Aa("plus",Hd);function _a(t){let e=null;return()=>(e==null&&(e=t()),e)}function zd(t,e){return t.filter(n=>n!==e)}function Wd(t,e){const n=new Set,r=s=>n.add(s);t.forEach(r),e.forEach(r);const i=[];return n.forEach(s=>i.push(s)),i}class Gd{enter(e){const n=this.entered.length,r=i=>this.isNodeInDocument(i)&&(!i.contains||i.contains(e));return this.entered=Wd(this.entered.filter(r),[e]),n===0&&this.entered.length>0}leave(e){const n=this.entered.length;return this.entered=zd(this.entered.filter(this.isNodeInDocument),e),n>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}class Kd{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){const n={};Object.keys(this.config.exposeProperties).forEach(r=>{const i=this.config.exposeProperties[r];i!=null&&(n[r]={value:i(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,n)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,n){return n===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}const La="__NATIVE_FILE__",ka="__NATIVE_URL__",ja="__NATIVE_TEXT__",Va="__NATIVE_HTML__",Rs=Object.freeze(Object.defineProperty({__proto__:null,FILE:La,HTML:Va,TEXT:ja,URL:ka},Symbol.toStringTag,{value:"Module"}));function br(t,e,n){const r=e.reduce((i,s)=>i||t.getData(s),"");return r??n}const Gr={[La]:{exposeProperties:{files:t=>Array.prototype.slice.call(t.files),items:t=>t.items,dataTransfer:t=>t},matchesTypes:["Files"]},[Va]:{exposeProperties:{html:(t,e)=>br(t,e,""),dataTransfer:t=>t},matchesTypes:["Html","text/html"]},[ka]:{exposeProperties:{urls:(t,e)=>br(t,e,"").split(`
|
|
12
|
+
`),dataTransfer:t=>t},matchesTypes:["Url","text/uri-list"]},[ja]:{exposeProperties:{text:(t,e)=>br(t,e,""),dataTransfer:t=>t},matchesTypes:["Text","text/plain"]}};function qd(t,e){const n=Gr[t];if(!n)throw new Error(`native type ${t} has no configuration`);const r=new Kd(n);return r.loadDataTransfer(e),r}function Tr(t){if(!t)return null;const e=Array.prototype.slice.call(t.types||[]);return Object.keys(Gr).filter(n=>{const r=Gr[n];return r!=null&&r.matchesTypes?r.matchesTypes.some(i=>e.indexOf(i)>-1):!1})[0]||null}const Yd=_a(()=>/firefox/i.test(navigator.userAgent)),Fa=_a(()=>!!window.safari);class As{interpolate(e){const{xs:n,ys:r,c1s:i,c2s:s,c3s:o}=this;let a=n.length-1;if(e===n[a])return r[a];let c=0,l=o.length-1,u;for(;c<=l;){u=Math.floor(.5*(c+l));const p=n[u];if(p<e)c=u+1;else if(p>e)l=u-1;else return r[u]}a=Math.max(0,l);const d=e-n[a],f=d*d;return r[a]+i[a]*d+s[a]*f+o[a]*d*f}constructor(e,n){const{length:r}=e,i=[];for(let p=0;p<r;p++)i.push(p);i.sort((p,v)=>e[p]<e[v]?-1:1);const s=[],o=[];let a,c;for(let p=0;p<r-1;p++)a=e[p+1]-e[p],c=n[p+1]-n[p],s.push(a),o.push(c/a);const l=[o[0]];for(let p=0;p<s.length-1;p++){const v=o[p],g=o[p+1];if(v*g<=0)l.push(0);else{a=s[p];const x=s[p+1],y=a+x;l.push(3*y/((y+x)/v+(y+a)/g))}}l.push(o[o.length-1]);const u=[],d=[];let f;for(let p=0;p<l.length-1;p++){f=o[p];const v=l[p],g=1/s[p],x=v+l[p+1]-f-f;u.push((f-v-x)*g),d.push(x*g*g)}this.xs=e,this.ys=n,this.c1s=l,this.c2s=u,this.c3s=d}}const Xd=1;function Ba(t){const e=t.nodeType===Xd?t:t.parentElement;if(!e)return null;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function Tn(t){return{x:t.clientX,y:t.clientY}}function Zd(t){var e;return t.nodeName==="IMG"&&(Yd()||!(!((e=document.documentElement)===null||e===void 0)&&e.contains(t)))}function Jd(t,e,n,r){let i=t?e.width:n,s=t?e.height:r;return Fa()&&t&&(s/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:s}}function Qd(t,e,n,r,i){const s=Zd(e),a=Ba(s?t:e),c={x:n.x-a.x,y:n.y-a.y},{offsetWidth:l,offsetHeight:u}=t,{anchorX:d,anchorY:f}=r,{dragPreviewWidth:p,dragPreviewHeight:v}=Jd(s,e,l,u),g=()=>{let P=new As([0,.5,1],[c.y,c.y/u*v,c.y+v-u]).interpolate(f);return Fa()&&s&&(P+=(window.devicePixelRatio-1)*v),P},x=()=>new As([0,.5,1],[c.x,c.x/l*p,c.x+p-l]).interpolate(d),{offsetX:y,offsetY:b}=i,T=y===0||y,S=b===0||b;return{x:T?y:x(),y:S?b:g()}}let ef=class{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var e;return!((e=this.globalContext)===null||e===void 0)&&e.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var e;return((e=this.optionsArgs)===null||e===void 0?void 0:e.rootElement)||this.window}constructor(e,n){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=n}};function tf(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ns(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){tf(t,i,n[i])})}return t}class nf{profile(){var e,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((e=this.dragStartSourceIds)===null||e===void 0?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){const e=this.rootElement;if(e!==void 0&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(e,n,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,n,r){this.sourceNodes.set(e,n),this.sourceNodeOptions.set(e,r);const i=o=>this.handleDragStart(o,e),s=o=>this.handleSelectStart(o);return n.setAttribute("draggable","true"),n.addEventListener("dragstart",i),n.addEventListener("selectstart",s),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),n.removeEventListener("dragstart",i),n.removeEventListener("selectstart",s),n.setAttribute("draggable","false")}}connectDropTarget(e,n){const r=o=>this.handleDragEnter(o,e),i=o=>this.handleDragOver(o,e),s=o=>this.handleDrop(o,e);return n.addEventListener("dragenter",r),n.addEventListener("dragover",i),n.addEventListener("drop",s),()=>{n.removeEventListener("dragenter",r),n.removeEventListener("dragover",i),n.removeEventListener("drop",s)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(e);return Ns({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(e);return Ns({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(Rs).some(n=>Rs[n]===e)}beginDragNativeItem(e,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=qd(e,n),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;const n=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},n)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)===null||e===void 0||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,n){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}handleDragEnter(e,n){this.dragEnterTargetIds.unshift(n)}handleDragOver(e,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}handleDrop(e,n){this.dropTargetIds.unshift(n)}constructor(e,n,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=i=>{const s=this.sourceNodes.get(i);return s&&Ba(s)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=i=>!!(i&&this.document&&this.document.body&&this.document.body.contains(i)),this.endDragIfSourceWasRemovedFromDOM=()=>{const i=this.currentDragSourceNode;i==null||this.isNodeInDocument(i)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=i=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(i||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=i=>{if(i.defaultPrevented)return;const{dragStartSourceIds:s}=this;this.dragStartSourceIds=null;const o=Tn(i);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(s||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:o});const{dataTransfer:a}=i,c=Tr(a);if(this.monitor.isDragging()){if(a&&typeof a.setDragImage=="function"){const u=this.monitor.getSourceId(),d=this.sourceNodes.get(u),f=this.sourcePreviewNodes.get(u)||d;if(f){const{anchorX:p,anchorY:v,offsetX:g,offsetY:x}=this.getCurrentSourcePreviewNodeOptions(),T=Qd(d,f,o,{anchorX:p,anchorY:v},{offsetX:g,offsetY:x});a.setDragImage(f,T.x,T.y)}}try{a==null||a.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(i.target);const{captureDraggingState:l}=this.getCurrentSourcePreviewNodeOptions();l?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(c)this.beginDragNativeItem(c);else{if(a&&!a.types&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=i=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var s;(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(i.dataTransfer)}if(!this.enterLeaveCounter.enter(i.target)||this.monitor.isDragging())return;const{dataTransfer:a}=i,c=Tr(a);c&&this.beginDragNativeItem(c,a)},this.handleTopDragEnter=i=>{const{dragEnterTargetIds:s}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=i.altKey,s.length>0&&this.actions.hover(s,{clientOffset:Tn(i)}),s.some(a=>this.monitor.canDropOnTarget(a))&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=i=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var s;(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(i.dataTransfer)}},this.handleTopDragOver=i=>{const{dragOverTargetIds:s}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}this.altKeyPressed=i.altKey,this.lastClientOffset=Tn(i),this.scheduleHover(s),(s||[]).some(a=>this.monitor.canDropOnTarget(a))?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=i=>{this.isDraggingNativeItem()&&i.preventDefault(),this.enterLeaveCounter.leave(i.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=i=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var s;i.preventDefault(),(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(i.dataTransfer)}else Tr(i.dataTransfer)&&i.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=i=>{const{dropTargetIds:s}=this;this.dropTargetIds=[],this.actions.hover(s,{clientOffset:Tn(i)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=i=>{const s=i.target;typeof s.dragDrop=="function"&&(s.tagName==="INPUT"||s.tagName==="SELECT"||s.tagName==="TEXTAREA"||s.isContentEditable||(i.preventDefault(),s.dragDrop()))},this.options=new ef(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new Gd(this.isNodeInDocument)}}let wn;function rf(){return wn||(wn=new Image,wn.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),wn}const sf=function(e,n,r){return new nf(e,n,r)};var ct=[],of=function(){return ct.some(function(t){return t.activeTargets.length>0})},af=function(){return ct.some(function(t){return t.skippedTargets.length>0})},_s="ResizeObserver loop completed with undelivered notifications.",cf=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:_s}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=_s),window.dispatchEvent(t)},Zt;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Zt||(Zt={}));var lt=function(t){return Object.freeze(t)},lf=function(){function t(e,n){this.inlineSize=e,this.blockSize=n,lt(this)}return t}(),$a=function(){function t(e,n,r,i){return this.x=e,this.y=n,this.width=r,this.height=i,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,lt(this)}return t.prototype.toJSON=function(){var e=this,n=e.x,r=e.y,i=e.top,s=e.right,o=e.bottom,a=e.left,c=e.width,l=e.height;return{x:n,y:r,top:i,right:s,bottom:o,left:a,width:c,height:l}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),Oi=function(t){return t instanceof SVGElement&&"getBBox"in t},Ua=function(t){if(Oi(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var i=t,s=i.offsetWidth,o=i.offsetHeight;return!(s||o||t.getClientRects().length)},Ls=function(t){var e;if(t instanceof Element)return!0;var n=(e=t==null?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},uf=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},zt=typeof window<"u"?window:{},Sn=new WeakMap,ks=/auto|scroll/,df=/^tb|vertical/,ff=/msie|trident/i.test(zt.navigator&&zt.navigator.userAgent),Ie=function(t){return parseFloat(t||"0")},Et=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new lf((n?e:t)||0,(n?t:e)||0)},js=lt({devicePixelContentBoxSize:Et(),borderBoxSize:Et(),contentBoxSize:Et(),contentRect:new $a(0,0,0,0)}),Ha=function(t,e){if(e===void 0&&(e=!1),Sn.has(t)&&!e)return Sn.get(t);if(Ua(t))return Sn.set(t,js),js;var n=getComputedStyle(t),r=Oi(t)&&t.ownerSVGElement&&t.getBBox(),i=!ff&&n.boxSizing==="border-box",s=df.test(n.writingMode||""),o=!r&&ks.test(n.overflowY||""),a=!r&&ks.test(n.overflowX||""),c=r?0:Ie(n.paddingTop),l=r?0:Ie(n.paddingRight),u=r?0:Ie(n.paddingBottom),d=r?0:Ie(n.paddingLeft),f=r?0:Ie(n.borderTopWidth),p=r?0:Ie(n.borderRightWidth),v=r?0:Ie(n.borderBottomWidth),g=r?0:Ie(n.borderLeftWidth),x=d+l,y=c+u,b=g+p,T=f+v,S=a?t.offsetHeight-T-t.clientHeight:0,C=o?t.offsetWidth-b-t.clientWidth:0,P=i?x+b:0,D=i?y+T:0,E=r?r.width:Ie(n.width)-P-C,k=r?r.height:Ie(n.height)-D-S,A=E+x+C+b,G=k+y+S+T,K=lt({devicePixelContentBoxSize:Et(Math.round(E*devicePixelRatio),Math.round(k*devicePixelRatio),s),borderBoxSize:Et(A,G,s),contentBoxSize:Et(E,k,s),contentRect:new $a(d,c,E,k)});return Sn.set(t,K),K},za=function(t,e,n){var r=Ha(t,n),i=r.borderBoxSize,s=r.contentBoxSize,o=r.devicePixelContentBoxSize;switch(e){case Zt.DEVICE_PIXEL_CONTENT_BOX:return o;case Zt.BORDER_BOX:return i;default:return s}},hf=function(){function t(e){var n=Ha(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=lt([n.borderBoxSize]),this.contentBoxSize=lt([n.contentBoxSize]),this.devicePixelContentBoxSize=lt([n.devicePixelContentBoxSize])}return t}(),Wa=function(t){if(Ua(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},pf=function(){var t=1/0,e=[];ct.forEach(function(o){if(o.activeTargets.length!==0){var a=[];o.activeTargets.forEach(function(l){var u=new hf(l.target),d=Wa(l.target);a.push(u),l.lastReportedSize=za(l.target,l.observedBox),d<t&&(t=d)}),e.push(function(){o.callback.call(o.observer,a,o.observer)}),o.activeTargets.splice(0,o.activeTargets.length)}});for(var n=0,r=e;n<r.length;n++){var i=r[n];i()}return t},Vs=function(t){ct.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(i){i.isActive()&&(Wa(i.target)>t?n.activeTargets.push(i):n.skippedTargets.push(i))})})},gf=function(){var t=0;for(Vs(t);of();)t=pf(),Vs(t);return af()&&cf(),t>0},wr,Ga=[],mf=function(){return Ga.splice(0).forEach(function(t){return t()})},vf=function(t){if(!wr){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return mf()}).observe(n,r),wr=function(){n.textContent="".concat(e?e--:e++)}}Ga.push(t),wr()},yf=function(t){vf(function(){requestAnimationFrame(t)})},_n=0,xf=function(){return!!_n},bf=250,Tf={attributes:!0,characterData:!0,childList:!0,subtree:!0},Fs=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Bs=function(t){return t===void 0&&(t=0),Date.now()+t},Sr=!1,wf=function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=bf),!Sr){Sr=!0;var r=Bs(e);yf(function(){var i=!1;try{i=gf()}finally{if(Sr=!1,e=r-Bs(),!xf())return;i?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,Tf)};document.body?n():zt.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Fs.forEach(function(n){return zt.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Fs.forEach(function(n){return zt.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t}(),Kr=new wf,$s=function(t){!_n&&t>0&&Kr.start(),_n+=t,!_n&&Kr.stop()},Sf=function(t){return!Oi(t)&&!uf(t)&&getComputedStyle(t).display==="inline"},Cf=function(){function t(e,n){this.target=e,this.observedBox=n||Zt.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=za(this.target,this.observedBox,!0);return Sf(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),Ef=function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t}(),Cn=new WeakMap,Us=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},En=function(){function t(){}return t.connect=function(e,n){var r=new Ef(e,n);Cn.set(e,r)},t.observe=function(e,n,r){var i=Cn.get(e),s=i.observationTargets.length===0;Us(i.observationTargets,n)<0&&(s&&ct.push(i),i.observationTargets.push(new Cf(n,r&&r.box)),$s(1),Kr.schedule())},t.unobserve=function(e,n){var r=Cn.get(e),i=Us(r.observationTargets,n),s=r.observationTargets.length===1;i>=0&&(s&&ct.splice(ct.indexOf(r),1),r.observationTargets.splice(i,1),$s(-1))},t.disconnect=function(e){var n=this,r=Cn.get(e);r.observationTargets.slice().forEach(function(i){return n.unobserve(e,i.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t}(),Df=function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");En.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Ls(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");En.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Ls(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");En.unobserve(this,e)},t.prototype.disconnect=function(){En.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();const Ka=h.createContext({});function Pf(t){const e=h.useRef(null);return e.current===null&&(e.current=t()),e.current}const Mi=h.createContext(null),qa=h.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Of(t=!0){const e=h.useContext(Mi);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=e,s=h.useId();h.useEffect(()=>{t&&i(s)},[t]);const o=h.useCallback(()=>t&&r&&r(s),[s,r,t]);return!n&&r?[!1,o]:[!0]}const Ii=typeof window<"u",Mf=Ii?h.useLayoutEffect:h.useEffect,pe=t=>t;let Ya=pe;function Ri(t){let e;return()=>(e===void 0&&(e=t()),e)}const Dt=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r},je=t=>t*1e3,Ve=t=>t/1e3,If={useManualTiming:!1};function Rf(t){let e=new Set,n=new Set,r=!1,i=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(l){s.has(l)&&(c.schedule(l),t()),l(o)}const c={schedule:(l,u=!1,d=!1)=>{const p=d&&r?e:n;return u&&s.add(l),p.has(l)||p.add(l),l},cancel:l=>{n.delete(l),s.delete(l)},process:l=>{if(o=l,r){i=!0;return}r=!0,[e,n]=[n,e],e.forEach(a),e.clear(),r=!1,i&&(i=!1,c.process(l))}};return c}const Dn=["read","resolveKeyframes","update","preRender","render","postRender"],Af=40;function Xa(t,e){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=Dn.reduce((y,b)=>(y[b]=Rf(s),y),{}),{read:a,resolveKeyframes:c,update:l,preRender:u,render:d,postRender:f}=o,p=()=>{const y=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(y-i.timestamp,Af),1),i.timestamp=y,i.isProcessing=!0,a.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),i.isProcessing=!1,n&&e&&(r=!1,t(p))},v=()=>{n=!0,r=!0,i.isProcessing||t(p)};return{schedule:Dn.reduce((y,b)=>{const T=o[b];return y[b]=(S,C=!1,P=!1)=>(n||v(),T.schedule(S,C,P)),y},{}),cancel:y=>{for(let b=0;b<Dn.length;b++)o[Dn[b]].cancel(y)},state:i,steps:o}}const{schedule:q,cancel:Ye,state:ie,steps:Cr}=Xa(typeof requestAnimationFrame<"u"?requestAnimationFrame:pe,!0),Za=h.createContext({strict:!1}),Hs={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Pt={};for(const t in Hs)Pt[t]={isEnabled:e=>Hs[t].some(n=>!!e[n])};function Nf(t){for(const e in t)Pt[e]={...Pt[e],...t[e]}}const _f=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function zn(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||_f.has(t)}let Ja=t=>!zn(t);function Lf(t){t&&(Ja=e=>e.startsWith("on")?!zn(e):t(e))}try{Lf(require("@emotion/is-prop-valid").default)}catch{}function kf(t,e,n){const r={};for(const i in t)i==="values"&&typeof t.values=="object"||(Ja(i)||n===!0&&zn(i)||!e&&!zn(i)||t.draggable&&i.startsWith("onDrag"))&&(r[i]=t[i]);return r}function jf(t){if(typeof Proxy>"u")return t;const e=new Map,n=(...r)=>t(...r);return new Proxy(n,{get:(r,i)=>i==="create"?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}const nr=h.createContext({});function Jt(t){return typeof t=="string"||Array.isArray(t)}function rr(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const Ai=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ni=["initial",...Ai];function ir(t){return rr(t.animate)||Ni.some(e=>Jt(t[e]))}function Qa(t){return!!(ir(t)||t.variants)}function Vf(t,e){if(ir(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Jt(n)?n:void 0,animate:Jt(r)?r:void 0}}return t.inherit!==!1?e:{}}function Ff(t){const{initial:e,animate:n}=Vf(t,h.useContext(nr));return h.useMemo(()=>({initial:e,animate:n}),[zs(e),zs(n)])}function zs(t){return Array.isArray(t)?t.join(" "):t}const Bf=Symbol.for("motionComponentSymbol");function xt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function $f(t,e,n){return h.useCallback(r=>{r&&t.onMount&&t.onMount(r),e&&(r?e.mount(r):e.unmount()),n&&(typeof n=="function"?n(r):xt(n)&&(n.current=r))},[e])}const _i=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Uf="framerAppearId",ec="data-"+_i(Uf),{schedule:Li}=Xa(queueMicrotask,!1),tc=h.createContext({});function Hf(t,e,n,r,i){var s,o;const{visualElement:a}=h.useContext(nr),c=h.useContext(Za),l=h.useContext(Mi),u=h.useContext(qa).reducedMotion,d=h.useRef(null);r=r||c.renderer,!d.current&&r&&(d.current=r(t,{visualState:e,parent:a,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u}));const f=d.current,p=h.useContext(tc);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&zf(d.current,n,i,p);const v=h.useRef(!1);h.useInsertionEffect(()=>{f&&v.current&&f.update(n,l)});const g=n[ec],x=h.useRef(!!g&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,g))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,g)));return Mf(()=>{f&&(v.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),Li.render(f.render),x.current&&f.animationState&&f.animationState.animateChanges())}),h.useEffect(()=>{f&&(!x.current&&f.animationState&&f.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,g)}),x.current=!1))}),f}function zf(t,e,n,r){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:c,layoutRoot:l}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:nc(t.parent)),t.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&xt(a),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,layoutScroll:c,layoutRoot:l})}function nc(t){if(t)return t.options.allowProjection!==!1?t.projection:nc(t.parent)}function Wf({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:r,Component:i}){var s,o;t&&Nf(t);function a(l,u){let d;const f={...h.useContext(qa),...l,layoutId:Gf(l)},{isStatic:p}=f,v=Ff(l),g=r(l,p);if(!p&&Ii){Kf();const x=qf(f);d=x.MeasureLayout,v.visualElement=Hf(i,g,f,e,x.ProjectionNode)}return m.jsxs(nr.Provider,{value:v,children:[d&&v.visualElement?m.jsx(d,{visualElement:v.visualElement,...f}):null,n(i,l,$f(g,v.visualElement,u),g,p,v.visualElement)]})}a.displayName=`motion.${typeof i=="string"?i:`create(${(o=(s=i.displayName)!==null&&s!==void 0?s:i.name)!==null&&o!==void 0?o:""})`}`;const c=h.forwardRef(a);return c[Bf]=i,c}function Gf({layoutId:t}){const e=h.useContext(Ka).id;return e&&t!==void 0?e+"-"+t:t}function Kf(t,e){h.useContext(Za).strict}function qf(t){const{drag:e,layout:n}=Pt;if(!e&&!n)return{};const r={...e,...n};return{MeasureLayout:e!=null&&e.isEnabled(t)||n!=null&&n.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const Yf=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function ki(t){return typeof t!="string"||t.includes("-")?!1:!!(Yf.indexOf(t)>-1||/[A-Z]/u.test(t))}function Ws(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function ji(t,e,n,r){if(typeof e=="function"){const[i,s]=Ws(r);e=e(n!==void 0?n:t.custom,i,s)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,s]=Ws(r);e=e(n!==void 0?n:t.custom,i,s)}return e}const qr=t=>Array.isArray(t),Xf=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),Zf=t=>qr(t)?t[t.length-1]||0:t,oe=t=>!!(t&&t.getVelocity);function Ln(t){const e=oe(t)?t.get():t;return Xf(e)?e.toValue():e}function Jf({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},r,i,s){const o={latestValues:Qf(r,i,s,t),renderState:e()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const rc=t=>(e,n)=>{const r=h.useContext(nr),i=h.useContext(Mi),s=()=>Jf(t,e,r,i);return n?s():Pf(s)};function Qf(t,e,n,r){const i={},s=r(t,{});for(const f in s)i[f]=Ln(s[f]);let{initial:o,animate:a}=t;const c=ir(t),l=Qa(t);e&&l&&!c&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const d=u?a:o;if(d&&typeof d!="boolean"&&!rr(d)){const f=Array.isArray(d)?d:[d];for(let p=0;p<f.length;p++){const v=ji(t,f[p]);if(v){const{transitionEnd:g,transition:x,...y}=v;for(const b in y){let T=y[b];if(Array.isArray(T)){const S=u?T.length-1:0;T=T[S]}T!==null&&(i[b]=T)}for(const b in g)i[b]=g[b]}}}return i}const Mt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ft=new Set(Mt),ic=t=>e=>typeof e=="string"&&e.startsWith(t),sc=ic("--"),eh=ic("var(--"),Vi=t=>eh(t)?th.test(t.split("/*")[0].trim()):!1,th=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,oc=(t,e)=>e&&typeof t=="number"?e.transform(t):t,Be=(t,e,n)=>n>e?e:n<t?t:n,It={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Qt={...It,transform:t=>Be(0,1,t)},Pn={...It,default:1},an=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),ze=an("deg"),Re=an("%"),N=an("px"),nh=an("vh"),rh=an("vw"),Gs={...Re,parse:t=>Re.parse(t)/100,transform:t=>Re.transform(t*100)},ih={borderWidth:N,borderTopWidth:N,borderRightWidth:N,borderBottomWidth:N,borderLeftWidth:N,borderRadius:N,radius:N,borderTopLeftRadius:N,borderTopRightRadius:N,borderBottomRightRadius:N,borderBottomLeftRadius:N,width:N,maxWidth:N,height:N,maxHeight:N,top:N,right:N,bottom:N,left:N,padding:N,paddingTop:N,paddingRight:N,paddingBottom:N,paddingLeft:N,margin:N,marginTop:N,marginRight:N,marginBottom:N,marginLeft:N,backgroundPositionX:N,backgroundPositionY:N},sh={rotate:ze,rotateX:ze,rotateY:ze,rotateZ:ze,scale:Pn,scaleX:Pn,scaleY:Pn,scaleZ:Pn,skew:ze,skewX:ze,skewY:ze,distance:N,translateX:N,translateY:N,translateZ:N,x:N,y:N,z:N,perspective:N,transformPerspective:N,opacity:Qt,originX:Gs,originY:Gs,originZ:N},Ks={...It,transform:Math.round},Fi={...ih,...sh,zIndex:Ks,size:N,fillOpacity:Qt,strokeOpacity:Qt,numOctaves:Ks},oh={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ah=Mt.length;function ch(t,e,n){let r="",i=!0;for(let s=0;s<ah;s++){const o=Mt[s],a=t[o];if(a===void 0)continue;let c=!0;if(typeof a=="number"?c=a===(o.startsWith("scale")?1:0):c=parseFloat(a)===0,!c||n){const l=oc(a,Fi[o]);if(!c){i=!1;const u=oh[o]||o;r+=`${u}(${l}) `}n&&(e[o]=l)}}return r=r.trim(),n?r=n(e,i?"":r):i&&(r="none"),r}function Bi(t,e,n){const{style:r,vars:i,transformOrigin:s}=t;let o=!1,a=!1;for(const c in e){const l=e[c];if(ft.has(c)){o=!0;continue}else if(sc(c)){i[c]=l;continue}else{const u=oc(l,Fi[c]);c.startsWith("origin")?(a=!0,s[c]=u):r[c]=u}}if(e.transform||(o||n?r.transform=ch(e,t.transform,n):r.transform&&(r.transform="none")),a){const{originX:c="50%",originY:l="50%",originZ:u=0}=s;r.transformOrigin=`${c} ${l} ${u}`}}const lh={offset:"stroke-dashoffset",array:"stroke-dasharray"},uh={offset:"strokeDashoffset",array:"strokeDasharray"};function dh(t,e,n=1,r=0,i=!0){t.pathLength=1;const s=i?lh:uh;t[s.offset]=N.transform(-r);const o=N.transform(e),a=N.transform(n);t[s.array]=`${o} ${a}`}function qs(t,e,n){return typeof t=="string"?t:N.transform(e+n*t)}function fh(t,e,n){const r=qs(e,t.x,t.width),i=qs(n,t.y,t.height);return`${r} ${i}`}function $i(t,{attrX:e,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:c=0,...l},u,d){if(Bi(t,l,d),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:p,dimensions:v}=t;f.transform&&(v&&(p.transform=f.transform),delete f.transform),v&&(i!==void 0||s!==void 0||p.transform)&&(p.transformOrigin=fh(v,i!==void 0?i:.5,s!==void 0?s:.5)),e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&dh(f,o,a,c,!1)}const Ui=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),ac=()=>({...Ui(),attrs:{}}),Hi=t=>typeof t=="string"&&t.toLowerCase()==="svg";function cc(t,{style:e,vars:n},r,i){Object.assign(t.style,e,i&&i.getProjectionStyles(r));for(const s in n)t.style.setProperty(s,n[s])}const lc=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function uc(t,e,n,r){cc(t,e,void 0,r);for(const i in e.attrs)t.setAttribute(lc.has(i)?i:_i(i),e.attrs[i])}const Wn={};function hh(t){Object.assign(Wn,t)}function dc(t,{layout:e,layoutId:n}){return ft.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Wn[t]||t==="opacity")}function zi(t,e,n){var r;const{style:i}=t,s={};for(const o in i)(oe(i[o])||e.style&&oe(e.style[o])||dc(o,t)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(s[o]=i[o]);return s}function fc(t,e,n){const r=zi(t,e,n);for(const i in t)if(oe(t[i])||oe(e[i])){const s=Mt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=t[i]}return r}function ph(t,e){try{e.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{e.dimensions={x:0,y:0,width:0,height:0}}}const Ys=["x","y","width","height","cx","cy","r"],gh={useVisualState:rc({scrapeMotionValuesFromProps:fc,createRenderState:ac,onUpdate:({props:t,prevProps:e,current:n,renderState:r,latestValues:i})=>{if(!n)return;let s=!!t.drag;if(!s){for(const a in i)if(ft.has(a)){s=!0;break}}if(!s)return;let o=!e;if(e)for(let a=0;a<Ys.length;a++){const c=Ys[a];t[c]!==e[c]&&(o=!0)}o&&q.read(()=>{ph(n,r),q.render(()=>{$i(r,i,Hi(n.tagName),t.transformTemplate),uc(n,r)})})}})},mh={useVisualState:rc({scrapeMotionValuesFromProps:zi,createRenderState:Ui})};function hc(t,e,n){for(const r in e)!oe(e[r])&&!dc(r,n)&&(t[r]=e[r])}function vh({transformTemplate:t},e){return h.useMemo(()=>{const n=Ui();return Bi(n,e,t),Object.assign({},n.vars,n.style)},[e])}function yh(t,e){const n=t.style||{},r={};return hc(r,n,t),Object.assign(r,vh(t,e)),r}function xh(t,e){const n={},r=yh(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}function bh(t,e,n,r){const i=h.useMemo(()=>{const s=ac();return $i(s,e,Hi(r),t.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};hc(s,t.style,t),i.style={...s,...i.style}}return i}function Th(t=!1){return(n,r,i,{latestValues:s},o)=>{const c=(ki(n)?bh:xh)(r,s,o,n),l=kf(r,typeof n=="string",t),u=n!==h.Fragment?{...l,...c,ref:i}:{},{children:d}=r,f=h.useMemo(()=>oe(d)?d.get():d,[d]);return h.createElement(n,{...u,children:f})}}function wh(t,e){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...ki(r)?gh:mh,preloadedFeatures:t,useRender:Th(i),createVisualElement:e,Component:r};return Wf(o)}}function pc(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function sr(t,e,n){const r=t.getProps();return ji(r,e,n!==void 0?n:r.custom,t)}const Sh=Ri(()=>window.ScrollTimeline!==void 0);class Ch{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let r=0;r<this.animations.length;r++)this.animations[r][e]=n}attachTimeline(e,n){const r=this.animations.map(i=>{if(Sh()&&i.attachTimeline)return i.attachTimeline(e);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let n=0;n<this.animations.length;n++)e=Math.max(e,this.animations[n].duration);return e}runAll(e){this.animations.forEach(n=>n[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Eh extends Ch{then(e,n){return Promise.all(this.animations).then(e).catch(n)}}function Wi(t,e){return t?t[e]||t.default||t:void 0}const Yr=2e4;function gc(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Yr;)e+=n,r=t.next(e);return e>=Yr?1/0:e}function Gi(t){return typeof t=="function"}function Xs(t,e){t.timeline=e,t.onfinish=null}const Ki=t=>Array.isArray(t)&&typeof t[0]=="number",Dh={linearEasing:void 0};function Ph(t,e){const n=Ri(t);return()=>{var r;return(r=Dh[e])!==null&&r!==void 0?r:n()}}const Gn=Ph(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),mc=(t,e,n=10)=>{let r="";const i=Math.max(Math.round(e/n),2);for(let s=0;s<i;s++)r+=t(Dt(0,i-1,s))+", ";return`linear(${r.substring(0,r.length-2)})`};function vc(t){return!!(typeof t=="function"&&Gn()||!t||typeof t=="string"&&(t in Xr||Gn())||Ki(t)||Array.isArray(t)&&t.every(vc))}const Vt=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,Xr={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Vt([0,.65,.55,1]),circOut:Vt([.55,0,1,.45]),backIn:Vt([.31,.01,.66,-.59]),backOut:Vt([.33,1.53,.69,.99])};function yc(t,e){if(t)return typeof t=="function"&&Gn()?mc(t,e):Ki(t)?Vt(t):Array.isArray(t)?t.map(n=>yc(n,e)||Xr.easeOut):Xr[t]}const De={x:!1,y:!1};function xc(){return De.x||De.y}function Oh(t,e,n){var r;if(t instanceof Element)return[t];if(typeof t=="string"){let i=document;const s=(r=void 0)!==null&&r!==void 0?r:i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t)}function bc(t,e){const n=Oh(t),r=new AbortController,i={passive:!0,...e,signal:r.signal};return[n,i,()=>r.abort()]}function Zs(t){return e=>{e.pointerType==="touch"||xc()||t(e)}}function Mh(t,e,n={}){const[r,i,s]=bc(t,n),o=Zs(a=>{const{target:c}=a,l=e(a);if(typeof l!="function"||!c)return;const u=Zs(d=>{l(d),c.removeEventListener("pointerleave",u)});c.addEventListener("pointerleave",u,i)});return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const Tc=(t,e)=>e?t===e?!0:Tc(t,e.parentElement):!1,qi=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Ih=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Rh(t){return Ih.has(t.tagName)||t.tabIndex!==-1}const Ft=new WeakSet;function Js(t){return e=>{e.key==="Enter"&&t(e)}}function Er(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Ah=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=Js(()=>{if(Ft.has(n))return;Er(n,"down");const i=Js(()=>{Er(n,"up")}),s=()=>Er(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",s,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function Qs(t){return qi(t)&&!xc()}function Nh(t,e,n={}){const[r,i,s]=bc(t,n),o=a=>{const c=a.currentTarget;if(!Qs(a)||Ft.has(c))return;Ft.add(c);const l=e(a),u=(p,v)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),!(!Qs(p)||!Ft.has(c))&&(Ft.delete(c),typeof l=="function"&&l(p,{success:v}))},d=p=>{u(p,n.useGlobalTarget||Tc(c,p.target))},f=p=>{u(p,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",f,i)};return r.forEach(a=>{!Rh(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0),(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),a.addEventListener("focus",l=>Ah(l,i),i)}),s}function _h(t){return t==="x"||t==="y"?De[t]?null:(De[t]=!0,()=>{De[t]=!1}):De.x||De.y?null:(De.x=De.y=!0,()=>{De.x=De.y=!1})}const wc=new Set(["width","height","top","left","right","bottom",...Mt]);let kn;function Lh(){kn=void 0}const Ae={now:()=>(kn===void 0&&Ae.set(ie.isProcessing||If.useManualTiming?ie.timestamp:performance.now()),kn),set:t=>{kn=t,queueMicrotask(Lh)}};function Yi(t,e){t.indexOf(e)===-1&&t.push(e)}function Xi(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Zi{constructor(){this.subscriptions=[]}add(e){return Yi(this.subscriptions,e),()=>Xi(this.subscriptions,e)}notify(e,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Sc(t,e){return e?t*(1e3/e):0}const eo=30,kh=t=>!isNaN(parseFloat(t));class jh{constructor(e,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=Ae.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=Ae.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=kh(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Zi);const r=this.events[e].add(n);return e==="change"?()=>{r(),q.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=Ae.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>eo)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,eo);return Sc(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function en(t,e){return new jh(t,e)}function Vh(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,en(n))}function Fh(t,e){const n=sr(t,e);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=Zf(s[o]);Vh(t,o,a)}}function Bh(t){return!!(oe(t)&&t.add)}function Zr(t,e){const n=t.getValue("willChange");if(Bh(n))return n.add(e)}function Cc(t){return t.props[ec]}const Ec=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,$h=1e-7,Uh=12;function Hh(t,e,n,r,i){let s,o,a=0;do o=e+(n-e)/2,s=Ec(o,r,i)-t,s>0?n=o:e=o;while(Math.abs(s)>$h&&++a<Uh);return o}function cn(t,e,n,r){if(t===e&&n===r)return pe;const i=s=>Hh(s,0,1,t,n);return s=>s===0||s===1?s:Ec(i(s),e,r)}const Dc=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Pc=t=>e=>1-t(1-e),Oc=cn(.33,1.53,.69,.99),Ji=Pc(Oc),Mc=Dc(Ji),Ic=t=>(t*=2)<1?.5*Ji(t):.5*(2-Math.pow(2,-10*(t-1))),Qi=t=>1-Math.sin(Math.acos(t)),Rc=Pc(Qi),Ac=Dc(Qi),Nc=t=>/^0[^.\s]+$/u.test(t);function zh(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Nc(t):!0}const Wt=t=>Math.round(t*1e5)/1e5,es=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Wh(t){return t==null}const Gh=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ts=(t,e)=>n=>!!(typeof n=="string"&&Gh.test(n)&&n.startsWith(t)||e&&!Wh(n)&&Object.prototype.hasOwnProperty.call(n,e)),_c=(t,e,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(es);return{[t]:parseFloat(i),[e]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Kh=t=>Be(0,255,t),Dr={...It,transform:t=>Math.round(Kh(t))},ot={test:ts("rgb","red"),parse:_c("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+Dr.transform(t)+", "+Dr.transform(e)+", "+Dr.transform(n)+", "+Wt(Qt.transform(r))+")"};function qh(t){let e="",n="",r="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,r+=r,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const Jr={test:ts("#"),parse:qh,transform:ot.transform},bt={test:ts("hsl","hue"),parse:_c("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+Re.transform(Wt(e))+", "+Re.transform(Wt(n))+", "+Wt(Qt.transform(r))+")"},se={test:t=>ot.test(t)||Jr.test(t)||bt.test(t),parse:t=>ot.test(t)?ot.parse(t):bt.test(t)?bt.parse(t):Jr.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ot.transform(t):bt.transform(t)},Yh=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Xh(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(es))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(Yh))===null||n===void 0?void 0:n.length)||0)>0}const Lc="number",kc="color",Zh="var",Jh="var(",to="${}",Qh=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function tn(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=e.replace(Qh,c=>(se.test(c)?(r.color.push(s),i.push(kc),n.push(se.parse(c))):c.startsWith(Jh)?(r.var.push(s),i.push(Zh),n.push(c)):(r.number.push(s),i.push(Lc),n.push(parseFloat(c))),++s,to)).split(to);return{values:n,split:a,indexes:r,types:i}}function jc(t){return tn(t).values}function Vc(t){const{split:e,types:n}=tn(t),r=e.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=e[o],i[o]!==void 0){const a=n[o];a===Lc?s+=Wt(i[o]):a===kc?s+=se.transform(i[o]):s+=i[o]}return s}}const ep=t=>typeof t=="number"?0:t;function tp(t){const e=jc(t);return Vc(t)(e.map(ep))}const Xe={test:Xh,parse:jc,createTransformer:Vc,getAnimatableNone:tp},np=new Set(["brightness","contrast","saturate","opacity"]);function rp(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(es)||[];if(!r)return t;const i=n.replace(r,"");let s=np.has(e)?1:0;return r!==n&&(s*=100),e+"("+s+i+")"}const ip=/\b([a-z-]*)\(.*?\)/gu,Qr={...Xe,getAnimatableNone:t=>{const e=t.match(ip);return e?e.map(rp).join(" "):t}},sp={...Fi,color:se,backgroundColor:se,outlineColor:se,fill:se,stroke:se,borderColor:se,borderTopColor:se,borderRightColor:se,borderBottomColor:se,borderLeftColor:se,filter:Qr,WebkitFilter:Qr},ns=t=>sp[t];function Fc(t,e){let n=ns(t);return n!==Qr&&(n=Xe),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const op=new Set(["auto","none","0"]);function ap(t,e,n){let r=0,i;for(;r<t.length&&!i;){const s=t[r];typeof s=="string"&&!op.has(s)&&tn(s).values.length&&(i=t[r]),r++}if(i&&n)for(const s of e)t[s]=Fc(n,i)}const no=t=>t===It||t===N,ro=(t,e)=>parseFloat(t.split(", ")[e]),io=(t,e)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return ro(i[1],e);{const s=r.match(/^matrix\((.+)\)$/u);return s?ro(s[1],t):0}},cp=new Set(["x","y","z"]),lp=Mt.filter(t=>!cp.has(t));function up(t){const e=[];return lp.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Ot={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:io(4,13),y:io(5,14)};Ot.translateX=Ot.x;Ot.translateY=Ot.y;const ut=new Set;let ei=!1,ti=!1;function Bc(){if(ti){const t=Array.from(ut).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const i=up(r);i.length&&(n.set(r,i),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))===null||a===void 0||a.set(o)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}ti=!1,ei=!1,ut.forEach(t=>t.complete()),ut.clear()}function $c(){ut.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ti=!0)})}function dp(){$c(),Bc()}class rs{constructor(e,n,r,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ut.add(this),ei||(ei=!0,q.read($c),q.resolveKeyframes(Bc))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:i}=this;for(let s=0;s<e.length;s++)if(e[s]===null)if(s===0){const o=i==null?void 0:i.get(),a=e[e.length-1];if(o!==void 0)e[0]=o;else if(r&&n){const c=r.readValue(n,a);c!=null&&(e[0]=c)}e[0]===void 0&&(e[0]=a),i&&o===void 0&&i.set(e[0])}else e[s]=e[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),ut.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ut.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Uc=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),fp=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function hp(t){const e=fp.exec(t);if(!e)return[,];const[,n,r,i]=e;return[`--${n??r}`,i]}function Hc(t,e,n=1){const[r,i]=hp(t);if(!r)return;const s=window.getComputedStyle(e).getPropertyValue(r);if(s){const o=s.trim();return Uc(o)?parseFloat(o):o}return Vi(i)?Hc(i,e,n+1):i}const zc=t=>e=>e.test(t),pp={test:t=>t==="auto",parse:t=>t},Wc=[It,N,Re,ze,rh,nh,pp],so=t=>Wc.find(zc(t));class Gc extends rs{constructor(e,n,r,i,s){super(e,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<e.length;c++){let l=e[c];if(typeof l=="string"&&(l=l.trim(),Vi(l))){const u=Hc(l,n.current);u!==void 0&&(e[c]=u),c===e.length-1&&(this.finalKeyframe=l)}}if(this.resolveNoneKeyframes(),!wc.has(r)||e.length!==2)return;const[i,s]=e,o=so(i),a=so(s);if(o!==a)if(no(o)&&no(a))for(let c=0;c<e.length;c++){const l=e[c];typeof l=="string"&&(e[c]=parseFloat(l))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let i=0;i<e.length;i++)zh(e[i])&&r.push(i);r.length&&ap(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ot[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(r,i).jump(i,!1)}measureEndState(){var e;const{element:n,name:r,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const s=n.getValue(r);s&&s.jump(this.measuredOrigin,!1);const o=i.length-1,a=i[o];i[o]=Ot[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((e=this.removedTransforms)===null||e===void 0)&&e.length&&this.removedTransforms.forEach(([c,l])=>{n.getValue(c).set(l)}),this.resolveNoneKeyframes()}}const oo=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Xe.test(t)||t==="0")&&!t.startsWith("url("));function gp(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function mp(t,e,n,r){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const s=t[t.length-1],o=oo(i,e),a=oo(s,e);return!o||!a?!1:gp(t)||(n==="spring"||Gi(n))&&r}const vp=t=>t!==null;function or(t,{repeat:e,repeatType:n="loop"},r){const i=t.filter(vp),s=e&&n!=="loop"&&e%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const yp=40;class Kc{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Ae.now(),this.options={autoplay:e,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>yp?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&dp(),this._resolved}onKeyframesResolved(e,n){this.resolvedAt=Ae.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:o,onComplete:a,onUpdate:c,isGenerator:l}=this.options;if(!l&&!mp(e,r,i,s))if(o)this.options.duration=0;else{c&&c(or(e,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const u=this.initPlayback(e,n);u!==!1&&(this._resolved={keyframes:e,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(e,n){return this.currentFinishedPromise.then(e,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const X=(t,e,n)=>t+(e-t)*n;function Pr(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function xp({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let i=0,s=0,o=0;if(!e)i=s=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,c=2*n-a;i=Pr(c,a,t+1/3),s=Pr(c,a,t),o=Pr(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function Kn(t,e){return n=>n>0?e:t}const Or=(t,e,n)=>{const r=t*t,i=n*(e*e-r)+r;return i<0?0:Math.sqrt(i)},bp=[Jr,ot,bt],Tp=t=>bp.find(e=>e.test(t));function ao(t){const e=Tp(t);if(!e)return!1;let n=e.parse(t);return e===bt&&(n=xp(n)),n}const co=(t,e)=>{const n=ao(t),r=ao(e);if(!n||!r)return Kn(t,e);const i={...n};return s=>(i.red=Or(n.red,r.red,s),i.green=Or(n.green,r.green,s),i.blue=Or(n.blue,r.blue,s),i.alpha=X(n.alpha,r.alpha,s),ot.transform(i))},wp=(t,e)=>n=>e(t(n)),ln=(...t)=>t.reduce(wp),ni=new Set(["none","hidden"]);function Sp(t,e){return ni.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function Cp(t,e){return n=>X(t,e,n)}function is(t){return typeof t=="number"?Cp:typeof t=="string"?Vi(t)?Kn:se.test(t)?co:Pp:Array.isArray(t)?qc:typeof t=="object"?se.test(t)?co:Ep:Kn}function qc(t,e){const n=[...t],r=n.length,i=t.map((s,o)=>is(s)(s,e[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function Ep(t,e){const n={...t,...e},r={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(r[i]=is(t[i])(t[i],e[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function Dp(t,e){var n;const r=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const o=e.types[s],a=t.indexes[o][i[o]],c=(n=t.values[a])!==null&&n!==void 0?n:0;r[s]=c,i[o]++}return r}const Pp=(t,e)=>{const n=Xe.createTransformer(e),r=tn(t),i=tn(e);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?ni.has(t)&&!i.values.length||ni.has(e)&&!r.values.length?Sp(t,e):ln(qc(Dp(r,i),i.values),n):Kn(t,e)};function Yc(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?X(t,e,n):is(t)(t,e)}const Op=5;function Xc(t,e,n){const r=Math.max(e-Op,0);return Sc(n-t(r),e-r)}const Z={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},lo=.001;function Mp({duration:t=Z.duration,bounce:e=Z.bounce,velocity:n=Z.velocity,mass:r=Z.mass}){let i,s,o=1-e;o=Be(Z.minDamping,Z.maxDamping,o),t=Be(Z.minDuration,Z.maxDuration,Ve(t)),o<1?(i=l=>{const u=l*o,d=u*t,f=u-n,p=ri(l,o),v=Math.exp(-d);return lo-f/p*v},s=l=>{const d=l*o*t,f=d*n+n,p=Math.pow(o,2)*Math.pow(l,2)*t,v=Math.exp(-d),g=ri(Math.pow(l,2),o);return(-i(l)+lo>0?-1:1)*((f-p)*v)/g}):(i=l=>{const u=Math.exp(-l*t),d=(l-n)*t+1;return-.001+u*d},s=l=>{const u=Math.exp(-l*t),d=(n-l)*(t*t);return u*d});const a=5/t,c=Rp(i,s,a);if(t=je(t),isNaN(c))return{stiffness:Z.stiffness,damping:Z.damping,duration:t};{const l=Math.pow(c,2)*r;return{stiffness:l,damping:o*2*Math.sqrt(r*l),duration:t}}}const Ip=12;function Rp(t,e,n){let r=n;for(let i=1;i<Ip;i++)r=r-t(r)/e(r);return r}function ri(t,e){return t*Math.sqrt(1-e*e)}const Ap=["duration","bounce"],Np=["stiffness","damping","mass"];function uo(t,e){return e.some(n=>t[n]!==void 0)}function _p(t){let e={velocity:Z.velocity,stiffness:Z.stiffness,damping:Z.damping,mass:Z.mass,isResolvedFromDuration:!1,...t};if(!uo(t,Np)&&uo(t,Ap))if(t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*Be(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:Z.mass,stiffness:i,damping:s}}else{const n=Mp(t);e={...e,...n,mass:Z.mass},e.isResolvedFromDuration=!0}return e}function Zc(t=Z.visualDuration,e=Z.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=_p({...n,velocity:-Ve(n.velocity||0)}),v=f||0,g=l/(2*Math.sqrt(c*u)),x=o-s,y=Ve(Math.sqrt(c/u)),b=Math.abs(x)<5;r||(r=b?Z.restSpeed.granular:Z.restSpeed.default),i||(i=b?Z.restDelta.granular:Z.restDelta.default);let T;if(g<1){const C=ri(y,g);T=P=>{const D=Math.exp(-g*y*P);return o-D*((v+g*y*x)/C*Math.sin(C*P)+x*Math.cos(C*P))}}else if(g===1)T=C=>o-Math.exp(-y*C)*(x+(v+y*x)*C);else{const C=y*Math.sqrt(g*g-1);T=P=>{const D=Math.exp(-g*y*P),E=Math.min(C*P,300);return o-D*((v+g*y*x)*Math.sinh(E)+C*x*Math.cosh(E))/C}}const S={calculatedDuration:p&&d||null,next:C=>{const P=T(C);if(p)a.done=C>=d;else{let D=0;g<1&&(D=C===0?je(v):Xc(T,C,P));const E=Math.abs(D)<=r,k=Math.abs(o-P)<=i;a.done=E&&k}return a.value=a.done?o:P,a},toString:()=>{const C=Math.min(gc(S),Yr),P=mc(D=>S.next(C*D).value,C,30);return C+"ms "+P}};return S}function fo({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:c,restDelta:l=.5,restSpeed:u}){const d=t[0],f={done:!1,value:d},p=E=>a!==void 0&&E<a||c!==void 0&&E>c,v=E=>a===void 0?c:c===void 0||Math.abs(a-E)<Math.abs(c-E)?a:c;let g=n*e;const x=d+g,y=o===void 0?x:o(x);y!==x&&(g=y-d);const b=E=>-g*Math.exp(-E/r),T=E=>y+b(E),S=E=>{const k=b(E),A=T(E);f.done=Math.abs(k)<=l,f.value=f.done?y:A};let C,P;const D=E=>{p(f.value)&&(C=E,P=Zc({keyframes:[f.value,v(f.value)],velocity:Xc(T,E,f.value),damping:i,stiffness:s,restDelta:l,restSpeed:u}))};return D(0),{calculatedDuration:null,next:E=>{let k=!1;return!P&&C===void 0&&(k=!0,S(E),D(E)),C!==void 0&&E>=C?P.next(E-C):(!k&&S(E),f)}}}const Lp=cn(.42,0,1,1),kp=cn(0,0,.58,1),Jc=cn(.42,0,.58,1),jp=t=>Array.isArray(t)&&typeof t[0]!="number",Vp={linear:pe,easeIn:Lp,easeInOut:Jc,easeOut:kp,circIn:Qi,circInOut:Ac,circOut:Rc,backIn:Ji,backInOut:Mc,backOut:Oc,anticipate:Ic},ho=t=>{if(Ki(t)){Ya(t.length===4);const[e,n,r,i]=t;return cn(e,n,r,i)}else if(typeof t=="string")return Vp[t];return t};function Fp(t,e,n){const r=[],i=n||Yc,s=t.length-1;for(let o=0;o<s;o++){let a=i(t[o],t[o+1]);if(e){const c=Array.isArray(e)?e[o]||pe:e;a=ln(c,a)}r.push(a)}return r}function Bp(t,e,{clamp:n=!0,ease:r,mixer:i}={}){const s=t.length;if(Ya(s===e.length),s===1)return()=>e[0];if(s===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Fp(e,r,i),c=a.length,l=u=>{if(o&&u<t[0])return e[0];let d=0;if(c>1)for(;d<t.length-2&&!(u<t[d+1]);d++);const f=Dt(t[d],t[d+1],u);return a[d](f)};return n?u=>l(Be(t[0],t[s-1],u)):l}function $p(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const i=Dt(0,e,r);t.push(X(n,1,i))}}function Up(t){const e=[0];return $p(e,t.length-1),e}function Hp(t,e){return t.map(n=>n*e)}function zp(t,e){return t.map(()=>e||Jc).splice(0,t.length-1)}function qn({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const i=jp(r)?r.map(ho):ho(r),s={done:!1,value:e[0]},o=Hp(n&&n.length===e.length?n:Up(e),t),a=Bp(o,e,{ease:Array.isArray(i)?i:zp(e,i)});return{calculatedDuration:t,next:c=>(s.value=a(c),s.done=c>=t,s)}}const Wp=t=>{const e=({timestamp:n})=>t(n);return{start:()=>q.update(e,!0),stop:()=>Ye(e),now:()=>ie.isProcessing?ie.timestamp:Ae.now()}},Gp={decay:fo,inertia:fo,tween:qn,keyframes:qn,spring:Zc},Kp=t=>t/100;class ss extends Kc{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:r,element:i,keyframes:s}=this.options,o=(i==null?void 0:i.KeyframeResolver)||rs,a=(c,l)=>this.onKeyframesResolved(c,l);this.resolver=new o(s,a,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,a=Gi(n)?n:Gp[n]||qn;let c,l;a!==qn&&typeof e[0]!="number"&&(c=ln(Kp,Yc(e[0],e[1])),e=[0,100]);const u=a({...this.options,keyframes:e});s==="mirror"&&(l=a({...this.options,keyframes:[...e].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=gc(u));const{calculatedDuration:d}=u,f=d+i,p=f*(r+1)-i;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:c,calculatedDuration:d,resolvedDuration:f,totalDuration:p}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,n=!1){const{resolved:r}=this;if(!r){const{keyframes:E}=this.options;return{done:!0,value:E[E.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:c,calculatedDuration:l,totalDuration:u,resolvedDuration:d}=r;if(this.startTime===null)return s.next(0);const{delay:f,repeat:p,repeatType:v,repeatDelay:g,onUpdate:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-u/this.speed,this.startTime)),n?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const y=this.currentTime-f*(this.speed>=0?1:-1),b=this.speed>=0?y<0:y>u;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let T=this.currentTime,S=s;if(p){const E=Math.min(this.currentTime,u)/d;let k=Math.floor(E),A=E%1;!A&&E>=1&&(A=1),A===1&&k--,k=Math.min(k,p+1),!!(k%2)&&(v==="reverse"?(A=1-A,g&&(A-=g/d)):v==="mirror"&&(S=o)),T=Be(0,1,A)*d}const C=b?{done:!1,value:c[0]}:S.next(T);a&&(C.value=a(C.value));let{done:P}=C;!b&&l!==null&&(P=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const D=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return D&&i!==void 0&&(C.value=or(c,this.options,i)),x&&x(C.value),D&&this.finish(),C}get duration(){const{resolved:e}=this;return e?Ve(e.calculatedDuration):0}get time(){return Ve(this.currentTime)}set time(e){e=je(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=Ve(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=Wp,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const qp=new Set(["opacity","clipPath","filter","transform"]);function Yp(t,e,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeInOut",times:c}={}){const l={[e]:n};c&&(l.offset=c);const u=yc(a,i);return Array.isArray(u)&&(l.easing=u),t.animate(l,{delay:r,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const Xp=Ri(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Yn=10,Zp=2e4;function Jp(t){return Gi(t.type)||t.type==="spring"||!vc(t.ease)}function Qp(t,e){const n=new ss({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:t[0]};const i=[];let s=0;for(;!r.done&&s<Zp;)r=n.sample(s),i.push(r.value),s+=Yn;return{times:void 0,keyframes:i,duration:s-Yn,ease:"linear"}}const Qc={anticipate:Ic,backInOut:Mc,circInOut:Ac};function eg(t){return t in Qc}class po extends Kc{constructor(e){super(e);const{name:n,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new Gc(s,(o,a)=>this.onKeyframesResolved(o,a),n,r,i),this.resolver.scheduleResolve()}initPlayback(e,n){let{duration:r=300,times:i,ease:s,type:o,motionValue:a,name:c,startTime:l}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof s=="string"&&Gn()&&eg(s)&&(s=Qc[s]),Jp(this.options)){const{onComplete:d,onUpdate:f,motionValue:p,element:v,...g}=this.options,x=Qp(e,g);e=x.keyframes,e.length===1&&(e[1]=e[0]),r=x.duration,i=x.times,s=x.ease,o="keyframes"}const u=Yp(a.owner.current,c,e,{...this.options,duration:r,times:i,ease:s});return u.startTime=l??this.calcStartTime(),this.pendingTimeline?(Xs(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:d}=this.options;a.set(or(e,this.options,n)),d&&d(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:i,type:o,ease:s,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:n}=e;return Ve(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return Ve(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=je(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:n}=e;return n.playbackRate}set speed(e){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:n}=e;return n.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:n}=e;return n.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:n}=this;if(!n)return pe;const{animation:r}=n;Xs(r,e)}return pe}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:n,keyframes:r,duration:i,type:s,ease:o,times:a}=e;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:l,onUpdate:u,onComplete:d,element:f,...p}=this.options,v=new ss({...p,keyframes:r,duration:i,type:s,ease:o,times:a,isGenerator:!0}),g=je(this.time);l.setWithVelocity(v.sample(g-Yn).value,v.sample(g).value,Yn)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:n,name:r,repeatDelay:i,repeatType:s,damping:o,type:a}=e;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:l}=n.owner.getProps();return Xp()&&r&&qp.has(r)&&!c&&!l&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}const tg={type:"spring",stiffness:500,damping:25,restSpeed:10},ng=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),rg={type:"keyframes",duration:.8},ig={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},sg=(t,{keyframes:e})=>e.length>2?rg:ft.has(t)?t.startsWith("scale")?ng(e[1]):tg:ig;function og({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:c,elapsed:l,...u}){return!!Object.keys(u).length}const os=(t,e,n,r={},i,s)=>o=>{const a=Wi(r,t)||{},c=a.delay||r.delay||0;let{elapsed:l=0}=r;l=l-je(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:s?void 0:i};og(a)||(u={...u,...sg(t,u)}),u.duration&&(u.duration=je(u.duration)),u.repeatDelay&&(u.repeatDelay=je(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(d=!0)),d&&!s&&e.get()!==void 0){const f=or(u.keyframes,a);if(f!==void 0)return q.update(()=>{u.onUpdate(f),u.onComplete()}),new Eh([])}return!s&&po.supports(u)?new po(u):new ss(u)};function ag({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function el(t,e,{delay:n=0,transitionOverride:r,type:i}={}){var s;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...c}=e;r&&(o=r);const l=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const d in c){const f=t.getValue(d,(s=t.latestValues[d])!==null&&s!==void 0?s:null),p=c[d];if(p===void 0||u&&ag(u,d))continue;const v={delay:n,...Wi(o||{},d)};let g=!1;if(window.MotionHandoffAnimation){const y=Cc(t);if(y){const b=window.MotionHandoffAnimation(y,d,q);b!==null&&(v.startTime=b,g=!0)}}Zr(t,d),f.start(os(d,f,p,t.shouldReduceMotion&&wc.has(d)?{type:!1}:v,t,g));const x=f.animation;x&&l.push(x)}return a&&Promise.all(l).then(()=>{q.update(()=>{a&&Fh(t,a)})}),l}function ii(t,e,n={}){var r;const i=sr(t,e,n.type==="exit"?(r=t.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(el(t,i,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:f}=s;return cg(t,e,u+l,d,f,n)}:()=>Promise.resolve(),{when:c}=s;if(c){const[l,u]=c==="beforeChildren"?[o,a]:[a,o];return l().then(()=>u())}else return Promise.all([o(),a(n.delay)])}function cg(t,e,n=0,r=0,i=1,s){const o=[],a=(t.variantChildren.size-1)*r,c=i===1?(l=0)=>l*r:(l=0)=>a-l*r;return Array.from(t.variantChildren).sort(lg).forEach((l,u)=>{l.notify("AnimationStart",e),o.push(ii(l,e,{...s,delay:n+c(u)}).then(()=>l.notify("AnimationComplete",e)))}),Promise.all(o)}function lg(t,e){return t.sortNodePosition(e)}function ug(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const i=e.map(s=>ii(t,s,n));r=Promise.all(i)}else if(typeof e=="string")r=ii(t,e,n);else{const i=typeof e=="function"?sr(t,e,n.custom):e;r=Promise.all(el(t,i,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const dg=Ni.length;function tl(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?tl(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<dg;n++){const r=Ni[n],i=t.props[r];(Jt(i)||i===!1)&&(e[r]=i)}return e}const fg=[...Ai].reverse(),hg=Ai.length;function pg(t){return e=>Promise.all(e.map(({animation:n,options:r})=>ug(t,n,r)))}function gg(t){let e=pg(t),n=go(),r=!0;const i=c=>(l,u)=>{var d;const f=sr(t,u,c==="exit"?(d=t.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(f){const{transition:p,transitionEnd:v,...g}=f;l={...l,...g,...v}}return l};function s(c){e=c(t)}function o(c){const{props:l}=t,u=tl(t.parent)||{},d=[],f=new Set;let p={},v=1/0;for(let x=0;x<hg;x++){const y=fg[x],b=n[y],T=l[y]!==void 0?l[y]:u[y],S=Jt(T),C=y===c?b.isActive:null;C===!1&&(v=x);let P=T===u[y]&&T!==l[y]&&S;if(P&&r&&t.manuallyAnimateOnMount&&(P=!1),b.protectedKeys={...p},!b.isActive&&C===null||!T&&!b.prevProp||rr(T)||typeof T=="boolean")continue;const D=mg(b.prevProp,T);let E=D||y===c&&b.isActive&&!P&&S||x>v&&S,k=!1;const A=Array.isArray(T)?T:[T];let G=A.reduce(i(y),{});C===!1&&(G={});const{prevResolvedValues:K={}}=b,ne={...K,...G},re=H=>{E=!0,f.has(H)&&(k=!0,f.delete(H)),b.needsAnimating[H]=!0;const z=t.getValue(H);z&&(z.liveStyle=!1)};for(const H in ne){const z=G[H],O=K[H];if(p.hasOwnProperty(H))continue;let U=!1;qr(z)&&qr(O)?U=!pc(z,O):U=z!==O,U?z!=null?re(H):f.add(H):z!==void 0&&f.has(H)?re(H):b.protectedKeys[H]=!0}b.prevProp=T,b.prevResolvedValues=G,b.isActive&&(p={...p,...G}),r&&t.blockInitialAnimation&&(E=!1),E&&(!(P&&D)||k)&&d.push(...A.map(H=>({animation:H,options:{type:y}})))}if(f.size){const x={};f.forEach(y=>{const b=t.getBaseTarget(y),T=t.getValue(y);T&&(T.liveStyle=!0),x[y]=b??null}),d.push({animation:x})}let g=!!d.length;return r&&(l.initial===!1||l.initial===l.animate)&&!t.manuallyAnimateOnMount&&(g=!1),r=!1,g?e(d):Promise.resolve()}function a(c,l){var u;if(n[c].isActive===l)return Promise.resolve();(u=t.variantChildren)===null||u===void 0||u.forEach(f=>{var p;return(p=f.animationState)===null||p===void 0?void 0:p.setActive(c,l)}),n[c].isActive=l;const d=o(c);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=go(),r=!0}}}function mg(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!pc(e,t):!1}function tt(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function go(){return{animate:tt(!0),whileInView:tt(),whileHover:tt(),whileTap:tt(),whileDrag:tt(),whileFocus:tt(),exit:tt()}}class Je{constructor(e){this.isMounted=!1,this.node=e}update(){}}class vg extends Je{constructor(e){super(e),e.animationState||(e.animationState=gg(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();rr(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let yg=0;class xg extends Je{constructor(){super(...arguments),this.id=yg++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>n(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const bg={animation:{Feature:vg},exit:{Feature:xg}};function nn(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function un(t){return{point:{x:t.pageX,y:t.pageY}}}const Tg=t=>e=>qi(e)&&t(e,un(e));function Gt(t,e,n,r){return nn(t,e,Tg(n),r)}const mo=(t,e)=>Math.abs(t-e);function wg(t,e){const n=mo(t.x,e.x),r=mo(t.y,e.y);return Math.sqrt(n**2+r**2)}class nl{constructor(e,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=Ir(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=wg(d.offset,{x:0,y:0})>=3;if(!f&&!p)return;const{point:v}=d,{timestamp:g}=ie;this.history.push({...v,timestamp:g});const{onStart:x,onMove:y}=this.handlers;f||(x&&x(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Mr(f,this.transformPagePoint),q.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:p,onSessionEnd:v,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Ir(d.type==="pointercancel"?this.lastMoveEventInfo:Mr(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,x),v&&v(d,x)},!qi(e))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=un(e),a=Mr(o,this.transformPagePoint),{point:c}=a,{timestamp:l}=ie;this.history=[{...c,timestamp:l}];const{onSessionStart:u}=n;u&&u(e,Ir(a,this.history)),this.removeListeners=ln(Gt(this.contextWindow,"pointermove",this.handlePointerMove),Gt(this.contextWindow,"pointerup",this.handlePointerUp),Gt(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Ye(this.updatePoint)}}function Mr(t,e){return e?{point:e(t.point)}:t}function vo(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ir({point:t},e){return{point:t,delta:vo(t,rl(e)),offset:vo(t,Sg(e)),velocity:Cg(e,.1)}}function Sg(t){return t[0]}function rl(t){return t[t.length-1]}function Cg(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const i=rl(t);for(;n>=0&&(r=t[n],!(i.timestamp-r.timestamp>je(e)));)n--;if(!r)return{x:0,y:0};const s=Ve(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const il=1e-4,Eg=1-il,Dg=1+il,sl=.01,Pg=0-sl,Og=0+sl;function me(t){return t.max-t.min}function Mg(t,e,n){return Math.abs(t-e)<=n}function yo(t,e,n,r=.5){t.origin=r,t.originPoint=X(e.min,e.max,t.origin),t.scale=me(n)/me(e),t.translate=X(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Eg&&t.scale<=Dg||isNaN(t.scale))&&(t.scale=1),(t.translate>=Pg&&t.translate<=Og||isNaN(t.translate))&&(t.translate=0)}function Kt(t,e,n,r){yo(t.x,e.x,n.x,r?r.originX:void 0),yo(t.y,e.y,n.y,r?r.originY:void 0)}function xo(t,e,n){t.min=n.min+e.min,t.max=t.min+me(e)}function Ig(t,e,n){xo(t.x,e.x,n.x),xo(t.y,e.y,n.y)}function bo(t,e,n){t.min=e.min-n.min,t.max=t.min+me(e)}function qt(t,e,n){bo(t.x,e.x,n.x),bo(t.y,e.y,n.y)}function Rg(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?X(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?X(n,t,r.max):Math.min(t,n)),t}function To(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function Ag(t,{top:e,left:n,bottom:r,right:i}){return{x:To(t.x,n,i),y:To(t.y,e,r)}}function wo(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function Ng(t,e){return{x:wo(t.x,e.x),y:wo(t.y,e.y)}}function _g(t,e){let n=.5;const r=me(t),i=me(e);return i>r?n=Dt(e.min,e.max-r,t.min):r>i&&(n=Dt(t.min,t.max-i,e.min)),Be(0,1,n)}function Lg(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const si=.35;function kg(t=si){return t===!1?t=0:t===!0&&(t=si),{x:So(t,"left","right"),y:So(t,"top","bottom")}}function So(t,e,n){return{min:Co(t,e),max:Co(t,n)}}function Co(t,e){return typeof t=="number"?t:t[e]||0}const Eo=()=>({translate:0,scale:1,origin:0,originPoint:0}),Tt=()=>({x:Eo(),y:Eo()}),Do=()=>({min:0,max:0}),te=()=>({x:Do(),y:Do()});function Te(t){return[t("x"),t("y")]}function ol({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function jg({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Vg(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Rr(t){return t===void 0||t===1}function oi({scale:t,scaleX:e,scaleY:n}){return!Rr(t)||!Rr(e)||!Rr(n)}function nt(t){return oi(t)||al(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function al(t){return Po(t.x)||Po(t.y)}function Po(t){return t&&t!=="0%"}function Xn(t,e,n){const r=t-n,i=e*r;return n+i}function Oo(t,e,n,r,i){return i!==void 0&&(t=Xn(t,i,r)),Xn(t,n,r)+e}function ai(t,e=0,n=1,r,i){t.min=Oo(t.min,e,n,r,i),t.max=Oo(t.max,e,n,r,i)}function cl(t,{x:e,y:n}){ai(t.x,e.translate,e.scale,e.originPoint),ai(t.y,n.translate,n.scale,n.originPoint)}const Mo=.999999999999,Io=1.0000000000001;function Fg(t,e,n,r=!1){const i=n.length;if(!i)return;e.x=e.y=1;let s,o;for(let a=0;a<i;a++){s=n[a],o=s.projectionDelta;const{visualElement:c}=s.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&St(t,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,cl(t,o)),r&&nt(s.latestValues)&&St(t,s.latestValues))}e.x<Io&&e.x>Mo&&(e.x=1),e.y<Io&&e.y>Mo&&(e.y=1)}function wt(t,e){t.min=t.min+e,t.max=t.max+e}function Ro(t,e,n,r,i=.5){const s=X(t.min,t.max,i);ai(t,e,n,s,r)}function St(t,e){Ro(t.x,e.x,e.scaleX,e.scale,e.originX),Ro(t.y,e.y,e.scaleY,e.scale,e.originY)}function ll(t,e){return ol(Vg(t.getBoundingClientRect(),e))}function Bg(t,e,n){const r=ll(t,n),{scroll:i}=e;return i&&(wt(r.x,i.offset.x),wt(r.y,i.offset.y)),r}const ul=({current:t})=>t?t.ownerDocument.defaultView:null,$g=new WeakMap;class Ug{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=te(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=u=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(un(u).point)},s=(u,d)=>{const{drag:f,dragPropagation:p,onDragStart:v}=this.getProps();if(f&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=_h(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Te(x=>{let y=this.getAxisMotionValue(x).get()||0;if(Re.test(y)){const{projection:b}=this.visualElement;if(b&&b.layout){const T=b.layout.layoutBox[x];T&&(y=me(T)*(parseFloat(y)/100))}}this.originPoint[x]=y}),v&&q.postRender(()=>v(u,d)),Zr(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},o=(u,d)=>{const{dragPropagation:f,dragDirectionLock:p,onDirectionLock:v,onDrag:g}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:x}=d;if(p&&this.currentDirection===null){this.currentDirection=Hg(x),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",d.point,x),this.updateAxis("y",d.point,x),this.visualElement.render(),g&&g(u,d)},a=(u,d)=>this.stop(u,d),c=()=>Te(u=>{var d;return this.getAnimationState(u)==="paused"&&((d=this.getAxisMotionValue(u).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:l}=this.getProps();this.panSession=new nl(e,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,contextWindow:ul(this.visualElement)})}stop(e,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&q.postRender(()=>s(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,r){const{drag:i}=this.getProps();if(!r||!On(e,i,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=Rg(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){var e;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,s=this.constraints;n&&xt(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=Ag(i.layoutBox,n):this.constraints=!1,this.elastic=kg(r),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Te(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Lg(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!xt(e))return!1;const r=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=Bg(r,i.root,this.visualElement.getTransformPagePoint());let o=Ng(i.layout.layoutBox,s);if(n){const a=n(jg(o));this.hasMutatedConstraints=!!a,a&&(o=ol(a))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=Te(u=>{if(!On(u,n,this.currentDirection))return;let d=c&&c[u]||{};o&&(d={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,v={type:"inertia",velocity:r?e[u]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(u,v)});return Promise.all(l).then(a)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return Zr(this.visualElement,e),r.start(os(e,r,0,n,this.visualElement,!1))}stopAnimation(){Te(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Te(e=>{var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){Te(n=>{const{drag:r}=this.getProps();if(!On(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];s.set(e[n]-X(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!xt(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Te(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const c=a.get();i[o]=_g({min:c,max:c},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Te(o=>{if(!On(o,e,null))return;const a=this.getAxisMotionValue(o),{min:c,max:l}=this.constraints[o];a.set(X(c,l,i[o]))})}addListeners(){if(!this.visualElement.current)return;$g.set(this.visualElement,this);const e=this.visualElement.current,n=Gt(e,"pointerdown",c=>{const{drag:l,dragListener:u=!0}=this.getProps();l&&u&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();xt(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),q.read(r);const o=nn(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:l})=>{this.isDragging&&l&&(Te(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=c[u].translate,d.set(d.get()+c[u].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=si,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function On(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Hg(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class zg extends Je{constructor(e){super(e),this.removeGroupControls=pe,this.removeListeners=pe,this.controls=new Ug(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||pe}unmount(){this.removeGroupControls(),this.removeListeners()}}const Ao=t=>(e,n)=>{t&&q.postRender(()=>t(e,n))};class Wg extends Je{constructor(){super(...arguments),this.removePointerDownListener=pe}onPointerDown(e){this.session=new nl(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ul(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:Ao(e),onStart:Ao(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&q.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=Gt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const jn={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function No(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const _t={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(N.test(t))t=parseFloat(t);else return t;const n=No(t,e.target.x),r=No(t,e.target.y);return`${n}% ${r}%`}},Gg={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,i=Xe.parse(t);if(i.length>5)return r;const s=Xe.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,c=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=c;const l=X(a,c,.5);return typeof i[2+o]=="number"&&(i[2+o]/=l),typeof i[3+o]=="number"&&(i[3+o]/=l),s(i)}};class Kg extends h.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=e;hh(qg),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),jn.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,o=r.projection;return o&&(o.isPresent=s,i||e.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||q.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Li.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function dl(t){const[e,n]=Of(),r=h.useContext(Ka);return m.jsx(Kg,{...t,layoutGroup:r,switchLayoutGroup:h.useContext(tc),isPresent:e,safeToRemove:n})}const qg={borderRadius:{..._t,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:_t,borderTopRightRadius:_t,borderBottomLeftRadius:_t,borderBottomRightRadius:_t,boxShadow:Gg};function Yg(t,e,n){const r=oe(t)?t:en(t);return r.start(os("",r,e,n)),r.animation}function Xg(t){return t instanceof SVGElement&&t.tagName!=="svg"}const Zg=(t,e)=>t.depth-e.depth;class Jg{constructor(){this.children=[],this.isDirty=!1}add(e){Yi(this.children,e),this.isDirty=!0}remove(e){Xi(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Zg),this.isDirty=!1,this.children.forEach(e)}}function Qg(t,e){const n=Ae.now(),r=({timestamp:i})=>{const s=i-n;s>=e&&(Ye(r),t(s-e))};return q.read(r,!0),()=>Ye(r)}const fl=["TopLeft","TopRight","BottomLeft","BottomRight"],em=fl.length,_o=t=>typeof t=="string"?parseFloat(t):t,Lo=t=>typeof t=="number"||N.test(t);function tm(t,e,n,r,i,s){i?(t.opacity=X(0,n.opacity!==void 0?n.opacity:1,nm(r)),t.opacityExit=X(e.opacity!==void 0?e.opacity:1,0,rm(r))):s&&(t.opacity=X(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<em;o++){const a=`border${fl[o]}Radius`;let c=ko(e,a),l=ko(n,a);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||Lo(c)===Lo(l)?(t[a]=Math.max(X(_o(c),_o(l),r),0),(Re.test(l)||Re.test(c))&&(t[a]+="%")):t[a]=l}(e.rotate||n.rotate)&&(t.rotate=X(e.rotate||0,n.rotate||0,r))}function ko(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const nm=hl(0,.5,Rc),rm=hl(.5,.95,pe);function hl(t,e,n){return r=>r<t?0:r>e?1:n(Dt(t,e,r))}function jo(t,e){t.min=e.min,t.max=e.max}function ye(t,e){jo(t.x,e.x),jo(t.y,e.y)}function Vo(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Fo(t,e,n,r,i){return t-=e,t=Xn(t,1/n,r),i!==void 0&&(t=Xn(t,1/i,r)),t}function im(t,e=0,n=1,r=.5,i,s=t,o=t){if(Re.test(e)&&(e=parseFloat(e),e=X(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=X(s.min,s.max,r);t===s&&(a-=e),t.min=Fo(t.min,e,n,a,i),t.max=Fo(t.max,e,n,a,i)}function Bo(t,e,[n,r,i],s,o){im(t,e[n],e[r],e[i],e.scale,s,o)}const sm=["x","scaleX","originX"],om=["y","scaleY","originY"];function $o(t,e,n,r){Bo(t.x,e,sm,n?n.x:void 0,r?r.x:void 0),Bo(t.y,e,om,n?n.y:void 0,r?r.y:void 0)}function Uo(t){return t.translate===0&&t.scale===1}function pl(t){return Uo(t.x)&&Uo(t.y)}function Ho(t,e){return t.min===e.min&&t.max===e.max}function am(t,e){return Ho(t.x,e.x)&&Ho(t.y,e.y)}function zo(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function gl(t,e){return zo(t.x,e.x)&&zo(t.y,e.y)}function Wo(t){return me(t.x)/me(t.y)}function Go(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class cm{constructor(){this.members=[]}add(e){Yi(this.members,e),e.scheduleRender()}remove(e){if(Xi(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(e,n){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,n&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:r}=e;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function lm(t,e,n){let r="";const i=t.x.translate/e.x,s=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:l,rotate:u,rotateX:d,rotateY:f,skewX:p,skewY:v}=n;l&&(r=`perspective(${l}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),p&&(r+=`skewX(${p}deg) `),v&&(r+=`skewY(${v}deg) `)}const a=t.x.scale*e.x,c=t.y.scale*e.y;return(a!==1||c!==1)&&(r+=`scale(${a}, ${c})`),r||"none"}const rt={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Bt=typeof window<"u"&&window.MotionDebug!==void 0,Ar=["","X","Y","Z"],um={visibility:"hidden"},Ko=1e3;let dm=0;function Nr(t,e,n,r){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),r&&(r[t]=0))}function ml(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Cc(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",q,!(i||s))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&ml(r)}function vl({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=e==null?void 0:e()){this.id=dm++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Bt&&(rt.totalNodes=rt.resolvedTargetDeltas=rt.recalculatedProjection=0),this.nodes.forEach(pm),this.nodes.forEach(xm),this.nodes.forEach(bm),this.nodes.forEach(gm),Bt&&window.MotionDebug.record(rt)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new Jg)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Zi),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const c=this.eventHandlers.get(o);c&&c.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Xg(o),this.instance=o;const{layoutId:c,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(l||c)&&(this.isLayoutDirty=!0),t){let d;const f=()=>this.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=Qg(f,250),jn.hasAnimatedSinceResize&&(jn.hasAnimatedSinceResize=!1,this.nodes.forEach(Yo))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&u&&(c||l)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeTargetChanged:p,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||u.getDefaultTransition()||Em,{onLayoutAnimationStart:x,onLayoutAnimationComplete:y}=u.getProps(),b=!this.targetLayout||!gl(this.targetLayout,v)||p,T=!f&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||T||f&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,T);const S={...Wi(g,"layout"),onPlay:x,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S)}else f||Yo(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Ye(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Tm),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&ml(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(qo);return}this.isUpdating||this.nodes.forEach(vm),this.isUpdating=!1,this.nodes.forEach(ym),this.nodes.forEach(fm),this.nodes.forEach(hm),this.clearAllSnapshots();const a=Ae.now();ie.delta=Be(0,1e3/60,a-ie.timestamp),ie.timestamp=a,ie.isProcessing=!0,Cr.update.process(ie),Cr.preRender.process(ie),Cr.render.process(ie),ie.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Li.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(mm),this.sharedNodes.forEach(wm)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,q.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){q.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=te(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!pl(this.projectionDelta),c=this.getTransformTemplate(),l=c?c(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;o&&(a||nt(this.latestValues)||u)&&(i(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return o&&(c=this.removeTransform(c)),Dm(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:a}=this.options;if(!a)return te();const c=a.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(Pm))){const{scroll:u}=this.root;u&&(wt(c.x,u.offset.x),wt(c.y,u.offset.y))}return c}removeElementScroll(o){var a;const c=te();if(ye(c,o),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return c;for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:d,options:f}=u;u!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&ye(c,o),wt(c.x,d.offset.x),wt(c.y,d.offset.y))}return c}applyTransform(o,a=!1){const c=te();ye(c,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&St(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),nt(u.latestValues)&&St(c,u.latestValues)}return nt(this.latestValues)&&St(c,this.latestValues),c}removeTransform(o){const a=te();ye(a,o);for(let c=0;c<this.path.length;c++){const l=this.path[c];if(!l.instance||!nt(l.latestValues))continue;oi(l.latestValues)&&l.updateSnapshot();const u=te(),d=l.measurePageBox();ye(u,d),$o(a,l.latestValues,l.snapshot?l.snapshot.layoutBox:void 0,u)}return nt(this.latestValues)&&$o(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==ie.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==c;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=ie.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=te(),this.relativeTargetOrigin=te(),qt(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),ye(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=te(),this.targetWithTransforms=te()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Ig(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ye(this.target,this.layout.layoutBox),cl(this.target,this.targetDelta)):ye(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=te(),this.relativeTargetOrigin=te(),qt(this.relativeTargetOrigin,this.target,p.target),ye(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Bt&&rt.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||oi(this.parent.latestValues)||al(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const a=this.getLead(),c=!!this.resumingFrom||this!==a;let l=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(l=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===ie.timestamp&&(l=!1),l)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;ye(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,p=this.treeScale.y;Fg(this.layoutCorrected,this.treeScale,this.path,c),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=te());const{target:v}=a;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Vo(this.prevProjectionDelta.x,this.projectionDelta.x),Vo(this.prevProjectionDelta.y,this.projectionDelta.y)),Kt(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==p||!Go(this.projectionDelta.x,this.prevProjectionDelta.x)||!Go(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v)),Bt&&rt.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Tt(),this.projectionDelta=Tt(),this.projectionDeltaWithTransform=Tt()}setAnimationOrigin(o,a=!1){const c=this.snapshot,l=c?c.latestValues:{},u={...this.latestValues},d=Tt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=te(),p=c?c.source:void 0,v=this.layout?this.layout.source:void 0,g=p!==v,x=this.getStack(),y=!x||x.members.length<=1,b=!!(g&&!y&&this.options.crossfade===!0&&!this.path.some(Cm));this.animationProgress=0;let T;this.mixTargetDelta=S=>{const C=S/1e3;Xo(d.x,o.x,C),Xo(d.y,o.y,C),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(qt(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Sm(this.relativeTarget,this.relativeTargetOrigin,f,C),T&&am(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=te()),ye(T,this.relativeTarget)),g&&(this.animationValues=u,tm(u,l,this.latestValues,C,b,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Ye(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=q.update(()=>{jn.hasAnimatedSinceResize=!0,this.currentAnimation=Yg(0,Ko,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Ko),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=o;if(!(!a||!c||!l)){if(this!==o&&this.layout&&l&&yl(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||te();const d=me(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+d;const f=me(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+f}ye(a,c),St(a,u),Kt(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new cm),this.sharedNodes.get(o).add(a);const l=a.options.initialPromotionConfig;a.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const l={};c.z&&Nr("z",o,l,this.animationValues);for(let u=0;u<Ar.length;u++)Nr(`rotate${Ar[u]}`,o,l,this.animationValues),Nr(`skew${Ar[u]}`,o,l,this.animationValues);o.render();for(const u in l)o.setStaticValue(u,l[u]),this.animationValues&&(this.animationValues[u]=l[u]);o.scheduleRender()}getProjectionStyles(o){var a,c;if(!this.instance||this.isSVG)return;if(!this.isVisible)return um;const l={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,l.opacity="",l.pointerEvents=Ln(o==null?void 0:o.pointerEvents)||"",l.transform=u?u(this.latestValues,""):"none",l;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const g={};return this.options.layoutId&&(g.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,g.pointerEvents=Ln(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!nt(this.latestValues)&&(g.transform=u?u({},""):"none",this.hasProjected=!1),g}const f=d.animationValues||d.latestValues;this.applyTransformsToTarget(),l.transform=lm(this.projectionDeltaWithTransform,this.treeScale,f),u&&(l.transform=u(f,l.transform));const{x:p,y:v}=this.projectionDelta;l.transformOrigin=`${p.origin*100}% ${v.origin*100}% 0`,d.animationValues?l.opacity=d===this?(c=(a=f.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&c!==void 0?c:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:l.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const g in Wn){if(f[g]===void 0)continue;const{correct:x,applyTo:y}=Wn[g],b=l.transform==="none"?f[g]:x(f[g],d);if(y){const T=y.length;for(let S=0;S<T;S++)l[y[S]]=b}else l[g]=b}return this.options.layoutId&&(l.pointerEvents=d===this?Ln(o==null?void 0:o.pointerEvents)||"":"none"),l}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(qo),this.root.sharedNodes.clear()}}}function fm(t){t.updateLayout()}function hm(t){var e;const n=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=t.layout,{animationType:s}=t.options,o=n.source!==t.layout.source;s==="size"?Te(d=>{const f=o?n.measuredBox[d]:n.layoutBox[d],p=me(f);f.min=r[d].min,f.max=f.min+p}):yl(s,n.layoutBox,r)&&Te(d=>{const f=o?n.measuredBox[d]:n.layoutBox[d],p=me(r[d]);f.max=f.min+p,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[d].max=t.relativeTarget[d].min+p)});const a=Tt();Kt(a,r,n.layoutBox);const c=Tt();o?Kt(c,t.applyTransform(i,!0),n.measuredBox):Kt(c,r,n.layoutBox);const l=!pl(a);let u=!1;if(!t.resumeFrom){const d=t.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:p}=d;if(f&&p){const v=te();qt(v,n.layoutBox,f.layoutBox);const g=te();qt(g,r,p.layoutBox),gl(v,g)||(u=!0),d.options.layoutRoot&&(t.relativeTarget=g,t.relativeTargetOrigin=v,t.relativeParent=d)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:c,layoutDelta:a,hasLayoutChanged:l,hasRelativeTargetChanged:u})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function pm(t){Bt&&rt.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function gm(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function mm(t){t.clearSnapshot()}function qo(t){t.clearMeasurements()}function vm(t){t.isLayoutDirty=!1}function ym(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Yo(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function xm(t){t.resolveTargetDelta()}function bm(t){t.calcProjection()}function Tm(t){t.resetSkewAndRotation()}function wm(t){t.removeLeadSnapshot()}function Xo(t,e,n){t.translate=X(e.translate,0,n),t.scale=X(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Zo(t,e,n,r){t.min=X(e.min,n.min,r),t.max=X(e.max,n.max,r)}function Sm(t,e,n,r){Zo(t.x,e.x,n.x,r),Zo(t.y,e.y,n.y,r)}function Cm(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Em={duration:.45,ease:[.4,0,.1,1]},Jo=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Qo=Jo("applewebkit/")&&!Jo("chrome/")?Math.round:pe;function ea(t){t.min=Qo(t.min),t.max=Qo(t.max)}function Dm(t){ea(t.x),ea(t.y)}function yl(t,e,n){return t==="position"||t==="preserve-aspect"&&!Mg(Wo(e),Wo(n),.2)}function Pm(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const Om=vl({attachResizeListener:(t,e)=>nn(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),_r={current:void 0},xl=vl({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!_r.current){const t=new Om({});t.mount(window),t.setOptions({layoutScroll:!0}),_r.current=t}return _r.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Mm={pan:{Feature:Wg},drag:{Feature:zg,ProjectionNode:xl,MeasureLayout:dl}};function ta(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&q.postRender(()=>s(e,un(e)))}class Im extends Je{mount(){const{current:e}=this.node;e&&(this.unmount=Mh(e,n=>(ta(this.node,n,"Start"),r=>ta(this.node,r,"End"))))}unmount(){}}class Rm extends Je{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ln(nn(this.node.current,"focus",()=>this.onFocus()),nn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function na(t,e,n){const{props:r}=t;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&q.postRender(()=>s(e,un(e)))}class Am extends Je{mount(){const{current:e}=this.node;e&&(this.unmount=Nh(e,n=>(na(this.node,n,"Start"),(r,{success:i})=>na(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const ci=new WeakMap,Lr=new WeakMap,Nm=t=>{const e=ci.get(t.target);e&&e(t)},_m=t=>{t.forEach(Nm)};function Lm({root:t,...e}){const n=t||document;Lr.has(n)||Lr.set(n,{});const r=Lr.get(n),i=JSON.stringify(e);return r[i]||(r[i]=new IntersectionObserver(_m,{root:t,...e})),r[i]}function km(t,e,n){const r=Lm(e);return ci.set(t,n),r.observe(t),()=>{ci.delete(t),r.unobserve(t)}}const jm={some:0,all:1};class Vm extends Je{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=e,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:jm[i]},a=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,s&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=l?u:d;f&&f(c)};return km(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Fm(e,n))&&this.startObserver()}unmount(){}}function Fm({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Bm={inView:{Feature:Vm},tap:{Feature:Am},focus:{Feature:Rm},hover:{Feature:Im}},$m={layout:{ProjectionNode:xl,MeasureLayout:dl}},li={current:null},bl={current:!1};function Um(){if(bl.current=!0,!!Ii)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>li.current=t.matches;t.addListener(e),e()}else li.current=!1}const Hm=[...Wc,se,Xe],zm=t=>Hm.find(zc(t)),ra=new WeakMap;function Wm(t,e,n){for(const r in e){const i=e[r],s=n[r];if(oe(i))t.addValue(r,i);else if(oe(s))t.addValue(r,en(i,{owner:t}));else if(s!==i)if(t.hasValue(r)){const o=t.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(r);t.addValue(r,en(o!==void 0?o:i,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const ia=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Gm{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=rs,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Ae.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,q.render(this.render,!1,!0))};const{latestValues:c,renderState:l,onUpdate:u}=o;this.onUpdate=u,this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=ir(n),this.isVariantNode=Qa(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:d,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in f){const v=f[p];c[p]!==void 0&&oe(v)&&v.set(c[p],!1)}}mount(e){this.current=e,ra.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),bl.current||Um(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:li.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){ra.delete(this.current),this.projection&&this.projection.unmount(),Ye(this.notifyUpdate),Ye(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const r=ft.has(e),i=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&q.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Pt){const n=Pt[e];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[e]&&i&&r(this.props)&&(this.features[e]=new i(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):te()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<ia.length;r++){const i=ia[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=e[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=Wm(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=en(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){var r;let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(r=this.getBaseTargetFromProps(this.props,e))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(Uc(i)||Nc(i))?i=parseFloat(i):!zm(i)&&Xe.test(n)&&(i=Fc(e,n)),this.setBaseTarget(e,oe(i)?i.get():i)),oe(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const o=ji(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(i=o[e])}if(r&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!oe(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Zi),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class Tl extends Gm{constructor(){super(...arguments),this.KeyframeResolver=Gc}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;oe(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Km(t){return window.getComputedStyle(t)}class qm extends Tl{constructor(){super(...arguments),this.type="html",this.renderInstance=cc}readValueFromInstance(e,n){if(ft.has(n)){const r=ns(n);return r&&r.default||0}else{const r=Km(e),i=(sc(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return ll(e,n)}build(e,n,r){Bi(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return zi(e,n,r)}}class Ym extends Tl{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=te}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(ft.has(n)){const r=ns(n);return r&&r.default||0}return n=lc.has(n)?n:_i(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return fc(e,n,r)}build(e,n,r){$i(e,n,this.isSVGTag,r.transformTemplate)}renderInstance(e,n,r,i){uc(e,n,r,i)}mount(e){this.isSVGTag=Hi(e.tagName),super.mount(e)}}const Xm=(t,e)=>ki(t)?new Ym(e):new qm(e,{allowProjection:t!==h.Fragment}),Zm=wh({...bg,...Bm,...Mm,...$m},Xm),Jm=jf(Zm);function sa(t,e){let n;return(...r)=>{window.clearTimeout(n),n=window.setTimeout(()=>t(...r),e)}}function Qm({debounce:t,scroll:e,polyfill:n,offsetSize:r}={debounce:0,scroll:!1,offsetSize:!1}){const i=n||(typeof window>"u"?class{}:window.ResizeObserver);if(!i)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[s,o]=h.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),a=h.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s,orientationHandler:null}),c=t?typeof t=="number"?t:t.scroll:null,l=t?typeof t=="number"?t:t.resize:null,u=h.useRef(!1);h.useEffect(()=>(u.current=!0,()=>void(u.current=!1)));const[d,f,p]=h.useMemo(()=>{const y=()=>{if(!a.current.element)return;const{left:b,top:T,width:S,height:C,bottom:P,right:D,x:E,y:k}=a.current.element.getBoundingClientRect(),A={left:b,top:T,width:S,height:C,bottom:P,right:D,x:E,y:k};a.current.element instanceof HTMLElement&&r&&(A.height=a.current.element.offsetHeight,A.width=a.current.element.offsetWidth),Object.freeze(A),u.current&&!rv(a.current.lastBounds,A)&&o(a.current.lastBounds=A)};return[y,l?sa(y,l):y,c?sa(y,c):y]},[o,r,c,l]);function v(){a.current.scrollContainers&&(a.current.scrollContainers.forEach(y=>y.removeEventListener("scroll",p,!0)),a.current.scrollContainers=null),a.current.resizeObserver&&(a.current.resizeObserver.disconnect(),a.current.resizeObserver=null),a.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",a.current.orientationHandler))}function g(){a.current.element&&(a.current.resizeObserver=new i(p),a.current.resizeObserver.observe(a.current.element),e&&a.current.scrollContainers&&a.current.scrollContainers.forEach(y=>y.addEventListener("scroll",p,{capture:!0,passive:!0})),a.current.orientationHandler=()=>{p()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",a.current.orientationHandler))}const x=y=>{!y||y===a.current.element||(v(),a.current.element=y,a.current.scrollContainers=wl(y),g())};return tv(p,!!e),ev(f),h.useEffect(()=>{v(),g()},[e,p,f]),h.useEffect(()=>v,[]),[x,s,d]}function ev(t){h.useEffect(()=>{const e=t;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[t])}function tv(t,e){h.useEffect(()=>{if(e){const n=t;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[t,e])}function wl(t){const e=[];if(!t||t===document.body)return e;const{overflow:n,overflowX:r,overflowY:i}=window.getComputedStyle(t);return[n,r,i].some(s=>s==="auto"||s==="scroll")&&e.push(t),[...e,...wl(t.parentElement)]}const nv=["x","y","top","bottom","left","right","width","height"],rv=(t,e)=>nv.every(n=>t[n]===e[n]),Sl=h.createContext({dragDropManager:void 0});function xe(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var oa=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),aa=function(){return Math.random().toString(36).substring(7).split("").join(".")},ca={INIT:"@@redux/INIT"+aa(),REPLACE:"@@redux/REPLACE"+aa()};function iv(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Cl(t,e,n){var r;if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(xe(0));if(typeof e=="function"&&typeof n>"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(xe(1));return n(Cl)(t,e)}if(typeof t!="function")throw new Error(xe(2));var i=t,s=e,o=[],a=o,c=!1;function l(){a===o&&(a=o.slice())}function u(){if(c)throw new Error(xe(3));return s}function d(g){if(typeof g!="function")throw new Error(xe(4));if(c)throw new Error(xe(5));var x=!0;return l(),a.push(g),function(){if(x){if(c)throw new Error(xe(6));x=!1,l();var b=a.indexOf(g);a.splice(b,1),o=null}}}function f(g){if(!iv(g))throw new Error(xe(7));if(typeof g.type>"u")throw new Error(xe(8));if(c)throw new Error(xe(9));try{c=!0,s=i(s,g)}finally{c=!1}for(var x=o=a,y=0;y<x.length;y++){var b=x[y];b()}return g}function p(g){if(typeof g!="function")throw new Error(xe(10));i=g,f({type:ca.REPLACE})}function v(){var g,x=d;return g={subscribe:function(b){if(typeof b!="object"||b===null)throw new Error(xe(11));function T(){b.next&&b.next(u())}T();var S=x(T);return{unsubscribe:S}}},g[oa]=function(){return this},g}return f({type:ca.INIT}),r={dispatch:f,subscribe:d,getState:u,replaceReducer:p},r[oa]=v,r}function V(t,e,...n){if(sv()&&e===void 0)throw new Error("invariant requires an error message argument");if(!t){let r;if(e===void 0)r=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let i=0;r=new Error(e.replace(/%s/g,function(){return n[i++]})),r.name="Invariant Violation"}throw r.framesToPop=1,r}}function sv(){return typeof process<"u"&&!0}function ov(t,e,n){return e.split(".").reduce((r,i)=>r&&r[i]?r[i]:n||null,t)}function av(t,e){return t.filter(n=>n!==e)}function El(t){return typeof t=="object"}function cv(t,e){const n=new Map,r=s=>{n.set(s,n.has(s)?n.get(s)+1:1)};t.forEach(r),e.forEach(r);const i=[];return n.forEach((s,o)=>{s===1&&i.push(o)}),i}function lv(t,e){return t.filter(n=>e.indexOf(n)>-1)}const as="dnd-core/INIT_COORDS",ar="dnd-core/BEGIN_DRAG",cs="dnd-core/PUBLISH_DRAG_SOURCE",cr="dnd-core/HOVER",lr="dnd-core/DROP",ur="dnd-core/END_DRAG";function la(t,e){return{type:as,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}const uv={type:as,payload:{clientOffset:null,sourceClientOffset:null}};function dv(t){return function(n=[],r={publishSource:!0}){const{publishSource:i=!0,clientOffset:s,getSourceClientOffset:o}=r,a=t.getMonitor(),c=t.getRegistry();t.dispatch(la(s)),fv(n,a,c);const l=gv(n,a);if(l==null){t.dispatch(uv);return}let u=null;if(s){if(!o)throw new Error("getSourceClientOffset must be defined");hv(o),u=o(l)}t.dispatch(la(s,u));const f=c.getSource(l).beginDrag(a,l);if(f==null)return;pv(f),c.pinSource(l);const p=c.getSourceType(l);return{type:ar,payload:{itemType:p,item:f,sourceId:l,clientOffset:s||null,sourceClientOffset:u||null,isSourcePublic:!!i}}}}function fv(t,e,n){V(!e.isDragging(),"Cannot call beginDrag while dragging."),t.forEach(function(r){V(n.getSource(r),"Expected sourceIds to be registered.")})}function hv(t){V(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function pv(t){V(El(t),"Item must be an object.")}function gv(t,e){let n=null;for(let r=t.length-1;r>=0;r--)if(e.canDragSource(t[r])){n=t[r];break}return n}function mv(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vv(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){mv(t,i,n[i])})}return t}function yv(t){return function(n={}){const r=t.getMonitor(),i=t.getRegistry();xv(r),wv(r).forEach((o,a)=>{const c=bv(o,a,i,r),l={type:lr,payload:{dropResult:vv({},n,c)}};t.dispatch(l)})}}function xv(t){V(t.isDragging(),"Cannot call drop while not dragging."),V(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function bv(t,e,n,r){const i=n.getTarget(t);let s=i?i.drop(r,t):void 0;return Tv(s),typeof s>"u"&&(s=e===0?{}:r.getDropResult()),s}function Tv(t){V(typeof t>"u"||El(t),"Drop result must either be an object or undefined.")}function wv(t){const e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}function Sv(t){return function(){const n=t.getMonitor(),r=t.getRegistry();Cv(n);const i=n.getSourceId();return i!=null&&(r.getSource(i,!0).endDrag(n,i),r.unpinSource()),{type:ur}}}function Cv(t){V(t.isDragging(),"Cannot call endDrag while not dragging.")}function ui(t,e){return e===null?t===null:Array.isArray(t)?t.some(n=>n===e):t===e}function Ev(t){return function(n,{clientOffset:r}={}){Dv(n);const i=n.slice(0),s=t.getMonitor(),o=t.getRegistry(),a=s.getItemType();return Ov(i,o,a),Pv(i,s,o),Mv(i,s,o),{type:cr,payload:{targetIds:i,clientOffset:r||null}}}}function Dv(t){V(Array.isArray(t),"Expected targetIds to be an array.")}function Pv(t,e,n){V(e.isDragging(),"Cannot call hover while not dragging."),V(!e.didDrop(),"Cannot call hover after drop.");for(let r=0;r<t.length;r++){const i=t[r];V(t.lastIndexOf(i)===r,"Expected targetIds to be unique in the passed array.");const s=n.getTarget(i);V(s,"Expected targetIds to be registered.")}}function Ov(t,e,n){for(let r=t.length-1;r>=0;r--){const i=t[r],s=e.getTargetType(i);ui(s,n)||t.splice(r,1)}}function Mv(t,e,n){t.forEach(function(r){n.getTarget(r).hover(e,r)})}function Iv(t){return function(){if(t.getMonitor().isDragging())return{type:cs}}}function Rv(t){return{beginDrag:dv(t),publishDragSource:Iv(t),hover:Ev(t),drop:yv(t),endDrag:Sv(t)}}class Av{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const e=this,{dispatch:n}=this.store;function r(s){return(...o)=>{const a=s.apply(e,o);typeof a<"u"&&n(a)}}const i=Rv(this);return Object.keys(i).reduce((s,o)=>{const a=i[o];return s[o]=r(a),s},{})}dispatch(e){this.store.dispatch(e)}constructor(e,n){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=n,e.subscribe(this.handleRefCountChange)}}function Nv(t,e){return{x:t.x+e.x,y:t.y+e.y}}function Dl(t,e){return{x:t.x-e.x,y:t.y-e.y}}function _v(t){const{clientOffset:e,initialClientOffset:n,initialSourceClientOffset:r}=t;return!e||!n||!r?null:Dl(Nv(e,r),n)}function Lv(t){const{clientOffset:e,initialClientOffset:n}=t;return!e||!n?null:Dl(e,n)}const Yt=[],ls=[];Yt.__IS_NONE__=!0;ls.__IS_ALL__=!0;function kv(t,e){return t===Yt?!1:t===ls||typeof e>"u"?!0:lv(e,t).length>0}class jv{subscribeToStateChange(e,n={}){const{handlerIds:r}=n;V(typeof e=="function","listener must be a function."),V(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let i=this.store.getState().stateId;const s=()=>{const o=this.store.getState(),a=o.stateId;try{a===i||a===i+1&&!kv(o.dirtyHandlerIds,r)||e()}finally{i=a}};return this.store.subscribe(s)}subscribeToOffsetChange(e){V(typeof e=="function","listener must be a function.");let n=this.store.getState().dragOffset;const r=()=>{const i=this.store.getState().dragOffset;i!==n&&(n=i,e())};return this.store.subscribe(r)}canDragSource(e){if(!e)return!1;const n=this.registry.getSource(e);return V(n,`Expected to find a valid source. sourceId=${e}`),this.isDragging()?!1:n.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const n=this.registry.getTarget(e);if(V(n,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(e),i=this.getItemType();return ui(r,i)&&n.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;const n=this.registry.getSource(e,!0);if(V(n,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(e),i=this.getItemType();return r!==i?!1:n.isDragging(this,e)}isOverTarget(e,n={shallow:!1}){if(!e)return!1;const{shallow:r}=n;if(!this.isDragging())return!1;const i=this.registry.getTargetType(e),s=this.getItemType();if(s&&!ui(i,s))return!1;const o=this.getTargetIds();if(!o.length)return!1;const a=o.indexOf(e);return r?a===o.length-1:a>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return _v(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return Lv(this.store.getState().dragOffset)}constructor(e,n){this.store=e,this.registry=n}}const ua=typeof global<"u"?global:self,Pl=ua.MutationObserver||ua.WebKitMutationObserver;function Ol(t){return function(){const n=setTimeout(i,0),r=setInterval(i,50);function i(){clearTimeout(n),clearInterval(r),t()}}}function Vv(t){let e=1;const n=new Pl(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}const Fv=typeof Pl=="function"?Vv:Ol;class Bv{enqueueTask(e){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const n=this.index;if(this.index++,e[n].call(),this.index>this.capacity){for(let r=0,i=e.length-this.index;r<i;r++)e[r]=e[r+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=Fv(this.flush),this.requestErrorThrow=Ol(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class $v{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,n){this.onError=e,this.release=n,this.task=null}}class Uv{create(e){const n=this.freeTasks,r=n.length?n.pop():new $v(this.onError,i=>n[n.length]=i);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}const Ml=new Bv,Hv=new Uv(Ml.registerPendingError);function zv(t){Ml.enqueueTask(Hv.create(t))}const us="dnd-core/ADD_SOURCE",ds="dnd-core/ADD_TARGET",fs="dnd-core/REMOVE_SOURCE",dr="dnd-core/REMOVE_TARGET";function Wv(t){return{type:us,payload:{sourceId:t}}}function Gv(t){return{type:ds,payload:{targetId:t}}}function Kv(t){return{type:fs,payload:{sourceId:t}}}function qv(t){return{type:dr,payload:{targetId:t}}}function Yv(t){V(typeof t.canDrag=="function","Expected canDrag to be a function."),V(typeof t.beginDrag=="function","Expected beginDrag to be a function."),V(typeof t.endDrag=="function","Expected endDrag to be a function.")}function Xv(t){V(typeof t.canDrop=="function","Expected canDrop to be a function."),V(typeof t.hover=="function","Expected hover to be a function."),V(typeof t.drop=="function","Expected beginDrag to be a function.")}function di(t,e){if(e&&Array.isArray(t)){t.forEach(n=>di(n,!1));return}V(typeof t=="string"||typeof t=="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var we;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(we||(we={}));let Zv=0;function Jv(){return Zv++}function Qv(t){const e=Jv().toString();switch(t){case we.SOURCE:return`S${e}`;case we.TARGET:return`T${e}`;default:throw new Error(`Unknown Handler Role: ${t}`)}}function da(t){switch(t[0]){case"S":return we.SOURCE;case"T":return we.TARGET;default:throw new Error(`Cannot parse handler ID: ${t}`)}}function fa(t,e){const n=t.entries();let r=!1;do{const{done:i,value:[,s]}=n.next();if(s===e)return!0;r=!!i}while(!r);return!1}class ey{addSource(e,n){di(e),Yv(n);const r=this.addHandler(we.SOURCE,e,n);return this.store.dispatch(Wv(r)),r}addTarget(e,n){di(e,!0),Xv(n);const r=this.addHandler(we.TARGET,e,n);return this.store.dispatch(Gv(r)),r}containsHandler(e){return fa(this.dragSources,e)||fa(this.dropTargets,e)}getSource(e,n=!1){return V(this.isSourceId(e),"Expected a valid source ID."),n&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return V(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return V(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return V(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return da(e)===we.SOURCE}isTargetId(e){return da(e)===we.TARGET}removeSource(e){V(this.getSource(e),"Expected an existing source."),this.store.dispatch(Kv(e)),zv(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){V(this.getTarget(e),"Expected an existing target."),this.store.dispatch(qv(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const n=this.getSource(e);V(n,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=n}unpinSource(){V(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,n,r){const i=Qv(e);return this.types.set(i,n),e===we.SOURCE?this.dragSources.set(i,r):e===we.TARGET&&this.dropTargets.set(i,r),i}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}const ty=(t,e)=>t===e;function ny(t,e){return!t&&!e?!0:!t||!e?!1:t.x===e.x&&t.y===e.y}function ry(t,e,n=ty){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(!n(t[r],e[r]))return!1;return!0}function iy(t=Yt,e){switch(e.type){case cr:break;case us:case ds:case dr:case fs:return Yt;case ar:case cs:case ur:case lr:default:return ls}const{targetIds:n=[],prevTargetIds:r=[]}=e.payload,i=cv(n,r);if(!(i.length>0||!ry(n,r)))return Yt;const o=r[r.length-1],a=n[n.length-1];return o!==a&&(o&&i.push(o),a&&i.push(a)),i}function sy(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function oy(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){sy(t,i,n[i])})}return t}const ha={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function ay(t=ha,e){const{payload:n}=e;switch(e.type){case as:case ar:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case cr:return ny(t.clientOffset,n.clientOffset)?t:oy({},t,{clientOffset:n.clientOffset});case ur:case lr:return ha;default:return t}}function cy(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){cy(t,i,n[i])})}return t}const ly={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function uy(t=ly,e){const{payload:n}=e;switch(e.type){case ar:return yt({},t,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case cs:return yt({},t,{isSourcePublic:!0});case cr:return yt({},t,{targetIds:n.targetIds});case dr:return t.targetIds.indexOf(n.targetId)===-1?t:yt({},t,{targetIds:av(t.targetIds,n.targetId)});case lr:return yt({},t,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case ur:return yt({},t,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return t}}function dy(t=0,e){switch(e.type){case us:case ds:return t+1;case fs:case dr:return t-1;default:return t}}function fy(t=0){return t+1}function hy(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function py(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){hy(t,i,n[i])})}return t}function gy(t={},e){return{dirtyHandlerIds:iy(t.dirtyHandlerIds,{type:e.type,payload:py({},e.payload,{prevTargetIds:ov(t,"dragOperation.targetIds",[])})}),dragOffset:ay(t.dragOffset,e),refCount:dy(t.refCount,e),dragOperation:uy(t.dragOperation,e),stateId:fy(t.stateId)}}function my(t,e=void 0,n={},r=!1){const i=vy(r),s=new jv(i,new ey(i)),o=new Av(i,s),a=t(o,e,n);return o.receiveBackend(a),o}function vy(t){const e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Cl(gy,t&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}function yy(t,e){if(t==null)return{};var n=xy(t,e),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)r=s[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function xy(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}let pa=0;const Vn=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var by=h.memo(function(e){var{children:n}=e,r=yy(e,["children"]);const[i,s]=Ty(r);return h.useEffect(()=>{if(s){const o=Il();return++pa,()=>{--pa===0&&(o[Vn]=null)}}},[]),m.jsx(Sl.Provider,{value:i,children:n})});function Ty(t){if("manager"in t)return[{dragDropManager:t.manager},!1];const e=wy(t.backend,t.context,t.options,t.debugMode),n=!t.context;return[e,n]}function wy(t,e=Il(),n,r){const i=e;return i[Vn]||(i[Vn]={dragDropManager:my(t,e,n,r)}),i[Vn]}function Il(){return typeof global<"u"?global:window}var Sy=dd();const Cy=od(Sy),dt=typeof window<"u"?h.useLayoutEffect:h.useEffect;function Rl(t,e,n){const[r,i]=h.useState(()=>e(t)),s=h.useCallback(()=>{const o=e(t);Cy(r,o)||(i(o),n&&n())},[r,t,n]);return dt(s),[r,s]}function Ey(t,e,n){const[r,i]=Rl(t,e,n);return dt(function(){const o=t.getHandlerId();if(o!=null)return t.subscribeToStateChange(i,{handlerIds:[o]})},[t,i]),r}function Al(t,e,n){return Ey(e,t||(()=>({})),()=>n.reconnect())}function Nl(t,e){const n=[];return typeof t!="function"&&n.push(t),h.useMemo(()=>typeof t=="function"?t():t,n)}function Dy(t){return h.useMemo(()=>t.hooks.dragSource(),[t])}function Py(t){return h.useMemo(()=>t.hooks.dragPreview(),[t])}let kr=!1,jr=!1;class Oy{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){V(!kr,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return kr=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{kr=!1}}isDragging(){if(!this.sourceId)return!1;V(!jr,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return jr=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{jr=!1}}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,n){return this.internalMonitor.isOverTarget(e,n)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}let Vr=!1;class My{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}canDrop(){if(!this.targetId)return!1;V(!Vr,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Vr=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Vr=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}function Iy(t,e,n){const r=n.getRegistry(),i=r.addTarget(t,e);return[i,()=>r.removeTarget(i)]}function Ry(t,e,n){const r=n.getRegistry(),i=r.addSource(t,e);return[i,()=>r.removeSource(i)]}function fi(t,e,n,r){let i;if(i!==void 0)return!!i;if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;const s=Object.keys(t),o=Object.keys(e);if(s.length!==o.length)return!1;const a=Object.prototype.hasOwnProperty.bind(e);for(let c=0;c<s.length;c++){const l=s[c];if(!a(l))return!1;const u=t[l],d=e[l];if(i=void 0,i===!1||i===void 0&&u!==d)return!1}return!0}function hi(t){return t!==null&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Ay(t){if(typeof t.type=="string")return;const e=t.type.displayName||t.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${e} into a <div>, or turn it into a drag source or a drop target itself.`)}function Ny(t){return(e=null,n=null)=>{if(!h.isValidElement(e)){const s=e;return t(s,n),s}const r=e;return Ay(r),_y(r,n?s=>t(s,n):t)}}function _l(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n];if(n.endsWith("Ref"))e[n]=t[n];else{const i=Ny(r);e[n]=()=>i}}),e}function ga(t,e){typeof t=="function"?t(e):t.current=e}function _y(t,e){const n=t.ref;return V(typeof n!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?h.cloneElement(t,{ref:r=>{ga(n,r),ga(e,r)}}):h.cloneElement(t,{ref:e})}class Ly{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return n&&this.disconnectDragSource(),this.handlerId?e?(n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),n):(this.lastConnectedDragSource=e,n):n}reconnectDragPreview(e=!1){const n=this.dragPreview,r=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!n){this.lastConnectedDragPreview=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=n,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,n,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!fi(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!fi(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=_l({dragSource:(n,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,hi(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,hi(n)?this.dragPreviewRef=n:this.dragPreviewNode=n,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}class ky{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!fi(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=_l({dropTarget:(n,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,hi(n)?this.dropTargetRef=n:this.dropTargetNode=n,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}function $e(){const{dragDropManager:t}=h.useContext(Sl);return V(t!=null,"Expected drag drop context"),t}function jy(t,e){const n=$e(),r=h.useMemo(()=>new Ly(n.getBackend()),[n]);return dt(()=>(r.dragSourceOptions=t||null,r.reconnect(),()=>r.disconnectDragSource()),[r,t]),dt(()=>(r.dragPreviewOptions=e||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,e]),r}function Vy(){const t=$e();return h.useMemo(()=>new Oy(t),[t])}class Fy{beginDrag(){const e=this.spec,n=this.monitor;let r=null;return typeof e.item=="object"?r=e.item:typeof e.item=="function"?r=e.item(n):r={},r??null}canDrag(){const e=this.spec,n=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag=="function"?e.canDrag(n):!0}isDragging(e,n){const r=this.spec,i=this.monitor,{isDragging:s}=r;return s?s(i):n===e.getSourceId()}endDrag(){const e=this.spec,n=this.monitor,r=this.connector,{end:i}=e;i&&i(n.getItem(),n),r.reconnect()}constructor(e,n,r){this.spec=e,this.monitor=n,this.connector=r}}function By(t,e,n){const r=h.useMemo(()=>new Fy(t,e,n),[e,n]);return h.useEffect(()=>{r.spec=t},[t]),r}function $y(t){return h.useMemo(()=>{const e=t.type;return V(e!=null,"spec.type must be defined"),e},[t])}function Uy(t,e,n){const r=$e(),i=By(t,e,n),s=$y(t);dt(function(){if(s!=null){const[a,c]=Ry(s,i,r);return e.receiveHandlerId(a),n.receiveHandlerId(a),c}},[r,e,n,i,s])}function Hy(t,e){const n=Nl(t);V(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=Vy(),i=jy(n.options,n.previewOptions);return Uy(n,r,i),[Al(n.collect,r,i),Dy(i),Py(i)]}function zy(t){const n=$e().getMonitor(),[r,i]=Rl(n,t);return h.useEffect(()=>n.subscribeToOffsetChange(i)),h.useEffect(()=>n.subscribeToStateChange(i)),r}function Wy(t){return h.useMemo(()=>t.hooks.dropTarget(),[t])}function Gy(t){const e=$e(),n=h.useMemo(()=>new ky(e.getBackend()),[e]);return dt(()=>(n.dropTargetOptions=t||null,n.reconnect(),()=>n.disconnectDropTarget()),[t]),n}function Ky(){const t=$e();return h.useMemo(()=>new My(t),[t])}function qy(t){const{accept:e}=t;return h.useMemo(()=>(V(t.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]),[e])}class Yy{canDrop(){const e=this.spec,n=this.monitor;return e.canDrop?e.canDrop(n.getItem(),n):!0}hover(){const e=this.spec,n=this.monitor;e.hover&&e.hover(n.getItem(),n)}drop(){const e=this.spec,n=this.monitor;if(e.drop)return e.drop(n.getItem(),n)}constructor(e,n){this.spec=e,this.monitor=n}}function Xy(t,e){const n=h.useMemo(()=>new Yy(t,e),[e]);return h.useEffect(()=>{n.spec=t},[t]),n}function Zy(t,e,n){const r=$e(),i=Xy(t,e),s=qy(t);dt(function(){const[a,c]=Iy(s,i,r);return e.receiveHandlerId(a),n.receiveHandlerId(a),c},[r,e,i,n,s.map(o=>o.toString()).join("|")])}function Ll(t,e){const n=Nl(t),r=Ky(),i=Gy(n.options);return Zy(n,r,i),[Al(n.collect,r,i),Wy(i)]}var kl=t=>{throw TypeError(t)},jl=(t,e,n)=>e.has(t)||kl("Cannot "+n),j=(t,e,n)=>(jl(t,e,"read from private field"),n?n.call(t):e.get(t)),be=(t,e,n)=>e.has(t)?kl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),it=(t,e,n,r)=>(jl(t,e,"write to private field"),e.set(t,n),n),We,Jy=class{constructor(){be(this,We),this.register=t=>{j(this,We).push(t)},this.unregister=t=>{for(;j(this,We).indexOf(t)!==-1;)j(this,We).splice(j(this,We).indexOf(t),1)},this.backendChanged=t=>{for(let e of j(this,We))e.backendChanged(t)},it(this,We,[])}};We=new WeakMap;var fe,$t,he,ke,st,pi,gi,mi,Fn,Bn,Ut,Vl=class $n{constructor(e,n,r){if(be(this,fe),be(this,$t),be(this,he),be(this,ke),be(this,st),be(this,pi,(i,s,o)=>{if(!o.backend)throw new Error(`You must specify a 'backend' property in your Backend entry: ${JSON.stringify(o)}`);let a=o.backend(i,s,o.options),c=o.id,l=!o.id&&a&&a.constructor;if(l&&(c=a.constructor.name),!c)throw new Error(`You must specify an 'id' property in your Backend entry: ${JSON.stringify(o)}
|
|
13
|
+
see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-5xx`);if(l&&console.warn(`Deprecation notice: You are using a pipeline which doesn't include backends' 'id'.
|
|
14
|
+
This might be unsupported in the future, please specify 'id' explicitely for every backend.`),j(this,he)[c])throw new Error(`You must specify a unique 'id' property in your Backend entry:
|
|
15
|
+
${JSON.stringify(o)} (conflicts with: ${JSON.stringify(j(this,he)[c])})`);return{id:c,instance:a,preview:o.preview??!1,transition:o.transition,skipDispatchOnTransition:o.skipDispatchOnTransition??!1}}),this.setup=()=>{if(!(typeof window>"u")){if($n.isSetUp)throw new Error("Cannot have two MultiBackends at the same time.");$n.isSetUp=!0,j(this,gi).call(this,window),j(this,he)[j(this,fe)].instance.setup()}},this.teardown=()=>{typeof window>"u"||($n.isSetUp=!1,j(this,mi).call(this,window),j(this,he)[j(this,fe)].instance.teardown())},this.connectDragSource=(i,s,o)=>j(this,Ut).call(this,"connectDragSource",i,s,o),this.connectDragPreview=(i,s,o)=>j(this,Ut).call(this,"connectDragPreview",i,s,o),this.connectDropTarget=(i,s,o)=>j(this,Ut).call(this,"connectDropTarget",i,s,o),this.profile=()=>j(this,he)[j(this,fe)].instance.profile(),this.previewEnabled=()=>j(this,he)[j(this,fe)].preview,this.previewsList=()=>j(this,$t),this.backendsList=()=>j(this,ke),be(this,gi,i=>{for(let s of j(this,ke))s.transition&&i.addEventListener(s.transition.event,j(this,Fn))}),be(this,mi,i=>{for(let s of j(this,ke))s.transition&&i.removeEventListener(s.transition.event,j(this,Fn))}),be(this,Fn,i=>{var o;let s=j(this,fe);if(j(this,ke).some(a=>a.id!==j(this,fe)&&a.transition&&a.transition.check(i)?(it(this,fe,a.id),!0):!1),j(this,fe)!==s){j(this,he)[s].instance.teardown();for(let[u,d]of Object.entries(j(this,st)))d.unsubscribe(),d.unsubscribe=j(this,Bn).call(this,d.func,...d.args);j(this,$t).backendChanged(this);let a=j(this,he)[j(this,fe)];if(a.instance.setup(),a.skipDispatchOnTransition)return;let c=i.constructor,l=new c(i.type,i);(o=i.target)==null||o.dispatchEvent(l)}}),be(this,Bn,(i,s,o,a)=>j(this,he)[j(this,fe)].instance[i](s,o,a)),be(this,Ut,(i,s,o,a)=>{let c=`${i}_${s}`,l=j(this,Bn).call(this,i,s,o,a);return j(this,st)[c]={func:i,args:[s,o,a],unsubscribe:l},()=>{j(this,st)[c].unsubscribe(),delete j(this,st)[c]}}),!r||!r.backends||r.backends.length<1)throw new Error(`You must specify at least one Backend, if you are coming from 2.x.x (or don't understand this error)
|
|
16
|
+
see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-2xx`);it(this,$t,new Jy),it(this,he,{}),it(this,ke,[]);for(let i of r.backends){let s=j(this,pi).call(this,e,n,i);j(this,he)[s.id]=s,j(this,ke).push(s)}it(this,fe,j(this,ke)[0].id),it(this,st,{})}};fe=new WeakMap,$t=new WeakMap,he=new WeakMap,ke=new WeakMap,st=new WeakMap,pi=new WeakMap,gi=new WeakMap,mi=new WeakMap,Fn=new WeakMap,Bn=new WeakMap,Ut=new WeakMap,Vl.isSetUp=!1;var Qy=Vl,ex=(t,e,n)=>new Qy(t,e,n),Fl=(t,e)=>({event:t,check:e}),tx=Fl("touchstart",t=>{let e=t;return e.touches!==null&&e.touches!==void 0}),nx=Fl("pointerdown",t=>t.pointerType==="mouse"),qe;(function(t){t.mouse="mouse",t.touch="touch",t.keyboard="keyboard"})(qe||(qe={}));class rx{get delay(){var e;return(e=this.args.delay)!==null&&e!==void 0?e:0}get scrollAngleRanges(){return this.args.scrollAngleRanges}get getDropTargetElementsAtPoint(){return this.args.getDropTargetElementsAtPoint}get ignoreContextMenu(){var e;return(e=this.args.ignoreContextMenu)!==null&&e!==void 0?e:!1}get enableHoverOutsideTarget(){var e;return(e=this.args.enableHoverOutsideTarget)!==null&&e!==void 0?e:!1}get enableKeyboardEvents(){var e;return(e=this.args.enableKeyboardEvents)!==null&&e!==void 0?e:!1}get enableMouseEvents(){var e;return(e=this.args.enableMouseEvents)!==null&&e!==void 0?e:!1}get enableTouchEvents(){var e;return(e=this.args.enableTouchEvents)!==null&&e!==void 0?e:!0}get touchSlop(){return this.args.touchSlop||0}get delayTouchStart(){var e,n,r,i;return(i=(r=(e=this.args)===null||e===void 0?void 0:e.delayTouchStart)!==null&&r!==void 0?r:(n=this.args)===null||n===void 0?void 0:n.delay)!==null&&i!==void 0?i:0}get delayMouseStart(){var e,n,r,i;return(i=(r=(e=this.args)===null||e===void 0?void 0:e.delayMouseStart)!==null&&r!==void 0?r:(n=this.args)===null||n===void 0?void 0:n.delay)!==null&&i!==void 0?i:0}get window(){if(this.context&&this.context.window)return this.context.window;if(typeof window<"u")return window}get document(){var e;if(!((e=this.context)===null||e===void 0)&&e.document)return this.context.document;if(this.window)return this.window.document}get rootElement(){var e;return((e=this.args)===null||e===void 0?void 0:e.rootElement)||this.document}constructor(e,n){this.args=e,this.context=n}}function ix(t,e,n,r){return Math.sqrt(Math.pow(Math.abs(n-t),2)+Math.pow(Math.abs(r-e),2))}function sx(t,e,n,r,i){if(!i)return!1;const s=Math.atan2(r-e,n-t)*180/Math.PI+180;for(let o=0;o<i.length;++o){const a=i[o];if(a&&(a.start==null||s>=a.start)&&(a.end==null||s<=a.end))return!0}return!1}const ox={Left:1},ax={Left:0};function Fr(t){return t.button===void 0||t.button===ax.Left}function cx(t){return t.buttons===void 0||(t.buttons&ox.Left)===0}function Bl(t){return!!t.targetTouches}const lx=1;function ux(t){const e=t.nodeType===lx?t:t.parentElement;if(!e)return;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function dx(t,e){if(t.targetTouches.length===1)return Zn(t.targetTouches[0]);if(e&&t.touches.length===1&&t.touches[0].target===e.target)return Zn(t.touches[0])}function Zn(t,e){return Bl(t)?dx(t,e):{x:t.clientX,y:t.clientY}}const ma=(()=>{let t=!1;try{addEventListener("test",()=>{},Object.defineProperty({},"passive",{get(){return t=!0,!0}}))}catch{}return t})(),Lt={[qe.mouse]:{start:"mousedown",move:"mousemove",end:"mouseup",contextmenu:"contextmenu"},[qe.touch]:{start:"touchstart",move:"touchmove",end:"touchend"},[qe.keyboard]:{keydown:"keydown"}};class Xt{profile(){var e;return{sourceNodes:this.sourceNodes.size,sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,targetNodes:this.targetNodes.size,dragOverTargetIds:((e=this.dragOverTargetIds)===null||e===void 0?void 0:e.length)||0}}get document(){return this.options.document}setup(){const e=this.options.rootElement;e&&(V(!Xt.isSetUp,"Cannot have two Touch backends at the same time."),Xt.isSetUp=!0,this.addEventListener(e,"start",this.getTopMoveStartHandler()),this.addEventListener(e,"start",this.handleTopMoveStartCapture,!0),this.addEventListener(e,"move",this.handleTopMove),this.addEventListener(e,"move",this.handleTopMoveCapture,!0),this.addEventListener(e,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.addEventListener(e,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.addEventListener(e,"keydown",this.handleCancelOnEscape,!0))}teardown(){const e=this.options.rootElement;e&&(Xt.isSetUp=!1,this._mouseClientOffset={},this.removeEventListener(e,"start",this.handleTopMoveStartCapture,!0),this.removeEventListener(e,"start",this.handleTopMoveStart),this.removeEventListener(e,"move",this.handleTopMoveCapture,!0),this.removeEventListener(e,"move",this.handleTopMove),this.removeEventListener(e,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.removeEventListener(e,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.removeEventListener(e,"keydown",this.handleCancelOnEscape,!0),this.uninstallSourceNodeRemovalObserver())}addEventListener(e,n,r,i=!1){const s=ma?{capture:i,passive:!1}:i;this.listenerTypes.forEach(function(o){const a=Lt[o][n];a&&e.addEventListener(a,r,s)})}removeEventListener(e,n,r,i=!1){const s=ma?{capture:i,passive:!1}:i;this.listenerTypes.forEach(function(o){const a=Lt[o][n];a&&e.removeEventListener(a,r,s)})}connectDragSource(e,n){const r=this.handleMoveStart.bind(this,e);return this.sourceNodes.set(e,n),this.addEventListener(n,"start",r),()=>{this.sourceNodes.delete(e),this.removeEventListener(n,"start",r)}}connectDragPreview(e,n,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDropTarget(e,n){const r=this.options.rootElement;if(!this.document||!r)return()=>{};const i=s=>{if(!this.document||!r||!this.monitor.isDragging())return;let o;switch(s.type){case Lt.mouse.move:o={x:s.clientX,y:s.clientY};break;case Lt.touch.move:var a,c;o={x:((a=s.touches[0])===null||a===void 0?void 0:a.clientX)||0,y:((c=s.touches[0])===null||c===void 0?void 0:c.clientY)||0};break}const l=o!=null?this.document.elementFromPoint(o.x,o.y):void 0,u=l&&n.contains(l);if(l===n||u)return this.handleMove(s,e)};return this.addEventListener(this.document.body,"move",i),this.targetNodes.set(e,n),()=>{this.document&&(this.targetNodes.delete(e),this.removeEventListener(this.document.body,"move",i))}}getTopMoveStartHandler(){return!this.options.delayTouchStart&&!this.options.delayMouseStart?this.handleTopMoveStart:this.handleTopMoveStartDelay}installSourceNodeRemovalObserver(e){this.uninstallSourceNodeRemovalObserver(),this.draggedSourceNode=e,this.draggedSourceNodeRemovalObserver=new MutationObserver(()=>{e&&!e.parentElement&&(this.resurrectSourceNode(),this.uninstallSourceNodeRemovalObserver())}),!(!e||!e.parentElement)&&this.draggedSourceNodeRemovalObserver.observe(e.parentElement,{childList:!0})}resurrectSourceNode(){this.document&&this.draggedSourceNode&&(this.draggedSourceNode.style.display="none",this.draggedSourceNode.removeAttribute("data-reactid"),this.document.body.appendChild(this.draggedSourceNode))}uninstallSourceNodeRemovalObserver(){this.draggedSourceNodeRemovalObserver&&this.draggedSourceNodeRemovalObserver.disconnect(),this.draggedSourceNodeRemovalObserver=void 0,this.draggedSourceNode=void 0}constructor(e,n,r){this.getSourceClientOffset=i=>{const s=this.sourceNodes.get(i);return s&&ux(s)},this.handleTopMoveStartCapture=i=>{Fr(i)&&(this.moveStartSourceIds=[])},this.handleMoveStart=i=>{Array.isArray(this.moveStartSourceIds)&&this.moveStartSourceIds.unshift(i)},this.handleTopMoveStart=i=>{if(!Fr(i))return;const s=Zn(i);s&&(Bl(i)&&(this.lastTargetTouchFallback=i.targetTouches[0]),this._mouseClientOffset=s),this.waitingForDelay=!1},this.handleTopMoveStartDelay=i=>{if(!Fr(i))return;const s=i.type===Lt.touch.start?this.options.delayTouchStart:this.options.delayMouseStart;this.timeout=setTimeout(this.handleTopMoveStart.bind(this,i),s),this.waitingForDelay=!0},this.handleTopMoveCapture=()=>{this.dragOverTargetIds=[]},this.handleMove=(i,s)=>{this.dragOverTargetIds&&this.dragOverTargetIds.unshift(s)},this.handleTopMove=i=>{if(this.timeout&&clearTimeout(this.timeout),!this.document||this.waitingForDelay)return;const{moveStartSourceIds:s,dragOverTargetIds:o}=this,a=this.options.enableHoverOutsideTarget,c=Zn(i,this.lastTargetTouchFallback);if(!c)return;if(this._isScrolling||!this.monitor.isDragging()&&sx(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,c.x,c.y,this.options.scrollAngleRanges)){this._isScrolling=!0;return}if(!this.monitor.isDragging()&&this._mouseClientOffset.hasOwnProperty("x")&&s&&ix(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,c.x,c.y)>(this.options.touchSlop?this.options.touchSlop:0)&&(this.moveStartSourceIds=void 0,this.actions.beginDrag(s,{clientOffset:this._mouseClientOffset,getSourceClientOffset:this.getSourceClientOffset,publishSource:!1})),!this.monitor.isDragging())return;const l=this.sourceNodes.get(this.monitor.getSourceId());this.installSourceNodeRemovalObserver(l),this.actions.publishDragSource(),i.cancelable&&i.preventDefault();const u=(o||[]).map(v=>this.targetNodes.get(v)).filter(v=>!!v),d=this.options.getDropTargetElementsAtPoint?this.options.getDropTargetElementsAtPoint(c.x,c.y,u):this.document.elementsFromPoint(c.x,c.y),f=[];for(const v in d){if(!d.hasOwnProperty(v))continue;let g=d[v];for(g!=null&&f.push(g);g;)g=g.parentElement,g&&f.indexOf(g)===-1&&f.push(g)}const p=f.filter(v=>u.indexOf(v)>-1).map(v=>this._getDropTargetId(v)).filter(v=>!!v).filter((v,g,x)=>x.indexOf(v)===g);if(a)for(const v in this.targetNodes){const g=this.targetNodes.get(v);if(l&&g&&g.contains(l)&&p.indexOf(v)===-1){p.unshift(v);break}}p.reverse(),this.actions.hover(p,{clientOffset:c})},this._getDropTargetId=i=>{const s=this.targetNodes.keys();let o=s.next();for(;o.done===!1;){const a=o.value;if(i===this.targetNodes.get(a))return a;o=s.next()}},this.handleTopMoveEndCapture=i=>{if(this._isScrolling=!1,this.lastTargetTouchFallback=void 0,!!cx(i)){if(!this.monitor.isDragging()||this.monitor.didDrop()){this.moveStartSourceIds=void 0;return}i.cancelable&&i.preventDefault(),this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.drop(),this.actions.endDrag()}},this.handleCancelOnEscape=i=>{i.key==="Escape"&&this.monitor.isDragging()&&(this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.endDrag())},this.options=new rx(r,n),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.sourceNodes=new Map,this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.targetNodes=new Map,this.listenerTypes=[],this._mouseClientOffset={},this._isScrolling=!1,this.options.enableMouseEvents&&this.listenerTypes.push(qe.mouse),this.options.enableTouchEvents&&this.listenerTypes.push(qe.touch),this.options.enableKeyboardEvents&&this.listenerTypes.push(qe.keyboard)}}const fx=function(e,n={},r={}){return new Xt(e,n,r)};var Ce=function(){return Ce=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Ce.apply(this,arguments)};function ae(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}function hx(t){var e=t.isVisible,n=t.ease,r=n===void 0?"easeIn":n,i=t.duration,s=t.variants,o=s===void 0?{open:{opacity:1,height:"auto"},close:{opacity:0,height:0}}:s,a=t.children,c=Qm({polyfill:Df}),l=c[0],u=c[1].height,d=h.useState(e),f=d[0],p=d[1],v=h.useState(e),g=v[0],x=v[1],y=h.useState(!1),b=y[0],T=y[1],S=function(){T(!1),e||p(!1)};h.useEffect(function(){T(!0),e?p(!0):x(!1)},[e]);var C=u===0;return h.useEffect(function(){f&&x(!0)},[C]),W.createElement(Jm.div,{style:b?{overflow:"hidden"}:void 0,onAnimationComplete:S,initial:g?"open":"close",animate:g?"open":"close",inherit:!1,variants:o,transition:{ease:r,duration:px(u,i)}},W.createElement("div",{ref:l},f&&a))}function px(t,e){if(e)return e;if(!t)return 0;var n=t/36;return Math.round((4+10*Math.pow(n,.25)+n/5)*10)/1500}var $l=h.createContext({}),gx={isLock:!1},mx=function(t){var e=h.useState(gx.isLock),n=e[0],r=e[1];return W.createElement($l.Provider,{value:{isLock:n,lock:function(){return r(!0)},unlock:function(){return r(!1)}}},t.children)},dn=h.createContext({}),Mn={dropTargetId:void 0,index:void 0},vx=function(t){var e=h.useState(Mn.dropTargetId),n=e[0],r=e[1],i=h.useState(Mn.index),s=i[0],o=i[1],a=function(l,u){r(l),o(u)},c=function(){r(Mn.dropTargetId),o(Mn.index)};return W.createElement(dn.Provider,{value:{dropTargetId:n,index:s,showPlaceholder:a,hidePlaceholder:c}},t.children)},yx=function(t,e){return t.text>e.text?1:t.text<e.text?-1:0},kt=function(t,e){return t.find(function(n){return n.id===e})},Ul=function(t,e,n){if(n===0)return!1;var r=t.find(function(i){return i.id===n});return r===void 0?!1:r.parent===e?!0:Ul(t,e,r.parent)},hs=function(t){return typeof t=="object"&&t!==null&&"id"in t&&"parent"in t&&"text"in t},Ze=function(t,e,n){var r=n.tree,i=n.rootId,s=n.canDrop;if(t===null){if(e===i)return!0;var o=r.find(function(u){return u.id===e});return!!(o&&o.droppable)}else{var a=hs(t)?t.id:null;if(s){var c=s(a,e);if(c!==void 0)return c}if(a===e)return!1;var l=r.find(function(d){return d.id===a}),o=r.find(function(d){return d.id===e});return l===void 0||a===null?e===i||!!(o!=null&&o.droppable):o===void 0?l.parent!==0:l.parent===e||!o.droppable?!1:!Ul(r,a,e)}},xx=function(t,e,n){return t.map(function(r){return r.id===e?Ce(Ce({},r),{parent:n}):r})},Hl=function(t,e,n){if(n===0)return 0;var r=t.filter(function(i){return i.parent===e});return r[n]?t.findIndex(function(i){return i.id===r[n].id}):t.findIndex(function(i){return i.id===r[n-1].id})+1},bx=function(t,e){return t.findIndex(function(n){return n.id===e})},zl=function(t,e,n,r){var i=bx(t,e),s=Hl(t,n,r);return s=s>i?s-1:s,[i,s]},Tx=function(t,e,n){var r=e<0?t.length+e:e;if(r>=0&&r<t.length){var i=n<0?t.length+n:n,s=t.splice(e,1)[0];t.splice(i,0,s)}},wx=function(t,e,n,r){var i=zl(t,e,n,r),s=i[0],o=i[1],a=ae([],t,!0);return Tx(a,s,o),a.map(function(c){return c.id===e?Ce(Ce({},c),{parent:n}):c})},Sx=function(t,e){var n=t.getBoundingClientRect(),r=n.top+n.height/2;return e>r?"down":"up"},vi=function(t,e){var n="",r=0;return t.forEach(function(i,s){var o,a=Sx(i,((o=e.getClientOffset())===null||o===void 0?void 0:o.y)||0);n===""?n=a:n!==a&&(n=a,r=s),s===t.length-1&&a==="down"&&(r=s+1)}),r},va=function(t,e,n){var r=e.closest('[role="list"]'),i=r==null?void 0:r.querySelectorAll(':scope > [role="listitem"]');return i?vi(i,n):null},Cx=function(t,e,n){var r=t.getBoundingClientRect(),i=n.dropTargetOffset;if(i===0)return"middle";var s=r.top+i,o=r.bottom-i;return e>o?"lower":e<s?"upper":"middle"},yi=function(t,e,n,r){var i;if(!e)return null;if(t===null){var s=e.querySelectorAll(':scope > [role="listitem"]');return{id:r.rootId,index:vi(s,n)}}var o=n.getItem(),a=e.querySelector('[role="list"]'),c=Cx(e,((i=n.getClientOffset())===null||i===void 0?void 0:i.y)||0,r);if(a){if(c==="upper")if(Ze(o,t.parent,r)){var l=va(t,e,n);return l===null?null:{id:t.parent,index:l}}else return{id:t.id,index:0};var s=a.querySelectorAll(':scope > [role="listitem"]');return{id:t.id,index:vi(s,n)}}else{if(c==="middle")return{id:t.id,index:0};if(Ze(o,t.parent,r)){var l=va(t,e,n);return l===null?null:{id:t.parent,index:l}}return null}},Ex=function(t){return t===void 0&&(t={}),{backends:[{id:"html5",backend:sf,options:t.html5,transition:nx},{id:"touch",backend:fx,options:t.touch||{enableMouseEvents:!0},preview:!0,transition:tx}]}},Un=function(t,e){return t.some(function(n){return n.parent===e})},Wl=h.createContext({}),Dx=function(t){var e=Ax(t.tree,t.initialOpen),n=e[0],r=e[1],i=r.handleToggle,s=r.handleCloseAll,o=r.handleOpenAll,a=r.handleOpen,c=r.handleClose;h.useImperativeHandle(t.treeRef,function(){return{open:function(p){return a(p,t.onChangeOpen)},close:function(p){return c(p,t.onChangeOpen)},openAll:function(){return o(t.onChangeOpen)},closeAll:function(){return s(t.onChangeOpen)}}});var l=$e().getMonitor(),u=t.canDrop,d=t.canDrag,f=Ce(Ce({extraAcceptTypes:[],listComponent:"ul",listItemComponent:"li",placeholderComponent:"li",sort:!0,insertDroppableFirst:!0,enableAnimateExpand:!1,dropTargetOffset:0,initialOpen:!1},t),{openIds:n,onDrop:function(p,v,g){if(p){var x={dragSourceId:p.id,dropTargetId:v,dragSource:p,dropTarget:kt(t.tree,v),monitor:l},y=t.tree;if(kt(y,p.id)||(y=ae(ae([],y,!0),[p],!1)),t.sort===!1){var b=zl(y,p.id,v,g),T=b[1];x.destinationIndex=T,x.relativeIndex=g,t.onDrop(wx(y,p.id,v,g),x);return}t.onDrop(xx(y,p.id,v),x)}else{var x={dropTargetId:v,dropTarget:kt(t.tree,v),monitor:l};t.sort===!1&&(x.destinationIndex=Hl(t.tree,v,g),x.relativeIndex=g),t.onDrop(t.tree,x)}},canDrop:u?function(p,v){return u(t.tree,{dragSourceId:p??void 0,dropTargetId:v,dragSource:l.getItem(),dropTarget:kt(t.tree,v),monitor:l})}:void 0,canDrag:d?function(p){return d(kt(t.tree,p))}:void 0,onToggle:function(p){return i(p,t.onChangeOpen)}});return W.createElement(Wl.Provider,{value:f},t.children)},Px=function(t){return W.createElement(Dx,Ce({},t),W.createElement(mx,null,W.createElement(vx,null,t.children)))},Ox=function(t){var e=h.useContext($l);h.useEffect(function(){if(t.current){var n=t.current,r=function(u){var d=u.target;(d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement)&&e.lock()},i=function(u){var d=u.target;(d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement)&&e.unlock()},s=function(u){return r(u)},o=function(u){return i(u)},a=function(u){return r(u)},c=function(u){return i(u)},l=new MutationObserver(function(){document.activeElement===document.body&&e.unlock()});return l.observe(n,{subtree:!0,childList:!0}),n.addEventListener("mouseover",s),n.addEventListener("mouseout",o),n.addEventListener("focusin",a),n.addEventListener("focusout",c),function(){l.disconnect(),n.removeEventListener("mouseover",s),n.removeEventListener("mouseout",o),n.removeEventListener("focusin",a),n.removeEventListener("focusout",c)}}},[t,e]),h.useEffect(function(){var n;(n=t.current)===null||n===void 0||n.setAttribute("draggable",e.isLock?"false":"true")},[t,e.isLock])},fr={TREE_ITEM:Symbol()},Gl=null,Kl=function(t){var e=t.target;if(e instanceof HTMLElement){var n=e.closest('[role="listitem"]');t.currentTarget===n&&(Gl=n)}},ya=function(t){return Kl(t)},xa=function(t){return Kl(t)},Mx=function(t,e){var n=Qe();h.useEffect(function(){var a=e.current;return a==null||a.addEventListener("dragstart",ya),a==null||a.addEventListener("touchstart",xa,{passive:!0}),function(){a==null||a.removeEventListener("dragstart",ya),a==null||a.removeEventListener("touchstart",xa)}},[e]);var r=Hy({type:fr.TREE_ITEM,item:function(a){var c=Ce({ref:e},t);return n.onDragStart&&n.onDragStart(c,a),c},end:function(a,c){var l=a;n.onDragEnd&&n.onDragEnd(l,c)},canDrag:function(){var a=n.canDrag;return Gl!==e.current?!1:a?a(t.id):!0},collect:function(a){return{isDragging:a.isDragging()}}}),i=r[0].isDragging,s=r[1],o=r[2];return[i,s,o]},Ix=function(t){var e=Qe(),n=h.useContext(dn),r=Ll({accept:ae([fr.TREE_ITEM],e.extraAcceptTypes,!0),drop:function(c,l){var u=e.rootId,d=e.onDrop,f=n.dropTargetId,p=n.index;l.isOver({shallow:!0})&&f!==void 0&&p!==void 0&&d(hs(c)?c:null,u,p),n.hidePlaceholder()},canDrop:function(c,l){var u=e.rootId;return l.isOver({shallow:!0})?c===void 0?!1:Ze(c,u,e):!1},hover:function(c,l){if(l.isOver({shallow:!0})){var u=e.rootId,d=n.dropTargetId,f=n.index,p=n.showPlaceholder,v=n.hidePlaceholder,g=yi(null,t.current,l,e);if(g===null||!Ze(c,u,e)){v();return}(g.id!==d||g.index!==f)&&p(g.id,g.index)}},collect:function(c){var l=c.getItem();return{isOver:c.isOver({shallow:!0})&&c.canDrop(),dragSource:l}}}),i=r[0],s=i.isOver,o=i.dragSource,a=r[1];return[s,o,a]},Rx=function(t,e){var n=Qe(),r=h.useContext(dn),i=Ll({accept:ae([fr.TREE_ITEM],n.extraAcceptTypes,!0),drop:function(l,u){var d=r.dropTargetId,f=r.index;u.isOver({shallow:!0})&&d!==void 0&&f!==void 0&&n.onDrop(hs(l)?l:null,d,f),r.hidePlaceholder()},canDrop:function(l,u){if(u.isOver({shallow:!0})){var d=yi(t,e.current,u,n);return d===null?!1:Ze(l,d.id,n)}return!1},hover:function(l,u){if(u.isOver({shallow:!0})){var d=r.dropTargetId,f=r.index,p=r.showPlaceholder,v=r.hidePlaceholder,g=yi(t,e.current,u,n);if(g===null||!Ze(l,g.id,n)){v();return}(g.id!==d||g.index!==f)&&p(g.id,g.index)}},collect:function(l){var u=l.getItem();return{isOver:l.isOver({shallow:!0})&&l.canDrop(),dragSource:u}}}),s=i[0],o=s.isOver,a=s.dragSource,c=i[1];return[o,a,c]},Ax=function(t,e){var n=h.useMemo(function(){return e===!0?t.filter(function(d){return Un(t,d.id)}).map(function(d){return d.id}):Array.isArray(e)?e:[]},[e]),r=h.useState(n),i=r[0],s=r[1];h.useEffect(function(){return s(n)},[n]);var o=function(d,f){var p=i.includes(d)?i.filter(function(v){return v!==d}):ae(ae([],i,!0),[d],!1);s(p),f&&f(p)},a=function(d){s([]),d&&d([])},c=function(d){var f=t.filter(function(p){return Un(t,p.id)}).map(function(p){return p.id});s(f),d&&d(f)},l=function(d,f){var p=[];if(Array.isArray(d)){var v=t.filter(function(g){return d.includes(g.id)&&Un(t,g.id)});p=ae(ae([],i,!0),v.map(function(g){return g.id}),!0).filter(function(g,x,y){return y.indexOf(g)===x})}else p=i.includes(d)?i:ae(ae([],i,!0),[d],!1);s(p),f&&f(p)},u=function(d,f){var p=i.filter(function(v){return Array.isArray(d)?!d.includes(v):v!==d});s(p),f&&f(p)};return[i,{handleToggle:o,handleCloseAll:a,handleOpenAll:c,handleOpen:l,handleClose:u}]},Nx=function(){return zy(function(t){var e=t.getItemType();return{item:t.getItem(),clientOffset:t.getClientOffset(),isDragging:t.isDragging()&&e===fr.TREE_ITEM}})},Qe=function(){var t=h.useContext(Wl);if(!t)throw new Error("useTreeContext must be used under TreeProvider");return t},_x=function(t,e){var n=Qe(),r=n.rootId,i=n.rootProps,s=n.classes,o=(s==null?void 0:s.container)||"";return e&&(s!=null&&s.dropTarget)&&(o="".concat(o," ").concat(s.dropTarget)),t===r&&(s!=null&&s.root)&&(o="".concat(o," ").concat(s.root)),t===r&&(i!=null&&i.className)&&(o="".concat(o," ").concat(i.className)),o=o.trim(),o},Lx=function(t,e,n){e.current?n(e):n(t),h.useEffect(function(){e.current?n(e):n(t)},[e.current])},kx=function(t){var e=Qe(),n=h.useContext(dn),r=h.useRef(null),i=h.useRef(null),s=e.tree.find(function(E){return E.id===t.id}),o=e.openIds,a=e.classes,c=e.enableAnimateExpand,l=o.includes(t.id),u=Mx(s,r),d=u[0],f=u[1],p=u[2],v=Rx(s,r),g=v[0],x=v[1],y=v[2];Lx(r,i,f),Ze(x,t.id,e)&&y(r),h.useEffect(function(){e.dragPreviewRender?p(rf(),{captureDraggingState:!0}):i.current&&p(r)},[p,e.dragPreviewRender]),Ox(r);var b=function(){return e.onToggle(s.id)},T=e.listItemComponent,S=e.canDrag?e.canDrag(t.id):!0,C=n.dropTargetId===t.id,P={depth:t.depth,isOpen:l,isDragging:d,isDropTarget:C,draggable:S,hasChild:Un(e.tree,t.id),containerRef:r,handleRef:i,onToggle:b},D="";return a!=null&&a.listItem&&(D=typeof a.listItem=="string"?a.listItem:a.listItem(s,P)),g&&(a!=null&&a.dropTarget)&&(D="".concat(D," ").concat(a.dropTarget)),d&&(a!=null&&a.draggingSource)&&(D="".concat(D," ").concat(a.draggingSource)),W.createElement(T,{ref:r,className:D,role:"listitem"},e.render(s,P),c&&P.hasChild&&W.createElement(hx,{isVisible:l},W.createElement(xi,{parentId:t.id,depth:t.depth+1})),!c&&P.hasChild&&l&&W.createElement(xi,{parentId:t.id,depth:t.depth+1}))},ba=function(t){var e=Qe(),n=e.placeholderRender,r=e.placeholderComponent,i=e.classes,s=h.useContext(dn),o=$e(),a=o.getMonitor(),c=a.getItem();if(!n||!c)return null;var l=t.dropTargetId===s.dropTargetId&&(t.index===s.index||t.index===void 0&&t.listCount===s.index),u=a.getTargetIds();return!l||!u.length?null:W.createElement(r,{className:(i==null?void 0:i.placeholder)||""},n(c,{depth:t.depth}))},xi=function(t){var e=Qe(),n=h.useRef(null),r=e.tree.filter(function(g){return g.parent===t.parentId}),i=r,s=typeof e.sort=="function"?e.sort:yx;if(e.insertDroppableFirst){var o=r.filter(function(g){return g.droppable}),a=r.filter(function(g){return!g.droppable});e.sort===!1?i=ae(ae([],o,!0),a,!0):(o=o.sort(s),a=a.sort(s),i=ae(ae([],o,!0),a,!0))}else e.sort!==!1&&(i=r.sort(s));var c=Ix(n),l=c[0],u=c[1],d=c[2];t.parentId===e.rootId&&Ze(u,e.rootId,e)&&d(n);var f=_x(t.parentId,l),p=e.rootProps||{},v=e.listComponent;return W.createElement(v,Ce({ref:n,role:"list"},p,{className:f}),i.map(function(g,x){return W.createElement(W.Fragment,{key:g.id},W.createElement(ba,{depth:t.depth,listCount:i.length,dropTargetId:t.parentId,index:x}),W.createElement(kx,{id:g.id,depth:t.depth}))}),W.createElement(ba,{depth:t.depth,listCount:i.length,dropTargetId:t.parentId}))},jx={height:"100%",left:0,pointerEvents:"none",position:"fixed",top:0,width:"100%",zIndex:100},Vx=function(t){var e=t.clientOffset;if(!e)return{};var n=e.x,r=e.y,i="translate(".concat(n,"px, ").concat(r,"px)");return{pointerEvents:"none",transform:i}},Fx=function(){var t=Qe(),e=Nx(),n=e.isDragging,r=e.clientOffset;return!n||!r?null:W.createElement("div",{style:jx},W.createElement("div",{style:Vx(e)},t.dragPreviewRender&&t.dragPreviewRender(e)))};function Bx(t,e){return W.createElement(Px,Ce({},t,{treeRef:e}),t.dragPreviewRender&&W.createElement(Fx,null),W.createElement(xi,{parentId:t.rootId,depth:0}))}var $x=h.forwardRef(Bx);const Ux="_root_71whx_1",Hx="_isSelected_71whx_10",zx="_expandIconWrapper_71whx_13",Wx="_isOpen_71whx_25",Gx="_labelGridItem_71whx_29",jt={root:Ux,isSelected:Hx,expandIconWrapper:zx,isOpen:Wx,labelGridItem:Gx},Kx=t=>{var y,b;const e=Pe.c(26),n=t.depth*24;let r;e[0]!==t?(r=T=>{T.stopPropagation(),t.onToggle(t.node.id)},e[0]=t,e[1]=r):r=e[1];const i=r;let s;e[2]!==t?(s=()=>t.onSelect(t.node),e[2]=t,e[3]=s):s=e[3];const o=s,a=`tree-node ${jt.root} ${t.isSelected?jt.isSelected:""} ${(y=t.node.data)!=null&&y.marked?"bg-gray-200":""}`;let c;e[4]!==n?(c={paddingInlineStart:n},e[4]=n,e[5]=c):c=e[5];const l=`${jt.expandIconWrapper} ${t.isOpen?jt.isOpen:""}`;let u;e[6]!==i||e[7]!==t.node.droppable?(u=t.node.droppable&&m.jsx("div",{onClick:i,children:m.jsx(hd,{size:18})}),e[6]=i,e[7]=t.node.droppable,e[8]=u):u=e[8];let d;e[9]!==l||e[10]!==u?(d=m.jsx("div",{className:l,children:u}),e[9]=l,e[10]=u,e[11]=d):d=e[11];const f=((b=t.node.data)==null?void 0:b.icon)??"folder";let p;e[12]!==f?(p=m.jsx(Hn,{name:f}),e[12]=f,e[13]=p):p=e[13];let v;e[14]!==t.node.text?(v=m.jsx("div",{className:jt.labelGridItem,children:m.jsx("span",{children:t.node.text})}),e[14]=t.node.text,e[15]=v):v=e[15];let g;e[16]!==t.loading?(g=t.loading&&m.jsx(at,{className:"size-4 animate-spin"}),e[16]=t.loading,e[17]=g):g=e[17];let x;return e[18]!==o||e[19]!==g||e[20]!==a||e[21]!==c||e[22]!==d||e[23]!==p||e[24]!==v?(x=m.jsxs("div",{className:a,style:c,onClick:o,children:[d,p,v,g]}),e[18]=o,e[19]=g,e[20]=a,e[21]=c,e[22]=d,e[23]=p,e[24]=v,e[25]=x):x=e[25],x},qx="_root_m21nb_1",Yx="_icon_m21nb_16",Xx="_label_m21nb_17",Br={root:qx,icon:Yx,label:Xx},Zx=t=>{var a;const e=Pe.c(7),n=t.monitorProps.item,r=((a=n.data)==null?void 0:a.icon)??"folder";let i;e[0]!==r?(i=m.jsx("div",{className:Br.icon,children:m.jsx(Hn,{name:r})}),e[0]=r,e[1]=i):i=e[1];let s;e[2]!==n.text?(s=m.jsx("div",{className:Br.label,children:n.text}),e[2]=n.text,e[3]=s):s=e[3];let o;return e[4]!==i||e[5]!==s?(o=m.jsxs("div",{className:Br.root,children:[i,s]}),e[4]=i,e[5]=s,e[6]=o):o=e[6],o},Jx="_app_1musi_1",Qx="_draggingSource_1musi_9",eb="_placeholderContainer_1musi_13",tb="_dropTarget_1musi_17",In={app:Jx,draggingSource:Qx,placeholderContainer:eb,dropTarget:tb},nb="_root_psdhm_1",rb={root:nb},ib=t=>{const e=Pe.c(2),n=t.depth*24;let r;return e[0]!==n?(r=m.jsx("div",{className:rb.root,style:{left:n}}),e[0]=n,e[1]=r):r=e[1],r},ql=h.createContext({messages:{},setMessages:()=>{}});function Jn(t){const e=sb(t),n=h.forwardRef((r,i)=>{const{children:s,...o}=r,a=h.Children.toArray(s),c=a.find(ab);if(c){const l=c.props.children,u=a.map(d=>d===c?h.Children.count(l)>1?h.Children.only(null):h.isValidElement(l)?l.props.children:null:d);return m.jsx(e,{...o,ref:i,children:h.isValidElement(l)?h.cloneElement(l,void 0,u):null})}return m.jsx(e,{...o,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}function sb(t){const e=h.forwardRef((n,r)=>{const{children:i,...s}=n;if(h.isValidElement(i)){const o=lb(i),a=cb(s,i.props);return i.type!==h.Fragment&&(a.ref=r?Oa(r,o):o),h.cloneElement(i,a)}return h.Children.count(i)>1?h.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var ob=Symbol("radix.slottable");function ab(t){return h.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===ob}function cb(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const c=s(...a);return i(...a),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function lb(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var ub=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ce=ub.reduce((t,e)=>{const n=Jn(`Primitive.${e}`),r=h.forwardRef((i,s)=>{const{asChild:o,...a}=i,c=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function Yl(t,e){t&&ad.flushSync(()=>t.dispatchEvent(e))}function Xl(t){const e=t+"CollectionProvider",[n,r]=on(e),[i,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:x,children:y}=g,b=W.useRef(null),T=W.useRef(new Map).current;return m.jsx(i,{scope:x,itemMap:T,collectionRef:b,children:y})};o.displayName=e;const a=t+"CollectionSlot",c=Jn(a),l=W.forwardRef((g,x)=>{const{scope:y,children:b}=g,T=s(a,y),S=ge(x,T.collectionRef);return m.jsx(c,{ref:S,children:b})});l.displayName=a;const u=t+"CollectionItemSlot",d="data-radix-collection-item",f=Jn(u),p=W.forwardRef((g,x)=>{const{scope:y,children:b,...T}=g,S=W.useRef(null),C=ge(x,S),P=s(u,y);return W.useEffect(()=>(P.itemMap.set(S,{ref:S,...T}),()=>void P.itemMap.delete(S))),m.jsx(f,{[d]:"",ref:C,children:b})});p.displayName=u;function v(g){const x=s(t+"CollectionConsumer",g);return W.useCallback(()=>{const b=x.collectionRef.current;if(!b)return[];const T=Array.from(b.querySelectorAll(`[${d}]`));return Array.from(x.itemMap.values()).sort((P,D)=>T.indexOf(P.ref.current)-T.indexOf(D.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},v,r]}var db="DismissableLayer",bi="dismissableLayer.update",fb="dismissableLayer.pointerDownOutside",hb="dismissableLayer.focusOutside",Ta,Zl=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Jl=h.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...c}=t,l=h.useContext(Zl),[u,d]=h.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=h.useState({}),v=ge(e,D=>d(D)),g=Array.from(l.layers),[x]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),y=g.indexOf(x),b=u?g.indexOf(u):-1,T=l.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=mb(D=>{const E=D.target,k=[...l.branches].some(A=>A.contains(E));!S||k||(i==null||i(D),o==null||o(D),D.defaultPrevented||a==null||a())},f),P=vb(D=>{const E=D.target;[...l.branches].some(A=>A.contains(E))||(s==null||s(D),o==null||o(D),D.defaultPrevented||a==null||a())},f);return vd(D=>{b===l.layers.size-1&&(r==null||r(D),!D.defaultPrevented&&a&&(D.preventDefault(),a()))},f),h.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Ta=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),wa(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Ta)}},[u,f,n,l]),h.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),wa())},[u,l]),h.useEffect(()=>{const D=()=>p({});return document.addEventListener(bi,D),()=>document.removeEventListener(bi,D)},[]),m.jsx(ce.div,{...c,ref:v,style:{pointerEvents:T?S?"auto":"none":void 0,...t.style},onFocusCapture:B(t.onFocusCapture,P.onFocusCapture),onBlurCapture:B(t.onBlurCapture,P.onBlurCapture),onPointerDownCapture:B(t.onPointerDownCapture,C.onPointerDownCapture)})});Jl.displayName=db;var pb="DismissableLayerBranch",gb=h.forwardRef((t,e)=>{const n=h.useContext(Zl),r=h.useRef(null),i=ge(e,r);return h.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),m.jsx(ce.div,{...t,ref:i})});gb.displayName=pb;function mb(t,e=globalThis==null?void 0:globalThis.document){const n=Fe(t),r=h.useRef(!1),i=h.useRef(()=>{});return h.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){Ql(fb,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=c,e.addEventListener("click",i.current,{once:!0})):c()}else e.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function vb(t,e=globalThis==null?void 0:globalThis.document){const n=Fe(t),r=h.useRef(!1);return h.useEffect(()=>{const i=s=>{s.target&&!r.current&&Ql(hb,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function wa(){const t=new CustomEvent(bi);document.dispatchEvent(t)}function Ql(t,e,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?Yl(i,s):i.dispatchEvent(s)}var $r="focusScope.autoFocusOnMount",Ur="focusScope.autoFocusOnUnmount",Sa={bubbles:!1,cancelable:!0},yb="FocusScope",eu=h.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,c]=h.useState(null),l=Fe(i),u=Fe(s),d=h.useRef(null),f=ge(e,g=>c(g)),p=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(r){let g=function(T){if(p.paused||!a)return;const S=T.target;a.contains(S)?d.current=S:Ge(d.current,{select:!0})},x=function(T){if(p.paused||!a)return;const S=T.relatedTarget;S!==null&&(a.contains(S)||Ge(d.current,{select:!0}))},y=function(T){if(document.activeElement===document.body)for(const C of T)C.removedNodes.length>0&&Ge(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",x);const b=new MutationObserver(y);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",x),b.disconnect()}}},[r,a,p.paused]),h.useEffect(()=>{if(a){Ea.add(p);const g=document.activeElement;if(!a.contains(g)){const y=new CustomEvent($r,Sa);a.addEventListener($r,l),a.dispatchEvent(y),y.defaultPrevented||(xb(Cb(tu(a)),{select:!0}),document.activeElement===g&&Ge(a))}return()=>{a.removeEventListener($r,l),setTimeout(()=>{const y=new CustomEvent(Ur,Sa);a.addEventListener(Ur,u),a.dispatchEvent(y),y.defaultPrevented||Ge(g??document.body,{select:!0}),a.removeEventListener(Ur,u),Ea.remove(p)},0)}}},[a,l,u,p]);const v=h.useCallback(g=>{if(!n&&!r||p.paused)return;const x=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,y=document.activeElement;if(x&&y){const b=g.currentTarget,[T,S]=bb(b);T&&S?!g.shiftKey&&y===S?(g.preventDefault(),n&&Ge(T,{select:!0})):g.shiftKey&&y===T&&(g.preventDefault(),n&&Ge(S,{select:!0})):y===b&&g.preventDefault()}},[n,r,p.paused]);return m.jsx(ce.div,{tabIndex:-1,...o,ref:f,onKeyDown:v})});eu.displayName=yb;function xb(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Ge(r,{select:e}),document.activeElement!==n)return}function bb(t){const e=tu(t),n=Ca(e,t),r=Ca(e.reverse(),t);return[n,r]}function tu(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Ca(t,e){for(const n of t)if(!Tb(n,{upTo:e}))return n}function Tb(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function wb(t){return t instanceof HTMLInputElement&&"select"in t}function Ge(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&wb(t)&&e&&t.select()}}var Ea=Sb();function Sb(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=Da(t,e),t.unshift(e)},remove(e){var n;t=Da(t,e),(n=t[0])==null||n.resume()}}}function Da(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function Cb(t){return t.filter(e=>e.tagName!=="A")}var Eb="Arrow",nu=h.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...s}=t;return m.jsx(ce.svg,{...s,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:m.jsx("polygon",{points:"0,0 30,0 15,10"})})});nu.displayName=Eb;var Db=nu,ps="Popper",[ru,iu]=on(ps),[Pb,su]=ru(ps),ou=t=>{const{__scopePopper:e,children:n}=t,[r,i]=h.useState(null);return m.jsx(Pb,{scope:e,anchor:r,onAnchorChange:i,children:n})};ou.displayName=ps;var au="PopperAnchor",cu=h.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,s=su(au,n),o=h.useRef(null),a=ge(e,o);return h.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:m.jsx(ce.div,{...i,ref:a})});cu.displayName=au;var gs="PopperContent",[Ob,Mb]=ru(gs),lu=h.forwardRef((t,e)=>{var Ee,_e,de,He,gn,Me;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:v,...g}=t,x=su(gs,n),[y,b]=h.useState(null),T=ge(e,et=>b(et)),[S,C]=h.useState(null),P=yd(S),D=(P==null?void 0:P.width)??0,E=(P==null?void 0:P.height)??0,k=r+(s!=="center"?"-"+s:""),A=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},G=Array.isArray(l)?l:[l],K=G.length>0,ne={padding:A,boundary:G.filter(Rb),altBoundary:K},{refs:re,floatingStyles:ue,placement:J,isPositioned:H,middlewareData:z}=xd({strategy:"fixed",placement:k,whileElementsMounted:(...et)=>Pd(...et,{animationFrame:p==="always"}),elements:{reference:x.anchor},middleware:[bd({mainAxis:i+E,alignmentAxis:o}),c&&Td({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Dd():void 0,...ne}),c&&wd({...ne}),Sd({...ne,apply:({elements:et,rects:Rt,availableWidth:mn,availableHeight:gr})=>{const{width:mr,height:At}=Rt.reference,mt=et.floating.style;mt.setProperty("--radix-popper-available-width",`${mn}px`),mt.setProperty("--radix-popper-available-height",`${gr}px`),mt.setProperty("--radix-popper-anchor-width",`${mr}px`),mt.setProperty("--radix-popper-anchor-height",`${At}px`)}}),S&&Cd({element:S,padding:a}),Ab({arrowWidth:D,arrowHeight:E}),f&&Ed({strategy:"referenceHidden",...ne})]}),[O,U]=fu(J),Q=Fe(v);Wr(()=>{H&&(Q==null||Q())},[H,Q]);const ve=(Ee=z.arrow)==null?void 0:Ee.x,Ne=(_e=z.arrow)==null?void 0:_e.y,Ue=((de=z.arrow)==null?void 0:de.centerOffset)!==0,[gt,Oe]=h.useState();return Wr(()=>{y&&Oe(window.getComputedStyle(y).zIndex)},[y]),m.jsx("div",{ref:re.setFloating,"data-radix-popper-content-wrapper":"",style:{...ue,transform:H?ue.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:gt,"--radix-popper-transform-origin":[(He=z.transformOrigin)==null?void 0:He.x,(gn=z.transformOrigin)==null?void 0:gn.y].join(" "),...((Me=z.hide)==null?void 0:Me.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:m.jsx(Ob,{scope:n,placedSide:O,onArrowChange:C,arrowX:ve,arrowY:Ne,shouldHideArrow:Ue,children:m.jsx(ce.div,{"data-side":O,"data-align":U,...g,ref:T,style:{...g.style,animation:H?void 0:"none"}})})})});lu.displayName=gs;var uu="PopperArrow",Ib={top:"bottom",right:"left",bottom:"top",left:"right"},du=h.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,s=Mb(uu,r),o=Ib[s.placedSide];return m.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:m.jsx(Db,{...i,ref:n,style:{...i.style,display:"block"}})})});du.displayName=uu;function Rb(t){return t!==null}var Ab=t=>({name:"transformOrigin",options:t,fn(e){var x,y,b;const{placement:n,rects:r,middlewareData:i}=e,o=((x=i.arrow)==null?void 0:x.centerOffset)!==0,a=o?0:t.arrowWidth,c=o?0:t.arrowHeight,[l,u]=fu(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((y=i.arrow)==null?void 0:y.x)??0)+a/2,p=(((b=i.arrow)==null?void 0:b.y)??0)+c/2;let v="",g="";return l==="bottom"?(v=o?d:`${f}px`,g=`${-c}px`):l==="top"?(v=o?d:`${f}px`,g=`${r.floating.height+c}px`):l==="right"?(v=`${-c}px`,g=o?d:`${p}px`):l==="left"&&(v=`${r.floating.width+c}px`,g=o?d:`${p}px`),{data:{x:v,y:g}}}});function fu(t){const[e,n="center"]=t.split("-");return[e,n]}var Nb=ou,_b=cu,Lb=lu,kb=du,jb="Portal",hu=h.forwardRef((t,e)=>{var a;const{container:n,...r}=t,[i,s]=h.useState(!1);Wr(()=>s(!0),[]);const o=n||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?cd.createPortal(m.jsx(ce.div,{...r,ref:e}),o):null});hu.displayName=jb;var Hr="rovingFocusGroup.onEntryFocus",Vb={bubbles:!1,cancelable:!0},fn="RovingFocusGroup",[Ti,pu,Fb]=Xl(fn),[Bb,gu]=on(fn,[Fb]),[$b,Ub]=Bb(fn),mu=h.forwardRef((t,e)=>m.jsx(Ti.Provider,{scope:t.__scopeRovingFocusGroup,children:m.jsx(Ti.Slot,{scope:t.__scopeRovingFocusGroup,children:m.jsx(Hb,{...t,ref:e})})}));mu.displayName=fn;var Hb=h.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=t,f=h.useRef(null),p=ge(e,f),v=Ia(s),[g,x]=Md({prop:o,defaultProp:a??null,onChange:c,caller:fn}),[y,b]=h.useState(!1),T=Fe(l),S=pu(n),C=h.useRef(!1),[P,D]=h.useState(0);return h.useEffect(()=>{const E=f.current;if(E)return E.addEventListener(Hr,T),()=>E.removeEventListener(Hr,T)},[T]),m.jsx($b,{scope:n,orientation:r,dir:v,loop:i,currentTabStopId:g,onItemFocus:h.useCallback(E=>x(E),[x]),onItemShiftTab:h.useCallback(()=>b(!0),[]),onFocusableItemAdd:h.useCallback(()=>D(E=>E+1),[]),onFocusableItemRemove:h.useCallback(()=>D(E=>E-1),[]),children:m.jsx(ce.div,{tabIndex:y||P===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...t.style},onMouseDown:B(t.onMouseDown,()=>{C.current=!0}),onFocus:B(t.onFocus,E=>{const k=!C.current;if(E.target===E.currentTarget&&k&&!y){const A=new CustomEvent(Hr,Vb);if(E.currentTarget.dispatchEvent(A),!A.defaultPrevented){const G=S().filter(J=>J.focusable),K=G.find(J=>J.active),ne=G.find(J=>J.id===g),ue=[K,ne,...G].filter(Boolean).map(J=>J.ref.current);xu(ue,u)}}C.current=!1}),onBlur:B(t.onBlur,()=>b(!1))})})}),vu="RovingFocusGroupItem",yu=h.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,children:o,...a}=t,c=Od(),l=s||c,u=Ub(vu,n),d=u.currentTabStopId===l,f=pu(n),{onFocusableItemAdd:p,onFocusableItemRemove:v,currentTabStopId:g}=u;return h.useEffect(()=>{if(r)return p(),()=>v()},[r,p,v]),m.jsx(Ti.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:m.jsx(ce.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...a,ref:e,onMouseDown:B(t.onMouseDown,x=>{r?u.onItemFocus(l):x.preventDefault()}),onFocus:B(t.onFocus,()=>u.onItemFocus(l)),onKeyDown:B(t.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){u.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const y=Gb(x,u.orientation,u.dir);if(y!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let T=f().filter(S=>S.focusable).map(S=>S.ref.current);if(y==="last")T.reverse();else if(y==="prev"||y==="next"){y==="prev"&&T.reverse();const S=T.indexOf(x.currentTarget);T=u.loop?Kb(T,S+1):T.slice(S+1)}setTimeout(()=>xu(T))}}),children:typeof o=="function"?o({isCurrentTabStop:d,hasTabStop:g!=null}):o})})});yu.displayName=vu;var zb={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Wb(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Gb(t,e,n){const r=Wb(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return zb[r]}function xu(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function Kb(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var qb=mu,Yb=yu,wi=["Enter"," "],Xb=["ArrowDown","PageUp","Home"],bu=["ArrowUp","PageDown","End"],Zb=[...Xb,...bu],Jb={ltr:[...wi,"ArrowRight"],rtl:[...wi,"ArrowLeft"]},Qb={ltr:["ArrowLeft"],rtl:["ArrowRight"]},hn="Menu",[rn,eT,tT]=Xl(hn),[ht,Tu]=on(hn,[tT,iu,gu]),hr=iu(),wu=gu(),[nT,pt]=ht(hn),[rT,pn]=ht(hn),Su=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:i,onOpenChange:s,modal:o=!0}=t,a=hr(e),[c,l]=h.useState(null),u=h.useRef(!1),d=Fe(s),f=Ia(i);return h.useEffect(()=>{const p=()=>{u.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>u.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),m.jsx(Nb,{...a,children:m.jsx(nT,{scope:e,open:n,onOpenChange:d,content:c,onContentChange:l,children:m.jsx(rT,{scope:e,onClose:h.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};Su.displayName=hn;var iT="MenuAnchor",ms=h.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=hr(n);return m.jsx(_b,{...i,...r,ref:e})});ms.displayName=iT;var vs="MenuPortal",[sT,Cu]=ht(vs,{forceMount:void 0}),Eu=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:i}=t,s=pt(vs,e);return m.jsx(sT,{scope:e,forceMount:n,children:m.jsx(tr,{present:n||s.open,children:m.jsx(hu,{asChild:!0,container:i,children:r})})})};Eu.displayName=vs;var Se="MenuContent",[oT,ys]=ht(Se),Du=h.forwardRef((t,e)=>{const n=Cu(Se,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,s=pt(Se,t.__scopeMenu),o=pn(Se,t.__scopeMenu);return m.jsx(rn.Provider,{scope:t.__scopeMenu,children:m.jsx(tr,{present:r||s.open,children:m.jsx(rn.Slot,{scope:t.__scopeMenu,children:o.modal?m.jsx(aT,{...i,ref:e}):m.jsx(cT,{...i,ref:e})})})})}),aT=h.forwardRef((t,e)=>{const n=pt(Se,t.__scopeMenu),r=h.useRef(null),i=ge(e,r);return h.useEffect(()=>{const s=r.current;if(s)return Id(s)},[]),m.jsx(xs,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:B(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),cT=h.forwardRef((t,e)=>{const n=pt(Se,t.__scopeMenu);return m.jsx(xs,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),lT=Jn("MenuContent.ScrollLock"),xs=h.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:v,...g}=t,x=pt(Se,n),y=pn(Se,n),b=hr(n),T=wu(n),S=eT(n),[C,P]=h.useState(null),D=h.useRef(null),E=ge(e,D,x.onContentChange),k=h.useRef(0),A=h.useRef(""),G=h.useRef(0),K=h.useRef(null),ne=h.useRef("right"),re=h.useRef(0),ue=v?Ad:h.Fragment,J=v?{as:lT,allowPinchZoom:!0}:void 0,H=O=>{var Ee,_e;const U=A.current+O,Q=S().filter(de=>!de.disabled),ve=document.activeElement,Ne=(Ee=Q.find(de=>de.ref.current===ve))==null?void 0:Ee.textValue,Ue=Q.map(de=>de.textValue),gt=TT(Ue,U,Ne),Oe=(_e=Q.find(de=>de.textValue===gt))==null?void 0:_e.ref.current;(function de(He){A.current=He,window.clearTimeout(k.current),He!==""&&(k.current=window.setTimeout(()=>de(""),1e3))})(U),Oe&&setTimeout(()=>Oe.focus())};h.useEffect(()=>()=>window.clearTimeout(k.current),[]),Rd();const z=h.useCallback(O=>{var Q,ve;return ne.current===((Q=K.current)==null?void 0:Q.side)&&ST(O,(ve=K.current)==null?void 0:ve.area)},[]);return m.jsx(oT,{scope:n,searchRef:A,onItemEnter:h.useCallback(O=>{z(O)&&O.preventDefault()},[z]),onItemLeave:h.useCallback(O=>{var U;z(O)||((U=D.current)==null||U.focus(),P(null))},[z]),onTriggerLeave:h.useCallback(O=>{z(O)&&O.preventDefault()},[z]),pointerGraceTimerRef:G,onPointerGraceIntentChange:h.useCallback(O=>{K.current=O},[]),children:m.jsx(ue,{...J,children:m.jsx(eu,{asChild:!0,trapped:i,onMountAutoFocus:B(s,O=>{var U;O.preventDefault(),(U=D.current)==null||U.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:m.jsx(Jl,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:m.jsx(qb,{asChild:!0,...T,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:P,onEntryFocus:B(c,O=>{y.isUsingKeyboardRef.current||O.preventDefault()}),preventScrollOnEntryFocus:!0,children:m.jsx(Lb,{role:"menu","aria-orientation":"vertical","data-state":Uu(x.open),"data-radix-menu-content":"",dir:y.dir,...b,...g,ref:E,style:{outline:"none",...g.style},onKeyDown:B(g.onKeyDown,O=>{const Q=O.target.closest("[data-radix-menu-content]")===O.currentTarget,ve=O.ctrlKey||O.altKey||O.metaKey,Ne=O.key.length===1;Q&&(O.key==="Tab"&&O.preventDefault(),!ve&&Ne&&H(O.key));const Ue=D.current;if(O.target!==Ue||!Zb.includes(O.key))return;O.preventDefault();const Oe=S().filter(Ee=>!Ee.disabled).map(Ee=>Ee.ref.current);bu.includes(O.key)&&Oe.reverse(),xT(Oe)}),onBlur:B(t.onBlur,O=>{O.currentTarget.contains(O.target)||(window.clearTimeout(k.current),A.current="")}),onPointerMove:B(t.onPointerMove,sn(O=>{const U=O.target,Q=re.current!==O.clientX;if(O.currentTarget.contains(U)&&Q){const ve=O.clientX>re.current?"right":"left";ne.current=ve,re.current=O.clientX}}))})})})})})})});Du.displayName=Se;var uT="MenuGroup",bs=h.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return m.jsx(ce.div,{role:"group",...r,ref:e})});bs.displayName=uT;var dT="MenuLabel",Pu=h.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return m.jsx(ce.div,{...r,ref:e})});Pu.displayName=dT;var Qn="MenuItem",Pa="menu.itemSelect",pr=h.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...i}=t,s=h.useRef(null),o=pn(Qn,t.__scopeMenu),a=ys(Qn,t.__scopeMenu),c=ge(e,s),l=h.useRef(!1),u=()=>{const d=s.current;if(!n&&d){const f=new CustomEvent(Pa,{bubbles:!0,cancelable:!0});d.addEventListener(Pa,p=>r==null?void 0:r(p),{once:!0}),Yl(d,f),f.defaultPrevented?l.current=!1:o.onClose()}};return m.jsx(Ou,{...i,ref:c,disabled:n,onClick:B(t.onClick,u),onPointerDown:d=>{var f;(f=t.onPointerDown)==null||f.call(t,d),l.current=!0},onPointerUp:B(t.onPointerUp,d=>{var f;l.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:B(t.onKeyDown,d=>{const f=a.searchRef.current!=="";n||f&&d.key===" "||wi.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});pr.displayName=Qn;var Ou=h.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...s}=t,o=ys(Qn,n),a=wu(n),c=h.useRef(null),l=ge(e,c),[u,d]=h.useState(!1),[f,p]=h.useState("");return h.useEffect(()=>{const v=c.current;v&&p((v.textContent??"").trim())},[s.children]),m.jsx(rn.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:m.jsx(Yb,{asChild:!0,...a,focusable:!r,children:m.jsx(ce.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:l,onPointerMove:B(t.onPointerMove,sn(v=>{r?o.onItemLeave(v):(o.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:B(t.onPointerLeave,sn(v=>o.onItemLeave(v))),onFocus:B(t.onFocus,()=>d(!0)),onBlur:B(t.onBlur,()=>d(!1))})})})}),fT="MenuCheckboxItem",Mu=h.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...i}=t;return m.jsx(_u,{scope:t.__scopeMenu,checked:n,children:m.jsx(pr,{role:"menuitemcheckbox","aria-checked":er(n)?"mixed":n,...i,ref:e,"data-state":ws(n),onSelect:B(i.onSelect,()=>r==null?void 0:r(er(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Mu.displayName=fT;var Iu="MenuRadioGroup",[hT,pT]=ht(Iu,{value:void 0,onValueChange:()=>{}}),Ru=h.forwardRef((t,e)=>{const{value:n,onValueChange:r,...i}=t,s=Fe(r);return m.jsx(hT,{scope:t.__scopeMenu,value:n,onValueChange:s,children:m.jsx(bs,{...i,ref:e})})});Ru.displayName=Iu;var Au="MenuRadioItem",Nu=h.forwardRef((t,e)=>{const{value:n,...r}=t,i=pT(Au,t.__scopeMenu),s=n===i.value;return m.jsx(_u,{scope:t.__scopeMenu,checked:s,children:m.jsx(pr,{role:"menuitemradio","aria-checked":s,...r,ref:e,"data-state":ws(s),onSelect:B(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});Nu.displayName=Au;var Ts="MenuItemIndicator",[_u,gT]=ht(Ts,{checked:!1}),Lu=h.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...i}=t,s=gT(Ts,n);return m.jsx(tr,{present:r||er(s.checked)||s.checked===!0,children:m.jsx(ce.span,{...i,ref:e,"data-state":ws(s.checked)})})});Lu.displayName=Ts;var mT="MenuSeparator",ku=h.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return m.jsx(ce.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});ku.displayName=mT;var vT="MenuArrow",ju=h.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=hr(n);return m.jsx(kb,{...i,...r,ref:e})});ju.displayName=vT;var yT="MenuSub",[SS,Vu]=ht(yT),Ht="MenuSubTrigger",Fu=h.forwardRef((t,e)=>{const n=pt(Ht,t.__scopeMenu),r=pn(Ht,t.__scopeMenu),i=Vu(Ht,t.__scopeMenu),s=ys(Ht,t.__scopeMenu),o=h.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=s,l={__scopeMenu:t.__scopeMenu},u=h.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return h.useEffect(()=>u,[u]),h.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),c(null)}},[a,c]),m.jsx(ms,{asChild:!0,...l,children:m.jsx(Ou,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":Uu(n.open),...t,ref:Oa(e,i.onTriggerChange),onClick:d=>{var f;(f=t.onClick)==null||f.call(t,d),!(t.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:B(t.onPointerMove,sn(d=>{s.onItemEnter(d),!d.defaultPrevented&&!t.disabled&&!n.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:B(t.onPointerLeave,sn(d=>{var p,v;u();const f=(p=n.content)==null?void 0:p.getBoundingClientRect();if(f){const g=(v=n.content)==null?void 0:v.dataset.side,x=g==="right",y=x?-5:5,b=f[x?"left":"right"],T=f[x?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+y,y:d.clientY},{x:b,y:f.top},{x:T,y:f.top},{x:T,y:f.bottom},{x:b,y:f.bottom}],side:g}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:B(t.onKeyDown,d=>{var p;const f=s.searchRef.current!=="";t.disabled||f&&d.key===" "||Jb[r.dir].includes(d.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),d.preventDefault())})})})});Fu.displayName=Ht;var Bu="MenuSubContent",$u=h.forwardRef((t,e)=>{const n=Cu(Se,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,s=pt(Se,t.__scopeMenu),o=pn(Se,t.__scopeMenu),a=Vu(Bu,t.__scopeMenu),c=h.useRef(null),l=ge(e,c);return m.jsx(rn.Provider,{scope:t.__scopeMenu,children:m.jsx(tr,{present:r||s.open,children:m.jsx(rn.Slot,{scope:t.__scopeMenu,children:m.jsx(xs,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:l,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;o.isUsingKeyboardRef.current&&((d=c.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:B(t.onFocusOutside,u=>{u.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:B(t.onEscapeKeyDown,u=>{o.onClose(),u.preventDefault()}),onKeyDown:B(t.onKeyDown,u=>{var p;const d=u.currentTarget.contains(u.target),f=Qb[o.dir].includes(u.key);d&&f&&(s.onOpenChange(!1),(p=a.trigger)==null||p.focus(),u.preventDefault())})})})})})});$u.displayName=Bu;function Uu(t){return t?"open":"closed"}function er(t){return t==="indeterminate"}function ws(t){return er(t)?"indeterminate":t?"checked":"unchecked"}function xT(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function bT(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function TT(t,e,n){const i=e.length>1&&Array.from(e).every(l=>l===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let o=bT(t,Math.max(s,0));i.length===1&&(o=o.filter(l=>l!==n));const c=o.find(l=>l.toLowerCase().startsWith(i.toLowerCase()));return c!==n?c:void 0}function wT(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,o=e.length-1;s<e.length;o=s++){const a=e[s],c=e[o],l=a.x,u=a.y,d=c.x,f=c.y;u>r!=f>r&&n<(d-l)*(r-u)/(f-u)+l&&(i=!i)}return i}function ST(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return wT(n,e)}function sn(t){return e=>e.pointerType==="mouse"?t(e):void 0}var CT=Su,ET=ms,DT=Eu,PT=Du,OT=bs,MT=Pu,IT=pr,RT=Mu,AT=Ru,NT=Nu,_T=Lu,LT=ku,kT=ju,jT=Fu,VT=$u,Ss="ContextMenu",[FT,CS]=on(Ss,[Tu]),le=Tu(),[BT,Hu]=FT(Ss),zu=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:i,modal:s=!0}=t,[o,a]=h.useState(!1),c=le(e),l=Fe(r),u=h.useCallback(d=>{a(d),l(d)},[l]);return m.jsx(BT,{scope:e,open:o,onOpenChange:u,modal:s,children:m.jsx(CT,{...c,dir:i,open:o,onOpenChange:u,modal:s,children:n})})};zu.displayName=Ss;var Wu="ContextMenuTrigger",Gu=h.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...i}=t,s=Hu(Wu,n),o=le(n),a=h.useRef({x:0,y:0}),c=h.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),l=h.useRef(0),u=h.useCallback(()=>window.clearTimeout(l.current),[]),d=f=>{a.current={x:f.clientX,y:f.clientY},s.onOpenChange(!0)};return h.useEffect(()=>u,[u]),h.useEffect(()=>void(r&&u()),[r,u]),m.jsxs(m.Fragment,{children:[m.jsx(ET,{...o,virtualRef:c}),m.jsx(ce.span,{"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,...i,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:B(t.onContextMenu,f=>{u(),d(f),f.preventDefault()}),onPointerDown:r?t.onPointerDown:B(t.onPointerDown,Rn(f=>{u(),l.current=window.setTimeout(()=>d(f),700)})),onPointerMove:r?t.onPointerMove:B(t.onPointerMove,Rn(u)),onPointerCancel:r?t.onPointerCancel:B(t.onPointerCancel,Rn(u)),onPointerUp:r?t.onPointerUp:B(t.onPointerUp,Rn(u))})]})});Gu.displayName=Wu;var $T="ContextMenuPortal",Ku=t=>{const{__scopeContextMenu:e,...n}=t,r=le(e);return m.jsx(DT,{...r,...n})};Ku.displayName=$T;var qu="ContextMenuContent",Yu=h.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Hu(qu,n),s=le(n),o=h.useRef(!1);return m.jsx(PT,{...s,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:a=>{var c;(c=t.onCloseAutoFocus)==null||c.call(t,a),!a.defaultPrevented&&o.current&&a.preventDefault(),o.current=!1},onInteractOutside:a=>{var c;(c=t.onInteractOutside)==null||c.call(t,a),!a.defaultPrevented&&!i.modal&&(o.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Yu.displayName=qu;var UT="ContextMenuGroup",HT=h.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=le(n);return m.jsx(OT,{...i,...r,ref:e})});HT.displayName=UT;var zT="ContextMenuLabel",WT=h.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=le(n);return m.jsx(MT,{...i,...r,ref:e})});WT.displayName=zT;var GT="ContextMenuItem",Xu=h.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=le(n);return m.jsx(IT,{...i,...r,ref:e})});Xu.displayName=GT;var KT="ContextMenuCheckboxItem",qT=h.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=le(n);return m.jsx(RT,{...i,...r,ref:e})});qT.displayName=KT;var YT="ContextMenuRadioGroup",XT=h.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=le(n);return m.jsx(AT,{...i,...r,ref:e})});XT.displayName=YT;var ZT="ContextMenuRadioItem",JT=h.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=le(n);return m.jsx(NT,{...i,...r,ref:e})});JT.displayName=ZT;var QT="ContextMenuItemIndicator",ew=h.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=le(n);return m.jsx(_T,{...i,...r,ref:e})});ew.displayName=QT;var tw="ContextMenuSeparator",nw=h.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=le(n);return m.jsx(LT,{...i,...r,ref:e})});nw.displayName=tw;var rw="ContextMenuArrow",iw=h.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=le(n);return m.jsx(kT,{...i,...r,ref:e})});iw.displayName=rw;var sw="ContextMenuSubTrigger",ow=h.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=le(n);return m.jsx(jT,{...i,...r,ref:e})});ow.displayName=sw;var aw="ContextMenuSubContent",cw=h.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=le(n);return m.jsx(VT,{...i,...r,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});cw.displayName=aw;function Rn(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var lw=zu,uw=Gu,dw=Ku,fw=Yu,hw=Xu;function pw(t){const e=Pe.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(lw,{"data-slot":"context-menu",...n}),e[2]=n,e[3]=r):r=e[3],r}function gw(t){const e=Pe.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(uw,{"data-slot":"context-menu-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function mw(t){const e=Pe.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let i;e[3]!==n?(i=Ma("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=m.jsx(dw,{children:m.jsx(fw,{"data-slot":"context-menu-content",className:i,...r})}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function An(t){const e=Pe.c(12);let n,r,i,s;e[0]!==t?({className:n,inset:r,variant:s,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s):(n=e[1],r=e[2],i=e[3],s=e[4]);const o=s===void 0?"default":s;let a;e[5]!==n?(a=Ma("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),e[5]=n,e[6]=a):a=e[6];let c;return e[7]!==r||e[8]!==i||e[9]!==a||e[10]!==o?(c=m.jsx(hw,{"data-slot":"context-menu-item","data-inset":r,"data-variant":o,className:a,...i}),e[7]=r,e[8]=i,e[9]=a,e[10]=o,e[11]=c):c=e[11],c}const vw=t=>{const e=Pe.c(46);let n,r,i,s,o;e[0]!==t?({type:o,callback:n,parentId:s,isNavigation:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s,e[5]=o):(n=e[1],r=e[2],i=e[3],s=e[4],o=e[5]);const[a,c]=h.useState(!1);let l;e[6]!==n||e[7]!==s||e[8]!==a||e[9]!==o?(l=async k=>{try{(await ee.post("",{data:{record:k,parentId:s,targetBlank:a,_method:"select",type:o},_method:"createItem"})).data&&n()}catch(A){console.log(A)}},e[6]=n,e[7]=s,e[8]=a,e[9]=o,e[10]=l):l=e[10];const u=l,d=`grid gap-4 ${r.items.length?"":"opacity-50 pointer-events-none"}`;let f;e[11]!==r.labels.selectTitle?(f=m.jsx(Ct,{children:r.labels.selectTitle}),e[11]=r.labels.selectTitle,e[12]=f):f=e[12];let p;e[13]!==r.labels.selectTitle?(p=m.jsx(Si,{className:"w-full max-w-[170px] cursor-pointer",children:m.jsx(Ci,{placeholder:r.labels.selectTitle})}),e[13]=r.labels.selectTitle,e[14]=p):p=e[14];let v;e[15]!==r.items?(v=r.items.map(yw),e[15]=r.items,e[16]=v):v=e[16];let g;e[17]!==v?(g=m.jsx(Di,{children:v}),e[17]=v,e[18]=g):g=e[18];let x;e[19]!==u||e[20]!==p||e[21]!==g?(x=m.jsxs(Pi,{onValueChange:u,children:[p,g]}),e[19]=u,e[20]=p,e[21]=g,e[22]=x):x=e[22];let y;e[23]!==d||e[24]!==f||e[25]!==x?(y=m.jsxs("div",{className:d,children:[f,x]}),e[23]=d,e[24]=f,e[25]=x,e[26]=y):y=e[26];let b;e[27]!==r.labels.openInNewWindow||e[28]!==i||e[29]!==a?(b=i&&m.jsxs("div",{className:"flex gap-4 items-center",children:[m.jsx(Ra,{id:"targetBlank",checked:a,onCheckedChange:k=>c(!!k),className:"cursor-pointer size-5"}),m.jsx(Ct,{htmlFor:"targetBlank",children:r.labels.openInNewWindow})]}),e[27]=r.labels.openInNewWindow,e[28]=i,e[29]=a,e[30]=b):b=e[30];let T;e[31]!==y||e[32]!==b?(T=m.jsxs("div",{className:"flex gap-4 flex-col",children:[y,b]}),e[31]=y,e[32]=b,e[33]=T):T=e[33];let S;e[34]!==r.labels.OR?(S=m.jsx("div",{className:"mt-8",children:m.jsx("span",{children:m.jsx("b",{children:r.labels.OR})})}),e[34]=r.labels.OR,e[35]=S):S=e[35];let C;e[36]!==r?(C=()=>r.add(r.model),e[36]=r,e[37]=C):C=e[37];let P;e[38]===Symbol.for("react.memo_cache_sentinel")?(P=m.jsx(Na,{}),e[38]=P):P=e[38];let D;e[39]!==r.labels.createTitle||e[40]!==C?(D=m.jsxs(Ke,{className:"mt-8",onClick:C,children:[P,r.labels.createTitle]}),e[39]=r.labels.createTitle,e[40]=C,e[41]=D):D=e[41];let E;return e[42]!==T||e[43]!==S||e[44]!==D?(E=m.jsxs("div",{className:"p-8",children:[T,S,D]}),e[42]=T,e[43]=S,e[44]=D,e[45]=E):E=e[45],E};function yw(t){return m.jsx(Ei,{value:t.id.toString(),children:t.name},`${t.id}-${t.name}`)}const Nn=({update:t=!1,type:e,parentId:n,...r})=>{const[i,s]=h.useState({}),[o,a]=h.useState(!1),[c,l]=h.useState(!1);h.useEffect(()=>{r.item?(s({name:r.item.name||"",...Object.fromEntries(r.items.map(f=>[f.name,r.item?r.item[f.name]:""]))}),a(r.item.targetBlank||!1)):(s({name:"",...Object.fromEntries(r.items.map(f=>[f.name,""]))}),a(!1))},[r.item,r.items]);const u=f=>{const{name:p,value:v}=f.target;s(g=>({...g,[p]:v}))},d=async f=>{var p,v;f.preventDefault(),l(!0);try{let g=null;t?(g=await ee.put("",{type:(p=r.item)==null?void 0:p.type,modelId:(v=r.item)==null?void 0:v.id,data:{...r.item,...i,targetBlank:o},_method:"updateItem"}),r.callback(g.data.data)):(await ee.post("",{data:{...i,targetBlank:o,parentId:n,type:e},_method:"createItem"}),r.callback(null))}catch(g){console.error(g)}finally{l(!1)}};return m.jsxs("div",{className:"p-8",children:[m.jsxs("form",{className:"grid gap-6",id:"group-add",onSubmit:d,children:[m.jsxs("div",{className:"flex gap-4 items-center",children:[m.jsx(Ra,{id:"targetBlank",checked:o,onCheckedChange:f=>a(!!f),className:"cursor-pointer size-5"}),m.jsx(Ct,{htmlFor:"targetBlank",children:r.labels.openInNewWindow})]}),m.jsxs("div",{className:"grid gap-4",children:[m.jsx(Ct,{htmlFor:"name",children:r.labels.title}),m.jsx(zr,{required:!0,value:i.name||"",name:"name",placeholder:r.labels.title,onChange:u})]}),r.items.map(f=>m.jsxs("div",{className:"grid gap-4",children:[m.jsx(Ct,{children:f.name}),m.jsx(zr,{required:f.required,value:i[f.name]||"",name:f.name,placeholder:f.name,onChange:u})]},f.name))]}),m.jsxs(Ke,{className:"mt-8 w-fit",form:"group-add",type:"submit",disabled:c,children:[r.labels.save,c&&m.jsx(at,{className:"h-4 w-4 animate-spin ml-2"})]})]})},xw=t=>{const e=Pe.c(18),{items:n,onSelect:r}=t,i=h.useContext(ql),[s,o]=h.useState("");let a;e[0]!==r?(a=y=>{o(y),r(y),o("")},e[0]=r,e[1]=a):a=e[1];const c=a,l=i.messages["Select Item type"];let u;e[2]!==l?(u=m.jsx(Ct,{className:"mb-4",children:l}),e[2]=l,e[3]=u):u=e[3];const d=i.messages["Select Ids"];let f;e[4]!==d?(f=m.jsx(Si,{className:"w-full max-w-[170px] cursor-pointer",children:m.jsx(Ci,{placeholder:d})}),e[4]=d,e[5]=f):f=e[5];let p;e[6]!==n?(p=n.map(bw),e[6]=n,e[7]=p):p=e[7];let v;e[8]!==p?(v=m.jsx(Di,{children:p}),e[8]=p,e[9]=v):v=e[9];let g;e[10]!==c||e[11]!==s||e[12]!==f||e[13]!==v?(g=m.jsxs(Pi,{onValueChange:c,value:s,children:[f,v]}),e[10]=c,e[11]=s,e[12]=f,e[13]=v,e[14]=g):g=e[14];let x;return e[15]!==u||e[16]!==g?(x=m.jsxs("div",{className:"p-8",children:[u,g]}),e[15]=u,e[16]=g,e[17]=x):x=e[17],x};function bw(t){return m.jsx(Ei,{value:t.type,children:t.name},`${t.type}-${t.name}`)}const Tw=t=>{const e=Pe.c(55),{dialogRef:n,PopupEvent:r,firstRender:i,secondRender:s,popupType:o,addProps:a,editModel:c,popUpTargetBlank:l,isNavigation:u,messages:d,DynamicComponent:f,DynamicActionComponent:p,addLinksGroupProps:v,reloadCatalog:g,itemType:x,parentid:y,addItemProps:b,getAddModelJSON:T,addModel:S,items:C,selectCatalogItem:P}=t;let D;e[0]===Symbol.for("react.memo_cache_sentinel")?(D=m.jsx(Nd,{}),e[0]=D):D=e[0];let E;e[1]!==r||e[2]!==i||e[3]!==C||e[4]!==P?(E=r==="create"&&m.jsxs(m.Fragment,{children:[i&&m.jsx(at,{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 size-8 animate-spin"}),m.jsx(xw,{items:C,onSelect:P})]}),e[1]=r,e[2]=i,e[3]=C,e[4]=P,e[5]=E):E=e[5];let k;e[6]!==f||e[7]!==r||e[8]!==v||e[9]!==a||e[10]!==n||e[11]!==c||e[12]!==i||e[13]!==u||e[14]!==d||e[15]!==l||e[16]!==o||e[17]!==g?(k=r==="update"&&m.jsx("div",{className:"h-full overflow-y-auto mt-5",children:i?m.jsx(at,{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 size-8 animate-spin"}):m.jsxs(m.Fragment,{children:[o==="model"&&m.jsx(Ms,{page:a,catalog:!0,callback:c,openNewWindowLabel:d["Open in a new window"],openNewWindow:l,isNavigation:u}),o==="navigation.group"&&m.jsx(Nn,{callback:O=>{var U;(U=n.current)==null||U.close(),g(O)},update:!0,type:"group",...v}),o==="navigation.link"&&m.jsx(Nn,{callback:O=>{var U;(U=n.current)==null||U.close(),g(O)},update:!0,type:"link",...v}),o==="component"&&m.jsx(m.Fragment,{children:f})]})}),e[6]=f,e[7]=r,e[8]=v,e[9]=a,e[10]=n,e[11]=c,e[12]=i,e[13]=u,e[14]=d,e[15]=l,e[16]=o,e[17]=g,e[18]=k):k=e[18];let A;e[19]!==p||e[20]!==r?(A=r==="action"&&m.jsx(m.Fragment,{children:p}),e[19]=p,e[20]=r,e[21]=A):A=e[21];let G;e[22]!==E||e[23]!==k||e[24]!==A?(G=m.jsx(xr,{children:m.jsxs("div",{className:"relative h-full",children:[E,k,A]})}),e[22]=E,e[23]=k,e[24]=A,e[25]=G):G=e[25];let K;e[26]!==s?(K=s&&m.jsx(at,{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 size-8 animate-spin"}),e[26]=s,e[27]=K):K=e[27];let ne;e[28]!==f||e[29]!==r||e[30]!==b||e[31]!==v||e[32]!==n||e[33]!==T||e[34]!==u||e[35]!==x||e[36]!==y||e[37]!==o||e[38]!==g?(ne=r==="create"&&m.jsxs(m.Fragment,{children:[o==="model"&&m.jsx(vw,{add:T,callback:()=>{var O;(O=n.current)==null||O.close(),g(null)},type:x??"",parentId:y,isNavigation:u,...b}),o==="navigation.group"&&m.jsx(Nn,{callback:O=>{var U;(U=n.current)==null||U.close(),g(O)},type:"group",parentId:y,...v}),o==="navigation.link"&&m.jsx(Nn,{callback:O=>{var U;(U=n.current)==null||U.close(),g(O)},type:"link",parentId:y,...v}),o==="component"&&m.jsx(m.Fragment,{children:f})]}),e[28]=f,e[29]=r,e[30]=b,e[31]=v,e[32]=n,e[33]=T,e[34]=u,e[35]=x,e[36]=y,e[37]=o,e[38]=g,e[39]=ne):ne=e[39];let re;e[40]!==K||e[41]!==ne?(re=m.jsx(xr,{children:m.jsxs("div",{className:"relative h-full",children:[K,ne]})}),e[40]=K,e[41]=ne,e[42]=re):re=e[42];const ue=d["Open in a new window"];let J;e[43]!==S||e[44]!==a||e[45]!==u||e[46]!==ue?(J=m.jsx(xr,{children:m.jsx("div",{className:"h-full overflow-y-auto mt-5",children:m.jsx(Ms,{page:a,catalog:!0,callback:S,openNewWindowLabel:ue,isNavigation:u})})}),e[43]=S,e[44]=a,e[45]=u,e[46]=ue,e[47]=J):J=e[47];let H;e[48]!==J||e[49]!==G||e[50]!==re?(H=m.jsxs(_d,{children:[G,re,J]}),e[48]=J,e[49]=G,e[50]=re,e[51]=H):H=e[51];let z;return e[52]!==n||e[53]!==H?(z=m.jsxs(Ld,{ref:n,children:[D,H]}),e[52]=n,e[53]=H,e[54]=z):z=e[54],z},ww=()=>{var Ds;const t=h.useRef(null),e=h.useRef(null),[n,r]=h.useState([]),[i,s]=h.useState([]),[o,a]=h.useState({catalogId:"",catalogName:"",catalogSlug:"",idList:[],nodes:[],movingGroupsRootOnly:!1}),[c,l]=h.useState([]),[u,d]=h.useState({}),[f,p]=h.useState(!1),v=h.useRef(null),[g,x]=h.useState({items:[],model:"",labels:{}}),[y,b]=h.useState({items:[],labels:{}}),[T,S]=h.useState(""),[C,P]=h.useState(null),[D,E]=h.useState(null),[k,A]=h.useState(null),[G,K]=h.useState(0),[ne,re]=h.useState(!1),[ue,J]=h.useState(!1),[H,z]=h.useState(null),[O,U]=h.useState(null),[Q,ve]=h.useState([]),[Ne,Ue]=h.useState([]),[gt,Oe]=h.useState(!1),[Ee,_e]=h.useState(!1),[de,He]=h.useState({props:{actions:[],btnBack:{link:"",title:""},btnSave:{title:""},edit:!1,fields:[],notFound:"",postLink:"",search:"",view:!1}}),[gn,Me]=h.useState(!1),[et,Rt]=h.useState(!1);h.useEffect(()=>{const w=async()=>{const _=await ee.post("",{_method:"getCatalog"}),{catalog:L,items:I,toolsActions:F}=_.data;a(L),l(I),r(L.nodes),ve(F),J(L.catalogSlug==="navigation"),console.log(F)},R=async()=>{let _=await ee.post("",{_method:"getLocales"});d(_.data.data)};(async()=>{try{p(!0),await R(),await w()}catch(_){console.error("Error initializing catalog:",_)}finally{p(!1)}})()},[]);const mn=w=>{i.find(M=>M.id===w.id)?(K(0),s(i.filter(M=>M.id!==w.id))):(K(w.id),s([...i,w]))},gr=w=>{w.target===w.currentTarget&&s([])},mr=h.useCallback(async(w,{dragSourceId:R,dropTargetId:M})=>{var _;try{const L=w.find($=>$.id===R),I=M||0,F={data:{reqNode:[{id:L==null?void 0:L.id,parent:I,text:L==null?void 0:L.text,data:L==null?void 0:L.data}],reqParent:{id:I,children:w.filter($=>$.parent===I).map($=>({id:$.id,text:$.text,data:$.data})),data:I===0?{id:0}:(_=w.find($=>$.id===I))==null?void 0:_.data}},_method:"updateTree"};r(w),await ee.put("",F)}catch(L){console.error("Error updating tree:",L)}},[n]),At=h.useCallback(async(w,R)=>{if(R)try{P(w);const M=n.find(I=>I.id===w),L=(await ee.post("",{data:M,_method:"getChilds"})).data.data;r(I=>{const F=new Set(I.map(Y=>Y.id)),$=L.filter(Y=>!F.has(Y.id));return $.length===0?I:[...I,...$]})}catch(M){console.error("Error loading child nodes:",M)}finally{P(null)}},[n]),mt=h.useCallback(async()=>{try{const w=await ee.post("",{_method:"getCatalog"}),{catalog:R}=w.data;r(M=>{const _=new Map(M.map($=>[$.id,$])),L=R.nodes,I=M.map($=>{const Y=L.find(Le=>Le.id===$.id);return Y&&Y.text!==$.text?Y:$}),F=L.filter($=>{var Y;return!_.has($.id)||((Y=_.get($.id))==null?void 0:Y.text)!==$.text});return F.length===0&&I.length===M.length&&I.every(($,Y)=>$===M[Y])?M:[...I,...F]})}catch(w){console.error("Error reloading catalog:",w)}},[]),vn=h.useCallback(async w=>{var R,M;w?r(_=>_.map(L=>L.id===w.id?{...L,text:w.name,data:{...L.data,...w}}:L)):(R=i[0])!=null&&R.droppable?((M=t.current)==null||M.open(i[0].id),await At(i[0].id,!0)):await mt()},[i,At,r]),Zu=h.useCallback(async w=>{var M;E(w),Me(!0);const R=await ee.post("",{type:w,_method:"getAddTemplate"});Qu(R.data),(M=v.current)==null||M.next(),Me(!1)},[G]),Cs=h.useCallback(async()=>{var w,R,M,_,L,I;try{Me(!0);const F=await ee.post("",{type:(R=(w=i[0])==null?void 0:w.data)==null?void 0:R.type,modelId:((_=(M=i[0])==null?void 0:M.data)==null?void 0:_.modelId)??null,id:(I=(L=i[0])==null?void 0:L.data)==null?void 0:I.id,_method:"getEditTemplate"});if(F.data)if(F.data.type.includes("navigation"))switch(F.data.type){case"navigation.group":b(F.data.data),S("navigation.group"),Me(!1);break;case"navigation.link":b(F.data.data),S("navigation.link"),Me(!1);break}else switch(F.data.type){case"model":const $=F.data.data.item,Y=await ee.get(`${window.routePrefix}/model/${$.type}/edit/${$.modelId}?without_layout=true`);He(Y.data),re($.targetBlank),S("model"),Me(!1);break;default:(async()=>{const yn=(await import(F.data.data.path)).default;z(m.jsx(yn,{callback:xn=>{var bn;(bn=v.current)==null||bn.close(),vn(xn)},update:!0,item:F.data.data.item},`${F.data.data.id}-${F.data.data.item.name}`))})(),S("component"),Me(!1);break}}catch(F){console.log(F)}},[i]),Ju=h.useCallback(async()=>{if(i.length)try{for(const w of i)if((await ee.delete("",{data:w})).data.data.ok){let M=[...n];const _=(L,I)=>{let F=I.filter(Y=>Y.id!==L);return I.filter(Y=>Y.parent===L).forEach(Y=>{F=_(Y.id,F)}),F};i.forEach(L=>{M=_(L.id,M)}),r(M)}}catch(w){console.error("Error deleting node:",w)}finally{s([]),K(0)}},[i,n]),Qu=h.useCallback(w=>{if(w.type.includes("navigation"))switch(w.type){case"model":x(w.data),S("model");break;case"navigation.group":console.log(w.data),b(w.data),S("navigation.group");break;case"navigation.link":b(w.data),S("navigation.link");break}else switch(w.type){case"model":x(w.data),S("model");break;default:(async()=>{const _=(await import(w.data.path)).default;z(m.jsx(_,{parentId:G,callback:L=>{var I;(I=v.current)==null||I.close(),vn(L)}},JSON.stringify(new Date)))})(),S("component");break}},[i,ue]),ed=h.useCallback(async w=>{var M;Rt(!0);const R=await ee.get(`${window.routePrefix}/model/${w}/add?without_layout=true'`);He(R.data),(M=v.current)==null||M.next(),Rt(!1)},[D]),td=async(w,R)=>{var M;R&&(w.targetBlank=R);try{await ee.post("",{data:{record:w,parentId:G,type:D},_method:"createItem"})}catch(_){console.log(_)}finally{(M=v.current)==null||M.close(),vn()}},nd=h.useCallback(async(w,R)=>{var M,_,L,I,F,$,Y;R&&(w[0].targetBlank=R),w[0].treeId=(_=(M=i[0])==null?void 0:M.data)==null?void 0:_.id;try{const Le=await ee.put("",{type:(I=(L=i[0])==null?void 0:L.data)==null?void 0:I.type,data:{record:w[0]},modelId:($=(F=i[0])==null?void 0:F.data)==null?void 0:$.modelId,_method:"updateItem"});r(vt=>{const{modelId:yn,type:xn,name:bn}=Le.data.data;return yn===void 0||xn===void 0?(console.warn("No modelId or type in response!"),vt):vt.map(Nt=>{var Ps,Os;return((Ps=Nt.data)==null?void 0:Ps.modelId)===yn&&((Os=Nt.data)==null?void 0:Os.type)===xn?{...Nt,text:bn,data:{...Nt.data,...Le.data}}:Nt})})}catch(Le){console.error("Error updating model:",Le)}finally{(Y=v.current)==null||Y.close()}},[i,r,n]),Es=async w=>{if(s([]),_e(!0),!w.trim()){const R=await ee.post("",{_method:"getCatalog"}),{catalog:M}=R.data;r(M.nodes),requestAnimationFrame(()=>{requestAnimationFrame(()=>{var _,L;t.current&&((L=(_=t.current).closeAll)==null||L.call(_),_e(!1))})});return}try{const R=await ee.post("",{s:w,_method:"search"});r(R.data.data),requestAnimationFrame(()=>{requestAnimationFrame(()=>{var M,_;t.current&&((_=(M=t.current).openAll)==null||_.call(M),_e(!1))})})}catch(R){console.error("Error searching:",R)}},rd=fd(Es,500),id=h.useCallback((w,R)=>{if(w){const M=i.some(_=>_.id===R.id);s([]),M||(mn(R),sd(R))}},[]),sd=h.useCallback(async w=>{var R,M;Ue([]),Oe(!0);try{const _=await ee.post("",{items:[w],type:"context",_method:"getActions"});_.data&&((M=(R=_==null?void 0:_.data)==null?void 0:R.data)!=null&&M.length)&&Ue(_.data.data)}catch(_){console.error(_)}finally{Oe(!1)}},[]),vr=h.useCallback(async w=>{var _,L;const R=Q.find(I=>I.id===w)??Ne.find(I=>I.id===w);if(!R)return;let M=null;switch(R.type){case"link":try{M=await ee.put("",{actionId:R.id,_method:"getLink"}),M.data&&((_=window.open(`${M.data.data}`,"_blank"))==null||_.focus())}catch(F){console.error(F)}break;case"basic":let I={actionID:R.id,items:i,data:""};try{Is.warning(u["Performing an action..."]),await ee.put("",{data:I,_method:"handleAction"})}catch(F){console.error(F)}finally{Is.success(u["Action completed"])}break;case"external":try{const F=await ee.put("",{actionId:R.id,_method:"getPopUpTemplate"});F.data&&((async()=>{const Le=(await import(F.data.data)).default;U(m.jsx(Le,{items:i,callback:()=>{var vt;(vt=v.current)==null||vt.close()}},JSON.stringify(i)))})(),(L=v.current)==null||L.open(),A("action"))}catch(F){console.error(F)}break}},[Q,i,Ne]);return m.jsx(m.Fragment,{children:f?m.jsxs(m.Fragment,{children:[m.jsx(yr,{className:"h-12 w-1/4 rounded-md"}),m.jsx(yr,{className:"h-12 w-full rounded-md"}),m.jsx(yr,{className:"h-full w-full rounded-md"})]}):m.jsxs(ql.Provider,{value:{messages:u,setMessages:d},children:[m.jsx(kd,{position:"top-center",richColors:!0,closeButton:!0}),m.jsxs("div",{className:"flex gap-8 items-center mb-4",children:[m.jsx("h1",{className:"text-[28px] leading-[36px] text-foreground",children:u[o.catalogName]}),o.idList.length>0&&m.jsxs(Pi,{defaultValue:o.catalogId,onValueChange:w=>{ld.get(`${window.routePrefix}/catalog/${o.catalogSlug}/${w}`)},children:[m.jsx(Si,{className:"w-full max-w-[170px] cursor-pointer",children:m.jsx(Ci,{placeholder:u["Select Ids"]})}),m.jsx(Di,{children:o.idList.map(w=>m.jsx(Ei,{value:w,children:w},w))})]})]}),m.jsxs("div",{className:"xl:gap-10 justify-between flex flex-col xl:flex-row gap-3.5",children:[m.jsxs("div",{className:"flex gap-2 items-center",children:[m.jsxs("div",{className:"flex gap-2 items-center flex-wrap md:flex-nowrap",children:[m.jsxs(Ke,{variant:"default",size:"sm",className:`w-fit rounded-sm ${i.length===0||i.length===1&&((Ds=i[0])!=null&&Ds.droppable)?"":"opacity-50 pointer-events-none"}`,onClick:()=>{var w;A("create"),(w=v.current)==null||w.open()},children:[m.jsx(Na,{}),u.create]}),m.jsxs(Ke,{variant:"outline",size:"sm",className:`w-fit cursor-pointer rounded-sm ${i.length>1||!i.length?"opacity-50 pointer-events-none":""}`,onClick:()=>{var w;Cs(),A("update"),(w=v.current)==null||w.open()},children:[m.jsx(pd,{}),u.Edit]}),m.jsx(gd,{btnTitle:u.Delete,ref:e,variant:"destructive",btnCLass:`w-fit text-white hover ${i.length?"":"opacity-50 pointer-events-none"}`,delModal:{yes:u.Yes,no:u.No,text:u["Are you sure?"]},isLink:!1,handleDelete:Ju}),m.jsxs(Ke,{variant:"secondary",size:"sm",className:`w-fit cursor-pointer rounded-sm ${i.length?"":"opacity-50 pointer-events-none"}`,onClick:()=>{K(0),s([])},children:[m.jsx(Ud,{}),u.Clean]})]}),m.jsxs("div",{className:"ml-4",children:[m.jsx("div",{className:"hidden lg:flex gap-2",children:Q.map(w=>m.jsxs(Ke,{variant:"outline",size:"sm",onClick:()=>vr(w.id),children:[m.jsx(Hn,{name:w.icon}),w.name]},w.id))}),Q.length>0&&m.jsx("div",{className:"block lg:hidden",children:m.jsxs(jd,{children:[m.jsx(Vd,{asChild:!0,children:m.jsx(Ke,{variant:"outline",size:"icon",children:m.jsx(md,{})})}),m.jsx(Fd,{className:"w-fit",side:"right",align:"start",children:m.jsx(Bd,{className:"grid gap-2",children:Q.map(w=>m.jsxs(Ke,{variant:"outline",size:"sm",onClick:()=>vr(w.id),children:[m.jsx(Hn,{name:w.icon}),w.name]},w.id))})})]})})]})]}),m.jsxs("div",{className:"flex gap-2 items-center justify-start xl:justify-end",children:[Ee&&m.jsx(at,{className:"size-4 animate-spin order-2 xl:order-1"}),m.jsx(zr,{type:"search",autoFocus:!1,placeholder:u.Search,className:"w-[200px] p-2 border rounded order-1 xl:order-2",onChange:w=>{rd(w.target.value)},onKeyDown:w=>{w.key==="Enter"&&(w.preventDefault(),Es(w.currentTarget.value))}})]})]}),m.jsx("div",{className:"h-full",children:m.jsx(by,{backend:ex,options:Ex(),children:m.jsx("div",{className:In.app,children:m.jsx($x,{ref:t,tree:n,rootId:0,render:(w,{depth:R,isOpen:M,onToggle:_})=>{var L;return m.jsxs(pw,{onOpenChange:I=>id(I,w),children:[m.jsx(gw,{children:m.jsx(Kx,{node:w,depth:R,isOpen:M,loading:C===w.id,isSelected:!!i.find(I=>I.id===w.id),onToggle:I=>{_(),At(I,!M)},onSelect:mn})}),m.jsxs(mw,{children:[m.jsx(An,{className:`${(L=i[0])!=null&&L.droppable?"":"opacity-50 pointer-events-none"}`,onClick:()=>{var I;A("create"),(I=v.current)==null||I.open()},children:u.create}),m.jsx(An,{onClick:()=>{var I;Cs(),A("update"),(I=v.current)==null||I.open()},children:u.Edit}),m.jsx(An,{variant:"destructive",onClick:()=>{var I;document.body.removeAttribute("style"),(I=e.current)==null||I.click()},className:i.length?"":"opacity-50 pointer-events-none",children:u.Delete}),gt?m.jsx(at,{className:"mx-auto size-3 animate-spin"}):Ne.map(I=>m.jsx(An,{onClick:()=>vr(I.id),children:I.name},I.id))]})]})},dropTargetOffset:5,insertDroppableFirst:!1,classes:{draggingSource:In.draggingSource,dropTarget:In.dropTarget,placeholder:In.placeholderContainer,root:"py-4"},canDrop:(w,{dragSource:R,dropTargetId:M})=>{if((R==null?void 0:R.parent)===M)return!0},sort:!1,dragPreviewRender:w=>m.jsx(Zx,{monitorProps:w}),onDrop:mr,placeholderRender:(w,{depth:R})=>m.jsx(ib,{node:w,depth:R}),rootProps:{onClick:gr}})})})}),m.jsx(Tw,{dialogRef:v,PopupEvent:k,firstRender:gn,secondRender:et,popupType:T,addProps:de,editModel:nd,popUpTargetBlank:ne,isNavigation:ue,messages:u,DynamicComponent:H,DynamicActionComponent:O,addLinksGroupProps:y,reloadCatalog:vn,itemType:D,parentid:G,addItemProps:g,getAddModelJSON:ed,addModel:td,items:c,selectCatalogItem:Zu})]})})},Sw=[];function ES(){const t=Pe.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx(ud,{breadcrumbs:Sw,children:m.jsx("div",{className:"flex h-full flex-1 flex-col gap-4 rounded-xl p-4",children:m.jsx(ww,{})})}),t[0]=e):e=t[0],e}export{ES as default};
|