epic-modals 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react.d.ts +0 -2
- package/dist/react.js +1 -1
- package/dist/runtime.js +1 -1
- package/dist/vanilla.js +1 -1
- package/package.json +1 -1
package/dist/react.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export { openModal, closeModal, closeAllModals, minimizeModal, restoreModal, openChildModal, bringToFront, isModalOpen, isModalRegistered, toggleModalTransparency, } from './core/state.svelte';
|
|
2
|
-
export { getConfig, setConfig } from './core/config.svelte';
|
|
3
1
|
export { Modal } from './react/Modal';
|
|
4
2
|
export type { ModalProps } from './react/Modal';
|
|
5
3
|
export { ModalProvider } from './react/ModalProvider';
|
package/dist/react.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsxs as e,Fragment as n,jsx as t}from"react/jsx-runtime";import r,{useRef as i,useState as o,useEffect as l,useCallback as s,useSyncExternalStore as u}from"react";import{createPortal as c}from"react-dom";import{r as d,u as a,m,M as p,a as f,t as g,s as h,i as y,g as z,b as v,c as C,D as E,d as M,o as b,e as O,f as k,h as w,j as x,k as j,l as T,n as F,p as H}from"./runtime.js";function R({id:r,title:s,icon:u,maxWidth:h="600px",preferredHeight:y,autoOpen:z=!1,glow:v,config:C,closeOnEscape:E=!0,onClose:M,children:b,footer:O}){const k=i(null),w=i(null),x=i(null),j=i(null),[T,F]=o(!1),[H,R]=o(!1);l(()=>(d({id:r,title:s,icon:u??"",isOpen:z,isMinimized:!1,isHiddenWithParent:!1,isTransparent:!1,isRejected:!1,position:null,size:null,hasBeenDragged:!1,dockPosition:0,glow:v??null}),F(!0),()=>{a(r)}),[r]),l(()=>{if(!T||!k.current)return;const e=b?(x.current||"undefined"==typeof document||(x.current=document.createElement("div"),x.current.className="react-modal-body-content"),x.current):null,n=O?(j.current||"undefined"==typeof document||(j.current=document.createElement("div"),j.current.className="react-modal-footer-content"),j.current):null;return w.current=m(p,{target:k.current,props:{id:r,title:s,icon:u??"",maxWidth:h,preferredHeight:y,closeOnEscape:E,onClose:M,bodyElement:e,footerElement:n}}),R(!0),()=>{w.current&&(f(w.current),w.current=null,R(!1)),x.current=null,j.current=null}},[T,r]);const W=g(r),D=H?x.current:null,N=H?j.current:null;return e(n,{children:[t("div",{ref:k,"data-modal-bridge":W,style:{display:"contents"}}),D&&b&&c(b,D),N&&O&&c(O,N)]})}function W({config:e,children:n}){return l(()=>{e&&h(e),y();const n=z().portalTarget;let t=null;return"string"==typeof n&&"undefined"!=typeof document&&(document.querySelector(n)||(t=document.createElement("div"),t.id=n.replace("#",""),document.body.appendChild(t))),()=>{v(),C(),t&&t.remove()}},[e]),r.createElement(r.Fragment,null,n)}function D({renderIcon:e}){const n=i(null),r=i(null);return l(()=>{if(n.current)return r.current=m(E,{target:n.current,props:{}}),()=>{r.current&&(f(r.current),r.current=null)}},[]),t("div",{ref:n,"data-dock-bridge":"true",style:{display:"contents"}})}function N(e,n){if(!H(e))throw new Error(`Cannot call ${n}() on unregistered modal "${String(e)}". Ensure the Modal component is rendered.`)}const P=new Map;function S(e){const n=s(()=>function(e){const n=F().modals.get(e),t=void 0!==n&&!n.isMinimized,r=(null==n?void 0:n.isMinimized)??!1,i=void 0!==n,o=P.get(e);if(o&&o.isOpen===t&&o.isMinimized===r&&o.isRegistered===i)return o;const l={isOpen:t,isMinimized:r,isRegistered:i};return P.set(e,l),l}(e),[e]);return{...u(M,n,n),open:s(n=>{N(e,"open"),b(e,n)},[e]),close:s(()=>{N(e,"close"),O(e)},[e]),minimize:s(()=>{N(e,"minimize"),k(e)},[e]),restore:s(()=>{N(e,"restore"),w(e)},[e]),openChild:s((n,t)=>{N(e,"openChild"),x({id:n},e,t)},[e]),shake:s(()=>{N(e,"shake"),j(e)},[e]),bringToFront:s(()=>{N(e,"bringToFront"),T(e)},[e])}}let $=null;function q(){const e=F(),n=Array.from(e.modals.values()),t=n.filter(e=>e.isMinimized).length,r=n.filter(e=>!e.isMinimized).length;return $&&$.modals===e.modals&&$.minimizedCount===t&&$.openCount===r||($={modals:e.modals,minimizedCount:t,openCount:r}),$}function A(){return u(M,q,q)}export{D as Dock,R as Modal,W as ModalProvider,S as useModal,A as useModals};
|
package/dist/runtime.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var t,e,n,i,r,o,s,a,l,d,u,c,f,h,p,v,g,m,w,y,x,b,M,z,k,I,_,P,D,C,S,O,E,W,T,B,R,A,L,H,$,F,q=Object.defineProperty,j=t=>{throw TypeError(t)},X=(t,e,n)=>((t,e,n)=>e in t?q(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n)(t,"symbol"!=typeof e?e+"":e,n),Y=(t,e,n)=>e.has(t)||j("Cannot "+n),N=(t,e,n)=>(Y(t,e,"read from private field"),n?n.call(t):e.get(t)),K=(t,e,n)=>e.has(t)?j("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),G=(t,e,n,i)=>(Y(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n),V=(t,e,n)=>(Y(t,e,"access private method"),n);const U=Symbol();var Q=Array.isArray,J=Array.prototype.indexOf,Z=Array.from,tt=Object.defineProperty,et=Object.getOwnPropertyDescriptor,nt=Object.getOwnPropertyDescriptors,it=Object.prototype,rt=Array.prototype,ot=Object.getPrototypeOf,st=Object.isExtensible;const at=()=>{};function lt(){var t,e;return{promise:new Promise((n,i)=>{t=n,e=i}),resolve:t,reject:e}}const dt=16,ut=512,ct=1024,ft=2048,ht=4096,pt=8192,vt=16384,gt=32768,mt=65536,wt=1<<18,yt=1<<19,xt=1<<25,bt=32768,Mt=1<<21,zt=1<<23,kt=Symbol("$state"),It=Symbol(""),_t=new class extends Error{constructor(){super(...arguments),X(this,"name","StaleReactionError"),X(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function Pt(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Dt(t){return t===this.v}function Ct(t,e){return t!=t?e==e:t!==e||null!==t&&"object"==typeof t||"function"==typeof t}function St(t){return!Ct(t,this.v)}let Ot=null;function Et(t){Ot=t}function Wt(t){return Rt().get(t)}function Tt(t,e=!1,n){Ot={p:Ot,i:!1,c:null,e:null,s:t,x:null,l:null}}function Bt(t){var e=Ot,n=e.e;if(null!==n)for(var i of(e.e=null,n))$e(i);return void 0!==t&&(e.x=t),e.i=!0,Ot=e.p,t??{}}function Rt(t){return null===Ot&&Pt(),Ot.c??(Ot.c=new Map(function(){let t=Ot.p;for(;null!==t;){const e=t.c;if(null!==e)return e;t=t.p}return null}()||void 0))}let At=[];function Lt(){var t=At;At=[],function(t){for(var e=0;e<t.length;e++)t[e]()}(t)}function Ht(t){if(0===At.length&&!Vt){var e=At;queueMicrotask(()=>{e===At&&Lt()})}At.push(t)}function $t(){for(;At.length>0;)Lt()}function Ft(t){var e=dn;if(null===e)return sn.f|=zt,t;if(0===(e.f>)){if(!(128&e.f))throw t;e.b.error(t)}else qt(t,e)}function qt(t,e){for(;null!==e;){if(128&e.f)try{return void e.b.error(t)}catch(e){t=e}e=e.parent}throw t}const jt=new Set;let Xt=null,Yt=null,Nt=[],Kt=null,Gt=!1,Vt=!1;t=new WeakMap,e=new WeakMap,n=new WeakMap,i=new WeakMap,r=new WeakMap,o=new WeakMap,s=new WeakMap,a=new WeakSet,l=function(t,e){var n;t.f^=ct;for(var i=t.first;null!==i;){var r=i.f,s=!!(96&r),l=s&&0!==(r&ct)||0!==(r&pt)||this.skipped_effects.has(i);if(!!(128&i.f)&&(null==(n=i.b)?void 0:n.is_pending())&&(e={parent:e,effect:i,effects:[],render_effects:[]}),!l&&null!==i.fn){s?i.f^=ct:4&r?e.effects.push(i):bn(i)&&(0!==(i.f&dt)&&N(this,o).add(i),_n(i));var u=i.first;if(null!==u){i=u;continue}}var c=i.parent;for(i=i.next;null===i&&null!==c;)c===e.effect&&(V(this,a,d).call(this,e.effects),V(this,a,d).call(this,e.render_effects),e=e.parent),i=c.next,c=c.parent}},d=function(t){for(const e of t)0!==(e.f&ft)?N(this,o).add(e):0!==(e.f&ht)&&N(this,s).add(e),V(this,a,u).call(this,e.deps),Wn(e,ct)},u=function(t){if(null!==t)for(const e of t)2&e.f&&0!==(e.f&bt)&&(e.f^=bt,V(this,a,u).call(this,e.deps))},c=function(){if(0===N(this,i)){for(const e of N(this,t))e();N(this,t).clear()}0===N(this,n)&&V(this,a,f).call(this)},f=function(){var t;if(jt.size>1){this.previous.clear();var e=Yt,n=!0,i={parent:null,effect:null,effects:[],render_effects:[]};for(const e of jt){if(e===this){n=!1;continue}const o=[];for(const[t,i]of this.current){if(e.current.has(t)){if(!n||i===e.current.get(t))continue;e.current.set(t,i)}o.push(t)}if(0===o.length)continue;const s=[...e.current.keys()].filter(t=>!this.current.has(t));if(s.length>0){var r=Nt;Nt=[];const n=new Set,d=new Map;for(const t of o)ee(t,s,n,d);if(Nt.length>0){Xt=e,e.apply();for(const n of Nt)V(t=e,a,l).call(t,n,i);e.deactivate()}Nt=r}}Xt=null,Yt=e}this.committed=!0,jt.delete(this)};let Ut=class u{constructor(){K(this,a),X(this,"committed",!1),X(this,"current",new Map),X(this,"previous",new Map),K(this,t,new Set),K(this,e,new Set),K(this,n,0),K(this,i,0),K(this,r,null),K(this,o,new Set),K(this,s,new Set),X(this,"skipped_effects",new Set),X(this,"is_fork",!1)}is_deferred(){return this.is_fork||N(this,i)>0}process(t){var e;Nt=[],this.apply();var n={parent:null,effect:null,effects:[],render_effects:[]};for(const e of t)V(this,a,l).call(this,e,n);this.is_fork||V(this,a,c).call(this),this.is_deferred()?(V(this,a,d).call(this,n.effects),V(this,a,d).call(this,n.render_effects)):(Xt=null,te(n.render_effects),te(n.effects),null==(e=N(this,r))||e.resolve()),Yt=null}capture(t,e){this.previous.has(t)||this.previous.set(t,e),0===(t.f&zt)&&(this.current.set(t,t.v),null==Yt||Yt.set(t,t.v))}activate(){Xt=this,this.apply()}deactivate(){Xt===this&&(Xt=null,Yt=null)}flush(){if(this.activate(),Nt.length>0){if(Qt(),null!==Xt&&Xt!==this)return}else 0===N(this,n)&&this.process([]);this.deactivate()}discard(){for(const t of N(this,e))t(this);N(this,e).clear()}increment(t){G(this,n,N(this,n)+1),t&&G(this,i,N(this,i)+1)}decrement(t){G(this,n,N(this,n)-1),t&&G(this,i,N(this,i)-1),this.revive()}revive(){for(const t of N(this,o))N(this,s).delete(t),Wn(t,ft),ie(t);for(const t of N(this,s))Wn(t,ht),ie(t);this.flush()}oncommit(e){N(this,t).add(e)}ondiscard(t){N(this,e).add(t)}settled(){return(N(this,r)??G(this,r,lt())).promise}static ensure(){if(null===Xt){const t=Xt=new u;jt.add(Xt),Vt||u.enqueue(()=>{Xt===t&&t.flush()})}return Xt}static enqueue(t){Ht(t)}apply(){}};function Qt(){var t=en;Gt=!0;try{var e=0;for(nn(!0);Nt.length>0;){var n=Ut.ensure();e++>1e3&&Jt(),n.process(Nt),pe.clear()}}finally{Gt=!1,nn(t),Kt=null}}function Jt(){try{!function(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}()}catch(t){qt(t,Kt)}}let Zt=null;function te(t){var e=t.length;if(0!==e){for(var n=0;n<e;){var i=t[n++];if(!(24576&i.f)&&bn(i)&&(Zt=new Set,_n(i),null===i.deps&&null===i.first&&null===i.nodes&&(null===i.teardown&&null===i.ac?Ve(i):i.fn=null),(null==Zt?void 0:Zt.size)>0)){pe.clear();for(const t of Zt){if(24576&t.f)continue;const e=[t];let n=t.parent;for(;null!==n;)Zt.has(n)&&(Zt.delete(n),e.push(n)),n=n.parent;for(let t=e.length-1;t>=0;t--){const n=e[t];24576&n.f||_n(n)}}Zt.clear()}}Zt=null}}function ee(t,e,n,i){if(!n.has(t)&&(n.add(t),null!==t.reactions))for(const r of t.reactions){const t=r.f;2&t?ee(r,e,n,i):4194320&t&&0===(t&ft)&&ne(r,e,i)&&(Wn(r,ft),ie(r))}}function ne(t,e,n){const i=n.get(t);if(void 0!==i)return i;if(null!==t.deps)for(const i of t.deps){if(e.includes(i))return!0;if(2&i.f&&ne(i,e,n))return n.set(i,!0),!0}return n.set(t,!1),!1}function ie(t){for(var e=Kt=t;null!==e.parent;){var n=(e=e.parent).f;if(Gt&&e===dn&&0!==(n&dt)&&0===(n&wt))return;if(96&n){if(0===(n&ct))return;e.f^=ct}}Nt.push(e)}class re{constructor(t,e,n){K(this,C),X(this,"parent"),K(this,h,!1),K(this,p),K(this,v,null),K(this,g),K(this,m),K(this,w),K(this,y,null),K(this,x,null),K(this,b,null),K(this,M,null),K(this,z,null),K(this,k,0),K(this,I,0),K(this,_,!1),K(this,P,null),K(this,D,function(t){let e,n=0,i=ge(0);return()=>{Ae()&&(Dn(i),qe(()=>(0===n&&(e=On(()=>t())),n+=1,()=>{Ht(()=>{n-=1,0===n&&(null==e||e(),e=void 0,Me(i))})})))}}(()=>(G(this,P,ge(N(this,k))),()=>{G(this,P,null)}))),G(this,p,t),G(this,g,e),G(this,m,n),this.parent=dn.b,G(this,h,!!N(this,g).pending),G(this,w,Xe(()=>{dn.b=this;var t=V(this,C,S).call(this);try{G(this,y,Ye(()=>n(t)))}catch(t){this.error(t)}return N(this,I)>0?V(this,C,E).call(this):G(this,h,!1),()=>{var t;null==(t=N(this,z))||t.remove()}},589952))}is_pending(){return N(this,h)||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!N(this,g).pending}update_pending_count(t){V(this,C,W).call(this,t),G(this,k,N(this,k)+t),N(this,P)&&xe(N(this,P),N(this,k))}get_effect_pending(){return N(this,D).call(this),Dn(N(this,P))}error(t){var e=N(this,g).onerror;let n=N(this,g).failed;if(N(this,_)||!e&&!n)throw t;N(this,y)&&(Ge(N(this,y)),G(this,y,null)),N(this,x)&&(Ge(N(this,x)),G(this,x,null)),N(this,b)&&(Ge(N(this,b)),G(this,b,null));var i=!1,r=!1;const o=()=>{i||(i=!0,r&&function(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}(),Ut.ensure(),G(this,k,0),null!==N(this,b)&&Ue(N(this,b),()=>{G(this,b,null)}),G(this,h,this.has_pending_snippet()),G(this,y,V(this,C,O).call(this,()=>(G(this,_,!1),Ye(()=>N(this,m).call(this,N(this,p)))))),N(this,I)>0?V(this,C,E).call(this):G(this,h,!1))};var s=sn;try{ln(null),r=!0,null==e||e(t,o),r=!1}catch(t){qt(t,N(this,w)&&N(this,w).parent)}finally{ln(s)}n&&Ht(()=>{G(this,b,V(this,C,O).call(this,()=>{Ut.ensure(),G(this,_,!0);try{return Ye(()=>{n(N(this,p),()=>t,()=>o)})}catch(t){return qt(t,N(this,w).parent),null}finally{G(this,_,!1)}}))})}}function oe(){un(null),ln(null),Et(null)}function se(t){var e=null!==sn&&2&sn.f?sn:null;return null!==dn&&(dn.f|=yt),{ctx:Ot,deps:null,effects:null,equals:Dt,f:2050,fn:t,reactions:null,rv:0,v:U,wv:0,parent:e??dn,ac:null}}function ae(t,e){let n=dn;null===n&&function(){throw new Error("https://svelte.dev/e/async_derived_orphan")}();var i=n.b,r=void 0,o=ge(U),s=!sn,a=new Map;return function(t){Re(4718592,t,!0)}(()=>{var e,n=lt();r=n.promise;try{Promise.resolve(t()).then(n.resolve,n.reject).then(()=>{l===Xt&&l.committed&&l.deactivate(),oe()})}catch(t){n.reject(t),oe()}var l=Xt;if(s){var d=!i.is_pending();i.update_pending_count(1),l.increment(d),null==(e=a.get(l))||e.reject(_t),a.delete(l),a.set(l,n)}const u=(t,e=void 0)=>{if(l.activate(),e)e!==_t&&(o.f|=zt,xe(o,e));else{0!==(o.f&zt)&&(o.f^=zt),xe(o,t);for(const[t,e]of a){if(a.delete(t),t===l)break;e.reject(_t)}}s&&(i.update_pending_count(-1),l.decrement(d))};n.promise.then(u,t=>u(null,t||"unknown"))}),Le(()=>{for(const t of a.values())t.reject(_t)}),new Promise(t=>{!function e(n){function i(){n===r?t(o):e(r)}n.then(i,i)}(r)})}function le(t){const e=se(t);return fn(e),e}function de(t){const e=se(t);return e.equals=St,e}function ue(t){var e=t.effects;if(null!==e){t.effects=null;for(var n=0;n<e.length;n+=1)Ge(e[n])}}function ce(t){var e,n=dn;un(function(t){for(var e=t.parent;null!==e;){if(!(2&e.f))return 0===(e.f&vt)?e:null;e=e.parent}return null}(t));try{t.f&=-32769,ue(t),e=zn(t)}finally{un(n)}return e}function fe(t){var e=ce(t);t.equals(e)||((null==Xt?void 0:Xt.is_fork)||(t.v=e),t.wv=xn()),rn||(null!==Yt?(Ae()||(null==Xt?void 0:Xt.is_fork))&&Yt.set(t,e):Wn(t,0===(t.f&ut)?ht:ct))}h=new WeakMap,p=new WeakMap,v=new WeakMap,g=new WeakMap,m=new WeakMap,w=new WeakMap,y=new WeakMap,x=new WeakMap,b=new WeakMap,M=new WeakMap,z=new WeakMap,k=new WeakMap,I=new WeakMap,_=new WeakMap,P=new WeakMap,D=new WeakMap,C=new WeakSet,S=function(){var t=N(this,p);return N(this,h)&&(G(this,z,Ce()),N(this,p).before(N(this,z)),t=N(this,z)),t},O=function(t){var e=dn,n=sn,i=Ot;un(N(this,w)),ln(N(this,w)),Et(N(this,w).ctx);try{return t()}catch(t){return Ft(t),null}finally{un(e),ln(n),Et(i)}},E=function(){const t=N(this,g).pending;null!==N(this,y)&&(G(this,M,document.createDocumentFragment()),N(this,M).append(N(this,z)),tn(N(this,y),N(this,M))),null===N(this,x)&&G(this,x,Ye(()=>t(N(this,p))))},W=function(t){var e;this.has_pending_snippet()?(G(this,I,N(this,I)+t),0===N(this,I)&&(G(this,h,!1),N(this,x)&&Ue(N(this,x),()=>{G(this,x,null)}),N(this,M)&&(N(this,p).before(N(this,M)),G(this,M,null)))):this.parent&&V(e=this.parent,C,W).call(e,t)};let he=new Set;const pe=new Map;let ve=!1;function ge(t,e){return{f:0,v:t,reactions:null,equals:Dt,rv:0,wv:0}}function me(t,e){const n=ge(t);return fn(n),n}function we(t,e=!1,n=!0){const i=ge(t);return e||(i.equals=St),i}function ye(t,e,n=!1){return null===sn||an&&!(131072&sn.f)||!(4325394&sn.f)||(null==cn?void 0:cn.includes(t))||function(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}(),xe(t,n?ke(e):e)}function xe(t,e){if(!t.equals(e)){var n=t.v;rn?pe.set(t,e):pe.set(t,n),t.v=e;var i=Ut.ensure();i.capture(t,n),2&t.f&&(0!==(t.f&ft)&&ce(t),Wn(t,0!==(t.f&ut)?ct:ht)),t.wv=xn(),ze(t,ft),null===dn||0===(dn.f&ct)||96&dn.f||(null===vn?function(t){vn=t}([t]):vn.push(t)),!i.is_fork&&he.size>0&&!ve&&function(){ve=!1;var t=en;nn(!0);const e=Array.from(he);try{for(const t of e)0!==(t.f&ct)&&Wn(t,ht),bn(t)&&_n(t)}finally{nn(t)}he.clear()}()}return e}function be(t,e=1){var n=Dn(t),i=1===e?n++:n--;return ye(t,n),i}function Me(t){ye(t,t.v+1)}function ze(t,e){var n=t.reactions;if(null!==n)for(var i=n.length,r=0;r<i;r++){var o=n[r],s=o.f,a=0===(s&ft);if(a&&Wn(o,e),2&s){var l=o;null==Yt||Yt.delete(l),0===(s&bt)&&(s&ut&&(o.f|=bt),ze(l,ht))}else a&&(0!==(s&dt)&&null!==Zt&&Zt.add(o),ie(o))}}function ke(t){if("object"!=typeof t||null===t||kt in t)return t;const e=ot(t);if(e!==it&&e!==rt)return t;var n=new Map,i=Q(t),r=me(0),o=wn,s=t=>{if(wn===o)return t();var e=sn,n=wn;ln(null),yn(o);var i=t();return ln(e),yn(n),i};return i&&n.set("length",me(t.length)),new Proxy(t,{defineProperty(t,e,i){"value"in i&&!1!==i.configurable&&!1!==i.enumerable&&!1!==i.writable||function(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}();var r=n.get(e);return void 0===r?r=s(()=>{var t=me(i.value);return n.set(e,t),t}):ye(r,i.value,!0),!0},deleteProperty(t,e){var i=n.get(e);if(void 0===i){if(e in t){const t=s(()=>me(U));n.set(e,t),Me(r)}}else ye(i,U),Me(r);return!0},get(e,i,r){var o;if(i===kt)return t;var a=n.get(i),l=i in e;if(void 0!==a||l&&!(null==(o=et(e,i))?void 0:o.writable)||(a=s(()=>me(ke(l?e[i]:U))),n.set(i,a)),void 0!==a){var d=Dn(a);return d===U?void 0:d}return Reflect.get(e,i,r)},getOwnPropertyDescriptor(t,e){var i=Reflect.getOwnPropertyDescriptor(t,e);if(i&&"value"in i){var r=n.get(e);r&&(i.value=Dn(r))}else if(void 0===i){var o=n.get(e),s=null==o?void 0:o.v;if(void 0!==o&&s!==U)return{enumerable:!0,configurable:!0,value:s,writable:!0}}return i},has(t,e){var i;if(e===kt)return!0;var r=n.get(e),o=void 0!==r&&r.v!==U||Reflect.has(t,e);return!((void 0!==r||null!==dn&&(!o||(null==(i=et(t,e))?void 0:i.writable)))&&(void 0===r&&(r=s(()=>me(o?ke(t[e]):U)),n.set(e,r)),Dn(r)===U))&&o},set(t,e,o,a){var l,d=n.get(e),u=e in t;if(i&&"length"===e)for(var c=o;c<d.v;c+=1){var f=n.get(c+"");void 0!==f?ye(f,U):c in t&&(f=s(()=>me(U)),n.set(c+"",f))}void 0===d?u&&!(null==(l=et(t,e))?void 0:l.writable)||(ye(d=s(()=>me(void 0)),ke(o)),n.set(e,d)):(u=d.v!==U,ye(d,s(()=>ke(o))));var h=Reflect.getOwnPropertyDescriptor(t,e);if((null==h?void 0:h.set)&&h.set.call(a,o),!u){if(i&&"string"==typeof e){var p=n.get("length"),v=Number(e);Number.isInteger(v)&&v>=p.v&&ye(p,v+1)}Me(r)}return!0},ownKeys(t){Dn(r);var e=Reflect.ownKeys(t).filter(t=>{var e=n.get(t);return void 0===e||e.v!==U});for(var[i,o]of n)o.v===U||i in t||e.push(i);return e},setPrototypeOf(){!function(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}()}})}var Ie,_e,Pe,De;function Ce(t=""){return document.createTextNode(t)}function Se(t){return Pe.call(t)}function Oe(t){return De.call(t)}function Ee(t,e){return Se(t)}function We(t,e=!1){var n=Se(t);return n instanceof Comment&&""===n.data?Oe(n):n}function Te(t,e=1,n=!1){let i=t;for(;e--;)i=Oe(i);return i}function Be(t){var e=sn,n=dn;ln(null),un(null);try{return t()}finally{ln(e),un(n)}}function Re(t,e,n){var i=dn;null!==i&&0!==(i.f&pt)&&(t|=pt);var r={ctx:Ot,deps:null,nodes:null,f:t|ft|ut,first:null,fn:e,last:null,next:null,parent:i,b:i&&i.b,prev:null,teardown:null,wv:0,ac:null};if(n)try{_n(r),r.f|=gt}catch(t){throw Ge(r),t}else null!==e&&ie(r);var o=r;if(n&&null===o.deps&&null===o.teardown&&null===o.nodes&&o.first===o.last&&0===(o.f&yt)&&(o=o.first,0!==(t&dt)&&0!==(t&mt)&&null!==o&&(o.f|=mt)),null!==o&&(o.parent=i,null!==i&&function(t,e){var n=e.last;null===n?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}(o,i),null!==sn&&2&sn.f&&!(64&t))){var s=sn;(s.effects??(s.effects=[])).push(o)}return r}function Ae(){return null!==sn&&!an}function Le(t){const e=Re(8,null,!1);return Wn(e,ct),e.teardown=t,e}function He(t){null===dn&&(null===sn&&function(){throw new Error("https://svelte.dev/e/effect_orphan")}(),function(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}()),rn&&function(){throw new Error("https://svelte.dev/e/effect_in_teardown")}();var e=dn.f;if(sn||!(32&e)||0!==(e>))return $e(t);var n=Ot;(n.e??(n.e=[])).push(t)}function $e(t){return Re(1048580,t,!1)}function Fe(t){return Re(4,t,!1)}function qe(t,e=0){return Re(8|e,t,!0)}function je(t,e=[],n=[],i=[]){!function(t,e,n,i){const r=se;if(0!==n.length||0!==t.length){var o,s,a,l,d=Xt,u=dn,c=(o=dn,s=sn,a=Ot,l=Xt,function(t=!0){un(o),ln(s),Et(a),t&&(null==l||l.activate())});t.length>0?Promise.all(t).then(()=>{c();try{return f()}finally{null==d||d.deactivate(),oe()}}):f()}else i(e.map(r));function f(){Promise.all(n.map(t=>ae(t))).then(t=>{c();try{i([...e.map(r),...t])}catch(t){0===(u.f&vt)&&qt(t,u)}null==d||d.deactivate(),oe()}).catch(t=>{qt(t,u)})}}(i,e,n,e=>{Re(8,()=>t(...e.map(Dn)),!0)})}function Xe(t,e=0){return Re(dt|e,t,!0)}function Ye(t){return Re(524320,t,!0)}function Ne(t){var e=t.teardown;if(null!==e){const t=rn,n=sn;on(!0),ln(null);try{e.call(null)}finally{on(t),ln(n)}}}function Ke(t,e=!1){var n=t.first;for(t.first=t.last=null;null!==n;){const t=n.ac;null!==t&&Be(()=>{t.abort(_t)});var i=n.next;64&n.f?n.parent=null:Ge(n,e),n=i}}function Ge(t,e=!0){var n=!1;!e&&0===(t.f&wt)||null===t.nodes||null===t.nodes.end||(function(t,e){for(;null!==t;){var n=t===e?null:Oe(t);t.remove(),t=n}}(t.nodes.start,t.nodes.end),n=!0),Ke(t,e&&!n),In(t,0),Wn(t,vt);var i=t.nodes&&t.nodes.t;if(null!==i)for(const t of i)t.stop();Ne(t);var r=t.parent;null!==r&&null!==r.first&&Ve(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=null}function Ve(t){var e=t.parent,n=t.prev,i=t.next;null!==n&&(n.next=i),null!==i&&(i.prev=n),null!==e&&(e.first===t&&(e.first=i),e.last===t&&(e.last=n))}function Ue(t,e,n=!0){var i=[];Qe(t,i,!0);var r=()=>{n&&Ge(t),e&&e()},o=i.length;if(o>0){var s=()=>--o||r();for(var a of i)a.out(s)}else r()}function Qe(t,e,n){if(0===(t.f&pt)){t.f^=pt;var i=t.nodes&&t.nodes.t;if(null!==i)for(const t of i)(t.is_global||n)&&e.push(t);for(var r=t.first;null!==r;){var o=r.next;Qe(r,e,!!(0!==(r.f&mt)||32&r.f&&0!==(t.f&dt))&&n),r=o}}}function Je(t){Ze(t,!0)}function Ze(t,e){if(0!==(t.f&pt)){t.f^=pt,0===(t.f&ct)&&(Wn(t,ft),ie(t));for(var n=t.first;null!==n;){var i=n.next;Ze(n,!!(0!==(n.f&mt)||32&n.f)&&e),n=i}var r=t.nodes&&t.nodes.t;if(null!==r)for(const t of r)(t.is_global||e)&&t.in()}}function tn(t,e){if(t.nodes)for(var n=t.nodes.start,i=t.nodes.end;null!==n;){var r=n===i?null:Oe(n);e.append(n),n=r}}let en=!1;function nn(t){en=t}let rn=!1;function on(t){rn=t}let sn=null,an=!1;function ln(t){sn=t}let dn=null;function un(t){dn=t}let cn=null;function fn(t){null!==sn&&(null===cn?cn=[t]:cn.push(t))}let hn=null,pn=0,vn=null,gn=1,mn=0,wn=mn;function yn(t){wn=t}function xn(){return++gn}function bn(t){var e=t.f;if(0!==(e&ft))return!0;if(2&e&&(t.f&=-32769),0!==(e&ht)){var n=t.deps;if(null!==n)for(var i=n.length,r=0;r<i;r++){var o=n[r];if(bn(o)&&fe(o),o.wv>t.wv)return!0}0!==(e&ut)&&null===Yt&&Wn(t,ct)}return!1}function Mn(t,e,n=!0){var i=t.reactions;if(null!==i&&!(null==cn?void 0:cn.includes(t)))for(var r=0;r<i.length;r++){var o=i[r];2&o.f?Mn(o,e,!1):e===o&&(n?Wn(o,ft):0!==(o.f&ct)&&Wn(o,ht),ie(o))}}function zn(t){var e,n=hn,i=pn,r=vn,o=sn,s=cn,a=Ot,l=an,d=wn,u=t.f;hn=null,pn=0,vn=null,sn=96&u?null:t,cn=null,Et(t.ctx),an=!1,wn=++mn,null!==t.ac&&(Be(()=>{t.ac.abort(_t)}),t.ac=null);try{t.f|=Mt;var c=(0,t.fn)(),f=t.deps;if(null!==hn){var h;if(In(t,pn),null!==f&&pn>0)for(f.length=pn+hn.length,h=0;h<hn.length;h++)f[pn+h]=hn[h];else t.deps=f=hn;if(Ae()&&0!==(t.f&ut))for(h=pn;h<f.length;h++)((e=f[h]).reactions??(e.reactions=[])).push(t)}else null!==f&&pn<f.length&&(In(t,pn),f.length=pn);if(!(null===vn||an||null===f||6146&t.f))for(h=0;h<vn.length;h++)Mn(vn[h],t);return null!==o&&o!==t&&(mn++,null!==vn&&(null===r?r=vn:r.push(...vn))),0!==(t.f&zt)&&(t.f^=zt),c}catch(t){return Ft(t)}finally{t.f^=Mt,hn=n,pn=i,vn=r,sn=o,cn=s,Et(a),an=l,wn=d}}function kn(t,e){let n=e.reactions;if(null!==n){var i=J.call(n,t);if(-1!==i){var r=n.length-1;0===r?n=e.reactions=null:(n[i]=n[r],n.pop())}}null===n&&2&e.f&&(null===hn||!hn.includes(e))&&(Wn(e,ht),0!==(e.f&ut)&&(e.f^=ut,e.f&=-32769),ue(e),In(e,0))}function In(t,e){var n=t.deps;if(null!==n)for(var i=e;i<n.length;i++)kn(t,n[i])}function _n(t){var e=t.f;if(0===(e&vt)){Wn(t,ct);var n=dn,i=en;dn=t,en=!0;try{16777232&e?function(t){for(var e=t.first;null!==e;){var n=e.next;!(32&e.f)&&Ge(e),e=n}}(t):Ke(t),Ne(t);var r=zn(t);t.teardown="function"==typeof r?r:null,t.wv=gn}finally{en=i,dn=n}}}async function Pn(){await Promise.resolve(),function(){var t=Vt;Vt=!0;try{for(;;){if($t(),0===Nt.length&&(null==Xt||Xt.flush(),0===Nt.length))return void(Kt=null);Qt()}}finally{Vt=t}}()}function Dn(t){var e=!!(2&t.f);if(!(null===sn||an||null!==dn&&0!==(dn.f&vt)||(null==cn?void 0:cn.includes(t)))){var n=sn.deps;if(0!==(sn.f&Mt))t.rv<mn&&(t.rv=mn,null===hn&&null!==n&&n[pn]===t?pn++:null===hn?hn=[t]:hn.includes(t)||hn.push(t));else{(sn.deps??(sn.deps=[])).push(t);var i=t.reactions;null===i?t.reactions=[sn]:i.includes(sn)||i.push(sn)}}if(rn){if(pe.has(t))return pe.get(t);if(e){var r=t,o=r.v;return(0===(r.f&ct)&&null!==r.reactions||Sn(r))&&(o=ce(r)),pe.set(r,o),o}}else e&&(!(null==Yt?void 0:Yt.has(t))||(null==Xt?void 0:Xt.is_fork)&&!Ae())&&(bn(r=t)&&fe(r),en&&Ae()&&0===(r.f&ut)&&Cn(r));if(null==Yt?void 0:Yt.has(t))return Yt.get(t);if(0!==(t.f&zt))throw t.v;return t.v}function Cn(t){if(null!==t.deps){t.f^=ut;for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),2&e.f&&0===(e.f&ut)&&Cn(e)}}function Sn(t){if(t.v===U)return!0;if(null===t.deps)return!1;for(const e of t.deps){if(pe.has(e))return!0;if(2&e.f&&Sn(e))return!0}return!1}function On(t){var e=an;try{return an=!0,t()}finally{an=e}}const En=-7169;function Wn(t,e){t.f=t.f&En|e}function Tn(t,e=new Set){if(!("object"!=typeof t||null===t||t instanceof EventTarget||e.has(t))){e.add(t),t instanceof Date&&t.getTime();for(let n in t)try{Tn(t[n],e)}catch(t){}const n=ot(t);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const e=nt(n);for(let n in e){const i=e[n].get;if(i)try{i.call(t)}catch(t){}}}}}const Bn=new Set,Rn=new Set;function An(t){for(var e=0;e<t.length;e++)Bn.add(t[e]);for(var n of Rn)n(t)}let Ln=null;function Hn(t){var e,n=this,i=n.ownerDocument,r=t.type,o=(null==(e=t.composedPath)?void 0:e.call(t))||[],s=o[0]||t.target;Ln=t;var a=0,l=Ln===t&&t.__root;if(l){var d=o.indexOf(l);if(-1!==d&&(n===document||n===window))return void(t.__root=n);var u=o.indexOf(n);if(-1===u)return;d<=u&&(a=d)}if((s=o[a]||t.target)!==n){tt(t,"currentTarget",{configurable:!0,get:()=>s||i});var c=sn,f=dn;ln(null),un(null);try{for(var h,p=[];null!==s;){var v=s.assignedSlot||s.parentNode||s.host||null;try{var g=s["__"+r];null==g||s.disabled&&t.target!==s||g.call(s,t)}catch(t){h?p.push(t):h=t}if(t.cancelBubble||v===n||null===v)break;s=v}if(h){for(let t of p)queueMicrotask(()=>{throw t});throw h}}finally{t.__root=n,delete t.currentTarget,ln(c),un(f)}}}function $n(t,e){var n=dn;null===n.nodes&&(n.nodes={start:t,end:e,a:null,t:null})}function Fn(t,e){var n,i=!!(1&e),r=!!(2&e),o=!t.startsWith("<!>");return()=>{var e,s;void 0===n&&(e=o?t:"<!>"+t,(s=document.createElement("template")).innerHTML=e.replaceAll("<!>","\x3c!----\x3e"),n=s.content,i||(n=Se(n)));var a=r||_e?document.importNode(n,!0):n.cloneNode(!0);return i?$n(Se(a),a.lastChild):$n(a,a),a}}function qn(){var t=document.createDocumentFragment(),e=document.createComment(""),n=Ce();return t.append(e,n),$n(e,n),t}function jn(t,e){null!==t&&t.before(e)}const Xn=["touchstart","touchmove"];function Yn(t){return Xn.includes(t)}let Nn=!0;function Kn(t,e){var n=null==e?"":"object"==typeof e?e+"":e;n!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=n,t.nodeValue=n+"")}function Gn(t,e){return function(t,{target:e,anchor:n,props:i={},events:r,context:o,intro:s=!0}){!function(){if(void 0===Ie){Ie=window,_e=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;Pe=et(e,"firstChild").get,De=et(e,"nextSibling").get,st(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),st(n)&&(n.__t=void 0)}}();var a=new Set,l=t=>{for(var n=0;n<t.length;n++){var i=t[n];if(!a.has(i)){a.add(i);var r=Yn(i);e.addEventListener(i,Hn,{passive:r});var o=Vn.get(i);void 0===o?(document.addEventListener(i,Hn,{passive:r}),Vn.set(i,1)):Vn.set(i,o+1)}}};l(Z(Bn)),Rn.add(l);var d=void 0,u=function(){Ut.ensure();const u=Re(524352,()=>{var u=n??e.appendChild(Ce());return new re(u,{pending:()=>{}},e=>{o&&(Tt({}),Ot.c=o),r&&(i.$$events=r),Nn=s,d=t(e,i)||{},Nn=!0,o&&Bt()}),()=>{var t;for(var i of a){e.removeEventListener(i,Hn);var r=Vn.get(i);0===--r?(document.removeEventListener(i,Hn),Vn.delete(i)):Vn.set(i,r)}Rn.delete(l),u!==n&&(null==(t=u.parentNode)||t.removeChild(u))}},!0);return(t={})=>new Promise(e=>{t.outro?Ue(u,()=>{Ge(u),e(void 0)}):(Ge(u),e(void 0))})}();return Un.set(d,u),d}(t,e)}const Vn=new Map;let Un=new WeakMap;function Qn(t,e){const n=Un.get(t);return n?(Un.delete(t),n(e)):Promise.resolve()}class Jn{constructor(t,e=!0){X(this,"anchor"),K(this,T,new Map),K(this,B,new Map),K(this,R,new Map),K(this,A,new Set),K(this,L,!0),K(this,H,()=>{var t=Xt;if(N(this,T).has(t)){var e=N(this,T).get(t),n=N(this,B).get(e);if(n)Je(n),N(this,A).delete(e);else{var i=N(this,R).get(e);i&&(N(this,B).set(e,i.effect),N(this,R).delete(e),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),n=i.effect)}for(const[e,n]of N(this,T)){if(N(this,T).delete(e),e===t)break;const i=N(this,R).get(n);i&&(Ge(i.effect),N(this,R).delete(n))}for(const[t,i]of N(this,B)){if(t===e||N(this,A).has(t))continue;const r=()=>{if(Array.from(N(this,T).values()).includes(t)){var e=document.createDocumentFragment();tn(i,e),e.append(Ce()),N(this,R).set(t,{effect:i,fragment:e})}else Ge(i);N(this,A).delete(t),N(this,B).delete(t)};N(this,L)||!n?(N(this,A).add(t),Ue(i,r,!1)):r()}}}),K(this,$,t=>{N(this,T).delete(t);const e=Array.from(N(this,T).values());for(const[t,n]of N(this,R))e.includes(t)||(Ge(n.effect),N(this,R).delete(t))}),this.anchor=t,G(this,L,e)}ensure(t,e){var n=Xt;!e||N(this,B).has(t)||N(this,R).has(t)||N(this,B).set(t,Ye(()=>e(this.anchor))),N(this,T).set(n,t),N(this,H).call(this)}}function Zn(t,e,...n){var i=new Jn(t);Xe(()=>{const t=e()??null;i.ensure(t,t&&(e=>t(e,...n)))},mt)}function ti(t){null===Ot&&Pt(),He(()=>{const e=On(t);if("function"==typeof e)return e})}function ei(t){null===Ot&&Pt(),ti(()=>()=>On(t))}function ni(t,e,n=!1){var i=new Jn(t);function r(t,e){i.ensure(t,e)}Xe(()=>{var t=!1;e((e,n=!0)=>{t=!0,r(n,e)}),t||r(!1,null)},n?mt:0)}function ii(t,e){return e}function ri(t,e=!0){for(var n=0;n<t.length;n++)Ge(t[n],e)}var oi;function si(t,e,n,i,r,o=null){var s=t,a=new Map;!(4&e)||(s=t.appendChild(Ce()));var l,d=null,u=de(()=>{var t=n();return Q(t)?t:null==t?[]:Z(t)}),c=!0,f={effect:Xe(()=>{for(var t=(l=Dn(u)).length,h=new Set,p=0;p<t;p+=1){var v=l[p],g=i(v,p),m=c?null:a.get(g);m?(m.v&&xe(m.v,v),m.i&&xe(m.i,p)):(m=ai(a,c?s:oi??(oi=Ce()),v,g,p,r,e,n),c||(m.e.f|=xt),a.set(g,m)),h.add(g)}0===t&&o&&!d&&(c?d=Ye(()=>o(s)):(d=Ye(()=>o(oi??(oi=Ce())))).f|=xt),c||(f.fallback=d,function(t,e,n,i,r){var o,s,a,l,d,u,c,f,h,p,v,g,m,w,y=!!(8&i),x=e.length,b=t.items,M=t.effect.first,z=null,k=[],I=[];if(y)for(w=0;w<x;w+=1)g=r(e[w],w),0===((m=b.get(g).e).f&xt)&&(null==(s=null==(o=m.nodes)?void 0:o.a)||s.measure(),(v??(v=new Set)).add(m));for(w=0;w<x;w+=1){if(g=r(e[w],w),m=b.get(g).e,null!==t.outrogroups)for(const e of t.outrogroups)e.pending.delete(m),e.done.delete(m);if(0!==(m.f&xt)){if(m.f^=xt,m!==M){var _=z?z.next:M;m===t.effect.last&&(t.effect.last=m.prev),m.prev&&(m.prev.next=m.next),m.next&&(m.next.prev=m.prev),di(t,z,m),di(t,m,_),li(m,_,n),k=[],I=[],M=(z=m).next;continue}li(m,null,n)}if(0!==(m.f&pt)&&(Je(m),y&&(null==(l=null==(a=m.nodes)?void 0:a.a)||l.unfix(),(v??(v=new Set)).delete(m))),m!==M){if(void 0!==p&&p.has(m)){if(k.length<I.length){var P,D=I[0];z=D.prev;var C=k[0],S=k[k.length-1];for(P=0;P<k.length;P+=1)li(k[P],D,n);for(P=0;P<I.length;P+=1)p.delete(I[P]);di(t,C.prev,S.next),di(t,z,C),di(t,S,D),M=D,z=S,w-=1,k=[],I=[]}else p.delete(m),li(m,M,n),di(t,m.prev,m.next),di(t,m,null===z?t.effect.first:z.next),di(t,z,m),z=m;continue}for(k=[],I=[];null!==M&&M!==m;)(p??(p=new Set)).add(M),I.push(M),M=M.next;if(null===M)continue}0===(m.f&xt)&&k.push(m),z=m,M=m.next}if(null!==t.outrogroups){for(const e of t.outrogroups)0===e.pending.size&&(ri(Z(e.done)),null==(d=t.outrogroups)||d.delete(e));0===t.outrogroups.size&&(t.outrogroups=null)}if(null!==M||void 0!==p){var O=[];if(void 0!==p)for(m of p)0===(m.f&pt)&&O.push(m);for(;null!==M;)0===(M.f&pt)&&M!==t.fallback&&O.push(M),M=M.next;var E=O.length;if(E>0){var W=4&i&&0===x?n:null;if(y){for(w=0;w<E;w+=1)null==(c=null==(u=O[w].nodes)?void 0:u.a)||c.measure();for(w=0;w<E;w+=1)null==(h=null==(f=O[w].nodes)?void 0:f.a)||h.fix()}!function(t,e,n){for(var i,r=e.length,o=e.length,s=0;s<r;s++){let n=e[s];Ue(n,()=>{if(i){if(i.pending.delete(n),i.done.add(n),0===i.pending.size){var e=t.outrogroups;ri(Z(i.done)),e.delete(i),0===e.size&&(t.outrogroups=null)}}else o-=1},!1)}if(0===o){var a=null!==n;if(a){var l=n,d=l.parentNode;d.textContent="",d.append(l),t.items.clear()}ri(e,!a)}else i={pending:new Set(e),done:new Set},(t.outrogroups??(t.outrogroups=new Set)).add(i)}(t,O,W)}}y&&Ht(()=>{var t,e;if(void 0!==v)for(m of v)null==(e=null==(t=m.nodes)?void 0:t.a)||e.apply()})}(f,l,s,e,i),null!==d&&(0===l.length?0===(d.f&xt)?Je(d):(d.f^=xt,li(d,null,s)):Ue(d,()=>{d=null}))),Dn(u)}),items:a,outrogroups:null,fallback:d};c=!1}function ai(t,e,n,i,r,o,s,a){var l=1&s?16&s?ge(n):we(n,!1,!1):null,d=2&s?ge(r):null;return{v:l,i:d,e:Ye(()=>(o(e,l??n,d??r,a),()=>{t.delete(i)}))}}function li(t,e,n){if(t.nodes)for(var i=t.nodes.start,r=t.nodes.end,o=e&&0===(e.f&xt)?e.nodes.start:n;null!==i;){var s=Oe(i);if(o.before(i),i===r)return;i=s}}function di(t,e,n){null===e?t.effect.first=n:e.next=n,null===n?t.effect.last=e:n.prev=e}T=new WeakMap,B=new WeakMap,R=new WeakMap,A=new WeakMap,L=new WeakMap,H=new WeakMap,$=new WeakMap;const ui={tick:t=>requestAnimationFrame(t),now:()=>performance.now(),tasks:new Set};function ci(){const t=ui.now();ui.tasks.forEach(e=>{e.c(t)||(ui.tasks.delete(e),e.f())}),0!==ui.tasks.size&&ui.tick(ci)}function fi(t,e){Be(()=>{t.dispatchEvent(new CustomEvent(e))})}function hi(t){if("float"===t)return"cssFloat";if("offset"===t)return"cssOffset";if(t.startsWith("--"))return t;const e=t.split("-");return 1===e.length?e[0]:e[0]+e.slice(1).map(t=>t[0].toUpperCase()+t.slice(1)).join("")}function pi(t){const e={},n=t.split(";");for(const t of n){const[n,i]=t.split(":");if(!n||void 0===i)break;e[hi(n.trim())]=i.trim()}return e}const vi=t=>t;function gi(t,e,n,i){var r,o,s,a,l=!!(4&t),d=e.inert,u=e.style.overflow;function c(){return Be(()=>o??(o=n()(e,(null==i?void 0:i())??{},{direction:"both"})))}var f={is_global:l,in(){e.inert=d,fi(e,"introstart"),s=mi(e,c(),a,1,()=>{fi(e,"introend"),null==s||s.abort(),s=o=void 0,e.style.overflow=u})},out(t){e.inert=!0,fi(e,"outrostart"),a=mi(e,c(),s,0,()=>{fi(e,"outroend"),null==t||t()})},stop:()=>{null==s||s.abort(),null==a||a.abort()}},h=dn;if(((r=h.nodes).t??(r.t=[])).push(f),Nn){var p=l;if(!p){for(var v=h.parent;v&&0!==(v.f&mt);)for(;(v=v.parent)&&0===(v.f&dt););p=!v||0!==(v.f>)}p&&Fe(()=>{On(()=>f.in())})}}function mi(t,e,n,i,r){var o=1===i;if("function"==typeof e){var s,a=!1;return Ht(()=>{if(!a){var l=e({direction:o?"in":"out"});s=mi(t,l,n,i,r)}}),{abort:()=>{a=!0,null==s||s.abort()},deactivate:()=>s.deactivate(),reset:()=>s.reset(),t:()=>s.t()}}if(null==n||n.deactivate(),!(null==e?void 0:e.duration))return r(),{abort:at,deactivate:at,reset:at,t:()=>i};const{delay:l=0,css:d,tick:u,easing:c=vi}=e;var f=[];if(o&&void 0===n&&(u&&u(0,1),d)){var h=pi(d(0,1));f.push(h,h)}var p=()=>1-i,v=t.animate(f,{duration:l,fill:"forwards"});return v.onfinish=()=>{v.cancel();var o=(null==n?void 0:n.t())??1-i;null==n||n.abort();var s=i-o,a=e.duration*Math.abs(s),l=[];if(a>0){var f=!1;if(d)for(var h=Math.ceil(a/(1e3/60)),g=0;g<=h;g+=1){var m=o+s*c(g/h),w=pi(d(m,1-m));l.push(w),f||(f="hidden"===w.overflow)}f&&(t.style.overflow="hidden"),p=()=>{var t=v.currentTime;return o+s*c(t/a)},u&&function(t){let e;0===ui.tasks.size&&ui.tick(ci),new Promise(n=>{ui.tasks.add(e={c:t,f:n})})}(()=>{if("running"!==v.playState)return!1;var t=p();return u(t,1-t),!0})}(v=t.animate(l,{duration:a,fill:"forwards"})).onfinish=()=>{p=()=>i,null==u||u(i,1-i),r()}},{abort:()=>{v&&(v.cancel(),v.effect=null,v.onfinish=at)},deactivate:()=>{r=at},reset:()=>{0===i&&(null==u||u(1,0))},t:()=>p()}}function wi(t,e,n){Fe(()=>{var i=On(()=>e(t,null==n?void 0:n())||{});if(n&&(null==i?void 0:i.update)){var r=!1,o={};qe(()=>{var t=n();!function(t){if("object"==typeof t&&t&&!(t instanceof EventTarget))if(kt in t)Tn(t);else if(!Array.isArray(t))for(let e in t){const n=t[e];"object"==typeof n&&n&&kt in n&&Tn(n)}}(t),r&&Ct(o,t)&&(o=t,i.update(t))}),r=!0}if(null==i?void 0:i.destroy)return()=>i.destroy()})}const yi=[..." \t\n\r\f \v\ufeff"];function xi(t,e=!1){var n=e?" !important;":";",i="";for(var r in t){var o=t[r];null!=o&&""!==o&&(i+=" "+r+": "+o+n)}return i}function bi(t){return"-"!==t[0]||"-"!==t[1]?t.toLowerCase():t}function Mi(t,e,n,i,r,o){var s=t.__className;if(s!==n||void 0===s){var a=function(t,e,n){var i=null==t?"":""+t;if(e&&(i=i?i+" "+e:e),n)for(var r in n)if(n[r])i=i?i+" "+r:r;else if(i.length)for(var o=r.length,s=0;(s=i.indexOf(r,s))>=0;){var a=s+o;0!==s&&!yi.includes(i[s-1])||a!==i.length&&!yi.includes(i[a])?s=a:i=(0===s?"":i.substring(0,s))+i.substring(a+1)}return""===i?null:i}(n,i,o);null==a?t.removeAttribute("class"):t.className=a,t.__className=n}else if(o&&r!==o)for(var l in o){var d=!!o[l];null!=r&&d===!!r[l]||t.classList.toggle(l,d)}return o}function zi(t,e={},n,i){for(var r in n){var o=n[r];e[r]!==o&&(null==n[r]?t.style.removeProperty(r):t.style.setProperty(r,o,i))}}function ki(t,e,n,i){if(t.__style!==e){var r=function(t,e){if(e){var n,i,r="";if(Array.isArray(e)?(n=e[0],i=e[1]):n=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var o=!1,s=0,a=!1,l=[];n&&l.push(...Object.keys(n).map(bi)),i&&l.push(...Object.keys(i).map(bi));var d=0,u=-1;const e=t.length;for(var c=0;c<e;c++){var f=t[c];if(a?"/"===f&&"*"===t[c-1]&&(a=!1):o?o===f&&(o=!1):"/"===f&&"*"===t[c+1]?a=!0:'"'===f||"'"===f?o=f:"("===f?s++:")"===f&&s--,!a&&!1===o&&0===s)if(":"===f&&-1===u)u=c;else if(";"===f||c===e-1){if(-1!==u){var h=bi(t.substring(d,u).trim());l.includes(h)||(";"!==f&&c++,r+=" "+t.substring(d,c).trim()+";")}d=c+1,u=-1}}}return n&&(r+=xi(n)),i&&(r+=xi(i,!0)),""===(r=r.trim())?null:r}return null==t?null:String(t)}(e,i);null==r?t.removeAttribute("style"):t.style.cssText=r,t.__style=e}else i&&(Array.isArray(i)?(zi(t,null==n?void 0:n[0],i[0]),zi(t,null==n?void 0:n[1],i[1],"important")):zi(t,n,i));return i}const Ii=Symbol("is custom element"),_i=Symbol("is html");function Pi(t,e,n,i){var r=function(t){return t.__attributes??(t.__attributes={[Ii]:t.nodeName.includes("-"),[_i]:"http://www.w3.org/1999/xhtml"===t.namespaceURI})}(t);r[e]!==(r[e]=n)&&("loading"===e&&(t[It]=n),null==n?t.removeAttribute(e):"string"!=typeof n&&function(t){var e,n=t.getAttribute("is")||t.nodeName,i=Di.get(n);if(i)return i;Di.set(n,i=[]);for(var r=t,o=Element.prototype;o!==r;){for(var s in e=nt(r))e[s].set&&i.push(s);r=ot(r)}return i}(t).includes(e)?t[e]=n:t.setAttribute(e,n))}var Di=new Map;function Ci(t,e){return t===e||(null==t?void 0:t[kt])===e}function Si(t={},e,n,i){return Fe(()=>{var i,r;return qe(()=>{i=r,r=[],On(()=>{t!==n(...r)&&(e(t,...r),i&&Ci(n(...i),t)&&e(null,...i))})}),()=>{Ht(()=>{r&&Ci(n(...r),t)&&e(null,...r)})}}),t}function Oi(t,e,n,i){var r=i,o=!0,s=()=>(o&&(o=!1,r=i),r);return void 0===t[e]&&void 0!==i&&s(),()=>{var n=t[e];return void 0===n?s():(o=!0,n)}}const Ei={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 Wi={...Ei},Ti=me(0);function Bi(){return Dn(Ti)}function Ri(){return Wi}function Ai(t){const e=Wi;var n,i;Wi={features:{...(n=Ei).features,...(i=t).features},dock:{...n.dock,...i.dock},animations:{...n.animations,...i.animations},appearance:{...n.appearance,...i.appearance},zIndex:{...n.zIndex,...i.zIndex},parentChild:{...n.parentChild,...i.parentChild},positioning:{...n.positioning,...i.positioning},portalTarget:i.portalTarget??n.portalTarget},be(Ti),e.features.dock&&!Wi.features.dock&&(Array.from(Qi.values()).filter(t=>t.isMinimized).map(t=>t.id).forEach(t=>{const e=Qi.get(t);if(e){Qi.set(t,{...e,isMinimized:!1,isOpen:!0}),ye(sr,[...Dn(sr),t],!0),kr(t);const n=e.lastChildId||e.childId;n&&br(n)}}),ye(gr,[],!0),tr())}function Li(){Wi={...Ei},be(Ti)}const Hi={BASE:0,DROPDOWN:100,STICKY:200,OVERLAY:300,MODAL:400,DOCK:8e3,TOAST:9e3};let $i=me(ke(Hi.MODAL));function Fi(){ye($i,Ri().zIndex.base,!0)}function qi(t){const e=Ri();return"MODAL"===t?e.zIndex.base:"DOCK"===t?e.zIndex.dock:"TOAST"===t?e.zIndex.toast:Hi[t]}function ji(){ye($i,Ri().zIndex.base,!0)}const Xi=8;function Yi(t,e,n,i,r={}){const{margin:o=Xi,allowPartialVisibility:s=!1}=r,a="undefined"!=typeof window?window.innerWidth:1920,l="undefined"!=typeof window?window.innerHeight:1080;let d,u,c,f;return s&&n>a-2*o?(d=40-n,u=a-40):(d=o,u=Math.max(o,a-n-o)),s&&i>l-2*o?(c=40-i,f=l-40):(c=o,f=Math.max(o,l-i-o)),{x:Math.max(d,Math.min(u,t)),y:Math.max(c,Math.min(f,e))}}function Ni(t,e,n,i,r={}){const{margin:o=Xi}=r,s=("undefined"!=typeof window?window.innerWidth:1920)-2*o,a=("undefined"!=typeof window?window.innerHeight:1080)-2*o,l=Math.min(n,s),d=Math.min(i,a),u=Yi(t,e,l,d,r);return{x:u.x,y:u.y,width:l,height:d}}function Ki(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 Gi(t,e,n,i,r,o){const s={x:t-o,y:e-o,width:n+2*o,height:i+2*o};let a=0;for(const t of r)a+=Ki(s,t);return a}function Vi(t,e,n,i,r,o,s){const a=(r-n)/2,l=(o-i)/2,d=a-s,u=l-s,c=Math.abs(t-a)/(d||1),f=Math.abs(e-l)/(u||1),h=Math.sqrt(c*c+f*f)/Math.SQRT2,p=50,v=t-s,g=r-n-s-t,m=e-s,w=o-i-s-e;let y=0;return v<p&&(y+=.3*(1-v/p)),g<p&&(y+=.3*(1-g/p)),m<p&&(y+=.2*(1-m/p)),w<p&&(y+=.2*(1-w/p)),Math.min(1,h+y)}function Ui(t){return"symbol"==typeof t?t.description??"symbol":t}let Qi=ke(new Map),Ji=me(0);const Zi=new Set;function tr(){be(Ji),queueMicrotask(()=>{Zi.forEach(t=>t())})}function er(t){return Zi.add(t),()=>Zi.delete(t)}let nr=me(ke([])),ir=me(ke([])),rr=me(ke([])),or=me(ke([])),sr=me(ke([])),ar=me(ke([])),lr=me(ke([])),dr=me(ke([])),ur=me(null),cr=ke(new Map),fr=me(null),hr=ke(new Map),pr=ke(new Set),vr=ke(new Set),gr=me(ke([]));function mr(t){const e=Qi.get(t.id),n=(null==e?void 0:e.zIndex)??function(){const t=Dn($i);return ye($i,Dn($i)+2),t}();e?Qi.set(t.id,{...e,title:t.title,icon:t.icon,glow:t.glow,zIndex:n}):Qi.set(t.id,{...t,zIndex:n,isAnimating:!1}),tr(),t.isMinimized&&!Dn(gr).includes(t.id)&&Dn(gr).push(t.id)}function wr(t){const e=Qi.get(t);if(e){if(ye(gr,Dn(gr).filter(e=>e!==t),!0),e.childId){const t=Qi.get(e.childId);t&&Qi.set(e.childId,{...t,parentId:void 0})}if(e.parentId){const t=Qi.get(e.parentId);t&&Qi.set(e.parentId,{...t,childId:void 0,lastChildId:e.id})}Qi.delete(t),tr(),vr.delete(t),pr.delete(t)}}function yr(t){const e=Qi.get(t);if(!e||e.isMinimized)return;if(Xr(t),e.parentId){const t=Qi.get(e.parentId);if(t&&!t.isMinimized)return void yr(e.parentId)}ye(nr,[...Dn(nr),t],!0),e.position&&e.size;const n=e.childId;Qi.set(t,{...e,isMinimized:!0,lastChildId:n}),tr(),Dn(gr).includes(t)||Dn(gr).push(t),e.childId&&function(t){const e=Qi.get(t);if(!(null==e?void 0:e.childId))return;const n=Qi.get(e.childId);n&&(Qi.set(e.childId,{...n,isHiddenWithParent:!0}),tr())}(t)}function xr(t){const e=Qi.get(t);if(!e||!e.isMinimized)return;Qi.set(t,{...e,isMinimized:!1,isOpen:!0}),tr(),ye(sr,[...Dn(sr),t],!0),kr(t);const n=e.lastChildId||e.childId;n&&br(n)}function br(t){const e=Qi.get(t);e&&e.isHiddenWithParent&&(Qi.set(t,{...e,isHiddenWithParent:!1}),tr(),ye(ar,[...Dn(ar),t],!0))}function Mr(t,e,n){const i=Qi.get(t);if(!i)return;let r=e;if((null==n?void 0:n.constrain)&&i.size&&(r=Yi(e.x,e.y,i.size.width,i.size.height)),Qi.set(t,{...i,position:r,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=r;for(;;){const t=Qi.get(e);if(!(null==t?void 0:t.childId))break;const i=Qi.get(t.childId);if(!(null==i?void 0:i.offsetFromParent))break;const r={x:n.x+i.offsetFromParent.x,y:n.y+i.offsetFromParent.y};Qi.set(t.childId,{...i,position:r,hasBeenDragged:!0}),e=t.childId,n=r}}if(i.parentId&&i.offsetFromParent){const e=Ri();let n=t,o=i;for(;o.parentId&&o.offsetFromParent;){const i=Qi.get(o.parentId);if(!i)break;const s=n===t?r:Qi.get(n).position,a={x:s.x-o.offsetFromParent.x,y:s.y-o.offsetFromParent.y};"animated"===e.parentChild.movementMode?hr.set(o.parentId,a):Qi.set(o.parentId,{...i,position:a,hasBeenDragged:!0}),n=o.parentId,o=i}}tr()}function zr(t,e){const n=Qi.get(t);n&&(Qi.set(t,{...n,...e}),tr())}function kr(t){var e;const n=Qi.get(t);if(!n)return;const i=Math.max(...Array.from(Qi.values()).map(t=>t.zIndex),0);if(n.parentId){const r=Qi.get(n.parentId);r&&r.zIndex<i&&Qi.set(n.parentId,{...r,zIndex:i+2});const o=(null==(e=Qi.get(n.parentId))?void 0:e.zIndex)??i+2;return n.zIndex<=o&&Qi.set(t,{...n,zIndex:o+2}),void tr()}if(n.zIndex<i&&(Qi.set(t,{...n,zIndex:i+2}),tr()),n.childId){const e=Qi.get(n.childId),i=Qi.get(t);e&&i&&e.zIndex<=i.zIndex&&(Qi.set(n.childId,{...e,zIndex:i.zIndex+2}),tr())}}function Ir(t,e,n){const i=e.getBoundingClientRect();cr.set(t,{x:i.left+i.width/2,y:i.top+i.height/2});const r=Ri();(null==n?void 0:n.parentId)&&r.features.parentChild&&ye(fr,{parentId:n.parentId,childId:t},!0),Dn(ir).includes(t)||ye(ir,[...Dn(ir),t],!0),tr();const o=Qi.get(t);if(o){if(o.isOpen&&!o.isMinimized&&!o.isHiddenWithParent)return ye(ir,Dn(ir).filter(e=>e!==t),!0),Lr(t),void kr(t);if(o.isMinimized)return ye(ir,Dn(ir).filter(e=>e!==t),!0),void xr(t);Qi.set(t,{...o,isOpen:!0}),kr(t)}}function _r(t,e=!1){const n=Qi.get(t);n&&(Xr(t),e?ye(or,[...Dn(or),t],!0):ye(rr,[...Dn(rr),t],!0),tr(),n.childId&&_r(n.childId,e))}function Pr(){Array.from(Qi.keys()).forEach(t=>_r(t,!0))}function Dr(t,e,n){const i=Ri();if(n&&!cr.has(t.id)){const e=n.getBoundingClientRect();cr.set(t.id,{x:e.left+e.width/2,y:e.top+e.height/2})}const r={id:t.id,title:t.title??"",icon:t.icon??"",isOpen:!0,isMinimized:!1,isHiddenWithParent:!1,isTransparent:t.isTransparent??!1,isRejected:!1,position:t.position??null,size:t.size??null,hasBeenDragged:t.hasBeenDragged??!1,dockPosition:t.dockPosition??-1,glow:t.glow??null};if(!i.features.parentChild){mr(r);const e=Qi.get(t.id);return e&&Qi.set(t.id,{...e,isOpen:!0}),ye(ir,[...Dn(ir),t.id],!0),tr(),void kr(t.id)}const o=Qi.get(e);if(!o)return;o.childId&&_r(o.childId,!0),mr({...r,parentId:e});const s=Qi.get(t.id);s&&Qi.set(t.id,{...s,isOpen:!0,parentId:e}),ye(ir,[...Dn(ir),t.id],!0),tr(),kr(t.id),ye(fr,{parentId:e,childId:t.id},!0)}function Cr(t){return Dn(nr).includes(t)}function Sr(t){return Qi.get(t)}function Or(){return Dn(Ji)}function Er(t){return Dn(ir).includes(t)}function Wr(t){return Dn(rr).includes(t)}function Tr(t){return Dn(or).includes(t)}function Br(t){return!!Dn(or).includes(t)&&(ye(or,Dn(or).filter(e=>e!==t),!0),!0)}function Rr(t){return Dn(sr).includes(t)}function Ar(t){return Dn(ar).includes(t)}function Lr(t){Qi.get(t)&&(Dn(lr).includes(t)||Dn(dr).includes(t)||(ye(lr,[...Dn(lr),t],!0),tr()))}function Hr(t){const e=Qi.get(t);return void 0!==e&&e.isOpen&&!e.isMinimized&&!e.isHiddenWithParent}function $r(t){return Qi.has(t)}function Fr(){return{get modals(){return Qi},get pendingMinimize(){return Dn(nr)},get pendingOpen(){return Dn(ir)},get pendingClose(){return Dn(rr)},get pendingRestore(){return Dn(sr)},get dockOrder(){return Dn(gr)}}}function qr(t){vr.has(t)?vr.delete(t):vr.add(t);const e=Qi.get(t);e&&(Qi.set(t,{...e,isTransparent:vr.has(t)}),tr())}function jr(t){vr.delete(t);const e=Qi.get(t);e&&(Qi.set(t,{...e,isTransparent:!1}),tr())}function Xr(t){hr.delete(t)}"undefined"!=typeof window&&((F=window.__svelte??(window.__svelte={})).v??(F.v=new Set)).add("5");const Yr=Symbol("modal-render-icon"),Nr=Symbol("modal-id");function Kr(){return Ri().features.animations}const Gr=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function Vr(t){return Array.from(t.querySelectorAll(Gr)).filter(t=>null!==t.offsetParent||"A"===t.tagName)}function Ur(t,e){if("Tab"!==t.key)return;const n=Vr(e);if(0===n.length)return void t.preventDefault();const i=n[0],r=n[n.length-1],o=document.activeElement;t.shiftKey?o===i&&(r.focus(),t.preventDefault()):o===r&&(i.focus(),t.preventDefault())}function Qr(t){const e=Vr(t);return e.length>0&&(e[0].focus(),!0)}const Jr="modal-portal";var Zr=Fn('<div style="display: contents;"><!></div>');function to(t,e){Tt(e,!0);let n=Oi(e,"target",0,"body"),i=null,r=null;const{mount:o}={mount:function(t,e=null){const n=function(t){if("undefined"==typeof window)return null;if(t instanceof HTMLElement)return t;if("string"==typeof t){const e=document.querySelector(t);if(e)return e;if(t.startsWith("#")){const e=t.slice(1),n=document.createElement("div");return n.id=e,document.body.appendChild(n),n}}let e=document.getElementById(Jr);return e||(e=document.createElement("div"),e.id=Jr,document.body.appendChild(e)),e}(e);return n?(n.appendChild(t),()=>{t.parentNode===n&&n.removeChild(t),n.id!==Jr&&0===n.children.length&&n.parentNode&&n.parentNode.removeChild(n)}):()=>{}}};ti(()=>(i&&(r=o(i,n())),()=>{null==r||r()}));var s=Zr();Zn(Ee(s),()=>e.children),Si(s,t=>i=t,()=>i),jn(t,s),Bt()}var eo=Fn('<button type="button" aria-label="Minimize"></button>'),no=Fn('<button type="button" class="modal-header-light modal-header-light-style" aria-label="Toggle style"></button>'),io=Fn('<div class="modal-header-icon"><!></div>'),ro=Fn('<div class="modal-header-icon"><!></div>'),oo=Fn('<h2 class="modal-header-title"> </h2>'),so=Fn('<h2 class="modal-header-title"> </h2>'),ao=Fn('<div class="modal-header-traffic-lights"><button type="button" class="modal-header-light modal-header-light-close" aria-label="Close"></button> <!> <!></div> <div class="modal-header-mac-center"><!> <div class="modal-header-title-group"><!></div></div> <div class="modal-header-mac-spacer"></div>',1),lo=Fn('<div class="modal-header-icon"><!></div>'),uo=Fn('<div class="modal-header-icon"><!></div>'),co=Fn('<h2 class="modal-header-title"> </h2>'),fo=Fn('<h2 class="modal-header-title"> </h2>'),ho=Fn('<button type="button" class="modal-header-btn-windows modal-header-btn-windows-style" aria-label="Toggle style">◇</button>'),po=Fn('<button type="button" aria-label="Minimize">–</button>'),vo=Fn('<div class="modal-header-title-group"><!> <!></div> <div class="modal-header-actions"><!> <!> <button type="button" class="modal-header-btn-windows modal-header-btn-windows-close" aria-label="Close">×</button></div>',1),go=Fn("<header><!></header>");An(["pointerdown","click"]);var mo=Fn("<div></div>"),wo=Fn('<div class="modal-resize-handles"></div>');function yo(t,e){return e&&t.appendChild(e),{update(e){t.innerHTML="",e&&t.appendChild(e)},destroy(){t.innerHTML=""}}}An(["pointerdown"]);var xo=Fn('<div class="modal-footer"><!></div>'),bo=Fn("<div></div>"),Mo=Fn('<div role="dialog" aria-modal="true" tabindex="-1"><!> <div class="modal-body"><!></div> <!> <!> <!></div>');function zo(t,e){Tt(e,!0);let n=Oi(e,"maxWidth",0,"600px"),i=Oi(e,"autoOpen",0,!1),r=Oi(e,"closeOnEscape",0,!0),o=Oi(e,"skipRegistration",0,!1);var s,a;s=Nr,a=()=>e.id,Rt().set(s,a);const l=Ri().portalTarget,d=le(()=>Ui(e.id));function u(t){var n,i;return(null==(i=null==(n=e.config)?void 0:n.features)?void 0:i[t])??function(t){return Wi.features[t]}(t)}const c=le(()=>(Bi(),u("drag"))),f=le(()=>(Bi(),u("minimize"))),h=le(()=>(Bi(),!u("dock"))),p=le(()=>(Bi(),u("transparency"))),v=le(()=>(Bi(),u("resize"))),g=le(()=>{var t,n;return Bi(),(null==(n=null==(t=e.config)?void 0:t.appearance)?void 0:n.headerLayout)??Ri().appearance.headerLayout});let m=me(null),w=me(!1),y=me(!1),x=me(!1),b=me(!1),M=me(!1);const z=le(()=>(Or(),Sr(e.id))),k=le(()=>Dn(z)&&(Dn(z).isOpen||Wr(e.id))&&(!Dn(z).isMinimized||Cr(e.id))&&!Dn(z).isHiddenWithParent),I=le(()=>{var t;return!!(null==(t=Dn(z))?void 0:t.childId)}),_=le(()=>{var t;return!!(null==(t=Dn(z))?void 0:t.parentId)}),P=le(()=>Dn(I)||Dn(y)),D=le(()=>!!e.glow),C=le(()=>`modal-title-${Dn(d)}`),S=le(()=>{var t;return(null==(t=Dn(z))?void 0:t.zIndex)??1e3}),O=function(t={x:0,y:0}){const e=ke({...t}),n=ke({isDragging:!1,startX:0,startY:0,initialX:0,initialY:0,hasBeenDragged:!1});return{get position(){return e},get hasBeenDragged(){return n.hasBeenDragged},get isDragging(){return n.isDragging},onPointerDown:function(t,i){if(0===t.button){if(!n.hasBeenDragged){const t=i.getBoundingClientRect();e.x=t.left,e.y=t.top}n.isDragging=!0,n.startX=t.clientX,n.startY=t.clientY,n.initialX=e.x,n.initialY=e.y,i.setPointerCapture(t.pointerId)}},onPointerMove:function(t,i,r){if(!n.isDragging)return;const o=t.clientX-n.startX,s=t.clientY-n.startY,a=Yi(n.initialX+o,n.initialY+s,r.width,r.height);e.x=a.x,e.y=a.y,n.hasBeenDragged=!0},onPointerUp:function(t,e){n.isDragging&&(n.isDragging=!1,e.releasePointerCapture(t.pointerId))},setPosition:function(t){e.x=t.x,e.y=t.y},setHasBeenDragged:function(t){n.hasBeenDragged=t},reset:function(){e.x=t.x,e.y=t.y,n.hasBeenDragged=!1}}}({x:0,y:0});let E=me(!1);const W=function(t,n,i){let r=me(!1),o=me(""),s=me(ke({width:0,height:0})),a=me(!1),l=me(!1),d={x:0,y:0,width:0,height:0,posX:0,posY:0},u=null;function c(e,l){e.preventDefault(),e.stopPropagation();const c=t();if(!c)return;const p=c.getBoundingClientRect();O.hasBeenDragged||(i({x:p.left,y:p.top}),O.setHasBeenDragged(!0)),Dn(a)||(ye(s,{width:p.width,height:p.height},!0),ye(a,!0));const v=n();ye(r,!0),ye(o,l,!0),u=e.pointerId,d={x:e.clientX,y:e.clientY,width:Dn(s).width,height:Dn(s).height,posX:v.x,posY:v.y,centerX:v.x+Dn(s).width/2,centerY:v.y+Dn(s).height/2},window.addEventListener("pointermove",f),window.addEventListener("pointerup",h),window.addEventListener("pointercancel",h)}function f(t){if(t.pointerId!==u)return;const e=t.clientX-d.x,n=t.clientY-d.y,r=window.innerWidth,a=window.innerHeight;let l=d.width,c=d.height,f=d.posX,h=d.posY;if(Dn(o).includes("e")){const t=r-f;l=Math.max(280,Math.min(d.width+e,t))}if(Dn(o).includes("w")){const t=d.width-280,n=Math.min(e,t);l=d.width-n,f=d.posX+n}if(Dn(o).includes("s")){const t=a-h;c=Math.max(200,Math.min(d.height+n,t))}if(Dn(o).includes("n")){const t=d.height-200,e=Math.min(n,t);c=d.height-e,h=d.posY+e}const p=Ni(f,h,l,c);ye(s,{width:p.width,height:p.height},!0),i({x:p.x,y:p.y})}function h(t){t.pointerId===u&&(ye(r,!1),u=null,window.removeEventListener("pointermove",f),window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),ye(l,!0),((t,n)=>{const i=Sr(e.id);if(null==i?void 0:i.parentId){const t=Sr(i.parentId),r=document.querySelector(`[data-modal-id="${Ui(i.parentId)}"]`);if(t&&r){const i=t.position??{x:r.getBoundingClientRect().left,y:r.getBoundingClientRect().top},o=t.size??{width:r.offsetWidth,height:r.offsetHeight},s={x:i.x+(o.width-n.width)/2,y:i.y+(o.height-n.height)/2};ye(E,!0),O.setPosition(s);const a={x:s.x-i.x,y:s.y-i.y};return zr(e.id,{position:s,size:n,hasBeenDragged:!0,offsetFromParent:a}),void setTimeout(()=>{ye(E,!1)},200)}}zr(e.id,{position:t,size:n,hasBeenDragged:!0})})(n(),Dn(s)),setTimeout(()=>{ye(l,!1)},0))}const p={startResize:c};return{get isResizing(){return Dn(r)},get resizeDirection(){return Dn(o)},get size(){return Dn(s)},get hasBeenResized(){return Dn(a)},get isActive(){return Dn(r)},get justFinishedResizing(){return Dn(l)},start:c,setHasBeenResized:()=>{},setSize:function(t){ye(s,t,!0),ye(a,!0)},reset:function(){ye(a,!1),ye(s,{width:0,height:0},!0)},constrainToViewport:function(){const e=n(),r=t();if(!r)return;const o=Ni(e.x,e.y,Dn(s).width||r.offsetWidth,Dn(s).height||r.offsetHeight);ye(s,{width:o.width,height:o.height},!0),i({x:o.x,y:o.y})},handlers:p}}(()=>Dn(m),()=>O.position,t=>O.setPosition(t)),T=function(t,n,i,r,o,s,a,l,d){let u=me(!1),c=me(!1),f=me(!1),h=me(!1),p=me(null),v=me(null),g=null,m=null;function w(){m&&(clearTimeout(m),m=null)}function y(){const t=e.id,n=document.querySelector(`.modal-dock-item[data-modal-id="${Ui(t)}"]`),i=document.querySelector('[data-dock-container="true"]'),r=n||i;if(r){const t=r.getBoundingClientRect();return{x:t.left+t.width/2,y:t.top+t.height/2}}return{x:window.innerWidth/2,y:window.innerHeight-40}}return He(()=>()=>{w(),ye(u,!1),ye(c,!1),ye(f,!1),ye(h,!1),ye(p,null),ye(v,null),g=null}),{get isMinimizing(){return Dn(u)},get isRestoring(){return Dn(c)},get isOpening(){return Dn(f)},get isClosing(){return Dn(h)},get animationTransform(){return Dn(p)},get pendingOpenSource(){return Dn(v)},startMinimize:function(t,e){const h=n();if(Dn(u)||!h)return;if(ye(c,!1),ye(f,!1),w(),!Kr()){const t=h.getBoundingClientRect();let n=o()?i():{x:t.left,y:t.top},u=a()?l():{width:t.width,height:t.height};return o()||(r(n),s(!0)),void(e?e():d(n,!0,u))}const v=h.getBoundingClientRect(),g=v.left+v.width/2,x=v.top+v.height/2;let b=o()?i():{x:v.left,y:v.top},M=a()?l():{width:v.width,height:v.height};o()||(r(b),s(!0));const z=t??y(),k=z.x-v.left,I=z.y-v.top,_={x:z.x-g,y:z.y-x,originX:k,originY:I};ye(p,_,!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{ye(u,!0)})}),m=setTimeout(()=>{e?e():d(b,!0,M)},500)},startRestore:function(t,e){if(!Kr()){const e=t||{x:window.innerWidth/2,y:window.innerHeight/2};return r(e),void s(!0)}const n=y(),i=t||{x:window.innerWidth/2,y:window.innerHeight/2},o=e||{width:480,height:400};r(i),s(!0);const a=i.x+o.width/2,l=i.y+o.height/2,d=n.x-i.x,u=n.y-i.y;ye(p,{x:n.x-a,y:n.y-l,originX:d,originY:u},!0),ye(c,!0),setTimeout(()=>{ye(c,!1),ye(p,null)},400)},startClose:function(t){Dn(h)||Dn(u)||(Kr()?(g=t,ye(h,!0),setTimeout(()=>{ye(h,!1),g&&(g(),g=null)},250)):t())},setPendingOpenSource:function(t){ye(v,t,!0)},tryStartOpenAnimation:function(){const t=n();if(!Dn(v)||!t||Dn(f))return!1;if(!Kr())return ye(v,null),!1;const e=Dn(v);ye(v,null);const a=t.getBoundingClientRect(),l=o()?i():{x:a.left,y:a.top},d=a.width,u=a.height,c=l.x+d/2,h=l.y+u/2;o()||(r(l),s(!0));const g=e.x-l.x,m=e.y-l.y;return ye(p,{x:e.x-c,y:e.y-h,originX:g,originY:m},!0),ye(f,!0),setTimeout(()=>{ye(f,!1),ye(p,null)},400),!0},forceClearMinimize:function(){w(),ye(u,!1),ye(p,null)}}}(0,()=>Dn(m),()=>O.position,t=>O.setPosition(t),()=>O.hasBeenDragged,t=>O.setHasBeenDragged(t),()=>W.hasBeenResized,()=>W.size,(t,n,i)=>{zr(e.id,{position:t,size:i,hasBeenDragged:n}),yr(e.id)}),{trapFocus:B,focusFirstElement:R}={trapFocus:Ur,focusFirstElement:Qr},A=le(()=>T.isMinimizing||T.isRestoring||T.isOpening||T.isClosing),L=le(()=>(Ar(e.id)||Rr(e.id))&&!T.isRestoring);let H=me(!1);const $=le(()=>T.isRestoring||T.isOpening||Dn(H)),F=le(()=>Dn(k)&&!O.hasBeenDragged&&!Dn(A)&&!T.pendingOpenSource&&!Dn(L)),q=le(()=>{const t=[];return t.push(`z-index: ${Dn(S)};`),T.animationTransform?(t.push(`left: ${O.position.x}px; top: ${O.position.y}px;`),t.push(`--genie-origin-x: ${T.animationTransform.originX}px;`),t.push(`--genie-origin-y: ${T.animationTransform.originY}px;`),t.push(`--genie-translate-x: ${T.animationTransform.x}px;`),t.push(`--genie-translate-y: ${T.animationTransform.y}px;`)):O.hasBeenDragged&&t.push(`left: ${O.position.x}px; top: ${O.position.y}px; transform: none;`),W.hasBeenResized?t.push(`width: ${W.size.width}px; height: ${W.size.height}px; max-width: none; max-height: none;`):(e.preferredHeight&&t.push(`min-height: ${e.preferredHeight};`),n()&&t.push(`max-width: ${n()};`)),Dn(D)&&e.glow&&(t.push(`--modal-glow-color: ${e.glow.color};`),t.push(`--modal-glow-intensity: ${e.glow.intensity};`)),t.join(" ")});function j(){Dn(f)&&yr(e.id)}function X(){var t;Tr(e.id)&&Br(e.id),_r(e.id),null==(t=e.onClose)||t.call(e)}function Y(){qr(e.id)}function N(t){Dn(c)&&Dn(m)&&O.onPointerDown(t,Dn(m))}function K(t){r()&&"Escape"===t.key&&function(t){const e=Qi.get(t);if(!e)return!1;const n=Math.max(...Array.from(Qi.values()).map(t=>t.zIndex),0);return e.zIndex===n&&!e.isMinimized&&!e.isHiddenWithParent}(e.id)&&(t.stopPropagation(),X())}function G(t){if(!Dn(m))return;const n=O.isDragging,i=W.hasBeenResized?W.size:{width:Dn(m).offsetWidth,height:Dn(m).offsetHeight};O.onPointerMove(t,Dn(m),i),O.isDragging&&n&&Mr(e.id,O.position,{drag:!0})}function V(t){if(!Dn(m))return;const n=O.isDragging;O.onPointerUp(t,Dn(m)),n&&!W.justFinishedResizing&&(Mr(e.id,O.position,{drag:!0}),function(t){const e=Ri();if("animated"!==e.parentChild.movementMode)return;const n=e.parentChild.animationDuration,i=[];let r=t;for(;;){const t=Qi.get(r);if(!(null==t?void 0:t.parentId))break;i.push({parentId:t.parentId,childId:r}),r=t.parentId}i.forEach(({parentId:t,childId:e},i)=>{setTimeout(()=>{const i=Qi.get(e),r=Qi.get(t);if(!(null==i?void 0:i.position)||!i.offsetFromParent||!r)return;const o={x:i.position.x-i.offsetFromParent.x,y:i.position.y-i.offsetFromParent.y};hr.set(t,o),function(t){const e=hr.get(t);if(!e)return;const n=Qi.get(t);n&&(Qi.set(t,{...n,isAnimatingPosition:!0,position:e}),hr.delete(t),tr())}(t),setTimeout(()=>function(t){const e=Qi.get(t);e&&(Qi.set(t,{...e,isAnimatingPosition:!1}),tr())}(t),n)},i*n)})}(e.id))}function U(){var t;const n=Ri();if("smart"!==(null==(t=n.positioning)?void 0:t.strategy))return!1;const i=Sr(e.id),r=Dn(fr);if((null==i?void 0:i.parentId)||r&&r.childId===e.id)return!1;if((null==i?void 0:i.hasBeenDragged)||(null==i?void 0:i.position))return!1;const o=Dn(m)||document.querySelector(`[data-modal-id="${Dn(d)}"]`);if(!o)return!1;const s=o.offsetWidth,a=o.offsetHeight;if(s<=0||a<=0)return!1;const l=n.positioning.modalGap??16,u=function(t){const e=[];for(const[n,i]of Qi.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="${Ui(n)}"]`);if(t){const n=t.getBoundingClientRect();e.push({x:n.left,y:n.top,width:n.width,height:n.height})}}return e}(e.id),c=function(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}(n.positioning.avoidElements??[]),f=function(t,e,n,i={}){const{modalGap:r=16,gridResolution:o=10,avoidBounds:s=[],avoidMargin:a=16}=i,l=i.margin??r,d="undefined"!=typeof window?window.innerWidth:1920,u="undefined"!=typeof window?window.innerHeight:1080,c=s.map(t=>({x:t.x-a,y:t.y-a,width:t.width+2*a,height:t.height+2*a})),f={x:(d-t)/2,y:(u-e)/2};if(0===n.length&&0===c.length)return f;const h=l,p=Math.max(l,d-t-l),v=l,g=Math.max(l,u-e-l);if(p<=h||g<=v)return f;const m=Gi(f.x,f.y,t,e,n,r),w=Gi(f.x,f.y,t,e,c,0);if(0===m&&0===w)return f;const y=[],x=(p-h)/o,b=(g-v)/o;for(let i=0;i<=o;i++)for(let s=0;s<=o;s++){const o=h+i*x,a=v+s*b,f=Gi(o,a,t,e,n,r),p=Gi(o,a,t,e,c,0),g=Vi(o,a,t,e,d,u,l);y.push({pos:{x:o,y:a},modalOverlap:f,avoidOverlap:p,centerDist:g})}const M=y.filter(t=>0===t.avoidOverlap),z=M.length>0?M:y,k=t*e,I=Math.min(...z.map(t=>t.modalOverlap))/k;return z.sort((t,e)=>{if(0===M.length&&t.avoidOverlap!==e.avoidOverlap)return t.avoidOverlap-e.avoidOverlap;const n=t.modalOverlap/k,i=e.modalOverlap/k;if(I<.3){const r=.3,o=n<=r,s=i<=r;if(o&&s)return t.centerDist+.3*n-(e.centerDist+.3*i);if(o)return-1;if(s)return 1}return.6*n+.4*t.centerDist-(.6*i+.4*e.centerDist)}),z[0].pos}(s,a,u,{modalGap:l,avoidBounds:c});if(Gi(f.x,f.y,s,a,u,l)/(s*a)>.1&&u.length>0){const t=function(t){const e=[];for(const[n,i]of Qi.entries())if(n!==t&&i.isOpen&&!i.isMinimized&&!i.isHiddenWithParent&&!i.parentId)if(i.position&&i.size)e.push({id:Ui(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="${Ui(n)}"]`);if(t){const i=t.getBoundingClientRect();e.push({id:Ui(n),x:i.left,y:i.top,width:i.width,height:i.height})}}return e}(e.id),n=function(t,e,n,i={}){const{modalGap:r=16}=i,o=i.margin??r,s="undefined"!=typeof window?window.innerWidth:1920,a="undefined"!=typeof window?window.innerHeight:1080,l=n.reduce((t,e)=>t+e.width,0)+t,d=n.length*r,u=s-2*o;if(l+d>u)return null;const c=u-l-d;n.length;const f=c/2,h=s/2,p=[...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:h,currentY:(a-e)/2,isNew:!0}];p.sort((t,e)=>t.currentX-e.currentX);let v=o+f;const g=new Map;let m=null;for(const t of p){const e=v;if(t.isNew)m={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&&g.set(t.id,{x:Math.round(e),y:Math.round(i.y)})}v+=t.width+r}return m?{newModalPosition:m,existingModalMoves:g}:null}(s,a,t,{modalGap:l});if(n&&n.existingModalMoves.size>0)return function(t){const e=Ri().parentChild.animationDuration;for(const[e,n]of t){const t=Qi.get(e);t&&Qi.set(e,{...t,position:n,isAnimatingPosition:!0,hasBeenDragged:!0})}tr(),setTimeout(()=>{for(const e of t.keys()){const t=Qi.get(e);t&&Qi.set(e,{...t,isAnimatingPosition:!1})}tr()},e)}(n.existingModalMoves),O.setPosition(n.newModalPosition),O.setHasBeenDragged(!0),Mr(e.id,n.newModalPosition,{size:{width:s,height:a}}),!0}return O.setPosition(f),O.setHasBeenDragged(!0),Mr(e.id,f,{size:{width:s,height:a}}),!0}function Q(){Pn().then(()=>Pn()).then(()=>{let t=0;const e=()=>{t+=1,U()||t>5||requestAnimationFrame(e)};Dn(m)?e():requestAnimationFrame(e)})}ti(()=>{var t;function n(){const t=Sr(e.id);if(!(null==t?void 0:t.position)||!Dn(m))return;if(t.parentId)return;const n=W.hasBeenResized?W.size.width:Dn(m).offsetWidth,i=W.hasBeenResized?W.size.height:Dn(m).offsetHeight;if(n<=0||i<=0)return;const r=Yi(t.position.x,t.position.y,n,i);(Math.abs(r.x-t.position.x)>1||Math.abs(r.y-t.position.y)>1)&&(O.setPosition(r),Mr(e.id,r))}return o()||(t=i(),mr({id:e.id,title:e.title,icon:e.icon??"",isOpen:t,isMinimized:!1,isHiddenWithParent:!1,isTransparent:!1,isRejected:!1,position:null,size:null,hasBeenDragged:!1,dockPosition:0,glow:e.glow??null,parentId:void 0,childId:void 0,offsetFromParent:void 0}),t&&kr(e.id)),i()&&(Pn().then(()=>{Dn(m)&&R(Dn(m))}),Q()),window.addEventListener("pointermove",G),window.addEventListener("pointerup",V),window.addEventListener("resize",n),()=>{window.removeEventListener("pointermove",G),window.removeEventListener("pointerup",V),window.removeEventListener("resize",n)}}),ei(()=>{jr(e.id),o()||wr(e.id)}),He(()=>{Or();const t=Sr(e.id);if(t){if(ye(w,t.isTransparent,!0),!O.isDragging&&!W.isResizing&&t.position){const e=O.position,n=t.position;(Math.abs(e.x-n.x)>.5||Math.abs(e.y-n.y)>.5)&&(O.setPosition(n),t.hasBeenDragged&&O.setHasBeenDragged(!0))}Pn().then(()=>function(){var t,n;if(!Sr(e.id))return;if(Tr(e.id))return Br(e.id),void(null==(t=e.onClose)||t.call(e));if(Cr(e.id)&&!Dn(b)){if(ye(b,!0),Dn(ur),ye(ur,null),Dn(m)){const t=Dn(m).getBoundingClientRect(),n=O.hasBeenDragged?O.position:{x:t.left,y:t.top},i=W.hasBeenResized?W.size:{width:t.width,height:t.height};zr(e.id,{position:n,size:i,hasBeenDragged:!0})}T.startMinimize(void 0,()=>{var t;t=e.id,Dn(nr).includes(t)&&ye(nr,Dn(nr).filter(e=>e!==t),!0),ye(b,!1)})}if(Rr(e.id)){n=e.id,Dn(sr).includes(n)&&ye(sr,Dn(sr).filter(t=>t!==n),!0);const t=Sr(e.id);T.startRestore((null==t?void 0:t.position)??void 0,(null==t?void 0:t.size)??void 0),Pn().then(()=>{Dn(m)&&R(Dn(m))})}if(Ar(e.id)){!function(t){Dn(ar).includes(t)&&ye(ar,Dn(ar).filter(e=>e!==t),!0)}(e.id);const t=Sr(e.id);T.startRestore((null==t?void 0:t.position)??void 0,(null==t?void 0:t.size)??void 0)}if(Wr(e.id)&&(function(t){Dn(rr).includes(t)&&ye(rr,Dn(rr).filter(e=>e!==t),!0)}(e.id),T.startClose(()=>{var t;jr(e.id),function(t){const e=Qi.get(t);if(e){if(e.parentId){const n=Qi.get(e.parentId);n&&n.childId===t&&Qi.set(e.parentId,{...n,childId:void 0,lastChildId:t})}Qi.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}),tr()}}(e.id),null==(t=e.onClose)||t.call(e)})),Er(e.id)){!function(t){Dn(ir).includes(t)&&ye(ir,Dn(ir).filter(e=>e!==t),!0)}(e.id);const t=function(t){const e=cr.get(t);return e&&cr.delete(t),e??null}(e.id)||e.openSourcePosition||null;t?(T.setPendingOpenSource(t),Pn().then(()=>Pn()).then(()=>{U(),T.tryStartOpenAnimation()})):Q(),Pn().then(()=>{Dn(m)&&R(Dn(m))})}(function(t){return Dn(lr).includes(t)})(e.id)&&(function(t){Dn(lr).includes(t)&&ye(lr,Dn(lr).filter(e=>e!==t),!0)}(e.id),function(t){Dn(dr).includes(t)||ye(dr,[...Dn(dr),t],!0)}(e.id),ye(M,!0),setTimeout(()=>{ye(M,!1),function(t){ye(dr,Dn(dr).filter(e=>e!==t),!0)}(e.id)},600));const i=function(t){if(!Dn(fr)||Dn(fr).childId!==t)return null;const e=Dn(fr);return ye(fr,null),e}(e.id);var r;i&&Dn(m)&&(r=i.parentId,Pn().then(()=>Pn()).then(()=>{let t=0;const n=()=>{t+=1;const i=function(t){var n,i;const r=Sr(t);if(!r)return!1;const o=Dn(m)||document.querySelector(`[data-modal-id="${Dn(d)}"]`),s=document.querySelector(`[data-modal-id="${Ui(t)}"]`),a=null==s?void 0:s.getBoundingClientRect(),l=r.position??(a?{x:a.left,y:a.top}:null);if(!l||!o)return!1;const u=(null==(n=r.size)?void 0:n.width)??(null==s?void 0:s.offsetWidth)??(null==a?void 0:a.width)??480,c=(null==(i=r.size)?void 0:i.height)??(null==s?void 0:s.offsetHeight)??(null==a?void 0:a.height)??400,f=o.offsetWidth,h=o.offsetHeight;if(u<=0||c<=0||f<=0||h<=0)return!1;const p={x:l.x+(u-f)/2,y:l.y+(c-h)/2};return O.setPosition(p),O.setHasBeenDragged(!0),Mr(e.id,p,{size:{width:f,height:h}}),r.position&&r.size||!a||Mr(t,{x:a.left,y:a.top},{size:{width:u,height:c}}),function(t,e){if(!Ri().features.parentChild)return;const n=Qi.get(t),i=Qi.get(e);if(!n||!i)return;let r={x:40,y:40};n.position&&i.position&&(r={x:i.position.x-n.position.x,y:i.position.y-n.position.y});const o=Math.max(i.zIndex,n.zIndex+1);Qi.set(t,{...n,childId:e,lastChildId:e}),Qi.set(e,{...i,parentId:t,offsetFromParent:r,zIndex:o}),tr()}(t,e.id),!0}(r);i||t>5||requestAnimationFrame(n)};Dn(m)?n():requestAnimationFrame(n)}))}())}}),He(()=>{const t=Sr(e.id);t&&t.isTransparent!==Dn(w)&&ye(w,t.isTransparent,!0)}),He(()=>{if(Dn(k)&&Dn(m)){const t=t=>function(t){Dn(m)&&B(t,Dn(m))}(t);return Dn(m).addEventListener("keydown",t),()=>{var e;return null==(e=Dn(m))?void 0:e.removeEventListener("keydown",t)}}}),He(()=>{!Dn(k)&&T.isMinimizing&&T.forceClearMinimize()}),He(()=>{T.isRestoring||T.isOpening?ye(H,!0):Dn(H)&&requestAnimationFrame(()=>{ye(H,!1)})}),He(()=>{Dn(x)&&!Dn(I)&&(ye(y,!0),setTimeout(()=>{ye(y,!1)},200)),ye(x,Dn(I),!0)});var J=qn(),Z=We(J),tt=t=>{to(t,{get target(){return l},children:(t,n)=>{var i=Mo();let r;i.__keydown=K;var o=Ee(i);{let t=le(()=>Dn(c)?N:void 0);!function(t,e){Tt(e,!0);let n=Oi(e,"isTransparent",0,!1),i=Oi(e,"headerLayout",0,"macos"),r=Oi(e,"minimizable",0,!0),o=Oi(e,"minimizeDisabled",0,!1),s=Oi(e,"transparencyEnabled",0,!0);const a=Wt(Yr),l=le(()=>null==a?void 0:a()),d=le(()=>"macos"===i());var u=go();let c;u.__pointerdown=function(t){var n;t.target.closest("button")||null==(n=e.onStartDrag)||n.call(e,t)};var f=Ee(u),h=t=>{var n=ao(),i=We(n),a=Ee(i);a.__click=function(...t){var n;null==(n=e.onClose)||n.apply(this,t)};var d=Te(a,2),u=t=>{var n=eo();let i;n.__click=function(...t){var n;null==(n=o()?void 0:e.onMinimize)||n.apply(this,t)},je(()=>{i=Mi(n,0,"modal-header-light modal-header-light-minimize",null,i,{"modal-header-light-disabled":o()}),n.disabled=o(),Pi(n,"title",o()?"Enable dock to minimize":void 0)}),jn(t,n)};ni(d,t=>{r()&&t(u)});var c=Te(d,2),f=t=>{var n=no();n.__click=function(...t){var n;null==(n=e.onToggleStyle)||n.apply(this,t)},jn(t,n)};ni(c,t=>{s()&&t(f)});var h=Ee(Te(i,2)),p=t=>{var n=io();Zn(Ee(n),()=>e.customIcon),jn(t,n)},v=t=>{var n=qn(),i=We(n),r=t=>{var n=ro();Zn(Ee(n),()=>Dn(l),()=>e.icon),jn(t,n)};ni(i,t=>{e.icon&&Dn(l)&&t(r)},!0),jn(t,n)};ni(h,t=>{e.customIcon?t(p):t(v,!1)});var g=Ee(Te(h,2)),m=t=>{var n=oo(),i=Ee(n);je(()=>{Pi(n,"id",e.titleId),Kn(i,e.title)}),jn(t,n)},w=t=>{var n=so(),i=Ee(n);je(()=>Kn(i,e.title)),jn(t,n)};ni(g,t=>{e.titleId?t(m):t(w,!1)}),jn(t,n)},p=t=>{var n=vo(),i=We(n),a=Ee(i),d=t=>{var n=lo();Zn(Ee(n),()=>e.customIcon),jn(t,n)},u=t=>{var n=qn(),i=We(n),r=t=>{var n=uo();Zn(Ee(n),()=>Dn(l),()=>e.icon),jn(t,n)};ni(i,t=>{e.icon&&Dn(l)&&t(r)},!0),jn(t,n)};ni(a,t=>{e.customIcon?t(d):t(u,!1)});var c=Te(a,2),f=t=>{var n=co(),i=Ee(n);je(()=>{Pi(n,"id",e.titleId),Kn(i,e.title)}),jn(t,n)},h=t=>{var n=fo(),i=Ee(n);je(()=>Kn(i,e.title)),jn(t,n)};ni(c,t=>{e.titleId?t(f):t(h,!1)});var p=Ee(Te(i,2)),v=t=>{var n=ho();n.__click=function(...t){var n;null==(n=e.onToggleStyle)||n.apply(this,t)},jn(t,n)};ni(p,t=>{s()&&t(v)});var g=Te(p,2),m=t=>{var n=po();let i;n.__click=function(...t){var n;null==(n=o()?void 0:e.onMinimize)||n.apply(this,t)},je(()=>{i=Mi(n,0,"modal-header-btn-windows",null,i,{"modal-header-btn-windows-disabled":o()}),n.disabled=o(),Pi(n,"title",o()?"Enable dock to minimize":void 0)}),jn(t,n)};ni(g,t=>{r()&&t(m)}),Te(g,2).__click=function(...t){var n;null==(n=e.onClose)||n.apply(this,t)},jn(t,n)};ni(f,t=>{Dn(d)?t(h):t(p,!1)}),je(()=>c=Mi(u,0,"modal-header",null,c,{"modal-header-draggable":!!e.onStartDrag,transparent:n()})),jn(t,u),Bt()}(o,{get title(){return e.title},get customIcon(){return e.customIcon},get icon(){return e.icon},get isTransparent(){return Dn(w)},get titleId(){return Dn(C)},get headerLayout(){return Dn(g)},get onStartDrag(){return Dn(t)},onToggleStyle:Y,onMinimize:j,onClose:X,get minimizable(){return Dn(f)},get minimizeDisabled(){return Dn(h)},get transparencyEnabled(){return Dn(p)}})}var s=Te(o,2);Zn(Ee(s),()=>e.children??at),wi(s,(t,e)=>null==yo?void 0:yo(t,e),()=>e.bodyElement);var a=Te(s,2),l=t=>{var n=xo(),i=Ee(n),r=t=>{var n=qn();Zn(We(n),()=>e.footer),jn(t,n)};ni(i,t=>{e.footer&&t(r)}),wi(n,(t,e)=>null==yo?void 0:yo(t,e),()=>e.footerElement),jn(t,n)};ni(a,t=>{(e.footer||e.footerElement)&&t(l)});var u=Te(a,2);{let t=le(()=>Dn(v)&&!Dn(I)?W.handlers.startResize:void 0);!function(t,e){Tt(e,!0);const n=["n","s","e","w","ne","nw","se","sw"];var i=qn(),r=We(i),o=t=>{var i=wo();si(i,21,()=>n,ii,(t,n)=>{var i=mo();i.__pointerdown=t=>function(t,n){var i;null==(i=e.onStartResize)||i.call(e,t,n)}(t,Dn(n)),je(()=>Mi(i,0,`modal-resize-handle modal-resize-${Dn(n)??""}`)),jn(t,i)}),jn(t,i)};ni(r,t=>{e.onStartResize&&t(o)}),jn(t,i),Bt()}(u,{get onStartResize(){return Dn(t)}})}var x,b,k,S=Te(u,2),B=t=>{var e=bo();let n;je(()=>n=Mi(e,0,"modal-child-overlay",null,n,{"modal-overlay-closing":Dn(y)})),jn(t,e)};ni(S,t=>{Dn(P)&&t(B)}),Si(i,t=>ye(m,t),()=>Dn(m)),je(()=>{var t;r=Mi(i,0,"modal-dialog",null,r,{"modal-dragging":O.isDragging,"modal-resizing":W.isResizing,"modal-positioned":O.hasBeenDragged,"modal-minimizing":T.isMinimizing,"modal-restoring":T.isRestoring,"modal-opening":T.isOpening,"modal-closing":T.isClosing,"modal-centered":Dn(F),"modal-solid":!Dn(w),"modal-transparent":Dn(w),"modal-glow":Dn(D),"modal-has-child":Dn(I),"modal-is-child":Dn(_),"modal-visible-by-animation":Dn($),"modal-animating-to-center":Dn(E),"modal-animating-position":null==(t=Dn(z))?void 0:t.isAnimatingPosition,"modal-attention":Dn(M)}),Pi(i,"data-modal-id",Dn(d)),ki(i,Dn(q)),Pi(i,"aria-labelledby",Dn(C))}),k=function(t,e,n,i={}){function r(t){if(i.capture||Hn.call(e,t),!t.cancelBubble)return Be(()=>null==n?void 0:n.call(this,t))}return t.startsWith("pointer")||t.startsWith("touch")||"wheel"===t?Ht(()=>{e.addEventListener(t,r,i)}):e.addEventListener(t,r,i),r}("pointerdown",x=i,()=>kr(e.id),b={capture:!0,passive:void 0}),(x===document.body||x===window||x===document||x instanceof HTMLMediaElement)&&Le(()=>{x.removeEventListener("pointerdown",k,b)}),jn(t,i)},$$slots:{default:!0}})};ni(Z,t=>{Dn(k)&&t(tt)}),jn(t,J),Bt()}An(["keydown"]);const ko=t=>t;function Io(t){const e=t-1;return e*e*e+1}function _o(t){const e="string"==typeof t&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}function Po(t,{delay:e=0,duration:n=400,easing:i=ko}={}){const r=+getComputedStyle(t).opacity;return{delay:e,duration:n,easing:i,css:t=>"opacity: "+t*r}}function Do(t,{delay:e=0,duration:n=400,easing:i=Io,x:r=0,y:o=0,opacity:s=0}={}){const a=getComputedStyle(t),l=+a.opacity,d="none"===a.transform?"":a.transform,u=l*(1-s),[c,f]=_o(r),[h,p]=_o(o);return{delay:e,duration:n,easing:i,css:(t,e)=>`\n\t\t\ttransform: ${d} translate(${(1-t)*c}${f}, ${(1-t)*h}${p});\n\t\t\topacity: ${l-u*e}`}}function Co(t,{delay:e=0,duration:n=400,easing:i=Io,start:r=0,opacity:o=0}={}){const s=getComputedStyle(t),a=+s.opacity,l="none"===s.transform?"":s.transform,d=1-r,u=a*(1-o);return{delay:e,duration:n,easing:i,css:(t,e)=>`\n\t\t\ttransform: ${l} scale(${1-d*e});\n\t\t\topacity: ${a-u*e}\n\t\t`}}function So(t){const e=1.70158;return--t*t*((e+1)*t+e)+1}function Oo(t){const e=t-1;return e*e*e+1}var Eo=Fn('<button type="button" aria-label="Drag dock"></button>'),Wo=Fn('<span class="modal-dock-item-icon-placeholder"> </span>'),To=Fn('<span class="modal-dock-item-label"> </span>'),Bo=Fn("<span>+</span>"),Ro=Fn('<span class="modal-dock-child-indicator"><!></span>'),Ao=Fn('<button><span class="modal-dock-item-icon"><!></span> <!> <span class="modal-dock-item-glow"></span> <!></button>'),Lo=Fn('<div data-dock-container="true"><div><!> <!></div></div>');function Ho(t,e){Tt(e,!0);const n=Wt(Yr),i=le(()=>e.renderIcon??(null==n?void 0:n())),r=Fr(),o=le(()=>(Bi(),Ri())),s=le(()=>qi("DOCK")),a=le(()=>Dn(o).dock.position),l=le(()=>Dn(o).dock.labelMode);let d=me("horizontal"),u=me(ke({x:100,y:100})),c=me(null),f=me(!1),h={x:0,y:0},p=null;const v=le(()=>(Or(),Array.from(r.modals.values()).filter(t=>t.isMinimized).sort((t,e)=>t.dockPosition-e.dockPosition))),g=le(()=>{switch(Dn(a)){case"left":return{x:-20,duration:250,easing:Oo};case"right":return{x:20,duration:250,easing:Oo};default:return{y:20,duration:250,easing:Oo}}});function m(t){var e;"free"===Dn(a)&&(ye(f,!0),p=t.pointerId,h={x:t.clientX-Dn(u).x,y:t.clientY-Dn(u).y},null==(e=t.currentTarget)||e.setPointerCapture(t.pointerId),window.addEventListener("pointermove",w),window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y))}function w(t){if(t.pointerId!==p||!Dn(c))return;const e=Dn(c).getBoundingClientRect(),n=window.innerWidth-e.width-8,i=window.innerHeight-e.height-8,r=Math.min(Math.max(t.clientX-h.x,8),Math.max(8,n)),o=Math.min(Math.max(t.clientY-h.y,8),Math.max(8,i));ye(u,{x:Math.round(r),y:Math.round(o)},!0)}function y(t){t.pointerId===p&&(ye(f,!1),p=null,window.removeEventListener("pointermove",w),window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y))}const{addListener:x}=function(){function t(t,e,n){return"undefined"==typeof window?()=>{}:(window.addEventListener(t,e,n),()=>{window.removeEventListener(t,e,n)})}return{addListener:t,addListenerEffect:function(e,n,i){He(()=>{if("undefined"!=typeof window)return t(e,n,i)})}}}();function b(){if("free"!==Dn(a)||!Dn(c))return;const t=Dn(c).getBoundingClientRect(),e=Yi(Dn(u).x,Dn(u).y,t.width,t.height);e.x===Dn(u).x&&e.y===Dn(u).y||ye(u,{x:Math.round(e.x),y:Math.round(e.y)},!0)}He(()=>{"undefined"!=typeof window&&x("resize",b)});var M={setDockOrientation:function(t){ye(d,t,!0)},setDockFreePosition:function(t){ye(u,t,!0)},getDockState:function(){return{dockPosition:Dn(a),dockOrientation:Dn(d),dockFreePosition:Dn(u),dockLabelMode:Dn(l)}}};return to(t,{get target(){return Dn(o).portalTarget},children:(t,e)=>{var n=Lo();let o,h;var p=Ee(n);let w;var y=Ee(p),x=t=>{var e=Eo();let n;e.__pointerdown=m,je(()=>n=Mi(e,0,"modal-dock-handle",null,n,{"modal-dock-handle-dragging":Dn(f)})),jn(t,e)};ni(y,t=>{"free"===Dn(a)&&t(x)}),si(Te(y,2),19,()=>Dn(v),t=>t.id,(t,e,n)=>{const o=le(()=>Dn(e).lastChildId?r.modals.get(Dn(e).lastChildId):null);var s=Ao();let a;s.__click=t=>{var n;n=Dn(e).id,pr.has(n)?t.currentTarget.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"}):xr(Dn(e).id)};var d=Ee(s),u=Ee(d),c=t=>{var n=qn();Zn(We(n),()=>Dn(i),()=>Dn(e).icon),jn(t,n)},f=t=>{var n=Wo(),i=Ee(n);je(t=>Kn(i,t),[()=>Dn(e).title.charAt(0)]),jn(t,n)};ni(u,t=>{Dn(e).icon&&Dn(i)?t(c):t(f,!1)});var h=Te(d,2),p=t=>{var n=To(),i=Ee(n);je(()=>Kn(i,Dn(e).title)),jn(t,n)};ni(h,t=>{"hidden"!==Dn(l)&&t(p)});var v=Te(h,4),g=t=>{var e=Ro(),n=Ee(e),r=t=>{var e=qn();Zn(We(e),()=>Dn(i),()=>Dn(o).icon),jn(t,e)},s=t=>{jn(t,Bo())};ni(n,t=>{Dn(o).icon&&Dn(i)?t(r):t(s,!1)}),jn(t,e)};ni(v,t=>{Dn(e).lastChildId&&Dn(o)&&t(g)}),je(t=>{a=Mi(s,0,"modal-dock-item",null,a,{"modal-dock-item-has-glow":!!Dn(e).glow,"modal-dock-item-has-child":!!Dn(e).lastChildId,"modal-dock-item-label-beside":"beside"===Dn(l),"modal-dock-item-label-below":"below"===Dn(l)}),Pi(s,"data-modal-id",t),ki(s,Dn(e).glow?`--modal-dock-glow-color: ${Dn(e).glow.color};`:"")},[()=>Ui(Dn(e).id)]),gi(3,s,()=>Co,()=>({duration:300,delay:50*Dn(n),easing:So,start:.5})),jn(t,s)}),Si(n,t=>ye(c,t),()=>Dn(c)),je(()=>{o=Mi(n,0,"modal-dock-container",null,o,{"modal-dock-left":"left"===Dn(a),"modal-dock-right":"right"===Dn(a),"modal-dock-bottom":"bottom"===Dn(a),"modal-dock-free":"free"===Dn(a),"modal-dock-empty":0===Dn(v).length}),h=ki(n,"free"===Dn(a)?`left: ${Dn(u).x}px; top: ${Dn(u).y}px;`:"",h,{"z-index":Dn(s)}),w=Mi(p,0,"modal-dock",null,w,{"modal-dock-free-horizontal":"free"===Dn(a)&&"horizontal"===Dn(d),"modal-dock-free-vertical":"free"===Dn(a)&&"vertical"===Dn(d)})}),gi(3,n,()=>Do,()=>Dn(v).length>0?Dn(g):{duration:0}),jn(t,n)},$$slots:{default:!0}}),Bt(M)}function $o(t,e){Tt(e,!0);let n=Oi(e,"maxWidth",0,"600px"),i=Oi(e,"autoOpen",0,!1),r=Oi(e,"closeOnEscape",0,!0),o=me(!1);ti(()=>{mr({id:e.id,title:e.title,icon:e.icon??"",isOpen:i(),isMinimized:!1,isHiddenWithParent:!1,isTransparent:!1,isRejected:!1,position:null,size:null,hasBeenDragged:!1,dockPosition:0,glow:e.glow??null,parentId:void 0,childId:void 0,offsetFromParent:void 0}),ye(o,!0)}),ei(()=>{wr(e.id)});const s=le(()=>{if(!Dn(o))return!1;Or();const t=Sr(e.id);return!!t&&(t.isOpen||t.isMinimized||Er(e.id)||Wr(e.id)||Cr(e.id))});var a=qn(),l=We(a),d=t=>{zo(t,{get id(){return e.id},get title(){return e.title},get icon(){return e.icon},get customIcon(){return e.customIcon},get maxWidth(){return n()},get preferredHeight(){return e.preferredHeight},get autoOpen(){return i()},get openSourcePosition(){return e.openSourcePosition},get glow(){return e.glow},get config(){return e.config},get closeOnEscape(){return r()},get onClose(){return e.onClose},get children(){return e.children},get footer(){return e.footer},skipRegistration:!0})};ni(l,t=>{Dn(s)&&t(d)}),jn(t,a),Bt()}An(["pointerdown","click"]);var Fo=Fn('<div class="modal-backdrop svelte-1d3nq4t" aria-hidden="true"></div>');function qo(t,e){Tt(e,!0);const n=Fr(),i=le(()=>(Bi(),Ri())),r=le(()=>Dn(i).features.backdrop),o=le(()=>(Or(),Array.from(n.modals.values()).some(t=>t.isOpen&&!t.isMinimized&&!t.isHiddenWithParent))),s=le(()=>Dn(r)&&Dn(o)),a=le(()=>qi("MODAL")-1);to(t,{get target(){return Dn(i).portalTarget},children:(t,e)=>{var n=qn(),i=We(n),r=t=>{var e=Fo();let n;je(()=>n=ki(e,"",n,{"z-index":Dn(a)})),gi(3,e,()=>Po,()=>({duration:200})),jn(t,e)};ni(i,t=>{Dn(s)&&t(r)}),jn(t,n)},$$slots:{default:!0}}),Bt()}export{qo as B,Ho as D,zo as M,Qn as a,Li as b,ji as c,er as d,_r as e,yr as f,Ri as g,xr as h,Fi as i,Dr as j,Lr as k,kr as l,Gn as m,Fr as n,Ir as o,$r as p,Pr as q,mr as r,Ai as s,Ui as t,wr as u,Hr as v,qr as w,$o as x};
|
|
1
|
+
var t,e,n,i,r,o,s,a,l,d,u,c,f,h,p,v,g,m,w,y,x,b,M,z,k,I,_,P,D,C,S,O,E,W,T,B,R,A,L,H,$,F,q=Object.defineProperty,j=t=>{throw TypeError(t)},X=(t,e,n)=>((t,e,n)=>e in t?q(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n)(t,"symbol"!=typeof e?e+"":e,n),Y=(t,e,n)=>e.has(t)||j("Cannot "+n),N=(t,e,n)=>(Y(t,e,"read from private field"),n?n.call(t):e.get(t)),K=(t,e,n)=>e.has(t)?j("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),G=(t,e,n,i)=>(Y(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n),V=(t,e,n)=>(Y(t,e,"access private method"),n),U=Array.isArray,Q=Array.prototype.indexOf,J=Array.from,Z=Object.defineProperty,tt=Object.getOwnPropertyDescriptor,et=Object.getOwnPropertyDescriptors,nt=Object.prototype,it=Array.prototype,rt=Object.getPrototypeOf,ot=Object.isExtensible;const st=()=>{};function at(){var t,e;return{promise:new Promise((n,i)=>{t=n,e=i}),resolve:t,reject:e}}const lt=16,dt=512,ut=1024,ct=2048,ft=4096,ht=8192,pt=16384,vt=32768,gt=65536,mt=1<<18,wt=1<<19,yt=1<<25,xt=32768,bt=1<<21,Mt=1<<23,zt=Symbol("$state"),kt=Symbol(""),It=new class extends Error{constructor(){super(...arguments),X(this,"name","StaleReactionError"),X(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function _t(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}const Pt=Symbol();function Dt(t){return t===this.v}function Ct(t,e){return t!=t?e==e:t!==e||null!==t&&"object"==typeof t||"function"==typeof t}function St(t){return!Ct(t,this.v)}let Ot=null;function Et(t){Ot=t}function Wt(t){return Rt().get(t)}function Tt(t,e=!1,n){Ot={p:Ot,i:!1,c:null,e:null,s:t,x:null,l:null}}function Bt(t){var e=Ot,n=e.e;if(null!==n)for(var i of(e.e=null,n))$e(i);return void 0!==t&&(e.x=t),e.i=!0,Ot=e.p,t??{}}function Rt(t){return null===Ot&&_t(),Ot.c??(Ot.c=new Map(function(){let t=Ot.p;for(;null!==t;){const e=t.c;if(null!==e)return e;t=t.p}return null}()||void 0))}let At=[];function Lt(){var t=At;At=[],function(t){for(var e=0;e<t.length;e++)t[e]()}(t)}function Ht(t){if(0===At.length&&!Vt){var e=At;queueMicrotask(()=>{e===At&&Lt()})}At.push(t)}function $t(){for(;At.length>0;)Lt()}function Ft(t){var e=dn;if(null===e)return sn.f|=Mt,t;if(0===(e.f&vt)){if(!(128&e.f))throw t;e.b.error(t)}else qt(t,e)}function qt(t,e){for(;null!==e;){if(128&e.f)try{return void e.b.error(t)}catch(e){t=e}e=e.parent}throw t}const jt=new Set;let Xt=null,Yt=null,Nt=[],Kt=null,Gt=!1,Vt=!1;t=new WeakMap,e=new WeakMap,n=new WeakMap,i=new WeakMap,r=new WeakMap,o=new WeakMap,s=new WeakMap,a=new WeakSet,l=function(t,e){var n;t.f^=ut;for(var i=t.first;null!==i;){var r=i.f,s=!!(96&r),l=s&&0!==(r&ut)||0!==(r&ht)||this.skipped_effects.has(i);if(!!(128&i.f)&&(null==(n=i.b)?void 0:n.is_pending())&&(e={parent:e,effect:i,effects:[],render_effects:[]}),!l&&null!==i.fn){s?i.f^=ut:4&r?e.effects.push(i):bn(i)&&(0!==(i.f<)&&N(this,o).add(i),_n(i));var u=i.first;if(null!==u){i=u;continue}}var c=i.parent;for(i=i.next;null===i&&null!==c;)c===e.effect&&(V(this,a,d).call(this,e.effects),V(this,a,d).call(this,e.render_effects),e=e.parent),i=c.next,c=c.parent}},d=function(t){for(const e of t)0!==(e.f&ct)?N(this,o).add(e):0!==(e.f&ft)&&N(this,s).add(e),V(this,a,u).call(this,e.deps),Wn(e,ut)},u=function(t){if(null!==t)for(const e of t)2&e.f&&0!==(e.f&xt)&&(e.f^=xt,V(this,a,u).call(this,e.deps))},c=function(){if(0===N(this,i)){for(const e of N(this,t))e();N(this,t).clear()}0===N(this,n)&&V(this,a,f).call(this)},f=function(){var t;if(jt.size>1){this.previous.clear();var e=Yt,n=!0,i={parent:null,effect:null,effects:[],render_effects:[]};for(const e of jt){if(e===this){n=!1;continue}const o=[];for(const[t,i]of this.current){if(e.current.has(t)){if(!n||i===e.current.get(t))continue;e.current.set(t,i)}o.push(t)}if(0===o.length)continue;const s=[...e.current.keys()].filter(t=>!this.current.has(t));if(s.length>0){var r=Nt;Nt=[];const n=new Set,d=new Map;for(const t of o)ee(t,s,n,d);if(Nt.length>0){Xt=e,e.apply();for(const n of Nt)V(t=e,a,l).call(t,n,i);e.deactivate()}Nt=r}}Xt=null,Yt=e}this.committed=!0,jt.delete(this)};let Ut=class u{constructor(){K(this,a),X(this,"committed",!1),X(this,"current",new Map),X(this,"previous",new Map),K(this,t,new Set),K(this,e,new Set),K(this,n,0),K(this,i,0),K(this,r,null),K(this,o,new Set),K(this,s,new Set),X(this,"skipped_effects",new Set),X(this,"is_fork",!1)}is_deferred(){return this.is_fork||N(this,i)>0}process(t){var e;Nt=[],this.apply();var n={parent:null,effect:null,effects:[],render_effects:[]};for(const e of t)V(this,a,l).call(this,e,n);this.is_fork||V(this,a,c).call(this),this.is_deferred()?(V(this,a,d).call(this,n.effects),V(this,a,d).call(this,n.render_effects)):(Xt=null,te(n.render_effects),te(n.effects),null==(e=N(this,r))||e.resolve()),Yt=null}capture(t,e){this.previous.has(t)||this.previous.set(t,e),0===(t.f&Mt)&&(this.current.set(t,t.v),null==Yt||Yt.set(t,t.v))}activate(){Xt=this,this.apply()}deactivate(){Xt===this&&(Xt=null,Yt=null)}flush(){if(this.activate(),Nt.length>0){if(Qt(),null!==Xt&&Xt!==this)return}else 0===N(this,n)&&this.process([]);this.deactivate()}discard(){for(const t of N(this,e))t(this);N(this,e).clear()}increment(t){G(this,n,N(this,n)+1),t&&G(this,i,N(this,i)+1)}decrement(t){G(this,n,N(this,n)-1),t&&G(this,i,N(this,i)-1),this.revive()}revive(){for(const t of N(this,o))N(this,s).delete(t),Wn(t,ct),ie(t);for(const t of N(this,s))Wn(t,ft),ie(t);this.flush()}oncommit(e){N(this,t).add(e)}ondiscard(t){N(this,e).add(t)}settled(){return(N(this,r)??G(this,r,at())).promise}static ensure(){if(null===Xt){const t=Xt=new u;jt.add(Xt),Vt||u.enqueue(()=>{Xt===t&&t.flush()})}return Xt}static enqueue(t){Ht(t)}apply(){}};function Qt(){var t=en;Gt=!0;try{var e=0;for(nn(!0);Nt.length>0;){var n=Ut.ensure();e++>1e3&&Jt(),n.process(Nt),pe.clear()}}finally{Gt=!1,nn(t),Kt=null}}function Jt(){try{!function(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}()}catch(t){qt(t,Kt)}}let Zt=null;function te(t){var e=t.length;if(0!==e){for(var n=0;n<e;){var i=t[n++];if(!(24576&i.f)&&bn(i)&&(Zt=new Set,_n(i),null===i.deps&&null===i.first&&null===i.nodes&&(null===i.teardown&&null===i.ac?Ve(i):i.fn=null),(null==Zt?void 0:Zt.size)>0)){pe.clear();for(const t of Zt){if(24576&t.f)continue;const e=[t];let n=t.parent;for(;null!==n;)Zt.has(n)&&(Zt.delete(n),e.push(n)),n=n.parent;for(let t=e.length-1;t>=0;t--){const n=e[t];24576&n.f||_n(n)}}Zt.clear()}}Zt=null}}function ee(t,e,n,i){if(!n.has(t)&&(n.add(t),null!==t.reactions))for(const r of t.reactions){const t=r.f;2&t?ee(r,e,n,i):4194320&t&&0===(t&ct)&&ne(r,e,i)&&(Wn(r,ct),ie(r))}}function ne(t,e,n){const i=n.get(t);if(void 0!==i)return i;if(null!==t.deps)for(const i of t.deps){if(e.includes(i))return!0;if(2&i.f&&ne(i,e,n))return n.set(i,!0),!0}return n.set(t,!1),!1}function ie(t){for(var e=Kt=t;null!==e.parent;){var n=(e=e.parent).f;if(Gt&&e===dn&&0!==(n<)&&0===(n&mt))return;if(96&n){if(0===(n&ut))return;e.f^=ut}}Nt.push(e)}class re{constructor(t,e,n){K(this,C),X(this,"parent"),K(this,h,!1),K(this,p),K(this,v,null),K(this,g),K(this,m),K(this,w),K(this,y,null),K(this,x,null),K(this,b,null),K(this,M,null),K(this,z,null),K(this,k,0),K(this,I,0),K(this,_,!1),K(this,P,null),K(this,D,function(t){let e,n=0,i=ge(0);return()=>{Ae()&&(Dn(i),qe(()=>(0===n&&(e=On(()=>t())),n+=1,()=>{Ht(()=>{n-=1,0===n&&(null==e||e(),e=void 0,Me(i))})})))}}(()=>(G(this,P,ge(N(this,k))),()=>{G(this,P,null)}))),G(this,p,t),G(this,g,e),G(this,m,n),this.parent=dn.b,G(this,h,!!N(this,g).pending),G(this,w,Xe(()=>{dn.b=this;var t=V(this,C,S).call(this);try{G(this,y,Ye(()=>n(t)))}catch(t){this.error(t)}return N(this,I)>0?V(this,C,E).call(this):G(this,h,!1),()=>{var t;null==(t=N(this,z))||t.remove()}},589952))}is_pending(){return N(this,h)||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!N(this,g).pending}update_pending_count(t){V(this,C,W).call(this,t),G(this,k,N(this,k)+t),N(this,P)&&xe(N(this,P),N(this,k))}get_effect_pending(){return N(this,D).call(this),Dn(N(this,P))}error(t){var e=N(this,g).onerror;let n=N(this,g).failed;if(N(this,_)||!e&&!n)throw t;N(this,y)&&(Ge(N(this,y)),G(this,y,null)),N(this,x)&&(Ge(N(this,x)),G(this,x,null)),N(this,b)&&(Ge(N(this,b)),G(this,b,null));var i=!1,r=!1;const o=()=>{i||(i=!0,r&&function(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}(),Ut.ensure(),G(this,k,0),null!==N(this,b)&&Ue(N(this,b),()=>{G(this,b,null)}),G(this,h,this.has_pending_snippet()),G(this,y,V(this,C,O).call(this,()=>(G(this,_,!1),Ye(()=>N(this,m).call(this,N(this,p)))))),N(this,I)>0?V(this,C,E).call(this):G(this,h,!1))};var s=sn;try{ln(null),r=!0,null==e||e(t,o),r=!1}catch(t){qt(t,N(this,w)&&N(this,w).parent)}finally{ln(s)}n&&Ht(()=>{G(this,b,V(this,C,O).call(this,()=>{Ut.ensure(),G(this,_,!0);try{return Ye(()=>{n(N(this,p),()=>t,()=>o)})}catch(t){return qt(t,N(this,w).parent),null}finally{G(this,_,!1)}}))})}}function oe(){un(null),ln(null),Et(null)}function se(t){var e=null!==sn&&2&sn.f?sn:null;return null!==dn&&(dn.f|=wt),{ctx:Ot,deps:null,effects:null,equals:Dt,f:2050,fn:t,reactions:null,rv:0,v:Pt,wv:0,parent:e??dn,ac:null}}function ae(t,e){let n=dn;null===n&&function(){throw new Error("https://svelte.dev/e/async_derived_orphan")}();var i=n.b,r=void 0,o=ge(Pt),s=!sn,a=new Map;return function(t){Re(4718592,t,!0)}(()=>{var e,n=at();r=n.promise;try{Promise.resolve(t()).then(n.resolve,n.reject).then(()=>{l===Xt&&l.committed&&l.deactivate(),oe()})}catch(t){n.reject(t),oe()}var l=Xt;if(s){var d=!i.is_pending();i.update_pending_count(1),l.increment(d),null==(e=a.get(l))||e.reject(It),a.delete(l),a.set(l,n)}const u=(t,e=void 0)=>{if(l.activate(),e)e!==It&&(o.f|=Mt,xe(o,e));else{0!==(o.f&Mt)&&(o.f^=Mt),xe(o,t);for(const[t,e]of a){if(a.delete(t),t===l)break;e.reject(It)}}s&&(i.update_pending_count(-1),l.decrement(d))};n.promise.then(u,t=>u(null,t||"unknown"))}),Le(()=>{for(const t of a.values())t.reject(It)}),new Promise(t=>{!function e(n){function i(){n===r?t(o):e(r)}n.then(i,i)}(r)})}function le(t){const e=se(t);return fn(e),e}function de(t){const e=se(t);return e.equals=St,e}function ue(t){var e=t.effects;if(null!==e){t.effects=null;for(var n=0;n<e.length;n+=1)Ge(e[n])}}function ce(t){var e,n=dn;un(function(t){for(var e=t.parent;null!==e;){if(!(2&e.f))return 0===(e.f&pt)?e:null;e=e.parent}return null}(t));try{t.f&=-32769,ue(t),e=zn(t)}finally{un(n)}return e}function fe(t){var e=ce(t);t.equals(e)||((null==Xt?void 0:Xt.is_fork)||(t.v=e),t.wv=xn()),rn||(null!==Yt?(Ae()||(null==Xt?void 0:Xt.is_fork))&&Yt.set(t,e):Wn(t,0===(t.f&dt)?ft:ut))}h=new WeakMap,p=new WeakMap,v=new WeakMap,g=new WeakMap,m=new WeakMap,w=new WeakMap,y=new WeakMap,x=new WeakMap,b=new WeakMap,M=new WeakMap,z=new WeakMap,k=new WeakMap,I=new WeakMap,_=new WeakMap,P=new WeakMap,D=new WeakMap,C=new WeakSet,S=function(){var t=N(this,p);return N(this,h)&&(G(this,z,Ce()),N(this,p).before(N(this,z)),t=N(this,z)),t},O=function(t){var e=dn,n=sn,i=Ot;un(N(this,w)),ln(N(this,w)),Et(N(this,w).ctx);try{return t()}catch(t){return Ft(t),null}finally{un(e),ln(n),Et(i)}},E=function(){const t=N(this,g).pending;null!==N(this,y)&&(G(this,M,document.createDocumentFragment()),N(this,M).append(N(this,z)),tn(N(this,y),N(this,M))),null===N(this,x)&&G(this,x,Ye(()=>t(N(this,p))))},W=function(t){var e;this.has_pending_snippet()?(G(this,I,N(this,I)+t),0===N(this,I)&&(G(this,h,!1),N(this,x)&&Ue(N(this,x),()=>{G(this,x,null)}),N(this,M)&&(N(this,p).before(N(this,M)),G(this,M,null)))):this.parent&&V(e=this.parent,C,W).call(e,t)};let he=new Set;const pe=new Map;let ve=!1;function ge(t,e){return{f:0,v:t,reactions:null,equals:Dt,rv:0,wv:0}}function me(t,e){const n=ge(t);return fn(n),n}function we(t,e=!1,n=!0){const i=ge(t);return e||(i.equals=St),i}function ye(t,e,n=!1){return null===sn||an&&!(131072&sn.f)||!(4325394&sn.f)||(null==cn?void 0:cn.includes(t))||function(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}(),xe(t,n?ke(e):e)}function xe(t,e){if(!t.equals(e)){var n=t.v;rn?pe.set(t,e):pe.set(t,n),t.v=e;var i=Ut.ensure();i.capture(t,n),2&t.f&&(0!==(t.f&ct)&&ce(t),Wn(t,0!==(t.f&dt)?ut:ft)),t.wv=xn(),ze(t,ct),null===dn||0===(dn.f&ut)||96&dn.f||(null===vn?function(t){vn=t}([t]):vn.push(t)),!i.is_fork&&he.size>0&&!ve&&function(){ve=!1;var t=en;nn(!0);const e=Array.from(he);try{for(const t of e)0!==(t.f&ut)&&Wn(t,ft),bn(t)&&_n(t)}finally{nn(t)}he.clear()}()}return e}function be(t,e=1){var n=Dn(t),i=1===e?n++:n--;return ye(t,n),i}function Me(t){ye(t,t.v+1)}function ze(t,e){var n=t.reactions;if(null!==n)for(var i=n.length,r=0;r<i;r++){var o=n[r],s=o.f,a=0===(s&ct);if(a&&Wn(o,e),2&s){var l=o;null==Yt||Yt.delete(l),0===(s&xt)&&(s&dt&&(o.f|=xt),ze(l,ft))}else a&&(0!==(s<)&&null!==Zt&&Zt.add(o),ie(o))}}function ke(t){if("object"!=typeof t||null===t||zt in t)return t;const e=rt(t);if(e!==nt&&e!==it)return t;var n=new Map,i=U(t),r=me(0),o=wn,s=t=>{if(wn===o)return t();var e=sn,n=wn;ln(null),yn(o);var i=t();return ln(e),yn(n),i};return i&&n.set("length",me(t.length)),new Proxy(t,{defineProperty(t,e,i){"value"in i&&!1!==i.configurable&&!1!==i.enumerable&&!1!==i.writable||function(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}();var r=n.get(e);return void 0===r?r=s(()=>{var t=me(i.value);return n.set(e,t),t}):ye(r,i.value,!0),!0},deleteProperty(t,e){var i=n.get(e);if(void 0===i){if(e in t){const t=s(()=>me(Pt));n.set(e,t),Me(r)}}else ye(i,Pt),Me(r);return!0},get(e,i,r){var o;if(i===zt)return t;var a=n.get(i),l=i in e;if(void 0!==a||l&&!(null==(o=tt(e,i))?void 0:o.writable)||(a=s(()=>me(ke(l?e[i]:Pt))),n.set(i,a)),void 0!==a){var d=Dn(a);return d===Pt?void 0:d}return Reflect.get(e,i,r)},getOwnPropertyDescriptor(t,e){var i=Reflect.getOwnPropertyDescriptor(t,e);if(i&&"value"in i){var r=n.get(e);r&&(i.value=Dn(r))}else if(void 0===i){var o=n.get(e),s=null==o?void 0:o.v;if(void 0!==o&&s!==Pt)return{enumerable:!0,configurable:!0,value:s,writable:!0}}return i},has(t,e){var i;if(e===zt)return!0;var r=n.get(e),o=void 0!==r&&r.v!==Pt||Reflect.has(t,e);return!((void 0!==r||null!==dn&&(!o||(null==(i=tt(t,e))?void 0:i.writable)))&&(void 0===r&&(r=s(()=>me(o?ke(t[e]):Pt)),n.set(e,r)),Dn(r)===Pt))&&o},set(t,e,o,a){var l,d=n.get(e),u=e in t;if(i&&"length"===e)for(var c=o;c<d.v;c+=1){var f=n.get(c+"");void 0!==f?ye(f,Pt):c in t&&(f=s(()=>me(Pt)),n.set(c+"",f))}void 0===d?u&&!(null==(l=tt(t,e))?void 0:l.writable)||(ye(d=s(()=>me(void 0)),ke(o)),n.set(e,d)):(u=d.v!==Pt,ye(d,s(()=>ke(o))));var h=Reflect.getOwnPropertyDescriptor(t,e);if((null==h?void 0:h.set)&&h.set.call(a,o),!u){if(i&&"string"==typeof e){var p=n.get("length"),v=Number(e);Number.isInteger(v)&&v>=p.v&&ye(p,v+1)}Me(r)}return!0},ownKeys(t){Dn(r);var e=Reflect.ownKeys(t).filter(t=>{var e=n.get(t);return void 0===e||e.v!==Pt});for(var[i,o]of n)o.v===Pt||i in t||e.push(i);return e},setPrototypeOf(){!function(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}()}})}var Ie,_e,Pe,De;function Ce(t=""){return document.createTextNode(t)}function Se(t){return Pe.call(t)}function Oe(t){return De.call(t)}function Ee(t,e){return Se(t)}function We(t,e=!1){var n=Se(t);return n instanceof Comment&&""===n.data?Oe(n):n}function Te(t,e=1,n=!1){let i=t;for(;e--;)i=Oe(i);return i}function Be(t){var e=sn,n=dn;ln(null),un(null);try{return t()}finally{ln(e),un(n)}}function Re(t,e,n){var i=dn;null!==i&&0!==(i.f&ht)&&(t|=ht);var r={ctx:Ot,deps:null,nodes:null,f:t|ct|dt,first:null,fn:e,last:null,next:null,parent:i,b:i&&i.b,prev:null,teardown:null,wv:0,ac:null};if(n)try{_n(r),r.f|=vt}catch(t){throw Ge(r),t}else null!==e&&ie(r);var o=r;if(n&&null===o.deps&&null===o.teardown&&null===o.nodes&&o.first===o.last&&0===(o.f&wt)&&(o=o.first,0!==(t<)&&0!==(t>)&&null!==o&&(o.f|=gt)),null!==o&&(o.parent=i,null!==i&&function(t,e){var n=e.last;null===n?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}(o,i),null!==sn&&2&sn.f&&!(64&t))){var s=sn;(s.effects??(s.effects=[])).push(o)}return r}function Ae(){return null!==sn&&!an}function Le(t){const e=Re(8,null,!1);return Wn(e,ut),e.teardown=t,e}function He(t){null===dn&&(null===sn&&function(){throw new Error("https://svelte.dev/e/effect_orphan")}(),function(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}()),rn&&function(){throw new Error("https://svelte.dev/e/effect_in_teardown")}();var e=dn.f;if(sn||!(32&e)||0!==(e&vt))return $e(t);var n=Ot;(n.e??(n.e=[])).push(t)}function $e(t){return Re(1048580,t,!1)}function Fe(t){return Re(4,t,!1)}function qe(t,e=0){return Re(8|e,t,!0)}function je(t,e=[],n=[],i=[]){!function(t,e,n,i){const r=se;if(0!==n.length||0!==t.length){var o,s,a,l,d=Xt,u=dn,c=(o=dn,s=sn,a=Ot,l=Xt,function(t=!0){un(o),ln(s),Et(a),t&&(null==l||l.activate())});t.length>0?Promise.all(t).then(()=>{c();try{return f()}finally{null==d||d.deactivate(),oe()}}):f()}else i(e.map(r));function f(){Promise.all(n.map(t=>ae(t))).then(t=>{c();try{i([...e.map(r),...t])}catch(t){0===(u.f&pt)&&qt(t,u)}null==d||d.deactivate(),oe()}).catch(t=>{qt(t,u)})}}(i,e,n,e=>{Re(8,()=>t(...e.map(Dn)),!0)})}function Xe(t,e=0){return Re(lt|e,t,!0)}function Ye(t){return Re(524320,t,!0)}function Ne(t){var e=t.teardown;if(null!==e){const t=rn,n=sn;on(!0),ln(null);try{e.call(null)}finally{on(t),ln(n)}}}function Ke(t,e=!1){var n=t.first;for(t.first=t.last=null;null!==n;){const t=n.ac;null!==t&&Be(()=>{t.abort(It)});var i=n.next;64&n.f?n.parent=null:Ge(n,e),n=i}}function Ge(t,e=!0){var n=!1;!e&&0===(t.f&mt)||null===t.nodes||null===t.nodes.end||(function(t,e){for(;null!==t;){var n=t===e?null:Oe(t);t.remove(),t=n}}(t.nodes.start,t.nodes.end),n=!0),Ke(t,e&&!n),In(t,0),Wn(t,pt);var i=t.nodes&&t.nodes.t;if(null!==i)for(const t of i)t.stop();Ne(t);var r=t.parent;null!==r&&null!==r.first&&Ve(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=null}function Ve(t){var e=t.parent,n=t.prev,i=t.next;null!==n&&(n.next=i),null!==i&&(i.prev=n),null!==e&&(e.first===t&&(e.first=i),e.last===t&&(e.last=n))}function Ue(t,e,n=!0){var i=[];Qe(t,i,!0);var r=()=>{n&&Ge(t),e&&e()},o=i.length;if(o>0){var s=()=>--o||r();for(var a of i)a.out(s)}else r()}function Qe(t,e,n){if(0===(t.f&ht)){t.f^=ht;var i=t.nodes&&t.nodes.t;if(null!==i)for(const t of i)(t.is_global||n)&&e.push(t);for(var r=t.first;null!==r;){var o=r.next;Qe(r,e,!!(0!==(r.f>)||32&r.f&&0!==(t.f<))&&n),r=o}}}function Je(t){Ze(t,!0)}function Ze(t,e){if(0!==(t.f&ht)){t.f^=ht,0===(t.f&ut)&&(Wn(t,ct),ie(t));for(var n=t.first;null!==n;){var i=n.next;Ze(n,!!(0!==(n.f>)||32&n.f)&&e),n=i}var r=t.nodes&&t.nodes.t;if(null!==r)for(const t of r)(t.is_global||e)&&t.in()}}function tn(t,e){if(t.nodes)for(var n=t.nodes.start,i=t.nodes.end;null!==n;){var r=n===i?null:Oe(n);e.append(n),n=r}}let en=!1;function nn(t){en=t}let rn=!1;function on(t){rn=t}let sn=null,an=!1;function ln(t){sn=t}let dn=null;function un(t){dn=t}let cn=null;function fn(t){null!==sn&&(null===cn?cn=[t]:cn.push(t))}let hn=null,pn=0,vn=null,gn=1,mn=0,wn=mn;function yn(t){wn=t}function xn(){return++gn}function bn(t){var e=t.f;if(0!==(e&ct))return!0;if(2&e&&(t.f&=-32769),0!==(e&ft)){var n=t.deps;if(null!==n)for(var i=n.length,r=0;r<i;r++){var o=n[r];if(bn(o)&&fe(o),o.wv>t.wv)return!0}0!==(e&dt)&&null===Yt&&Wn(t,ut)}return!1}function Mn(t,e,n=!0){var i=t.reactions;if(null!==i&&!(null==cn?void 0:cn.includes(t)))for(var r=0;r<i.length;r++){var o=i[r];2&o.f?Mn(o,e,!1):e===o&&(n?Wn(o,ct):0!==(o.f&ut)&&Wn(o,ft),ie(o))}}function zn(t){var e,n=hn,i=pn,r=vn,o=sn,s=cn,a=Ot,l=an,d=wn,u=t.f;hn=null,pn=0,vn=null,sn=96&u?null:t,cn=null,Et(t.ctx),an=!1,wn=++mn,null!==t.ac&&(Be(()=>{t.ac.abort(It)}),t.ac=null);try{t.f|=bt;var c=(0,t.fn)(),f=t.deps;if(null!==hn){var h;if(In(t,pn),null!==f&&pn>0)for(f.length=pn+hn.length,h=0;h<hn.length;h++)f[pn+h]=hn[h];else t.deps=f=hn;if(Ae()&&0!==(t.f&dt))for(h=pn;h<f.length;h++)((e=f[h]).reactions??(e.reactions=[])).push(t)}else null!==f&&pn<f.length&&(In(t,pn),f.length=pn);if(!(null===vn||an||null===f||6146&t.f))for(h=0;h<vn.length;h++)Mn(vn[h],t);return null!==o&&o!==t&&(mn++,null!==vn&&(null===r?r=vn:r.push(...vn))),0!==(t.f&Mt)&&(t.f^=Mt),c}catch(t){return Ft(t)}finally{t.f^=bt,hn=n,pn=i,vn=r,sn=o,cn=s,Et(a),an=l,wn=d}}function kn(t,e){let n=e.reactions;if(null!==n){var i=Q.call(n,t);if(-1!==i){var r=n.length-1;0===r?n=e.reactions=null:(n[i]=n[r],n.pop())}}null===n&&2&e.f&&(null===hn||!hn.includes(e))&&(Wn(e,ft),0!==(e.f&dt)&&(e.f^=dt,e.f&=-32769),ue(e),In(e,0))}function In(t,e){var n=t.deps;if(null!==n)for(var i=e;i<n.length;i++)kn(t,n[i])}function _n(t){var e=t.f;if(0===(e&pt)){Wn(t,ut);var n=dn,i=en;dn=t,en=!0;try{16777232&e?function(t){for(var e=t.first;null!==e;){var n=e.next;!(32&e.f)&&Ge(e),e=n}}(t):Ke(t),Ne(t);var r=zn(t);t.teardown="function"==typeof r?r:null,t.wv=gn}finally{en=i,dn=n}}}async function Pn(){await Promise.resolve(),function(){var t=Vt;Vt=!0;try{for(;;){if($t(),0===Nt.length&&(null==Xt||Xt.flush(),0===Nt.length))return void(Kt=null);Qt()}}finally{Vt=t}}()}function Dn(t){var e=!!(2&t.f);if(!(null===sn||an||null!==dn&&0!==(dn.f&pt)||(null==cn?void 0:cn.includes(t)))){var n=sn.deps;if(0!==(sn.f&bt))t.rv<mn&&(t.rv=mn,null===hn&&null!==n&&n[pn]===t?pn++:null===hn?hn=[t]:hn.includes(t)||hn.push(t));else{(sn.deps??(sn.deps=[])).push(t);var i=t.reactions;null===i?t.reactions=[sn]:i.includes(sn)||i.push(sn)}}if(rn){if(pe.has(t))return pe.get(t);if(e){var r=t,o=r.v;return(0===(r.f&ut)&&null!==r.reactions||Sn(r))&&(o=ce(r)),pe.set(r,o),o}}else e&&(!(null==Yt?void 0:Yt.has(t))||(null==Xt?void 0:Xt.is_fork)&&!Ae())&&(bn(r=t)&&fe(r),en&&Ae()&&0===(r.f&dt)&&Cn(r));if(null==Yt?void 0:Yt.has(t))return Yt.get(t);if(0!==(t.f&Mt))throw t.v;return t.v}function Cn(t){if(null!==t.deps){t.f^=dt;for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),2&e.f&&0===(e.f&dt)&&Cn(e)}}function Sn(t){if(t.v===Pt)return!0;if(null===t.deps)return!1;for(const e of t.deps){if(pe.has(e))return!0;if(2&e.f&&Sn(e))return!0}return!1}function On(t){var e=an;try{return an=!0,t()}finally{an=e}}const En=-7169;function Wn(t,e){t.f=t.f&En|e}function Tn(t,e=new Set){if(!("object"!=typeof t||null===t||t instanceof EventTarget||e.has(t))){e.add(t),t instanceof Date&&t.getTime();for(let n in t)try{Tn(t[n],e)}catch(t){}const n=rt(t);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const e=et(n);for(let n in e){const i=e[n].get;if(i)try{i.call(t)}catch(t){}}}}}const Bn=["touchstart","touchmove"];function Rn(t){return Bn.includes(t)}const An=new Set,Ln=new Set;function Hn(t){for(var e=0;e<t.length;e++)An.add(t[e]);for(var n of Ln)n(t)}let $n=null;function Fn(t){var e,n=this,i=n.ownerDocument,r=t.type,o=(null==(e=t.composedPath)?void 0:e.call(t))||[],s=o[0]||t.target;$n=t;var a=0,l=$n===t&&t.__root;if(l){var d=o.indexOf(l);if(-1!==d&&(n===document||n===window))return void(t.__root=n);var u=o.indexOf(n);if(-1===u)return;d<=u&&(a=d)}if((s=o[a]||t.target)!==n){Z(t,"currentTarget",{configurable:!0,get:()=>s||i});var c=sn,f=dn;ln(null),un(null);try{for(var h,p=[];null!==s;){var v=s.assignedSlot||s.parentNode||s.host||null;try{var g=s["__"+r];null==g||s.disabled&&t.target!==s||g.call(s,t)}catch(t){h?p.push(t):h=t}if(t.cancelBubble||v===n||null===v)break;s=v}if(h){for(let t of p)queueMicrotask(()=>{throw t});throw h}}finally{t.__root=n,delete t.currentTarget,ln(c),un(f)}}}function qn(t,e){var n=dn;null===n.nodes&&(n.nodes={start:t,end:e,a:null,t:null})}function jn(t,e){var n,i=!!(1&e),r=!!(2&e),o=!t.startsWith("<!>");return()=>{var e,s;void 0===n&&(e=o?t:"<!>"+t,(s=document.createElement("template")).innerHTML=e.replaceAll("<!>","\x3c!----\x3e"),n=s.content,i||(n=Se(n)));var a=r||_e?document.importNode(n,!0):n.cloneNode(!0);return i?qn(Se(a),a.lastChild):qn(a,a),a}}function Xn(){var t=document.createDocumentFragment(),e=document.createComment(""),n=Ce();return t.append(e,n),qn(e,n),t}function Yn(t,e){null!==t&&t.before(e)}let Nn=!0;function Kn(t,e){var n=null==e?"":"object"==typeof e?e+"":e;n!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=n,t.nodeValue=n+"")}function Gn(t,e){return function(t,{target:e,anchor:n,props:i={},events:r,context:o,intro:s=!0}){!function(){if(void 0===Ie){Ie=window,_e=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;Pe=tt(e,"firstChild").get,De=tt(e,"nextSibling").get,ot(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),ot(n)&&(n.__t=void 0)}}();var a=new Set,l=t=>{for(var n=0;n<t.length;n++){var i=t[n];if(!a.has(i)){a.add(i);var r=Rn(i);e.addEventListener(i,Fn,{passive:r});var o=Vn.get(i);void 0===o?(document.addEventListener(i,Fn,{passive:r}),Vn.set(i,1)):Vn.set(i,o+1)}}};l(J(An)),Ln.add(l);var d=void 0,u=function(){Ut.ensure();const u=Re(524352,()=>{var u=n??e.appendChild(Ce());return new re(u,{pending:()=>{}},e=>{o&&(Tt({}),Ot.c=o),r&&(i.$$events=r),Nn=s,d=t(e,i)||{},Nn=!0,o&&Bt()}),()=>{var t;for(var i of a){e.removeEventListener(i,Fn);var r=Vn.get(i);0===--r?(document.removeEventListener(i,Fn),Vn.delete(i)):Vn.set(i,r)}Ln.delete(l),u!==n&&(null==(t=u.parentNode)||t.removeChild(u))}},!0);return(t={})=>new Promise(e=>{t.outro?Ue(u,()=>{Ge(u),e(void 0)}):(Ge(u),e(void 0))})}();return Un.set(d,u),d}(t,e)}const Vn=new Map;let Un=new WeakMap;function Qn(t,e){const n=Un.get(t);return n?(Un.delete(t),n(e)):Promise.resolve()}class Jn{constructor(t,e=!0){X(this,"anchor"),K(this,T,new Map),K(this,B,new Map),K(this,R,new Map),K(this,A,new Set),K(this,L,!0),K(this,H,()=>{var t=Xt;if(N(this,T).has(t)){var e=N(this,T).get(t),n=N(this,B).get(e);if(n)Je(n),N(this,A).delete(e);else{var i=N(this,R).get(e);i&&(N(this,B).set(e,i.effect),N(this,R).delete(e),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),n=i.effect)}for(const[e,n]of N(this,T)){if(N(this,T).delete(e),e===t)break;const i=N(this,R).get(n);i&&(Ge(i.effect),N(this,R).delete(n))}for(const[t,i]of N(this,B)){if(t===e||N(this,A).has(t))continue;const r=()=>{if(Array.from(N(this,T).values()).includes(t)){var e=document.createDocumentFragment();tn(i,e),e.append(Ce()),N(this,R).set(t,{effect:i,fragment:e})}else Ge(i);N(this,A).delete(t),N(this,B).delete(t)};N(this,L)||!n?(N(this,A).add(t),Ue(i,r,!1)):r()}}}),K(this,$,t=>{N(this,T).delete(t);const e=Array.from(N(this,T).values());for(const[t,n]of N(this,R))e.includes(t)||(Ge(n.effect),N(this,R).delete(t))}),this.anchor=t,G(this,L,e)}ensure(t,e){var n=Xt;!e||N(this,B).has(t)||N(this,R).has(t)||N(this,B).set(t,Ye(()=>e(this.anchor))),N(this,T).set(n,t),N(this,H).call(this)}}function Zn(t,e,n=!1){var i=new Jn(t);function r(t,e){i.ensure(t,e)}Xe(()=>{var t=!1;e((e,n=!0)=>{t=!0,r(n,e)}),t||r(!1,null)},n?gt:0)}function ti(t,e){return e}function ei(t,e=!0){for(var n=0;n<t.length;n++)Ge(t[n],e)}var ni;function ii(t,e,n,i,r,o=null){var s=t,a=new Map;!(4&e)||(s=t.appendChild(Ce()));var l,d=null,u=de(()=>{var t=n();return U(t)?t:null==t?[]:J(t)}),c=!0,f={effect:Xe(()=>{for(var t=(l=Dn(u)).length,h=new Set,p=0;p<t;p+=1){var v=l[p],g=i(v,p),m=c?null:a.get(g);m?(m.v&&xe(m.v,v),m.i&&xe(m.i,p)):(m=ri(a,c?s:ni??(ni=Ce()),v,g,p,r,e,n),c||(m.e.f|=yt),a.set(g,m)),h.add(g)}0===t&&o&&!d&&(c?d=Ye(()=>o(s)):(d=Ye(()=>o(ni??(ni=Ce())))).f|=yt),c||(f.fallback=d,function(t,e,n,i,r){var o,s,a,l,d,u,c,f,h,p,v,g,m,w,y=!!(8&i),x=e.length,b=t.items,M=t.effect.first,z=null,k=[],I=[];if(y)for(w=0;w<x;w+=1)g=r(e[w],w),0===((m=b.get(g).e).f&yt)&&(null==(s=null==(o=m.nodes)?void 0:o.a)||s.measure(),(v??(v=new Set)).add(m));for(w=0;w<x;w+=1){if(g=r(e[w],w),m=b.get(g).e,null!==t.outrogroups)for(const e of t.outrogroups)e.pending.delete(m),e.done.delete(m);if(0!==(m.f&yt)){if(m.f^=yt,m!==M){var _=z?z.next:M;m===t.effect.last&&(t.effect.last=m.prev),m.prev&&(m.prev.next=m.next),m.next&&(m.next.prev=m.prev),si(t,z,m),si(t,m,_),oi(m,_,n),k=[],I=[],M=(z=m).next;continue}oi(m,null,n)}if(0!==(m.f&ht)&&(Je(m),y&&(null==(l=null==(a=m.nodes)?void 0:a.a)||l.unfix(),(v??(v=new Set)).delete(m))),m!==M){if(void 0!==p&&p.has(m)){if(k.length<I.length){var P,D=I[0];z=D.prev;var C=k[0],S=k[k.length-1];for(P=0;P<k.length;P+=1)oi(k[P],D,n);for(P=0;P<I.length;P+=1)p.delete(I[P]);si(t,C.prev,S.next),si(t,z,C),si(t,S,D),M=D,z=S,w-=1,k=[],I=[]}else p.delete(m),oi(m,M,n),si(t,m.prev,m.next),si(t,m,null===z?t.effect.first:z.next),si(t,z,m),z=m;continue}for(k=[],I=[];null!==M&&M!==m;)(p??(p=new Set)).add(M),I.push(M),M=M.next;if(null===M)continue}0===(m.f&yt)&&k.push(m),z=m,M=m.next}if(null!==t.outrogroups){for(const e of t.outrogroups)0===e.pending.size&&(ei(J(e.done)),null==(d=t.outrogroups)||d.delete(e));0===t.outrogroups.size&&(t.outrogroups=null)}if(null!==M||void 0!==p){var O=[];if(void 0!==p)for(m of p)0===(m.f&ht)&&O.push(m);for(;null!==M;)0===(M.f&ht)&&M!==t.fallback&&O.push(M),M=M.next;var E=O.length;if(E>0){var W=4&i&&0===x?n:null;if(y){for(w=0;w<E;w+=1)null==(c=null==(u=O[w].nodes)?void 0:u.a)||c.measure();for(w=0;w<E;w+=1)null==(h=null==(f=O[w].nodes)?void 0:f.a)||h.fix()}!function(t,e,n){for(var i,r=e.length,o=e.length,s=0;s<r;s++){let n=e[s];Ue(n,()=>{if(i){if(i.pending.delete(n),i.done.add(n),0===i.pending.size){var e=t.outrogroups;ei(J(i.done)),e.delete(i),0===e.size&&(t.outrogroups=null)}}else o-=1},!1)}if(0===o){var a=null!==n;if(a){var l=n,d=l.parentNode;d.textContent="",d.append(l),t.items.clear()}ei(e,!a)}else i={pending:new Set(e),done:new Set},(t.outrogroups??(t.outrogroups=new Set)).add(i)}(t,O,W)}}y&&Ht(()=>{var t,e;if(void 0!==v)for(m of v)null==(e=null==(t=m.nodes)?void 0:t.a)||e.apply()})}(f,l,s,e,i),null!==d&&(0===l.length?0===(d.f&yt)?Je(d):(d.f^=yt,oi(d,null,s)):Ue(d,()=>{d=null}))),Dn(u)}),items:a,outrogroups:null,fallback:d};c=!1}function ri(t,e,n,i,r,o,s,a){var l=1&s?16&s?ge(n):we(n,!1,!1):null,d=2&s?ge(r):null;return{v:l,i:d,e:Ye(()=>(o(e,l??n,d??r,a),()=>{t.delete(i)}))}}function oi(t,e,n){if(t.nodes)for(var i=t.nodes.start,r=t.nodes.end,o=e&&0===(e.f&yt)?e.nodes.start:n;null!==i;){var s=Oe(i);if(o.before(i),i===r)return;i=s}}function si(t,e,n){null===e?t.effect.first=n:e.next=n,null===n?t.effect.last=e:n.prev=e}function ai(t,e,...n){var i=new Jn(t);Xe(()=>{const t=e()??null;i.ensure(t,t&&(e=>t(e,...n)))},gt)}T=new WeakMap,B=new WeakMap,R=new WeakMap,A=new WeakMap,L=new WeakMap,H=new WeakMap,$=new WeakMap;const li={tick:t=>requestAnimationFrame(t),now:()=>performance.now(),tasks:new Set};function di(){const t=li.now();li.tasks.forEach(e=>{e.c(t)||(li.tasks.delete(e),e.f())}),0!==li.tasks.size&&li.tick(di)}function ui(t,e){Be(()=>{t.dispatchEvent(new CustomEvent(e))})}function ci(t){if("float"===t)return"cssFloat";if("offset"===t)return"cssOffset";if(t.startsWith("--"))return t;const e=t.split("-");return 1===e.length?e[0]:e[0]+e.slice(1).map(t=>t[0].toUpperCase()+t.slice(1)).join("")}function fi(t){const e={},n=t.split(";");for(const t of n){const[n,i]=t.split(":");if(!n||void 0===i)break;e[ci(n.trim())]=i.trim()}return e}const hi=t=>t;function pi(t,e,n,i){var r,o,s,a,l=!!(4&t),d=e.inert,u=e.style.overflow;function c(){return Be(()=>o??(o=n()(e,(null==i?void 0:i())??{},{direction:"both"})))}var f={is_global:l,in(){e.inert=d,ui(e,"introstart"),s=vi(e,c(),a,1,()=>{ui(e,"introend"),null==s||s.abort(),s=o=void 0,e.style.overflow=u})},out(t){e.inert=!0,ui(e,"outrostart"),a=vi(e,c(),s,0,()=>{ui(e,"outroend"),null==t||t()})},stop:()=>{null==s||s.abort(),null==a||a.abort()}},h=dn;if(((r=h.nodes).t??(r.t=[])).push(f),Nn){var p=l;if(!p){for(var v=h.parent;v&&0!==(v.f>);)for(;(v=v.parent)&&0===(v.f<););p=!v||0!==(v.f&vt)}p&&Fe(()=>{On(()=>f.in())})}}function vi(t,e,n,i,r){var o=1===i;if("function"==typeof e){var s,a=!1;return Ht(()=>{if(!a){var l=e({direction:o?"in":"out"});s=vi(t,l,n,i,r)}}),{abort:()=>{a=!0,null==s||s.abort()},deactivate:()=>s.deactivate(),reset:()=>s.reset(),t:()=>s.t()}}if(null==n||n.deactivate(),!(null==e?void 0:e.duration))return r(),{abort:st,deactivate:st,reset:st,t:()=>i};const{delay:l=0,css:d,tick:u,easing:c=hi}=e;var f=[];if(o&&void 0===n&&(u&&u(0,1),d)){var h=fi(d(0,1));f.push(h,h)}var p=()=>1-i,v=t.animate(f,{duration:l,fill:"forwards"});return v.onfinish=()=>{v.cancel();var o=(null==n?void 0:n.t())??1-i;null==n||n.abort();var s=i-o,a=e.duration*Math.abs(s),l=[];if(a>0){var f=!1;if(d)for(var h=Math.ceil(a/(1e3/60)),g=0;g<=h;g+=1){var m=o+s*c(g/h),w=fi(d(m,1-m));l.push(w),f||(f="hidden"===w.overflow)}f&&(t.style.overflow="hidden"),p=()=>{var t=v.currentTime;return o+s*c(t/a)},u&&function(t){let e;0===li.tasks.size&&li.tick(di),new Promise(n=>{li.tasks.add(e={c:t,f:n})})}(()=>{if("running"!==v.playState)return!1;var t=p();return u(t,1-t),!0})}(v=t.animate(l,{duration:a,fill:"forwards"})).onfinish=()=>{p=()=>i,null==u||u(i,1-i),r()}},{abort:()=>{v&&(v.cancel(),v.effect=null,v.onfinish=st)},deactivate:()=>{r=st},reset:()=>{0===i&&(null==u||u(1,0))},t:()=>p()}}function gi(t,e,n){Fe(()=>{var i=On(()=>e(t,null==n?void 0:n())||{});if(n&&(null==i?void 0:i.update)){var r=!1,o={};qe(()=>{var t=n();!function(t){if("object"==typeof t&&t&&!(t instanceof EventTarget))if(zt in t)Tn(t);else if(!Array.isArray(t))for(let e in t){const n=t[e];"object"==typeof n&&n&&zt in n&&Tn(n)}}(t),r&&Ct(o,t)&&(o=t,i.update(t))}),r=!0}if(null==i?void 0:i.destroy)return()=>i.destroy()})}const mi=[..." \t\n\r\f \v\ufeff"];function wi(t,e=!1){var n=e?" !important;":";",i="";for(var r in t){var o=t[r];null!=o&&""!==o&&(i+=" "+r+": "+o+n)}return i}function yi(t){return"-"!==t[0]||"-"!==t[1]?t.toLowerCase():t}function xi(t,e,n,i,r,o){var s=t.__className;if(s!==n||void 0===s){var a=function(t,e,n){var i=null==t?"":""+t;if(e&&(i=i?i+" "+e:e),n)for(var r in n)if(n[r])i=i?i+" "+r:r;else if(i.length)for(var o=r.length,s=0;(s=i.indexOf(r,s))>=0;){var a=s+o;0!==s&&!mi.includes(i[s-1])||a!==i.length&&!mi.includes(i[a])?s=a:i=(0===s?"":i.substring(0,s))+i.substring(a+1)}return""===i?null:i}(n,i,o);null==a?t.removeAttribute("class"):t.className=a,t.__className=n}else if(o&&r!==o)for(var l in o){var d=!!o[l];null!=r&&d===!!r[l]||t.classList.toggle(l,d)}return o}function bi(t,e={},n,i){for(var r in n){var o=n[r];e[r]!==o&&(null==n[r]?t.style.removeProperty(r):t.style.setProperty(r,o,i))}}function Mi(t,e,n,i){if(t.__style!==e){var r=function(t,e){if(e){var n,i,r="";if(Array.isArray(e)?(n=e[0],i=e[1]):n=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var o=!1,s=0,a=!1,l=[];n&&l.push(...Object.keys(n).map(yi)),i&&l.push(...Object.keys(i).map(yi));var d=0,u=-1;const e=t.length;for(var c=0;c<e;c++){var f=t[c];if(a?"/"===f&&"*"===t[c-1]&&(a=!1):o?o===f&&(o=!1):"/"===f&&"*"===t[c+1]?a=!0:'"'===f||"'"===f?o=f:"("===f?s++:")"===f&&s--,!a&&!1===o&&0===s)if(":"===f&&-1===u)u=c;else if(";"===f||c===e-1){if(-1!==u){var h=yi(t.substring(d,u).trim());l.includes(h)||(";"!==f&&c++,r+=" "+t.substring(d,c).trim()+";")}d=c+1,u=-1}}}return n&&(r+=wi(n)),i&&(r+=wi(i,!0)),""===(r=r.trim())?null:r}return null==t?null:String(t)}(e,i);null==r?t.removeAttribute("style"):t.style.cssText=r,t.__style=e}else i&&(Array.isArray(i)?(bi(t,null==n?void 0:n[0],i[0]),bi(t,null==n?void 0:n[1],i[1],"important")):bi(t,n,i));return i}const zi=Symbol("is custom element"),ki=Symbol("is html");function Ii(t,e,n,i){var r=function(t){return t.__attributes??(t.__attributes={[zi]:t.nodeName.includes("-"),[ki]:"http://www.w3.org/1999/xhtml"===t.namespaceURI})}(t);r[e]!==(r[e]=n)&&("loading"===e&&(t[kt]=n),null==n?t.removeAttribute(e):"string"!=typeof n&&function(t){var e,n=t.getAttribute("is")||t.nodeName,i=_i.get(n);if(i)return i;_i.set(n,i=[]);for(var r=t,o=Element.prototype;o!==r;){for(var s in e=et(r))e[s].set&&i.push(s);r=rt(r)}return i}(t).includes(e)?t[e]=n:t.setAttribute(e,n))}var _i=new Map;function Pi(t,e){return t===e||(null==t?void 0:t[zt])===e}function Di(t={},e,n,i){return Fe(()=>{var i,r;return qe(()=>{i=r,r=[],On(()=>{t!==n(...r)&&(e(t,...r),i&&Pi(n(...i),t)&&e(null,...i))})}),()=>{Ht(()=>{r&&Pi(n(...r),t)&&e(null,...r)})}}),t}function Ci(t,e,n,i){var r=i,o=!0,s=()=>(o&&(o=!1,r=i),r);return void 0===t[e]&&void 0!==i&&s(),()=>{var n=t[e];return void 0===n?s():(o=!0,n)}}function Si(t){null===Ot&&_t(),He(()=>{const e=On(t);if("function"==typeof e)return e})}function Oi(t){null===Ot&&_t(),Si(()=>()=>On(t))}"undefined"!=typeof window&&((F=window.__svelte??(window.__svelte={})).v??(F.v=new Set)).add("5");const Ei=Symbol("modal-render-icon"),Wi=Symbol("modal-id"),Ti={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 Bi={...Ti},Ri=me(0);function Ai(){return Dn(Ri)}function Li(){return Bi}function Hi(t){const e=Bi;var n,i;Bi={features:{...(n=Ti).features,...(i=t).features},dock:{...n.dock,...i.dock},animations:{...n.animations,...i.animations},appearance:{...n.appearance,...i.appearance},zIndex:{...n.zIndex,...i.zIndex},parentChild:{...n.parentChild,...i.parentChild},positioning:{...n.positioning,...i.positioning},portalTarget:i.portalTarget??n.portalTarget},be(Ri),e.features.dock&&!Bi.features.dock&&(Array.from(Zi.values()).filter(t=>t.isMinimized).map(t=>t.id).forEach(t=>{const e=Zi.get(t);if(e){Zi.set(t,{...e,isMinimized:!1,isOpen:!0}),ye(lr,[...Dn(lr),t],!0),_r(t);const n=e.lastChildId||e.childId;n&&zr(n)}}),ye(wr,[],!0),nr())}function $i(){Bi={...Ti},be(Ri)}const Fi={BASE:0,DROPDOWN:100,STICKY:200,OVERLAY:300,MODAL:400,DOCK:8e3,TOAST:9e3};let qi=me(ke(Fi.MODAL));function ji(){ye(qi,Li().zIndex.base,!0)}function Xi(t){const e=Li();return"MODAL"===t?e.zIndex.base:"DOCK"===t?e.zIndex.dock:"TOAST"===t?e.zIndex.toast:Fi[t]}function Yi(){ye(qi,Li().zIndex.base,!0)}const Ni=8;function Ki(t,e,n,i,r={}){const{margin:o=Ni,allowPartialVisibility:s=!1}=r,a="undefined"!=typeof window?window.innerWidth:1920,l="undefined"!=typeof window?window.innerHeight:1080;let d,u,c,f;return s&&n>a-2*o?(d=40-n,u=a-40):(d=o,u=Math.max(o,a-n-o)),s&&i>l-2*o?(c=40-i,f=l-40):(c=o,f=Math.max(o,l-i-o)),{x:Math.max(d,Math.min(u,t)),y:Math.max(c,Math.min(f,e))}}function Gi(t,e,n,i,r={}){const{margin:o=Ni}=r,s=("undefined"!=typeof window?window.innerWidth:1920)-2*o,a=("undefined"!=typeof window?window.innerHeight:1080)-2*o,l=Math.min(n,s),d=Math.min(i,a),u=Ki(t,e,l,d,r);return{x:u.x,y:u.y,width:l,height:d}}function Vi(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 Ui(t,e,n,i,r,o){const s={x:t-o,y:e-o,width:n+2*o,height:i+2*o};let a=0;for(const t of r)a+=Vi(s,t);return a}function Qi(t,e,n,i,r,o,s){const a=(r-n)/2,l=(o-i)/2,d=a-s,u=l-s,c=Math.abs(t-a)/(d||1),f=Math.abs(e-l)/(u||1),h=Math.sqrt(c*c+f*f)/Math.SQRT2,p=50,v=t-s,g=r-n-s-t,m=e-s,w=o-i-s-e;let y=0;return v<p&&(y+=.3*(1-v/p)),g<p&&(y+=.3*(1-g/p)),m<p&&(y+=.2*(1-m/p)),w<p&&(y+=.2*(1-w/p)),Math.min(1,h+y)}function Ji(t){return"symbol"==typeof t?t.description??"symbol":t}let Zi=ke(new Map),tr=me(0);const er=new Set;function nr(){be(tr),queueMicrotask(()=>{er.forEach(t=>t())})}function ir(t){return er.add(t),()=>er.delete(t)}let rr=me(ke([])),or=me(ke([])),sr=me(ke([])),ar=me(ke([])),lr=me(ke([])),dr=me(ke([])),ur=me(ke([])),cr=me(ke([])),fr=me(null),hr=ke(new Map),pr=me(null),vr=ke(new Map),gr=ke(new Set),mr=ke(new Set),wr=me(ke([]));function yr(t){const e=Zi.get(t.id),n=(null==e?void 0:e.zIndex)??function(){const t=Dn(qi);return ye(qi,Dn(qi)+2),t}();e?Zi.set(t.id,{...e,title:t.title,icon:t.icon,glow:t.glow,zIndex:n}):Zi.set(t.id,{...t,zIndex:n,isAnimating:!1}),nr(),t.isMinimized&&!Dn(wr).includes(t.id)&&Dn(wr).push(t.id)}function xr(t){const e=Zi.get(t);if(e){if(ye(wr,Dn(wr).filter(e=>e!==t),!0),e.childId){const t=Zi.get(e.childId);t&&Zi.set(e.childId,{...t,parentId:void 0})}if(e.parentId){const t=Zi.get(e.parentId);t&&Zi.set(e.parentId,{...t,childId:void 0,lastChildId:e.id})}Zi.delete(t),nr(),mr.delete(t),gr.delete(t)}}function br(t){const e=Zi.get(t);if(!e||e.isMinimized)return;if(Nr(t),e.parentId){const t=Zi.get(e.parentId);if(t&&!t.isMinimized)return void br(e.parentId)}ye(rr,[...Dn(rr),t],!0),e.position&&e.size;const n=e.childId;Zi.set(t,{...e,isMinimized:!0,lastChildId:n}),nr(),Dn(wr).includes(t)||Dn(wr).push(t),e.childId&&function(t){const e=Zi.get(t);if(!(null==e?void 0:e.childId))return;const n=Zi.get(e.childId);n&&(Zi.set(e.childId,{...n,isHiddenWithParent:!0}),nr())}(t)}function Mr(t){const e=Zi.get(t);if(!e||!e.isMinimized)return;Zi.set(t,{...e,isMinimized:!1,isOpen:!0}),nr(),ye(lr,[...Dn(lr),t],!0),_r(t);const n=e.lastChildId||e.childId;n&&zr(n)}function zr(t){const e=Zi.get(t);e&&e.isHiddenWithParent&&(Zi.set(t,{...e,isHiddenWithParent:!1}),nr(),ye(dr,[...Dn(dr),t],!0))}function kr(t,e,n){const i=Zi.get(t);if(!i)return;let r=e;if((null==n?void 0:n.constrain)&&i.size&&(r=Ki(e.x,e.y,i.size.width,i.size.height)),Zi.set(t,{...i,position:r,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=r;for(;;){const t=Zi.get(e);if(!(null==t?void 0:t.childId))break;const i=Zi.get(t.childId);if(!(null==i?void 0:i.offsetFromParent))break;const r={x:n.x+i.offsetFromParent.x,y:n.y+i.offsetFromParent.y};Zi.set(t.childId,{...i,position:r,hasBeenDragged:!0}),e=t.childId,n=r}}if(i.parentId&&i.offsetFromParent){const e=Li();let n=t,o=i;for(;o.parentId&&o.offsetFromParent;){const i=Zi.get(o.parentId);if(!i)break;const s=n===t?r:Zi.get(n).position,a={x:s.x-o.offsetFromParent.x,y:s.y-o.offsetFromParent.y};"animated"===e.parentChild.movementMode?vr.set(o.parentId,a):Zi.set(o.parentId,{...i,position:a,hasBeenDragged:!0}),n=o.parentId,o=i}}nr()}function Ir(t,e){const n=Zi.get(t);n&&(Zi.set(t,{...n,...e}),nr())}function _r(t){var e;const n=Zi.get(t);if(!n)return;const i=Math.max(...Array.from(Zi.values()).map(t=>t.zIndex),0);if(n.parentId){const r=Zi.get(n.parentId);r&&r.zIndex<i&&Zi.set(n.parentId,{...r,zIndex:i+2});const o=(null==(e=Zi.get(n.parentId))?void 0:e.zIndex)??i+2;return n.zIndex<=o&&Zi.set(t,{...n,zIndex:o+2}),void nr()}if(n.zIndex<i&&(Zi.set(t,{...n,zIndex:i+2}),nr()),n.childId){const e=Zi.get(n.childId),i=Zi.get(t);e&&i&&e.zIndex<=i.zIndex&&(Zi.set(n.childId,{...e,zIndex:i.zIndex+2}),nr())}}function Pr(t,e,n){const i=e.getBoundingClientRect();hr.set(t,{x:i.left+i.width/2,y:i.top+i.height/2});const r=Li();(null==n?void 0:n.parentId)&&r.features.parentChild&&ye(pr,{parentId:n.parentId,childId:t},!0),Dn(or).includes(t)||ye(or,[...Dn(or),t],!0),nr();const o=Zi.get(t);if(o){if(o.isOpen&&!o.isMinimized&&!o.isHiddenWithParent)return ye(or,Dn(or).filter(e=>e!==t),!0),$r(t),void _r(t);if(o.isMinimized)return ye(or,Dn(or).filter(e=>e!==t),!0),void Mr(t);Zi.set(t,{...o,isOpen:!0}),_r(t)}}function Dr(t,e=!1){const n=Zi.get(t);n&&(Nr(t),e?ye(ar,[...Dn(ar),t],!0):ye(sr,[...Dn(sr),t],!0),nr(),n.childId&&Dr(n.childId,e))}function Cr(){Array.from(Zi.keys()).forEach(t=>Dr(t,!0))}function Sr(t,e,n){const i=Li();if(n&&!hr.has(t.id)){const e=n.getBoundingClientRect();hr.set(t.id,{x:e.left+e.width/2,y:e.top+e.height/2})}const r={id:t.id,title:t.title??"",icon:t.icon??"",isOpen:!0,isMinimized:!1,isHiddenWithParent:!1,isTransparent:t.isTransparent??!1,isRejected:!1,position:t.position??null,size:t.size??null,hasBeenDragged:t.hasBeenDragged??!1,dockPosition:t.dockPosition??-1,glow:t.glow??null};if(!i.features.parentChild){yr(r);const e=Zi.get(t.id);return e&&Zi.set(t.id,{...e,isOpen:!0}),ye(or,[...Dn(or),t.id],!0),nr(),void _r(t.id)}const o=Zi.get(e);if(!o)return;o.childId&&Dr(o.childId,!0),yr({...r,parentId:e});const s=Zi.get(t.id);s&&Zi.set(t.id,{...s,isOpen:!0,parentId:e}),ye(or,[...Dn(or),t.id],!0),nr(),_r(t.id),ye(pr,{parentId:e,childId:t.id},!0)}function Or(t){return Dn(rr).includes(t)}function Er(t){return Zi.get(t)}function Wr(){return Dn(tr)}function Tr(t){return Dn(or).includes(t)}function Br(t){return Dn(sr).includes(t)}function Rr(t){return Dn(ar).includes(t)}function Ar(t){return!!Dn(ar).includes(t)&&(ye(ar,Dn(ar).filter(e=>e!==t),!0),!0)}function Lr(t){return Dn(lr).includes(t)}function Hr(t){return Dn(dr).includes(t)}function $r(t){Zi.get(t)&&(Dn(ur).includes(t)||Dn(cr).includes(t)||(ye(ur,[...Dn(ur),t],!0),nr()))}function Fr(t){const e=Zi.get(t);return void 0!==e&&e.isOpen&&!e.isMinimized&&!e.isHiddenWithParent}function qr(t){return Zi.has(t)}function jr(){return{get modals(){return Zi},get pendingMinimize(){return Dn(rr)},get pendingOpen(){return Dn(or)},get pendingClose(){return Dn(sr)},get pendingRestore(){return Dn(lr)},get dockOrder(){return Dn(wr)}}}function Xr(t){mr.has(t)?mr.delete(t):mr.add(t);const e=Zi.get(t);e&&(Zi.set(t,{...e,isTransparent:mr.has(t)}),nr())}function Yr(t){mr.delete(t);const e=Zi.get(t);e&&(Zi.set(t,{...e,isTransparent:!1}),nr())}function Nr(t){vr.delete(t)}function Kr(){return Li().features.animations}const Gr=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function Vr(t){return Array.from(t.querySelectorAll(Gr)).filter(t=>null!==t.offsetParent||"A"===t.tagName)}function Ur(t,e){if("Tab"!==t.key)return;const n=Vr(e);if(0===n.length)return void t.preventDefault();const i=n[0],r=n[n.length-1],o=document.activeElement;t.shiftKey?o===i&&(r.focus(),t.preventDefault()):o===r&&(i.focus(),t.preventDefault())}function Qr(t){const e=Vr(t);return e.length>0&&(e[0].focus(),!0)}const Jr="modal-portal";var Zr=jn('<div style="display: contents;"><!></div>');function to(t,e){Tt(e,!0);let n=Ci(e,"target",0,"body"),i=null,r=null;const{mount:o}={mount:function(t,e=null){const n=function(t){if("undefined"==typeof window)return null;if(t instanceof HTMLElement)return t;if("string"==typeof t){const e=document.querySelector(t);if(e)return e;if(t.startsWith("#")){const e=t.slice(1),n=document.createElement("div");return n.id=e,document.body.appendChild(n),n}}let e=document.getElementById(Jr);return e||(e=document.createElement("div"),e.id=Jr,document.body.appendChild(e)),e}(e);return n?(n.appendChild(t),()=>{t.parentNode===n&&n.removeChild(t),n.id!==Jr&&0===n.children.length&&n.parentNode&&n.parentNode.removeChild(n)}):()=>{}}};Si(()=>(i&&(r=o(i,n())),()=>{null==r||r()}));var s=Zr();ai(Ee(s),()=>e.children),Di(s,t=>i=t,()=>i),Yn(t,s),Bt()}var eo=jn('<button type="button" aria-label="Minimize"></button>'),no=jn('<button type="button" class="modal-header-light modal-header-light-style" aria-label="Toggle style"></button>'),io=jn('<div class="modal-header-icon"><!></div>'),ro=jn('<div class="modal-header-icon"><!></div>'),oo=jn('<h2 class="modal-header-title"> </h2>'),so=jn('<h2 class="modal-header-title"> </h2>'),ao=jn('<div class="modal-header-traffic-lights"><button type="button" class="modal-header-light modal-header-light-close" aria-label="Close"></button> <!> <!></div> <div class="modal-header-mac-center"><!> <div class="modal-header-title-group"><!></div></div> <div class="modal-header-mac-spacer"></div>',1),lo=jn('<div class="modal-header-icon"><!></div>'),uo=jn('<div class="modal-header-icon"><!></div>'),co=jn('<h2 class="modal-header-title"> </h2>'),fo=jn('<h2 class="modal-header-title"> </h2>'),ho=jn('<button type="button" class="modal-header-btn-windows modal-header-btn-windows-style" aria-label="Toggle style">◇</button>'),po=jn('<button type="button" aria-label="Minimize">–</button>'),vo=jn('<div class="modal-header-title-group"><!> <!></div> <div class="modal-header-actions"><!> <!> <button type="button" class="modal-header-btn-windows modal-header-btn-windows-close" aria-label="Close">×</button></div>',1),go=jn("<header><!></header>");Hn(["pointerdown","click"]);var mo=jn("<div></div>"),wo=jn('<div class="modal-resize-handles"></div>');function yo(t,e){return e&&t.appendChild(e),{update(e){t.innerHTML="",e&&t.appendChild(e)},destroy(){t.innerHTML=""}}}Hn(["pointerdown"]);var xo=jn('<div class="modal-footer"><!></div>'),bo=jn("<div></div>"),Mo=jn('<div role="dialog" aria-modal="true" tabindex="-1"><!> <div class="modal-body"><!></div> <!> <!> <!></div>');function zo(t,e){Tt(e,!0);let n=Ci(e,"maxWidth",0,"600px"),i=Ci(e,"autoOpen",0,!1),r=Ci(e,"closeOnEscape",0,!0),o=Ci(e,"skipRegistration",0,!1);var s,a;s=Wi,a=()=>e.id,Rt().set(s,a);const l=Li().portalTarget,d=le(()=>Ji(e.id));function u(t){var n,i;return(null==(i=null==(n=e.config)?void 0:n.features)?void 0:i[t])??function(t){return Bi.features[t]}(t)}const c=le(()=>(Ai(),u("drag"))),f=le(()=>(Ai(),u("minimize"))),h=le(()=>(Ai(),!u("dock"))),p=le(()=>(Ai(),u("transparency"))),v=le(()=>(Ai(),u("resize"))),g=le(()=>{var t,n;return Ai(),(null==(n=null==(t=e.config)?void 0:t.appearance)?void 0:n.headerLayout)??Li().appearance.headerLayout});let m=me(null),w=me(!1),y=me(!1),x=me(!1),b=me(!1),M=me(!1);const z=le(()=>(Wr(),Er(e.id))),k=le(()=>Dn(z)&&(Dn(z).isOpen||Br(e.id))&&(!Dn(z).isMinimized||Or(e.id))&&!Dn(z).isHiddenWithParent),I=le(()=>{var t;return!!(null==(t=Dn(z))?void 0:t.childId)}),_=le(()=>{var t;return!!(null==(t=Dn(z))?void 0:t.parentId)}),P=le(()=>Dn(I)||Dn(y)),D=le(()=>!!e.glow),C=le(()=>`modal-title-${Dn(d)}`),S=le(()=>{var t;return(null==(t=Dn(z))?void 0:t.zIndex)??1e3}),O=function(t={x:0,y:0}){const e=ke({...t}),n=ke({isDragging:!1,startX:0,startY:0,initialX:0,initialY:0,hasBeenDragged:!1});return{get position(){return e},get hasBeenDragged(){return n.hasBeenDragged},get isDragging(){return n.isDragging},onPointerDown:function(t,i){if(0===t.button){if(!n.hasBeenDragged){const t=i.getBoundingClientRect();e.x=t.left,e.y=t.top}n.isDragging=!0,n.startX=t.clientX,n.startY=t.clientY,n.initialX=e.x,n.initialY=e.y,i.setPointerCapture(t.pointerId)}},onPointerMove:function(t,i,r){if(!n.isDragging)return;const o=t.clientX-n.startX,s=t.clientY-n.startY,a=Ki(n.initialX+o,n.initialY+s,r.width,r.height);e.x=a.x,e.y=a.y,n.hasBeenDragged=!0},onPointerUp:function(t,e){n.isDragging&&(n.isDragging=!1,e.releasePointerCapture(t.pointerId))},setPosition:function(t){e.x=t.x,e.y=t.y},setHasBeenDragged:function(t){n.hasBeenDragged=t},reset:function(){e.x=t.x,e.y=t.y,n.hasBeenDragged=!1}}}({x:0,y:0});let E=me(!1);const W=function(t,n,i){let r=me(!1),o=me(""),s=me(ke({width:0,height:0})),a=me(!1),l=me(!1),d={x:0,y:0,width:0,height:0,posX:0,posY:0},u=null;function c(e,l){e.preventDefault(),e.stopPropagation();const c=t();if(!c)return;const p=c.getBoundingClientRect();O.hasBeenDragged||(i({x:p.left,y:p.top}),O.setHasBeenDragged(!0)),Dn(a)||(ye(s,{width:p.width,height:p.height},!0),ye(a,!0));const v=n();ye(r,!0),ye(o,l,!0),u=e.pointerId,d={x:e.clientX,y:e.clientY,width:Dn(s).width,height:Dn(s).height,posX:v.x,posY:v.y,centerX:v.x+Dn(s).width/2,centerY:v.y+Dn(s).height/2},window.addEventListener("pointermove",f),window.addEventListener("pointerup",h),window.addEventListener("pointercancel",h)}function f(t){if(t.pointerId!==u)return;const e=t.clientX-d.x,n=t.clientY-d.y,r=window.innerWidth,a=window.innerHeight;let l=d.width,c=d.height,f=d.posX,h=d.posY;if(Dn(o).includes("e")){const t=r-f;l=Math.max(280,Math.min(d.width+e,t))}if(Dn(o).includes("w")){const t=d.width-280,n=Math.min(e,t);l=d.width-n,f=d.posX+n}if(Dn(o).includes("s")){const t=a-h;c=Math.max(200,Math.min(d.height+n,t))}if(Dn(o).includes("n")){const t=d.height-200,e=Math.min(n,t);c=d.height-e,h=d.posY+e}const p=Gi(f,h,l,c);ye(s,{width:p.width,height:p.height},!0),i({x:p.x,y:p.y})}function h(t){t.pointerId===u&&(ye(r,!1),u=null,window.removeEventListener("pointermove",f),window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),ye(l,!0),((t,n)=>{const i=Er(e.id);if(null==i?void 0:i.parentId){const t=Er(i.parentId),r=document.querySelector(`[data-modal-id="${Ji(i.parentId)}"]`);if(t&&r){const i=t.position??{x:r.getBoundingClientRect().left,y:r.getBoundingClientRect().top},o=t.size??{width:r.offsetWidth,height:r.offsetHeight},s={x:i.x+(o.width-n.width)/2,y:i.y+(o.height-n.height)/2};ye(E,!0),O.setPosition(s);const a={x:s.x-i.x,y:s.y-i.y};return Ir(e.id,{position:s,size:n,hasBeenDragged:!0,offsetFromParent:a}),void setTimeout(()=>{ye(E,!1)},200)}}Ir(e.id,{position:t,size:n,hasBeenDragged:!0})})(n(),Dn(s)),setTimeout(()=>{ye(l,!1)},0))}const p={startResize:c};return{get isResizing(){return Dn(r)},get resizeDirection(){return Dn(o)},get size(){return Dn(s)},get hasBeenResized(){return Dn(a)},get isActive(){return Dn(r)},get justFinishedResizing(){return Dn(l)},start:c,setHasBeenResized:()=>{},setSize:function(t){ye(s,t,!0),ye(a,!0)},reset:function(){ye(a,!1),ye(s,{width:0,height:0},!0)},constrainToViewport:function(){const e=n(),r=t();if(!r)return;const o=Gi(e.x,e.y,Dn(s).width||r.offsetWidth,Dn(s).height||r.offsetHeight);ye(s,{width:o.width,height:o.height},!0),i({x:o.x,y:o.y})},handlers:p}}(()=>Dn(m),()=>O.position,t=>O.setPosition(t)),T=function(t,n,i,r,o,s,a,l,d){let u=me(!1),c=me(!1),f=me(!1),h=me(!1),p=me(null),v=me(null),g=null,m=null;function w(){m&&(clearTimeout(m),m=null)}function y(){const t=e.id,n=document.querySelector(`.modal-dock-item[data-modal-id="${Ji(t)}"]`),i=document.querySelector('[data-dock-container="true"]'),r=n||i;if(r){const t=r.getBoundingClientRect();return{x:t.left+t.width/2,y:t.top+t.height/2}}return{x:window.innerWidth/2,y:window.innerHeight-40}}return He(()=>()=>{w(),ye(u,!1),ye(c,!1),ye(f,!1),ye(h,!1),ye(p,null),ye(v,null),g=null}),{get isMinimizing(){return Dn(u)},get isRestoring(){return Dn(c)},get isOpening(){return Dn(f)},get isClosing(){return Dn(h)},get animationTransform(){return Dn(p)},get pendingOpenSource(){return Dn(v)},startMinimize:function(t,e){const h=n();if(Dn(u)||!h)return;if(ye(c,!1),ye(f,!1),w(),!Kr()){const t=h.getBoundingClientRect();let n=o()?i():{x:t.left,y:t.top},u=a()?l():{width:t.width,height:t.height};return o()||(r(n),s(!0)),void(e?e():d(n,!0,u))}const v=h.getBoundingClientRect(),g=v.left+v.width/2,x=v.top+v.height/2;let b=o()?i():{x:v.left,y:v.top},M=a()?l():{width:v.width,height:v.height};o()||(r(b),s(!0));const z=t??y(),k=z.x-v.left,I=z.y-v.top,_={x:z.x-g,y:z.y-x,originX:k,originY:I};ye(p,_,!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{ye(u,!0)})}),m=setTimeout(()=>{e?e():d(b,!0,M)},500)},startRestore:function(t,e){if(!Kr()){const e=t||{x:window.innerWidth/2,y:window.innerHeight/2};return r(e),void s(!0)}const n=y(),i=t||{x:window.innerWidth/2,y:window.innerHeight/2},o=e||{width:480,height:400};r(i),s(!0);const a=i.x+o.width/2,l=i.y+o.height/2,d=n.x-i.x,u=n.y-i.y;ye(p,{x:n.x-a,y:n.y-l,originX:d,originY:u},!0),ye(c,!0),setTimeout(()=>{ye(c,!1),ye(p,null)},400)},startClose:function(t){Dn(h)||Dn(u)||(Kr()?(g=t,ye(h,!0),setTimeout(()=>{ye(h,!1),g&&(g(),g=null)},250)):t())},setPendingOpenSource:function(t){ye(v,t,!0)},tryStartOpenAnimation:function(){const t=n();if(!Dn(v)||!t||Dn(f))return!1;if(!Kr())return ye(v,null),!1;const e=Dn(v);ye(v,null);const a=t.getBoundingClientRect(),l=o()?i():{x:a.left,y:a.top},d=a.width,u=a.height,c=l.x+d/2,h=l.y+u/2;o()||(r(l),s(!0));const g=e.x-l.x,m=e.y-l.y;return ye(p,{x:e.x-c,y:e.y-h,originX:g,originY:m},!0),ye(f,!0),setTimeout(()=>{ye(f,!1),ye(p,null)},400),!0},forceClearMinimize:function(){w(),ye(u,!1),ye(p,null)}}}(0,()=>Dn(m),()=>O.position,t=>O.setPosition(t),()=>O.hasBeenDragged,t=>O.setHasBeenDragged(t),()=>W.hasBeenResized,()=>W.size,(t,n,i)=>{Ir(e.id,{position:t,size:i,hasBeenDragged:n}),br(e.id)}),{trapFocus:B,focusFirstElement:R}={trapFocus:Ur,focusFirstElement:Qr},A=le(()=>T.isMinimizing||T.isRestoring||T.isOpening||T.isClosing),L=le(()=>(Hr(e.id)||Lr(e.id))&&!T.isRestoring);let H=me(!1);const $=le(()=>T.isRestoring||T.isOpening||Dn(H)),F=le(()=>Dn(k)&&!O.hasBeenDragged&&!Dn(A)&&!T.pendingOpenSource&&!Dn(L)),q=le(()=>{const t=[];return t.push(`z-index: ${Dn(S)};`),T.animationTransform?(t.push(`left: ${O.position.x}px; top: ${O.position.y}px;`),t.push(`--genie-origin-x: ${T.animationTransform.originX}px;`),t.push(`--genie-origin-y: ${T.animationTransform.originY}px;`),t.push(`--genie-translate-x: ${T.animationTransform.x}px;`),t.push(`--genie-translate-y: ${T.animationTransform.y}px;`)):O.hasBeenDragged&&t.push(`left: ${O.position.x}px; top: ${O.position.y}px; transform: none;`),W.hasBeenResized?t.push(`width: ${W.size.width}px; height: ${W.size.height}px; max-width: none; max-height: none;`):(e.preferredHeight&&t.push(`min-height: ${e.preferredHeight};`),n()&&t.push(`max-width: ${n()};`)),Dn(D)&&e.glow&&(t.push(`--modal-glow-color: ${e.glow.color};`),t.push(`--modal-glow-intensity: ${e.glow.intensity};`)),t.join(" ")});function j(){Dn(f)&&br(e.id)}function X(){var t;Rr(e.id)&&Ar(e.id),Dr(e.id),null==(t=e.onClose)||t.call(e)}function Y(){Xr(e.id)}function N(t){Dn(c)&&Dn(m)&&O.onPointerDown(t,Dn(m))}function K(t){r()&&"Escape"===t.key&&function(t){const e=Zi.get(t);if(!e)return!1;const n=Math.max(...Array.from(Zi.values()).map(t=>t.zIndex),0);return e.zIndex===n&&!e.isMinimized&&!e.isHiddenWithParent}(e.id)&&(t.stopPropagation(),X())}function G(t){if(!Dn(m))return;const n=O.isDragging,i=W.hasBeenResized?W.size:{width:Dn(m).offsetWidth,height:Dn(m).offsetHeight};O.onPointerMove(t,Dn(m),i),O.isDragging&&n&&kr(e.id,O.position,{drag:!0})}function V(t){if(!Dn(m))return;const n=O.isDragging;O.onPointerUp(t,Dn(m)),n&&!W.justFinishedResizing&&(kr(e.id,O.position,{drag:!0}),function(t){const e=Li();if("animated"!==e.parentChild.movementMode)return;const n=e.parentChild.animationDuration,i=[];let r=t;for(;;){const t=Zi.get(r);if(!(null==t?void 0:t.parentId))break;i.push({parentId:t.parentId,childId:r}),r=t.parentId}i.forEach(({parentId:t,childId:e},i)=>{setTimeout(()=>{const i=Zi.get(e),r=Zi.get(t);if(!(null==i?void 0:i.position)||!i.offsetFromParent||!r)return;const o={x:i.position.x-i.offsetFromParent.x,y:i.position.y-i.offsetFromParent.y};vr.set(t,o),function(t){const e=vr.get(t);if(!e)return;const n=Zi.get(t);n&&(Zi.set(t,{...n,isAnimatingPosition:!0,position:e}),vr.delete(t),nr())}(t),setTimeout(()=>function(t){const e=Zi.get(t);e&&(Zi.set(t,{...e,isAnimatingPosition:!1}),nr())}(t),n)},i*n)})}(e.id))}function U(){var t;const n=Li();if("smart"!==(null==(t=n.positioning)?void 0:t.strategy))return!1;const i=Er(e.id),r=Dn(pr);if((null==i?void 0:i.parentId)||r&&r.childId===e.id)return!1;if((null==i?void 0:i.hasBeenDragged)||(null==i?void 0:i.position))return!1;const o=Dn(m)||document.querySelector(`[data-modal-id="${Dn(d)}"]`);if(!o)return!1;const s=o.offsetWidth,a=o.offsetHeight;if(s<=0||a<=0)return!1;const l=n.positioning.modalGap??16,u=function(t){const e=[];for(const[n,i]of Zi.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="${Ji(n)}"]`);if(t){const n=t.getBoundingClientRect();e.push({x:n.left,y:n.top,width:n.width,height:n.height})}}return e}(e.id),c=function(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}(n.positioning.avoidElements??[]),f=function(t,e,n,i={}){const{modalGap:r=16,gridResolution:o=10,avoidBounds:s=[],avoidMargin:a=16}=i,l=i.margin??r,d="undefined"!=typeof window?window.innerWidth:1920,u="undefined"!=typeof window?window.innerHeight:1080,c=s.map(t=>({x:t.x-a,y:t.y-a,width:t.width+2*a,height:t.height+2*a})),f={x:(d-t)/2,y:(u-e)/2};if(0===n.length&&0===c.length)return f;const h=l,p=Math.max(l,d-t-l),v=l,g=Math.max(l,u-e-l);if(p<=h||g<=v)return f;const m=Ui(f.x,f.y,t,e,n,r),w=Ui(f.x,f.y,t,e,c,0);if(0===m&&0===w)return f;const y=[],x=(p-h)/o,b=(g-v)/o;for(let i=0;i<=o;i++)for(let s=0;s<=o;s++){const o=h+i*x,a=v+s*b,f=Ui(o,a,t,e,n,r),p=Ui(o,a,t,e,c,0),g=Qi(o,a,t,e,d,u,l);y.push({pos:{x:o,y:a},modalOverlap:f,avoidOverlap:p,centerDist:g})}const M=y.filter(t=>0===t.avoidOverlap),z=M.length>0?M:y,k=t*e,I=Math.min(...z.map(t=>t.modalOverlap))/k;return z.sort((t,e)=>{if(0===M.length&&t.avoidOverlap!==e.avoidOverlap)return t.avoidOverlap-e.avoidOverlap;const n=t.modalOverlap/k,i=e.modalOverlap/k;if(I<.3){const r=.3,o=n<=r,s=i<=r;if(o&&s)return t.centerDist+.3*n-(e.centerDist+.3*i);if(o)return-1;if(s)return 1}return.6*n+.4*t.centerDist-(.6*i+.4*e.centerDist)}),z[0].pos}(s,a,u,{modalGap:l,avoidBounds:c});if(Ui(f.x,f.y,s,a,u,l)/(s*a)>.1&&u.length>0){const t=function(t){const e=[];for(const[n,i]of Zi.entries())if(n!==t&&i.isOpen&&!i.isMinimized&&!i.isHiddenWithParent&&!i.parentId)if(i.position&&i.size)e.push({id:Ji(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="${Ji(n)}"]`);if(t){const i=t.getBoundingClientRect();e.push({id:Ji(n),x:i.left,y:i.top,width:i.width,height:i.height})}}return e}(e.id),n=function(t,e,n,i={}){const{modalGap:r=16}=i,o=i.margin??r,s="undefined"!=typeof window?window.innerWidth:1920,a="undefined"!=typeof window?window.innerHeight:1080,l=n.reduce((t,e)=>t+e.width,0)+t,d=n.length*r,u=s-2*o;if(l+d>u)return null;const c=u-l-d;n.length;const f=c/2,h=s/2,p=[...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:h,currentY:(a-e)/2,isNew:!0}];p.sort((t,e)=>t.currentX-e.currentX);let v=o+f;const g=new Map;let m=null;for(const t of p){const e=v;if(t.isNew)m={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&&g.set(t.id,{x:Math.round(e),y:Math.round(i.y)})}v+=t.width+r}return m?{newModalPosition:m,existingModalMoves:g}:null}(s,a,t,{modalGap:l});if(n&&n.existingModalMoves.size>0)return function(t){const e=Li().parentChild.animationDuration;for(const[e,n]of t){const t=Zi.get(e);t&&Zi.set(e,{...t,position:n,isAnimatingPosition:!0,hasBeenDragged:!0})}nr(),setTimeout(()=>{for(const e of t.keys()){const t=Zi.get(e);t&&Zi.set(e,{...t,isAnimatingPosition:!1})}nr()},e)}(n.existingModalMoves),O.setPosition(n.newModalPosition),O.setHasBeenDragged(!0),kr(e.id,n.newModalPosition,{size:{width:s,height:a}}),!0}return O.setPosition(f),O.setHasBeenDragged(!0),kr(e.id,f,{size:{width:s,height:a}}),!0}function Q(){Pn().then(()=>Pn()).then(()=>{let t=0;const e=()=>{t+=1,U()||t>5||requestAnimationFrame(e)};Dn(m)?e():requestAnimationFrame(e)})}Si(()=>{var t;function n(){const t=Er(e.id);if(!(null==t?void 0:t.position)||!Dn(m))return;if(t.parentId)return;const n=W.hasBeenResized?W.size.width:Dn(m).offsetWidth,i=W.hasBeenResized?W.size.height:Dn(m).offsetHeight;if(n<=0||i<=0)return;const r=Ki(t.position.x,t.position.y,n,i);(Math.abs(r.x-t.position.x)>1||Math.abs(r.y-t.position.y)>1)&&(O.setPosition(r),kr(e.id,r))}return o()||(t=i(),yr({id:e.id,title:e.title,icon:e.icon??"",isOpen:t,isMinimized:!1,isHiddenWithParent:!1,isTransparent:!1,isRejected:!1,position:null,size:null,hasBeenDragged:!1,dockPosition:0,glow:e.glow??null,parentId:void 0,childId:void 0,offsetFromParent:void 0}),t&&_r(e.id)),i()&&(Pn().then(()=>{Dn(m)&&R(Dn(m))}),Q()),window.addEventListener("pointermove",G),window.addEventListener("pointerup",V),window.addEventListener("resize",n),()=>{window.removeEventListener("pointermove",G),window.removeEventListener("pointerup",V),window.removeEventListener("resize",n)}}),Oi(()=>{Yr(e.id),o()||xr(e.id)}),He(()=>{Wr();const t=Er(e.id);if(t){if(ye(w,t.isTransparent,!0),!O.isDragging&&!W.isResizing&&t.position){const e=O.position,n=t.position;(Math.abs(e.x-n.x)>.5||Math.abs(e.y-n.y)>.5)&&(O.setPosition(n),t.hasBeenDragged&&O.setHasBeenDragged(!0))}Pn().then(()=>function(){var t,n;if(!Er(e.id))return;if(Rr(e.id))return Ar(e.id),void(null==(t=e.onClose)||t.call(e));if(Or(e.id)&&!Dn(b)){if(ye(b,!0),Dn(fr),ye(fr,null),Dn(m)){const t=Dn(m).getBoundingClientRect(),n=O.hasBeenDragged?O.position:{x:t.left,y:t.top},i=W.hasBeenResized?W.size:{width:t.width,height:t.height};Ir(e.id,{position:n,size:i,hasBeenDragged:!0})}T.startMinimize(void 0,()=>{var t;t=e.id,Dn(rr).includes(t)&&ye(rr,Dn(rr).filter(e=>e!==t),!0),ye(b,!1)})}if(Lr(e.id)){n=e.id,Dn(lr).includes(n)&&ye(lr,Dn(lr).filter(t=>t!==n),!0);const t=Er(e.id);T.startRestore((null==t?void 0:t.position)??void 0,(null==t?void 0:t.size)??void 0),Pn().then(()=>{Dn(m)&&R(Dn(m))})}if(Hr(e.id)){!function(t){Dn(dr).includes(t)&&ye(dr,Dn(dr).filter(e=>e!==t),!0)}(e.id);const t=Er(e.id);T.startRestore((null==t?void 0:t.position)??void 0,(null==t?void 0:t.size)??void 0)}if(Br(e.id)&&(function(t){Dn(sr).includes(t)&&ye(sr,Dn(sr).filter(e=>e!==t),!0)}(e.id),T.startClose(()=>{var t;Yr(e.id),function(t){const e=Zi.get(t);if(e){if(e.parentId){const n=Zi.get(e.parentId);n&&n.childId===t&&Zi.set(e.parentId,{...n,childId:void 0,lastChildId:t})}Zi.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}),nr()}}(e.id),null==(t=e.onClose)||t.call(e)})),Tr(e.id)){!function(t){Dn(or).includes(t)&&ye(or,Dn(or).filter(e=>e!==t),!0)}(e.id);const t=function(t){const e=hr.get(t);return e&&hr.delete(t),e??null}(e.id)||e.openSourcePosition||null;t?(T.setPendingOpenSource(t),Pn().then(()=>Pn()).then(()=>{U(),T.tryStartOpenAnimation()})):Q(),Pn().then(()=>{Dn(m)&&R(Dn(m))})}(function(t){return Dn(ur).includes(t)})(e.id)&&(function(t){Dn(ur).includes(t)&&ye(ur,Dn(ur).filter(e=>e!==t),!0)}(e.id),function(t){Dn(cr).includes(t)||ye(cr,[...Dn(cr),t],!0)}(e.id),ye(M,!0),setTimeout(()=>{ye(M,!1),function(t){ye(cr,Dn(cr).filter(e=>e!==t),!0)}(e.id)},600));const i=function(t){if(!Dn(pr)||Dn(pr).childId!==t)return null;const e=Dn(pr);return ye(pr,null),e}(e.id);var r;i&&Dn(m)&&(r=i.parentId,Pn().then(()=>Pn()).then(()=>{let t=0;const n=()=>{t+=1;const i=function(t){var n,i;const r=Er(t);if(!r)return!1;const o=Dn(m)||document.querySelector(`[data-modal-id="${Dn(d)}"]`),s=document.querySelector(`[data-modal-id="${Ji(t)}"]`),a=null==s?void 0:s.getBoundingClientRect(),l=r.position??(a?{x:a.left,y:a.top}:null);if(!l||!o)return!1;const u=(null==(n=r.size)?void 0:n.width)??(null==s?void 0:s.offsetWidth)??(null==a?void 0:a.width)??480,c=(null==(i=r.size)?void 0:i.height)??(null==s?void 0:s.offsetHeight)??(null==a?void 0:a.height)??400,f=o.offsetWidth,h=o.offsetHeight;if(u<=0||c<=0||f<=0||h<=0)return!1;const p={x:l.x+(u-f)/2,y:l.y+(c-h)/2};return O.setPosition(p),O.setHasBeenDragged(!0),kr(e.id,p,{size:{width:f,height:h}}),r.position&&r.size||!a||kr(t,{x:a.left,y:a.top},{size:{width:u,height:c}}),function(t,e){if(!Li().features.parentChild)return;const n=Zi.get(t),i=Zi.get(e);if(!n||!i)return;let r={x:40,y:40};n.position&&i.position&&(r={x:i.position.x-n.position.x,y:i.position.y-n.position.y});const o=Math.max(i.zIndex,n.zIndex+1);Zi.set(t,{...n,childId:e,lastChildId:e}),Zi.set(e,{...i,parentId:t,offsetFromParent:r,zIndex:o}),nr()}(t,e.id),!0}(r);i||t>5||requestAnimationFrame(n)};Dn(m)?n():requestAnimationFrame(n)}))}())}}),He(()=>{const t=Er(e.id);t&&t.isTransparent!==Dn(w)&&ye(w,t.isTransparent,!0)}),He(()=>{if(Dn(k)&&Dn(m)){const t=t=>function(t){Dn(m)&&B(t,Dn(m))}(t);return Dn(m).addEventListener("keydown",t),()=>{var e;return null==(e=Dn(m))?void 0:e.removeEventListener("keydown",t)}}}),He(()=>{!Dn(k)&&T.isMinimizing&&T.forceClearMinimize()}),He(()=>{T.isRestoring||T.isOpening?ye(H,!0):Dn(H)&&requestAnimationFrame(()=>{ye(H,!1)})}),He(()=>{Dn(x)&&!Dn(I)&&(ye(y,!0),setTimeout(()=>{ye(y,!1)},200)),ye(x,Dn(I),!0)});var J=Xn(),Z=We(J),tt=t=>{to(t,{get target(){return l},children:(t,n)=>{var i=Mo();let r;i.__keydown=K;var o=Ee(i);{let t=le(()=>Dn(c)?N:void 0);!function(t,e){Tt(e,!0);let n=Ci(e,"isTransparent",0,!1),i=Ci(e,"headerLayout",0,"macos"),r=Ci(e,"minimizable",0,!0),o=Ci(e,"minimizeDisabled",0,!1),s=Ci(e,"transparencyEnabled",0,!0);const a=Wt(Ei),l=le(()=>null==a?void 0:a()),d=le(()=>"macos"===i());var u=go();let c;u.__pointerdown=function(t){var n;t.target.closest("button")||null==(n=e.onStartDrag)||n.call(e,t)};var f=Ee(u),h=t=>{var n=ao(),i=We(n),a=Ee(i);a.__click=function(...t){var n;null==(n=e.onClose)||n.apply(this,t)};var d=Te(a,2),u=t=>{var n=eo();let i;n.__click=function(...t){var n;null==(n=o()?void 0:e.onMinimize)||n.apply(this,t)},je(()=>{i=xi(n,0,"modal-header-light modal-header-light-minimize",null,i,{"modal-header-light-disabled":o()}),n.disabled=o(),Ii(n,"title",o()?"Enable dock to minimize":void 0)}),Yn(t,n)};Zn(d,t=>{r()&&t(u)});var c=Te(d,2),f=t=>{var n=no();n.__click=function(...t){var n;null==(n=e.onToggleStyle)||n.apply(this,t)},Yn(t,n)};Zn(c,t=>{s()&&t(f)});var h=Ee(Te(i,2)),p=t=>{var n=io();ai(Ee(n),()=>e.customIcon),Yn(t,n)},v=t=>{var n=Xn(),i=We(n),r=t=>{var n=ro();ai(Ee(n),()=>Dn(l),()=>e.icon),Yn(t,n)};Zn(i,t=>{e.icon&&Dn(l)&&t(r)},!0),Yn(t,n)};Zn(h,t=>{e.customIcon?t(p):t(v,!1)});var g=Ee(Te(h,2)),m=t=>{var n=oo(),i=Ee(n);je(()=>{Ii(n,"id",e.titleId),Kn(i,e.title)}),Yn(t,n)},w=t=>{var n=so(),i=Ee(n);je(()=>Kn(i,e.title)),Yn(t,n)};Zn(g,t=>{e.titleId?t(m):t(w,!1)}),Yn(t,n)},p=t=>{var n=vo(),i=We(n),a=Ee(i),d=t=>{var n=lo();ai(Ee(n),()=>e.customIcon),Yn(t,n)},u=t=>{var n=Xn(),i=We(n),r=t=>{var n=uo();ai(Ee(n),()=>Dn(l),()=>e.icon),Yn(t,n)};Zn(i,t=>{e.icon&&Dn(l)&&t(r)},!0),Yn(t,n)};Zn(a,t=>{e.customIcon?t(d):t(u,!1)});var c=Te(a,2),f=t=>{var n=co(),i=Ee(n);je(()=>{Ii(n,"id",e.titleId),Kn(i,e.title)}),Yn(t,n)},h=t=>{var n=fo(),i=Ee(n);je(()=>Kn(i,e.title)),Yn(t,n)};Zn(c,t=>{e.titleId?t(f):t(h,!1)});var p=Ee(Te(i,2)),v=t=>{var n=ho();n.__click=function(...t){var n;null==(n=e.onToggleStyle)||n.apply(this,t)},Yn(t,n)};Zn(p,t=>{s()&&t(v)});var g=Te(p,2),m=t=>{var n=po();let i;n.__click=function(...t){var n;null==(n=o()?void 0:e.onMinimize)||n.apply(this,t)},je(()=>{i=xi(n,0,"modal-header-btn-windows",null,i,{"modal-header-btn-windows-disabled":o()}),n.disabled=o(),Ii(n,"title",o()?"Enable dock to minimize":void 0)}),Yn(t,n)};Zn(g,t=>{r()&&t(m)}),Te(g,2).__click=function(...t){var n;null==(n=e.onClose)||n.apply(this,t)},Yn(t,n)};Zn(f,t=>{Dn(d)?t(h):t(p,!1)}),je(()=>c=xi(u,0,"modal-header",null,c,{"modal-header-draggable":!!e.onStartDrag,transparent:n()})),Yn(t,u),Bt()}(o,{get title(){return e.title},get customIcon(){return e.customIcon},get icon(){return e.icon},get isTransparent(){return Dn(w)},get titleId(){return Dn(C)},get headerLayout(){return Dn(g)},get onStartDrag(){return Dn(t)},onToggleStyle:Y,onMinimize:j,onClose:X,get minimizable(){return Dn(f)},get minimizeDisabled(){return Dn(h)},get transparencyEnabled(){return Dn(p)}})}var s=Te(o,2);ai(Ee(s),()=>e.children??st),gi(s,(t,e)=>null==yo?void 0:yo(t,e),()=>e.bodyElement);var a=Te(s,2),l=t=>{var n=xo(),i=Ee(n),r=t=>{var n=Xn();ai(We(n),()=>e.footer),Yn(t,n)};Zn(i,t=>{e.footer&&t(r)}),gi(n,(t,e)=>null==yo?void 0:yo(t,e),()=>e.footerElement),Yn(t,n)};Zn(a,t=>{(e.footer||e.footerElement)&&t(l)});var u=Te(a,2);{let t=le(()=>Dn(v)&&!Dn(I)?W.handlers.startResize:void 0);!function(t,e){Tt(e,!0);const n=["n","s","e","w","ne","nw","se","sw"];var i=Xn(),r=We(i),o=t=>{var i=wo();ii(i,21,()=>n,ti,(t,n)=>{var i=mo();i.__pointerdown=t=>function(t,n){var i;null==(i=e.onStartResize)||i.call(e,t,n)}(t,Dn(n)),je(()=>xi(i,0,`modal-resize-handle modal-resize-${Dn(n)??""}`)),Yn(t,i)}),Yn(t,i)};Zn(r,t=>{e.onStartResize&&t(o)}),Yn(t,i),Bt()}(u,{get onStartResize(){return Dn(t)}})}var x,b,k,S=Te(u,2),B=t=>{var e=bo();let n;je(()=>n=xi(e,0,"modal-child-overlay",null,n,{"modal-overlay-closing":Dn(y)})),Yn(t,e)};Zn(S,t=>{Dn(P)&&t(B)}),Di(i,t=>ye(m,t),()=>Dn(m)),je(()=>{var t;r=xi(i,0,"modal-dialog",null,r,{"modal-dragging":O.isDragging,"modal-resizing":W.isResizing,"modal-positioned":O.hasBeenDragged,"modal-minimizing":T.isMinimizing,"modal-restoring":T.isRestoring,"modal-opening":T.isOpening,"modal-closing":T.isClosing,"modal-centered":Dn(F),"modal-solid":!Dn(w),"modal-transparent":Dn(w),"modal-glow":Dn(D),"modal-has-child":Dn(I),"modal-is-child":Dn(_),"modal-visible-by-animation":Dn($),"modal-animating-to-center":Dn(E),"modal-animating-position":null==(t=Dn(z))?void 0:t.isAnimatingPosition,"modal-attention":Dn(M)}),Ii(i,"data-modal-id",Dn(d)),Mi(i,Dn(q)),Ii(i,"aria-labelledby",Dn(C))}),k=function(t,e,n,i={}){function r(t){if(i.capture||Fn.call(e,t),!t.cancelBubble)return Be(()=>null==n?void 0:n.call(this,t))}return t.startsWith("pointer")||t.startsWith("touch")||"wheel"===t?Ht(()=>{e.addEventListener(t,r,i)}):e.addEventListener(t,r,i),r}("pointerdown",x=i,()=>_r(e.id),b={capture:!0,passive:void 0}),(x===document.body||x===window||x===document||x instanceof HTMLMediaElement)&&Le(()=>{x.removeEventListener("pointerdown",k,b)}),Yn(t,i)},$$slots:{default:!0}})};Zn(Z,t=>{Dn(k)&&t(tt)}),Yn(t,J),Bt()}Hn(["keydown"]);const ko=t=>t;function Io(t){const e=t-1;return e*e*e+1}function _o(t){const e="string"==typeof t&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}function Po(t,{delay:e=0,duration:n=400,easing:i=ko}={}){const r=+getComputedStyle(t).opacity;return{delay:e,duration:n,easing:i,css:t=>"opacity: "+t*r}}function Do(t,{delay:e=0,duration:n=400,easing:i=Io,x:r=0,y:o=0,opacity:s=0}={}){const a=getComputedStyle(t),l=+a.opacity,d="none"===a.transform?"":a.transform,u=l*(1-s),[c,f]=_o(r),[h,p]=_o(o);return{delay:e,duration:n,easing:i,css:(t,e)=>`\n\t\t\ttransform: ${d} translate(${(1-t)*c}${f}, ${(1-t)*h}${p});\n\t\t\topacity: ${l-u*e}`}}function Co(t,{delay:e=0,duration:n=400,easing:i=Io,start:r=0,opacity:o=0}={}){const s=getComputedStyle(t),a=+s.opacity,l="none"===s.transform?"":s.transform,d=1-r,u=a*(1-o);return{delay:e,duration:n,easing:i,css:(t,e)=>`\n\t\t\ttransform: ${l} scale(${1-d*e});\n\t\t\topacity: ${a-u*e}\n\t\t`}}function So(t){const e=1.70158;return--t*t*((e+1)*t+e)+1}function Oo(t){const e=t-1;return e*e*e+1}var Eo=jn('<button type="button" aria-label="Drag dock"></button>'),Wo=jn('<span class="modal-dock-item-icon-placeholder"> </span>'),To=jn('<span class="modal-dock-item-label"> </span>'),Bo=jn("<span>+</span>"),Ro=jn('<span class="modal-dock-child-indicator"><!></span>'),Ao=jn('<button><span class="modal-dock-item-icon"><!></span> <!> <span class="modal-dock-item-glow"></span> <!></button>'),Lo=jn('<div data-dock-container="true"><div><!> <!></div></div>');function Ho(t,e){Tt(e,!0);const n=Wt(Ei),i=le(()=>e.renderIcon??(null==n?void 0:n())),r=jr(),o=le(()=>(Ai(),Li())),s=le(()=>Xi("DOCK")),a=le(()=>Dn(o).dock.position),l=le(()=>Dn(o).dock.labelMode);let d=me("horizontal"),u=me(ke({x:100,y:100})),c=me(null),f=me(!1),h={x:0,y:0},p=null;const v=le(()=>(Wr(),Array.from(r.modals.values()).filter(t=>t.isMinimized).sort((t,e)=>t.dockPosition-e.dockPosition))),g=le(()=>{switch(Dn(a)){case"left":return{x:-20,duration:250,easing:Oo};case"right":return{x:20,duration:250,easing:Oo};default:return{y:20,duration:250,easing:Oo}}});function m(t){var e;"free"===Dn(a)&&(ye(f,!0),p=t.pointerId,h={x:t.clientX-Dn(u).x,y:t.clientY-Dn(u).y},null==(e=t.currentTarget)||e.setPointerCapture(t.pointerId),window.addEventListener("pointermove",w),window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y))}function w(t){if(t.pointerId!==p||!Dn(c))return;const e=Dn(c).getBoundingClientRect(),n=window.innerWidth-e.width-8,i=window.innerHeight-e.height-8,r=Math.min(Math.max(t.clientX-h.x,8),Math.max(8,n)),o=Math.min(Math.max(t.clientY-h.y,8),Math.max(8,i));ye(u,{x:Math.round(r),y:Math.round(o)},!0)}function y(t){t.pointerId===p&&(ye(f,!1),p=null,window.removeEventListener("pointermove",w),window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y))}const{addListener:x}=function(){function t(t,e,n){return"undefined"==typeof window?()=>{}:(window.addEventListener(t,e,n),()=>{window.removeEventListener(t,e,n)})}return{addListener:t,addListenerEffect:function(e,n,i){He(()=>{if("undefined"!=typeof window)return t(e,n,i)})}}}();function b(){if("free"!==Dn(a)||!Dn(c))return;const t=Dn(c).getBoundingClientRect(),e=Ki(Dn(u).x,Dn(u).y,t.width,t.height);e.x===Dn(u).x&&e.y===Dn(u).y||ye(u,{x:Math.round(e.x),y:Math.round(e.y)},!0)}He(()=>{"undefined"!=typeof window&&x("resize",b)});var M={setDockOrientation:function(t){ye(d,t,!0)},setDockFreePosition:function(t){ye(u,t,!0)},getDockState:function(){return{dockPosition:Dn(a),dockOrientation:Dn(d),dockFreePosition:Dn(u),dockLabelMode:Dn(l)}}};return to(t,{get target(){return Dn(o).portalTarget},children:(t,e)=>{var n=Lo();let o,h;var p=Ee(n);let w;var y=Ee(p),x=t=>{var e=Eo();let n;e.__pointerdown=m,je(()=>n=xi(e,0,"modal-dock-handle",null,n,{"modal-dock-handle-dragging":Dn(f)})),Yn(t,e)};Zn(y,t=>{"free"===Dn(a)&&t(x)}),ii(Te(y,2),19,()=>Dn(v),t=>t.id,(t,e,n)=>{const o=le(()=>Dn(e).lastChildId?r.modals.get(Dn(e).lastChildId):null);var s=Ao();let a;s.__click=t=>{var n;n=Dn(e).id,gr.has(n)?t.currentTarget.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"}):Mr(Dn(e).id)};var d=Ee(s),u=Ee(d),c=t=>{var n=Xn();ai(We(n),()=>Dn(i),()=>Dn(e).icon),Yn(t,n)},f=t=>{var n=Wo(),i=Ee(n);je(t=>Kn(i,t),[()=>Dn(e).title.charAt(0)]),Yn(t,n)};Zn(u,t=>{Dn(e).icon&&Dn(i)?t(c):t(f,!1)});var h=Te(d,2),p=t=>{var n=To(),i=Ee(n);je(()=>Kn(i,Dn(e).title)),Yn(t,n)};Zn(h,t=>{"hidden"!==Dn(l)&&t(p)});var v=Te(h,4),g=t=>{var e=Ro(),n=Ee(e),r=t=>{var e=Xn();ai(We(e),()=>Dn(i),()=>Dn(o).icon),Yn(t,e)},s=t=>{Yn(t,Bo())};Zn(n,t=>{Dn(o).icon&&Dn(i)?t(r):t(s,!1)}),Yn(t,e)};Zn(v,t=>{Dn(e).lastChildId&&Dn(o)&&t(g)}),je(t=>{a=xi(s,0,"modal-dock-item",null,a,{"modal-dock-item-has-glow":!!Dn(e).glow,"modal-dock-item-has-child":!!Dn(e).lastChildId,"modal-dock-item-label-beside":"beside"===Dn(l),"modal-dock-item-label-below":"below"===Dn(l)}),Ii(s,"data-modal-id",t),Mi(s,Dn(e).glow?`--modal-dock-glow-color: ${Dn(e).glow.color};`:"")},[()=>Ji(Dn(e).id)]),pi(3,s,()=>Co,()=>({duration:300,delay:50*Dn(n),easing:So,start:.5})),Yn(t,s)}),Di(n,t=>ye(c,t),()=>Dn(c)),je(()=>{o=xi(n,0,"modal-dock-container",null,o,{"modal-dock-left":"left"===Dn(a),"modal-dock-right":"right"===Dn(a),"modal-dock-bottom":"bottom"===Dn(a),"modal-dock-free":"free"===Dn(a),"modal-dock-empty":0===Dn(v).length}),h=Mi(n,"free"===Dn(a)?`left: ${Dn(u).x}px; top: ${Dn(u).y}px;`:"",h,{"z-index":Dn(s)}),w=xi(p,0,"modal-dock",null,w,{"modal-dock-free-horizontal":"free"===Dn(a)&&"horizontal"===Dn(d),"modal-dock-free-vertical":"free"===Dn(a)&&"vertical"===Dn(d)})}),pi(3,n,()=>Do,()=>Dn(v).length>0?Dn(g):{duration:0}),Yn(t,n)},$$slots:{default:!0}}),Bt(M)}function $o(t,e){Tt(e,!0);let n=Ci(e,"maxWidth",0,"600px"),i=Ci(e,"autoOpen",0,!1),r=Ci(e,"closeOnEscape",0,!0),o=me(!1);Si(()=>{yr({id:e.id,title:e.title,icon:e.icon??"",isOpen:i(),isMinimized:!1,isHiddenWithParent:!1,isTransparent:!1,isRejected:!1,position:null,size:null,hasBeenDragged:!1,dockPosition:0,glow:e.glow??null,parentId:void 0,childId:void 0,offsetFromParent:void 0}),ye(o,!0)}),Oi(()=>{xr(e.id)});const s=le(()=>{if(!Dn(o))return!1;Wr();const t=Er(e.id);return!!t&&(t.isOpen||t.isMinimized||Tr(e.id)||Br(e.id)||Or(e.id))});var a=Xn(),l=We(a),d=t=>{zo(t,{get id(){return e.id},get title(){return e.title},get icon(){return e.icon},get customIcon(){return e.customIcon},get maxWidth(){return n()},get preferredHeight(){return e.preferredHeight},get autoOpen(){return i()},get openSourcePosition(){return e.openSourcePosition},get glow(){return e.glow},get config(){return e.config},get closeOnEscape(){return r()},get onClose(){return e.onClose},get children(){return e.children},get footer(){return e.footer},skipRegistration:!0})};Zn(l,t=>{Dn(s)&&t(d)}),Yn(t,a),Bt()}Hn(["pointerdown","click"]);var Fo=jn('<div class="modal-backdrop svelte-1d3nq4t" aria-hidden="true"></div>');function qo(t,e){Tt(e,!0);const n=jr(),i=le(()=>(Ai(),Li())),r=le(()=>Dn(i).features.backdrop),o=le(()=>(Wr(),Array.from(n.modals.values()).some(t=>t.isOpen&&!t.isMinimized&&!t.isHiddenWithParent))),s=le(()=>Dn(r)&&Dn(o)),a=le(()=>Xi("MODAL")-1);to(t,{get target(){return Dn(i).portalTarget},children:(t,e)=>{var n=Xn(),i=We(n),r=t=>{var e=Fo();let n;je(()=>n=Mi(e,"",n,{"z-index":Dn(a)})),pi(3,e,()=>Po,()=>({duration:200})),Yn(t,e)};Zn(i,t=>{Dn(s)&&t(r)}),Yn(t,n)},$$slots:{default:!0}}),Bt()}export{qo as B,Ho as D,zo as M,Qn as a,$i as b,Yi as c,ir as d,Dr as e,br as f,Li as g,Mr as h,ji as i,Sr as j,$r as k,_r as l,Gn as m,jr as n,Pr as o,qr as p,$o as q,yr as r,Hi as s,Ji as t,xr as u,Fr as v,Cr as w,Xr as x};
|
package/dist/vanilla.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as o,
|
|
1
|
+
import{m as o,q as t,a as n,s as e,i as r,g as s,D as a,B as d}from"./runtime.js";import{l as c,w as i,e as l,v as u,p,f,j as m,o as y,h as g,x as M}from"./runtime.js";function b(e){const{content:r,footer:s,icon:a,...d}=e,c=o(t,{target:document.body,props:{...d,children:r?()=>v(r):void 0,footer:s?()=>v(s):void 0,icon:a?()=>v(a):void 0}});return{destroy:()=>n(c)}}function k(){const t=o(a,{target:document.body,props:{}});return{destroy:()=>n(t)}}function v(o){if("string"==typeof o){const t=document.createElement("div");return t.innerHTML=o,t}return o}function T(){const t=o(d,{target:document.body,props:{}});return{destroy:()=>n(t)}}function h(o={}){const{config:t}=o;t&&e(t),r();const n=s(),a=o.backdrop??n.features.backdrop?T():null,d=o.dock??n.features.dock?k():null;return{backdrop:a,dock:d,destroy:()=>{null==a||a.destroy(),null==d||d.destroy()}}}export{c as bringToFront,i as closeAllModals,l as closeModal,T as createBackdrop,k as createDock,b as createModal,s as getConfig,h as init,u as isModalOpen,p as isModalRegistered,f as minimizeModal,m as openChildModal,y as openModal,g as restoreModal,e as setConfig,M as toggleModalTransparency};
|