import{J as q,K as E,M as S,N as C,O as I,P as A,Q as $,h as x,k as N,R as z,S as Z,d as G,b as J,E as Q,e as V,g as W,i as X,j as T,T as H,U as k,q as B,V as ee,W as m,X as g,Y as re,Z as K,v as P,_ as se,z as te,$ as ie,a0 as O,a1 as ne,a2 as ae,a3 as fe,a4 as ue,a5 as ce,y as oe,a6 as le,a7 as de,L as Y,a8 as pe,a9 as D,aa as M,ab as _}from"./C2ft-gVq.js";class he{anchor;#r=new Map;#s=new Map;#e=new Map;#t=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#n=e=>{if(this.#r.has(e)){var t=this.#r.get(e),s=this.#s.get(t);if(s)q(s),this.#t.delete(t);else{var i=this.#e.get(t);i&&(i.effect.f&E)===0&&(this.#s.set(t,i.effect),this.#e.delete(t),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),s=i.effect)}for(const[n,f]of this.#r){if(this.#r.delete(n),n===e)break;const a=this.#e.get(f);a&&(S(a.effect),this.#e.delete(f))}for(const[n,f]of this.#s){if(n===t||this.#t.has(n)||(f.f&E)!==0)continue;const a=()=>{if(Array.from(this.#r.values()).includes(n)){var o=document.createDocumentFragment();z(f,o),o.append(I()),this.#e.set(n,{effect:f,fragment:o})}else S(f);this.#t.delete(n),this.#s.delete(n)};this.#i||!s?(this.#t.add(n),C(f,a,!1)):a()}}};#a=e=>{this.#r.delete(e);const t=Array.from(this.#r.values());for(const[s,i]of this.#e)t.includes(s)||(S(i.effect),this.#e.delete(s))};ensure(e,t){var s=$,i=Z();if(t&&!this.#s.has(e)&&!this.#e.has(e))if(i){var n=document.createDocumentFragment(),f=I();n.append(f),this.#e.set(e,{effect:A(()=>t(f)),fragment:n})}else this.#s.set(e,A(()=>t(this.anchor)));if(this.#r.set(s,e),i){for(const[a,u]of this.#s)a===e?s.unskip_effect(u):s.skip_effect(u);for(const[a,u]of this.#e)a===e?s.unskip_effect(u.effect):s.skip_effect(u.effect);s.oncommit(this.#n),s.ondiscard(this.#a)}else x&&(this.anchor=N),this.#n(s)}}function xe(r,e,t=!1){var s;x&&(s=N,J());var i=new he(r),n=t?Q:0;function f(a,u){if(x){var o=V(s);if(a!==parseInt(o.substring(1))){var l=W();X(l),i.anchor=l,T(!1),i.ensure(a,u),T(!0);return}}i.ensure(a,u)}G(()=>{var a=!1;e((u,o=0)=>{a=!0,f(o,u)}),a||f(-1,null)},n)}function L(r,e){return r===e||r?.[m]===e}function ge(r={},e,t,s){return H(()=>{var i,n;return k(()=>{i=n,n=[],B(()=>{r!==t(...n)&&(e(r,...n),i&&L(t(...i),r)&&e(null,...i))})}),()=>{ee(()=>{n&&L(t(...n),r)&&e(null,...n)})}}),r}let b=!1;function _e(r){var e=b;try{return b=!1,[r(),b]}finally{b=e}}const ve={get(r,e){if(!r.exclude.includes(e))return r.props[e]},set(r,e){return!1},getOwnPropertyDescriptor(r,e){if(!r.exclude.includes(e)&&e in r.props)return{enumerable:!0,configurable:!0,value:r.props[e]}},has(r,e){return r.exclude.includes(e)?!1:e in r.props},ownKeys(r){return Reflect.ownKeys(r.props).filter(e=>!r.exclude.includes(e))}};function me(r,e,t){return new Proxy({props:r,exclude:e},ve)}const be={get(r,e){if(!r.exclude.includes(e))return P(r.version),e in r.special?r.special[e]():r.props[e]},set(r,e,t){if(!(e in r.special)){var s=O;try{M(r.parent_effect),r.special[e]=we({get[e](){return r.props[e]}},e,K)}finally{M(s)}}return r.special[e](t),D(r.version),!0},getOwnPropertyDescriptor(r,e){if(!r.exclude.includes(e)&&e in r.props)return{enumerable:!0,configurable:!0,value:r.props[e]}},deleteProperty(r,e){return r.exclude.includes(e)||(r.exclude.push(e),D(r.version)),!0},has(r,e){return r.exclude.includes(e)?!1:e in r.props},ownKeys(r){return Reflect.ownKeys(r.props).filter(e=>!r.exclude.includes(e))}};function Oe(r,e){return new Proxy({props:r,exclude:e,special:{},version:pe(0),parent_effect:O},be)}const Pe={get(r,e){let t=r.props.length;for(;t--;){let s=r.props[t];if(_(s)&&(s=s()),typeof s=="object"&&s!==null&&e in s)return s[e]}},set(r,e,t){let s=r.props.length;for(;s--;){let i=r.props[s];_(i)&&(i=i());const n=g(i,e);if(n&&n.set)return n.set(t),!0}return!1},getOwnPropertyDescriptor(r,e){let t=r.props.length;for(;t--;){let s=r.props[t];if(_(s)&&(s=s()),typeof s=="object"&&s!==null&&e in s){const i=g(s,e);return i&&!i.configurable&&(i.configurable=!0),i}}},has(r,e){if(e===m||e===Y)return!1;for(let t of r.props)if(_(t)&&(t=t()),t!=null&&e in t)return!0;return!1},ownKeys(r){const e=[];for(let t of r.props)if(_(t)&&(t=t()),!!t){for(const s in t)e.includes(s)||e.push(s);for(const s of Object.getOwnPropertySymbols(t))e.includes(s)||e.push(s)}return e}};function Re(...r){return new Proxy({props:r},Pe)}function we(r,e,t,s){var i=!fe||(t&ue)!==0,n=(t&ae)!==0,f=(t&de)!==0,a=s,u=!0,o=()=>(u&&(u=!1,a=f?B(s):s),a),l;if(n){var j=m in r||Y in r;l=g(r,e)?.set??(j&&e in r?c=>r[e]=c:void 0)}var p,R=!1;n?[p,R]=_e(()=>r[e]):p=r[e],p===void 0&&s!==void 0&&(p=o(),l&&(i&&re(),l(p)));var d;if(i?d=()=>{var c=r[e];return c===void 0?o():(u=!0,c)}:d=()=>{var c=r[e];return c!==void 0&&(a=void 0),c===void 0?a:c},i&&(t&K)===0)return d;if(l){var F=r.$$legacy;return(function(c,v){return arguments.length>0?((!i||!v||F||R)&&l(v?d():c),c):d()})}var w=!1,h=((t&ce)!==0?oe:le)(()=>(w=!1,d()));n&&P(h);var U=O;return(function(c,v){if(arguments.length>0){const y=v?P(h):i&&n?se(c):c;return te(h,y),w=!0,a!==void 0&&(a=y),c}return ie&&w||(U.f&ne)!==0?h.v:P(h)})}export{he as B,ge as b,xe as i,Oe as l,we as p,me as r,Re as s};