import{ag as f,ah as _,ai as y,U as b,aj as q,Y as x,D as B,F as D}from"./AM9C8FsA.js";let w=!1;function O(){w||(w=!0,document.addEventListener("reset",r=>{Promise.resolve().then(()=>{var t;if(!r.defaultPrevented)for(const e of r.target.elements)(t=e.__on_r)==null||t.call(e)})},{capture:!0}))}function E(r){var t=y,e=b;f(null),_(null);try{return r()}finally{f(t),_(e)}}function M(r,t,e,n=e){r.addEventListener(t,()=>E(e));const i=r.__on_r;i?r.__on_r=()=>{i(),n(!0)}:r.__on_r=()=>n(!0),O()}const T=new Set,W=new Set;function j(r,t,e,n={}){function i(a){if(n.capture||m.call(t,a),!a.cancelBubble)return E(()=>e==null?void 0:e.call(this,a))}return r.startsWith("pointer")||r.startsWith("touch")||r==="wheel"?D(()=>{t.addEventListener(r,i,n)}):t.addEventListener(r,i,n),i}function N(r,t,e,n,i){var a={capture:n,passive:i},o=j(r,t,e,a);(t===document.body||t===window||t===document)&&B(()=>{t.removeEventListener(r,o,a)})}function U(r){for(var t=0;t<r.length;t++)T.add(r[t]);for(var e of W)e(r)}function m(r){var g;var t=this,e=t.ownerDocument,n=r.type,i=((g=r.composedPath)==null?void 0:g.call(r))||[],a=i[0]||r.target,o=0,v=r.__root;if(v){var l=i.indexOf(v);if(l!==-1&&(t===document||t===window)){r.__root=t;return}var p=i.indexOf(t);if(p===-1)return;l<=p&&(o=l)}if(a=i[o]||r.target,a!==t){q(r,"currentTarget",{configurable:!0,get(){return a||e}});var L=y,k=b;f(null),_(null);try{for(var s,h=[];a!==null;){var d=a.assignedSlot||a.parentNode||a.host||null;try{var u=a["__"+n];if(u!==void 0&&(!a.disabled||r.target===a))if(x(u)){var[P,...S]=u;P.apply(a,[r,...S])}else u.call(a,r)}catch(c){s?h.push(c):s=c}if(r.cancelBubble||d===t||d===null)break;a=d}if(s){for(let c of h)queueMicrotask(()=>{throw c});throw s}}finally{r.__root=t,delete r.currentTarget,f(L),_(k)}}}export{O as a,T as b,U as d,N as e,m as h,M as l,W as r,E as w};
