mfuntowicz's picture
mfuntowicz HF Staff
Upload folder using huggingface_hub
dce232a verified
raw
history blame
3.2 kB
import{ab as E,ac as O,A as m,p as x,m as R,l as y,d as S,h as L,y as M,ad as B,j as N,k,J as F,ae as Y,H as C,F as U,D as j,S as T,af as q,ag as H,ah as K,g,a7 as $,ai as z,aj as G,ak as J,al as Z,f as Q,am as V,an as W,u as X,a0 as ee,ao as te,ap as se,aq as re,a2 as ae,ar as ie}from"./Db8vGcEi.js";class ne{anchor;#t=new Map;#s=new Map;#e=new Map;#r=new Set;#a=!0;constructor(e,r=!0){this.anchor=e,this.#a=r}#i=()=>{var e=E;if(this.#t.has(e)){var r=this.#t.get(e),s=this.#s.get(r);if(s)O(s),this.#r.delete(r);else{var f=this.#e.get(r);f&&(this.#s.set(r,f.effect),this.#e.delete(r),f.fragment.lastChild.remove(),this.anchor.before(f.fragment),s=f.effect)}for(const[a,n]of this.#t){if(this.#t.delete(a),a===e)break;const i=this.#e.get(n);i&&(m(i.effect),this.#e.delete(n))}for(const[a,n]of this.#s){if(a===r||this.#r.has(a))continue;const i=()=>{if(Array.from(this.#t.values()).includes(a)){var d=document.createDocumentFragment();M(n,d),d.append(R()),this.#e.set(a,{effect:n,fragment:d})}else m(n);this.#r.delete(a),this.#s.delete(a)};this.#a||!s?(this.#r.add(a),x(n,i,!1)):i()}}};#n=e=>{this.#t.delete(e);const r=Array.from(this.#t.values());for(const[s,f]of this.#e)r.includes(s)||(m(f.effect),this.#e.delete(s))};ensure(e,r){var s=E,f=B();if(r&&!this.#s.has(e)&&!this.#e.has(e))if(f){var a=document.createDocumentFragment(),n=R();a.append(n),this.#e.set(e,{effect:y(()=>r(n)),fragment:a})}else this.#s.set(e,y(()=>r(this.anchor)));if(this.#t.set(s,e),f){for(const[i,u]of this.#s)i===e?s.skipped_effects.delete(u):s.skipped_effects.add(u);for(const[i,u]of this.#e)i===e?s.skipped_effects.delete(u.effect):s.skipped_effects.add(u.effect);s.oncommit(this.#i),s.ondiscard(this.#n)}else S&&(this.anchor=L),this.#i()}}function de(t,e,r=!1){S&&k();var s=new ne(t),f=r?F:0;function a(n,i){if(S){const d=Y(t)===C;if(n===d){var u=U();j(u),s.anchor=u,T(!1),s.ensure(n,i),T(!0);return}}s.ensure(n,i)}N(()=>{var n=!1;e((i,u=!0)=>{n=!0,a(u,i)}),n||a(!1,null)},f)}let p=!1;function fe(t){var e=p;try{return p=!1,[t(),p]}finally{p=e}}const ue={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return!1},getOwnPropertyDescriptor(t,e){if(!t.exclude.includes(e)&&e in t.props)return{enumerable:!0,configurable:!0,value:t.props[e]}},has(t,e){return t.exclude.includes(e)?!1:e in t.props},ownKeys(t){return Reflect.ownKeys(t.props).filter(e=>!t.exclude.includes(e))}};function oe(t,e,r){return new Proxy({props:t,exclude:e},ue)}function le(t,e,r,s){var f=!ee||(r&te)!==0,a=(r&W)!==0,n=(r&re)!==0,i=s,u=!0,d=()=>(u&&(u=!1,i=n?X(s):s),i),l;if(a){var I=ae in t||ie in t;l=q(t,e)?.set??(I&&e in t?c=>t[e]=c:void 0)}var h,P=!1;a?[h,P]=fe(()=>t[e]):h=t[e],h===void 0&&s!==void 0&&(h=d(),l&&(f&&H(),l(h)));var o;if(f?o=()=>{var c=t[e];return c===void 0?d():(u=!0,c)}:o=()=>{var c=t[e];return c!==void 0&&(i=void 0),c===void 0?i:c},f&&(r&K)===0)return o;if(l){var w=t.$$legacy;return(function(c,v){return arguments.length>0?((!f||!v||w||P)&&l(v?o():c),c):o()})}var b=!1,_=((r&se)!==0?$:z)(()=>(b=!1,o()));a&&g(_);var D=Q;return(function(c,v){if(arguments.length>0){const A=v?g(_):f&&a?G(c):c;return J(_,A),b=!0,i!==void 0&&(i=A),c}return Z&&b||(D.f&V)!==0?_.v:g(_)})}export{ne as B,de as i,le as p,oe as r};