studiograph 1.3.48-next.1 → 1.3.48-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/dist/web/_app/immutable/chunks/{BHNrGVTD.js → -iaeBIWN.js} +1 -1
  2. package/dist/web/_app/immutable/chunks/{CSCdPd1d.js → B3Z4_Sps.js} +1 -1
  3. package/dist/web/_app/immutable/chunks/{CNJXZsV0.js → BPWYOQXG.js} +1 -1
  4. package/dist/web/_app/immutable/chunks/{DX3q8Wh7.js → BR77jbfR.js} +1 -1
  5. package/dist/web/_app/immutable/chunks/{BU9bZcWS.js → Bq_KShUL.js} +1 -1
  6. package/dist/web/_app/immutable/chunks/{CodnfUpZ.js → BzPu-Eht.js} +1 -1
  7. package/dist/web/_app/immutable/chunks/{BfIhVLn6.js → CGc1sIb_.js} +1 -1
  8. package/dist/web/_app/immutable/chunks/{8319UlK_.js → CX87mIM8.js} +1 -1
  9. package/dist/web/_app/immutable/chunks/{WlsUHv-K.js → Cpsr8-Xy.js} +1 -1
  10. package/dist/web/_app/immutable/chunks/{vANlie4P.js → DTZE-yoq.js} +1 -1
  11. package/dist/web/_app/immutable/entry/{app.2t49gcrW.js → app.BeUKh4sD.js} +2 -2
  12. package/dist/web/_app/immutable/entry/start.CZJnFuQn.js +1 -0
  13. package/dist/web/_app/immutable/nodes/{0.ag_8oFh-.js → 0.DyF_RsLg.js} +2 -2
  14. package/dist/web/_app/immutable/nodes/{1.BNYg0Vsp.js → 1.7iDQmMPh.js} +1 -1
  15. package/dist/web/_app/immutable/nodes/{10.Cyg4coUc.js → 10.Btl8d8HT.js} +1 -1
  16. package/dist/web/_app/immutable/nodes/{2.CGjgxqHA.js → 2.LDRE62jN.js} +4 -4
  17. package/dist/web/_app/immutable/nodes/{3.DEqqEOTV.js → 3.BaW1XB1x.js} +1 -1
  18. package/dist/web/_app/immutable/nodes/{4.V61Ed9TC.js → 4.D0Q8kpkI.js} +4 -4
  19. package/dist/web/_app/immutable/nodes/{5.DlF50ub0.js → 5.n7j2UG9h.js} +1 -1
  20. package/dist/web/_app/immutable/nodes/{6.DEPjN38c.js → 6.DQYxR0iy.js} +1 -1
  21. package/dist/web/_app/immutable/nodes/{7.npfkOwsL.js → 7.BsURvFAp.js} +1 -1
  22. package/dist/web/_app/immutable/nodes/{8.BiZVwE8_.js → 8.CsiErG0p.js} +1 -1
  23. package/dist/web/_app/immutable/nodes/{9.BH02cvQU.js → 9.CnN6OZgC.js} +1 -1
  24. package/dist/web/_app/version.json +1 -1
  25. package/dist/web/index.html +6 -6
  26. package/package.json +1 -1
  27. package/dist/web/_app/immutable/entry/start.BdkvSU2l.js +0 -1
@@ -1 +1 @@
1
- import{o as St,p as he,c as j,a as u,b as D,s as Tt,f as Vt,d as ve,g as X,t as Nt,e as me}from"./iDtAARVW.js";import{e as F,s as d,g as o,u as O,p as _t,h as H,b as yt,c as y,ad as Kt,r as C,l as Ht,d as ot,a as Ut,n as U,m as At,t as ut,aC as ge,a5 as be,i as z}from"./CT6oIU-C.js";import{b as dt,a as ct,r as _e,s as ye}from"./CmCtpZ1Y.js";import{i as N,b as Ce}from"./72bZS3G9.js";import{e as we}from"./CDV5Q7RN.js";import{c as q}from"./CXH6iFbA.js";import{s as Wt}from"./DGbA7IXh.js";import{b as Pe,B as xe}from"./BS2rFAVq.js";import{p as v,s as ne,r as ue,l as Mt}from"./cLyZlkXv.js";import{g as re}from"./WlsUHv-K.js";import{i as Zt}from"./Y90OgS-9.js";import{A as Te,C as se}from"./vSaooFHB.js";import{n as et}from"./4Hhzb6pv.js";import{v as Bt}from"./BfIhVLn6.js";import{w as He}from"./CJ8__CWt.js";import{w as Qt,H as Ae,I as bt,C as Me,a as de,J as Ve,K as Lt,E as Ie,S as Oe,L as ce,c as ke,N as De,O as ie,h as k,d as ze,f as pe,n as xt,P as Fe,p as Ee,m as $t,q as ae,r as Se,F as Ne,A as We,u as Be,v as $e,x as Ke,y as Le,z as Ye,B as Xe,G as qe}from"./CJUKmosC.js";function jt(m,t){const[e,s]=m;let n=!1;const r=t.length;for(let h=0,i=r-1;h<r;i=h++){const[f,x]=t[h]??[0,0],[_,c]=t[i]??[0,0];x>=s!=c>=s&&e<=(_-f)*(s-x)/(c-x)+f&&(n=!n)}return n}function Gt(m,t){return m[0]>=t.left&&m[0]<=t.right&&m[1]>=t.top&&m[1]<=t.bottom}function le(m,t){const e=m.left+m.width/2,s=m.top+m.height/2,n=t.left+t.width/2,r=t.top+t.height/2,h=n-e,i=r-s;return Math.abs(h)>Math.abs(i)?h>0?"right":"left":i>0?"bottom":"top"}class je{#t;#n;#s;#r=null;#e=null;#l=[];#h=null;#o=null;#i=null;#a(){this.#o!==null&&(cancelAnimationFrame(this.#o),this.#o=null)}#d(){this.#a(),this.#o=requestAnimationFrame(()=>{this.#o=null,!(!this.#r||!this.#e)&&(this.#u(),this.#t.onPointerExit())})}#c(){this.#i!==null&&(clearTimeout(this.#i),this.#i=null)}#f(){this.#s!==null&&(this.#c(),this.#i=window.setTimeout(()=>{this.#i=null,!(!this.#r||!this.#e)&&(this.#u(),this.#t.onPointerExit())},this.#s))}constructor(t){this.#t=t,this.#n=t.buffer??1;const e=t.transitIntentTimeout;this.#s=typeof e=="number"&&e>0?e:null,Qt([t.triggerNode,t.contentNode,t.enabled],([s,n,r])=>{if(!s||!n||!r){this.#h=null,this.#u();return}this.#h&&this.#h!==s&&this.#u(),this.#h=s;const h=Ae(s),i=a=>{this.#v([a.clientX,a.clientY],s,n)},f=a=>{const p=a.relatedTarget;if(bt(p)&&n.contains(p))return;const T=this.#t.ignoredTargets?.()??[];bt(p)&&T.some(E=>E===p||E.contains(p))||(this.#l=bt(p)&&T.length>0?T.filter(E=>p.contains(E)):[],this.#r=[a.clientX,a.clientY],this.#e="content",this.#d())},x=()=>{this.#u()},_=()=>{this.#u()},c=a=>{const p=a.relatedTarget;bt(p)&&s.contains(p)||(this.#r=[a.clientX,a.clientY],this.#e="trigger",this.#d())};return[St(h,"pointermove",i),St(s,"pointerleave",f),St(s,"pointerenter",x),St(n,"pointerenter",_),St(n,"pointerleave",c)].reduce((a,p)=>()=>{a(),p()},()=>{})})}#v(t,e,s){if(!this.#r||!this.#e)return;this.#a(),this.#f();const n=e.getBoundingClientRect(),r=s.getBoundingClientRect();if(this.#e==="content"&&Gt(t,r)){this.#u();return}if(this.#e==="trigger"&&Gt(t,n)){this.#u();return}if(this.#e==="content"&&this.#l.length>0)for(const _ of this.#l){const c=_.getBoundingClientRect();if(Gt(t,c))return;const a=le(n,c),p=this.#p(n,c,a);if(p&&jt(t,p))return}const h=le(n,r),i=this.#p(n,r,h);if(i&&jt(t,i))return;const f=this.#e==="content"?r:n,x=this.#m(this.#r,f,h,this.#e);jt(t,x)||(this.#u(),this.#t.onPointerExit())}#u(){this.#r=null,this.#e=null,this.#l=[],this.#a(),this.#c()}#p(t,e,s){const n=this.#n;switch(s){case"top":return[[Math.min(t.left,e.left)-n,t.top],[Math.min(t.left,e.left)-n,e.bottom],[Math.max(t.right,e.right)+n,e.bottom],[Math.max(t.right,e.right)+n,t.top]];case"bottom":return[[Math.min(t.left,e.left)-n,t.bottom],[Math.min(t.left,e.left)-n,e.top],[Math.max(t.right,e.right)+n,e.top],[Math.max(t.right,e.right)+n,t.bottom]];case"left":return[[t.left,Math.min(t.top,e.top)-n],[e.right,Math.min(t.top,e.top)-n],[e.right,Math.max(t.bottom,e.bottom)+n],[t.left,Math.max(t.bottom,e.bottom)+n]];case"right":return[[t.right,Math.min(t.top,e.top)-n],[e.left,Math.min(t.top,e.top)-n],[e.left,Math.max(t.bottom,e.bottom)+n],[t.right,Math.max(t.bottom,e.bottom)+n]]}}#m(t,e,s,n){const r=this.#n*4,[h,i]=t;switch(n==="trigger"?this.#g(s):s){case"top":return[[h-r,i+r],[h+r,i+r],[e.right+r,e.bottom],[e.right+r,e.top],[e.left-r,e.top],[e.left-r,e.bottom]];case"bottom":return[[h-r,i-r],[h+r,i-r],[e.right+r,e.top],[e.right+r,e.bottom],[e.left-r,e.bottom],[e.left-r,e.top]];case"left":return[[h+r,i-r],[h+r,i+r],[e.right,e.bottom+r],[e.left,e.bottom+r],[e.left,e.top-r],[e.right,e.top-r]];case"right":return[[h-r,i-r],[h-r,i+r],[e.left,e.bottom+r],[e.right,e.bottom+r],[e.right,e.top-r],[e.left,e.top-r]]}}#g(t){switch(t){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left"}}}const Jt=ze({component:"popover",parts:["root","trigger","content","close","overlay"]}),Rt=new Me("Popover.Root");class te{static create(t){return Rt.set(new te(t))}opts;#t=F(null);get contentNode(){return o(this.#t)}set contentNode(t){d(this.#t,t,!0)}contentPresence;#n=F(null);get triggerNode(){return o(this.#n)}set triggerNode(t){d(this.#n,t,!0)}#s=F(null);get overlayNode(){return o(this.#s)}set overlayNode(t){d(this.#s,t,!0)}overlayPresence;#r=F(!1);get openedViaHover(){return o(this.#r)}set openedViaHover(t){d(this.#r,t,!0)}#e=F(!1);get hasInteractedWithContent(){return o(this.#e)}set hasInteractedWithContent(t){d(this.#e,t,!0)}#l=F(!1);get hoverCooldown(){return o(this.#l)}set hoverCooldown(t){d(this.#l,t,!0)}#h=F(0);get closeDelay(){return o(this.#h)}set closeDelay(t){d(this.#h,t,!0)}#o=null;#i=null;constructor(t){this.opts=t,this.contentPresence=new ie({ref:k(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new ie({ref:k(()=>this.overlayNode),open:this.opts.open}),Qt(()=>this.opts.open.current,e=>{e||(this.openedViaHover=!1,this.hasInteractedWithContent=!1,this.#a())})}setDomContext(t){this.#i=t}#a(){this.#o!==null&&this.#i&&(this.#i.clearTimeout(this.#o),this.#o=null)}toggleOpen(){this.#a(),this.opts.open.current=!this.opts.open.current}handleClose(){this.#a(),this.opts.open.current&&(this.opts.open.current=!1)}handleHoverOpen(){this.#a(),!this.opts.open.current&&(this.openedViaHover=!0,this.opts.open.current=!0)}handleHoverClose(){this.opts.open.current&&this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1)}handleDelayedHoverClose(){this.opts.open.current&&(!this.openedViaHover||this.hasInteractedWithContent||(this.#a(),this.closeDelay<=0?this.opts.open.current=!1:this.#i&&(this.#o=this.#i.setTimeout(()=>{this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1),this.#o=null},this.closeDelay))))}cancelDelayedClose(){this.#a()}markInteraction(){this.hasInteractedWithContent=!0,this.#a()}}class ee{static create(t){return new ee(t,Rt.get())}opts;root;attachment;domContext;#t=null;#n=null;#s=F(!1);constructor(t,e){this.opts=t,this.root=e,this.attachment=de(this.opts.ref,s=>this.root.triggerNode=s),this.domContext=new Ve(t.ref),this.root.setDomContext(this.domContext),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),Qt(()=>this.opts.closeDelay.current,s=>{this.root.closeDelay=s})}#r(){this.#t!==null&&(this.domContext.clearTimeout(this.#t),this.#t=null)}#e(){this.#n!==null&&(this.domContext.clearTimeout(this.#n),this.#n=null)}#l(){this.#r(),this.#e()}onpointerenter(t){if(this.opts.disabled.current||!this.opts.openOnHover.current||Lt(t)||(d(this.#s,!0),this.#e(),this.root.cancelDelayedClose(),this.root.opts.open.current||this.root.hoverCooldown))return;const e=this.opts.openDelay.current;e<=0?this.root.handleHoverOpen():this.#t=this.domContext.setTimeout(()=>{this.root.handleHoverOpen(),this.#t=null},e)}onpointerleave(t){this.opts.disabled.current||this.opts.openOnHover.current&&(Lt(t)||(d(this.#s,!1),this.#r(),this.root.hoverCooldown=!1))}onclick(t){if(!this.opts.disabled.current&&t.button===0){if(this.#l(),o(this.#s)&&this.root.opts.open.current&&this.root.openedViaHover){this.root.openedViaHover=!1,this.root.hasInteractedWithContent=!0;return}o(this.#s)&&this.opts.openOnHover.current&&this.root.opts.open.current&&(this.root.hoverCooldown=!0),this.root.hoverCooldown&&!this.root.opts.open.current&&(this.root.hoverCooldown=!1),this.root.toggleOpen()}}onkeydown(t){this.opts.disabled.current||(t.key===Ie||t.key===Oe)&&(t.preventDefault(),this.#l(),this.root.toggleOpen())}#h(){if(this.root.opts.open.current&&this.root.contentNode?.id)return this.root.contentNode?.id}#o=O(()=>({id:this.opts.id.current,"aria-haspopup":"dialog","aria-expanded":ke(this.root.opts.open.current),"data-state":ce(this.root.opts.open.current),"aria-controls":this.#h(),[Jt.trigger]:"",disabled:this.opts.disabled.current,onkeydown:this.onkeydown,onclick:this.onclick,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return o(this.#o)}set props(t){d(this.#o,t)}}class oe{static create(t){return new oe(t,Rt.get())}opts;root;attachment;constructor(t,e){this.opts=t,this.root=e,this.attachment=de(this.opts.ref,s=>this.root.contentNode=s),this.onpointerdown=this.onpointerdown.bind(this),this.onfocusin=this.onfocusin.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),new je({triggerNode:()=>this.root.triggerNode,contentNode:()=>this.root.contentNode,enabled:()=>this.root.opts.open.current&&this.root.openedViaHover&&!this.root.hasInteractedWithContent,onPointerExit:()=>{this.root.handleDelayedHoverClose()}})}onpointerdown(t){this.root.markInteraction()}onfocusin(t){const e=t.target;bt(e)&&De(e)&&this.root.markInteraction()}onpointerenter(t){Lt(t)||this.root.cancelDelayedClose()}onpointerleave(t){Lt(t)}onInteractOutside=t=>{if(this.opts.onInteractOutside.current(t),t.defaultPrevented||!bt(t.target))return;const e=t.target.closest(Jt.selector("trigger"));if(!(e&&e===this.root.triggerNode)){if(this.opts.customAnchor.current){if(bt(this.opts.customAnchor.current)){if(this.opts.customAnchor.current.contains(t.target))return}else if(typeof this.opts.customAnchor.current=="string"){const s=document.querySelector(this.opts.customAnchor.current);if(s&&s.contains(t.target))return}}this.root.handleClose()}};onEscapeKeydown=t=>{this.opts.onEscapeKeydown.current(t),!t.defaultPrevented&&this.root.handleClose()};get shouldRender(){return this.root.contentPresence.shouldRender}get shouldTrapFocus(){return!(this.root.openedViaHover&&!this.root.hasInteractedWithContent)}#t=O(()=>({open:this.root.opts.open.current}));get snippetProps(){return o(this.#t)}set snippetProps(t){d(this.#t,t)}#n=O(()=>({id:this.opts.id.current,tabindex:-1,"data-state":ce(this.root.opts.open.current),[Jt.content]:"",style:{pointerEvents:"auto",contain:"layout style"},onpointerdown:this.onpointerdown,onfocusin:this.onfocusin,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return o(this.#n)}set props(t){d(this.#n,t)}popperProps={onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown}}var Ge=D("<div><div><!></div></div>"),Je=D("<div><div><!></div></div>");function Ue(m,t){const e=he();_t(t,!0);let s=v(t,"ref",15,null),n=v(t,"id",19,()=>pe(e)),r=v(t,"forceMount",3,!1),h=v(t,"onOpenAutoFocus",3,xt),i=v(t,"onCloseAutoFocus",3,xt),f=v(t,"onEscapeKeydown",3,xt),x=v(t,"onInteractOutside",3,xt),_=v(t,"trapFocus",3,!0),c=v(t,"preventScroll",3,!1),a=v(t,"customAnchor",3,null),p=ue(t,["$$slots","$$events","$$legacy","child","children","ref","id","forceMount","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeydown","onInteractOutside","trapFocus","preventScroll","customAnchor","style"]);const T=oe.create({id:k(()=>n()),ref:k(()=>s(),V=>s(V)),onInteractOutside:k(()=>x()),onEscapeKeydown:k(()=>f()),customAnchor:k(()=>a())}),E=O(()=>$t(p,T.props)),Ct=O(()=>_()&&T.shouldTrapFocus);function wt(V){T.shouldTrapFocus||V.preventDefault(),h()(V)}var W=j(),G=H(W);{var K=V=>{Fe(V,ne(()=>o(E),()=>T.popperProps,{get ref(){return T.opts.ref},get enabled(){return T.root.opts.open.current},get id(){return n()},get trapFocus(){return o(Ct)},get preventScroll(){return c()},loop:!0,forceMount:!0,get customAnchor(){return a()},onOpenAutoFocus:wt,get onCloseAutoFocus(){return i()},get shouldRender(){return T.shouldRender},popper:(pt,rt)=>{let ft=()=>rt?.().props,st=()=>rt?.().wrapperProps;const it=O(()=>$t(ft(),{style:ae("popover")},{style:t.style}));var at=j(),Ot=H(at);{var kt=M=>{var A=j(),S=H(A);{let Z=O(()=>({props:o(it),wrapperProps:st(),...T.snippetProps}));dt(S,()=>t.child,()=>o(Z))}u(M,A)},Pt=M=>{var A=Ge();ct(A,()=>({...st()}));var S=y(A);ct(S,()=>({...o(it)}));var Z=y(S);dt(Z,()=>t.children??Kt),C(S),C(A),u(M,A)};N(Ot,M=>{t.child?M(kt):M(Pt,!1)})}u(pt,at)},$$slots:{popper:!0}}))},nt=V=>{Ee(V,ne(()=>o(E),()=>T.popperProps,{get ref(){return T.opts.ref},get open(){return T.root.opts.open.current},get id(){return n()},get trapFocus(){return o(Ct)},get preventScroll(){return c()},loop:!0,forceMount:!1,get customAnchor(){return a()},onOpenAutoFocus:wt,get onCloseAutoFocus(){return i()},get shouldRender(){return T.shouldRender},popper:(pt,rt)=>{let ft=()=>rt?.().props,st=()=>rt?.().wrapperProps;const it=O(()=>$t(ft(),{style:ae("popover")},{style:t.style}));var at=j(),Ot=H(at);{var kt=M=>{var A=j(),S=H(A);{let Z=O(()=>({props:o(it),wrapperProps:st(),...T.snippetProps}));dt(S,()=>t.child,()=>o(Z))}u(M,A)},Pt=M=>{var A=Je();ct(A,()=>({...st()}));var S=y(A);ct(S,()=>({...o(it)}));var Z=y(S);dt(Z,()=>t.children??Kt),C(S),C(A),u(M,A)};N(Ot,M=>{t.child?M(kt):M(Pt,!1)})}u(pt,at)},$$slots:{popper:!0}}))};N(G,V=>{r()?V(K):r()||V(nt,1)})}u(m,W),yt()}var Ze=D("<button><!></button>");function Qe(m,t){const e=he();_t(t,!0);let s=v(t,"id",19,()=>pe(e)),n=v(t,"ref",15,null),r=v(t,"type",3,"button"),h=v(t,"disabled",3,!1),i=v(t,"openOnHover",3,!1),f=v(t,"openDelay",3,700),x=v(t,"closeDelay",3,300),_=ue(t,["$$slots","$$events","$$legacy","children","child","id","ref","type","disabled","openOnHover","openDelay","closeDelay"]);const c=ee.create({id:k(()=>s()),ref:k(()=>n(),p=>n(p)),disabled:k(()=>!!h()),openOnHover:k(()=>i()),openDelay:k(()=>f()),closeDelay:k(()=>x())}),a=O(()=>$t(_,c.props,{type:r()}));Se(m,{get id(){return s()},get ref(){return c.opts.ref},children:(p,T)=>{var E=j(),Ct=H(E);{var wt=G=>{var K=j(),nt=H(K);dt(nt,()=>t.child,()=>({props:o(a)})),u(G,K)},W=G=>{var K=Ze();ct(K,()=>({...o(a)}));var nt=y(K);dt(nt,()=>t.children??Kt),C(K),u(G,K)};N(Ct,G=>{t.child?G(wt):G(W,!1)})}u(p,E)},$$slots:{default:!0}}),yt()}function Re(m,t){_t(t,!0);let e=v(t,"open",15,!1),s=v(t,"onOpenChange",3,xt),n=v(t,"onOpenChangeComplete",3,xt);te.create({open:k(()=>e(),r=>{e(r),s()(r)}),onOpenChangeComplete:k(()=>n())}),Ne(m,{children:(r,h)=>{var i=j(),f=H(i);dt(f,()=>t.children??Kt),u(r,i)},$$slots:{default:!0}}),yt()}var to=Vt("<title> </title>"),eo=Vt('<svg><!><path d="M17.74,30,16,29l4-7h6a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2H6A2,2,0,0,0,4,8V20a2,2,0,0,0,2,2h9v2H6a4,4,0,0,1-4-4V8A4,4,0,0,1,6,4H26a4,4,0,0,1,4,4V20a4,4,0,0,1-4,4H21.16Z"></path><path d="M8 10H24V12H8z"></path><path d="M8 16H18V18H8z"></path></svg>');function oo(m,t){const e=Mt(t,["children","$$slots","$$events","$$legacy"]),s=Mt(e,["size","title"]);_t(t,!1);const n=At(),r=At();let h=v(t,"size",8,16),i=v(t,"title",8,void 0);Ht(()=>(ot(e),ot(i())),()=>{d(n,e["aria-label"]||e["aria-labelledby"]||i())}),Ht(()=>(o(n),ot(e)),()=>{d(r,{"aria-hidden":o(n)?void 0:!0,role:o(n)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),Ut(),Zt();var f=eo();ct(f,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:h(),height:h(),...o(r),...s}));var x=y(f);{var _=c=>{var a=to(),p=y(a,!0);C(a),ut(()=>Tt(p,i())),u(c,a)};N(x,c=>{i()&&c(_)})}U(3),C(f),u(m,f),yt()}var no=Vt("<title> </title>"),ro=Vt('<svg><!><path d="M10 6H28V8H10z"></path><path d="M10 24H28V26H10z"></path><path d="M10 15H28V17H10z"></path><path d="M4 15H6V17H4z"></path><path d="M4 6H6V8H4z"></path><path d="M4 24H6V26H4z"></path></svg>');function so(m,t){const e=Mt(t,["children","$$slots","$$events","$$legacy"]),s=Mt(e,["size","title"]);_t(t,!1);const n=At(),r=At();let h=v(t,"size",8,16),i=v(t,"title",8,void 0);Ht(()=>(ot(e),ot(i())),()=>{d(n,e["aria-label"]||e["aria-labelledby"]||i())}),Ht(()=>(o(n),ot(e)),()=>{d(r,{"aria-hidden":o(n)?void 0:!0,role:o(n)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),Ut(),Zt();var f=ro();ct(f,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:h(),height:h(),...o(r),...s}));var x=y(f);{var _=c=>{var a=no(),p=y(a,!0);C(a),ut(()=>Tt(p,i())),u(c,a)};N(x,c=>{i()&&c(_)})}U(6),C(f),u(m,f),yt()}var io=Vt("<title> </title>"),ao=Vt('<svg><!><path d="M26,4h-4V2h-2v2h-8V2h-2v2H6C4.9,4,4,4.9,4,6v20c0,1.1,0.9,2,2,2h20c1.1,0,2-0.9,2-2V6C28,4.9,27.1,4,26,4z M26,26H6V12h20 V26z M26,10H6V6h4v2h2V6h8v2h2V6h4V10z"></path></svg>');function lo(m,t){const e=Mt(t,["children","$$slots","$$events","$$legacy"]),s=Mt(e,["size","title"]);_t(t,!1);const n=At(),r=At();let h=v(t,"size",8,16),i=v(t,"title",8,void 0);Ht(()=>(ot(e),ot(i())),()=>{d(n,e["aria-label"]||e["aria-labelledby"]||i())}),Ht(()=>(o(n),ot(e)),()=>{d(r,{"aria-hidden":o(n)?void 0:!0,role:o(n)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),Ut(),Zt();var f=ao();ct(f,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:h(),height:h(),...o(r),...s}));var x=y(f);{var _=c=>{var a=io(),p=y(a,!0);C(a),ut(()=>Tt(p,i())),u(c,a)};N(x,c=>{i()&&c(_)})}U(),C(f),u(m,f),yt()}const ho=Re,uo=Qe,co=Ue;var po=D('<div class="tab active svelte-r6dy5f"><input class="tab-rename-input svelte-r6dy5f"/></div>'),fo=D('<span class="tab-close svelte-r6dy5f" title="Close"><!></span>'),vo=D('<button><span class="tab-label svelte-r6dy5f"> </span> <!></button>'),mo=D('<span class="tab-close svelte-r6dy5f" title="Close"><!></span>'),go=D('<button><span class="tab-label svelte-r6dy5f"> </span> <!></button>'),bo=D("<!> <span>New View</span>",1),_o=D('<button class="add-view-option svelte-r6dy5f"><!> List</button> <button class="add-view-option svelte-r6dy5f"><!> Calendar</button>',1),yo=D("<!> <!>",1),Co=D("<!> <!>",1),wo=D("<!> <!>",1),Po=D("<!> <!>",1),xo=D('<div class="tab-bar svelte-r6dy5f"><div class="tabs-scroll svelte-r6dy5f"><button><span class="tab-label svelte-r6dy5f">Home</span></button> <button><span class="tab-label svelte-r6dy5f">Graph</span></button> <!> <!> <!></div> <div class="bar-right svelte-r6dy5f"><!> <!></div></div> <!>',1);function $o(m,t){_t(t,!0);let e=v(t,"activeView",3,"entity");const s=ge("chat");function n(l){re(l,{noScroll:!0})}const r=O(()=>et.selectedId!==null),h=O(()=>{if(!et.selectedRepo||!et.selectedId)return"";for(const l of He.repos){if(l.name!==et.selectedRepo)continue;const g=l.entities.find(w=>w.id===et.selectedId);if(g)return g.title}return et.selectedId.replace(/-/g," ").replace(/\b\w/g,l=>l.toUpperCase())});function i(){et.deselect(),n("/")}let f=F(!1);async function x(l){d(f,!1);const g=l==="calendar"?"Calendar":"List",w=await Bt.create(g,l);re(`/views/${w.id}`)}let _=F(null),c=F(""),a=F(null),p=F(!1);function T(l){d(p,!1),d(_,l.id,!0),d(c,l.name,!0)}be(()=>{o(_)&&o(a)&&(o(a).focus(),o(a).select(),setTimeout(()=>{d(p,!0)},50))});function E(){o(p)&&(o(_)&&o(c).trim()&&Bt.update(o(_),{name:o(c).trim()}),d(_,null),d(p,!1))}function Ct(){d(_,null),d(p,!1)}function wt(l){l.key==="Enter"&&(l.preventDefault(),d(p,!0),E()),l.key==="Escape"&&(l.preventDefault(),Ct())}let W=F(null);function G(l,g){l.stopPropagation(),d(W,g,!0)}async function K(){o(W)&&(await Bt.remove(o(W).id),d(W,null))}var nt=xo(),V=H(nt),It=y(V),pt=y(It);let rt;var ft=z(pt,2);let st;var it=z(ft,2);we(it,17,()=>Bt.views,l=>l.id,(l,g)=>{var w=j(),Q=H(w);{var R=B=>{var I=po(),b=y(I);_e(b),Ce(b,P=>d(a,P),()=>o(a)),C(I),ut(P=>ye(b,"size",P),[()=>Math.max(o(c).length,1)]),X("keydown",b,wt),X("input",b,P=>{d(c,P.currentTarget.value,!0)}),me("blur",b,E),Pe(b,()=>o(c),P=>d(c,P)),u(B,I)},tt=B=>{const I=O(()=>e()==="view"&&et.activeViewId===o(g).id);var b=vo();let P;var lt=y(b),$=y(lt,!0);C(lt);var L=z(lt,2);{var Dt=Y=>{var J=fo(),zt=y(J);se(zt,{size:12}),C(J),X("click",J,Yt=>G(Yt,o(g))),u(Y,J)};N(L,Y=>{o(I)&&Y(Dt)})}C(b),ut(()=>{P=Wt(b,1,"tab svelte-r6dy5f",null,P,{"tab-permanent":!o(I),active:o(I)}),Tt($,o(g).name)}),X("click",b,()=>n(`/views/${o(g).id}`)),X("dblclick",b,()=>T(o(g))),u(B,b)};N(Q,B=>{o(_)===o(g).id?B(R):B(tt,!1)})}u(l,w)});var at=z(it,2);{var Ot=l=>{const g=O(()=>e()==="entity"&&o(r));var w=go();let Q;var R=y(w),tt=y(R,!0);C(R);var B=z(R,2);{var I=b=>{var P=mo(),lt=y(P);se(lt,{size:12}),C(P),X("click",P,$=>{$.stopPropagation(),i()}),u(b,P)};N(B,b=>{o(g)&&b(I)})}C(w),ut(()=>{Q=Wt(w,1,"tab svelte-r6dy5f",null,Q,{"tab-permanent":!o(g),active:o(g)}),Tt(tt,o(h))}),X("click",w,()=>n(et.entityPath??"/")),u(l,w)};N(at,l=>{o(r)&&l(Ot)})}var kt=z(at,2);q(kt,()=>ho,(l,g)=>{g(l,{get open(){return o(f)},set open(w){d(f,w,!0)},children:(w,Q)=>{var R=yo(),tt=H(R);q(tt,()=>uo,(I,b)=>{b(I,{class:"new-view-btn",title:"New view",children:(P,lt)=>{var $=bo(),L=H($);Te(L,{size:16}),U(2),u(P,$)},$$slots:{default:!0}})});var B=z(tt,2);q(B,()=>co,(I,b)=>{b(I,{class:"add-view-menu",sideOffset:4,align:"start",children:(P,lt)=>{var $=_o(),L=H($),Dt=y(L);so(Dt,{size:14}),U(),C(L);var Y=z(L,2),J=y(Y);lo(J,{size:14}),U(),C(Y),X("click",L,()=>x("list")),X("click",Y,()=>x("calendar")),u(P,$)},$$slots:{default:!0}})}),u(w,R)},$$slots:{default:!0}})}),C(It);var Pt=z(It,2),M=y(Pt);{var A=l=>{var g=j(),w=H(g);dt(w,()=>t.right),u(l,g)};N(M,l=>{t.right&&l(A)})}var S=z(M,2);{var Z=l=>{xe(l,{variant:"accent",size:"icon",class:"chat-toggle",title:"Open Agent",get onclick(){return s.toggle},children:(g,w)=>{oo(g,{size:14})},$$slots:{default:!0}})};N(S,l=>{s.open||l(Z)})}C(Pt),C(V);var fe=z(V,2);{let l=O(()=>!!o(W));q(fe,()=>qe,(g,w)=>{w(g,{get open(){return o(l)},onOpenChange:Q=>{Q||d(W,null)},children:(Q,R)=>{var tt=j(),B=H(tt);q(B,()=>We,(I,b)=>{b(I,{children:(P,lt)=>{var $=Po(),L=H($);q(L,()=>Be,(Y,J)=>{J(Y,{children:(zt,Yt)=>{var Ft=Co(),Et=H(Ft);q(Et,()=>$e,(vt,mt)=>{mt(vt,{children:(gt,qt)=>{U();var ht=Nt("Delete view?");u(gt,ht)},$$slots:{default:!0}})});var Xt=z(Et,2);q(Xt,()=>Ke,(vt,mt)=>{mt(vt,{children:(gt,qt)=>{U();var ht=Nt();ut(()=>Tt(ht,`The view "${o(W)?.name??""}" will be permanently deleted.`)),u(gt,ht)},$$slots:{default:!0}})}),u(zt,Ft)},$$slots:{default:!0}})});var Dt=z(L,2);q(Dt,()=>Le,(Y,J)=>{J(Y,{children:(zt,Yt)=>{var Ft=wo(),Et=H(Ft);q(Et,()=>Ye,(vt,mt)=>{mt(vt,{children:(gt,qt)=>{U();var ht=Nt("Cancel");u(gt,ht)},$$slots:{default:!0}})});var Xt=z(Et,2);q(Xt,()=>Xe,(vt,mt)=>{mt(vt,{onclick:K,children:(gt,qt)=>{U();var ht=Nt("Delete");u(gt,ht)},$$slots:{default:!0}})}),u(zt,Ft)},$$slots:{default:!0}})}),u(P,$)},$$slots:{default:!0}})}),u(Q,tt)},$$slots:{default:!0}})})}ut(()=>{rt=Wt(pt,1,"tab tab-permanent svelte-r6dy5f",null,rt,{active:e()==="home"}),st=Wt(ft,1,"tab tab-permanent svelte-r6dy5f",null,st,{active:e()==="graph"})}),X("click",pt,()=>n("/")),X("click",ft,()=>e()!=="graph"&&n("/graph")),u(m,nt),yt()}ve(["click","keydown","input","dblclick"]);export{co as C,ho as R,uo as T,$o as V,lo as a};
1
+ import{o as St,p as he,c as j,a as u,b as D,s as Tt,f as Vt,d as ve,g as X,t as Nt,e as me}from"./iDtAARVW.js";import{e as F,s as d,g as o,u as O,p as _t,h as H,b as yt,c as y,ad as Kt,r as C,l as Ht,d as ot,a as Ut,n as U,m as At,t as ut,aC as ge,a5 as be,i as z}from"./CT6oIU-C.js";import{b as dt,a as ct,r as _e,s as ye}from"./CmCtpZ1Y.js";import{i as N,b as Ce}from"./72bZS3G9.js";import{e as we}from"./CDV5Q7RN.js";import{c as q}from"./CXH6iFbA.js";import{s as Wt}from"./DGbA7IXh.js";import{b as Pe,B as xe}from"./BS2rFAVq.js";import{p as v,s as ne,r as ue,l as Mt}from"./cLyZlkXv.js";import{g as re}from"./Cpsr8-Xy.js";import{i as Zt}from"./Y90OgS-9.js";import{A as Te,C as se}from"./vSaooFHB.js";import{n as et}from"./4Hhzb6pv.js";import{v as Bt}from"./CGc1sIb_.js";import{w as He}from"./CJ8__CWt.js";import{w as Qt,H as Ae,I as bt,C as Me,a as de,J as Ve,K as Lt,E as Ie,S as Oe,L as ce,c as ke,N as De,O as ie,h as k,d as ze,f as pe,n as xt,P as Fe,p as Ee,m as $t,q as ae,r as Se,F as Ne,A as We,u as Be,v as $e,x as Ke,y as Le,z as Ye,B as Xe,G as qe}from"./CJUKmosC.js";function jt(m,t){const[e,s]=m;let n=!1;const r=t.length;for(let h=0,i=r-1;h<r;i=h++){const[f,x]=t[h]??[0,0],[_,c]=t[i]??[0,0];x>=s!=c>=s&&e<=(_-f)*(s-x)/(c-x)+f&&(n=!n)}return n}function Gt(m,t){return m[0]>=t.left&&m[0]<=t.right&&m[1]>=t.top&&m[1]<=t.bottom}function le(m,t){const e=m.left+m.width/2,s=m.top+m.height/2,n=t.left+t.width/2,r=t.top+t.height/2,h=n-e,i=r-s;return Math.abs(h)>Math.abs(i)?h>0?"right":"left":i>0?"bottom":"top"}class je{#t;#n;#s;#r=null;#e=null;#l=[];#h=null;#o=null;#i=null;#a(){this.#o!==null&&(cancelAnimationFrame(this.#o),this.#o=null)}#d(){this.#a(),this.#o=requestAnimationFrame(()=>{this.#o=null,!(!this.#r||!this.#e)&&(this.#u(),this.#t.onPointerExit())})}#c(){this.#i!==null&&(clearTimeout(this.#i),this.#i=null)}#f(){this.#s!==null&&(this.#c(),this.#i=window.setTimeout(()=>{this.#i=null,!(!this.#r||!this.#e)&&(this.#u(),this.#t.onPointerExit())},this.#s))}constructor(t){this.#t=t,this.#n=t.buffer??1;const e=t.transitIntentTimeout;this.#s=typeof e=="number"&&e>0?e:null,Qt([t.triggerNode,t.contentNode,t.enabled],([s,n,r])=>{if(!s||!n||!r){this.#h=null,this.#u();return}this.#h&&this.#h!==s&&this.#u(),this.#h=s;const h=Ae(s),i=a=>{this.#v([a.clientX,a.clientY],s,n)},f=a=>{const p=a.relatedTarget;if(bt(p)&&n.contains(p))return;const T=this.#t.ignoredTargets?.()??[];bt(p)&&T.some(E=>E===p||E.contains(p))||(this.#l=bt(p)&&T.length>0?T.filter(E=>p.contains(E)):[],this.#r=[a.clientX,a.clientY],this.#e="content",this.#d())},x=()=>{this.#u()},_=()=>{this.#u()},c=a=>{const p=a.relatedTarget;bt(p)&&s.contains(p)||(this.#r=[a.clientX,a.clientY],this.#e="trigger",this.#d())};return[St(h,"pointermove",i),St(s,"pointerleave",f),St(s,"pointerenter",x),St(n,"pointerenter",_),St(n,"pointerleave",c)].reduce((a,p)=>()=>{a(),p()},()=>{})})}#v(t,e,s){if(!this.#r||!this.#e)return;this.#a(),this.#f();const n=e.getBoundingClientRect(),r=s.getBoundingClientRect();if(this.#e==="content"&&Gt(t,r)){this.#u();return}if(this.#e==="trigger"&&Gt(t,n)){this.#u();return}if(this.#e==="content"&&this.#l.length>0)for(const _ of this.#l){const c=_.getBoundingClientRect();if(Gt(t,c))return;const a=le(n,c),p=this.#p(n,c,a);if(p&&jt(t,p))return}const h=le(n,r),i=this.#p(n,r,h);if(i&&jt(t,i))return;const f=this.#e==="content"?r:n,x=this.#m(this.#r,f,h,this.#e);jt(t,x)||(this.#u(),this.#t.onPointerExit())}#u(){this.#r=null,this.#e=null,this.#l=[],this.#a(),this.#c()}#p(t,e,s){const n=this.#n;switch(s){case"top":return[[Math.min(t.left,e.left)-n,t.top],[Math.min(t.left,e.left)-n,e.bottom],[Math.max(t.right,e.right)+n,e.bottom],[Math.max(t.right,e.right)+n,t.top]];case"bottom":return[[Math.min(t.left,e.left)-n,t.bottom],[Math.min(t.left,e.left)-n,e.top],[Math.max(t.right,e.right)+n,e.top],[Math.max(t.right,e.right)+n,t.bottom]];case"left":return[[t.left,Math.min(t.top,e.top)-n],[e.right,Math.min(t.top,e.top)-n],[e.right,Math.max(t.bottom,e.bottom)+n],[t.left,Math.max(t.bottom,e.bottom)+n]];case"right":return[[t.right,Math.min(t.top,e.top)-n],[e.left,Math.min(t.top,e.top)-n],[e.left,Math.max(t.bottom,e.bottom)+n],[t.right,Math.max(t.bottom,e.bottom)+n]]}}#m(t,e,s,n){const r=this.#n*4,[h,i]=t;switch(n==="trigger"?this.#g(s):s){case"top":return[[h-r,i+r],[h+r,i+r],[e.right+r,e.bottom],[e.right+r,e.top],[e.left-r,e.top],[e.left-r,e.bottom]];case"bottom":return[[h-r,i-r],[h+r,i-r],[e.right+r,e.top],[e.right+r,e.bottom],[e.left-r,e.bottom],[e.left-r,e.top]];case"left":return[[h+r,i-r],[h+r,i+r],[e.right,e.bottom+r],[e.left,e.bottom+r],[e.left,e.top-r],[e.right,e.top-r]];case"right":return[[h-r,i-r],[h-r,i+r],[e.left,e.bottom+r],[e.right,e.bottom+r],[e.right,e.top-r],[e.left,e.top-r]]}}#g(t){switch(t){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left"}}}const Jt=ze({component:"popover",parts:["root","trigger","content","close","overlay"]}),Rt=new Me("Popover.Root");class te{static create(t){return Rt.set(new te(t))}opts;#t=F(null);get contentNode(){return o(this.#t)}set contentNode(t){d(this.#t,t,!0)}contentPresence;#n=F(null);get triggerNode(){return o(this.#n)}set triggerNode(t){d(this.#n,t,!0)}#s=F(null);get overlayNode(){return o(this.#s)}set overlayNode(t){d(this.#s,t,!0)}overlayPresence;#r=F(!1);get openedViaHover(){return o(this.#r)}set openedViaHover(t){d(this.#r,t,!0)}#e=F(!1);get hasInteractedWithContent(){return o(this.#e)}set hasInteractedWithContent(t){d(this.#e,t,!0)}#l=F(!1);get hoverCooldown(){return o(this.#l)}set hoverCooldown(t){d(this.#l,t,!0)}#h=F(0);get closeDelay(){return o(this.#h)}set closeDelay(t){d(this.#h,t,!0)}#o=null;#i=null;constructor(t){this.opts=t,this.contentPresence=new ie({ref:k(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new ie({ref:k(()=>this.overlayNode),open:this.opts.open}),Qt(()=>this.opts.open.current,e=>{e||(this.openedViaHover=!1,this.hasInteractedWithContent=!1,this.#a())})}setDomContext(t){this.#i=t}#a(){this.#o!==null&&this.#i&&(this.#i.clearTimeout(this.#o),this.#o=null)}toggleOpen(){this.#a(),this.opts.open.current=!this.opts.open.current}handleClose(){this.#a(),this.opts.open.current&&(this.opts.open.current=!1)}handleHoverOpen(){this.#a(),!this.opts.open.current&&(this.openedViaHover=!0,this.opts.open.current=!0)}handleHoverClose(){this.opts.open.current&&this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1)}handleDelayedHoverClose(){this.opts.open.current&&(!this.openedViaHover||this.hasInteractedWithContent||(this.#a(),this.closeDelay<=0?this.opts.open.current=!1:this.#i&&(this.#o=this.#i.setTimeout(()=>{this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1),this.#o=null},this.closeDelay))))}cancelDelayedClose(){this.#a()}markInteraction(){this.hasInteractedWithContent=!0,this.#a()}}class ee{static create(t){return new ee(t,Rt.get())}opts;root;attachment;domContext;#t=null;#n=null;#s=F(!1);constructor(t,e){this.opts=t,this.root=e,this.attachment=de(this.opts.ref,s=>this.root.triggerNode=s),this.domContext=new Ve(t.ref),this.root.setDomContext(this.domContext),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),Qt(()=>this.opts.closeDelay.current,s=>{this.root.closeDelay=s})}#r(){this.#t!==null&&(this.domContext.clearTimeout(this.#t),this.#t=null)}#e(){this.#n!==null&&(this.domContext.clearTimeout(this.#n),this.#n=null)}#l(){this.#r(),this.#e()}onpointerenter(t){if(this.opts.disabled.current||!this.opts.openOnHover.current||Lt(t)||(d(this.#s,!0),this.#e(),this.root.cancelDelayedClose(),this.root.opts.open.current||this.root.hoverCooldown))return;const e=this.opts.openDelay.current;e<=0?this.root.handleHoverOpen():this.#t=this.domContext.setTimeout(()=>{this.root.handleHoverOpen(),this.#t=null},e)}onpointerleave(t){this.opts.disabled.current||this.opts.openOnHover.current&&(Lt(t)||(d(this.#s,!1),this.#r(),this.root.hoverCooldown=!1))}onclick(t){if(!this.opts.disabled.current&&t.button===0){if(this.#l(),o(this.#s)&&this.root.opts.open.current&&this.root.openedViaHover){this.root.openedViaHover=!1,this.root.hasInteractedWithContent=!0;return}o(this.#s)&&this.opts.openOnHover.current&&this.root.opts.open.current&&(this.root.hoverCooldown=!0),this.root.hoverCooldown&&!this.root.opts.open.current&&(this.root.hoverCooldown=!1),this.root.toggleOpen()}}onkeydown(t){this.opts.disabled.current||(t.key===Ie||t.key===Oe)&&(t.preventDefault(),this.#l(),this.root.toggleOpen())}#h(){if(this.root.opts.open.current&&this.root.contentNode?.id)return this.root.contentNode?.id}#o=O(()=>({id:this.opts.id.current,"aria-haspopup":"dialog","aria-expanded":ke(this.root.opts.open.current),"data-state":ce(this.root.opts.open.current),"aria-controls":this.#h(),[Jt.trigger]:"",disabled:this.opts.disabled.current,onkeydown:this.onkeydown,onclick:this.onclick,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return o(this.#o)}set props(t){d(this.#o,t)}}class oe{static create(t){return new oe(t,Rt.get())}opts;root;attachment;constructor(t,e){this.opts=t,this.root=e,this.attachment=de(this.opts.ref,s=>this.root.contentNode=s),this.onpointerdown=this.onpointerdown.bind(this),this.onfocusin=this.onfocusin.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),new je({triggerNode:()=>this.root.triggerNode,contentNode:()=>this.root.contentNode,enabled:()=>this.root.opts.open.current&&this.root.openedViaHover&&!this.root.hasInteractedWithContent,onPointerExit:()=>{this.root.handleDelayedHoverClose()}})}onpointerdown(t){this.root.markInteraction()}onfocusin(t){const e=t.target;bt(e)&&De(e)&&this.root.markInteraction()}onpointerenter(t){Lt(t)||this.root.cancelDelayedClose()}onpointerleave(t){Lt(t)}onInteractOutside=t=>{if(this.opts.onInteractOutside.current(t),t.defaultPrevented||!bt(t.target))return;const e=t.target.closest(Jt.selector("trigger"));if(!(e&&e===this.root.triggerNode)){if(this.opts.customAnchor.current){if(bt(this.opts.customAnchor.current)){if(this.opts.customAnchor.current.contains(t.target))return}else if(typeof this.opts.customAnchor.current=="string"){const s=document.querySelector(this.opts.customAnchor.current);if(s&&s.contains(t.target))return}}this.root.handleClose()}};onEscapeKeydown=t=>{this.opts.onEscapeKeydown.current(t),!t.defaultPrevented&&this.root.handleClose()};get shouldRender(){return this.root.contentPresence.shouldRender}get shouldTrapFocus(){return!(this.root.openedViaHover&&!this.root.hasInteractedWithContent)}#t=O(()=>({open:this.root.opts.open.current}));get snippetProps(){return o(this.#t)}set snippetProps(t){d(this.#t,t)}#n=O(()=>({id:this.opts.id.current,tabindex:-1,"data-state":ce(this.root.opts.open.current),[Jt.content]:"",style:{pointerEvents:"auto",contain:"layout style"},onpointerdown:this.onpointerdown,onfocusin:this.onfocusin,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return o(this.#n)}set props(t){d(this.#n,t)}popperProps={onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown}}var Ge=D("<div><div><!></div></div>"),Je=D("<div><div><!></div></div>");function Ue(m,t){const e=he();_t(t,!0);let s=v(t,"ref",15,null),n=v(t,"id",19,()=>pe(e)),r=v(t,"forceMount",3,!1),h=v(t,"onOpenAutoFocus",3,xt),i=v(t,"onCloseAutoFocus",3,xt),f=v(t,"onEscapeKeydown",3,xt),x=v(t,"onInteractOutside",3,xt),_=v(t,"trapFocus",3,!0),c=v(t,"preventScroll",3,!1),a=v(t,"customAnchor",3,null),p=ue(t,["$$slots","$$events","$$legacy","child","children","ref","id","forceMount","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeydown","onInteractOutside","trapFocus","preventScroll","customAnchor","style"]);const T=oe.create({id:k(()=>n()),ref:k(()=>s(),V=>s(V)),onInteractOutside:k(()=>x()),onEscapeKeydown:k(()=>f()),customAnchor:k(()=>a())}),E=O(()=>$t(p,T.props)),Ct=O(()=>_()&&T.shouldTrapFocus);function wt(V){T.shouldTrapFocus||V.preventDefault(),h()(V)}var W=j(),G=H(W);{var K=V=>{Fe(V,ne(()=>o(E),()=>T.popperProps,{get ref(){return T.opts.ref},get enabled(){return T.root.opts.open.current},get id(){return n()},get trapFocus(){return o(Ct)},get preventScroll(){return c()},loop:!0,forceMount:!0,get customAnchor(){return a()},onOpenAutoFocus:wt,get onCloseAutoFocus(){return i()},get shouldRender(){return T.shouldRender},popper:(pt,rt)=>{let ft=()=>rt?.().props,st=()=>rt?.().wrapperProps;const it=O(()=>$t(ft(),{style:ae("popover")},{style:t.style}));var at=j(),Ot=H(at);{var kt=M=>{var A=j(),S=H(A);{let Z=O(()=>({props:o(it),wrapperProps:st(),...T.snippetProps}));dt(S,()=>t.child,()=>o(Z))}u(M,A)},Pt=M=>{var A=Ge();ct(A,()=>({...st()}));var S=y(A);ct(S,()=>({...o(it)}));var Z=y(S);dt(Z,()=>t.children??Kt),C(S),C(A),u(M,A)};N(Ot,M=>{t.child?M(kt):M(Pt,!1)})}u(pt,at)},$$slots:{popper:!0}}))},nt=V=>{Ee(V,ne(()=>o(E),()=>T.popperProps,{get ref(){return T.opts.ref},get open(){return T.root.opts.open.current},get id(){return n()},get trapFocus(){return o(Ct)},get preventScroll(){return c()},loop:!0,forceMount:!1,get customAnchor(){return a()},onOpenAutoFocus:wt,get onCloseAutoFocus(){return i()},get shouldRender(){return T.shouldRender},popper:(pt,rt)=>{let ft=()=>rt?.().props,st=()=>rt?.().wrapperProps;const it=O(()=>$t(ft(),{style:ae("popover")},{style:t.style}));var at=j(),Ot=H(at);{var kt=M=>{var A=j(),S=H(A);{let Z=O(()=>({props:o(it),wrapperProps:st(),...T.snippetProps}));dt(S,()=>t.child,()=>o(Z))}u(M,A)},Pt=M=>{var A=Je();ct(A,()=>({...st()}));var S=y(A);ct(S,()=>({...o(it)}));var Z=y(S);dt(Z,()=>t.children??Kt),C(S),C(A),u(M,A)};N(Ot,M=>{t.child?M(kt):M(Pt,!1)})}u(pt,at)},$$slots:{popper:!0}}))};N(G,V=>{r()?V(K):r()||V(nt,1)})}u(m,W),yt()}var Ze=D("<button><!></button>");function Qe(m,t){const e=he();_t(t,!0);let s=v(t,"id",19,()=>pe(e)),n=v(t,"ref",15,null),r=v(t,"type",3,"button"),h=v(t,"disabled",3,!1),i=v(t,"openOnHover",3,!1),f=v(t,"openDelay",3,700),x=v(t,"closeDelay",3,300),_=ue(t,["$$slots","$$events","$$legacy","children","child","id","ref","type","disabled","openOnHover","openDelay","closeDelay"]);const c=ee.create({id:k(()=>s()),ref:k(()=>n(),p=>n(p)),disabled:k(()=>!!h()),openOnHover:k(()=>i()),openDelay:k(()=>f()),closeDelay:k(()=>x())}),a=O(()=>$t(_,c.props,{type:r()}));Se(m,{get id(){return s()},get ref(){return c.opts.ref},children:(p,T)=>{var E=j(),Ct=H(E);{var wt=G=>{var K=j(),nt=H(K);dt(nt,()=>t.child,()=>({props:o(a)})),u(G,K)},W=G=>{var K=Ze();ct(K,()=>({...o(a)}));var nt=y(K);dt(nt,()=>t.children??Kt),C(K),u(G,K)};N(Ct,G=>{t.child?G(wt):G(W,!1)})}u(p,E)},$$slots:{default:!0}}),yt()}function Re(m,t){_t(t,!0);let e=v(t,"open",15,!1),s=v(t,"onOpenChange",3,xt),n=v(t,"onOpenChangeComplete",3,xt);te.create({open:k(()=>e(),r=>{e(r),s()(r)}),onOpenChangeComplete:k(()=>n())}),Ne(m,{children:(r,h)=>{var i=j(),f=H(i);dt(f,()=>t.children??Kt),u(r,i)},$$slots:{default:!0}}),yt()}var to=Vt("<title> </title>"),eo=Vt('<svg><!><path d="M17.74,30,16,29l4-7h6a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2H6A2,2,0,0,0,4,8V20a2,2,0,0,0,2,2h9v2H6a4,4,0,0,1-4-4V8A4,4,0,0,1,6,4H26a4,4,0,0,1,4,4V20a4,4,0,0,1-4,4H21.16Z"></path><path d="M8 10H24V12H8z"></path><path d="M8 16H18V18H8z"></path></svg>');function oo(m,t){const e=Mt(t,["children","$$slots","$$events","$$legacy"]),s=Mt(e,["size","title"]);_t(t,!1);const n=At(),r=At();let h=v(t,"size",8,16),i=v(t,"title",8,void 0);Ht(()=>(ot(e),ot(i())),()=>{d(n,e["aria-label"]||e["aria-labelledby"]||i())}),Ht(()=>(o(n),ot(e)),()=>{d(r,{"aria-hidden":o(n)?void 0:!0,role:o(n)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),Ut(),Zt();var f=eo();ct(f,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:h(),height:h(),...o(r),...s}));var x=y(f);{var _=c=>{var a=to(),p=y(a,!0);C(a),ut(()=>Tt(p,i())),u(c,a)};N(x,c=>{i()&&c(_)})}U(3),C(f),u(m,f),yt()}var no=Vt("<title> </title>"),ro=Vt('<svg><!><path d="M10 6H28V8H10z"></path><path d="M10 24H28V26H10z"></path><path d="M10 15H28V17H10z"></path><path d="M4 15H6V17H4z"></path><path d="M4 6H6V8H4z"></path><path d="M4 24H6V26H4z"></path></svg>');function so(m,t){const e=Mt(t,["children","$$slots","$$events","$$legacy"]),s=Mt(e,["size","title"]);_t(t,!1);const n=At(),r=At();let h=v(t,"size",8,16),i=v(t,"title",8,void 0);Ht(()=>(ot(e),ot(i())),()=>{d(n,e["aria-label"]||e["aria-labelledby"]||i())}),Ht(()=>(o(n),ot(e)),()=>{d(r,{"aria-hidden":o(n)?void 0:!0,role:o(n)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),Ut(),Zt();var f=ro();ct(f,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:h(),height:h(),...o(r),...s}));var x=y(f);{var _=c=>{var a=no(),p=y(a,!0);C(a),ut(()=>Tt(p,i())),u(c,a)};N(x,c=>{i()&&c(_)})}U(6),C(f),u(m,f),yt()}var io=Vt("<title> </title>"),ao=Vt('<svg><!><path d="M26,4h-4V2h-2v2h-8V2h-2v2H6C4.9,4,4,4.9,4,6v20c0,1.1,0.9,2,2,2h20c1.1,0,2-0.9,2-2V6C28,4.9,27.1,4,26,4z M26,26H6V12h20 V26z M26,10H6V6h4v2h2V6h8v2h2V6h4V10z"></path></svg>');function lo(m,t){const e=Mt(t,["children","$$slots","$$events","$$legacy"]),s=Mt(e,["size","title"]);_t(t,!1);const n=At(),r=At();let h=v(t,"size",8,16),i=v(t,"title",8,void 0);Ht(()=>(ot(e),ot(i())),()=>{d(n,e["aria-label"]||e["aria-labelledby"]||i())}),Ht(()=>(o(n),ot(e)),()=>{d(r,{"aria-hidden":o(n)?void 0:!0,role:o(n)?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})}),Ut(),Zt();var f=ao();ct(f,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:h(),height:h(),...o(r),...s}));var x=y(f);{var _=c=>{var a=io(),p=y(a,!0);C(a),ut(()=>Tt(p,i())),u(c,a)};N(x,c=>{i()&&c(_)})}U(),C(f),u(m,f),yt()}const ho=Re,uo=Qe,co=Ue;var po=D('<div class="tab active svelte-r6dy5f"><input class="tab-rename-input svelte-r6dy5f"/></div>'),fo=D('<span class="tab-close svelte-r6dy5f" title="Close"><!></span>'),vo=D('<button><span class="tab-label svelte-r6dy5f"> </span> <!></button>'),mo=D('<span class="tab-close svelte-r6dy5f" title="Close"><!></span>'),go=D('<button><span class="tab-label svelte-r6dy5f"> </span> <!></button>'),bo=D("<!> <span>New View</span>",1),_o=D('<button class="add-view-option svelte-r6dy5f"><!> List</button> <button class="add-view-option svelte-r6dy5f"><!> Calendar</button>',1),yo=D("<!> <!>",1),Co=D("<!> <!>",1),wo=D("<!> <!>",1),Po=D("<!> <!>",1),xo=D('<div class="tab-bar svelte-r6dy5f"><div class="tabs-scroll svelte-r6dy5f"><button><span class="tab-label svelte-r6dy5f">Home</span></button> <button><span class="tab-label svelte-r6dy5f">Graph</span></button> <!> <!> <!></div> <div class="bar-right svelte-r6dy5f"><!> <!></div></div> <!>',1);function $o(m,t){_t(t,!0);let e=v(t,"activeView",3,"entity");const s=ge("chat");function n(l){re(l,{noScroll:!0})}const r=O(()=>et.selectedId!==null),h=O(()=>{if(!et.selectedRepo||!et.selectedId)return"";for(const l of He.repos){if(l.name!==et.selectedRepo)continue;const g=l.entities.find(w=>w.id===et.selectedId);if(g)return g.title}return et.selectedId.replace(/-/g," ").replace(/\b\w/g,l=>l.toUpperCase())});function i(){et.deselect(),n("/")}let f=F(!1);async function x(l){d(f,!1);const g=l==="calendar"?"Calendar":"List",w=await Bt.create(g,l);re(`/views/${w.id}`)}let _=F(null),c=F(""),a=F(null),p=F(!1);function T(l){d(p,!1),d(_,l.id,!0),d(c,l.name,!0)}be(()=>{o(_)&&o(a)&&(o(a).focus(),o(a).select(),setTimeout(()=>{d(p,!0)},50))});function E(){o(p)&&(o(_)&&o(c).trim()&&Bt.update(o(_),{name:o(c).trim()}),d(_,null),d(p,!1))}function Ct(){d(_,null),d(p,!1)}function wt(l){l.key==="Enter"&&(l.preventDefault(),d(p,!0),E()),l.key==="Escape"&&(l.preventDefault(),Ct())}let W=F(null);function G(l,g){l.stopPropagation(),d(W,g,!0)}async function K(){o(W)&&(await Bt.remove(o(W).id),d(W,null))}var nt=xo(),V=H(nt),It=y(V),pt=y(It);let rt;var ft=z(pt,2);let st;var it=z(ft,2);we(it,17,()=>Bt.views,l=>l.id,(l,g)=>{var w=j(),Q=H(w);{var R=B=>{var I=po(),b=y(I);_e(b),Ce(b,P=>d(a,P),()=>o(a)),C(I),ut(P=>ye(b,"size",P),[()=>Math.max(o(c).length,1)]),X("keydown",b,wt),X("input",b,P=>{d(c,P.currentTarget.value,!0)}),me("blur",b,E),Pe(b,()=>o(c),P=>d(c,P)),u(B,I)},tt=B=>{const I=O(()=>e()==="view"&&et.activeViewId===o(g).id);var b=vo();let P;var lt=y(b),$=y(lt,!0);C(lt);var L=z(lt,2);{var Dt=Y=>{var J=fo(),zt=y(J);se(zt,{size:12}),C(J),X("click",J,Yt=>G(Yt,o(g))),u(Y,J)};N(L,Y=>{o(I)&&Y(Dt)})}C(b),ut(()=>{P=Wt(b,1,"tab svelte-r6dy5f",null,P,{"tab-permanent":!o(I),active:o(I)}),Tt($,o(g).name)}),X("click",b,()=>n(`/views/${o(g).id}`)),X("dblclick",b,()=>T(o(g))),u(B,b)};N(Q,B=>{o(_)===o(g).id?B(R):B(tt,!1)})}u(l,w)});var at=z(it,2);{var Ot=l=>{const g=O(()=>e()==="entity"&&o(r));var w=go();let Q;var R=y(w),tt=y(R,!0);C(R);var B=z(R,2);{var I=b=>{var P=mo(),lt=y(P);se(lt,{size:12}),C(P),X("click",P,$=>{$.stopPropagation(),i()}),u(b,P)};N(B,b=>{o(g)&&b(I)})}C(w),ut(()=>{Q=Wt(w,1,"tab svelte-r6dy5f",null,Q,{"tab-permanent":!o(g),active:o(g)}),Tt(tt,o(h))}),X("click",w,()=>n(et.entityPath??"/")),u(l,w)};N(at,l=>{o(r)&&l(Ot)})}var kt=z(at,2);q(kt,()=>ho,(l,g)=>{g(l,{get open(){return o(f)},set open(w){d(f,w,!0)},children:(w,Q)=>{var R=yo(),tt=H(R);q(tt,()=>uo,(I,b)=>{b(I,{class:"new-view-btn",title:"New view",children:(P,lt)=>{var $=bo(),L=H($);Te(L,{size:16}),U(2),u(P,$)},$$slots:{default:!0}})});var B=z(tt,2);q(B,()=>co,(I,b)=>{b(I,{class:"add-view-menu",sideOffset:4,align:"start",children:(P,lt)=>{var $=_o(),L=H($),Dt=y(L);so(Dt,{size:14}),U(),C(L);var Y=z(L,2),J=y(Y);lo(J,{size:14}),U(),C(Y),X("click",L,()=>x("list")),X("click",Y,()=>x("calendar")),u(P,$)},$$slots:{default:!0}})}),u(w,R)},$$slots:{default:!0}})}),C(It);var Pt=z(It,2),M=y(Pt);{var A=l=>{var g=j(),w=H(g);dt(w,()=>t.right),u(l,g)};N(M,l=>{t.right&&l(A)})}var S=z(M,2);{var Z=l=>{xe(l,{variant:"accent",size:"icon",class:"chat-toggle",title:"Open Agent",get onclick(){return s.toggle},children:(g,w)=>{oo(g,{size:14})},$$slots:{default:!0}})};N(S,l=>{s.open||l(Z)})}C(Pt),C(V);var fe=z(V,2);{let l=O(()=>!!o(W));q(fe,()=>qe,(g,w)=>{w(g,{get open(){return o(l)},onOpenChange:Q=>{Q||d(W,null)},children:(Q,R)=>{var tt=j(),B=H(tt);q(B,()=>We,(I,b)=>{b(I,{children:(P,lt)=>{var $=Po(),L=H($);q(L,()=>Be,(Y,J)=>{J(Y,{children:(zt,Yt)=>{var Ft=Co(),Et=H(Ft);q(Et,()=>$e,(vt,mt)=>{mt(vt,{children:(gt,qt)=>{U();var ht=Nt("Delete view?");u(gt,ht)},$$slots:{default:!0}})});var Xt=z(Et,2);q(Xt,()=>Ke,(vt,mt)=>{mt(vt,{children:(gt,qt)=>{U();var ht=Nt();ut(()=>Tt(ht,`The view "${o(W)?.name??""}" will be permanently deleted.`)),u(gt,ht)},$$slots:{default:!0}})}),u(zt,Ft)},$$slots:{default:!0}})});var Dt=z(L,2);q(Dt,()=>Le,(Y,J)=>{J(Y,{children:(zt,Yt)=>{var Ft=wo(),Et=H(Ft);q(Et,()=>Ye,(vt,mt)=>{mt(vt,{children:(gt,qt)=>{U();var ht=Nt("Cancel");u(gt,ht)},$$slots:{default:!0}})});var Xt=z(Et,2);q(Xt,()=>Xe,(vt,mt)=>{mt(vt,{onclick:K,children:(gt,qt)=>{U();var ht=Nt("Delete");u(gt,ht)},$$slots:{default:!0}})}),u(zt,Ft)},$$slots:{default:!0}})}),u(P,$)},$$slots:{default:!0}})}),u(Q,tt)},$$slots:{default:!0}})})}ut(()=>{rt=Wt(pt,1,"tab tab-permanent svelte-r6dy5f",null,rt,{active:e()==="home"}),st=Wt(ft,1,"tab tab-permanent svelte-r6dy5f",null,st,{active:e()==="graph"})}),X("click",pt,()=>n("/")),X("click",ft,()=>e()!=="graph"&&n("/graph")),u(m,nt),yt()}ve(["click","keydown","input","dblclick"]);export{co as C,ho as R,uo as T,$o as V,lo as a};
@@ -1 +1 @@
1
- import{s as e}from"./WlsUHv-K.js";const r=()=>{const s=e;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},b={subscribe(s){return r().page.subscribe(s)}};export{b as p};
1
+ import{s as e}from"./Cpsr8-Xy.js";const r=()=>{const s=e;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},b={subscribe(s){return r().page.subscribe(s)}};export{b as p};
@@ -1 +1 @@
1
- import{O as _,f as P,g as b,e as W,w as m,a as G,t as k,c as A,r as I,b as q,d as j,h as V,i as R,j as z,k as C,l as K,D as Q,p as X,m as Z}from"./CSVbGg_b.js";import{r as O}from"./vANlie4P.js";const T=3e4;class $ extends _{constructor(n){super(),this.doc=n,this.clientID=n.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{const e=b();this.getLocalState()!==null&&T/2<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const s=[];this.meta.forEach((a,c)=>{c!==this.clientID&&T<=e-a.lastUpdated&&this.states.has(c)&&s.push(c)}),s.length>0&&Y(this,s,"timeout")},P(T/10)),n.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(n){const e=this.clientID,s=this.meta.get(e),a=s===void 0?0:s.clock+1,c=this.states.get(e);n===null?this.states.delete(e):this.states.set(e,n),this.meta.set(e,{clock:a,lastUpdated:b()});const i=[],u=[],r=[],f=[];n===null?f.push(e):c==null?n!=null&&i.push(e):(u.push(e),W(c,n)||r.push(e)),(i.length>0||r.length>0||f.length>0)&&this.emit("change",[{added:i,updated:r,removed:f},"local"]),this.emit("update",[{added:i,updated:u,removed:f},"local"])}setLocalStateField(n,e){const s=this.getLocalState();s!==null&&this.setLocalState({...s,[n]:e})}getStates(){return this.states}}const Y=(t,n,e)=>{const s=[];for(let a=0;a<n.length;a++){const c=n[a];if(t.states.has(c)){if(t.states.delete(c),c===t.clientID){const i=t.meta.get(c);t.meta.set(c,{clock:i.clock+1,lastUpdated:b()})}s.push(c)}}s.length>0&&(t.emit("change",[{added:[],updated:[],removed:s},e]),t.emit("update",[{added:[],updated:[],removed:s},e]))},H=(t,n,e=t.states)=>{const s=n.length,a=A();m(a,s);for(let c=0;c<s;c++){const i=n[c],u=e.get(i)||null,r=t.meta.get(i).clock;m(a,i),m(a,r),G(a,JSON.stringify(u))}return k(a)},tt=(t,n,e)=>{const s=j(n),a=b(),c=[],i=[],u=[],r=[],f=I(s);for(let w=0;w<f;w++){const d=I(s);let y=I(s);const h=JSON.parse(q(s)),g=t.meta.get(d),U=t.states.get(d),S=g===void 0?0:g.clock;(S<y||S===y&&h===null&&t.states.has(d))&&(h===null?d===t.clientID&&t.getLocalState()!=null?y++:t.states.delete(d):t.states.set(d,h),t.meta.set(d,{clock:y,lastUpdated:a}),g===void 0&&h!==null?c.push(d):g!==void 0&&h===null?r.push(d):h!==null&&(W(h,U)||u.push(d),i.push(d)))}(c.length>0||u.length>0||r.length>0)&&t.emit("change",[{added:c,updated:u,removed:r},e]),(c.length>0||i.length>0||r.length>0)&&t.emit("update",[{added:c,updated:i,removed:r},e])},B=0,M=1,N=2,et=(t,n)=>{m(t,B);const e=R(n);V(t,e)},nt=(t,n,e)=>{m(t,M),V(t,K(n,e))},st=(t,n,e)=>nt(n,e,C(t)),F=(t,n,e,s)=>{try{z(n,C(t),e)}catch(a){s?.(a),console.error("Caught error while handling a Yjs update",a)}},at=(t,n)=>{m(t,N),V(t,n)},ct=F,ot=(t,n,e,s,a)=>{const c=I(t);switch(c){case B:st(t,n,e);break;case M:F(t,e,s,a);break;case N:ct(t,e,s,a);break;default:throw new Error("Unknown message type")}return c},L=0,x=1;function it(t,n,e){const s=new TextEncoder().encode(t),a=new ArrayBuffer(2+s.length+1+e.length);return new DataView(a).setUint16(0,s.length),new Uint8Array(a,2,s.length).set(s),new Uint8Array(a)[2+s.length]=n,new Uint8Array(a,2+s.length+1).set(e),a}function lt(t){if(t.byteLength<3)return null;const e=new DataView(t).getUint16(0);if(t.byteLength<2+e+1)return null;const s=new TextDecoder().decode(new Uint8Array(t,2,e)),a=new Uint8Array(t)[2+e],c=new Uint8Array(t,2+e+1);return{docName:s,msgType:a,payload:c}}function ut(t,n){const e=new Q,s=e.getText("content"),a=new $(e);a.setLocalStateField("user",{name:n.name,color:n.color,colorLight:n.colorLight??n.color+"33"});let c=null,i=!1,u=!1;function r(){return O.ws??null}function f(o,p){const l=r();!l||l.readyState!==WebSocket.OPEN||l.send(it(t,o,p))}function w(){const o=A();et(o,e),f(L,k(o))}function d(o){const p=o??[e.clientID],l=H(a,p);f(x,l)}function y(o){if(i||typeof o.data=="string")return;const p=o.data instanceof ArrayBuffer?o.data:null;if(!p)return;const l=lt(p);if(!(!l||l.docName!==t))if(l.msgType===L){const v=j(l.payload),D=X(v),E=A();ot(v,E,e,"ws-server"),Z(E)>0&&f(L,k(E)),!u&&(D===M||D===N)&&(u=!0,S.synced=!0)}else l.msgType===x&&tt(a,l.payload,"ws-server")}function h(o,p){if(i||p==="ws-server")return;const l=A();at(l,o),f(L,k(l))}function g({added:o,updated:p,removed:l},v){if(i||v==="ws-server")return;const D=o.concat(p,l);d(D)}function U(){if(i)return;const o=r();!o||o.readyState!==WebSocket.OPEN||(o.send(JSON.stringify({type:"collab:join",docName:t})),c&&o.removeEventListener("message",c),c=y,o.addEventListener("message",c),w(),d())}const S={ydoc:e,ytext:s,awareness:a,synced:!1,destroy:J};e.on("update",h),a.on("update",g),U(),O.addConnectHandler(U);function J(){if(i)return;i=!0,Y(a,[e.clientID],"local"),d([e.clientID]);const o=r();o&&o.readyState===WebSocket.OPEN&&o.send(JSON.stringify({type:"collab:leave",docName:t})),c&&o&&(o.removeEventListener("message",c),c=null),e.off("update",h),a.off("update",g),a.destroy(),e.destroy()}return S}export{ut as createCollabSession};
1
+ import{O as _,f as P,g as b,e as W,w as m,a as G,t as k,c as A,r as I,b as q,d as j,h as V,i as R,j as z,k as C,l as K,D as Q,p as X,m as Z}from"./CSVbGg_b.js";import{r as O}from"./DTZE-yoq.js";const T=3e4;class $ extends _{constructor(n){super(),this.doc=n,this.clientID=n.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{const e=b();this.getLocalState()!==null&&T/2<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const s=[];this.meta.forEach((a,c)=>{c!==this.clientID&&T<=e-a.lastUpdated&&this.states.has(c)&&s.push(c)}),s.length>0&&Y(this,s,"timeout")},P(T/10)),n.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(n){const e=this.clientID,s=this.meta.get(e),a=s===void 0?0:s.clock+1,c=this.states.get(e);n===null?this.states.delete(e):this.states.set(e,n),this.meta.set(e,{clock:a,lastUpdated:b()});const i=[],u=[],r=[],f=[];n===null?f.push(e):c==null?n!=null&&i.push(e):(u.push(e),W(c,n)||r.push(e)),(i.length>0||r.length>0||f.length>0)&&this.emit("change",[{added:i,updated:r,removed:f},"local"]),this.emit("update",[{added:i,updated:u,removed:f},"local"])}setLocalStateField(n,e){const s=this.getLocalState();s!==null&&this.setLocalState({...s,[n]:e})}getStates(){return this.states}}const Y=(t,n,e)=>{const s=[];for(let a=0;a<n.length;a++){const c=n[a];if(t.states.has(c)){if(t.states.delete(c),c===t.clientID){const i=t.meta.get(c);t.meta.set(c,{clock:i.clock+1,lastUpdated:b()})}s.push(c)}}s.length>0&&(t.emit("change",[{added:[],updated:[],removed:s},e]),t.emit("update",[{added:[],updated:[],removed:s},e]))},H=(t,n,e=t.states)=>{const s=n.length,a=A();m(a,s);for(let c=0;c<s;c++){const i=n[c],u=e.get(i)||null,r=t.meta.get(i).clock;m(a,i),m(a,r),G(a,JSON.stringify(u))}return k(a)},tt=(t,n,e)=>{const s=j(n),a=b(),c=[],i=[],u=[],r=[],f=I(s);for(let w=0;w<f;w++){const d=I(s);let y=I(s);const h=JSON.parse(q(s)),g=t.meta.get(d),U=t.states.get(d),S=g===void 0?0:g.clock;(S<y||S===y&&h===null&&t.states.has(d))&&(h===null?d===t.clientID&&t.getLocalState()!=null?y++:t.states.delete(d):t.states.set(d,h),t.meta.set(d,{clock:y,lastUpdated:a}),g===void 0&&h!==null?c.push(d):g!==void 0&&h===null?r.push(d):h!==null&&(W(h,U)||u.push(d),i.push(d)))}(c.length>0||u.length>0||r.length>0)&&t.emit("change",[{added:c,updated:u,removed:r},e]),(c.length>0||i.length>0||r.length>0)&&t.emit("update",[{added:c,updated:i,removed:r},e])},B=0,M=1,N=2,et=(t,n)=>{m(t,B);const e=R(n);V(t,e)},nt=(t,n,e)=>{m(t,M),V(t,K(n,e))},st=(t,n,e)=>nt(n,e,C(t)),F=(t,n,e,s)=>{try{z(n,C(t),e)}catch(a){s?.(a),console.error("Caught error while handling a Yjs update",a)}},at=(t,n)=>{m(t,N),V(t,n)},ct=F,ot=(t,n,e,s,a)=>{const c=I(t);switch(c){case B:st(t,n,e);break;case M:F(t,e,s,a);break;case N:ct(t,e,s,a);break;default:throw new Error("Unknown message type")}return c},L=0,x=1;function it(t,n,e){const s=new TextEncoder().encode(t),a=new ArrayBuffer(2+s.length+1+e.length);return new DataView(a).setUint16(0,s.length),new Uint8Array(a,2,s.length).set(s),new Uint8Array(a)[2+s.length]=n,new Uint8Array(a,2+s.length+1).set(e),a}function lt(t){if(t.byteLength<3)return null;const e=new DataView(t).getUint16(0);if(t.byteLength<2+e+1)return null;const s=new TextDecoder().decode(new Uint8Array(t,2,e)),a=new Uint8Array(t)[2+e],c=new Uint8Array(t,2+e+1);return{docName:s,msgType:a,payload:c}}function ut(t,n){const e=new Q,s=e.getText("content"),a=new $(e);a.setLocalStateField("user",{name:n.name,color:n.color,colorLight:n.colorLight??n.color+"33"});let c=null,i=!1,u=!1;function r(){return O.ws??null}function f(o,p){const l=r();!l||l.readyState!==WebSocket.OPEN||l.send(it(t,o,p))}function w(){const o=A();et(o,e),f(L,k(o))}function d(o){const p=o??[e.clientID],l=H(a,p);f(x,l)}function y(o){if(i||typeof o.data=="string")return;const p=o.data instanceof ArrayBuffer?o.data:null;if(!p)return;const l=lt(p);if(!(!l||l.docName!==t))if(l.msgType===L){const v=j(l.payload),D=X(v),E=A();ot(v,E,e,"ws-server"),Z(E)>0&&f(L,k(E)),!u&&(D===M||D===N)&&(u=!0,S.synced=!0)}else l.msgType===x&&tt(a,l.payload,"ws-server")}function h(o,p){if(i||p==="ws-server")return;const l=A();at(l,o),f(L,k(l))}function g({added:o,updated:p,removed:l},v){if(i||v==="ws-server")return;const D=o.concat(p,l);d(D)}function U(){if(i)return;const o=r();!o||o.readyState!==WebSocket.OPEN||(o.send(JSON.stringify({type:"collab:join",docName:t})),c&&o.removeEventListener("message",c),c=y,o.addEventListener("message",c),w(),d())}const S={ydoc:e,ytext:s,awareness:a,synced:!1,destroy:J};e.on("update",h),a.on("update",g),U(),O.addConnectHandler(U);function J(){if(i)return;i=!0,Y(a,[e.clientID],"local"),d([e.clientID]);const o=r();o&&o.readyState===WebSocket.OPEN&&o.send(JSON.stringify({type:"collab:leave",docName:t})),c&&o&&(o.removeEventListener("message",c),c=null),e.off("update",h),a.off("update",g),a.destroy(),e.destroy()}return S}export{ut as createCollabSession};
@@ -1 +1 @@
1
- import{a,b as G,o as ye,g as Ct,e as Me,c as b,d as Ee,t as he,s as Yt,f as Ft}from"./iDtAARVW.js";import{p as fe,c as J,r as Y,t as K,b as ve,e as A,f as we,a5 as ht,s as r,g as e,a6 as Xt,aE as xe,i as Lt,u as l,ad as lt,h}from"./CT6oIU-C.js";import{i as B,b as Ie}from"./72bZS3G9.js";import{e as ue}from"./CDV5Q7RN.js";import{s as y,c as le,b as p,a as Pe,S as Ae}from"./CmCtpZ1Y.js";import{p as T,s as ce,r as Ce}from"./cLyZlkXv.js";import{a as O,c as it,s as Le,S as He}from"./vANlie4P.js";import{c as Tt}from"./CXH6iFbA.js";import{c as st,s as rt}from"./DGbA7IXh.js";import"./Y90OgS-9.js";const Oe=Array(12).fill(0);var ke=G('<div class="sonner-loading-bar"></div>'),Ne=G('<div><div class="sonner-spinner"></div></div>');function Re(_,t){fe(t,!0);var C=Ne(),k=J(C);ue(k,23,()=>Oe,($,tt)=>`spinner-bar-${tt}`,($,tt)=>{var ct=ke();a($,ct)}),Y(k),Y(C),K($=>{rt(C,1,$),y(C,"data-visible",t.visible)},[()=>st(["sonner-loading-wrapper",t.class].filter(Boolean).join(" "))]),a(_,C),ve()}function Zt(_){return _.label!==void 0}function Fe(){let _=A(we(typeof document<"u"?document.hidden:!1));return ht(()=>ye(document,"visibilitychange",()=>{r(_,document.hidden,!0)})),{get current(){return e(_)}}}const be=4e3,ze=14,We=45,Ue=200,Ve=.05,je={toast:"",title:"",description:"",loader:"",closeButton:"",cancelButton:"",actionButton:"",action:"",warning:"",error:"",success:"",default:"",info:"",loading:""};function Ke(_){const[t,C]=_.split("-"),k=[];return t&&k.push(t),C&&k.push(C),k}function _e(_){return 1/(1.5+Math.abs(_)/20)}var Ye=G("<div><!></div>"),Ze=G('<button data-close-button=""><!></button>'),Ge=G('<div data-icon=""><!> <!></div>'),Xe=G('<div data-description=""><!></div>'),Qe=G('<button data-button="" data-cancel=""> </button>'),qe=G('<button data-button=""> </button>'),Je=G('<!> <div data-content=""><div data-title=""><!></div> <!></div> <!> <!>',1),pe=G('<li aria-atomic="true" data-sonner-toast=""><!> <!></li>');function $e(_,t){fe(t,!0);const C=s=>{var c=b(),v=h(c);{var w=g=>{var L=Ye(),It=J(L);p(It,()=>t.loadingIcon),Y(L),K(Rt=>{rt(L,1,Rt),y(L,"data-visible",e(S)==="loading")},[()=>st(it(e(j)?.loader,t.toast?.classes?.loader,"sonner-loader"))]),a(g,L)},x=g=>{{let L=l(()=>it(e(j)?.loader,t.toast.classes?.loader)),It=l(()=>e(S)==="loading");Re(g,{get class(){return e(L)},get visible(){return e(It)}})}};B(v,g=>{t.loadingIcon?g(w):g(x,!1)})}a(s,c)};let k=T(t,"cancelButtonStyle",3,""),$=T(t,"actionButtonStyle",3,""),tt=T(t,"descriptionClass",3,""),ct=T(t,"unstyled",3,!1),Bt=T(t,"defaultRichColors",3,!1);const St={...je};let V=A(!1),N=A(!1),Dt=A(!1),Ht=A(!1),Ot=A(!1),W=A(0),dt=A(0),Mt=t.toast.duration||t.duration||be,Z=A(void 0),et=A(null),kt=A(null);const Qt=l(()=>t.index===0),qt=l(()=>t.index+1<=t.visibleToasts),S=l(()=>t.toast.type),U=l(()=>t.toast.dismissible!==void 0?t.toast.dismissible!==!1:t.toast.dismissable!==!1),Et=l(()=>t.toast.class||""),yt=l(()=>t.toast.descriptionClass||""),ut=l(()=>O.heights.findIndex(s=>s.toastId===t.toast.id)||0),ft=l(()=>t.toast.closeButton??t.closeButton),wt=l(()=>t.toast.duration??t.duration??be);let bt=null;const zt=l(()=>t.position.split("-")),Jt=l(()=>O.heights.reduce((s,c,v)=>v>=e(ut)?s:s+c.height,0)),pt=Fe(),$t=l(()=>t.toast.invert||t.invert),Nt=l(()=>e(S)==="loading"),j=l(()=>({...St,...t.classes})),te=l(()=>t.toast.title),ee=l(()=>t.toast.description);let vt=A(0),Wt=A(0);const Pt=l(()=>Math.round(e(ut)*ze+e(Jt)));ht(()=>{e(te),e(ee);let s;t.expanded||t.expandByDefault?s=1:s=1-t.index*Ve;const c=Xt(()=>e(Z));if(c===void 0)return;c.style.setProperty("height","auto");const v=c.offsetHeight,w=c.getBoundingClientRect().height,x=Math.round(w/s+Number.EPSILON&100)/100;c.style.removeProperty("height");let g;Math.abs(x-v)<1?g=x:g=v,r(dt,g,!0),O.setHeight({toastId:t.toast.id,height:g})});function n(){r(N,!0),r(W,e(Pt),!0),O.removeHeight(t.toast.id),setTimeout(()=>{O.remove(t.toast.id)},Ue)}let M;const nt=l(()=>t.toast.promise&&e(S)==="loading"||t.toast.duration===Number.POSITIVE_INFINITY);function at(){r(vt,new Date().getTime(),!0),M=setTimeout(()=>{t.toast.onAutoClose?.(t.toast),n()},Mt)}function xt(){if(e(Wt)<e(vt)){const s=new Date().getTime()-e(vt);Mt=Mt-s}r(Wt,new Date().getTime(),!0)}ht(()=>{t.toast.updated&&(clearTimeout(M),Mt=e(wt),at())}),ht(()=>(e(nt)||(t.expanded||t.interacting||t.pauseWhenPageIsHidden&&pt.current?xt():at()),()=>clearTimeout(M))),xe(()=>{r(V,!0);const s=e(Z)?.getBoundingClientRect().height;return r(dt,s,!0),O.setHeight({toastId:t.toast.id,height:s}),()=>{O.removeHeight(t.toast.id)}}),ht(()=>{t.toast.delete&&Xt(()=>{n(),t.toast.onDismiss?.(t.toast)})});const ne=s=>{if(e(Nt))return;r(W,e(Pt),!0);const c=s.target;c.setPointerCapture(s.pointerId),c.tagName!=="BUTTON"&&(r(Dt,!0),bt={x:s.clientX,y:s.clientY})},me=()=>{if(e(Ht)||!e(U))return;bt=null;const s=Number(e(Z)?.style.getPropertyValue("--swipe-amount-x").replace("px","")||0),c=Number(e(Z)?.style.getPropertyValue("--swipe-amount-y").replace("px","")||0),v=new Date().getTime()-0,w=e(et)==="x"?s:c,x=Math.abs(w)/v;if(Math.abs(w)>=We||x>.11){r(W,e(Pt),!0),t.toast.onDismiss?.(t.toast),e(et)==="x"?r(kt,s>0?"right":"left",!0):r(kt,c>0?"down":"up",!0),n(),r(Ht,!0);return}else e(Z)?.style.setProperty("--swipe-amount-x","0px"),e(Z)?.style.setProperty("--swipe-amount-y","0px");r(Ot,!1),r(Dt,!1),r(et,null)},Ut=s=>{if(!bt||!e(U)||(window.getSelection()?.toString().length??-1)>0)return;const v=s.clientY-bt.y,w=s.clientX-bt.x,x=t.swipeDirections??Ke(t.position);!e(et)&&(Math.abs(w)>1||Math.abs(v)>1)&&r(et,Math.abs(w)>Math.abs(v)?"x":"y",!0);let g={x:0,y:0};if(e(et)==="y"){if(x.includes("top")||x.includes("bottom"))if(x.includes("top")&&v<0||x.includes("bottom")&&v>0)g.y=v;else{const L=v*_e(v);g.y=Math.abs(L)<Math.abs(v)?L:v}}else if(e(et)==="x"&&(x.includes("left")||x.includes("right")))if(x.includes("left")&&w<0||x.includes("right")&&w>0)g.x=w;else{const L=w*_e(w);g.x=Math.abs(L)<Math.abs(w)?L:w}(Math.abs(g.x)>0||Math.abs(g.y)>0)&&r(Ot,!0),e(Z)?.style.setProperty("--swipe-amount-x",`${g.x}px`),e(Z)?.style.setProperty("--swipe-amount-y",`${g.y}px`)},ot=()=>{r(Dt,!1),r(et,null),bt=null},mt=l(()=>t.toast.icon?t.toast.icon:e(S)==="success"?t.successIcon:e(S)==="error"?t.errorIcon:e(S)==="warning"?t.warningIcon:e(S)==="info"?t.infoIcon:e(S)==="loading"?t.loadingIcon:null);var i=pe();y(i,"tabindex",0);let At;var Vt=J(i);{var ge=s=>{var c=Ze(),v=J(c);p(v,()=>t.closeIcon??lt),Y(c),K(w=>{y(c,"aria-label",t.closeButtonAriaLabel),y(c,"data-disabled",e(Nt)),rt(c,1,w)},[()=>st(it(e(j)?.closeButton,t.toast?.classes?.closeButton))]),Ct("click",c,()=>{e(Nt)||!e(U)||(n(),t.toast.onDismiss?.(t.toast))}),a(s,c)};B(Vt,s=>{e(ft)&&!t.toast.component&&e(S)!=="loading"&&t.closeIcon!==null&&s(ge)})}var ae=Lt(Vt,2);{var oe=s=>{const c=l(()=>t.toast.component);var v=b(),w=h(v);Tt(w,()=>e(c),(x,g)=>{g(x,ce(()=>t.toast.componentProps,{closeToast:n}))}),a(s,v)},ie=s=>{var c=Je(),v=h(c);{var w=u=>{var m=Ge(),o=J(m);{var I=d=>{var f=b(),z=h(f);{var E=_t=>{var Kt=b(),re=h(Kt);Tt(re,()=>t.toast.icon,(H,F)=>{F(H,{})}),a(_t,Kt)},q=_t=>{C(_t)};B(z,_t=>{t.toast.icon?_t(E):_t(q,!1)})}a(d,f)};B(o,d=>{(t.toast.promise||e(S)==="loading")&&d(I)})}var P=Lt(o,2);{var D=d=>{var f=b(),z=h(f);{var E=H=>{var F=b(),gt=h(F);Tt(gt,()=>t.toast.icon,(Se,De)=>{De(Se,{})}),a(H,F)},q=H=>{var F=b(),gt=h(F);p(gt,()=>t.successIcon??lt),a(H,F)},_t=H=>{var F=b(),gt=h(F);p(gt,()=>t.errorIcon??lt),a(H,F)},Kt=H=>{var F=b(),gt=h(F);p(gt,()=>t.warningIcon??lt),a(H,F)},re=H=>{var F=b(),gt=h(F);p(gt,()=>t.infoIcon??lt),a(H,F)};B(z,H=>{t.toast.icon?H(E):e(S)==="success"?H(q,1):e(S)==="error"?H(_t,2):e(S)==="warning"?H(Kt,3):e(S)==="info"&&H(re,4)})}a(d,f)};B(P,d=>{t.toast.type!=="loading"&&d(D)})}Y(m),K(d=>rt(m,1,d),[()=>st(it(e(j)?.icon,t.toast?.classes?.icon))]),a(u,m)};B(v,u=>{(e(S)||t.toast.icon||t.toast.promise)&&t.toast.icon!==null&&(e(mt)!==null||t.toast.icon)&&u(w)})}var x=Lt(v,2),g=J(x),L=J(g);{var It=u=>{var m=b(),o=h(m);{var I=D=>{const d=l(()=>t.toast.title);var f=b(),z=h(f);Tt(z,()=>e(d),(E,q)=>{q(E,ce(()=>t.toast.componentProps))}),a(D,f)},P=D=>{var d=he();K(()=>Yt(d,t.toast.title)),a(D,d)};B(o,D=>{typeof t.toast.title!="string"?D(I):D(P,!1)})}a(u,m)};B(L,u=>{t.toast.title&&u(It)})}Y(g);var Rt=Lt(g,2);{var se=u=>{var m=Xe(),o=J(m);{var I=D=>{const d=l(()=>t.toast.description);var f=b(),z=h(f);Tt(z,()=>e(d),(E,q)=>{q(E,ce(()=>t.toast.componentProps))}),a(D,f)},P=D=>{var d=he();K(()=>Yt(d,t.toast.description)),a(D,d)};B(o,D=>{typeof t.toast.description!="string"?D(I):D(P,!1)})}Y(m),K(D=>rt(m,1,D),[()=>st(it(tt(),e(yt),e(j)?.description,t.toast.classes?.description))]),a(u,m)};B(Rt,u=>{t.toast.description&&u(se)})}Y(x);var jt=Lt(x,2);{var X=u=>{var m=b(),o=h(m);{var I=d=>{var f=b(),z=h(f);Tt(z,()=>t.toast.cancel,(E,q)=>{q(E,{})}),a(d,f)},P=d=>{var f=Qe(),z=J(f,!0);Y(f),K(E=>{le(f,t.toast.cancelButtonStyle??k()),rt(f,1,E),Yt(z,t.toast.cancel.label)},[()=>st(it(e(j)?.cancelButton,t.toast?.classes?.cancelButton))]),Ct("click",f,E=>{Zt(t.toast.cancel)&&e(U)&&(t.toast.cancel?.onClick?.(E),n())}),a(d,f)},D=l(()=>Zt(t.toast.cancel));B(o,d=>{typeof t.toast.cancel=="function"?d(I):e(D)&&d(P,1)})}a(u,m)};B(jt,u=>{t.toast.cancel&&u(X)})}var R=Lt(jt,2);{var Q=u=>{var m=b(),o=h(m);{var I=d=>{var f=b(),z=h(f);Tt(z,()=>t.toast.action,(E,q)=>{q(E,{})}),a(d,f)},P=d=>{var f=qe(),z=J(f,!0);Y(f),K(E=>{le(f,t.toast.actionButtonStyle??$()),rt(f,1,E),Yt(z,t.toast.action.label)},[()=>st(it(e(j)?.actionButton,t.toast?.classes?.actionButton))]),Ct("click",f,E=>{Zt(t.toast.action)&&(t.toast.action?.onClick(E),!E.defaultPrevented&&n())}),a(d,f)},D=l(()=>Zt(t.toast.action));B(o,d=>{typeof t.toast.action=="function"?d(I):e(D)&&d(P,1)})}a(u,m)};B(R,u=>{t.toast.action&&u(Q)})}K((u,m)=>{rt(x,1,u),rt(g,1,m)},[()=>st(it(e(j)?.content,t.toast?.classes?.content)),()=>st(it(e(j)?.title,t.toast?.classes?.title))]),a(s,c)};B(ae,s=>{t.toast.component?s(oe):s(ie,!1)})}Y(i),Ie(i,s=>r(Z,s),()=>e(Z)),K((s,c,v)=>{rt(i,1,s),y(i,"aria-live",t.toast.important?"assertive":"polite"),y(i,"data-rich-colors",t.toast.richColors??Bt()),y(i,"data-styled",!(t.toast.component||t.toast.unstyled||ct())),y(i,"data-mounted",e(V)),y(i,"data-promise",c),y(i,"data-swiped",e(Ot)),y(i,"data-removed",e(N)),y(i,"data-visible",e(qt)),y(i,"data-y-position",e(zt)[0]),y(i,"data-x-position",e(zt)[1]),y(i,"data-index",t.index),y(i,"data-front",e(Qt)),y(i,"data-swiping",e(Dt)),y(i,"data-dismissible",e(U)),y(i,"data-type",e(S)),y(i,"data-invert",e($t)),y(i,"data-swipe-out",e(Ht)),y(i,"data-swipe-direction",e(kt)),y(i,"data-expanded",v),At=le(i,`${t.style} ${t.toast.style}`,At,{"--index":t.index,"--toasts-before":t.index,"--z-index":O.toasts.length-t.index,"--offset":`${e(N)?e(W):e(Pt)}px`,"--initial-height":t.expandByDefault?"auto":`${e(dt)}px`})},[()=>st(it(t.class,e(Et),e(j)?.toast,t.toast?.classes?.toast,e(j)?.[e(S)],t.toast?.classes?.[e(S)])),()=>!!t.toast.promise,()=>!!(t.expanded||t.expandByDefault&&e(V))]),Ct("pointermove",i,Ut),Ct("pointerup",i,me),Ct("pointerdown",i,ne),Me("dragend",i,ot),a(_,i),ve()}Ee(["pointermove","pointerup","pointerdown","click"]);var tn=Ft('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-success-icon=""><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>');function en(_){var t=tn();a(_,t)}var nn=Ft('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-error-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>');function an(_){var t=nn();a(_,t)}var on=Ft('<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" data-sonner-warning-icon="" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>');function sn(_){var t=on();a(_,t)}var rn=Ft('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-info-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>');function ln(_){var t=rn();a(_,t)}var cn=Ft('<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-sonner-close-icon=""><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>');function dn(_){var t=cn();a(_,t)}const un=3,Te="24px",Be="16px",fn=4e3,vn=356,mn=14,de="dark",Gt="light";function gn(_,t){const C={};return[_,t].forEach((k,$)=>{const tt=$===1,ct=tt?"--mobile-offset":"--offset",Bt=tt?Be:Te;function St(V){["top","right","bottom","left"].forEach(N=>{C[`${ct}-${N}`]=typeof V=="number"?`${V}px`:V})}typeof k=="number"||typeof k=="string"?St(k):typeof k=="object"?["top","right","bottom","left"].forEach(V=>{const N=k[V];N===void 0?C[`${ct}-${V}`]=Bt:C[`${ct}-${V}`]=typeof N=="number"?`${N}px`:N}):St(Bt)}),C}var hn=G("<ol></ol>"),bn=G('<section aria-live="polite" aria-relevant="additions text" aria-atomic="false" class="svelte-nbs0zk"><!></section>');function En(_,t){fe(t,!0);function C(n){return n!=="system"?n:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?de:Gt}let k=T(t,"invert",3,!1),$=T(t,"position",3,"bottom-right"),tt=T(t,"hotkey",19,()=>["altKey","KeyT"]),ct=T(t,"expand",3,!1),Bt=T(t,"closeButton",3,!1),St=T(t,"offset",3,Te),V=T(t,"mobileOffset",3,Be),N=T(t,"theme",3,"light"),Dt=T(t,"richColors",3,!1),Ht=T(t,"duration",3,fn),Ot=T(t,"visibleToasts",3,un),W=T(t,"toastOptions",19,()=>({})),dt=T(t,"dir",7,"auto"),Mt=T(t,"gap",3,mn),Z=T(t,"pauseWhenPageIsHidden",3,!1),et=T(t,"containerAriaLabel",3,"Notifications"),kt=T(t,"closeButtonAriaLabel",3,"Close toast"),Qt=Ce(t,["$$slots","$$events","$$legacy","invert","position","hotkey","expand","closeButton","offset","mobileOffset","theme","richColors","duration","visibleToasts","toastOptions","dir","gap","pauseWhenPageIsHidden","loadingIcon","successIcon","errorIcon","warningIcon","closeIcon","infoIcon","containerAriaLabel","class","closeButtonAriaLabel","onblur","onfocus","onmouseenter","onmousemove","onmouseleave","ondragend","onpointerdown","onpointerup"]);function qt(){if(dt()!=="auto")return dt();if(typeof window>"u"||typeof document>"u")return"ltr";const n=document.documentElement.getAttribute("dir");return n==="auto"||!n?(Xt(()=>dt(window.getComputedStyle(document.documentElement).direction??"ltr")),dt()):(Xt(()=>dt(n)),n)}const S=l(()=>Array.from(new Set([$(),...O.toasts.filter(n=>n.position).map(n=>n.position)].filter(Boolean))));let U=A(!1),Et=A(!1),yt=A(we(C(N()))),ut=A(void 0),ft=A(null),wt=A(!1);const bt=l(()=>tt().join("+").replace(/Key/g,"").replace(/Digit/g,""));ht(()=>{O.toasts.length<=1&&r(U,!1)}),ht(()=>{const n=O.toasts.filter(M=>M.dismiss&&!M.delete);if(n.length>0){const M=O.toasts.map(nt=>n.find(xt=>xt.id===nt.id)?{...nt,delete:!0}:nt);O.toasts=M}}),ht(()=>()=>{e(ut)&&e(ft)&&(e(ft).focus({preventScroll:!0}),r(ft,null),r(wt,!1))}),xe(()=>(O.reset(),ye(document,"keydown",M=>{tt().every(at=>M[at]||M.code===at)&&(r(U,!0),e(ut)?.focus()),M.code==="Escape"&&(document.activeElement===e(ut)||e(ut)?.contains(document.activeElement))&&r(U,!1)}))),ht(()=>{if(N()!=="system"&&r(yt,N()),typeof window<"u"){N()==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?r(yt,de):r(yt,Gt));const n=window.matchMedia("(prefers-color-scheme: dark)"),M=({matches:nt})=>{N()==="system"&&r(yt,nt?de:Gt,!0)};"addEventListener"in n?n.addEventListener("change",M):n.addListener(M)}});const zt=n=>{t.onblur?.(n),e(wt)&&!n.currentTarget.contains(n.relatedTarget)&&(r(wt,!1),e(ft)&&(e(ft).focus({preventScroll:!0}),r(ft,null)))},Jt=n=>{t.onfocus?.(n),!(n.target instanceof HTMLElement&&n.target.dataset.dismissible==="false")&&(e(wt)||(r(wt,!0),r(ft,n.relatedTarget,!0)))},pt=n=>{t.onpointerdown?.(n),!(n.target instanceof HTMLElement&&n.target.dataset.dismissible==="false")&&r(Et,!0)},$t=n=>{t.onmouseenter?.(n),r(U,!0)},Nt=n=>{t.onmouseleave?.(n),e(Et)||r(U,!1)},j=n=>{t.onmousemove?.(n),r(U,!0)},te=n=>{t.ondragend?.(n),r(U,!1)},ee=n=>{t.onpointerup?.(n),r(Et,!1)};Le.set(new He);var vt=bn();y(vt,"tabindex",-1);var Wt=J(vt);{var Pt=n=>{var M=b(),nt=h(M);ue(nt,18,()=>e(S),at=>at,(at,xt,ne,me)=>{const Ut=l(()=>{const[i,At]=xt.split("-");return{y:i,x:At}}),ot=l(()=>gn(St(),V()));var mt=hn();Pe(mt,i=>({tabindex:-1,dir:i,class:t.class,"data-sonner-toaster":!0,"data-sonner-theme":e(yt),"data-y-position":e(Ut).y,"data-x-position":e(Ut).x,style:t.style,onblur:zt,onfocus:Jt,onmouseenter:$t,onmousemove:j,onmouseleave:Nt,ondragend:te,onpointerdown:pt,onpointerup:ee,...Qt,[Ae]:{"--front-toast-height":`${O.heights[0]?.height}px`,"--width":`${vn}px`,"--gap":`${Mt()}px`,"--offset-top":e(ot)["--offset-top"],"--offset-right":e(ot)["--offset-right"],"--offset-bottom":e(ot)["--offset-bottom"],"--offset-left":e(ot)["--offset-left"],"--mobile-offset-top":e(ot)["--mobile-offset-top"],"--mobile-offset-right":e(ot)["--mobile-offset-right"],"--mobile-offset-bottom":e(ot)["--mobile-offset-bottom"],"--mobile-offset-left":e(ot)["--mobile-offset-left"]}}),[qt],void 0,void 0,"svelte-nbs0zk"),ue(mt,23,()=>O.toasts.filter(i=>!i.position&&e(ne)===0||i.position===xt),i=>i.id,(i,At,Vt,ge)=>{{const ae=X=>{var R=b(),Q=h(R);{var u=o=>{var I=b(),P=h(I);p(P,()=>t.successIcon??lt),a(o,I)},m=o=>{en(o)};B(Q,o=>{t.successIcon?o(u):t.successIcon!==null&&o(m,1)})}a(X,R)},oe=X=>{var R=b(),Q=h(R);{var u=o=>{var I=b(),P=h(I);p(P,()=>t.errorIcon??lt),a(o,I)},m=o=>{an(o)};B(Q,o=>{t.errorIcon?o(u):t.errorIcon!==null&&o(m,1)})}a(X,R)},ie=X=>{var R=b(),Q=h(R);{var u=o=>{var I=b(),P=h(I);p(P,()=>t.warningIcon??lt),a(o,I)},m=o=>{sn(o)};B(Q,o=>{t.warningIcon?o(u):t.warningIcon!==null&&o(m,1)})}a(X,R)},s=X=>{var R=b(),Q=h(R);{var u=o=>{var I=b(),P=h(I);p(P,()=>t.infoIcon??lt),a(o,I)},m=o=>{ln(o)};B(Q,o=>{t.infoIcon?o(u):t.infoIcon!==null&&o(m,1)})}a(X,R)},c=X=>{var R=b(),Q=h(R);{var u=o=>{var I=b(),P=h(I);p(P,()=>t.closeIcon??lt),a(o,I)},m=o=>{dn(o)};B(Q,o=>{t.closeIcon?o(u):t.closeIcon!==null&&o(m,1)})}a(X,R)};let v=l(()=>W()?.duration??Ht()),w=l(()=>W()?.class??""),x=l(()=>W()?.descriptionClass||""),g=l(()=>W()?.style??""),L=l(()=>W().classes||{}),It=l(()=>W().unstyled??!1),Rt=l(()=>W()?.cancelButtonStyle??""),se=l(()=>W()?.actionButtonStyle??""),jt=l(()=>W()?.closeButtonAriaLabel??kt());$e(i,{get index(){return e(Vt)},get toast(){return e(At)},get defaultRichColors(){return Dt()},get duration(){return e(v)},get class(){return e(w)},get descriptionClass(){return e(x)},get invert(){return k()},get visibleToasts(){return Ot()},get closeButton(){return Bt()},get interacting(){return e(Et)},get position(){return xt},get style(){return e(g)},get classes(){return e(L)},get unstyled(){return e(It)},get cancelButtonStyle(){return e(Rt)},get actionButtonStyle(){return e(se)},get closeButtonAriaLabel(){return e(jt)},get expandByDefault(){return ct()},get expanded(){return e(U)},get pauseWhenPageIsHidden(){return Z()},get loadingIcon(){return t.loadingIcon},successIcon:ae,errorIcon:oe,warningIcon:ie,infoIcon:s,closeIcon:c,$$slots:{successIcon:!0,errorIcon:!0,warningIcon:!0,infoIcon:!0,closeIcon:!0}})}}),Y(mt),Ie(mt,i=>r(ut,i),()=>e(ut)),K(()=>mt.dir=mt.dir),a(at,mt)}),a(n,M)};B(Wt,n=>{O.toasts.length>0&&n(Pt)})}Y(vt),K(()=>y(vt,"aria-label",`${et()??""} ${e(bt)??""}`)),a(_,vt),ve()}export{Re as L,En as T};
1
+ import{a,b as G,o as ye,g as Ct,e as Me,c as b,d as Ee,t as he,s as Yt,f as Ft}from"./iDtAARVW.js";import{p as fe,c as J,r as Y,t as K,b as ve,e as A,f as we,a5 as ht,s as r,g as e,a6 as Xt,aE as xe,i as Lt,u as l,ad as lt,h}from"./CT6oIU-C.js";import{i as B,b as Ie}from"./72bZS3G9.js";import{e as ue}from"./CDV5Q7RN.js";import{s as y,c as le,b as p,a as Pe,S as Ae}from"./CmCtpZ1Y.js";import{p as T,s as ce,r as Ce}from"./cLyZlkXv.js";import{a as O,c as it,s as Le,S as He}from"./DTZE-yoq.js";import{c as Tt}from"./CXH6iFbA.js";import{c as st,s as rt}from"./DGbA7IXh.js";import"./Y90OgS-9.js";const Oe=Array(12).fill(0);var ke=G('<div class="sonner-loading-bar"></div>'),Ne=G('<div><div class="sonner-spinner"></div></div>');function Re(_,t){fe(t,!0);var C=Ne(),k=J(C);ue(k,23,()=>Oe,($,tt)=>`spinner-bar-${tt}`,($,tt)=>{var ct=ke();a($,ct)}),Y(k),Y(C),K($=>{rt(C,1,$),y(C,"data-visible",t.visible)},[()=>st(["sonner-loading-wrapper",t.class].filter(Boolean).join(" "))]),a(_,C),ve()}function Zt(_){return _.label!==void 0}function Fe(){let _=A(we(typeof document<"u"?document.hidden:!1));return ht(()=>ye(document,"visibilitychange",()=>{r(_,document.hidden,!0)})),{get current(){return e(_)}}}const be=4e3,ze=14,We=45,Ue=200,Ve=.05,je={toast:"",title:"",description:"",loader:"",closeButton:"",cancelButton:"",actionButton:"",action:"",warning:"",error:"",success:"",default:"",info:"",loading:""};function Ke(_){const[t,C]=_.split("-"),k=[];return t&&k.push(t),C&&k.push(C),k}function _e(_){return 1/(1.5+Math.abs(_)/20)}var Ye=G("<div><!></div>"),Ze=G('<button data-close-button=""><!></button>'),Ge=G('<div data-icon=""><!> <!></div>'),Xe=G('<div data-description=""><!></div>'),Qe=G('<button data-button="" data-cancel=""> </button>'),qe=G('<button data-button=""> </button>'),Je=G('<!> <div data-content=""><div data-title=""><!></div> <!></div> <!> <!>',1),pe=G('<li aria-atomic="true" data-sonner-toast=""><!> <!></li>');function $e(_,t){fe(t,!0);const C=s=>{var c=b(),v=h(c);{var w=g=>{var L=Ye(),It=J(L);p(It,()=>t.loadingIcon),Y(L),K(Rt=>{rt(L,1,Rt),y(L,"data-visible",e(S)==="loading")},[()=>st(it(e(j)?.loader,t.toast?.classes?.loader,"sonner-loader"))]),a(g,L)},x=g=>{{let L=l(()=>it(e(j)?.loader,t.toast.classes?.loader)),It=l(()=>e(S)==="loading");Re(g,{get class(){return e(L)},get visible(){return e(It)}})}};B(v,g=>{t.loadingIcon?g(w):g(x,!1)})}a(s,c)};let k=T(t,"cancelButtonStyle",3,""),$=T(t,"actionButtonStyle",3,""),tt=T(t,"descriptionClass",3,""),ct=T(t,"unstyled",3,!1),Bt=T(t,"defaultRichColors",3,!1);const St={...je};let V=A(!1),N=A(!1),Dt=A(!1),Ht=A(!1),Ot=A(!1),W=A(0),dt=A(0),Mt=t.toast.duration||t.duration||be,Z=A(void 0),et=A(null),kt=A(null);const Qt=l(()=>t.index===0),qt=l(()=>t.index+1<=t.visibleToasts),S=l(()=>t.toast.type),U=l(()=>t.toast.dismissible!==void 0?t.toast.dismissible!==!1:t.toast.dismissable!==!1),Et=l(()=>t.toast.class||""),yt=l(()=>t.toast.descriptionClass||""),ut=l(()=>O.heights.findIndex(s=>s.toastId===t.toast.id)||0),ft=l(()=>t.toast.closeButton??t.closeButton),wt=l(()=>t.toast.duration??t.duration??be);let bt=null;const zt=l(()=>t.position.split("-")),Jt=l(()=>O.heights.reduce((s,c,v)=>v>=e(ut)?s:s+c.height,0)),pt=Fe(),$t=l(()=>t.toast.invert||t.invert),Nt=l(()=>e(S)==="loading"),j=l(()=>({...St,...t.classes})),te=l(()=>t.toast.title),ee=l(()=>t.toast.description);let vt=A(0),Wt=A(0);const Pt=l(()=>Math.round(e(ut)*ze+e(Jt)));ht(()=>{e(te),e(ee);let s;t.expanded||t.expandByDefault?s=1:s=1-t.index*Ve;const c=Xt(()=>e(Z));if(c===void 0)return;c.style.setProperty("height","auto");const v=c.offsetHeight,w=c.getBoundingClientRect().height,x=Math.round(w/s+Number.EPSILON&100)/100;c.style.removeProperty("height");let g;Math.abs(x-v)<1?g=x:g=v,r(dt,g,!0),O.setHeight({toastId:t.toast.id,height:g})});function n(){r(N,!0),r(W,e(Pt),!0),O.removeHeight(t.toast.id),setTimeout(()=>{O.remove(t.toast.id)},Ue)}let M;const nt=l(()=>t.toast.promise&&e(S)==="loading"||t.toast.duration===Number.POSITIVE_INFINITY);function at(){r(vt,new Date().getTime(),!0),M=setTimeout(()=>{t.toast.onAutoClose?.(t.toast),n()},Mt)}function xt(){if(e(Wt)<e(vt)){const s=new Date().getTime()-e(vt);Mt=Mt-s}r(Wt,new Date().getTime(),!0)}ht(()=>{t.toast.updated&&(clearTimeout(M),Mt=e(wt),at())}),ht(()=>(e(nt)||(t.expanded||t.interacting||t.pauseWhenPageIsHidden&&pt.current?xt():at()),()=>clearTimeout(M))),xe(()=>{r(V,!0);const s=e(Z)?.getBoundingClientRect().height;return r(dt,s,!0),O.setHeight({toastId:t.toast.id,height:s}),()=>{O.removeHeight(t.toast.id)}}),ht(()=>{t.toast.delete&&Xt(()=>{n(),t.toast.onDismiss?.(t.toast)})});const ne=s=>{if(e(Nt))return;r(W,e(Pt),!0);const c=s.target;c.setPointerCapture(s.pointerId),c.tagName!=="BUTTON"&&(r(Dt,!0),bt={x:s.clientX,y:s.clientY})},me=()=>{if(e(Ht)||!e(U))return;bt=null;const s=Number(e(Z)?.style.getPropertyValue("--swipe-amount-x").replace("px","")||0),c=Number(e(Z)?.style.getPropertyValue("--swipe-amount-y").replace("px","")||0),v=new Date().getTime()-0,w=e(et)==="x"?s:c,x=Math.abs(w)/v;if(Math.abs(w)>=We||x>.11){r(W,e(Pt),!0),t.toast.onDismiss?.(t.toast),e(et)==="x"?r(kt,s>0?"right":"left",!0):r(kt,c>0?"down":"up",!0),n(),r(Ht,!0);return}else e(Z)?.style.setProperty("--swipe-amount-x","0px"),e(Z)?.style.setProperty("--swipe-amount-y","0px");r(Ot,!1),r(Dt,!1),r(et,null)},Ut=s=>{if(!bt||!e(U)||(window.getSelection()?.toString().length??-1)>0)return;const v=s.clientY-bt.y,w=s.clientX-bt.x,x=t.swipeDirections??Ke(t.position);!e(et)&&(Math.abs(w)>1||Math.abs(v)>1)&&r(et,Math.abs(w)>Math.abs(v)?"x":"y",!0);let g={x:0,y:0};if(e(et)==="y"){if(x.includes("top")||x.includes("bottom"))if(x.includes("top")&&v<0||x.includes("bottom")&&v>0)g.y=v;else{const L=v*_e(v);g.y=Math.abs(L)<Math.abs(v)?L:v}}else if(e(et)==="x"&&(x.includes("left")||x.includes("right")))if(x.includes("left")&&w<0||x.includes("right")&&w>0)g.x=w;else{const L=w*_e(w);g.x=Math.abs(L)<Math.abs(w)?L:w}(Math.abs(g.x)>0||Math.abs(g.y)>0)&&r(Ot,!0),e(Z)?.style.setProperty("--swipe-amount-x",`${g.x}px`),e(Z)?.style.setProperty("--swipe-amount-y",`${g.y}px`)},ot=()=>{r(Dt,!1),r(et,null),bt=null},mt=l(()=>t.toast.icon?t.toast.icon:e(S)==="success"?t.successIcon:e(S)==="error"?t.errorIcon:e(S)==="warning"?t.warningIcon:e(S)==="info"?t.infoIcon:e(S)==="loading"?t.loadingIcon:null);var i=pe();y(i,"tabindex",0);let At;var Vt=J(i);{var ge=s=>{var c=Ze(),v=J(c);p(v,()=>t.closeIcon??lt),Y(c),K(w=>{y(c,"aria-label",t.closeButtonAriaLabel),y(c,"data-disabled",e(Nt)),rt(c,1,w)},[()=>st(it(e(j)?.closeButton,t.toast?.classes?.closeButton))]),Ct("click",c,()=>{e(Nt)||!e(U)||(n(),t.toast.onDismiss?.(t.toast))}),a(s,c)};B(Vt,s=>{e(ft)&&!t.toast.component&&e(S)!=="loading"&&t.closeIcon!==null&&s(ge)})}var ae=Lt(Vt,2);{var oe=s=>{const c=l(()=>t.toast.component);var v=b(),w=h(v);Tt(w,()=>e(c),(x,g)=>{g(x,ce(()=>t.toast.componentProps,{closeToast:n}))}),a(s,v)},ie=s=>{var c=Je(),v=h(c);{var w=u=>{var m=Ge(),o=J(m);{var I=d=>{var f=b(),z=h(f);{var E=_t=>{var Kt=b(),re=h(Kt);Tt(re,()=>t.toast.icon,(H,F)=>{F(H,{})}),a(_t,Kt)},q=_t=>{C(_t)};B(z,_t=>{t.toast.icon?_t(E):_t(q,!1)})}a(d,f)};B(o,d=>{(t.toast.promise||e(S)==="loading")&&d(I)})}var P=Lt(o,2);{var D=d=>{var f=b(),z=h(f);{var E=H=>{var F=b(),gt=h(F);Tt(gt,()=>t.toast.icon,(Se,De)=>{De(Se,{})}),a(H,F)},q=H=>{var F=b(),gt=h(F);p(gt,()=>t.successIcon??lt),a(H,F)},_t=H=>{var F=b(),gt=h(F);p(gt,()=>t.errorIcon??lt),a(H,F)},Kt=H=>{var F=b(),gt=h(F);p(gt,()=>t.warningIcon??lt),a(H,F)},re=H=>{var F=b(),gt=h(F);p(gt,()=>t.infoIcon??lt),a(H,F)};B(z,H=>{t.toast.icon?H(E):e(S)==="success"?H(q,1):e(S)==="error"?H(_t,2):e(S)==="warning"?H(Kt,3):e(S)==="info"&&H(re,4)})}a(d,f)};B(P,d=>{t.toast.type!=="loading"&&d(D)})}Y(m),K(d=>rt(m,1,d),[()=>st(it(e(j)?.icon,t.toast?.classes?.icon))]),a(u,m)};B(v,u=>{(e(S)||t.toast.icon||t.toast.promise)&&t.toast.icon!==null&&(e(mt)!==null||t.toast.icon)&&u(w)})}var x=Lt(v,2),g=J(x),L=J(g);{var It=u=>{var m=b(),o=h(m);{var I=D=>{const d=l(()=>t.toast.title);var f=b(),z=h(f);Tt(z,()=>e(d),(E,q)=>{q(E,ce(()=>t.toast.componentProps))}),a(D,f)},P=D=>{var d=he();K(()=>Yt(d,t.toast.title)),a(D,d)};B(o,D=>{typeof t.toast.title!="string"?D(I):D(P,!1)})}a(u,m)};B(L,u=>{t.toast.title&&u(It)})}Y(g);var Rt=Lt(g,2);{var se=u=>{var m=Xe(),o=J(m);{var I=D=>{const d=l(()=>t.toast.description);var f=b(),z=h(f);Tt(z,()=>e(d),(E,q)=>{q(E,ce(()=>t.toast.componentProps))}),a(D,f)},P=D=>{var d=he();K(()=>Yt(d,t.toast.description)),a(D,d)};B(o,D=>{typeof t.toast.description!="string"?D(I):D(P,!1)})}Y(m),K(D=>rt(m,1,D),[()=>st(it(tt(),e(yt),e(j)?.description,t.toast.classes?.description))]),a(u,m)};B(Rt,u=>{t.toast.description&&u(se)})}Y(x);var jt=Lt(x,2);{var X=u=>{var m=b(),o=h(m);{var I=d=>{var f=b(),z=h(f);Tt(z,()=>t.toast.cancel,(E,q)=>{q(E,{})}),a(d,f)},P=d=>{var f=Qe(),z=J(f,!0);Y(f),K(E=>{le(f,t.toast.cancelButtonStyle??k()),rt(f,1,E),Yt(z,t.toast.cancel.label)},[()=>st(it(e(j)?.cancelButton,t.toast?.classes?.cancelButton))]),Ct("click",f,E=>{Zt(t.toast.cancel)&&e(U)&&(t.toast.cancel?.onClick?.(E),n())}),a(d,f)},D=l(()=>Zt(t.toast.cancel));B(o,d=>{typeof t.toast.cancel=="function"?d(I):e(D)&&d(P,1)})}a(u,m)};B(jt,u=>{t.toast.cancel&&u(X)})}var R=Lt(jt,2);{var Q=u=>{var m=b(),o=h(m);{var I=d=>{var f=b(),z=h(f);Tt(z,()=>t.toast.action,(E,q)=>{q(E,{})}),a(d,f)},P=d=>{var f=qe(),z=J(f,!0);Y(f),K(E=>{le(f,t.toast.actionButtonStyle??$()),rt(f,1,E),Yt(z,t.toast.action.label)},[()=>st(it(e(j)?.actionButton,t.toast?.classes?.actionButton))]),Ct("click",f,E=>{Zt(t.toast.action)&&(t.toast.action?.onClick(E),!E.defaultPrevented&&n())}),a(d,f)},D=l(()=>Zt(t.toast.action));B(o,d=>{typeof t.toast.action=="function"?d(I):e(D)&&d(P,1)})}a(u,m)};B(R,u=>{t.toast.action&&u(Q)})}K((u,m)=>{rt(x,1,u),rt(g,1,m)},[()=>st(it(e(j)?.content,t.toast?.classes?.content)),()=>st(it(e(j)?.title,t.toast?.classes?.title))]),a(s,c)};B(ae,s=>{t.toast.component?s(oe):s(ie,!1)})}Y(i),Ie(i,s=>r(Z,s),()=>e(Z)),K((s,c,v)=>{rt(i,1,s),y(i,"aria-live",t.toast.important?"assertive":"polite"),y(i,"data-rich-colors",t.toast.richColors??Bt()),y(i,"data-styled",!(t.toast.component||t.toast.unstyled||ct())),y(i,"data-mounted",e(V)),y(i,"data-promise",c),y(i,"data-swiped",e(Ot)),y(i,"data-removed",e(N)),y(i,"data-visible",e(qt)),y(i,"data-y-position",e(zt)[0]),y(i,"data-x-position",e(zt)[1]),y(i,"data-index",t.index),y(i,"data-front",e(Qt)),y(i,"data-swiping",e(Dt)),y(i,"data-dismissible",e(U)),y(i,"data-type",e(S)),y(i,"data-invert",e($t)),y(i,"data-swipe-out",e(Ht)),y(i,"data-swipe-direction",e(kt)),y(i,"data-expanded",v),At=le(i,`${t.style} ${t.toast.style}`,At,{"--index":t.index,"--toasts-before":t.index,"--z-index":O.toasts.length-t.index,"--offset":`${e(N)?e(W):e(Pt)}px`,"--initial-height":t.expandByDefault?"auto":`${e(dt)}px`})},[()=>st(it(t.class,e(Et),e(j)?.toast,t.toast?.classes?.toast,e(j)?.[e(S)],t.toast?.classes?.[e(S)])),()=>!!t.toast.promise,()=>!!(t.expanded||t.expandByDefault&&e(V))]),Ct("pointermove",i,Ut),Ct("pointerup",i,me),Ct("pointerdown",i,ne),Me("dragend",i,ot),a(_,i),ve()}Ee(["pointermove","pointerup","pointerdown","click"]);var tn=Ft('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-success-icon=""><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>');function en(_){var t=tn();a(_,t)}var nn=Ft('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-error-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>');function an(_){var t=nn();a(_,t)}var on=Ft('<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" data-sonner-warning-icon="" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>');function sn(_){var t=on();a(_,t)}var rn=Ft('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-info-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>');function ln(_){var t=rn();a(_,t)}var cn=Ft('<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-sonner-close-icon=""><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>');function dn(_){var t=cn();a(_,t)}const un=3,Te="24px",Be="16px",fn=4e3,vn=356,mn=14,de="dark",Gt="light";function gn(_,t){const C={};return[_,t].forEach((k,$)=>{const tt=$===1,ct=tt?"--mobile-offset":"--offset",Bt=tt?Be:Te;function St(V){["top","right","bottom","left"].forEach(N=>{C[`${ct}-${N}`]=typeof V=="number"?`${V}px`:V})}typeof k=="number"||typeof k=="string"?St(k):typeof k=="object"?["top","right","bottom","left"].forEach(V=>{const N=k[V];N===void 0?C[`${ct}-${V}`]=Bt:C[`${ct}-${V}`]=typeof N=="number"?`${N}px`:N}):St(Bt)}),C}var hn=G("<ol></ol>"),bn=G('<section aria-live="polite" aria-relevant="additions text" aria-atomic="false" class="svelte-nbs0zk"><!></section>');function En(_,t){fe(t,!0);function C(n){return n!=="system"?n:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?de:Gt}let k=T(t,"invert",3,!1),$=T(t,"position",3,"bottom-right"),tt=T(t,"hotkey",19,()=>["altKey","KeyT"]),ct=T(t,"expand",3,!1),Bt=T(t,"closeButton",3,!1),St=T(t,"offset",3,Te),V=T(t,"mobileOffset",3,Be),N=T(t,"theme",3,"light"),Dt=T(t,"richColors",3,!1),Ht=T(t,"duration",3,fn),Ot=T(t,"visibleToasts",3,un),W=T(t,"toastOptions",19,()=>({})),dt=T(t,"dir",7,"auto"),Mt=T(t,"gap",3,mn),Z=T(t,"pauseWhenPageIsHidden",3,!1),et=T(t,"containerAriaLabel",3,"Notifications"),kt=T(t,"closeButtonAriaLabel",3,"Close toast"),Qt=Ce(t,["$$slots","$$events","$$legacy","invert","position","hotkey","expand","closeButton","offset","mobileOffset","theme","richColors","duration","visibleToasts","toastOptions","dir","gap","pauseWhenPageIsHidden","loadingIcon","successIcon","errorIcon","warningIcon","closeIcon","infoIcon","containerAriaLabel","class","closeButtonAriaLabel","onblur","onfocus","onmouseenter","onmousemove","onmouseleave","ondragend","onpointerdown","onpointerup"]);function qt(){if(dt()!=="auto")return dt();if(typeof window>"u"||typeof document>"u")return"ltr";const n=document.documentElement.getAttribute("dir");return n==="auto"||!n?(Xt(()=>dt(window.getComputedStyle(document.documentElement).direction??"ltr")),dt()):(Xt(()=>dt(n)),n)}const S=l(()=>Array.from(new Set([$(),...O.toasts.filter(n=>n.position).map(n=>n.position)].filter(Boolean))));let U=A(!1),Et=A(!1),yt=A(we(C(N()))),ut=A(void 0),ft=A(null),wt=A(!1);const bt=l(()=>tt().join("+").replace(/Key/g,"").replace(/Digit/g,""));ht(()=>{O.toasts.length<=1&&r(U,!1)}),ht(()=>{const n=O.toasts.filter(M=>M.dismiss&&!M.delete);if(n.length>0){const M=O.toasts.map(nt=>n.find(xt=>xt.id===nt.id)?{...nt,delete:!0}:nt);O.toasts=M}}),ht(()=>()=>{e(ut)&&e(ft)&&(e(ft).focus({preventScroll:!0}),r(ft,null),r(wt,!1))}),xe(()=>(O.reset(),ye(document,"keydown",M=>{tt().every(at=>M[at]||M.code===at)&&(r(U,!0),e(ut)?.focus()),M.code==="Escape"&&(document.activeElement===e(ut)||e(ut)?.contains(document.activeElement))&&r(U,!1)}))),ht(()=>{if(N()!=="system"&&r(yt,N()),typeof window<"u"){N()==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?r(yt,de):r(yt,Gt));const n=window.matchMedia("(prefers-color-scheme: dark)"),M=({matches:nt})=>{N()==="system"&&r(yt,nt?de:Gt,!0)};"addEventListener"in n?n.addEventListener("change",M):n.addListener(M)}});const zt=n=>{t.onblur?.(n),e(wt)&&!n.currentTarget.contains(n.relatedTarget)&&(r(wt,!1),e(ft)&&(e(ft).focus({preventScroll:!0}),r(ft,null)))},Jt=n=>{t.onfocus?.(n),!(n.target instanceof HTMLElement&&n.target.dataset.dismissible==="false")&&(e(wt)||(r(wt,!0),r(ft,n.relatedTarget,!0)))},pt=n=>{t.onpointerdown?.(n),!(n.target instanceof HTMLElement&&n.target.dataset.dismissible==="false")&&r(Et,!0)},$t=n=>{t.onmouseenter?.(n),r(U,!0)},Nt=n=>{t.onmouseleave?.(n),e(Et)||r(U,!1)},j=n=>{t.onmousemove?.(n),r(U,!0)},te=n=>{t.ondragend?.(n),r(U,!1)},ee=n=>{t.onpointerup?.(n),r(Et,!1)};Le.set(new He);var vt=bn();y(vt,"tabindex",-1);var Wt=J(vt);{var Pt=n=>{var M=b(),nt=h(M);ue(nt,18,()=>e(S),at=>at,(at,xt,ne,me)=>{const Ut=l(()=>{const[i,At]=xt.split("-");return{y:i,x:At}}),ot=l(()=>gn(St(),V()));var mt=hn();Pe(mt,i=>({tabindex:-1,dir:i,class:t.class,"data-sonner-toaster":!0,"data-sonner-theme":e(yt),"data-y-position":e(Ut).y,"data-x-position":e(Ut).x,style:t.style,onblur:zt,onfocus:Jt,onmouseenter:$t,onmousemove:j,onmouseleave:Nt,ondragend:te,onpointerdown:pt,onpointerup:ee,...Qt,[Ae]:{"--front-toast-height":`${O.heights[0]?.height}px`,"--width":`${vn}px`,"--gap":`${Mt()}px`,"--offset-top":e(ot)["--offset-top"],"--offset-right":e(ot)["--offset-right"],"--offset-bottom":e(ot)["--offset-bottom"],"--offset-left":e(ot)["--offset-left"],"--mobile-offset-top":e(ot)["--mobile-offset-top"],"--mobile-offset-right":e(ot)["--mobile-offset-right"],"--mobile-offset-bottom":e(ot)["--mobile-offset-bottom"],"--mobile-offset-left":e(ot)["--mobile-offset-left"]}}),[qt],void 0,void 0,"svelte-nbs0zk"),ue(mt,23,()=>O.toasts.filter(i=>!i.position&&e(ne)===0||i.position===xt),i=>i.id,(i,At,Vt,ge)=>{{const ae=X=>{var R=b(),Q=h(R);{var u=o=>{var I=b(),P=h(I);p(P,()=>t.successIcon??lt),a(o,I)},m=o=>{en(o)};B(Q,o=>{t.successIcon?o(u):t.successIcon!==null&&o(m,1)})}a(X,R)},oe=X=>{var R=b(),Q=h(R);{var u=o=>{var I=b(),P=h(I);p(P,()=>t.errorIcon??lt),a(o,I)},m=o=>{an(o)};B(Q,o=>{t.errorIcon?o(u):t.errorIcon!==null&&o(m,1)})}a(X,R)},ie=X=>{var R=b(),Q=h(R);{var u=o=>{var I=b(),P=h(I);p(P,()=>t.warningIcon??lt),a(o,I)},m=o=>{sn(o)};B(Q,o=>{t.warningIcon?o(u):t.warningIcon!==null&&o(m,1)})}a(X,R)},s=X=>{var R=b(),Q=h(R);{var u=o=>{var I=b(),P=h(I);p(P,()=>t.infoIcon??lt),a(o,I)},m=o=>{ln(o)};B(Q,o=>{t.infoIcon?o(u):t.infoIcon!==null&&o(m,1)})}a(X,R)},c=X=>{var R=b(),Q=h(R);{var u=o=>{var I=b(),P=h(I);p(P,()=>t.closeIcon??lt),a(o,I)},m=o=>{dn(o)};B(Q,o=>{t.closeIcon?o(u):t.closeIcon!==null&&o(m,1)})}a(X,R)};let v=l(()=>W()?.duration??Ht()),w=l(()=>W()?.class??""),x=l(()=>W()?.descriptionClass||""),g=l(()=>W()?.style??""),L=l(()=>W().classes||{}),It=l(()=>W().unstyled??!1),Rt=l(()=>W()?.cancelButtonStyle??""),se=l(()=>W()?.actionButtonStyle??""),jt=l(()=>W()?.closeButtonAriaLabel??kt());$e(i,{get index(){return e(Vt)},get toast(){return e(At)},get defaultRichColors(){return Dt()},get duration(){return e(v)},get class(){return e(w)},get descriptionClass(){return e(x)},get invert(){return k()},get visibleToasts(){return Ot()},get closeButton(){return Bt()},get interacting(){return e(Et)},get position(){return xt},get style(){return e(g)},get classes(){return e(L)},get unstyled(){return e(It)},get cancelButtonStyle(){return e(Rt)},get actionButtonStyle(){return e(se)},get closeButtonAriaLabel(){return e(jt)},get expandByDefault(){return ct()},get expanded(){return e(U)},get pauseWhenPageIsHidden(){return Z()},get loadingIcon(){return t.loadingIcon},successIcon:ae,errorIcon:oe,warningIcon:ie,infoIcon:s,closeIcon:c,$$slots:{successIcon:!0,errorIcon:!0,warningIcon:!0,infoIcon:!0,closeIcon:!0}})}}),Y(mt),Ie(mt,i=>r(ut,i),()=>e(ut)),K(()=>mt.dir=mt.dir),a(at,mt)}),a(n,M)};B(Wt,n=>{O.toasts.length>0&&n(Pt)})}Y(vt),K(()=>y(vt,"aria-label",`${et()??""} ${e(bt)??""}`)),a(_,vt),ve()}export{Re as L,En as T};
@@ -1,4 +1,4 @@
1
- import{e as h,f as U,s as a,g as t,av as x}from"./CT6oIU-C.js";import{i as L,g as V}from"./WlsUHv-K.js";import{n as y}from"./4Hhzb6pv.js";import{w as W}from"./CJ8__CWt.js";function X(g,c,o){fetch("/api/chat/stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g),signal:o}).then(async n=>{if(!n.ok){c({type:"error",message:`HTTP ${n.status}`});return}const r=n.body?.getReader();if(!r){c({type:"error",message:"No response body"});return}const p=new TextDecoder;let m="";for(;;){const{done:k,value:O}=await r.read();if(k)break;m+=p.decode(O,{stream:!0});const A=m.split(`
1
+ import{e as h,f as U,s as a,g as t,av as x}from"./CT6oIU-C.js";import{i as L,g as V}from"./Cpsr8-Xy.js";import{n as y}from"./4Hhzb6pv.js";import{w as W}from"./CJ8__CWt.js";function X(g,c,o){fetch("/api/chat/stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g),signal:o}).then(async n=>{if(!n.ok){c({type:"error",message:`HTTP ${n.status}`});return}const r=n.body?.getReader();if(!r){c({type:"error",message:"No response body"});return}const p=new TextDecoder;let m="";for(;;){const{done:k,value:O}=await r.read();if(k)break;m+=p.decode(O,{stream:!0});const A=m.split(`
2
2
  `);m=A.pop()??"";for(const C of A)if(C.startsWith("data: "))try{const f=JSON.parse(C.slice(6));c(f)}catch{}}}).catch(n=>{n.name!=="AbortError"&&c({type:"error",message:n.message})})}const D="sg-chat-sessions",J="sg-chat-version",z=14;function b(){try{const g=localStorage.getItem(D);if(!g)return[];if(localStorage.getItem(J)==="2")return JSON.parse(g);const n=JSON.parse(g).map(r=>({id:crypto.randomUUID(),createdAt:r.date+"T00:00:00.000Z",updatedAt:r.date+"T00:00:00.000Z",title:r.messages.find(p=>p.role==="user")?.content.slice(0,50)||"New chat",messages:r.messages}));return localStorage.setItem(D,JSON.stringify(n)),localStorage.setItem(J,"2"),n}catch{return[]}}function _(g){const o=[...g].sort((n,r)=>r.updatedAt.localeCompare(n.updatedAt)).slice(0,z);try{localStorage.setItem(D,JSON.stringify(o)),localStorage.setItem(J,"2")}catch{}}function N(g,c){const o=b(),n=c.map(({streaming:p,...m})=>m),r=o.findIndex(p=>p.id===g);r>=0&&(o[r].messages=n,o[r].updatedAt=new Date().toISOString()),_(o)}function B(){const c=b().sort((e,i)=>i.updatedAt.localeCompare(e.updatedAt))[0];let o=h(U(c?c.messages.map(e=>({...e,streaming:!1})):[])),n=h(U(c?.id??null)),r=h(!1),p=h(0),m=h(0),k=h(0),O=h(null),A=null,C=h(""),f=h(U(!!c));const R=new Set(["create_entity","update_entity","delete_entity","move_entity"]);function M(){$();const e=crypto.randomUUID();a(n,e,!0),a(o,[],!0),a(f,!1)}function E(){if(t(n)&&t(f))return t(n);const e=t(n)||crypto.randomUUID();a(n,e,!0);const i=new Date().toISOString(),d=b();return d.push({id:e,createdAt:i,updatedAt:i,title:"New chat",messages:[]}),_(d),a(f,!0),e}function K(e){if(!e.trim()||t(r))return;a(O,null);const i=E();t(o).push({role:"user",content:e}),t(o).push({role:"agent",content:"",segments:[],streaming:!0}),a(r,!0);const d=b(),l=d.find(s=>s.id===i);l&&l.title==="New chat"&&(l.title=e.slice(0,50),_(d)),N(i,t(o));let T=!1,w=null;A=new AbortController;const G=y.selectedSubPath?`${y.selectedRepo}/${y.selectedType}/${y.selectedId}/${y.selectedSubPath}`:y.selectedId?`${y.selectedRepo}/${y.selectedType}/${y.selectedId}`:null,P=t(o).slice(0,-2).map(s=>({role:s.role==="agent"?"assistant":s.role,content:s.content})),H={message:e,context:G??void 0,sessionId:i,history:P.length>0?P:void 0};X(H,s=>{if(!t(r))return;const u=t(o)[t(o).length-1];if(!u||u.role!=="agent")return;const S=u.segments;switch(s.type){case"token":{u.content+=s.text??"";const I=S[S.length-1];I&&I.type==="text"?I.content+=s.text??"":S.push({type:"text",content:s.text??""}),u.segments=S,x(m);break}case"tool_start":if(s.name){R.has(s.name)&&(T=!0);const I=S[S.length-1];I&&I.type==="tools"?I.names=[...I.names,s.name]:S.push({type:"tools",names:[s.name]}),u.segments=S,x(m)}break;case"mutation":T=!0,s.action==="created"&&s.repo&&s.entityType&&s.entityId&&(w={repo:s.repo,entityType:s.entityType,entityId:s.entityId}),window.StudioChrome?.emitMutation?.({action:s.action,repo:s.repo,entityType:s.entityType,entityId:s.entityId});break;case"highlight":a(O,s.entityIds&&s.entityIds.length>0?new Set(s.entityIds):null,!0);break;case"done":s.message&&!u.content&&(u.content=s.message,u.segments=[{type:"text",content:s.message}]),u.streaming=!1,a(r,!1),N(i,t(o)),T&&(L().then(()=>{x(p)}),W.refreshAll().then(()=>{w&&V(`/${w.repo}/${w.entityType}/${w.entityId}`)}));break;case"error":u.content+=`
3
3
 
4
4
  Error: ${s.message}`,u.streaming=!1,a(r,!1),N(i,t(o));break}},A.signal)}function $(){if(!t(r))return;fetch("/api/chat/abort",{method:"POST",credentials:"include"}).catch(()=>{}),A?.abort(),A=null,a(r,!1);const e=t(o)[t(o).length-1];e?.streaming&&(e.streaming=!1,t(n)&&N(t(n),t(o)))}function Y(){$(),a(o,[],!0),t(n)&&t(f)&&N(t(n),t(o))}function Z(e){const d=b().filter(l=>l.id!==e);if(_(d),t(n)===e){const l=d.sort((T,w)=>w.updatedAt.localeCompare(T.updatedAt));l.length>0?(a(n,l[0].id,!0),a(o,l[0].messages.map(T=>({...T,streaming:!1})),!0),a(f,!0)):(a(n,null),a(o,[],!0),a(f,!1))}}function j(e){const d=b().find(l=>l.id===e);d&&($(),a(n,d.id,!0),a(o,d.messages.map(l=>({...l,streaming:!1})),!0),a(f,!0))}function q(){return b().sort((e,i)=>i.updatedAt.localeCompare(e.updatedAt)).map(e=>({id:e.id,title:e.title,createdAt:e.createdAt,updatedAt:e.updatedAt,preview:e.messages.find(i=>i.role==="user")?.content.slice(0,80)||"",count:e.messages.length,active:e.id===t(n)}))}return{get messages(){return t(o)},get streaming(){return t(r)},get mutationCount(){return t(p)},get scrollTick(){return t(m)},get forceScroll(){return t(k)},triggerScroll(){x(k)},get highlightedIds(){return t(O)},get activeSessionId(){return t(n)},get draftInput(){return t(C)},set draftInput(e){a(C,e,!0)},send:K,stop:$,clear:Y,newSession:M,deleteSession:Z,getSessions:q,loadSession:j}}const te=B();export{te as chatStore};
@@ -1 +1 @@
1
- import{c as m,a,f as l}from"./iDtAARVW.js";import{h as w}from"./CT6oIU-C.js";import{i as n}from"./72bZS3G9.js";import{p as d}from"./cLyZlkXv.js";import{L as b,T as k}from"./DX3q8Wh7.js";import{t as y}from"./vANlie4P.js";import{u as S}from"./vANlie4P.js";var u=l('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>'),x=l('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>'),_=l('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>'),z=l('<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>');function H(s,v){const t=d(v,"type",3,"success");var e=m(),c=w(e);{var i=o=>{var r=u();a(o,r)},p=o=>{var r=x();a(o,r)},h=o=>{var r=_();a(o,r)},g=o=>{var r=z();a(o,r)},f=o=>{};n(c,o=>{t()==="success"?o(i):t()==="error"?o(p,1):t()==="info"?o(h,2):t()==="warning"?o(g,3):o(f,!1)})}a(s,e)}export{H as Icon,b as Loader,k as Toaster,y as toast,S as useSonner};
1
+ import{c as m,a,f as l}from"./iDtAARVW.js";import{h as w}from"./CT6oIU-C.js";import{i as n}from"./72bZS3G9.js";import{p as d}from"./cLyZlkXv.js";import{L as b,T as k}from"./BR77jbfR.js";import{t as y}from"./DTZE-yoq.js";import{u as S}from"./DTZE-yoq.js";var u=l('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>'),x=l('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>'),_=l('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>'),z=l('<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>');function H(s,v){const t=d(v,"type",3,"success");var e=m(),c=w(e);{var i=o=>{var r=u();a(o,r)},p=o=>{var r=x();a(o,r)},h=o=>{var r=_();a(o,r)},g=o=>{var r=z();a(o,r)},f=o=>{};n(c,o=>{t()==="success"?o(i):t()==="error"?o(p,1):t()==="info"?o(h,2):t()==="warning"?o(g,3):o(f,!1)})}a(s,e)}export{H as Icon,b as Loader,k as Toaster,y as toast,S as useSonner};
@@ -1 +1 @@
1
- import{e as i,f as y,g as r,s as n}from"./CT6oIU-C.js";import{g as l}from"./WlsUHv-K.js";import{d as v,u as V,c as F,f as h}from"./CJ8__CWt.js";const d={selectedType:null,groupBy:null,sortKey:"name",sortAsc:!0,filters:{text:{},enum:{},date:{}}};function x(){let a=i(y([])),o=i(null),c=i(!1);async function w(){try{n(a,await h(),!0),n(c,!0)}catch(e){console.error("Failed to load views:",e)}}async function f(e,t="list"){const s=t==="calendar"?{...d,calendar:{dateField:"due_date",year:new Date().getFullYear(),month:new Date().getMonth()+1}}:d,u=await F(e,s,t);return n(a,[...r(a),u],!0),u}async function g(e,t){await V(e,t),n(a,r(a).map(s=>s.id===e?{...s,...t}:s),!0)}async function m(e){if(await v(e),n(a,r(a).filter(t=>t.id!==e),!0),r(o)===e){const t=r(a)[0];t?(n(o,t.id,!0),l(`/views/${t.id}`,{replaceState:!0})):(n(o,null),l("/",{replaceState:!0}))}}function p(e){n(o,e,!0)}return{get views(){return r(a)},get activeViewId(){return r(o)},get loaded(){return r(c)},load:w,create:f,update:g,remove:m,setActive:p}}const D=x();export{D as v};
1
+ import{e as i,f as y,g as r,s as n}from"./CT6oIU-C.js";import{g as l}from"./Cpsr8-Xy.js";import{d as v,u as V,c as F,f as h}from"./CJ8__CWt.js";const d={selectedType:null,groupBy:null,sortKey:"name",sortAsc:!0,filters:{text:{},enum:{},date:{}}};function x(){let a=i(y([])),o=i(null),c=i(!1);async function w(){try{n(a,await h(),!0),n(c,!0)}catch(e){console.error("Failed to load views:",e)}}async function f(e,t="list"){const s=t==="calendar"?{...d,calendar:{dateField:"due_date",year:new Date().getFullYear(),month:new Date().getMonth()+1}}:d,u=await F(e,s,t);return n(a,[...r(a),u],!0),u}async function g(e,t){await V(e,t),n(a,r(a).map(s=>s.id===e?{...s,...t}:s),!0)}async function m(e){if(await v(e),n(a,r(a).filter(t=>t.id!==e),!0),r(o)===e){const t=r(a)[0];t?(n(o,t.id,!0),l(`/views/${t.id}`,{replaceState:!0})):(n(o,null),l("/",{replaceState:!0}))}}function p(e){n(o,e,!0)}return{get views(){return r(a)},get activeViewId(){return r(o)},get loaded(){return r(c)},load:w,create:f,update:g,remove:m,setActive:p}}const D=x();export{D as v};
@@ -1 +1 @@
1
- import{p as ae,c as A,a as d,b as B,s as ee,f as me,t as ne}from"./iDtAARVW.js";import{p as G,h as S,b as N,g as i,c as U,ad as X,r as z,u as L,e as Pe,f as ye,s as de,l as fe,d as le,a as be,n as te,m as ve,t as re,i as ie}from"./CT6oIU-C.js";import{b as K,a as j}from"./CmCtpZ1Y.js";import{i as q}from"./72bZS3G9.js";import{p as s,r as oe,s as pe,l as _e}from"./cLyZlkXv.js";import{f as se,n as J,M as Me,h as b,m as Q,j as we,k as Ce,l as Se,F as xe,o as Oe,P as Ae,p as Fe,q as ge,D as Ie,r as Re,t as ke,A as Ee,u as Le,v as Ke,x as He,y as Te,z as Ue,B as ze,G as De}from"./CJUKmosC.js";import{r as ce}from"./vANlie4P.js";import{i as je}from"./Y90OgS-9.js";import{c as D}from"./CXH6iFbA.js";import{a as he}from"./BS2rFAVq.js";var Be=B("<div><!></div>");function Ve(c,e){const l=ae();G(e,!0);let h=s(e,"ref",15,null),p=s(e,"id",19,()=>se(l)),_=s(e,"disabled",3,!1),M=s(e,"onSelect",3,J),P=s(e,"closeOnSelect",3,!0),f=oe(e,["$$slots","$$events","$$legacy","child","children","ref","id","disabled","onSelect","closeOnSelect"]);const w=Me.create({id:b(()=>p()),disabled:b(()=>_()),onSelect:b(()=>M()),ref:b(()=>h(),r=>h(r)),closeOnSelect:b(()=>P())}),u=L(()=>Q(f,w.props));var x=A(),a=S(x);{var t=r=>{var o=A(),m=S(o);K(m,()=>e.child,()=>({props:i(u)})),d(r,o)},n=r=>{var o=Be();j(o,()=>({...i(u)}));var m=U(o);K(m,()=>e.children??X),z(o),d(r,o)};q(a,r=>{e.child?r(t):r(n,!1)})}d(c,x),N()}var Ze=B("<div><!></div>");function We(c,e){const l=ae();G(e,!0);let h=s(e,"ref",15,null),p=s(e,"id",19,()=>se(l)),_=oe(e,["$$slots","$$events","$$legacy","ref","id","child","children"]);const M=we.create({id:b(()=>p()),ref:b(()=>h(),a=>h(a))}),P=L(()=>Q(_,M.props));var f=A(),w=S(f);{var u=a=>{var t=A(),n=S(t);K(n,()=>e.child,()=>({props:i(P)})),d(a,t)},x=a=>{var t=Ze();j(t,()=>({...i(P)}));var n=U(t);K(n,()=>e.children??X),z(t),d(a,t)};q(w,a=>{e.child?a(u):a(x,!1)})}d(c,f),N()}function qe(c,e){G(e,!0);let l=s(e,"open",15,!1),h=s(e,"dir",3,"ltr"),p=s(e,"onOpenChange",3,J),_=s(e,"onOpenChangeComplete",3,J),M=s(e,"_internal_variant",3,"dropdown-menu");const P=Ce.create({variant:b(()=>M()),dir:b(()=>h()),onClose:()=>{l(!1),p()(!1)}});Se.create({open:b(()=>l(),f=>{l(f),p()(f)}),onOpenChangeComplete:b(()=>_())},P),xe(c,{children:(f,w)=>{var u=A(),x=S(u);K(x,()=>e.children??X),d(f,u)},$$slots:{default:!0}}),N()}var Ge=B("<div><div><!></div></div>"),Ne=B("<div><div><!></div></div>");function Ye(c,e){const l=ae();G(e,!0);let h=s(e,"id",19,()=>se(l)),p=s(e,"ref",15,null),_=s(e,"loop",3,!0),M=s(e,"onInteractOutside",3,J),P=s(e,"onEscapeKeydown",3,J),f=s(e,"onCloseAutoFocus",3,J),w=s(e,"forceMount",3,!1),u=s(e,"trapFocus",3,!1),x=oe(e,["$$slots","$$events","$$legacy","id","child","children","ref","loop","onInteractOutside","onEscapeKeydown","onCloseAutoFocus","forceMount","trapFocus","style"]);const a=Oe.create({id:b(()=>h()),loop:b(()=>_()),ref:b(()=>p(),g=>p(g)),onCloseAutoFocus:b(()=>f())}),t=L(()=>Q(x,a.props));function n(g){if(a.handleInteractOutside(g),!g.defaultPrevented&&(M()(g),!g.defaultPrevented)){if(g.target&&g.target instanceof Element){const V=`[${a.parentMenu.root.getBitsAttr("sub-content")}]`;if(g.target.closest(V))return}a.parentMenu.onClose()}}function r(g){P()(g),!g.defaultPrevented&&a.parentMenu.onClose()}var o=A(),m=S(o);{var O=g=>{Ae(g,pe(()=>i(t),()=>a.popperProps,{get ref(){return a.opts.ref},get enabled(){return a.parentMenu.opts.open.current},onInteractOutside:n,onEscapeKeydown:r,get trapFocus(){return u()},get loop(){return _()},forceMount:!0,get id(){return h()},get shouldRender(){return a.shouldRender},popper:(Z,H)=>{let $=()=>H?.().props,F=()=>H?.().wrapperProps;const I=L(()=>Q($(),{style:ge("dropdown-menu")},{style:e.style}));var T=A(),R=S(T);{var k=y=>{var v=A(),C=S(v);{let W=L(()=>({props:i(I),wrapperProps:F(),...a.snippetProps}));K(C,()=>e.child,()=>i(W))}d(y,v)},E=y=>{var v=Ge();j(v,()=>({...F()}));var C=U(v);j(C,()=>({...i(I)}));var W=U(C);K(W,()=>e.children??X),z(C),z(v),d(y,v)};q(R,y=>{e.child?y(k):y(E,!1)})}d(Z,T)},$$slots:{popper:!0}}))},Y=g=>{Fe(g,pe(()=>i(t),()=>a.popperProps,{get ref(){return a.opts.ref},get open(){return a.parentMenu.opts.open.current},onInteractOutside:n,onEscapeKeydown:r,get trapFocus(){return u()},get loop(){return _()},forceMount:!1,get id(){return h()},get shouldRender(){return a.shouldRender},popper:(Z,H)=>{let $=()=>H?.().props,F=()=>H?.().wrapperProps;const I=L(()=>Q($(),{style:ge("dropdown-menu")},{style:e.style}));var T=A(),R=S(T);{var k=y=>{var v=A(),C=S(v);{let W=L(()=>({props:i(I),wrapperProps:F(),...a.snippetProps}));K(C,()=>e.child,()=>i(W))}d(y,v)},E=y=>{var v=Ne();j(v,()=>({...F()}));var C=U(v);j(C,()=>({...i(I)}));var W=U(C);K(W,()=>e.children??X),z(C),z(v),d(y,v)};q(R,y=>{e.child?y(k):y(E,!1)})}d(Z,T)},$$slots:{popper:!0}}))};q(m,g=>{w()?g(O):w()||g(Y,1)})}d(c,o),N()}var Je=B("<button><!></button>");function Qe(c,e){const l=ae();G(e,!0);let h=s(e,"id",19,()=>se(l)),p=s(e,"ref",15,null),_=s(e,"disabled",3,!1),M=s(e,"type",3,"button"),P=oe(e,["$$slots","$$events","$$legacy","id","ref","child","children","disabled","type"]);const f=Ie.create({id:b(()=>h()),disabled:b(()=>_()??!1),ref:b(()=>p(),u=>p(u))}),w=L(()=>Q(P,f.props,{type:M()}));Re(c,{get id(){return h()},get ref(){return f.opts.ref},children:(u,x)=>{var a=A(),t=S(a);{var n=o=>{var m=A(),O=S(m);K(O,()=>e.child,()=>({props:i(w)})),d(o,m)},r=o=>{var m=Je();j(m,()=>({...i(w)}));var O=U(m);K(O,()=>e.children??X),z(m),d(o,m)};q(t,o=>{e.child?o(n):o(r,!1)})}d(u,a)},$$slots:{default:!0}}),N()}const pt=qe,_t=Qe,gt=ke,ht=Ye,mt=Ve,Pt=We;function Xe(){let c=Pe(ye({})),e=null,l=null;function h(t,n,r){l&&(clearInterval(l),l=null),e=`${t}/${n}/${r}`,_("enter",t,n,r),l=setInterval(()=>{e&&_("heartbeat",t,n,r)},3e4)}function p(){if(l&&(clearInterval(l),l=null),e){const[t,n,r]=e.split("/");t&&n&&r&&_("leave",t,n,r),e=null}}function _(t,n,r,o){ce.send({type:"presence",action:t,repo:n,entityType:r,entityId:o})}function M(t){const n=`${t.repo}/${t.entityType}/${t.entityId}`,r=i(c)[n]??[];if(t.action==="leave")i(c)[n]=r.filter(o=>o.id!==t.user.id);else{const o=r.findIndex(m=>m.id===t.user.id);o>=0?(r[o]=t.user,i(c)[n]=[...r]):i(c)[n]=[...r,t.user]}}function P(){if(de(c,{},!0),!e)return;const[t,n,r]=e.split("/");t&&n&&r&&_("enter",t,n,r)}function f(t,n,r,o){const m=`${t}/${n}/${r}`,O=i(c)[m]??[];return o?O.filter(Y=>Y.id!==o):O}function w(t,n){const r=new Map;for(const[o,m]of Object.entries(i(c)))if(o.startsWith(t))for(const O of m)(!n||O.id!==n)&&r.set(O.id,O);return[...r.values()]}function u(t,n){return w(`${t}/`,n)}function x(t){const n=new Map;for(const r of Object.values(i(c)))for(const o of r)(!t||o.id!==t)&&n.set(o.id,o);return[...n.values()]}const a=L(()=>{const t=new Map;for(const n of Object.values(i(c)))for(const r of n)t.set(r.id,r);return[...t.values()]});return{enter:h,leave:p,handlePresenceEvent:M,resetAndResend:P,getPresence:f,getPresenceByPrefix:w,getRepoPresence:u,getAllUsers:x,get allUsers(){return i(a)}}}const ue=Xe();ce.setPresenceHandler(c=>ue.handlePresenceEvent(c));ce.addConnectHandler(()=>ue.resetAndResend());typeof window<"u"&&window.addEventListener("beforeunload",()=>ue.leave());var $e=me("<title> </title>"),et=me('<svg><!><path d="M25,12H20v2h5a1.0008,1.0008,0,0,1,1,1v2H22a3.0033,3.0033,0,0,0-3,3v1a3.0033,3.0033,0,0,0,3,3h6V15A3.0033,3.0033,0,0,0,25,12ZM22,22a1.0008,1.0008,0,0,1-1-1V20a1.0008,1.0008,0,0,1,1-1h4v3Z"></path><path d="M16,24h2L12,7H10L4,24H6l1.6936-5h6.6135ZM8.3711,17l2.4966-7.3711.2668.0005L13.63,17Z"></path></svg>');function yt(c,e){const l=_e(e,["children","$$slots","$$events","$$legacy"]),h=_e(l,["size","title"]);G(e,!1);const p=ve(),_=ve();let M=s(e,"size",8,16),P=s(e,"title",8,void 0);fe(()=>(le(l),le(P())),()=>{de(p,l["aria-label"]||l["aria-labelledby"]||P())}),fe(()=>(i(p),le(l)),()=>{de(_,{"aria-hidden":i(p)?void 0:!0,role:i(p)?"img":void 0,focusable:Number(l.tabindex)===0?!0:void 0})}),be(),je();var f=et();j(f,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:M(),height:M(),...i(_),...h}));var w=U(f);{var u=x=>{var a=$e(),t=U(a,!0);z(a),re(()=>ee(t,P())),d(x,a)};q(w,x=>{P()&&x(u)})}te(2),z(f),d(c,f),N()}var tt=B("<!> <!>",1),rt=B("<!> <!>",1),nt=B("<!> <!>",1);function bt(c,e){G(e,!0);let l=s(e,"open",15),h=s(e,"confirmLabel",3,"Confirm"),p=s(e,"cancelLabel",3,"Cancel"),_=s(e,"destructive",3,!1);var M=A(),P=S(M);D(P,()=>De,(f,w)=>{w(f,{onOpenChange:u=>{u||e.oncancel()},get open(){return l()},set open(u){l(u)},children:(u,x)=>{var a=A(),t=S(a);D(t,()=>Ee,(n,r)=>{r(n,{children:(o,m)=>{var O=nt(),Y=S(O);D(Y,()=>Le,(V,Z)=>{Z(V,{children:(H,$)=>{var F=tt(),I=S(F);D(I,()=>Ke,(R,k)=>{k(R,{children:(E,y)=>{te();var v=ne();re(()=>ee(v,e.title)),d(E,v)},$$slots:{default:!0}})});var T=ie(I,2);D(T,()=>He,(R,k)=>{k(R,{children:(E,y)=>{te();var v=ne();re(()=>ee(v,e.message)),d(E,v)},$$slots:{default:!0}})}),d(H,F)},$$slots:{default:!0}})});var g=ie(Y,2);D(g,()=>Te,(V,Z)=>{Z(V,{children:(H,$)=>{var F=rt(),I=S(F);{let R=L(()=>he({variant:"ghost"}));D(I,()=>Ue,(k,E)=>{E(k,{get class(){return i(R)},get onclick(){return e.oncancel},children:(y,v)=>{te();var C=ne();re(()=>ee(C,p())),d(y,C)},$$slots:{default:!0}})})}var T=ie(I,2);{let R=L(()=>he({variant:_()?"destructive":"accent"}));D(T,()=>ze,(k,E)=>{E(k,{get class(){return i(R)},get onclick(){return e.onconfirm},children:(y,v)=>{te();var C=ne();re(()=>ee(C,h())),d(y,C)},$$slots:{default:!0}})})}d(H,F)},$$slots:{default:!0}})}),d(o,O)},$$slots:{default:!0}})}),d(u,a)},$$slots:{default:!0}})}),d(c,M),N()}export{ht as C,mt as I,gt as P,pt as R,Pt as S,_t as T,yt as a,bt as b,ue as p};
1
+ import{p as ae,c as A,a as d,b as B,s as ee,f as me,t as ne}from"./iDtAARVW.js";import{p as G,h as S,b as N,g as i,c as U,ad as X,r as z,u as L,e as Pe,f as ye,s as de,l as fe,d as le,a as be,n as te,m as ve,t as re,i as ie}from"./CT6oIU-C.js";import{b as K,a as j}from"./CmCtpZ1Y.js";import{i as q}from"./72bZS3G9.js";import{p as s,r as oe,s as pe,l as _e}from"./cLyZlkXv.js";import{f as se,n as J,M as Me,h as b,m as Q,j as we,k as Ce,l as Se,F as xe,o as Oe,P as Ae,p as Fe,q as ge,D as Ie,r as Re,t as ke,A as Ee,u as Le,v as Ke,x as He,y as Te,z as Ue,B as ze,G as De}from"./CJUKmosC.js";import{r as ce}from"./DTZE-yoq.js";import{i as je}from"./Y90OgS-9.js";import{c as D}from"./CXH6iFbA.js";import{a as he}from"./BS2rFAVq.js";var Be=B("<div><!></div>");function Ve(c,e){const l=ae();G(e,!0);let h=s(e,"ref",15,null),p=s(e,"id",19,()=>se(l)),_=s(e,"disabled",3,!1),M=s(e,"onSelect",3,J),P=s(e,"closeOnSelect",3,!0),f=oe(e,["$$slots","$$events","$$legacy","child","children","ref","id","disabled","onSelect","closeOnSelect"]);const w=Me.create({id:b(()=>p()),disabled:b(()=>_()),onSelect:b(()=>M()),ref:b(()=>h(),r=>h(r)),closeOnSelect:b(()=>P())}),u=L(()=>Q(f,w.props));var x=A(),a=S(x);{var t=r=>{var o=A(),m=S(o);K(m,()=>e.child,()=>({props:i(u)})),d(r,o)},n=r=>{var o=Be();j(o,()=>({...i(u)}));var m=U(o);K(m,()=>e.children??X),z(o),d(r,o)};q(a,r=>{e.child?r(t):r(n,!1)})}d(c,x),N()}var Ze=B("<div><!></div>");function We(c,e){const l=ae();G(e,!0);let h=s(e,"ref",15,null),p=s(e,"id",19,()=>se(l)),_=oe(e,["$$slots","$$events","$$legacy","ref","id","child","children"]);const M=we.create({id:b(()=>p()),ref:b(()=>h(),a=>h(a))}),P=L(()=>Q(_,M.props));var f=A(),w=S(f);{var u=a=>{var t=A(),n=S(t);K(n,()=>e.child,()=>({props:i(P)})),d(a,t)},x=a=>{var t=Ze();j(t,()=>({...i(P)}));var n=U(t);K(n,()=>e.children??X),z(t),d(a,t)};q(w,a=>{e.child?a(u):a(x,!1)})}d(c,f),N()}function qe(c,e){G(e,!0);let l=s(e,"open",15,!1),h=s(e,"dir",3,"ltr"),p=s(e,"onOpenChange",3,J),_=s(e,"onOpenChangeComplete",3,J),M=s(e,"_internal_variant",3,"dropdown-menu");const P=Ce.create({variant:b(()=>M()),dir:b(()=>h()),onClose:()=>{l(!1),p()(!1)}});Se.create({open:b(()=>l(),f=>{l(f),p()(f)}),onOpenChangeComplete:b(()=>_())},P),xe(c,{children:(f,w)=>{var u=A(),x=S(u);K(x,()=>e.children??X),d(f,u)},$$slots:{default:!0}}),N()}var Ge=B("<div><div><!></div></div>"),Ne=B("<div><div><!></div></div>");function Ye(c,e){const l=ae();G(e,!0);let h=s(e,"id",19,()=>se(l)),p=s(e,"ref",15,null),_=s(e,"loop",3,!0),M=s(e,"onInteractOutside",3,J),P=s(e,"onEscapeKeydown",3,J),f=s(e,"onCloseAutoFocus",3,J),w=s(e,"forceMount",3,!1),u=s(e,"trapFocus",3,!1),x=oe(e,["$$slots","$$events","$$legacy","id","child","children","ref","loop","onInteractOutside","onEscapeKeydown","onCloseAutoFocus","forceMount","trapFocus","style"]);const a=Oe.create({id:b(()=>h()),loop:b(()=>_()),ref:b(()=>p(),g=>p(g)),onCloseAutoFocus:b(()=>f())}),t=L(()=>Q(x,a.props));function n(g){if(a.handleInteractOutside(g),!g.defaultPrevented&&(M()(g),!g.defaultPrevented)){if(g.target&&g.target instanceof Element){const V=`[${a.parentMenu.root.getBitsAttr("sub-content")}]`;if(g.target.closest(V))return}a.parentMenu.onClose()}}function r(g){P()(g),!g.defaultPrevented&&a.parentMenu.onClose()}var o=A(),m=S(o);{var O=g=>{Ae(g,pe(()=>i(t),()=>a.popperProps,{get ref(){return a.opts.ref},get enabled(){return a.parentMenu.opts.open.current},onInteractOutside:n,onEscapeKeydown:r,get trapFocus(){return u()},get loop(){return _()},forceMount:!0,get id(){return h()},get shouldRender(){return a.shouldRender},popper:(Z,H)=>{let $=()=>H?.().props,F=()=>H?.().wrapperProps;const I=L(()=>Q($(),{style:ge("dropdown-menu")},{style:e.style}));var T=A(),R=S(T);{var k=y=>{var v=A(),C=S(v);{let W=L(()=>({props:i(I),wrapperProps:F(),...a.snippetProps}));K(C,()=>e.child,()=>i(W))}d(y,v)},E=y=>{var v=Ge();j(v,()=>({...F()}));var C=U(v);j(C,()=>({...i(I)}));var W=U(C);K(W,()=>e.children??X),z(C),z(v),d(y,v)};q(R,y=>{e.child?y(k):y(E,!1)})}d(Z,T)},$$slots:{popper:!0}}))},Y=g=>{Fe(g,pe(()=>i(t),()=>a.popperProps,{get ref(){return a.opts.ref},get open(){return a.parentMenu.opts.open.current},onInteractOutside:n,onEscapeKeydown:r,get trapFocus(){return u()},get loop(){return _()},forceMount:!1,get id(){return h()},get shouldRender(){return a.shouldRender},popper:(Z,H)=>{let $=()=>H?.().props,F=()=>H?.().wrapperProps;const I=L(()=>Q($(),{style:ge("dropdown-menu")},{style:e.style}));var T=A(),R=S(T);{var k=y=>{var v=A(),C=S(v);{let W=L(()=>({props:i(I),wrapperProps:F(),...a.snippetProps}));K(C,()=>e.child,()=>i(W))}d(y,v)},E=y=>{var v=Ne();j(v,()=>({...F()}));var C=U(v);j(C,()=>({...i(I)}));var W=U(C);K(W,()=>e.children??X),z(C),z(v),d(y,v)};q(R,y=>{e.child?y(k):y(E,!1)})}d(Z,T)},$$slots:{popper:!0}}))};q(m,g=>{w()?g(O):w()||g(Y,1)})}d(c,o),N()}var Je=B("<button><!></button>");function Qe(c,e){const l=ae();G(e,!0);let h=s(e,"id",19,()=>se(l)),p=s(e,"ref",15,null),_=s(e,"disabled",3,!1),M=s(e,"type",3,"button"),P=oe(e,["$$slots","$$events","$$legacy","id","ref","child","children","disabled","type"]);const f=Ie.create({id:b(()=>h()),disabled:b(()=>_()??!1),ref:b(()=>p(),u=>p(u))}),w=L(()=>Q(P,f.props,{type:M()}));Re(c,{get id(){return h()},get ref(){return f.opts.ref},children:(u,x)=>{var a=A(),t=S(a);{var n=o=>{var m=A(),O=S(m);K(O,()=>e.child,()=>({props:i(w)})),d(o,m)},r=o=>{var m=Je();j(m,()=>({...i(w)}));var O=U(m);K(O,()=>e.children??X),z(m),d(o,m)};q(t,o=>{e.child?o(n):o(r,!1)})}d(u,a)},$$slots:{default:!0}}),N()}const pt=qe,_t=Qe,gt=ke,ht=Ye,mt=Ve,Pt=We;function Xe(){let c=Pe(ye({})),e=null,l=null;function h(t,n,r){l&&(clearInterval(l),l=null),e=`${t}/${n}/${r}`,_("enter",t,n,r),l=setInterval(()=>{e&&_("heartbeat",t,n,r)},3e4)}function p(){if(l&&(clearInterval(l),l=null),e){const[t,n,r]=e.split("/");t&&n&&r&&_("leave",t,n,r),e=null}}function _(t,n,r,o){ce.send({type:"presence",action:t,repo:n,entityType:r,entityId:o})}function M(t){const n=`${t.repo}/${t.entityType}/${t.entityId}`,r=i(c)[n]??[];if(t.action==="leave")i(c)[n]=r.filter(o=>o.id!==t.user.id);else{const o=r.findIndex(m=>m.id===t.user.id);o>=0?(r[o]=t.user,i(c)[n]=[...r]):i(c)[n]=[...r,t.user]}}function P(){if(de(c,{},!0),!e)return;const[t,n,r]=e.split("/");t&&n&&r&&_("enter",t,n,r)}function f(t,n,r,o){const m=`${t}/${n}/${r}`,O=i(c)[m]??[];return o?O.filter(Y=>Y.id!==o):O}function w(t,n){const r=new Map;for(const[o,m]of Object.entries(i(c)))if(o.startsWith(t))for(const O of m)(!n||O.id!==n)&&r.set(O.id,O);return[...r.values()]}function u(t,n){return w(`${t}/`,n)}function x(t){const n=new Map;for(const r of Object.values(i(c)))for(const o of r)(!t||o.id!==t)&&n.set(o.id,o);return[...n.values()]}const a=L(()=>{const t=new Map;for(const n of Object.values(i(c)))for(const r of n)t.set(r.id,r);return[...t.values()]});return{enter:h,leave:p,handlePresenceEvent:M,resetAndResend:P,getPresence:f,getPresenceByPrefix:w,getRepoPresence:u,getAllUsers:x,get allUsers(){return i(a)}}}const ue=Xe();ce.setPresenceHandler(c=>ue.handlePresenceEvent(c));ce.addConnectHandler(()=>ue.resetAndResend());typeof window<"u"&&window.addEventListener("beforeunload",()=>ue.leave());var $e=me("<title> </title>"),et=me('<svg><!><path d="M25,12H20v2h5a1.0008,1.0008,0,0,1,1,1v2H22a3.0033,3.0033,0,0,0-3,3v1a3.0033,3.0033,0,0,0,3,3h6V15A3.0033,3.0033,0,0,0,25,12ZM22,22a1.0008,1.0008,0,0,1-1-1V20a1.0008,1.0008,0,0,1,1-1h4v3Z"></path><path d="M16,24h2L12,7H10L4,24H6l1.6936-5h6.6135ZM8.3711,17l2.4966-7.3711.2668.0005L13.63,17Z"></path></svg>');function yt(c,e){const l=_e(e,["children","$$slots","$$events","$$legacy"]),h=_e(l,["size","title"]);G(e,!1);const p=ve(),_=ve();let M=s(e,"size",8,16),P=s(e,"title",8,void 0);fe(()=>(le(l),le(P())),()=>{de(p,l["aria-label"]||l["aria-labelledby"]||P())}),fe(()=>(i(p),le(l)),()=>{de(_,{"aria-hidden":i(p)?void 0:!0,role:i(p)?"img":void 0,focusable:Number(l.tabindex)===0?!0:void 0})}),be(),je();var f=et();j(f,()=>({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",preserveAspectRatio:"xMidYMid meet",width:M(),height:M(),...i(_),...h}));var w=U(f);{var u=x=>{var a=$e(),t=U(a,!0);z(a),re(()=>ee(t,P())),d(x,a)};q(w,x=>{P()&&x(u)})}te(2),z(f),d(c,f),N()}var tt=B("<!> <!>",1),rt=B("<!> <!>",1),nt=B("<!> <!>",1);function bt(c,e){G(e,!0);let l=s(e,"open",15),h=s(e,"confirmLabel",3,"Confirm"),p=s(e,"cancelLabel",3,"Cancel"),_=s(e,"destructive",3,!1);var M=A(),P=S(M);D(P,()=>De,(f,w)=>{w(f,{onOpenChange:u=>{u||e.oncancel()},get open(){return l()},set open(u){l(u)},children:(u,x)=>{var a=A(),t=S(a);D(t,()=>Ee,(n,r)=>{r(n,{children:(o,m)=>{var O=nt(),Y=S(O);D(Y,()=>Le,(V,Z)=>{Z(V,{children:(H,$)=>{var F=tt(),I=S(F);D(I,()=>Ke,(R,k)=>{k(R,{children:(E,y)=>{te();var v=ne();re(()=>ee(v,e.title)),d(E,v)},$$slots:{default:!0}})});var T=ie(I,2);D(T,()=>He,(R,k)=>{k(R,{children:(E,y)=>{te();var v=ne();re(()=>ee(v,e.message)),d(E,v)},$$slots:{default:!0}})}),d(H,F)},$$slots:{default:!0}})});var g=ie(Y,2);D(g,()=>Te,(V,Z)=>{Z(V,{children:(H,$)=>{var F=rt(),I=S(F);{let R=L(()=>he({variant:"ghost"}));D(I,()=>Ue,(k,E)=>{E(k,{get class(){return i(R)},get onclick(){return e.oncancel},children:(y,v)=>{te();var C=ne();re(()=>ee(C,p())),d(y,C)},$$slots:{default:!0}})})}var T=ie(I,2);{let R=L(()=>he({variant:_()?"destructive":"accent"}));D(T,()=>ze,(k,E)=>{E(k,{get class(){return i(R)},get onclick(){return e.onconfirm},children:(y,v)=>{te();var C=ne();re(()=>ee(C,h())),d(y,C)},$$slots:{default:!0}})})}d(H,F)},$$slots:{default:!0}})}),d(o,O)},$$slots:{default:!0}})}),d(u,a)},$$slots:{default:!0}})}),d(c,M),N()}export{ht as C,mt as I,gt as P,pt as R,Pt as S,_t as T,yt as a,bt as b,ue as p};
@@ -1 +1 @@
1
- import{bB as Le,aE as Ge,e as A,g as U,s as P,aF as ne,bC as vt}from"./CT6oIU-C.js";class Ae{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Ue{constructor(t,n){this.status=t,this.location=n}}class Pe extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function wt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function yt(e){return e.split("%25").map(decodeURI).join("%25")}function bt(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function me({href:e}){return e.split("#")[0]}function kt(e,t,n,r=!1){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(s,o){if(o==="get"||o==="getAll"||o==="has")return(c,...d)=>(n(c),s[o](c,...d));t();const l=Reflect.get(s,o);return typeof l=="function"?l.bind(s):l}}),enumerable:!0,configurable:!0});const i=["href","pathname","search","toString","toJSON"];r&&i.push("hash");for(const s of i)Object.defineProperty(a,s,{get(){return t(),e[s]},enumerable:!0,configurable:!0});return a}function Et(...e){let t=5381;for(const n of e)if(typeof n=="string"){let r=n.length;for(;r;)t=t*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)t=t*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;new TextDecoder;function St(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const Rt=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&G.delete(Te(e)),Rt(e,t));const G=new Map;function xt(e,t){const n=Te(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:a,...i}=JSON.parse(r.textContent);const s=r.getAttribute("data-ttl");return s&&G.set(n,{body:a,init:i,ttl:1e3*Number(s)}),r.getAttribute("data-b64")!==null&&(a=St(a)),Promise.resolve(new Response(a,i))}return window.fetch(e,t)}function Lt(e,t,n){if(G.size>0){const r=Te(e,n),a=G.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(n?.cache))return new Response(a.body,a.init);G.delete(r)}}return window.fetch(t,n)}function Te(e,t){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){const a=[];t.headers&&a.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&a.push(t.body),r+=`[data-hash="${Et(...a)}"]`}return r}const At=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Ut(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${Tt(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const i=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(i)return t.push({name:i[1],matcher:i[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const s=r.split(/\[(.+?)\](?!\])/);return"/"+s.map((l,c)=>{if(c%2){if(l.startsWith("x+"))return _e(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return _e(String.fromCharCode(...l.slice(2).split("-").map(v=>parseInt(v,16))));const d=At.exec(l),[,p,f,u,h]=d;return t.push({name:u,matcher:h,optional:!!p,rest:!!f,chained:f?c===1&&s[0]==="":!1}),f?"([^]*?)":p?"([^/]*)?":"([^/]+?)"}return _e(l)}).join("")}).join("")}/?$`),params:t}}function Pt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function Tt(e){return e.slice(1).split("/").filter(Pt)}function It(e,t,n){const r={},a=e.slice(1),i=a.filter(o=>o!==void 0);let s=0;for(let o=0;o<t.length;o+=1){const l=t[o];let c=a[o-s];if(l.chained&&l.rest&&s&&(c=a.slice(o-s,o+1).filter(d=>d).join("/"),s=0),c===void 0)if(l.rest)c="";else continue;if(!l.matcher||n[l.matcher](c)){r[l.name]=c;const d=t[o+1],p=a[o+1];d&&!d.rest&&d.optional&&p&&l.chained&&(s=0),!d&&!p&&Object.keys(r).length===i.length&&(s=0);continue}if(l.optional&&l.chained){s++;continue}return}if(!s)return r}function _e(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Ot({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([o,[l,c,d]])=>{const{pattern:p,params:f}=Ut(o),u={id:o,exec:h=>{const v=p.exec(h);if(v)return It(v,f,r)},errors:[1,...d||[]].map(h=>e[h]),layouts:[0,...c||[]].map(s),leaf:i(l)};return u.errors.length=u.layouts.length=Math.max(u.errors.length,u.layouts.length),u});function i(o){const l=o<0;return l&&(o=~o),[l,e[o]]}function s(o){return o===void 0?o:[a.has(o),e[o]]}}function Xe(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function Me(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const x=globalThis.__sveltekit_17m3gvt?.base??"",Ct=globalThis.__sveltekit_17m3gvt?.assets??x??"",$t="1775068107990",Qe="sveltekit:snapshot",Ze="sveltekit:scroll",et="sveltekit:states",jt="sveltekit:pageurl",B="sveltekit:history",H="sveltekit:navigation",N={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},he=location.origin;function Ie(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function D(){return{x:pageXOffset,y:pageYOffset}}function V(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const He={...N,"":N.hover};function tt(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function nt(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=tt(e)}}function be(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const o=location.hash.split("#")[1]||"/";r.hash=`#${o}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,i=!r||!!a||pe(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),s=r?.origin===he&&e.hasAttribute("download");return{url:r,external:i,target:a,download:s}}function re(e){let t=null,n=null,r=null,a=null,i=null,s=null,o=e;for(;o&&o!==document.documentElement;)r===null&&(r=V(o,"preload-code")),a===null&&(a=V(o,"preload-data")),t===null&&(t=V(o,"keepfocus")),n===null&&(n=V(o,"noscroll")),i===null&&(i=V(o,"reload")),s===null&&(s=V(o,"replacestate")),o=tt(o);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:He[r??"off"],preload_data:He[a??"off"],keepfocus:l(t),noscroll:l(n),reload:l(i),replace_state:l(s)}}function We(e){const t=Le(e);let n=!0;function r(){n=!0,t.update(s=>s)}function a(s){n=!1,t.set(s)}function i(s){let o;return t.subscribe(l=>{(o===void 0||n&&l!==o)&&s(o=l)})}return{notify:r,set:a,subscribe:i}}const rt={v:()=>{}};function Nt(){const{set:e,subscribe:t}=Le(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Ct}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const s=(await a.json()).version!==$t;return s&&(e(!0),rt.v(),clearTimeout(n)),s}catch{return!1}}return{subscribe:t,check:r}}function pe(e,t,n){return e.origin!==he||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function cn(e){}const at=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...at];const Dt=new Set([...at]);[...Dt];function qt(e){return e.filter(t=>t!=null)}function Oe(e){return e instanceof Ae||e instanceof Pe?e.status:500}function Vt(e){return e instanceof Pe?e.text:"Internal Error"}let b,W,ve;const Bt=Ge.toString().includes("$$")||/function \w+\(\) \{\}/.test(Ge.toString());Bt?(b={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},W={current:null},ve={current:!1}):(b=new class{#e=A({});get data(){return U(this.#e)}set data(t){P(this.#e,t)}#t=A(null);get form(){return U(this.#t)}set form(t){P(this.#t,t)}#n=A(null);get error(){return U(this.#n)}set error(t){P(this.#n,t)}#r=A({});get params(){return U(this.#r)}set params(t){P(this.#r,t)}#a=A({id:null});get route(){return U(this.#a)}set route(t){P(this.#a,t)}#o=A({});get state(){return U(this.#o)}set state(t){P(this.#o,t)}#s=A(-1);get status(){return U(this.#s)}set status(t){P(this.#s,t)}#i=A(new URL("https://example.com"));get url(){return U(this.#i)}set url(t){P(this.#i,t)}},W=new class{#e=A(null);get current(){return U(this.#e)}set current(t){P(this.#e,t)}},ve=new class{#e=A(!1);get current(){return U(this.#e)}set current(t){P(this.#e,t)}},rt.v=()=>ve.current=!0);function ot(e){Object.assign(b,e)}const Je={spanContext(){return Ft},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},Ft={traceId:"",spanId:"",traceFlags:0},Kt=new Set(["icon","shortcut icon","apple-touch-icon"]),j=Xe(Ze)??{},J=Xe(Qe)??{},$={url:We({}),page:We({}),navigating:Le(null),updated:Nt()};function Ce(e){j[e]=D()}function Gt(e,t){let n=e+1;for(;j[n];)delete j[n],n+=1;for(n=t+1;J[n];)delete J[n],n+=1}function Y(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function st(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(x||"/");e&&await e.update()}}function ke(){}let $e,Ee,ae,T,Se,w;const oe=[],se=[];let L=null;function ie(){L?.fork?.then(e=>e?.discard()),L=null}const te=new Map,it=new Set,Mt=new Set,M=new Set;let _={branch:[],error:null,url:null},lt=!1,le=!1,Ye=!0,z=!1,K=!1,ct=!1,Q=!1,je,y,R,I;const ce=new Set;let we;const ue=new Map;async function hn(e,t,n){globalThis.__sveltekit_17m3gvt?.data&&globalThis.__sveltekit_17m3gvt.data,document.URL!==location.href&&(location.href=location.href),w=e,await e.hooks.init?.(),$e=Ot(e),T=document.documentElement,Se=t,Ee=e.nodes[0],ae=e.nodes[1],Ee(),ae(),y=history.state?.[B],R=history.state?.[H],y||(y=R=Date.now(),history.replaceState({...history.state,[B]:y,[H]:R},""));const r=j[y];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await rn(Se,n)):(await F({type:"enter",url:Ie(w.hash?sn(new URL(location.href)):location.href),replace_state:!0}),a()),nn()}async function Ht(e=!0,t=!0){if(await(we||=Promise.resolve()),!we)return;we=null;const n=I={},r=await Z(_.url,!0);if(ie(),Q&&ue.forEach(({resource:a})=>{a.refresh?.()}),e){const a=b.state,i=r&&await Ve(r);if(!i||n!==I)return;if(i.type==="redirect")return Ne(new URL(i.location,_.url).href,{replaceState:!0},1,n);t||(i.props.page.state=a),ot(i.props.page),_=i.state,Re(),je.$set(i.props)}else Re();await Promise.all([...ue.values()].map(({resource:a})=>a)).catch(ke)}function Re(){oe.length=0,Q=!1}function ut(e){se.some(t=>t?.snapshot)&&(J[e]=se.map(t=>t?.snapshot?.capture()))}function ft(e){J[e]?.forEach((t,n)=>{se[n]?.snapshot?.restore(t)})}function ze(){Ce(y),Me(Ze,j),ut(R),Me(Qe,J)}async function Ne(e,t,n,r){let a;t.invalidateAll&&ie(),await F({type:"goto",url:Ie(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(Q=!0,a=[...ue.keys()]),t.invalidate&&t.invalidate.forEach(tn)}}),t.invalidateAll&&ne().then(ne).then(()=>{ue.forEach(({resource:i},s)=>{a?.includes(s)&&i.refresh?.()})})}async function Wt(e){if(e.id!==L?.id){ie();const t={};ce.add(t),L={id:e.id,token:t,promise:Ve({...e,preload:t}).then(n=>(ce.delete(t),n.type==="loaded"&&n.state.error&&ie(),n)),fork:null}}return L.promise}async function ye(e){const t=(await Z(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(n=>n[1]()))}async function dt(e,t,n){_=e.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(b,e.props.page),je=new w.root({target:t,props:{...e.props,stores:$,components:se},hydrate:n,sync:!1}),await Promise.resolve(),ft(R),n){const a={from:null,to:{params:_.params,route:{id:_.route?.id??null},url:new URL(location.href),scroll:j[y]??D()},willUnload:!1,type:"enter",complete:Promise.resolve()};M.forEach(i=>i(a))}le=!0}function fe({url:e,params:t,branch:n,status:r,error:a,route:i,form:s}){let o="never";if(x&&(e.pathname===x||e.pathname===x+"/"))o="always";else for(const u of n)u?.slash!==void 0&&(o=u.slash);e.pathname=wt(e.pathname,o),e.search=e.search;const l={type:"loaded",state:{url:e,params:t,branch:n,error:a,route:i},props:{constructors:qt(n).map(u=>u.node.component),page:Ke(b)}};s!==void 0&&(l.props.form=s);let c={},d=!b,p=0;for(let u=0;u<Math.max(n.length,_.branch.length);u+=1){const h=n[u],v=_.branch[u];h?.data!==v?.data&&(d=!0),h&&(c={...c,...h.data},d&&(l.props[`data_${p}`]=c),p+=1)}return(!_.url||e.href!==_.url.href||_.error!==a||s!==void 0&&s!==b.form||d)&&(l.props.page={error:a,params:t,route:{id:i?.id??null},state:{},status:r,url:new URL(e),form:s??null,data:d?c:b.data}),l}async function De({loader:e,parent:t,url:n,params:r,route:a,server_data_node:i}){let s=null,o=!0;const l={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},c=await e();if(c.universal?.load){let d=function(...f){for(const u of f){const{href:h}=new URL(u,n);l.dependencies.add(h)}};const p={tracing:{enabled:!1,root:Je,current:Je},route:new Proxy(a,{get:(f,u)=>(o&&(l.route=!0),f[u])}),params:new Proxy(r,{get:(f,u)=>(o&&l.params.add(u),f[u])}),data:i?.data??null,url:kt(n,()=>{o&&(l.url=!0)},f=>{o&&l.search_params.add(f)},w.hash),async fetch(f,u){f instanceof Request&&(u={body:f.method==="GET"||f.method==="HEAD"?void 0:await f.blob(),cache:f.cache,credentials:f.credentials,headers:[...f.headers].length>0?f?.headers:void 0,integrity:f.integrity,keepalive:f.keepalive,method:f.method,mode:f.mode,redirect:f.redirect,referrer:f.referrer,referrerPolicy:f.referrerPolicy,signal:f.signal,...u});const{resolved:h,promise:v}=ht(f,u,n);return o&&d(h.href),v},setHeaders:()=>{},depends:d,parent(){return o&&(l.parent=!0),t()},untrack(f){o=!1;try{return f()}finally{o=!0}}};s=await c.universal.load.call(null,p)??null}return{node:c,loader:e,server:i,universal:c.universal?.load?{type:"data",data:s,uses:l}:null,data:s??i?.data??null,slash:c.universal?.trailingSlash??i?.slash}}function ht(e,t,n){let r=e instanceof Request?e.url:e;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const i=le?Lt(r,a.href,t):xt(r,t);return{resolved:a,promise:i}}function Jt(e,t,n,r,a,i){if(Q)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const s of a.search_params)if(r.has(s))return!0;for(const s of a.params)if(i[s]!==_.params[s])return!0;for(const s of a.dependencies)if(oe.some(o=>o(new URL(s))))return!0;return!1}function qe(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function Yt(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),i=t.searchParams.getAll(r);a.every(s=>i.includes(s))&&i.every(s=>a.includes(s))&&n.delete(r)}return n}function zt({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:Ke(b),constructors:[]}}}async function Ve({id:e,invalidating:t,url:n,params:r,route:a,preload:i}){if(L?.id===e)return ce.delete(L.token),L.promise;const{errors:s,layouts:o,leaf:l}=a,c=[...o,l];s.forEach(m=>m?.().catch(()=>{})),c.forEach(m=>m?.[1]().catch(()=>{}));const d=_.url?e!==de(_.url):!1,p=_.route?a.id!==_.route.id:!1,f=Yt(_.url,n);let u=!1;const h=c.map(async(m,g)=>{if(!m)return;const E=_.branch[g];return m[1]===E?.loader&&!Jt(u,p,d,f,E.universal?.uses,r)?E:(u=!0,De({loader:m[1],url:n,params:r,route:a,parent:async()=>{const O={};for(let C=0;C<g;C+=1)Object.assign(O,(await h[C])?.data);return O},server_data_node:qe(m[0]?{type:"skip"}:null,m[0]?E?.server:void 0)}))});for(const m of h)m.catch(()=>{});const v=[];for(let m=0;m<c.length;m+=1)if(c[m])try{v.push(await h[m])}catch(g){if(g instanceof Ue)return{type:"redirect",location:g.location};if(ce.has(i))return zt({error:await X(g,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let E=Oe(g),S;if(g instanceof Ae)S=g.body;else{if(await $.updated.check())return await st(),await Y(n);S=await X(g,{params:r,url:n,route:{id:a.id}})}const O=await Xt(m,v,s);return O?fe({url:n,params:r,branch:v.slice(0,O.idx).concat(O.node),status:E,error:S,route:a}):await gt(n,{id:a.id},S,E)}else v.push(void 0);return fe({url:n,params:r,branch:v,status:200,error:null,route:a,form:t?void 0:null})}async function Xt(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)r-=1;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function Be({status:e,error:t,url:n,route:r}){const a={};let i=null;try{const s=await De({loader:Ee,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:qe(i)}),o={node:await ae(),loader:ae,universal:null,server:null,data:null};return fe({url:n,params:a,branch:[s,o],status:e,error:t,route:null})}catch(s){if(s instanceof Ue)return Ne(new URL(s.location,location.href),{},0);throw s}}async function Qt(e){const t=e.href;if(te.has(t))return te.get(t);let n;try{const r=(async()=>{let a=await w.hooks.reroute({url:new URL(e),fetch:async(i,s)=>ht(i,s,e).promise})??e;if(typeof a=="string"){const i=new URL(e);w.hash?i.hash=a:i.pathname=a,a=i}return a})();te.set(t,r),n=await r}catch{te.delete(t);return}return n}async function Z(e,t){if(e&&!pe(e,x,w.hash)){const n=await Qt(e);if(!n)return;const r=Zt(n);for(const a of $e){const i=a.exec(r);if(i)return{id:de(e),invalidating:t,route:a,params:bt(i),url:e}}}}function Zt(e){return yt(w.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(x.length))||"/"}function de(e){return(w.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function pt({url:e,type:t,intent:n,delta:r,event:a,scroll:i}){let s=!1;const o=Fe(_,n,e,t,i??null);r!==void 0&&(o.navigation.delta=r),a!==void 0&&(o.navigation.event=a);const l={...o.navigation,cancel:()=>{s=!0,o.reject(new Error("navigation cancelled"))}};return z||it.forEach(c=>c(l)),s?null:o}async function F({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:i,state:s={},redirect_count:o=0,nav_token:l={},accept:c=ke,block:d=ke,event:p}){const f=I;I=l;const u=await Z(t,!1),h=e==="enter"?Fe(_,u,t,e):pt({url:t,type:e,delta:n?.delta,intent:u,scroll:n?.scroll,event:p});if(!h){d(),I===l&&(I=f);return}const v=y,m=R;c(),z=!0,le&&h.navigation.type!=="enter"&&$.navigating.set(W.current=h.navigation);let g=u&&await Ve(u);if(!g){if(pe(t,x,w.hash))return await Y(t,i);g=await gt(t,{id:null},await X(new Pe(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,i)}if(t=u?.url||t,I!==l)return h.reject(new Error("navigation aborted")),!1;if(g.type==="redirect"){if(o<20){await F({type:e,url:new URL(g.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:i,state:s,redirect_count:o+1,nav_token:l}),h.fulfil(void 0);return}g=await Be({status:500,error:await X(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else g.props.page.status>=400&&await $.updated.check()&&(await st(),await Y(t,i));if(Re(),Ce(v),ut(m),g.props.page.url.pathname!==t.pathname&&(t.pathname=g.props.page.url.pathname),s=n?n.state:s,!n){const k=i?0:1,ee={[B]:y+=k,[H]:R+=k,[et]:s};(i?history.replaceState:history.pushState).call(history,ee,"",t),i||Gt(y,R)}const E=u&&L?.id===u.id?L.fork:null;L=null,g.props.page.state=s;let S;if(le){const k=(await Promise.all(Array.from(Mt,q=>q(h.navigation)))).filter(q=>typeof q=="function");if(k.length>0){let q=function(){k.forEach(ge=>{M.delete(ge)})};k.push(q),k.forEach(ge=>{M.add(ge)})}_=g.state,g.props.page&&(g.props.page.url=t);const ee=E&&await E;ee?S=ee.commit():(je.$set(g.props),ot(g.props.page),S=vt?.()),ct=!0}else await dt(g,Se,!1);const{activeElement:O}=document;await S,await ne(),await ne();let C=null;if(Ye){const k=n?n.scroll:a?D():null;k?scrollTo(k.x,k.y):(C=t.hash&&document.getElementById(mt(t)))?C.scrollIntoView():scrollTo(0,0)}const _t=document.activeElement!==O&&document.activeElement!==document.body;!r&&!_t&&on(t,!C),Ye=!0,g.props.page&&Object.assign(b,g.props.page),z=!1,e==="popstate"&&ft(R),h.fulfil(void 0),h.navigation.to&&(h.navigation.to.scroll=D()),M.forEach(k=>k(h.navigation)),$.navigating.set(W.current=null)}async function gt(e,t,n,r,a){return e.origin===he&&e.pathname===location.pathname&&!lt?await Be({status:r,error:n,url:e,route:t}):await Y(e,a)}function en(){let e,t={element:void 0,href:void 0},n;T.addEventListener("mousemove",o=>{const l=o.target;clearTimeout(e),e=setTimeout(()=>{i(l,N.hover)},20)});function r(o){o.defaultPrevented||i(o.composedPath()[0],N.tap)}T.addEventListener("mousedown",r),T.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(o=>{for(const l of o)l.isIntersecting&&(ye(new URL(l.target.href)),a.unobserve(l.target))},{threshold:0});async function i(o,l){const c=nt(o,T),d=c===t.element&&c?.href===t.href&&l>=n;if(!c||d)return;const{url:p,external:f,download:u}=be(c,x,w.hash);if(f||u)return;const h=re(c),v=p&&de(_.url)===de(p);if(!(h.reload||v))if(l<=h.preload_data){t={element:c,href:c.href},n=N.tap;const m=await Z(p,!1);if(!m)return;Wt(m)}else l<=h.preload_code&&(t={element:c,href:c.href},n=l,ye(p))}function s(){a.disconnect();for(const o of T.querySelectorAll("a")){const{url:l,external:c,download:d}=be(o,x,w.hash);if(c||d)continue;const p=re(o);p.reload||(p.preload_code===N.viewport&&a.observe(o),p.preload_code===N.eager&&ye(l))}}M.add(s),s()}function X(e,t){if(e instanceof Ae)return e.body;const n=Oe(e),r=Vt(e);return w.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function pn(e,t={}){return e=new URL(Ie(e)),e.origin!==he?Promise.reject(new Error("goto: invalid URL")):Ne(e,t,0)}function tn(e){if(typeof e=="function")oe.push(e);else{const{href:t}=new URL(e,location.href);oe.push(n=>n.href===t)}}function gn(){return Q=!0,Ht()}function nn(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(ze(),!z){const r=Fe(_,void 0,null,"leave"),a={...r.navigation,cancel:()=>{n=!0,r.reject(new Error("navigation cancelled"))}};it.forEach(i=>i(a))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&ze()}),navigator.connection?.saveData||en(),T.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=nt(t.composedPath()[0],T);if(!n)return;const{url:r,external:a,target:i,download:s}=be(n,x,w.hash);if(!r)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const o=re(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||s)return;const[c,d]=(w.hash?r.hash.replace(/^#/,""):r.href).split("#"),p=c===me(location);if(a||o.reload&&(!p||!d)){pt({url:r,type:"link",event:t})?z=!0:t.preventDefault();return}if(d!==void 0&&p){const[,f]=_.url.href.split("#");if(f===d){if(t.preventDefault(),d===""||d==="top"&&n.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const u=n.ownerDocument.getElementById(decodeURIComponent(d));u&&(u.scrollIntoView(),u.focus())}return}if(K=!0,Ce(y),e(r),!o.replace_state)return;K=!1}t.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await F({type:"link",url:r,keepfocus:o.keepfocus,noscroll:o.noscroll,replace_state:o.replace_state??r.href===location.href,event:t})}),T.addEventListener("submit",t=>{if(t.defaultPrevented)return;const n=HTMLFormElement.prototype.cloneNode.call(t.target),r=t.submitter;if((r?.formTarget||n.target)==="_blank"||(r?.formMethod||n.method)!=="get")return;const s=new URL(r?.hasAttribute("formaction")&&r?.formAction||n.action);if(pe(s,x,!1))return;const o=t.target,l=re(o);if(l.reload)return;t.preventDefault(),t.stopPropagation();const c=new FormData(o,r);s.search=new URLSearchParams(c).toString(),F({type:"form",url:s,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??s.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!xe){if(t.state?.[B]){const n=t.state[B];if(I={},n===y)return;const r=j[n],a=t.state[et]??{},i=new URL(t.state[jt]??location.href),s=t.state[H],o=_.url?me(location)===me(_.url):!1;if(s===R&&(ct||o)){a!==b.state&&(b.state=a),e(i),j[y]=D(),r&&scrollTo(r.x,r.y),y=n;return}const c=n-y;await F({type:"popstate",url:i,popped:{state:a,scroll:r,delta:c},accept:()=>{y=n,R=s},block:()=>{history.go(-c)},nav_token:I,event:t})}else if(!K){const n=new URL(location.href);e(n),w.hash&&location.reload()}}}),addEventListener("hashchange",()=>{K&&(K=!1,history.replaceState({...history.state,[B]:++y,[H]:R},"",location.href))});for(const t of document.querySelectorAll("link"))Kt.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&$.navigating.set(W.current=null)});function e(t){_.url=b.url=t,$.page.set(Ke(b)),$.page.notify()}}async function rn(e,{status:t=200,error:n,node_ids:r,params:a,route:i,server_route:s,data:o,form:l}){lt=!0;const c=new URL(location.href);let d;({params:a={},route:i={id:null}}=await Z(c,!1)||{}),d=$e.find(({id:u})=>u===i.id);let p,f=!0;try{const u=r.map(async(v,m)=>{const g=o[m];return g?.uses&&(g.uses=an(g.uses)),De({loader:w.nodes[v],url:c,params:a,route:i,parent:async()=>{const E={};for(let S=0;S<m;S+=1)Object.assign(E,(await u[S]).data);return E},server_data_node:qe(g)})}),h=await Promise.all(u);if(d){const v=d.layouts;for(let m=0;m<v.length;m++)v[m]||h.splice(m,0,void 0)}p=fe({url:c,params:a,branch:h,status:t,error:n,form:l,route:d??null})}catch(u){if(u instanceof Ue){await Y(new URL(u.location,location.href));return}p=await Be({status:Oe(u),error:await X(u,{url:c,params:a,route:i}),url:c,route:i}),e.textContent="",f=!1}p.props.page&&(p.props.page.state={}),await dt(p,e,f)}function an(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}let xe=!1;function on(e,t=!0){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=mt(e);if(r&&document.getElementById(r)){const{x:i,y:s}=D();setTimeout(()=>{const o=history.state;xe=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(o,"",e),t&&scrollTo(i,s),xe=!1})}else{const i=document.body,s=i.getAttribute("tabindex");i.tabIndex=-1,i.focus({preventScroll:!0,focusVisible:!1}),s!==null?i.setAttribute("tabindex",s):i.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const i=[];for(let s=0;s<a.rangeCount;s+=1)i.push(a.getRangeAt(s));setTimeout(()=>{if(a.rangeCount===i.length){for(let s=0;s<a.rangeCount;s+=1){const o=i[s],l=a.getRangeAt(s);if(o.commonAncestorContainer!==l.commonAncestorContainer||o.startContainer!==l.startContainer||o.endContainer!==l.endContainer||o.startOffset!==l.startOffset||o.endOffset!==l.endOffset)return}a.removeAllRanges()}})}}}function Fe(e,t,n,r,a=null){let i,s;const o=new Promise((c,d)=>{i=c,s=d});return o.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:D()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:a},willUnload:!t,type:r,complete:o},fulfil:i,reject:s}}function Ke(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function sn(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function mt(e){let t;if(w.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{hn as a,pn as g,gn as i,cn as l,b as p,$ as s};
1
+ import{bB as Le,aE as Ge,e as A,g as U,s as P,aF as ne,bC as vt}from"./CT6oIU-C.js";class Ae{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Ue{constructor(t,n){this.status=t,this.location=n}}class Pe extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function wt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function yt(e){return e.split("%25").map(decodeURI).join("%25")}function bt(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function me({href:e}){return e.split("#")[0]}function kt(e,t,n,r=!1){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(s,o){if(o==="get"||o==="getAll"||o==="has")return(c,...d)=>(n(c),s[o](c,...d));t();const l=Reflect.get(s,o);return typeof l=="function"?l.bind(s):l}}),enumerable:!0,configurable:!0});const i=["href","pathname","search","toString","toJSON"];r&&i.push("hash");for(const s of i)Object.defineProperty(a,s,{get(){return t(),e[s]},enumerable:!0,configurable:!0});return a}function Et(...e){let t=5381;for(const n of e)if(typeof n=="string"){let r=n.length;for(;r;)t=t*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)t=t*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;new TextDecoder;function St(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const Rt=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&G.delete(Te(e)),Rt(e,t));const G=new Map;function xt(e,t){const n=Te(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:a,...i}=JSON.parse(r.textContent);const s=r.getAttribute("data-ttl");return s&&G.set(n,{body:a,init:i,ttl:1e3*Number(s)}),r.getAttribute("data-b64")!==null&&(a=St(a)),Promise.resolve(new Response(a,i))}return window.fetch(e,t)}function Lt(e,t,n){if(G.size>0){const r=Te(e,n),a=G.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(n?.cache))return new Response(a.body,a.init);G.delete(r)}}return window.fetch(t,n)}function Te(e,t){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){const a=[];t.headers&&a.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&a.push(t.body),r+=`[data-hash="${Et(...a)}"]`}return r}const At=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Ut(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${Tt(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const i=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(i)return t.push({name:i[1],matcher:i[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const s=r.split(/\[(.+?)\](?!\])/);return"/"+s.map((l,c)=>{if(c%2){if(l.startsWith("x+"))return _e(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return _e(String.fromCharCode(...l.slice(2).split("-").map(v=>parseInt(v,16))));const d=At.exec(l),[,p,f,u,h]=d;return t.push({name:u,matcher:h,optional:!!p,rest:!!f,chained:f?c===1&&s[0]==="":!1}),f?"([^]*?)":p?"([^/]*)?":"([^/]+?)"}return _e(l)}).join("")}).join("")}/?$`),params:t}}function Pt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function Tt(e){return e.slice(1).split("/").filter(Pt)}function It(e,t,n){const r={},a=e.slice(1),i=a.filter(o=>o!==void 0);let s=0;for(let o=0;o<t.length;o+=1){const l=t[o];let c=a[o-s];if(l.chained&&l.rest&&s&&(c=a.slice(o-s,o+1).filter(d=>d).join("/"),s=0),c===void 0)if(l.rest)c="";else continue;if(!l.matcher||n[l.matcher](c)){r[l.name]=c;const d=t[o+1],p=a[o+1];d&&!d.rest&&d.optional&&p&&l.chained&&(s=0),!d&&!p&&Object.keys(r).length===i.length&&(s=0);continue}if(l.optional&&l.chained){s++;continue}return}if(!s)return r}function _e(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Ot({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([o,[l,c,d]])=>{const{pattern:p,params:f}=Ut(o),u={id:o,exec:h=>{const v=p.exec(h);if(v)return It(v,f,r)},errors:[1,...d||[]].map(h=>e[h]),layouts:[0,...c||[]].map(s),leaf:i(l)};return u.errors.length=u.layouts.length=Math.max(u.errors.length,u.layouts.length),u});function i(o){const l=o<0;return l&&(o=~o),[l,e[o]]}function s(o){return o===void 0?o:[a.has(o),e[o]]}}function Xe(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function Me(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const x=globalThis.__sveltekit_1m9okky?.base??"",Ct=globalThis.__sveltekit_1m9okky?.assets??x??"",$t="1775142963932",Qe="sveltekit:snapshot",Ze="sveltekit:scroll",et="sveltekit:states",jt="sveltekit:pageurl",B="sveltekit:history",H="sveltekit:navigation",N={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},he=location.origin;function Ie(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function D(){return{x:pageXOffset,y:pageYOffset}}function V(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const He={...N,"":N.hover};function tt(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function nt(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=tt(e)}}function be(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const o=location.hash.split("#")[1]||"/";r.hash=`#${o}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,i=!r||!!a||pe(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),s=r?.origin===he&&e.hasAttribute("download");return{url:r,external:i,target:a,download:s}}function re(e){let t=null,n=null,r=null,a=null,i=null,s=null,o=e;for(;o&&o!==document.documentElement;)r===null&&(r=V(o,"preload-code")),a===null&&(a=V(o,"preload-data")),t===null&&(t=V(o,"keepfocus")),n===null&&(n=V(o,"noscroll")),i===null&&(i=V(o,"reload")),s===null&&(s=V(o,"replacestate")),o=tt(o);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:He[r??"off"],preload_data:He[a??"off"],keepfocus:l(t),noscroll:l(n),reload:l(i),replace_state:l(s)}}function We(e){const t=Le(e);let n=!0;function r(){n=!0,t.update(s=>s)}function a(s){n=!1,t.set(s)}function i(s){let o;return t.subscribe(l=>{(o===void 0||n&&l!==o)&&s(o=l)})}return{notify:r,set:a,subscribe:i}}const rt={v:()=>{}};function Nt(){const{set:e,subscribe:t}=Le(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Ct}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const s=(await a.json()).version!==$t;return s&&(e(!0),rt.v(),clearTimeout(n)),s}catch{return!1}}return{subscribe:t,check:r}}function pe(e,t,n){return e.origin!==he||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function cn(e){}const at=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...at];const Dt=new Set([...at]);[...Dt];function qt(e){return e.filter(t=>t!=null)}function Oe(e){return e instanceof Ae||e instanceof Pe?e.status:500}function Vt(e){return e instanceof Pe?e.text:"Internal Error"}let b,W,ve;const Bt=Ge.toString().includes("$$")||/function \w+\(\) \{\}/.test(Ge.toString());Bt?(b={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},W={current:null},ve={current:!1}):(b=new class{#e=A({});get data(){return U(this.#e)}set data(t){P(this.#e,t)}#t=A(null);get form(){return U(this.#t)}set form(t){P(this.#t,t)}#n=A(null);get error(){return U(this.#n)}set error(t){P(this.#n,t)}#r=A({});get params(){return U(this.#r)}set params(t){P(this.#r,t)}#a=A({id:null});get route(){return U(this.#a)}set route(t){P(this.#a,t)}#o=A({});get state(){return U(this.#o)}set state(t){P(this.#o,t)}#s=A(-1);get status(){return U(this.#s)}set status(t){P(this.#s,t)}#i=A(new URL("https://example.com"));get url(){return U(this.#i)}set url(t){P(this.#i,t)}},W=new class{#e=A(null);get current(){return U(this.#e)}set current(t){P(this.#e,t)}},ve=new class{#e=A(!1);get current(){return U(this.#e)}set current(t){P(this.#e,t)}},rt.v=()=>ve.current=!0);function ot(e){Object.assign(b,e)}const Je={spanContext(){return Ft},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},Ft={traceId:"",spanId:"",traceFlags:0},Kt=new Set(["icon","shortcut icon","apple-touch-icon"]),j=Xe(Ze)??{},J=Xe(Qe)??{},$={url:We({}),page:We({}),navigating:Le(null),updated:Nt()};function Ce(e){j[e]=D()}function Gt(e,t){let n=e+1;for(;j[n];)delete j[n],n+=1;for(n=t+1;J[n];)delete J[n],n+=1}function Y(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function st(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(x||"/");e&&await e.update()}}function ke(){}let $e,Ee,ae,T,Se,w;const oe=[],se=[];let L=null;function ie(){L?.fork?.then(e=>e?.discard()),L=null}const te=new Map,it=new Set,Mt=new Set,M=new Set;let _={branch:[],error:null,url:null},lt=!1,le=!1,Ye=!0,z=!1,K=!1,ct=!1,Q=!1,je,y,R,I;const ce=new Set;let we;const ue=new Map;async function hn(e,t,n){globalThis.__sveltekit_1m9okky?.data&&globalThis.__sveltekit_1m9okky.data,document.URL!==location.href&&(location.href=location.href),w=e,await e.hooks.init?.(),$e=Ot(e),T=document.documentElement,Se=t,Ee=e.nodes[0],ae=e.nodes[1],Ee(),ae(),y=history.state?.[B],R=history.state?.[H],y||(y=R=Date.now(),history.replaceState({...history.state,[B]:y,[H]:R},""));const r=j[y];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await rn(Se,n)):(await F({type:"enter",url:Ie(w.hash?sn(new URL(location.href)):location.href),replace_state:!0}),a()),nn()}async function Ht(e=!0,t=!0){if(await(we||=Promise.resolve()),!we)return;we=null;const n=I={},r=await Z(_.url,!0);if(ie(),Q&&ue.forEach(({resource:a})=>{a.refresh?.()}),e){const a=b.state,i=r&&await Ve(r);if(!i||n!==I)return;if(i.type==="redirect")return Ne(new URL(i.location,_.url).href,{replaceState:!0},1,n);t||(i.props.page.state=a),ot(i.props.page),_=i.state,Re(),je.$set(i.props)}else Re();await Promise.all([...ue.values()].map(({resource:a})=>a)).catch(ke)}function Re(){oe.length=0,Q=!1}function ut(e){se.some(t=>t?.snapshot)&&(J[e]=se.map(t=>t?.snapshot?.capture()))}function ft(e){J[e]?.forEach((t,n)=>{se[n]?.snapshot?.restore(t)})}function ze(){Ce(y),Me(Ze,j),ut(R),Me(Qe,J)}async function Ne(e,t,n,r){let a;t.invalidateAll&&ie(),await F({type:"goto",url:Ie(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(Q=!0,a=[...ue.keys()]),t.invalidate&&t.invalidate.forEach(tn)}}),t.invalidateAll&&ne().then(ne).then(()=>{ue.forEach(({resource:i},s)=>{a?.includes(s)&&i.refresh?.()})})}async function Wt(e){if(e.id!==L?.id){ie();const t={};ce.add(t),L={id:e.id,token:t,promise:Ve({...e,preload:t}).then(n=>(ce.delete(t),n.type==="loaded"&&n.state.error&&ie(),n)),fork:null}}return L.promise}async function ye(e){const t=(await Z(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(n=>n[1]()))}async function dt(e,t,n){_=e.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(b,e.props.page),je=new w.root({target:t,props:{...e.props,stores:$,components:se},hydrate:n,sync:!1}),await Promise.resolve(),ft(R),n){const a={from:null,to:{params:_.params,route:{id:_.route?.id??null},url:new URL(location.href),scroll:j[y]??D()},willUnload:!1,type:"enter",complete:Promise.resolve()};M.forEach(i=>i(a))}le=!0}function fe({url:e,params:t,branch:n,status:r,error:a,route:i,form:s}){let o="never";if(x&&(e.pathname===x||e.pathname===x+"/"))o="always";else for(const u of n)u?.slash!==void 0&&(o=u.slash);e.pathname=wt(e.pathname,o),e.search=e.search;const l={type:"loaded",state:{url:e,params:t,branch:n,error:a,route:i},props:{constructors:qt(n).map(u=>u.node.component),page:Ke(b)}};s!==void 0&&(l.props.form=s);let c={},d=!b,p=0;for(let u=0;u<Math.max(n.length,_.branch.length);u+=1){const h=n[u],v=_.branch[u];h?.data!==v?.data&&(d=!0),h&&(c={...c,...h.data},d&&(l.props[`data_${p}`]=c),p+=1)}return(!_.url||e.href!==_.url.href||_.error!==a||s!==void 0&&s!==b.form||d)&&(l.props.page={error:a,params:t,route:{id:i?.id??null},state:{},status:r,url:new URL(e),form:s??null,data:d?c:b.data}),l}async function De({loader:e,parent:t,url:n,params:r,route:a,server_data_node:i}){let s=null,o=!0;const l={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},c=await e();if(c.universal?.load){let d=function(...f){for(const u of f){const{href:h}=new URL(u,n);l.dependencies.add(h)}};const p={tracing:{enabled:!1,root:Je,current:Je},route:new Proxy(a,{get:(f,u)=>(o&&(l.route=!0),f[u])}),params:new Proxy(r,{get:(f,u)=>(o&&l.params.add(u),f[u])}),data:i?.data??null,url:kt(n,()=>{o&&(l.url=!0)},f=>{o&&l.search_params.add(f)},w.hash),async fetch(f,u){f instanceof Request&&(u={body:f.method==="GET"||f.method==="HEAD"?void 0:await f.blob(),cache:f.cache,credentials:f.credentials,headers:[...f.headers].length>0?f?.headers:void 0,integrity:f.integrity,keepalive:f.keepalive,method:f.method,mode:f.mode,redirect:f.redirect,referrer:f.referrer,referrerPolicy:f.referrerPolicy,signal:f.signal,...u});const{resolved:h,promise:v}=ht(f,u,n);return o&&d(h.href),v},setHeaders:()=>{},depends:d,parent(){return o&&(l.parent=!0),t()},untrack(f){o=!1;try{return f()}finally{o=!0}}};s=await c.universal.load.call(null,p)??null}return{node:c,loader:e,server:i,universal:c.universal?.load?{type:"data",data:s,uses:l}:null,data:s??i?.data??null,slash:c.universal?.trailingSlash??i?.slash}}function ht(e,t,n){let r=e instanceof Request?e.url:e;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const i=le?Lt(r,a.href,t):xt(r,t);return{resolved:a,promise:i}}function Jt(e,t,n,r,a,i){if(Q)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const s of a.search_params)if(r.has(s))return!0;for(const s of a.params)if(i[s]!==_.params[s])return!0;for(const s of a.dependencies)if(oe.some(o=>o(new URL(s))))return!0;return!1}function qe(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function Yt(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),i=t.searchParams.getAll(r);a.every(s=>i.includes(s))&&i.every(s=>a.includes(s))&&n.delete(r)}return n}function zt({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:Ke(b),constructors:[]}}}async function Ve({id:e,invalidating:t,url:n,params:r,route:a,preload:i}){if(L?.id===e)return ce.delete(L.token),L.promise;const{errors:s,layouts:o,leaf:l}=a,c=[...o,l];s.forEach(m=>m?.().catch(()=>{})),c.forEach(m=>m?.[1]().catch(()=>{}));const d=_.url?e!==de(_.url):!1,p=_.route?a.id!==_.route.id:!1,f=Yt(_.url,n);let u=!1;const h=c.map(async(m,g)=>{if(!m)return;const E=_.branch[g];return m[1]===E?.loader&&!Jt(u,p,d,f,E.universal?.uses,r)?E:(u=!0,De({loader:m[1],url:n,params:r,route:a,parent:async()=>{const O={};for(let C=0;C<g;C+=1)Object.assign(O,(await h[C])?.data);return O},server_data_node:qe(m[0]?{type:"skip"}:null,m[0]?E?.server:void 0)}))});for(const m of h)m.catch(()=>{});const v=[];for(let m=0;m<c.length;m+=1)if(c[m])try{v.push(await h[m])}catch(g){if(g instanceof Ue)return{type:"redirect",location:g.location};if(ce.has(i))return zt({error:await X(g,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let E=Oe(g),S;if(g instanceof Ae)S=g.body;else{if(await $.updated.check())return await st(),await Y(n);S=await X(g,{params:r,url:n,route:{id:a.id}})}const O=await Xt(m,v,s);return O?fe({url:n,params:r,branch:v.slice(0,O.idx).concat(O.node),status:E,error:S,route:a}):await gt(n,{id:a.id},S,E)}else v.push(void 0);return fe({url:n,params:r,branch:v,status:200,error:null,route:a,form:t?void 0:null})}async function Xt(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)r-=1;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function Be({status:e,error:t,url:n,route:r}){const a={};let i=null;try{const s=await De({loader:Ee,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:qe(i)}),o={node:await ae(),loader:ae,universal:null,server:null,data:null};return fe({url:n,params:a,branch:[s,o],status:e,error:t,route:null})}catch(s){if(s instanceof Ue)return Ne(new URL(s.location,location.href),{},0);throw s}}async function Qt(e){const t=e.href;if(te.has(t))return te.get(t);let n;try{const r=(async()=>{let a=await w.hooks.reroute({url:new URL(e),fetch:async(i,s)=>ht(i,s,e).promise})??e;if(typeof a=="string"){const i=new URL(e);w.hash?i.hash=a:i.pathname=a,a=i}return a})();te.set(t,r),n=await r}catch{te.delete(t);return}return n}async function Z(e,t){if(e&&!pe(e,x,w.hash)){const n=await Qt(e);if(!n)return;const r=Zt(n);for(const a of $e){const i=a.exec(r);if(i)return{id:de(e),invalidating:t,route:a,params:bt(i),url:e}}}}function Zt(e){return yt(w.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(x.length))||"/"}function de(e){return(w.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function pt({url:e,type:t,intent:n,delta:r,event:a,scroll:i}){let s=!1;const o=Fe(_,n,e,t,i??null);r!==void 0&&(o.navigation.delta=r),a!==void 0&&(o.navigation.event=a);const l={...o.navigation,cancel:()=>{s=!0,o.reject(new Error("navigation cancelled"))}};return z||it.forEach(c=>c(l)),s?null:o}async function F({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:i,state:s={},redirect_count:o=0,nav_token:l={},accept:c=ke,block:d=ke,event:p}){const f=I;I=l;const u=await Z(t,!1),h=e==="enter"?Fe(_,u,t,e):pt({url:t,type:e,delta:n?.delta,intent:u,scroll:n?.scroll,event:p});if(!h){d(),I===l&&(I=f);return}const v=y,m=R;c(),z=!0,le&&h.navigation.type!=="enter"&&$.navigating.set(W.current=h.navigation);let g=u&&await Ve(u);if(!g){if(pe(t,x,w.hash))return await Y(t,i);g=await gt(t,{id:null},await X(new Pe(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,i)}if(t=u?.url||t,I!==l)return h.reject(new Error("navigation aborted")),!1;if(g.type==="redirect"){if(o<20){await F({type:e,url:new URL(g.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:i,state:s,redirect_count:o+1,nav_token:l}),h.fulfil(void 0);return}g=await Be({status:500,error:await X(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else g.props.page.status>=400&&await $.updated.check()&&(await st(),await Y(t,i));if(Re(),Ce(v),ut(m),g.props.page.url.pathname!==t.pathname&&(t.pathname=g.props.page.url.pathname),s=n?n.state:s,!n){const k=i?0:1,ee={[B]:y+=k,[H]:R+=k,[et]:s};(i?history.replaceState:history.pushState).call(history,ee,"",t),i||Gt(y,R)}const E=u&&L?.id===u.id?L.fork:null;L=null,g.props.page.state=s;let S;if(le){const k=(await Promise.all(Array.from(Mt,q=>q(h.navigation)))).filter(q=>typeof q=="function");if(k.length>0){let q=function(){k.forEach(ge=>{M.delete(ge)})};k.push(q),k.forEach(ge=>{M.add(ge)})}_=g.state,g.props.page&&(g.props.page.url=t);const ee=E&&await E;ee?S=ee.commit():(je.$set(g.props),ot(g.props.page),S=vt?.()),ct=!0}else await dt(g,Se,!1);const{activeElement:O}=document;await S,await ne(),await ne();let C=null;if(Ye){const k=n?n.scroll:a?D():null;k?scrollTo(k.x,k.y):(C=t.hash&&document.getElementById(mt(t)))?C.scrollIntoView():scrollTo(0,0)}const _t=document.activeElement!==O&&document.activeElement!==document.body;!r&&!_t&&on(t,!C),Ye=!0,g.props.page&&Object.assign(b,g.props.page),z=!1,e==="popstate"&&ft(R),h.fulfil(void 0),h.navigation.to&&(h.navigation.to.scroll=D()),M.forEach(k=>k(h.navigation)),$.navigating.set(W.current=null)}async function gt(e,t,n,r,a){return e.origin===he&&e.pathname===location.pathname&&!lt?await Be({status:r,error:n,url:e,route:t}):await Y(e,a)}function en(){let e,t={element:void 0,href:void 0},n;T.addEventListener("mousemove",o=>{const l=o.target;clearTimeout(e),e=setTimeout(()=>{i(l,N.hover)},20)});function r(o){o.defaultPrevented||i(o.composedPath()[0],N.tap)}T.addEventListener("mousedown",r),T.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(o=>{for(const l of o)l.isIntersecting&&(ye(new URL(l.target.href)),a.unobserve(l.target))},{threshold:0});async function i(o,l){const c=nt(o,T),d=c===t.element&&c?.href===t.href&&l>=n;if(!c||d)return;const{url:p,external:f,download:u}=be(c,x,w.hash);if(f||u)return;const h=re(c),v=p&&de(_.url)===de(p);if(!(h.reload||v))if(l<=h.preload_data){t={element:c,href:c.href},n=N.tap;const m=await Z(p,!1);if(!m)return;Wt(m)}else l<=h.preload_code&&(t={element:c,href:c.href},n=l,ye(p))}function s(){a.disconnect();for(const o of T.querySelectorAll("a")){const{url:l,external:c,download:d}=be(o,x,w.hash);if(c||d)continue;const p=re(o);p.reload||(p.preload_code===N.viewport&&a.observe(o),p.preload_code===N.eager&&ye(l))}}M.add(s),s()}function X(e,t){if(e instanceof Ae)return e.body;const n=Oe(e),r=Vt(e);return w.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function pn(e,t={}){return e=new URL(Ie(e)),e.origin!==he?Promise.reject(new Error("goto: invalid URL")):Ne(e,t,0)}function tn(e){if(typeof e=="function")oe.push(e);else{const{href:t}=new URL(e,location.href);oe.push(n=>n.href===t)}}function gn(){return Q=!0,Ht()}function nn(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(ze(),!z){const r=Fe(_,void 0,null,"leave"),a={...r.navigation,cancel:()=>{n=!0,r.reject(new Error("navigation cancelled"))}};it.forEach(i=>i(a))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&ze()}),navigator.connection?.saveData||en(),T.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=nt(t.composedPath()[0],T);if(!n)return;const{url:r,external:a,target:i,download:s}=be(n,x,w.hash);if(!r)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const o=re(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||s)return;const[c,d]=(w.hash?r.hash.replace(/^#/,""):r.href).split("#"),p=c===me(location);if(a||o.reload&&(!p||!d)){pt({url:r,type:"link",event:t})?z=!0:t.preventDefault();return}if(d!==void 0&&p){const[,f]=_.url.href.split("#");if(f===d){if(t.preventDefault(),d===""||d==="top"&&n.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const u=n.ownerDocument.getElementById(decodeURIComponent(d));u&&(u.scrollIntoView(),u.focus())}return}if(K=!0,Ce(y),e(r),!o.replace_state)return;K=!1}t.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await F({type:"link",url:r,keepfocus:o.keepfocus,noscroll:o.noscroll,replace_state:o.replace_state??r.href===location.href,event:t})}),T.addEventListener("submit",t=>{if(t.defaultPrevented)return;const n=HTMLFormElement.prototype.cloneNode.call(t.target),r=t.submitter;if((r?.formTarget||n.target)==="_blank"||(r?.formMethod||n.method)!=="get")return;const s=new URL(r?.hasAttribute("formaction")&&r?.formAction||n.action);if(pe(s,x,!1))return;const o=t.target,l=re(o);if(l.reload)return;t.preventDefault(),t.stopPropagation();const c=new FormData(o,r);s.search=new URLSearchParams(c).toString(),F({type:"form",url:s,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??s.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!xe){if(t.state?.[B]){const n=t.state[B];if(I={},n===y)return;const r=j[n],a=t.state[et]??{},i=new URL(t.state[jt]??location.href),s=t.state[H],o=_.url?me(location)===me(_.url):!1;if(s===R&&(ct||o)){a!==b.state&&(b.state=a),e(i),j[y]=D(),r&&scrollTo(r.x,r.y),y=n;return}const c=n-y;await F({type:"popstate",url:i,popped:{state:a,scroll:r,delta:c},accept:()=>{y=n,R=s},block:()=>{history.go(-c)},nav_token:I,event:t})}else if(!K){const n=new URL(location.href);e(n),w.hash&&location.reload()}}}),addEventListener("hashchange",()=>{K&&(K=!1,history.replaceState({...history.state,[B]:++y,[H]:R},"",location.href))});for(const t of document.querySelectorAll("link"))Kt.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&$.navigating.set(W.current=null)});function e(t){_.url=b.url=t,$.page.set(Ke(b)),$.page.notify()}}async function rn(e,{status:t=200,error:n,node_ids:r,params:a,route:i,server_route:s,data:o,form:l}){lt=!0;const c=new URL(location.href);let d;({params:a={},route:i={id:null}}=await Z(c,!1)||{}),d=$e.find(({id:u})=>u===i.id);let p,f=!0;try{const u=r.map(async(v,m)=>{const g=o[m];return g?.uses&&(g.uses=an(g.uses)),De({loader:w.nodes[v],url:c,params:a,route:i,parent:async()=>{const E={};for(let S=0;S<m;S+=1)Object.assign(E,(await u[S]).data);return E},server_data_node:qe(g)})}),h=await Promise.all(u);if(d){const v=d.layouts;for(let m=0;m<v.length;m++)v[m]||h.splice(m,0,void 0)}p=fe({url:c,params:a,branch:h,status:t,error:n,form:l,route:d??null})}catch(u){if(u instanceof Ue){await Y(new URL(u.location,location.href));return}p=await Be({status:Oe(u),error:await X(u,{url:c,params:a,route:i}),url:c,route:i}),e.textContent="",f=!1}p.props.page&&(p.props.page.state={}),await dt(p,e,f)}function an(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}let xe=!1;function on(e,t=!0){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=mt(e);if(r&&document.getElementById(r)){const{x:i,y:s}=D();setTimeout(()=>{const o=history.state;xe=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(o,"",e),t&&scrollTo(i,s),xe=!1})}else{const i=document.body,s=i.getAttribute("tabindex");i.tabIndex=-1,i.focus({preventScroll:!0,focusVisible:!1}),s!==null?i.setAttribute("tabindex",s):i.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const i=[];for(let s=0;s<a.rangeCount;s+=1)i.push(a.getRangeAt(s));setTimeout(()=>{if(a.rangeCount===i.length){for(let s=0;s<a.rangeCount;s+=1){const o=i[s],l=a.getRangeAt(s);if(o.commonAncestorContainer!==l.commonAncestorContainer||o.startContainer!==l.startContainer||o.endContainer!==l.endContainer||o.startOffset!==l.startOffset||o.endOffset!==l.endOffset)return}a.removeAllRanges()}})}}}function Fe(e,t,n,r,a=null){let i,s;const o=new Promise((c,d)=>{i=c,s=d});return o.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:D()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:a},willUnload:!t,type:r,complete:o},fulfil:i,reject:s}}function Ke(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function sn(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function mt(e){let t;if(w.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{hn as a,pn as g,gn as i,cn as l,b as p,$ as s};