import{S as D,o as O,ae as V,h,af as C,ab as T,Y as _,U as p,x as f,M as H,ag as R,ah as w,R as Y,Z as k,ai as M,aj as j,a7 as F,a1 as P,ak as $,v as B,p as Q,B as U,Q as W,c as Z}from"./CZBSCAq2.js";import{b as q,r as N,h as v}from"./DqKNatLn.js";import{d as z}from"./BI1irte-.js";const G=["touchstart","touchmove"];function J(t){return G.includes(t)}let n;function K(){n=void 0}function ae(t){let e=null,a=h;var i;if(h){for(e=f,n===void 0&&(n=H(document.head));n!==null&&(n.nodeType!==8||n.data!==C);)n=T(n);n===null?_(!1):n=p(T(n))}h||(i=document.head.appendChild(D()));try{O(()=>t(i),V)}finally{a&&(_(!0),n=f,p(e))}}let S=!0;function re(t,e){var a=e==null?"":typeof e=="object"?e+"":e;a!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=a,t.nodeValue=a+"")}function X(t,e){return I(t,e)}function ne(t,e){R(),e.intro=e.intro??!1;const a=e.target,i=h,y=f;try{for(var r=H(a);r&&(r.nodeType!==8||r.data!==C);)r=T(r);if(!r)throw w;_(!0),p(r),Y();const l=I(t,{...e,anchor:r});if(f===null||f.nodeType!==8||f.data!==k)throw M(),w;return _(!1),l}catch(l){if(l===w)return e.recover===!1&&j(),R(),F(a),_(!1),X(t,e);throw l}finally{_(i),p(y),K()}}const u=new Map;function I(t,{target:e,anchor:a,props:i={},events:y,context:r,intro:l=!0}){R();var g=new Set,m=o=>{for(var s=0;s<o.length;s++){var d=o[s];if(!g.has(d)){g.add(d);var c=J(d);e.addEventListener(d,v,{passive:c});var A=u.get(d);A===void 0?(document.addEventListener(d,v,{passive:c}),u.set(d,1)):u.set(d,A+1)}}};m(P(q)),N.add(m);var E=void 0,L=$(()=>{var o=a??e.appendChild(D());return B(()=>{if(r){Q({});var s=U;s.c=r}y&&(i.$$events=y),h&&z(o,null),S=l,E=t(o,i)||{},S=!0,h&&(W.nodes_end=f),r&&Z()}),()=>{var c;for(var s of g){e.removeEventListener(s,v);var d=u.get(s);--d===0?(document.removeEventListener(s,v),u.delete(s)):u.set(s,d)}N.delete(m),o!==a&&((c=o.parentNode)==null||c.removeChild(o))}});return b.set(E,L),E}let b=new WeakMap;function se(t,e){const a=b.get(t);return a?(b.delete(t),a(e)):Promise.resolve()}export{ae as a,S as b,ne as h,X as m,re as s,se as u};
