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