import{F as c,h as _,G as y,d as q,e as U,I as x,f as $,J as u,q as w,K as R,L as A,M as B,N as z,O,P as F,Q as M,R as G,T as X,c as H,U as J,V,W as K,X as Y,Y as Q,Z,p as ee,_ as N,g as m,$ as te,s as se,a0 as C,a1 as ie,E as ne,a2 as re,a3 as ae,a4 as oe,a5 as he,a6 as S,a7 as le,H as de,a8 as fe,a9 as k,i as g,aa as ue,ab as ce,ac as _e,ad as pe,x as ge,ae as ve,af as ye,A as me}from"./TwTPH6iZ.js";import{c as Ee,b as be,r as L,h as P,d as Te}from"./BfcgiW2_.js";var we=ne|re|ae;function Re(t,e,s){new Ae(t,e,s)}class Ae{parent;is_pending=!1;#t;#y=_?c:null;#i;#d;#n;#s=null;#e=null;#r=null;#a=null;#l=null;#f=0;#o=0;#c=!1;#u=!1;#_=new Set;#p=new Set;#h=null;#b=Ee(()=>(this.#h=he(this.#f),()=>{this.#h=null}));constructor(e,s,r){this.#t=e,this.#i=s,this.#d=r,this.parent=y.b,this.is_pending=!!this.#i.pending,this.#n=q(()=>{if(y.b=this,_){const i=this.#y;U(),i.nodeType===x&&i.data===$?this.#w():(this.#T(),this.#o===0&&(this.is_pending=!1))}else{var o=this.#m();try{this.#s=u(()=>r(o))}catch(i){this.error(i)}this.#o>0?this.#v():this.is_pending=!1}return()=>{this.#l?.remove()}},we),_&&(this.#t=c)}#T(){try{this.#s=u(()=>this.#d(this.#t))}catch(e){this.error(e)}}#w(){const e=this.#i.pending;e&&(this.#e=u(()=>e(this.#t)),w(()=>{var s=this.#m();this.#s=this.#g(()=>(R.ensure(),u(()=>this.#d(s)))),this.#o>0?this.#v():(A(this.#e,()=>{this.#e=null}),this.is_pending=!1)}))}#m(){var e=this.#t;return this.is_pending&&(this.#l=B(),this.#t.before(this.#l),e=this.#l),e}defer_effect(e){z(e,this.#_,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#i.pending}#g(e){var s=y,r=X,o=H;O(this.#n),F(this.#n),M(this.#n.ctx);try{return e()}catch(i){return G(i),null}finally{O(s),F(r),M(o)}}#v(){const e=this.#i.pending;this.#s!==null&&(this.#a=document.createDocumentFragment(),this.#a.append(this.#l),J(this.#s,this.#a)),this.#e===null&&(this.#e=u(()=>e(this.#t)))}#E(e){if(!this.has_pending_snippet()){this.parent&&this.parent.#E(e);return}if(this.#o+=e,this.#o===0){this.is_pending=!1;for(const s of this.#_)V(s,K),Y(s);for(const s of this.#p)V(s,Q),Y(s);this.#_.clear(),this.#p.clear(),this.#e&&A(this.#e,()=>{this.#e=null}),this.#a&&(this.#t.before(this.#a),this.#a=null)}}update_pending_count(e){this.#E(e),this.#f+=e,!(!this.#h||this.#c)&&(this.#c=!0,w(()=>{this.#c=!1,this.#h&&Z(this.#h,this.#f)}))}get_effect_pending(){return this.#b(),ee(this.#h)}error(e){var s=this.#i.onerror;let r=this.#i.failed;if(this.#u||!s&&!r)throw e;this.#s&&(N(this.#s),this.#s=null),this.#e&&(N(this.#e),this.#e=null),this.#r&&(N(this.#r),this.#r=null),_&&(m(this.#y),te(),m(se()));var o=!1,i=!1;const a=()=>{if(o){oe();return}o=!0,i&&ie(),R.ensure(),this.#f=0,this.#r!==null&&A(this.#r,()=>{this.#r=null}),this.is_pending=this.has_pending_snippet(),this.#s=this.#g(()=>(this.#u=!1,u(()=>this.#d(this.#t)))),this.#o>0?this.#v():this.is_pending=!1};w(()=>{try{i=!0,s?.(e,a),i=!1}catch(d){C(d,this.#n&&this.#n.parent)}r&&(this.#r=this.#g(()=>{R.ensure(),this.#u=!0;try{return u(()=>{r(this.#t,()=>e,()=>a)})}catch(d){return C(d,this.#n.parent),null}finally{this.#u=!1}}))})}}function Me(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const Ne=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Ve(t){return Ne.includes(t)}const Se={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function Ye(t){return t=t.toLowerCase(),Se[t]??t}const ke=["touchstart","touchmove"];function De(t){return ke.includes(t)}const xe=["textarea","script","style","title"];function Ce(t){return xe.includes(t)}function Le(t,e){var s=e==null?"":typeof e=="object"?e+"":e;s!==(t.__t??=t.nodeValue)&&(t.__t=s,t.nodeValue=s+"")}function Ie(t,e){return W(t,e)}function Pe(t,e){S(),e.intro=e.intro??!1;const s=e.target,r=_,o=c;try{for(var i=le(s);i&&(i.nodeType!==x||i.data!==de);)i=fe(i);if(!i)throw k;g(!0),m(i);const a=W(t,{...e,anchor:i});return g(!1),a}catch(a){if(a instanceof Error&&a.message.split(`
`).some(d=>d.startsWith("https://svelte.dev/e/")))throw a;return a!==k&&console.warn("Failed to hydrate: ",a),e.recover===!1&&ue(),S(),ce(s),g(!1),Ie(t,e)}finally{g(r),m(o)}}const v=new Map;function W(t,{target:e,anchor:s,props:r={},events:o,context:i,intro:a=!0}){S();var d=new Set,E=f=>{for(var h=0;h<f.length;h++){var n=f[h];if(!d.has(n)){d.add(n);var p=De(n);for(const T of[e,document]){var l=v.get(T);l===void 0&&(l=new Map,v.set(T,l));var I=l.get(n);I===void 0?(T.addEventListener(n,P,{passive:p}),l.set(n,1)):l.set(n,I+1)}}}};E(_e(be)),L.add(E);var b=void 0,j=pe(()=>{var f=s??e.appendChild(B());return Re(f,{pending:()=>{}},h=>{ge({});var n=H;if(i&&(n.c=i),o&&(r.$$events=o),_&&Te(h,null),b=t(h,r)||{},_&&(y.nodes.end=c,c===null||c.nodeType!==x||c.data!==ve))throw ye(),k;me()}),()=>{for(var h of d)for(const l of[e,document]){var n=v.get(l),p=n.get(h);--p==0?(l.removeEventListener(h,P),n.delete(h),n.size===0&&v.delete(l)):n.set(h,p)}L.delete(E),f!==s&&f.parentNode?.removeChild(f)}});return D.set(b,j),b}let D=new WeakMap;function Be(t,e){const s=D.get(t);return s?(D.delete(t),s(e)):Promise.resolve()}export{Me as a,Ve as c,Pe as h,Ce as i,Ie as m,Ye as n,Le as s,Be as u};
