3 lines
5.0 KiB
JavaScript
3 lines
5.0 KiB
JavaScript
|
|
import{aG as Q,g as W,Q as G,o as K,aH as C,U as R,ay as $,a2 as u,N as p,l as y,aI as H,ai as X,a0 as Z,aq as ee,aJ as M,af as c,ae as q,ad as D,B as V,ag as te,aK as se,aL as Y,aM as L,aN as P,aO as re,aP as ie,aQ as ne,ao as U,as as ae,ac as F,Z as N,n as he,al as fe,aR as E,aj as oe,aF as de,aS as _e,aT as le,aU as O,_ as ce,a3 as z,aV as ue,a4 as pe,a6 as x,am as b,aW as ge,aD as ve,aX as ye,av as me,p as Ee,ar as be,a5 as Te,c as Re}from"./reyx9_7L.js";import{i as Ne,r as j,j as B,e as Se}from"./B89f14j0.js";function we(r){let e=0,t=$(0),i;return()=>{Q()&&(W(t),G(()=>(e===0&&(i=K(()=>r(()=>C(t)))),e+=1,()=>{R(()=>{e-=1,e===0&&(i?.(),i=void 0,C(t))})})))}}var Ae=oe|de;function De(r,e,t,i){new Fe(r,e,t,i)}class Fe{parent;is_pending=!1;transform_error;#t;#u=p?u:null;#i;#o;#e;#n=null;#s=null;#r=null;#a=null;#d=0;#f=0;#_=!1;#p=new Set;#g=new Set;#h=null;#m=we(()=>(this.#h=$(this.#d),()=>{this.#h=null}));constructor(e,t,i,f){this.#t=e,this.#i=t,this.#o=s=>{var n=y;n.b=this,n.f|=H,i(s)},this.parent=y.b,this.transform_error=f??this.parent?.transform_error??(s=>s),this.#e=X(()=>{if(p){const s=this.#u;Z();const n=s.data===ee;if(s.data.startsWith(M)){const a=JSON.parse(s.data.slice(M.length));this.#b(a)}else n?this.#T():this.#E()}else this.#v()},Ae),p&&(this.#t=u)}#E(){try{this.#n=c(()=>this.#o(this.#t))}catch(e){this.error(e)}}#b(e){const t=this.#i.failed;t&&(this.#r=c(()=>{t(this.#t,()=>e,()=>()=>{})}))}#T(){const e=this.#i.pending;e&&(this.is_pending=!0,this.#s=c(()=>e(this.#t)),R(()=>{var t=this.#a=document.createDocumentFragment(),i=q();t.append(i),this.#n=this.#c(()=>c(()=>this.#o(i))),this.#f===0&&(this.#t.before(t),this.#a=null,D(this.#s,()=>{this.#s=null}),this.#l(V))}))}#v(){try{if(this.is_pending=this.has_pending_snippet(),this.#f=0,this.#d=0,this.#n=c(()=>{this.#o(this.#t)}),this.#f>0){var e=this.#a=document.createDocumentFragment();te(this.#n,e);const t=this.#i.pending;this.#s=c(()=>t(this.#t))}else this.#l(V)}catch(t){this.error(t)}}#l(e){this.is_pending=!1,e.transfer_effects(this.#p,this.#g)}defer_effect(e){se(e,this.#p,this.#g)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#i.pending}#c(e){var t=y,i=ne,f=U;Y(this.#e),L(this.#e),P(this.#e.ctx);try{return re.ensure(),e()}catch(s){return ie(s),null}finally{Y(t),L(i),P(f)}}#y(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#y(e,t);return}this.#f+=e,this.#f===0&&(this.#l(t),this.#s&&D(this.#s,()=>{this.#s=null}),this.#a&&(this.#t.before(this.#a),this.#a=null))}update_pending_count(e,t){this.#y(e,t),this.#d+=e,!(!this.#h||this.#_)&&(this.#_=!0,R(()=>{this.#_=!1,this.#h&&ae(this.#h,this.#d)}))}get_effect_pending(){return this.#m(),W(this.#h)}error(e){var t=this.#i.onerror;let i=this.#i.failed;if(!t&&!i)throw e;this.#n&&(F(this.#n),this.#n=null),this.#s&&(F(this.#s),this.#s=null),this.#r&&(F(this.#r),this.#r=null),p&&(N(this.#u),he(),N(fe()));var f=!1,s=!1;const n=()=>{if(f){le();return}f=!0,s&&_e(),this.#r!==null&&D(this.#r,()=>{this.#r=null}),this.#c(()=>{this.#v()})},l=a=>{try{s=!0,t?.(a,n),s=!1}catch(h){E(h,this.#e&&this.#e.parent)}i&&(this.#r=this.#c(()=>{try{return c(()=>{var h=y;h.b=this,h.f|=H,i(this.#t,()=>a,()=>n)})}catch(h){return E(h,this.#e.parent),null}}))};R(()=>{var a;try{a=this.transform_error(e)}catch(h){E(h,this.#e&&this.#e.parent);return}a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(l,h=>E(h,this.#e&&this.#e.parent)):l(a)})}}const Oe=["touchstart","touchmove"];function xe(r){return Oe.includes(r)}function He(r,e){var t=e==null?"":typeof e=="object"?`${e}`:e;t!==(r.__t??=r.nodeValue)&&(r.__t=t,r.nodeValue=`${t}`)}function Ie(r,e){return J(r,e)}function Me(r,e){O(),e.intro=e.intro??!1;const t=e.target,i=p,f=u;try{for(var s=ce(t);s&&(s.nodeType!==z||s.data!==ue);)s=pe(s);if(!s)throw x;b(!0),N(s);const n=J(r,{...e,anchor:s});return b(!1),n}catch(n){if(n instanceof Error&&n.message.split(`
|
||
|
|
`).some(l=>l.startsWith("https://svelte.dev/e/")))throw n;return n!==x&&console.warn("Failed to hydrate: ",n),e.recover===!1&&ge(),O(),ve(t),b(!1),Ie(r,e)}finally{b(i),N(f)}}const T=new Map;function J(r,{target:e,anchor:t,props:i={},events:f,context:s,intro:n=!0,transformError:l}){O();var a=void 0,h=ye(()=>{var m=t??e.appendChild(q());De(m,{pending:()=>{}},o=>{Ee({});var d=U;if(s&&(d.c=s),f&&(i.$$events=f),p&&Se(o,null),a=r(o,i)||{},p&&(y.nodes.end=u,u===null||u.nodeType!==z||u.data!==be))throw Te(),x;Re()},l);var S=new Set,w=o=>{for(var d=0;d<o.length;d++){var _=o[d];if(!S.has(_)){S.add(_);var v=xe(_);for(const A of[e,document]){var g=T.get(A);g===void 0&&(g=new Map,T.set(A,g));var k=g.get(_);k===void 0?(A.addEventListener(_,B,{passive:v}),g.set(_,1)):g.set(_,k+1)}}}};return w(me(Ne)),j.add(w),()=>{for(var o of S)for(const v of[e,document]){var d=T.get(v),_=d.get(o);--_==0?(v.removeEventListener(o,B),d.delete(o),d.size===0&&T.delete(v)):d.set(o,_)}j.delete(w),m!==t&&m.parentNode?.removeChild(m)}});return I.set(a,h),a}let I=new WeakMap;function Ve(r,e){const t=I.get(r);return t?(I.delete(r),t(e)):Promise.resolve()}export{Me as h,Ie as m,He as s,Ve as u};
|