import{ag as E,ah as N,_ as P,L as j,M as R,J as y,h as I,F as U,U as Y,ai as C,d as q,e as G,E as $,aj as S,ak as z,al as T,p as m,am as J,an as Z,ao as H,G as x,ap as Q,aq as V,b as W,a as X,ar as k,as as ee,v as re,at as se,au as te,S as M,av as L,a5 as ne,aw as _,ax as A,O as D}from"./TwTPH6iZ.js";class ie{anchor;#r=new Map;#s=new Map;#e=new Map;#t=new Set;#n=!0;constructor(e,t=!0){this.anchor=e,this.#n=t}#i=()=>{var e=E;if(this.#r.has(e)){var t=this.#r.get(e),s=this.#s.get(t);if(s)N(s),this.#t.delete(t);else{var n=this.#e.get(t);n&&(this.#s.set(t,n.effect),this.#e.delete(t),n.fragment.lastChild.remove(),this.anchor.before(n.fragment),s=n.effect)}for(const[i,u]of this.#r){if(this.#r.delete(i),i===e)break;const a=this.#e.get(u);a&&(P(a.effect),this.#e.delete(u))}for(const[i,u]of this.#s){if(i===t||this.#t.has(i))continue;const a=()=>{if(Array.from(this.#r.values()).includes(i)){var c=document.createDocumentFragment();Y(u,c),c.append(R()),this.#e.set(i,{effect:u,fragment:c})}else P(u);this.#t.delete(i),this.#s.delete(i)};this.#n||!s?(this.#t.add(i),j(u,a,!1)):a()}}};#a=e=>{this.#r.delete(e);const t=Array.from(this.#r.values());for(const[s,n]of this.#e)t.includes(s)||(P(n.effect),this.#e.delete(s))};ensure(e,t){var s=E,n=C();if(t&&!this.#s.has(e)&&!this.#e.has(e))if(n){var i=document.createDocumentFragment(),u=R();i.append(u),this.#e.set(e,{effect:y(()=>t(u)),fragment:i})}else this.#s.set(e,y(()=>t(this.anchor)));if(this.#r.set(s,e),n){for(const[a,o]of this.#s)a===e?s.unskip_effect(o):s.skip_effect(o);for(const[a,o]of this.#e)a===e?s.unskip_effect(o.effect):s.skip_effect(o.effect);s.oncommit(this.#i),s.ondiscard(this.#a)}else I&&(this.anchor=U),this.#i()}}function de(r,e,t){I&&G();var s=new ie(r);q(()=>{var n=e()??null;s.ensure(n,n&&(i=>t(i,n)))},$)}let b=!1;function ae(r){var e=b;try{return b=!1,[r(),b]}finally{b=e}}const fe={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 pe(r,e,t){return new Proxy({props:r,exclude:e},fe)}const ue={get(r,e){if(!r.exclude.includes(e))return m(r.version),e in r.special?r.special[e]():r.props[e]},set(r,e,t){if(!(e in r.special)){var s=x;try{D(r.parent_effect),r.special[e]=ce({get[e](){return r.props[e]}},e,T)}finally{D(s)}}return r.special[e](t),A(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),A(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 he(r,e){return new Proxy({props:r,exclude:e,special:{},version:ne(0),parent_effect:x},ue)}const oe={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 n=r.props[s];_(n)&&(n=n());const i=S(n,e);if(i&&i.set)return i.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 n=S(s,e);return n&&!n.configurable&&(n.configurable=!0),n}}},has(r,e){if(e===M||e===L)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 _e(...r){return new Proxy({props:r},oe)}function ce(r,e,t,s){var n=!X||(t&k)!==0,i=(t&V)!==0,u=(t&te)!==0,a=s,o=!0,c=()=>(o&&(o=!1,a=u?W(s):s),a),d;if(i){var B=M in r||L in r;d=S(r,e)?.set??(B&&e in r?f=>r[e]=f:void 0)}var p,g=!1;i?[p,g]=ae(()=>r[e]):p=r[e],p===void 0&&s!==void 0&&(p=c(),d&&(n&&z(),d(p)));var l;if(n?l=()=>{var f=r[e];return f===void 0?c():(o=!0,f)}:l=()=>{var f=r[e];return f!==void 0&&(a=void 0),f===void 0?a:f},n&&(t&T)===0)return l;if(d){var F=r.$$legacy;return(function(f,v){return arguments.length>0?((!n||!v||F||g)&&d(v?l():f),f):l()})}var w=!1,h=((t&ee)!==0?re:se)(()=>(w=!1,l()));i&&m(h);var K=x;return(function(f,v){if(arguments.length>0){const O=v?m(h):n&&i?J(f):f;return Z(h,O),w=!0,a!==void 0&&(a=O),f}return H&&w||(K.f&Q)!==0?h.v:m(h)})}export{ie as B,de as c,he as l,ce as p,pe as r,_e as s};
