2025-03-25 21:30:34 +01:00

2 lines
1.7 KiB
JavaScript

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