diff --git "a/assets/route-block-Itj55K8h.js" "b/assets/route-block-Itj55K8h.js" new file mode 100644--- /dev/null +++ "b/assets/route-block-Itj55K8h.js" @@ -0,0 +1,536 @@ +var au=Object.defineProperty;var su=(t,e,n)=>e in t?au(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var yo=(t,e,n)=>su(t,typeof e!="symbol"?e+"":e,n);import{d as xe,f as V,w as Ee,h as mt,i as ut,c as ee,o as Q,e as ze,v as Ya,x as Se,l as Wa,y as Xa,z as lu,A as Qa,B as uu,C as Bi,m as je,T as zi,p as be,D as Za,E as Ja,a as ve,j as P,G as Gt,H as at,I as vr,k as Ye,t as oe,b as D,J as Lt,K as gn,L as yr,M as es,Z as Fi,N as cu,V as de,O as tn,S as bo,Q as ur,P as cn,R as Ge,U as Bt,W as du,X as ts,Y as Rn,_ as Ui,$ as Xe,a0 as ns,a1 as rs,a2 as ji,a3 as On,a4 as fu,a5 as $i,a6 as pu,a7 as is,a8 as Mt,a9 as Vi,aa as zt,ab as hu,ac as os,ad as Wt,ae as as,af as ss,ag as mu,ah as ls,ai as gu,aj as yt,ak as br,al as us,am as cs,an as vu,ao as Yt,ap as yu,aq as bu,ar as xu,as as wu,at as Ir,au as cr,av as pi,aw as Kt,ax as ds,ay as hi,az as ln,aA as xo,aB as qt,aC as un,aD as Rr,aE as ku,aF as Tu,aG as Au,aH as Eu,aI as fs,aJ as ps,aK as dr,aL as hs,aM as Hi,aN as fr,aO as ms,aP as _u,aQ as wo,n as pr,aR as Mu,aS as mi,aT as gs,aU as Su,aV as Mn,aW as vs,aX as xt,aY as St,aZ as Cn,a_ as Iu,a$ as Ru,b0 as Cu,b1 as Nu,b2 as Ou,b3 as Gi,b4 as Pu,b5 as Du,b6 as Lu,b7 as Cr,b8 as Bu,b9 as ys,ba as zu,bb as Fu,bc as Uu,bd as ju,be as $u,bf as Nr,bg as Vu,bh as Hu,bi as Gu,bj as ko,bk as To,bl as Ao,bm as Eo,bn as Ku,bo as qu,bp as Yu,bq as Wu,br as Xu,bs as xr,bt as Pn,bu as Ft,bv as Dn,bw as Qu,bx as Zu,by as Ut,bz as Ju,bA as ec,bB as tc,bC as Qt,bD as _o,bE as or,bF as nc,bG as ft,bH as rc,bI as ic,bJ as oc,bK as ac,F as mn,bL as bs,bM as xs,bN as ws,bO as sc,bP as Or,bQ as lc,s as Nn,bR as uc,bS as ks,bT as cc,bU as dc,bV as fc,bW as Ts,bX as As,bY as pc,bZ as Pr}from"./index-DWxkGnJi.js";import{u as Dr}from"./queue-BdL-zJ6z.js";import{e as gi,T as Es,A as hc,L as vi,c as _s,r as Ms,I as mc,M as gc,d as vc,D as yc,E as bc,f as xc,g as wc,h as kc,i as Tc,j as Ac,k as Ss,V as Ec,m as _c,n as Mc,o as yi,p as Sc,q as Ic,b as Rc,a as Cc,u as Nc,l as Oc,s as Pc,t as Dc,_ as Is}from"./Stage.vue_vue_type_style_index_0_scoped_0f1c2eb6_lang-pX-yGk3M.js";import{_ as Ki}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{d as Mo}from"./index-DsObsDkZ.js";const Lc=xe({__name:"Canvas",props:{width:null,height:null},setup(t){const e=t,n=V(),r=V(),i=V();async function o(s){vi.registerTicker(_s),gi.add(Es),r.value=new hc({width:e.width,height:e.height,backgroundAlpha:0}),i.value=r.value.view,i.value.style.objectFit="contain",s.appendChild(r.value.view)}function a(){var s;r.value&&r.value.renderer.resize(e.width,e.height),(s=r.value)!=null&&s.view&&(r.value.view.width=e.width,r.value.view.height=e.height)}return Ee([()=>e.width,()=>e.height],()=>a()),mt(async()=>n.value&&await o(n.value)),ut(()=>{var s;return(s=r.value)==null?void 0:s.destroy()}),(s,l)=>(Q(),ee("div",{ref_key:"containerRef",ref:n,"h-full":"","w-full":""},[ze(s.$slots,"default",{app:r.value})],512))}});function So(t,e,n){return(1-n)*t+n*e}function Ht(t,e){return t+Math.random()*(e-t)}async function*Bc(t,e){const n=t.getReader();try{for(;;){const{done:r,value:i}=await n.read();if(r)return;yield e(i)}}finally{n.releaseLock()}}function zc(){let t=-1,e,n=-1;function r(i,o){(o>=t||oe.app),r=V(),i=V(0),o=V(0),a=Se(()=>Math.max(0,Math.min(100,e.mouthOpenSize))),s=Wa(),l=Xa(Qa),u=Se(()=>l.between("sm","md").value||l.smaller("sm").value),c=zc();function d(){return r.value.internalModel.coreModel}function p(g){if(!g.value)return;let E=2.2;u.value&&(E=2.2);const T=e.height*.95/o.value*E,M=e.width*.95/i.value*E,N=Math.min(T,M);g.value.scale.set(N,N)}async function f(){var N;if(!n.value)return;vi.registerTicker(_s),gi.add(Es),gi.add(mc),r.value=await vi.from(e.model,{motionPreload:gc.ALL}),n.value.stage.addChild(r.value),i.value=r.value.width,o.value=r.value.height,r.value.x=e.width/2,r.value.y=e.height,r.value.rotation=Math.PI,r.value.skew.x=Math.PI,r.value.anchor.set(.5,.5),p(r),r.value.on("hit",m=>{r.value&&m.includes("body")&&r.value.motion("tap_body")});const g=r.value.internalModel,E=g.coreModel,T=g.motionManager;E.setParameterValueById("ParamMouthOpenY",a.value),T.groups.idle&&((N=T.motionGroups[T.groups.idle])==null||N.forEach(m=>{m._motionData.curves.forEach(_=>{(_.id==="ParamEyeBallX"||_.id==="ParamEyeBallY")&&(_.id=`_${_.id}`)})}));const M=T.update;T.update=function(m,_){return M==null||M.call(this,m,_),T.state.currentGroup===T.groups.idle&&c.update(g,_),!0}}async function h(g){await r.value.motion(g,void 0,vc.FORCE)}const w=lu(()=>{r.value&&(r.value.x=e.width/2,r.value.y=e.height,p(r))},100);function v(){r.value&&(r.value.filters=[new yc({color:s.value?10053247:14662098,alpha:.3,blur:0,distance:20,rotation:45})])}return Ee([()=>e.width,()=>e.height],()=>w()),Ee(s,v,{immediate:!0}),Ee(r,v),Ee(a,g=>d().setParameterValueById("ParamMouthOpenY",g)),Ee(n,f),Ee(()=>e.motion,()=>e.motion&&h(e.motion)),mt(v),ut(()=>{var g;return r.value&&((g=n.value)==null?void 0:g.stage.removeChild(r.value))}),(g,E)=>ze(g.$slots,"default")}}),Rs=xe({__name:"Screen",setup(t){const e=V(),n=Xa(Qa),{width:r,height:i}=uu(),o=Bi(e,{immediate:!0,windowResize:!0,reset:!0}),a=Se(()=>n.between("sm","md").value||n.smaller("sm").value),s=Se(()=>n.between("md","lg").value),l=Se(()=>n.greaterOrEqual("lg").value),u=Se(()=>l.value?o.width.value:a.value||s.value?r.value-16:o.width.value),c=V(0);return Ee([r,i,e],()=>{var p,f;const d=(f=(p=e.value)==null?void 0:p.parentElement)==null?void 0:f.getBoundingClientRect();l.value||a.value||s.value?c.value=(d==null?void 0:d.height)||0:c.value=600}),Ee([o.width,o.height],()=>{l.value||a.value||s.value?c.value=o.height.value:c.value=600}),mt(async()=>{e.value&&o.update()}),(d,p)=>(Q(),ee("div",{ref_key:"containerRef",ref:e,"h-full":"","w-full":""},[ze(d.$slots,"default",{width:u.value,height:c.value})],512))}}),At="0px",wr=xe({__name:"TransitionVertical",props:{duration:{default:250},easingEnter:{default:"ease-in-out"},easingLeave:{default:"ease-in-out"},opacityClosed:{default:0},opacityOpened:{default:1}},setup(t){const e=t;function n(l){return{height:l.style.height,width:l.style.width,position:l.style.position,visibility:l.style.visibility,overflow:l.style.overflow,paddingTop:l.style.paddingTop,paddingBottom:l.style.paddingBottom,borderTopWidth:l.style.borderTopWidth,borderBottomWidth:l.style.borderBottomWidth,marginTop:l.style.marginTop,marginBottom:l.style.marginBottom}}function r(l,u){const{width:c}=getComputedStyle(l);l.style.width=c,l.style.position="absolute",l.style.visibility="hidden",l.style.height="";const{height:d}=getComputedStyle(l);return l.style.width=u.width,l.style.position=u.position,l.style.visibility=u.visibility,l.style.height=At,l.style.overflow="hidden",u.height&&u.height!==At?u.height:d}function i(l,u,c,d,p){const f=l.animate(d,p);l.style.height=u.height,f.onfinish=()=>{l.style.overflow=u.overflow,c()}}function o(l,u){return[{height:At,opacity:e.opacityClosed,paddingTop:At,paddingBottom:At,borderTopWidth:At,borderBottomWidth:At,marginTop:At,marginBottom:At},{height:l,opacity:e.opacityOpened,paddingTop:u.paddingTop,paddingBottom:u.paddingBottom,borderTopWidth:u.borderTopWidth,borderBottomWidth:u.borderBottomWidth,marginTop:u.marginTop,marginBottom:u.marginBottom}]}function a(l,u){const c=l,d=n(c),p=r(c,d),f=o(p,d),h={duration:e.duration,easing:e.easingEnter};i(c,d,u,f,h)}function s(l,u){const c=l,d=n(c),{height:p}=getComputedStyle(c);c.style.height=p,c.style.overflow="hidden";const f=o(p,d).reverse(),h={duration:e.duration,easing:e.easingLeave};i(c,d,u,f,h)}return(l,u)=>(Q(),je(zi,{css:!1,onEnter:a,onLeave:s},{default:be(()=>[ze(l.$slots,"default")]),_:3}))}}),Uc={absolute:"",bottom:"3",right:"3"},jc={flex:"~ row","cursor-pointer":""},$c=["checked","aria-checked"],Vc={key:0,"min-w":"50vw",z:"(Q(),je(Rs,{relative:""},{default:be(({width:o,height:a})=>[ve(Lc,{width:o,height:a},{default:be(({app:s})=>[ve(Fc,{app:s,model:t.model,"mouth-open-size":t.mouthOpenSize,width:o,height:a,motion:e.value},null,8,["app","model","mouth-open-size","width","height","motion"])]),_:2},1032,["width","height"]),P("div",Uc,[P("div",jc,[P("label",{class:Gt([n.value?"bg-zinc-300 dark:bg-zinc-200":"bg-zinc-100 dark:bg-zinc-700"]),transition:"all ease-in-out duration-500",text:"lg zinc-500 dark:zinc-400","m-1":"","h-fit":"","w-fit":"","cursor-pointer":"","appearance-none":"","gap-1":"","rounded-lg":"","rounded-md":"","border-none":"","p-2":"","outline-none":""},[at(P("input",{"onUpdate:modelValue":i[0]||(i[0]=s=>n.value=s),checked:n.value,"aria-checked":n.value,name:"showLive2DViewerInspector",type:"checkbox",hidden:"","appearance-none":"","outline-none":""},null,8,$c),[[vr,n.value]]),i[8]||(i[8]=P("div",{"select-none":""},[P("div",{"i-solar:bug-bold-duotone":""})],-1))],2)]),ve(wr,null,{default:be(()=>[n.value?(Q(),ee("div",Vc,[P("div",Hc,[P("div",Gc,[P("span",null,oe(r.$t("stage.viewers.debug-menu.emotions")),1)]),P("div",Kc,[P("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:i[1]||(i[1]=s=>e.value=D(bc))},oe(r.$t("stage.viewers.debug-menu.emotions-btn.surprised")),1),P("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:i[2]||(i[2]=s=>e.value=D(xc))},oe(r.$t("stage.viewers.debug-menu.emotions-btn.sad")),1),P("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:i[3]||(i[3]=s=>e.value=D(wc))},oe(r.$t("stage.viewers.debug-menu.emotions-btn.angry")),1),P("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:i[4]||(i[4]=s=>e.value=D(kc))},oe(r.$t("stage.viewers.debug-menu.emotions-btn.happy")),1),P("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:i[5]||(i[5]=s=>e.value=D(Tc))},oe(r.$t("stage.viewers.debug-menu.emotions-btn.awkward")),1),P("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:i[6]||(i[6]=s=>e.value=D(Ac))},oe(r.$t("stage.viewers.debug-menu.emotions-btn.question")),1),P("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:i[7]||(i[7]=s=>e.value=D(Ss))},oe(r.$t("stage.viewers.debug-menu.emotions-btn.think")),1)])])])):Ye("",!0)]),_:1})])]),_:1}))}});var Yc=Object.defineProperty,Wc=(t,e,n)=>e in t?Yc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Xc=(t,e,n)=>Wc(t,e+"",n);function Qc(t){return us()?(cs(t),!0):!1}function Cs(t){return typeof t=="function"?t():D(t)}const Zc=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Jc=Object.prototype.toString,ed=t=>Jc.call(t)==="[object Object]",td=()=>{},nd=Zc?window:void 0;function rd(t){var e;const n=Cs(t);return(e=n==null?void 0:n.$el)!=null?e:n}function Lr(...t){let e,n,r,i;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,r,i]=t,e=nd):[e,n,r,i]=t,!e)return td;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const o=[],a=()=>{o.forEach(c=>c()),o.length=0},s=(c,d,p,f)=>(c.addEventListener(d,p,f),()=>c.removeEventListener(d,p,f)),l=Ee(()=>[rd(e),Cs(i)],([c,d])=>{if(a(),!c)return;const p=ed(d)?{...d}:d;o.push(...n.flatMap(f=>r.map(h=>s(c,f,h,p))))},{immediate:!0,flush:"post"}),u=()=>{l(),a()};return Qc(u),u}function Ns(t,e,n,r){const i=class extends On{constructor(o={}){const a=Object.entries(t);super({uniforms:a.reduce((s,[l,u])=>{const c=$i.clone({[l]:{value:u}});return{...s,...c}},{}),vertexShader:e,fragmentShader:n}),Xc(this,"key",""),a.forEach(([s])=>Object.defineProperty(this,s,{get:()=>this.uniforms[s].value,set:l=>this.uniforms[s].value=l})),Object.assign(this,o)}};return i.key=Wt.generateUUID(),i}Ns({color:new Xe("white"),scale:new Ge(1,1),imageBounds:new Ge(1,1),resolution:1024,map:null,zoom:1,radius:0,grayscale:0,opacity:1},` + varying vec2 vUv; + varying vec2 vPos; + void main() { + gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position, 1.); + vUv = uv; + vPos = position.xy; + } + `,` + // mostly from https://gist.github.com/statico/df64c5d167362ecf7b34fca0b1459a44 + varying vec2 vUv; + varying vec2 vPos; + uniform vec2 scale; + uniform vec2 imageBounds; + uniform float resolution; + uniform vec3 color; + uniform sampler2D map; + uniform float radius; + uniform float zoom; + uniform float grayscale; + uniform float opacity; + const vec3 luma = vec3(.299, 0.587, 0.114); + vec4 toGrayscale(vec4 color, float intensity) { + return vec4(mix(color.rgb, vec3(dot(color.rgb, luma)), intensity), color.a); + } + vec2 aspect(vec2 size) { + return size / min(size.x, size.y); + } + + const float PI = 3.14159265; + + // from https://iquilezles.org/articles/distfunctions + float udRoundBox( vec2 p, vec2 b, float r ) { + return length(max(abs(p)-b+r,0.0))-r; + } + + void main() { + vec2 s = aspect(scale); + vec2 i = aspect(imageBounds); + float rs = s.x / s.y; + float ri = i.x / i.y; + vec2 new = rs < ri ? vec2(i.x * s.y / i.y, s.y) : vec2(s.x, i.y * s.x / i.x); + vec2 offset = (rs < ri ? vec2((new.x - s.x) / 2.0, 0.0) : vec2(0.0, (new.y - s.y) / 2.0)) / new; + vec2 uv = vUv * s / new + offset; + vec2 zUv = (uv - vec2(0.5, 0.5)) / zoom + vec2(0.5, 0.5); + + vec2 res = vec2(scale * resolution); + vec2 halfRes = 0.5 * res; + float b = udRoundBox(vUv.xy * res - halfRes, halfRes, resolution * radius); + vec3 a = mix(vec3(1.0,0.0,0.0), vec3(0.0,0.0,0.0), smoothstep(0.0, 1.0, b)); + gl_FragColor = toGrayscale(texture2D(map, zUv) * vec4(color, opacity * a), grayscale); + + #include + #include + } + `);const qi=parseInt(vu.replace(/\D+/g,""));var id=Object.defineProperty,od=(t,e,n)=>e in t?id(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ad=(t,e,n)=>(od(t,e+"",n),n);async function Io(t){const e=await t.arrayBuffer(),n=btoa(String.fromCharCode(...new Uint8Array(e)));return`data:${t.type||""};base64,${n}`}let $n,Br,nn,Vn;function zr(t,e=1/0,n=null){Br||(Br=new as(2,2,1,1)),nn||(nn=new On({uniforms:{blitTexture:new Au(t)},vertexShader:` + varying vec2 vUv; + void main(){ + vUv = uv; + gl_Position = vec4(position.xy * 1.0,0.,.999999); + } + `,fragmentShader:` + uniform sampler2D blitTexture; + varying vec2 vUv; + + void main(){ + gl_FragColor = vec4(vUv.xy, 0, 1); + + #ifdef IS_SRGB + gl_FragColor = LinearTosRGB( texture2D( blitTexture, vUv) ); + #else + gl_FragColor = texture2D( blitTexture, vUv); + #endif + } + `})),nn.uniforms.blitTexture.value=t,nn.defines.IS_SRGB="colorSpace"in t?t.colorSpace==="srgb":t.encoding===3001,nn.needsUpdate=!0,Vn||(Vn=new Yt(Br,nn),Vn.frustrumCulled=!1);const r=new Bt,i=new hi;i.add(Vn),n||(n=$n=new Eu({antialias:!1})),n.setSize(Math.min(t.image.width,e),Math.min(t.image.height,e)),n.clear(),n.render(i,r);const o=new cr(n.domElement);return o.minFilter=t.minFilter,o.magFilter=t.magFilter,o.wrapS=t.wrapS,o.wrapT=t.wrapT,o.name=t.name,$n&&($n.dispose(),$n=null),o}const Ro={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]};class Os{constructor(){this.pluginCallbacks=[],this.register(function(e){return new gd(e)}),this.register(function(e){return new vd(e)}),this.register(function(e){return new xd(e)}),this.register(function(e){return new wd(e)}),this.register(function(e){return new kd(e)}),this.register(function(e){return new Td(e)}),this.register(function(e){return new yd(e)}),this.register(function(e){return new bd(e)}),this.register(function(e){return new Ad(e)}),this.register(function(e){return new Ed(e)}),this.register(function(e){return new _d(e)})}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,n,r,i){const o=new md,a=[];for(let s=0,l=this.pluginCallbacks.length;st.times[t.times.length-1]){if(Math.abs(t.times[t.times.length-1]-e)<.001)return t.times.length-1;r[r.length-1]=e,r.set(t.times,0),i.set(t.values,0),i.set(o.evaluate(e),t.values.length),a=r.length-1}else for(let s=0;se){r.set(t.times.slice(0,s+1),0),r[s+1]=e,r.set(t.times.slice(s+1),s+2),i.set(t.values.slice(0,(s+1)*n),0),i.set(o.evaluate(e),(s+1)*n),i.set(t.values.slice((s+1)*n),(s+2)*n),a=s+1;break}}return t.times=r,t.values=i,a},mergeMorphTargetTracks:function(t,e){const n=[],r={},i=t.tracks;for(let o=0;o4?a=t.array[i*t.itemSize+o]:(o===0?a=t.getX(i):o===1?a=t.getY(i):o===2?a=t.getZ(i):o===3&&(a=t.getW(i)),t.normalized===!0&&(a=Wt.normalize(a,t.array))),r.min[o]=Math.min(r.min[o],a),r.max[o]=Math.max(r.max[o],a)}return r}function Ps(t){return Math.ceil(t/4)*4}function Ur(t,e=0){const n=Ps(t.byteLength);if(n!==t.byteLength){const r=new Uint8Array(n);if(r.set(new Uint8Array(t)),e!==0)for(let i=t.byteLength;i"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function Do(t,e){if(t.toBlob!==void 0)return new Promise(r=>t.toBlob(r,e));let n;return e==="image/jpeg"?n=.92:e==="image/webp"&&(n=.8),t.convertToBlob({type:e,quality:n})}let md=class{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(e){this.plugins=e}async write(e,n,r={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},r),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);const i=this,o=i.buffers,a=i.json;r=i.options;const s=i.extensionsUsed,l=i.extensionsRequired,u=new Blob(o,{type:"application/octet-stream"}),c=Object.keys(s),d=Object.keys(l);c.length>0&&(a.extensionsUsed=c),d.length>0&&(a.extensionsRequired=d),a.buffers&&a.buffers.length>0&&(a.buffers[0].byteLength=u.size),r.binary===!0?u.arrayBuffer().then(p=>{const f=Ur(p),h=new DataView(new ArrayBuffer(Oo));h.setUint32(0,f.byteLength,!0),h.setUint32(4,dd,!0);const w=Ur(fd(JSON.stringify(a)),32),v=new DataView(new ArrayBuffer(Oo));v.setUint32(0,w.byteLength,!0),v.setUint32(4,cd,!0);const g=new ArrayBuffer(No),E=new DataView(g);E.setUint32(0,ld,!0),E.setUint32(4,ud,!0);const T=No+v.byteLength+w.byteLength+h.byteLength+f.byteLength;E.setUint32(8,T,!0),new Blob([g,v,w,h,f],{type:"application/octet-stream"}).arrayBuffer().then(n)}):a.buffers&&a.buffers.length>0?Io(u).then(p=>{a.buffers[0].uri=p,n(a)}):n(a)}serializeUserData(e,n){if(Object.keys(e.userData).length===0)return;const r=this.options,i=this.extensionsUsed;try{const o=JSON.parse(JSON.stringify(e.userData));if(r.includeCustomExtensions&&o.gltfExtensions){n.extensions===void 0&&(n.extensions={});for(const a in o.gltfExtensions)n.extensions[a]=o.gltfExtensions[a],i[a]=!0;delete o.gltfExtensions}Object.keys(o).length>0&&(n.extras=o)}catch(o){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+o.message)}}getUID(e,n=!1){if(this.uids.has(e)===!1){const r=new Map;r.set(!0,this.uid++),r.set(!1,this.uid++),this.uids.set(e,r)}return this.uids.get(e).get(n)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;const n=new de;for(let r=0,i=e.count;r5e-4)return!1;return!0}createNormalizedNormalAttribute(e){const n=this.cache;if(n.attributesNormalized.has(e))return n.attributesNormalized.get(e);const r=e.clone(),i=new de;for(let o=0,a=r.count;o4?h=e.array[p*e.itemSize+f]:(f===0?h=e.getX(p):f===1?h=e.getY(p):f===2?h=e.getZ(p):f===3&&(h=e.getW(p)),e.normalized===!0&&(h=Wt.normalize(h,e.array))),n===Ae.FLOAT?u.setFloat32(c,h,!0):n===Ae.INT?u.setInt32(c,h,!0):n===Ae.UNSIGNED_INT?u.setUint32(c,h,!0):n===Ae.SHORT?u.setInt16(c,h,!0):n===Ae.UNSIGNED_SHORT?u.setUint16(c,h,!0):n===Ae.BYTE?u.setInt8(c,h):n===Ae.UNSIGNED_BYTE&&u.setUint8(c,h),c+=s}const d={buffer:this.processBuffer(u.buffer),byteOffset:this.byteOffset,byteLength:l};return o!==void 0&&(d.target=o),o===Ae.ARRAY_BUFFER&&(d.byteStride=e.itemSize*s),this.byteOffset+=l,a.bufferViews.push(d),{id:a.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){const n=this,r=n.json;return r.bufferViews||(r.bufferViews=[]),e.arrayBuffer().then(i=>{const o=Ur(i),a={buffer:n.processBuffer(o),byteOffset:n.byteOffset,byteLength:o.byteLength};return n.byteOffset+=o.byteLength,r.bufferViews.push(a)-1})}processAccessor(e,n,r,i){const o=this.json,a={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"};let s;if(e.array.constructor===Float32Array)s=Ae.FLOAT;else if(e.array.constructor===Int32Array)s=Ae.INT;else if(e.array.constructor===Uint32Array)s=Ae.UNSIGNED_INT;else if(e.array.constructor===Int16Array)s=Ae.SHORT;else if(e.array.constructor===Uint16Array)s=Ae.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)s=Ae.BYTE;else if(e.array.constructor===Uint8Array)s=Ae.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(r===void 0&&(r=0),i===void 0&&(i=e.count),i===0)return null;const l=hd(e,r,i);let u;n!==void 0&&(u=e===n.index?Ae.ELEMENT_ARRAY_BUFFER:Ae.ARRAY_BUFFER);const c=this.processBufferView(e,s,r,i,u),d={bufferView:c.id,byteOffset:c.byteOffset,componentType:s,count:i,max:l.max,min:l.min,type:a[e.itemSize]};return e.normalized===!0&&(d.normalized=!0),o.accessors||(o.accessors=[]),o.accessors.push(d)-1}processImage(e,n,r,i="image/png"){if(e!==null){const o=this,a=o.cache,s=o.json,l=o.options,u=o.pending;a.images.has(e)||a.images.set(e,{});const c=a.images.get(e),d=i+":flipY/"+r.toString();if(c[d]!==void 0)return c[d];s.images||(s.images=[]);const p={mimeType:i},f=Po();f.width=Math.min(e.width,l.maxTextureSize),f.height=Math.min(e.height,l.maxTextureSize);const h=f.getContext("2d");if(r===!0&&(h.translate(0,f.height),h.scale(1,-1)),e.data!==void 0){n!==pi&&console.error("GLTFExporter: Only RGBAFormat is supported.",n),(e.width>l.maxTextureSize||e.height>l.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);const v=new Uint8ClampedArray(e.height*e.width*4);for(let g=0;go.processBufferViewImage(v)).then(v=>{p.bufferView=v})):f.toDataURL!==void 0?p.uri=f.toDataURL(i):u.push(Do(f,i).then(Io).then(v=>{p.uri=v}));const w=s.images.push(p)-1;return c[d]=w,w}else throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){const n=this.json;n.samplers||(n.samplers=[]);const r={magFilter:st[e.magFilter],minFilter:st[e.minFilter],wrapS:st[e.wrapS],wrapT:st[e.wrapT]};return n.samplers.push(r)-1}processTexture(e){const n=this.options,r=this.cache,i=this.json;if(r.textures.has(e))return r.textures.get(e);i.textures||(i.textures=[]),e instanceof Ir&&(e=zr(e,n.maxTextureSize));let o=e.userData.mimeType;o==="image/webp"&&(o="image/png");const a={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,o)};e.name&&(a.name=e.name),this._invokeAll(function(l){l.writeTexture&&l.writeTexture(e,a)});const s=i.textures.push(a)-1;return r.textures.set(e,s),s}processMaterial(e){const n=this.cache,r=this.json;if(n.materials.has(e))return n.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;r.materials||(r.materials=[]);const i={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");const o=e.color.toArray().concat([e.opacity]);if(_n(o,[1,1,1,1])||(i.pbrMetallicRoughness.baseColorFactor=o),e.isMeshStandardMaterial?(i.pbrMetallicRoughness.metallicFactor=e.metalness,i.pbrMetallicRoughness.roughnessFactor=e.roughness):(i.pbrMetallicRoughness.metallicFactor=.5,i.pbrMetallicRoughness.roughnessFactor=.5),e.metalnessMap||e.roughnessMap){const s=this.buildMetalRoughTexture(e.metalnessMap,e.roughnessMap),l={index:this.processTexture(s),channel:s.channel};this.applyTextureTransform(l,s),i.pbrMetallicRoughness.metallicRoughnessTexture=l}if(e.map){const s={index:this.processTexture(e.map),texCoord:e.map.channel};this.applyTextureTransform(s,e.map),i.pbrMetallicRoughness.baseColorTexture=s}if(e.emissive){const s=e.emissive;if(Math.max(s.r,s.g,s.b)>0&&(i.emissiveFactor=e.emissive.toArray()),e.emissiveMap){const l={index:this.processTexture(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(l,e.emissiveMap),i.emissiveTexture=l}}if(e.normalMap){const s={index:this.processTexture(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&e.normalScale.x!==1&&(s.scale=e.normalScale.x),this.applyTextureTransform(s,e.normalMap),i.normalTexture=s}if(e.aoMap){const s={index:this.processTexture(e.aoMap),texCoord:e.aoMap.channel};e.aoMapIntensity!==1&&(s.strength=e.aoMapIntensity),this.applyTextureTransform(s,e.aoMap),i.occlusionTexture=s}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),e.side===br&&(i.doubleSided=!0),e.name!==""&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll(function(s){s.writeMaterial&&s.writeMaterial(e,i)});const a=r.materials.push(i)-1;return n.materials.set(e,a),a}processMesh(e){const n=this.cache,r=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let T=0,M=e.material.length;T=152?{uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3"}:{uv:"TEXCOORD_0",uv2:"TEXCOORD_1"},color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},f=a.getAttribute("normal");f!==void 0&&!this.isNormalizedNormalAttribute(f)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),a.setAttribute("normal",this.createNormalizedNormalAttribute(f)));let h=null;for(let T in a.attributes){if(T.slice(0,5)==="morph")continue;const M=a.attributes[T];if(T=p[T]||T.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(T)||(T="_"+T),n.attributes.has(this.getUID(M))){u[T]=n.attributes.get(this.getUID(M));continue}h=null;const N=M.array;T==="JOINTS_0"&&!(N instanceof Uint16Array)&&!(N instanceof Uint8Array)&&(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),h=new Kt(new Uint16Array(N),M.itemSize,M.normalized));const m=this.processAccessor(h||M,a);m!==null&&(T.startsWith("_")||this.detectMeshQuantization(T,M),u[T]=m,n.attributes.set(this.getUID(M),m))}if(f!==void 0&&a.setAttribute("normal",f),Object.keys(u).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){const T=[],M=[],N={};if(e.morphTargetDictionary!==void 0)for(const m in e.morphTargetDictionary)N[e.morphTargetDictionary[m]]=m;for(let m=0;m0&&(l.extras={},l.extras.targetNames=M)}const w=Array.isArray(e.material);if(w&&a.groups.length===0)return null;const v=w?e.material:[e.material],g=w?a.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let T=0,M=g.length;T0&&(N.targets=d),a.index!==null){let _=this.getUID(a.index);(g[T].start!==void 0||g[T].count!==void 0)&&(_+=":"+g[T].start+":"+g[T].count),n.attributes.has(_)?N.indices=n.attributes.get(_):(N.indices=this.processAccessor(a.index,a,g[T].start,g[T].count),n.attributes.set(_,N.indices)),N.indices===null&&delete N.indices}const m=this.processMaterial(v[g[T].materialIndex]);m!==null&&(N.material=m),c.push(N)}l.primitives=c,r.meshes||(r.meshes=[]),this._invokeAll(function(T){T.writeMesh&&T.writeMesh(e,l)});const E=r.meshes.push(l)-1;return n.meshes.set(o,E),E}detectMeshQuantization(e,n){if(this.extensionsUsed[Fr])return;let r;switch(n.array.constructor){case Int8Array:r="byte";break;case Uint8Array:r="unsigned byte";break;case Int16Array:r="short";break;case Uint16Array:r="unsigned short";break;default:return}n.normalized&&(r+=" normalized");const i=e.split("_",1)[0];Ro[i]&&Ro[i].includes(r)&&(this.extensionsUsed[Fr]=!0,this.extensionsRequired[Fr]=!0)}processCamera(e){const n=this.json;n.cameras||(n.cameras=[]);const r=e.isOrthographicCamera,i={type:r?"orthographic":"perspective"};return r?i.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:i.perspective={aspectRatio:e.aspect,yfov:Wt.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(i.name=e.type),n.cameras.push(i)-1}processAnimation(e,n){const r=this.json,i=this.nodeMap;r.animations||(r.animations=[]),e=Os.Utils.mergeMorphTargetTracks(e.clone(),n);const o=e.tracks,a=[],s=[];for(let l=0;l0){const s=[];for(let l=0,u=e.children.length;l0&&(o.children=s)}this._invokeAll(function(s){s.writeNode&&s.writeNode(e,o)});const a=n.nodes.push(o)-1;return i.set(e,a),a}processScene(e){const n=this.json,r=this.options;n.scenes||(n.scenes=[],n.scene=0);const i={};e.name!==""&&(i.name=e.name),n.scenes.push(i);const o=[];for(let a=0,s=e.children.length;a0&&(i.nodes=o),this.serializeUserData(e,i)}processObjects(e){const n=new hi;n.name="AuxScene";for(let r=0;r0&&this.processObjects(r);for(let i=0;i0&&(a.range=e.distance)):e.isSpotLight&&(a.type="spot",e.distance>0&&(a.range=e.distance),a.spot={},a.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,a.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),o[this.name]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},o[this.name]=!0);const s=i.extensions[this.name].lights;s.push(a),n.extensions=n.extensions||{},n.extensions[this.name]={light:s.length-1}}}let vd=class{constructor(t){this.writer=t,this.name="KHR_materials_unlit"}writeMaterial(t,e){if(!t.isMeshBasicMaterial)return;const n=this.writer.extensionsUsed;e.extensions=e.extensions||{},e.extensions[this.name]={},n[this.name]=!0,e.pbrMetallicRoughness.metallicFactor=0,e.pbrMetallicRoughness.roughnessFactor=.9}},yd=class{constructor(t){this.writer=t,this.name="KHR_materials_clearcoat"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.clearcoat===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.clearcoatFactor=t.clearcoat,t.clearcoatMap){const o={index:n.processTexture(t.clearcoatMap),texCoord:t.clearcoatMap.channel};n.applyTextureTransform(o,t.clearcoatMap),i.clearcoatTexture=o}if(i.clearcoatRoughnessFactor=t.clearcoatRoughness,t.clearcoatRoughnessMap){const o={index:n.processTexture(t.clearcoatRoughnessMap),texCoord:t.clearcoatRoughnessMap.channel};n.applyTextureTransform(o,t.clearcoatRoughnessMap),i.clearcoatRoughnessTexture=o}if(t.clearcoatNormalMap){const o={index:n.processTexture(t.clearcoatNormalMap),texCoord:t.clearcoatNormalMap.channel};n.applyTextureTransform(o,t.clearcoatNormalMap),i.clearcoatNormalTexture=o}e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},bd=class{constructor(t){this.writer=t,this.name="KHR_materials_iridescence"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.iridescence===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.iridescenceFactor=t.iridescence,t.iridescenceMap){const o={index:n.processTexture(t.iridescenceMap),texCoord:t.iridescenceMap.channel};n.applyTextureTransform(o,t.iridescenceMap),i.iridescenceTexture=o}if(i.iridescenceIor=t.iridescenceIOR,i.iridescenceThicknessMinimum=t.iridescenceThicknessRange[0],i.iridescenceThicknessMaximum=t.iridescenceThicknessRange[1],t.iridescenceThicknessMap){const o={index:n.processTexture(t.iridescenceThicknessMap),texCoord:t.iridescenceThicknessMap.channel};n.applyTextureTransform(o,t.iridescenceThicknessMap),i.iridescenceThicknessTexture=o}e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},xd=class{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,n){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;const r=this.writer,i=r.extensionsUsed,o={};if(o.transmissionFactor=e.transmission,e.transmissionMap){const a={index:r.processTexture(e.transmissionMap),texCoord:e.transmissionMap.channel};r.applyTextureTransform(a,e.transmissionMap),o.transmissionTexture=a}n.extensions=n.extensions||{},n.extensions[this.name]=o,i[this.name]=!0}},wd=class{constructor(t){this.writer=t,this.name="KHR_materials_volume"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.transmission===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.thicknessFactor=t.thickness,t.thicknessMap){const o={index:n.processTexture(t.thicknessMap),texCoord:t.thicknessMap.channel};n.applyTextureTransform(o,t.thicknessMap),i.thicknessTexture=o}i.attenuationDistance=t.attenuationDistance,i.attenuationColor=t.attenuationColor.toArray(),e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},kd=class{constructor(t){this.writer=t,this.name="KHR_materials_ior"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.ior===1.5)return;const n=this.writer.extensionsUsed,r={};r.ior=t.ior,e.extensions=e.extensions||{},e.extensions[this.name]=r,n[this.name]=!0}},Td=class{constructor(t){this.writer=t,this.name="KHR_materials_specular"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.specularIntensity===1&&t.specularColor.equals(sd)&&!t.specularIntensityMap&&!t.specularColorTexture)return;const n=this.writer,r=n.extensionsUsed,i={};if(t.specularIntensityMap){const o={index:n.processTexture(t.specularIntensityMap),texCoord:t.specularIntensityMap.channel};n.applyTextureTransform(o,t.specularIntensityMap),i.specularTexture=o}if(t.specularColorMap){const o={index:n.processTexture(t.specularColorMap),texCoord:t.specularColorMap.channel};n.applyTextureTransform(o,t.specularColorMap),i.specularColorTexture=o}i.specularFactor=t.specularIntensity,i.specularColorFactor=t.specularColor.toArray(),e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Ad=class{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}writeMaterial(e,n){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;const r=this.writer,i=r.extensionsUsed,o={};if(e.sheenRoughnessMap){const a={index:r.processTexture(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};r.applyTextureTransform(a,e.sheenRoughnessMap),o.sheenRoughnessTexture=a}if(e.sheenColorMap){const a={index:r.processTexture(e.sheenColorMap),texCoord:e.sheenColorMap.channel};r.applyTextureTransform(a,e.sheenColorMap),o.sheenColorTexture=a}o.sheenRoughnessFactor=e.sheenRoughness,o.sheenColorFactor=e.sheenColor.toArray(),n.extensions=n.extensions||{},n.extensions[this.name]=o,i[this.name]=!0}},Ed=class{constructor(t){this.writer=t,this.name="KHR_materials_anisotropy"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.anisotropy==0)return;const n=this.writer,r=n.extensionsUsed,i={};if(t.anisotropyMap){const o={index:n.processTexture(t.anisotropyMap)};n.applyTextureTransform(o,t.anisotropyMap),i.anisotropyTexture=o}i.anisotropyStrength=t.anisotropy,i.anisotropyRotation=t.anisotropyRotation,e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},_d=class{constructor(t){this.writer=t,this.name="KHR_materials_emissive_strength"}writeMaterial(t,e){if(!t.isMeshStandardMaterial||t.emissiveIntensity===1)return;const n=this.writer.extensionsUsed,r={};r.emissiveStrength=t.emissiveIntensity,e.extensions=e.extensions||{},e.extensions[this.name]=r,n[this.name]=!0}};var Ln=Uint8Array,Ds=Uint16Array,Md=Uint32Array,Sd=new Ln([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Id=new Ln([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ls=function(t,e){for(var n=new Ds(31),r=0;r<31;++r)n[r]=e+=1<>>1|(Le&21845)<<1;Nt=(Nt&52428)>>>2|(Nt&13107)<<2,Nt=(Nt&61680)>>>4|(Nt&3855)<<4,Nd[Le]=((Nt&65280)>>>8|(Nt&255)<<8)>>>1}var kr=new Ln(288);for(var Le=0;Le<144;++Le)kr[Le]=8;for(var Le=144;Le<256;++Le)kr[Le]=9;for(var Le=256;Le<280;++Le)kr[Le]=7;for(var Le=280;Le<288;++Le)kr[Le]=8;var Od=new Ln(32);for(var Le=0;Le<32;++Le)Od[Le]=5;var Pd=new Ln(0),Dd=typeof TextDecoder<"u"&&new TextDecoder,Ld=0;try{Dd.decode(Pd,{stream:!0}),Ld=1}catch{}var Bd=Object.defineProperty,zd=(t,e,n)=>e in t?Bd(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Fd=(t,e,n)=>(zd(t,e+"",n),n);const zs=class extends Yt{constructor(t,e={}){super(t),this.isReflector=!0,this.type="Reflector",this.camera=new Bt;const n=this,r=e.color!==void 0?new Xe(e.color):new Xe(8355711),i=e.textureWidth||512,o=e.textureHeight||512,a=e.clipBias||0,s=e.shader||zs.ReflectorShader,l=e.multisample!==void 0?e.multisample:4,u=new ts,c=new de,d=new de,p=new de,f=new Mt,h=new de(0,0,-1),w=new zt,v=new de,g=new de,E=new zt,T=new Mt,M=this.camera,N=new bu(i,o,{samples:l,type:xu}),m=new On({uniforms:$i.clone(s.uniforms),fragmentShader:s.fragmentShader,vertexShader:s.vertexShader});m.uniforms.tDiffuse.value=N.texture,m.uniforms.color.value=r,m.uniforms.textureMatrix.value=T,this.material=m,this.onBeforeRender=function(_,x,b){if(d.setFromMatrixPosition(n.matrixWorld),p.setFromMatrixPosition(b.matrixWorld),f.extractRotation(n.matrixWorld),c.set(0,0,1),c.applyMatrix4(f),v.subVectors(d,p),v.dot(c)>0)return;v.reflect(c).negate(),v.add(d),f.extractRotation(b.matrixWorld),h.set(0,0,-1),h.applyMatrix4(f),h.add(p),g.subVectors(d,h),g.reflect(c).negate(),g.add(d),M.position.copy(v),M.up.set(0,1,0),M.up.applyMatrix4(f),M.up.reflect(c),M.lookAt(g),M.far=b.far,M.updateMatrixWorld(),M.projectionMatrix.copy(b.projectionMatrix),T.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),T.multiply(M.projectionMatrix),T.multiply(M.matrixWorldInverse),T.multiply(n.matrixWorld),u.setFromNormalAndCoplanarPoint(c,d),u.applyMatrix4(M.matrixWorldInverse),w.set(u.normal.x,u.normal.y,u.normal.z,u.constant);const y=M.projectionMatrix;E.x=(Math.sign(w.x)+y.elements[8])/y.elements[0],E.y=(Math.sign(w.y)+y.elements[9])/y.elements[5],E.z=-1,E.w=(1+y.elements[10])/y.elements[14],w.multiplyScalar(2/w.dot(E)),y.elements[2]=w.x,y.elements[6]=w.y,y.elements[10]=w.z+1-a,y.elements[14]=w.w,n.visible=!1;const A=_.getRenderTarget(),R=_.xr.enabled,z=_.shadowMap.autoUpdate,F=_.toneMapping;let B=!1;"outputColorSpace"in _?B=_.outputColorSpace==="srgb":B=_.outputEncoding===3001,_.xr.enabled=!1,_.shadowMap.autoUpdate=!1,"outputColorSpace"in _?_.outputColorSpace="srgb-linear":_.outputEncoding=3e3,_.toneMapping=wu,_.setRenderTarget(N),_.state.buffers.depth.setMask(!0),_.autoClear===!1&&_.clear(),_.render(x,M),_.xr.enabled=R,_.shadowMap.autoUpdate=z,_.toneMapping=F,"outputColorSpace"in _?_.outputColorSpace=B?"srgb":"srgb-linear":_.outputEncoding=B?3001:3e3,_.setRenderTarget(A);const $=b.viewport;$!==void 0&&_.state.viewport($),n.visible=!0},this.getRenderTarget=function(){return N},this.dispose=function(){N.dispose(),n.material.dispose()}}};let bi=zs;Fd(bi,"ReflectorShader",{uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:` + uniform mat4 textureMatrix; + varying vec4 vUv; + + #include + #include + + void main() { + + vUv = textureMatrix * vec4( position, 1.0 ); + + gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); + + #include + + }`,fragmentShader:` + uniform vec3 color; + uniform sampler2D tDiffuse; + varying vec4 vUv; + + #include + + float blendOverlay( float base, float blend ) { + + return( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) ); + + } + + vec3 blendOverlay( vec3 base, vec3 blend ) { + + return vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) ); + + } + + void main() { + + #include + + vec4 base = texture2DProj( tDiffuse, vUv ); + gl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 ); + + #include + #include <${qi>=154?"colorspace_fragment":"encodings_fragment"}> + + }`});var Ud=Object.defineProperty,jd=(t,e,n)=>e in t?Ud(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Fs=(t,e,n)=>(jd(t,typeof e!="symbol"?e+"":e,n),n);const Tr=new ns,$d=new Float32Array([-1,-1,0,0,0,1,-1,0,1,0,1,1,0,1,1,-1,1,0,0,1]),Us=new rs($d,5);Tr.setIndex([0,1,2,0,2,3]);Tr.setAttribute("position",new ji(Us,3,0,!1));Tr.setAttribute("uv",new ji(Us,2,3,!1));const xi=class extends Yt{constructor(){super(xi.Geometry,new ln({opacity:0,transparent:!0})),this.isLensflare=!0,this.type="Lensflare",this.frustumCulled=!1,this.renderOrder=1/0;const t=new de,e=new de,n=new xo(new Uint8Array(16*16*3),16,16,pi);n.minFilter=qt,n.magFilter=qt,n.wrapS=un,n.wrapT=un;const r=new xo(new Uint8Array(16*16*3),16,16,pi);r.minFilter=qt,r.magFilter=qt,r.wrapS=un,r.wrapT=un;const i=xi.Geometry,o=new Rr({uniforms:{scale:{value:null},screenPosition:{value:null}},vertexShader:` + + precision highp float; + + uniform vec3 screenPosition; + uniform vec2 scale; + + attribute vec3 position; + + void main() { + + gl_Position = vec4( position.xy * scale + screenPosition.xy, screenPosition.z, 1.0 ); + + }`,fragmentShader:` + + precision highp float; + + void main() { + + gl_FragColor = vec4( 1.0, 0.0, 1.0, 1.0 ); + + }`,depthTest:!0,depthWrite:!1,transparent:!1}),a=new Rr({uniforms:{map:{value:n},scale:{value:null},screenPosition:{value:null}},vertexShader:` + + precision highp float; + + uniform vec3 screenPosition; + uniform vec2 scale; + + attribute vec3 position; + attribute vec2 uv; + + varying vec2 vUV; + + void main() { + + vUV = uv; + + gl_Position = vec4( position.xy * scale + screenPosition.xy, screenPosition.z, 1.0 ); + + }`,fragmentShader:` + + precision highp float; + + uniform sampler2D map; + + varying vec2 vUV; + + void main() { + + gl_FragColor = texture2D( map, vUV ); + + }`,depthTest:!1,depthWrite:!1,transparent:!1}),s=new Yt(i,o),l=[],u=js.Shader,c=new Rr({uniforms:{map:{value:null},occlusionMap:{value:r},color:{value:new Xe(16777215)},scale:{value:new Ge},screenPosition:{value:new de}},vertexShader:u.vertexShader,fragmentShader:u.fragmentShader,blending:ku,transparent:!0,depthWrite:!1}),d=new Yt(i,c);this.addElement=function(v){l.push(v)};const p=new Ge,f=new Ge,h=new Tu,w=new zt;this.onBeforeRender=function(v,g,E){v.getCurrentViewport(w);const T=w.w/w.z,M=w.z/2,N=w.w/2;let m=16/w.w;if(p.set(m*T,m),h.min.set(w.x,w.y),h.max.set(w.x+(w.z-16),w.y+(w.w-16)),e.setFromMatrixPosition(this.matrixWorld),e.applyMatrix4(E.matrixWorldInverse),!(e.z>0)&&(t.copy(e).applyMatrix4(E.projectionMatrix),f.x=w.x+t.x*M+M-8,f.y=w.y+t.y*N+N-8,h.containsPoint(f))){v.copyFramebufferToTexture(f,n);let _=o.uniforms;_.scale.value=p,_.screenPosition.value=t,v.renderBufferDirect(E,null,i,o,s,null),v.copyFramebufferToTexture(f,r),_=a.uniforms,_.scale.value=p,_.screenPosition.value=t,v.renderBufferDirect(E,null,i,a,s,null);const x=-t.x*2,b=-t.y*2;for(let y=0,A=l.length;ye in t?Hd(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,$s=(t,e,n)=>(Gd(t,typeof e!="symbol"?e+"":e,n),n);const ar={uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new de},up:{value:new de(0,1,0)}},vertexShader:` + uniform vec3 sunPosition; + uniform float rayleigh; + uniform float turbidity; + uniform float mieCoefficient; + uniform vec3 up; + + varying vec3 vWorldPosition; + varying vec3 vSunDirection; + varying float vSunfade; + varying vec3 vBetaR; + varying vec3 vBetaM; + varying float vSunE; + + // constants for atmospheric scattering + const float e = 2.71828182845904523536028747135266249775724709369995957; + const float pi = 3.141592653589793238462643383279502884197169; + + // wavelength of used primaries, according to preetham + const vec3 lambda = vec3( 680E-9, 550E-9, 450E-9 ); + // this pre-calcuation replaces older TotalRayleigh(vec3 lambda) function: + // (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn)) + const vec3 totalRayleigh = vec3( 5.804542996261093E-6, 1.3562911419845635E-5, 3.0265902468824876E-5 ); + + // mie stuff + // K coefficient for the primaries + const float v = 4.0; + const vec3 K = vec3( 0.686, 0.678, 0.666 ); + // MieConst = pi * pow( ( 2.0 * pi ) / lambda, vec3( v - 2.0 ) ) * K + const vec3 MieConst = vec3( 1.8399918514433978E14, 2.7798023919660528E14, 4.0790479543861094E14 ); + + // earth shadow hack + // cutoffAngle = pi / 1.95; + const float cutoffAngle = 1.6110731556870734; + const float steepness = 1.5; + const float EE = 1000.0; + + float sunIntensity( float zenithAngleCos ) { + zenithAngleCos = clamp( zenithAngleCos, -1.0, 1.0 ); + return EE * max( 0.0, 1.0 - pow( e, -( ( cutoffAngle - acos( zenithAngleCos ) ) / steepness ) ) ); + } + + vec3 totalMie( float T ) { + float c = ( 0.2 * T ) * 10E-18; + return 0.434 * c * MieConst; + } + + void main() { + + vec4 worldPosition = modelMatrix * vec4( position, 1.0 ); + vWorldPosition = worldPosition.xyz; + + gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); + gl_Position.z = gl_Position.w; // set z to camera.far + + vSunDirection = normalize( sunPosition ); + + vSunE = sunIntensity( dot( vSunDirection, up ) ); + + vSunfade = 1.0 - clamp( 1.0 - exp( ( sunPosition.y / 450000.0 ) ), 0.0, 1.0 ); + + float rayleighCoefficient = rayleigh - ( 1.0 * ( 1.0 - vSunfade ) ); + + // extinction (absorbtion + out scattering) + // rayleigh coefficients + vBetaR = totalRayleigh * rayleighCoefficient; + + // mie coefficients + vBetaM = totalMie( turbidity ) * mieCoefficient; + + } + `,fragmentShader:` + varying vec3 vWorldPosition; + varying vec3 vSunDirection; + varying float vSunfade; + varying vec3 vBetaR; + varying vec3 vBetaM; + varying float vSunE; + + uniform float mieDirectionalG; + uniform vec3 up; + + const vec3 cameraPos = vec3( 0.0, 0.0, 0.0 ); + + // constants for atmospheric scattering + const float pi = 3.141592653589793238462643383279502884197169; + + const float n = 1.0003; // refractive index of air + const float N = 2.545E25; // number of molecules per unit volume for air at 288.15K and 1013mb (sea level -45 celsius) + + // optical length at zenith for molecules + const float rayleighZenithLength = 8.4E3; + const float mieZenithLength = 1.25E3; + // 66 arc seconds -> degrees, and the cosine of that + const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324; + + // 3.0 / ( 16.0 * pi ) + const float THREE_OVER_SIXTEENPI = 0.05968310365946075; + // 1.0 / ( 4.0 * pi ) + const float ONE_OVER_FOURPI = 0.07957747154594767; + + float rayleighPhase( float cosTheta ) { + return THREE_OVER_SIXTEENPI * ( 1.0 + pow( cosTheta, 2.0 ) ); + } + + float hgPhase( float cosTheta, float g ) { + float g2 = pow( g, 2.0 ); + float inverse = 1.0 / pow( 1.0 - 2.0 * g * cosTheta + g2, 1.5 ); + return ONE_OVER_FOURPI * ( ( 1.0 - g2 ) * inverse ); + } + + void main() { + + vec3 direction = normalize( vWorldPosition - cameraPos ); + + // optical length + // cutoff angle at 90 to avoid singularity in next formula. + float zenithAngle = acos( max( 0.0, dot( up, direction ) ) ); + float inverse = 1.0 / ( cos( zenithAngle ) + 0.15 * pow( 93.885 - ( ( zenithAngle * 180.0 ) / pi ), -1.253 ) ); + float sR = rayleighZenithLength * inverse; + float sM = mieZenithLength * inverse; + + // combined extinction factor + vec3 Fex = exp( -( vBetaR * sR + vBetaM * sM ) ); + + // in scattering + float cosTheta = dot( direction, vSunDirection ); + + float rPhase = rayleighPhase( cosTheta * 0.5 + 0.5 ); + vec3 betaRTheta = vBetaR * rPhase; + + float mPhase = hgPhase( cosTheta, mieDirectionalG ); + vec3 betaMTheta = vBetaM * mPhase; + + vec3 Lin = pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * ( 1.0 - Fex ), vec3( 1.5 ) ); + Lin *= mix( vec3( 1.0 ), pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * Fex, vec3( 1.0 / 2.0 ) ), clamp( pow( 1.0 - dot( up, vSunDirection ), 5.0 ), 0.0, 1.0 ) ); + + // nightsky + float theta = acos( direction.y ); // elevation --> y-axis, [-pi/2, pi/2] + float phi = atan( direction.z, direction.x ); // azimuth --> x-axis [-pi/2, pi/2] + vec2 uv = vec2( phi, theta ) / vec2( 2.0 * pi, pi ) + vec2( 0.5, 0.0 ); + vec3 L0 = vec3( 0.1 ) * Fex; + + // composition + solar disc + float sundisk = smoothstep( sunAngularDiameterCos, sunAngularDiameterCos + 0.00002, cosTheta ); + L0 += ( vSunE * 19000.0 * Fex ) * sundisk; + + vec3 texColor = ( Lin + L0 ) * 0.04 + vec3( 0.0, 0.0003, 0.00075 ); + + vec3 retColor = pow( texColor, vec3( 1.0 / ( 1.2 + ( 1.2 * vSunfade ) ) ) ); + + gl_FragColor = vec4( retColor, 1.0 ); + + #include + #include <${qi>=154?"colorspace_fragment":"encodings_fragment"}> + + } + `},Vs=new On({name:"SkyShader",fragmentShader:ar.fragmentShader,vertexShader:ar.vertexShader,uniforms:$i.clone(ar.uniforms),side:fu,depthWrite:!1});let Hs=class extends Yt{constructor(){super(new yu(1,1,1),Vs)}};$s(Hs,"SkyShader",ar);$s(Hs,"material",Vs);new pu;new de;new is(0,0,0,"YXZ");new de;var Kd=Object.defineProperty,qd=(t,e,n)=>e in t?Kd(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ae=(t,e,n)=>(qd(t,typeof e!="symbol"?e+"":e,n),n);const Hn=new du,Lo=new ts,Yd=Math.cos(70*(Math.PI/180)),Bo=(t,e)=>(t%e+e)%e;class Wd extends cu{constructor(e,n){super(),ae(this,"object"),ae(this,"domElement"),ae(this,"enabled",!0),ae(this,"target",new de),ae(this,"minDistance",0),ae(this,"maxDistance",1/0),ae(this,"minZoom",0),ae(this,"maxZoom",1/0),ae(this,"minPolarAngle",0),ae(this,"maxPolarAngle",Math.PI),ae(this,"minAzimuthAngle",-1/0),ae(this,"maxAzimuthAngle",1/0),ae(this,"enableDamping",!1),ae(this,"dampingFactor",.05),ae(this,"enableZoom",!0),ae(this,"zoomSpeed",1),ae(this,"enableRotate",!0),ae(this,"rotateSpeed",1),ae(this,"enablePan",!0),ae(this,"panSpeed",1),ae(this,"screenSpacePanning",!0),ae(this,"keyPanSpeed",7),ae(this,"zoomToCursor",!1),ae(this,"autoRotate",!1),ae(this,"autoRotateSpeed",2),ae(this,"reverseOrbit",!1),ae(this,"reverseHorizontalOrbit",!1),ae(this,"reverseVerticalOrbit",!1),ae(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),ae(this,"mouseButtons",{LEFT:tn.ROTATE,MIDDLE:tn.DOLLY,RIGHT:tn.PAN}),ae(this,"touches",{ONE:Lt.ROTATE,TWO:Lt.DOLLY_PAN}),ae(this,"target0"),ae(this,"position0"),ae(this,"zoom0"),ae(this,"_domElementKeyEvents",null),ae(this,"getPolarAngle"),ae(this,"getAzimuthalAngle"),ae(this,"setPolarAngle"),ae(this,"setAzimuthalAngle"),ae(this,"getDistance"),ae(this,"getZoomScale"),ae(this,"listenToKeyEvents"),ae(this,"stopListenToKeyEvents"),ae(this,"saveState"),ae(this,"reset"),ae(this,"update"),ae(this,"connect"),ae(this,"dispose"),ae(this,"dollyIn"),ae(this,"dollyOut"),ae(this,"getScale"),ae(this,"setScale"),this.object=e,this.domElement=n,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>c.phi,this.getAzimuthalAngle=()=>c.theta,this.setPolarAngle=L=>{let W=Bo(L,2*Math.PI),re=c.phi;re<0&&(re+=2*Math.PI),W<0&&(W+=2*Math.PI);let Ce=Math.abs(W-re);2*Math.PI-Ce{let W=Bo(L,2*Math.PI),re=c.theta;re<0&&(re+=2*Math.PI),W<0&&(W+=2*Math.PI);let Ce=Math.abs(W-re);2*Math.PI-Cer.object.position.distanceTo(r.target),this.listenToKeyEvents=L=>{L.addEventListener("keydown",ne),this._domElementKeyEvents=L},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",ne),this._domElementKeyEvents=null},this.saveState=()=>{r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=()=>{r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(i),r.update(),l=s.NONE},this.update=(()=>{const L=new de,W=new de(0,1,0),re=new ur().setFromUnitVectors(e.up,W),Ce=re.clone().invert(),it=new de,ht=new ur,Un=2*Math.PI;return function(){const vo=r.object.position;re.setFromUnitVectors(e.up,W),Ce.copy(re).invert(),L.copy(vo).sub(r.target),L.applyQuaternion(re),c.setFromVector3(L),r.autoRotate&&l===s.NONE&&F(R()),r.enableDamping?(c.theta+=d.theta*r.dampingFactor,c.phi+=d.phi*r.dampingFactor):(c.theta+=d.theta,c.phi+=d.phi);let kt=r.minAzimuthAngle,Tt=r.maxAzimuthAngle;isFinite(kt)&&isFinite(Tt)&&(kt<-Math.PI?kt+=Un:kt>Math.PI&&(kt-=Un),Tt<-Math.PI?Tt+=Un:Tt>Math.PI&&(Tt-=Un),kt<=Tt?c.theta=Math.max(kt,Math.min(Tt,c.theta)):c.theta=c.theta>(kt+Tt)/2?Math.max(kt,c.theta):Math.min(Tt,c.theta)),c.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,c.phi)),c.makeSafe(),r.enableDamping===!0?r.target.addScaledVector(f,r.dampingFactor):r.target.add(f),r.zoomToCursor&&b||r.object.isOrthographicCamera?c.radius=C(c.radius):c.radius=C(c.radius*p),L.setFromSpherical(c),L.applyQuaternion(Ce),vo.copy(r.target).add(L),r.object.matrixAutoUpdate||r.object.updateMatrix(),r.object.lookAt(r.target),r.enableDamping===!0?(d.theta*=1-r.dampingFactor,d.phi*=1-r.dampingFactor,f.multiplyScalar(1-r.dampingFactor)):(d.set(0,0,0),f.set(0,0,0));let bn=!1;if(r.zoomToCursor&&b){let xn=null;if(r.object instanceof Bt&&r.object.isPerspectiveCamera){const wn=L.length();xn=C(wn*p);const jn=wn-xn;r.object.position.addScaledVector(_,jn),r.object.updateMatrixWorld()}else if(r.object.isOrthographicCamera){const wn=new de(x.x,x.y,0);wn.unproject(r.object),r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/p)),r.object.updateProjectionMatrix(),bn=!0;const jn=new de(x.x,x.y,0);jn.unproject(r.object),r.object.position.sub(jn).add(wn),r.object.updateMatrixWorld(),xn=L.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),r.zoomToCursor=!1;xn!==null&&(r.screenSpacePanning?r.target.set(0,0,-1).transformDirection(r.object.matrix).multiplyScalar(xn).add(r.object.position):(Hn.origin.copy(r.object.position),Hn.direction.set(0,0,-1).transformDirection(r.object.matrix),Math.abs(r.object.up.dot(Hn.direction))u||8*(1-ht.dot(r.object.quaternion))>u?(r.dispatchEvent(i),it.copy(r.object.position),ht.copy(r.object.quaternion),bn=!1,!0):!1}})(),this.connect=L=>{r.domElement=L,r.domElement.style.touchAction="none",r.domElement.addEventListener("contextmenu",Ue),r.domElement.addEventListener("pointerdown",Me),r.domElement.addEventListener("pointercancel",We),r.domElement.addEventListener("wheel",X)},this.dispose=()=>{var L,W,re,Ce,it,ht;r.domElement&&(r.domElement.style.touchAction="auto"),(L=r.domElement)==null||L.removeEventListener("contextmenu",Ue),(W=r.domElement)==null||W.removeEventListener("pointerdown",Me),(re=r.domElement)==null||re.removeEventListener("pointercancel",We),(Ce=r.domElement)==null||Ce.removeEventListener("wheel",X),(it=r.domElement)==null||it.ownerDocument.removeEventListener("pointermove",Ke),(ht=r.domElement)==null||ht.ownerDocument.removeEventListener("pointerup",We),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",ne)};const r=this,i={type:"change"},o={type:"start"},a={type:"end"},s={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=s.NONE;const u=1e-6,c=new bo,d=new bo;let p=1;const f=new de,h=new Ge,w=new Ge,v=new Ge,g=new Ge,E=new Ge,T=new Ge,M=new Ge,N=new Ge,m=new Ge,_=new de,x=new Ge;let b=!1;const y=[],A={};function R(){return 2*Math.PI/60/60*r.autoRotateSpeed}function z(){return Math.pow(.95,r.zoomSpeed)}function F(L){r.reverseOrbit||r.reverseHorizontalOrbit?d.theta+=L:d.theta-=L}function B(L){r.reverseOrbit||r.reverseVerticalOrbit?d.phi+=L:d.phi-=L}const $=(()=>{const L=new de;return function(W,re){L.setFromMatrixColumn(re,0),L.multiplyScalar(-W),f.add(L)}})(),ie=(()=>{const L=new de;return function(W,re){r.screenSpacePanning===!0?L.setFromMatrixColumn(re,1):(L.setFromMatrixColumn(re,0),L.crossVectors(r.object.up,L)),L.multiplyScalar(W),f.add(L)}})(),te=(()=>{const L=new de;return function(W,re){const Ce=r.domElement;if(Ce&&r.object instanceof Bt&&r.object.isPerspectiveCamera){const it=r.object.position;L.copy(it).sub(r.target);let ht=L.length();ht*=Math.tan(r.object.fov/2*Math.PI/180),$(2*W*ht/Ce.clientHeight,r.object.matrix),ie(2*re*ht/Ce.clientHeight,r.object.matrix)}else Ce&&r.object instanceof cn&&r.object.isOrthographicCamera?($(W*(r.object.right-r.object.left)/r.object.zoom/Ce.clientWidth,r.object.matrix),ie(re*(r.object.top-r.object.bottom)/r.object.zoom/Ce.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}})();function ue(L){r.object instanceof Bt&&r.object.isPerspectiveCamera||r.object instanceof cn&&r.object.isOrthographicCamera?p=L:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function S(L){ue(p/L)}function we(L){ue(p*L)}function Fe(L){if(!r.zoomToCursor||!r.domElement)return;b=!0;const W=r.domElement.getBoundingClientRect(),re=L.clientX-W.left,Ce=L.clientY-W.top,it=W.width,ht=W.height;x.x=re/it*2-1,x.y=-(Ce/ht)*2+1,_.set(x.x,x.y,1).unproject(r.object).sub(r.object.position).normalize()}function C(L){return Math.max(r.minDistance,Math.min(r.maxDistance,L))}function ye(L){h.set(L.clientX,L.clientY)}function Ie(L){Fe(L),M.set(L.clientX,L.clientY)}function _e(L){g.set(L.clientX,L.clientY)}function $e(L){w.set(L.clientX,L.clientY),v.subVectors(w,h).multiplyScalar(r.rotateSpeed);const W=r.domElement;W&&(F(2*Math.PI*v.x/W.clientHeight),B(2*Math.PI*v.y/W.clientHeight)),h.copy(w),r.update()}function K(L){N.set(L.clientX,L.clientY),m.subVectors(N,M),m.y>0?S(z()):m.y<0&&we(z()),M.copy(N),r.update()}function k(L){E.set(L.clientX,L.clientY),T.subVectors(E,g).multiplyScalar(r.panSpeed),te(T.x,T.y),g.copy(E),r.update()}function I(L){Fe(L),L.deltaY<0?we(z()):L.deltaY>0&&S(z()),r.update()}function O(L){let W=!1;switch(L.code){case r.keys.UP:te(0,r.keyPanSpeed),W=!0;break;case r.keys.BOTTOM:te(0,-r.keyPanSpeed),W=!0;break;case r.keys.LEFT:te(r.keyPanSpeed,0),W=!0;break;case r.keys.RIGHT:te(-r.keyPanSpeed,0),W=!0;break}W&&(L.preventDefault(),r.update())}function H(){if(y.length==1)h.set(y[0].pageX,y[0].pageY);else{const L=.5*(y[0].pageX+y[1].pageX),W=.5*(y[0].pageY+y[1].pageY);h.set(L,W)}}function U(){if(y.length==1)g.set(y[0].pageX,y[0].pageY);else{const L=.5*(y[0].pageX+y[1].pageX),W=.5*(y[0].pageY+y[1].pageY);g.set(L,W)}}function Y(){const L=y[0].pageX-y[1].pageX,W=y[0].pageY-y[1].pageY,re=Math.sqrt(L*L+W*W);M.set(0,re)}function G(){r.enableZoom&&Y(),r.enablePan&&U()}function J(){r.enableZoom&&Y(),r.enableRotate&&H()}function se(L){if(y.length==1)w.set(L.pageX,L.pageY);else{const re=wt(L),Ce=.5*(L.pageX+re.x),it=.5*(L.pageY+re.y);w.set(Ce,it)}v.subVectors(w,h).multiplyScalar(r.rotateSpeed);const W=r.domElement;W&&(F(2*Math.PI*v.x/W.clientHeight),B(2*Math.PI*v.y/W.clientHeight)),h.copy(w)}function Z(L){if(y.length==1)E.set(L.pageX,L.pageY);else{const W=wt(L),re=.5*(L.pageX+W.x),Ce=.5*(L.pageY+W.y);E.set(re,Ce)}T.subVectors(E,g).multiplyScalar(r.panSpeed),te(T.x,T.y),g.copy(E)}function le(L){const W=wt(L),re=L.pageX-W.x,Ce=L.pageY-W.y,it=Math.sqrt(re*re+Ce*Ce);N.set(0,it),m.set(0,Math.pow(N.y/M.y,r.zoomSpeed)),S(m.y),M.copy(N)}function me(L){r.enableZoom&&le(L),r.enablePan&&Z(L)}function he(L){r.enableZoom&&le(L),r.enableRotate&&se(L)}function Me(L){var W,re;r.enabled!==!1&&(y.length===0&&((W=r.domElement)==null||W.ownerDocument.addEventListener("pointermove",Ke),(re=r.domElement)==null||re.ownerDocument.addEventListener("pointerup",We)),Qe(L),L.pointerType==="touch"?ce(L):Rt(L))}function Ke(L){r.enabled!==!1&&(L.pointerType==="touch"?Te(L):j(L))}function We(L){var W,re,Ce;Ze(L),y.length===0&&((W=r.domElement)==null||W.releasePointerCapture(L.pointerId),(re=r.domElement)==null||re.ownerDocument.removeEventListener("pointermove",Ke),(Ce=r.domElement)==null||Ce.ownerDocument.removeEventListener("pointerup",We)),r.dispatchEvent(a),l=s.NONE}function Rt(L){let W;switch(L.button){case 0:W=r.mouseButtons.LEFT;break;case 1:W=r.mouseButtons.MIDDLE;break;case 2:W=r.mouseButtons.RIGHT;break;default:W=-1}switch(W){case tn.DOLLY:if(r.enableZoom===!1)return;Ie(L),l=s.DOLLY;break;case tn.ROTATE:if(L.ctrlKey||L.metaKey||L.shiftKey){if(r.enablePan===!1)return;_e(L),l=s.PAN}else{if(r.enableRotate===!1)return;ye(L),l=s.ROTATE}break;case tn.PAN:if(L.ctrlKey||L.metaKey||L.shiftKey){if(r.enableRotate===!1)return;ye(L),l=s.ROTATE}else{if(r.enablePan===!1)return;_e(L),l=s.PAN}break;default:l=s.NONE}l!==s.NONE&&r.dispatchEvent(o)}function j(L){if(r.enabled!==!1)switch(l){case s.ROTATE:if(r.enableRotate===!1)return;$e(L);break;case s.DOLLY:if(r.enableZoom===!1)return;K(L);break;case s.PAN:if(r.enablePan===!1)return;k(L);break}}function X(L){r.enabled===!1||r.enableZoom===!1||l!==s.NONE&&l!==s.ROTATE||(L.preventDefault(),r.dispatchEvent(o),I(L),r.dispatchEvent(a))}function ne(L){r.enabled===!1||r.enablePan===!1||O(L)}function ce(L){switch(Ct(L),y.length){case 1:switch(r.touches.ONE){case Lt.ROTATE:if(r.enableRotate===!1)return;H(),l=s.TOUCH_ROTATE;break;case Lt.PAN:if(r.enablePan===!1)return;U(),l=s.TOUCH_PAN;break;default:l=s.NONE}break;case 2:switch(r.touches.TWO){case Lt.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;G(),l=s.TOUCH_DOLLY_PAN;break;case Lt.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;J(),l=s.TOUCH_DOLLY_ROTATE;break;default:l=s.NONE}break;default:l=s.NONE}l!==s.NONE&&r.dispatchEvent(o)}function Te(L){switch(Ct(L),l){case s.TOUCH_ROTATE:if(r.enableRotate===!1)return;se(L),r.update();break;case s.TOUCH_PAN:if(r.enablePan===!1)return;Z(L),r.update();break;case s.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;me(L),r.update();break;case s.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;he(L),r.update();break;default:l=s.NONE}}function Ue(L){r.enabled!==!1&&L.preventDefault()}function Qe(L){y.push(L)}function Ze(L){delete A[L.pointerId];for(let W=0;W{we(L),r.update()},this.dollyOut=(L=z())=>{S(L),r.update()},this.getScale=()=>p,this.setScale=L=>{ue(L),r.update()},this.getZoomScale=()=>z(),n!==void 0&&this.connect(n),this.update()}}new Mt;new de;new is;new de;var Xd=Object.defineProperty,Qd=(t,e,n)=>e in t?Xd(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Yi=(t,e,n)=>(Qd(t,typeof e!="symbol"?e+"":e,n),n);class Gs{constructor(e){Yi(this,"data"),this.data=e}generateShapes(e,n=100,r){const i=[],o={letterSpacing:0,lineHeight:1,...r},a=Zd(e,n,this.data,o);for(let s=0,l=a.length;s + #include + #include + uniform float thickness; + uniform bool screenspace; + uniform vec2 size; + void main() { + #if defined (USE_SKINNING) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + vec4 tNormal = vec4(normal, 0.0); + vec4 tPosition = vec4(transformed, 1.0); + #ifdef USE_INSTANCING + tNormal = instanceMatrix * tNormal; + tPosition = instanceMatrix * tPosition; + #endif + if (screenspace) { + vec3 newPosition = tPosition.xyz + tNormal.xyz * thickness; + gl_Position = projectionMatrix * modelViewMatrix * vec4(newPosition, 1.0); + } else { + vec4 clipPosition = projectionMatrix * modelViewMatrix * tPosition; + vec4 clipNormal = projectionMatrix * modelViewMatrix * tNormal; + vec2 offset = normalize(clipNormal.xy) * thickness / size * clipPosition.w * 2.0; + clipPosition.xy += offset; + gl_Position = clipPosition; + } + }`,`uniform vec3 color; + uniform float opacity; + void main(){ + gl_FragColor = vec4(color, opacity); + #include + #include + }`);const ef=["args","material-uniforms-color-value"];bi.ReflectorShader;new de;new de;new de;var jr;/Mac/.test((jr=globalThis==null?void 0:globalThis.navigator)===null||jr===void 0?void 0:jr.platform);const tf=["target","auto-rotate","auto-rotate-speed","enable-damping","damping-factor","enable-pan","key-pan-speed","keys","max-azimuth-angle","min-azimuth-angle","max-polar-angle","min-polar-angle","min-distance","max-distance","min-zoom","max-zoom","touches","enable-zoom","zoom-speed","enable-rotate","rotate-speed","args"],nf=xe({__name:"OrbitControls",props:{makeDefault:{type:Boolean,default:!1},camera:{},domElement:{},target:{default:()=>[0,0,0]},enableDamping:{type:Boolean,default:!0},dampingFactor:{default:.05},autoRotate:{type:Boolean,default:!1},autoRotateSpeed:{default:2},enablePan:{type:Boolean,default:!0},keyPanSpeed:{default:7},keys:{},maxAzimuthAngle:{default:Number.POSITIVE_INFINITY},minAzimuthAngle:{default:Number.NEGATIVE_INFINITY},maxPolarAngle:{default:Math.PI},minPolarAngle:{default:0},minDistance:{default:0},maxDistance:{default:Number.POSITIVE_INFINITY},minZoom:{default:0},maxZoom:{default:Number.POSITIVE_INFINITY},touches:{default:()=>({ONE:Lt.ROTATE,TWO:Lt.DOLLY_PAN})},enableZoom:{type:Boolean,default:!0},zoomSpeed:{default:1},enableRotate:{type:Boolean,default:!0},rotateSpeed:{default:1}},emits:["change","start","end"],setup(t,{expose:e,emit:n}){const r=t,i=n,{makeDefault:o,autoRotate:a,autoRotateSpeed:s,enableDamping:l,dampingFactor:u,enablePan:c,keyPanSpeed:d,maxAzimuthAngle:p,minAzimuthAngle:f,maxPolarAngle:h,minPolarAngle:w,minDistance:v,maxDistance:g,minZoom:E,maxZoom:T,enableZoom:M,zoomSpeed:N,enableRotate:m,touches:_,rotateSpeed:x,target:b}=gn(r),{camera:y,renderer:A,extend:R,controls:z,invalidate:F}=yr(),B=es(null);R({OrbitControls:Wd}),Ee(B,te=>{$(),te&&o.value?z.value=te:z.value=null});function $(){Lr(B.value,"change",()=>{i("change",B.value),F()}),Lr(B.value,"start",()=>i("start",B.value)),Lr(B.value,"end",()=>i("end",B.value))}const{onBeforeRender:ie}=Fi();return ie(({invalidate:te})=>{B.value&&(l.value||a.value)&&(B.value.update(),a.value&&te())}),ut(()=>{B.value&&B.value.dispose()}),e({instance:B}),(te,ue)=>(te.camera||D(y))&&(te.domElement||D(A))?(Q(),ee("TresOrbitControls",{key:0,ref_key:"controlsRef",ref:B,target:D(b),"auto-rotate":D(a),"auto-rotate-speed":D(s),"enable-damping":D(l),"damping-factor":D(u),"enable-pan":D(c),"key-pan-speed":D(d),keys:te.keys,"max-azimuth-angle":D(p),"min-azimuth-angle":D(f),"max-polar-angle":D(h),"min-polar-angle":D(w),"min-distance":D(v),"max-distance":D(g),"min-zoom":D(E),"max-zoom":D(T),touches:D(_),"enable-zoom":D(M),"zoom-speed":D(N),"enable-rotate":D(m),"rotate-speed":D(x),args:[te.camera||D(y),te.domElement||D(A).domElement]},null,8,tf)):Ye("",!0)}});function Gn(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var zo={exports:{}},Fo;function rf(){return Fo||(Fo=1,function(t,e){(function(n){t.exports=n()})(function(){return function n(r,i,o){function a(u,c){if(!i[u]){if(!r[u]){var d=typeof Gn=="function"&&Gn;if(!c&&d)return d(u,!0);if(s)return s(u,!0);throw new Error("Cannot find module '"+u+"'")}c=i[u]={exports:{}},r[u][0].call(c.exports,function(p){var f=r[u][1][p];return a(f||p)},c,c.exports,n,r,i,o)}return i[u].exports}for(var s=typeof Gn=="function"&&Gn,l=0;l>16),B((65280&y)>>8),B(255&y);return A==2?B(255&(y=_(x.charAt(b))<<2|_(x.charAt(b+1))>>4)):A==1&&(B((y=_(x.charAt(b))<<10|_(x.charAt(b+1))<<4|_(x.charAt(b+2))>>2)>>8&255),B(255&y)),R},h.fromByteArray=function(x){var b,y,A,R,z=x.length%3,F="";function B($){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt($)}for(b=0,A=x.length-z;b>18&63)+B(R>>12&63)+B(R>>6&63)+B(63&R);switch(z){case 1:F=(F+=B((y=x[x.length-1])>>2))+B(y<<4&63)+"==";break;case 2:F=(F=(F+=B((y=(x[x.length-2]<<8)+x[x.length-1])>>10))+B(y>>4&63))+B(y<<2&63)+"="}return F}})(i===void 0?this.base64js={}:i)}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(n,r,i){(function(o,a,v,l,u,c,d,p,f){var h=n("base64-js"),w=n("ieee754");function v(k,I,O){if(!(this instanceof v))return new v(k,I,O);var H,U,Y,G,J=typeof k;if(I==="base64"&&J=="string")for(k=(G=k).trim?G.trim():G.replace(/^\s+|\s+$/g,"");k.length%4!=0;)k+="=";if(J=="number")H=te(k);else if(J=="string")H=v.byteLength(k,I);else{if(J!="object")throw new Error("First argument needs to be a number, array or string.");H=te(k.length)}if(v._useTypedArrays?U=v._augment(new Uint8Array(H)):((U=this).length=H,U._isBuffer=!0),v._useTypedArrays&&typeof k.byteLength=="number")U._set(k);else if(ue(G=k)||v.isBuffer(G)||G&&typeof G=="object"&&typeof G.length=="number")for(Y=0;Y>8,G=G%256,J.push(G),J.push(Y);return J}(I),k,O,H)}function T(k,I,O){var H="";O=Math.min(k.length,O);for(var U=I;U>>0)):(I+1>>0),U}function m(k,I,O,H){if(H||(K(typeof O=="boolean","missing or invalid endian"),K(I!=null,"missing offset"),K(I+1>>8*(H?Y:1-Y)}function A(k,I,O,H,U){if(U||(K(I!=null,"missing value"),K(typeof H=="boolean","missing or invalid endian"),K(O!=null,"missing offset"),K(O+3>>8*(H?Y:3-Y)&255}function R(k,I,O,H,U){U||(K(I!=null,"missing value"),K(typeof H=="boolean","missing or invalid endian"),K(O!=null,"missing offset"),K(O+1this.length&&(H=this.length);var U=(H=k.length-I=this.length))return this[k]},v.prototype.readUInt16LE=function(k,I){return M(this,k,!0,I)},v.prototype.readUInt16BE=function(k,I){return M(this,k,!1,I)},v.prototype.readUInt32LE=function(k,I){return N(this,k,!0,I)},v.prototype.readUInt32BE=function(k,I){return N(this,k,!1,I)},v.prototype.readInt8=function(k,I){if(I||(K(k!=null,"missing offset"),K(k=this.length))return 128&this[k]?-1*(255-this[k]+1):this[k]},v.prototype.readInt16LE=function(k,I){return m(this,k,!0,I)},v.prototype.readInt16BE=function(k,I){return m(this,k,!1,I)},v.prototype.readInt32LE=function(k,I){return _(this,k,!0,I)},v.prototype.readInt32BE=function(k,I){return _(this,k,!1,I)},v.prototype.readFloatLE=function(k,I){return x(this,k,!0,I)},v.prototype.readFloatBE=function(k,I){return x(this,k,!1,I)},v.prototype.readDoubleLE=function(k,I){return b(this,k,!0,I)},v.prototype.readDoubleBE=function(k,I){return b(this,k,!1,I)},v.prototype.writeUInt8=function(k,I,O){O||(K(k!=null,"missing value"),K(I!=null,"missing offset"),K(I=this.length||(this[I]=k)},v.prototype.writeUInt16LE=function(k,I,O){y(this,k,I,!0,O)},v.prototype.writeUInt16BE=function(k,I,O){y(this,k,I,!1,O)},v.prototype.writeUInt32LE=function(k,I,O){A(this,k,I,!0,O)},v.prototype.writeUInt32BE=function(k,I,O){A(this,k,I,!1,O)},v.prototype.writeInt8=function(k,I,O){O||(K(k!=null,"missing value"),K(I!=null,"missing offset"),K(I=this.length||(0<=k?this.writeUInt8(k,I,O):this.writeUInt8(255+k+1,I,O))},v.prototype.writeInt16LE=function(k,I,O){R(this,k,I,!0,O)},v.prototype.writeInt16BE=function(k,I,O){R(this,k,I,!1,O)},v.prototype.writeInt32LE=function(k,I,O){z(this,k,I,!0,O)},v.prototype.writeInt32BE=function(k,I,O){z(this,k,I,!1,O)},v.prototype.writeFloatLE=function(k,I,O){F(this,k,I,!0,O)},v.prototype.writeFloatBE=function(k,I,O){F(this,k,I,!1,O)},v.prototype.writeDoubleLE=function(k,I,O){B(this,k,I,!0,O)},v.prototype.writeDoubleBE=function(k,I,O){B(this,k,I,!1,O)},v.prototype.fill=function(k,I,O){if(I=I||0,O=O||this.length,K(typeof(k=typeof(k=k||0)=="string"?k.charCodeAt(0):k)=="number"&&!isNaN(k),"value is not a number"),K(I<=O,"end < start"),O!==I&&this.length!==0){K(0<=I&&I"},v.prototype.toArrayBuffer=function(){if(typeof Uint8Array>"u")throw new Error("Buffer.toArrayBuffer not supported in this browser");if(v._useTypedArrays)return new v(this).buffer;for(var k=new Uint8Array(this.length),I=0,O=k.length;I=I.length||U>=k.length);U++)I[U+O]=k[U];return U}function ye(k){try{return decodeURIComponent(k)}catch{return"�"}}function Ie(k,I){K(typeof k=="number","cannot write a non-number as a number"),K(0<=k,"specified a negative value for writing an unsigned value"),K(k<=I,"value is larger than maximum value for type"),K(Math.floor(k)===k,"value has a fractional component")}function _e(k,I,O){K(typeof k=="number","cannot write a non-number as a number"),K(k<=I,"value larger than maximum allowed value"),K(O<=k,"value smaller than minimum allowed value"),K(Math.floor(k)===k,"value has a fractional component")}function $e(k,I,O){K(typeof k=="number","cannot write a non-number as a number"),K(k<=I,"value larger than maximum allowed value"),K(O<=k,"value smaller than minimum allowed value")}function K(k,I){if(!k)throw new Error(I||"Failed assertion")}v._augment=function(k){return k._isBuffer=!0,k._get=k.get,k._set=k.set,k.get=$.get,k.set=$.set,k.write=$.write,k.toString=$.toString,k.toLocaleString=$.toString,k.toJSON=$.toJSON,k.copy=$.copy,k.slice=$.slice,k.readUInt8=$.readUInt8,k.readUInt16LE=$.readUInt16LE,k.readUInt16BE=$.readUInt16BE,k.readUInt32LE=$.readUInt32LE,k.readUInt32BE=$.readUInt32BE,k.readInt8=$.readInt8,k.readInt16LE=$.readInt16LE,k.readInt16BE=$.readInt16BE,k.readInt32LE=$.readInt32LE,k.readInt32BE=$.readInt32BE,k.readFloatLE=$.readFloatLE,k.readFloatBE=$.readFloatBE,k.readDoubleLE=$.readDoubleLE,k.readDoubleBE=$.readDoubleBE,k.writeUInt8=$.writeUInt8,k.writeUInt16LE=$.writeUInt16LE,k.writeUInt16BE=$.writeUInt16BE,k.writeUInt32LE=$.writeUInt32LE,k.writeUInt32BE=$.writeUInt32BE,k.writeInt8=$.writeInt8,k.writeInt16LE=$.writeInt16LE,k.writeInt16BE=$.writeInt16BE,k.writeInt32LE=$.writeInt32LE,k.writeInt32BE=$.writeInt32BE,k.writeFloatLE=$.writeFloatLE,k.writeFloatBE=$.writeFloatBE,k.writeDoubleLE=$.writeDoubleLE,k.writeDoubleBE=$.writeDoubleBE,k.fill=$.fill,k.inspect=$.inspect,k.toArrayBuffer=$.toArrayBuffer,k}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(n,r,i){(function(o,a,h,l,u,c,d,p,f){var h=n("buffer").Buffer,w=4,v=new h(w);v.fill(0),r.exports={hash:function(g,E,T,M){for(var N=E(function(y,A){y.length%w!=0&&(R=y.length+(w-y.length%w),y=h.concat([y,v],R));for(var R,z=[],F=A?y.readInt32BE:y.readInt32LE,B=0;BT?ie=$(ie):ie.length>5]|=128<<_%32,m[14+(_+64>>>9<<4)]=_;for(var x=1732584193,b=-271733879,y=-1732584194,A=271733878,R=0;R>>32-y,x)}function g(m,_,x,b,y,A,R){return v(_&x|~_&b,m,_,y,A,R)}function E(m,_,x,b,y,A,R){return v(_&b|x&~b,m,_,y,A,R)}function T(m,_,x,b,y,A,R){return v(_^x^b,m,_,y,A,R)}function M(m,_,x,b,y,A,R){return v(x^(_|~b),m,_,y,A,R)}function N(m,_){var x=(65535&m)+(65535&_);return(m>>16)+(_>>16)+(x>>16)<<16|65535&x}r.exports=function(m){return h.hash(m,w,16)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(n,r,i){(function(o,a,s,l,u,c,d,p,f){r.exports=function(h){for(var w,v=new Array(h),g=0;g>>((3&g)<<3)&255;return v}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(n,r,i){(function(o,a,s,l,u,c,d,p,f){var h=n("./helpers");function w(E,T){E[T>>5]|=128<<24-T%32,E[15+(T+64>>9<<4)]=T;for(var M,N,m,_=Array(80),x=1732584193,b=-271733879,y=-1732584194,A=271733878,R=-1009589776,z=0;z>16)+(T>>16)+(M>>16)<<16|65535&M}function g(E,T){return E<>>32-T}r.exports=function(E){return h.hash(E,w,20,!0)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(n,r,i){(function(o,a,s,l,u,c,d,p,f){function h(T,M){var N=(65535&T)+(65535&M);return(T>>16)+(M>>16)+(N>>16)<<16|65535&N}function w(T,M){var N,m=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),_=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),x=new Array(64);T[M>>5]|=128<<24-M%32,T[15+(M+64>>9<<4)]=M;for(var b,y,A=0;A>>M|T<<32-M},E=function(T,M){return T>>>M};r.exports=function(T){return v.hash(T,w,32,!0)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(n,r,i){(function(o,a,s,l,u,c,d,p,f){i.read=function(h,w,v,g,A){var T,M,N=8*A-g-1,m=(1<>1,x=-7,b=v?A-1:0,y=v?-1:1,A=h[w+b];for(b+=y,T=A&(1<<-x)-1,A>>=-x,x+=N;0>=-x,x+=g;0>1,b=E===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=g?0:R-1,A=g?1:-1,R=w<0||w===0&&1/w<0?1:0;for(w=Math.abs(w),isNaN(w)||w===1/0?(N=isNaN(w)?1:0,M=_):(M=Math.floor(Math.log(w)/Math.LN2),w*(g=Math.pow(2,-M))<1&&(M--,g*=2),2<=(w+=1<=M+x?b/g:b*Math.pow(2,1-x))*g&&(M++,g/=2),_<=M+x?(N=0,M=_):1<=M+x?(N=(w*g-1)*Math.pow(2,E),M+=x):(N=w*Math.pow(2,x-1)*Math.pow(2,E),M=0));8<=E;h[v+y]=255&N,y+=A,N/=256,E-=8);for(M=M<>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]),$o}var Ho,Go;function qs(){return Go||(Go=1,Ho=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]),Ho}var $r,Ko;function af(){if(Ko)return $r;Ko=1;var t=Ks();return $r=t.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"]),$r}var Vr,qo;function sf(){if(qo)return Vr;qo=1;var t=qs();return t=t.slice().filter(function(e){return!/^(gl\_|texture)/.test(e)}),Vr=t.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"]),Vr}var Hr,Yo;function lf(){if(Yo)return Hr;Yo=1,Hr=M;var t=Ks(),e=of(),n=qs(),r=af(),i=sf(),o=999,a=9999,s=0,l=1,u=2,c=3,d=4,p=5,f=6,h=7,w=8,v=9,g=10,E=11,T=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function M(N){var m=0,_=0,x=o,b,y,A=[],R=[],z=1,F=0,B=0,$=!1,ie=!1,te="",ue;N=N||{};var S=n,we=t;N.version==="300 es"&&(S=i,we=r);for(var Fe={},C={},m=0;m0)continue;he=Z.slice(0,1).join("")}return ye(he),B+=he.length,A=A.slice(he.length),A.length}while(!0)}function Y(){return/[^a-fA-F0-9]/.test(b)?(ye(A.join("")),x=o,m):(A.push(b),y=b,m+1)}function G(){return b==="."||/[eE]/.test(b)?(A.push(b),x=p,y=b,m+1):b==="x"&&A.length===1&&A[0]==="0"?(x=E,A.push(b),y=b,m+1):/[^\d]/.test(b)?(ye(A.join("")),x=o,m):(A.push(b),y=b,m+1)}function J(){return b==="f"&&(A.push(b),y=b,m+=1),/[eE]/.test(b)||(b==="-"||b==="+")&&/[eE]/.test(y)?(A.push(b),y=b,m+1):/[^\d]/.test(b)?(ye(A.join("")),x=o,m):(A.push(b),y=b,m+1)}function se(){if(/[^\d\w_]/.test(b)){var Z=A.join("");return C[Z]?x=w:Fe[Z]?x=h:x=f,ye(A.join("")),x=o,m}return A.push(b),y=b,m+1}}return Hr}var Gr,Wo;function uf(){if(Wo)return Gr;Wo=1;var t=lf();Gr=e;function e(n,r){var i=t(r),o=[];return o=o.concat(i(n)),o=o.concat(i(null)),o}return Gr}uf();function cf(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function df(t){var e=cf(t,"string");return typeof e=="symbol"?e:String(e)}function Oe(t,e,n){return e=df(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var pe={position:"csm_Position",positionRaw:"csm_PositionRaw",pointSize:"csm_PointSize",fragColor:"csm_FragColor",diffuseColor:"csm_DiffuseColor",normal:"csm_Normal",roughness:"csm_Roughness",metalness:"csm_Metalness",emissive:"csm_Emissive",ao:"csm_AO",bump:"csm_Bump",depthAlpha:"csm_DepthAlpha"},Je,rn;Je={},Oe(Je,"".concat(pe.normal),{"#include ":` + vec3 objectNormal = `.concat(pe.normal,`; + #ifdef USE_TANGENT + vec3 objectTangent = vec3( tangent.xyz ); + #endif + `)}),Oe(Je,"".concat(pe.position),{"#include ":` + vec3 transformed = `.concat(pe.position,`; + `)}),Oe(Je,"".concat(pe.positionRaw),{"#include ":` + vec4 csm_internal_positionUnprojected = `.concat(pe.positionRaw,`; + mat4x4 csm_internal_unprojectMatrix = projectionMatrix * modelViewMatrix; + #ifdef USE_INSTANCING + csm_internal_unprojectMatrix = csm_internal_unprojectMatrix * instanceMatrix; + #endif + csm_internal_positionUnprojected = inverse(csm_internal_unprojectMatrix) * csm_internal_positionUnprojected; + vec3 transformed = csm_internal_positionUnprojected.xyz; + `)}),Oe(Je,"".concat(pe.pointSize),{"gl_PointSize = size;":` + gl_PointSize = `.concat(pe.pointSize,`; + `)}),Oe(Je,"".concat(pe.diffuseColor),{"#include ":` + #include + diffuseColor = `.concat(pe.diffuseColor,`; + `)}),Oe(Je,"".concat(pe.fragColor),{"#include ":` + #include + gl_FragColor = `.concat(pe.fragColor,`; + `)}),Oe(Je,"".concat(pe.emissive),{"vec3 totalEmissiveRadiance = emissive;":` + vec3 totalEmissiveRadiance = `.concat(pe.emissive,`; + `)}),Oe(Je,"".concat(pe.roughness),{"#include ":` + #include + roughnessFactor = `.concat(pe.roughness,`; + `)}),Oe(Je,"".concat(pe.metalness),{"#include ":` + #include + metalnessFactor = `.concat(pe.metalness,`; + `)}),Oe(Je,"".concat(pe.ao),{"#include ":` + #include + reflectedLight.indirectDiffuse *= 1. - `.concat(pe.ao,`; + `)}),Oe(Je,"".concat(pe.bump),{"#include ":` + #include + + vec3 csm_internal_orthogonal = `.concat(pe.bump," - (dot(").concat(pe.bump,`, normal) * normal); + vec3 csm_internal_projectedbump = mat3(csm_internal_vModelViewMatrix) * csm_internal_orthogonal; + normal = normalize(normal - csm_internal_projectedbump); + `)}),Oe(Je,"".concat(pe.depthAlpha),{"gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );":` + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity * `.concat(pe.depthAlpha,` ); + `),"gl_FragColor = packDepthToRGBA( fragCoordZ );":` + gl_FragColor = packDepthToRGBA( fragCoordZ ); + gl_FragColor.a *= `.concat(pe.depthAlpha,`; + `)});rn={},Oe(rn,"".concat(pe.position),{"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );":` + gl_Position = projectionMatrix * modelViewMatrix * vec4( `.concat(pe.position,`, 1.0 ); + `)}),Oe(rn,"".concat(pe.positionRaw),{"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );":` + gl_Position = `.concat(pe.position,`; + `)}),Oe(rn,"".concat(pe.diffuseColor),{"gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );":` + gl_FragColor = `.concat(pe.diffuseColor,`; + `)}),Oe(rn,"".concat(pe.fragColor),{"gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );":` + gl_FragColor = `.concat(pe.fragColor,`; + `)});var et;et={},Oe(et,"".concat(pe.position),"*"),Oe(et,"".concat(pe.positionRaw),"*"),Oe(et,"".concat(pe.normal),"*"),Oe(et,"".concat(pe.pointSize),["PointsMaterial"]),Oe(et,"".concat(pe.diffuseColor),"*"),Oe(et,"".concat(pe.fragColor),"*"),Oe(et,"".concat(pe.emissive),["MeshStandardMaterial","MeshPhysicalMaterial"]),Oe(et,"".concat(pe.roughness),["MeshStandardMaterial","MeshPhysicalMaterial"]),Oe(et,"".concat(pe.metalness),["MeshStandardMaterial","MeshPhysicalMaterial"]),Oe(et,"".concat(pe.ao),["MeshStandardMaterial","MeshPhysicalMaterial","MeshBasicMaterial","MeshLambertMaterial","MeshPhongMaterial","MeshToonMaterial"]),Oe(et,"".concat(pe.bump),["MeshLambertMaterial","MeshMatcapMaterial","MeshNormalMaterial","MeshPhongMaterial","MeshPhysicalMaterial","MeshStandardMaterial","MeshToonMaterial","ShadowMaterial"]),Oe(et,"".concat(pe.depthAlpha),"*");var ff=`void main() { + gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); +}`,pf=`#include + +void main() { + vec2 center = vec2(0., 1.); + float rotation = 0.0; + + + + float size = 0.03; + + vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); + vec2 scale; + scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); + scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); + + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + + gl_Position = projectionMatrix * mvPosition; +}`;const Bn=new de(0,0,0),Wi=new de(0,0,0),hf=new de(0,0,0);function Xo(t,e,n){const r=Bn.setFromMatrixPosition(t.matrixWorld);r.project(e);const i=n.width/2,o=n.height/2;return[(Number.isNaN(r.x)?0:r.x)*i+i,-(r.y*o)+o]}function mf(t,e){const n=Bn.setFromMatrixPosition(t.matrixWorld),r=Wi.setFromMatrixPosition(e.matrixWorld),i=n.sub(r),o=e.getWorldDirection(hf);return i.angleTo(o)>Math.PI/2}function gf(t,e,n,r){const i=Bn.setFromMatrixPosition(t.matrixWorld),o=i.clone();o.project(e),n.setFromCamera(new Ge(o.x,o.y),e);const a=n.intersectObjects(r,!0);if(a.length>0){const s=a[0].distance;return i.distanceTo(n.ray.origin)Math.abs(t)<1e-10?0:t;function Ys(t,e,n=""){let r="matrix3d(";for(let i=0;i!==16;i++)r+=wi(e[i]*t.elements[i])+(i!==15?",":")");return n+r}const bf=(t=>e=>Ys(e,t))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),xf=(t=>(e,n)=>Ys(e,t(n),"translate(-50%,-50%)"))(t=>[1/t,1/t,1/t,1,-1/t,-1/t,-1/t,-1,1/t,1/t,1/t,1,1,1,1,1]),wf=["geometry","material"];new as;var ki={exports:{}},kf=ki.exports,Qo;function Tf(){return Qo||(Qo=1,function(t,e){(function(n,r){t.exports=r()})(kf,function(){var n=function(){function r(f){return a.appendChild(f.dom),f}function i(f){for(var h=0;hl+1e3&&(c.update(1e3*u/(f-l),100),l=f,u=0,p)){var h=performance.memory;p.update(h.usedJSHeapSize/1048576,h.jsHeapSizeLimit/1048576)}return f},update:function(){s=this.end()},domElement:a,setMode:i}};return n.Panel=function(r,i,o){var a=1/0,s=0,l=Math.round,u=l(window.devicePixelRatio||1),c=80*u,d=48*u,p=3*u,f=2*u,h=3*u,w=15*u,v=74*u,g=30*u,E=document.createElement("canvas");E.width=c,E.height=d,E.style.cssText="width:80px;height:48px";var T=E.getContext("2d");return T.font="bold "+9*u+"px Helvetica,Arial,sans-serif",T.textBaseline="top",T.fillStyle=o,T.fillRect(0,0,c,d),T.fillStyle=i,T.fillText(r,p,f),T.fillRect(h,w,v,g),T.fillStyle=o,T.globalAlpha=.9,T.fillRect(h,w,v,g),{dom:E,update:function(M,N){a=Math.min(a,M),s=Math.max(s,M),T.fillStyle=o,T.globalAlpha=1,T.fillRect(0,0,c,w),T.fillStyle=i,T.fillText(l(M)+" "+r+" ("+l(a)+"-"+l(s)+")",p,f),T.drawImage(E,h+u,w,v-u,g,h,w,v-u,g),T.fillRect(h+v-u,w,u,g),T.fillStyle=o,T.globalAlpha=.9,T.fillRect(h+v-u,w,u,l((1-M/N)*g))}}},n})}(ki)),ki.exports}Tf();const Af={key:0,args:[0,1,64]},Ef={key:1,args:[.5,1,64]},_f={key:2},Mf=["tone-mapped","map","side","color"];new Xe(16777215);const Sf={flex:"~ col",border:"~ gray/25 rounded-lg",divide:"y dashed gray/25","of-clip":"","shadow-sm":""},If={op50:""},Rf={key:0,"w-full":""},Zo=xe({__name:"Collapsable",props:Za({default:{type:Boolean},label:null},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=Ja(t,"modelValue");return yt(()=>{e.default!=null&&(n.value=!!e.default)}),(r,i)=>(Q(),ee("div",Sf,[P("button",{sticky:"","top-0":"","z-10":"",flex:"","items-center":"","justify-between":"",px2:"",py1:"","text-sm":"","backdrop-blur-xl":"",onClick:i[0]||(i[0]=o=>n.value=!n.value)},[P("span",null,[ze(r.$slots,"label",{},()=>[wo(oe(e.label??"Collapsable"),1)])]),i[1]||(i[1]=wo()),P("span",If,oe(n.value?"▲":"▼"),1)]),ve(wr,null,{default:be(()=>[n.value?(Q(),ee("div",Rf,[ze(r.$slots,"default")])):Ye("",!0)]),_:3})]))}}),on=xe({__name:"Range",props:{modelValue:null,min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","mousedown"],setup(t,{emit:e}){const n=t,r=e,i=V(null);function o(h,w,v){return Math.min(Math.max(h,w),v)}function a(h){const w=h.toString();return w.includes("e-")?Number.parseInt(w.split("e-")[1],10):w.includes(".")?w.split(".")[1].length:0}function s(h,w){const v=a(w),g=10**(v+3);return Number.parseFloat((h*g/g).toFixed(v))}const l=Se(()=>s(o(n.modelValue,n.min,n.max),n.step)),u=Se(()=>{const h=(l.value-n.min)/(n.max-n.min)*100;return{width:`${h}%`,backgroundSize:`${h}% 100%`}});function c(h){if(!i.value)return l.value;const w=i.value.getBoundingClientRect(),g=(h.clientX-w.left)/w.width,E=n.max-n.min,T=n.min+E*g,M=Math.round(T/n.step)*n.step;return Math.min(Math.max(M,n.min),n.max)}function d(h){if(n.disabled)return;const w=c(h);r("update:modelValue",w)}function p(h){if(n.disabled)return;h.preventDefault();const w=c(h);r("update:modelValue",w),window.addEventListener("mousemove",d),window.addEventListener("mouseup",f)}function f(h){window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",f)}return ut(()=>{window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",f)}),(h,w)=>(Q(),ee("span",{ref_key:"sliderRef",ref:i,class:Gt(["range-slider disabled:pointer-events-none disabled:cursor-default disabled:opacity-50",{disabled:t.disabled}]),bg:"[#e6e1fc] dark:[#676085]","touch-action-none":"",relative:"","inline-block":"","w-full":"","cursor-ew-resize":"","rounded-sm":"",onMousedown:p},[P("span",{style:pr(u.value),bg:"[#cabeff] dark:[#4e34b9]",relative:"",block:"","rounded-sm":"",h:"[14px]"},null,4),P("span",{role:"slider",class:"slider-thumb",style:pr({left:`${(l.value-t.min)/(t.max-t.min)*100}%`}),absolute:"","rounded-sm":"",w:"[1px]",h:"[14px]",bg:"zinc-100 dark:zinc-400",top:"50%",transform:"translate-x-[50%] translate-y-[-50%]"},null,4)],34))}});function Jo(t,e){if(e===Mu)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===mi||e===gs){let n=t.getIndex();if(n===null){const a=[],s=t.getAttribute("position");if(s!==void 0){for(let l=0;l=2.0 are supported."));return}const u=new cp(o,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});u.fileLoader.setRequestHeader(this.requestHeader);for(let c=0;c=0&&s[d]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+d+'".')}}u.setExtensions(a),u.setPlugins(s),u.parse(r,i)}parseAsync(e,n){const r=this;return new Promise(function(i,o){r.parse(e,n,i,o)})}}function Nf(){let t={};return{get:function(e){return t[e]},add:function(e,n){t[e]=n},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const ke={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class Of{constructor(e){this.parser=e,this.name=ke.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,n=this.parser.json.nodes||[];for(let r=0,i=n.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return n.loadTextureImage(e,o.source,a)}}class qf{constructor(e){this.parser=e,this.name=ke.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const n=this.name,r=this.parser,i=r.json,o=i.textures[e];if(!o.extensions||!o.extensions[n])return null;const a=o.extensions[n],s=i.images[a.source];let l=r.textureLoader;if(s.uri){const u=r.options.manager.getHandler(s.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return r.loadTextureImage(e,a.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(n)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const n=new Image;n.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class Yf{constructor(e){this.parser=e,this.name=ke.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const n=this.name,r=this.parser,i=r.json,o=i.textures[e];if(!o.extensions||!o.extensions[n])return null;const a=o.extensions[n],s=i.images[a.source];let l=r.textureLoader;if(s.uri){const u=r.options.manager.getHandler(s.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return r.loadTextureImage(e,a.source,l);if(i.extensionsRequired&&i.extensionsRequired.indexOf(n)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const n=new Image;n.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",n.onload=n.onerror=function(){e(n.height===1)}})),this.isSupported}}class Wf{constructor(e){this.name=ke.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const n=this.parser.json,r=n.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const i=r.extensions[this.name],o=this.parser.getDependency("buffer",i.buffer),a=this.parser.options.meshoptDecoder;if(!a||!a.supported){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return o.then(function(s){const l=i.byteOffset||0,u=i.byteLength||0,c=i.count,d=i.byteStride,p=new Uint8Array(s,l,u);return a.decodeGltfBufferAsync?a.decodeGltfBufferAsync(c,d,p,i.mode,i.filter).then(function(f){return f.buffer}):a.ready.then(function(){const f=new ArrayBuffer(c*d);return a.decodeGltfBuffer(new Uint8Array(f),c,d,p,i.mode,i.filter),f})})}else return null}}class Xf{constructor(e){this.name=ke.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const n=this.parser.json,r=n.nodes[e];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;const i=n.meshes[r.mesh];for(const u of i.primitives)if(u.mode!==ct.TRIANGLES&&u.mode!==ct.TRIANGLE_STRIP&&u.mode!==ct.TRIANGLE_FAN&&u.mode!==void 0)return null;const a=r.extensions[this.name].attributes,s=[],l={};for(const u in a)s.push(this.parser.getDependency("accessor",a[u]).then(c=>(l[u]=c,l[u])));return s.length<1?null:(s.push(this.parser.createNodeMesh(e)),Promise.all(s).then(u=>{const c=u.pop(),d=c.isGroup?c.children:[c],p=u[0].count,f=[];for(const h of d){const w=new Mt,v=new de,g=new ur,E=new de(1,1,1),T=new Nu(h.geometry,h.material,p);for(let M=0;M0||t.search(/^data\:image\/jpeg/)===0?"image/jpeg":t.search(/\.webp($|\?)/i)>0||t.search(/^data\:image\/webp/)===0?"image/webp":t.search(/\.ktx2($|\?)/i)>0||t.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const up=new Mt;class cp{constructor(e={},n={}){this.json=e,this.extensions={},this.plugins={},this.options=n,this.cache=new Nf,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,i=-1,o=!1,a=-1;if(typeof navigator<"u"){const s=navigator.userAgent;r=/^((?!chrome|android).)*safari/i.test(s)===!0;const l=s.match(/Version\/(\d+)/);i=r&&l?parseInt(l[1],10):-1,o=s.indexOf("Firefox")>-1,a=o?s.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||r&&i<17||o&&a<98?this.textureLoader=new Pu(this.options.manager):this.textureLoader=new Du(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new vs(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,n){const r=this,i=this.json,o=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(a){return a._markDefs&&a._markDefs()}),Promise.all(this._invokeAll(function(a){return a.beforeRoot&&a.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(a){const s={scene:a[0][i.scene||0],scenes:a[0],animations:a[1],cameras:a[2],asset:i.asset,parser:r,userData:{}};return $t(o,s,i),_t(s,i),Promise.all(r._invokeAll(function(l){return l.afterRoot&&l.afterRoot(s)})).then(function(){for(const l of s.scenes)l.updateMatrixWorld();e(s)})}).catch(n)}_markDefs(){const e=this.json.nodes||[],n=this.json.skins||[],r=this.json.meshes||[];for(let i=0,o=n.length;i{const l=this.associations.get(a);l!=null&&this.associations.set(s,l);for(const[u,c]of a.children.entries())o(c,s.children[u])};return o(r,i),i.name+="_instance_"+e.uses[n]++,i}_invokeOne(e){const n=Object.values(this.plugins);n.push(this);for(let r=0;r=2&&v.setY(b,m[_*l+1]),l>=3&&v.setZ(b,m[_*l+2]),l>=4&&v.setW(b,m[_*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}v.normalized=h}return v})}loadTexture(e){const n=this.json,r=this.options,o=n.textures[e].source,a=n.images[o];let s=this.textureLoader;if(a.uri){const l=r.manager.getHandler(a.uri);l!==null&&(s=l)}return this.loadTextureImage(e,o,s)}loadTextureImage(e,n,r){const i=this,o=this.json,a=o.textures[e],s=o.images[n],l=(s.uri||s.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];const u=this.loadImageSource(n,r).then(function(c){c.flipY=!1,c.name=a.name||s.name||"",c.name===""&&typeof s.uri=="string"&&s.uri.startsWith("data:image/")===!1&&(c.name=s.uri);const p=(o.samplers||{})[a.sampler]||{};return c.magFilter=ta[p.magFilter]||dr,c.minFilter=ta[p.minFilter]||Hi,c.wrapS=na[p.wrapS]||fr,c.wrapT=na[p.wrapT]||fr,c.generateMipmaps=!c.isCompressedTexture&&c.minFilter!==qt&&c.minFilter!==dr,i.associations.set(c,{textures:e}),c}).catch(function(){return null});return this.textureCache[l]=u,u}loadImageSource(e,n){const r=this,i=this.json,o=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(d=>d.clone());const a=i.images[e],s=self.URL||self.webkitURL;let l=a.uri||"",u=!1;if(a.bufferView!==void 0)l=r.getDependency("bufferView",a.bufferView).then(function(d){u=!0;const p=new Blob([d],{type:a.mimeType});return l=s.createObjectURL(p),l});else if(a.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(l).then(function(d){return new Promise(function(p,f){let h=p;n.isImageBitmapLoader===!0&&(h=function(w){const v=new cr(w);v.needsUpdate=!0,p(v)}),n.load(Mn.resolveURL(d,o.path),h,void 0,f)})}).then(function(d){return u===!0&&s.revokeObjectURL(l),_t(d,a),d.userData.mimeType=a.mimeType||lp(a.uri),d}).catch(function(d){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),d});return this.sourceCache[e]=c,c}assignTexture(e,n,r,i){const o=this;return this.getDependency("texture",r.index).then(function(a){if(!a)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(a=a.clone(),a.channel=r.texCoord),o.extensions[ke.KHR_TEXTURE_TRANSFORM]){const s=r.extensions!==void 0?r.extensions[ke.KHR_TEXTURE_TRANSFORM]:void 0;if(s){const l=o.associations.get(a);a=o.extensions[ke.KHR_TEXTURE_TRANSFORM].extendTexture(a,s),o.associations.set(a,l)}}return i!==void 0&&(a.colorSpace=i),e[n]=a,a})}assignFinalMaterial(e){const n=e.geometry;let r=e.material;const i=n.attributes.tangent===void 0,o=n.attributes.color!==void 0,a=n.attributes.normal===void 0;if(e.isPoints){const s="PointsMaterial:"+r.uuid;let l=this.cache.get(s);l||(l=new Lu,Cr.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,l.sizeAttenuation=!1,this.cache.add(s,l)),r=l}else if(e.isLine){const s="LineBasicMaterial:"+r.uuid;let l=this.cache.get(s);l||(l=new Bu,Cr.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,this.cache.add(s,l)),r=l}if(i||o||a){let s="ClonedMaterial:"+r.uuid+":";i&&(s+="derivative-tangents:"),o&&(s+="vertex-colors:"),a&&(s+="flat-shading:");let l=this.cache.get(s);l||(l=r.clone(),o&&(l.vertexColors=!0),a&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(s,l),this.associations.set(l,this.associations.get(r))),r=l}e.material=r}getMaterialType(){return ys}loadMaterial(e){const n=this,r=this.json,i=this.extensions,o=r.materials[e];let a;const s={},l=o.extensions||{},u=[];if(l[ke.KHR_MATERIALS_UNLIT]){const d=i[ke.KHR_MATERIALS_UNLIT];a=d.getMaterialType(),u.push(d.extendParams(s,o,n))}else{const d=o.pbrMetallicRoughness||{};if(s.color=new Xe(1,1,1),s.opacity=1,Array.isArray(d.baseColorFactor)){const p=d.baseColorFactor;s.color.setRGB(p[0],p[1],p[2],St),s.opacity=p[3]}d.baseColorTexture!==void 0&&u.push(n.assignTexture(s,"map",d.baseColorTexture,Cn)),s.metalness=d.metallicFactor!==void 0?d.metallicFactor:1,s.roughness=d.roughnessFactor!==void 0?d.roughnessFactor:1,d.metallicRoughnessTexture!==void 0&&(u.push(n.assignTexture(s,"metalnessMap",d.metallicRoughnessTexture)),u.push(n.assignTexture(s,"roughnessMap",d.metallicRoughnessTexture))),a=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,s)})))}o.doubleSided===!0&&(s.side=br);const c=o.alphaMode||qr.OPAQUE;if(c===qr.BLEND?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,c===qr.MASK&&(s.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&a!==ln&&(u.push(n.assignTexture(s,"normalMap",o.normalTexture)),s.normalScale=new Ge(1,1),o.normalTexture.scale!==void 0)){const d=o.normalTexture.scale;s.normalScale.set(d,d)}if(o.occlusionTexture!==void 0&&a!==ln&&(u.push(n.assignTexture(s,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(s.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&a!==ln){const d=o.emissiveFactor;s.emissive=new Xe().setRGB(d[0],d[1],d[2],St)}return o.emissiveTexture!==void 0&&a!==ln&&u.push(n.assignTexture(s,"emissiveMap",o.emissiveTexture,Cn)),Promise.all(u).then(function(){const d=new a(s);return o.name&&(d.name=o.name),_t(d,o),n.associations.set(d,{materials:e}),o.extensions&&$t(i,d,o),d})}createUniqueName(e){const n=Rn.sanitizeNodeName(e||"");return n in this.nodeNamesUsed?n+"_"+ ++this.nodeNamesUsed[n]:(this.nodeNamesUsed[n]=0,n)}loadGeometries(e){const n=this,r=this.extensions,i=this.primitiveCache;function o(s){return r[ke.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(s,n).then(function(l){return ra(l,s,n)})}const a=[];for(let s=0,l=e.length;s0&&ap(g,o),g.name=n.createUniqueName(o.name||"mesh_"+e),_t(g,o),v.extensions&&$t(i,g,v),n.assignFinalMaterial(g),d.push(g)}for(let f=0,h=d.length;f1?c=new Nr:u.length===1?c=u[0]:c=new Gi,c!==u[0])for(let d=0,p=u.length;d{const d=new Map;for(const[p,f]of i.associations)(p instanceof Cr||p instanceof cr)&&d.set(p,f);return c.traverse(p=>{const f=i.associations.get(p);f!=null&&d.set(p,f)}),d};return i.associations=u(o),o})}_createAnimationTracks(e,n,r,i,o){const a=[],s=e.name?e.name:e.uuid,l=[];Ot[o.path]===Ot.weights?e.traverse(function(p){p.morphTargetInfluences&&l.push(p.name?p.name:p.uuid)}):l.push(s);let u;switch(Ot[o.path]){case Ot.weights:u=To;break;case Ot.rotation:u=Ao;break;case Ot.position:case Ot.scale:u=ko;break;default:switch(r.itemSize){case 1:u=To;break;case 2:case 3:default:u=ko;break}break}const c=i.interpolation!==void 0?rp[i.interpolation]:Ui,d=this._getArrayFromAccessor(r);for(let p=0,f=l.length;pnew Ec(t)),Vt.register(t=>new _c(t)),Vt)}async function fp(t){const r=(await Qs().loadAsync(t)).userData;if(!r.vrmAnimations){console.warn("No VRM animations found in the .vrma file");return}if(r.vrmAnimations.length===0){console.warn("No VRM animations found in the .vrma file");return}return r.vrmAnimations[0]}async function pp(t,e){if(!t){console.warn("No VRM found");return}if(e)return Mc(e,t)}function hp(){const t=V(!1),e=V(0),n=V(0),r=.2,i=1,o=6,a=V(Math.random()*(o-i)+i);function s(l,u){if(l!=null&&l.expressionManager&&(n.value+=u,!t.value&&n.value>=a.value&&(t.value=!0,e.value=0),t.value)){e.value+=u/r;const c=Math.sin(Math.PI*e.value);l.expressionManager.setValue("blink",c),e.value>=1&&(t.value=!1,n.value=0,l.expressionManager.setValue("blink",0),a.value=Math.random()*(o-i)+i)}}return{update:s}}function mp(){let t=-1,e,n=0;function r(){e?e.set(Ht(-.25,.25),Ht(-.2,.15),-.65):e=new de(Ht(-.25,.25),Ht(-.2,.15),-.65)}function i(o,a){var s;!(o!=null&&o.expressionManager)||!o.lookAt||(n>=t?(r(),n=0,t=Ms()/1e3):e||r(),o.lookAt.target||(o.lookAt.target=new Gi),o.lookAt.target.position.lerp(e,Ht(.2,.5)),(s=o.lookAt)==null||s.update(a),n+=a)}return{update:i}}async function gp(t,e){const i=(await Qs().loadAsync(t,a=>{var s;return(s=e==null?void 0:e.onProgress)==null?void 0:s.call(e,a)})).userData;if(!i.vrm)return;const o=i.vrm;if(yi.removeUnnecessaryVertices(o.scene),yi.combineSkeletons(o.scene),o.scene.traverse(a=>{a.frustumCulled=!1}),o.lookAt){const a=new Sc(o.lookAt);a.name="lookAtQuaternionProxy",o.scene.add(a)}return e!=null&&e.scene&&e.scene.add(o.scene),e!=null&&e.position&&o.scene.position.set(...e.position),o}function vp(t){const e=V(null),n=V(!1),r=V(0),i=V(new Map),o=V(new Map),a=V(),s=(g,E,T)=>g+(E-g)*T,l=g=>g<.5?4*g*g*g:1-(-2*g+2)**3/2,u=new Map([["happy",{expression:[{name:"happy",value:1,duration:.3},{name:"aa",value:.3}],blendDuration:.3}],["sad",{expression:[{name:"sad",value:1},{name:"oh",value:.2}],blendDuration:.3}],["angry",{expression:[{name:"angry",value:1},{name:"ee",value:.4}],blendDuration:.2}],["surprised",{expression:[{name:"Surprised",value:1},{name:"oh",value:.6}],blendDuration:.1}],["neutral",{expression:[{name:"neutral",value:1}],blendDuration:.5}]]),c=()=>{a.value&&(clearTimeout(a.value),a.value=void 0)},d=g=>{var T;if(c(),!u.has(g)){console.warn(`Emotion ${g} not found`);return}const E=u.get(g);if(e.value=g,n.value=!0,r.value=0,t.expressionManager){const M=Object.keys(t.expressionManager.expressionMap);for(const N of M)t.expressionManager.setValue(N,0)}i.value.clear(),o.value.clear();for(const M of E.expression||[]){const N=((T=t.expressionManager)==null?void 0:T.getValue(M.name))||0;i.value.set(M.name,N),o.value.set(M.name,M.value)}};return{currentEmotion:e,isTransitioning:n,setEmotion:d,setEmotionWithResetAfter:(g,E)=>{c(),d(g),a.value=setTimeout(()=>{d("neutral"),a.value=void 0},E)},update:g=>{var M;if(!n.value||!e.value)return;const T=u.get(e.value).blendDuration||.3;r.value+=g/T,r.value>=1&&(r.value=1,n.value=!1);for(const[N,m]of o.value){const _=i.value.get(N)||0,x=s(_,m,l(r.value));(M=t.expressionManager)==null||M.setValue(N,x)}},addEmotionState:(g,E)=>{u.set(g,E)},removeEmotionState:g=>{u.delete(g)},dispose:()=>{c()}}}const yp=xe({__name:"Model",props:{model:null,idleAnimation:null,loadAnimations:null,position:null},emits:["loadModelProgress","error"],setup(t,{expose:e,emit:n}){const r=t,i=n;let o;const a=V(),s=V(),{scene:l}=yr(),{onBeforeRender:u}=Fi(),c=hp(),d=mp(),p=V();return Ee(()=>r.position,([f,h,w])=>{a.value&&a.value.scene.position.set(f,h,w)}),mt(async()=>{if(l.value)try{const f=await gp(r.model,{scene:l.value,lookAt:!0,position:r.position,onProgress:v=>i("loadModelProgress",Number.parseFloat((100*(v.loaded/v.total)).toFixed(2)))});if(!f){console.warn("No VRM model loaded");return}const h=await fp(r.idleAnimation),w=await pp(f,h);if(!w){console.warn("No VRM animation loaded");return}s.value=new Yu(f.scene),s.value.clipAction(w).play(),p.value=vp(f),a.value=f,o=u(({delta:v})=>{var g,E,T;(g=s.value)==null||g.update(v),(E=a.value)==null||E.update(v),c.update(a.value,v),d.update(a.value,v),(T=p.value)==null||T.update(v)}).off}catch(f){i("error",f)}}),ut(()=>{o==null||o(),a.value&&(a.value.scene.removeFromParent(),yi.deepDispose(a.value.scene))}),e({setExpression(f){var h;(h=p.value)==null||h.setEmotionWithResetAfter(f,1e3)}}),(f,h)=>ze(f.$slots,"default")}}),bp=["position"],xp={absolute:"",bottom:"3",right:"3"},wp={flex:"~ row","cursor-pointer":""},kp=["checked","aria-checked"],Tp={key:0,"min-w":"50vw",z:"{var h;(h=p.value)==null||h.setExpression(f)}}),(f,h)=>(Q(),je(Rs,{relative:""},{default:be(({height:w,width:v})=>[ve(D(Wu),{alpha:!0,antialias:!0,width:v,height:w},{default:be(()=>[ve(D(nf)),P("TresPerspectiveCamera",{position:[a.value,s.value,l.value]},null,8,bp),h[14]||(h[14]=P("TresDirectionalLight",{color:16777215,intensity:1.2,position:[1,1,1]},null,-1)),h[15]||(h[15]=P("TresAmbientLight",{color:16777215,intensity:1.5},null,-1)),ve(yp,{ref_key:"modelRef",ref:p,model:r.model,"idle-animation":r.idleAnimation,position:[u.value,c.value,d.value],onLoadModelProgress:h[0]||(h[0]=g=>i("loadModelProgress",g)),onError:h[1]||(h[1]=g=>i("error",g))},null,8,["model","idle-animation","position"])]),_:2},1032,["width","height"]),P("div",xp,[P("div",wp,[P("label",{class:Gt([o.value?"bg-zinc-300 dark:bg-zinc-200":"bg-zinc-100 dark:bg-zinc-700"]),transition:"all ease-in-out duration-500",text:"lg zinc-500 dark:zinc-400","m-1":"","h-fit":"","w-fit":"","cursor-pointer":"","appearance-none":"","gap-1":"","rounded-lg":"","rounded-md":"","border-none":"","p-2":"","outline-none":""},[at(P("input",{"onUpdate:modelValue":h[2]||(h[2]=g=>o.value=g),checked:o.value,"aria-checked":o.value,name:"showLive2DViewerInspector",type:"checkbox",hidden:"","appearance-none":"","outline-none":""},null,8,kp),[[vr,o.value]]),h[16]||(h[16]=P("div",{"select-none":""},[P("div",{"i-solar:bug-bold-duotone":""})],-1))],2)]),ve(wr,null,{default:be(()=>[o.value?(Q(),ee("div",Tp,[P("div",Ap,[P("div",Ep,[P("span",null,oe(f.$t("stage.viewers.debug-menu.vrm.model.title")),1)]),ve(Zo,{"h-fit":"","w-full":""},{label:be(()=>[P("span",_p,oe(f.$t("stage.viewers.debug-menu.vrm.camera")),1)]),default:be(()=>[P("div",Mp,[h[17]||(h[17]=P("div",{text:"zinc-400 dark:zinc-500"},[P("span",null,"X")],-1)),P("label",Sp,[ve(on,{modelValue:a.value,"onUpdate:modelValue":h[3]||(h[3]=g=>a.value=g),min:-10,max:10,step:.01},null,8,["modelValue"])]),P("div",Ip,[P("span",null,oe(a.value),1)]),h[18]||(h[18]=P("div",{text:"zinc-400 dark:zinc-500"},[P("span",null,"Y")],-1)),P("label",Rp,[ve(on,{modelValue:s.value,"onUpdate:modelValue":h[4]||(h[4]=g=>s.value=g),min:-10,max:10,step:.01},null,8,["modelValue"])]),P("div",Cp,[P("span",null,oe(s.value),1)]),h[19]||(h[19]=P("div",{text:"zinc-400 dark:zinc-500"},[P("span",null,"Z")],-1)),P("label",Np,[ve(on,{modelValue:l.value,"onUpdate:modelValue":h[5]||(h[5]=g=>l.value=g),min:-10,max:10,step:.01},null,8,["modelValue"])]),P("div",Op,[P("span",null,oe(l.value),1)])])]),_:1}),ve(Zo,{"h-fit":"","w-full":""},{label:be(()=>[P("span",Pp,oe(f.$t("stage.viewers.debug-menu.vrm.model.title")),1)]),default:be(()=>[P("div",Dp,[h[20]||(h[20]=P("div",{text:"zinc-400 dark:zinc-500"},[P("span",null,"X")],-1)),P("label",Lp,[ve(on,{modelValue:u.value,"onUpdate:modelValue":h[6]||(h[6]=g=>u.value=g),min:-10,max:10,step:.01},null,8,["modelValue"])]),P("div",Bp,[P("span",null,oe(u.value),1)]),h[21]||(h[21]=P("div",{text:"zinc-400 dark:zinc-500"},[P("span",null,"Y")],-1)),P("label",zp,[ve(on,{modelValue:c.value,"onUpdate:modelValue":h[7]||(h[7]=g=>c.value=g),min:-10,max:10,step:.01},null,8,["modelValue"])]),P("div",Fp,[P("span",null,oe(c.value),1)]),h[22]||(h[22]=P("div",{text:"zinc-400 dark:zinc-500"},[P("span",null,"Z")],-1)),P("label",Up,[ve(on,{modelValue:d.value,"onUpdate:modelValue":h[8]||(h[8]=g=>d.value=g),min:-10,max:10,step:.01},null,8,["modelValue"])]),P("div",jp,[P("span",null,oe(d.value),1)])])]),_:1}),P("div",$p,[P("span",null,oe(f.$t("stage.viewers.debug-menu.emotions")),1)]),P("div",Vp,[P("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:h[9]||(h[9]=g=>{var E;return(E=p.value)==null?void 0:E.setExpression("neutral")})},oe(f.$t("stage.viewers.debug-menu.emotions-btn.neutral")),1),P("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:h[10]||(h[10]=g=>{var E;return(E=p.value)==null?void 0:E.setExpression("surprised")})},oe(f.$t("stage.viewers.debug-menu.emotions-btn.surprised")),1),P("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:h[11]||(h[11]=g=>{var E;return(E=p.value)==null?void 0:E.setExpression("sad")})},oe(f.$t("stage.viewers.debug-menu.emotions-btn.sad")),1),P("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:h[12]||(h[12]=g=>{var E;return(E=p.value)==null?void 0:E.setExpression("angry")})},oe(f.$t("stage.viewers.debug-menu.emotions-btn.angry")),1),P("button",{"rounded-lg":"",bg:"zinc-100/70 dark:zinc-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:h[13]||(h[13]=g=>{var E;return(E=p.value)==null?void 0:E.setExpression("happy")})},oe(f.$t("stage.viewers.debug-menu.emotions-btn.happy")),1)])])])):Ye("",!0)]),_:1})])]),_:1}))}});class Wr extends Error{constructor(n,r){super(n);yo(this,"response");this.name="XSAIError",this.response=r}}const Gp=t=>t.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`),sr=t=>Object.fromEntries(Object.entries(t).map(([e,n])=>[Gp(e),n])),Zs=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),Js=t=>JSON.stringify(sr(Zs({...t,abortSignal:void 0,apiKey:void 0,baseURL:void 0,fetch:void 0,headers:void 0}))),Xi=(t,e)=>Zs({Authorization:e!==void 0?`Bearer ${e}`:void 0,...t}),Qi=(t,e)=>{const n=e.toString();return new URL(t,n.endsWith("/")?n:`${n}/`)},Zi=async t=>{if(!t.ok){const e=new Wr(`Remote sent ${t.status} response`,t);throw e.cause=new Error(await t.text()),e}if(!t.body)throw new Wr("Response body is empty from remote server",t);if(!(t.body instanceof ReadableStream)){const e=new Wr(`Expected Response body to be a ReadableStream, but got ${String(t.body)}`,t);throw e.cause=new Error(`Content-Type is ${t.headers.get("Content-Type")}`),e}return t},Kp=async t=>Zi(t).then(async e=>e.json()),qp=async t=>(t.fetch??globalThis.fetch)(Qi("audio/speech",t.baseURL),{body:Js(t),headers:Xi({"Content-Type":"application/json",...t.headers},t.apiKey),method:"POST",signal:t.abortSignal}).then(Zi).then(async e=>e.arrayBuffer()),el=(t,{apiKey:e,baseURL:n,headers:r})=>({apiKey:e,baseURL:n,headers:r,model:t}),Yp=t=>{const e={...t,baseURL:new URL("http://localhost:11434/v1/")},n=r=>el(r,e);return{chat:n,embed:n,model:()=>e}};Yp();const Wp=t=>{const e=({applyTextNormalization:n,languageCode:r,nextRequestIds:i,nextText:o,previousRequestIds:a,previousText:s,pronunciationDictionaryLocators:l,seed:u,voiceSettings:c})=>({extraBody:sr({applyTextNormalization:n,languageCode:r,nextRequestIds:i,nextText:o,previousRequestIds:a,previousText:s,pronunciationDictionaryLocators:l?l.map(d=>sr(d)):void 0,seed:u,voiceSettings:c?sr(c):void 0})});return{speech:(n,r)=>({...r?e(r):{},...el(`elevenlabs/${n}`,{...t,baseURL:(t==null?void 0:t.baseURL)??new URL("http://localhost:5933/v1/")})})}},Xp=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class zn{constructor(e,n,r){this.property=e,this.normal=n,r&&(this.space=r)}}zn.prototype.property={};zn.prototype.normal={};zn.prototype.space=null;function tl(t,e){const n={},r={};let i=-1;for(;++i4&&n.slice(0,4)==="data"&&th.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(oa,oh);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!oa.test(o)){let a=o.replace(nh,ih);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}i=Ji}return new i(r,e)}function ih(t){return"-"+t.toLowerCase()}function oh(t){return t.charAt(1).toUpperCase()}const ah=tl([il,rl,sl,ll,Jp],"html"),ul=tl([il,rl,sl,ll,eh],"svg"),aa={}.hasOwnProperty;function sh(t,e){const n=e||{};function r(i,...o){let a=r.invalid;const s=r.handlers;if(i&&aa.call(i,t)){const l=String(i[t]);a=aa.call(s,l)?s[l]:r.unknown}if(a)return a.call(this,i,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const lh=/["&'<>`]/g,uh=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ch=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,dh=/[|\\{}()[\]^$+*?.]/g,sa=new WeakMap;function fh(t,e){if(t=t.replace(e.subset?ph(e.subset):lh,r),e.subset||e.escapeOnly)return t;return t.replace(uh,n).replace(ch,r);function n(i,o,a){return e.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,a.charCodeAt(o+2),e)}function r(i,o,a){return e.format(i.charCodeAt(0),a.charCodeAt(o+1),e)}}function ph(t){let e=sa.get(t);return e||(e=hh(t),sa.set(t,e)),e}function hh(t){const e=[];let n=-1;for(;++n",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},xh=["cent","copy","divide","gt","lt","not","para","times"],cl={}.hasOwnProperty,Mi={};let Kn;for(Kn in Qr)cl.call(Qr,Kn)&&(Mi[Qr[Kn]]=Kn);const wh=/[^\dA-Za-z]/;function kh(t,e,n,r){const i=String.fromCharCode(t);if(cl.call(Mi,i)){const o=Mi[i],a="&"+o;return n&&bh.includes(o)&&!xh.includes(o)&&(!r||e&&e!==61&&wh.test(String.fromCharCode(e)))?a:a+";"}return""}function Th(t,e,n){let r=gh(t,e,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=kh(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const o=yh(t,e,n.omitOptionalSemicolons);o.length|^->||--!>|"],_h=["<",">"];function Mh(t,e,n,r){return r.settings.bogusComments?"":"";function i(o){return pn(o,Object.assign({},r.settings.characterReferences,{subset:_h}))}}function Sh(t,e,n,r){return""}function la(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(e);for(;i!==-1;)r++,i=n.indexOf(e,i+e.length);return r}function Ih(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Rh(t){return t.join(" ").trim()}const Ch=/[ \t\n\f\r]/g;function eo(t){return typeof t=="object"?t.type==="text"?ua(t.value):!1:ua(t)}function ua(t){return t.replace(Ch,"")===""}const qe=fl(1),dl=fl(-1),Nh=[];function fl(t){return e;function e(n,r,i){const o=n?n.children:Nh;let a=(r||0)+t,s=o[a];if(!i)for(;s&&eo(s);)a+=t,s=o[a];return s}}const Oh={}.hasOwnProperty;function pl(t){return e;function e(n,r,i){return Oh.call(t,n.tagName)&&t[n.tagName](n,r,i)}}const to=pl({body:Dh,caption:Zr,colgroup:Zr,dd:Fh,dt:zh,head:Zr,html:Ph,li:Bh,optgroup:Uh,option:jh,p:Lh,rp:ca,rt:ca,tbody:Vh,td:da,tfoot:Hh,th:da,thead:$h,tr:Gh});function Zr(t,e,n){const r=qe(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&eo(r.value.charAt(0)))}function Ph(t,e,n){const r=qe(n,e);return!r||r.type!=="comment"}function Dh(t,e,n){const r=qe(n,e);return!r||r.type!=="comment"}function Lh(t,e,n){const r=qe(n,e);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function Bh(t,e,n){const r=qe(n,e);return!r||r.type==="element"&&r.tagName==="li"}function zh(t,e,n){const r=qe(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Fh(t,e,n){const r=qe(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function ca(t,e,n){const r=qe(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Uh(t,e,n){const r=qe(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function jh(t,e,n){const r=qe(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function $h(t,e,n){const r=qe(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Vh(t,e,n){const r=qe(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Hh(t,e,n){return!qe(n,e)}function Gh(t,e,n){const r=qe(n,e);return!r||r.type==="element"&&r.tagName==="tr"}function da(t,e,n){const r=qe(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const Kh=pl({body:Wh,colgroup:Xh,head:Yh,html:qh,tbody:Qh});function qh(t){const e=qe(t,-1);return!e||e.type!=="comment"}function Yh(t){const e=new Set;for(const r of t.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(e.has(r.tagName))return!1;e.add(r.tagName)}const n=t.children[0];return!n||n.type==="element"}function Wh(t){const e=qe(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&eo(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function Xh(t,e,n){const r=dl(n,e),i=qe(t,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&to(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function Qh(t,e,n){const r=dl(n,e),i=qe(t,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&to(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const qn={name:[[` +\f\r &/=>`.split(""),` +\f\r "&'/=>\``.split("")],[`\0 +\f\r "&'/<=>`.split(""),`\0 +\f\r "&'/<=>\``.split("")]],unquoted:[[` +\f\r &>`.split(""),`\0 +\f\r "&'<=>\``.split("")],[`\0 +\f\r "&'<=>\``.split(""),`\0 +\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Zh(t,e,n,r){const i=r.schema,o=i.space==="svg"?!1:r.settings.omitOptionalTags;let a=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(t.tagName.toLowerCase());const s=[];let l;i.space==="html"&&t.tagName==="svg"&&(r.schema=ul);const u=Jh(r,t.properties),c=r.all(i.space==="html"&&t.tagName==="template"?t.content:t);return r.schema=i,c&&(a=!1),(u||!o||!Kh(t,e,n))&&(s.push("<",t.tagName,u?" "+u:""),a&&(i.space==="svg"||r.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&s.push(" "),s.push("/")),s.push(">")),s.push(c),!a&&(!o||!to(t,e,n))&&s.push(""),s.join("")}function Jh(t,e){const n=[];let r=-1,i;if(e){for(i in e)if(e[i]!==null&&e[i]!==void 0){const o=em(t,i,e[i]);o&&n.push(o)}}for(;++rla(n,t.alternative)&&(a=t.alternative),s=a+pn(n,Object.assign({},t.settings.characterReferences,{subset:(a==="'"?qn.single:qn.double)[i][o],attribute:!0}))+a),l+(s&&"="+s))}const tm=["<","&"];function hl(t,e,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:pn(t.value,Object.assign({},r.settings.characterReferences,{subset:tm}))}function nm(t,e,n,r){return r.settings.allowDangerousHtml?t.value:hl(t,e,n,r)}function rm(t,e,n,r){return r.all(t)}const im=sh("type",{invalid:om,unknown:am,handlers:{comment:Mh,doctype:Sh,element:Zh,raw:nm,root:rm,text:hl}});function om(t){throw new Error("Expected node, not `"+t+"`")}function am(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const sm={},lm={},um=[];function cm(t,e){const n=e||sm,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:dm,all:fm,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Xp,characterReferences:n.characterReferences||lm,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?ul:ah,quote:r,alternative:i}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function dm(t,e,n){return im(t,e,n,this)}function fm(t){const e=[],n=t&&t.children||um;let r=-1;for(;++ri?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(e,n),t.splice(...a);else for(n&&t.splice(e,n);o0?(bt(t,t.length,0,e),t):e}const ha={}.hasOwnProperty;function vm(t){const e={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function hn(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const vt=jt(/[A-Za-z]/),lt=jt(/[\dA-Za-z]/),xm=jt(/[#-'*+\--9=?A-Z^-~]/);function Si(t){return t!==null&&(t<32||t===127)}const Ii=jt(/\d/),wm=jt(/[\dA-Fa-f]/),km=jt(/[!-/:-@[-`{-~]/);function fe(t){return t!==null&&t<-2}function nt(t){return t!==null&&(t<0||t===32)}function Re(t){return t===-2||t===-1||t===32}const Tm=jt(new RegExp("\\p{P}|\\p{S}","u")),Am=jt(/\s/);function jt(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function yn(t){const e=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const s=t.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="�"}else a=String.fromCharCode(o);a&&(e.push(t.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function De(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(l){return Re(l)?(t.enter(n),s(l)):e(l)}function s(l){return Re(l)&&o++a))return;const _=e.events.length;let x=_,b,y;for(;x--;)if(e.events[x][0]==="exit"&&e.events[x][1].type==="chunkFlow"){if(b){y=e.events[x][1].end;break}b=!0}for(g(r),m=_;mT;){const N=n[M];e.containerState=N[1],N[0].exit.call(e,t)}n.length=T}function E(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function Im(t,e,n){return De(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ga(t){if(t===null||nt(t)||Am(t))return 1;if(Tm(t))return 2}function ro(t,e,n){const r=[];let i=-1;for(;++i1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const d={...t[r][1].end},p={...t[n][1].start};va(d,-l),va(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...t[r][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:p},o={type:l>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},t[r][1].end={...a.start},t[n][1].start={...s.end},u=[],t[r][1].end.offset-t[r][1].start.offset&&(u=dt(u,[["enter",t[r][1],e],["exit",t[r][1],e]])),u=dt(u,[["enter",i,e],["enter",a,e],["exit",a,e],["enter",o,e]]),u=dt(u,ro(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),u=dt(u,[["exit",o,e],["enter",s,e],["exit",s,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(c=2,u=dt(u,[["enter",t[n][1],e],["exit",t[n][1],e]])):c=0,bt(t,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n0&&Re(m)?De(t,E,"linePrefix",o+1)(m):E(m)}function E(m){return m===null||fe(m)?t.check(ya,w,M)(m):(t.enter("codeFlowValue"),T(m))}function T(m){return m===null||fe(m)?(t.exit("codeFlowValue"),E(m)):(t.consume(m),T)}function M(m){return t.exit("codeFenced"),e(m)}function N(m,_,x){let b=0;return y;function y(B){return m.enter("lineEnding"),m.consume(B),m.exit("lineEnding"),A}function A(B){return m.enter("codeFencedFence"),Re(B)?De(m,R,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):R(B)}function R(B){return B===s?(m.enter("codeFencedFenceSequence"),z(B)):x(B)}function z(B){return B===s?(b++,m.consume(B),z):b>=a?(m.exit("codeFencedFenceSequence"),Re(B)?De(m,F,"whitespace")(B):F(B)):x(B)}function F(B){return B===null||fe(B)?(m.exit("codeFencedFence"),_(B)):x(B)}}}function jm(t,e,n){const r=this;return i;function i(a){return a===null?n(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}const Jr={name:"codeIndented",tokenize:Vm},$m={partial:!0,tokenize:Hm};function Vm(t,e,n){const r=this;return i;function i(u){return t.enter("codeIndented"),De(t,o,"linePrefix",5)(u)}function o(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?l(u):fe(u)?t.attempt($m,a,l)(u):(t.enter("codeFlowValue"),s(u))}function s(u){return u===null||fe(u)?(t.exit("codeFlowValue"),a(u)):(t.consume(u),s)}function l(u){return t.exit("codeIndented"),e(u)}}function Hm(t,e,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):fe(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):De(t,o,"linePrefix",5)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?e(a):fe(a)?i(a):n(a)}}const Gm={name:"codeText",previous:qm,resolve:Km,tokenize:Ym};function Km(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length)return this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse();const i=this.left.slice(e);return i.push(...this.right.slice(this.right.length-r+this.left.length).reverse()),i}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Tn(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Tn(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Tn(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e=4?e(a):t.interrupt(r.parser.constructs.flow,n,e)(a)}}function wl(t,e,n,r,i,o,a,s,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return d;function d(g){return g===60?(t.enter(r),t.enter(i),t.enter(o),t.consume(g),t.exit(o),p):g===null||g===32||g===41||Si(g)?n(g):(t.enter(r),t.enter(a),t.enter(s),t.enter("chunkString",{contentType:"string"}),w(g))}function p(g){return g===62?(t.enter(o),t.consume(g),t.exit(o),t.exit(i),t.exit(r),e):(t.enter(s),t.enter("chunkString",{contentType:"string"}),f(g))}function f(g){return g===62?(t.exit("chunkString"),t.exit(s),p(g)):g===null||g===60||fe(g)?n(g):(t.consume(g),g===92?h:f)}function h(g){return g===60||g===62||g===92?(t.consume(g),f):f(g)}function w(g){return!c&&(g===null||g===41||nt(g))?(t.exit("chunkString"),t.exit(s),t.exit(a),t.exit(r),e(g)):c999||f===null||f===91||f===93&&!l||f===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):f===93?(t.exit(o),t.enter(i),t.consume(f),t.exit(i),t.exit(r),e):fe(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),c):(t.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===null||f===91||f===93||fe(f)||s++>999?(t.exit("chunkString"),c(f)):(t.consume(f),l||(l=!Re(f)),f===92?p:d)}function p(f){return f===91||f===92||f===93?(t.consume(f),s++,d):d(f)}}function Tl(t,e,n,r,i,o){let a;return s;function s(p){return p===34||p===39||p===40?(t.enter(r),t.enter(i),t.consume(p),t.exit(i),a=p===40?41:p,l):n(p)}function l(p){return p===a?(t.enter(i),t.consume(p),t.exit(i),t.exit(r),e):(t.enter(o),u(p))}function u(p){return p===a?(t.exit(o),l(a)):p===null?n(p):fe(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),De(t,u,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===a||p===null||fe(p)?(t.exit("chunkString"),u(p)):(t.consume(p),p===92?d:c)}function d(p){return p===a||p===92?(t.consume(p),c):c(p)}}function Sn(t,e){let n;return r;function r(i){return fe(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):Re(i)?De(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const ng={name:"definition",tokenize:ig},rg={partial:!0,tokenize:og};function ig(t,e,n){const r=this;let i;return o;function o(f){return t.enter("definition"),a(f)}function a(f){return kl.call(r,t,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function s(f){return i=hn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(t.enter("definitionMarker"),t.consume(f),t.exit("definitionMarker"),l):n(f)}function l(f){return nt(f)?Sn(t,u)(f):u(f)}function u(f){return wl(t,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function c(f){return t.attempt(rg,d,d)(f)}function d(f){return Re(f)?De(t,p,"whitespace")(f):p(f)}function p(f){return f===null||fe(f)?(t.exit("definition"),r.parser.defined.push(i),e(f)):n(f)}}function og(t,e,n){return r;function r(s){return nt(s)?Sn(t,i)(s):n(s)}function i(s){return Tl(t,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return Re(s)?De(t,a,"whitespace")(s):a(s)}function a(s){return s===null||fe(s)?e(s):n(s)}}const ag={name:"hardBreakEscape",tokenize:sg};function sg(t,e,n){return r;function r(o){return t.enter("hardBreakEscape"),t.consume(o),i}function i(o){return fe(o)?(t.exit("hardBreakEscape"),e(o)):n(o)}}const lg={name:"headingAtx",resolve:ug,tokenize:cg};function ug(t,e){let n=t.length-2,r=3,i,o;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},o={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},bt(t,r,n-r+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),t}function cg(t,e,n){let r=0;return i;function i(c){return t.enter("atxHeading"),o(c)}function o(c){return t.enter("atxHeadingSequence"),a(c)}function a(c){return c===35&&r++<6?(t.consume(c),a):c===null||nt(c)?(t.exit("atxHeadingSequence"),s(c)):n(c)}function s(c){return c===35?(t.enter("atxHeadingSequence"),l(c)):c===null||fe(c)?(t.exit("atxHeading"),e(c)):Re(c)?De(t,s,"whitespace")(c):(t.enter("atxHeadingText"),u(c))}function l(c){return c===35?(t.consume(c),l):(t.exit("atxHeadingSequence"),s(c))}function u(c){return c===null||c===35||nt(c)?(t.exit("atxHeadingText"),s(c)):(t.consume(c),u)}}const dg=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],xa=["pre","script","style","textarea"],fg={concrete:!0,name:"htmlFlow",resolveTo:mg,tokenize:gg},pg={partial:!0,tokenize:yg},hg={partial:!0,tokenize:vg};function mg(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function gg(t,e,n){const r=this;let i,o,a,s,l;return u;function u(C){return c(C)}function c(C){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(C),d}function d(C){return C===33?(t.consume(C),p):C===47?(t.consume(C),o=!0,w):C===63?(t.consume(C),i=3,r.interrupt?e:S):vt(C)?(t.consume(C),a=String.fromCharCode(C),v):n(C)}function p(C){return C===45?(t.consume(C),i=2,f):C===91?(t.consume(C),i=5,s=0,h):vt(C)?(t.consume(C),i=4,r.interrupt?e:S):n(C)}function f(C){return C===45?(t.consume(C),r.interrupt?e:S):n(C)}function h(C){const ye="CDATA[";return C===ye.charCodeAt(s++)?(t.consume(C),s===ye.length?r.interrupt?e:R:h):n(C)}function w(C){return vt(C)?(t.consume(C),a=String.fromCharCode(C),v):n(C)}function v(C){if(C===null||C===47||C===62||nt(C)){const ye=C===47,Ie=a.toLowerCase();return!ye&&!o&&xa.includes(Ie)?(i=1,r.interrupt?e(C):R(C)):dg.includes(a.toLowerCase())?(i=6,ye?(t.consume(C),g):r.interrupt?e(C):R(C)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(C):o?E(C):T(C))}return C===45||lt(C)?(t.consume(C),a+=String.fromCharCode(C),v):n(C)}function g(C){return C===62?(t.consume(C),r.interrupt?e:R):n(C)}function E(C){return Re(C)?(t.consume(C),E):y(C)}function T(C){return C===47?(t.consume(C),y):C===58||C===95||vt(C)?(t.consume(C),M):Re(C)?(t.consume(C),T):y(C)}function M(C){return C===45||C===46||C===58||C===95||lt(C)?(t.consume(C),M):N(C)}function N(C){return C===61?(t.consume(C),m):Re(C)?(t.consume(C),N):T(C)}function m(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(t.consume(C),l=C,_):Re(C)?(t.consume(C),m):x(C)}function _(C){return C===l?(t.consume(C),l=null,b):C===null||fe(C)?n(C):(t.consume(C),_)}function x(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||nt(C)?N(C):(t.consume(C),x)}function b(C){return C===47||C===62||Re(C)?T(C):n(C)}function y(C){return C===62?(t.consume(C),A):n(C)}function A(C){return C===null||fe(C)?R(C):Re(C)?(t.consume(C),A):n(C)}function R(C){return C===45&&i===2?(t.consume(C),$):C===60&&i===1?(t.consume(C),ie):C===62&&i===4?(t.consume(C),we):C===63&&i===3?(t.consume(C),S):C===93&&i===5?(t.consume(C),ue):fe(C)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(pg,Fe,z)(C)):C===null||fe(C)?(t.exit("htmlFlowData"),z(C)):(t.consume(C),R)}function z(C){return t.check(hg,F,Fe)(C)}function F(C){return t.enter("lineEnding"),t.consume(C),t.exit("lineEnding"),B}function B(C){return C===null||fe(C)?z(C):(t.enter("htmlFlowData"),R(C))}function $(C){return C===45?(t.consume(C),S):R(C)}function ie(C){return C===47?(t.consume(C),a="",te):R(C)}function te(C){if(C===62){const ye=a.toLowerCase();return xa.includes(ye)?(t.consume(C),we):R(C)}return vt(C)&&a.length<8?(t.consume(C),a+=String.fromCharCode(C),te):R(C)}function ue(C){return C===93?(t.consume(C),S):R(C)}function S(C){return C===62?(t.consume(C),we):C===45&&i===2?(t.consume(C),S):R(C)}function we(C){return C===null||fe(C)?(t.exit("htmlFlowData"),Fe(C)):(t.consume(C),we)}function Fe(C){return t.exit("htmlFlow"),e(C)}}function vg(t,e,n){const r=this;return i;function i(a){return fe(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function yg(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Ar,e,n)}}const bg={name:"htmlText",tokenize:xg};function xg(t,e,n){const r=this;let i,o,a;return s;function s(S){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(S),l}function l(S){return S===33?(t.consume(S),u):S===47?(t.consume(S),N):S===63?(t.consume(S),T):vt(S)?(t.consume(S),x):n(S)}function u(S){return S===45?(t.consume(S),c):S===91?(t.consume(S),o=0,h):vt(S)?(t.consume(S),E):n(S)}function c(S){return S===45?(t.consume(S),f):n(S)}function d(S){return S===null?n(S):S===45?(t.consume(S),p):fe(S)?(a=d,ie(S)):(t.consume(S),d)}function p(S){return S===45?(t.consume(S),f):d(S)}function f(S){return S===62?$(S):S===45?p(S):d(S)}function h(S){const we="CDATA[";return S===we.charCodeAt(o++)?(t.consume(S),o===we.length?w:h):n(S)}function w(S){return S===null?n(S):S===93?(t.consume(S),v):fe(S)?(a=w,ie(S)):(t.consume(S),w)}function v(S){return S===93?(t.consume(S),g):w(S)}function g(S){return S===62?$(S):S===93?(t.consume(S),g):w(S)}function E(S){return S===null||S===62?$(S):fe(S)?(a=E,ie(S)):(t.consume(S),E)}function T(S){return S===null?n(S):S===63?(t.consume(S),M):fe(S)?(a=T,ie(S)):(t.consume(S),T)}function M(S){return S===62?$(S):T(S)}function N(S){return vt(S)?(t.consume(S),m):n(S)}function m(S){return S===45||lt(S)?(t.consume(S),m):_(S)}function _(S){return fe(S)?(a=_,ie(S)):Re(S)?(t.consume(S),_):$(S)}function x(S){return S===45||lt(S)?(t.consume(S),x):S===47||S===62||nt(S)?b(S):n(S)}function b(S){return S===47?(t.consume(S),$):S===58||S===95||vt(S)?(t.consume(S),y):fe(S)?(a=b,ie(S)):Re(S)?(t.consume(S),b):$(S)}function y(S){return S===45||S===46||S===58||S===95||lt(S)?(t.consume(S),y):A(S)}function A(S){return S===61?(t.consume(S),R):fe(S)?(a=A,ie(S)):Re(S)?(t.consume(S),A):b(S)}function R(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(t.consume(S),i=S,z):fe(S)?(a=R,ie(S)):Re(S)?(t.consume(S),R):(t.consume(S),F)}function z(S){return S===i?(t.consume(S),i=void 0,B):S===null?n(S):fe(S)?(a=z,ie(S)):(t.consume(S),z)}function F(S){return S===null||S===34||S===39||S===60||S===61||S===96?n(S):S===47||S===62||nt(S)?b(S):(t.consume(S),F)}function B(S){return S===47||S===62||nt(S)?b(S):n(S)}function $(S){return S===62?(t.consume(S),t.exit("htmlTextData"),t.exit("htmlText"),e):n(S)}function ie(S){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),te}function te(S){return Re(S)?De(t,ue,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):ue(S)}function ue(S){return t.enter("htmlTextData"),a(S)}}const io={name:"labelEnd",resolveAll:Ag,resolveTo:Eg,tokenize:_g},wg={tokenize:Mg},kg={tokenize:Sg},Tg={tokenize:Ig};function Ag(t){let e=-1;const n=[];for(;++e=3&&(u===null||fe(u))?(t.exit("thematicBreak"),e(u)):n(u)}function l(u){return u===i?(t.consume(u),r++,l):(t.exit("thematicBreakSequence"),Re(u)?De(t,s,"whitespace")(u):s(u))}}const tt={continuation:{tokenize:Fg},exit:jg,name:"list",tokenize:zg},Lg={partial:!0,tokenize:$g},Bg={partial:!0,tokenize:Ug};function zg(t,e,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return s;function s(f){const h=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(h==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Ii(f)){if(r.containerState.type||(r.containerState.type=h,t.enter(h,{_container:!0})),h==="listUnordered")return t.enter("listItemPrefix"),f===42||f===45?t.check(lr,n,u)(f):u(f);if(!r.interrupt||f===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(f)}return n(f)}function l(f){return Ii(f)&&++a<10?(t.consume(f),l):(!r.interrupt||a<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(t.exit("listItemValue"),u(f)):n(f)}function u(f){return t.enter("listItemMarker"),t.consume(f),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,t.check(Ar,r.interrupt?n:c,t.attempt(Lg,p,d))}function c(f){return r.containerState.initialBlankLine=!0,o++,p(f)}function d(f){return Re(f)?(t.enter("listItemPrefixWhitespace"),t.consume(f),t.exit("listItemPrefixWhitespace"),p):n(f)}function p(f){return r.containerState.size=o+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(f)}}function Fg(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(Ar,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,De(t,e,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!Re(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(Bg,e,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,De(t,t.attempt(tt,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function Ug(t,e,n){const r=this;return De(t,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?e(o):n(o)}}function jg(t){t.exit(this.containerState.type)}function $g(t,e,n){const r=this;return De(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!Re(o)&&a&&a[1].type==="listItemPrefixWhitespace"?e(o):n(o)}}const wa={name:"setextUnderline",resolveTo:Vg,tokenize:Hg};function Vg(t,e){let n=t.length,r,i,o;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!o&&t[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:{...t[i][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",o?(t.splice(i,0,["enter",a,e]),t.splice(o+1,0,["exit",t[r][1],e]),t[r][1].end={...t[o][1].end}):t[r][1]=a,t.push(["exit",a,e]),t}function Hg(t,e,n){const r=this;let i;return o;function o(u){let c=r.events.length,d;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){d=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(t.enter("setextHeadingLine"),i=u,a(u)):n(u)}function a(u){return t.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===i?(t.consume(u),s):(t.exit("setextHeadingLineSequence"),Re(u)?De(t,l,"lineSuffix")(u):l(u))}function l(u){return u===null||fe(u)?(t.exit("setextHeadingLine"),e(u)):n(u)}}const Gg={tokenize:Kg};function Kg(t){const e=this,n=t.attempt(Ar,r,t.attempt(this.parser.constructs.flowInitial,i,De(t,t.attempt(this.parser.constructs.flow,i,t.attempt(Qm,i)),"linePrefix")));return n;function r(o){if(o===null){t.consume(o);return}return t.enter("lineEndingBlank"),t.consume(o),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const qg={resolveAll:El()},Yg=Al("string"),Wg=Al("text");function Al(t){return{resolveAll:El(t==="text"?Xg:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],o=n.attempt(i,a,s);return a;function a(c){return u(c)?o(c):s(c)}function s(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),o(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;const d=i[c];let p=-1;if(d)for(;++p-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(t[i].slice(0,o))}return a}function uv(t,e){let n=-1;const r=[];let i;for(;++n0){const Ue=ne.tokenStack[ne.tokenStack.length-1];(Ue[1]||Ea).call(ne,void 0,Ue[0])}for(X.position={start:Pt(j.length>0?j[0][1].start:{line:1,column:1,offset:0}),end:Pt(j.length>0?j[j.length-2][1].end:{line:1,column:1,offset:0})},Te=-1;++Te1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};t.patch(e,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return t.patch(e,u),t.applyData(e,u)}function _v(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Mv(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function Sl(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=t.all(e),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function Sv(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return Sl(t,e);const i={src:yn(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,o),t.applyData(e,o)}function Iv(t,e){const n={src:yn(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function Rv(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function Cv(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return Sl(t,e);const i={href:yn(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,o),t.applyData(e,o)}function Nv(t,e){const n={href:yn(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function Ov(t,e,n){const r=t.all(e),i=n?Pv(n):Il(e),o={},a=[];if(typeof e.checked=="boolean"){const c=r[0];let d;c&&c.type==="element"&&c.tagName==="p"?d=c:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s1}function Dv(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Fv(t){const e=Cl(t),n=Rl(t);if(e&&n)return{start:e,end:n}}function Uv(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},s=Cl(e.children[1]),l=Rl(e.children[e.children.length-1]);s&&l&&(a.position={start:s,end:l}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,o),t.applyData(e,o)}function jv(t,e,n){const r=n?n.children:void 0,o=(r?r.indexOf(e):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,s=a?a.length:e.children.length;let l=-1;const u=[];for(;++l0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return o.push(Sa(e.slice(i),i>0,!1)),o.join("")}function Sa(t,e,n){let r=0,i=t.length;if(e){let o=t.codePointAt(r);for(;o===_a||o===Ma;)r++,o=t.codePointAt(r)}if(n){let o=t.codePointAt(i-1);for(;o===_a||o===Ma;)i--,o=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function Hv(t,e){const n={type:"text",value:Vv(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function Gv(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const Kv={blockquote:xv,break:wv,code:kv,delete:Tv,emphasis:Av,footnoteReference:Ev,heading:_v,html:Mv,imageReference:Sv,image:Iv,inlineCode:Rv,linkReference:Cv,link:Nv,listItem:Ov,list:Dv,paragraph:Lv,root:Bv,strong:zv,table:Uv,tableCell:$v,tableRow:jv,text:Hv,thematicBreak:Gv,toml:Yn,yaml:Yn,definition:Yn,footnoteDefinition:Yn};function Yn(){}const Ol=-1,Er=0,hr=1,mr=2,oo=3,ao=4,so=5,lo=6,Pl=7,Dl=8,Ia=typeof self=="object"?self:globalThis,qv=(t,e)=>{const n=(i,o)=>(t.set(o,i),i),r=i=>{if(t.has(i))return t.get(i);const[o,a]=e[i];switch(o){case Er:case Ol:return n(a,i);case hr:{const s=n([],i);for(const l of a)s.push(r(l));return s}case mr:{const s=n({},i);for(const[l,u]of a)s[r(l)]=r(u);return s}case oo:return n(new Date(a),i);case ao:{const{source:s,flags:l}=a;return n(new RegExp(s,l),i)}case so:{const s=n(new Map,i);for(const[l,u]of a)s.set(r(l),r(u));return s}case lo:{const s=n(new Set,i);for(const l of a)s.add(r(l));return s}case Pl:{const{name:s,message:l}=a;return n(new Ia[s](l),i)}case Dl:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i)}return n(new Ia[o](a),i)};return r},Ra=t=>qv(new Map,t)(0),an="",{toString:Yv}={},{keys:Wv}=Object,An=t=>{const e=typeof t;if(e!=="object"||!t)return[Er,e];const n=Yv.call(t).slice(8,-1);switch(n){case"Array":return[hr,an];case"Object":return[mr,an];case"Date":return[oo,an];case"RegExp":return[ao,an];case"Map":return[so,an];case"Set":return[lo,an]}return n.includes("Array")?[hr,n]:n.includes("Error")?[Pl,n]:[mr,n]},Wn=([t,e])=>t===Er&&(e==="function"||e==="symbol"),Xv=(t,e,n,r)=>{const i=(a,s)=>{const l=r.push(a)-1;return n.set(s,l),l},o=a=>{if(n.has(a))return n.get(a);let[s,l]=An(a);switch(s){case Er:{let c=a;switch(l){case"bigint":s=Dl,c=a.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+l);c=null;break;case"undefined":return i([Ol],a)}return i([s,c],a)}case hr:{if(l)return i([l,[...a]],a);const c=[],d=i([s,c],a);for(const p of a)c.push(o(p));return d}case mr:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(e&&"toJSON"in a)return o(a.toJSON());const c=[],d=i([s,c],a);for(const p of Wv(a))(t||!Wn(An(a[p])))&&c.push([o(p),o(a[p])]);return d}case oo:return i([s,a.toISOString()],a);case ao:{const{source:c,flags:d}=a;return i([s,{source:c,flags:d}],a)}case so:{const c=[],d=i([s,c],a);for(const[p,f]of a)(t||!(Wn(An(p))||Wn(An(f))))&&c.push([o(p),o(f)]);return d}case lo:{const c=[],d=i([s,c],a);for(const p of a)(t||!Wn(An(p)))&&c.push(o(p));return d}}const{message:u}=a;return i([s,{name:l,message:u}],a)};return o},Ca=(t,{json:e,lossy:n}={})=>{const r=[];return Xv(!(e||n),!!e,new Map,r)(t),r},gr=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?Ra(Ca(t,e)):structuredClone(t):(t,e)=>Ra(Ca(t,e));function Qv(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function Zv(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function Jv(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||Qv,r=t.options.footnoteBackLabel||Zv,i=t.options.footnoteLabel||"Footnotes",o=t.options.footnoteLabelTagName||"h2",a=t.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l0&&h.push({type:"text",value:" "});let E=typeof n=="string"?n:n(l,f);typeof E=="string"&&(E={type:"text",value:E}),h.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+p+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,f),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const v=c[c.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const E=v.children[v.children.length-1];E&&E.type==="text"?E.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...h)}else c.push(...h);const g={type:"element",tagName:"li",properties:{id:e+"fn-"+p},children:t.wrap(c,!0)};t.patch(u,g),s.push(g)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...gr(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:t.wrap(s,!0)},{type:"text",value:` +`}]}}const Ll=function(t){if(t==null)return ry;if(typeof t=="function")return _r(t);if(typeof t=="object")return Array.isArray(t)?ey(t):ty(t);if(typeof t=="string")return ny(t);throw new Error("Expected function, string, or object as test")};function ey(t){const e=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let f=Bl,h,w,v;if((!e||o(l,u,c[c.length-1]||void 0))&&(f=ly(n(l,c)),f[0]===Na))return f;if("children"in l&&l.children){const g=l;if(g.children&&f[0]!==ay)for(w=(r?g.children.length:-1)+a,v=c.concat(g);w>-1&&w0&&n.push({type:"text",value:` +`}),n}function Oa(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function Pa(t,e){const n=dy(t,e),r=n.one(t,void 0),i=Jv(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` +`},i),o}function gy(t,e){return t&&"run"in t?async function(n,r){const i=Pa(n,{file:r,...e});await t.run(i,r)}:function(n,r){return Pa(n,{file:r,...t||e})}}function Da(t){if(t)throw t}var ti,La;function vy(){if(La)return ti;La=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):e.call(u)==="[object Array]"},o=function(u){if(!u||e.call(u)!=="[object Object]")return!1;var c=t.call(u,"constructor"),d=u.constructor&&u.constructor.prototype&&t.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!c&&!d)return!1;var p;for(p in u);return typeof p>"u"||t.call(u,p)},a=function(u,c){n&&c.name==="__proto__"?n(u,c.name,{enumerable:!0,configurable:!0,value:c.newValue,writable:!0}):u[c.name]=c.newValue},s=function(u,c){if(c==="__proto__")if(t.call(u,c)){if(r)return r(u,c).value}else return;return u[c]};return ti=function l(){var u,c,d,p,f,h,w=arguments[0],v=1,g=arguments.length,E=!1;for(typeof w=="boolean"&&(E=w,w=arguments[1]||{},v=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});va.length;let l;s&&a.push(i);try{l=t.apply(this,a)}catch(u){const c=u;if(s&&n)throw c;return i(c)}s||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(a,...s){n||(n=!0,e(a,...s))}function o(a){i(null,a)}}class rt extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof e=="string"?i=e:!o.cause&&e&&(a=!0,i=e.message,o.cause=e),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=s?s.line:void 0,this.name=In(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}rt.prototype.file="";rt.prototype.name="";rt.prototype.reason="";rt.prototype.message="";rt.prototype.stack="";rt.prototype.column=void 0;rt.prototype.line=void 0;rt.prototype.ancestors=void 0;rt.prototype.cause=void 0;rt.prototype.fatal=void 0;rt.prototype.place=void 0;rt.prototype.ruleId=void 0;rt.prototype.source=void 0;const gt={basename:wy,dirname:ky,extname:Ty,join:Ay,sep:"/"};function wy(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');Fn(t);let n=0,r=-1,i=t.length,o;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let a=-1,s=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(t.codePointAt(i)===e.codePointAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=t.length),t.slice(n,r)}function ky(t){if(Fn(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function Ty(t){Fn(t);let e=t.length,n=-1,r=0,i=-1,o=0,a;for(;e--;){const s=t.codePointAt(e);if(s===47){if(a){r=e+1;break}continue}n<0&&(a=!0,n=e+1),s===46?i<0?i=e:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function Ay(...t){let e=-1,n;for(;++e0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function _y(t,e){let n="",r=0,i=-1,o=0,a=-1,s,l;for(;++a<=t.length;){if(a2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,a):n=t.slice(i+1,a),r=a-i-1;i=a,o=0}else s===46&&o>-1?o++:o=-1}return n}function Fn(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const My={cwd:Sy};function Sy(){return"/"}function Pi(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Iy(t){if(typeof t=="string")t=new URL(t);else if(!Pi(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return Ry(t)}function Ry(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n0){let[f,...h]=c;const w=r[p][1];Oi(w)&&Oi(f)&&(f=ni(!0,w,f)),r[p]=[u,f,...h]}}}}const Dy=new uo().freeze();function ai(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function si(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function li(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function za(t){if(!Oi(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Fa(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Xn(t){return Ly(t)?t:new Cy(t)}function Ly(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function By(t){return typeof t=="string"||zy(t)}function zy(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}function co(){const t=Dy().use(bv).use(gy).use(pm);return{process:e=>t.processSync(e).toString()}}function Fy(t,e){return{role:"system",content:[t,Ic.map(n=>`- ${n}`).join(` +`),e].join(` + +`)}}function Uy(t){const e=new Uint8Array(t.frequencyBinCount);t.getByteFrequencyData(e);const n=[];for(let i=0;i<700;i+=80)n.push(e[i]);return e.map(i=>i**1.2).map(i=>i*1.2).reduce((i,o)=>i+o,0)/e.length/100}function jy(t){const e=new Uint8Array(t.frequencyBinCount);t.getByteFrequencyData(e);const n=[];for(let u=0;u<700;u+=80)n.push(e[u]);const r=e.map(u=>u**1.5),i=Math.min(...r),a=Math.max(...r)-i;let s;return a===0?s=r.map(()=>0):s=r.map(u=>(u-i)/a),s.reduce((u,c)=>u+c,0)/e.length}function $y(t,e="linear"){switch(e){case"linear":return Uy(t);case"minmax":return jy(t)}}const zl=xr("AudioContext",()=>({audioContext:new AudioContext,calculateVolume:$y})),Vy=xr("SpeakingStore",()=>{const n=V(0),r=V(!1),i=Se(()=>r.value?(30+70*n.value)/100:30);return{mouthOpenSize:n,nowSpeaking:r,nowSpeakingAvatarBorderOpacity:i}});function Qn(t,e,n){return e+n<0||e+n>=t.length-1?"":t[e+n]}function Hy(t){let e="literal",n="";return{async consume(r){var i,o,a;for(let s=0;s"?(l+=Qn(r,s,1),u="literal",s++):l==="<"?u="special":l===">"&&(u="literal"),e==="literal"&&u==="special"?n!==""&&(await((i=t.onLiteral)==null?void 0:i.call(t,n)),n=""):e==="special"&&u==="literal"&&n!==""&&(n+=l,await((o=t.onSpecial)==null?void 0:o.call(t,n)),n=""),e==="literal"&&u==="literal"?(await((a=t.onLiteral)==null?void 0:a.call(t,l)),n=""):e==="special"&&u==="literal"?n="":n+=l,e=u}},async end(){var r,i;n!==""&&(e==="literal"?await((r=t.onLiteral)==null?void 0:r.call(t,n)):n.endsWith("|>")&&await((i=t.onSpecial)==null?void 0:i.call(t,n)))}}}const Gy=async t=>(t.fetch??globalThis.fetch)(Qi("models",t.baseURL),{headers:Xi({"Content-Type":"application/json",...t.headers},t.apiKey),signal:t.abortSignal}).then(Kp).then(({data:e})=>e),Ky=async t=>{var e;return(t.fetch??globalThis.fetch)(Qi("chat/completions",t.baseURL),{body:Js({...t,tools:(e=t.tools)==null?void 0:e.map(n=>({function:n.function,type:"function"}))}),headers:Xi({"Content-Type":"application/json",...t.headers},t.apiKey),method:"POST",signal:t.abortSignal}).then(Zi)},Ua="data:",qy=async t=>Ky({...t,stream:!0}).then(async e=>{const n=new TextDecoder;let r,i;const o=async(d,p)=>{if(!d||!d.startsWith(Ua))return;const f=d.slice(Ua.length),h=f.startsWith(" ")?f.slice(1):f;if(h==="[DONE]")return p.terminate(),!0;if(h.startsWith("{")&&h.includes('"error":'))return p.error(new Error(`Error from server: ${h}`)),!0;const w=JSON.parse(h);p.enqueue(w),t.onChunk&&await t.onChunk(w),w.choices[0].finish_reason!==void 0&&(r=w.choices[0].finish_reason),w.usage!==void 0&&(i=w.usage)};let a="";const s=e.body.pipeThrough(new TransformStream({transform:async(d,p)=>{const f=n.decode(d,{stream:!0});a+=f;const h=a.split(` +`);a=h.pop()??"";for(const w of h)if(await o(w,p))break}})),[l,u]=s.tee(),c=u.pipeThrough(new TransformStream({transform:(d,p)=>p.enqueue(d.choices[0].delta.content)}));return{chunkStream:l,finishReason:r,textStream:c,usage:i}}),Fl=xr("llm",()=>{async function t(n,r,i,o){return await qy({baseURL:n.endsWith("/")?n:`${n}/`,apiKey:r,model:i,messages:o,streamOptions:{usage:!0}})}async function e(n,r){if(n==="")return[];try{return await Gy({baseURL:n.endsWith("/")?n:`${n}/`,apiKey:r})}catch(i){if(String(i).includes("Failed to construct 'URL': Invalid URL"))return[];throw i}}return{models:e,stream:t}}),Xt=xr("chat",()=>{const{stream:t}=Fl(),{t:e}=Pn(),{openAiApiBaseURL:n,openAiApiKey:r,openAiModel:i}=Ft(Dn()),o=V([]),a=V([]),s=V([]),l=V([]),u=V([]),c=V([]),d=V([]);function p(m){o.value.push(m)}function f(m){a.value.push(m)}function h(m){s.value.push(m)}function w(m){l.value.push(m)}function v(m){u.value.push(m)}function g(m){c.value.push(m)}function E(m){d.value.push(m)}const T=V([Fy(e("prompt.prefix"),e("prompt.suffix"))]),M=V({role:"assistant",content:""});async function N(m,_){if(!m)return;for(const B of o.value)await B(m);const{baseUrl:x=n.value,apiKey:b=r.value,model:y=i.value}=_??{};M.value={role:"assistant",content:""},T.value.push({role:"user",content:m}),T.value.push(M.value);const A=T.value.slice(0,T.value.length-1);for(const B of a.value)await B(m);for(const B of s.value)await B(m);const R=await t(x,b,y.id,A);for(const B of l.value)await B(m);let z="";const F=Hy({onLiteral:async B=>{for(const $ of u.value)await $(B);M.value.content+=B},onSpecial:async B=>{for(const $ of c.value)await $(B)}});for await(const B of Bc(R.textStream,async $=>$))z+=B,await F.consume(B);await F.end();for(const B of d.value)await B();console.debug("LLM output:",z)}return{messages:T,streamingMessage:M,send:N,onBeforeMessageComposed:p,onAfterMessageComposed:f,onBeforeSend:h,onAfterSend:w,onTokenLiteral:v,onTokenSpecial:g,onStreamEnd:E}}),Yy={relative:""},Wy={"h-full":"","w-full":""},Xy={key:0,class:"animate-stripe",absolute:"",left:"1/2",bottom:"20%",z:"20","rounded-2xl":"",text:"pink-600","px-2":"","py-2":"",transform:"translate-x--1/2"},Qy={bg:"pink-50","rounded-xl":"","px-10":"","py-6":""},Zy=["innerHTML"],Jy=xe({__name:"Stage",setup(t){const e=V(),n=V(),{stageView:r,elevenLabsApiKey:i,elevenlabsVoiceEnglish:o,elevenlabsVoiceJapanese:a}=Ft(Dn()),{mouthOpenSize:s}=Ft(Vy()),{audioContext:l,calculateVolume:u}=zl(),{onBeforeMessageComposed:c,onBeforeSend:d,onTokenLiteral:p,onTokenSpecial:f,onStreamEnd:h,streamingMessage:w}=Xt(),{process:v}=co(),{locale:g}=Pn(),E=V(),T=V(!1),M=V(!1),N=Dr({handlers:[F=>new Promise(B=>{const $=l.createBufferSource();$.buffer=F.data.audioBuffer,$.connect(l.destination),$.connect(E.value),T.value=!0,$.start(0),$.onended=()=>{T.value=!1,B()}})]}),m=Dr({handlers:[async F=>{let B=Qu.Camilla_KM;g.value==="jp"||g.value==="jp-JP"?B=a.value:B=o.value;const $=Date.now(),ie=Wp({apiKey:i.value,baseURL:"https://unspeech.hyp3r.link/v1/"}),te=await qp({...ie.speech("eleven_multilingual_v2",{voiceSettings:{stability:.4,similarityBoost:.5}}),input:F.data,voice:Zu[B]}),ue=Date.now()-$;console.debug("TTS took",ue,"ms");const S=await l.decodeAudioData(te);await N.add({audioBuffer:S,text:F.data})}]});m.on("add",F=>{console.debug("ttsQueue added",F)});const _=Rc(m),x=Dr({handlers:[async F=>{if(r.value==="3d"){const B=Pc[F.data];if(!B)return;await n.value.setExpression(B)}else r.value==="2d"&&await e.value.setMotion(Dc[F.data])}]}),b=Cc(x);b.onHandlerEvent("emotion",F=>{console.debug("emotion detected",F)});const y=Nc();y.onHandlerEvent("delay",F=>{console.debug("delay detected",F)});function A(){requestAnimationFrame(A),T.value&&(s.value=u(E.value,"linear"))}function R(){M.value||(A(),l.resume(),M.value=!0)}function z(){E.value||(E.value=l.createAnalyser())}return c(async()=>{z(),R()}),d(async()=>{var F;(F=e.value)==null||F.setMotion(Ss)}),p(async F=>{await _.add(F)}),f(async F=>{await y.add(F),await b.add(F)}),h(async()=>{await y.add(Oc)}),ut(()=>{M.value=!1}),(F,B)=>(Q(),ee("div",Yy,[P("div",Wy,[D(r)==="2d"?(Q(),je(qc,{key:0,ref_key:"live2DViewerRef",ref:e,"mouth-open-size":D(s),model:"./assets/live2d/models/hiyori_pro_zh.zip","min-w":"50% {const o=tc(r,i);if(o||o===null)return o;throw new Error(`Injection \`${r.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`)},i=>(sc(r,i),i)]}function Ul(t,e,n){const r=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&r.addEventListener(t,e,{once:!0}),r.dispatchEvent(i)}function jl(t){return us()?(cs(t),!0):!1}function e0(t){let e=!1,n;const r=bs(!0);return(...i)=>(e||(n=r.run(()=>t(...i)),e=!0),n)}function t0(t){let e=0,n,r;const i=()=>{e-=1,r&&e<=0&&(r.stop(),n=void 0,r=void 0)};return(...o)=>(e+=1,n||(r=bs(!0),n=r.run(()=>t(...o))),jl(i),n)}function po(t){return typeof t=="function"?t():D(t)}const Jt=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const n0=t=>typeof t<"u",r0=Object.prototype.toString,i0=t=>r0.call(t)==="[object Object]",o0=()=>{},ja=a0();function a0(){var t,e;return Jt&&((t=window==null?void 0:window.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function s0(t){return Qt()}function l0(t,e){s0()&&xs(t,e)}function Mr(t){var e;const n=po(t);return(e=n==null?void 0:n.$el)!=null?e:n}const ho=Jt?window:void 0;function $l(...t){let e,n,r,i;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,r,i]=t,e=ho):[e,n,r,i]=t,!e)return o0;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const o=[],a=()=>{o.forEach(c=>c()),o.length=0},s=(c,d,p,f)=>(c.addEventListener(d,p,f),()=>c.removeEventListener(d,p,f)),l=Ee(()=>[Mr(e),po(i)],([c,d])=>{if(a(),!c)return;const p=i0(d)?{...d}:d;o.push(...n.flatMap(f=>r.map(h=>s(c,f,h,p))))},{immediate:!0,flush:"post"}),u=()=>{l(),a()};return jl(u),u}function u0(t){return typeof t=="function"?t:typeof t=="string"?e=>e.key===t:Array.isArray(t)?e=>t.includes(e.key):()=>!0}function c0(...t){let e,n,r={};t.length===3?(e=t[0],n=t[1],r=t[2]):t.length===2?typeof t[1]=="object"?(e=!0,n=t[0],r=t[1]):(e=t[0],n=t[1]):(e=!0,n=t[0]);const{target:i=ho,eventName:o="keydown",passive:a=!1,dedupe:s=!1}=r,l=u0(e);return $l(i,o,u=>{u.repeat&&po(s)||l(u)&&n(u)},a)}function d0(){const t=V(!1),e=Qt();return e&&mt(()=>{t.value=!0},e),t}function f0(t){return JSON.parse(JSON.stringify(t))}function p0(t,e,n,r={}){var i,o,a;const{clone:s=!1,passive:l=!1,eventName:u,deep:c=!1,defaultValue:d,shouldEmit:p}=r,f=Qt(),h=n||(f==null?void 0:f.emit)||((i=f==null?void 0:f.$emit)==null?void 0:i.bind(f))||((a=(o=f==null?void 0:f.proxy)==null?void 0:o.$emit)==null?void 0:a.bind(f==null?void 0:f.proxy));let w=u;w=w||`update:${e.toString()}`;const v=T=>s?typeof s=="function"?s(T):f0(T):T,g=()=>n0(t[e])?v(t[e]):d,E=T=>{p?p(T)&&h(w,T):h(w,T)};if(l){const T=g(),M=V(T);let N=!1;return Ee(()=>t[e],m=>{N||(N=!0,M.value=v(m),ft(()=>N=!1))}),Ee(M,m=>{!N&&(m!==t[e]||c)&&E(m)},{deep:c}),M}else return Se({get(){return g()},set(T){E(T)}})}function mo(t){return t?t.flatMap(e=>e.type===mn?mo(e.children):[e]):[]}function ui(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function Di(t,e,n=".",r){if(!ui(e))return Di(t,{},n);const i=Object.assign({},e);for(const o in t){if(o==="__proto__"||o==="constructor")continue;const a=t[o];a!=null&&(Array.isArray(a)&&Array.isArray(i[o])?i[o]=[...a,...i[o]]:ui(a)&&ui(i[o])?i[o]=Di(a,i[o],(n?`${n}.`:"")+o.toString()):i[o]=a)}return i}function h0(t){return(...e)=>e.reduce((n,r)=>Di(n,r,""),{})}const m0=h0(),[Vl,fx]=fo("ConfigProvider");let g0="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",v0=(t=21)=>{let e="",n=t;for(;n--;)e+=g0[Math.random()*64|0];return e};const y0=t0(()=>{const t=V(new Map),e=V(),n=Se(()=>{for(const a of t.value.values())if(a)return!0;return!1}),r=Vl({scrollBody:V(!0)});let i=null;const o=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.body.style.removeProperty("--scrollbar-width"),document.body.style.overflow=e.value??"",ja&&(i==null||i()),e.value=void 0};return Ee(n,(a,s)=>{var l;if(!Jt)return;if(!a){s&&o();return}e.value===void 0&&(e.value=document.body.style.overflow);const u=window.innerWidth-document.documentElement.clientWidth,c={padding:u,margin:0},d=(l=r.scrollBody)!=null&&l.value?typeof r.scrollBody.value=="object"?m0({padding:r.scrollBody.value.padding===!0?u:r.scrollBody.value.padding,margin:r.scrollBody.value.margin===!0?u:r.scrollBody.value.margin},c):c:{padding:0,margin:0};u>0&&(document.body.style.paddingRight=typeof d.padding=="number"?`${d.padding}px`:String(d.padding),document.body.style.marginRight=typeof d.margin=="number"?`${d.margin}px`:String(d.margin),document.body.style.setProperty("--scrollbar-width",`${u}px`),document.body.style.overflow="hidden"),ja&&(i=$l(document,"touchmove",p=>x0(p),{passive:!1})),ft(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})},{immediate:!0,flush:"sync"}),t});function b0(t){const e=v0(6),n=y0();n.value.set(e,t);const r=Se({get:()=>n.value.get(e)??!1,set:i=>n.value.set(e,i)});return l0(()=>{n.value.delete(e)}),r}function Hl(t){const e=window.getComputedStyle(t);if(e.overflowX==="scroll"||e.overflowY==="scroll"||e.overflowX==="auto"&&t.clientWidth1?!0:(e.preventDefault&&e.cancelable&&e.preventDefault(),!1)}function go(t){const e=Qt(),n=e==null?void 0:e.type.emits,r={};return n!=null&&n.length||console.warn(`No emitted event found. Please check component: ${e==null?void 0:e.type.__name}`),n==null||n.forEach(i=>{r[oc(ac(i))]=(...o)=>t(i,...o)}),r}function It(){const t=Qt(),e=V(),n=Se(()=>{var a,s;return["#text","#comment"].includes((a=e.value)==null?void 0:a.$el.nodeName)?(s=e.value)==null?void 0:s.$el.nextElementSibling:Mr(e)}),r=Object.assign({},t.exposed),i={};for(const a in t.props)Object.defineProperty(i,a,{enumerable:!0,configurable:!0,get:()=>t.props[a]});if(Object.keys(r).length>0)for(const a in r)Object.defineProperty(i,a,{enumerable:!0,configurable:!0,get:()=>r[a]});Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>t.vnode.el}),t.exposed=i;function o(a){e.value=a,!(a instanceof Element||!a)&&(Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>a.$el}),t.exposed=i)}return{forwardRef:o,currentRef:e,currentElement:n}}var w0=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},sn=new WeakMap,Zn=new WeakMap,Jn={},ci=0,Gl=function(t){return t&&(t.host||Gl(t.parentNode))},k0=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=Gl(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},T0=function(t,e,n,r){var i=k0(e,Array.isArray(t)?t:[t]);Jn[n]||(Jn[n]=new WeakMap);var o=Jn[n],a=[],s=new Set,l=new Set(i),u=function(d){!d||s.has(d)||(s.add(d),u(d.parentNode))};i.forEach(u);var c=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(p){if(s.has(p))c(p);else try{var f=p.getAttribute(r),h=f!==null&&f!=="false",w=(sn.get(p)||0)+1,v=(o.get(p)||0)+1;sn.set(p,w),o.set(p,v),a.push(p),w===1&&h&&Zn.set(p,!0),v===1&&p.setAttribute(n,"true"),h||p.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",p,g)}})};return c(e),s.clear(),ci++,function(){a.forEach(function(d){var p=sn.get(d)-1,f=o.get(d)-1;sn.set(d,p),o.set(d,f),p||(Zn.has(d)||d.removeAttribute(r),Zn.delete(d)),f||d.removeAttribute(n)}),ci--,ci||(sn=new WeakMap,sn=new WeakMap,Zn=new WeakMap,Jn={})}},A0=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=w0(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),T0(r,i,n,"aria-hidden")):function(){return null}};function E0(t){let e;Ee(()=>Mr(t),n=>{n?e=A0(n):e&&e()}),ut(()=>{e&&e()})}let _0=0;function Li(t,e="radix"){const n=Vl({useId:void 0});return _o?`${e}-${_o()}`:n.useId?`${e}-${n.useId()}`:`${e}-${++_0}`}function M0(t,e){const n=V(t);function r(i){return e[n.value][i]??n.value}return{state:n,dispatch:i=>{n.value=r(i)}}}const S0=xe({name:"PrimitiveSlot",inheritAttrs:!1,setup(t,{attrs:e,slots:n}){return()=>{var r,i;if(!n.default)return null;const o=mo(n.default()),a=o.findIndex(c=>c.type!==rc);if(a===-1)return o;const s=o[a];(r=s.props)==null||delete r.ref;const l=s.props?Ut(e,s.props):e;e.class&&(i=s.props)!=null&&i.class&&delete s.props.class;const u=ic(s,l);for(const c in l)c.startsWith("on")&&(u.props||(u.props={}),u.props[c]=l[c]);return o.length===1?u:(o[a]=u,o)}}}),Sr=xe({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(t,{attrs:e,slots:n}){const r=t.asChild?"template":t.as;return typeof r=="string"&&["area","img","input"].includes(r)?()=>or(r,e):r!=="template"?()=>or(t.as,e,{default:n.default}):()=>or(S0,e,{default:n.default})}});function I0(t,e){var n;const r=V({}),i=V("none"),o=V(t),a=t.value?"mounted":"unmounted";let s;const l=((n=e.value)==null?void 0:n.ownerDocument.defaultView)??ho,{state:u,dispatch:c}=M0(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),d=v=>{var g;if(Jt){const E=new CustomEvent(v,{bubbles:!1,cancelable:!1});(g=e.value)==null||g.dispatchEvent(E)}};Ee(t,async(v,g)=>{var E;const T=g!==v;if(await ft(),T){const M=i.value,N=er(e.value);v?(c("MOUNT"),d("enter"),N==="none"&&d("after-enter")):N==="none"||((E=r.value)==null?void 0:E.display)==="none"?(c("UNMOUNT"),d("leave"),d("after-leave")):g&&M!==N?(c("ANIMATION_OUT"),d("leave")):(c("UNMOUNT"),d("after-leave"))}},{immediate:!0});const p=v=>{const g=er(e.value),E=g.includes(v.animationName),T=u.value==="mounted"?"enter":"leave";if(v.target===e.value&&E&&(d(`after-${T}`),c("ANIMATION_END"),!o.value)){const M=e.value.style.animationFillMode;e.value.style.animationFillMode="forwards",s=l==null?void 0:l.setTimeout(()=>{var N;((N=e.value)==null?void 0:N.style.animationFillMode)==="forwards"&&(e.value.style.animationFillMode=M)})}v.target===e.value&&g==="none"&&c("ANIMATION_END")},f=v=>{v.target===e.value&&(i.value=er(e.value))},h=Ee(e,(v,g)=>{v?(r.value=getComputedStyle(v),v.addEventListener("animationstart",f),v.addEventListener("animationcancel",p),v.addEventListener("animationend",p)):(c("ANIMATION_END"),l==null||l.clearTimeout(s),g==null||g.removeEventListener("animationstart",f),g==null||g.removeEventListener("animationcancel",p),g==null||g.removeEventListener("animationend",p))},{immediate:!0}),w=Ee(u,()=>{const v=er(e.value);i.value=u.value==="mounted"?v:"none"});return ut(()=>{h(),w()}),{isPresent:Se(()=>["mounted","unmountSuspended"].includes(u.value))}}function er(t){return t&&getComputedStyle(t).animationName||"none"}const Kl=xe({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(t,{slots:e,expose:n}){var r;const{present:i,forceMount:o}=gn(t),a=V(),{isPresent:s}=I0(i,a);n({present:s});let l=e.default({present:s});l=mo(l||[]);const u=Qt();if(l&&(l==null?void 0:l.length)>1){const c=(r=u==null?void 0:u.parent)!=null&&r.type.name?`<${u.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${c}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(d=>` - ${d}`).join(` +`)].join(` +`))}return()=>o.value||i.value||s.value?or(e.default({present:s})[0],{ref:c=>{const d=Mr(c);return typeof(d==null?void 0:d.hasAttribute)>"u"||(d!=null&&d.hasAttribute("data-radix-popper-content-wrapper")?a.value=d.firstElementChild:a.value=d),d}}):null}}),[en,R0]=fo("DialogRoot"),C0=xe({inheritAttrs:!1,__name:"DialogRoot",props:{open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:!1},modal:{type:Boolean,default:!0}},emits:["update:open"],setup(t,{emit:e}){const n=t,r=p0(n,"open",e,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=V(),o=V(),{modal:a}=gn(n);return R0({open:r,modal:a,openModal:()=>{r.value=!0},onOpenChange:s=>{r.value=s},onOpenToggle:()=>{r.value=!r.value},contentId:"",titleId:"",descriptionId:"",triggerElement:i,contentElement:o}),(s,l)=>ze(s.$slots,"default",{open:D(r)})}}),ql=xe({__name:"DialogTrigger",props:{asChild:{type:Boolean},as:{default:"button"}},setup(t){const e=t,n=en(),{forwardRef:r,currentElement:i}=It();return n.contentId||(n.contentId=Li(void 0,"radix-vue-dialog-content")),mt(()=>{n.triggerElement.value=i.value}),(o,a)=>(Q(),je(D(Sr),Ut(e,{ref:D(r),type:o.as==="button"?"button":void 0,"aria-haspopup":"dialog","aria-expanded":D(n).open.value||!1,"aria-controls":D(n).open.value?D(n).contentId:void 0,"data-state":D(n).open.value?"open":"closed",onClick:D(n).onOpenToggle}),{default:be(()=>[ze(o.$slots,"default")]),_:3},16,["type","aria-expanded","aria-controls","data-state","onClick"]))}}),N0=xe({__name:"Teleport",props:{to:{default:"body"},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(t){const e=d0();return(n,r)=>D(e)||n.forceMount?(Q(),je(nc,{key:0,to:n.to,disabled:n.disabled},[ze(n.$slots,"default")],8,["to","disabled"])):Ye("",!0)}}),Yl=xe({__name:"DialogPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(t){const e=t;return(n,r)=>(Q(),je(D(N0),Ju(ec(e)),{default:be(()=>[ze(n.$slots,"default")]),_:3},16))}}),O0="dismissableLayer.pointerDownOutside",P0="dismissableLayer.focusOutside";function Wl(t,e){const n=e.closest("[data-dismissable-layer]"),r=t.dataset.dismissableLayer===""?t:t.querySelector("[data-dismissable-layer]"),i=Array.from(t.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(n&&r===n||i.indexOf(r){});return yt(a=>{if(!Jt)return;const s=async u=>{const c=u.target;if(e!=null&&e.value){if(Wl(e.value,c)){i.value=!1;return}if(u.target&&!i.value){let d=function(){Ul(O0,t,p)};const p={originalEvent:u};u.pointerType==="touch"?(r.removeEventListener("click",o.value),o.value=d,r.addEventListener("click",o.value,{once:!0})):d()}else r.removeEventListener("click",o.value);i.value=!1}},l=window.setTimeout(()=>{r.addEventListener("pointerdown",s)},0);a(()=>{window.clearTimeout(l),r.removeEventListener("pointerdown",s),r.removeEventListener("click",o.value)})}),{onPointerDownCapture:()=>i.value=!0}}function L0(t,e){var n;const r=((n=e==null?void 0:e.value)==null?void 0:n.ownerDocument)??(globalThis==null?void 0:globalThis.document),i=V(!1);return yt(o=>{if(!Jt)return;const a=async s=>{e!=null&&e.value&&(await ft(),!(!e.value||Wl(e.value,s.target))&&s.target&&!i.value&&Ul(P0,t,{originalEvent:s}))};r.addEventListener("focusin",a),o(()=>r.removeEventListener("focusin",a))}),{onFocusCapture:()=>i.value=!0,onBlurCapture:()=>i.value=!1}}const Et=ws({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),B0=xe({__name:"DismissableLayer",props:{disableOutsidePointerEvents:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","dismiss"],setup(t,{emit:e}){const n=t,r=e,{forwardRef:i,currentElement:o}=It(),a=Se(()=>{var h;return((h=o.value)==null?void 0:h.ownerDocument)??globalThis.document}),s=Se(()=>Et.layersRoot),l=Se(()=>o.value?Array.from(s.value).indexOf(o.value):-1),u=Se(()=>Et.layersWithOutsidePointerEventsDisabled.size>0),c=Se(()=>{const h=Array.from(s.value),[w]=[...Et.layersWithOutsidePointerEventsDisabled].slice(-1),v=h.indexOf(w);return l.value>=v}),d=D0(async h=>{const w=[...Et.branches].some(v=>v==null?void 0:v.contains(h.target));!c.value||w||(r("pointerDownOutside",h),r("interactOutside",h),await ft(),h.defaultPrevented||r("dismiss"))},o),p=L0(h=>{[...Et.branches].some(w=>w==null?void 0:w.contains(h.target))||(r("focusOutside",h),r("interactOutside",h),h.defaultPrevented||r("dismiss"))},o);c0("Escape",h=>{l.value===s.value.size-1&&(r("escapeKeyDown",h),h.defaultPrevented||r("dismiss"))});let f;return yt(h=>{o.value&&(n.disableOutsidePointerEvents&&(Et.layersWithOutsidePointerEventsDisabled.size===0&&(f=a.value.body.style.pointerEvents,a.value.body.style.pointerEvents="none"),Et.layersWithOutsidePointerEventsDisabled.add(o.value)),s.value.add(o.value),h(()=>{n.disableOutsidePointerEvents&&Et.layersWithOutsidePointerEventsDisabled.size===1&&(a.value.body.style.pointerEvents=f)}))}),yt(h=>{h(()=>{o.value&&(s.value.delete(o.value),Et.layersWithOutsidePointerEventsDisabled.delete(o.value))})}),(h,w)=>(Q(),je(D(Sr),{ref:D(i),"as-child":h.asChild,as:h.as,"data-dismissable-layer":"",style:pr({pointerEvents:u.value?c.value?"auto":"none":void 0}),onFocusCapture:D(p).onFocusCapture,onBlurCapture:D(p).onBlurCapture,onPointerdownCapture:D(d).onPointerDownCapture},{default:be(()=>[ze(h.$slots,"default")]),_:3},8,["as-child","as","style","onFocusCapture","onBlurCapture","onPointerdownCapture"]))}}),di="focusScope.autoFocusOnMount",fi="focusScope.autoFocusOnUnmount",$a={bubbles:!1,cancelable:!0};function z0(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Dt(r,{select:e}),document.activeElement!==n)return!0}function F0(t){const e=Xl(t),n=Va(e,t),r=Va(e.reverse(),t);return[n,r]}function Xl(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Va(t,e){for(const n of t)if(!U0(n,{upTo:e}))return n}function U0(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function j0(t){return t instanceof HTMLInputElement&&"select"in t}function Dt(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&j0(t)&&e&&t.select()}}const $0=e0(()=>V([]));function V0(){const t=$0();return{add(e){const n=t.value[0];e!==n&&(n==null||n.pause()),t.value=Ha(t.value,e),t.value.unshift(e)},remove(e){var n;t.value=Ha(t.value,e),(n=t.value[0])==null||n.resume()}}}function Ha(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function H0(t){return t.filter(e=>e.tagName!=="A")}const G0=xe({__name:"FocusScope",props:{loop:{type:Boolean,default:!1},trapped:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:["mountAutoFocus","unmountAutoFocus"],setup(t,{emit:e}){const n=t,r=e,{currentRef:i,currentElement:o}=It(),a=V(null),s=V0(),l=ws({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});yt(c=>{if(!Jt)return;const d=o.value;if(!n.trapped)return;function p(v){if(l.paused||!d)return;const g=v.target;d.contains(g)?a.value=g:Dt(a.value,{select:!0})}function f(v){if(l.paused||!d)return;const g=v.relatedTarget;g!==null&&(d.contains(g)||Dt(a.value,{select:!0}))}function h(v){d.contains(a.value)||Dt(d)}document.addEventListener("focusin",p),document.addEventListener("focusout",f);const w=new MutationObserver(h);d&&w.observe(d,{childList:!0,subtree:!0}),c(()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",f),w.disconnect()})}),yt(async c=>{const d=o.value;if(await ft(),!d)return;s.add(l);const p=document.activeElement;if(!d.contains(p)){const f=new CustomEvent(di,$a);d.addEventListener(di,h=>r("mountAutoFocus",h)),d.dispatchEvent(f),f.defaultPrevented||(z0(H0(Xl(d)),{select:!0}),document.activeElement===p&&Dt(d))}c(()=>{d.removeEventListener(di,w=>r("mountAutoFocus",w));const f=new CustomEvent(fi,$a),h=w=>{r("unmountAutoFocus",w)};d.addEventListener(fi,h),d.dispatchEvent(f),setTimeout(()=>{f.defaultPrevented||Dt(p??document.body,{select:!0}),d.removeEventListener(fi,h),s.remove(l)},0)})});function u(c){if(!n.loop&&!n.trapped||l.paused)return;const d=c.key==="Tab"&&!c.altKey&&!c.ctrlKey&&!c.metaKey,p=document.activeElement;if(d&&p){const f=c.currentTarget,[h,w]=F0(f);h&&w?!c.shiftKey&&p===w?(c.preventDefault(),n.loop&&Dt(h,{select:!0})):c.shiftKey&&p===h&&(c.preventDefault(),n.loop&&Dt(w,{select:!0})):p===f&&c.preventDefault()}}return(c,d)=>(Q(),je(D(Sr),{ref_key:"currentRef",ref:i,tabindex:"-1","as-child":c.asChild,as:c.as,onKeydown:u},{default:be(()=>[ze(c.$slots,"default")]),_:3},8,["as-child","as"]))}});function K0(t){return t?"open":"closed"}const Ql=xe({__name:"DialogContentImpl",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,r=e,i=en(),{forwardRef:o,currentElement:a}=It();return i.titleId||(i.titleId=Li(void 0,"radix-vue-dialog-title")),i.descriptionId||(i.descriptionId=Li(void 0,"radix-vue-dialog-description")),mt(()=>{i.contentElement=a,document.activeElement!==document.body&&(i.triggerElement.value=document.activeElement)}),(s,l)=>(Q(),je(D(G0),{"as-child":"",loop:"",trapped:n.trapFocus,onMountAutoFocus:l[5]||(l[5]=u=>r("openAutoFocus",u)),onUnmountAutoFocus:l[6]||(l[6]=u=>r("closeAutoFocus",u))},{default:be(()=>[ve(D(B0),Ut({id:D(i).contentId,ref:D(o),as:s.as,"as-child":s.asChild,"disable-outside-pointer-events":s.disableOutsidePointerEvents,role:"dialog","aria-describedby":D(i).descriptionId,"aria-labelledby":D(i).titleId,"data-state":D(K0)(D(i).open.value)},s.$attrs,{onDismiss:l[0]||(l[0]=u=>D(i).onOpenChange(!1)),onEscapeKeyDown:l[1]||(l[1]=u=>r("escapeKeyDown",u)),onFocusOutside:l[2]||(l[2]=u=>r("focusOutside",u)),onInteractOutside:l[3]||(l[3]=u=>r("interactOutside",u)),onPointerDownOutside:l[4]||(l[4]=u=>r("pointerDownOutside",u))}),{default:be(()=>[ze(s.$slots,"default")]),_:3},16,["id","as","as-child","disable-outside-pointer-events","aria-describedby","aria-labelledby","data-state"])]),_:3},8,["trapped"]))}}),q0=xe({__name:"DialogContentModal",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,r=e,i=en(),o=go(r),{forwardRef:a,currentElement:s}=It();return E0(s),(l,u)=>(Q(),je(Ql,Ut({...n,...D(o)},{ref:D(a),"trap-focus":D(i).open.value,"disable-outside-pointer-events":!0,onCloseAutoFocus:u[0]||(u[0]=c=>{var d;c.defaultPrevented||(c.preventDefault(),(d=D(i).triggerElement.value)==null||d.focus())}),onPointerDownOutside:u[1]||(u[1]=c=>{const d=c.detail.originalEvent,p=d.button===0&&d.ctrlKey===!0;(d.button===2||p)&&c.preventDefault()}),onFocusOutside:u[2]||(u[2]=c=>{c.preventDefault()})}),{default:be(()=>[ze(l.$slots,"default")]),_:3},16,["trap-focus"]))}}),Y0=xe({__name:"DialogContentNonModal",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,r=go(e);It();const i=en(),o=V(!1),a=V(!1);return(s,l)=>(Q(),je(Ql,Ut({...n,...D(r)},{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:l[0]||(l[0]=u=>{var c;u.defaultPrevented||(o.value||(c=D(i).triggerElement.value)==null||c.focus(),u.preventDefault()),o.value=!1,a.value=!1}),onInteractOutside:l[1]||(l[1]=u=>{var c;u.defaultPrevented||(o.value=!0,u.detail.originalEvent.type==="pointerdown"&&(a.value=!0));const d=u.target;(c=D(i).triggerElement.value)!=null&&c.contains(d)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&a.value&&u.preventDefault()})}),{default:be(()=>[ze(s.$slots,"default")]),_:3},16))}}),W0=xe({__name:"DialogContent",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,r=e,i=en(),o=go(r),{forwardRef:a}=It();return(s,l)=>(Q(),je(D(Kl),{present:s.forceMount||D(i).open.value},{default:be(()=>[D(i).modal.value?(Q(),je(q0,Ut({key:0,ref:D(a)},{...n,...D(o),...s.$attrs}),{default:be(()=>[ze(s.$slots,"default")]),_:3},16)):(Q(),je(Y0,Ut({key:1,ref:D(a)},{...n,...D(o),...s.$attrs}),{default:be(()=>[ze(s.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),X0=xe({__name:"DialogOverlayImpl",props:{asChild:{type:Boolean},as:{}},setup(t){const e=en();return b0(!0),It(),(n,r)=>(Q(),je(D(Sr),{as:n.as,"as-child":n.asChild,"data-state":D(e).open.value?"open":"closed",style:{"pointer-events":"auto"}},{default:be(()=>[ze(n.$slots,"default")]),_:3},8,["as","as-child","data-state"]))}}),Q0=xe({__name:"DialogOverlay",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){const e=en(),{forwardRef:n}=It();return(r,i)=>{var o;return(o=D(e))!=null&&o.modal.value?(Q(),je(D(Kl),{key:0,present:r.forceMount||D(e).open.value},{default:be(()=>[ve(X0,Ut(r.$attrs,{ref:D(n),as:r.as,"as-child":r.asChild}),{default:be(()=>[ze(r.$slots,"default")]),_:3},16,["as","as-child"])]),_:3},8,["present"])):Ye("",!0)}}});function Z0(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}Z0();(function(){try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('[vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32,.72,0,1)}[vaul-drawer][vaul-drawer-direction=bottom]{transform:translate3d(0,100%,0)}[vaul-drawer][vaul-drawer-direction=top]{transform:translate3d(0,-100%,0)}[vaul-drawer][vaul-drawer-direction=left]{transform:translate3d(-100%,0,0)}[vaul-drawer][vaul-drawer-direction=right]{transform:translate3d(100%,0,0)}.vaul-dragging .vaul-scrollable [vault-drawer-direction=top],.vaul-dragging .vaul-scrollable [vault-drawer-direction=bottom]{overflow-y:hidden!important}.vaul-dragging .vaul-scrollable [vault-drawer-direction=left],.vaul-dragging .vaul-scrollable [vault-drawer-direction=right]{overflow-x:hidden!important}[vaul-drawer][vaul-drawer-visible=true][vaul-drawer-direction=top],[vaul-drawer][vaul-drawer-visible=true][vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height, 0),0)}[vaul-drawer][vaul-drawer-visible=true][vaul-drawer-direction=left],[vaul-drawer][vaul-drawer-visible=true][vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height, 0),0,0)}[vaul-overlay]{opacity:0;transition:opacity .5s cubic-bezier(.32,.72,0,1)}[vaul-overlay][vaul-drawer-visible=true]{opacity:1}[vaul-drawer]:after{content:"";position:absolute;background:inherit;background-color:inherit}[vaul-drawer][vaul-drawer-direction=top]:after{top:initial;bottom:100%;left:0;right:0;height:200%}[vaul-drawer][vaul-drawer-direction=bottom]:after{top:100%;bottom:initial;left:0;right:0;height:200%}[vaul-drawer][vaul-drawer-direction=left]:after{left:initial;right:100%;top:0;bottom:0;width:200%}[vaul-drawer][vaul-drawer-direction=right]:after{left:100%;right:initial;top:0;bottom:0;width:200%}[vaul-overlay][vaul-snap-points=true]:not([vaul-snap-points-overlay=true]):not([data-state=closed]){opacity:0}[vaul-overlay][vaul-snap-points-overlay=true]:not([vaul-drawer-visible=false]){opacity:1}@keyframes fake-animation{}@media (hover: hover) and (pointer: fine){[vaul-drawer]{-webkit-user-select:none;user-select:none}}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();const J0=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const eb=t=>typeof t<"u";function tb(t){return JSON.parse(JSON.stringify(t))}function Ga(t,e,n,r={}){var i,o,a;const{clone:s=!1,passive:l=!1,eventName:u,deep:c=!1,defaultValue:d,shouldEmit:p}=r,f=Qt(),h=n||(f==null?void 0:f.emit)||((i=f==null?void 0:f.$emit)==null?void 0:i.bind(f))||((a=(o=f==null?void 0:f.proxy)==null?void 0:o.$emit)==null?void 0:a.bind(f==null?void 0:f.proxy));let w=u;e||(e="modelValue"),w=w||`update:${e.toString()}`;const v=T=>s?typeof s=="function"?s(T):tb(T):T,g=()=>eb(t[e])?v(t[e]):d,E=T=>{p?p(T)&&h(w,T):h(w,T)};if(l){const T=g(),M=V(T);let N=!1;return Ee(()=>t[e],m=>{N||(N=!0,M.value=v(m),ft(()=>N=!1))}),Ee(M,m=>{!N&&(m!==t[e]||c)&&E(m)},{deep:c}),M}else return Se({get(){return g()},set(T){E(T)}})}const[Zl,nb]=fo("DrawerRoot"),Jl=new WeakMap;function Be(t,e,n=!1){if(!t||!(t instanceof HTMLElement)||!e)return;const r={};Object.entries(e).forEach(([i,o])=>{if(i.startsWith("--")){t.style.setProperty(i,o);return}r[i]=t.style[i],t.style[i]=o}),!n&&Jl.set(t,r)}function tr(t,e){if(!t||!(t instanceof HTMLElement))return;const n=Jl.get(t);n&&(e?t.style[e]=n[e]:Object.entries(n).forEach(([r,i])=>{t.style[r]=i}))}function nr(t,e){const n=window.getComputedStyle(t),r=n.transform||n.webkitTransform||n.mozTransform;let i=r.match(/^matrix3d\((.+)\)$/);return i?Number.parseFloat(i[1].split(", ")[He(e)?13:12]):(i=r.match(/^matrix\((.+)\)$/),i?Number.parseFloat(i[1].split(", ")[He(e)?5:4]):null)}function rb(t){return 8*(Math.log(t+1)-2)}function He(t){switch(t){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return t}}const Ne={DURATION:.5,EASE:[.32,.72,0,1]},eu=.4;function ib({activeSnapPoint:t,snapPoints:e,drawerRef:n,overlayRef:r,fadeFromIndex:i,onSnapPointChange:o,direction:a}){const s=V(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);function l(){s.value={innerWidth:window.innerWidth,innerHeight:window.innerHeight}}mt(()=>{typeof window<"u"&&window.addEventListener("resize",l)}),xs(()=>{typeof window<"u"&&window.removeEventListener("resize",l)});const u=Se(()=>(e.value&&t.value===e.value[e.value.length-1])??null),c=Se(()=>e.value&&e.value.length>0&&((i==null?void 0:i.value)||(i==null?void 0:i.value)===0)&&!Number.isNaN(i==null?void 0:i.value)&&e.value[(i==null?void 0:i.value)??-1]===t.value||!e.value),d=Se(()=>{var E;return((E=e.value)==null?void 0:E.findIndex(T=>T===t.value))??null}),p=Se(()=>{var E;return((E=e.value)==null?void 0:E.map(T=>{const M=typeof T=="string";let N=0;if(M&&(N=Number.parseInt(T,10)),He(a.value)){const _=M?N:s.value?T*s.value.innerHeight:0;return s.value?a.value==="bottom"?s.value.innerHeight-_:-s.value.innerHeight+_:_}const m=M?N:s.value?T*s.value.innerWidth:0;return s.value?a.value==="right"?s.value.innerWidth-m:-s.value.innerWidth+m:m}))??[]}),f=Se(()=>{var E;return d.value!==null?(E=p.value)==null?void 0:E[d.value]:null}),h=E=>{var T,M,N,m;const _=((T=p.value)==null?void 0:T.findIndex(x=>x===E))??null;ft(()=>{var x;o(_,p.value),Be((x=n.value)==null?void 0:x.$el,{transition:`transform ${Ne.DURATION}s cubic-bezier(${Ne.EASE.join(",")})`,transform:He(a.value)?`translate3d(0, ${E}px, 0)`:`translate3d(${E}px, 0, 0)`})}),p.value&&_!==p.value.length-1&&_!==(i==null?void 0:i.value)?Be((M=r.value)==null?void 0:M.$el,{transition:`opacity ${Ne.DURATION}s cubic-bezier(${Ne.EASE.join(",")})`,opacity:"0"}):Be((N=r.value)==null?void 0:N.$el,{transition:`opacity ${Ne.DURATION}s cubic-bezier(${Ne.EASE.join(",")})`,opacity:"1"}),t.value=_!==null?((m=e.value)==null?void 0:m[_])??null:null};Ee([t,p,e],()=>{var E;if(t.value){const T=((E=e.value)==null?void 0:E.findIndex(M=>M===t.value))??-1;p.value&&T!==-1&&typeof p.value[T]=="number"&&h(p.value[T])}},{immediate:!0});function w({draggedDistance:E,closeDrawer:T,velocity:M,dismissible:N}){var m,_,x;if(i.value===void 0)return;const b=a.value==="bottom"||a.value==="right"?(f.value??0)-E:(f.value??0)+E,y=d.value===i.value-1,A=d.value===0,R=E>0;if(y&&Be((m=r.value)==null?void 0:m.$el,{transition:`opacity ${Ne.DURATION}s cubic-bezier(${Ne.EASE.join(",")})`}),M>2&&!R){N?T():h(p.value[0]);return}if(M>2&&R&&p&&e.value){h(p.value[e.value.length-1]);return}const z=(_=p.value)==null?void 0:_.reduce((B,$)=>typeof B!="number"||typeof $!="number"?B:Math.abs($-b)eu&&Math.abs(E)0&&u){h(p.value[(((x=e.value)==null?void 0:x.length)??0)-1]);return}if(A&&B<0&&N&&T(),d.value===null)return;h(p.value[d.value+B]);return}h(z)}function v({draggedDistance:E}){var T;if(f.value===null)return;const M=a.value==="bottom"||a.value==="right"?f.value-E:f.value+E;(a.value==="bottom"||a.value==="right")&&Mp.value[p.value.length-1]||Be((T=n.value)==null?void 0:T.$el,{transform:He(a.value)?`translate3d(0, ${M}px, 0)`:`translate3d(${M}px, 0, 0)`})}function g(E,T){if(!e.value||typeof d.value!="number"||!p.value||i.value===void 0)return null;const M=d.value===i.value-1;if(d.value>=i.value&&T)return 0;if(M&&!T)return 1;if(!c.value&&!M)return null;const N=M?d.value+1:d.value-1,m=M?p.value[N]-p.value[N-1]:p.value[N+1]-p.value[N],_=E/Math.abs(m);return M?1-_:_}return{isLastSnapPoint:u,shouldFade:c,getPercentageDragged:g,activeSnapPointIndex:d,onRelease:w,onDrag:v,snapPointsOffset:p}}let En=null;function ob(t){const{isOpen:e,modal:n,nested:r,hasBeenOpened:i}=t,o=V(typeof window<"u"?window.location.href:""),a=V(0);function s(){if(En===null&&e.value){En={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height};const{scrollX:u,innerHeight:c}=window;document.body.style.position="fixed",document.body.style.top=`-${a.value}px`,document.body.style.left=`-${u}px`,document.body.style.right="0px",document.body.style.height="auto",setTimeout(()=>{requestAnimationFrame(()=>{const d=c-window.innerHeight;d&&a.value>=c&&(document.body.style.top=`-${a.value+d}px`)})},300)}}function l(){if(En!==null){const u=-Number.parseInt(document.body.style.top,10),c=-Number.parseInt(document.body.style.left,10);Object.assign(document.body.style,En),requestAnimationFrame(()=>{if(o.value!==window.location.href){o.value=window.location.href;return}window.scrollTo(c,u)}),En=null}}return mt(()=>{function u(){a.value=window.scrollY}u(),window.addEventListener("scroll",u),ut(()=>{window.removeEventListener("scroll",u)})}),Ee([e,i,o],()=>{r.value||!i.value||(e.value?(!window.matchMedia("(display-mode: standalone)").matches&&s(),n.value||setTimeout(()=>{l()},500)):l())}),{restorePositionSetting:l}}const ab=.25,sb=100,Ka=8,rr=16,lb=26,qa="vaul-dragging";function ub(t,e){return t&&t.value?t:e}function cb(t){const{emitDrag:e,emitRelease:n,emitClose:r,emitOpenChange:i,open:o,dismissible:a,nested:s,modal:l,shouldScaleBackground:u,scrollLockTimeout:c,closeThreshold:d,activeSnapPoint:p,fadeFromIndex:f,direction:h}=t,w=V(o.value??!1),v=V(!1),g=V(!1),E=V(!1),T=V(!1),M=V(null),N=V(null),m=V(null),_=V(null),x=V(null),b=V(!0),y=V(null),A=V(0),R=V(!1);V(0);const z=V(null);V(0);const F=Se(()=>{var G;return((G=z.value)==null?void 0:G.$el.getBoundingClientRect().height)||0}),B=ub(t.snapPoints,V(void 0)),{activeSnapPointIndex:$,onRelease:ie,snapPointsOffset:te,onDrag:ue,shouldFade:S,getPercentageDragged:we}=ib({snapPoints:B,activeSnapPoint:p,drawerRef:z,fadeFromIndex:f,overlayRef:M,onSnapPointChange:Fe,direction:h});function Fe(G,J){B.value&&G===J.length-1&&(N.value=new Date)}const{restorePositionSetting:C}=ob({isOpen:w,modal:l,nested:s,hasBeenOpened:v});function ye(){return(window.innerWidth-lb)/window.innerWidth}function Ie(G,J){var se;if(!G)return!1;let Z=G;const le=(se=window.getSelection())==null?void 0:se.toString(),me=z.value?nr(z.value.$el,h.value):null,he=new Date;if(Z.hasAttribute("data-vaul-no-drag")||Z.closest("[data-vaul-no-drag]"))return!1;if(h.value==="right"||h.value==="left")return!0;if(N.value&&he.getTime()-N.value.getTime()<500)return!1;if(me!==null&&(h.value==="bottom"?me>0:me<0))return!0;if(le&&le.length>0)return!1;if(x.value&&he.getTime()-x.value.getTime()Z.clientHeight){if(Z.scrollTop!==0)return x.value=new Date,!1;if(Z.getAttribute("role")==="dialog")return!0}Z=Z.parentNode}return!0}function _e(G){!a.value&&!B.value||z.value&&!z.value.$el.contains(G.target)||(E.value=!0,m.value=new Date,G.target.setPointerCapture(G.pointerId),A.value=He(h.value)?G.clientY:G.clientX)}function $e(G){var J,se,Z,le,me,he;if(z.value&&E.value){const Me=h.value==="bottom"||h.value==="right"?1:-1,Ke=(A.value-(He(h.value)?G.clientY:G.clientX))*Me,We=Ke>0,Rt=B.value&&!a.value&&!We;if(Rt&&$.value===0)return;const j=Math.abs(Ke),X=document.querySelector("[vaul-drawer-wrapper]");let ne=j/F.value;const ce=we(j,We);if(ce!==null&&(ne=ce),Rt&&ne>=1||!b.value&&!Ie(G.target,We))return;if((J=z==null?void 0:z.value)==null||J.$el.classList.add(qa),b.value=!0,Be((se=z.value)==null?void 0:se.$el,{transition:"none"}),Be((Z=M.value)==null?void 0:Z.$el,{transition:"none"}),B.value&&ue({draggedDistance:Ke}),We&&!B.value){const Ue=rb(Ke),Qe=Math.min(Ue*-1,0)*Me;Be((le=z.value)==null?void 0:le.$el,{transform:He(h.value)?`translate3d(0, ${Qe}px, 0)`:`translate3d(${Qe}px, 0, 0)`});return}const Te=1-ne;if((S.value||f.value&&$.value===f.value-1)&&(e(ne),Be((me=M.value)==null?void 0:me.$el,{opacity:`${Te}`,transition:"none"},!0)),X&&M.value&&u.value){const Ue=Math.min(ye()+ne*(1-ye()),1),Qe=8-ne*8,Ze=Math.max(0,14-ne*14);Be(X,{borderRadius:`${Qe}px`,transform:He(h.value)?`scale(${Ue}) translate3d(0, ${Ze}px, 0)`:`scale(${Ue}) translate3d(${Ze}px, 0, 0)`,transition:"none"},!0)}if(!B.value){const Ue=j*Me;Be((he=z.value)==null?void 0:he.$el,{transform:He(h.value)?`translate3d(0, ${Ue}px, 0)`:`translate3d(${Ue}px, 0, 0)`})}}}function K(){var G;if(!z.value)return;const J=document.querySelector("[vaul-drawer-wrapper]"),se=nr(z.value.$el,h.value);Be(z.value.$el,{transform:"translate3d(0, 0, 0)",transition:`transform ${Ne.DURATION}s cubic-bezier(${Ne.EASE.join(",")})`}),Be((G=M.value)==null?void 0:G.$el,{transition:`opacity ${Ne.DURATION}s cubic-bezier(${Ne.EASE.join(",")})`,opacity:"1"}),u.value&&se&&se>0&&w.value&&Be(J,{borderRadius:`${Ka}px`,overflow:"hidden",...He(h.value)?{transform:`scale(${ye()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${ye()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${Ne.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Ne.EASE.join(",")})`},!0)}function k(){var G;z.value&&(r(),Be(z.value.$el,{transform:He(h.value)?`translate3d(0, ${h.value==="bottom"?"100%":"-100%"}, 0)`:`translate3d(${h.value==="right"?"100%":"-100%"}, 0, 0)`,transition:`transform ${Ne.DURATION}s cubic-bezier(${Ne.EASE.join(",")})`}),Be((G=M.value)==null?void 0:G.$el,{opacity:"0",transition:`opacity ${Ne.DURATION}s cubic-bezier(${Ne.EASE.join(",")})`}),O(!1),window.setTimeout(()=>{g.value=!1,w.value=!1},300),window.setTimeout(()=>{B.value&&(p.value=B.value[0])},Ne.DURATION*1e3))}yt(()=>{if(!w.value&&u.value&&J0){const G=setTimeout(()=>{tr(document.body)},200);return()=>clearTimeout(G)}}),ut(()=>{O(!1),C()});function I(G){if(!E.value||!z.value)return;z.value.$el.classList.remove(qa),b.value=!1,E.value=!1,_.value=new Date;const J=nr(z.value.$el,h.value);if(!Ie(G.target,!1)||!J||Number.isNaN(J)||m.value===null)return;const se=_.value.getTime()-m.value.getTime(),Z=A.value-(He(h.value)?G.clientY:G.clientX),le=Math.abs(Z)/se;if(le>.05&&(T.value=!0,window.setTimeout(()=>{T.value=!1},200)),B.value){const he=h.value==="bottom"||h.value==="right"?1:-1;ie({draggedDistance:Z*he,closeDrawer:k,velocity:le,dismissible:a.value}),n(!0);return}if(h.value==="bottom"||h.value==="right"?Z>0:Z<0){K(),n(!0);return}if(le>eu){k(),n(!1);return}const me=Math.min(z.value.$el.getBoundingClientRect().height??0,window.innerHeight);if(J>=me*d.value){k(),n(!1);return}n(!0),K()}Ee(w,G=>{G&&(N.value=new Date,O(!0)),i(G)},{immediate:!0}),Ee(o,G=>{G?(w.value=G,v.value=!0):k()},{immediate:!0});function O(G){const J=document.querySelector("[vaul-drawer-wrapper]");!J||!u.value||(G?(Be(document.body,{background:document.body.style.backgroundColor||document.body.style.background}),Be(document.body,{background:"black"},!0),Be(J,{borderRadius:`${Ka}px`,overflow:"hidden",...He(h.value)?{transform:`scale(${ye()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${ye()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${Ne.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Ne.EASE.join(",")})`})):(tr(J,"overflow"),tr(J,"transform"),tr(J,"borderRadius"),Be(J,{transitionProperty:"transform, border-radius",transitionDuration:`${Ne.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Ne.EASE.join(",")})`})))}function H(G){var J,se;const Z=G?(window.innerWidth-rr)/window.innerWidth:1,le=G?-16:0;y.value&&window.clearTimeout(y.value),Be((J=z.value)==null?void 0:J.$el,{transition:`transform ${Ne.DURATION}s cubic-bezier(${Ne.EASE.join(",")})`,transform:`scale(${Z}) translate3d(0, ${le}px, 0)`}),!G&&(se=z.value)!=null&&se.$el&&(y.value=window.setTimeout(()=>{var me,he;const Me=nr((me=z.value)==null?void 0:me.$el,h.value);Be((he=z.value)==null?void 0:he.$el,{transition:"none",transform:He(h.value)?`translate3d(0, ${Me}px, 0)`:`translate3d(${Me}px, 0, 0)`})},500))}function U(G){var J;if(G<0)return;const se=He(h.value)?window.innerHeight:window.innerWidth,Z=(se-rr)/se,le=Z+G*(1-Z),me=-16+G*rr;Be((J=z.value)==null?void 0:J.$el,{transform:He(h.value)?`scale(${le}) translate3d(0, ${me}px, 0)`:`scale(${le}) translate3d(${me}px, 0, 0)`,transition:"none"})}function Y(G){var J;const se=He(h.value)?window.innerHeight:window.innerWidth,Z=G?(se-rr)/se:1,le=G?-16:0;G&&Be((J=z.value)==null?void 0:J.$el,{transition:`transform ${Ne.DURATION}s cubic-bezier(${Ne.EASE.join(",")})`,transform:He(h.value)?`scale(${Z}) translate3d(0, ${le}px, 0)`:`scale(${Z}) translate3d(${le}px, 0, 0)`})}return{open:o,isOpen:w,modal:l,keyboardIsOpen:R,hasBeenOpened:v,isVisible:g,drawerRef:z,drawerHeightRef:F,overlayRef:M,isDragging:E,dragStartTime:m,isAllowedToDrag:b,snapPoints:B,activeSnapPoint:p,pointerStart:A,dismissible:a,snapPointsOffset:te,direction:h,shouldFade:S,fadeFromIndex:f,shouldScaleBackground:u,onPress:_e,onDrag:$e,onRelease:I,closeDrawer:k,onNestedDrag:U,onNestedRelease:Y,onNestedOpenChange:H,emitClose:r,emitDrag:e,emitRelease:n,emitOpenChange:i,nested:s}}const tu=xe({__name:"DrawerRoot",props:{activeSnapPoint:{default:void 0},closeThreshold:{default:ab},shouldScaleBackground:{type:Boolean,default:void 0},scrollLockTimeout:{default:sb},fixed:{type:Boolean,default:void 0},dismissible:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},nested:{type:Boolean,default:!1},direction:{default:"bottom"},snapPoints:{default:void 0},fadeFromIndex:{default:void 0}},emits:["drag","release","close","update:open","update:activeSnapPoint","animationEnd"],setup(t,{expose:e,emit:n}){const r=t,i=n;ss();const o=Se(()=>r.fadeFromIndex??(r.snapPoints&&r.snapPoints.length-1)),a=Ga(r,"open",i,{defaultValue:r.defaultOpen,passive:r.open===void 0}),s=Ga(r,"activeSnapPoint",i,{passive:r.activeSnapPoint===void 0}),l={emitDrag:h=>i("drag",h),emitRelease:h=>i("release",h),emitClose:()=>i("close"),emitOpenChange:h=>{i("update:open",h),setTimeout(()=>{i("animationEnd",h)},Ne.DURATION*1e3)}},{closeDrawer:u,hasBeenOpened:c,modal:d,isOpen:p}=nb(cb({...l,...gn(r),activeSnapPoint:s,fadeFromIndex:o,open:a}));function f(h){if(a.value!==void 0){l.emitOpenChange(h);return}h?(c.value=!0,p.value=h):u()}return e({open:p}),(h,w)=>(Q(),je(D(C0),{open:D(p),modal:D(d),"onUpdate:open":f},{default:be(()=>[ze(h.$slots,"default",{open:D(p)})]),_:3},8,["open","modal"]))}}),nu=xe({__name:"DrawerOverlay",setup(t){const{overlayRef:e,snapPoints:n,isVisible:r,isOpen:i,shouldFade:o}=Zl(),a=Se(()=>{var s;return n&&(((s=n.value)==null?void 0:s.length)??0)>0});return(s,l)=>(Q(),je(D(Q0),{ref_key:"overlayRef",ref:e,"vaul-drawer-visible":D(r)?"true":"false","vaul-overlay":"","vaul-snap-points":D(i)&&a.value?"true":"false","vaul-snap-points-overlay":D(i)&&D(o)?"true":"false"},null,8,["vaul-drawer-visible","vaul-snap-points","vaul-snap-points-overlay"]))}}),ru=xe({__name:"DrawerContent",setup(t){const{open:e,isOpen:n,isVisible:r,snapPointsOffset:i,drawerRef:o,onPress:a,onDrag:s,onRelease:l,modal:u,emitOpenChange:c,dismissible:d,keyboardIsOpen:p,closeDrawer:f,direction:h}=Zl(),w=Se(()=>i.value&&i.value.length>0?`${i.value[0]}px`:"0");function v(g){if(!u.value||g.defaultPrevented){g.preventDefault();return}p.value&&(p.value=!1),g.preventDefault(),d.value&&c(!1),!(!d.value||e.value!==void 0)&&f()}return Ee(n,g=>{g&&setTimeout(()=>{r.value=!0},1)},{immediate:!0}),(g,E)=>(Q(),je(D(W0),{ref_key:"drawerRef",ref:o,"vaul-drawer":"","vaul-drawer-direction":D(h),"vaul-drawer-visible":D(r)?"true":"false",style:pr({"--snap-point-height":w.value}),onPointerdown:D(a),onPointermove:D(s),onPointerup:D(l),onPointerDownOutside:v,onEscapeKeyDown:E[0]||(E[0]=T=>{D(d)||T.preventDefault()})},{default:be(()=>[ze(g.$slots,"default")]),_:3},8,["vaul-drawer-direction","vaul-drawer-visible","style","onPointerdown","onPointermove","onPointerup"]))}}),db={text:"zinc-500 dark:zinc-400"},fb={text:"zinc-800/80 dark:zinc-200/80 xl","font-bold":""},pb={grid:"~ cols-[150px_1fr]","my-2":"","items-center":"","gap-1.5":"","rounded-lg":"",bg:"zinc-100 dark:zinc-800","px-2":"","py-1":""},hb={text:"sm","pl-1":""},mb={flex:"~ row","w-full":"",text:"sm"},gb=["placeholder"],vb={text:"sm","pl-1":""},yb={flex:"~ row","w-full":"",text:"sm"},bb=["placeholder"],xb={text:"sm","pl-1":""},wb={flex:"~ row","w-full":"",text:"sm"},kb=["placeholder"],Tb={text:"sm","pl-1":""},Ab={flex:"~ row","w-full":"",text:"sm"},Eb={value:"en-US"},_b={value:"zh-CN"},Mb={text:"sm","pl-1":""},Sb={flex:"~ row","w-full":"",text:"sm"},Ib={disabled:"",class:"bg-white dark:bg-zinc-800"},Rb=["value"],Cb=["value"],Nb={text:"sm","pl-1":""},Ob={flex:"~ row","w-full":"",text:"sm"},Pb={disabled:"",class:"bg-white dark:bg-zinc-800"},Db=["value"],Lb=["value"],Bb=["value"],zb=["value"],Fb={grid:"~ cols-[140px_1fr]","my-2":"","items-center":"","gap-1.5":"","rounded-lg":"",bg:"zinc-100 dark:zinc-800","px-2":"","py-1":""},Ub={"h-8":"",flex:"","cursor-pointer":"","items-center":"","justify-end":""},jb=["checked","aria-checked"],$b={"select-none":""},Vb={key:0,"i-solar:sun-fog-bold-duotone":"",transition:"all ease-in-out duration-250"},Hb={key:1,"i-solar:moon-stars-bold-duotone":"",transition:"all ease-in-out duration-250"},iu=xe({__name:"MobileSettings",setup(t){const{t:e,locale:n}=Pn(),r=Dn(),i=Wa({disableTransition:!1}),o=V([]),{models:a}=Fl(),{openAiModel:s,openAiApiBaseURL:l,openAiApiKey:u,elevenlabsVoiceEnglish:c,elevenlabsVoiceJapanese:d}=Ft(r);function p(w){const v=w.target,g=o.value.find(E=>E.id===v.value);if(!g){s.value=void 0;return}s.value=g}function f(w){const v=w.target;r.stageView=v.value}function h(w){const v=w.target.value;switch(n.value){case"en":case"en-US":c.value=v;break;case"zh":case"zh-CN":case"zh-TW":case"zh-HK":c.value=v;break;case"jp":case"jp-JP":d.value=v;break}}return Ee([l,u],async([w,v])=>{if(!w||!v){o.value=[];return}o.value=await a(w,v)}),mt(async()=>{!l.value||!u.value||(o.value=await a(l.value,u.value))}),(w,v)=>(Q(),ee("div",db,[P("h2",fb,oe(D(e)("settings.title")),1),P("div",null,[P("div",pb,[P("div",hb,[P("span",null,oe(D(e)("settings.openai-base-url.label")),1)]),P("div",mb,[at(P("input",{"onUpdate:modelValue":v[0]||(v[0]=g=>D(r).openAiApiBaseURL=g),text:"zinc-800 dark:zinc-100",type:"text",placeholder:D(e)("settings.openai-base-url.placeholder_mobile"),"h-8":"","w-full":"","rounded-md":"","bg-transparent":"","px-2":"","py-1":"","text-right":"","font-mono":"","outline-none":""},null,8,gb),[[Or,D(r).openAiApiBaseURL]])]),P("div",vb,[P("span",null,oe(D(e)("settings.openai-api-key.label")),1)]),P("div",yb,[at(P("input",{"onUpdate:modelValue":v[1]||(v[1]=g=>D(r).openAiApiKey=g),text:"zinc-800 dark:zinc-100",type:"text",placeholder:D(e)("settings.openai-api-key.placeholder_mobile"),"h-8":"","w-full":"","rounded-md":"","bg-transparent":"","px-2":"","py-1":"","text-right":"","font-mono":"","outline-none":""},null,8,bb),[[Or,D(r).openAiApiKey]])]),P("div",xb,[P("span",null,oe(D(e)("settings.elevenlabs-api-key.label")),1)]),P("div",wb,[at(P("input",{"onUpdate:modelValue":v[2]||(v[2]=g=>D(r).elevenLabsApiKey=g),text:"zinc-800 dark:zinc-100",type:"text",placeholder:D(e)("settings.elevenlabs-api-key.placeholder_mobile"),"h-8":"","w-full":"","rounded-md":"","bg-transparent":"","px-2":"","py-1":"","text-right":"","font-mono":"","outline-none":""},null,8,kb),[[Or,D(r).elevenLabsApiKey]])]),P("div",Tb,[P("span",null,oe(D(e)("settings.language.title")),1)]),P("div",Ab,[at(P("select",{"onUpdate:modelValue":v[3]||(v[3]=g=>D(r).language=g),"h-8":"","w-full":"","rounded-md":"","bg-transparent":"","px-2":"","py-1":"","text-right":"","font-mono":"","outline-none":"",text:"zinc-800 dark:zinc-100"},[P("option",Eb,oe(D(e)("settings.language.english")),1),P("option",_b,oe(D(e)("settings.language.chinese")),1)],512),[[lc,D(r).language]])]),P("div",Mb,[P("span",null,oe(D(e)("settings.models")),1)]),P("div",Sb,[P("select",{"h-8":"","w-full":"","rounded-md":"","bg-transparent":"","px-2":"","py-1":"","text-right":"","font-mono":"","outline-none":"",text:"zinc-800 dark:zinc-100",onChange:p},[P("option",Ib,oe(D(e)("stage.select-a-model")),1),D(r).openAiModel?(Q(),ee("option",{key:0,value:D(r).openAiModel.id},oe("name"in D(r).openAiModel?`${D(r).openAiModel.name} (${D(r).openAiModel.id})`:D(r).openAiModel.id),9,Rb)):Ye("",!0),(Q(!0),ee(mn,null,Nn(o.value,g=>(Q(),ee("option",{key:g.id,value:g.id},oe("name"in g?`${g.name} (${g.id})`:g.id),9,Cb))),128))],32)]),P("div",Nb,[P("span",null,oe(D(e)("settings.voices")),1)]),P("div",Ob,[P("select",{"h-8":"","w-full":"","rounded-md":"","bg-transparent":"","px-2":"","py-1":"","text-right":"","font-mono":"","outline-none":"",text:"zinc-800 dark:zinc-100",onChange:h},[P("option",Pb,oe(D(e)("stage.select-a-voice")),1),["en","en-US"].includes(D(n))&&D(c)?(Q(),ee("option",{key:0,value:D(c)},oe(D(c)),9,Db)):Ye("",!0),["zh","zh-CN","zh-TW","zh-HK"].includes(D(n))&&D(c)?(Q(),ee("option",{key:1,value:D(c)},oe(D(c)),9,Lb)):Ye("",!0),["jp","jp-JP"].includes(D(n))&&D(d)?(Q(),ee("option",{key:2,value:D(d)},oe(D(d)),9,Bb)):Ye("",!0),(Q(!0),ee(mn,null,Nn(D(uc)[D(n)],(g,E)=>(Q(),ee("option",{key:E,value:g},oe(g),9,zb))),128))],32)])])]),v[8]||(v[8]=P("h2",{text:"zinc-800/80 dark:zinc-200/80 xl","font-bold":""}," View ",-1)),P("div",null,[P("div",Fb,[v[6]||(v[6]=P("div",{text:"sm","pl-1":""},[P("span",null,"Viewer")],-1)),P("select",{"h-8":"","w-full":"","rounded-md":"","bg-transparent":"","px-2":"","py-1":"","text-right":"","font-mono":"","outline-none":"",text:"zinc-800 dark:zinc-100",onChange:f},v[5]||(v[5]=[P("option",{value:"2d"}," 2D ",-1),P("option",{value:"3d"}," 3D ",-1)]),32),v[7]||(v[7]=P("div",{text:"sm","pl-1":""},[P("span",null,"Theme")],-1)),P("label",Ub,[at(P("input",{"onUpdate:modelValue":v[4]||(v[4]=g=>ls(i)?i.value=g:null),text:"zinc-800 dark:zinc-100",checked:D(i),"aria-checked":D(i),name:"stageView",type:"checkbox",hidden:"","appearance-none":"","outline-none":""},null,8,jb),[[vr,D(i)]]),P("div",$b,[ve(zi,{name:"slide-away",mode:"out-in"},{default:be(()=>[D(i)?(Q(),ee("div",Vb)):(Q(),ee("div",Hb))]),_:1})])])])])]))}}),Gb={flex:"~","gap-2":""},Kb={flex:"~ 1 col gap-2","of-y-scroll":"","rounded-t-lg":"","p-5":""},qb=xe({__name:"DesktopSettings",setup(t){return(e,n)=>(Q(),ee("div",Gb,[ve(D(tu),{"should-scale-background":"",direction:"right"},{default:be(()=>[ve(D(ql),{bg:"zinc-100 dark:zinc-800",text:"lg zinc-500 dark:zinc-400","max-h":"[10lh]","min-h":"[1lh]","m-1":"","rounded-lg":"","p-2":"","outline-none":""},{default:be(()=>n[0]||(n[0]=[P("div",{"i-solar:settings-minimalistic-bold-duotone":""},null,-1)])),_:1}),ve(D(Yl),null,{default:be(()=>[ve(D(nu),{fixed:"","inset-0":"","z-50":"","bg-black:40":""}),ve(D(ru),{class:"max-w-40% min-w-500px w-full",flex:"~ col",bg:"white dark:zinc-900",fixed:"","inset-y-4":"","right-4":"","z-50":"","of-hidden":"","rounded-lg":""},{default:be(()=>[P("div",Kb,[ve(iu)])]),_:1})]),_:1})]),_:1})]))}}),Yb={"mb-1":"","w-full":"","gap-2":""},px=xe({__name:"Header",setup(t){return(e,n)=>(Q(),ee("header",Yb,[n[0]||(n[0]=P("a",{href:"https://github.com/moeru-ai/airi",rel:"noreferrer noopener",target:"_blank",flex:"~ 1","w-full":"","items-center":"","gap-2":"","px-2":"","text-nowrap":"","text-2xl":"","outline-none":""},[P("div",{"i-solar:cat-outline":"",text:"[#ed869d]"}),P("div",{"font-cute":""},[P("span",null,"アイリ")])],-1)),ve(qb)]))}});function ou(t,e){const n=ks(e??{},{...Mo.getDefaultRealTimeVADOptions("v5"),preSpeechPadFrames:30,positiveSpeechThreshold:.5,negativeSpeechThreshold:.35,minSpeechFrames:30,auto:!0}),r=V(),i=cc("microphone");async function o(){if(r.value&&(r.value.destroy(),r.value=void 0,console.warn("existing MicVAD destroyed")),!i.value)return;const a=D(t);if(!a)return;const s=await navigator.mediaDevices.getUserMedia({audio:{deviceId:a}});r.value=await Mo.MicVAD.new({...n,stream:s}),n.auto&&r.value.start()}return Ee(i,o,{immediate:!0}),Ee(Ya(t),o,{immediate:!0}),dc(o),ut(()=>{r.value&&(r.value.destroy(),r.value=void 0)}),{destroy:()=>{r.value&&(r.value.destroy(),r.value=void 0)},start:()=>{r.value&&r.value.start()}}}function Wb(t,e){const n=ks(e,{onLoading:()=>{},onInitiate:()=>{},onProgress:()=>{},onDone:()=>{},onReady:()=>{},onStart:()=>{},onUpdate:()=>{},onComplete:()=>{}}),{post:r,data:i,terminate:o}=fc(t,{type:"module"}),a=V(null),s=V(""),l=V([]),u=V(!1),c=V(0),d=V("");return Ee(i,p=>{var f,h,w,v,g,E,T,M;switch(p.status){case"loading":a.value="loading",s.value=p.data,(f=n.onLoading)==null||f.call(n,p.data);break;case"initiate":l.value.push(p),(h=n.onInitiate)==null||h.call(n,p);break;case"progress":l.value=l.value.map(N=>N.file===p.file?{...N,...p}:N),(w=n.onProgress)==null||w.call(n,p);break;case"done":l.value=l.value.filter(N=>N.file!==p.file),(v=n.onDone)==null||v.call(n,p);break;case"ready":a.value="ready",(g=n.onReady)==null||g.call(n);break;case"start":u.value=!0,(E=n.onStart)==null||E.call(n);break;case"update":c.value=p.tps,(T=n.onUpdate)==null||T.call(n,p.tps);break;case"complete":u.value=!1,d.value=p.output[0]||"",console.debug("Whisper result:",d.value),(M=n.onComplete)==null||M.call(n,p.output[0]);break}}),ut(()=>{o()}),{transcribe:p=>r(p),status:a,loadingMessage:s,loadingProgress:l,transcribing:u,tps:c,result:d,load:()=>r({type:"load"}),terminate:o}}const Xb="/assets/worker-CL_jKwe6.js";async function Qb(t,e){const n=new ArrayBuffer(44+t.length*2),r=new DataView(n);ir(r,0,"RIFF"),r.setUint32(4,36+t.length*2,!0),ir(r,8,"WAVE"),ir(r,12,"fmt "),r.setUint32(16,16,!0),r.setUint16(20,1,!0),r.setUint16(22,1,!0),r.setUint32(24,e,!0),r.setUint32(28,e*2,!0),r.setUint16(32,2,!0),r.setUint16(34,16,!0),ir(r,36,"data"),r.setUint32(40,t.length*2,!0),Zb(r,44,t);const i=new Blob([r],{type:"audio/wav"});return new Promise((o,a)=>{const s=new FileReader;s.onload=()=>{const l=s.result.split(",")[1];o(l)},s.onerror=a,s.readAsDataURL(i)})}function ir(t,e,n){for(let r=0;r{ft().then(()=>{r.update(),i.value=r.height.value})}),s(async()=>{ft().then(()=>{r.update(),i.value=r.height.value})}),(l,u)=>{const c=As("auto-animate");return Q(),ee("div",Jb,[u[1]||(u[1]=P("div",{"flex-1":""},null,-1)),at((Q(),ee("div",{ref_key:"chatHistoryRef",ref:e,"h-full":"","w-full":"",flex:"~ col","overflow-scroll":""},[u[0]||(u[0]=P("div",{"flex-1":""},null,-1)),(Q(!0),ee(mn,null,Nn(D(n),(d,p)=>(Q(),ee("div",{key:p,"mb-2":""},[d.role==="assistant"?(Q(),ee("div",e1,[P("div",t1,[P("div",null,[P("span",n1,oe(l.$t("stage.chat.message.character-name.airi")),1)]),d.content?(Q(),ee("div",{key:0,class:"markdown-content",text:"base {await u(_)}});async function g(){await u(e.value)}const{destroy:E,start:T}=ou(l,{onSpeechStart:()=>{n.value=!0},onVADMisfire:()=>{n.value=!1},onSpeechEnd:_=>{n.value=!1,N(_)},auto:!1});function M(){w.value!=="loading"&&(h(),T())}async function N(_){await d.resume();const x=await Qb(_,d.sampleRate);f({type:"generate",data:{audio:x,language:"en"}})}async function m(_){const x=_.target,b=o.value.find(y=>y.deviceId===x.value);if(!b){a.value=void 0;return}a.value=b}return Ee(s,async _=>{_==="false"&&(E(),v())}),c(async()=>{e.value=""}),(_,x)=>(Q(),ee("div",d1,[P("fieldset",f1,[P("label",{class:Gt([r.value==="chat"?"bg-pink-100 dark:bg-[#3c2632]":"bg-white dark:bg-[#121212]",r.value==="chat"?"text-pink-500 dark:text-pink-500":""]),flex:"~ row",checked:r.value==="chat","aria-checked":r.value==="chat",border:"solid l-2 t-2 b-2 pink-100 dark:[#3c2632]",bg:"hover:pink-100 dark:hover:[#3c2632]",text:"pink-300 hover:pink-500 dark:pink-300/50 dark:hover:pink-500",transition:"all duration-250 ease-in-out","cursor-pointer":"","items-center":"","gap-1":"","rounded-l-lg":"","px-2":""},[at(P("input",{"onUpdate:modelValue":x[0]||(x[0]=b=>r.value=b),type:"radio",name:"tab",value:"chat",hidden:""},null,512),[[Pr,r.value]]),x[5]||(x[5]=P("div",{"i-solar:dialog-2-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),P("div",h1,[P("span",m1,oe(_.$t("stage.chat.tabs.chat")),1)])],10,p1),P("label",{class:Gt([r.value==="custom"?"bg-pink-100 dark:bg-[#3c2632]":"bg-white dark:bg-[#121212]",r.value==="custom"?"text-pink-500 dark:text-pink-500":""]),flex:"~ row",checked:r.value==="custom","aria-checked":r.value==="custom",border:"solid t-2 b-2 pink-100 dark:[#3c2632]",bg:"hover:pink-100 dark:hover:[#3c2632]",text:"pink-300 hover:pink-500 dark:pink-300/50 dark:hover:pink-500",transition:"all duration-250 ease-in-out","cursor-pointer":"","items-center":"","gap-1":"","px-2":""},[at(P("input",{"onUpdate:modelValue":x[1]||(x[1]=b=>r.value=b),type:"radio",name:"tab",value:"custom",hidden:""},null,512),[[Pr,r.value]]),x[6]||(x[6]=P("div",{"i-solar:star-fall-2-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),P("div",v1,[P("span",null,oe(_.$t("stage.chat.tabs.custom")),1)])],10,g1),P("label",{class:Gt([r.value==="clothes"?"bg-pink-100 dark:bg-[#3c2632]":"bg-white dark:bg-[#121212]",r.value==="clothes"?"text-pink-500 dark:text-pink-500":""]),flex:"~ row",checked:r.value==="clothes","aria-checked":r.value==="clothes",border:"solid r-2 t-2 b-2 pink-100 dark:[#3c2632]",bg:"hover:pink-100 dark:hover:[#3c2632]",text:"pink-300 hover:pink-500 dark:pink-300/50 dark:hover:pink-500",transition:"all duration-250 ease-in-out","cursor-pointer":"","items-center":"","gap-1":"","rounded-r-lg":"","px-2":""},[at(P("input",{"onUpdate:modelValue":x[2]||(x[2]=b=>r.value=b),type:"radio",name:"tab",value:"clothes",hidden:""},null,512),[[Pr,r.value]]),x[7]||(x[7]=P("div",{"i-solar:magic-stick-3-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),P("div",b1,[P("span",null,oe(_.$t("stage.chat.tabs.clothes")),1)])],10,y1)]),P("div",x1,[P("div",w1,[ve(c1,{"h-full":"","flex-1":"","p-4":"",w:"full","max-h":"e.value=b),placeholder:D(p)("stage.message"),text:"pink-300 hover:pink-500 dark:pink-300/50 dark:hover:pink-500 placeholder:pink-300 placeholder:hover:pink-500 placeholder:dark:pink-300/50 placeholder:dark:hover:pink-500",bg:"pink-100 dark:pink-400/20","min-h":"[100px]","w-full":"","rounded-t-xl":"","p-4":"","font-medium":"","outline-none":"",transition:"all duration-250 ease-in-out placeholder:all placeholder:duration-250 placeholder:ease-in-out",onSubmit:g},null,8,["modelValue","placeholder"])])])]),P("div",T1,[P("button",{bg:"cyan-100 hover:cyan-200 dark:cyan-800 dark:hover:cyan-700",transition:"all duration-250 ease-in-out",text:"cyan-400","mb-6":"",flex:"","cursor-pointer":"","items-center":"","justify-center":"","gap-2":"","rounded-full":"","px-4":"","py-2":"",onClick:M},[ve(zi,{mode:"out-in"},{default:be(()=>[D(w)===null?(Q(),ee("div",A1,oe(_.$t("stage.operations.load-models")),1)):D(w)==="loading"?(Q(),ee("div",E1,[x[8]||(x[8]=P("div",{"i-svg-spinners:bouncing-ball":"",class:"text-cyan"},null,-1)),P("span",null,oe(_.$t("stage.operations.load-models-status.loading")),1)])):D(w)==="ready"?(Q(),ee("div",_1,[x[9]||(x[9]=P("div",{"i-lucide:check":"",class:"text-cyan"},null,-1)),P("span",null,oe(_.$t("stage.operations.load-models-status.ready")),1)])):Ye("",!0)]),_:1})]),P("div",M1,[ve(D(wr),null,{default:be(()=>[i.value?(Q(),ee("fieldset",S1,[(Q(!0),ee(mn,null,Nn(D(o),(b,y)=>(Q(),ee("label",{key:y,class:"[&_div_span]:dark:hover:bg-cyan-300 [&_div_span]:dark:hover:bg-cyan-900"},[P("input",{type:"radio",name:"audioInput",value:b.deviceId,hidden:"",onChange:m},null,40,I1),P("div",R1,[P("div",C1,[b.deviceId===D(l)?(Q(),ee("div",N1)):Ye("",!0)]),P("span",{"inline-block":"",class:Gt([b.deviceId===D(l)?"cyan-400 dark:text-white":"cyan-400/50 dark:text-white/50"]),transition:"all duration-250 ease-in-out"},oe(b.label),3)])]))),128))])):Ye("",!0)]),_:1}),P("label",O1,[at(P("input",{"onUpdate:modelValue":x[4]||(x[4]=b=>i.value=b),type:"checkbox",hidden:""},null,512),[[vr,i.value]]),x[10]||(x[10]=P("div",{"i-solar:microphone-2-bold-duotone":""},null,-1)),P("div",null,[n.value?(Q(),ee("span",D1,"Listening...")):(Q(),ee("span",P1,oe(_.$t("settings.microphone")),1))])])])])]))}}),hx=Ki(L1,[["__scopeId","data-v-893059ff"]]),B1={},z1={"mb-1":"","w-full":"","gap-2":""};function F1(t,e){return Q(),ee("header",z1,e[0]||(e[0]=[P("div",{flex:"~ 1","w-full":"","items-center":"","justify-center":"","gap-2":"","px-2":"","text-nowrap":"","text-lg":""},[P("div",{"i-solar:cat-outline":"",text:"[#ed869d]"}),P("div",{"font-cute":""},[P("span",null,"アイリ")])],-1)]))}const mx=Ki(B1,[["render",F1]]),U1={py:"1",flex:"~ col",rounded:"lg","overflow-hidden":""},j1={key:0,flex:"",mr:"12"},$1={flex:"~ col",border:"4 solid pink-200/50 dark:pink-500/50",shadow:"md pink-200/50 dark:none","min-w-20":"","rounded-lg":"","px-2":"","py-1":"",h:"unset {ft().then(()=>{r.update(),i.value=r.height.value})}),s(async()=>{ft().then(()=>{r.update(),i.value=r.height.value})}),(l,u)=>{const c=As("auto-animate");return Q(),ee("div",U1,[u[1]||(u[1]=P("div",{"flex-1":""},null,-1)),at((Q(),ee("div",{ref_key:"chatHistoryRef",ref:e,"h-full":"","w-full":"","max-h":"30vh",flex:"~ col","overflow-scroll":""},[u[0]||(u[0]=P("div",{"flex-1":""},null,-1)),(Q(!0),ee(mn,null,Nn(D(n),(d,p)=>(Q(),ee("div",{key:p,"mb-2":""},[d.role==="assistant"?(Q(),ee("div",j1,[P("div",$1,[P("div",null,[P("span",V1,oe(l.$t("stage.chat.message.character-name.airi")),1)]),d.content?(Q(),ee("div",{key:0,class:"markdown-content",text:"base {n.value=!0},onVADMisfire:()=>{n.value=!1},onSpeechEnd:p=>{n.value=!1,d()},auto:!1});function d(p){alert("Transcription is not implemented yet")}return Ee(r,async p=>{p==="false"&&u()}),a(async()=>{e.value=""}),mt(()=>{c()}),(p,f)=>(Q(),ee("div",null,[P("div",Z1,[ve(Q1,{absolute:"","left-0":"","top-0":"",transform:"translate-y-[-100%]","w-full":""}),P("div",J1,[ve(D(Is),{modelValue:e.value,"onUpdate:modelValue":f[0]||(f[0]=h=>e.value=h),placeholder:D(s)("stage.message"),border:"solid 2 pink-100 dark:pink-400/20",text:"pink-400 hover:pink-600 dark:[#905073] dark:hover:pink-600 placeholder:pink-400 placeholder:hover:pink-600 placeholder:dark:[#905073] placeholder:dark:hover:pink-600",bg:"pink-50 dark:[#3c2632]","max-h":"[10lh]","min-h":"[1lh]","w-full":"","resize-none":"","overflow-y-scroll":"","rounded-l-xl":"","p-2":"","font-medium":"","outline-none":"",transition:"all duration-250 ease-in-out placeholder:all placeholder:duration-250 placeholder:ease-in-out",onSubmit:l},null,8,["modelValue","placeholder"])]),ve(D(tu),{"should-scale-background":""},{default:be(()=>[ve(D(ql),{class:"px-4 py-2.5",border:"solid 2 pink-100 dark:pink-400/20",text:"lg pink-400 hover:pink-600 dark:[#905073] dark:hover:pink-600 placeholder:pink-400 placeholder:hover:pink-600 placeholder:dark:[#905073] placeholder:dark:hover:pink-600",bg:"pink-50 dark:[#3c2632]","max-h":"[10lh]","min-h":"[1lh]","rounded-r-xl":""},{default:be(()=>f[1]||(f[1]=[P("div",{"i-solar:settings-bold-duotone":""},null,-1)])),_:1}),ve(D(Yl),null,{default:be(()=>[ve(D(nu),{class:"fixed inset-0 z-50 bg-black/40"}),ve(D(ru),{"max-h":"[75%]",fixed:"","bottom-0":"","left-0":"","right-0":"","z-50":"","mt-24":"","h-full":"",flex:"","flex-col":"","rounded-t-lg":"",bg:"[#fffbff] dark:[#1f1a1d]"},{default:be(()=>[P("div",ex,[ve(iu)])]),_:1})]),_:1})]),_:1})])]))}}),vx={};export{hx as I,mx as M,dx as W,px as _,gx as a,vx as b};