import{a6 as E,a7 as b,a8 as I,F as R,a9 as H,aa as W,ab as Y,I as j,ac as L,a2 as B,ad as C,ae as $,af as T,N as w,M as k,J as F,c as p,ag as J,ah as z,ai as G,aj as K,ak as Q,al as U,a1 as X,a as Z,q as x,e as tt,h as N,s as et}from"./DlLMAEhl.js";import{b as rt}from"./CrehCDwn.js";const at=["touchstart","touchmove"];function nt(t){return at.includes(t)}let A=!1;function st(){A||(A=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const a of t.target.elements)(e=a.__on_r)==null||e.call(a)})},{capture:!0}))}function P(t){var e=I,a=R;E(null),b(null);try{return t()}finally{E(e),b(a)}}function _t(t,e,a,i=a){t.addEventListener(e,()=>P(a));const n=t.__on_r;n?t.__on_r=()=>{n(),i(!0)}:t.__on_r=()=>i(!0),st()}const it=new Set,D=new Set;function ot(t,e,a,i={}){function n(r){if(i.capture||y.call(e,r),!r.cancelBubble)return P(()=>a==null?void 0:a.call(this,r))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?W(()=>{e.addEventListener(t,n,i)}):e.addEventListener(t,n,i),n}function lt(t,e,a,i,n){var r={capture:i,passive:n},u=ot(t,e,a,r);(e===document.body||e===window||e===document)&&H(()=>{e.removeEventListener(t,u,r)})}function y(t){var O;var e=this,a=e.ownerDocument,i=t.type,n=((O=t.composedPath)==null?void 0:O.call(t))||[],r=n[0]||t.target,u=0,d=t.__root;if(d){var _=n.indexOf(d);if(_!==-1&&(e===document||e===window)){t.__root=e;return}var h=n.indexOf(e);if(h===-1)return;_<=h&&(u=_)}if(r=n[u]||t.target,r!==e){Y(t,"currentTarget",{configurable:!0,get(){return r||a}});var m=I,f=R;E(null),b(null);try{for(var s,o=[];r!==null;){var c=r.assignedSlot||r.parentNode||r.host||null;try{var l=r["__"+i];if(l!==void 0&&(!r.disabled||t.target===r))if(j(l)){var[V,...q]=l;V.apply(r,[t,...q])}else l.call(r,t)}catch(g){s?o.push(g):s=g}if(t.cancelBubble||c===e||c===null)break;r=c}if(s){for(let g of o)queueMicrotask(()=>{throw g});throw s}}finally{t.__root=e,delete t.currentTarget,E(m),b(f)}}}function dt(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 ut(t,e){return M(t,e)}function ht(t,e){L(),e.intro=e.intro??!1;const a=e.target,i=N,n=p;try{for(var r=B(a);r&&(r.nodeType!==8||r.data!==C);)r=$(r);if(!r)throw T;w(!0),k(r),F();const u=M(t,{...e,anchor:r});if(p===null||p.nodeType!==8||p.data!==J)throw z(),T;return w(!1),u}catch(u){if(u===T)return e.recover===!1&&G(),L(),K(a),w(!1),ut(t,e);throw u}finally{w(i),k(n)}}const v=new Map;function M(t,{target:e,anchor:a,props:i={},events:n,context:r,intro:u=!0}){L();var d=new Set,_=f=>{for(var s=0;s{var f=a??e.appendChild(X());return Z(()=>{if(r){x({});var s=tt;s.c=r}n&&(i.$$events=n),N&&rt(f,null),h=t(f,i)||{},N&&(R.nodes_end=p),r&&et()}),()=>{var c;for(var s of d){e.removeEventListener(s,y);var o=v.get(s);--o===0?(document.removeEventListener(s,y),v.delete(s)):v.set(s,o)}D.delete(_),f!==a&&((c=f.parentNode)==null||c.removeChild(f))}});return S.set(h,m),h}let S=new WeakMap;function vt(t,e){const a=S.get(t);return a?(S.delete(t),a(e)):Promise.resolve()}export{st as a,lt as e,ht as h,_t as l,ut as m,dt as s,vt as u};