epic-modals 0.0.9 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -93
- package/dist/core/animation/controller.d.ts +58 -0
- package/dist/core/animation/flip.d.ts +8 -0
- package/dist/core/animation/genie.d.ts +14 -0
- package/dist/core/animation/index.d.ts +6 -0
- package/dist/core/animation/timing.d.ts +34 -0
- package/dist/core/behaviors/drag.d.ts +34 -0
- package/dist/core/behaviors/focusTrap.d.ts +23 -0
- package/dist/core/behaviors/index.d.ts +6 -0
- package/dist/core/behaviors/parentChild.d.ts +27 -0
- package/dist/core/behaviors/resize.d.ts +49 -0
- package/dist/core/config/defaults.d.ts +90 -0
- package/dist/core/config/index.d.ts +4 -0
- package/dist/core/config/resolution.d.ts +25 -0
- package/dist/core/index.d.ts +7 -5
- package/dist/core/modal/Controller.d.ts +70 -0
- package/dist/core/modal/Controller.types.d.ts +77 -0
- package/dist/core/modal/Interactions.d.ts +67 -0
- package/dist/core/modal/Lifecycle.d.ts +20 -0
- package/dist/core/modal/Positioning.d.ts +40 -0
- package/dist/core/modal/StateManager.d.ts +91 -0
- package/dist/core/modal/Styling.d.ts +42 -0
- package/dist/core/modal/index.d.ts +8 -0
- package/dist/core/state/effects.d.ts +16 -0
- package/dist/core/state/events.d.ts +15 -0
- package/dist/core/state/getters.d.ts +37 -0
- package/dist/core/state/index.d.ts +17 -0
- package/dist/core/state/internal.d.ts +105 -0
- package/dist/core/state/layout.d.ts +17 -0
- package/dist/core/state/minimize.d.ts +18 -0
- package/dist/core/state/open-close.d.ts +21 -0
- package/dist/core/state/parent-child.d.ts +17 -0
- package/dist/core/state/pending.d.ts +55 -0
- package/dist/core/state/position.d.ts +15 -0
- package/dist/core/state/registration.d.ts +15 -0
- package/dist/core/state/stacking.d.ts +10 -0
- package/dist/core/state/zindex.d.ts +8 -0
- package/dist/core/types.d.ts +107 -14
- package/dist/core/utils/backdrop.d.ts +8 -0
- package/dist/core/utils/constants.d.ts +193 -0
- package/dist/core/utils/dock.d.ts +12 -0
- package/dist/core/utils/dom.d.ts +31 -0
- package/dist/core/utils/helpers.d.ts +8 -0
- package/dist/core/utils/index.d.ts +8 -0
- package/dist/core/utils/viewport/constraints.d.ts +7 -0
- package/dist/core/utils/viewport/index.d.ts +7 -0
- package/dist/core/utils/viewport/overlap.d.ts +30 -0
- package/dist/core/utils/viewport/smart-layout.d.ts +3 -0
- package/dist/core/utils/viewport/smart-position.d.ts +36 -0
- package/dist/core/utils/viewport/types.d.ts +56 -0
- package/dist/core/utils/viewport.d.ts +3 -0
- package/dist/core.js +1 -1
- package/dist/epic-modals.css +45 -7
- package/dist/index.js +1 -1
- package/dist/react/components/Backdrop.d.ts +7 -0
- package/dist/react/{ModalProvider.d.ts → components/ModalProvider.d.ts} +4 -5
- package/dist/react/components/Portal.d.ts +10 -0
- package/dist/react/components/dock/Dock.d.ts +7 -0
- package/dist/react/components/dock/DockItem.d.ts +16 -0
- package/dist/react/{Modal.d.ts → components/modal/Modal.d.ts} +4 -3
- package/dist/react/components/modal/ModalHeader.d.ts +13 -0
- package/dist/react/components/modal/ModalInner.d.ts +17 -0
- package/dist/react/components/modal/ResizeHandles.d.ts +9 -0
- package/dist/react/components/wizard/WizardModal.d.ts +33 -0
- package/dist/react/components/wizard/WizardStep.d.ts +15 -0
- package/dist/react/context.d.ts +10 -3
- package/dist/react/hooks/useConfig.d.ts +25 -0
- package/dist/react/useModal.d.ts +3 -7
- package/dist/react.d.ts +10 -6
- package/dist/react.js +1 -1
- package/dist/runtime.js +1 -1
- package/dist/styles/animations.css +1 -1
- package/dist/styles/backdrop.css +1 -0
- package/dist/styles/dock.css +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/styles/modal.css +1 -1
- package/dist/styles/themes/dark.css +1 -1
- package/dist/styles/themes/light.css +1 -1
- package/dist/styles/variables.css +1 -1
- package/dist/styles/wizard.css +1 -0
- package/dist/svelte/actions/appendElement.d.ts +1 -4
- package/dist/svelte/components/wizard/WizardModal.svelte.d.ts +1 -0
- package/dist/svelte/components/wizard/WizardStep.svelte.d.ts +1 -0
- package/dist/svelte/context.d.ts +5 -5
- package/dist/svelte/hooks/index.d.ts +5 -8
- package/dist/svelte/hooks/useFocusTrap.svelte.d.ts +4 -13
- package/dist/svelte/hooks/useModal.svelte.d.ts +24 -28
- package/dist/svelte/hooks/useModalConfig.svelte.d.ts +27 -0
- package/dist/svelte/hooks/useModalZIndex.svelte.d.ts +3 -23
- package/dist/svelte/hooks/usePortal.svelte.d.ts +2 -7
- package/dist/svelte/hooks/useWindowEvent.svelte.d.ts +2 -7
- package/dist/svelte/stores.svelte.d.ts +6 -0
- package/dist/svelte/wizardContext.svelte.d.ts +36 -0
- package/dist/svelte.d.ts +17 -7
- package/dist/svelte.js +1 -1
- package/dist/ui.js +1 -1
- package/dist/vanilla/VanillaBackdrop.d.ts +14 -0
- package/dist/vanilla/VanillaDock.d.ts +24 -0
- package/dist/vanilla/VanillaModal.d.ts +76 -0
- package/dist/vanilla/index.d.ts +21 -25
- package/dist/vanilla.d.ts +1 -8
- package/dist/vanilla.js +1 -1
- package/package.json +36 -5
- package/dist/core/config.svelte.d.ts +0 -85
- package/dist/core/stacking.svelte.d.ts +0 -19
- package/dist/core/state.svelte.d.ts +0 -324
- package/dist/core/utils.d.ts +0 -7
- package/dist/core/viewport.d.ts +0 -92
- package/dist/core/viewport.test.d.ts +0 -2
- package/dist/react/Dock.d.ts +0 -10
- package/dist/react/index.d.ts +0 -15
- package/dist/react/reactiveProps.svelte.d.ts +0 -17
- package/dist/react/svelte-bridge.d.ts +0 -18
- package/dist/react/useModalZIndex.d.ts +0 -35
- package/dist/svelte/hooks/useModalAnimation.svelte.d.ts +0 -16
- package/dist/svelte/hooks/useModalDrag.svelte.d.ts +0 -16
- package/dist/svelte/hooks/useModalResize.svelte.d.ts +0 -18
- package/dist/svelte/index.d.ts +0 -14
- /package/dist/svelte/{Backdrop.svelte.d.ts → components/Backdrop.svelte.d.ts} +0 -0
- /package/dist/svelte/{ModalProvider.svelte.d.ts → components/ModalProvider.svelte.d.ts} +0 -0
- /package/dist/svelte/{Portal.svelte.d.ts → components/Portal.svelte.d.ts} +0 -0
- /package/dist/svelte/{Dock.svelte.d.ts → components/dock/Dock.svelte.d.ts} +0 -0
- /package/dist/svelte/{Modal.svelte.d.ts → components/modal/Modal.svelte.d.ts} +0 -0
- /package/dist/svelte/{ModalHeader.svelte.d.ts → components/modal/ModalHeader.svelte.d.ts} +0 -0
- /package/dist/svelte/{ModalInner.svelte.d.ts → components/modal/ModalInner.svelte.d.ts} +0 -0
- /package/dist/svelte/{ResizeHandles.svelte.d.ts → components/modal/ResizeHandles.svelte.d.ts} +0 -0
package/dist/core.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as t from"svelte/internal/client";const e={BASE:0,DROPDOWN:100,STICKY:200,OVERLAY:300,MODAL:400,DOCK:8e3,TOAST:9e3};let n=t.state(t.proxy(e.MODAL));function i(){t.set(n,ae().zIndex.base,!0)}function s(){const e=t.get(n);return t.set(n,t.get(n)+2),e}function o(t){const n=ae();return"MODAL"===t?n.zIndex.base:"DOCK"===t?n.zIndex.dock:"TOAST"===t?n.zIndex.toast:e[t]}function a(){t.set(n,ae().zIndex.base,!0)}const r=8;function d(t,e,n,i,s={}){const{margin:o=r,allowPartialVisibility:a=!1}=s,d="undefined"!=typeof window?window.innerWidth:1920,c="undefined"!=typeof window?window.innerHeight:1080;let u,l,f,g;return a&&n>d-2*o?(u=40-n,l=d-40):(u=o,l=Math.max(o,d-n-o)),a&&i>c-2*o?(f=40-i,g=c-40):(f=o,g=Math.max(o,c-i-o)),{x:Math.max(u,Math.min(l,t)),y:Math.max(f,Math.min(g,e))}}function c(t,e,n,i,s={}){const{margin:o=r}=s,a=("undefined"!=typeof window?window.innerWidth:1920)-2*o,c=("undefined"!=typeof window?window.innerHeight:1080)-2*o,u=Math.min(n,a),l=Math.min(i,c),f=d(t,e,u,l,s);return{x:f.x,y:f.y,width:u,height:l}}function u(t,e){return Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x))*Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y))}function l(t,e,n,i,s,o){const a={x:t-o,y:e-o,width:n+2*o,height:i+2*o};let r=0;for(const t of s)r+=u(a,t);return r}function f(t){if("undefined"==typeof document)return[];const e=[];for(const n of t)try{const t=document.querySelectorAll(n);for(const n of t){const t=n.getBoundingClientRect();t.width>0&&t.height>0&&e.push({x:t.left,y:t.top,width:t.width,height:t.height})}}catch{}return e}function g(t,e,n,i,s,o,a){const r=(s-n)/2,d=(o-i)/2,c=r-a,u=d-a,l=Math.abs(t-r)/(c||1),f=Math.abs(e-d)/(u||1),g=Math.sqrt(l*l+f*f)/Math.SQRT2,h=50,p=t-a,m=s-n-a-t,x=e-a,I=o-i-a-e;let y=0;return p<h&&(y+=.3*(1-p/h)),m<h&&(y+=.3*(1-m/h)),x<h&&(y+=.2*(1-x/h)),I<h&&(y+=.2*(1-I/h)),Math.min(1,g+y)}function h(t,e,n,i={}){const{modalGap:s=16,gridResolution:o=10,avoidBounds:a=[],avoidMargin:r=16}=i,d=i.margin??s,c="undefined"!=typeof window?window.innerWidth:1920,u="undefined"!=typeof window?window.innerHeight:1080,f=a.map(t=>({x:t.x-r,y:t.y-r,width:t.width+2*r,height:t.height+2*r})),h={x:(c-t)/2,y:(u-e)/2};if(0===n.length&&0===f.length)return h;const p=d,m=Math.max(d,c-t-d),x=d,I=Math.max(d,u-e-d);if(m<=p||I<=x)return h;const y=l(h.x,h.y,t,e,n,s),w=l(h.x,h.y,t,e,f,0);if(0===y&&0===w)return h;const M=[],z=(m-p)/o,v=(I-x)/o;for(let i=0;i<=o;i++)for(let a=0;a<=o;a++){const o=p+i*z,r=x+a*v,h=l(o,r,t,e,n,s),m=l(o,r,t,e,f,0),I=g(o,r,t,e,c,u,d);M.push({pos:{x:o,y:r},modalOverlap:h,avoidOverlap:m,centerDist:I})}const O=M.filter(t=>0===t.avoidOverlap),P=O.length>0?O:M,C=t*e,D=Math.min(...P.map(t=>t.modalOverlap))/C;return P.sort((t,e)=>{if(0===O.length&&t.avoidOverlap!==e.avoidOverlap)return t.avoidOverlap-e.avoidOverlap;const n=t.modalOverlap/C,i=e.modalOverlap/C;if(D<.3){const s=.3,o=n<=s,a=i<=s;if(o&&a)return t.centerDist+.3*n-(e.centerDist+.3*i);if(o)return-1;if(a)return 1}return.6*n+.4*t.centerDist-(.6*i+.4*e.centerDist)}),P[0].pos}function p(t,e,n,i={}){const{modalGap:s=16}=i,o=i.margin??s,a="undefined"!=typeof window?window.innerWidth:1920,r="undefined"!=typeof window?window.innerHeight:1080,d=n.reduce((t,e)=>t+e.width,0)+t,c=n.length*s,u=a-2*o;if(d+c>u)return null;const l=u-d-c;n.length;const f=l/2,g=a/2,h=[...n.map(t=>({id:t.id,width:t.width,height:t.height,currentX:t.x+t.width/2,currentY:t.y,isNew:!1})),{id:"__new__",width:t,height:e,currentX:g,currentY:(r-e)/2,isNew:!0}];h.sort((t,e)=>t.currentX-e.currentX);let p=o+f;const m=new Map;let x=null;for(const t of h){const e=p;if(t.isNew)x={x:Math.round(e),y:Math.round(t.currentY)};else{const i=n.find(e=>e.id===t.id);Math.abs(e-i.x)>5&&m.set(t.id,{x:Math.round(e),y:Math.round(i.y)})}p+=t.width+s}return x?{newModalPosition:x,existingModalMoves:m}:null}function m(t){return"symbol"==typeof t?t.description??"symbol":t}let x=t.proxy(new Map),I=t.state(0);const y=new Set;function w(){t.update(I),queueMicrotask(()=>{y.forEach(t=>t())})}function M(t){return y.add(t),()=>y.delete(t)}let z=t.state(t.proxy([])),v=t.state(t.proxy([])),O=t.state(t.proxy([])),P=t.state(t.proxy([])),C=t.state(t.proxy([])),D=t.state(t.proxy([])),k=t.state(t.proxy([])),b=t.state(t.proxy([])),A=t.state(null),T=t.proxy(new Map),F=t.state(null),W=t.proxy(new Map),H=t.proxy(new Set),B=t.proxy(new Set),R=t.state(t.proxy([])),S=null,X=null;function E(e){const n=x.get(e.id),i=(null==n?void 0:n.zIndex)??s();n?x.set(e.id,{...n,title:e.title,icon:e.icon,glow:e.glow,zIndex:i}):x.set(e.id,{...e,zIndex:i,isAnimating:!1}),w(),e.isMinimized&&!t.get(R).includes(e.id)&&t.get(R).push(e.id)}function q(e){const n=x.get(e);if(n){if(t.set(R,t.get(R).filter(t=>t!==e),!0),n.childId){const t=x.get(n.childId);t&&x.set(n.childId,{...t,parentId:void 0})}if(n.parentId){const t=x.get(n.parentId);t&&x.set(n.parentId,{...t,childId:void 0,lastChildId:n.id})}x.delete(e),w(),B.delete(e),H.delete(e)}}function Y(e){const n=x.get(e);if(!n||n.isMinimized)return;if(Vt(e),n.parentId){const t=x.get(n.parentId);if(t&&!t.isMinimized)return void Y(n.parentId)}if(t.set(z,[...t.get(z),e],!0),n.position&&n.size&&X){const i=X(),s=t.get(R).indexOf(e),o=i.x+s*(i.height+8),a=i.y;t.set(A,{x:o,y:a,originX:n.position.x+n.size.width/2,originY:n.position.y+n.size.height/2},!0)}const i=n.childId;x.set(e,{...n,isMinimized:!0,lastChildId:i}),w(),t.get(R).includes(e)||t.get(R).push(e),n.childId&&at(e)}function L(e){const n=x.get(e);if(!n||!n.isMinimized)return;x.set(e,{...n,isMinimized:!1,isOpen:!0}),w(),t.set(C,[...t.get(C),e],!0),$(e);const i=n.lastChildId||n.childId;i&&_(i)}function N(){Array.from(x.values()).filter(t=>t.isMinimized).map(t=>t.id).forEach(e=>{const n=x.get(e);if(n){x.set(e,{...n,isMinimized:!1,isOpen:!0}),t.set(C,[...t.get(C),e],!0),$(e);const i=n.lastChildId||n.childId;i&&_(i)}}),t.set(R,[],!0),w()}function _(e){const n=x.get(e);if(n&&n.isHiddenWithParent){x.set(e,{...n,isHiddenWithParent:!1}),w(),t.set(D,[...t.get(D),e],!0);const i=n.lastChildId||n.childId;i&&_(i)}}function G(t,e,n){const i=x.get(t);if(!i)return;let s=e;if((null==n?void 0:n.constrain)&&i.size&&(s=d(e.x,e.y,i.size.width,i.size.height)),x.set(t,{...i,position:s,size:(null==n?void 0:n.size)??i.size,hasBeenDragged:i.hasBeenDragged||(null==n?void 0:n.drag)||!1}),i.childId){let e=t,n=s;for(;;){const t=x.get(e);if(!(null==t?void 0:t.childId))break;const i=x.get(t.childId);if(!(null==i?void 0:i.offsetFromParent))break;const s={x:n.x+i.offsetFromParent.x,y:n.y+i.offsetFromParent.y};x.set(t.childId,{...i,position:s,hasBeenDragged:!0}),e=t.childId,n=s}}if(i.parentId&&i.offsetFromParent){const e=ae();let n=t,o=i;for(;o.parentId&&o.offsetFromParent;){const i=x.get(o.parentId);if(!i)break;const a=n===t?s:x.get(n).position,r={x:a.x-o.offsetFromParent.x,y:a.y-o.offsetFromParent.y};"animated"===e.parentChild.movementMode?W.set(o.parentId,r):x.set(o.parentId,{...i,position:r,hasBeenDragged:!0}),n=o.parentId,o=i}}w()}function K(t,e){const n=x.get(t);n&&(x.set(t,{...n,size:e}),w())}function j(t,e){const n=x.get(t);n&&(x.set(t,{...n,...e}),w())}function V(t,e){const n=x.get(t);if(!(null==n?void 0:n.childId))return;const i=x.get(n.childId);if(!i)return;const s=e+2;x.set(n.childId,{...i,zIndex:s}),V(n.childId,s)}function $(t){if(!x.get(t))return;const e=Math.max(...Array.from(x.values()).map(t=>t.zIndex),0),n=function(t){let e=t,n=x.get(e);for(;null==n?void 0:n.parentId;)e=n.parentId,n=x.get(e);return e}(t),i=x.get(n);if(!i)return;const s=e+2;x.set(n,{...i,zIndex:s}),V(n,s),w()}function Q(t){const e=x.get(t);if(!e)return!1;const n=Math.max(...Array.from(x.values()).map(t=>t.zIndex),0);return e.zIndex===n&&!e.isMinimized&&!e.isHiddenWithParent}function J(e){t.set(R,e,!0)}function U(e,n,i){const s=n.getBoundingClientRect();T.set(e,{x:s.left+s.width/2,y:s.top+s.height/2});const o=ae();(null==i?void 0:i.parentId)&&o.features.parentChild&&t.set(F,{parentId:i.parentId,childId:e},!0),t.get(v).includes(e)||t.set(v,[...t.get(v),e],!0),w();const a=x.get(e);if(a){if(a.isOpen&&!a.isMinimized&&!a.isHiddenWithParent)return t.set(v,t.get(v).filter(t=>t!==e),!0),At(e),void $(e);if(a.isMinimized)return t.set(v,t.get(v).filter(t=>t!==e),!0),void L(e);x.set(e,{...a,isOpen:!0}),$(e),null==S||S.push(e)}}function Z(e){E(e);const n=x.get(e.id);n&&(x.set(e.id,{...n,isOpen:!0}),w()),t.set(v,[...t.get(v),e.id],!0),w(),$(e.id),null==S||S.push(e.id)}function tt(e,n=!1){const i=x.get(e);i&&(Vt(e),n?t.set(P,[...t.get(P),e],!0):t.set(O,[...t.get(O),e],!0),w(),i.childId&&tt(i.childId,n),null==S||S.pop())}function et(){Array.from(x.keys()).forEach(t=>tt(t,!0))}function nt(t){const e=x.get(t);if(e){if(e.parentId){const n=x.get(e.parentId);n&&n.childId===t&&x.set(e.parentId,{...n,childId:void 0,lastChildId:t})}x.set(t,{...e,isOpen:!1,isMinimized:!1,isHiddenWithParent:!1,isTransparent:!1,position:null,size:null,hasBeenDragged:!1,parentId:void 0,childId:void 0,offsetFromParent:void 0}),w()}}function it(t){const e=x.get(t);if(!e)return[t];const n=[t];return e.childId&&n.push(...it(e.childId)),n}function st(e,n,i){const s=ae();if(i&&!T.has(e.id)){const t=i.getBoundingClientRect();T.set(e.id,{x:t.left+t.width/2,y:t.top+t.height/2})}const o={id:e.id,title:e.title??"",icon:e.icon??"",isOpen:!0,isMinimized:!1,isHiddenWithParent:!1,isTransparent:e.isTransparent??!1,isRejected:!1,position:e.position??null,size:e.size??null,hasBeenDragged:e.hasBeenDragged??!1,dockPosition:e.dockPosition??-1,glow:e.glow??null};if(!s.features.parentChild){E(o);const n=x.get(e.id);return n&&x.set(e.id,{...n,isOpen:!0}),t.set(v,[...t.get(v),e.id],!0),w(),void $(e.id)}const a=x.get(n);if(!a)return;a.childId&&tt(a.childId,!0),E({...o,parentId:n});const r=x.get(e.id);r&&x.set(e.id,{...r,isOpen:!0,parentId:n}),t.set(v,[...t.get(v),e.id],!0),w(),$(e.id),t.set(F,{parentId:n,childId:e.id},!0)}function ot(t,e){if(!ae().features.parentChild)return;const n=x.get(t),i=x.get(e);if(!n||!i)return;let s={x:40,y:40};n.position&&i.position&&(s={x:i.position.x-n.position.x,y:i.position.y-n.position.y});const o=Math.max(i.zIndex,n.zIndex+1);x.set(t,{...n,childId:e,lastChildId:e}),x.set(e,{...i,parentId:t,offsetFromParent:s,zIndex:o}),w()}function at(t){const e=x.get(t);if(!(null==e?void 0:e.childId))return;const n=x.get(e.childId);n&&(n.childId&&at(e.childId),x.set(e.childId,{...n,isHiddenWithParent:!0}),w())}function rt(t,e){const n=x.get(t);if(!(null==n?void 0:n.childId))return;const i=x.get(n.childId);if(!i||!i.offsetFromParent)return;const s={x:e.x+i.offsetFromParent.x,y:e.y+i.offsetFromParent.y};x.set(n.childId,{...i,position:s}),w()}function dt(t,e){const n=x.get(t),i=x.get(e);if(!(null==n?void 0:n.position)||!(null==i?void 0:i.position))return;const s={x:n.position.x-i.position.x,y:n.position.y-i.position.y};x.set(t,{...n,offsetFromParent:s}),w()}function ct(e){return t.get(z).includes(e)}function ut(e){return!!t.get(z).includes(e)&&(t.set(z,t.get(z).filter(t=>t!==e),!0),!0)}function lt(){return t.get(z).length>0}function ft(){return Array.from(x.keys())}function gt(t){return x.get(t)}function ht(t){const e=[];for(const[n,i]of x.entries())if(n!==t&&i.isOpen&&!i.isMinimized&&!i.isHiddenWithParent&&!i.parentId)if(i.position&&i.size)e.push({id:m(n),x:i.position.x,y:i.position.y,width:i.size.width,height:i.size.height});else{const t=document.querySelector(`[data-modal-id="${m(n)}"]`);if(t){const i=t.getBoundingClientRect();e.push({id:m(n),x:i.left,y:i.top,width:i.width,height:i.height})}}return e}function pt(t){const e=[];for(const[n,i]of x.entries())if(n!==t&&i.isOpen&&!i.isMinimized&&!i.isHiddenWithParent)if(i.position&&i.size)e.push({x:i.position.x,y:i.position.y,width:i.size.width,height:i.size.height});else{const t=document.querySelector(`[data-modal-id="${m(n)}"]`);if(t){const n=t.getBoundingClientRect();e.push({x:n.left,y:n.top,width:n.width,height:n.height})}}return e}function mt(){return t.get(I)}function xt(){const e=t.get(A);return t.set(A,null),e}function It(e){return t.get(v).includes(e)}function yt(e){return!!t.get(v).includes(e)&&(t.set(v,t.get(v).filter(t=>t!==e),!0),!0)}function wt(e){return t.get(O).includes(e)}function Mt(e){return!!t.get(O).includes(e)&&(t.set(O,t.get(O).filter(t=>t!==e),!0),!0)}function zt(e){return t.get(P).includes(e)}function vt(e){return!!t.get(P).includes(e)&&(t.set(P,t.get(P).filter(t=>t!==e),!0),!0)}function Ot(e){return t.get(C).includes(e)}function Pt(e){return!!t.get(C).includes(e)&&(t.set(C,t.get(C).filter(t=>t!==e),!0),!0)}function Ct(e){return t.get(D).includes(e)}function Dt(e){return!!t.get(D).includes(e)&&(t.set(D,t.get(D).filter(t=>t!==e),!0),!0)}function kt(e){return t.get(k).includes(e)}function bt(e){return!!t.get(k).includes(e)&&(t.set(k,t.get(k).filter(t=>t!==e),!0),!0)}function At(e){x.get(e)&&(t.get(k).includes(e)||t.get(b).includes(e)||(t.set(k,[...t.get(k),e],!0),w()))}function Tt(e){t.get(b).includes(e)||t.set(b,[...t.get(b),e],!0)}function Ft(e){t.set(b,t.get(b).filter(t=>t!==e),!0)}function Wt(){return t.get(F)}function Ht(e){if(!t.get(F)||t.get(F).childId!==e)return null;const n=t.get(F);return t.set(F,null),n}function Bt(t,e){T.set(t,e)}function Rt(t){const e=T.get(t);return e&&T.delete(t),e??null}function St(t,e){e?H.add(t):H.delete(t)}function Xt(t){return H.has(t)}function Et(t){const e=x.get(t);return void 0!==e&&e.isOpen&&!e.isMinimized&&!e.isHiddenWithParent}function qt(t){return x.has(t)}function Yt(){return{get modals(){return x},get pendingMinimize(){return t.get(z)},get pendingOpen(){return t.get(v)},get pendingClose(){return t.get(O)},get pendingRestore(){return t.get(C)},get dockOrder(){return t.get(R)}}}function Lt(t){B.has(t)?B.delete(t):B.add(t);const e=x.get(t);e&&(x.set(t,{...e,isTransparent:B.has(t)}),w())}function Nt(t){B.delete(t);const e=x.get(t);e&&(x.set(t,{...e,isTransparent:!1}),w())}function _t(t){t.animate([{transform:"translateX(0)"},{transform:"translateX(-6px)"},{transform:"translateX(6px)"},{transform:"translateX(-6px)"},{transform:"translateX(6px)"},{transform:"translateX(0)"}],{duration:300,easing:"ease-in-out"})}function Gt(t){const e=W.get(t);if(!e)return;const n=x.get(t);n&&(x.set(t,{...n,isAnimatingPosition:!0,position:e}),W.delete(t),w())}function Kt(t){const e=x.get(t);e&&(x.set(t,{...e,isAnimatingPosition:!1}),w())}function jt(t){return W.has(t)}function Vt(t){W.delete(t)}function $t(t){const e=ae().parentChild.animationDuration;for(const[e,n]of t){const t=x.get(e);t&&x.set(e,{...t,position:n,isAnimatingPosition:!0,hasBeenDragged:!0})}w(),setTimeout(()=>{for(const e of t.keys()){const t=x.get(e);t&&x.set(e,{...t,isAnimatingPosition:!1})}w()},e)}function Qt(t){const e=ae();if("animated"!==e.parentChild.movementMode)return;const n=e.parentChild.animationDuration,i=[];let s=t;for(;;){const t=x.get(s);if(!(null==t?void 0:t.parentId))break;i.push({parentId:t.parentId,childId:s}),s=t.parentId}i.forEach(({parentId:t,childId:e},i)=>{setTimeout(()=>{const i=x.get(e),s=x.get(t);if(!(null==i?void 0:i.position)||!i.offsetFromParent||!s)return;const o={x:i.position.x-i.offsetFromParent.x,y:i.position.y-i.offsetFromParent.y};W.set(t,o),Gt(t),setTimeout(()=>Kt(t),n)},i*n)})}function Jt(t){}function Ut(t){S=t}function Zt(t){X=t}function te(){return{modals:x,pendingMinimize:t.get(z),pendingOpen:t.get(v),pendingClose:t.get(O),pendingRestore:t.get(C),dockOrder:t.get(R),animatingModals:H,transparentModals:B}}function ee(){x.clear(),t.get(z).length=0,t.get(v).length=0,t.get(O).length=0,t.get(P).length=0,t.get(C).length=0,t.get(D).length=0,t.set(A,null),T.clear(),t.set(F,null),W.clear(),H.clear(),B.clear(),t.get(R).length=0,S=null,X=null}const ne={features:{dock:!0,minimize:!0,transparency:!0,resize:!0,drag:!0,focusTrap:!0,animations:!0,backdrop:!0,parentChild:!0},dock:{position:"bottom",labelMode:"beside",enableReorder:!0,enableFreeDrag:!0},animations:{open:400,close:250,minimize:500,restore:400},appearance:{headerLayout:"macos",defaultWidth:"480px",defaultHeight:"auto",minWidth:280,minHeight:200},zIndex:{base:400,dock:8e3,toast:9e3},parentChild:{movementMode:"animated",animationDuration:300},positioning:{strategy:"smart",modalGap:16,avoidElements:[]},portalTarget:"#modal-portal"};let ie={...ne},se=t.state(0);function oe(){return t.get(se)}function ae(){return ie}function re(e){const n=ie;ie=ce(ne,e),t.update(se),n.features.dock&&!ie.features.dock&&N()}function de(){ie={...ne},t.update(se)}function ce(t,e){return{features:{...t.features,...e.features},dock:{...t.dock,...e.dock},animations:{...t.animations,...e.animations},appearance:{...t.appearance,...e.appearance},zIndex:{...t.zIndex,...e.zIndex},parentChild:{...t.parentChild,...e.parentChild},positioning:{...t.positioning,...e.positioning},portalTarget:e.portalTarget??t.portalTarget}}function ue(t){return ie.features[t]}export{ot as $,vt as A,xt as B,j as C,ut as D,Pt as E,Dt as F,Mt as G,nt as H,Ht as I,It as J,yt as K,Rt as L,kt as M,bt as N,Tt as O,Ft as P,Wt as Q,pt as R,f as S,h as T,l as U,ht as V,p as W,$t as X,E as Y,Q as Z,Lt as _,Et as a,o as a0,Yt as a1,Xt as a2,_t as a3,re as a4,i as a5,de as a6,a as a7,ne as a8,ce as a9,g as aA,M as aa,N as ab,_ as ac,K as ad,J as ae,Z as af,et as ag,it as ah,at as ai,rt as aj,dt as ak,lt as al,ft as am,Bt as an,St as ao,Gt as ap,Kt as aq,jt as ar,Vt as as,Jt as at,Ut as au,Zt as av,te as aw,ee as ax,s as ay,u as az,U as b,tt as c,$ as d,d as e,c as f,ae as g,m as h,qt as i,gt as j,oe as k,mt as l,Y as m,wt as n,st as o,ct as p,Ct as q,L as r,Ot as s,At as t,Nt as u,q as v,ue as w,G as x,Qt as y,zt as z};
|
|
1
|
+
var t=Object.defineProperty,i=(i,e,n)=>((i,e,n)=>e in i?t(i,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[e]=n)(i,"symbol"!=typeof e?e+"":e,n);const e=Symbol.for("epic-modals-core");if("undefined"!=typeof globalThis){const t=globalThis;t[e],t[e]=!0}const n=new Map;let o=0,s=null;function a(t){s=t}let r=null;function d(t){r=t}const l=new Set;let h=!1,c=!1,g=!1,u=[],m=[],f=[],p=[],w=[],y=[],z=[],v=[],x=[],b=null;function I(t){b=t}const C=new Map;let P=null;function M(t){P=t}const A=new Map,k=new Set,R=new Set,B=new Set;let S=[];function D(t){S=t}let H=null;function E(t){H=t}let T=null;function O(t){T=t}let F=null;function W(t){F=t}function L(t){u=t}function _(t){m=t}function G(t){f=t}function $(t){p=t}function V(t){w=t}function Y(t){y=t}function X(t){z=t}function q(t){v=t}function N(t){x=t}function j(){if(!g){g=!0;try{l.forEach(t=>t())}finally{g=!1}}}function K(){o++,h?c=!0:j()}function U(){return o}function Z(t){return l.add(t),()=>l.delete(t)}function J(t){const i=h;h=!0;try{t()}finally{h=i,!i&&c&&(c=!1,queueMicrotask(()=>{j()}))}}function Q(t,i){if(t.width<=0||t.height<=0)throw new Error(`[epic-modals] Invalid dimensions in ${i}: width=${t.width}, height=${t.height}`)}function tt(t,i){return!!n.get(t)||(function(){var t,i;try{const e=import.meta;return!0===(null==(t=e.env)?void 0:t.DEV)||"development"===(null==(i=e.env)?void 0:i.MODE)}catch{return!1}}(),!1)}function it(){n.clear(),u=[],m=[],f=[],p=[],w=[],y=[],z=[],v=[],x=[],b=null,C.clear(),P=null,A.clear(),k.clear(),R.clear(),B.clear(),S=[],H=null,T=null,F=null,s&&(clearTimeout(s),s=null),r&&(clearTimeout(r),r=null)}function et(){return{modals:n,pendingMinimize:u,pendingOpen:m,pendingClose:f,pendingRestore:w,dockOrder:S,animatingModals:k,transparentModals:B}}function nt(t){return{id:t.id,title:t.title,icon:t.icon??"",isOpen:t.autoOpen??!1,isMinimized:!1,isHiddenWithParent:!1,isTransparent:!1,isRejected:!1,position:null,size:null,hasBeenDragged:!1,dockPosition:0,glow:t.glow??null,parentId:void 0,childId:void 0,offsetFromParent:void 0}}function ot(t){const i=n.get(t.id);let e;e=(null==i?void 0:i.zIndex)?i.zIndex:Math.max(...Array.from(n.values()).map(t=>t.zIndex),ue().zIndex.base-2)+2;const o=m.includes(t.id),s=t.isOpen||o;i?n.set(t.id,{...i,title:t.title,icon:t.icon,glow:t.glow,zIndex:e}):n.set(t.id,{...t,isOpen:s,zIndex:e,isAnimating:!1}),K(),t.isMinimized&&!S.includes(t.id)&&D([...S,t.id])}function st(t){const i=n.get(t);if(i){if(D(S.filter(i=>i!==t)),_(m.filter(i=>i!==t)),G(f.filter(i=>i!==t)),$(p.filter(i=>i!==t)),L(u.filter(i=>i!==t)),V(w.filter(i=>i!==t)),Y(y.filter(i=>i!==t)),X(z.filter(i=>i!==t)),q(v.filter(i=>i!==t)),i.childId){const t=n.get(i.childId);t&&n.set(i.childId,{...t,parentId:void 0})}if(i.parentId){const t=n.get(i.parentId);t&&n.set(i.parentId,{...t,childId:void 0,lastChildId:i.id})}n.delete(t),K(),B.delete(t),k.delete(t)}}function at(t,i){const e=n.get(t);if(!(null==e?void 0:e.childId))return;const o=n.get(e.childId);if(!o)return;const s=i+2;n.set(e.childId,{...o,zIndex:s}),at(e.childId,s)}function rt(t){if(!n.get(t))return;const i=Math.max(...Array.from(n.values()).map(t=>t.zIndex),0),e=function(t){let i=t,e=n.get(i);for(;null==e?void 0:e.parentId;)i=e.parentId,e=n.get(i);return i}(t),o=n.get(e);if(!o)return;const s=i+2;n.set(e,{...o,zIndex:s}),at(e,s),K()}function dt(t){const i=n.get(t);if(!i)return!1;const e=Math.max(...Array.from(n.values()).map(t=>t.zIndex),0);return i.zIndex===e&&!i.isMinimized&&!i.isHiddenWithParent}function lt(t,i){if(Array.isArray(t))D(t);else if("number"==typeof i){const e=t,n=[...S],[o]=n.splice(e,1);n.splice(i,0,o),D(n)}}const ht=8;function ct(t,i,e,n,o={}){const{margin:s=ht,allowPartialVisibility:a=!1}=o,r="undefined"!=typeof window?window.innerWidth:1920,d="undefined"!=typeof window?window.innerHeight:1080;let l,h,c,g;return a&&e>r-2*s?(l=40-e,h=r-40):(l=s,h=Math.max(s,r-e-s)),a&&n>d-2*s?(c=40-n,g=d-40):(c=s,g=Math.max(s,d-n-s)),{x:Math.max(l,Math.min(h,t)),y:Math.max(c,Math.min(g,i))}}function gt(t,i,e,n,o={}){const{margin:s=ht}=o,a=("undefined"!=typeof window?window.innerWidth:1920)-2*s,r=("undefined"!=typeof window?window.innerHeight:1080)-2*s,d=Math.min(e,a),l=Math.min(n,r),h=ct(t,i,d,l,o);return{x:h.x,y:h.y,width:d,height:l}}function ut(t,i){return Math.max(0,Math.min(t.x+t.width,i.x+i.width)-Math.max(t.x,i.x))*Math.max(0,Math.min(t.y+t.height,i.y+i.height)-Math.max(t.y,i.y))}function mt(t,i,e,n,o,s){const a={x:t-s,y:i-s,width:e+2*s,height:n+2*s};let r=0;for(const t of o)r+=ut(a,t);return r}function ft(t,i){const e=i.x-(t.x+t.width),n=t.x-(i.x+i.width),o=i.y-(t.y+t.height),s=t.y-(i.y+i.height),a=Math.max(e,n,0),r=Math.max(o,s,0);return 0===a&&0===r?0:Math.sqrt(a*a+r*r)}function pt(t){if("undefined"==typeof document)return[];const i=[];for(const e of t)try{const t=document.querySelectorAll(e);for(const e of t){const t=e.getBoundingClientRect();t.width>0&&t.height>0&&i.push({x:t.left,y:t.top,width:t.width,height:t.height})}}catch{}return i}function wt(t,i,e,n,o){let s=e,a=e,r=t-e,d=i-e;for(const e of n){const n=e.y,l=i-(e.y+e.height),h=e.x,c=t-(e.x+e.width);let g;if(e.width>e.height)g=n<=l?"top":"bottom";else if(e.height>e.width)g=h<=c?"left":"right";else{const t=Math.min(n,l,h,c);g=t===n?"top":t===l?"bottom":t===h?"left":"right"}"bottom"===g?d=Math.min(d,e.y-o):"top"===g?a=Math.max(a,e.y+e.height+o):"left"===g?s=Math.max(s,e.x+e.width+o):r=Math.min(r,e.x-o)}return{x:s,y:a,width:Math.max(0,r-s),height:Math.max(0,d-a)}}function yt(t,i,e,n){const o=t-i,s=e-1;if(o<=0)return{interGap:0,edgeGap:0};if(e<=1)return{interGap:0,edgeGap:o/2};const a=o/(e+1);if(a>=n)return{interGap:a,edgeGap:a};const r=s*n;return o>=r?{interGap:n,edgeGap:(o-r)/2}:{interGap:o/s,edgeGap:0}}function zt(t,i,e,n,o=0){if(0===e.length)return{cols:t,rows:i,score:1/0,positions:new Map};const s=new Array(t).fill(0),a=new Array(i).fill(0);for(let i=0;i<e.length;i++){const n=i%t,o=Math.floor(i/t);s[n]=Math.max(s[n],e[i].width),a[o]=Math.max(a[o],e[i].height)}const r=s.reduce((t,i)=>t+i,0),d=a.reduce((t,i)=>t+i,0);if(r>n.width||d>n.height)return null;const{interGap:l,edgeGap:h}=yt(n.width,r,t,o),{interGap:c,edgeGap:g}=yt(n.height,d,i,o),u=new Map,m=[0];for(let i=0;i<t;i++)m.push(m[i]+s[i]);const f=[0];for(let t=0;t<i;t++)f.push(f[t]+a[t]);for(let i=0;i<e.length;i++){const o=i%t,r=Math.floor(i/t),d=e[i],p=n.x+h+o*l+m[o],w=n.y+g+r*c+f[r],y=p+(s[o]-d.width)/2,z=w+(a[r]-d.height)/2;u.set(d.id,{x:Math.round(y),y:Math.round(z)})}const p=t>1?l:h,w=i>1?c:g;return{cols:t,rows:i,score:(.6*Math.min(p,w)+.4*Math.sqrt(p*w))*(n.width>n.height==t>=i?1.02:1),positions:u}}function vt(t,i,e={}){const{modalGap:n=16,viewportMargin:o=16,avoidBounds:s=[],avoidMargin:a=24}=e,r="undefined"!=typeof window?window.innerWidth:1920,d="undefined"!=typeof window?window.innerHeight:1080,l=new Map,h=t.filter(t=>!t.parentId),c=h.map(t=>({id:t.id,width:t.width,height:t.height}));if(i&&c.push({id:i.id,width:i.width,height:i.height}),0===c.length)return{positions:l};const g=new Map(h.map(t=>[t.id,t.currentPosition]));c.sort((t,i)=>{const e=g.get(t.id),n=g.get(i.id);return(e?e.x+t.width/2:1/0)-(n?n.x+i.width/2:1/0)});const u=wt(r,d,o,s,a);if(1===c.length){const t=c[0],i=u.x+(u.width-t.width)/2,e=u.y+(u.height-t.height)/2;return l.set(t.id,{x:Math.round(i),y:Math.round(e)}),{positions:l}}const m=c.length;let f=null;for(let t=1;t<=m;t++){const i=zt(t,Math.ceil(m/t),c,u,n);i&&(null===f||i.score>f.score)&&(f=i)}if(f){for(const[t,i]of f.positions)l.set(t,i);return{positions:l}}if(i){const t=h.map(t=>({x:t.currentPosition.x,y:t.currentPosition.y,width:t.width,height:t.height})),e=function(t,i,e,n,o=20){const s=n.x+(n.width-t)/2,a=n.y+(n.height-i)/2;if(0===e.length)return{x:Math.round(s),y:Math.round(a)};const r=n.x,d=Math.max(n.x,n.x+n.width-t),l=n.y,h=Math.max(n.y,n.y+n.height-i);if(d<=r||h<=l)return{x:Math.round(s),y:Math.round(a)};const c=(d-r)/o,g=(h-l)/o;let u={x:s,y:a},m=1/0;const f=t*i,p=Math.hypot(n.width/2,n.height/2),w=n.x+n.width/2,y=n.y+n.height/2;for(let n=0;n<=o;n++)for(let s=0;s<=o;s++){const o=r+n*c,a=l+s*g,d=mt(o,a,t,i,e,0),h=f>0?d/f:0,z=Math.hypot(o+t/2-w,a+i/2-y),v=.5*h+.5*(p>0?z/p:0);v<m&&(m=v,u={x:o,y:a})}return{x:Math.round(u.x),y:Math.round(u.y)}}(i.width,i.height,t,u);return l.set(i.id,e),{positions:l}}const p=function(t,i){const e=new Map,n=Math.max(...t.map(t=>t.width)),o=Math.max(...t.map(t=>t.height)),s=n+40*(t.length-1),a=o+40*(t.length-1);let r=i.x+(i.width-s)/2,d=i.y+(i.height-a)/2;r=Math.max(i.x,r),d=Math.max(i.y,d);for(let i=0;i<t.length;i++)e.set(t[i].id,{x:Math.round(r+40*i),y:Math.round(d+40*i)});return e}(c,u);return{positions:p}}function xt(t){return t}function bt(t){return"undefined"==typeof document?null:document.querySelector(`.modal-dialog[data-modal-id="${t}"]`)}function It(){return{x:window.innerWidth/2,y:window.innerHeight/2}}const Ct={minimize:500,restore:400,open:400,close:250,attention:300,parentMove:300,parentRetargetInterval:100,centerAfterResize:200,glowStabilize:1e3,overlayFade:200},Pt=100,Mt={easeOut:"ease-out",easeOutCubic:"cubic-bezier(0.25, 0.1, 0.25, 1)",linear:"linear",easeInOut:"ease-in-out"};function At(t){switch(t){case"open":return Ct.open;case"close":return Ct.close;case"minimize":return Ct.minimize;case"restore":return Ct.restore;case"attention":return Ct.attention;default:return 0}}function kt(t){switch(t){case"open":case"restore":return Mt.easeOut;case"close":case"minimize":return Mt.easeOutCubic;case"attention":return Mt.easeInOut;default:return Mt.linear}}function Rt(t,i,e,n){var o;const s=i.x-e.x,a=i.y-e.y;if(0===s&&0===a)return null==(o=null==n?void 0:n.onComplete)||o.call(n),()=>{};const r=(null==n?void 0:n.duration)??Ct.parentMove,d=(null==n?void 0:n.easing)??"ease-out";let l=!1;function h(){var t;l||(l=!0,clearTimeout(g),null==(t=null==n?void 0:n.onComplete)||t.call(n))}t.style.left=`${e.x}px`,t.style.top=`${e.y}px`;const c=t.animate([{transform:`translate(${s}px, ${a}px)`},{transform:"translate(0, 0)"}],{duration:r,easing:d,fill:"none"});c.onfinish=h;const g=setTimeout(h,r+Pt);return function(){l||(l=!0,clearTimeout(g),c.cancel())}}function Bt(t){return n.get(t)}function St(t){const i=n.get(t);return(null==i?void 0:i.isOpen)??!1}function Dt(t){return n.has(t)}function Ht(t){return k.has(t)}function Et(t,i){i?k.add(t):k.delete(t)}function Tt(){return n}function Ot(){return S}function Ft(t){return"undefined"==typeof document?null:document.querySelector(`[data-dock-item="${t}"]`)}function Wt(){const t=[];for(const i of n.values()){if(!i.isOpen||i.isMinimized||i.isHiddenWithParent)continue;if(R.has(i.id))continue;const e=bt(i.id);if(!e)continue;const n=i.position??{x:e.getBoundingClientRect().left,y:e.getBoundingClientRect().top},o=i.size??{width:e.offsetWidth,height:e.offsetHeight};t.push({id:i.id,width:o.width,height:o.height,currentPosition:n,parentId:i.parentId})}return t}function Lt(t){const i=[];for(const e of n.values())if(e.isOpen&&!e.isMinimized&&!e.isHiddenWithParent&&(!t||e.id!==t))if(e.position&&e.size)i.push({x:e.position.x,y:e.position.y,width:e.size.width,height:e.size.height});else{const t=bt(e.id);if(t){const e=t.getBoundingClientRect();i.push({x:e.left,y:e.top,width:e.width,height:e.height})}}return i}function _t(t){const i=[];for(const e of n.values())if(e.isOpen&&!e.isMinimized&&!e.isHiddenWithParent&&(!t||e.id!==t))if(e.position&&e.size)i.push({id:e.id,x:e.position.x,y:e.position.y,width:e.size.width,height:e.size.height});else{const t=bt(e.id);if(t){const n=t.getBoundingClientRect();i.push({id:e.id,x:n.left,y:n.top,width:n.width,height:n.height})}}return i}function Gt(t,i,e){if(!tt(t))return;!function(t){if(!Number.isFinite(t.x)||!Number.isFinite(t.y))throw new Error(`[epic-modals] Invalid position in updateModalPosition: x=${t.x}, y=${t.y}`)}(i),(null==e?void 0:e.size)&&Q(e.size,"updateModalPosition");const o=n.get(t);if(!o)return;let s=i;if((null==e?void 0:e.constrain)&&o.size&&(s=ct(i.x,i.y,o.size.width,o.size.height)),n.set(t,{...o,position:s,size:(null==e?void 0:e.size)??o.size,hasBeenDragged:o.hasBeenDragged||(null==e?void 0:e.drag)||!1}),o.childId){let i=t,e=s;for(;;){const t=n.get(i);if(!(null==t?void 0:t.childId))break;const o=n.get(t.childId);if(!(null==o?void 0:o.offsetFromParent))break;const s={x:e.x+o.offsetFromParent.x,y:e.y+o.offsetFromParent.y};n.set(t.childId,{...o,position:s,hasBeenDragged:!0}),i=t.childId,e=s}}if(o.parentId&&o.offsetFromParent){const i=ue();let a=t,r=o;for(;r.parentId&&r.offsetFromParent;){const o=n.get(r.parentId);if(!o)break;const d=a===t?s:n.get(a).position,l={x:d.x-r.offsetFromParent.x,y:d.y-r.offsetFromParent.y};if("animated"===i.parentChild.movementMode&&!(null==e?void 0:e.realtime)){A.set(r.parentId,l);break}n.set(r.parentId,{...o,position:l,hasBeenDragged:!0}),a=r.parentId,r=o}}K()}function $t(t){const i=n.get(t);if(!i)return;if(!i.isAnimatingPosition)return;i.isAnimatingPosition=!1;let e=i.childId;for(;e;){const t=n.get(e);t&&(t.isAnimatingPosition=!1),e=null==t?void 0:t.childId}K()}function Vt(t,i){if(!tt(t))return;Q(i,"updateModalSize");const e=n.get(t);e&&(n.set(t,{...e,size:i}),K())}function Yt(t,i){const e=n.get(t);e&&(n.set(t,{...e,...i}),K())}function Xt(t){const i=ue();"smart"===i.positioning.strategy&&(s&&clearTimeout(s),a(setTimeout(()=>{const e=Wt(),n=pt(i.positioning.avoidElements);qt(vt(e,t,{modalGap:i.positioning.modalGap,viewportMargin:i.positioning.modalGap,avoidBounds:n,avoidMargin:i.positioning.modalGap}).positions),a(null)},50)))}function qt(t){if(0===t.size)return;const i=[];for(const[e,o]of t){const t=n.get(e);if(!t)continue;const s=bt(e),a=t.position??(s?{x:s.getBoundingClientRect().left,y:s.getBoundingClientRect().top}:{x:0,y:0}),r=t.size??(s?{width:s.offsetWidth,height:s.offsetHeight}:{width:0,height:0});i.push({id:e,element:s,oldPosition:a,newPosition:o,size:r}),Nt(e,a,o,i)}for(const{id:t,newPosition:e,size:o}of i){const i=n.get(t);i&&n.set(t,{...i,position:e,size:o,hasBeenDragged:!0,isAnimatingPosition:!0})}K();for(const{id:t,element:e,oldPosition:n,newPosition:o}of i)e?Rt(e,n,o,{duration:Ct.parentMove,onComplete:()=>$t(t)}):setTimeout(()=>$t(t),Ct.parentMove+Pt)}function Nt(t,i,e,o){const s=n.get(t);if(!(null==s?void 0:s.childId))return;const a=n.get(s.childId);if(!(null==a?void 0:a.offsetFromParent))return;const r=bt(s.childId),d={x:i.x+a.offsetFromParent.x,y:i.y+a.offsetFromParent.y},l={x:e.x+a.offsetFromParent.x,y:e.y+a.offsetFromParent.y};o.push({id:s.childId,element:r,oldPosition:d,newPosition:l}),n.set(s.childId,{...a,position:l,hasBeenDragged:!0,isAnimatingPosition:!0}),a.childId&&Nt(s.childId,d,l,o)}function jt(){r&&clearTimeout(r),d(setTimeout(()=>{Xt(null),d(null)},100))}let Kt=!1;function Ut(){Kt||"undefined"==typeof window||(window.addEventListener("resize",jt),Kt=!0)}function Zt(){"undefined"!=typeof window&&(window.removeEventListener("resize",jt),Kt=!1)}function Jt(t){if(0===t.size)return;const i=[];for(const[e,o]of t){const t=n.get(e);if(!t)continue;const s=bt(e),a=t.position??(s?{x:s.getBoundingClientRect().left,y:s.getBoundingClientRect().top}:{x:0,y:0});i.push({id:e,element:s,oldPosition:a,newPosition:o})}for(const{id:t,newPosition:e}of i){const i=n.get(t);i&&n.set(t,{...i,position:e,hasBeenDragged:!0,isAnimatingPosition:!0})}K();for(const{id:t,element:e,oldPosition:n,newPosition:o}of i)e?Rt(e,n,o,{duration:Ct.parentMove,onComplete:()=>$t(t)}):setTimeout(()=>$t(t),Ct.parentMove+Pt)}function Qt(t){A.delete(t)}function ti(t){const i=n.get(t);if(!(null==i?void 0:i.childId))return;const e=n.get(i.childId);e&&(z.includes(i.childId)||X([...z,i.childId]),e.childId&&ti(i.childId))}function ii(t){const i=n.get(t);if(!i||i.isMinimized)return;if(Qt(t),i.parentId){const t=n.get(i.parentId);if(t&&!t.isMinimized)return void ii(i.parentId)}if(L([...u,t]),i.position&&i.size&&T){const e=T(),n=S.indexOf(t);I({x:e.x+n*(e.height+8),y:e.y,originX:i.position.x+i.size.width/2,originY:i.position.y+i.size.height/2})}const e=i.childId;n.set(t,{...i,isMinimized:!0,lastChildId:e}),S.includes(t)||D([...S,t]),K(),i.childId&&ti(t),Xt(null)}function ei(t){const i=n.get(t);if(!i||!i.isMinimized)return;n.set(t,{...i,isMinimized:!1,isOpen:!0}),V([...w,t]),rt(t);const e=i.lastChildId||i.childId;e&&oi(e),K()}function ni(){Array.from(n.values()).filter(t=>t.isMinimized).map(t=>t.id).forEach(t=>{const i=n.get(t);if(i){n.set(t,{...i,isMinimized:!1,isOpen:!0}),V([...w,t]),rt(t);const e=i.lastChildId||i.childId;e&&oi(e)}}),D([]),K()}function oi(t){const i=n.get(t);if(i&&i.isHiddenWithParent){Y([...y,t]);const e=i.lastChildId||i.childId;e&&oi(e)}}function si(t){const i=n.get(t);i&&i.isHiddenWithParent&&(n.set(t,{...i,isHiddenWithParent:!1}),K())}function ai(t){const i=n.get(t);i&&(n.set(t,{...i,isHiddenWithParent:!0}),K())}function ri(t){const i=n.get(t);if(!(null==i?void 0:i.childId))return;const e=n.get(i.childId);e&&(e.childId&&ri(i.childId),n.set(i.childId,{...e,isHiddenWithParent:!0}),K())}function di(t){if(!tt(t))return;const i=n.get(t);B.has(t)?(B.delete(t),n.set(t,{...i,isTransparent:!1})):(B.add(t),n.set(t,{...i,isTransparent:!0})),K()}function li(t){tt(t)&&(v.includes(t)||(q([...v,t]),K()))}function hi(t){t.classList.add("modal-shake"),t.addEventListener("animationend",()=>{t.classList.remove("modal-shake")},{once:!0})}function ci(t){if(!tt(t))return;const i=n.get(t);n.set(t,{...i,isRejected:!0}),K(),setTimeout(()=>{const i=n.get(t);i&&(n.set(t,{...i,isRejected:!1}),K())},300);const e=bt(t);e&&hi(e)}function gi(t){if(!tt(t))return;const i=n.get(t);B.delete(t),n.set(t,{...i,isTransparent:!1}),K()}function ui(t){}function mi(t){}function fi(t,i,e){pi(t,e,{parentId:i})}function pi(t,i,e){const o=ue(),s=n.get(t);if(s&&s.isOpen&&!s.isMinimized&&!s.isHiddenWithParent)return li(t),void rt(t);if(s&&s.isMinimized)return void ei(t);if("x"in i&&"y"in i)C.set(t,i);else{const e=i.getBoundingClientRect();C.set(t,{x:e.left+e.width/2,y:e.top+e.height/2})}if((null==e?void 0:e.parentId)&&o.features.parentChild){const i=n.get(e.parentId);(null==i?void 0:i.childId)&&i.childId!==t&&yi(i.childId,!0),M({parentId:e.parentId,childId:t})}if(m.includes(t)||_([...m,t]),K(),!s)return void((null==F?void 0:F.isRegisteredInRegistry(t))&&F.mountModal(t));const a={isOpen:!0};(null==e?void 0:e.parentId)&&o.features.parentChild&&(a.parentId=e.parentId),n.set(t,{...s,...a}),rt(t),null==H||H.push(t)}function wi(t){ot(t);const i=n.get(t.id);i&&(n.set(t.id,{...i,isOpen:!0}),K()),_([...m,t.id]),K(),rt(t.id),null==H||H.push(t.id)}function yi(t,i=!1){const e=n.get(t);if(e&&(e.isOpen||e.isMinimized)){if(Qt(t),e.childId&&yi(e.childId,i),e.isMinimized)return D(S.filter(i=>i!==t)),vi(t),void(null==H||H.pop());R.add(t),i?$([...p,t]):G([...f,t]),e.parentId||Xt(null),K(),null==H||H.pop()}}function zi(t){const i=new Set(t??[]);Array.from(n.keys()).filter(t=>!i.has(t)).forEach(t=>yi(t,!0))}function vi(t){const i=n.get(t);if(i){if(R.delete(t),i.parentId){const e=n.get(i.parentId);e&&e.childId===t&&n.set(i.parentId,{...e,childId:void 0,lastChildId:t})}n.set(t,{...i,isOpen:!1,isMinimized:!1,isHiddenWithParent:!1,isTransparent:!1,position:null,size:null,hasBeenDragged:!1,parentId:void 0,childId:void 0,offsetFromParent:void 0}),K()}}function xi(t){if(Array.isArray(t)){const i=new Set(t);return Array.from(n.entries()).filter(([t,e])=>e.isOpen&&!i.has(t)).map(([t])=>t)}const i=n.get(t);if(!i)return[t];const e=[t];return i.childId&&e.push(...xi(i.childId)),e}function bi(t){return u.includes(t)}function Ii(t){L(u.filter(i=>i!==t));const i=b;return I(null),i}function Ci(t){return z.includes(t)}function Pi(t){X(z.filter(i=>i!==t))}function Mi(t){return m.includes(t)}function Ai(t){_(m.filter(i=>i!==t))}function ki(t){return f.includes(t)}function Ri(t){G(f.filter(i=>i!==t))}function Bi(t){return p.includes(t)}function Si(t){$(p.filter(i=>i!==t))}function Di(t){return w.includes(t)}function Hi(t){V(w.filter(i=>i!==t))}function Ei(t){return y.includes(t)}function Ti(t){Y(y.filter(i=>i!==t))}function Oi(t){return v.includes(t)}function Fi(t){q(v.filter(i=>i!==t)),x.includes(t)||N([...x,t])}function Wi(t){N(x.filter(i=>i!==t))}function Li(t){return(null==P?void 0:P.childId)===t}function _i(t){return A.has(t)}function Gi(t){const i=A.get(t)??null;return A.delete(t),i}function $i(t,i){C.set(t,i)}function Vi(t){return C.get(t)??null}function Yi(t){const i=C.get(t)??null;return C.delete(t),i}function Xi(){const t=b;return I(null),t}function qi(t){const i=P;return t&&(null==i?void 0:i.childId)!==t?null:(M(null),i)}function Ni(t,i,e){const o=n.get(t),s=n.get(i);o&&s&&(n.set(t,{...o,childId:i}),n.set(i,{...s,parentId:t,offsetFromParent:e}),rt(i),K())}function ji(){return P}function Ki(t){if("animated"!==ue().parentChild.movementMode)return;const i=n.get(t);if(!(null==i?void 0:i.parentId)||!i.offsetFromParent||!i.position)return;const e={x:i.position.x-i.offsetFromParent.x,y:i.position.y-i.offsetFromParent.y};A.set(i.parentId,e),K()}function Ui(t){return A.get(t)??null}function Zi(t,i,e){const o=n.get(t);if(!o)return null;const s=bt(t);if(!s)return null;const a=o.position??{x:s.getBoundingClientRect().left,y:s.getBoundingClientRect().top},r=o.size??{width:s.offsetWidth,height:s.offsetHeight};return{x:a.x+(r.width-i)/2,y:a.y+(r.height-e)/2}}const Ji={BASE:0,DROPDOWN:100,STICKY:200,OVERLAY:300,MODAL:400,DOCK:8e3,TOAST:9e3};let Qi=Ji.MODAL;function te(){Qi=ue().zIndex.base}function ie(){const t=Qi;return Qi+=2,t}function ee(t){const i=ue();return"MODAL"===t?i.zIndex.base:"DOCK"===t?i.zIndex.dock:"TOAST"===t?i.zIndex.toast:Ji[t]}function ne(){Qi=ue().zIndex.base}function oe(){const t=new Map;return{on(i,e){let n=t.get(i);return n||(n=new Set,t.set(i,n)),n.add(e),()=>{null==n||n.delete(e),0===(null==n?void 0:n.size)&&t.delete(i)}},emit(i,e){const n=t.get(i);n&&n.forEach(t=>t(e))},off(i){i?t.delete(i):t.clear()},listenerCount(i){var e;return(null==(e=t.get(i))?void 0:e.size)??0}}}function se(t){return"boolean"==typeof t?{visible:t,blockClicks:t}:t}const ae={features:{dock:!0,minimize:!0,transparency:!0,resize:!0,drag:!0,focusTrap:!0,animations:!0,backdrop:!0,parentChild:!0},dock:{position:"bottom",labelMode:"beside",enableReorder:!0,enableFreeDrag:!0},animations:{open:400,close:250,minimize:500,restore:400,easing:"cubic-bezier(0.34, 1.56, 0.64, 1)"},appearance:{headerLayout:"macos",defaultWidth:"480px",defaultHeight:"auto",minWidth:280,minHeight:200},zIndex:{base:400,dock:8e3,toast:9e3},parentChild:{movementMode:"animated",animationDuration:300},positioning:{strategy:"smart",modalGap:16,avoidElements:[]},portalTarget:"#modal-portal"};let re={...ae},de=0;const le=new Set;function he(t){return le.add(t),()=>le.delete(t)}function ce(){le.forEach(t=>t())}function ge(){return de}function ue(){return re}function me(t){const i=re;re=pe(re,t),de++,ce(),i.features.dock&&!re.features.dock&&ni()}function fe(){re={...ae},de++,ce()}function pe(t,i){var e;return{features:{...t.features,...i.features},dock:{...t.dock,...i.dock},animations:{...t.animations,...i.animations},appearance:{...t.appearance,...i.appearance},zIndex:{...t.zIndex,...i.zIndex},parentChild:{...t.parentChild,...i.parentChild},positioning:{...t.positioning,...i.positioning,avoidElements:(null==(e=i.positioning)?void 0:e.avoidElements)??t.positioning.avoidElements},portalTarget:i.portalTarget??t.portalTarget}}function we(t){const i=re.features[t];if("backdrop"===t){const t=se(i);return t.visible||t.blockClicks}return i}function ye(t,i){const e=ue(),n=i?pe(e,i):e;return{isFeatureEnabled:i=>{var e;if(void 0!==(null==(e=null==t?void 0:t.features)?void 0:e[i])){const e=t.features[i];if("backdrop"===i){const t=se(e);return t.visible||t.blockClicks}return e}const o=n.features[i];if("backdrop"===i){const t=se(o);return t.visible||t.blockClicks}return o},getAppearance:i=>{var e;return void 0!==(null==(e=null==t?void 0:t.appearance)?void 0:e[i])?t.appearance[i]:n.appearance[i]},getPositioning:i=>{var e;return void 0!==(null==(e=null==t?void 0:t.positioning)?void 0:e[i])?t.positioning[i]:n.positioning[i]},getEffectiveConfig:()=>n}}function ze(t){const{getModalConfig:i,getProviderConfig:e}=t;return{getEffectiveConfig:function(){const t=ue(),n=e(),o=i();let s=t;return n&&(s=pe(s,n)),o&&(s={...s,features:{...s.features,...o.features},appearance:{...s.appearance,...o.appearance},animations:{...s.animations,...o.animations},positioning:{...s.positioning,...o.positioning},parentChild:{...s.parentChild,...o.parentChild}}),s},isFeatureEnabled:function(t){var n,o;const s=i(),a=e(),r=i=>{if(void 0!==i){if("backdrop"===t&&"object"==typeof i){const t=se(i);return t.visible||t.blockClicks}return i}},d=r(null==(n=null==s?void 0:s.features)?void 0:n[t]);if(void 0!==d)return d;const l=r(null==(o=null==a?void 0:a.features)?void 0:o[t]);return void 0!==l?l:r(ue().features[t])??!1},getAppearance:function(t){var n,o;const s=i(),a=e();return void 0!==(null==(n=null==s?void 0:s.appearance)?void 0:n[t])?s.appearance[t]:void 0!==(null==(o=null==a?void 0:a.appearance)?void 0:o[t])?a.appearance[t]:ue().appearance[t]},getAnimation:function(t){var n,o;const s=i(),a=e();return void 0!==(null==(n=null==s?void 0:s.animations)?void 0:n[t])?s.animations[t]:void 0!==(null==(o=null==a?void 0:a.animations)?void 0:o[t])?a.animations[t]:ue().animations[t]},getPositioning:function(t){var n,o;const s=i(),a=e();return void 0!==(null==(n=null==s?void 0:s.positioning)?void 0:n[t])?s.positioning[t]:void 0!==(null==(o=null==a?void 0:a.positioning)?void 0:o[t])?a.positioning[t]:ue().positioning[t]},getParentChild:function(t){var n,o;const s=i(),a=e();return void 0!==(null==(n=null==s?void 0:s.parentChild)?void 0:n[t])?s.parentChild[t]:void 0!==(null==(o=null==a?void 0:a.parentChild)?void 0:o[t])?a.parentChild[t]:ue().parentChild[t]}}}const ve={modal:"modal-dialog",modalDragging:"modal-dragging",modalResizing:"modal-resizing",modalPositioned:"modal-positioned",modalMinimizing:"modal-minimizing",modalRestoring:"modal-restoring",modalOpening:"modal-opening",modalClosing:"modal-closing",modalCentered:"modal-centered",modalSolid:"modal-solid",modalTransparent:"modal-transparent",modalGlow:"modal-glow",modalHasGlow:"modal-has-glow",modalHasChild:"modal-has-child",modalIsChild:"modal-is-child",modalWasRestored:"modal-was-restored",modalVisibleByAnimation:"modal-visible-by-animation",modalAwaitingRestore:"modal-awaiting-restore",modalAwaitingChildOpen:"modal-awaiting-child-open",modalAnimatingToCenter:"modal-animating-to-center",modalAnimatingPosition:"modal-animating-position",modalAttention:"modal-attention",modalGlowStabilizing:"modal-glow-stabilizing",header:"modal-header",headerDraggable:"modal-header-draggable",body:"modal-body",footer:"modal-footer",childOverlay:"modal-child-overlay",overlayClosing:"modal-overlay-closing",headerTitle:"modal-header-title",headerIcon:"modal-header-icon",headerTitleGroup:"modal-header-title-group",headerActions:"modal-header-actions",headerTrafficLights:"modal-header-traffic-lights",headerLight:"modal-header-light",headerLightClose:"modal-header-light-close",headerLightMinimize:"modal-header-light-minimize",headerLightStyle:"modal-header-light-style",headerLightDisabled:"modal-header-light-disabled",headerMacCenter:"modal-header-mac-center",headerMacSpacer:"modal-header-mac-spacer",headerBtnWindows:"modal-header-btn-windows",headerBtnWindowsClose:"modal-header-btn-windows-close",headerBtnWindowsStyle:"modal-header-btn-windows-style",headerBtnWindowsDisabled:"modal-header-btn-windows-disabled",resizeHandles:"modal-resize-handles",resizeHandle:"modal-resize-handle",resizeN:"modal-resize-n",resizeS:"modal-resize-s",resizeE:"modal-resize-e",resizeW:"modal-resize-w",resizeNE:"modal-resize-ne",resizeNW:"modal-resize-nw",resizeSE:"modal-resize-se",resizeSW:"modal-resize-sw",resizePrefix:"modal-resize-",dock:"modal-dock",dockContainer:"modal-dock-container",dockItem:"modal-dock-item",dockItemActive:"modal-dock-item-active",dockItemHasGlow:"modal-dock-item-has-glow",dockItemHasChild:"modal-dock-item-has-child",dockItemLabelBeside:"modal-dock-item-label-beside",dockItemLabelBelow:"modal-dock-item-label-below",dockItemIcon:"modal-dock-item-icon",dockItemIconPlaceholder:"modal-dock-item-icon-placeholder",dockItemLabel:"modal-dock-item-label",dockItemGlow:"modal-dock-item-glow",dockChildIndicator:"modal-dock-child-indicator",dockHandle:"modal-dock-handle",dockHandleDragging:"modal-dock-handle-dragging",dockLeft:"modal-dock-left",dockRight:"modal-dock-right",dockBottom:"modal-dock-bottom",dockFree:"modal-dock-free",dockEmpty:"modal-dock-empty",dockFreeHorizontal:"modal-dock-free-horizontal",dockFreeVertical:"modal-dock-free-vertical",backdrop:"modal-backdrop",backdropVisible:"modal-backdrop-visible",srOnly:"sr-only",reactBodyContent:"react-modal-body-content",reactFooterContent:"react-modal-footer-content"},xe={dialog:ve.modal,dialogCentered:ve.modalCentered,dialogDragging:ve.modalDragging,dialogResizing:ve.modalResizing,dialogMinimizing:ve.modalMinimizing,dialogRestoring:ve.modalRestoring,dialogOpening:ve.modalOpening,dialogClosing:ve.modalClosing,dialogSolid:ve.modalSolid,dialogTransparent:ve.modalTransparent,dialogHasGlow:ve.modalHasGlow,dialogHasChild:ve.modalHasChild,dialogIsChild:ve.modalIsChild,dialogAnimatingPosition:ve.modalAnimatingPosition,dialogAttention:ve.modalAttention,header:ve.header,headerDraggable:ve.headerDraggable,headerLayout:t=>`modal-header--${t}`,body:ve.body,footer:ve.footer,childOverlay:ve.childOverlay,overlayClosing:ve.overlayClosing,headerTitle:ve.headerTitle,headerIcon:ve.headerIcon,headerTitleGroup:ve.headerTitleGroup,headerActions:ve.headerActions,headerTrafficLights:ve.headerTrafficLights,headerLight:ve.headerLight,headerLightClose:ve.headerLightClose,headerLightMinimize:ve.headerLightMinimize,headerLightStyle:ve.headerLightStyle,headerLightDisabled:ve.headerLightDisabled,headerMacCenter:ve.headerMacCenter,headerMacSpacer:ve.headerMacSpacer,headerBtnWindows:ve.headerBtnWindows,headerBtnWindowsClose:ve.headerBtnWindowsClose,headerBtnWindowsStyle:ve.headerBtnWindowsStyle,headerBtnWindowsDisabled:ve.headerBtnWindowsDisabled,resizeHandles:ve.resizeHandles,resizeHandle:ve.resizeHandle,resizePrefix:ve.resizePrefix,dock:ve.dock,dockContainer:ve.dockContainer,dockItem:ve.dockItem,dockItemActive:ve.dockItemActive,dockItemHasGlow:ve.dockItemHasGlow,dockItemHasChild:ve.dockItemHasChild,dockItemLabelBeside:ve.dockItemLabelBeside,dockItemLabelBelow:ve.dockItemLabelBelow,dockItemIcon:ve.dockItemIcon,dockItemIconPlaceholder:ve.dockItemIconPlaceholder,dockItemLabel:ve.dockItemLabel,dockItemGlow:ve.dockItemGlow,dockChildIndicator:ve.dockChildIndicator,dockHandle:ve.dockHandle,dockHandleDragging:ve.dockHandleDragging,dockLeft:ve.dockLeft,dockRight:ve.dockRight,dockBottom:ve.dockBottom,dockFree:ve.dockFree,dockEmpty:ve.dockEmpty,dockFreeHorizontal:ve.dockFreeHorizontal,dockFreeVertical:ve.dockFreeVertical,backdrop:ve.backdrop,backdropVisible:ve.backdropVisible},be={modalId:"data-modal-id",dockContainer:"data-dock-container",resizeDir:"data-resize-dir",modalBridge:"data-modal-bridge"},Ie={modalId:be.modalId,resizeDirection:"data-direction",dockItemId:"data-dock-item-id"},Ce=["n","s","e","w","ne","nw","se","sw"],Pe={n:"Resize north",s:"Resize south",e:"Resize east",w:"Resize west",ne:"Resize northeast",nw:"Resize northwest",se:"Resize southeast",sw:"Resize southwest"},Me={minimize:500,restore:400,open:400,close:250,overlay:200,centerAfterResize:200,glowStabilize:1e3},Ae={minWidth:280,minHeight:200,maxWidth:"600px",zIndexBase:1e3},ke=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function Re(t,i){return function(t,i,e={}){const{timeout:n=5e3}=e;return new Promise((e,o)=>{const s=performance.now(),a=()=>{const r=t(),d=performance.now()-s;r&&i(r)?e(r):d>=n?o(new Error(`DOM not ready after ${n}ms`)):requestAnimationFrame(a)};a()})}(t,t=>t.offsetWidth>0&&t.offsetHeight>0,i)}function Be(t,i,e=2e3){return new Promise((n,o)=>{let s=!1;const a=e=>{i&&e.animationName!==i||s||(s=!0,t.removeEventListener("animationend",a),n(e))};t.addEventListener("animationend",a),setTimeout(()=>{s||(s=!0,t.removeEventListener("animationend",a),o(new Error(`Animation '${i||"any"}' did not complete within ${e}ms`)))},e)})}const Se={MINIMIZE:"modal-genie-minimize",RESTORE:"modal-genie-restore",OPEN:"modal-genie-restore",CLOSE:"modal-close",CLOSE_CENTERED:"modal-close-centered",CHILD_APPEAR:"modal-child-appear",CHILD_DISAPPEAR:"modal-child-disappear"};function De(t,i){const e=e=>{e.target===t&&i(e.animationName)};return t.addEventListener("animationend",e),()=>t.removeEventListener("animationend",e)}function He(){const t=Tt();return Array.from(t.values()).filter(t=>t.isMinimized).sort((t,i)=>t.dockPosition-i.dockPosition)}function Ee(t,i,e){const n=ct(t.x,t.y,i,e);return{x:Math.round(n.x),y:Math.round(n.y)}}function Te(t,i,e,n,o,s=8){const a=window.innerWidth-n-s,r=window.innerHeight-o-s,d=Math.min(Math.max(t-e.x,s),Math.max(s,a)),l=Math.min(Math.max(i-e.y,s),Math.max(s,r));return{x:Math.round(d),y:Math.round(l)}}function Oe(t,i){const e=["modal-dock-container"];return"left"===t?e.push("modal-dock-left"):"right"===t?e.push("modal-dock-right"):"bottom"===t?e.push("modal-dock-bottom"):"free"===t&&e.push("modal-dock-free"),i&&e.push("modal-dock-empty"),e.join(" ")}function Fe(t,i){const e=["modal-dock"];return"free"===t&&e.push("horizontal"===i?"modal-dock-free-horizontal":"modal-dock-free-vertical"),e.join(" ")}function We(){const t=Tt();return Array.from(t.values()).some(t=>t.isOpen&&!t.isMinimized&&!t.isHiddenWithParent)}function Le(){return se(ue().features.backdrop)}function _e(){const t=Le();return t.visible||t.blockClicks}function Ge(t={}){const{initialPosition:i={x:0,y:0},constrain:e=!0}=t,n={...i};let o=!1,s=!1,a=0,r=0,d=0,l=0;const h=oe();function c(){return{isDragging:o,position:{...n},hasBeenDragged:s}}function g(){h.emit("change",c())}return{getState:c,getPosition:()=>({...n}),isDragging:()=>o,hasBeenDragged:()=>s,setPosition:function(t){n.x=t.x,n.y=t.y,g()},setHasBeenDragged:function(t){s=t,g()},reset:function(){n.x=i.x,n.y=i.y,s=!1,o=!1,g()},constrainToViewport:function(t){if(!s)return;const i=ct(n.x,n.y,t.width,t.height);n.x=i.x,n.y=i.y,g()},onPointerDown:function(t,i){if(0===t.button){if(!s){const t=i.getBoundingClientRect();n.x=t.left,n.y=t.top}o=!0,a=t.clientX,r=t.clientY,d=n.x,l=n.y,i.setPointerCapture(t.pointerId),h.emit("dragStart",{...n}),g()}},onPointerMove:function(t,i){if(!o)return;const c=t.clientX-a,u=t.clientY-r;let m=d+c,f=l+u;if(e){const t=ct(m,f,i.width,i.height);m=t.x,f=t.y}n.x=m,n.y=f,s=!0,h.emit("dragMove",{...n}),g()},onPointerUp:function(t,i){o&&(o=!1,i.releasePointerCapture(t.pointerId),h.emit("dragEnd",{...n}),g())},subscribe:function(t){return h.on("change",t)},destroy:function(){h.off()}}}function $e(t){const{minWidth:i=Ae.minWidth,minHeight:e=Ae.minHeight,getPosition:n,setPosition:o,getHasBeenDragged:s,setHasBeenDragged:a,getElement:r,getSymmetricResize:d,onResizeEnd:l}=t;let h=!1,c="",g={width:0,height:0},u=!1,m=!1,f={x:0,y:0,width:0,height:0,posX:0,posY:0,centerX:0,centerY:0},p=null;const w=oe();let y=null,z=null;function v(){return{isResizing:h,direction:c,size:{...g},hasBeenResized:u}}function x(){w.emit("change",v())}function b(t){if(t.pointerId!==p)return;const n=t.clientX-f.x,s=t.clientY-f.y,a=window.innerWidth,r=window.innerHeight,l=(null==d?void 0:d())??!1;let h=f.width,u=f.height,m=f.posX,y=f.posY;if(l){if(c.includes("e")||c.includes("w")){const t=c.includes("e")?n:-n;h=Math.max(i,f.width+2*t),m=f.centerX-h/2}if(c.includes("s")||c.includes("n")){const t=c.includes("s")?s:-s;u=Math.max(e,f.height+2*t),y=f.centerY-u/2}}else{if(c.includes("e")){const t=a-m;h=Math.max(i,Math.min(f.width+n,t))}if(c.includes("w")){const t=f.width-i,e=Math.min(n,t);h=f.width-e,m=f.posX+e}if(c.includes("s")){const t=r-y;u=Math.max(e,Math.min(f.height+s,t))}if(c.includes("n")){const t=f.height-e,i=Math.min(s,t);u=f.height-i,y=f.posY+i}}const z=gt(m,y,h,u);g={width:z.width,height:z.height},o({x:z.x,y:z.y}),w.emit("resizeMove",{size:{...g},position:{x:z.x,y:z.y}}),x()}function I(t){if(t.pointerId!==p)return;h=!1,c="",p=null,y&&window.removeEventListener("pointermove",y),z&&(window.removeEventListener("pointerup",z),window.removeEventListener("pointercancel",z)),y=null,z=null,m=!0;const i=n();w.emit("resizeEnd",{size:{...g},position:i}),l&&l(i,{...g}),x(),setTimeout(()=>{m=!1},0)}return{getState:v,getSize:()=>({...g}),isResizing:()=>h,hasBeenResized:()=>u,justFinishedResizing:()=>m,setSize:function(t){g={...t},u=!0,x()},reset:function(){u=!1,g={width:0,height:0},h=!1,c="",x()},constrainToViewport:function(){const t=n(),i=r();if(!i)return;const e=gt(t.x,t.y,g.width||i.offsetWidth,g.height||i.offsetHeight);g={width:e.width,height:e.height},o({x:e.x,y:e.y}),x()},startResize:function(t,i){t.preventDefault(),t.stopPropagation();const e=r();if(!e)return;const d=e.getBoundingClientRect();s()||(o({x:d.left,y:d.top}),a(!0)),u||(g={width:d.width,height:d.height},u=!0);const l=n();h=!0,c=i,p=t.pointerId,f={x:t.clientX,y:t.clientY,width:g.width,height:g.height,posX:l.x,posY:l.y,centerX:l.x+g.width/2,centerY:l.y+g.height/2},y=b,z=I,window.addEventListener("pointermove",y),window.addEventListener("pointerup",z),window.addEventListener("pointercancel",z),w.emit("resizeStart",{direction:i}),x()},subscribe:function(t){return w.on("change",t)},destroy:function(){y&&window.removeEventListener("pointermove",y),z&&(window.removeEventListener("pointerup",z),window.removeEventListener("pointercancel",z)),w.off()}}}function Ve(t){return Array.from(t.querySelectorAll(ke)).filter(t=>null!==t.offsetParent||"A"===t.tagName)}function Ye(t,i){if("Tab"!==t.key)return;const e=Ve(i);if(0===e.length)return void t.preventDefault();const n=e[0],o=e[e.length-1],s=document.activeElement;t.shiftKey?s===n&&(o.focus(),t.preventDefault()):s===o&&(n.focus(),t.preventDefault())}function Xe(t){const i=Ve(t);return i.length>0&&(i[0].focus(),!0)}function qe(t){const i=Ve(t);return i.length>0&&(i[i.length-1].focus(),!0)}function Ne(t){return t.contains(document.activeElement)}function je(t){let i=null;return{activate(){i=document.activeElement,Xe(t)},deactivate(){i&&"function"==typeof i.focus&&i.focus(),i=null},handleKeyDown(i){Ye(i,t)},containsFocus:()=>Ne(t)}}function Ke(t,i){return{x:t.x-i.x,y:t.y-i.y}}function Ue(t,i){return{x:t.x+i.x,y:t.y+i.y}}function Ze(t,i){return{x:t.x-i.x,y:t.y-i.y}}function Je(t,i,e){return{x:t.x+(i.width-e.width)/2,y:t.y+(i.height-e.height)/2}}function Qe(t){const i=t.getBoundingClientRect();return{position:{x:i.left,y:i.top},size:{width:i.width,height:i.height}}}function tn(t){return bt(t)}function en(t){return bt(t)}function nn(t,i,e){return t&&!i&&!e}function on(t,i){const e=[];let n=i(t);for(;n;)e.push(n),n=i(n);return e}function sn(t,i){const e=[];let n=i(t);for(;n;)e.push(n),n=i(n);return e}function an(t,i){let e=t,n=i(e);for(;n;)e=n,n=i(e);return e}function rn(t,i,e){const n=t.x+i.width/2,o=t.y+i.height/2;return{x:e.x-n,y:e.y-o,originX:e.x-t.x,originY:e.y-t.y}}function dn(t,i,e){const n=t.x+i.width/2,o=t.y+i.height/2;return{x:e.x-n,y:e.y-o,originX:e.x-t.x,originY:e.y-t.y}}function ln(t,i,e){const n=t.x+i.width/2,o=t.y+i.height/2;return{x:e.x-n,y:e.y-o,originX:e.x-t.x,originY:e.y-t.y}}function hn(t){return{"--modal-transform-x":`${t.x}px`,"--modal-transform-y":`${t.y}px`,"--modal-origin-x":`${t.originX}px`,"--modal-origin-y":`${t.originY}px`}}function cn(){return{x:"undefined"!=typeof window?window.innerWidth/2:0,y:"undefined"!=typeof window?window.innerHeight-40:0}}function gn(t,i){const e=document.querySelector(`.modal-dock-item[data-modal-id="${t}"]`);if(e){const t=e.getBoundingClientRect();return{x:t.left+t.width/2,y:t.top+t.height/2}}const n=document.querySelector('[data-dock-container="true"]');if(n){const t=n.getBoundingClientRect();return{x:t.left+t.width/2,y:t.top+t.height/2}}return i??cn()}function un(t){const{getId:i,getElement:e,getPosition:n,setPosition:o,getHasBeenDragged:s,setHasBeenDragged:a,getHasBeenResized:r,getSize:d,areAnimationsEnabled:l=()=>!0,onMinimizeComplete:h,onOpenStart:c}=t;let g="none",u=!1,m=null,f=null,p=null,w=null,y=null,z=null,v=null;const x=oe();function b(){return{type:g,isAnimating:u,transform:m?{...m}:null}}function I(){x.emit("change",b())}function C(){z&&(clearTimeout(z),z=null)}function P(){const t=e();t&&!v&&(v=De(t,M))}function M(t){switch(C(),t){case Se.MINIMIZE:"minimize"===g&&A();break;case Se.RESTORE:"restore"===g?k():"open"===g&&R();break;case Se.CLOSE:case Se.CLOSE_CENTERED:case Se.CHILD_DISAPPEAR:"close"===g&&B();break;case Se.CHILD_APPEAR:"open"===g&&R()}}function A(){"minimize"===g&&(C(),w?(w(),w=null):y&&(null==h||h(y.position,!0,y.size)),x.emit("animationEnd",{type:"minimize"}),y=null)}function k(){if("restore"!==g)return;C(),g="none",u=!1,m=null;const t=e();t&&(t.setAttribute("data-state","open"),t.setAttribute("data-animation-phase","idle")),x.emit("animationEnd",{type:"restore"}),I()}function R(){if("open"!==g)return;C(),g="none",u=!1,m=null;const t=e();t&&(t.setAttribute("data-state","open"),t.setAttribute("data-animation-phase","idle")),x.emit("animationEnd",{type:"open"}),I()}function B(){if("close"!==g)return;C(),g="none",u=!1;const t=e();t&&(t.setAttribute("data-state","closed"),t.setAttribute("data-animation-phase","idle")),x.emit("animationEnd",{type:"close"}),p&&(p(),p=null),I()}return{getState:b,isAnimating:()=>u,getAnimationType:()=>g,getTransform:()=>m?{...m}:null,getPendingOpenSource:()=>f?{...f}:null,setPendingOpenSource:t=>{f=t?{...t}:null},startMinimize:function(t,c){const f=e();if(u||!f)return!1;if(P(),C(),!l()){const t=f.getBoundingClientRect(),i=s()?n():{x:t.left,y:t.top},e=r()?d():{width:t.width,height:t.height};return s()||(o(i),a(!0)),c?c():null==h||h(i,!0,e),!0}const p=f.getBoundingClientRect(),v=s()?n():{x:p.left,y:p.top},b=r()?d():{width:p.width,height:p.height};s()||(o(v),a(!0));const M=t??gn(i());return m=rn(v,b,M),w=c||null,y={position:v,size:b},f.setAttribute("data-state","minimizing"),f.setAttribute("data-animation-phase","prepare"),requestAnimationFrame(()=>{requestAnimationFrame(()=>{g="minimize",u=!0,f.setAttribute("data-animation-phase","animate"),x.emit("animationStart",{type:"minimize"}),I()})}),z=setTimeout(()=>{"minimize"===g&&A()},Ct.minimize+Pt),!0},startRestore:function(t,n){const s=e();if(P(),C(),!l()){const i=t||{x:window.innerWidth/2,y:window.innerHeight/2};return o(i),void a(!0)}const r=gn(i()),d=t||{x:window.innerWidth/2,y:window.innerHeight/2},h=n||{width:480,height:400};o(d),a(!0),m=dn(d,h,r),g="restore",u=!0,s&&(s.setAttribute("data-state","restoring"),s.setAttribute("data-animation-phase","animate")),x.emit("animationStart",{type:"restore"}),I(),z=setTimeout(()=>{"restore"===g&&k()},Ct.restore+Pt)},startOpen:function(){const t=e();if(!f||!t||u)return!1;if(P(),C(),!l())return f=null,!1;const i=f,r=t.getBoundingClientRect(),d=s()?n():{x:r.left,y:r.top},h=r.width,p=r.height;return s()||(o(d),a(!0)),m=ln(d,{width:h,height:p},i),g="open",u=!0,f=null,t.setAttribute("data-state","opening"),t.setAttribute("data-animation-phase","animate"),x.emit("animationStart",{type:"open"}),null==c||c(),I(),z=setTimeout(()=>{"open"===g&&R()},Ct.open+Pt),!0},startClose:function(t){const i=e();return!u&&(P(),C(),l()?(p=t,g="close",u=!0,i&&(i.setAttribute("data-state","closing"),i.setAttribute("data-animation-phase","animate")),x.emit("animationStart",{type:"close"}),I(),z=setTimeout(()=>{"close"===g&&B()},Ct.close+Pt),!0):(t(),!0))},forceClearMinimize:function(){C(),"minimize"===g&&(g="none",u=!1,m=null,w=null,y=null,I())},destroy:function(){C(),null==v||v(),v=null,x.off()},subscribe:t=>x.on("change",t)}}function mn(t){const i={"z-index":t.zIndex};return t.animationTransform?(i.left=`${t.position.x}px`,i.top=`${t.position.y}px`,i["--genie-origin-x"]=`${t.animationTransform.originX}px`,i["--genie-origin-y"]=`${t.animationTransform.originY}px`,i["--genie-translate-x"]=`${t.animationTransform.x}px`,i["--genie-translate-y"]=`${t.animationTransform.y}px`):t.hasBeenDragged&&(i.left=`${t.position.x}px`,i.top=`${t.position.y}px`,t.isAnimatingPosition||(i.transform="none")),t.hasBeenResized?(i.width=`${t.size.width}px`,i.height=`${t.size.height}px`,i["max-width"]="none",i["max-height"]="none"):(t.preferredHeight&&(i["min-height"]=t.preferredHeight),t.maxWidth&&(i["max-width"]=t.maxWidth)),t.glowEnabled&&t.glow&&(i["--modal-glow-color"]=t.glow.color,i["--modal-glow-intensity"]=String(t.glow.intensity??"medium")),i}function fn(t){const i=["modal-dialog"];return t.isDragging&&i.push("modal-dragging"),t.isResizing&&i.push("modal-resizing"),t.hasBeenDragged&&i.push("modal-positioned"),t.isMinimizing&&i.push("modal-minimizing"),t.isRestoring&&i.push("modal-restoring"),t.isOpening&&i.push("modal-opening"),t.isClosing&&i.push("modal-closing"),t.showCentered&&i.push("modal-centered"),t.isTransparent||i.push("modal-solid"),t.isTransparent&&i.push("modal-transparent"),t.glowEnabled&&i.push("modal-glow"),t.hasChild&&i.push("modal-has-child"),t.isChildModal&&i.push("modal-is-child"),t.wasRestored&&i.push("modal-was-restored"),t.isVisibleByAnimation&&i.push("modal-visible-by-animation"),t.isAwaitingRestore&&i.push("modal-awaiting-restore"),t.isAwaitingChildOpen&&i.push("modal-awaiting-child-open"),t.isAnimatingToCenter&&i.push("modal-animating-to-center"),t.isAnimatingPosition&&i.push("modal-animating-position"),t.isAttentionAnimating&&i.push("modal-attention"),t.glowStabilizing&&t.glowEnabled&&i.push("modal-glow-stabilizing"),i}class pn{constructor(t={}){i(this,"element",null),i(this,"resizeHandler",null),i(this,"options"),this.options=t}mount(t){var i,e;this.element=t,this.options.onWindowResize&&(this.resizeHandler=this.options.onWindowResize,window.addEventListener("resize",this.resizeHandler)),null==(e=(i=this.options).onMount)||e.call(i)}destroy(){var t,i;this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null),this.element=null,null==(i=(t=this.options).onDestroy)||i.call(t)}getElement(){return this.element}isMounted(){return null!==this.element}}class wn{constructor(t){i(this,"id"),i(this,"dataId"),i(this,"configHelper"),i(this,"getDragBehavior"),i(this,"getElement"),this.id=t.id,this.dataId=t.dataId,this.configHelper=t.configHelper,this.getDragBehavior=t.getDragBehavior,this.getElement=t.getElement}constrainToViewport(t){const i=this.getDragBehavior();i.hasBeenDragged()&&i.constrainToViewport(t)}shouldApplySmartPositioning(){return"smart"===this.configHelper.getPositioning("strategy")&&!this.getDragBehavior().hasBeenDragged()}applySmartPositioning(){if("smart"!==this.configHelper.getPositioning("strategy"))return!1;const t=Bt(this.id),i=ji();if((null==t?void 0:t.parentId)||i&&i.childId===this.id)return!1;if((null==t?void 0:t.hasBeenDragged)||(null==t?void 0:t.position))return!1;const e=this.getElement()||bt(this.id);if(!e)return!1;const n=e.offsetWidth,o=e.offsetHeight;if(n<=0||o<=0)return!1;const s=this.configHelper.getPositioning("modalGap"),a=Wt().filter(t=>t.id!==this.id),r=pt(this.configHelper.getPositioning("avoidElements")),d=vt(a,{id:this.id,width:n,height:o},{modalGap:s,viewportMargin:s,avoidBounds:r,avoidMargin:s}),l=d.positions.get(this.id);if(!l)return!1;const h=new Map;for(const[t,i]of d.positions)t!==this.id&&h.set(t,i);h.size>0&&qt(h);const c=this.getDragBehavior();return c.setPosition(l),c.setHasBeenDragged(!0),Gt(this.id,l,{size:{width:n,height:o}}),!0}scheduleSmartPositioning(){Re(()=>this.getElement()||bt(this.id)).then(()=>{this.applySmartPositioning()}).catch(()=>{this.applySmartPositioning()})}centerChildOnParent(t){var i,e;const n=Bt(t);if(!n)return!1;const o=this.getElement()||bt(this.id),s=bt(t),a=null==s?void 0:s.getBoundingClientRect(),r=n.position??(a?{x:a.left,y:a.top}:null);if(!r||!o)return!1;const d=(null==(i=n.size)?void 0:i.width)??(null==s?void 0:s.offsetWidth)??(null==a?void 0:a.width)??480,l=(null==(e=n.size)?void 0:e.height)??(null==s?void 0:s.offsetHeight)??(null==a?void 0:a.height)??400,h=o.offsetWidth,c=o.offsetHeight;if(d<=0||l<=0||h<=0||c<=0)return!1;const g={x:r.x+(d-h)/2,y:r.y+(l-c)/2},u=this.getDragBehavior();u.setPosition(g),u.setHasBeenDragged(!0),Gt(this.id,g,{size:{width:h,height:c}}),n.position&&n.size||!a||Gt(t,{x:a.left,y:a.top},{size:{width:d,height:l}});const m={x:g.x-r.x,y:g.y-r.y};return Ni(t,this.id,m),!0}scheduleCenterChildOnParent(t){Re(()=>this.getElement()).then(()=>{this.centerChildOnParent(t)}).catch(()=>{this.centerChildOnParent(t)})}}class yn{constructor(t){i(this,"options"),this.options=t}startDrag(t){const i=this.options.getElement();this.options.configHelper.isFeatureEnabled("drag")&&i&&this.options.getDragBehavior().onPointerDown(t,i)}startResize(t,i){const e=this.options.getState();this.options.configHelper.isFeatureEnabled("resize")&&!e.hasChild&&this.options.getResizeBehavior().startResize(t,i)}handlePointerMove(t){const i=this.options.getElement();if(!i)return;const e=this.options.getDragBehavior(),n=e.isDragging(),o=this.options.getResizeBehavior(),s=o.hasBeenResized()?o.getSize():{width:i.offsetWidth,height:i.offsetHeight};e.onPointerMove(t,s),n&&e.isDragging()&&this.options.onDragMove()}handlePointerUp(t){const i=this.options.getElement();if(!i)return;const e=this.options.getDragBehavior(),n=e.isDragging();e.onPointerUp(t,i),n&&!this.options.getResizeBehavior().justFinishedResizing()&&this.options.onDragEnd()}handleKeyDown(t){var i,e;this.options.closeOnEscape&&"Escape"===t.key&&this.options.isTopModal()&&(t.stopPropagation(),null==(e=(i=this.options).onClose)||e.call(i))}handleTabKey(t){const i=this.options.getElement();i&&Ye(t,i)}focusFirst(){const t=this.options.getElement();t&&Xe(t)}}class zn{constructor(t){i(this,"id"),i(this,"options"),i(this,"_isHandlingMinimize",!1),i(this,"_isAttentionAnimating",!1),i(this,"_wasRestored"),i(this,"_glowStabilizing",!1),i(this,"_restoreHold",!1),i(this,"_isAnimatingToCenter",!1),i(this,"_cancelParentAnimationCleanup",null),i(this,"_parentFlipInFlight",!1),i(this,"_deferredParentTarget",null),i(this,"_parentFlipStartTime",0),this.id=t.id,this.options=t,this._wasRestored=!1}handlePendingStates(){if(!Bt(this.id))return;if(this.handlePendingForceClose())return;if(this.handlePendingMinimize(),this.handlePendingMinimizeWithParent(),this.handlePendingRestore(),this.handlePendingChildRestore(),this.handlePendingClose())return;const t=this.handlePendingParentLink(),i=this.handlePendingOpen(t);this.handlePendingAttention(),this.handlePendingParentAnimation(),this.handleChildCentering(t,i)}handlePendingForceClose(){var t,i;return!!Bi(this.id)&&(Si(this.id),vi(this.id),null==(i=(t=this.options.options).onClose)||i.call(t),!0)}handlePendingMinimize(){if(!bi(this.id)||this._isHandlingMinimize)return;this._isHandlingMinimize=!0,Xi();const t=this.options.getElement();if(t){const i=this.options.getDragBehavior(),e=this.options.getResizeBehavior(),n=t.getBoundingClientRect(),o=i.hasBeenDragged()?i.getPosition():{x:n.left,y:n.top},s=e.hasBeenResized()?e.getSize():{width:n.width,height:n.height};Yt(this.id,{position:o,size:s,hasBeenDragged:!0})}this.options.getAnimationController().startMinimize(void 0,()=>{Ii(this.id),this._isHandlingMinimize=!1})||(this._isHandlingMinimize=!1)}handlePendingMinimizeWithParent(){if(!Ci(this.id)||this._isHandlingMinimize)return;this._isHandlingMinimize=!0;const t=this.options.getElement();if(t){const i=this.options.getDragBehavior(),e=this.options.getResizeBehavior(),n=t.getBoundingClientRect(),o=i.hasBeenDragged()?i.getPosition():{x:n.left,y:n.top},s=e.hasBeenResized()?e.getSize():{width:n.width,height:n.height};Yt(this.id,{position:o,size:s,hasBeenDragged:!0})}this.options.getAnimationController().startMinimize(void 0,()=>{Pi(this.id),ai(this.id),this._isHandlingMinimize=!1})}handlePendingRestore(){if(!Di(this.id))return;const t=Bt(this.id),i=this.options.getAnimationController();Hi(this.id),i.startRestore((null==t?void 0:t.position)??void 0,(null==t?void 0:t.size)??void 0),requestAnimationFrame(()=>{this.options.focusFirst()})}handlePendingChildRestore(){if(!Ei(this.id))return;const t=Bt(this.id),i=this.options.getAnimationController();Ti(this.id),i.startRestore((null==t?void 0:t.position)??void 0,(null==t?void 0:t.size)??void 0),si(this.id),this._wasRestored=!0}handlePendingClose(){var t,i;return!!ki(this.id)&&(Ri(this.id),this.options.getAnimationController().startClose(()=>{var t,i;gi(this.id),vi(this.id),null==(i=(t=this.options.options).onClose)||i.call(t)})||(gi(this.id),vi(this.id),null==(i=(t=this.options.options).onClose)||i.call(t)),!0)}handlePendingParentLink(){const t=ji();return t&&t.childId===this.id&&(Yt(this.id,{parentId:t.parentId}),this._wasRestored=!0),qi(this.id)}handlePendingOpen(t){var i;if(!Mi(this.id))return!1;Ai(this.id);const e=this.options.getDragBehavior(),n=this.options.getResizeBehavior();Yt(this.id,{position:null,hasBeenDragged:!1,size:null}),e.setPosition({x:0,y:0}),e.setHasBeenDragged(!1),n.reset();const o=Yi(this.id)||this.options.options.openSourcePosition||null,s=!!t||!!(null==(i=Bt(this.id))?void 0:i.parentId);let a=!1;return o?(a=!0,this.options.getAnimationController().setPendingOpenSource(o),s&&t?this.openChildModalWithAnimation(t.parentId):this.openStandaloneModalWithAnimation()):s||this.options.getPositioning().scheduleSmartPositioning(),requestAnimationFrame(()=>{this.options.focusFirst()}),a}openChildModalWithAnimation(t){const i=this.options.getPositioning(),e=this.options.getAnimationController();Re(()=>this.options.getElement()).then(()=>{i.centerChildOnParent(t)&&(e.startOpen(),this._wasRestored=!0)}).catch(()=>{i.centerChildOnParent(t)&&(e.startOpen(),this._wasRestored=!0)})}openStandaloneModalWithAnimation(){const t=this.options.getPositioning(),i=this.options.getAnimationController();Re(()=>this.options.getElement()).then(()=>{t.applySmartPositioning(),i.startOpen()}).catch(()=>{t.applySmartPositioning(),i.startOpen()})}handlePendingAttention(){Oi(this.id)&&(Fi(this.id),this.id,this._isAttentionAnimating=!0,setTimeout(()=>{this._isAttentionAnimating=!1,this.id,this.options.onStateChange()},600))}handlePendingParentAnimation(){if(!_i(this.id))return;const t=Gi(this.id);if(t){if(this._parentFlipInFlight&&Date.now()-this._parentFlipStartTime<Ct.parentRetargetInterval)return void(this._deferredParentTarget=t);this._deferredParentTarget=null,this.startParentFlip(t)}}startParentFlip(t){var i,e;const n=this.options.getDragBehavior(),o=this.options.getElement(),s=o?{x:o.getBoundingClientRect().left,y:o.getBoundingClientRect().top}:(null==(i=Bt(this.id))?void 0:i.position)??null;Yt(this.id,{position:t,hasBeenDragged:!0,isAnimatingPosition:!0}),n.setPosition(t),n.setHasBeenDragged(!0),null==(e=this._cancelParentAnimationCleanup)||e.call(this),this._parentFlipInFlight=!0,this._parentFlipStartTime=Date.now();const a=this.id,r=()=>{this._parentFlipInFlight=!1,this._cancelParentAnimationCleanup=null,$t(a);const t=this._deferredParentTarget;t?(this._deferredParentTarget=null,this.startParentFlip(t)):Ki(a)};o&&s?this._cancelParentAnimationCleanup=Rt(o,s,t,{duration:Ct.parentMove,onComplete:r}):setTimeout(r,Ct.parentMove+Pt)}handleChildCentering(t,i){t&&this.options.getElement()&&!i&&this.options.getPositioning().scheduleCenterChildOnParent(t.parentId)}get wasRestored(){return this._wasRestored}set wasRestored(t){this._wasRestored=t}get isAttentionAnimating(){return this._isAttentionAnimating}get glowStabilizing(){return this._glowStabilizing}set glowStabilizing(t){this._glowStabilizing=t}get restoreHold(){return this._restoreHold}set restoreHold(t){this._restoreHold=t}get isAnimatingToCenter(){return this._isAnimatingToCenter}set isAnimatingToCenter(t){this._isAnimatingToCenter=t}get isHandlingMinimize(){return this._isHandlingMinimize}}class vn{constructor(t){var e,n,o,s;i(this,"id"),i(this,"dataId"),i(this,"options"),i(this,"drag"),i(this,"resize"),i(this,"animation"),i(this,"positioning"),i(this,"lifecycle"),i(this,"interactions"),i(this,"stateManager"),i(this,"overlayClosing",!1),i(this,"emitter",oe()),i(this,"unsubscribeState",null),i(this,"cachedState",null),this.id=t.id,this.dataId=t.id,this.options=t,this.drag=Ge({initialPosition:{x:0,y:0},constrain:!0}),this.resize=$e({minWidth:(null==(n=null==(e=t.config)?void 0:e.appearance)?void 0:n.minWidth)??ue().appearance.minWidth,minHeight:(null==(s=null==(o=t.config)?void 0:o.appearance)?void 0:s.minHeight)??ue().appearance.minHeight,getPosition:()=>this.drag.getPosition(),setPosition:t=>this.drag.setPosition(t),getHasBeenDragged:()=>this.drag.hasBeenDragged(),setHasBeenDragged:t=>this.drag.setHasBeenDragged(t),getElement:()=>this.element,onResizeEnd:(t,i)=>this.handleResizeEnd(t,i)}),this.animation=un({getId:()=>this.id,getElement:()=>this.element,getPosition:()=>this.drag.getPosition(),setPosition:t=>this.drag.setPosition(t),getHasBeenDragged:()=>this.drag.hasBeenDragged(),setHasBeenDragged:t=>this.drag.setHasBeenDragged(t),getHasBeenResized:()=>this.resize.hasBeenResized(),getSize:()=>this.resize.getSize(),areAnimationsEnabled:()=>this.options.configHelper.isFeatureEnabled("animations"),onMinimizeComplete:(t,i,e)=>{Yt(this.id,{position:t,size:e,hasBeenDragged:i}),ii(this.id)},onOpenStart:()=>{const t=Bt(this.id);(null==t?void 0:t.parentId)&&(this.stateManager.wasRestored=!0)}}),this.positioning=new wn({id:this.id,dataId:this.dataId,configHelper:t.configHelper,getDragBehavior:()=>this.drag,getElement:()=>this.element}),this.interactions=new yn({id:this.id,configHelper:t.configHelper,getDragBehavior:()=>this.drag,getResizeBehavior:()=>this.resize,getElement:()=>this.element,getState:()=>{var t;return{hasChild:!!(null==(t=Bt(this.id))?void 0:t.childId)}},onDragMove:()=>{if("realtime"===ue().parentChild.movementMode){const t=this.drag.getPosition();Gt(this.id,t,{drag:!0,realtime:!0})}},onDragEnd:()=>{const t=this.drag.getPosition();Gt(this.id,t,{drag:!0}),"animated"===ue().parentChild.movementMode&&Ki(this.id)},onClose:()=>this.close(),closeOnEscape:t.closeOnEscape,isTopModal:()=>dt(this.id)}),this.stateManager=new zn({id:this.id,options:{glow:t.glow,openSourcePosition:t.openSourcePosition,onClose:t.onClose},getDragBehavior:()=>this.drag,getResizeBehavior:()=>this.resize,getAnimationController:()=>this.animation,getElement:()=>this.element,getPositioning:()=>this.positioning,onStateChange:()=>this.notifyStateChange(),focusFirst:()=>this.interactions.focusFirst()}),Li(t.id)&&(this.stateManager.wasRestored=!0),this.lifecycle=new pn({onMount:()=>{this.handleStateChange(),this.handlePendingStates(),this.notifyStateChange()},onDestroy:()=>{var t;null==(t=this.unsubscribeState)||t.call(this),this.drag.destroy(),this.resize.destroy(),this.animation.destroy(),this.emitter.off()},onWindowResize:()=>this.handleWindowResize()}),this.drag.subscribe(()=>this.notifyStateChange()),this.resize.subscribe(()=>this.notifyStateChange()),this.animation.subscribe(()=>{this.handlePendingStates(),this.notifyStateChange()}),this.unsubscribeState=Z(()=>{this.handleStateChange(),this.handlePendingStates(),this.notifyStateChange()}),t.skipRegistration||this.register(t.autoOpen??!1),this.handleStateChange(),this.handlePendingStates()}mount(t){this.lifecycle.mount(t)}destroy(){this.lifecycle.destroy()}get element(){return this.lifecycle.getElement()}handleWindowResize(){if(!this.element||!this.drag.hasBeenDragged())return;const t=this.resize.hasBeenResized()?this.resize.getSize():{width:this.element.offsetWidth,height:this.element.offsetHeight};this.positioning.constrainToViewport(t),this.resize.hasBeenResized()&&this.resize.constrainToViewport(),this.notifyStateChange()}register(t){ot({id:this.id,title:this.options.title,icon:this.options.icon??"",isOpen:t,isMinimized:!1,isHiddenWithParent:!1,isTransparent:!1,isRejected:!1,position:null,size:null,hasBeenDragged:!1,dockPosition:0,glow:this.options.glow??null,parentId:void 0,childId:void 0,offsetFromParent:void 0}),t&&rt(this.id)}getState(){if(this.cachedState)return this.cachedState;const t=Bt(this.id),i=this.drag.getState(),e=this.resize.getState(),n=this.animation.getState(),o=!!t&&(t.isOpen||ki(this.id))&&(!t.isMinimized||bi(this.id))&&(!t.isHiddenWithParent||Ci(this.id)||Ei(this.id)),s=!!(null==t?void 0:t.childId),a=!!(null==t?void 0:t.parentId),r="minimize"===n.type&&n.isAnimating,d="restore"===n.type&&n.isAnimating,l="open"===n.type&&n.isAnimating,h="close"===n.type&&n.isAnimating,c=n.isAnimating,g=(null==t?void 0:t.isAnimatingPosition)??!1,u=g&&(null==t?void 0:t.position)?t.position:i.position,m=!!g||i.hasBeenDragged,f=(Ei(this.id)||Di(this.id))&&!d,p=(a||Li(this.id))&&!l&&(!m||!!this.animation.getPendingOpenSource()),w=d||l||this.stateManager.restoreHold,y=o&&!m&&!c&&!this.animation.getPendingOpenSource()&&!f&&!p;let z="closed";r?z="minimizing":d?z="restoring":l?z="opening":h?z="closing":(null==t?void 0:t.isMinimized)?z="minimized":o&&(z="open");const v=this.options.configHelper.isFeatureEnabled("drag"),x=this.options.configHelper.isFeatureEnabled("resize"),b=this.options.configHelper.isFeatureEnabled("minimize"),I=!!this.options.glow,C=mn({position:u,hasBeenDragged:m,hasBeenResized:e.hasBeenResized,size:e.size,animationTransform:n.transform,zIndex:(null==t?void 0:t.zIndex)??1e3,glowEnabled:I,glow:this.options.glow??null,maxWidth:this.options.maxWidth,preferredHeight:this.options.preferredHeight,isAnimatingPosition:g}),P=fn({isDragging:i.isDragging,isResizing:e.isResizing,hasBeenDragged:m,isMinimizing:r,isRestoring:d,isOpening:l,isClosing:h,showCentered:y,isTransparent:(null==t?void 0:t.isTransparent)??!1,glowEnabled:I,hasChild:s,isChildModal:a,wasRestored:this.stateManager.wasRestored,isVisibleByAnimation:w,isAwaitingRestore:f,isAwaitingChildOpen:p,isAnimatingToCenter:this.stateManager.isAnimatingToCenter,isAnimatingPosition:(null==t?void 0:t.isAnimatingPosition)??!1,isAttentionAnimating:this.stateManager.isAttentionAnimating,glowStabilizing:this.stateManager.glowStabilizing});return this.cachedState={position:i.position,size:e.size,zIndex:(null==t?void 0:t.zIndex)??1e3,isDragging:i.isDragging,isResizing:e.isResizing,hasBeenDragged:i.hasBeenDragged,hasBeenResized:e.hasBeenResized,isMinimizing:r,isRestoring:d,isOpening:l,isClosing:h,isAnyAnimating:c,animationTransform:n.transform,isVisible:o,showCentered:y,isAwaitingRestore:f,isAwaitingChildOpen:p,isVisibleByAnimation:w,hasChild:s,isChildModal:a,showOverlay:s||this.overlayClosing,isTransparent:(null==t?void 0:t.isTransparent)??!1,isAttentionAnimating:this.stateManager.isAttentionAnimating,glowStabilizing:this.stateManager.glowStabilizing,isAnimatingPosition:(null==t?void 0:t.isAnimatingPosition)??!1,isAnimatingToCenter:this.stateManager.isAnimatingToCenter,wasRestored:this.stateManager.wasRestored,overlayClosing:this.overlayClosing,glowEnabled:I,draggable:v,resizable:x,minimizable:b,dataState:z,dataAnimationPhase:n.isAnimating?"animate":"idle",style:C,cssClasses:P},this.cachedState}subscribe(t){return this.emitter.on("stateChange",t)}notifyStateChange(){this.cachedState=null,this.emitter.emit("stateChange",this.getState())}startDrag(t){this.interactions.startDrag(t)}startResize(t,i){this.interactions.startResize(t,i)}handlePointerMove(t){this.interactions.handlePointerMove(t)}handlePointerUp(t){this.interactions.handlePointerUp(t)}handleKeyDown(t){this.interactions.handleKeyDown(t)}handleTabKey(t){this.interactions.handleTabKey(t)}minimize(){this.options.configHelper.isFeatureEnabled("minimize")&&ii(this.id)}close(){var t,i;Bi(this.id)&&Si(this.id),yi(this.id),null==(i=(t=this.options).onClose)||i.call(t)}toggleTransparency(){di(this.id)}bringToFront(){rt(this.id)}setOpenSourcePosition(t){this.animation.setPendingOpenSource(t)}updateGlow(t){this.options.glow!==t&&(this.options.glow=t,Yt(this.id,{glow:t??null}),this.notifyStateChange())}focusFirst(){this.interactions.focusFirst()}handleResizeEnd(t,i){const e=Bt(this.id);if(null==e?void 0:e.parentId){const n=Bt(e.parentId),o=bt(e.parentId);if(n&&o){const e=n.position??{x:o.getBoundingClientRect().left,y:o.getBoundingClientRect().top},s=n.size??{width:o.offsetWidth,height:o.offsetHeight},a={x:e.x+(s.width-i.width)/2,y:e.y+(s.height-i.height)/2},r=t;this.stateManager.isAnimatingToCenter=!0,this.drag.setPosition(a);const d={x:a.x-e.x,y:a.y-e.y};Yt(this.id,{position:a,size:i,hasBeenDragged:!0,offsetFromParent:d});const l=this.lifecycle.getElement();return void(l?Rt(l,r,a,{duration:Ct.centerAfterResize,onComplete:()=>{this.stateManager.isAnimatingToCenter=!1}}):this.stateManager.isAnimatingToCenter=!1)}}Yt(this.id,{position:t,size:i,hasBeenDragged:!0})}handleStateChange(){const t=Bt(this.id);if(t){if((t.parentId||Li(this.id))&&(this.stateManager.wasRestored=!0),!this.drag.isDragging()&&!this.resize.isResizing()&&t.position){const i=this.drag.getPosition(),e=t.position;(Math.abs(i.x-e.x)>.5||Math.abs(i.y-e.y)>.5)&&(this.drag.setPosition(e),t.hasBeenDragged&&this.drag.setHasBeenDragged(!0))}this.stateManager.handlePendingStates()}}handlePendingStates(){this.stateManager.handlePendingStates()}getId(){return this.id}getDataId(){return this.dataId}getElement(){return this.element}}function xn(t){return new vn(t)}export{pn as $,ee as A,He as B,xe as C,Ie as D,Ee as E,ke as F,Ht as G,hi as H,Te as I,Le as J,_e as K,We as L,vn as M,me as N,te as O,Ut as P,ne as Q,Ce as R,Zt as S,Me as T,Se as U,ve as V,be as W,Ae as X,Ct as Y,Mt as Z,yn as _,he as a,Fe as a$,wn as a0,zn as a1,et as a2,it as a3,ie as a4,Jt as a5,qt as a6,J as a7,Je as a8,Zi as a9,Pi as aA,Ai as aB,Gi as aC,qi as aD,Hi as aE,Ne as aF,un as aG,ye as aH,Ge as aI,oe as aJ,je as aK,wi as aL,xn as aM,$e as aN,ae as aO,mi as aP,ai as aQ,vi as aR,en as aS,tn as aT,an as aU,Rt as aV,Xe as aW,qe as aX,sn as aY,cn as aZ,on as a_,Ue as aa,vt as ab,ft as ac,rn as ad,Ke as ae,ln as af,ut as ag,Ze as ah,dn as ai,mt as aj,Wi as ak,Qt as al,$t as am,zi as an,wt as ao,fn as ap,mn as aq,gt as ar,ct as as,Yi as at,Fi as au,Ti as av,Ri as aw,Si as ax,Ii as ay,Xi as az,ge as b,Oe as b0,Ft as b1,gn as b2,Ot as b3,At as b4,kt as b5,pt as b6,Ve as b7,Qe as b8,Wt as b9,O as bA,Et as bB,W as bC,E as bD,De as bE,nn as bF,ui as bG,$i as bH,di as bI,hn as bJ,Ye as bK,Ki as bL,Xt as bM,ci as bN,si as bO,Yt as bP,Gt as bQ,Vt as bR,Re as bS,It as bT,xi as ba,Lt as bb,_t as bc,Vi as bd,Ui as be,ji as bf,jt as bg,Oi as bh,Ei as bi,Bi as bj,Ci as bk,_i as bl,Li as bm,Di as bn,ri as bo,we as bp,dt as bq,Ni as br,pe as bs,se as bt,Be as bu,lt as bv,fe as bw,gi as bx,ni as by,oi as bz,yi as c,pi as d,Bt as e,St as f,U as g,rt as h,Dt as i,Tt as j,ue as k,ze as l,ii as m,Pe as n,fi as o,xt as p,ot as q,ei as r,Z as s,li as t,nt as u,st as v,Mi as w,ki as x,bi as y,bt as z};
|
package/dist/epic-modals.css
CHANGED
|
@@ -1,9 +1,47 @@
|
|
|
1
1
|
|
|
2
|
-
.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
.wizard-viewport.svelte-cx8fqi {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
height: 100%;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.wizard-container.svelte-cx8fqi {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
height: 100%;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.wizard-step-wrapper.svelte-sp1x21 {
|
|
16
|
+
height: 100%;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.wizard-fade-slide-left.svelte-sp1x21 {
|
|
20
|
+
animation: svelte-sp1x21-fadeSlideFromRight 0.3s ease forwards;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.wizard-fade-slide-right.svelte-sp1x21 {
|
|
24
|
+
animation: svelte-sp1x21-fadeSlideFromLeft 0.3s ease forwards;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@keyframes svelte-sp1x21-fadeSlideFromRight {
|
|
28
|
+
from {
|
|
29
|
+
opacity: 0;
|
|
30
|
+
transform: translateX(30px);
|
|
31
|
+
}
|
|
32
|
+
to {
|
|
33
|
+
opacity: 1;
|
|
34
|
+
transform: translateX(0);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@keyframes svelte-sp1x21-fadeSlideFromLeft {
|
|
39
|
+
from {
|
|
40
|
+
opacity: 0;
|
|
41
|
+
transform: translateX(-30px);
|
|
42
|
+
}
|
|
43
|
+
to {
|
|
44
|
+
opacity: 1;
|
|
45
|
+
transform: translateX(0);
|
|
46
|
+
}
|
|
9
47
|
}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{T as a,U as e,V as s,C as n,D as t,W as i,X as o,Y as l,Z as r,F as d,M as c,_ as g,$ as m,a0 as u,a1 as M,R as P,n as C,a2 as A,a3 as p,a4 as S,a5 as h,a6 as T,a7 as E,h as f,a8 as I,a9 as R,aa as D,I as k,ab as O,ac as z,ad as L,ae as b,af as F,ag as B,ah as y,ai as _,ab as N,aj as v,S as U,ak as V,al as W,am as w,an as Z,c as j,ao as x,ap as q,aq as G,E as H,ar as J,as as K,at as Q,au as X,av as Y,aw as $,ax as aa,ay as ea,az as sa,aA as na,aB as ta,aC as ia,aD as oa,aE as la,aF as ra,aG as da,aH as ca,l as ga,aI as ma,aJ as ua,aK as Ma,aL as Pa,aM as Ca,u as Aa,aN as pa,aO as Sa,aP as ha,aQ as Ta,aR as Ea,aS as fa,aT as Ia,aU as Ra,aV as Da,aW as ka,aX as Oa,aY as za,J as La,k as ba,b as Fa,aZ as Ba,a_ as ya,a$ as _a,b0 as Na,b1 as va,b2 as Ua,b3 as Va,b4 as Wa,b5 as wa,b6 as Za,b7 as ja,A as xa,B as qa,b8 as Ga,b9 as Ha,e as Ja,j as Ka,ba as Qa,bb as Xa,bc as Ya,bd as $a,be as ae,bf as ee,g as se,bg as ne,L as te,bh as ie,bi as oe,x as le,bj as re,y as de,bk as ce,w as ge,bl as me,bm as ue,bn as Me,bo as Pe,P as Ce,O as Ae,K as pe,bp as Se,G as he,f as Te,i as Ee,bq as fe,br as Ie,bs as Re,m as De,bt as ke,bu as Oe,o as ze,d as Le,q as be,bv as Fe,bw as Be,bx as ye,Q as _e,by as Ne,bz as ve,r as Ue,N as Ve,bA as We,bB as we,bC as Ze,bC as je,bD as xe,bD as qe,bE as Ge,H as He,bF as Je,bG as Ke,bH as Qe,s as Xe,a as Ye,p as $e,bI as as,bJ as es,bK as ss,t as ns,bL as ts,bM as is,bN as os,bO as ls,v as rs,bP as ds,bQ as cs,bR as gs,bS as ms}from"./core.js";import"./ui.js";export{a as ANIMATION_DURATIONS,e as ANIMATION_NAMES,s as CSS,n as CSS_CLASSES,t as DATA_ATTRIBUTES,i as DATA_ATTRS,o as DEFAULTS,l as DURATIONS,r as EASINGS,d as FOCUSABLE_SELECTORS,c as ModalController,g as ModalInteractions,m as ModalLifecycle,u as ModalPositioning,M as ModalStateManager,P as RESIZE_DIRECTIONS,C as RESIZE_DIRECTION_LABELS,A as _getInternalState,p as _resetInternalState,S as acquireModalZIndex,h as animateModalsToPositions,T as applyLayoutPositions,E as batchUpdates,f as bringToFront,I as calculateCenteredChildPosition,R as calculateChildCenterPosition,D as calculateChildPosition,k as calculateDockDragPosition,O as calculateEqualSpaceLayout,z as calculateMinDistance,L as calculateMinimizeTransform,b as calculateOffsetFromParent,F as calculateOpenTransform,B as calculateOverlap,y as calculateParentPosition,_ as calculateRestoreTransform,N as calculateSmartLayout,v as calculateTotalOverlap,U as cleanupResizeListener,V as clearActiveAttention,W as clearPendingParentAnimation,w as clearPositionAnimation,Z as closeAllModals,j as closeModal,x as computeAvailableArea,q as computeCssClasses,G as computeStyle,H as constrainDockPosition,J as constrainSizeToViewport,K as constrainToViewport,Q as consumeOpenSourcePosition,X as consumePendingAttention,Y as consumePendingChildRestore,$ as consumePendingClose,aa as consumePendingForceClose,ea as consumePendingMinimize,sa as consumePendingMinimizeTarget,na as consumePendingMinimizeWithParent,ta as consumePendingOpen,ia as consumePendingParentAnimation,oa as consumePendingParentLink,la as consumePendingRestore,ra as containsFocus,da as createAnimationController,ca as createConfigHelper,ga as createConfigResolver,ma as createDragBehavior,ua as createEventEmitter,Ma as createFocusTrap,Pa as createModal,Ca as createModalController,Aa as createModalRegistration,pa as createResizeBehavior,Sa as defaultConfig,ha as endAttentionAnimation,Ta as finalizeChildMinimize,Ea as finalizeModalClose,fa as findChildModalElement,Ia as findParentModalElement,Ra as findRootAncestor,Da as flipAnimate,ka as focusFirstElement,Oa as focusLastElement,za as getAncestorIds,La as getBackdropConfig,ba as getConfig,Fa as getConfigVersion,Ba as getDefaultDockTarget,ya as getDescendantIds,_a as getDockClasses,Na as getDockContainerClasses,va as getDockItemElement,Ua as getDockItemPosition,Va as getDockOrder,Wa as getDuration,wa as getEasing,Za as getElementBounds,ja as getFocusableElements,xa as getLayerZIndex,qa as getMinimizedModals,Ga as getModalBounds,Ha as getModalLayoutInfos,Ja as getModalState,Ka as getModalsStore,Qa as getModalsToClose,Xa as getOpenModalBounds,Ya as getOpenModalBoundsWithIds,$a as getOpenSourcePosition,ae as getPendingParentAnimation,ee as getPendingParentLink,se as getStateVersion,ne as handleWindowResize,te as hasOpenModals,ie as hasPendingAttention,oe as hasPendingChildRestore,le as hasPendingClose,re as hasPendingForceClose,de as hasPendingMinimize,ce as hasPendingMinimizeWithParent,ge as hasPendingOpen,me as hasPendingParentAnimation,ue as hasPendingParentLinkFor,Me as hasPendingRestore,Pe as hideChildWithParent,Ce as initializeResizeListener,Ae as initializeStacking,pe as isBackdropEnabled,Se as isFeatureEnabled,he as isModalAnimating,Te as isModalOpen,Ee as isModalRegistered,fe as isTopModal,Ie as linkModals,Re as mergeConfig,De as minimizeModal,ke as normalizeBackdropConfig,Oe as onAnimationEnd,ze as openChildModal,Le as openModal,be as registerModal,Fe as reorderDock,Be as resetConfig,ye as resetModalTransparency,_e as resetStacking,Ne as restoreAllMinimizedModals,ve as restoreChildModal,Ue as restoreModal,Ve as setConfig,We as setDockPositionGetterInternal,we as setModalAnimating,Ze as setRegistryCallbacksInternal,je as setRegistryFunctions,xe as setURLCallbacks,qe as setURLStateCallbacks,Ge as setupAnimationEndListener,He as shakeElement,Je as shouldChildBeVisible,Ke as startAttentionAnimation,Qe as storeOpenSourcePosition,Xe as subscribe,Ye as subscribeToConfig,$e as toDataId,as as toggleModalTransparency,es as transformToCSSVars,ss as trapFocus,ns as triggerAttention,ts as triggerCascadingParentAnimations,is as triggerRearrangement,os as triggerRejection,ls as unhideChildModal,rs as unregisterModal,ds as updateModal,cs as updateModalPosition,gs as updateModalSize,ms as whenHasDimensions};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
|
2
|
-
import { ModalLibraryConfig } from '
|
|
2
|
+
import { ModalLibraryConfig } from '../../core/config';
|
|
3
3
|
export interface ModalProviderProps {
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
config?: Partial<ModalLibraryConfig>;
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
children?: ReactNode;
|
|
8
8
|
}
|
|
9
|
-
export declare function ModalProvider({ config: configOverride, children }: ModalProviderProps): React.FunctionComponentElement<React.
|
|
10
|
-
export default ModalProvider;
|
|
9
|
+
export declare function ModalProvider({ config: configOverride, children }: ModalProviderProps): React.FunctionComponentElement<React.ProviderProps<Partial<ModalLibraryConfig> | undefined>>;
|
|
11
10
|
//# sourceMappingURL=ModalProvider.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface PortalProps {
|
|
3
|
+
|
|
4
|
+
target?: HTMLElement | string;
|
|
5
|
+
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export declare function Portal({ target, children }: PortalProps): import('react').ReactPortal;
|
|
10
|
+
//# sourceMappingURL=Portal.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface DockProps {
|
|
3
|
+
|
|
4
|
+
renderIcon?: (icon: string) => ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare function Dock({ renderIcon: renderIconProp }: DockProps): import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
//# sourceMappingURL=Dock.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ModalState } from '../../../core/types';
|
|
3
|
+
export interface DockItemProps {
|
|
4
|
+
|
|
5
|
+
modal: ModalState;
|
|
6
|
+
|
|
7
|
+
childModal?: ModalState | null;
|
|
8
|
+
|
|
9
|
+
labelMode?: 'beside' | 'below' | 'hidden';
|
|
10
|
+
|
|
11
|
+
renderIcon?: (icon: string) => ReactNode;
|
|
12
|
+
|
|
13
|
+
animationDelay?: number;
|
|
14
|
+
}
|
|
15
|
+
export declare function DockItem({ modal, childModal, labelMode, renderIcon: renderIconProp, animationDelay, }: DockItemProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=DockItem.d.ts.map
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { BaseModalProps } from '
|
|
2
|
+
import { BaseModalProps } from '../../../core/types';
|
|
3
3
|
export interface ModalProps extends BaseModalProps {
|
|
4
4
|
children?: ReactNode;
|
|
5
5
|
footer?: ReactNode;
|
|
6
|
+
|
|
7
|
+
renderIcon?: () => ReactNode;
|
|
6
8
|
}
|
|
7
|
-
export declare function Modal({ id, title, icon, maxWidth, preferredHeight, autoOpen, glow, config, closeOnEscape, onClose, children, footer, }: ModalProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export default Modal;
|
|
9
|
+
export declare function Modal({ id, title, icon, maxWidth, preferredHeight, autoOpen, glow, config, closeOnEscape, onClose, children, footer, renderIcon, }: ModalProps): import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
//# sourceMappingURL=Modal.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { ModalHeaderBaseProps } from '../../../core/types';
|
|
3
|
+
export interface ModalHeaderProps extends ModalHeaderBaseProps {
|
|
4
|
+
|
|
5
|
+
customIcon?: ReactNode;
|
|
6
|
+
onStartDrag?: (e: React.PointerEvent) => void;
|
|
7
|
+
onToggleStyle: () => void;
|
|
8
|
+
onMinimize: () => void;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export declare function ModalHeader({ title, customIcon, icon, isTransparent, titleId, headerLayout, onStartDrag, onToggleStyle, onMinimize, onClose, minimizable, minimizeDisabled, transparencyEnabled, }: ModalHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=ModalHeader.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BaseModalProps } from '../../../core/types';
|
|
3
|
+
import { ModalLibraryConfig } from '../../../core/config';
|
|
4
|
+
export interface ModalInnerProps extends BaseModalProps {
|
|
5
|
+
|
|
6
|
+
renderIcon?: () => ReactNode;
|
|
7
|
+
|
|
8
|
+
providerConfig?: Partial<ModalLibraryConfig>;
|
|
9
|
+
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
|
|
12
|
+
footer?: ReactNode;
|
|
13
|
+
|
|
14
|
+
skipRegistration?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function ModalInner({ id, title, renderIcon, icon, description, maxWidth, preferredHeight, autoOpen, openSourcePosition: propOpenSourcePosition, glow, config: modalConfig, providerConfig: propProviderConfig, closeOnEscape, onClose, children, footer, skipRegistration, }: ModalInnerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
17
|
+
//# sourceMappingURL=ModalInner.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ResizeDirection } from '../../../core/behaviors/resize';
|
|
3
|
+
export interface ResizeHandlesProps {
|
|
4
|
+
|
|
5
|
+
onStartResize?: (e: React.PointerEvent, direction: ResizeDirection) => void;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export declare function ResizeHandles({ onStartResize }: ResizeHandlesProps): import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
//# sourceMappingURL=ResizeHandles.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ModalProps } from '../modal/Modal';
|
|
3
|
+
|
|
4
|
+
export interface WizardControls {
|
|
5
|
+
currentStep: number;
|
|
6
|
+
totalSteps: number;
|
|
7
|
+
isFirstStep: boolean;
|
|
8
|
+
isLastStep: boolean;
|
|
9
|
+
canProceed: boolean;
|
|
10
|
+
progress: number;
|
|
11
|
+
steps: Array<{
|
|
12
|
+
title: string;
|
|
13
|
+
}>;
|
|
14
|
+
next: () => void;
|
|
15
|
+
back: () => void;
|
|
16
|
+
goToStep: (index: number) => void;
|
|
17
|
+
}
|
|
18
|
+
export interface WizardModalProps extends Omit<ModalProps, 'children' | 'footer'> {
|
|
19
|
+
|
|
20
|
+
onComplete?: () => void;
|
|
21
|
+
|
|
22
|
+
onStepChange?: (step: number, direction: 'forward' | 'backward') => void;
|
|
23
|
+
|
|
24
|
+
footer?: (controls: WizardControls) => ReactNode;
|
|
25
|
+
|
|
26
|
+
showProgress?: boolean;
|
|
27
|
+
|
|
28
|
+
showNavigation?: boolean;
|
|
29
|
+
|
|
30
|
+
children?: ReactNode;
|
|
31
|
+
}
|
|
32
|
+
export declare function WizardModal({ id, onComplete, onStepChange, footer, showProgress, showNavigation, maxWidth, children, onClose, ...modalProps }: WizardModalProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
//# sourceMappingURL=WizardModal.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface WizardStepProps {
|
|
3
|
+
|
|
4
|
+
title?: string;
|
|
5
|
+
|
|
6
|
+
canProceed?: boolean;
|
|
7
|
+
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export declare function WizardStep({ children }: WizardStepProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare namespace WizardStep {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=WizardStep.d.ts.map
|
package/dist/react/context.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ModalLibraryConfig } from '../core/config';
|
|
3
|
+
|
|
4
|
+
export declare const ModalIdContext: import('react').Context<string | null>;
|
|
5
|
+
|
|
6
|
+
export declare const ModalProviderConfigContext: import('react').Context<Partial<ModalLibraryConfig> | undefined>;
|
|
7
|
+
|
|
8
|
+
type RenderIconFn = (iconName: string) => ReactNode;
|
|
9
|
+
export declare const RenderIconContext: import('react').Context<RenderIconFn | undefined>;
|
|
10
|
+
export {};
|
|
4
11
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ModalLibraryConfig, ModalFeatures, AppearanceConfig, AnimationDurations, PositioningConfig, ParentChildConfig, PartialModalLibraryConfig } from '../../core/config';
|
|
2
|
+
import { ModalConfigOverrides } from '../../core/types';
|
|
3
|
+
export interface UseModalConfigOptions {
|
|
4
|
+
|
|
5
|
+
modalConfig?: ModalConfigOverrides;
|
|
6
|
+
}
|
|
7
|
+
export interface UseModalConfigReturn {
|
|
8
|
+
|
|
9
|
+
getEffectiveConfig: () => ModalLibraryConfig;
|
|
10
|
+
|
|
11
|
+
isFeatureEnabled: (feature: keyof ModalFeatures) => boolean;
|
|
12
|
+
|
|
13
|
+
getAppearance: <K extends keyof AppearanceConfig>(key: K) => AppearanceConfig[K];
|
|
14
|
+
|
|
15
|
+
getAnimation: <K extends keyof AnimationDurations>(key: K) => AnimationDurations[K];
|
|
16
|
+
|
|
17
|
+
getPositioning: <K extends keyof PositioningConfig>(key: K) => PositioningConfig[K];
|
|
18
|
+
|
|
19
|
+
getParentChild: <K extends keyof ParentChildConfig>(key: K) => ParentChildConfig[K];
|
|
20
|
+
|
|
21
|
+
providerConfig: PartialModalLibraryConfig | undefined;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export declare function useModalConfig(options?: UseModalConfigOptions): UseModalConfigReturn;
|
|
25
|
+
//# sourceMappingURL=useConfig.d.ts.map
|
package/dist/react/useModal.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { ModalId } from '../core/types';
|
|
2
|
-
|
|
3
|
-
* React hook for controlling a specific modal
|
|
4
|
-
*/
|
|
2
|
+
|
|
5
3
|
export declare function useModal(id: ModalId): {
|
|
6
4
|
open: (sourceElement: HTMLElement) => void;
|
|
7
5
|
close: () => void;
|
|
@@ -19,9 +17,7 @@ interface ModalsSnapshot {
|
|
|
19
17
|
minimizedCount: number;
|
|
20
18
|
openCount: number;
|
|
21
19
|
}
|
|
22
|
-
|
|
23
|
-
* React hook for accessing all modals state
|
|
24
|
-
*/
|
|
20
|
+
|
|
25
21
|
export declare function useModals(): ModalsSnapshot;
|
|
26
|
-
export
|
|
22
|
+
export {};
|
|
27
23
|
//# sourceMappingURL=useModal.d.ts.map
|
package/dist/react.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
export { Modal } from './react/Modal';
|
|
2
|
-
export type { ModalProps } from './react/Modal';
|
|
3
|
-
export {
|
|
4
|
-
export type {
|
|
5
|
-
export {
|
|
6
|
-
export type {
|
|
1
|
+
export { Modal } from './react/components/modal/Modal';
|
|
2
|
+
export type { ModalProps } from './react/components/modal/Modal';
|
|
3
|
+
export { WizardModal } from './react/components/wizard/WizardModal';
|
|
4
|
+
export type { WizardModalProps } from './react/components/wizard/WizardModal';
|
|
5
|
+
export { WizardStep } from './react/components/wizard/WizardStep';
|
|
6
|
+
export type { WizardStepProps } from './react/components/wizard/WizardStep';
|
|
7
|
+
export { ModalProvider } from './react/components/ModalProvider';
|
|
8
|
+
export type { ModalProviderProps } from './react/components/ModalProvider';
|
|
9
|
+
export { Dock } from './react/components/dock/Dock';
|
|
10
|
+
export type { DockProps } from './react/components/dock/Dock';
|
|
7
11
|
export { useModal, useModals } from './react/useModal';
|
|
8
12
|
//# sourceMappingURL=react.d.ts.map
|