diff --git a/assets/Basic.vue_vue_type_script_setup_true_lang-Ckn2TiNk.js b/assets/Basic.vue_vue_type_script_setup_true_lang-DJ4kS-zi.js similarity index 90% rename from assets/Basic.vue_vue_type_script_setup_true_lang-Ckn2TiNk.js rename to assets/Basic.vue_vue_type_script_setup_true_lang-DJ4kS-zi.js index a490f47d0cb467c3f21be61d5a9e73f9b8de0c69..b28f885caf390a6862a9c27adfc36e5b69646f75 100644 --- a/assets/Basic.vue_vue_type_script_setup_true_lang-Ckn2TiNk.js +++ b/assets/Basic.vue_vue_type_script_setup_true_lang-DJ4kS-zi.js @@ -1 +1 @@ -import{d,bI as c,bJ as f,g as s,w as p,A as v,bE as x,o as h,c as y,n as _}from"./index--eYU5aQm.js";const g=d({__name:"Basic",props:{modelValue:{default:""},modelModifiers:{}},emits:c(["submit"],["update:modelValue"]),setup(n,{emit:u}){const r=u,e=f(n,"modelValue"),a=s(),o=s("auto");function i(t){t.code==="Enter"&&!t.shiftKey&&(t.preventDefault(),r("submit",e.value))}return p(e,()=>{o.value="auto",requestAnimationFrame(()=>{a.value&&(o.value=`${a.value.scrollHeight}px`)})},{immediate:!0}),(t,l)=>v((h(),y("textarea",{ref_key:"textareaRef",ref:a,"onUpdate:modelValue":l[0]||(l[0]=m=>e.value=m),style:_({height:o.value}),onKeydown:i},null,36)),[[x,e.value]])}});export{g as _}; +import{d,bI as c,bJ as f,g as s,w as p,A as v,bE as x,o as h,c as y,n as _}from"./index-D55VqdU4.js";const g=d({__name:"Basic",props:{modelValue:{default:""},modelModifiers:{}},emits:c(["submit"],["update:modelValue"]),setup(n,{emit:u}){const r=u,e=f(n,"modelValue"),a=s(),o=s("auto");function i(t){t.code==="Enter"&&!t.shiftKey&&(t.preventDefault(),r("submit",e.value))}return p(e,()=>{o.value="auto",requestAnimationFrame(()=>{a.value&&(o.value=`${a.value.scrollHeight}px`)})},{immediate:!0}),(t,l)=>v((h(),y("textarea",{ref_key:"textareaRef",ref:a,"onUpdate:modelValue":l[0]||(l[0]=m=>e.value=m),style:_({height:o.value}),onKeydown:i},null,36)),[[x,e.value]])}});export{g as _}; diff --git a/assets/CardDetailDialog-CxciD2B5.js b/assets/CardDetailDialog-CxciD2B5.js deleted file mode 100644 index 6f1af09b683128f65bb2f7a3bf603ae4f5cee600..0000000000000000000000000000000000000000 --- a/assets/CardDetailDialog-CxciD2B5.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as o}from"./CardDetailDialog.vue_vue_type_script_setup_true_lang-Dudpr3F2.js";import"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-R-YdRLSq.js";import"./index--eYU5aQm.js";import"./index-CpeQQOdD.js";import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import"./airi-card-_ueLLZ0g.js";import"./consciousness-NMirv8Xi.js";import"./providers-YQf-rDZ1.js";import"./index-Be1NqeGb.js";import"./speech-BOhrg3WS.js";export{o as default}; diff --git a/assets/CardDetailDialog-DKc4Mthn.js b/assets/CardDetailDialog-DKc4Mthn.js new file mode 100644 index 0000000000000000000000000000000000000000..228eab7c04a5b5cfc1afa5866937604fbe14f9a1 --- /dev/null +++ b/assets/CardDetailDialog-DKc4Mthn.js @@ -0,0 +1 @@ +import{_ as o}from"./CardDetailDialog.vue_vue_type_script_setup_true_lang-MUqOZwiW.js";import"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-DE2XAzMf.js";import"./index-D55VqdU4.js";import"./index-fSchh9rJ.js";import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import"./airi-card-TTCASwDd.js";import"./consciousness-BGmbU4M0.js";import"./providers-DAp1566d.js";import"./index-Be1NqeGb.js";import"./speech-BtNOtIn9.js";export{o as default}; diff --git a/assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-Dudpr3F2.js b/assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-MUqOZwiW.js similarity index 96% rename from assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-Dudpr3F2.js rename to assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-MUqOZwiW.js index 60f0eebbe37b0b9e704acb28da8e921a18a0dbd1..dc57a5693c480cf320e9a2dbe8fc0e79567ed0e2 100644 --- a/assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-Dudpr3F2.js +++ b/assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-MUqOZwiW.js @@ -1 +1 @@ -import{a as O,_ as q}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-R-YdRLSq.js";import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{d as E,q as U,s as F,h as x,g as L,c as n,o,bx as f,b as m,u as l,y as k,a as e,C as v,bL as u,D as i,z as $,by as j}from"./index--eYU5aQm.js";import{u as R}from"./airi-card-_ueLLZ0g.js";import{n as G,I as J,$ as K,P as Q,B as W}from"./index-CpeQQOdD.js";const X={key:0,class:"w-full flex flex-col gap-5"},Y={flex:"~ col","gap-3":""},Z={flex:"~ row","items-center":"","justify-between":""},ee={flex:"~ row","items-center":"","gap-2":""},te={key:0,class:"bg-primary-100 text-primary-600 dark:bg-primary-900/40 dark:text-primary-400 flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium"},ae={"mt-1":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},re={"font-medium":""},se={flex:"~ row","gap-2":""},le={class:"mt-4"},ne={class:"border-b border-neutral-200 dark:border-neutral-700"},oe={class:"flex justify-center -mb-px sm:justify-start space-x-1"},ie=["onClick"],de={class:"flex items-center gap-1"},ue={key:0},ce=["innerHTML"],me={key:1},ve=["innerHTML"],pe={key:2},ge={flex:"~ col","max-h-60":"","gap-4":"","overflow-auto":"","pr-1":"","sm:max-h-80":""},xe={key:0,flex:"~ col","gap-2":""},be={"text-lg":"","text-neutral-500":"","font-medium":"","dark:text-neutral-400":""},fe=["innerHTML"],he={key:3},_e={grid:"~ cols-1 sm:cols-3","gap-4":""},ke={flex:"~ col",bg:"white/60 dark:black/30","gap-1":"","rounded-lg":"","p-3":"",border:"~ neutral-200/50 dark:neutral-700/30",transition:"all duration-200",hover:"bg-white/80 dark:bg-black/40"},we={flex:"~ row","items-center":"","gap-2":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},ye={truncate:"","font-medium":""},Ce={flex:"~ col",bg:"white/60 dark:black/30","gap-2":"","rounded-lg":"","p-3":"",border:"~ neutral-200/50 dark:neutral-700/30",transition:"all duration-200",hover:"bg-white/80 dark:bg-black/40"},Ie={flex:"~ row","items-center":"","gap-2":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},Te={truncate:"","font-medium":""},Ve={flex:"~ col",bg:"white/60 dark:black/30","gap-2":"","rounded-lg":"","p-3":"",border:"~ neutral-200/50 dark:neutral-700/30",transition:"all duration-200",hover:"bg-white/80 dark:bg-black/40"},He={flex:"~ row","items-center":"","gap-2":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},Le={truncate:"","font-medium":""},$e={key:1,bg:"neutral-50/50 dark:neutral-900/50","rounded-xl":"","p-8":"","text-center":"",border:"~ neutral-200/50 dark:neutral-700/30",shadow:"sm"},ze=E({__name:"CardDetailDialog",props:{modelValue:{type:Boolean},cardId:null},emits:["update:modelValue"],setup(B,{emit:z}){const b=B,D=z,{t:d}=U(),w=R(),{removeCard:A}=w,{activeCardId:M}=F(w),a=x(()=>{if(b.cardId)return w.getCard(b.cardId)}),y=x(()=>{var t,c,r,g,S;if(!a.value||!((c=(t=a.value.extensions)==null?void 0:t.airi)!=null&&c.modules))return{consciousness:"",speech:"",voice:""};const s=a.value.extensions.airi.modules;return{consciousness:((r=s.consciousness)==null?void 0:r.model)||"",speech:((g=s.speech)==null?void 0:g.model)||"",voice:((S=s.speech)==null?void 0:S.voice_id)||""}}),C=x(()=>a.value?{personality:a.value.personality,scenario:a.value.scenario,systemPrompt:a.value.systemPrompt,postHistoryInstructions:a.value.postHistoryInstructions}:{}),h=x(()=>b.cardId===M.value),I=L(!1);function N(){I.value=!0,setTimeout(()=>{M.value=b.cardId,I.value=!1},300)}function T(s){return s==null?void 0:s.replace(/\{\{(.*?)\}\}/g,'{{ $1 }}').trim()}const _=L(!1);function P(){a.value&&(A(b.cardId),D("update:modelValue",!1)),_.value=!1}const V=L(""),H=x(()=>{var t,c;const s=[];return(t=a.value)!=null&&t.description&&s.push({id:"description",label:d("settings.pages.card.description_label"),icon:"i-solar:document-text-linear"}),(c=a.value)!=null&&c.notes&&s.push({id:"notes",label:d("settings.pages.card.creator_notes"),icon:"i-solar:notes-linear"}),Object.values(C.value).some(r=>!!r)&&s.push({id:"character",label:d("settings.pages.card.character"),icon:"i-solar:user-rounded-linear"}),s.push({id:"modules",label:d("settings.pages.card.modules"),icon:"i-solar:tuning-square-linear"}),s}),p=x({get:()=>{var s;return H.value.find(t=>t.id===V.value)?V.value:((s=H.value[0])==null?void 0:s.id)||""},set:s=>{V.value=s}});return(s,t)=>{var c;return o(),n(f,null,[m(l(G),{open:B.modelValue,"onUpdate:open":t[0]||(t[0]=r=>D("update:modelValue",r))},{default:k(()=>[m(l(J),null,{default:k(()=>[m(l(K),{class:"data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-50 bg-black/50 backdrop-blur-sm"}),m(l(Q),{class:"data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-50 m-0 max-h-[90vh] max-w-6xl w-[92vw] flex flex-col overflow-auto border border-neutral-200 rounded-xl bg-white p-5 shadow-xl 2xl:w-[60vw] lg:w-[80vw] md:w-[85vw] xl:w-[70vw] -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800 sm:p-6"},{default:k(()=>[a.value?(o(),n("div",X,[e("div",Y,[e("div",Z,[e("div",null,[e("div",ee,[m(l(W),{"text-2xl":"","font-bold":"",class:"from-primary-500 to-primary-400 bg-gradient-to-r bg-clip-text text-transparent"},{default:k(()=>[u(i(a.value.name),1)]),_:1}),h.value?(o(),n("div",te,[t[3]||(t[3]=e("div",{"i-solar:check-circle-bold-duotone":"","text-xs":""},null,-1)),u(" "+i(l(d)("settings.pages.card.active_badge")),1)])):v("",!0)]),e("div",ae,[u(" v"+i(a.value.version)+" ",1),a.value.creator?(o(),n(f,{key:0},[u(" · "+i(l(d)("settings.pages.card.created_by"))+" ",1),e("span",re,i(a.value.creator),1)],64)):v("",!0)])]),e("div",se,[m(l(O),{variant:"primary",icon:h.value?"i-solar:check-circle-bold-duotone":"i-solar:play-circle-broken",label:h.value?l(d)("settings.pages.card.active"):l(d)("settings.pages.card.activate"),disabled:h.value,class:$({"animate-pulse":I.value}),onClick:N},null,8,["icon","label","disabled","class"])])]),e("div",le,[e("div",ne,[e("div",oe,[(o(!0),n(f,null,j(H.value,r=>(o(),n("button",{key:r.id,class:$(["px-4 py-2 text-sm font-medium",[p.value===r.id?"text-primary-600 dark:text-primary-400 border-b-2 border-primary-500 dark:border-primary-400":"text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-300"]]),onClick:g=>p.value=r.id},[e("div",de,[e("div",{class:$(r.icon)},null,2),u(" "+i(r.label),1)])],10,ie))),128))])])]),p.value==="notes"&&a.value.notes?(o(),n("div",ue,[e("div",{bg:"white/60 dark:black/30",border:"~ neutral-200/50 dark:neutral-700/30","max-h-60":"","overflow-auto":"","whitespace-pre-line":"","rounded-lg":"","p-4":"","text-neutral-700":"","sm:max-h-80":"","dark:text-neutral-300":"",transition:"all duration-200",hover:"bg-white/80 dark:bg-black/40",innerHTML:T(a.value.notes)},null,8,ce)])):v("",!0),p.value==="description"&&a.value.description?(o(),n("div",me,[e("div",{bg:"white/60 dark:black/30","max-h-60":"","overflow-auto":"","whitespace-pre-line":"","rounded-lg":"","p-4":"","sm:max-h-80":"",text:"neutral-600 dark:neutral-300",border:"~ neutral-200/50 dark:neutral-700/30",innerHTML:T(a.value.description)},null,8,ve)])):v("",!0),p.value==="character"&&Object.values(C.value).some(r=>!!r)?(o(),n("div",pe,[e("div",ge,[(o(!0),n(f,null,j(C.value,(r,g)=>(o(),n(f,{key:g},[r?(o(),n("div",xe,[e("h2",be,i(l(d)(`settings.pages.card.${g.toLowerCase()}`)),1),e("div",{bg:"white/60 dark:black/30",border:"~ neutral-200/50 dark:neutral-700/30",transition:"all duration-200",hover:"bg-white/80 dark:bg-black/40","max-h-none":"","overflow-auto":"","whitespace-pre-line":"","rounded-lg":"","p-3":"","text-neutral-700":"","dark:text-neutral-300":"",innerHTML:T(r)},null,8,fe)])):v("",!0)],64))),128))])])):v("",!0),p.value==="modules"?(o(),n("div",he,[e("div",_e,[e("div",ke,[e("span",we,[t[4]||(t[4]=e("div",{"i-lucide:ghost":""},null,-1)),u(" "+i(l(d)("settings.pages.card.consciousness.model")),1)]),e("div",ye,i(y.value.consciousness??"default"),1)]),e("div",Ce,[e("span",Ie,[t[5]||(t[5]=e("div",{"i-lucide:mic":""},null,-1)),u(" "+i(l(d)("settings.pages.card.speech.model")),1)]),e("div",Te,i(y.value.speech??"default"),1)]),e("div",Ve,[e("span",He,[t[6]||(t[6]=e("div",{"i-lucide:music":""},null,-1)),u(" "+i(l(d)("settings.pages.card.speech.voice")),1)]),e("div",Le,i(y.value.voice??"default"),1)])])])):v("",!0)])])):(o(),n("div",$e,[t[7]||(t[7]=e("div",{"i-solar:card-search-broken":"","mx-auto":"","mb-3":"","text-6xl":"","text-neutral-400":""},null,-1)),u(" "+i(l(d)("settings.pages.card.card_not_found")),1)]))]),_:1})]),_:1})]),_:1},8,["open"]),m(q,{modelValue:_.value,"onUpdate:modelValue":t[1]||(t[1]=r=>_.value=r),"card-name":(c=a.value)==null?void 0:c.name,onConfirm:P,onCancel:t[2]||(t[2]=r=>_.value=!1)},null,8,["modelValue","card-name"])],64)}}});export{ze as _}; +import{a as O,_ as q}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-DE2XAzMf.js";import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{d as E,q as U,s as F,h as x,g as L,c as n,o,bx as f,b as m,u as l,y as k,a as e,C as v,bL as u,D as i,z as $,by as j}from"./index-D55VqdU4.js";import{u as R}from"./airi-card-TTCASwDd.js";import{n as G,I as J,$ as K,P as Q,B as W}from"./index-fSchh9rJ.js";const X={key:0,class:"w-full flex flex-col gap-5"},Y={flex:"~ col","gap-3":""},Z={flex:"~ row","items-center":"","justify-between":""},ee={flex:"~ row","items-center":"","gap-2":""},te={key:0,class:"bg-primary-100 text-primary-600 dark:bg-primary-900/40 dark:text-primary-400 flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium"},ae={"mt-1":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},re={"font-medium":""},se={flex:"~ row","gap-2":""},le={class:"mt-4"},ne={class:"border-b border-neutral-200 dark:border-neutral-700"},oe={class:"flex justify-center -mb-px sm:justify-start space-x-1"},ie=["onClick"],de={class:"flex items-center gap-1"},ue={key:0},ce=["innerHTML"],me={key:1},ve=["innerHTML"],pe={key:2},ge={flex:"~ col","max-h-60":"","gap-4":"","overflow-auto":"","pr-1":"","sm:max-h-80":""},xe={key:0,flex:"~ col","gap-2":""},be={"text-lg":"","text-neutral-500":"","font-medium":"","dark:text-neutral-400":""},fe=["innerHTML"],he={key:3},_e={grid:"~ cols-1 sm:cols-3","gap-4":""},ke={flex:"~ col",bg:"white/60 dark:black/30","gap-1":"","rounded-lg":"","p-3":"",border:"~ neutral-200/50 dark:neutral-700/30",transition:"all duration-200",hover:"bg-white/80 dark:bg-black/40"},we={flex:"~ row","items-center":"","gap-2":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},ye={truncate:"","font-medium":""},Ce={flex:"~ col",bg:"white/60 dark:black/30","gap-2":"","rounded-lg":"","p-3":"",border:"~ neutral-200/50 dark:neutral-700/30",transition:"all duration-200",hover:"bg-white/80 dark:bg-black/40"},Ie={flex:"~ row","items-center":"","gap-2":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},Te={truncate:"","font-medium":""},Ve={flex:"~ col",bg:"white/60 dark:black/30","gap-2":"","rounded-lg":"","p-3":"",border:"~ neutral-200/50 dark:neutral-700/30",transition:"all duration-200",hover:"bg-white/80 dark:bg-black/40"},He={flex:"~ row","items-center":"","gap-2":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},Le={truncate:"","font-medium":""},$e={key:1,bg:"neutral-50/50 dark:neutral-900/50","rounded-xl":"","p-8":"","text-center":"",border:"~ neutral-200/50 dark:neutral-700/30",shadow:"sm"},ze=E({__name:"CardDetailDialog",props:{modelValue:{type:Boolean},cardId:null},emits:["update:modelValue"],setup(B,{emit:z}){const b=B,D=z,{t:d}=U(),w=R(),{removeCard:A}=w,{activeCardId:M}=F(w),a=x(()=>{if(b.cardId)return w.getCard(b.cardId)}),y=x(()=>{var t,c,r,g,S;if(!a.value||!((c=(t=a.value.extensions)==null?void 0:t.airi)!=null&&c.modules))return{consciousness:"",speech:"",voice:""};const s=a.value.extensions.airi.modules;return{consciousness:((r=s.consciousness)==null?void 0:r.model)||"",speech:((g=s.speech)==null?void 0:g.model)||"",voice:((S=s.speech)==null?void 0:S.voice_id)||""}}),C=x(()=>a.value?{personality:a.value.personality,scenario:a.value.scenario,systemPrompt:a.value.systemPrompt,postHistoryInstructions:a.value.postHistoryInstructions}:{}),h=x(()=>b.cardId===M.value),I=L(!1);function N(){I.value=!0,setTimeout(()=>{M.value=b.cardId,I.value=!1},300)}function T(s){return s==null?void 0:s.replace(/\{\{(.*?)\}\}/g,'{{ $1 }}').trim()}const _=L(!1);function P(){a.value&&(A(b.cardId),D("update:modelValue",!1)),_.value=!1}const V=L(""),H=x(()=>{var t,c;const s=[];return(t=a.value)!=null&&t.description&&s.push({id:"description",label:d("settings.pages.card.description_label"),icon:"i-solar:document-text-linear"}),(c=a.value)!=null&&c.notes&&s.push({id:"notes",label:d("settings.pages.card.creator_notes"),icon:"i-solar:notes-linear"}),Object.values(C.value).some(r=>!!r)&&s.push({id:"character",label:d("settings.pages.card.character"),icon:"i-solar:user-rounded-linear"}),s.push({id:"modules",label:d("settings.pages.card.modules"),icon:"i-solar:tuning-square-linear"}),s}),p=x({get:()=>{var s;return H.value.find(t=>t.id===V.value)?V.value:((s=H.value[0])==null?void 0:s.id)||""},set:s=>{V.value=s}});return(s,t)=>{var c;return o(),n(f,null,[m(l(G),{open:B.modelValue,"onUpdate:open":t[0]||(t[0]=r=>D("update:modelValue",r))},{default:k(()=>[m(l(J),null,{default:k(()=>[m(l(K),{class:"data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-50 bg-black/50 backdrop-blur-sm"}),m(l(Q),{class:"data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-50 m-0 max-h-[90vh] max-w-6xl w-[92vw] flex flex-col overflow-auto border border-neutral-200 rounded-xl bg-white p-5 shadow-xl 2xl:w-[60vw] lg:w-[80vw] md:w-[85vw] xl:w-[70vw] -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800 sm:p-6"},{default:k(()=>[a.value?(o(),n("div",X,[e("div",Y,[e("div",Z,[e("div",null,[e("div",ee,[m(l(W),{"text-2xl":"","font-bold":"",class:"from-primary-500 to-primary-400 bg-gradient-to-r bg-clip-text text-transparent"},{default:k(()=>[u(i(a.value.name),1)]),_:1}),h.value?(o(),n("div",te,[t[3]||(t[3]=e("div",{"i-solar:check-circle-bold-duotone":"","text-xs":""},null,-1)),u(" "+i(l(d)("settings.pages.card.active_badge")),1)])):v("",!0)]),e("div",ae,[u(" v"+i(a.value.version)+" ",1),a.value.creator?(o(),n(f,{key:0},[u(" · "+i(l(d)("settings.pages.card.created_by"))+" ",1),e("span",re,i(a.value.creator),1)],64)):v("",!0)])]),e("div",se,[m(l(O),{variant:"primary",icon:h.value?"i-solar:check-circle-bold-duotone":"i-solar:play-circle-broken",label:h.value?l(d)("settings.pages.card.active"):l(d)("settings.pages.card.activate"),disabled:h.value,class:$({"animate-pulse":I.value}),onClick:N},null,8,["icon","label","disabled","class"])])]),e("div",le,[e("div",ne,[e("div",oe,[(o(!0),n(f,null,j(H.value,r=>(o(),n("button",{key:r.id,class:$(["px-4 py-2 text-sm font-medium",[p.value===r.id?"text-primary-600 dark:text-primary-400 border-b-2 border-primary-500 dark:border-primary-400":"text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-300"]]),onClick:g=>p.value=r.id},[e("div",de,[e("div",{class:$(r.icon)},null,2),u(" "+i(r.label),1)])],10,ie))),128))])])]),p.value==="notes"&&a.value.notes?(o(),n("div",ue,[e("div",{bg:"white/60 dark:black/30",border:"~ neutral-200/50 dark:neutral-700/30","max-h-60":"","overflow-auto":"","whitespace-pre-line":"","rounded-lg":"","p-4":"","text-neutral-700":"","sm:max-h-80":"","dark:text-neutral-300":"",transition:"all duration-200",hover:"bg-white/80 dark:bg-black/40",innerHTML:T(a.value.notes)},null,8,ce)])):v("",!0),p.value==="description"&&a.value.description?(o(),n("div",me,[e("div",{bg:"white/60 dark:black/30","max-h-60":"","overflow-auto":"","whitespace-pre-line":"","rounded-lg":"","p-4":"","sm:max-h-80":"",text:"neutral-600 dark:neutral-300",border:"~ neutral-200/50 dark:neutral-700/30",innerHTML:T(a.value.description)},null,8,ve)])):v("",!0),p.value==="character"&&Object.values(C.value).some(r=>!!r)?(o(),n("div",pe,[e("div",ge,[(o(!0),n(f,null,j(C.value,(r,g)=>(o(),n(f,{key:g},[r?(o(),n("div",xe,[e("h2",be,i(l(d)(`settings.pages.card.${g.toLowerCase()}`)),1),e("div",{bg:"white/60 dark:black/30",border:"~ neutral-200/50 dark:neutral-700/30",transition:"all duration-200",hover:"bg-white/80 dark:bg-black/40","max-h-none":"","overflow-auto":"","whitespace-pre-line":"","rounded-lg":"","p-3":"","text-neutral-700":"","dark:text-neutral-300":"",innerHTML:T(r)},null,8,fe)])):v("",!0)],64))),128))])])):v("",!0),p.value==="modules"?(o(),n("div",he,[e("div",_e,[e("div",ke,[e("span",we,[t[4]||(t[4]=e("div",{"i-lucide:ghost":""},null,-1)),u(" "+i(l(d)("settings.pages.card.consciousness.model")),1)]),e("div",ye,i(y.value.consciousness??"default"),1)]),e("div",Ce,[e("span",Ie,[t[5]||(t[5]=e("div",{"i-lucide:mic":""},null,-1)),u(" "+i(l(d)("settings.pages.card.speech.model")),1)]),e("div",Te,i(y.value.speech??"default"),1)]),e("div",Ve,[e("span",He,[t[6]||(t[6]=e("div",{"i-lucide:music":""},null,-1)),u(" "+i(l(d)("settings.pages.card.speech.voice")),1)]),e("div",Le,i(y.value.voice??"default"),1)])])])):v("",!0)])])):(o(),n("div",$e,[t[7]||(t[7]=e("div",{"i-solar:card-search-broken":"","mx-auto":"","mb-3":"","text-6xl":"","text-neutral-400":""},null,-1)),u(" "+i(l(d)("settings.pages.card.card_not_found")),1)]))]),_:1})]),_:1})]),_:1},8,["open"]),m(q,{modelValue:_.value,"onUpdate:modelValue":t[1]||(t[1]=r=>_.value=r),"card-name":(c=a.value)==null?void 0:c.name,onConfirm:P,onCancel:t[2]||(t[2]=r=>_.value=!1)},null,8,["modelValue","card-name"])],64)}}});export{ze as _}; diff --git a/assets/CardListItem-BTy07mxf.js b/assets/CardListItem-BTy07mxf.js deleted file mode 100644 index aa91db9542dac4413482c23d53a5454b602345dd..0000000000000000000000000000000000000000 --- a/assets/CardListItem-BTy07mxf.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as o}from"./CardListItem.vue_vue_type_script_setup_true_lang-B7ec9PDI.js";import"./index--eYU5aQm.js";import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";export{o as default}; diff --git a/assets/CardListItem-BohbUcI4.js b/assets/CardListItem-BohbUcI4.js new file mode 100644 index 0000000000000000000000000000000000000000..47652609b421bf42e4031fa7ba4639290e7a69bf --- /dev/null +++ b/assets/CardListItem-BohbUcI4.js @@ -0,0 +1 @@ +import{_ as o}from"./CardListItem.vue_vue_type_script_setup_true_lang-C3dXCNzW.js";import"./index-D55VqdU4.js";import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";export{o as default}; diff --git a/assets/CardListItem.vue_vue_type_script_setup_true_lang-B7ec9PDI.js b/assets/CardListItem.vue_vue_type_script_setup_true_lang-C3dXCNzW.js similarity index 97% rename from assets/CardListItem.vue_vue_type_script_setup_true_lang-B7ec9PDI.js rename to assets/CardListItem.vue_vue_type_script_setup_true_lang-C3dXCNzW.js index f9ba00bb6b12f77ee44a1ec1b33120883945baac..396771b58938862155f08f9283f8399572e21bb6 100644 --- a/assets/CardListItem.vue_vue_type_script_setup_true_lang-B7ec9PDI.js +++ b/assets/CardListItem.vue_vue_type_script_setup_true_lang-C3dXCNzW.js @@ -1 +1 @@ -import{d as M,g as s,l as R,c as p,o as d,m as D,n as F,bn as H,x as I,y as N,a as t,C as v,D as l,bM as k,z as h,u as V}from"./index--eYU5aQm.js";import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";const W=M({__name:"CursorFloating",props:{intensity:{default:1.5}},setup(r){const n=r,o=s(null),a=s(""),e=s("50% 50%"),i=s("50% 50%"),y=s(.5);function w(c){if(!o.value)return;const u=o.value,b=u.getBoundingClientRect(),C=c.clientX-b.left,_=c.clientY-b.top,z=u.offsetWidth,B=u.offsetHeight,f=Math.abs(Math.floor(100/z*C)-100),m=Math.abs(Math.floor(100/B*_)-100),x=50+(f-50)/1.5,g=50+(m-50)/1.5,P=50+(f-50)/7,S=50+(m-50)/7,X=(x-50)/1.5*.2*n.intensity,Y=(g-50)/2*-1*.2*n.intensity,A=50-f+(50-m),j=.5+Math.abs(A)*.008*n.intensity;a.value=`perspective(1200px) rotateX(${Y}deg) rotateY(${X}deg) scale3d(${1+.015*n.intensity}, ${1+.015*n.intensity}, ${1+.015*n.intensity})`,e.value=`${x}% ${g}%`,i.value=`${P}% ${S}%`,y.value=j}function $(){a.value="perspective(1200px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)",e.value="50% 50%",i.value="50% 50%",y.value=.5}return R(()=>{a.value="perspective(1200px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)"}),(c,u)=>(d(),p("div",{ref_key:"cardRef",ref:o,class:"card-hover-effect",style:F({transform:a.value,"--effect-intensity":r.intensity}),onMousemove:w,onMouseleave:$},[D(c.$slots,"default",{},void 0,!0)],36))}}),E=H(W,[["__scopeId","data-v-895421da"]]),L={relative:"",flex:"~ col 1","justify-between":"","gap-3":"","overflow-hidden":"","rounded-lg":"",bg:"white dark:neutral-900","p-5":"",transition:"all ease-in-out duration-400",after:"content-empty absolute inset-0 z--2 w-full h-full bg-dotted-[neutral-200/80] bg-size-10px mask-image-[linear-gradient(165deg,white_30%,transparent_50%)] transition-all duration-400 ease-in-out",hover:"after:bg-dotted-[primary-300/50] dark:after:bg-dotted-[primary-200/20] text-primary-600/80 dark:text-primary-300/80"},O={"z-1":"",flex:"","items-start":"","justify-between":"","gap-2":""},q={"flex-1":"",truncate:"","text-lg":"","font-bold":""},G={key:0,"shrink-0":"","rounded-md":"","p-1":"",bg:"primary-100 dark:primary-900/40",text:"primary-600 dark:primary-400"},J={key:0,"line-clamp-3":"","min-h-40px":"","flex-1":"","text-sm":"",text:"neutral-500 dark:neutral-400"},K={"z-1":"",flex:"","items-center":"","justify-between":"","text-xs":"",text:"neutral-500 dark:neutral-400"},Q={flex:"","items-center":"","gap-1.5":""},T={flex:"","items-center":"","gap-0.5":""},U={flex:"","items-center":"","gap-0.5":""},Z={flex:"","items-center":"","justify-end":"","px-2":"","py-1.5":""},ee=["disabled"],ne=M({__name:"CardListItem",props:{id:null,name:null,description:null,isActive:{type:Boolean},isSelected:{type:Boolean},version:null,consciousnessModel:null,voiceModel:null},emits:["select","activate","delete"],setup(r,{emit:n}){const o=n;return(a,e)=>(d(),I(V(E),{relative:"","min-h-120px":"",flex:"~ col","cursor-pointer":"","overflow-hidden":"","rounded-xl":"",class:h([r.isSelected?"border-2 border-primary-400 dark:border-primary-600":"border-2 border-neutral-100 dark:border-neutral-800/25"]),bg:"neutral-200/50 dark:neutral-800/50","drop-shadow":"none hover:[0px_4px_4px_rgba(220,220,220,0.4)] active:[0px_0px_0px_rgba(220,220,220,0.25)] dark:hover:none",transition:"all ease-in-out duration-400",before:"content-empty absolute inset-0 z-0 w-25% h-full transition-all duration-400 ease-in-out bg-gradient-to-r from-primary-500/0 to-primary-500/0 dark:from-primary-400/0 dark:to-primary-400/0 mask-image-[linear-gradient(120deg,white_100%)] opacity-0",hover:"before:w-50% before:opacity-100 before:bg-gradient-to-r before:from-primary-500/20 before:via-primary-500/10 before:to-transparent before:dark:from-primary-400/20 before:dark:via-primary-400/10 before:dark:to-transparent",onClick:e[2]||(e[2]=i=>o("select"))},{default:N(()=>[t("div",L,[t("div",O,[t("h3",q,l(r.name),1),r.isActive?(d(),p("div",G,e[3]||(e[3]=[t("div",{"i-solar:check-circle-bold-duotone":"","text-sm":""},null,-1)]))):v("",!0)]),r.description?(d(),p("p",J,l(r.description),1)):v("",!0),t("div",K,[t("div",null,"v"+l(r.version),1),t("div",Q,[t("div",T,[e[4]||(e[4]=t("div",{"i-lucide:ghost":"","text-xs":""},null,-1)),t("span",null,l(r.consciousnessModel),1)]),t("div",U,[e[5]||(e[5]=t("div",{"i-lucide:mic":"","text-xs":""},null,-1)),t("span",null,l(r.voiceModel),1)])])])]),t("div",Z,[t("button",{"rounded-lg":"","p-1.5":"","transition-colors":"",hover:"bg-neutral-200 dark:bg-neutral-700/50",disabled:r.isActive,onClick:e[0]||(e[0]=k(i=>o("activate"),["stop"]))},[t("div",{class:h([r.isActive?"i-solar:check-circle-bold-duotone text-primary-500 dark:text-primary-400":"i-solar:play-circle-broken text-neutral-500 dark:text-neutral-400"])},null,2)],8,ee),r.id!=="default"?(d(),p("button",{key:0,"rounded-lg":"","p-1.5":"","transition-colors":"",hover:"bg-neutral-200 dark:bg-neutral-700/50",onClick:e[1]||(e[1]=k(i=>o("delete"),["stop"]))},e[6]||(e[6]=[t("div",{"i-solar:trash-bin-trash-linear":"",text:"neutral-500 dark:neutral-400"},null,-1)]))):v("",!0)])]),_:1},8,["class"]))}});export{ne as _}; +import{d as M,g as s,l as R,c as p,o as d,m as D,n as F,bn as H,x as I,y as N,a as t,C as v,D as l,bM as k,z as h,u as V}from"./index-D55VqdU4.js";import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";const W=M({__name:"CursorFloating",props:{intensity:{default:1.5}},setup(r){const n=r,o=s(null),a=s(""),e=s("50% 50%"),i=s("50% 50%"),y=s(.5);function w(c){if(!o.value)return;const u=o.value,b=u.getBoundingClientRect(),C=c.clientX-b.left,_=c.clientY-b.top,z=u.offsetWidth,B=u.offsetHeight,f=Math.abs(Math.floor(100/z*C)-100),m=Math.abs(Math.floor(100/B*_)-100),x=50+(f-50)/1.5,g=50+(m-50)/1.5,P=50+(f-50)/7,S=50+(m-50)/7,X=(x-50)/1.5*.2*n.intensity,Y=(g-50)/2*-1*.2*n.intensity,A=50-f+(50-m),j=.5+Math.abs(A)*.008*n.intensity;a.value=`perspective(1200px) rotateX(${Y}deg) rotateY(${X}deg) scale3d(${1+.015*n.intensity}, ${1+.015*n.intensity}, ${1+.015*n.intensity})`,e.value=`${x}% ${g}%`,i.value=`${P}% ${S}%`,y.value=j}function $(){a.value="perspective(1200px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)",e.value="50% 50%",i.value="50% 50%",y.value=.5}return R(()=>{a.value="perspective(1200px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)"}),(c,u)=>(d(),p("div",{ref_key:"cardRef",ref:o,class:"card-hover-effect",style:F({transform:a.value,"--effect-intensity":r.intensity}),onMousemove:w,onMouseleave:$},[D(c.$slots,"default",{},void 0,!0)],36))}}),E=H(W,[["__scopeId","data-v-895421da"]]),L={relative:"",flex:"~ col 1","justify-between":"","gap-3":"","overflow-hidden":"","rounded-lg":"",bg:"white dark:neutral-900","p-5":"",transition:"all ease-in-out duration-400",after:"content-empty absolute inset-0 z--2 w-full h-full bg-dotted-[neutral-200/80] bg-size-10px mask-image-[linear-gradient(165deg,white_30%,transparent_50%)] transition-all duration-400 ease-in-out",hover:"after:bg-dotted-[primary-300/50] dark:after:bg-dotted-[primary-200/20] text-primary-600/80 dark:text-primary-300/80"},O={"z-1":"",flex:"","items-start":"","justify-between":"","gap-2":""},q={"flex-1":"",truncate:"","text-lg":"","font-bold":""},G={key:0,"shrink-0":"","rounded-md":"","p-1":"",bg:"primary-100 dark:primary-900/40",text:"primary-600 dark:primary-400"},J={key:0,"line-clamp-3":"","min-h-40px":"","flex-1":"","text-sm":"",text:"neutral-500 dark:neutral-400"},K={"z-1":"",flex:"","items-center":"","justify-between":"","text-xs":"",text:"neutral-500 dark:neutral-400"},Q={flex:"","items-center":"","gap-1.5":""},T={flex:"","items-center":"","gap-0.5":""},U={flex:"","items-center":"","gap-0.5":""},Z={flex:"","items-center":"","justify-end":"","px-2":"","py-1.5":""},ee=["disabled"],ne=M({__name:"CardListItem",props:{id:null,name:null,description:null,isActive:{type:Boolean},isSelected:{type:Boolean},version:null,consciousnessModel:null,voiceModel:null},emits:["select","activate","delete"],setup(r,{emit:n}){const o=n;return(a,e)=>(d(),I(V(E),{relative:"","min-h-120px":"",flex:"~ col","cursor-pointer":"","overflow-hidden":"","rounded-xl":"",class:h([r.isSelected?"border-2 border-primary-400 dark:border-primary-600":"border-2 border-neutral-100 dark:border-neutral-800/25"]),bg:"neutral-200/50 dark:neutral-800/50","drop-shadow":"none hover:[0px_4px_4px_rgba(220,220,220,0.4)] active:[0px_0px_0px_rgba(220,220,220,0.25)] dark:hover:none",transition:"all ease-in-out duration-400",before:"content-empty absolute inset-0 z-0 w-25% h-full transition-all duration-400 ease-in-out bg-gradient-to-r from-primary-500/0 to-primary-500/0 dark:from-primary-400/0 dark:to-primary-400/0 mask-image-[linear-gradient(120deg,white_100%)] opacity-0",hover:"before:w-50% before:opacity-100 before:bg-gradient-to-r before:from-primary-500/20 before:via-primary-500/10 before:to-transparent before:dark:from-primary-400/20 before:dark:via-primary-400/10 before:dark:to-transparent",onClick:e[2]||(e[2]=i=>o("select"))},{default:N(()=>[t("div",L,[t("div",O,[t("h3",q,l(r.name),1),r.isActive?(d(),p("div",G,e[3]||(e[3]=[t("div",{"i-solar:check-circle-bold-duotone":"","text-sm":""},null,-1)]))):v("",!0)]),r.description?(d(),p("p",J,l(r.description),1)):v("",!0),t("div",K,[t("div",null,"v"+l(r.version),1),t("div",Q,[t("div",T,[e[4]||(e[4]=t("div",{"i-lucide:ghost":"","text-xs":""},null,-1)),t("span",null,l(r.consciousnessModel),1)]),t("div",U,[e[5]||(e[5]=t("div",{"i-lucide:mic":"","text-xs":""},null,-1)),t("span",null,l(r.voiceModel),1)])])])]),t("div",Z,[t("button",{"rounded-lg":"","p-1.5":"","transition-colors":"",hover:"bg-neutral-200 dark:bg-neutral-700/50",disabled:r.isActive,onClick:e[0]||(e[0]=k(i=>o("activate"),["stop"]))},[t("div",{class:h([r.isActive?"i-solar:check-circle-bold-duotone text-primary-500 dark:text-primary-400":"i-solar:play-circle-broken text-neutral-500 dark:text-neutral-400"])},null,2)],8,ee),r.id!=="default"?(d(),p("button",{key:0,"rounded-lg":"","p-1.5":"","transition-colors":"",hover:"bg-neutral-200 dark:bg-neutral-700/50",onClick:e[1]||(e[1]=k(i=>o("delete"),["stop"]))},e[6]||(e[6]=[t("div",{"i-solar:trash-bin-trash-linear":"",text:"neutral-500 dark:neutral-400"},null,-1)]))):v("",!0)])]),_:1},8,["class"]))}});export{ne as _}; diff --git a/assets/Collapsable.vue_vue_type_script_setup_true_lang-CWkRm8IH.js b/assets/Collapsable.vue_vue_type_script_setup_true_lang-BDoHyduV.js similarity index 87% rename from assets/Collapsable.vue_vue_type_script_setup_true_lang-CWkRm8IH.js rename to assets/Collapsable.vue_vue_type_script_setup_true_lang-BDoHyduV.js index c958355da25e45bbe1b36d9216655741eaa26cca..895c63a137e7696a89fd83946cb6bd830e83e698 100644 --- a/assets/Collapsable.vue_vue_type_script_setup_true_lang-CWkRm8IH.js +++ b/assets/Collapsable.vue_vue_type_script_setup_true_lang-BDoHyduV.js @@ -1 +1 @@ -import{_ as d}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-BHnSNWo1.js";import{d as p,bI as m,bJ as f,af as b,c,o as v,m as r,b as V,bU as u,bV as y,y as C,C as g,bW as k,a as s,bL as x,D as i}from"./index--eYU5aQm.js";const B={op50:""},w=p({__name:"Collapsable",props:m({default:{type:Boolean},label:null},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=o,e=f(o,"modelValue");b(()=>{t.default!=null&&(e.value=!!t.default)});function n(l){return e.value=l,l}return(l,a)=>(v(),c("div",null,[r(l.$slots,"trigger",u(y({visible:e.value,setVisible:n})),()=>[s("button",{sticky:"","top-0":"","z-10":"",flex:"","items-center":"","justify-between":"",px2:"",py1:"","text-sm":"","backdrop-blur-xl":"",onClick:a[0]||(a[0]=_=>e.value=!e.value)},[s("span",null,i(t.label??"Collapsable"),1),a[1]||(a[1]=x()),s("span",B,i(e.value?"▲":"▼"),1)])]),V(d,null,{default:C(()=>[e.value?r(l.$slots,"default",u(k({key:0},{visible:e.value,setVisible:n}))):g("",!0)]),_:3})]))}});export{w as _}; +import{_ as d}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-BbB31kj-.js";import{d as p,bI as m,bJ as f,af as b,c,o as v,m as r,b as V,bU as u,bV as y,y as C,C as g,bW as k,a as s,bL as x,D as i}from"./index-D55VqdU4.js";const B={op50:""},w=p({__name:"Collapsable",props:m({default:{type:Boolean},label:null},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=o,e=f(o,"modelValue");b(()=>{t.default!=null&&(e.value=!!t.default)});function n(l){return e.value=l,l}return(l,a)=>(v(),c("div",null,[r(l.$slots,"trigger",u(y({visible:e.value,setVisible:n})),()=>[s("button",{sticky:"","top-0":"","z-10":"",flex:"","items-center":"","justify-between":"",px2:"",py1:"","text-sm":"","backdrop-blur-xl":"",onClick:a[0]||(a[0]=_=>e.value=!e.value)},[s("span",null,i(t.label??"Collapsable"),1),a[1]||(a[1]=x()),s("span",B,i(e.value?"▲":"▼"),1)])]),V(d,null,{default:C(()=>[e.value?r(l.$slots,"default",u(k({key:0},{visible:e.value,setVisible:n}))):g("",!0)]),_:3})]))}});export{w as _}; diff --git a/assets/ColorPalette.vue_vue_type_script_setup_true_lang-8aVGVYYF.js b/assets/ColorPalette.vue_vue_type_script_setup_true_lang-Cl6NdKBD.js similarity index 84% rename from assets/ColorPalette.vue_vue_type_script_setup_true_lang-8aVGVYYF.js rename to assets/ColorPalette.vue_vue_type_script_setup_true_lang-Cl6NdKBD.js index 8e43ebc3fe65ac18a860787cc38ab0350a6330b0..a751704e3c7ad30ff3ecf63941a7796e2c5895a7 100644 --- a/assets/ColorPalette.vue_vue_type_script_setup_true_lang-8aVGVYYF.js +++ b/assets/ColorPalette.vue_vue_type_script_setup_true_lang-Cl6NdKBD.js @@ -1 +1 @@ -import{_ as b}from"./Collapsable.vue_vue_type_script_setup_true_lang-CWkRm8IH.js";import{d as c,x as m,o as i,y as l,a as n,z as u,m as y,bL as f,D as g,v as C,c as d,C as k,bx as v,by as x,b as s,u as e,n as h,bS as w}from"./index--eYU5aQm.js";import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{W as S,j as $,q as z,U as B,G as E,H as V}from"./index-CpeQQOdD.js";const F=["onClick"],H={flex:"","gap-1.5":""},q=c({__name:"Section",props:{title:null,icon:null,innerClass:null,expand:{type:Boolean,default:!0}},setup(t){return(r,_)=>(i(),m(b,{default:t.expand},{trigger:l(o=>[n("button",{class:"w-full flex items-center justify-between rounded-lg px-4 py-3 outline-none transition-all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",onClick:a=>o.setVisible(!o.visible)},[n("div",H,[n("div",{class:u(t.icon),"size-6":""},null,2),f(" "+g(t.title),1)]),n("div",{"i-solar:alt-arrow-down-bold-duotone":"",transition:"transform duration-250",class:u({"rotate-180":o.visible})},null,2)],8,F)]),default:l(()=>[n("div",{grid:"","gap-4":"","p-4":"",class:u(t.innerClass)},[y(r.$slots,"default")],2)]),_:3},8,["default"]))}}),L={key:0,flex:"","gap-2":""},G=c({__name:"ColorPalette",props:{colors:null},setup(t){const r=C();return(_,o)=>t.colors.length?(i(),d("div",L,[(i(!0),d(v,null,x(t.colors,({hex:a,name:p})=>(i(),m(e(V),{key:a||"default"},{default:l(()=>[s(e(S),null,{default:l(()=>[s(e($),{transition:"all ease-in-out duration-250","bg-primary-500":"","size-6":"","cursor-pointer":"","rounded-full":"",style:h(a?{background:a}:{"--theme-colors-hue":e(w)}),class:u(e(r).isColorSelectedForPrimary(a)?"scale-150 mx-1":"hover:scale-110"),onClick:N=>e(r).applyPrimaryColorFrom(a)},null,8,["style","class","onClick"]),s(e(z),null,{default:l(()=>[s(e(B),{bg:"white dark:neutral-800","rounded-lg":"","px-3":"","py-1.5":"","text-sm":"","shadow-md":""},{default:l(()=>[f(g(p)+" ",1),s(e(E),{"fill-white":"","dark:fill-neutral-800":""})]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))])):k("",!0)}});export{q as _,G as a}; +import{_ as b}from"./Collapsable.vue_vue_type_script_setup_true_lang-BDoHyduV.js";import{d as c,x as m,o as i,y as l,a as n,z as u,m as y,bL as f,D as g,v as C,c as d,C as k,bx as v,by as x,b as s,u as e,n as h,bS as w}from"./index-D55VqdU4.js";import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{W as S,j as $,q as z,U as B,G as E,H as V}from"./index-fSchh9rJ.js";const F=["onClick"],H={flex:"","gap-1.5":""},q=c({__name:"Section",props:{title:null,icon:null,innerClass:null,expand:{type:Boolean,default:!0}},setup(t){return(r,_)=>(i(),m(b,{default:t.expand},{trigger:l(o=>[n("button",{class:"w-full flex items-center justify-between rounded-lg px-4 py-3 outline-none transition-all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",onClick:a=>o.setVisible(!o.visible)},[n("div",H,[n("div",{class:u(t.icon),"size-6":""},null,2),f(" "+g(t.title),1)]),n("div",{"i-solar:alt-arrow-down-bold-duotone":"",transition:"transform duration-250",class:u({"rotate-180":o.visible})},null,2)],8,F)]),default:l(()=>[n("div",{grid:"","gap-4":"","p-4":"",class:u(t.innerClass)},[y(r.$slots,"default")],2)]),_:3},8,["default"]))}}),L={key:0,flex:"","gap-2":""},G=c({__name:"ColorPalette",props:{colors:null},setup(t){const r=C();return(_,o)=>t.colors.length?(i(),d("div",L,[(i(!0),d(v,null,x(t.colors,({hex:a,name:p})=>(i(),m(e(V),{key:a||"default"},{default:l(()=>[s(e(S),null,{default:l(()=>[s(e($),{transition:"all ease-in-out duration-250","bg-primary-500":"","size-6":"","cursor-pointer":"","rounded-full":"",style:h(a?{background:a}:{"--theme-colors-hue":e(w)}),class:u(e(r).isColorSelectedForPrimary(a)?"scale-150 mx-1":"hover:scale-110"),onClick:N=>e(r).applyPrimaryColorFrom(a)},null,8,["style","class","onClick"]),s(e(z),null,{default:l(()=>[s(e(B),{bg:"white dark:neutral-800","rounded-lg":"","px-3":"","py-1.5":"","text-sm":"","shadow-md":""},{default:l(()=>[f(g(p)+" ",1),s(e(E),{"fill-white":"","dark:fill-neutral-800":""})]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))])):k("",!0)}});export{q as _,G as a}; diff --git a/assets/DeleteCardDialog-ByKUc8bN.js b/assets/DeleteCardDialog-ByKUc8bN.js deleted file mode 100644 index 1eea4094567a6f941784653da45b09d814d50eab..0000000000000000000000000000000000000000 --- a/assets/DeleteCardDialog-ByKUc8bN.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as o}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-R-YdRLSq.js";import"./index--eYU5aQm.js";import"./index-CpeQQOdD.js";export{o as default}; diff --git a/assets/DeleteCardDialog-C-dXtHQF.js b/assets/DeleteCardDialog-C-dXtHQF.js new file mode 100644 index 0000000000000000000000000000000000000000..1777cd03f820d3c6bc54595992e71ae5bfb24ae8 --- /dev/null +++ b/assets/DeleteCardDialog-C-dXtHQF.js @@ -0,0 +1 @@ +import{_ as o}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-DE2XAzMf.js";import"./index-D55VqdU4.js";import"./index-fSchh9rJ.js";export{o as default}; diff --git a/assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-R-YdRLSq.js b/assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-DE2XAzMf.js similarity index 93% rename from assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-R-YdRLSq.js rename to assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-DE2XAzMf.js index e2abe5ce9cf9ba4c2ce2d422dac8fb46fce4a952..d02cfd53581e9e1c05757ffab33218b093f55b23 100644 --- a/assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-R-YdRLSq.js +++ b/assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-DE2XAzMf.js @@ -1 +1 @@ -import{d as v,h as p,c as r,o as d,z as g,a as m,C as h,m as _,D as i,q as w,x as C,y as n,b as t,u as e,bL as x}from"./index--eYU5aQm.js";import{A as V,k as B,O as N,V as z,F as D,M as O,N as S,T}from"./index-CpeQQOdD.js";const $=["disabled"],j={class:"flex flex-row items-center justify-center gap-2"},A={key:0,class:"i-lucide:loader-circle animate-spin"},F={key:2},y=v({__name:"Button",props:{icon:null,label:null,disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},variant:{default:"primary"},size:{default:"md"},block:{type:Boolean,default:!1}},setup(a){const s=a,l=p(()=>s.disabled||s.loading),o={primary:"bg-primary-500 hover:bg-primary-600 dark:bg-primary-400 dark:hover:bg-primary-500 text-white",secondary:"bg-neutral-100 hover:bg-neutral-200 dark:bg-neutral-600 dark:hover:bg-neutral-500 text-neutral-900 dark:text-neutral-100",danger:"bg-red-500 hover:bg-red-600 dark:bg-red-400 dark:hover:bg-red-500 text-white"},c={sm:"px-3 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base"},u=p(()=>["rounded-lg font-medium outline-none transition-all duration-200 ease-in-out","disabled:cursor-not-allowed disabled:opacity-50",s.block?"w-full":"",c[s.size],o[s.variant],{"opacity-50 cursor-not-allowed":l.value},"focus:ring-2 focus:ring-offset-2 focus:ring-offset-white dark:focus:ring-offset-neutral-900","focus:ring-primary-500/50 dark:focus:ring-primary-400/50"]);return(b,f)=>(d(),r("button",{disabled:l.value,class:g(u.value)},[m("div",j,[a.loading?(d(),r("div",A)):a.icon?(d(),r("div",{key:1,class:g(a.icon)},null,2)):h("",!0),a.label?(d(),r("span",F,i(a.label),1)):_(b.$slots,"default",{key:3})])],10,$))}}),I={class:"flex flex-row justify-end gap-3"},E=v({__name:"DeleteCardDialog",props:{modelValue:{type:Boolean},cardName:null},emits:["update:modelValue","confirm","cancel"],setup(a,{emit:s}){const l=s,{t:o}=w();function c(){l("update:modelValue",!1),l("cancel")}function u(){l("update:modelValue",!1),l("confirm")}return(b,f)=>(d(),C(e(T),{open:a.modelValue,"onUpdate:open":f[0]||(f[0]=k=>l("update:modelValue",k))},{default:n(()=>[t(e(V),null,{default:n(()=>[t(e(B),{class:"data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-50 bg-black/50"}),t(e(N),{class:"data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-50 max-w-md w-full border border-neutral-200 rounded-xl bg-white p-6 shadow-xl -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800"},{default:n(()=>[t(e(z),{class:"mb-4 text-xl font-bold"},{default:n(()=>[x(i(e(o)("settings.pages.card.delete_card")),1)]),_:1}),t(e(D),{class:"mb-6"},{default:n(()=>[x(i(e(o)("settings.pages.card.delete_confirmation"))+" ",1),m("b",null,'"'+i(a.cardName||"")+'"',1)]),_:1}),m("div",I,[t(e(O),{"as-child":""},{default:n(()=>[t(e(y),{variant:"secondary",label:e(o)("settings.pages.card.cancel"),onClick:c},null,8,["label"])]),_:1}),t(e(S),{"as-child":""},{default:n(()=>[t(e(y),{variant:"danger",label:e(o)("settings.pages.card.delete"),onClick:u},null,8,["label"])]),_:1})])]),_:1})]),_:1})]),_:1},8,["open"]))}});export{E as _,y as a}; +import{d as v,h as p,c as r,o as d,z as g,a as m,C as h,m as _,D as i,q as w,x as C,y as n,b as t,u as e,bL as x}from"./index-D55VqdU4.js";import{A as V,k as B,O as N,V as z,F as D,M as O,N as S,T}from"./index-fSchh9rJ.js";const $=["disabled"],j={class:"flex flex-row items-center justify-center gap-2"},A={key:0,class:"i-lucide:loader-circle animate-spin"},F={key:2},y=v({__name:"Button",props:{icon:null,label:null,disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},variant:{default:"primary"},size:{default:"md"},block:{type:Boolean,default:!1}},setup(a){const s=a,l=p(()=>s.disabled||s.loading),o={primary:"bg-primary-500 hover:bg-primary-600 dark:bg-primary-400 dark:hover:bg-primary-500 text-white",secondary:"bg-neutral-100 hover:bg-neutral-200 dark:bg-neutral-600 dark:hover:bg-neutral-500 text-neutral-900 dark:text-neutral-100",danger:"bg-red-500 hover:bg-red-600 dark:bg-red-400 dark:hover:bg-red-500 text-white"},c={sm:"px-3 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base"},u=p(()=>["rounded-lg font-medium outline-none transition-all duration-200 ease-in-out","disabled:cursor-not-allowed disabled:opacity-50",s.block?"w-full":"",c[s.size],o[s.variant],{"opacity-50 cursor-not-allowed":l.value},"focus:ring-2 focus:ring-offset-2 focus:ring-offset-white dark:focus:ring-offset-neutral-900","focus:ring-primary-500/50 dark:focus:ring-primary-400/50"]);return(b,f)=>(d(),r("button",{disabled:l.value,class:g(u.value)},[m("div",j,[a.loading?(d(),r("div",A)):a.icon?(d(),r("div",{key:1,class:g(a.icon)},null,2)):h("",!0),a.label?(d(),r("span",F,i(a.label),1)):_(b.$slots,"default",{key:3})])],10,$))}}),I={class:"flex flex-row justify-end gap-3"},E=v({__name:"DeleteCardDialog",props:{modelValue:{type:Boolean},cardName:null},emits:["update:modelValue","confirm","cancel"],setup(a,{emit:s}){const l=s,{t:o}=w();function c(){l("update:modelValue",!1),l("cancel")}function u(){l("update:modelValue",!1),l("confirm")}return(b,f)=>(d(),C(e(T),{open:a.modelValue,"onUpdate:open":f[0]||(f[0]=k=>l("update:modelValue",k))},{default:n(()=>[t(e(V),null,{default:n(()=>[t(e(B),{class:"data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-50 bg-black/50"}),t(e(N),{class:"data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-50 max-w-md w-full border border-neutral-200 rounded-xl bg-white p-6 shadow-xl -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800"},{default:n(()=>[t(e(z),{class:"mb-4 text-xl font-bold"},{default:n(()=>[x(i(e(o)("settings.pages.card.delete_card")),1)]),_:1}),t(e(D),{class:"mb-6"},{default:n(()=>[x(i(e(o)("settings.pages.card.delete_confirmation"))+" ",1),m("b",null,'"'+i(a.cardName||"")+'"',1)]),_:1}),m("div",I,[t(e(O),{"as-child":""},{default:n(()=>[t(e(y),{variant:"secondary",label:e(o)("settings.pages.card.cancel"),onClick:c},null,8,["label"])]),_:1}),t(e(S),{"as-child":""},{default:n(()=>[t(e(y),{variant:"danger",label:e(o)("settings.pages.card.delete"),onClick:u},null,8,["label"])]),_:1})])]),_:1})]),_:1})]),_:1},8,["open"]))}});export{E as _,y as a}; diff --git a/assets/FieldInput.vue_vue_type_script_setup_true_lang-CriF7G5j.js b/assets/FieldInput.vue_vue_type_script_setup_true_lang-DQP2RhYC.js similarity index 81% rename from assets/FieldInput.vue_vue_type_script_setup_true_lang-CriF7G5j.js rename to assets/FieldInput.vue_vue_type_script_setup_true_lang-DQP2RhYC.js index 189b0d1aa329889b401ba09f00fd4152a0d3ada7..9bdfc6968a1568e925f94c2c04236eeb0fe37be4 100644 --- a/assets/FieldInput.vue_vue_type_script_setup_true_lang-CriF7G5j.js +++ b/assets/FieldInput.vue_vue_type_script_setup_true_lang-DQP2RhYC.js @@ -1 +1 @@ -import{_ as u}from"./Input.vue_vue_type_script_setup_true_lang-DaL4uFR_.js";import{d as i,bI as c,bJ as p,c as o,o as d,a as l,b as m,bL as _,C as x,D as n,z as f}from"./index--eYU5aQm.js";const V={"max-w-full":""},h={flex:"~ col gap-4"},b={class:"flex items-center gap-1 text-sm font-medium"},y={key:0,class:"text-red-500"},v={class:"text-xs text-neutral-500 dark:text-neutral-400","text-nowrap":""},B=i({__name:"FieldInput",props:c({label:null,description:null,placeholder:null,required:{type:Boolean},type:null,inputClass:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,a=p(t,"modelValue");return(C,s)=>(d(),o("div",V,[l("label",h,[l("div",null,[l("div",b,[_(n(e.label)+" ",1),e.required!==!1?(d(),o("span",y,"*")):x("",!0)]),l("div",v,n(e.description),1)]),m(u,{modelValue:a.value,"onUpdate:modelValue":s[0]||(s[0]=r=>a.value=r),type:e.type,placeholder:e.placeholder,class:f(e.inputClass)},null,8,["modelValue","type","placeholder","class"])])]))}});export{B as _}; +import{_ as u}from"./Input.vue_vue_type_script_setup_true_lang-CeU0PE9S.js";import{d as i,bI as c,bJ as p,c as o,o as d,a as l,b as m,bL as _,C as x,D as n,z as f}from"./index-D55VqdU4.js";const V={"max-w-full":""},h={flex:"~ col gap-4"},b={class:"flex items-center gap-1 text-sm font-medium"},y={key:0,class:"text-red-500"},v={class:"text-xs text-neutral-500 dark:text-neutral-400","text-nowrap":""},B=i({__name:"FieldInput",props:c({label:null,description:null,placeholder:null,required:{type:Boolean},type:null,inputClass:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,a=p(t,"modelValue");return(C,s)=>(d(),o("div",V,[l("label",h,[l("div",null,[l("div",b,[_(n(e.label)+" ",1),e.required!==!1?(d(),o("span",y,"*")):x("",!0)]),l("div",v,n(e.description),1)]),m(u,{modelValue:a.value,"onUpdate:modelValue":s[0]||(s[0]=r=>a.value=r),type:e.type,placeholder:e.placeholder,class:f(e.inputClass)},null,8,["modelValue","type","placeholder","class"])])]))}});export{B as _}; diff --git a/assets/FieldRange.vue_vue_type_script_setup_true_lang-DcZafZ9u.js b/assets/FieldRange.vue_vue_type_script_setup_true_lang-CtbCdbG8.js similarity index 91% rename from assets/FieldRange.vue_vue_type_script_setup_true_lang-DcZafZ9u.js rename to assets/FieldRange.vue_vue_type_script_setup_true_lang-CtbCdbG8.js index 21492cd468a07e92f9028af8894bc2e662b7b86a..1cbc5fd6d55125e9c5e2abe4afb036b930d348ce 100644 --- a/assets/FieldRange.vue_vue_type_script_setup_true_lang-DcZafZ9u.js +++ b/assets/FieldRange.vue_vue_type_script_setup_true_lang-CtbCdbG8.js @@ -1 +1 @@ -import{d as v,bI as x,bJ as g,h as r,g as y,l as b,A as M,bE as h,o as V,c as _,bn as k,a as o,D as i,b as C}from"./index--eYU5aQm.js";import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";const R=["min","max","step"],w=v({__name:"Range",props:x({min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1},thumbColor:{default:"#9090906e"},trackColor:{default:"gray"},trackValueColor:{default:"red"}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const a=t,l=g(t,"modelValue"),m=r(()=>a.min*1e4),s=r(()=>a.max*1e4),n=r(()=>a.step*1e4),e=y(),c=r({get:()=>l.value*1e4,set:p=>{l.value=p/1e4,f()}});b(()=>{f()});function f(){e.value&&(e.value.style.setProperty("--value",e.value.value),e.value.style.setProperty("--min",e.value.min?e.value.min:a.min.toString()),e.value.style.setProperty("--max",e.value.max?e.value.max:a.max.toString()))}return(p,u)=>M((V(),_("input",{ref_key:"sliderRef",ref:e,"onUpdate:modelValue":u[0]||(u[0]=d=>c.value=d),type:"range",min:m.value,max:s.value,step:n.value,class:"slider-progress form_input-range",onInput:u[1]||(u[1]=d=>{d.target.style.setProperty("--value",d.target.value)})},null,40,R)),[[h,c.value,void 0,{number:!0}]])}}),B=k(w,[["__scopeId","data-v-6ca6d31c"]]),P={flex:"~ col gap-4"},S={flex:"~ row","items-center":"","gap-2":""},D={flex:"1"},I={class:"flex items-center gap-1 text-sm font-medium"},q={class:"text-xs text-neutral-500 dark:text-neutral-400"},E={"font-mono":""},F={flex:"~ row","items-center":"","gap-2":""},U=v({__name:"FieldRange",props:x({min:null,max:null,step:null,label:null,description:null,formatValue:{type:Function}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const a=t,l=g(t,"modelValue");return(m,s)=>{var n;return V(),_("label",P,[o("div",S,[o("div",D,[o("div",I,i(t.label),1),o("div",q,i(t.description),1)]),o("span",E,i(((n=a.formatValue)==null?void 0:n.call(a,l.value))||l.value),1)]),o("div",F,[C(B,{modelValue:l.value,"onUpdate:modelValue":s[0]||(s[0]=e=>l.value=e),min:t.min||0,max:t.max||1,step:t.step||.01,"w-full":""},null,8,["modelValue","min","max","step"])])])}}});export{U as _}; +import{d as v,bI as x,bJ as g,h as r,g as y,l as b,A as M,bE as h,o as V,c as _,bn as k,a as o,D as i,b as C}from"./index-D55VqdU4.js";import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";const R=["min","max","step"],w=v({__name:"Range",props:x({min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1},thumbColor:{default:"#9090906e"},trackColor:{default:"gray"},trackValueColor:{default:"red"}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const a=t,l=g(t,"modelValue"),m=r(()=>a.min*1e4),s=r(()=>a.max*1e4),n=r(()=>a.step*1e4),e=y(),c=r({get:()=>l.value*1e4,set:p=>{l.value=p/1e4,f()}});b(()=>{f()});function f(){e.value&&(e.value.style.setProperty("--value",e.value.value),e.value.style.setProperty("--min",e.value.min?e.value.min:a.min.toString()),e.value.style.setProperty("--max",e.value.max?e.value.max:a.max.toString()))}return(p,u)=>M((V(),_("input",{ref_key:"sliderRef",ref:e,"onUpdate:modelValue":u[0]||(u[0]=d=>c.value=d),type:"range",min:m.value,max:s.value,step:n.value,class:"slider-progress form_input-range",onInput:u[1]||(u[1]=d=>{d.target.style.setProperty("--value",d.target.value)})},null,40,R)),[[h,c.value,void 0,{number:!0}]])}}),B=k(w,[["__scopeId","data-v-6ca6d31c"]]),P={flex:"~ col gap-4"},S={flex:"~ row","items-center":"","gap-2":""},D={flex:"1"},I={class:"flex items-center gap-1 text-sm font-medium"},q={class:"text-xs text-neutral-500 dark:text-neutral-400"},E={"font-mono":""},F={flex:"~ row","items-center":"","gap-2":""},U=v({__name:"FieldRange",props:x({min:null,max:null,step:null,label:null,description:null,formatValue:{type:Function}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const a=t,l=g(t,"modelValue");return(m,s)=>{var n;return V(),_("label",P,[o("div",S,[o("div",D,[o("div",I,i(t.label),1),o("div",q,i(t.description),1)]),o("span",E,i(((n=a.formatValue)==null?void 0:n.call(a,l.value))||l.value),1)]),o("div",F,[C(B,{modelValue:l.value,"onUpdate:modelValue":s[0]||(s[0]=e=>l.value=e),min:t.min||0,max:t.max||1,step:t.step||.01,"w-full":""},null,8,["modelValue","min","max","step"])])])}}});export{U as _}; diff --git a/assets/HeaderLink-BXS05cIQ.js b/assets/HeaderLink-Dfy3ZEHa.js similarity index 90% rename from assets/HeaderLink-BXS05cIQ.js rename to assets/HeaderLink-Dfy3ZEHa.js index 7f12132237e30e50bca7b4bc52ed73fddc6aeac6..6edae8720cadbf521b56b367a2013c0b016d17d0 100644 --- a/assets/HeaderLink-BXS05cIQ.js +++ b/assets/HeaderLink-Dfy3ZEHa.js @@ -1 +1 @@ -import{d as r,bC as c,x as l,u as e,bo as d,o as s,y as _,c as t,a,bn as i}from"./index--eYU5aQm.js";const k="/assets/logo-dark-CO0kwKsz.svg",p="/assets/logo-D6zeZTFl.svg",u=["src"],m=["src"],x=r({__name:"HeaderLink",setup(g){const n=c();return(f,o)=>(s(),l(e(d),{to:"/",flex:"~","items-center":"","gap-2":"","px-2":"","text-nowrap":"","text-2xl":"","outline-none":""},{default:_(()=>[e(n)?(s(),t("img",{key:0,src:e(k),"h-8":"","w-8":"",class:"theme-colored"},null,8,u)):(s(),t("img",{key:1,src:e(p),"h-8":"","w-8":"",class:"theme-colored"},null,8,m)),o[0]||(o[0]=a("div",{"font-cute":""},[a("span",null,"アイリ")],-1))]),_:1}))}}),w=i(x,[["__scopeId","data-v-496b6cde"]]);export{w as H}; +import{d as r,bC as c,x as l,u as e,bo as d,o as s,y as _,c as t,a,bn as i}from"./index-D55VqdU4.js";const k="/assets/logo-dark-CO0kwKsz.svg",p="/assets/logo-D6zeZTFl.svg",u=["src"],m=["src"],x=r({__name:"HeaderLink",setup(g){const n=c();return(f,o)=>(s(),l(e(d),{to:"/",flex:"~","items-center":"","gap-2":"","px-2":"","text-nowrap":"","text-2xl":"","outline-none":""},{default:_(()=>[e(n)?(s(),t("img",{key:0,src:e(k),"h-8":"","w-8":"",class:"theme-colored"},null,8,u)):(s(),t("img",{key:1,src:e(p),"h-8":"","w-8":"",class:"theme-colored"},null,8,m)),o[0]||(o[0]=a("div",{"font-cute":""},[a("span",null,"アイリ")],-1))]),_:1}))}}),w=i(x,[["__scopeId","data-v-496b6cde"]]);export{w as H}; diff --git a/assets/IconAnimation.vue_vue_type_script_setup_true_lang-BkJuuWL8.js b/assets/IconAnimation.vue_vue_type_script_setup_true_lang-BpdSb0ho.js similarity index 95% rename from assets/IconAnimation.vue_vue_type_script_setup_true_lang-BkJuuWL8.js rename to assets/IconAnimation.vue_vue_type_script_setup_true_lang-BpdSb0ho.js index 6ce269d9c27334500168d58de7bb30490d0ba6e9..fc930f4da0fb6e0dbc5f6bb926e45dc9341398ee 100644 --- a/assets/IconAnimation.vue_vue_type_script_setup_true_lang-BkJuuWL8.js +++ b/assets/IconAnimation.vue_vue_type_script_setup_true_lang-BpdSb0ho.js @@ -1 +1 @@ -import{d as m,g as s,w as p,h,c as f,o as x,n as l,a as u,z as y}from"./index--eYU5aQm.js";const C=m({__name:"IconAnimation",props:{icon:null,iconSize:null,position:null,duration:null,started:{type:Boolean},textColor:null,isReverse:{type:Boolean},zIndex:null},emits:["animationEnded"],setup(a,{emit:d}){const e=a,c=d,n=s(!1);p(()=>e.started,o=>{o&&requestAnimationFrame(()=>{n.value=!0})});const t=h(()=>({opacity:n.value!==e.isReverse?1:0,size:n.value!==e.isReverse?25:e.iconSize,position:n.value!==e.isReverse?"calc(50dvw - 12.5rem), calc(50dvh - 12.5rem)":e.position,textColor:n.value!==e.isReverse?"text-white":e.textColor})),i=s([]),r=s(!1);function v(o){i.value.push(o.propertyName),i.value.includes("color")&&i.value.includes("width")&&i.value.includes("height")&&i.value.includes("transform")&&(r.value=!0,c("animationEnded"))}return(o,z)=>(x(),f("div",{"pointer-events-none":"",fixed:"",w:"100dvw",h:"100dvh",style:l({zIndex:r.value?a.zIndex:void 0})},[u("div",{"bg-primary-500":"",fixed:"","inset-0":"","transition-opacity":"","ease-linear":"",style:l({opacity:t.value.opacity,transitionDuration:`${a.duration}ms`})},null,4),u("div",{fixed:"","inset-0":"","ease-in-out":"",style:l({width:`${t.value.size}rem`,height:`${t.value.size}rem`,transform:`translate(${t.value.position})`,transitionDuration:`${a.duration}ms`}),class:y([t.value.textColor,e.icon,{"transition-all":n.value}]),onTransitionend:v},null,38)],4))}});export{C as _}; +import{d as m,g as s,w as p,h,c as f,o as x,n as l,a as u,z as y}from"./index-D55VqdU4.js";const C=m({__name:"IconAnimation",props:{icon:null,iconSize:null,position:null,duration:null,started:{type:Boolean},textColor:null,isReverse:{type:Boolean},zIndex:null},emits:["animationEnded"],setup(a,{emit:d}){const e=a,c=d,n=s(!1);p(()=>e.started,o=>{o&&requestAnimationFrame(()=>{n.value=!0})});const t=h(()=>({opacity:n.value!==e.isReverse?1:0,size:n.value!==e.isReverse?25:e.iconSize,position:n.value!==e.isReverse?"calc(50dvw - 12.5rem), calc(50dvh - 12.5rem)":e.position,textColor:n.value!==e.isReverse?"text-white":e.textColor})),i=s([]),r=s(!1);function v(o){i.value.push(o.propertyName),i.value.includes("color")&&i.value.includes("width")&&i.value.includes("height")&&i.value.includes("transform")&&(r.value=!0,c("animationEnded"))}return(o,z)=>(x(),f("div",{"pointer-events-none":"",fixed:"",w:"100dvw",h:"100dvh",style:l({zIndex:r.value?a.zIndex:void 0})},[u("div",{"bg-primary-500":"",fixed:"","inset-0":"","transition-opacity":"","ease-linear":"",style:l({opacity:t.value.opacity,transitionDuration:`${a.duration}ms`})},null,4),u("div",{fixed:"","inset-0":"","ease-in-out":"",style:l({width:`${t.value.size}rem`,height:`${t.value.size}rem`,transform:`translate(${t.value.position})`,transitionDuration:`${a.duration}ms`}),class:y([t.value.textColor,e.icon,{"transition-all":n.value}]),onTransitionend:v},null,38)],4))}});export{C as _}; diff --git a/assets/IconStatusItem-rr4-xndX.js b/assets/IconStatusItem-DwLpS4EY.js similarity index 94% rename from assets/IconStatusItem-rr4-xndX.js rename to assets/IconStatusItem-DwLpS4EY.js index b67db8663364f940d2486458fb82608fd2613cfe..169c937f4770cd5fa27df0223eef6bb7d70071a3 100644 --- a/assets/IconStatusItem-rr4-xndX.js +++ b/assets/IconStatusItem-DwLpS4EY.js @@ -1 +1 @@ -import{d as u,r as c,c as e,o as n,b as d,a as o,y as m,C as a,D as i,z as s,bn as _}from"./index--eYU5aQm.js";import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";const p={flex:"~ col",bg:"neutral-50 dark:neutral-800",border:"neutral-100 dark:neutral-800/25 hover:primary-500/30 dark:hover:primary-400/30 solid 2","drop-shadow":"none hover:[0px_4px_4px_rgba(220,220,220,0.4)] active:[0px_0px_0px_rgba(220,220,220,0.25)] dark:hover:none",class:"menu-icon-status-item",transition:"all ease-in-out duration-400","w-full":"","cursor-pointer":"","of-hidden":"","rounded-xl":""},g={"z-1":"","flex-1":""},h={"text-lg":"","font-bold":"",class:"menu-icon-status-item-title",transition:"all ease-in-out duration-400"},k={text:"sm neutral-500 dark:neutral-400",class:"menu-icon-status-item-description",transition:"all ease-in-out duration-400"},f=["src"],x={"p-2":""},v={key:0,"size-3":"",bg:"green-500 dark:green-600","rounded-full":""},y={key:1,"size-3":"",bg:"neutral-400 dark:neutral-500","rounded-full":""},b=u({__name:"IconStatusItem",props:{title:null,description:null,icon:null,iconColor:null,iconImage:null,to:null,configured:{type:Boolean}},setup(r){const t=r;return(C,I)=>{const l=c("RouterLink");return n(),e("div",p,[d(l,{flex:"~ row",class:"menu-icon-status-item-link",bg:"white dark:neutral-900",transition:"all ease-in-out duration-400",relative:"","h-full":"","w-full":"","items-center":"","overflow-hidden":"","rounded-lg":"","p-5":"","text-left":"",to:t.to},{default:m(()=>[o("div",g,[o("div",h,i(t.title),1),o("div",k,[o("span",null,i(t.description),1)])]),t.icon?(n(),e("div",{key:0,class:s(["menu-icon-status-item-icon",[t.icon]]),transition:"all ease-in-out duration-400",absolute:"","right-0":"","size-16":"","translate-y-2":"",text:"neutral-400/50 dark:neutral-600/50","grayscale-100":""},null,2)):a("",!0),t.iconColor?(n(),e("div",{key:1,class:s(["menu-icon-status-item-icon-color",[t.iconColor]]),transition:"all ease-in-out duration-400",absolute:"","right-0":"","size-16":"","translate-y-2":"",text:"neutral-400/50 dark:neutral-600/50","grayscale-100":""},null,2)):a("",!0),t.iconImage?(n(),e("img",{key:2,src:t.iconImage,class:"menu-icon-status-item-icon-image",transition:"all ease-in-out duration-400",absolute:"","right-0":"","size-16":"","translate-y-2":"","grayscale-100":""},null,8,f)):a("",!0)]),_:1},8,["to"]),o("div",x,[t.configured?(n(),e("div",v)):(n(),e("div",y))])])}}}),B=_(b,[["__scopeId","data-v-6e5b5c9c"]]);export{B as I}; +import{d as u,r as c,c as e,o as n,b as d,a as o,y as m,C as a,D as i,z as s,bn as _}from"./index-D55VqdU4.js";import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";const p={flex:"~ col",bg:"neutral-50 dark:neutral-800",border:"neutral-100 dark:neutral-800/25 hover:primary-500/30 dark:hover:primary-400/30 solid 2","drop-shadow":"none hover:[0px_4px_4px_rgba(220,220,220,0.4)] active:[0px_0px_0px_rgba(220,220,220,0.25)] dark:hover:none",class:"menu-icon-status-item",transition:"all ease-in-out duration-400","w-full":"","cursor-pointer":"","of-hidden":"","rounded-xl":""},g={"z-1":"","flex-1":""},h={"text-lg":"","font-bold":"",class:"menu-icon-status-item-title",transition:"all ease-in-out duration-400"},k={text:"sm neutral-500 dark:neutral-400",class:"menu-icon-status-item-description",transition:"all ease-in-out duration-400"},f=["src"],x={"p-2":""},v={key:0,"size-3":"",bg:"green-500 dark:green-600","rounded-full":""},y={key:1,"size-3":"",bg:"neutral-400 dark:neutral-500","rounded-full":""},b=u({__name:"IconStatusItem",props:{title:null,description:null,icon:null,iconColor:null,iconImage:null,to:null,configured:{type:Boolean}},setup(r){const t=r;return(C,I)=>{const l=c("RouterLink");return n(),e("div",p,[d(l,{flex:"~ row",class:"menu-icon-status-item-link",bg:"white dark:neutral-900",transition:"all ease-in-out duration-400",relative:"","h-full":"","w-full":"","items-center":"","overflow-hidden":"","rounded-lg":"","p-5":"","text-left":"",to:t.to},{default:m(()=>[o("div",g,[o("div",h,i(t.title),1),o("div",k,[o("span",null,i(t.description),1)])]),t.icon?(n(),e("div",{key:0,class:s(["menu-icon-status-item-icon",[t.icon]]),transition:"all ease-in-out duration-400",absolute:"","right-0":"","size-16":"","translate-y-2":"",text:"neutral-400/50 dark:neutral-600/50","grayscale-100":""},null,2)):a("",!0),t.iconColor?(n(),e("div",{key:1,class:s(["menu-icon-status-item-icon-color",[t.iconColor]]),transition:"all ease-in-out duration-400",absolute:"","right-0":"","size-16":"","translate-y-2":"",text:"neutral-400/50 dark:neutral-600/50","grayscale-100":""},null,2)):a("",!0),t.iconImage?(n(),e("img",{key:2,src:t.iconImage,class:"menu-icon-status-item-icon-image",transition:"all ease-in-out duration-400",absolute:"","right-0":"","size-16":"","translate-y-2":"","grayscale-100":""},null,8,f)):a("",!0)]),_:1},8,["to"]),o("div",x,[t.configured?(n(),e("div",v)):(n(),e("div",y))])])}}}),B=_(b,[["__scopeId","data-v-6e5b5c9c"]]);export{B as I}; diff --git a/assets/Input.vue_vue_type_script_setup_true_lang-DaL4uFR_.js b/assets/Input.vue_vue_type_script_setup_true_lang-CeU0PE9S.js similarity index 91% rename from assets/Input.vue_vue_type_script_setup_true_lang-DaL4uFR_.js rename to assets/Input.vue_vue_type_script_setup_true_lang-CeU0PE9S.js index c88b594b39d7045281f23798581f5fedc1e03abf..3c7fe565ae8528e63c15a600848e4ccfd3ff8a38 100644 --- a/assets/Input.vue_vue_type_script_setup_true_lang-DaL4uFR_.js +++ b/assets/Input.vue_vue_type_script_setup_true_lang-CeU0PE9S.js @@ -1 +1 @@ -import{d as r,bI as n,bJ as u,A as s,co as d,o as i,c as p}from"./index--eYU5aQm.js";const m=["type"],y=r({__name:"Input",props:n({type:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const o=e,t=u(e,"modelValue");return(c,a)=>s((i(),p("input",{"onUpdate:modelValue":a[0]||(a[0]=l=>t.value=l),type:o.type||"text",border:"focus:primary-300 dark:focus:primary-400/50 2 solid neutral-100 dark:neutral-900",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-50 dark:neutral-950 focus:neutral-50 dark:focus:neutral-900"},null,8,m)),[[d,t.value]])}});export{y as _}; +import{d as r,bI as n,bJ as u,A as s,co as d,o as i,c as p}from"./index-D55VqdU4.js";const m=["type"],y=r({__name:"Input",props:n({type:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const o=e,t=u(e,"modelValue");return(c,a)=>s((i(),p("input",{"onUpdate:modelValue":a[0]||(a[0]=l=>t.value=l),type:o.type||"text",border:"focus:primary-300 dark:focus:primary-400/50 2 solid neutral-100 dark:neutral-900",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-50 dark:neutral-950 focus:neutral-50 dark:focus:neutral-900"},null,8,m)),[[d,t.value]])}});export{y as _}; diff --git a/assets/InputFile.vue_vue_type_script_setup_true_lang-DSuLZiGY.js b/assets/InputFile.vue_vue_type_script_setup_true_lang-CR9cbe_p.js similarity index 96% rename from assets/InputFile.vue_vue_type_script_setup_true_lang-DSuLZiGY.js rename to assets/InputFile.vue_vue_type_script_setup_true_lang-CR9cbe_p.js index 9e6302ae56ba160c1232551ae4a573d95f6c7f5d..02ec0e8468c0b9438398f507edc9a4879684ae42 100644 --- a/assets/InputFile.vue_vue_type_script_setup_true_lang-DSuLZiGY.js +++ b/assets/InputFile.vue_vue_type_script_setup_true_lang-CR9cbe_p.js @@ -1 +1 @@ -import{d as g,bI as b,bJ as v,g as p,bK as y,c as i,o as n,z as m,u as t,a as l,m as x}from"./index--eYU5aQm.js";const k=["accept","multiple"],h={key:0,text:"center","text-sm":""},D={key:1,text:"center","text-sm":""},C=g({__name:"InputFile",props:b({accept:null,multiple:{type:Boolean}},{modelValue:{required:!1,default:()=>[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const d=v(o,"modelValue"),u=p(),a=p(!1),r=y(a,150);function f(s){const e=s.target;e.files&&e.files.length>0&&(u.value=e.files[0]),d.value=Array.from(e.files||[]),a.value=!1}return(s,e)=>(n(),i("label",{relative:"",class:m(["min-h-[120px] flex flex-col cursor-pointer items-center justify-center rounded-xl p-6",[t(r)?"border-primary-400 dark:border-primary-600 hover:border-primary-300 dark:hover:border-primary-700":"border-neutral-200 dark:border-neutral-700 hover:border-primary-300 dark:hover:border-primary-700",t(r)?"bg-primary-50/5 dark:bg-primary-900/5":"bg-white/60 dark:bg-black/30 hover:bg-white/80 dark:hover:bg-black/40"]]),border:"dashed 2",transition:"all duration-300","cursor-pointer":"","opacity-95":"",hover:"scale-100 opacity-100 shadow-md dark:shadow-lg",onDragover:e[0]||(e[0]=c=>a.value=!0),onDragleave:e[1]||(e[1]=c=>a.value=!1)},[l("input",{type:"file",accept:o.accept,multiple:o.multiple,"cursor-pointer":"",class:"absolute inset-0 h-full w-full opacity-0",onChange:f},null,40,k),x(s.$slots,"default",{isDragging:t(r),firstFile:u.value,files:d.value},()=>[l("div",{class:m(["flex flex-col items-center",[t(r)?"text-primary-500 dark:text-primary-400":"text-neutral-400 dark:text-neutral-500"]])},[e[2]||(e[2]=l("div",{"i-solar:upload-square-line-duotone":"","mb-2":"","text-5xl":""},null,-1)),e[3]||(e[3]=l("p",{"font-medium":"",text:"center lg"}," Upload ",-1)),t(r)?(n(),i("p",h," Release to upload ")):(n(),i("p",D," Click or drag and drop a file here "))],2)])],34))}});export{C as _}; +import{d as g,bI as b,bJ as v,g as p,bK as y,c as i,o as n,z as m,u as t,a as l,m as x}from"./index-D55VqdU4.js";const k=["accept","multiple"],h={key:0,text:"center","text-sm":""},D={key:1,text:"center","text-sm":""},C=g({__name:"InputFile",props:b({accept:null,multiple:{type:Boolean}},{modelValue:{required:!1,default:()=>[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const d=v(o,"modelValue"),u=p(),a=p(!1),r=y(a,150);function f(s){const e=s.target;e.files&&e.files.length>0&&(u.value=e.files[0]),d.value=Array.from(e.files||[]),a.value=!1}return(s,e)=>(n(),i("label",{relative:"",class:m(["min-h-[120px] flex flex-col cursor-pointer items-center justify-center rounded-xl p-6",[t(r)?"border-primary-400 dark:border-primary-600 hover:border-primary-300 dark:hover:border-primary-700":"border-neutral-200 dark:border-neutral-700 hover:border-primary-300 dark:hover:border-primary-700",t(r)?"bg-primary-50/5 dark:bg-primary-900/5":"bg-white/60 dark:bg-black/30 hover:bg-white/80 dark:hover:bg-black/40"]]),border:"dashed 2",transition:"all duration-300","cursor-pointer":"","opacity-95":"",hover:"scale-100 opacity-100 shadow-md dark:shadow-lg",onDragover:e[0]||(e[0]=c=>a.value=!0),onDragleave:e[1]||(e[1]=c=>a.value=!1)},[l("input",{type:"file",accept:o.accept,multiple:o.multiple,"cursor-pointer":"",class:"absolute inset-0 h-full w-full opacity-0",onChange:f},null,40,k),x(s.$slots,"default",{isDragging:t(r),firstFile:u.value,files:d.value},()=>[l("div",{class:m(["flex flex-col items-center",[t(r)?"text-primary-500 dark:text-primary-400":"text-neutral-400 dark:text-neutral-500"]])},[e[2]||(e[2]=l("div",{"i-solar:upload-square-line-duotone":"","mb-2":"","text-5xl":""},null,-1)),e[3]||(e[3]=l("p",{"font-medium":"",text:"center lg"}," Upload ",-1)),t(r)?(n(),i("p",h," Release to upload ")):(n(),i("p",D," Click or drag and drop a file here "))],2)])],34))}});export{C as _}; diff --git a/assets/Model.vue_vue_type_script_setup_true_lang-nr66j8OO.js b/assets/Model.vue_vue_type_script_setup_true_lang-BILK6cfC.js similarity index 97% rename from assets/Model.vue_vue_type_script_setup_true_lang-nr66j8OO.js rename to assets/Model.vue_vue_type_script_setup_true_lang-BILK6cfC.js index 8d677992be6cad221758802d1662cafcd989af7a..c9a02139ef0ec1e56ae12f4852bcfa3062164bb4 100644 --- a/assets/Model.vue_vue_type_script_setup_true_lang-nr66j8OO.js +++ b/assets/Model.vue_vue_type_script_setup_true_lang-BILK6cfC.js @@ -1 +1 @@ -import{n as C,T as Y,A as re,L as F,o as $,r as ue,D as se,I as de,m as R,M as ce,p as T}from"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{bP as ve,d as G,g as h,w as p,l as N,H as X,c as j,o as q,m as Q,br as z,h as O,bC as pe,i as he,G as fe,s as me,v as ge,bQ as Me,bR as we,bx as ye,a as be,p as Se}from"./index--eYU5aQm.js";const xe=o=>Math.max(0,Math.min(1,o||0)),B=o=>Math.round(xe(o)*255),Pe=ve("rgb"),Be=o=>{if(o===void 0)return;let l=B(o.r),t=B(o.g),d=B(o.b);return"#"+(1<<24|l<<16|t<<8|d).toString(16).slice(1)},Ce=o=>Be(Pe(o)),ke=G({__name:"Canvas",props:{width:null,height:null},setup(o,{expose:l}){const t=o,d=h(),e=h(),i=h();async function c(n){F.registerTicker($),C.add(Y),e.value=new re({width:t.width,height:t.height,backgroundAlpha:0,preserveDrawingBuffer:!0}),i.value=e.value.view,i.value.style.objectFit="contain",n.appendChild(e.value.view)}function y(){var n;e.value&&e.value.renderer.resize(t.width,t.height),(n=e.value)!=null&&n.view&&(e.value.view.width=t.width,e.value.view.height=t.height)}p([()=>t.width,()=>t.height],()=>y()),N(async()=>d.value&&await c(d.value)),X(()=>{var n;return(n=e.value)==null?void 0:n.destroy()});async function P(){return new Promise(g=>{if(!i.value||!e.value)return g(null);e.value.render(),i.value.toBlob(g)})}return l({captureFrame:P}),(n,g)=>(q(),j("div",{ref_key:"containerRef",ref:d,"h-full":"","w-full":""},[Q(n.$slots,"default",{app:e.value})],512))}});function V(o,l,t){return(1-t)*o+t*l}function H(o,l){return o+Math.random()*(l-o)}function Fe(){let o=-1,l,t=-1;function d(e,i){(i>=o||il.app),d=z(()=>l.paused),e=h(),i=h(0),c=h(0),y=O(()=>Math.max(0,Math.min(100,l.mouthOpenSize))),P=pe(),n=he(Se),g=O(()=>n.between("sm","md").value||n.smaller("sm").value),U=Fe(),I=fe(new se({alpha:.2,blur:0,distance:20,rotation:45}));function W(){return e.value.internalModel.coreModel}function D(a){if(!a.value)return;let r=2.2;g.value&&(r=2.2);const f=l.height*.95/c.value*r,s=l.width*.95/i.value*r,m=Math.min(f,s);a.value.scale.set(m,m)}const{live2dModelFile:b,loadingLive2dModel:M,live2dCurrentMotion:J,availableLive2dMotions:K,live2dLoadSource:S,live2dModelUrl:k,themeColorsHue:Z,themeColorsHueDynamic:_}=me(ge()),ee=h({group:"Idle",index:0});async function ae(){var L;if(!t.value)return;e.value&&(t.value.stage.removeChild(e.value),e.value.destroy(),e.value=void 0);const a=new F;S.value==="file"?await T.setupLive2DModel(a,[b.value]):S.value==="url"&&await T.setupLive2DModel(a,k.value),e.value=a,t.value.stage.addChild(e.value),i.value=e.value.width,c.value=e.value.height,e.value.x=l.width/2,e.value.y=l.height,e.value.rotation=Math.PI,e.value.skew.x=Math.PI,e.value.anchor.set(.5,.5),D(e),e.value.on("hit",v=>{e.value&&v.includes("body")&&e.value.motion("tap_body")});const r=e.value.internalModel,f=r.coreModel,s=r.motionManager;f.setParameterValueById("ParamMouthOpenY",y.value),K.value=Object.entries(s.definitions).flatMap(([v,u])=>u?u.map((ie,ne)=>({motionName:v,motionIndex:ne,fileName:ie.File})):[]).filter(Boolean),s.groups.idle&&((L=s.motionGroups[s.groups.idle])==null||L.forEach(v=>{v._motionData.curves.forEach(u=>{(u.id==="ParamEyeBallX"||u.id==="ParamEyeBallY")&&(u.id=`_${u.id}`)})}));const m=s.update;s.update=function(v,u){return m==null||m.call(this,v,u),s.state.currentGroup===s.groups.idle&&U.update(r,u),!0},s.on("motionStart",(v,u)=>{ee.value={group:v,index:u}}),b.value&&await R.setItem("live2dModel",b.value),M.value=!1}async function te(){if(!t.value)return;F.registerTicker($),C.add(Y),C.add(de);const a=await R.getItem("live2dModel");if(a){b.value=a,S.value="file",M.value=!0;return}if(k.value){S.value="url",M.value=!0;return}M.value=!1}async function le(a,r){await e.value.motion(a,r,ce.FORCE)}const oe=Me(()=>{e.value&&(e.value.x=l.width/2,e.value.y=l.height,D(e))},100),A=h(),w=h(0);function x(){if(e.value){const a=getComputedStyle(A.value).backgroundColor;I.value.color=Number(Ce(a).replace("#","0x")),e.value.filters=[I.value]}}p([()=>l.width,()=>l.height],()=>oe()),p(P,x,{immediate:!0}),p([e,Z],x);function E(){x(),w.value=requestAnimationFrame(E)}return p(_,()=>{_.value?w.value=requestAnimationFrame(E):(cancelAnimationFrame(w.value),w.value=0)},{immediate:!0}),p(y,a=>W().setParameterValueById("ParamMouthOpenY",a)),p(t,te),p(J,a=>le(a.group,a.index)),p(d,a=>{var r,f;a?(r=t.value)==null||r.stop():(f=t.value)==null||f.start()}),we(M,a=>{a&&ae()},{debounce:1e3}),N(x),X(()=>{var a;cancelAnimationFrame(w.value),e.value&&((a=t.value)==null||a.stage.removeChild(e.value))}),(a,r)=>(q(),j(ye,null,[be("div",{ref_key:"dropShadowColorComputer",ref:A,hidden:"",bg:"primary-400 dark:primary-500"},null,512),Q(a.$slots,"default")],64))}});export{_e as _,ke as a,H as r}; +import{n as C,T as Y,A as re,L as F,o as $,r as ue,D as se,I as de,m as R,M as ce,p as T}from"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{bP as ve,d as G,g as h,w as p,l as N,H as X,c as j,o as q,m as Q,br as z,h as O,bC as pe,i as he,G as fe,s as me,v as ge,bQ as Me,bR as we,bx as ye,a as be,p as Se}from"./index-D55VqdU4.js";const xe=o=>Math.max(0,Math.min(1,o||0)),B=o=>Math.round(xe(o)*255),Pe=ve("rgb"),Be=o=>{if(o===void 0)return;let l=B(o.r),t=B(o.g),d=B(o.b);return"#"+(1<<24|l<<16|t<<8|d).toString(16).slice(1)},Ce=o=>Be(Pe(o)),ke=G({__name:"Canvas",props:{width:null,height:null},setup(o,{expose:l}){const t=o,d=h(),e=h(),i=h();async function c(n){F.registerTicker($),C.add(Y),e.value=new re({width:t.width,height:t.height,backgroundAlpha:0,preserveDrawingBuffer:!0}),i.value=e.value.view,i.value.style.objectFit="contain",n.appendChild(e.value.view)}function y(){var n;e.value&&e.value.renderer.resize(t.width,t.height),(n=e.value)!=null&&n.view&&(e.value.view.width=t.width,e.value.view.height=t.height)}p([()=>t.width,()=>t.height],()=>y()),N(async()=>d.value&&await c(d.value)),X(()=>{var n;return(n=e.value)==null?void 0:n.destroy()});async function P(){return new Promise(g=>{if(!i.value||!e.value)return g(null);e.value.render(),i.value.toBlob(g)})}return l({captureFrame:P}),(n,g)=>(q(),j("div",{ref_key:"containerRef",ref:d,"h-full":"","w-full":""},[Q(n.$slots,"default",{app:e.value})],512))}});function V(o,l,t){return(1-t)*o+t*l}function H(o,l){return o+Math.random()*(l-o)}function Fe(){let o=-1,l,t=-1;function d(e,i){(i>=o||il.app),d=z(()=>l.paused),e=h(),i=h(0),c=h(0),y=O(()=>Math.max(0,Math.min(100,l.mouthOpenSize))),P=pe(),n=he(Se),g=O(()=>n.between("sm","md").value||n.smaller("sm").value),U=Fe(),I=fe(new se({alpha:.2,blur:0,distance:20,rotation:45}));function W(){return e.value.internalModel.coreModel}function D(a){if(!a.value)return;let r=2.2;g.value&&(r=2.2);const f=l.height*.95/c.value*r,s=l.width*.95/i.value*r,m=Math.min(f,s);a.value.scale.set(m,m)}const{live2dModelFile:b,loadingLive2dModel:M,live2dCurrentMotion:J,availableLive2dMotions:K,live2dLoadSource:S,live2dModelUrl:k,themeColorsHue:Z,themeColorsHueDynamic:_}=me(ge()),ee=h({group:"Idle",index:0});async function ae(){var L;if(!t.value)return;e.value&&(t.value.stage.removeChild(e.value),e.value.destroy(),e.value=void 0);const a=new F;S.value==="file"?await T.setupLive2DModel(a,[b.value]):S.value==="url"&&await T.setupLive2DModel(a,k.value),e.value=a,t.value.stage.addChild(e.value),i.value=e.value.width,c.value=e.value.height,e.value.x=l.width/2,e.value.y=l.height,e.value.rotation=Math.PI,e.value.skew.x=Math.PI,e.value.anchor.set(.5,.5),D(e),e.value.on("hit",v=>{e.value&&v.includes("body")&&e.value.motion("tap_body")});const r=e.value.internalModel,f=r.coreModel,s=r.motionManager;f.setParameterValueById("ParamMouthOpenY",y.value),K.value=Object.entries(s.definitions).flatMap(([v,u])=>u?u.map((ie,ne)=>({motionName:v,motionIndex:ne,fileName:ie.File})):[]).filter(Boolean),s.groups.idle&&((L=s.motionGroups[s.groups.idle])==null||L.forEach(v=>{v._motionData.curves.forEach(u=>{(u.id==="ParamEyeBallX"||u.id==="ParamEyeBallY")&&(u.id=`_${u.id}`)})}));const m=s.update;s.update=function(v,u){return m==null||m.call(this,v,u),s.state.currentGroup===s.groups.idle&&U.update(r,u),!0},s.on("motionStart",(v,u)=>{ee.value={group:v,index:u}}),b.value&&await R.setItem("live2dModel",b.value),M.value=!1}async function te(){if(!t.value)return;F.registerTicker($),C.add(Y),C.add(de);const a=await R.getItem("live2dModel");if(a){b.value=a,S.value="file",M.value=!0;return}if(k.value){S.value="url",M.value=!0;return}M.value=!1}async function le(a,r){await e.value.motion(a,r,ce.FORCE)}const oe=Me(()=>{e.value&&(e.value.x=l.width/2,e.value.y=l.height,D(e))},100),A=h(),w=h(0);function x(){if(e.value){const a=getComputedStyle(A.value).backgroundColor;I.value.color=Number(Ce(a).replace("#","0x")),e.value.filters=[I.value]}}p([()=>l.width,()=>l.height],()=>oe()),p(P,x,{immediate:!0}),p([e,Z],x);function E(){x(),w.value=requestAnimationFrame(E)}return p(_,()=>{_.value?w.value=requestAnimationFrame(E):(cancelAnimationFrame(w.value),w.value=0)},{immediate:!0}),p(y,a=>W().setParameterValueById("ParamMouthOpenY",a)),p(t,te),p(J,a=>le(a.group,a.index)),p(d,a=>{var r,f;a?(r=t.value)==null||r.stop():(f=t.value)==null||f.start()}),we(M,a=>{a&&ae()},{debounce:1e3}),N(x),X(()=>{var a;cancelAnimationFrame(w.value),e.value&&((a=t.value)==null||a.stage.removeChild(e.value))}),(a,r)=>(q(),j(ye,null,[be("div",{ref_key:"dropShadowColorComputer",ref:A,hidden:"",bg:"primary-400 dark:primary-500"},null,512),Q(a.$slots,"default")],64))}});export{_e as _,ke as a,H as r}; diff --git a/assets/PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js b/assets/PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js similarity index 93% rename from assets/PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js rename to assets/PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js index c71082e073b2bd31929aa0851343b5678a8c0df0..50b9d6b1b2dd80b412a1699b832a68b06bf38bf6 100644 --- a/assets/PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js +++ b/assets/PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js @@ -1 +1 @@ -import{d as l,bG as u,bw as c,A as d,o as n,c as s,a as t,u as p,C as x,D as i}from"./index--eYU5aQm.js";const f={initial:{opacity:0,x:10},enter:{opacity:1,x:0},duration:250,style:{top:"env(safe-area-inset-top, 0px)",right:"env(safe-area-inset-right, 0px)",left:"env(safe-area-inset-left, 0px)"},sticky:"","inset-x-0":"","top-0":"","z-99":"","w-full":"","pb-6":"","pt-10":"",flex:"~ row items-center gap-2",bg:"$bg-color"},v={relative:""},b={key:0,absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},m={text:"neutral-300 dark:neutral-500","text-nowrap":""},_={"text-nowrap":"","text-3xl":"","font-semibold":""},y=l({__name:"PageHeader",props:{title:null,subtitle:null},setup(o){const a=u();return(g,e)=>{const r=c("motion");return d((n(),s("div",f,[t("button",{onClick:e[0]||(e[0]=k=>p(a).back())},e[1]||(e[1]=[t("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),t("h1",v,[o.subtitle?(n(),s("div",b,[t("span",m,i(o.subtitle),1)])):x("",!0),t("div",_,i(o.title),1)])])),[[r]])}}});export{y as _}; +import{d as l,bG as u,bw as c,A as d,o as n,c as s,a as t,u as p,C as x,D as i}from"./index-D55VqdU4.js";const f={initial:{opacity:0,x:10},enter:{opacity:1,x:0},duration:250,style:{top:"env(safe-area-inset-top, 0px)",right:"env(safe-area-inset-right, 0px)",left:"env(safe-area-inset-left, 0px)"},sticky:"","inset-x-0":"","top-0":"","z-99":"","w-full":"","pb-6":"","pt-10":"",flex:"~ row items-center gap-2",bg:"$bg-color"},v={relative:""},b={key:0,absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},m={text:"neutral-300 dark:neutral-500","text-nowrap":""},_={"text-nowrap":"","text-3xl":"","font-semibold":""},y=l({__name:"PageHeader",props:{title:null,subtitle:null},setup(o){const a=u();return(g,e)=>{const r=c("motion");return d((n(),s("div",f,[t("button",{onClick:e[0]||(e[0]=k=>p(a).back())},e[1]||(e[1]=[t("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),t("h1",v,[o.subtitle?(n(),s("div",b,[t("span",m,i(o.subtitle),1)])):x("",!0),t("div",_,i(o.title),1)])])),[[r]])}}});export{y as _}; diff --git a/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CCsf2oJB.js b/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BMPV9bKe.js similarity index 84% rename from assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CCsf2oJB.js rename to assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BMPV9bKe.js index 7671d3e358c098aeea825d2ff976ab91c1cea27b..6d54d2f6d67d7d015c1e50b2e058ab32e4f69799 100644 --- a/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CCsf2oJB.js +++ b/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BMPV9bKe.js @@ -1 +1 @@ -import{_ as u}from"./FieldInput.vue_vue_type_script_setup_true_lang-CriF7G5j.js";import{d as i,bI as n,q as t,bJ as p,h as m,x as c,o as f,u as b}from"./index--eYU5aQm.js";const y=i({__name:"ProviderApiKeyInput",props:n({providerName:null,placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e,{t:a}=t(),o=p(e,"modelValue"),d=m(()=>l.description||`API Key for ${l.providerName}`);return(v,r)=>(f(),c(u,{modelValue:o.value,"onUpdate:modelValue":r[0]||(r[0]=s=>o.value=s),label:e.label||b(a)("settings.pages.providers.common.fields.field.api-key.label"),description:d.value,placeholder:e.placeholder,required:e.required,type:"password"},null,8,["modelValue","label","description","placeholder","required"]))}});export{y as _}; +import{_ as u}from"./FieldInput.vue_vue_type_script_setup_true_lang-DQP2RhYC.js";import{d as i,bI as n,q as t,bJ as p,h as m,x as c,o as f,u as b}from"./index-D55VqdU4.js";const y=i({__name:"ProviderApiKeyInput",props:n({providerName:null,placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e,{t:a}=t(),o=p(e,"modelValue"),d=m(()=>l.description||`API Key for ${l.providerName}`);return(v,r)=>(f(),c(u,{modelValue:o.value,"onUpdate:modelValue":r[0]||(r[0]=s=>o.value=s),label:e.label||b(a)("settings.pages.providers.common.fields.field.api-key.label"),description:d.value,placeholder:e.placeholder,required:e.required,type:"password"},null,8,["modelValue","label","description","placeholder","required"]))}});export{y as _}; diff --git a/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dsoa87PD.js b/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-BtshDojk.js similarity index 88% rename from assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dsoa87PD.js rename to assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-BtshDojk.js index c2fd12aff52cb3285f26adf9f2f38b1aa1a6430f..b044b23b0ef3e99fa74107135229c50b7c82652b 100644 --- a/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dsoa87PD.js +++ b/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-BtshDojk.js @@ -1 +1 @@ -import{_ as p}from"./Collapsable.vue_vue_type_script_setup_true_lang-CWkRm8IH.js";import{d,g as m,x as u,o as c,y as n,a as e,m as f,D as _,z as v,bI as b,bJ as g}from"./index--eYU5aQm.js";import{_ as V}from"./FieldInput.vue_vue_type_script_setup_true_lang-CriF7G5j.js";const x=["onClick"],h={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},y={"mt-4":""},q=d({__name:"ProviderAdvancedSettings",props:{title:null,initialVisible:{type:Boolean}},setup(l){const a=m(l.initialVisible||!1);function r(){a.value=!a.value}return(o,i)=>(c(),u(p,{"w-full":""},{trigger:n(s=>[e("button",{transition:"all ease-in-out duration-250","w-full":"",flex:"","items-center":"","gap-1.5":"","outline-none":"",class:"[&_.provider-icon]:grayscale-100 [&_.provider-icon]:hover:grayscale-0",onClick:()=>s.setVisible(!s.visible)&&r()},[e("h2",h,[e("span",null,_(l.title||"Advanced"),1)]),e("div",{transform:"",transition:"transform duration-250",class:v({"rotate-180":s.visible})},i[0]||(i[0]=[e("div",{"i-solar:alt-arrow-down-bold-duotone":""},null,-1)]),2)],8,x)]),default:n(()=>[e("div",y,[f(o.$slots,"default")])]),_:3}))}}),w=d({__name:"ProviderBaseUrlInput",props:b({placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=g(l,"modelValue");return(r,o)=>(c(),u(V,{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=i=>a.value=i),label:t.label||"Base URL",description:t.description||"Custom base URL (optional)",placeholder:t.placeholder,required:t.required,type:"text"},null,8,["modelValue","label","description","placeholder","required"]))}});export{q as _,w as a}; +import{_ as p}from"./Collapsable.vue_vue_type_script_setup_true_lang-BDoHyduV.js";import{d,g as m,x as u,o as c,y as n,a as e,m as f,D as _,z as v,bI as b,bJ as g}from"./index-D55VqdU4.js";import{_ as V}from"./FieldInput.vue_vue_type_script_setup_true_lang-DQP2RhYC.js";const x=["onClick"],h={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},y={"mt-4":""},q=d({__name:"ProviderAdvancedSettings",props:{title:null,initialVisible:{type:Boolean}},setup(l){const a=m(l.initialVisible||!1);function r(){a.value=!a.value}return(o,i)=>(c(),u(p,{"w-full":""},{trigger:n(s=>[e("button",{transition:"all ease-in-out duration-250","w-full":"",flex:"","items-center":"","gap-1.5":"","outline-none":"",class:"[&_.provider-icon]:grayscale-100 [&_.provider-icon]:hover:grayscale-0",onClick:()=>s.setVisible(!s.visible)&&r()},[e("h2",h,[e("span",null,_(l.title||"Advanced"),1)]),e("div",{transform:"",transition:"transform duration-250",class:v({"rotate-180":s.visible})},i[0]||(i[0]=[e("div",{"i-solar:alt-arrow-down-bold-duotone":""},null,-1)]),2)],8,x)]),default:n(()=>[e("div",y,[f(o.$slots,"default")])]),_:3}))}}),w=d({__name:"ProviderBaseUrlInput",props:b({placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=g(l,"modelValue");return(r,o)=>(c(),u(V,{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=i=>a.value=i),label:t.label||"Base URL",description:t.description||"Custom base URL (optional)",placeholder:t.placeholder,required:t.required,type:"text"},null,8,["modelValue","label","description","placeholder","required"]))}});export{q as _,w as a}; diff --git a/assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BJL9_E_2.js b/assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DLyRry-6.js similarity index 94% rename from assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BJL9_E_2.js rename to assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DLyRry-6.js index eff1d57333f39bd1d33011e14f1a3d98b31979be..be195a258b2ac5bb454f630f86bdf8a867999c8f 100644 --- a/assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BJL9_E_2.js +++ b/assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DLyRry-6.js @@ -1 +1 @@ -import{d as o,c as s,o as a,a as e,m as i,C as u,D as l}from"./index--eYU5aQm.js";const c={flex:"~ col gap-6"},x={flex:"~ row","items-center":"","justify-between":""},f={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},m={text:"neutral-400 dark:neutral-500"},g=o({__name:"ProviderBasicSettings",props:{title:null,description:null,onReset:{type:Function}},setup(t){return(r,n)=>(a(),s("div",c,[e("div",x,[e("div",null,[e("h2",f,l(t.title||"Basic"),1),e("div",m,[e("span",null,l(t.description||"Essential settings"),1)])]),t.onReset?(a(),s("button",{key:0,title:"Reset settings",flex:"","items-center":"","justify-center":"","rounded-full":"","p-2":"",transition:"all duration-250 ease-in-out",text:"neutral-500 dark:neutral-400",bg:"transparent dark:transparent hover:neutral-200 dark:hover:neutral-800 active:neutral-300 dark:active:neutral-700",onClick:n[0]||(n[0]=(...d)=>t.onReset&&t.onReset(...d))},n[1]||(n[1]=[e("div",{"i-solar:refresh-bold-duotone":"","text-xl":""},null,-1)]))):u("",!0)]),i(r.$slots,"default")]))}}),p={bg:"neutral-50 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-6"},k=o({__name:"ProviderSettingsContainer",setup(t){return(r,n)=>(a(),s("div",p,[i(r.$slots,"default")]))}});export{k as _,g as a}; +import{d as o,c as s,o as a,a as e,m as i,C as u,D as l}from"./index-D55VqdU4.js";const c={flex:"~ col gap-6"},x={flex:"~ row","items-center":"","justify-between":""},f={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},m={text:"neutral-400 dark:neutral-500"},g=o({__name:"ProviderBasicSettings",props:{title:null,description:null,onReset:{type:Function}},setup(t){return(r,n)=>(a(),s("div",c,[e("div",x,[e("div",null,[e("h2",f,l(t.title||"Basic"),1),e("div",m,[e("span",null,l(t.description||"Essential settings"),1)])]),t.onReset?(a(),s("button",{key:0,title:"Reset settings",flex:"","items-center":"","justify-center":"","rounded-full":"","p-2":"",transition:"all duration-250 ease-in-out",text:"neutral-500 dark:neutral-400",bg:"transparent dark:transparent hover:neutral-200 dark:hover:neutral-800 active:neutral-300 dark:active:neutral-700",onClick:n[0]||(n[0]=(...d)=>t.onReset&&t.onReset(...d))},n[1]||(n[1]=[e("div",{"i-solar:refresh-bold-duotone":"","text-xl":""},null,-1)]))):u("",!0)]),i(r.$slots,"default")]))}}),p={bg:"neutral-50 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-6"},k=o({__name:"ProviderSettingsContainer",setup(t){return(r,n)=>(a(),s("div",p,[i(r.$slots,"default")]))}});export{k as _,g as a}; diff --git a/assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DVunqc-i.js b/assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-Cc3LXYUd.js similarity index 85% rename from assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DVunqc-i.js rename to assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-Cc3LXYUd.js index 04b588d72759ee51e9360a69fccad2720c15546e..f474abfcdc19fe024d4b54c842aa9cd9c3ab273c 100644 --- a/assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DVunqc-i.js +++ b/assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-Cc3LXYUd.js @@ -1 +1 @@ -import{_ as a}from"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";import{d as s,q as l,bw as c,c as t,o,b as d,m as u,A as m,u as p,a as v,z as _,bx as f}from"./index--eYU5aQm.js";const x={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":""},I=s({__name:"ProviderSettingsLayout",props:{providerName:null,providerIcon:null,providerIconColor:null,onBack:{type:Function}},setup(e){const{t:r}=l();return(n,b)=>{const i=c("motion");return o(),t(f,null,[d(a,{title:e.providerName,subtitle:p(r)("settings.pages.providers.title")},null,8,["title","subtitle"]),u(n.$slots,"default"),m((o(),t("div",x,[v("div",{text:"60",class:_(e.providerIcon||e.providerIconColor)},null,2)])),[[i]])],64)}}});export{I as _}; +import{_ as a}from"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";import{d as s,q as l,bw as c,c as t,o,b as d,m as u,A as m,u as p,a as v,z as _,bx as f}from"./index-D55VqdU4.js";const x={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":""},I=s({__name:"ProviderSettingsLayout",props:{providerName:null,providerIcon:null,providerIconColor:null,onBack:{type:Function}},setup(e){const{t:r}=l();return(n,b)=>{const i=c("motion");return o(),t(f,null,[d(a,{title:e.providerName,subtitle:p(r)("settings.pages.providers.title")},null,8,["title","subtitle"]),u(n.$slots,"default"),m((o(),t("div",x,[v("div",{text:"60",class:_(e.providerIcon||e.providerIconColor)},null,2)])),[[i]])],64)}}});export{I as _}; diff --git a/assets/RadioCardDetailManySelect-B7rv-Fju.js b/assets/RadioCardDetailManySelect-B6ly4h3g.js similarity index 96% rename from assets/RadioCardDetailManySelect-B7rv-Fju.js rename to assets/RadioCardDetailManySelect-B6ly4h3g.js index 9e77a4898d97d291d91f506d1bfe7e560c07a17f..49ca9ec8297c332a2ee7434c8a00cc636a296214 100644 --- a/assets/RadioCardDetailManySelect-B7rv-Fju.js +++ b/assets/RadioCardDetailManySelect-B6ly4h3g.js @@ -1 +1 @@ -import{d as g,bI as f,bJ as w,g as b,c as n,o as d,z as o,A as V,a as t,bA as B,C as v,D as c,b as $,y as M,bM as k,bn as C,h as S,bE as T,bx as z,by as D,x as E}from"./index--eYU5aQm.js";import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{_ as N}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-BHnSNWo1.js";import{_ as P}from"./Input.vue_vue_type_script_setup_true_lang-DaL4uFR_.js";const U=["checked","name","value"],q={class:"relative mr-3 mt-0.5 flex-shrink-0"},L={class:"w-full flex flex-col gap-2"},j={class:"flex items-center"},A={key:0,class:"relative"},F=["title"],J={key:1,class:"mt-2"},Q=g({__name:"RadioCardDetail",props:f({id:null,name:null,value:null,title:null,description:null,deprecated:{type:Boolean,default:!1},showExpandCollapse:{type:Boolean,default:!0},expandCollapseThreshold:{default:100},customInputValue:{default:""},customInputPlaceholder:{default:""},showCustomInput:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const a=w(e,"modelValue"),m=b(!1);function s(){m.value=!m.value}return(x,r)=>(d(),n("label",{key:e.id,class:o(["form_radio-card-detail relative flex cursor-pointer items-start rounded-xl p-3 pr-[20px]",[a.value===e.value?"bg-primary-50 dark:bg-primary-900/20 border-primary-100 dark:border-primary-900 hover:border-primary-500/30 dark:hover:border-primary-400/30":"bg-white dark:bg-neutral-900/20 border-neutral-100 dark:border-neutral-900 hover:border-primary-500/30 dark:hover:border-primary-400/30",a.value===e.value?"form_radio-card-detail-active":"",e.deprecated?"opacity-60":""]]),transition:"all duration-200 ease-in-out",border:"2 solid"},[V(t("input",{"onUpdate:modelValue":r[0]||(r[0]=i=>a.value=i),checked:a.value===e.value,type:"radio",name:e.name,value:e.value,class:"absolute opacity-0"},null,8,U),[[B,a.value]]),t("div",q,[t("div",{class:o(["size-5 border-2 rounded-full transition-colors duration-200",[a.value===e.value?"border-primary-500 dark:border-primary-400":"border-neutral-300 dark:border-neutral-600"]])},[t("div",{class:o(["absolute left-1/2 top-1/2 size-3 rounded-full transition-opacity duration-200 -translate-x-1/2 -translate-y-1/2",[a.value===e.value?"opacity-100 bg-primary-500 dark:bg-primary-400":"opacity-0"]])},null,2)],2)]),t("div",L,[t("div",j,[t("span",{class:o(["line-clamp-1 font-medium",[a.value===e.value?"text-neutral-700 dark:text-neutral-300":"text-neutral-700 dark:text-neutral-400"]])},c(e.title),3)]),e.description?(d(),n("div",A,[$(N,null,{default:M(()=>[!m.value||!e.showExpandCollapse?(d(),n("div",{key:0,class:o(["line-clamp-2 cursor-pointer text-xs",[a.value===e.value?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]]),title:e.description,onClick:k(s,["prevent"])},c(e.description),11,F)):(d(),n("div",{key:1,class:o(["cursor-pointer text-xs",[a.value===e.value?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]]),onClick:k(s,["prevent"])},c(e.description),3))]),_:1}),e.showExpandCollapse&&e.description.length>e.expandCollapseThreshold?(d(),n("button",{key:0,class:"text-primary-500 dark:text-primary-600 mt-0.5 inline-flex items-center text-xs",onClick:k(s,["prevent"])},[t("span",null,c(m.value?"Show less":"Show more"),1),t("div",{class:o([{"rotate-180":m.value},"transition-transform duration-200"])},r[2]||(r[2]=[t("div",{"i-solar:alt-arrow-down-bold-duotone":"","ml-0.5":"","text-xs":""},null,-1)]),2)])):v("",!0)])):v("",!0),e.showCustomInput&&a.value===e.value?(d(),n("div",J,[$(P,{modelValue:a.value,"onUpdate:modelValue":r[1]||(r[1]=i=>a.value=i),type:"text",class:"w-full border border-neutral-300 rounded bg-white px-2 py-1 text-sm dark:border-neutral-700 dark:bg-neutral-900",placeholder:e.customInputPlaceholder},null,8,["modelValue","placeholder"])])):v("",!0)])],2))}}),G=C(Q,[["__scopeId","data-v-c9195151"]]),H=["checked","name","value"],K={flex:"~ col","min-h-16":"","w-full":"","items-start":"","justify-center":"","pb-2":"","pl-5":"","pr-4":"","pt-2":""},O=g({__name:"RadioCardSimple",props:f({id:null,name:null,value:null,title:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const a=w(e,"modelValue");return(m,s)=>(d(),n("label",{key:e.id,border:"2px solid",class:o(["form_radio-card-simple relative",[a.value===e.value?"bg-primary-50 dark:bg-primary-900/20 border-primary-100 dark:border-primary-900 hover:border-primary-500/30 dark:hover:border-primary-400/30":"bg-white dark:bg-neutral-900/20 border-neutral-100 dark:border-neutral-900 hover:border-primary-500/30 dark:hover:border-primary-400/30",a.value===e.value?"form_radio-card-simple-active":""]]),transition:"all duration-200 ease-in-out",flex:"~ col",block:"","min-w-50":"","w-fit":"","cursor-pointer":"","items-start":"","rounded-xl":"","p-4":"","text-left":""},[V(t("input",{"onUpdate:modelValue":s[0]||(s[0]=x=>a.value=x),checked:a.value===e.value,type:"radio",name:e.name,value:e.value,class:"[&:checked+div]:border-primary-500 dark:[&:checked+div]:border-primary-400 absolute opacity-0 [&:checked+div_.radio-dot]:opacity-100"},null,8,H),[[B,a.value]]),s[1]||(s[1]=t("div",{class:"radio-circle absolute left-2 top-2 size-5 rounded-full",border:"2 solid neutral-300 dark:neutral-600",transition:"all duration-200 ease-in-out"},[t("div",{class:"radio-dot absolute left-1/2 top-1/2 size-3 rounded-full opacity-0 -translate-x-1/2 -translate-y-1/2",transition:"all duration-200 ease-in-out",bg:"primary-500 dark:primary-400"})],-1)),t("div",K,[t("span",{class:o(["radio-item-name font-bold",[a.value===e.value?"text-neutral-700 dark:text-neutral-300":"text-neutral-500 dark:text-neutral-500"]]),text:"md",transition:"all duration-200 ease-in-out"},c(e.title),3),e.description?(d(),n("span",{key:0,class:o(["radio-item-description",[a.value===e.value?"text-neutral-600 dark:text-neutral-400":"text-neutral-400 dark:text-neutral-600"]]),transition:"all duration-200 ease-in-out"},c(e.description),3)):v("",!0)]),s[2]||(s[2]=t("div",{class:"bg-dotted-neutral-200/80 dark:bg-dotted-neutral-700/50 [input:checked~&]:bg-dotted-primary-300/50 dark:[input:checked~&]:bg-dotted-primary-200/20",absolute:"","inset-0":"","z--1":"",style:{"background-size":"10px 10px","mask-image":"linear-gradient(165deg, white 30%, transparent 50%)"}},null,-1))],2))}}),ue=C(O,[["__scopeId","data-v-dd41bc0b"]]),W={class:"radio-card-detail-many-select"},X={key:0,class:"relative","inline-flex":"~","w-full":"","items-center":""},Y=["placeholder"],Z={class:"mt-4 space-y-2"},_={key:0,class:"text-sm text-neutral-500 dark:text-neutral-400"},ee={key:1,class:"flex items-center gap-3 border border-2 border-amber-200 rounded-xl bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},te={class:"flex flex-col"},ae={class:"font-medium"},le={class:"text-sm text-amber-600 dark:text-amber-400"},re={class:"relative"},oe=g({__name:"RadioCardDetailManySelect",props:f({items:null,searchable:{type:Boolean,default:!0},searchPlaceholder:{default:"Search..."},searchNoResultsTitle:{default:"No results found"},searchNoResultsDescription:{default:"Try a different search term"},searchResultsText:{default:"{count} of {total} results"},customInputPlaceholder:{default:"Enter custom value"},expandButtonText:{default:"Show more"},collapseButtonText:{default:"Show less"},showMore:{type:Boolean,default:!0}},{modelValue:{required:!0},modelModifiers:{}}),emits:f(["update:customValue"],["update:modelValue"]),setup(e,{emit:a}){const m=e,s=a,x=w(e,"modelValue"),r=b(""),i=b(!1),R=b(""),h=S(()=>{if(!r.value)return m.items;const p=r.value.toLowerCase();return m.items.filter(l=>l.name.toLowerCase().includes(p)||l.description&&l.description.toLowerCase().includes(p))});function I(p){R.value=p,s("update:customValue",p)}return(p,l)=>(d(),n("div",W,[e.searchable?(d(),n("div",X,[l[4]||(l[4]=t("div",{class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"},[t("div",{"i-solar:magnifer-line-duotone":"",class:"text-neutral-500 dark:text-neutral-400"})],-1)),V(t("input",{"onUpdate:modelValue":l[0]||(l[0]=u=>r.value=u),type:"search",class:"w-full rounded-xl p-2.5 pl-10 text-sm outline-none",border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",bg:"white dark:neutral-900",placeholder:e.searchPlaceholder},null,8,Y),[[T,r.value]])])):v("",!0),t("div",Z,[r.value?(d(),n("div",_,c(e.searchResultsText.replace("{count}",h.value.length.toString()).replace("{total}",e.items.length.toString())),1)):v("",!0),r.value&&h.value.length===0?(d(),n("div",ee,[l[5]||(l[5]=t("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),t("div",te,[t("span",ae,c(e.searchNoResultsTitle),1),t("span",le,c(e.searchNoResultsDescription.replace("{query}",r.value)),1)])])):v("",!0),t("div",re,[t("div",{class:o(["scrollbar-hide grid auto-cols-[350px] grid-flow-col max-h-[calc(100dvh-7lh)] gap-4 overflow-x-auto pb-4",[i.value?"grid-cols-1 md:grid-cols-2 grid-flow-row auto-cols-auto":""]]),transition:"all duration-200 ease-in-out",style:{"scroll-snap-type":"x mandatory"}},[(d(!0),n(z,null,D(h.value,u=>(d(),E(G,{id:u.id,key:u.id,modelValue:x.value,"onUpdate:modelValue":l[1]||(l[1]=y=>x.value=y),value:u.id,title:u.name,description:u.description,deprecated:u.deprecated,"show-expand-collapse":e.showMore,"expand-collapse-threshold":100,"show-custom-input":u.customizable,"custom-input-value":R.value,"custom-input-placeholder":e.customInputPlaceholder,name:"radio-card-detail-many-select",class:"scroll-snap-align-start","onUpdate:customInputValue":l[2]||(l[2]=y=>I(y))},null,8,["id","modelValue","value","title","description","deprecated","show-expand-collapse","show-custom-input","custom-input-value","custom-input-placeholder"]))),128))],2),t("div",{bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"",class:o([i.value?"w-full":"mt-4 w-full rounded-lg"])},[t("button",{"w-full":"",flex:"","items-center":"","justify-center":"","gap-2":"","rounded-lg":"","py-2":"",transition:"all duration-200 ease-in-out",class:o([i.value?"bg-primary-500 hover:bg-primary-600 text-white":"bg-white dark:bg-neutral-900 hover:bg-neutral-100 dark:hover:bg-neutral-800"]),onClick:l[3]||(l[3]=u=>i.value=!i.value)},[t("span",null,c(i.value?e.collapseButtonText:e.expandButtonText),1),t("div",{class:o([i.value?"rotate-180":"","text-lg"]),"i-solar:alt-arrow-down-bold-duotone":"",transition:"transform duration-200 ease-in-out"},null,2)],2)],2)])])]))}}),ce=C(oe,[["__scopeId","data-v-0c2329bf"]]);export{ce as R,ue as a}; +import{d as g,bI as f,bJ as w,g as b,c as n,o as d,z as o,A as V,a as t,bA as B,C as v,D as c,b as $,y as M,bM as k,bn as C,h as S,bE as T,bx as z,by as D,x as E}from"./index-D55VqdU4.js";import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{_ as N}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-BbB31kj-.js";import{_ as P}from"./Input.vue_vue_type_script_setup_true_lang-CeU0PE9S.js";const U=["checked","name","value"],q={class:"relative mr-3 mt-0.5 flex-shrink-0"},L={class:"w-full flex flex-col gap-2"},j={class:"flex items-center"},A={key:0,class:"relative"},F=["title"],J={key:1,class:"mt-2"},Q=g({__name:"RadioCardDetail",props:f({id:null,name:null,value:null,title:null,description:null,deprecated:{type:Boolean,default:!1},showExpandCollapse:{type:Boolean,default:!0},expandCollapseThreshold:{default:100},customInputValue:{default:""},customInputPlaceholder:{default:""},showCustomInput:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const a=w(e,"modelValue"),m=b(!1);function s(){m.value=!m.value}return(x,r)=>(d(),n("label",{key:e.id,class:o(["form_radio-card-detail relative flex cursor-pointer items-start rounded-xl p-3 pr-[20px]",[a.value===e.value?"bg-primary-50 dark:bg-primary-900/20 border-primary-100 dark:border-primary-900 hover:border-primary-500/30 dark:hover:border-primary-400/30":"bg-white dark:bg-neutral-900/20 border-neutral-100 dark:border-neutral-900 hover:border-primary-500/30 dark:hover:border-primary-400/30",a.value===e.value?"form_radio-card-detail-active":"",e.deprecated?"opacity-60":""]]),transition:"all duration-200 ease-in-out",border:"2 solid"},[V(t("input",{"onUpdate:modelValue":r[0]||(r[0]=i=>a.value=i),checked:a.value===e.value,type:"radio",name:e.name,value:e.value,class:"absolute opacity-0"},null,8,U),[[B,a.value]]),t("div",q,[t("div",{class:o(["size-5 border-2 rounded-full transition-colors duration-200",[a.value===e.value?"border-primary-500 dark:border-primary-400":"border-neutral-300 dark:border-neutral-600"]])},[t("div",{class:o(["absolute left-1/2 top-1/2 size-3 rounded-full transition-opacity duration-200 -translate-x-1/2 -translate-y-1/2",[a.value===e.value?"opacity-100 bg-primary-500 dark:bg-primary-400":"opacity-0"]])},null,2)],2)]),t("div",L,[t("div",j,[t("span",{class:o(["line-clamp-1 font-medium",[a.value===e.value?"text-neutral-700 dark:text-neutral-300":"text-neutral-700 dark:text-neutral-400"]])},c(e.title),3)]),e.description?(d(),n("div",A,[$(N,null,{default:M(()=>[!m.value||!e.showExpandCollapse?(d(),n("div",{key:0,class:o(["line-clamp-2 cursor-pointer text-xs",[a.value===e.value?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]]),title:e.description,onClick:k(s,["prevent"])},c(e.description),11,F)):(d(),n("div",{key:1,class:o(["cursor-pointer text-xs",[a.value===e.value?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]]),onClick:k(s,["prevent"])},c(e.description),3))]),_:1}),e.showExpandCollapse&&e.description.length>e.expandCollapseThreshold?(d(),n("button",{key:0,class:"text-primary-500 dark:text-primary-600 mt-0.5 inline-flex items-center text-xs",onClick:k(s,["prevent"])},[t("span",null,c(m.value?"Show less":"Show more"),1),t("div",{class:o([{"rotate-180":m.value},"transition-transform duration-200"])},r[2]||(r[2]=[t("div",{"i-solar:alt-arrow-down-bold-duotone":"","ml-0.5":"","text-xs":""},null,-1)]),2)])):v("",!0)])):v("",!0),e.showCustomInput&&a.value===e.value?(d(),n("div",J,[$(P,{modelValue:a.value,"onUpdate:modelValue":r[1]||(r[1]=i=>a.value=i),type:"text",class:"w-full border border-neutral-300 rounded bg-white px-2 py-1 text-sm dark:border-neutral-700 dark:bg-neutral-900",placeholder:e.customInputPlaceholder},null,8,["modelValue","placeholder"])])):v("",!0)])],2))}}),G=C(Q,[["__scopeId","data-v-c9195151"]]),H=["checked","name","value"],K={flex:"~ col","min-h-16":"","w-full":"","items-start":"","justify-center":"","pb-2":"","pl-5":"","pr-4":"","pt-2":""},O=g({__name:"RadioCardSimple",props:f({id:null,name:null,value:null,title:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const a=w(e,"modelValue");return(m,s)=>(d(),n("label",{key:e.id,border:"2px solid",class:o(["form_radio-card-simple relative",[a.value===e.value?"bg-primary-50 dark:bg-primary-900/20 border-primary-100 dark:border-primary-900 hover:border-primary-500/30 dark:hover:border-primary-400/30":"bg-white dark:bg-neutral-900/20 border-neutral-100 dark:border-neutral-900 hover:border-primary-500/30 dark:hover:border-primary-400/30",a.value===e.value?"form_radio-card-simple-active":""]]),transition:"all duration-200 ease-in-out",flex:"~ col",block:"","min-w-50":"","w-fit":"","cursor-pointer":"","items-start":"","rounded-xl":"","p-4":"","text-left":""},[V(t("input",{"onUpdate:modelValue":s[0]||(s[0]=x=>a.value=x),checked:a.value===e.value,type:"radio",name:e.name,value:e.value,class:"[&:checked+div]:border-primary-500 dark:[&:checked+div]:border-primary-400 absolute opacity-0 [&:checked+div_.radio-dot]:opacity-100"},null,8,H),[[B,a.value]]),s[1]||(s[1]=t("div",{class:"radio-circle absolute left-2 top-2 size-5 rounded-full",border:"2 solid neutral-300 dark:neutral-600",transition:"all duration-200 ease-in-out"},[t("div",{class:"radio-dot absolute left-1/2 top-1/2 size-3 rounded-full opacity-0 -translate-x-1/2 -translate-y-1/2",transition:"all duration-200 ease-in-out",bg:"primary-500 dark:primary-400"})],-1)),t("div",K,[t("span",{class:o(["radio-item-name font-bold",[a.value===e.value?"text-neutral-700 dark:text-neutral-300":"text-neutral-500 dark:text-neutral-500"]]),text:"md",transition:"all duration-200 ease-in-out"},c(e.title),3),e.description?(d(),n("span",{key:0,class:o(["radio-item-description",[a.value===e.value?"text-neutral-600 dark:text-neutral-400":"text-neutral-400 dark:text-neutral-600"]]),transition:"all duration-200 ease-in-out"},c(e.description),3)):v("",!0)]),s[2]||(s[2]=t("div",{class:"bg-dotted-neutral-200/80 dark:bg-dotted-neutral-700/50 [input:checked~&]:bg-dotted-primary-300/50 dark:[input:checked~&]:bg-dotted-primary-200/20",absolute:"","inset-0":"","z--1":"",style:{"background-size":"10px 10px","mask-image":"linear-gradient(165deg, white 30%, transparent 50%)"}},null,-1))],2))}}),ue=C(O,[["__scopeId","data-v-dd41bc0b"]]),W={class:"radio-card-detail-many-select"},X={key:0,class:"relative","inline-flex":"~","w-full":"","items-center":""},Y=["placeholder"],Z={class:"mt-4 space-y-2"},_={key:0,class:"text-sm text-neutral-500 dark:text-neutral-400"},ee={key:1,class:"flex items-center gap-3 border border-2 border-amber-200 rounded-xl bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},te={class:"flex flex-col"},ae={class:"font-medium"},le={class:"text-sm text-amber-600 dark:text-amber-400"},re={class:"relative"},oe=g({__name:"RadioCardDetailManySelect",props:f({items:null,searchable:{type:Boolean,default:!0},searchPlaceholder:{default:"Search..."},searchNoResultsTitle:{default:"No results found"},searchNoResultsDescription:{default:"Try a different search term"},searchResultsText:{default:"{count} of {total} results"},customInputPlaceholder:{default:"Enter custom value"},expandButtonText:{default:"Show more"},collapseButtonText:{default:"Show less"},showMore:{type:Boolean,default:!0}},{modelValue:{required:!0},modelModifiers:{}}),emits:f(["update:customValue"],["update:modelValue"]),setup(e,{emit:a}){const m=e,s=a,x=w(e,"modelValue"),r=b(""),i=b(!1),R=b(""),h=S(()=>{if(!r.value)return m.items;const p=r.value.toLowerCase();return m.items.filter(l=>l.name.toLowerCase().includes(p)||l.description&&l.description.toLowerCase().includes(p))});function I(p){R.value=p,s("update:customValue",p)}return(p,l)=>(d(),n("div",W,[e.searchable?(d(),n("div",X,[l[4]||(l[4]=t("div",{class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"},[t("div",{"i-solar:magnifer-line-duotone":"",class:"text-neutral-500 dark:text-neutral-400"})],-1)),V(t("input",{"onUpdate:modelValue":l[0]||(l[0]=u=>r.value=u),type:"search",class:"w-full rounded-xl p-2.5 pl-10 text-sm outline-none",border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",bg:"white dark:neutral-900",placeholder:e.searchPlaceholder},null,8,Y),[[T,r.value]])])):v("",!0),t("div",Z,[r.value?(d(),n("div",_,c(e.searchResultsText.replace("{count}",h.value.length.toString()).replace("{total}",e.items.length.toString())),1)):v("",!0),r.value&&h.value.length===0?(d(),n("div",ee,[l[5]||(l[5]=t("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),t("div",te,[t("span",ae,c(e.searchNoResultsTitle),1),t("span",le,c(e.searchNoResultsDescription.replace("{query}",r.value)),1)])])):v("",!0),t("div",re,[t("div",{class:o(["scrollbar-hide grid auto-cols-[350px] grid-flow-col max-h-[calc(100dvh-7lh)] gap-4 overflow-x-auto pb-4",[i.value?"grid-cols-1 md:grid-cols-2 grid-flow-row auto-cols-auto":""]]),transition:"all duration-200 ease-in-out",style:{"scroll-snap-type":"x mandatory"}},[(d(!0),n(z,null,D(h.value,u=>(d(),E(G,{id:u.id,key:u.id,modelValue:x.value,"onUpdate:modelValue":l[1]||(l[1]=y=>x.value=y),value:u.id,title:u.name,description:u.description,deprecated:u.deprecated,"show-expand-collapse":e.showMore,"expand-collapse-threshold":100,"show-custom-input":u.customizable,"custom-input-value":R.value,"custom-input-placeholder":e.customInputPlaceholder,name:"radio-card-detail-many-select",class:"scroll-snap-align-start","onUpdate:customInputValue":l[2]||(l[2]=y=>I(y))},null,8,["id","modelValue","value","title","description","deprecated","show-expand-collapse","show-custom-input","custom-input-value","custom-input-placeholder"]))),128))],2),t("div",{bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"",class:o([i.value?"w-full":"mt-4 w-full rounded-lg"])},[t("button",{"w-full":"",flex:"","items-center":"","justify-center":"","gap-2":"","rounded-lg":"","py-2":"",transition:"all duration-200 ease-in-out",class:o([i.value?"bg-primary-500 hover:bg-primary-600 text-white":"bg-white dark:bg-neutral-900 hover:bg-neutral-100 dark:hover:bg-neutral-800"]),onClick:l[3]||(l[3]=u=>i.value=!i.value)},[t("span",null,c(i.value?e.collapseButtonText:e.expandButtonText),1),t("div",{class:o([i.value?"rotate-180":"","text-lg"]),"i-solar:alt-arrow-down-bold-duotone":"",transition:"transform duration-200 ease-in-out"},null,2)],2)],2)])])]))}}),ce=C(oe,[["__scopeId","data-v-0c2329bf"]]);export{ce as R,ue as a}; diff --git a/assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-CYRUbdP0.js b/assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-CPbYTBJt.js similarity index 95% rename from assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-CYRUbdP0.js rename to assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-CPbYTBJt.js index 27acb1f39a9a06ad4e9c7e4a78ac3f5c7d9bd0e3..ab6f017d5e0a2c6a04f96c900847b4431d8a6ab5 100644 --- a/assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-CYRUbdP0.js +++ b/assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-CPbYTBJt.js @@ -1 +1 @@ -import{d as B,q as N,bw as ee,c as b,o as f,b as I,m as T,A as O,u as l,a,z as H,bx as q,g as u,w as K,H as Q,D as S,C as R,bE as F,bH as te,by as oe,bG as ae,s as le,h as C,l as se,x as re,y as M,bU as A,bV as G,bQ as ie}from"./index--eYU5aQm.js";import{a as ne,_ as ue}from"./TestDummyMarker.vue_vue_type_script_setup_true_lang-Pam45T1i.js";import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{u as de,g as ve}from"./speech-BOhrg3WS.js";import{u as ce}from"./providers-YQf-rDZ1.js";import{_ as pe,a as me}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dsoa87PD.js";import{_ as ge}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CCsf2oJB.js";import{_ as fe,a as be}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BJL9_E_2.js";import{_ as _e}from"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";const he={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":""},xe=B({__name:"ProviderSettingsLayout2",props:{providerName:null,providerIcon:null,providerIconColor:null,onBack:{type:Function}},setup(_){const{t:o}=N();return(y,d)=>{const v=ee("motion");return f(),b(q,null,[I(_e,{title:_.providerName,subtitle:l(o)("settings.pages.providers.title")},null,8,["title","subtitle"]),T(y.$slots,"default"),O((f(),b("div",he,[a("div",{text:"60",class:H(_.providerIcon||_.providerIconColor)},null,2)])),[[v]])],64)}}}),ye={"w-full":"","rounded-xl":""},ke={class:"mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400","w-full":""},Se={class:"inline-flex items-center gap-4"},Ue={flex:"~ col gap-4"},we=["placeholder"],Ie=["placeholder"],Ve={flex:"~ col gap-6"},$e={grid:"~ cols-2 gap-4"},Te={class:"flex items-center gap-1 text-sm font-medium"},Le={class:"text-xs text-neutral-500 dark:text-neutral-400"},Re=["value"],Pe={flex:"~ row","gap-4":""},Ce=["disabled"],Me={flex:"~ row","items-center":"","gap-2":""},Oe={flex:"~ row","items-center":"","gap-2":""},ze={key:2,class:"mt-2 text-sm text-red-500"},Ke={key:3,class:"mt-2 text-sm text-red-500"},Be={key:4,class:"mt-2 text-sm text-red-500"},Ne=["src"],tt=B({__name:"SpeechPlayground",props:{defaultText:null,availableVoices:null,generateSpeech:{type:Function},apiKeyConfigured:{type:Boolean}},setup(_,{expose:o}){const y=_,{t:d}=N(),v=u(y.defaultText||"Hello! This is a test of the voice synthesis."),U=u(!1),t=u(""),p=u(""),g=u(null),i=u(!1),h=u(""),m=u("");K(()=>y.availableVoices,n=>{var r;n.length>0&&!m.value&&(m.value=((r=n[0])==null?void 0:r.id)||"")},{immediate:!0});async function x(){if(!(!v.value.trim()&&!i.value||i.value&&!h.value.trim()||!m.value)){U.value=!0,p.value="";try{t.value&&V();const n=i.value?h.value:v.value,r=await y.generateSpeech(n,m.value,i.value);t.value=URL.createObjectURL(new Blob([r])),setTimeout(()=>{g.value&&g.value.play()},100)}catch(n){console.error("Error generating speech:",n),p.value=n instanceof Error?n.message:"An unknown error occurred"}finally{U.value=!1}}}function V(){g.value&&(g.value.pause(),g.value.currentTime=0),t.value&&(URL.revokeObjectURL(t.value),t.value="")}return Q(()=>{t.value&&URL.revokeObjectURL(t.value)}),o({testText:v,ssmlText:h,useSSML:i,selectedVoice:m,isGenerating:U,audioUrl:t,errorMessage:p,audioPlayer:g,generateTestSpeech:x,stopTestAudio:V}),(n,r)=>(f(),b("div",ye,[a("h2",ke,[a("div",Se,[I(l(ne)),a("div",null,S(l(d)("settings.pages.providers.provider.elevenlabs.playground.title")),1)])]),a("div",Ue,[I(l(ue),{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=c=>i.value=c),label:l(d)("settings.pages.modules.speech.sections.section.voice-settings.use-ssml.label"),description:l(d)("settings.pages.modules.speech.sections.section.voice-settings.use-ssml.description")},null,8,["modelValue","label","description"]),i.value?O((f(),b("textarea",{key:1,"onUpdate:modelValue":r[2]||(r[2]=c=>h.value=c),placeholder:l(d)("settings.pages.modules.speech.sections.section.voice-settings.input-ssml.placeholder"),border:"neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700",transition:"all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900","h-48":"","w-full":"","rounded-lg":"","px-3":"","py-2":"","text-sm":"","font-mono":"","outline-none":""},null,8,Ie)),[[F,h.value]]):O((f(),b("textarea",{key:0,"onUpdate:modelValue":r[1]||(r[1]=c=>v.value=c),placeholder:l(d)("settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder"),border:"neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700",transition:"all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900","h-24":"","w-full":"","rounded-lg":"","px-3":"","py-2":"","text-sm":"","outline-none":""},null,8,we)),[[F,v.value]]),a("div",Ve,[a("label",$e,[a("div",null,[a("div",Te,S(l(d)("settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.label")),1),a("div",Le,S(l(d)("settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.description")),1)]),O(a("select",{"onUpdate:modelValue":r[3]||(r[3]=c=>m.value=c),border:"neutral-300 dark:neutral-800 solid 2 focus:neutral-400 dark:focus:neutral-600",transition:"border duration-250 ease-in-out","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":""},[(f(!0),b(q,null,oe(_.availableVoices,c=>(f(),b("option",{key:c.id,value:c.id},S(c.name),9,Re))),128))],512),[[te,m.value]])])]),a("div",Pe,[a("button",{border:"neutral-800 dark:neutral-200 solid 2",transition:"border duration-250 ease-in-out","rounded-lg":"","px-4":"",text:"neutral-100 dark:neutral-900","py-2":"","text-sm":"",disabled:U.value||!v.value.trim()&&!i.value||i.value&&!h.value.trim()||!m.value||!_.apiKeyConfigured,class:H({"opacity-50 cursor-not-allowed":U.value||!v.value.trim()&&!i.value||i.value&&!h.value.trim()||!m.value||!_.apiKeyConfigured}),bg:"neutral-700 dark:neutral-300",onClick:x},[a("div",Me,[r[4]||(r[4]=a("div",{"i-solar:play-circle-bold-duotone":""},null,-1)),a("span",null,S(U.value?l(d)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating"):l(d)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label")),1)])],10,Ce),t.value?(f(),b("button",{key:0,border:"primary-300 dark:primary-800 solid 2",transition:"border duration-250 ease-in-out","rounded-lg":"","px-4":"","py-2":"","text-sm":"",onClick:V},[a("div",Oe,[r[5]||(r[5]=a("div",{"i-solar:stop-circle-bold-duotone":""},null,-1)),a("span",null,S(l(d)("settings.pages.modules.speech.sections.section.playground.buttons.stop.label")),1)])])):R("",!0)]),_.apiKeyConfigured?R("",!0):(f(),b("div",ze,S(l(d)("settings.pages.providers.provider.elevenlabs.playground.validation.error-missing-api-key")),1)),m.value?R("",!0):(f(),b("div",Ke,S(l(d)("settings.pages.modules.speech.sections.section.playground.select-voice.required")),1)),p.value?(f(),b("div",Be,S(p.value),1)):R("",!0),t.value?(f(),b("audio",{key:5,ref_key:"audioPlayer",ref:g,src:t.value,controls:"",class:"mt-2 w-full"},null,8,Ne)):R("",!0)]),T(n.$slots,"default")]))}}),je={flex:"~ col md:row gap-6"},De={flex:"~ col gap-6"},Ee={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},Fe={flex:"~ col gap-4"},Ae={flex:"~ col gap-6",class:"w-full md:w-[60%]"},Ge={"w-full":"","rounded-xl":""},ot=B({__name:"SpeechProviderSettings",props:{providerId:null,defaultModel:null,additionalSettings:null},setup(_){const o=_,{t:y}=N(),d=ae(),v=ce(),U=de(),{providers:t}=le(v),p=C(()=>v.getProviderMetadata(o.providerId)),g=C({get:()=>{var e;return((e=t.value[o.providerId])==null?void 0:e.apiKey)||""},set:e=>{t.value[o.providerId]||(t.value[o.providerId]={}),t.value[o.providerId].apiKey=e}}),i=C({get:()=>{var e,s,k;return((e=t.value[o.providerId])==null?void 0:e.baseUrl)||((k=(s=p.value)==null?void 0:s.defaultOptions)==null?void 0:k.baseUrl)||""},set:e=>{t.value[o.providerId]||(t.value[o.providerId]={}),t.value[o.providerId].baseUrl=e}}),h=u("Hello! This is a test of voice synthesis."),m=u(!1),x=u(""),V=u(""),n=u(null),r=u(!1),c=u(""),j=u(""),w=u({});function J(){var e;(e=t.value[o.providerId])!=null&&e.voiceSettings?w.value={...t.value[o.providerId].voiceSettings}:w.value={pitch:0,speed:1,volume:0,...o.additionalSettings}}se(()=>{var e,s,k,$;v.initializeProvider(o.providerId),g.value=((e=t.value[o.providerId])==null?void 0:e.apiKey)||"",i.value=((s=t.value[o.providerId])==null?void 0:s.baseUrl)||(($=(k=p.value)==null?void 0:k.defaultOptions)==null?void 0:$.baseUrl)||"",J(),v.configuredProviders[o.providerId]&&U.loadVoicesForProvider(o.providerId)});const z=ie(()=>{var e,s;t.value[o.providerId]={...t.value[o.providerId],apiKey:g.value,baseUrl:i.value||((s=(e=p.value)==null?void 0:e.defaultOptions)==null?void 0:s.baseUrl)||"",voiceSettings:{...w.value}}},1e3);K([g,i],z),K(w,z,{deep:!0});async function W(){if(!h.value.trim()&&!r.value||r.value&&!c.value.trim())return;const e=v.getProviderInstance(o.providerId);if(!e){console.error("Failed to initialize speech provider");return}if(!j.value){console.error("No active speech voice selected");return}m.value=!0,V.value="";try{x.value&&D();const s=o.defaultModel||"default",k=r.value?c.value:h.value,$=await ve({...e.speech(s,{voiceSettings:w.value}),input:k,voice:j.value});x.value=URL.createObjectURL(new Blob([$])),setTimeout(()=>{n.value&&n.value.play()},100)}catch(s){console.error("Error generating speech:",s),V.value=s instanceof Error?s.message:"An unknown error occurred"}finally{m.value=!1}}function D(){n.value&&(n.value.pause(),n.value.currentTime=0),x.value&&(URL.revokeObjectURL(x.value),x.value="")}Q(()=>{x.value&&URL.revokeObjectURL(x.value)});function X(){var e,s;w.value={...((s=(e=p.value)==null?void 0:e.defaultOptions)==null?void 0:s.voiceSettings)||{}},z()}function Y(e,s){w.value[e]=s}const E=C(()=>({voiceSettings:w.value,updateVoiceSettings:Y,isGenerating:m.value,testText:h.value,useSSML:r.value,ssmlText:c.value,generateTestSpeech:W,stopTestAudio:D,audioUrl:x.value,audioPlayer:n.value,errorMessage:V.value}));return(e,s)=>{var k,$;return f(),re(xe,{"provider-name":(k=p.value)==null?void 0:k.localizedName,"provider-icon":($=p.value)==null?void 0:$.icon,"on-back":()=>l(d).back()},{default:M(()=>[a("div",je,[I(l(fe),{class:"w-full md:w-[40%]"},{default:M(()=>[I(l(be),{title:l(y)("settings.pages.providers.common.section.basic.title"),description:l(y)("settings.pages.providers.common.section.basic.description"),"on-reset":X},{default:M(()=>{var L;return[I(l(ge),{modelValue:g.value,"onUpdate:modelValue":s[0]||(s[0]=P=>g.value=P),"provider-name":(L=p.value)==null?void 0:L.localizedName,placeholder:"sk-"},null,8,["modelValue","provider-name"]),T(e.$slots,"basic-settings")]}),_:3},8,["title","description"]),a("div",De,[a("h2",Ee,S(l(y)("settings.pages.providers.common.section.voice.title")),1),a("div",Fe,[T(e.$slots,"voice-settings",A(G(E.value)))])]),I(l(pe),{title:l(y)("settings.pages.providers.common.section.advanced.title")},{default:M(()=>{var L,P;return[I(l(me),{modelValue:i.value,"onUpdate:modelValue":s[1]||(s[1]=Z=>i.value=Z),placeholder:((P=(L=p.value)==null?void 0:L.defaultOptions)==null?void 0:P.baseUrl)||"",required:""},null,8,["modelValue","placeholder"]),T(e.$slots,"advanced-settings")]}),_:3},8,["title"])]),_:3}),a("div",Ae,[a("div",Ge,[T(e.$slots,"playground",A(G(E.value)))])])])]),_:3},8,["provider-name","provider-icon","on-back"])}}});export{tt as _,ot as a}; +import{d as B,q as N,bw as ee,c as b,o as f,b as I,m as T,A as O,u as l,a,z as H,bx as q,g as u,w as K,H as Q,D as S,C as R,bE as F,bH as te,by as oe,bG as ae,s as le,h as C,l as se,x as re,y as M,bU as A,bV as G,bQ as ie}from"./index-D55VqdU4.js";import{a as ne,_ as ue}from"./TestDummyMarker.vue_vue_type_script_setup_true_lang-DRQbkM6R.js";import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{u as de,g as ve}from"./speech-BtNOtIn9.js";import{u as ce}from"./providers-DAp1566d.js";import{_ as pe,a as me}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-BtshDojk.js";import{_ as ge}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BMPV9bKe.js";import{_ as fe,a as be}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DLyRry-6.js";import{_ as _e}from"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";const he={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":""},xe=B({__name:"ProviderSettingsLayout2",props:{providerName:null,providerIcon:null,providerIconColor:null,onBack:{type:Function}},setup(_){const{t:o}=N();return(y,d)=>{const v=ee("motion");return f(),b(q,null,[I(_e,{title:_.providerName,subtitle:l(o)("settings.pages.providers.title")},null,8,["title","subtitle"]),T(y.$slots,"default"),O((f(),b("div",he,[a("div",{text:"60",class:H(_.providerIcon||_.providerIconColor)},null,2)])),[[v]])],64)}}}),ye={"w-full":"","rounded-xl":""},ke={class:"mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400","w-full":""},Se={class:"inline-flex items-center gap-4"},Ue={flex:"~ col gap-4"},we=["placeholder"],Ie=["placeholder"],Ve={flex:"~ col gap-6"},$e={grid:"~ cols-2 gap-4"},Te={class:"flex items-center gap-1 text-sm font-medium"},Le={class:"text-xs text-neutral-500 dark:text-neutral-400"},Re=["value"],Pe={flex:"~ row","gap-4":""},Ce=["disabled"],Me={flex:"~ row","items-center":"","gap-2":""},Oe={flex:"~ row","items-center":"","gap-2":""},ze={key:2,class:"mt-2 text-sm text-red-500"},Ke={key:3,class:"mt-2 text-sm text-red-500"},Be={key:4,class:"mt-2 text-sm text-red-500"},Ne=["src"],tt=B({__name:"SpeechPlayground",props:{defaultText:null,availableVoices:null,generateSpeech:{type:Function},apiKeyConfigured:{type:Boolean}},setup(_,{expose:o}){const y=_,{t:d}=N(),v=u(y.defaultText||"Hello! This is a test of the voice synthesis."),U=u(!1),t=u(""),p=u(""),g=u(null),i=u(!1),h=u(""),m=u("");K(()=>y.availableVoices,n=>{var r;n.length>0&&!m.value&&(m.value=((r=n[0])==null?void 0:r.id)||"")},{immediate:!0});async function x(){if(!(!v.value.trim()&&!i.value||i.value&&!h.value.trim()||!m.value)){U.value=!0,p.value="";try{t.value&&V();const n=i.value?h.value:v.value,r=await y.generateSpeech(n,m.value,i.value);t.value=URL.createObjectURL(new Blob([r])),setTimeout(()=>{g.value&&g.value.play()},100)}catch(n){console.error("Error generating speech:",n),p.value=n instanceof Error?n.message:"An unknown error occurred"}finally{U.value=!1}}}function V(){g.value&&(g.value.pause(),g.value.currentTime=0),t.value&&(URL.revokeObjectURL(t.value),t.value="")}return Q(()=>{t.value&&URL.revokeObjectURL(t.value)}),o({testText:v,ssmlText:h,useSSML:i,selectedVoice:m,isGenerating:U,audioUrl:t,errorMessage:p,audioPlayer:g,generateTestSpeech:x,stopTestAudio:V}),(n,r)=>(f(),b("div",ye,[a("h2",ke,[a("div",Se,[I(l(ne)),a("div",null,S(l(d)("settings.pages.providers.provider.elevenlabs.playground.title")),1)])]),a("div",Ue,[I(l(ue),{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=c=>i.value=c),label:l(d)("settings.pages.modules.speech.sections.section.voice-settings.use-ssml.label"),description:l(d)("settings.pages.modules.speech.sections.section.voice-settings.use-ssml.description")},null,8,["modelValue","label","description"]),i.value?O((f(),b("textarea",{key:1,"onUpdate:modelValue":r[2]||(r[2]=c=>h.value=c),placeholder:l(d)("settings.pages.modules.speech.sections.section.voice-settings.input-ssml.placeholder"),border:"neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700",transition:"all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900","h-48":"","w-full":"","rounded-lg":"","px-3":"","py-2":"","text-sm":"","font-mono":"","outline-none":""},null,8,Ie)),[[F,h.value]]):O((f(),b("textarea",{key:0,"onUpdate:modelValue":r[1]||(r[1]=c=>v.value=c),placeholder:l(d)("settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder"),border:"neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700",transition:"all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900","h-24":"","w-full":"","rounded-lg":"","px-3":"","py-2":"","text-sm":"","outline-none":""},null,8,we)),[[F,v.value]]),a("div",Ve,[a("label",$e,[a("div",null,[a("div",Te,S(l(d)("settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.label")),1),a("div",Le,S(l(d)("settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.description")),1)]),O(a("select",{"onUpdate:modelValue":r[3]||(r[3]=c=>m.value=c),border:"neutral-300 dark:neutral-800 solid 2 focus:neutral-400 dark:focus:neutral-600",transition:"border duration-250 ease-in-out","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":""},[(f(!0),b(q,null,oe(_.availableVoices,c=>(f(),b("option",{key:c.id,value:c.id},S(c.name),9,Re))),128))],512),[[te,m.value]])])]),a("div",Pe,[a("button",{border:"neutral-800 dark:neutral-200 solid 2",transition:"border duration-250 ease-in-out","rounded-lg":"","px-4":"",text:"neutral-100 dark:neutral-900","py-2":"","text-sm":"",disabled:U.value||!v.value.trim()&&!i.value||i.value&&!h.value.trim()||!m.value||!_.apiKeyConfigured,class:H({"opacity-50 cursor-not-allowed":U.value||!v.value.trim()&&!i.value||i.value&&!h.value.trim()||!m.value||!_.apiKeyConfigured}),bg:"neutral-700 dark:neutral-300",onClick:x},[a("div",Me,[r[4]||(r[4]=a("div",{"i-solar:play-circle-bold-duotone":""},null,-1)),a("span",null,S(U.value?l(d)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating"):l(d)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label")),1)])],10,Ce),t.value?(f(),b("button",{key:0,border:"primary-300 dark:primary-800 solid 2",transition:"border duration-250 ease-in-out","rounded-lg":"","px-4":"","py-2":"","text-sm":"",onClick:V},[a("div",Oe,[r[5]||(r[5]=a("div",{"i-solar:stop-circle-bold-duotone":""},null,-1)),a("span",null,S(l(d)("settings.pages.modules.speech.sections.section.playground.buttons.stop.label")),1)])])):R("",!0)]),_.apiKeyConfigured?R("",!0):(f(),b("div",ze,S(l(d)("settings.pages.providers.provider.elevenlabs.playground.validation.error-missing-api-key")),1)),m.value?R("",!0):(f(),b("div",Ke,S(l(d)("settings.pages.modules.speech.sections.section.playground.select-voice.required")),1)),p.value?(f(),b("div",Be,S(p.value),1)):R("",!0),t.value?(f(),b("audio",{key:5,ref_key:"audioPlayer",ref:g,src:t.value,controls:"",class:"mt-2 w-full"},null,8,Ne)):R("",!0)]),T(n.$slots,"default")]))}}),je={flex:"~ col md:row gap-6"},De={flex:"~ col gap-6"},Ee={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},Fe={flex:"~ col gap-4"},Ae={flex:"~ col gap-6",class:"w-full md:w-[60%]"},Ge={"w-full":"","rounded-xl":""},ot=B({__name:"SpeechProviderSettings",props:{providerId:null,defaultModel:null,additionalSettings:null},setup(_){const o=_,{t:y}=N(),d=ae(),v=ce(),U=de(),{providers:t}=le(v),p=C(()=>v.getProviderMetadata(o.providerId)),g=C({get:()=>{var e;return((e=t.value[o.providerId])==null?void 0:e.apiKey)||""},set:e=>{t.value[o.providerId]||(t.value[o.providerId]={}),t.value[o.providerId].apiKey=e}}),i=C({get:()=>{var e,s,k;return((e=t.value[o.providerId])==null?void 0:e.baseUrl)||((k=(s=p.value)==null?void 0:s.defaultOptions)==null?void 0:k.baseUrl)||""},set:e=>{t.value[o.providerId]||(t.value[o.providerId]={}),t.value[o.providerId].baseUrl=e}}),h=u("Hello! This is a test of voice synthesis."),m=u(!1),x=u(""),V=u(""),n=u(null),r=u(!1),c=u(""),j=u(""),w=u({});function J(){var e;(e=t.value[o.providerId])!=null&&e.voiceSettings?w.value={...t.value[o.providerId].voiceSettings}:w.value={pitch:0,speed:1,volume:0,...o.additionalSettings}}se(()=>{var e,s,k,$;v.initializeProvider(o.providerId),g.value=((e=t.value[o.providerId])==null?void 0:e.apiKey)||"",i.value=((s=t.value[o.providerId])==null?void 0:s.baseUrl)||(($=(k=p.value)==null?void 0:k.defaultOptions)==null?void 0:$.baseUrl)||"",J(),v.configuredProviders[o.providerId]&&U.loadVoicesForProvider(o.providerId)});const z=ie(()=>{var e,s;t.value[o.providerId]={...t.value[o.providerId],apiKey:g.value,baseUrl:i.value||((s=(e=p.value)==null?void 0:e.defaultOptions)==null?void 0:s.baseUrl)||"",voiceSettings:{...w.value}}},1e3);K([g,i],z),K(w,z,{deep:!0});async function W(){if(!h.value.trim()&&!r.value||r.value&&!c.value.trim())return;const e=v.getProviderInstance(o.providerId);if(!e){console.error("Failed to initialize speech provider");return}if(!j.value){console.error("No active speech voice selected");return}m.value=!0,V.value="";try{x.value&&D();const s=o.defaultModel||"default",k=r.value?c.value:h.value,$=await ve({...e.speech(s,{voiceSettings:w.value}),input:k,voice:j.value});x.value=URL.createObjectURL(new Blob([$])),setTimeout(()=>{n.value&&n.value.play()},100)}catch(s){console.error("Error generating speech:",s),V.value=s instanceof Error?s.message:"An unknown error occurred"}finally{m.value=!1}}function D(){n.value&&(n.value.pause(),n.value.currentTime=0),x.value&&(URL.revokeObjectURL(x.value),x.value="")}Q(()=>{x.value&&URL.revokeObjectURL(x.value)});function X(){var e,s;w.value={...((s=(e=p.value)==null?void 0:e.defaultOptions)==null?void 0:s.voiceSettings)||{}},z()}function Y(e,s){w.value[e]=s}const E=C(()=>({voiceSettings:w.value,updateVoiceSettings:Y,isGenerating:m.value,testText:h.value,useSSML:r.value,ssmlText:c.value,generateTestSpeech:W,stopTestAudio:D,audioUrl:x.value,audioPlayer:n.value,errorMessage:V.value}));return(e,s)=>{var k,$;return f(),re(xe,{"provider-name":(k=p.value)==null?void 0:k.localizedName,"provider-icon":($=p.value)==null?void 0:$.icon,"on-back":()=>l(d).back()},{default:M(()=>[a("div",je,[I(l(fe),{class:"w-full md:w-[40%]"},{default:M(()=>[I(l(be),{title:l(y)("settings.pages.providers.common.section.basic.title"),description:l(y)("settings.pages.providers.common.section.basic.description"),"on-reset":X},{default:M(()=>{var L;return[I(l(ge),{modelValue:g.value,"onUpdate:modelValue":s[0]||(s[0]=P=>g.value=P),"provider-name":(L=p.value)==null?void 0:L.localizedName,placeholder:"sk-"},null,8,["modelValue","provider-name"]),T(e.$slots,"basic-settings")]}),_:3},8,["title","description"]),a("div",De,[a("h2",Ee,S(l(y)("settings.pages.providers.common.section.voice.title")),1),a("div",Fe,[T(e.$slots,"voice-settings",A(G(E.value)))])]),I(l(pe),{title:l(y)("settings.pages.providers.common.section.advanced.title")},{default:M(()=>{var L,P;return[I(l(me),{modelValue:i.value,"onUpdate:modelValue":s[1]||(s[1]=Z=>i.value=Z),placeholder:((P=(L=p.value)==null?void 0:L.defaultOptions)==null?void 0:P.baseUrl)||"",required:""},null,8,["modelValue","placeholder"]),T(e.$slots,"advanced-settings")]}),_:3},8,["title"])]),_:3}),a("div",Ae,[a("div",Ge,[T(e.$slots,"playground",A(G(E.value)))])])])]),_:3},8,["provider-name","provider-icon","on-back"])}}});export{tt as _,ot as a}; diff --git a/assets/Stage-BD8JBwgH.css b/assets/Stage-DNNKwjzW.css similarity index 99% rename from assets/Stage-BD8JBwgH.css rename to assets/Stage-DNNKwjzW.css index ffe86684e782ee849a881a2fe9c8e2cef204f50a..a1c72064110d97119e6204ffc16e760d897f141d 100644 --- a/assets/Stage-BD8JBwgH.css +++ b/assets/Stage-DNNKwjzW.css @@ -1 +1 @@ -.form_input-range[data-v-6ca6d31c]{--height: 2em;min-height:var(--height);-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border-radius:4px;transition:background-color .2s ease;--thumb-width: 4px;--thumb-height: var(--height);--thumb-box-shadow: 0 0 0px #e6e6e6;--thumb-border: none;--thumb-border-radius: 999px;--thumb-background: oklch(80% var(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 0));--thumb-background-hover: oklch(90% var(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 0));--thumb-background-active: oklch(70% var(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 0));--track-height: calc(var(--height) - var(--track-value-padding) * 2);--track-box-shadow: none;--track-border: solid 2px rgb(238, 238, 238);--track-border-radius: 6px;--track-background: rgb(238, 238, 238);--track-background-hover: rgb(238, 238, 238);--track-background-active: rgb(238, 238, 238);--track-value-background: rgb(255, 255, 255);--track-value-background-hover: rgb(255, 255, 255);--track-value-background-active: rgb(255, 255, 255);--track-value-padding: 2px}.dark .form_input-range[data-v-6ca6d31c]{--thumb-background: oklch(70% var(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 0));--thumb-background-hover: oklch(90% var(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 0));--thumb-background-active: oklch(80% var(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 0));--track-border: solid 2px rgb(44, 44, 44);--track-background: rgb(44, 44, 44);--track-background-hover: rgb(44, 44, 44);--track-background-active: rgb(44, 44, 44);--track-value-background: rgb(164, 164, 164);--track-value-background-hover: rgb(164, 164, 164);--track-value-background-active: rgb(164, 164, 164)}.form_input-range.slider-progress[data-v-6ca6d31c]{--range: calc(var(--max) - var(--min));--ratio: calc((var(--value) - var(--min)) / var(--range));--sx: calc(.5 * 0em + var(--ratio) * (100% - 0em))}.form_input-range[data-v-6ca6d31c]:focus{outline:none}.form_input-range[data-v-6ca6d31c]::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:var(--thumb-width);height:var(--thumb-height);border-radius:var(--thumb-border-radius);background:var(--thumb-background);border:var(--thumb-border);box-shadow:var(--thumb-box-shadow);margin-top:calc(var(--track-height) * .5 - var(--thumb-height) * .5 - 2px);margin-left:calc(0 - var(--track-value-padding));cursor:col-resize;transition:background .2s ease-in-out,box-shadow .2s ease-in-out,border-color .2s ease-in-out,transform .2s ease-in-out}.form_input-range[data-v-6ca6d31c]::-webkit-slider-runnable-track{height:var(--track-height);border:var(--track-border);border-radius:var(--track-border-radius);background:var(--track-background);box-shadow:var(--track-box-shadow);position:relative;cursor:col-resize;transition:box-shadow .2s ease-in-out,border-color .2s ease-in-out}.form_input-range[data-v-6ca6d31c]::-webkit-slider-thumb:hover{background:var(--thumb-background-hover)}.form_input-range[data-v-6ca6d31c]:hover::-webkit-slider-runnable-track{background:var(--track-background-hover)}.form_input-range[data-v-6ca6d31c]::-webkit-slider-thumb:active{background:var(--thumb-background-active)}.form_input-range[data-v-6ca6d31c]:active::-webkit-slider-runnable-track{background:var(--track-background-active)}.form_input-range.slider-progress[data-v-6ca6d31c]::-webkit-slider-runnable-track{margin-right:calc(0 - var(--track-value-padding));background:linear-gradient(var(--track-value-background),var(--track-value-background)) 0 / var(--sx) 100% no-repeat,var(--track-background)}.form_input-range.slider-progress[data-v-6ca6d31c]:hover::-webkit-slider-runnable-track{background:linear-gradient(var(--track-value-background-hover),var(--track-value-background-hover)) 0 / var(--sx) 100% no-repeat,var(--track-background-hover)}.form_input-range.slider-progress[data-v-6ca6d31c]:active::-webkit-slider-runnable-track{background:linear-gradient(var(--track-value-background-active),var(--track-value-background-active)) 0 / var(--sx) 100% no-repeat,var(--track-background-active)}.form_input-range[data-v-6ca6d31c]::-moz-range-thumb{width:var(--thumb-width);height:var(--thumb-height);border-radius:var(--thumb-border-radius);background:var(--thumb-background);border:none;box-shadow:var(--thumb-box-shadow);cursor:col-resize;margin-left:calc(0 - var(--track-value-padding))}.form_input-range[data-v-6ca6d31c]::-moz-range-track{height:var(--track-height);border:var(--track-border);border-radius:var(--track-border-radius);background:var(--track-background);box-shadow:var(--track-box-shadow);cursor:col-resize;width:calc(100% - var(--track-value-padding) * 2)}.form_input-range[data-v-6ca6d31c]::-moz-range-thumb:hover{background:var(--thumb-background-hover)}.form_input-range[data-v-6ca6d31c]:hover::-moz-range-track{background:var(--track-background-hover)}.form_input-range[data-v-6ca6d31c]::-moz-range-thumb:active{background:var(--thumb-background-active)}.form_input-range[data-v-6ca6d31c]:active::-moz-range-track{background:var(--track-background-active)}.form_input-range.slider-progress[data-v-6ca6d31c]::-moz-range-track{background:linear-gradient(var(--track-value-background),var(--track-value-background)) 0 / var(--sx) 100% no-repeat,var(--track-background)}.form_input-range.slider-progress[data-v-6ca6d31c]:hover::-moz-range-track{background:linear-gradient(var(--track-value-background-hover),var(--track-value-background-hover)) 0 / var(--sx) 100% no-repeat,var(--track-background-hover)}.form_input-range.slider-progress[data-v-6ca6d31c]:active::-moz-range-track{background:linear-gradient(var(--track-value-background-active),var(--track-value-background-active)) 0 / var(--sx) 100% no-repeat,var(--track-background-active)}.form_input-range[data-v-6ca6d31c]::-ms-fill-upper{background:transparent;border-color:transparent}.form_input-range[data-v-6ca6d31c]::-ms-fill-lower{background:transparent;border-color:transparent}.form_input-range[data-v-6ca6d31c]::-ms-thumb{width:var(--thumb-width);height:var(--thumb-height);border-radius:var(--thumb-border-radius);background:var(--thumb-background);border:var(--thumb-border);box-shadow:var(--thumb-box-shadow);margin-top:0;margin-left:calc(0 - var(--track-value-padding));box-sizing:border-box;cursor:col-resize}.form_input-range[data-v-6ca6d31c]::-ms-track{height:var(--track-height);border-radius:var(--track-border-radius);background:var(--track-background);border:var(--track-border);box-shadow:var(--track-box-shadow);box-sizing:border-box;cursor:col-resize}.form_input-range[data-v-6ca6d31c]::-ms-thumb:hover{background:var(--thumb-background-hover)}.form_input-range[data-v-6ca6d31c]:hover::-ms-track{background:var(--track-background-hover)}.form_input-range[data-v-6ca6d31c]::-ms-thumb:active{background:var(--thumb-background-active)}.form_input-range[data-v-6ca6d31c]:active::-ms-track{background:var(--track-background-active)}.form_input-range.slider-progress[data-v-6ca6d31c]::-ms-fill-lower{height:var(--track-height);border-radius:var(--track-border-radius) 0 0 var(--track-border-radius);margin:0;background:var(--track-value-background);border:none;border-right-width:0;margin-left:calc(var(--track-value-padding));margin-right:calc(0 - var(--track-value-padding))}.form_input-range.slider-progress[data-v-6ca6d31c]:hover::-ms-fill-lower{background:var(--track-value-background-hover)}.form_input-range.slider-progress[data-v-6ca6d31c]:active::-ms-fill-lower{background:var(--track-value-background-active)}.form_radio-card-detail[data-v-c9195151]{position:relative;overflow:hidden}.form_radio-card-detail[data-v-c9195151]:before{pointer-events:none;--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;width:25%;height:100%;transition:all .35s ease-in-out;-webkit-mask-image:linear-gradient(120deg,#fff);mask-image:linear-gradient(120deg,#fff);opacity:0}.dark .form_radio-card-detail[data-v-c9195151]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position)}.form_radio-card-detail[data-v-c9195151]:hover:before,.form_radio-card-detail._hover[data-v-c9195151]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));width:85%;opacity:1}.dark .form_radio-card-detail[data-v-c9195151]:hover:before,.dark .form_radio-card-detail._hover[data-v-c9195151]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.form_radio-card-detail-active[data-v-c9195151]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));width:85%;opacity:.5}.dark .form_radio-card-detail-active[data-v-c9195151]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.form_radio-card-simple[data-v-dd41bc0b]{position:relative;overflow:hidden}.form_radio-card-simple[data-v-dd41bc0b]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;width:25%;height:100%;transition:all .35s ease-in-out;-webkit-mask-image:linear-gradient(120deg,#fff);mask-image:linear-gradient(120deg,#fff);opacity:0}.dark .form_radio-card-simple[data-v-dd41bc0b]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position)}.form_radio-card-simple[data-v-dd41bc0b]:hover:before,.form_radio-card-simple._hover[data-v-dd41bc0b]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));width:85%;opacity:1}.dark .form_radio-card-simple[data-v-dd41bc0b]:hover:before,.dark .form_radio-card-simple._hover[data-v-dd41bc0b]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.form_radio-card-simple-active[data-v-dd41bc0b]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));width:85%;opacity:.5}.dark .form_radio-card-simple-active[data-v-dd41bc0b]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}input[type=search][data-v-0c2329bf]::-webkit-search-cancel-button{display:none}.form_voice-card[data-v-dbab964e]{position:relative;overflow:hidden;display:flex;flex-direction:column}.form_voice-card[data-v-dbab964e]:before{pointer-events:none;--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;width:25%;height:100%;transition:all .35s ease-in-out;-webkit-mask-image:linear-gradient(120deg,#fff);mask-image:linear-gradient(120deg,#fff);opacity:0}.dark .form_voice-card[data-v-dbab964e]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position)}.form_voice-card[data-v-dbab964e]:hover:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));width:85%;opacity:1}.dark .form_voice-card[data-v-dbab964e]:hover:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}input[type=search][data-v-070104a7]::-webkit-search-cancel-button{display:none}.voice-card[data-v-070104a7]{position:relative;overflow:hidden;display:flex;flex-direction:column}.voice-card[data-v-070104a7]:before{pointer-events:none;--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;width:25%;height:100%;transition:all .35s ease-in-out;-webkit-mask-image:linear-gradient(120deg,#fff);mask-image:linear-gradient(120deg,#fff);opacity:0}.dark .voice-card[data-v-070104a7]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position)}.voice-card[data-v-070104a7]:hover:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));width:85%;opacity:1}.dark .voice-card[data-v-070104a7]:hover:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.volumed[data-v-568551bc]{transform-style:preserve-3d;width:fit-content;height:fit-content}.test-dummy-flat[data-v-b4ef37ac]{display:inline-block;position:relative}.test-dummy-flat .marker[data-v-b4ef37ac]{position:absolute;top:0;right:0;bottom:0;left:0;background:conic-gradient(#ffeb3b,#ffeb3b 90deg,#000 90deg,#000 180deg,#ffeb3b 180deg,#ffeb3b 270deg,#000 270deg,#000 360deg);border-radius:50%;box-shadow:0 4px 12px #b9b9b933}.dark .test-dummy-flat .marker[data-v-b4ef37ac]{box-shadow:0 4px 12px #0003}.menu-icon-item[data-v-656e0116]{position:relative;overflow:hidden}.menu-icon-item[data-v-656e0116]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;width:25%;height:100%;-webkit-mask-image:linear-gradient(120deg,white 30%,transparent 50%);mask-image:linear-gradient(120deg,white 30%,transparent 50%);opacity:0;transition:all .4s ease-in-out}.dark .menu-icon-item[data-v-656e0116]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position)}.menu-icon-item[data-v-656e0116]:hover:before,.menu-icon-item._hover[data-v-656e0116]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));width:85%;opacity:1}.dark .menu-icon-item[data-v-656e0116]:hover:before,.dark .menu-icon-item._hover[data-v-656e0116]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.menu-icon-item[data-v-656e0116]:after{background-image:radial-gradient(circle at 1px 1px,rgb(229 229 229 / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.6;position:absolute;top:0;right:0;bottom:0;left:0;z-index:-2;width:100%;height:100%;background-size:10px 10px;content:"";-webkit-mask-image:linear-gradient(165deg,white 30%,transparent 50%);mask-image:linear-gradient(165deg,white 30%,transparent 50%);transition:all .4s ease-in-out}.menu-icon-item[data-v-656e0116]:after:hover{background-image:radial-gradient(circle at 1px 1px,oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.5}.dark .menu-icon-item[data-v-656e0116]:after{background-image:radial-gradient(circle at 1px 1px,rgb(64 64 64 / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.25}.dark .menu-icon-item[data-v-656e0116]:after:hover{background-image:radial-gradient(circle at 1px 1px,oklch(90% var(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.2}.menu-icon-item-icon[data-v-656e0116]{opacity:.5}.menu-icon-item:hover .menu-icon-item-title[data-v-656e0116],.menu-icon-item._hover .menu-icon-item-title[data-v-656e0116]{--un-text-opacity:1;color:oklch(54% var(--theme-colors-chroma-600) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}.menu-icon-item:hover .menu-icon-item-description[data-v-656e0116],.menu-icon-item._hover .menu-icon-item-description[data-v-656e0116]{--un-text-opacity:1;color:oklch(54% var(--theme-colors-chroma-600) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity));opacity:.8}.menu-icon-item:hover .menu-icon-item-icon[data-v-656e0116],.menu-icon-item._hover .menu-icon-item-icon[data-v-656e0116]{--un-text-opacity:1;color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity));scale:1.2}.dark .menu-icon-item:hover .menu-icon-item-title[data-v-656e0116],.dark .menu-icon-item._hover .menu-icon-item-title[data-v-656e0116]{--un-text-opacity:1;color:oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}.dark .menu-icon-item:hover .menu-icon-item-description[data-v-656e0116],.dark .menu-icon-item._hover .menu-icon-item-description[data-v-656e0116]{--un-text-opacity:1;color:oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity));opacity:.8}.dark .menu-icon-item:hover .menu-icon-item-icon[data-v-656e0116],.dark .menu-icon-item._hover .menu-icon-item-icon[data-v-656e0116]{--un-text-opacity:1;color:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}.menu-icon-status-item[data-v-6e5b5c9c]{position:relative;overflow:hidden}.menu-icon-status-item[data-v-6e5b5c9c]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;width:25%;height:100%;transition:all .4s ease-in-out;-webkit-mask-image:linear-gradient(120deg,#fff);mask-image:linear-gradient(120deg,#fff);opacity:0}.dark .menu-icon-status-item[data-v-6e5b5c9c]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position)}.menu-icon-status-item[data-v-6e5b5c9c]:hover:before,.menu-icon-status-item._hover[data-v-6e5b5c9c]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));width:50%;opacity:1}.dark .menu-icon-status-item[data-v-6e5b5c9c]:hover:before,.dark .menu-icon-status-item._hover[data-v-6e5b5c9c]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.menu-icon-status-item-link[data-v-6e5b5c9c]:after{background-image:radial-gradient(circle at 1px 1px,rgb(229 229 229 / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.8;position:absolute;top:0;right:0;bottom:0;left:0;z-index:-2;width:100%;height:100%;background-size:10px 10px;content:"";-webkit-mask-image:linear-gradient(165deg,white 30%,transparent 50%);mask-image:linear-gradient(165deg,white 30%,transparent 50%);transition:all .4s ease-in-out}.menu-icon-status-item-link[data-v-6e5b5c9c]:after:hover{background-image:radial-gradient(circle at 1px 1px,oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.5}.dark .menu-icon-status-item-link[data-v-6e5b5c9c]:after{background-image:radial-gradient(circle at 1px 1px,rgb(64 64 64 / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.4}.dark .menu-icon-status-item-link[data-v-6e5b5c9c]:after:hover{background-image:radial-gradient(circle at 1px 1px,oklch(90% var(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.2}.menu-icon-status-item-icon-color[data-v-6e5b5c9c]{opacity:.5}.menu-icon-status-item:hover .menu-icon-status-item-title[data-v-6e5b5c9c],.menu-icon-status-item._hover .menu-icon-status-item-title[data-v-6e5b5c9c]{--un-text-opacity:1;color:oklch(54% var(--theme-colors-chroma-600) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}.menu-icon-status-item:hover .menu-icon-status-item-description[data-v-6e5b5c9c],.menu-icon-status-item._hover .menu-icon-status-item-description[data-v-6e5b5c9c]{--un-text-opacity:1;color:oklch(54% var(--theme-colors-chroma-600) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity));opacity:.8}.menu-icon-status-item:hover .menu-icon-status-item-icon[data-v-6e5b5c9c],.menu-icon-status-item._hover .menu-icon-status-item-icon[data-v-6e5b5c9c],.menu-icon-status-item:hover .menu-icon-status-item-icon-color[data-v-6e5b5c9c],.menu-icon-status-item._hover .menu-icon-status-item-icon-color[data-v-6e5b5c9c]{--un-text-opacity:1;color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity));scale:1.2}.dark .menu-icon-status-item:hover .menu-icon-status-item-title[data-v-6e5b5c9c],.dark .menu-icon-status-item._hover .menu-icon-status-item-title[data-v-6e5b5c9c]{--un-text-opacity:1;color:oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}.dark .menu-icon-status-item:hover .menu-icon-status-item-description[data-v-6e5b5c9c],.dark .menu-icon-status-item._hover .menu-icon-status-item-description[data-v-6e5b5c9c]{--un-text-opacity:1;color:oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity));opacity:.8}.dark .menu-icon-status-item:hover .menu-icon-status-item-icon[data-v-6e5b5c9c],.dark .menu-icon-status-item._hover .menu-icon-status-item-icon[data-v-6e5b5c9c],.dark .menu-icon-status-item:hover .menu-icon-status-item-icon-color[data-v-6e5b5c9c],.dark .menu-icon-status-item._hover .menu-icon-status-item-icon-color[data-v-6e5b5c9c]{--un-text-opacity:1;color:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}.skeleton[data-v-f404da2a]{position:relative;transition:all .2s ease-in-out}.skeleton-pulse[data-v-f404da2a]{animation:skeleton-pulse-f404da2a 1.5s ease-in-out .5s infinite}@keyframes skeleton-pulse-f404da2a{0%{opacity:1}50%{opacity:.5}to{opacity:1}}.skeleton-wave[data-v-f404da2a]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;transform:translate(-100%);background:linear-gradient(90deg,transparent,rgba(255,255,255,.2),transparent);animation:skeleton-wave-f404da2a 1.5s infinite;border-radius:inherit}.dark .skeleton-wave[data-v-f404da2a]:after{background:linear-gradient(90deg,transparent,rgba(255,255,255,.1),transparent)}@keyframes skeleton-wave-f404da2a{0%{transform:translate(-100%)}60%{transform:translate(100%)}to{transform:translate(100%)}}.card-hover-effect[data-v-895421da]{transform-style:preserve-3d;transform-origin:center;will-change:transform;transition:transform .3s cubic-bezier(.23,1,.32,1)}.card-hover-effect[data-v-895421da]:before,.card-hover-effect[data-v-895421da]:after{content:"";position:absolute;left:0;right:0;bottom:0;top:0;background-repeat:no-repeat;transition:all .33s ease;pointer-events:none}.card-hover-effect[data-v-895421da]:before{background-position:var(--card-position-x) var(--card-position-y);background-size:300% 300%;background-image:linear-gradient(115deg,transparent 0%,rgba(var(--color-primary-500),calc(.3 * var(--effect-intensity))) 25%,transparent 47%,transparent 53%,rgba(var(--color-primary-600),calc(.3 * var(--effect-intensity))) 75%,transparent 100%);opacity:calc(.5 * var(--effect-intensity));filter:brightness(.5) contrast(1);z-index:1;mix-blend-mode:color-dodge}.card-hover-effect[data-v-895421da]:after{background-position:var(--sparkle-position-x) var(--sparkle-position-y);background-size:160%;background-image:linear-gradient(125deg,rgba(var(--color-primary-500),calc(.3 * var(--effect-intensity))) 15%,rgba(var(--color-primary-400),calc(.25 * var(--effect-intensity))) 30%,rgba(var(--color-primary-300),calc(.2 * var(--effect-intensity))) 40%,rgba(var(--color-primary-200),calc(.1 * var(--effect-intensity))) 60%,rgba(var(--color-primary-400),calc(.25 * var(--effect-intensity))) 70%,rgba(var(--color-primary-500),calc(.3 * var(--effect-intensity))) 85%);background-blend-mode:overlay;opacity:calc(var(--sparkle-opacity) * var(--effect-intensity));filter:brightness(1) contrast(1);z-index:2;mix-blend-mode:color-dodge}.card-hover-effect[data-v-895421da]:hover:before{opacity:calc(.88 * var(--effect-intensity));filter:brightness(.66) contrast(1.33)}.card-hover-effect[data-v-895421da]:hover:after{opacity:var(--effect-intensity);filter:brightness(1.1) contrast(1.2)}.animate-stripe[data-v-b414abf5]{background-image:repeating-linear-gradient(-45deg,#f472b6,#f472b6 25px,#f9a8d4 25px,#f9a8d4 50px);animation:progress-b414abf5 2s linear infinite;background-size:150% 100%}@-webkit-keyframes progress-b414abf5{0%{background-position:0 0}to{background-position:-75px 0px}}@-moz-keyframes progress-b414abf5{0%{background-position:0 0}to{background-position:-75px 0px}}@-ms-keyframes progress-b414abf5{0%{background-position:0 0}to{background-position:-75px 0px}}@keyframes progress-b414abf5{0%{background-position:0 0}to{background-position:-70px 0px}} +.form_input-range[data-v-6ca6d31c]{--height: 2em;min-height:var(--height);-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border-radius:4px;transition:background-color .2s ease;--thumb-width: 4px;--thumb-height: var(--height);--thumb-box-shadow: 0 0 0px #e6e6e6;--thumb-border: none;--thumb-border-radius: 999px;--thumb-background: oklch(80% var(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 0));--thumb-background-hover: oklch(90% var(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 0));--thumb-background-active: oklch(70% var(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 0));--track-height: calc(var(--height) - var(--track-value-padding) * 2);--track-box-shadow: none;--track-border: solid 2px rgb(238, 238, 238);--track-border-radius: 6px;--track-background: rgb(238, 238, 238);--track-background-hover: rgb(238, 238, 238);--track-background-active: rgb(238, 238, 238);--track-value-background: rgb(255, 255, 255);--track-value-background-hover: rgb(255, 255, 255);--track-value-background-active: rgb(255, 255, 255);--track-value-padding: 2px}.dark .form_input-range[data-v-6ca6d31c]{--thumb-background: oklch(70% var(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 0));--thumb-background-hover: oklch(90% var(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 0));--thumb-background-active: oklch(80% var(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 0));--track-border: solid 2px rgb(44, 44, 44);--track-background: rgb(44, 44, 44);--track-background-hover: rgb(44, 44, 44);--track-background-active: rgb(44, 44, 44);--track-value-background: rgb(164, 164, 164);--track-value-background-hover: rgb(164, 164, 164);--track-value-background-active: rgb(164, 164, 164)}.form_input-range.slider-progress[data-v-6ca6d31c]{--range: calc(var(--max) - var(--min));--ratio: calc((var(--value) - var(--min)) / var(--range));--sx: calc(.5 * 0em + var(--ratio) * (100% - 0em))}.form_input-range[data-v-6ca6d31c]:focus{outline:none}.form_input-range[data-v-6ca6d31c]::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:var(--thumb-width);height:var(--thumb-height);border-radius:var(--thumb-border-radius);background:var(--thumb-background);border:var(--thumb-border);box-shadow:var(--thumb-box-shadow);margin-top:calc(var(--track-height) * .5 - var(--thumb-height) * .5 - 2px);margin-left:calc(0 - var(--track-value-padding));cursor:col-resize;transition:background .2s ease-in-out,box-shadow .2s ease-in-out,border-color .2s ease-in-out,transform .2s ease-in-out}.form_input-range[data-v-6ca6d31c]::-webkit-slider-runnable-track{height:var(--track-height);border:var(--track-border);border-radius:var(--track-border-radius);background:var(--track-background);box-shadow:var(--track-box-shadow);position:relative;cursor:col-resize;transition:box-shadow .2s ease-in-out,border-color .2s ease-in-out}.form_input-range[data-v-6ca6d31c]::-webkit-slider-thumb:hover{background:var(--thumb-background-hover)}.form_input-range[data-v-6ca6d31c]:hover::-webkit-slider-runnable-track{background:var(--track-background-hover)}.form_input-range[data-v-6ca6d31c]::-webkit-slider-thumb:active{background:var(--thumb-background-active)}.form_input-range[data-v-6ca6d31c]:active::-webkit-slider-runnable-track{background:var(--track-background-active)}.form_input-range.slider-progress[data-v-6ca6d31c]::-webkit-slider-runnable-track{margin-right:calc(0 - var(--track-value-padding));background:linear-gradient(var(--track-value-background),var(--track-value-background)) 0 / var(--sx) 100% no-repeat,var(--track-background)}.form_input-range.slider-progress[data-v-6ca6d31c]:hover::-webkit-slider-runnable-track{background:linear-gradient(var(--track-value-background-hover),var(--track-value-background-hover)) 0 / var(--sx) 100% no-repeat,var(--track-background-hover)}.form_input-range.slider-progress[data-v-6ca6d31c]:active::-webkit-slider-runnable-track{background:linear-gradient(var(--track-value-background-active),var(--track-value-background-active)) 0 / var(--sx) 100% no-repeat,var(--track-background-active)}.form_input-range[data-v-6ca6d31c]::-moz-range-thumb{width:var(--thumb-width);height:var(--thumb-height);border-radius:var(--thumb-border-radius);background:var(--thumb-background);border:none;box-shadow:var(--thumb-box-shadow);cursor:col-resize;margin-left:calc(0 - var(--track-value-padding))}.form_input-range[data-v-6ca6d31c]::-moz-range-track{height:var(--track-height);border:var(--track-border);border-radius:var(--track-border-radius);background:var(--track-background);box-shadow:var(--track-box-shadow);cursor:col-resize;width:calc(100% - var(--track-value-padding) * 2)}.form_input-range[data-v-6ca6d31c]::-moz-range-thumb:hover{background:var(--thumb-background-hover)}.form_input-range[data-v-6ca6d31c]:hover::-moz-range-track{background:var(--track-background-hover)}.form_input-range[data-v-6ca6d31c]::-moz-range-thumb:active{background:var(--thumb-background-active)}.form_input-range[data-v-6ca6d31c]:active::-moz-range-track{background:var(--track-background-active)}.form_input-range.slider-progress[data-v-6ca6d31c]::-moz-range-track{background:linear-gradient(var(--track-value-background),var(--track-value-background)) 0 / var(--sx) 100% no-repeat,var(--track-background)}.form_input-range.slider-progress[data-v-6ca6d31c]:hover::-moz-range-track{background:linear-gradient(var(--track-value-background-hover),var(--track-value-background-hover)) 0 / var(--sx) 100% no-repeat,var(--track-background-hover)}.form_input-range.slider-progress[data-v-6ca6d31c]:active::-moz-range-track{background:linear-gradient(var(--track-value-background-active),var(--track-value-background-active)) 0 / var(--sx) 100% no-repeat,var(--track-background-active)}.form_input-range[data-v-6ca6d31c]::-ms-fill-upper{background:transparent;border-color:transparent}.form_input-range[data-v-6ca6d31c]::-ms-fill-lower{background:transparent;border-color:transparent}.form_input-range[data-v-6ca6d31c]::-ms-thumb{width:var(--thumb-width);height:var(--thumb-height);border-radius:var(--thumb-border-radius);background:var(--thumb-background);border:var(--thumb-border);box-shadow:var(--thumb-box-shadow);margin-top:0;margin-left:calc(0 - var(--track-value-padding));box-sizing:border-box;cursor:col-resize}.form_input-range[data-v-6ca6d31c]::-ms-track{height:var(--track-height);border-radius:var(--track-border-radius);background:var(--track-background);border:var(--track-border);box-shadow:var(--track-box-shadow);box-sizing:border-box;cursor:col-resize}.form_input-range[data-v-6ca6d31c]::-ms-thumb:hover{background:var(--thumb-background-hover)}.form_input-range[data-v-6ca6d31c]:hover::-ms-track{background:var(--track-background-hover)}.form_input-range[data-v-6ca6d31c]::-ms-thumb:active{background:var(--thumb-background-active)}.form_input-range[data-v-6ca6d31c]:active::-ms-track{background:var(--track-background-active)}.form_input-range.slider-progress[data-v-6ca6d31c]::-ms-fill-lower{height:var(--track-height);border-radius:var(--track-border-radius) 0 0 var(--track-border-radius);margin:0;background:var(--track-value-background);border:none;border-right-width:0;margin-left:calc(var(--track-value-padding));margin-right:calc(0 - var(--track-value-padding))}.form_input-range.slider-progress[data-v-6ca6d31c]:hover::-ms-fill-lower{background:var(--track-value-background-hover)}.form_input-range.slider-progress[data-v-6ca6d31c]:active::-ms-fill-lower{background:var(--track-value-background-active)}.form_radio-card-detail[data-v-c9195151]{position:relative;overflow:hidden}.form_radio-card-detail[data-v-c9195151]:before{pointer-events:none;--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;width:25%;height:100%;transition:all .35s ease-in-out;-webkit-mask-image:linear-gradient(120deg,#fff);mask-image:linear-gradient(120deg,#fff);opacity:0}.dark .form_radio-card-detail[data-v-c9195151]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position)}.form_radio-card-detail[data-v-c9195151]:hover:before,.form_radio-card-detail._hover[data-v-c9195151]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));width:85%;opacity:1}.dark .form_radio-card-detail[data-v-c9195151]:hover:before,.dark .form_radio-card-detail._hover[data-v-c9195151]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.form_radio-card-detail-active[data-v-c9195151]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));width:85%;opacity:.5}.dark .form_radio-card-detail-active[data-v-c9195151]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.form_radio-card-simple[data-v-dd41bc0b]{position:relative;overflow:hidden}.form_radio-card-simple[data-v-dd41bc0b]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;width:25%;height:100%;transition:all .35s ease-in-out;-webkit-mask-image:linear-gradient(120deg,#fff);mask-image:linear-gradient(120deg,#fff);opacity:0}.dark .form_radio-card-simple[data-v-dd41bc0b]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position)}.form_radio-card-simple[data-v-dd41bc0b]:hover:before,.form_radio-card-simple._hover[data-v-dd41bc0b]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));width:85%;opacity:1}.dark .form_radio-card-simple[data-v-dd41bc0b]:hover:before,.dark .form_radio-card-simple._hover[data-v-dd41bc0b]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.form_radio-card-simple-active[data-v-dd41bc0b]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));width:85%;opacity:.5}.dark .form_radio-card-simple-active[data-v-dd41bc0b]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}input[type=search][data-v-0c2329bf]::-webkit-search-cancel-button{display:none}.form_voice-card[data-v-dbab964e]{position:relative;overflow:hidden;display:flex;flex-direction:column}.form_voice-card[data-v-dbab964e]:before{pointer-events:none;--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;width:25%;height:100%;transition:all .35s ease-in-out;-webkit-mask-image:linear-gradient(120deg,#fff);mask-image:linear-gradient(120deg,#fff);opacity:0}.dark .form_voice-card[data-v-dbab964e]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position)}.form_voice-card[data-v-dbab964e]:hover:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));width:85%;opacity:1}.dark .form_voice-card[data-v-dbab964e]:hover:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}input[type=search][data-v-070104a7]::-webkit-search-cancel-button{display:none}.voice-card[data-v-070104a7]{position:relative;overflow:hidden;display:flex;flex-direction:column}.voice-card[data-v-070104a7]:before{pointer-events:none;--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;width:25%;height:100%;transition:all .35s ease-in-out;-webkit-mask-image:linear-gradient(120deg,#fff);mask-image:linear-gradient(120deg,#fff);opacity:0}.dark .voice-card[data-v-070104a7]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position)}.voice-card[data-v-070104a7]:hover:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));width:85%;opacity:1}.dark .voice-card[data-v-070104a7]:hover:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.volumed[data-v-568551bc]{transform-style:preserve-3d;width:fit-content;height:fit-content}.test-dummy-flat[data-v-b4ef37ac]{display:inline-block;position:relative}.test-dummy-flat .marker[data-v-b4ef37ac]{position:absolute;top:0;right:0;bottom:0;left:0;background:conic-gradient(#ffeb3b,#ffeb3b 90deg,#000 90deg,#000 180deg,#ffeb3b 180deg,#ffeb3b 270deg,#000 270deg,#000 360deg);border-radius:50%;box-shadow:0 4px 12px #b9b9b933}.dark .test-dummy-flat .marker[data-v-b4ef37ac]{box-shadow:0 4px 12px #0003}.menu-icon-item[data-v-656e0116]{position:relative;overflow:hidden}.menu-icon-item[data-v-656e0116]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;width:25%;height:100%;-webkit-mask-image:linear-gradient(120deg,white 30%,transparent 50%);mask-image:linear-gradient(120deg,white 30%,transparent 50%);opacity:0;transition:all .4s ease-in-out}.dark .menu-icon-item[data-v-656e0116]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position)}.menu-icon-item[data-v-656e0116]:hover:before,.menu-icon-item._hover[data-v-656e0116]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));width:85%;opacity:1}.dark .menu-icon-item[data-v-656e0116]:hover:before,.dark .menu-icon-item._hover[data-v-656e0116]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.menu-icon-item[data-v-656e0116]:after{background-image:radial-gradient(circle at 1px 1px,rgb(229 229 229 / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.6;position:absolute;top:0;right:0;bottom:0;left:0;z-index:-2;width:100%;height:100%;background-size:10px 10px;content:"";-webkit-mask-image:linear-gradient(165deg,white 30%,transparent 50%);mask-image:linear-gradient(165deg,white 30%,transparent 50%);transition:all .4s ease-in-out}.menu-icon-item[data-v-656e0116]:after:hover{background-image:radial-gradient(circle at 1px 1px,oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.5}.dark .menu-icon-item[data-v-656e0116]:after{background-image:radial-gradient(circle at 1px 1px,rgb(64 64 64 / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.25}.dark .menu-icon-item[data-v-656e0116]:after:hover{background-image:radial-gradient(circle at 1px 1px,oklch(90% var(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.2}.menu-icon-item-icon[data-v-656e0116]{opacity:.5}.menu-icon-item:hover .menu-icon-item-title[data-v-656e0116],.menu-icon-item._hover .menu-icon-item-title[data-v-656e0116]{--un-text-opacity:1;color:oklch(54% var(--theme-colors-chroma-600) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}.menu-icon-item:hover .menu-icon-item-description[data-v-656e0116],.menu-icon-item._hover .menu-icon-item-description[data-v-656e0116]{--un-text-opacity:1;color:oklch(54% var(--theme-colors-chroma-600) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity));opacity:.8}.menu-icon-item:hover .menu-icon-item-icon[data-v-656e0116],.menu-icon-item._hover .menu-icon-item-icon[data-v-656e0116]{--un-text-opacity:1;color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity));scale:1.2}.dark .menu-icon-item:hover .menu-icon-item-title[data-v-656e0116],.dark .menu-icon-item._hover .menu-icon-item-title[data-v-656e0116]{--un-text-opacity:1;color:oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}.dark .menu-icon-item:hover .menu-icon-item-description[data-v-656e0116],.dark .menu-icon-item._hover .menu-icon-item-description[data-v-656e0116]{--un-text-opacity:1;color:oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity));opacity:.8}.dark .menu-icon-item:hover .menu-icon-item-icon[data-v-656e0116],.dark .menu-icon-item._hover .menu-icon-item-icon[data-v-656e0116]{--un-text-opacity:1;color:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}.menu-icon-status-item[data-v-6e5b5c9c]{position:relative;overflow:hidden}.menu-icon-status-item[data-v-6e5b5c9c]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;width:25%;height:100%;transition:all .4s ease-in-out;-webkit-mask-image:linear-gradient(120deg,#fff);mask-image:linear-gradient(120deg,#fff);opacity:0}.dark .menu-icon-status-item[data-v-6e5b5c9c]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-from-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position)}.menu-icon-status-item[data-v-6e5b5c9c]:hover:before,.menu-icon-status-item._hover[data-v-6e5b5c9c]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position);--un-gradient-shape:to right in oklch;--un-gradient:var(--un-gradient-shape), var(--un-gradient-stops);background-image:linear-gradient(var(--un-gradient));width:50%;opacity:1}.dark .menu-icon-status-item[data-v-6e5b5c9c]:hover:before,.dark .menu-icon-status-item._hover[data-v-6e5b5c9c]:before{--un-gradient-from-position:0%;--un-gradient-from:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .2) var(--un-gradient-from-position);--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0) var(--un-gradient-to-position);--un-gradient-stops:var(--un-gradient-from), var(--un-gradient-to);--un-gradient-via-position:50%;--un-gradient-to:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / 0);--un-gradient-stops:var(--un-gradient-from), oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / .1) var(--un-gradient-via-position), var(--un-gradient-to);--un-gradient-to-position:100%;--un-gradient-to:transparent var(--un-gradient-to-position)}.menu-icon-status-item-link[data-v-6e5b5c9c]:after{background-image:radial-gradient(circle at 1px 1px,rgb(229 229 229 / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.8;position:absolute;top:0;right:0;bottom:0;left:0;z-index:-2;width:100%;height:100%;background-size:10px 10px;content:"";-webkit-mask-image:linear-gradient(165deg,white 30%,transparent 50%);mask-image:linear-gradient(165deg,white 30%,transparent 50%);transition:all .4s ease-in-out}.menu-icon-status-item-link[data-v-6e5b5c9c]:after:hover{background-image:radial-gradient(circle at 1px 1px,oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.5}.dark .menu-icon-status-item-link[data-v-6e5b5c9c]:after{background-image:radial-gradient(circle at 1px 1px,rgb(64 64 64 / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.4}.dark .menu-icon-status-item-link[data-v-6e5b5c9c]:after:hover{background-image:radial-gradient(circle at 1px 1px,oklch(90% var(--theme-colors-chroma-200) calc(var(--theme-colors-hue) + 0) / var(--un-background-opacity)) 1px,transparent 0);--un-background-opacity:.2}.menu-icon-status-item-icon-color[data-v-6e5b5c9c]{opacity:.5}.menu-icon-status-item:hover .menu-icon-status-item-title[data-v-6e5b5c9c],.menu-icon-status-item._hover .menu-icon-status-item-title[data-v-6e5b5c9c]{--un-text-opacity:1;color:oklch(54% var(--theme-colors-chroma-600) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}.menu-icon-status-item:hover .menu-icon-status-item-description[data-v-6e5b5c9c],.menu-icon-status-item._hover .menu-icon-status-item-description[data-v-6e5b5c9c]{--un-text-opacity:1;color:oklch(54% var(--theme-colors-chroma-600) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity));opacity:.8}.menu-icon-status-item:hover .menu-icon-status-item-icon[data-v-6e5b5c9c],.menu-icon-status-item._hover .menu-icon-status-item-icon[data-v-6e5b5c9c],.menu-icon-status-item:hover .menu-icon-status-item-icon-color[data-v-6e5b5c9c],.menu-icon-status-item._hover .menu-icon-status-item-icon-color[data-v-6e5b5c9c]{--un-text-opacity:1;color:oklch(62% var(--theme-colors-chroma) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity));scale:1.2}.dark .menu-icon-status-item:hover .menu-icon-status-item-title[data-v-6e5b5c9c],.dark .menu-icon-status-item._hover .menu-icon-status-item-title[data-v-6e5b5c9c]{--un-text-opacity:1;color:oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}.dark .menu-icon-status-item:hover .menu-icon-status-item-description[data-v-6e5b5c9c],.dark .menu-icon-status-item._hover .menu-icon-status-item-description[data-v-6e5b5c9c]{--un-text-opacity:1;color:oklch(85% var(--theme-colors-chroma-300) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity));opacity:.8}.dark .menu-icon-status-item:hover .menu-icon-status-item-icon[data-v-6e5b5c9c],.dark .menu-icon-status-item._hover .menu-icon-status-item-icon[data-v-6e5b5c9c],.dark .menu-icon-status-item:hover .menu-icon-status-item-icon-color[data-v-6e5b5c9c],.dark .menu-icon-status-item._hover .menu-icon-status-item-icon-color[data-v-6e5b5c9c]{--un-text-opacity:1;color:oklch(74% var(--theme-colors-chroma-400) calc(var(--theme-colors-hue) + 0) / var(--un-text-opacity))}.skeleton[data-v-f404da2a]{position:relative;transition:all .2s ease-in-out}.skeleton-pulse[data-v-f404da2a]{animation:skeleton-pulse-f404da2a 1.5s ease-in-out .5s infinite}@keyframes skeleton-pulse-f404da2a{0%{opacity:1}50%{opacity:.5}to{opacity:1}}.skeleton-wave[data-v-f404da2a]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;transform:translate(-100%);background:linear-gradient(90deg,transparent,rgba(255,255,255,.2),transparent);animation:skeleton-wave-f404da2a 1.5s infinite;border-radius:inherit}.dark .skeleton-wave[data-v-f404da2a]:after{background:linear-gradient(90deg,transparent,rgba(255,255,255,.1),transparent)}@keyframes skeleton-wave-f404da2a{0%{transform:translate(-100%)}60%{transform:translate(100%)}to{transform:translate(100%)}}.card-hover-effect[data-v-895421da]{transform-style:preserve-3d;transform-origin:center;will-change:transform;transition:transform .3s cubic-bezier(.23,1,.32,1)}.card-hover-effect[data-v-895421da]:before,.card-hover-effect[data-v-895421da]:after{content:"";position:absolute;left:0;right:0;bottom:0;top:0;background-repeat:no-repeat;transition:all .33s ease;pointer-events:none}.card-hover-effect[data-v-895421da]:before{background-position:var(--card-position-x) var(--card-position-y);background-size:300% 300%;background-image:linear-gradient(115deg,transparent 0%,rgba(var(--color-primary-500),calc(.3 * var(--effect-intensity))) 25%,transparent 47%,transparent 53%,rgba(var(--color-primary-600),calc(.3 * var(--effect-intensity))) 75%,transparent 100%);opacity:calc(.5 * var(--effect-intensity));filter:brightness(.5) contrast(1);z-index:1;mix-blend-mode:color-dodge}.card-hover-effect[data-v-895421da]:after{background-position:var(--sparkle-position-x) var(--sparkle-position-y);background-size:160%;background-image:linear-gradient(125deg,rgba(var(--color-primary-500),calc(.3 * var(--effect-intensity))) 15%,rgba(var(--color-primary-400),calc(.25 * var(--effect-intensity))) 30%,rgba(var(--color-primary-300),calc(.2 * var(--effect-intensity))) 40%,rgba(var(--color-primary-200),calc(.1 * var(--effect-intensity))) 60%,rgba(var(--color-primary-400),calc(.25 * var(--effect-intensity))) 70%,rgba(var(--color-primary-500),calc(.3 * var(--effect-intensity))) 85%);background-blend-mode:overlay;opacity:calc(var(--sparkle-opacity) * var(--effect-intensity));filter:brightness(1) contrast(1);z-index:2;mix-blend-mode:color-dodge}.card-hover-effect[data-v-895421da]:hover:before{opacity:calc(.88 * var(--effect-intensity));filter:brightness(.66) contrast(1.33)}.card-hover-effect[data-v-895421da]:hover:after{opacity:var(--effect-intensity);filter:brightness(1.1) contrast(1.2)}.animate-stripe[data-v-29db1c01]{background-image:repeating-linear-gradient(-45deg,#f472b6,#f472b6 25px,#f9a8d4 25px,#f9a8d4 50px);animation:progress-29db1c01 2s linear infinite;background-size:150% 100%}@-webkit-keyframes progress-29db1c01{0%{background-position:0 0}to{background-position:-75px 0px}}@-moz-keyframes progress-29db1c01{0%{background-position:0 0}to{background-position:-75px 0px}}@-ms-keyframes progress-29db1c01{0%{background-position:0 0}to{background-position:-75px 0px}}@keyframes progress-29db1c01{0%{background-position:0 0}to{background-position:-70px 0px}} diff --git a/assets/Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js b/assets/Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js similarity index 99% rename from assets/Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js rename to assets/Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js index 87345c866a636d86593d8c989b6eb718a5d4679b..aa59b3acfd0d4c9e92aa2b7e592ffe6e869a1efb 100644 --- a/assets/Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js +++ b/assets/Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-node-BrtBg7VE.js","assets/index--eYU5aQm.js","assets/index-BkzFBnsb.css","assets/import-url-browser-CPN8ipMD.js","assets/duckdb-mvp-CaaD-olE.js","assets/import-url-node-BfNoxhRr.js"])))=>i.map(i=>d[i]); -var f1=Object.defineProperty;var p1=(r,t,e)=>t in r?f1(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var W=(r,t,e)=>p1(r,typeof t!="symbol"?t+"":t,e);import{bm as Ef,ce as Dn,b2 as m1,a0 as g1,a9 as Fe,V as mt,Q as ne,a3 as Ps,ba as No,av as Xp,ag as Yp,ak as qp,b3 as ec,b6 as Af,cf as y1,$ as v1,cg as _1,a1 as b1,ch as Ho,ci as xn,W as qr,a4 as Wn,a_ as Ca,as as nr,cj as w1,X as hi,b7 as x1,b5 as S1,ck as Qp,bb as Mf,cl as T1,aj as Jl,J as co,bc as I1,bf as E1,bg as A1,bp as M1,cm as Ai}from"./index--eYU5aQm.js";/*! +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-node-p_ysqrIS.js","assets/index-D55VqdU4.js","assets/index-BkzFBnsb.css","assets/import-url-browser-CPN8ipMD.js","assets/duckdb-mvp-CaaD-olE.js","assets/import-url-node-BfNoxhRr.js"])))=>i.map(i=>d[i]); +var f1=Object.defineProperty;var p1=(r,t,e)=>t in r?f1(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var W=(r,t,e)=>p1(r,typeof t!="symbol"?t+"":t,e);import{bm as Ef,ce as Dn,b2 as m1,a0 as g1,a9 as Fe,V as mt,Q as ne,a3 as Ps,ba as No,av as Xp,ag as Yp,ak as qp,b3 as ec,b6 as Af,cf as y1,$ as v1,cg as _1,a1 as b1,ch as Ho,ci as xn,W as qr,a4 as Wn,a_ as Ca,as as nr,cj as w1,X as hi,b7 as x1,b5 as S1,ck as Qp,bb as Mf,cl as T1,aj as Jl,J as co,bc as I1,bf as E1,bg as A1,bp as M1,cm as Ai}from"./index-D55VqdU4.js";/*! * @pixi/constants - v6.5.10 * Compiled Thu, 06 Jul 2023 15:25:11 UTC * @@ -4069,13 +4069,13 @@ void main() { */function Jt(r,t,e,n){function i(s){return s instanceof e?s:new e(function(o){o(s)})}return new(e||(e=Promise))(function(s,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((n=n.apply(r,t||[])).next())})}function Zg(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Rt(r){return this instanceof Rt?(this.v=r,this):new Rt(r)}function br(r,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e.apply(r,t||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(d){return function(m){return Promise.resolve(m).then(d,h)}}function a(d,m){n[d]&&(i[d]=function(g){return new Promise(function(p,y){s.push([d,g,p,y])>1||l(d,g)})},m&&(i[d]=m(i[d])))}function l(d,m){try{u(n[d](m))}catch(g){f(s[0][3],g)}}function u(d){d.value instanceof Rt?Promise.resolve(d.value.v).then(c,h):f(s[0][2],d)}function c(d){l("next",d)}function h(d){l("throw",d)}function f(d,m){d(m),s.shift(),s.length&&l(s[0][0],s[0][1])}}function Ss(r){var t,e;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,s){t[i]=r[i]?function(o){return(e=!e)?{value:Rt(r[i](o)),done:!1}:s?s(o):o}:s}}function Bn(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=r[Symbol.asyncIterator],e;return t?t.call(r):(r=typeof Zg=="function"?Zg(r):r[Symbol.iterator](),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(s){e[s]=r[s]&&function(o){return new Promise(function(a,l){o=r[s](o),i(a,l,o.done,o.value)})}}function i(s,o,a,l){Promise.resolve(l).then(function(u){s({value:u,done:a})},o)}}const jR=new TextDecoder("utf-8"),Wd=r=>jR.decode(r),$R=new TextEncoder,Zf=r=>$R.encode(r),GR=r=>typeof r=="number",Rb=r=>typeof r=="boolean",Ye=r=>typeof r=="function",wr=r=>r!=null&&Object(r)===r,Is=r=>wr(r)&&Ye(r.then),Qa=r=>wr(r)&&Ye(r[Symbol.iterator]),Uo=r=>wr(r)&&Ye(r[Symbol.asyncIterator]),Hd=r=>wr(r)&&wr(r.schema),Fb=r=>wr(r)&&"done"in r&&"value"in r,Db=r=>wr(r)&&Ye(r.stat)&&GR(r.fd),Lb=r=>wr(r)&&Kf(r.body),oc=r=>"_getDOMStream"in r&&"_getNodeStream"in r,WR=r=>wr(r)&&Ye(r.abort)&&Ye(r.getWriter)&&!oc(r),Kf=r=>wr(r)&&Ye(r.cancel)&&Ye(r.getReader)&&!oc(r),HR=r=>wr(r)&&Ye(r.end)&&Ye(r.write)&&Rb(r.writable)&&!oc(r),Nb=r=>wr(r)&&Ye(r.read)&&Ye(r.pipe)&&Rb(r.readable)&&!oc(r),XR=r=>wr(r)&&Ye(r.clear)&&Ye(r.bytes)&&Ye(r.position)&&Ye(r.setPosition)&&Ye(r.capacity)&&Ye(r.getBufferIdentifier)&&Ye(r.createLong),Jf=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function YR(r){const t=r[0]?[r[0]]:[];let e,n,i,s;for(let o,a,l=0,u=0,c=r.length;++lc+h.byteLength,0);let i,s,o,a=0,l=-1;const u=Math.min(t||Number.POSITIVE_INFINITY,n);for(const c=e.length;++lxe(Int32Array,r),Jg=r=>xe(BigInt64Array,r),ce=r=>xe(Uint8Array,r),Xd=r=>(r.next(),r);function*qR(r,t){const e=function*(i){yield i},n=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Jf?e(t):Qa(t)?t:e(t);return yield*Xd(function*(i){let s=null;do s=i.next(yield xe(r,s));while(!s.done)}(n[Symbol.iterator]())),new r}const QR=r=>qR(Uint8Array,r);function Bb(r,t){return br(this,arguments,function*(){if(Is(t))return yield Rt(yield Rt(yield*Ss(Bn(Bb(r,yield Rt(t))))));const n=function(o){return br(this,arguments,function*(){yield yield Rt(yield Rt(o))})},i=function(o){return br(this,arguments,function*(){yield Rt(yield*Ss(Bn(Xd(function*(a){let l=null;do l=a.next(yield l==null?void 0:l.value);while(!l.done)}(o[Symbol.iterator]())))))})},s=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Jf?n(t):Qa(t)?i(t):Uo(t)?t:n(t);return yield Rt(yield*Ss(Bn(Xd(function(o){return br(this,arguments,function*(){let a=null;do a=yield Rt(o.next(yield yield Rt(xe(r,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield Rt(new r)})}const ZR=r=>Bb(Uint8Array,r);function Ub(r,t,e){if(r!==0){e=e.slice(0,t);for(let n=-1,i=e.length;++n0)do if(r[e]!==t[e])return!1;while(++e(r.next(),r);function*JR(r){let t,e=!1,n=[],i,s,o,a=0;function l(){return s==="peek"?kn(n,o)[0]:([i,n,a]=kn(n,o),i)}({cmd:s,size:o}=(yield null)||{cmd:"read",size:0});const u=QR(r)[Symbol.iterator]();try{do if({done:t,value:i}=Number.isNaN(o-a)?u.next():u.next(o-a),!t&&i.byteLength>0&&(n.push(i),a+=i.byteLength),t||o<=a)do({cmd:s,size:o}=yield l());while(o0&&(i.push(s),l+=s.byteLength),e||a<=l)do({cmd:o,size:a}=yield yield Rt(u()));while(a0&&(i.push(ce(s)),l+=s.byteLength),e||a<=l)do({cmd:o,size:a}=yield yield Rt(u()));while(a{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(t){return Jt(this,void 0,void 0,function*(){const{reader:e,source:n}=this;e&&(yield e.cancel(t).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(t){return Jt(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};const e=yield this.reader.read();return!e.done&&(e.value=ce(e)),e})}}const Ah=(r,t)=>{const e=i=>n([t,i]);let n;return[t,e,new Promise(i=>(n=i)&&r.once(t,e))]};function nF(r){return br(this,arguments,function*(){const e=[];let n="error",i=!1,s=null,o,a,l=0,u=[],c;function h(){return o==="peek"?kn(u,a)[0]:([c,u,l]=kn(u,a),c)}if({cmd:o,size:a}=(yield yield Rt(null))||{cmd:"read",size:0},r.isTTY)return yield yield Rt(new Uint8Array(0)),yield Rt(null);try{e[0]=Ah(r,"end"),e[1]=Ah(r,"error");do{if(e[2]=Ah(r,"readable"),[n,s]=yield Rt(Promise.race(e.map(d=>d[2]))),n==="error")break;if((i=n==="end")||(Number.isFinite(a-l)?(c=ce(r.read(a-l)),c.byteLength0&&(u.push(c),l+=c.byteLength)),i||a<=l)do({cmd:o,size:a}=yield yield Rt(h()));while(a{for(const[y,_]of d)r.off(y,_);try{const y=r.destroy;y&&y.call(r,m),m=void 0}catch(y){m=y||m}finally{m!=null?p(m):g()}})}})}var je;(function(r){r[r.V1=0]="V1",r[r.V2=1]="V2",r[r.V3=2]="V3",r[r.V4=3]="V4",r[r.V5=4]="V5"})(je||(je={}));var lr;(function(r){r[r.Sparse=0]="Sparse",r[r.Dense=1]="Dense"})(lr||(lr={}));var ar;(function(r){r[r.HALF=0]="HALF",r[r.SINGLE=1]="SINGLE",r[r.DOUBLE=2]="DOUBLE"})(ar||(ar={}));var nn;(function(r){r[r.DAY=0]="DAY",r[r.MILLISECOND=1]="MILLISECOND"})(nn||(nn={}));var Vt;(function(r){r[r.SECOND=0]="SECOND",r[r.MILLISECOND=1]="MILLISECOND",r[r.MICROSECOND=2]="MICROSECOND",r[r.NANOSECOND=3]="NANOSECOND"})(Vt||(Vt={}));var zn;(function(r){r[r.YEAR_MONTH=0]="YEAR_MONTH",r[r.DAY_TIME=1]="DAY_TIME",r[r.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(zn||(zn={}));const Mh=2,Pn=4,oi=4,_e=4,Ii=new Int32Array(2),ty=new Float32Array(Ii.buffer),ey=new Float64Array(Ii.buffer),Dl=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Yd;(function(r){r[r.UTF8_BYTES=1]="UTF8_BYTES",r[r.UTF16_STRING=2]="UTF16_STRING"})(Yd||(Yd={}));let Mo=class kb{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new kb(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<>8}writeUint16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeInt32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeUint32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeInt64(t,e){this.writeInt32(t,Number(BigInt.asIntN(32,e))),this.writeInt32(t+4,Number(BigInt.asIntN(32,e>>BigInt(32))))}writeUint64(t,e){this.writeUint32(t,Number(BigInt.asUintN(32,e))),this.writeUint32(t+4,Number(BigInt.asUintN(32,e>>BigInt(32))))}writeFloat32(t,e){ty[0]=e,this.writeInt32(t,Ii[0])}writeFloat64(t,e){ey[0]=e,this.writeInt32(t,Ii[Dl?0:1]),this.writeInt32(t+4,Ii[Dl?1:0])}getBufferIdentifier(){if(this.bytes_.lengththis.minalign&&(this.minalign=t);const n=~(this.bb.capacity()-this.space+e)+1&t-1;for(;this.space=0&&this.vtable[e]==0;e--);const n=e+1;for(;e>=0;e--)this.addInt16(this.vtable[e]!=0?t-this.vtable[e]:0);const i=2;this.addInt16(t-this.object_start);const s=(n+i)*Mh;this.addInt16(s);let o=0;const a=this.space;t:for(e=0;e=0;o--)this.writeInt8(s.charCodeAt(o))}this.prep(this.minalign,Pn+i),this.addOffset(t),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,e){this.finish(t,e,!0)}requiredField(t,e){const n=this.bb.capacity()-t,i=n-this.bb.readInt32(n);if(!(e=0;n--)t.addInt32(e[n]);return t.endVector()}static startTypeIdsVector(t,e){t.startVector(4,e,4)}static endUnion(t){return t.endObject()}static createUnion(t,e,n){return vr.startUnion(t),vr.addMode(t,e),vr.addTypeIds(t,n),vr.endUnion(t)}}let ly=class _a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsUtf8(t,e){return(e||new _a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,e){return t.setPosition(t.position()+_e),(e||new _a).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return _a.startUtf8(t),_a.endUtf8(t)}};var Ee;(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.FloatingPoint=3]="FloatingPoint",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct_=13]="Struct_",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Duration=18]="Duration",r[r.LargeBinary=19]="LargeBinary",r[r.LargeUtf8=20]="LargeUtf8",r[r.LargeList=21]="LargeList",r[r.RunEndEncoded=22]="RunEndEncoded"})(Ee||(Ee={}));let Wr=class Hl{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsField(t,e){return(e||new Hl).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,e){return t.setPosition(t.position()+_e),(e||new Hl).__init(t.readInt32(t.position())+t.position(),t)}name(t){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}nullable(){const t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}typeType(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):Ee.NONE}type(t){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__union(t,this.bb_pos+e):null}dictionary(t){const e=this.bb.__offset(this.bb_pos,12);return e?(t||new ai).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}children(t,e){const n=this.bb.__offset(this.bb_pos,14);return n?(e||new Hl).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}childrenLength(){const t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){const n=this.bb.__offset(this.bb_pos,16);return n?(e||new qe).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}static startField(t){t.startObject(7)}static addName(t,e){t.addFieldOffset(0,e,0)}static addNullable(t,e){t.addFieldInt8(1,+e,0)}static addTypeType(t,e){t.addFieldInt8(2,e,Ee.NONE)}static addType(t,e){t.addFieldOffset(3,e,0)}static addDictionary(t,e){t.addFieldOffset(4,e,0)}static addChildren(t,e){t.addFieldOffset(5,e,0)}static createChildrenVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startChildrenVector(t,e){t.startVector(4,e,4)}static addCustomMetadata(t,e){t.addFieldOffset(6,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endField(t){return t.endObject()}},In=class Zn{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSchema(t,e){return(e||new Zn).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,e){return t.setPosition(t.position()+_e),(e||new Zn).__init(t.readInt32(t.position())+t.position(),t)}endianness(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Co.Little}fields(t,e){const n=this.bb.__offset(this.bb_pos,6);return n?(e||new Wr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}fieldsLength(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){const n=this.bb.__offset(this.bb_pos,8);return n?(e||new qe).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}features(t){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+t*8):BigInt(0)}featuresLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSchema(t){t.startObject(4)}static addEndianness(t,e){t.addFieldInt16(0,e,Co.Little)}static addFields(t,e){t.addFieldOffset(1,e,0)}static createFieldsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startFieldsVector(t,e){t.startVector(4,e,4)}static addCustomMetadata(t,e){t.addFieldOffset(2,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static addFeatures(t,e){t.addFieldOffset(3,e,0)}static createFeaturesVector(t,e){t.startVector(8,e.length,8);for(let n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()}static startFeaturesVector(t,e){t.startVector(8,e,8)}static endSchema(t){return t.endObject()}static finishSchemaBuffer(t,e){t.finish(e)}static finishSizePrefixedSchemaBuffer(t,e){t.finish(e,void 0,!0)}static createSchema(t,e,n,i,s){return Zn.startSchema(t),Zn.addEndianness(t,e),Zn.addFields(t,n),Zn.addCustomMetadata(t,i),Zn.addFeatures(t,s),Zn.endSchema(t)}};var me;(function(r){r[r.NONE=0]="NONE",r[r.Schema=1]="Schema",r[r.DictionaryBatch=2]="DictionaryBatch",r[r.RecordBatch=3]="RecordBatch",r[r.Tensor=4]="Tensor",r[r.SparseTensor=5]="SparseTensor"})(me||(me={}));var k;(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.Float=3]="Float",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct=13]="Struct",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Duration=18]="Duration",r[r.LargeBinary=19]="LargeBinary",r[r.LargeUtf8=20]="LargeUtf8",r[r.Dictionary=-1]="Dictionary",r[r.Int8=-2]="Int8",r[r.Int16=-3]="Int16",r[r.Int32=-4]="Int32",r[r.Int64=-5]="Int64",r[r.Uint8=-6]="Uint8",r[r.Uint16=-7]="Uint16",r[r.Uint32=-8]="Uint32",r[r.Uint64=-9]="Uint64",r[r.Float16=-10]="Float16",r[r.Float32=-11]="Float32",r[r.Float64=-12]="Float64",r[r.DateDay=-13]="DateDay",r[r.DateMillisecond=-14]="DateMillisecond",r[r.TimestampSecond=-15]="TimestampSecond",r[r.TimestampMillisecond=-16]="TimestampMillisecond",r[r.TimestampMicrosecond=-17]="TimestampMicrosecond",r[r.TimestampNanosecond=-18]="TimestampNanosecond",r[r.TimeSecond=-19]="TimeSecond",r[r.TimeMillisecond=-20]="TimeMillisecond",r[r.TimeMicrosecond=-21]="TimeMicrosecond",r[r.TimeNanosecond=-22]="TimeNanosecond",r[r.DenseUnion=-23]="DenseUnion",r[r.SparseUnion=-24]="SparseUnion",r[r.IntervalDayTime=-25]="IntervalDayTime",r[r.IntervalYearMonth=-26]="IntervalYearMonth",r[r.DurationSecond=-27]="DurationSecond",r[r.DurationMillisecond=-28]="DurationMillisecond",r[r.DurationMicrosecond=-29]="DurationMicrosecond",r[r.DurationNanosecond=-30]="DurationNanosecond"})(k||(k={}));var ni;(function(r){r[r.OFFSET=0]="OFFSET",r[r.DATA=1]="DATA",r[r.VALIDITY=2]="VALIDITY",r[r.TYPE=3]="TYPE"})(ni||(ni={}));const iF=void 0;function Ba(r){if(r===null)return"null";if(r===iF)return"undefined";switch(typeof r){case"number":return`${r}`;case"bigint":return`${r}`;case"string":return`"${r}"`}return typeof r[Symbol.toPrimitive]=="function"?r[Symbol.toPrimitive]("string"):ArrayBuffer.isView(r)?r instanceof BigInt64Array||r instanceof BigUint64Array?`[${[...r].map(t=>Ba(t))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(t,e)=>typeof e=="bigint"?`${e}`:e)}function Te(r){if(typeof r=="bigint"&&(rNumber.MAX_SAFE_INTEGER))throw new TypeError(`${r} is not safe to convert to a number.`);return Number(r)}function Gb(r,t){return Te(r/t)+Te(r%t)/Te(t)}const sF=Symbol.for("isArrowBigNum");function pn(r,...t){return t.length===0?Object.setPrototypeOf(xe(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...t),this.constructor.prototype)}pn.prototype[sF]=!0;pn.prototype.toJSON=function(){return`"${ka(this)}"`};pn.prototype.valueOf=function(r){return Wb(this,r)};pn.prototype.toString=function(){return ka(this)};pn.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return Wb(this);case"string":return ka(this);case"default":return lF(this)}return ka(this)};function vo(...r){return pn.apply(this,r)}function _o(...r){return pn.apply(this,r)}function Ua(...r){return pn.apply(this,r)}Object.setPrototypeOf(vo.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(_o.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Ua.prototype,Object.create(Uint32Array.prototype));Object.assign(vo.prototype,pn.prototype,{constructor:vo,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(_o.prototype,pn.prototype,{constructor:_o,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(Ua.prototype,pn.prototype,{constructor:Ua,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const oF=BigInt(4294967296)*BigInt(4294967296),aF=oF-BigInt(1);function Wb(r,t){const{buffer:e,byteOffset:n,byteLength:i,signed:s}=r,o=new BigUint64Array(e,n,i/8),a=s&&o.at(-1)&BigInt(1)<=0)return Ch(r);t=t.slice();let n=1;for(let s=0;s(r.children=null,r.ArrayType=Array,r.OffsetArrayType=Int32Array,r[Symbol.toStringTag]="DataType"))(Ot.prototype);let Fi=class extends Ot{constructor(){super(k.Null)}toString(){return"Null"}};Yb=Symbol.toStringTag;Fi[Yb]=(r=>r[Symbol.toStringTag]="Null")(Fi.prototype);let Es=class extends Ot{constructor(t,e){super(k.Int),this.isSigned=t,this.bitWidth=e}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}};qb=Symbol.toStringTag;Es[qb]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(Es.prototype);class za extends Es{constructor(){super(!0,32)}get ArrayType(){return Int32Array}}Object.defineProperty(za.prototype,"ArrayType",{value:Int32Array});let mu=class extends Ot{constructor(t){super(k.Float),this.precision=t}get ArrayType(){switch(this.precision){case ar.HALF:return Uint16Array;case ar.SINGLE:return Float32Array;case ar.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};Qb=Symbol.toStringTag;mu[Qb]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(mu.prototype);let gu=class extends Ot{constructor(){super(k.Binary)}toString(){return"Binary"}};Zb=Symbol.toStringTag;gu[Zb]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(gu.prototype);let yu=class extends Ot{constructor(){super(k.LargeBinary)}toString(){return"LargeBinary"}};Kb=Symbol.toStringTag;yu[Kb]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeBinary"))(yu.prototype);let vu=class extends Ot{constructor(){super(k.Utf8)}toString(){return"Utf8"}};Jb=Symbol.toStringTag;vu[Jb]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(vu.prototype);let _u=class extends Ot{constructor(){super(k.LargeUtf8)}toString(){return"LargeUtf8"}};tw=Symbol.toStringTag;_u[tw]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeUtf8"))(_u.prototype);let bu=class extends Ot{constructor(){super(k.Bool)}toString(){return"Bool"}};ew=Symbol.toStringTag;bu[ew]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(bu.prototype);let wu=class extends Ot{constructor(t,e,n=128){super(k.Decimal),this.scale=t,this.precision=e,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};rw=Symbol.toStringTag;wu[rw]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(wu.prototype);let xu=class extends Ot{constructor(t){super(k.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${nn[this.unit]}>`}get ArrayType(){return this.unit===nn.DAY?Int32Array:BigInt64Array}};nw=Symbol.toStringTag;xu[nw]=(r=>(r.unit=null,r[Symbol.toStringTag]="Date"))(xu.prototype);let Su=class extends Ot{constructor(t,e){super(k.Time),this.unit=t,this.bitWidth=e}toString(){return`Time${this.bitWidth}<${Vt[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};iw=Symbol.toStringTag;Su[iw]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(Su.prototype);let Tu=class extends Ot{constructor(t,e){super(k.Timestamp),this.unit=t,this.timezone=e}toString(){return`Timestamp<${Vt[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};sw=Symbol.toStringTag;Tu[sw]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Timestamp"))(Tu.prototype);let Iu=class extends Ot{constructor(t){super(k.Interval),this.unit=t}toString(){return`Interval<${zn[this.unit]}>`}};ow=Symbol.toStringTag;Iu[ow]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(Iu.prototype);let Eu=class extends Ot{constructor(t){super(k.Duration),this.unit=t}toString(){return`Duration<${Vt[this.unit]}>`}};aw=Symbol.toStringTag;Eu[aw]=(r=>(r.unit=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Duration"))(Eu.prototype);let Au=class extends Ot{constructor(t){super(k.List),this.children=[t]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};lw=Symbol.toStringTag;Au[lw]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(Au.prototype);let dr=class extends Ot{constructor(t){super(k.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};uw=Symbol.toStringTag;dr[uw]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(dr.prototype);let Mu=class extends Ot{constructor(t,e,n){super(k.Union),this.mode=t,this.children=n,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((i,s,o)=>(i[s]=o)&&i||i,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}};cw=Symbol.toStringTag;Mu[cw]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(Mu.prototype);let Cu=class extends Ot{constructor(t){super(k.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};hw=Symbol.toStringTag;Cu[hw]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(Cu.prototype);let Ou=class extends Ot{constructor(t,e){super(k.FixedSizeList),this.listSize=t,this.children=[e]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};dw=Symbol.toStringTag;Ou[dw]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(Ou.prototype);let Pu=class extends Ot{constructor(t,e=!1){var n,i,s;if(super(k.Map),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((n=t==null?void 0:t.type)===null||n===void 0)&&n.children)){const o=(i=t==null?void 0:t.type)===null||i===void 0?void 0:i.children[0];o&&(o.name="key");const a=(s=t==null?void 0:t.type)===null||s===void 0?void 0:s.children[1];a&&(a.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};fw=Symbol.toStringTag;Pu[fw]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(Pu.prototype);const cF=(r=>()=>++r)(-1);let Oo=class extends Ot{constructor(t,e,n,i){super(k.Dictionary),this.indices=e,this.dictionary=t,this.isOrdered=i||!1,this.id=n==null?cF():Te(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};pw=Symbol.toStringTag;Oo[pw]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(Oo.prototype);function ii(r){const t=r;switch(r.typeId){case k.Decimal:return r.bitWidth/32;case k.Interval:return 1+t.unit;case k.FixedSizeList:return t.listSize;case k.FixedSizeBinary:return t.byteWidth;default:return 1}}let se=class{visitMany(t,...e){return t.map((n,i)=>this.visit(n,...e.map(s=>s[i])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return hF(this,t,e)}getVisitFnByTypeId(t,e=!0){return io(this,t,e)}visitNull(t,...e){return null}visitBool(t,...e){return null}visitInt(t,...e){return null}visitFloat(t,...e){return null}visitUtf8(t,...e){return null}visitLargeUtf8(t,...e){return null}visitBinary(t,...e){return null}visitLargeBinary(t,...e){return null}visitFixedSizeBinary(t,...e){return null}visitDate(t,...e){return null}visitTimestamp(t,...e){return null}visitTime(t,...e){return null}visitDecimal(t,...e){return null}visitList(t,...e){return null}visitStruct(t,...e){return null}visitUnion(t,...e){return null}visitDictionary(t,...e){return null}visitInterval(t,...e){return null}visitDuration(t,...e){return null}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}};function hF(r,t,e=!0){return typeof t=="number"?io(r,t,e):typeof t=="string"&&t in k?io(r,k[t],e):t&&t instanceof Ot?io(r,uy(t),e):t!=null&&t.type&&t.type instanceof Ot?io(r,uy(t.type),e):io(r,k.NONE,e)}function io(r,t,e=!0){let n=null;switch(t){case k.Null:n=r.visitNull;break;case k.Bool:n=r.visitBool;break;case k.Int:n=r.visitInt;break;case k.Int8:n=r.visitInt8||r.visitInt;break;case k.Int16:n=r.visitInt16||r.visitInt;break;case k.Int32:n=r.visitInt32||r.visitInt;break;case k.Int64:n=r.visitInt64||r.visitInt;break;case k.Uint8:n=r.visitUint8||r.visitInt;break;case k.Uint16:n=r.visitUint16||r.visitInt;break;case k.Uint32:n=r.visitUint32||r.visitInt;break;case k.Uint64:n=r.visitUint64||r.visitInt;break;case k.Float:n=r.visitFloat;break;case k.Float16:n=r.visitFloat16||r.visitFloat;break;case k.Float32:n=r.visitFloat32||r.visitFloat;break;case k.Float64:n=r.visitFloat64||r.visitFloat;break;case k.Utf8:n=r.visitUtf8;break;case k.LargeUtf8:n=r.visitLargeUtf8;break;case k.Binary:n=r.visitBinary;break;case k.LargeBinary:n=r.visitLargeBinary;break;case k.FixedSizeBinary:n=r.visitFixedSizeBinary;break;case k.Date:n=r.visitDate;break;case k.DateDay:n=r.visitDateDay||r.visitDate;break;case k.DateMillisecond:n=r.visitDateMillisecond||r.visitDate;break;case k.Timestamp:n=r.visitTimestamp;break;case k.TimestampSecond:n=r.visitTimestampSecond||r.visitTimestamp;break;case k.TimestampMillisecond:n=r.visitTimestampMillisecond||r.visitTimestamp;break;case k.TimestampMicrosecond:n=r.visitTimestampMicrosecond||r.visitTimestamp;break;case k.TimestampNanosecond:n=r.visitTimestampNanosecond||r.visitTimestamp;break;case k.Time:n=r.visitTime;break;case k.TimeSecond:n=r.visitTimeSecond||r.visitTime;break;case k.TimeMillisecond:n=r.visitTimeMillisecond||r.visitTime;break;case k.TimeMicrosecond:n=r.visitTimeMicrosecond||r.visitTime;break;case k.TimeNanosecond:n=r.visitTimeNanosecond||r.visitTime;break;case k.Decimal:n=r.visitDecimal;break;case k.List:n=r.visitList;break;case k.Struct:n=r.visitStruct;break;case k.Union:n=r.visitUnion;break;case k.DenseUnion:n=r.visitDenseUnion||r.visitUnion;break;case k.SparseUnion:n=r.visitSparseUnion||r.visitUnion;break;case k.Dictionary:n=r.visitDictionary;break;case k.Interval:n=r.visitInterval;break;case k.IntervalDayTime:n=r.visitIntervalDayTime||r.visitInterval;break;case k.IntervalYearMonth:n=r.visitIntervalYearMonth||r.visitInterval;break;case k.Duration:n=r.visitDuration;break;case k.DurationSecond:n=r.visitDurationSecond||r.visitDuration;break;case k.DurationMillisecond:n=r.visitDurationMillisecond||r.visitDuration;break;case k.DurationMicrosecond:n=r.visitDurationMicrosecond||r.visitDuration;break;case k.DurationNanosecond:n=r.visitDurationNanosecond||r.visitDuration;break;case k.FixedSizeList:n=r.visitFixedSizeList;break;case k.Map:n=r.visitMap;break}if(typeof n=="function")return n;if(!e)return()=>null;throw new Error(`Unrecognized type '${k[t]}'`)}function uy(r){switch(r.typeId){case k.Null:return k.Null;case k.Int:{const{bitWidth:t,isSigned:e}=r;switch(t){case 8:return e?k.Int8:k.Uint8;case 16:return e?k.Int16:k.Uint16;case 32:return e?k.Int32:k.Uint32;case 64:return e?k.Int64:k.Uint64}return k.Int}case k.Float:switch(r.precision){case ar.HALF:return k.Float16;case ar.SINGLE:return k.Float32;case ar.DOUBLE:return k.Float64}return k.Float;case k.Binary:return k.Binary;case k.LargeBinary:return k.LargeBinary;case k.Utf8:return k.Utf8;case k.LargeUtf8:return k.LargeUtf8;case k.Bool:return k.Bool;case k.Decimal:return k.Decimal;case k.Time:switch(r.unit){case Vt.SECOND:return k.TimeSecond;case Vt.MILLISECOND:return k.TimeMillisecond;case Vt.MICROSECOND:return k.TimeMicrosecond;case Vt.NANOSECOND:return k.TimeNanosecond}return k.Time;case k.Timestamp:switch(r.unit){case Vt.SECOND:return k.TimestampSecond;case Vt.MILLISECOND:return k.TimestampMillisecond;case Vt.MICROSECOND:return k.TimestampMicrosecond;case Vt.NANOSECOND:return k.TimestampNanosecond}return k.Timestamp;case k.Date:switch(r.unit){case nn.DAY:return k.DateDay;case nn.MILLISECOND:return k.DateMillisecond}return k.Date;case k.Interval:switch(r.unit){case zn.DAY_TIME:return k.IntervalDayTime;case zn.YEAR_MONTH:return k.IntervalYearMonth}return k.Interval;case k.Duration:switch(r.unit){case Vt.SECOND:return k.DurationSecond;case Vt.MILLISECOND:return k.DurationMillisecond;case Vt.MICROSECOND:return k.DurationMicrosecond;case Vt.NANOSECOND:return k.DurationNanosecond}return k.Duration;case k.Map:return k.Map;case k.List:return k.List;case k.Struct:return k.Struct;case k.Union:switch(r.mode){case lr.Dense:return k.DenseUnion;case lr.Sparse:return k.SparseUnion}return k.Union;case k.FixedSizeBinary:return k.FixedSizeBinary;case k.FixedSizeList:return k.FixedSizeList;case k.Dictionary:return k.Dictionary}throw new Error(`Unrecognized type '${k[r.typeId]}'`)}se.prototype.visitInt8=null;se.prototype.visitInt16=null;se.prototype.visitInt32=null;se.prototype.visitInt64=null;se.prototype.visitUint8=null;se.prototype.visitUint16=null;se.prototype.visitUint32=null;se.prototype.visitUint64=null;se.prototype.visitFloat16=null;se.prototype.visitFloat32=null;se.prototype.visitFloat64=null;se.prototype.visitDateDay=null;se.prototype.visitDateMillisecond=null;se.prototype.visitTimestampSecond=null;se.prototype.visitTimestampMillisecond=null;se.prototype.visitTimestampMicrosecond=null;se.prototype.visitTimestampNanosecond=null;se.prototype.visitTimeSecond=null;se.prototype.visitTimeMillisecond=null;se.prototype.visitTimeMicrosecond=null;se.prototype.visitTimeNanosecond=null;se.prototype.visitDenseUnion=null;se.prototype.visitSparseUnion=null;se.prototype.visitIntervalDayTime=null;se.prototype.visitIntervalYearMonth=null;se.prototype.visitDuration=null;se.prototype.visitDurationSecond=null;se.prototype.visitDurationMillisecond=null;se.prototype.visitDurationMicrosecond=null;se.prototype.visitDurationNanosecond=null;const mw=new Float64Array(1),Ws=new Uint32Array(mw.buffer);function gw(r){const t=(r&31744)>>10,e=(r&1023)/1024,n=Math.pow(-1,(r&32768)>>15);switch(t){case 31:return n*(e?Number.NaN:1/0);case 0:return n*(e?6103515625e-14*e:0)}return n*Math.pow(2,t-15)*(1+e)}function dF(r){if(r!==r)return 32256;mw[0]=r;const t=(Ws[1]&2147483648)>>16&65535;let e=Ws[1]&2146435072,n=0;return e>=1089470464?Ws[0]>0?e=31744:(e=(e&2080374784)>>16,n=(Ws[1]&1048575)>>10):e<=1056964608?(n=1048576+(Ws[1]&1048575),n=1048576+(n<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,n=(Ws[1]&1048575)+512>>10),t|e|n&65535}let jt=class extends se{};function Yt(r){return(t,e,n)=>{if(t.setValid(e,n!=null))return r(t,e,n)}}const fF=(r,t,e)=>{r[t]=Math.floor(e/864e5)},yw=(r,t,e,n)=>{if(e+1{const i=r+e;n?t[i>>3]|=1<>3]&=~(1<{r[t]=e},tp=({values:r},t,e)=>{r[t]=e},vw=({values:r},t,e)=>{r[t]=dF(e)},mF=(r,t,e)=>{switch(r.type.precision){case ar.HALF:return vw(r,t,e);case ar.SINGLE:case ar.DOUBLE:return tp(r,t,e)}},_w=({values:r},t,e)=>{fF(r,t,e.valueOf())},bw=({values:r},t,e)=>{r[t]=BigInt(e)},gF=({stride:r,values:t},e,n)=>{t.set(n.subarray(0,r),r*e)},ww=({values:r,valueOffsets:t},e,n)=>yw(r,t,e,n),xw=({values:r,valueOffsets:t},e,n)=>yw(r,t,e,Zf(n)),yF=(r,t,e)=>{r.type.unit===nn.DAY?_w(r,t,e):bw(r,t,e)},Sw=({values:r},t,e)=>{r[t]=BigInt(e/1e3)},Tw=({values:r},t,e)=>{r[t]=BigInt(e)},Iw=({values:r},t,e)=>{r[t]=BigInt(e*1e3)},Ew=({values:r},t,e)=>{r[t]=BigInt(e*1e6)},vF=(r,t,e)=>{switch(r.type.unit){case Vt.SECOND:return Sw(r,t,e);case Vt.MILLISECOND:return Tw(r,t,e);case Vt.MICROSECOND:return Iw(r,t,e);case Vt.NANOSECOND:return Ew(r,t,e)}},Aw=({values:r},t,e)=>{r[t]=e},Mw=({values:r},t,e)=>{r[t]=e},Cw=({values:r},t,e)=>{r[t]=e},Ow=({values:r},t,e)=>{r[t]=e},_F=(r,t,e)=>{switch(r.type.unit){case Vt.SECOND:return Aw(r,t,e);case Vt.MILLISECOND:return Mw(r,t,e);case Vt.MICROSECOND:return Cw(r,t,e);case Vt.NANOSECOND:return Ow(r,t,e)}},bF=({values:r,stride:t},e,n)=>{r.set(n.subarray(0,t),t*e)},wF=(r,t,e)=>{const n=r.children[0],i=r.valueOffsets,s=sn.getVisitFn(n);if(Array.isArray(e))for(let o=-1,a=i[t],l=i[t+1];a{const n=r.children[0],{valueOffsets:i}=r,s=sn.getVisitFn(n);let{[t]:o,[t+1]:a}=i;const l=e instanceof Map?e.entries():Object.entries(e);for(const u of l)if(s(n,o,u),++o>=a)break},SF=(r,t)=>(e,n,i,s)=>n&&e(n,r,t[s]),TF=(r,t)=>(e,n,i,s)=>n&&e(n,r,t.get(s)),IF=(r,t)=>(e,n,i,s)=>n&&e(n,r,t.get(i.name)),EF=(r,t)=>(e,n,i,s)=>n&&e(n,r,t[i.name]),AF=(r,t,e)=>{const n=r.type.children.map(s=>sn.getVisitFn(s.type)),i=e instanceof Map?IF(t,e):e instanceof Ne?TF(t,e):Array.isArray(e)?SF(t,e):EF(t,e);r.type.children.forEach((s,o)=>i(n[o],r.children[o],s,o))},MF=(r,t,e)=>{r.type.mode===lr.Dense?Pw(r,t,e):Rw(r,t,e)},Pw=(r,t,e)=>{const n=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[n];sn.visit(i,r.valueOffsets[t],e)},Rw=(r,t,e)=>{const n=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[n];sn.visit(i,t,e)},CF=(r,t,e)=>{var n;(n=r.dictionary)===null||n===void 0||n.set(r.values[t],e)},OF=(r,t,e)=>{r.type.unit===zn.DAY_TIME?Fw(r,t,e):Dw(r,t,e)},Fw=({values:r},t,e)=>{r.set(e.subarray(0,2),2*t)},Dw=({values:r},t,e)=>{r[t]=e[0]*12+e[1]%12},Lw=({values:r},t,e)=>{r[t]=e},Nw=({values:r},t,e)=>{r[t]=e},Bw=({values:r},t,e)=>{r[t]=e},Uw=({values:r},t,e)=>{r[t]=e},PF=(r,t,e)=>{switch(r.type.unit){case Vt.SECOND:return Lw(r,t,e);case Vt.MILLISECOND:return Nw(r,t,e);case Vt.MICROSECOND:return Bw(r,t,e);case Vt.NANOSECOND:return Uw(r,t,e)}},RF=(r,t,e)=>{const{stride:n}=r,i=r.children[0],s=sn.getVisitFn(i);if(Array.isArray(e))for(let o=-1,a=t*n;++o`${Ba(t)}: ${Ba(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new FF(this[un],this[bo])}},FF=class{constructor(t,e){this.childIndex=0,this.children=t.children,this.rowIndex=e,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){const t=this.childIndex;return te.name)}has(t,e){return t[un].type.children.findIndex(n=>n.name===e)!==-1}getOwnPropertyDescriptor(t,e){if(t[un].type.children.findIndex(n=>n.name===e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const n=t[un].type.children.findIndex(i=>i.name===e);if(n!==-1){const i=xr.visit(t[un].children[n],t[bo]);return Reflect.set(t,e,i),i}}set(t,e,n){const i=t[un].type.children.findIndex(s=>s.name===e);return i!==-1?(sn.visit(t[un].children[i],t[bo],n),Reflect.set(t,e,n)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,n):!1}},Ft=class extends se{};function $t(r){return(t,e)=>t.getValid(e)?r(t,e):null}const LF=(r,t)=>864e5*r[t],NF=(r,t)=>null,kw=(r,t,e)=>{if(e+1>=t.length)return null;const n=Te(t[e]),i=Te(t[e+1]);return r.subarray(n,i)},BF=({offset:r,values:t},e)=>{const n=r+e;return(t[n>>3]&1<LF(r,t),Vw=({values:r},t)=>Te(r[t]),zi=({stride:r,values:t},e)=>t[r*e],UF=({stride:r,values:t},e)=>gw(t[r*e]),jw=({values:r},t)=>r[t],kF=({stride:r,values:t},e)=>t.subarray(r*e,r*(e+1)),$w=({values:r,valueOffsets:t},e)=>kw(r,t,e),Gw=({values:r,valueOffsets:t},e)=>{const n=kw(r,t,e);return n!==null?Wd(n):null},zF=({values:r},t)=>r[t],VF=({type:r,values:t},e)=>r.precision!==ar.HALF?t[e]:gw(t[e]),jF=(r,t)=>r.type.unit===nn.DAY?zw(r,t):Vw(r,t),Ww=({values:r},t)=>1e3*Te(r[t]),Hw=({values:r},t)=>Te(r[t]),Xw=({values:r},t)=>Gb(r[t],BigInt(1e3)),Yw=({values:r},t)=>Gb(r[t],BigInt(1e6)),$F=(r,t)=>{switch(r.type.unit){case Vt.SECOND:return Ww(r,t);case Vt.MILLISECOND:return Hw(r,t);case Vt.MICROSECOND:return Xw(r,t);case Vt.NANOSECOND:return Yw(r,t)}},qw=({values:r},t)=>r[t],Qw=({values:r},t)=>r[t],Zw=({values:r},t)=>r[t],Kw=({values:r},t)=>r[t],GF=(r,t)=>{switch(r.type.unit){case Vt.SECOND:return qw(r,t);case Vt.MILLISECOND:return Qw(r,t);case Vt.MICROSECOND:return Zw(r,t);case Vt.NANOSECOND:return Kw(r,t)}},WF=({values:r,stride:t},e)=>uF.decimal(r.subarray(t*e,t*(e+1))),HF=(r,t)=>{const{valueOffsets:e,stride:n,children:i}=r,{[t*n]:s,[t*n+1]:o}=e,l=i[0].slice(s,o-s);return new Ne([l])},XF=(r,t)=>{const{valueOffsets:e,children:n}=r,{[t]:i,[t+1]:s}=e,o=n[0];return new rp(o.slice(i,s-i))},YF=(r,t)=>new ep(r,t),qF=(r,t)=>r.type.mode===lr.Dense?Jw(r,t):tx(r,t),Jw=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[e];return xr.visit(n,r.valueOffsets[t])},tx=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[e];return xr.visit(n,t)},QF=(r,t)=>{var e;return(e=r.dictionary)===null||e===void 0?void 0:e.get(r.values[t])},ZF=(r,t)=>r.type.unit===zn.DAY_TIME?ex(r,t):rx(r,t),ex=({values:r},t)=>r.subarray(2*t,2*(t+1)),rx=({values:r},t)=>{const e=r[t],n=new Int32Array(2);return n[0]=Math.trunc(e/12),n[1]=Math.trunc(e%12),n},nx=({values:r},t)=>r[t],ix=({values:r},t)=>r[t],sx=({values:r},t)=>r[t],ox=({values:r},t)=>r[t],KF=(r,t)=>{switch(r.type.unit){case Vt.SECOND:return nx(r,t);case Vt.MILLISECOND:return ix(r,t);case Vt.MICROSECOND:return sx(r,t);case Vt.NANOSECOND:return ox(r,t)}},JF=(r,t)=>{const{stride:e,children:n}=r,s=n[0].slice(t*e,e);return new Ne([s])};Ft.prototype.visitNull=$t(NF);Ft.prototype.visitBool=$t(BF);Ft.prototype.visitInt=$t(zF);Ft.prototype.visitInt8=$t(zi);Ft.prototype.visitInt16=$t(zi);Ft.prototype.visitInt32=$t(zi);Ft.prototype.visitInt64=$t(jw);Ft.prototype.visitUint8=$t(zi);Ft.prototype.visitUint16=$t(zi);Ft.prototype.visitUint32=$t(zi);Ft.prototype.visitUint64=$t(jw);Ft.prototype.visitFloat=$t(VF);Ft.prototype.visitFloat16=$t(UF);Ft.prototype.visitFloat32=$t(zi);Ft.prototype.visitFloat64=$t(zi);Ft.prototype.visitUtf8=$t(Gw);Ft.prototype.visitLargeUtf8=$t(Gw);Ft.prototype.visitBinary=$t($w);Ft.prototype.visitLargeBinary=$t($w);Ft.prototype.visitFixedSizeBinary=$t(kF);Ft.prototype.visitDate=$t(jF);Ft.prototype.visitDateDay=$t(zw);Ft.prototype.visitDateMillisecond=$t(Vw);Ft.prototype.visitTimestamp=$t($F);Ft.prototype.visitTimestampSecond=$t(Ww);Ft.prototype.visitTimestampMillisecond=$t(Hw);Ft.prototype.visitTimestampMicrosecond=$t(Xw);Ft.prototype.visitTimestampNanosecond=$t(Yw);Ft.prototype.visitTime=$t(GF);Ft.prototype.visitTimeSecond=$t(qw);Ft.prototype.visitTimeMillisecond=$t(Qw);Ft.prototype.visitTimeMicrosecond=$t(Zw);Ft.prototype.visitTimeNanosecond=$t(Kw);Ft.prototype.visitDecimal=$t(WF);Ft.prototype.visitList=$t(HF);Ft.prototype.visitStruct=$t(YF);Ft.prototype.visitUnion=$t(qF);Ft.prototype.visitDenseUnion=$t(Jw);Ft.prototype.visitSparseUnion=$t(tx);Ft.prototype.visitDictionary=$t(QF);Ft.prototype.visitInterval=$t(ZF);Ft.prototype.visitIntervalDayTime=$t(ex);Ft.prototype.visitIntervalYearMonth=$t(rx);Ft.prototype.visitDuration=$t(KF);Ft.prototype.visitDurationSecond=$t(nx);Ft.prototype.visitDurationMillisecond=$t(ix);Ft.prototype.visitDurationMicrosecond=$t(sx);Ft.prototype.visitDurationNanosecond=$t(ox);Ft.prototype.visitFixedSizeList=$t(JF);Ft.prototype.visitMap=$t(XF);const xr=new Ft,so=Symbol.for("keys"),wo=Symbol.for("vals"),oo=Symbol.for("kKeysAsStrings"),Kd=Symbol.for("_kKeysAsStrings");let rp=class{constructor(t){return this[so]=new Ne([t.children[0]]).memoize(),this[wo]=t.children[1],new Proxy(this,new e2)}get[oo](){return this[Kd]||(this[Kd]=Array.from(this[so].toArray(),String))}[Symbol.iterator](){return new t2(this[so],this[wo])}get size(){return this[so].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[so],e=this[wo],n={};for(let i=-1,s=t.length;++i`${Ba(t)}: ${Ba(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},t2=class{constructor(t,e){this.keys=t,this.vals=e,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){const t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),xr.visit(this.vals,t)]})}},e2=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[oo]}has(t,e){return t[oo].includes(e)}getOwnPropertyDescriptor(t,e){if(t[oo].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const n=t[oo].indexOf(e);if(n!==-1){const i=xr.visit(Reflect.get(t,wo),n);return Reflect.set(t,e,i),i}}set(t,e,n){const i=t[oo].indexOf(e);return i!==-1?(sn.visit(Reflect.get(t,wo),i,n),Reflect.set(t,e,n)):Reflect.has(t,e)?Reflect.set(t,e,n):!1}};Object.defineProperties(rp.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[so]:{writable:!0,enumerable:!1,configurable:!1,value:null},[wo]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Kd]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let cy;function ax(r,t,e,n){const{length:i=0}=r;let s=typeof t!="number"?0:t,o=typeof e!="number"?i:e;return s<0&&(s=(s%i+i)%i),o<0&&(o=(o%i+i)%i),oi&&(o=i),n?n(r,s,o):[s,o]}const np=(r,t)=>r<0?t+r:r,hy=r=>r!==r;function ko(r){if(typeof r!=="object"||r===null)return hy(r)?hy:e=>e===r;if(r instanceof Date){const e=r.valueOf();return n=>n instanceof Date?n.valueOf()===e:!1}return ArrayBuffer.isView(r)?e=>e?KR(r,e):!1:r instanceof Map?n2(r):Array.isArray(r)?r2(r):r instanceof Ne?i2(r):s2(r,!0)}function r2(r){const t=[];for(let e=-1,n=r.length;++e!1;const n=[];for(let i=-1,s=e.length;++i{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return o2(r,e);case Map:return dy(r,e,e.keys());case rp:case ep:case Object:case void 0:return dy(r,e,t||Object.keys(e))}return e instanceof Ne?a2(r,e):!1}}function o2(r,t){const e=r.length;if(t.length!==e)return!1;for(let n=-1;++n>n}function Ru(r,t,e){const n=e.byteLength+7&-8;if(r>0||e.byteLength>3):Fu(new ip(e,r,t,null,lx)).subarray(0,n)),i}return e}function Fu(r){const t=[];let e=0,n=0,i=0;for(const o of r)o&&(i|=1<0)&&(t[e++]=i);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}let ip=class{constructor(t,e,n,i,s){this.bytes=t,this.length=n,this.context=i,this.get=s,this.bit=e%8,this.byteIndex=e>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index>3<<3,i=t+(t%8===0?0:8-t%8);return Jd(r,t,i)+Jd(r,n,e)+u2(r,i>>3,n-i>>3)}function u2(r,t,e){let n=0,i=Math.trunc(t);const s=new DataView(r.buffer,r.byteOffset,r.byteLength),o=e===void 0?r.byteLength:i+e;for(;o-i>=4;)n+=Oh(s.getUint32(i)),i+=4;for(;o-i>=2;)n+=Oh(s.getUint16(i)),i+=2;for(;o-i>=1;)n+=Oh(s.getUint8(i)),i+=1;return n}function Oh(r){let t=Math.trunc(r);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const c2=-1;let Ae=class tf{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){const{type:t}=this;return Ot.isSparseUnion(t)?this.children.some(e=>e.nullable):Ot.isDenseUnion(t)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0;const{valueOffsets:e,values:n,nullBitmap:i,typeIds:s}=this;return e&&(t+=e.byteLength),n&&(t+=n.byteLength),i&&(t+=i.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){if(Ot.isUnion(this.type))return this.children.reduce((n,i)=>n+i.nullCount,0);let t=this._nullCount,e;return t<=c2&&(e=this.nullBitmap)&&(this._nullCount=t=e.length===0?0:this.length-Jd(e,this.offset,this.offset+this.length)),t}constructor(t,e,n,i,s,o=[],a){this.type=t,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let l;s instanceof tf?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=ii(t),s&&((l=s[0])&&(this.valueOffsets=l),(l=s[1])&&(this.values=l),(l=s[2])&&(this.nullBitmap=l),(l=s[3])&&(this.typeIds=l)))}getValid(t){const{type:e}=this;if(Ot.isUnion(e)){const n=e,i=this.children[n.typeIdToChildIndex[this.typeIds[t]]],s=n.mode===lr.Dense?this.valueOffsets[t]:t;return i.getValid(s)}if(this.nullable&&this.nullCount>0){const n=this.offset+t;return(this.nullBitmap[n>>3]&1<>3;(!s||s.byteLength<=c)&&(s=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(s.set(Ru(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:s})):Object.assign(this,{nullBitmap:s,_nullCount:0}));const h=s[c];n=(h&u)!==0,s[c]=e?h|u:h&~u}return n!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,n=this.length,i=this._nullCount,s=this,o=this.children){return new tf(t,e,n,i,s,o,this.dictionary)}slice(t,e){const{stride:n,typeId:i,children:s}=this,o=+(this._nullCount===0)-1,a=i===16?n:1,l=this._sliceBuffers(t,e,n,i);return this.clone(this.type,this.offset+t,e,o,l,s.length===0||this.valueOffsets?s:this._sliceChildren(s,a*t,a*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===k.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:n}=this,i=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);i[e>>3]=(1<0&&i.set(Ru(this.offset,e,this.nullBitmap),0);const s=this.buffers;return s[ni.VALIDITY]=i,this.clone(this.type,0,t,n+(t-e),s)}_sliceBuffers(t,e,n,i){let s;const{buffers:o}=this;return(s=o[ni.TYPE])&&(o[ni.TYPE]=s.subarray(t,t+e)),(s=o[ni.OFFSET])&&(o[ni.OFFSET]=s.subarray(t,t+e+1))||(s=o[ni.DATA])&&(o[ni.DATA]=i===6?s:s.subarray(n*t,n*(t+e))),o}_sliceChildren(t,e,n){return t.map(i=>i.slice(e,n))}};Ae.prototype.children=Object.freeze([]);class Sa extends se{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){const{["type"]:e,["offset"]:n=0,["length"]:i=0}=t;return new Ae(e,n,i,i)}visitBool(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.nullBitmap),s=xe(e.ArrayType,t.data),{["length"]:o=s.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Ae(e,n,o,a,[void 0,s,i])}visitInt(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.nullBitmap),s=xe(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Ae(e,n,o,a,[void 0,s,i])}visitFloat(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.nullBitmap),s=xe(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Ae(e,n,o,a,[void 0,s,i])}visitUtf8(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.data),s=ce(t.nullBitmap),o=ia(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Ae(e,n,a,l,[o,i,s])}visitLargeUtf8(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.data),s=ce(t.nullBitmap),o=Jg(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Ae(e,n,a,l,[o,i,s])}visitBinary(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.data),s=ce(t.nullBitmap),o=ia(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Ae(e,n,a,l,[o,i,s])}visitLargeBinary(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.data),s=ce(t.nullBitmap),o=Jg(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Ae(e,n,a,l,[o,i,s])}visitFixedSizeBinary(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.nullBitmap),s=xe(e.ArrayType,t.data),{["length"]:o=s.length/ii(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Ae(e,n,o,a,[void 0,s,i])}visitDate(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.nullBitmap),s=xe(e.ArrayType,t.data),{["length"]:o=s.length/ii(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Ae(e,n,o,a,[void 0,s,i])}visitTimestamp(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.nullBitmap),s=xe(e.ArrayType,t.data),{["length"]:o=s.length/ii(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Ae(e,n,o,a,[void 0,s,i])}visitTime(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.nullBitmap),s=xe(e.ArrayType,t.data),{["length"]:o=s.length/ii(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Ae(e,n,o,a,[void 0,s,i])}visitDecimal(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.nullBitmap),s=xe(e.ArrayType,t.data),{["length"]:o=s.length/ii(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Ae(e,n,o,a,[void 0,s,i])}visitList(t){const{["type"]:e,["offset"]:n=0,["child"]:i}=t,s=ce(t.nullBitmap),o=ia(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Ae(e,n,a,l,[o,void 0,s],[i])}visitStruct(t){const{["type"]:e,["offset"]:n=0,["children"]:i=[]}=t,s=ce(t.nullBitmap),{length:o=i.reduce((l,{length:u})=>Math.max(l,u),0),nullCount:a=t.nullBitmap?-1:0}=t;return new Ae(e,n,o,a,[void 0,void 0,s],i)}visitUnion(t){const{["type"]:e,["offset"]:n=0,["children"]:i=[]}=t,s=xe(e.ArrayType,t.typeIds),{["length"]:o=s.length,["nullCount"]:a=-1}=t;if(Ot.isSparseUnion(e))return new Ae(e,n,o,a,[void 0,void 0,void 0,s],i);const l=ia(t.valueOffsets);return new Ae(e,n,o,a,[l,void 0,void 0,s],i)}visitDictionary(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.nullBitmap),s=xe(e.indices.ArrayType,t.data),{["dictionary"]:o=new Ne([new Sa().visit({type:e.dictionary})])}=t,{["length"]:a=s.length,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Ae(e,n,a,l,[void 0,s,i],[],o)}visitInterval(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.nullBitmap),s=xe(e.ArrayType,t.data),{["length"]:o=s.length/ii(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Ae(e,n,o,a,[void 0,s,i])}visitDuration(t){const{["type"]:e,["offset"]:n=0}=t,i=ce(t.nullBitmap),s=xe(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Ae(e,n,o,a,[void 0,s,i])}visitFixedSizeList(t){const{["type"]:e,["offset"]:n=0,["child"]:i=new Sa().visit({type:e.valueType})}=t,s=ce(t.nullBitmap),{["length"]:o=i.length/ii(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Ae(e,n,o,a,[void 0,void 0,s],[i])}visitMap(t){const{["type"]:e,["offset"]:n=0,["child"]:i=new Sa().visit({type:e.childType})}=t,s=ce(t.nullBitmap),o=ia(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Ae(e,n,a,l,[o,void 0,s],[i])}}const h2=new Sa;function le(r){return h2.visit(r)}let fy=class{constructor(t=0,e){this.numChunks=t,this.getChunkIterator=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndext.nullable)}function ux(r){return r.reduce((t,e)=>t+e.nullCount,0)}function cx(r){return r.reduce((t,e,n)=>(t[n+1]=t[n]+e.length,t),new Uint32Array(r.length+1))}function hx(r,t,e,n){const i=[];for(let s=-1,o=r.length;++s=n)break;if(e>=l+u)continue;if(l>=e&&l+u<=n){i.push(a);continue}const c=Math.max(0,e-l),h=Math.min(n-l,u);i.push(a.slice(c,h-c))}return i.length===0&&i.push(r[0].slice(0,0)),i}function sp(r,t,e,n){let i=0,s=0,o=t.length-1;do{if(i>=o-1)return e0?0:-1}function p2(r,t){const{nullBitmap:e}=r;if(!e||r.nullCount<=0)return-1;let n=0;for(const i of new ip(e,r.offset+(t||0),r.length,e,lx)){if(!i)return n;++n}return-1}function Zt(r,t,e){if(t===void 0)return-1;if(t===null)switch(r.typeId){case k.Union:break;case k.Dictionary:break;default:return p2(r,e)}const n=xr.getVisitFn(r),i=ko(t);for(let s=(e||0)-1,o=r.length;++s{const i=r.data[n];return i.values.subarray(0,i.length)[Symbol.iterator]()});let e=0;return new fy(r.data.length,n=>{const s=r.data[n].length,o=r.slice(e,e+s);return e+=s,new m2(o)})}let m2=class{constructor(t){this.vector=t,this.index=0}next(){return this.indexa.data):t;if(s.length===0||s.some(a=>!(a instanceof Ae)))throw new TypeError("Vector constructor expects an Array of Data instances.");const o=(e=s[0])===null||e===void 0?void 0:e.type;switch(s.length){case 0:this._offsets=[0];break;case 1:{const{get:a,set:l,indexOf:u}=gx[o.typeId],c=s[0];this.isValid=h=>op(c,h),this.get=h=>a(c,h),this.set=(h,f)=>l(c,h,f),this.indexOf=h=>u(c,h),this._offsets=[0,c.length];break}default:Object.setPrototypeOf(this,yx[o.typeId]),this._offsets=cx(s);break}this.data=s,this.type=o,this.stride=ii(o),this.numChildren=(i=(n=o.children)===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullable(){return d2(this.data)}get nullCount(){return ux(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${k[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}at(t){return this.get(np(t,this.length))}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}[Symbol.iterator](){return ap.visit(this)}concat(...t){return new ls(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new ls(ax(this,t,e,({data:n,_offsets:i},s,o)=>hx(n,i,s,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:n,stride:i,ArrayType:s}=this;switch(t.typeId){case k.Int:case k.Float:case k.Decimal:case k.Time:case k.Timestamp:switch(e.length){case 0:return new s;case 1:return e[0].values.subarray(0,n*i);default:return e.reduce((o,{values:a,length:l})=>(o.array.set(a.subarray(0,l*i),o.offset),o.offset+=l*i,o),{array:new s(n*i),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var e;return this.getChildAt((e=this.type.children)===null||e===void 0?void 0:e.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return Ot.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(Ot.isDictionary(this.type)){const t=new py(this.data[0].dictionary),e=this.data.map(n=>{const i=n.clone();return i.dictionary=t,i});return new ls(e)}return new py(this)}unmemoize(){if(Ot.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(n=>{const i=n.clone();return i.dictionary=t,i});return new ls(e)}return this}};mx=Symbol.toStringTag;Ne[mx]=(r=>{r.type=Ot.prototype,r.data=[],r.length=0,r.stride=1,r.numChildren=0,r._offsets=new Uint32Array([0]),r[Symbol.isConcatSpreadable]=!0;const t=Object.keys(k).map(e=>k[e]).filter(e=>typeof e=="number"&&e!==k.NONE);for(const e of t){const n=xr.getVisitFnByTypeId(e),i=sn.getVisitFnByTypeId(e),s=Lu.getVisitFnByTypeId(e);gx[e]={get:n,set:i,indexOf:s},yx[e]=Object.create(r,{isValid:{value:Du(op)},get:{value:Du(xr.getVisitFnByTypeId(e))},set:{value:dx(sn.getVisitFnByTypeId(e))},indexOf:{value:fx(Lu.getVisitFnByTypeId(e))}})}return"Vector"})(Ne.prototype);let py=class vx extends Ne{constructor(t){super(t.data);const e=this.get,n=this.set,i=this.slice,s=new Array(this.length);Object.defineProperty(this,"get",{value(o){const a=s[o];if(a!==void 0)return a;const l=e.call(this,o);return s[o]=l,l}}),Object.defineProperty(this,"set",{value(o,a){n.call(this,o,a),s[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new vx(i.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new Ne(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};class ef{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(t,e,n,i){return t.prep(8,24),t.writeInt64(BigInt(i??0)),t.pad(4),t.writeInt32(n),t.writeInt64(BigInt(e??0)),t.offset()}}class Er{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFooter(t,e){return(e||new Er).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,e){return t.setPosition(t.position()+_e),(e||new Er).__init(t.readInt32(t.position())+t.position(),t)}version(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):je.V1}schema(t){const e=this.bb.__offset(this.bb_pos,6);return e?(t||new In).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}dictionaries(t,e){const n=this.bb.__offset(this.bb_pos,8);return n?(e||new ef).__init(this.bb.__vector(this.bb_pos+n)+t*24,this.bb):null}dictionariesLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}recordBatches(t,e){const n=this.bb.__offset(this.bb_pos,10);return n?(e||new ef).__init(this.bb.__vector(this.bb_pos+n)+t*24,this.bb):null}recordBatchesLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){const n=this.bb.__offset(this.bb_pos,12);return n?(e||new qe).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startFooter(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,je.V1)}static addSchema(t,e){t.addFieldOffset(1,e,0)}static addDictionaries(t,e){t.addFieldOffset(2,e,0)}static startDictionariesVector(t,e){t.startVector(24,e,8)}static addRecordBatches(t,e){t.addFieldOffset(3,e,0)}static startRecordBatchesVector(t,e){t.startVector(24,e,8)}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endFooter(t){return t.endObject()}static finishFooterBuffer(t,e){t.finish(e)}static finishSizePrefixedFooterBuffer(t,e){t.finish(e,void 0,!0)}}let Le=class us{constructor(t=[],e,n,i=je.V5){this.fields=t||[],this.metadata=e||new Map,n||(n=rf(this.fields)),this.dictionaries=n,this.metadataVersion=i}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return`Schema<{ ${this.fields.map((t,e)=>`${e}: ${t}`).join(", ")} }>`}select(t){const e=new Set(t),n=this.fields.filter(i=>e.has(i.name));return new us(n,this.metadata)}selectAt(t){const e=t.map(n=>this.fields[n]).filter(Boolean);return new us(e,this.metadata)}assign(...t){const e=t[0]instanceof us?t[0]:Array.isArray(t[0])?new us(t[0]):new us(t),n=[...this.fields],i=Ll(Ll(new Map,this.metadata),e.metadata),s=e.fields.filter(a=>{const l=n.findIndex(u=>u.name===a.name);return~l?(n[l]=a.clone({metadata:Ll(Ll(new Map,n[l].metadata),a.metadata)}))&&!1:!0}),o=rf(s,new Map);return new us([...n,...s],i,new Map([...this.dictionaries,...o]))}};Le.prototype.fields=null;Le.prototype.metadata=null;Le.prototype.dictionaries=null;class Pe{static new(...t){let[e,n,i,s]=t;return t[0]&&typeof t[0]=="object"&&({name:e}=t[0],n===void 0&&(n=t[0].type),i===void 0&&(i=t[0].nullable),s===void 0&&(s=t[0].metadata)),new Pe(`${e}`,n,i,s)}constructor(t,e,n=!1,i){this.name=t,this.type=e,this.nullable=n,this.metadata=i||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[e,n,i,s]=t;return!t[0]||typeof t[0]!="object"?[e=this.name,n=this.type,i=this.nullable,s=this.metadata]=t:{name:e=this.name,type:n=this.type,nullable:i=this.nullable,metadata:s=this.metadata}=t[0],Pe.new(e,n,i,s)}}Pe.prototype.type=null;Pe.prototype.name=null;Pe.prototype.nullable=null;Pe.prototype.metadata=null;function Ll(r,t){return new Map([...r||new Map,...t||new Map])}function rf(r,t=new Map){for(let e=-1,n=r.length;++e0&&rf(s.children,t)}return t}var g2=zb,y2=Mo;class Va{static decode(t){t=new y2(ce(t));const e=Er.getRootAsFooter(t),n=Le.decode(e.schema(),new Map,e.version());return new v2(n,e)}static encode(t){const e=new g2,n=Le.encode(e,t.schema);Er.startRecordBatchesVector(e,t.numRecordBatches);for(const o of[...t.recordBatches()].slice().reverse())Di.encode(e,o);const i=e.endVector();Er.startDictionariesVector(e,t.numDictionaries);for(const o of[...t.dictionaryBatches()].slice().reverse())Di.encode(e,o);const s=e.endVector();return Er.startFooter(e),Er.addSchema(e,n),Er.addVersion(e,je.V5),Er.addRecordBatches(e,i),Er.addDictionaries(e,s),Er.finishFooterBuffer(e,Er.endFooter(e)),e.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,e=je.V5,n,i){this.schema=t,this.version=e,n&&(this._recordBatches=n),i&&(this._dictionaryBatches=i)}*recordBatches(){for(let t,e=-1,n=this.numRecordBatches;++e=0&&t=0&&t=0&&t=0&&tthis._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return Jt(this,void 0,void 0,function*(){yield this.return(t)})}write(t){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(t):this.resolvers.shift().resolve({done:!1,value:t}))}abort(t){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:t}:this.resolvers.shift().reject({done:!0,value:t}))}close(){if(this._closedPromiseResolve){const{resolvers:t}=this;for(;t.length>0;)t.shift().resolve(Be);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return Yr.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return Yr.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return Jt(this,void 0,void 0,function*(){return yield this.abort(t),Be})}return(t){return Jt(this,void 0,void 0,function*(){return yield this.close(),Be})}read(t){return Jt(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return Jt(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(...t){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((e,n)=>{this.resolvers.push({resolve:e,reject:n})}):Promise.resolve(Be)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}class Xl extends _2{write(t){if((t=ce(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?Wd(this.toUint8Array(!0)):this.toUint8Array(!1).then(Wd)}toUint8Array(t=!1){return t?kn(this._values)[0]:Jt(this,void 0,void 0,function*(){var e,n,i,s;const o=[];let a=0;try{for(var l=!0,u=Bn(this),c;c=yield u.next(),e=c.done,!e;l=!0){s=c.value,l=!1;const h=s;o.push(h),a+=h.byteLength}}catch(h){n={error:h}}finally{try{!l&&!e&&(i=u.return)&&(yield i.call(u))}finally{if(n)throw n.error}}return kn(o,a)[0]})}}class Nu{constructor(t){t&&(this.source=new b2(Yr.fromIterable(t)))}[Symbol.iterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}}class Po{constructor(t){t instanceof Po?this.source=t.source:t instanceof Xl?this.source=new ts(Yr.fromAsyncIterable(t)):Nb(t)?this.source=new ts(Yr.fromNodeStream(t)):Kf(t)?this.source=new ts(Yr.fromDOMStream(t)):Lb(t)?this.source=new ts(Yr.fromDOMStream(t.body)):Qa(t)?this.source=new ts(Yr.fromIterable(t)):Is(t)?this.source=new ts(Yr.fromAsyncIterable(t)):Uo(t)&&(this.source=new ts(Yr.fromAsyncIterable(t)))}[Symbol.asyncIterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}get closed(){return this.source.closed}cancel(t){return this.source.cancel(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}}class b2{constructor(t){this.source=t}cancel(t){this.return(t)}peek(t){return this.next(t,"peek").value}read(t){return this.next(t,"read").value}next(t,e="read"){return this.source.next({cmd:e,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||Be)}return(t){return Object.create(this.source.return&&this.source.return(t)||Be)}}class ts{constructor(t){this.source=t,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(t){return Jt(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return Jt(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return Jt(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t){return Jt(this,arguments,void 0,function*(e,n="read"){return yield this.source.next({cmd:n,size:e})})}throw(t){return Jt(this,void 0,void 0,function*(){const e=this.source.throw&&(yield this.source.throw(t))||Be;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}return(t){return Jt(this,void 0,void 0,function*(){const e=this.source.return&&(yield this.source.return(t))||Be;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}}class gy extends Nu{constructor(t,e){super(),this.position=0,this.buffer=ce(t),this.size=e===void 0?this.buffer.byteLength:e}readInt32(t){const{buffer:e,byteOffset:n}=this.readAt(t,4);return new DataView(e,n).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let i=e[3]*n[3];this.buffer[0]=i&65535;let s=i>>>16;return i=e[2]*n[3],s+=i,i=e[3]*n[2]>>>0,s+=i,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0>>16,this.buffer[1]+=e[1]*n[3]+e[2]*n[2]+e[3]*n[1],this.buffer[1]+=e[0]*n[3]+e[1]*n[2]+e[2]*n[1]+e[3]*n[0]<<16,this}_plus(t){const e=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],e>>0&&++this.buffer[1],this.buffer[0]=e}lessThan(t){return this.buffer[1]>>0,e[2]=this.buffer[2]+t.buffer[2]>>>0,e[1]=this.buffer[1]+t.buffer[1]>>>0,e[0]=this.buffer[0]+t.buffer[0]>>>0,e[0]>>0&&++e[1],e[1]>>0&&++e[2],e[2]>>0&&++e[3],this.buffer[3]=e[3],this.buffer[2]=e[2],this.buffer[1]=e[1],this.buffer[0]=e[0],this}hex(){return`${fo(this.buffer[3])} ${fo(this.buffer[2])} ${fo(this.buffer[1])} ${fo(this.buffer[0])}`}static multiply(t,e){return new ti(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new ti(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return ti.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return ti.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const n=t.startsWith("-"),i=t.length,s=new ti(e);for(let o=n?1:0;o0&&this.readData(t,n)||new Uint8Array(0)}readOffsets(t,e){return this.readData(t,e)}readTypeIds(t,e){return this.readData(t,e)}readData(t,{length:e,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+e)}readDictionary(t){return this.dictionaries.get(t.id)}}class S2 extends bx{constructor(t,e,n,i,s){super(new Uint8Array(0),e,n,i,s),this.sources=t}readNullBitmap(t,e,{offset:n}=this.nextBufferRange()){return e<=0?new Uint8Array(0):Fu(this.sources[n])}readOffsets(t,{offset:e}=this.nextBufferRange()){return xe(Uint8Array,xe(t.OffsetArrayType,this.sources[e]))}readTypeIds(t,{offset:e}=this.nextBufferRange()){return xe(Uint8Array,xe(t.ArrayType,this.sources[e]))}readData(t,{offset:e}=this.nextBufferRange()){const{sources:n}=this;return Ot.isTimestamp(t)||(Ot.isInt(t)||Ot.isTime(t))&&t.bitWidth===64||Ot.isDuration(t)||Ot.isDate(t)&&t.unit===nn.MILLISECOND?xe(Uint8Array,Ta.convertArray(n[e])):Ot.isDecimal(t)?xe(Uint8Array,x2.convertArray(n[e])):Ot.isBinary(t)||Ot.isLargeBinary(t)||Ot.isFixedSizeBinary(t)?T2(n[e]):Ot.isBool(t)?Fu(n[e]):Ot.isUtf8(t)||Ot.isLargeUtf8(t)?Zf(n[e].join("")):xe(Uint8Array,xe(t.ArrayType,n[e].map(i=>+i)))}}function T2(r){const t=r.join(""),e=new Uint8Array(t.length/2);for(let n=0;n>1]=Number.parseInt(t.slice(n,n+2),16);return e}let Nt=class extends se{compareSchemas(t,e){return t===e||e instanceof t.constructor&&this.compareManyFields(t.fields,e.fields)}compareManyFields(t,e){return t===e||Array.isArray(t)&&Array.isArray(e)&&t.length===e.length&&t.every((n,i)=>this.compareFields(n,e[i]))}compareFields(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&this.visit(t.type,e.type)}};function mr(r,t){return t instanceof r.constructor}function Fs(r,t){return r===t||mr(r,t)}function fi(r,t){return r===t||mr(r,t)&&r.bitWidth===t.bitWidth&&r.isSigned===t.isSigned}function lc(r,t){return r===t||mr(r,t)&&r.precision===t.precision}function I2(r,t){return r===t||mr(r,t)&&r.byteWidth===t.byteWidth}function cp(r,t){return r===t||mr(r,t)&&r.unit===t.unit}function Za(r,t){return r===t||mr(r,t)&&r.unit===t.unit&&r.timezone===t.timezone}function Ka(r,t){return r===t||mr(r,t)&&r.unit===t.unit&&r.bitWidth===t.bitWidth}function E2(r,t){return r===t||mr(r,t)&&r.children.length===t.children.length&&Li.compareManyFields(r.children,t.children)}function A2(r,t){return r===t||mr(r,t)&&r.children.length===t.children.length&&Li.compareManyFields(r.children,t.children)}function hp(r,t){return r===t||mr(r,t)&&r.mode===t.mode&&r.typeIds.every((e,n)=>e===t.typeIds[n])&&Li.compareManyFields(r.children,t.children)}function M2(r,t){return r===t||mr(r,t)&&r.id===t.id&&r.isOrdered===t.isOrdered&&Li.visit(r.indices,t.indices)&&Li.visit(r.dictionary,t.dictionary)}function dp(r,t){return r===t||mr(r,t)&&r.unit===t.unit}function Ja(r,t){return r===t||mr(r,t)&&r.unit===t.unit}function C2(r,t){return r===t||mr(r,t)&&r.listSize===t.listSize&&r.children.length===t.children.length&&Li.compareManyFields(r.children,t.children)}function O2(r,t){return r===t||mr(r,t)&&r.keysSorted===t.keysSorted&&r.children.length===t.children.length&&Li.compareManyFields(r.children,t.children)}Nt.prototype.visitNull=Fs;Nt.prototype.visitBool=Fs;Nt.prototype.visitInt=fi;Nt.prototype.visitInt8=fi;Nt.prototype.visitInt16=fi;Nt.prototype.visitInt32=fi;Nt.prototype.visitInt64=fi;Nt.prototype.visitUint8=fi;Nt.prototype.visitUint16=fi;Nt.prototype.visitUint32=fi;Nt.prototype.visitUint64=fi;Nt.prototype.visitFloat=lc;Nt.prototype.visitFloat16=lc;Nt.prototype.visitFloat32=lc;Nt.prototype.visitFloat64=lc;Nt.prototype.visitUtf8=Fs;Nt.prototype.visitLargeUtf8=Fs;Nt.prototype.visitBinary=Fs;Nt.prototype.visitLargeBinary=Fs;Nt.prototype.visitFixedSizeBinary=I2;Nt.prototype.visitDate=cp;Nt.prototype.visitDateDay=cp;Nt.prototype.visitDateMillisecond=cp;Nt.prototype.visitTimestamp=Za;Nt.prototype.visitTimestampSecond=Za;Nt.prototype.visitTimestampMillisecond=Za;Nt.prototype.visitTimestampMicrosecond=Za;Nt.prototype.visitTimestampNanosecond=Za;Nt.prototype.visitTime=Ka;Nt.prototype.visitTimeSecond=Ka;Nt.prototype.visitTimeMillisecond=Ka;Nt.prototype.visitTimeMicrosecond=Ka;Nt.prototype.visitTimeNanosecond=Ka;Nt.prototype.visitDecimal=Fs;Nt.prototype.visitList=E2;Nt.prototype.visitStruct=A2;Nt.prototype.visitUnion=hp;Nt.prototype.visitDenseUnion=hp;Nt.prototype.visitSparseUnion=hp;Nt.prototype.visitDictionary=M2;Nt.prototype.visitInterval=dp;Nt.prototype.visitIntervalDayTime=dp;Nt.prototype.visitIntervalYearMonth=dp;Nt.prototype.visitDuration=Ja;Nt.prototype.visitDurationSecond=Ja;Nt.prototype.visitDurationMillisecond=Ja;Nt.prototype.visitDurationMicrosecond=Ja;Nt.prototype.visitDurationNanosecond=Ja;Nt.prototype.visitFixedSizeList=C2;Nt.prototype.visitMap=O2;const Li=new Nt;function nf(r,t){return Li.compareSchemas(r,t)}function Ph(r,t){return P2(r,t.map(e=>e.data.concat()))}function P2(r,t){const e=[...r.fields],n=[],i={numBatches:t.reduce((h,f)=>Math.max(h,f.length),0)};let s=0,o=0,a=-1;const l=t.length;let u,c=[];for(;i.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,a=-1;++a0&&(n[s++]=le({type:new dr(e),length:o,nullCount:0,children:c.slice()})))}return[r=r.assign(e),n.map(h=>new _r(r,h))]}function R2(r,t,e,n,i){var s;const o=(t+63&-64)>>3;for(let a=-1,l=n.length;++a=t)c===t?e[a]=u:(e[a]=u.slice(0,t),i.numBatches=Math.max(i.numBatches,n[a].unshift(u.slice(t,c-t))));else{const h=r[a];r[a]=h.clone({nullable:!0}),e[a]=(s=u==null?void 0:u._changeLengthAndBackfillNullBitmap(t))!==null&&s!==void 0?s:le({type:h.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)})}}return e}var wx;let Ni=class cs{constructor(...t){var e,n;if(t.length===0)return this.batches=[],this.schema=new Le([]),this._offsets=[0],this;let i,s;t[0]instanceof Le&&(i=t.shift()),t.at(-1)instanceof Uint32Array&&(s=t.pop());const o=l=>{if(l){if(l instanceof _r)return[l];if(l instanceof cs)return l.batches;if(l instanceof Ae){if(l.type instanceof dr)return[new _r(new Le(l.type.children),l)]}else{if(Array.isArray(l))return l.flatMap(u=>o(u));if(typeof l[Symbol.iterator]=="function")return[...l].flatMap(u=>o(u));if(typeof l=="object"){const u=Object.keys(l),c=u.map(d=>new Ne([l[d]])),h=i??new Le(u.map((d,m)=>new Pe(String(d),c[m].type,c[m].nullable))),[,f]=Ph(h,c);return f.length===0?[new _r(l)]:f}}}return[]},a=t.flatMap(l=>o(l));if(i=(n=i??((e=a[0])===null||e===void 0?void 0:e.schema))!==null&&n!==void 0?n:new Le([]),!(i instanceof Le))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(const l of a){if(!(l instanceof _r))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!nf(i,l.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=i,this.batches=a,this._offsets=s??cx(this.data)}get data(){return this.batches.map(({data:t})=>t)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((t,e)=>t+e.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=ux(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}at(t){return this.get(np(t,this.numRows))}set(t,e){}indexOf(t,e){return-1}[Symbol.iterator](){return this.batches.length>0?ap.visit(new Ne(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[ ${this.toArray().join(`, `)} -]`}concat(...t){const e=this.schema,n=this.data.concat(t.flatMap(({data:i})=>i));return new cs(e,n.map(i=>new _r(e,i)))}slice(t,e){const n=this.schema;[t,e]=ax({length:this.numRows},t,e);const i=hx(this.data,this._offsets,t,e);return new cs(n,i.map(s=>new _r(n,s)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(e=>e.name===t))}getChildAt(t){if(t>-1&&tn.children[t]);if(e.length===0){const{type:n}=this.schema.fields[t],i=le({type:n,length:0,nullCount:0});e.push(i._changeLengthAndBackfillNullBitmap(this.numRows))}return new Ne(e)}return null}setChild(t,e){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(i=>i.name===t),e)}setChildAt(t,e){let n=this.schema,i=[...this.batches];if(t>-1&&tthis.getChildAt(u));[s[t],a[t]]=[o,e],[n,i]=Ph(n,a)}return new cs(n,i)}select(t){const e=this.schema.fields.reduce((n,i,s)=>n.set(i.name,s),new Map);return this.selectAt(t.map(n=>e.get(n)).filter(n=>n>-1))}selectAt(t){const e=this.schema.selectAt(t),n=this.batches.map(i=>i.selectAt(t));return new cs(e,n)}assign(t){const e=this.schema.fields,[n,i]=t.schema.fields.reduce((a,l,u)=>{const[c,h]=a,f=e.findIndex(d=>d.name===l.name);return~f?h[f]=u:c.push(u),a},[[],[]]),s=this.schema.assign(t.schema),o=[...e.map((a,l)=>[l,i[l]]).map(([a,l])=>l===void 0?this.getChildAt(a):t.getChildAt(l)),...n.map(a=>t.getChildAt(a))].filter(Boolean);return new cs(...Ph(s,o))}};wx=Symbol.toStringTag;Ni[wx]=(r=>(r.schema=null,r.batches=[],r._offsets=new Uint32Array([0]),r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,r.isValid=Du(op),r.get=Du(xr.getVisitFn(k.Struct)),r.set=dx(sn.getVisitFn(k.Struct)),r.indexOf=fx(Lu.getVisitFn(k.Struct)),"Table"))(Ni.prototype);var xx;let _r=class ba{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof Le))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=le({nullCount:0,type:new dr(this.schema.fields),children:this.schema.fields.map(e=>le({type:e.type,nullCount:0}))})]=t,!(this.data instanceof Ae))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=yy(this.schema,this.data.children);break}case 1:{const[e]=t,{fields:n,children:i,length:s}=Object.keys(e).reduce((l,u,c)=>(l.children[c]=e[u],l.length=Math.max(l.length,e[u].length),l.fields[c]=Pe.new({name:u,type:e[u].type,nullable:!0}),l),{length:0,fields:new Array,children:new Array}),o=new Le(n),a=le({type:new dr(n),length:s,children:i,nullCount:0});[this.schema,this.data]=yy(o,a.children,s);break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get dictionaries(){return this._dictionaries||(this._dictionaries=Sx(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(t){return this.data.getValid(t)}get(t){return xr.visit(this.data,t)}at(t){return this.get(np(t,this.numRows))}set(t,e){return sn.visit(this.data,t,e)}indexOf(t,e){return Lu.visit(this.data,t,e)}[Symbol.iterator](){return ap.visit(new Ne([this.data]))}toArray(){return[...this]}concat(...t){return new Ni(this.schema,[this,...t])}slice(t,e){const[n]=new Ne([this.data]).slice(t,e).data;return new ba(this.schema,n)}getChild(t){var e;return this.getChildAt((e=this.schema.fields)===null||e===void 0?void 0:e.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&ti.name===t),e)}setChildAt(t,e){let n=this.schema,i=this.data;if(t>-1&&ta.name===s);~o&&(i[o]=this.data.children[o])}return new ba(e,le({type:n,length:this.numRows,children:i}))}selectAt(t){const e=this.schema.selectAt(t),n=t.map(s=>this.data.children[s]).filter(Boolean),i=le({type:new dr(e.fields),length:this.numRows,children:n});return new ba(e,i)}};xx=Symbol.toStringTag;_r[xx]=(r=>(r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(_r.prototype);function yy(r,t,e=t.reduce((n,i)=>Math.max(n,i.length),0)){var n;const i=[...r.fields],s=[...t],o=(e+63&-64)>>3;for(const[a,l]of r.fields.entries()){const u=t[a];(!u||u.length!==e)&&(i[a]=l.clone({nullable:!0}),s[a]=(n=u==null?void 0:u._changeLengthAndBackfillNullBitmap(e))!==null&&n!==void 0?n:le({type:l.type,length:e,nullCount:e,nullBitmap:new Uint8Array(o)}))}return[r.assign(i),le({type:new dr(i),length:e,children:s})]}function Sx(r,t,e=new Map){var n,i;if(((n=r==null?void 0:r.length)!==null&&n!==void 0?n:0)>0&&(r==null?void 0:r.length)===(t==null?void 0:t.length))for(let s=-1,o=r.length;++sle({type:i.type})),n=le({type:new dr(t.fields),nullCount:0,children:e});super(t,n)}}let wi=class Sn{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMessage(t,e){return(e||new Sn).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+_e),(e||new Sn).__init(t.readInt32(t.position())+t.position(),t)}version(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):je.V1}headerType(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):me.NONE}header(t){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null}bodyLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}customMetadata(t,e){const n=this.bb.__offset(this.bb_pos,12);return n?(e||new qe).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,je.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,me.NONE)}static addHeader(t,e){t.addFieldOffset(2,e,0)}static addBodyLength(t,e){t.addFieldInt64(3,e,BigInt("0"))}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,e){t.finish(e)}static finishSizePrefixedMessageBuffer(t,e){t.finish(e,void 0,!0)}static createMessage(t,e,n,i,s,o){return Sn.startMessage(t),Sn.addVersion(t,e),Sn.addHeaderType(t,n),Sn.addHeader(t,i),Sn.addBodyLength(t,s),Sn.addCustomMetadata(t,o),Sn.endMessage(t)}};class F2 extends se{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return ay.startNull(e),ay.endNull(e)}visitInt(t,e){return Cr.startInt(e),Cr.addBitWidth(e,t.bitWidth),Cr.addIsSigned(e,t.isSigned),Cr.endInt(e)}visitFloat(t,e){return Rn.startFloatingPoint(e),Rn.addPrecision(e,t.precision),Rn.endFloatingPoint(e)}visitBinary(t,e){return ry.startBinary(e),ry.endBinary(e)}visitLargeBinary(t,e){return iy.startLargeBinary(e),iy.endLargeBinary(e)}visitBool(t,e){return ny.startBool(e),ny.endBool(e)}visitUtf8(t,e){return ly.startUtf8(e),ly.endUtf8(e)}visitLargeUtf8(t,e){return sy.startLargeUtf8(e),sy.endLargeUtf8(e)}visitDecimal(t,e){return Js.startDecimal(e),Js.addScale(e,t.scale),Js.addPrecision(e,t.precision),Js.addBitWidth(e,t.bitWidth),Js.endDecimal(e)}visitDate(t,e){return Vl.startDate(e),Vl.addUnit(e,t.unit),Vl.endDate(e)}visitTime(t,e){return Zr.startTime(e),Zr.addUnit(e,t.unit),Zr.addBitWidth(e,t.bitWidth),Zr.endTime(e)}visitTimestamp(t,e){const n=t.timezone&&e.createString(t.timezone)||void 0;return Kr.startTimestamp(e),Kr.addUnit(e,t.unit),n!==void 0&&Kr.addTimezone(e,n),Kr.endTimestamp(e)}visitInterval(t,e){return Fn.startInterval(e),Fn.addUnit(e,t.unit),Fn.endInterval(e)}visitDuration(t,e){return jl.startDuration(e),jl.addUnit(e,t.unit),jl.endDuration(e)}visitList(t,e){return oy.startList(e),oy.endList(e)}visitStruct(t,e){return ys.startStruct_(e),ys.endStruct_(e)}visitUnion(t,e){vr.startTypeIdsVector(e,t.typeIds.length);const n=vr.createTypeIdsVector(e,t.typeIds);return vr.startUnion(e),vr.addMode(e,t.mode),vr.addTypeIds(e,n),vr.endUnion(e)}visitDictionary(t,e){const n=this.visit(t.indices,e);return ai.startDictionaryEncoding(e),ai.addId(e,BigInt(t.id)),ai.addIsOrdered(e,t.isOrdered),n!==void 0&&ai.addIndexType(e,n),ai.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return $l.startFixedSizeBinary(e),$l.addByteWidth(e,t.byteWidth),$l.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return Gl.startFixedSizeList(e),Gl.addListSize(e,t.listSize),Gl.endFixedSizeList(e)}visitMap(t,e){return Wl.startMap(e),Wl.addKeysSorted(e,t.keysSorted),Wl.endMap(e)}}const Rh=new F2;function D2(r,t=new Map){return new Le(N2(r,t),Yl(r.metadata),t)}function Tx(r){return new Br(r.count,Ix(r.columns),Ex(r.columns))}function L2(r){return new Vn(Tx(r.data),r.id,r.isDelta)}function N2(r,t){return(r.fields||[]).filter(Boolean).map(e=>Pe.fromJSON(e,t))}function vy(r,t){return(r.children||[]).filter(Boolean).map(e=>Pe.fromJSON(e,t))}function Ix(r){return(r||[]).reduce((t,e)=>[...t,new Bi(e.count,B2(e.VALIDITY)),...Ix(e.children)],[])}function Ex(r,t=[]){for(let e=-1,n=(r||[]).length;++et+ +(e===0),0)}function U2(r,t){let e,n,i,s,o,a;return!t||!(s=r.dictionary)?(o=by(r,vy(r,t)),i=new Pe(r.name,o,r.nullable,Yl(r.metadata))):t.has(e=s.id)?(n=(n=s.indexType)?_y(n):new za,a=new Oo(t.get(e),n,e,s.isOrdered),i=new Pe(r.name,a,r.nullable,Yl(r.metadata))):(n=(n=s.indexType)?_y(n):new za,t.set(e,o=by(r,vy(r,t))),a=new Oo(o,n,e,s.isOrdered),i=new Pe(r.name,a,r.nullable,Yl(r.metadata))),i||null}function Yl(r=[]){return new Map(r.map(({key:t,value:e})=>[t,e]))}function _y(r){return new Es(r.isSigned,r.bitWidth)}function by(r,t){const e=r.type.name;switch(e){case"NONE":return new Fi;case"null":return new Fi;case"binary":return new gu;case"largebinary":return new yu;case"utf8":return new vu;case"largeutf8":return new _u;case"bool":return new bu;case"list":return new Au((t||[])[0]);case"struct":return new dr(t||[]);case"struct_":return new dr(t||[])}switch(e){case"int":{const n=r.type;return new Es(n.isSigned,n.bitWidth)}case"floatingpoint":{const n=r.type;return new mu(ar[n.precision])}case"decimal":{const n=r.type;return new wu(n.scale,n.precision,n.bitWidth)}case"date":{const n=r.type;return new xu(nn[n.unit])}case"time":{const n=r.type;return new Su(Vt[n.unit],n.bitWidth)}case"timestamp":{const n=r.type;return new Tu(Vt[n.unit],n.timezone)}case"interval":{const n=r.type;return new Iu(zn[n.unit])}case"duration":{const n=r.type;return new Eu(Vt[n.unit])}case"union":{const n=r.type,[i,...s]=(n.mode+"").toLowerCase(),o=i.toUpperCase()+s.join("");return new Mu(lr[o],n.typeIds||[],t||[])}case"fixedsizebinary":{const n=r.type;return new Cu(n.byteWidth)}case"fixedsizelist":{const n=r.type;return new Ou(n.listSize,(t||[])[0])}case"map":{const n=r.type;return new Pu((t||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${e}"`)}var k2=zb,z2=Mo;class fr{static fromJSON(t,e){const n=new fr(0,je.V5,e);return n._createHeader=V2(t,e),n}static decode(t){t=new z2(ce(t));const e=wi.getRootAsMessage(t),n=e.bodyLength(),i=e.version(),s=e.headerType(),o=new fr(n,i,s);return o._createHeader=j2(e,s),o}static encode(t){const e=new k2;let n=-1;return t.isSchema()?n=Le.encode(e,t.header()):t.isRecordBatch()?n=Br.encode(e,t.header()):t.isDictionaryBatch()&&(n=Vn.encode(e,t.header())),wi.startMessage(e),wi.addVersion(e,je.V5),wi.addHeader(e,n),wi.addHeaderType(e,t.headerType),wi.addBodyLength(e,BigInt(t.bodyLength)),wi.finishMessageBuffer(e,wi.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof Le)return new fr(0,je.V5,me.Schema,t);if(t instanceof Br)return new fr(e,je.V5,me.RecordBatch,t);if(t instanceof Vn)return new fr(e,je.V5,me.DictionaryBatch,t);throw new Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===me.Schema}isRecordBatch(){return this.headerType===me.RecordBatch}isDictionaryBatch(){return this.headerType===me.DictionaryBatch}constructor(t,e,n,i){this._version=e,this._headerType=n,this.body=new Uint8Array(0),i&&(this._createHeader=()=>i),this._bodyLength=Te(t)}}class Br{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,e,n){this._nodes=e,this._buffers=n,this._length=Te(t)}}class Vn{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(t,e,n=!1){this._data=t,this._isDelta=n,this._id=Te(e)}}class Ln{constructor(t,e){this.offset=Te(t),this.length=Te(e)}}class Bi{constructor(t,e){this.length=Te(t),this.nullCount=Te(e)}}function V2(r,t){return()=>{switch(t){case me.Schema:return Le.fromJSON(r);case me.RecordBatch:return Br.fromJSON(r);case me.DictionaryBatch:return Vn.fromJSON(r)}throw new Error(`Unrecognized Message type: { name: ${me[t]}, type: ${t} }`)}}function j2(r,t){return()=>{switch(t){case me.Schema:return Le.decode(r.header(new In),new Map,r.version());case me.RecordBatch:return Br.decode(r.header(new ri),r.version());case me.DictionaryBatch:return Vn.decode(r.header(new Zs),r.version())}throw new Error(`Unrecognized Message type: { name: ${me[t]}, type: ${t} }`)}}Pe.encode=J2;Pe.decode=Z2;Pe.fromJSON=U2;Le.encode=K2;Le.decode=$2;Le.fromJSON=D2;Br.encode=tD;Br.decode=G2;Br.fromJSON=Tx;Vn.encode=eD;Vn.decode=W2;Vn.fromJSON=L2;Bi.encode=rD;Bi.decode=X2;Ln.encode=nD;Ln.decode=H2;function $2(r,t=new Map,e=je.V5){const n=Q2(r,t);return new Le(n,ql(r),t,e)}function G2(r,t=je.V5){if(r.compression()!==null)throw new Error("Record batch compression not implemented");return new Br(r.length(),Y2(r),q2(r,t))}function W2(r,t=je.V5){return new Vn(Br.decode(r.data(),t),r.id(),r.isDelta())}function H2(r){return new Ln(r.offset(),r.length())}function X2(r){return new Bi(r.length(),r.nullCount())}function Y2(r){const t=[];for(let e,n=-1,i=-1,s=r.nodesLength();++nPe.encode(r,s));In.startFieldsVector(r,e.length);const n=In.createFieldsVector(r,e),i=t.metadata&&t.metadata.size>0?In.createCustomMetadataVector(r,[...t.metadata].map(([s,o])=>{const a=r.createString(`${s}`),l=r.createString(`${o}`);return qe.startKeyValue(r),qe.addKey(r,a),qe.addValue(r,l),qe.endKeyValue(r)})):-1;return In.startSchema(r),In.addFields(r,n),In.addEndianness(r,iD?Co.Little:Co.Big),i!==-1&&In.addCustomMetadata(r,i),In.endSchema(r)}function J2(r,t){let e=-1,n=-1,i=-1;const s=t.type;let o=t.typeId;Ot.isDictionary(s)?(o=s.dictionary.typeId,i=Rh.visit(s,r),n=Rh.visit(s.dictionary,r)):n=Rh.visit(s,r);const a=(s.children||[]).map(c=>Pe.encode(r,c)),l=Wr.createChildrenVector(r,a),u=t.metadata&&t.metadata.size>0?Wr.createCustomMetadataVector(r,[...t.metadata].map(([c,h])=>{const f=r.createString(`${c}`),d=r.createString(`${h}`);return qe.startKeyValue(r),qe.addKey(r,f),qe.addValue(r,d),qe.endKeyValue(r)})):-1;return t.name&&(e=r.createString(t.name)),Wr.startField(r),Wr.addType(r,n),Wr.addTypeType(r,o),Wr.addChildren(r,l),Wr.addNullable(r,!!t.nullable),e!==-1&&Wr.addName(r,e),i!==-1&&Wr.addDictionary(r,i),u!==-1&&Wr.addCustomMetadata(r,u),Wr.endField(r)}function tD(r,t){const e=t.nodes||[],n=t.buffers||[];ri.startNodesVector(r,e.length);for(const o of e.slice().reverse())Bi.encode(r,o);const i=r.endVector();ri.startBuffersVector(r,n.length);for(const o of n.slice().reverse())Ln.encode(r,o);const s=r.endVector();return ri.startRecordBatch(r),ri.addLength(r,BigInt(t.length)),ri.addNodes(r,i),ri.addBuffers(r,s),ri.endRecordBatch(r)}function eD(r,t){const e=Br.encode(r,t.data);return Zs.startDictionaryBatch(r),Zs.addId(r,BigInt(t.id)),Zs.addIsDelta(r,t.isDelta),Zs.addData(r,e),Zs.endDictionaryBatch(r)}function rD(r,t){return $b.createFieldNode(r,BigInt(t.length),BigInt(t.nullCount))}function nD(r,t){return jb.createBuffer(r,BigInt(t.offset),BigInt(t.length))}const iD=(()=>{const r=new ArrayBuffer(2);return new DataView(r).setInt16(0,256,!0),new Int16Array(r)[0]===256})(),pp=r=>`Expected ${me[r]} Message in stream, but was null or length 0.`,mp=r=>`Header pointer of flatbuffer-encoded ${me[r]} Message is null or length 0.`,Ax=(r,t)=>`Expected to read ${r} metadata bytes, but only read ${t}.`,Mx=(r,t)=>`Expected to read ${r} bytes for message body, but only read ${t}.`;class Cx{constructor(t){this.source=t instanceof Nu?t:new Nu(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done||t.value===-1&&(t=this.readMetadataLength()).done||(t=this.readMetadata(t.value)).done?Be:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(pp(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);const e=ce(this.source.read(t));if(e.byteLength[...i,...s.VALIDITY&&[s.VALIDITY]||[],...s.TYPE_ID&&[s.TYPE_ID]||[],...s.OFFSET&&[s.OFFSET]||[],...s.DATA&&[s.DATA]||[],...e(s.children)],[])}}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(pp(t));return e.value}readSchema(){const t=me.Schema,e=this.readMessage(t),n=e==null?void 0:e.header();if(!e||!n)throw new Error(mp(t));return n}}const uc=4,sf="ARROW1",ja=new Uint8Array(sf.length);for(let r=0;rthis):this}readRecordBatch(t){return this._impl.isFile()?this._impl.readRecordBatch(t):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return Yr.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Yr.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof tn?t:Hd(t)?hD(t):Db(t)?pD(t):Is(t)?Jt(this,void 0,void 0,function*(){return yield tn.from(yield t)}):Lb(t)||Kf(t)||Nb(t)||Uo(t)?fD(new Po(t)):dD(new Nu(t))}static readAll(t){return t instanceof tn?t.isSync()?Ty(t):Iy(t):Hd(t)||ArrayBuffer.isView(t)||Qa(t)||Fb(t)?Ty(t):Iy(t)}}class Uu extends tn{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return br(this,arguments,function*(){yield Rt(yield*Ss(Bn(this[Symbol.iterator]())))})}}class ku extends tn{constructor(t){super(t),this._impl=t}readAll(){return Jt(this,void 0,void 0,function*(){var t,e,n,i;const s=new Array;try{for(var o=!0,a=Bn(this),l;l=yield a.next(),t=l.done,!t;o=!0){i=l.value,o=!1;const u=i;s.push(u)}}catch(u){e={error:u}}finally{try{!o&&!t&&(n=a.return)&&(yield n.call(a))}finally{if(e)throw e.error}}return s})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class Px extends Uu{constructor(t){super(t),this._impl=t}}class lD extends ku{constructor(t){super(t),this._impl=t}}class Rx{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,e){const n=this._loadVectors(t,e,this.schema.fields),i=le({type:new dr(this.schema.fields),length:t.length,children:n});return new _r(this.schema,i)}_loadDictionaryBatch(t,e){const{id:n,isDelta:i}=t,{dictionaries:s,schema:o}=this,a=s.get(n),l=o.dictionaries.get(n),u=this._loadVectors(t.data,e,[l]);return(a&&i?a.concat(new Ne(u)):new Ne(u)).memoize()}_loadVectors(t,e,n){return new bx(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}}class zu extends Rx{constructor(t,e){super(e),this._reader=Hd(t)?new oD(this._handle=t):new Cx(this._handle=t)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(t){return this.closed||(this.autoDestroy=Dx(this,t),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(t):Be}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):Be}next(){if(this.closed)return Be;let t;const{_reader:e}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const n=t.header(),i=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const n=t.header(),i=e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new fp(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class Vu extends Rx{constructor(t,e){super(e),this._reader=new sD(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return Jt(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(t){return Jt(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=Dx(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return Jt(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):Be})}return(t){return Jt(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):Be})}next(){return Jt(this,void 0,void 0,function*(){if(this.closed)return Be;let t;const{_reader:e}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const n=t.header(),i=yield e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const n=t.header(),i=yield e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new fp(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return Jt(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}}class Fx extends zu{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,e){super(t instanceof gy?t:new gy(t),e)}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(const e of this._footer.dictionaryBatches())e&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){var e;if(this.closed)return null;this._footer||this.open();const n=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(n&&this._handle.seek(n.offset)){const i=this._reader.readMessage(me.RecordBatch);if(i!=null&&i.isRecordBatch()){const s=i.header(),o=this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(s,o)}}return null}_readDictionaryBatch(t){var e;const n=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(n&&this._handle.seek(n.offset)){const i=this._reader.readMessage(me.DictionaryBatch);if(i!=null&&i.isDictionaryBatch()){const s=i.header(),o=this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}}_readFooter(){const{_handle:t}=this,e=t.size-Ox,n=t.readInt32(e),i=t.readAt(e-n,n);return Va.decode(i)}_readNextMessageAndValidate(t){var e;if(this._footer||this.open(),this._footer&&this._recordBatchIndexsuper.open}});return Jt(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(const n of this._footer.dictionaryBatches())n&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield e.open.call(this,t)})}readRecordBatch(t){return Jt(this,void 0,void 0,function*(){var e;if(this.closed)return null;this._footer||(yield this.open());const n=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(n&&(yield this._handle.seek(n.offset))){const i=yield this._reader.readMessage(me.RecordBatch);if(i!=null&&i.isRecordBatch()){const s=i.header(),o=yield this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(s,o)}}return null})}_readDictionaryBatch(t){return Jt(this,void 0,void 0,function*(){var e;const n=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(n&&(yield this._handle.seek(n.offset))){const i=yield this._reader.readMessage(me.DictionaryBatch);if(i!=null&&i.isDictionaryBatch()){const s=i.header(),o=yield this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}})}_readFooter(){return Jt(this,void 0,void 0,function*(){const{_handle:t}=this;t._pending&&(yield t._pending);const e=t.size-Ox,n=yield t.readInt32(e),i=yield t.readAt(e-n,n);return Va.decode(i)})}_readNextMessageAndValidate(t){return Jt(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex=4?gp(t)?new Px(new Fx(r.read())):new Uu(new zu(r)):new Uu(new zu(function*(){}()))}function fD(r){return Jt(this,void 0,void 0,function*(){const t=yield r.peek(tl+7&-8);return t&&t.byteLength>=4?gp(t)?new Px(new Fx(yield r.read())):new ku(new Vu(r)):new ku(new Vu(function(){return br(this,arguments,function*(){})}()))})}function pD(r){return Jt(this,void 0,void 0,function*(){const{size:t}=yield r.stat(),e=new Bu(r,t);return t>=aD&&gp(yield e.readAt(0,tl+7&-8))?new lD(new uD(e)):new ku(new Vu(e))})}class ke extends se{static assemble(...t){const e=i=>i.flatMap(s=>Array.isArray(s)?e(s):s instanceof _r?s.data.children:s.data),n=new ke;return n.visitMany(e(t)),n}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(t){if(t instanceof Ne)return this.visitMany(t.data),this;const{type:e}=t;if(!Ot.isDictionary(e)){const{length:n}=t;if(n>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(Ot.isUnion(e))this.nodes.push(new Bi(n,0));else{const{nullCount:i}=t;Ot.isNull(e)||dn.call(this,i<=0?new Uint8Array(0):Ru(t.offset,n,t.nullBitmap)),this.nodes.push(new Bi(n,i))}}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}}function dn(r){const t=r.byteLength+7&-8;return this.buffers.push(r),this.bufferRegions.push(new Ln(this._byteLength,t)),this._byteLength+=t,this}function mD(r){var t;const{type:e,length:n,typeIds:i,valueOffsets:s}=r;if(dn.call(this,i),e.mode===lr.Sparse)return of.call(this,r);if(e.mode===lr.Dense){if(r.offset<=0)return dn.call(this,s),of.call(this,r);{const o=new Int32Array(n),a=Object.create(null),l=Object.create(null);for(let u,c,h=-1;++h{const h=e.typeIds[c],f=a[h],d=l[h];return u.slice(f,Math.min(n,d))}))}}return this}function gD(r){let t;return r.nullCount>=r.length?dn.call(this,new Uint8Array(0)):(t=r.values)instanceof Uint8Array?dn.call(this,Ru(r.offset,r.length,t)):dn.call(this,Fu(r.values))}function pi(r){return dn.call(this,r.values.subarray(0,r.length*r.stride))}function cc(r){const{length:t,values:e,valueOffsets:n}=r,i=Te(n[0]),s=Te(n[t]),o=Math.min(s-i,e.byteLength-i);return dn.call(this,Ub(-i,t+1,n)),dn.call(this,e.subarray(i,i+o)),this}function yp(r){const{length:t,valueOffsets:e}=r;if(e){const{[0]:n,[t]:i}=e;return dn.call(this,Ub(-n,t+1,e)),this.visit(r.children[0].slice(n,i-n))}return this.visit(r.children[0])}function of(r){return this.visitMany(r.type.children.map((t,e)=>r.children[e]).filter(Boolean))[0]}ke.prototype.visitBool=gD;ke.prototype.visitInt=pi;ke.prototype.visitFloat=pi;ke.prototype.visitUtf8=cc;ke.prototype.visitLargeUtf8=cc;ke.prototype.visitBinary=cc;ke.prototype.visitLargeBinary=cc;ke.prototype.visitFixedSizeBinary=pi;ke.prototype.visitDate=pi;ke.prototype.visitTimestamp=pi;ke.prototype.visitTime=pi;ke.prototype.visitDecimal=pi;ke.prototype.visitList=yp;ke.prototype.visitStruct=of;ke.prototype.visitUnion=mD;ke.prototype.visitInterval=pi;ke.prototype.visitDuration=pi;ke.prototype.visitFixedSizeList=yp;ke.prototype.visitMap=yp;class Lx extends lp{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}constructor(t){super(),this._position=0,this._started=!1,this._sink=new Xl,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,wr(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return Is(t)?t.then(e=>this.writeAll(e)):Uo(t)?wp(this,t):bp(this,t)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(t){return this._sink.toDOMStream(t)}toNodeStream(t){return this._sink.toNodeStream(t)}close(){return this.reset()._sink.close()}abort(t){return this.reset()._sink.abort(t)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(t=this._sink,e=null){return t===this._sink||t instanceof Xl?this._sink=t:(this._sink=new Xl,t&&WR(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&HR(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!e||!nf(e,this._schema))&&(e==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=e,this._writeSchema(e))),this}write(t){let e=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof Ni&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof _r&&!(e=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(e&&!nf(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof _r?t instanceof fp||this._writeRecordBatch(t):t instanceof Ni?this.writeAll(t.batches):Qa(t)&&this.writeAll(t)}_writeMessage(t,e=8){const n=e-1,i=fr.encode(t),s=i.byteLength,o=this._writeLegacyIpcFormat?4:8,a=s+o+n&~n,l=a-s-o;return t.headerType===me.RecordBatch?this._recordBatchBlocks.push(new Di(a,t.bodyLength,this._position)):t.headerType===me.DictionaryBatch&&this._dictionaryBlocks.push(new Di(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-o)),s>0&&this._write(i),this._writePadding(l)}_write(t){if(this._started){const e=ce(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(fr.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(ja)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:e,nodes:n,bufferRegions:i,buffers:s}=ke.assemble(t),o=new Br(t.numRows,n,i),a=fr.from(o,e);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(s)}_writeDictionaryBatch(t,e,n=!1){const{byteLength:i,nodes:s,bufferRegions:o,buffers:a}=ke.assemble(new Ne([t])),l=new Br(t.length,s,o),u=new Vn(l,e,n),c=fr.from(u,i);return this._writeMessage(c)._writeBodyBuffers(a)}_writeBodyBuffers(t){let e,n,i;for(let s=-1,o=t.length;++s0&&(this._write(e),(i=(n+7&-8)-n)>0&&this._writePadding(i));return this}_writeDictionaries(t){var e,n;for(const[i,s]of t.dictionaries){const o=(e=s==null?void 0:s.data)!==null&&e!==void 0?e:[],a=this._seenDictionaries.get(i),l=(n=this._dictionaryDeltaOffsets.get(i))!==null&&n!==void 0?n:0;if(!a||a.data[0]!==o[0])for(const[u,c]of o.entries())this._writeDictionaryBatch(c,i,u>0);else if(ln.writeAll(i)):Uo(t)?wp(n,t):bp(n,t)}}class _p extends Lx{static writeAll(t){const e=new _p;return Is(t)?t.then(n=>e.writeAll(n)):Uo(t)?wp(e,t):bp(e,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(t,e,n=!1){if(!n&&this._seenDictionaries.has(e))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(t,e,n)}_writeFooter(t){const e=Va.encode(new Va(t,je.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}}function bp(r,t){let e=t;t instanceof Ni&&(e=t.batches,r.reset(void 0,t.schema));for(const n of e)r.write(n);return r.finish()}function wp(r,t){return Jt(this,void 0,void 0,function*(){var e,n,i,s,o,a,l;try{for(e=!0,n=Bn(t);i=yield n.next(),s=i.done,!s;e=!0){l=i.value,e=!1;const u=l;r.write(u)}}catch(u){o={error:u}}finally{try{!e&&!s&&(a=n.return)&&(yield a.call(n))}finally{if(o)throw o.error}}return r.finish()})}function yD(r,t="stream"){return(t==="stream"?vp:_p).writeAll(r).toUint8Array(!0)}var vD=Object.create,Nx=Object.defineProperty,_D=Object.getOwnPropertyDescriptor,bD=Object.getOwnPropertyNames,wD=Object.getPrototypeOf,xD=Object.prototype.hasOwnProperty,SD=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),TD=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of bD(t))!xD.call(r,i)&&i!==e&&Nx(r,i,{get:()=>t[i],enumerable:!(n=_D(t,i))||n.enumerable});return r},ID=(r,t,e)=>(e=r!=null?vD(wD(r)):{},TD(!r||!r.__esModule?Nx(e,"default",{value:r,enumerable:!0}):e,r)),ED=SD((r,t)=>{t.exports=Worker}),Bx=(r=>(r[r.UNDEFINED=0]="UNDEFINED",r[r.AUTOMATIC=1]="AUTOMATIC",r[r.READ_ONLY=2]="READ_ONLY",r[r.READ_WRITE=3]="READ_WRITE",r))(Bx||{}),AD=(r=>(r[r.IDENTIFIER=0]="IDENTIFIER",r[r.NUMERIC_CONSTANT=1]="NUMERIC_CONSTANT",r[r.STRING_CONSTANT=2]="STRING_CONSTANT",r[r.OPERATOR=3]="OPERATOR",r[r.KEYWORD=4]="KEYWORD",r[r.COMMENT=5]="COMMENT",r))(AD||{}),MD=(r=>(r[r.NONE=0]="NONE",r[r.DEBUG=1]="DEBUG",r[r.INFO=2]="INFO",r[r.WARNING=3]="WARNING",r[r.ERROR=4]="ERROR",r))(MD||{}),CD=(r=>(r[r.NONE=0]="NONE",r[r.CONNECT=1]="CONNECT",r[r.DISCONNECT=2]="DISCONNECT",r[r.OPEN=3]="OPEN",r[r.QUERY=4]="QUERY",r[r.INSTANTIATE=5]="INSTANTIATE",r))(CD||{}),OD=(r=>(r[r.NONE=0]="NONE",r[r.OK=1]="OK",r[r.ERROR=2]="ERROR",r[r.START=3]="START",r[r.RUN=4]="RUN",r[r.CAPTURE=5]="CAPTURE",r))(OD||{}),PD=(r=>(r[r.NONE=0]="NONE",r[r.WEB_WORKER=1]="WEB_WORKER",r[r.NODE_WORKER=2]="NODE_WORKER",r[r.BINDINGS=3]="BINDINGS",r[r.ASYNC_DUCKDB=4]="ASYNC_DUCKDB",r))(PD||{}),RD=class{log(r){}},Ux=class{constructor(r=2){this.level=r}log(r){r.level>=this.level&&console.log(r)}},FD=(r=>(r[r.SUCCESS=0]="SUCCESS",r))(FD||{}),DD=class{constructor(r,t){this._bindings=r,this._conn=t}get bindings(){return this._bindings}async close(){return this._bindings.disconnect(this._conn)}useUnsafe(r){return r(this._bindings,this._conn)}async query(r){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:r});let t=await this._bindings.runQuery(this._conn,r),e=tn.from(t);return console.assert(e.isSync(),"Reader is not sync"),console.assert(e.isFile(),"Reader is not file"),new Ni(e)}async send(r,t=!1){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:r});let e=await this._bindings.startPendingQuery(this._conn,r,t);for(;e==null;)e=await this._bindings.pollPendingQuery(this._conn);let n=new kx(this._bindings,this._conn,e),i=await tn.from(n);return console.assert(i.isAsync()),console.assert(i.isStream()),i}async cancelSent(){return await this._bindings.cancelPendingQuery(this._conn)}async getTableNames(r){return await this._bindings.getTableNames(this._conn,r)}async prepare(r){let t=await this._bindings.createPrepared(this._conn,r);return new LD(this._bindings,this._conn,t)}async insertArrowTable(r,t){let e=yD(r,"stream");await this.insertArrowFromIPCStream(e,t)}async insertArrowFromIPCStream(r,t){await this._bindings.insertArrowFromIPCStream(this._conn,r,t)}async insertCSVFromPath(r,t){await this._bindings.insertCSVFromPath(this._conn,r,t)}async insertJSONFromPath(r,t){await this._bindings.insertJSONFromPath(this._conn,r,t)}},kx=class{constructor(r,t,e){this.db=r,this.conn=t,this.header=e,this._first=!0,this._depleted=!1,this._inFlight=null}async next(){if(this._first)return this._first=!1,{done:!1,value:this.header};if(this._depleted)return{done:!0,value:null};let r;return this._inFlight!=null?(r=await this._inFlight,this._inFlight=null):r=await this.db.fetchQueryResults(this.conn),this._depleted=r.length==0,this._depleted||(this._inFlight=this.db.fetchQueryResults(this.conn)),{done:this._depleted,value:r}}[Symbol.asyncIterator](){return this}},LD=class{constructor(r,t,e){this.bindings=r,this.connectionId=t,this.statementId=e}async close(){await this.bindings.closePrepared(this.connectionId,this.statementId)}async query(...r){let t=await this.bindings.runPrepared(this.connectionId,this.statementId,r),e=tn.from(t);return console.assert(e.isSync()),console.assert(e.isFile()),new Ni(e)}async send(...r){let t=await this.bindings.sendPrepared(this.connectionId,this.statementId,r),e=new kx(this.bindings,this.connectionId,t),n=await tn.from(e);return console.assert(n.isAsync()),console.assert(n.isStream()),n}},ND=(r=>(r.CANCEL_PENDING_QUERY="CANCEL_PENDING_QUERY",r.CLOSE_PREPARED="CLOSE_PREPARED",r.COLLECT_FILE_STATISTICS="COLLECT_FILE_STATISTICS",r.REGISTER_OPFS_FILE_NAME="REGISTER_OPFS_FILE_NAME",r.CONNECT="CONNECT",r.COPY_FILE_TO_BUFFER="COPY_FILE_TO_BUFFER",r.COPY_FILE_TO_PATH="COPY_FILE_TO_PATH",r.CREATE_PREPARED="CREATE_PREPARED",r.DISCONNECT="DISCONNECT",r.DROP_FILE="DROP_FILE",r.DROP_FILES="DROP_FILES",r.EXPORT_FILE_STATISTICS="EXPORT_FILE_STATISTICS",r.FETCH_QUERY_RESULTS="FETCH_QUERY_RESULTS",r.FLUSH_FILES="FLUSH_FILES",r.GET_FEATURE_FLAGS="GET_FEATURE_FLAGS",r.GET_TABLE_NAMES="GET_TABLE_NAMES",r.GET_VERSION="GET_VERSION",r.GLOB_FILE_INFOS="GLOB_FILE_INFOS",r.INSERT_ARROW_FROM_IPC_STREAM="INSERT_ARROW_FROM_IPC_STREAM",r.INSERT_CSV_FROM_PATH="IMPORT_CSV_FROM_PATH",r.INSERT_JSON_FROM_PATH="IMPORT_JSON_FROM_PATH",r.INSTANTIATE="INSTANTIATE",r.OPEN="OPEN",r.PING="PING",r.POLL_PENDING_QUERY="POLL_PENDING_QUERY",r.REGISTER_FILE_BUFFER="REGISTER_FILE_BUFFER",r.REGISTER_FILE_HANDLE="REGISTER_FILE_HANDLE",r.REGISTER_FILE_URL="REGISTER_FILE_URL",r.RESET="RESET",r.RUN_PREPARED="RUN_PREPARED",r.RUN_QUERY="RUN_QUERY",r.SEND_PREPARED="SEND_PREPARED",r.START_PENDING_QUERY="START_PENDING_QUERY",r.TOKENIZE="TOKENIZE",r))(ND||{}),BD=(r=>(r.CONNECTION_INFO="CONNECTION_INFO",r.ERROR="ERROR",r.FEATURE_FLAGS="FEATURE_FLAGS",r.FILE_BUFFER="FILE_BUFFER",r.FILE_INFOS="FILE_INFOS",r.FILE_SIZE="FILE_SIZE",r.FILE_STATISTICS="FILE_STATISTICS",r.INSTANTIATE_PROGRESS="INSTANTIATE_PROGRESS",r.LOG="LOG",r.OK="OK",r.PREPARED_STATEMENT_ID="PREPARED_STATEMENT_ID",r.QUERY_PLAN="QUERY_PLAN",r.QUERY_RESULT="QUERY_RESULT",r.QUERY_RESULT_CHUNK="QUERY_RESULT_CHUNK",r.QUERY_RESULT_HEADER="QUERY_RESULT_HEADER",r.QUERY_RESULT_HEADER_OR_NULL="QUERY_RESULT_HEADER_OR_NULL",r.REGISTERED_FILE="REGISTERED_FILE",r.SCRIPT_TOKENS="SCRIPT_TOKENS",r.SUCCESS="SUCCESS",r.TABLE_NAMES="TABLE_NAMES",r.VERSION_STRING="VERSION_STRING",r))(BD||{}),de=class{constructor(r,t){this.promiseResolver=()=>{},this.promiseRejecter=()=>{},this.type=r,this.data=t,this.promise=new Promise((e,n)=>{this.promiseResolver=e,this.promiseRejecter=n})}};function Ql(r){switch(r.typeId){case k.Binary:return{sqlType:"binary"};case k.Bool:return{sqlType:"bool"};case k.Date:return{sqlType:"date"};case k.DateDay:return{sqlType:"date32[d]"};case k.DateMillisecond:return{sqlType:"date64[ms]"};case k.Decimal:{let t=r;return{sqlType:"decimal",precision:t.precision,scale:t.scale}}case k.Float:return{sqlType:"float"};case k.Float16:return{sqlType:"float16"};case k.Float32:return{sqlType:"float32"};case k.Float64:return{sqlType:"float64"};case k.Int:return{sqlType:"int32"};case k.Int16:return{sqlType:"int16"};case k.Int32:return{sqlType:"int32"};case k.Int64:return{sqlType:"int64"};case k.Uint16:return{sqlType:"uint16"};case k.Uint32:return{sqlType:"uint32"};case k.Uint64:return{sqlType:"uint64"};case k.Uint8:return{sqlType:"uint8"};case k.IntervalDayTime:return{sqlType:"interval[dt]"};case k.IntervalYearMonth:return{sqlType:"interval[m]"};case k.List:return{sqlType:"list",valueType:Ql(r.valueType)};case k.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:r.byteWidth};case k.Null:return{sqlType:"null"};case k.Utf8:return{sqlType:"utf8"};case k.Struct:return{sqlType:"struct",fields:r.children.map(t=>af(t.name,t.type))};case k.Map:{let t=r;return{sqlType:"map",keyType:Ql(t.keyType),valueType:Ql(t.valueType)}}case k.Time:return{sqlType:"time[s]"};case k.TimeMicrosecond:return{sqlType:"time[us]"};case k.TimeMillisecond:return{sqlType:"time[ms]"};case k.TimeNanosecond:return{sqlType:"time[ns]"};case k.TimeSecond:return{sqlType:"time[s]"};case k.Timestamp:return{sqlType:"timestamp",timezone:r.timezone||void 0};case k.TimestampSecond:return{sqlType:"timestamp[s]",timezone:r.timezone||void 0};case k.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:r.timezone||void 0};case k.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:r.timezone||void 0};case k.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:r.timezone||void 0}}throw new Error("unsupported arrow type: ".concat(r.toString()))}function af(r,t){let e=Ql(t);return e.name=r,e}var UD=new TextEncoder,kD=class{constructor(r,t=null){this._onInstantiationProgress=[],this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{},this._nextMessageId=0,this._pendingRequests=new Map,this._logger=r,this._onMessageHandler=this.onMessage.bind(this),this._onErrorHandler=this.onError.bind(this),this._onCloseHandler=this.onClose.bind(this),t!=null&&this.attach(t)}get logger(){return this._logger}attach(r){this._worker=r,this._worker.addEventListener("message",this._onMessageHandler),this._worker.addEventListener("error",this._onErrorHandler),this._worker.addEventListener("close",this._onCloseHandler),this._workerShutdownPromise=new Promise((t,e)=>{this._workerShutdownResolver=t})}detach(){this._worker&&(this._worker.removeEventListener("message",this._onMessageHandler),this._worker.removeEventListener("error",this._onErrorHandler),this._worker.removeEventListener("close",this._onCloseHandler),this._worker=null,this._workerShutdownResolver(null),this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async terminate(){this._worker&&(this._worker.terminate(),this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async postTask(r,t=[]){if(!this._worker){console.error("cannot send a message since the worker is not set!");return}let e=this._nextMessageId++;return this._pendingRequests.set(e,r),this._worker.postMessage({messageId:e,type:r.type,data:r.data},t),await r.promise}onMessage(r){var t;let e=r.data;switch(e.type){case"LOG":{this._logger.log(e.data);return}case"INSTANTIATE_PROGRESS":{for(let i of this._onInstantiationProgress)i(e.data);return}}let n=this._pendingRequests.get(e.requestId);if(!n){console.warn("unassociated response: [".concat(e.requestId,", ").concat(e.type.toString(),"]"));return}if(this._pendingRequests.delete(e.requestId),e.type=="ERROR"){let i=new Error(e.data.message);i.name=e.data.name,(t=Object.getOwnPropertyDescriptor(i,"stack"))!=null&&t.writable&&(i.stack=e.data.stack),n.promiseRejecter(i);return}switch(n.type){case"CLOSE_PREPARED":case"COLLECT_FILE_STATISTICS":case"REGISTER_OPFS_FILE_NAME":case"COPY_FILE_TO_PATH":case"DISCONNECT":case"DROP_FILE":case"DROP_FILES":case"FLUSH_FILES":case"INSERT_ARROW_FROM_IPC_STREAM":case"IMPORT_CSV_FROM_PATH":case"IMPORT_JSON_FROM_PATH":case"OPEN":case"PING":case"REGISTER_FILE_BUFFER":case"REGISTER_FILE_HANDLE":case"REGISTER_FILE_URL":case"RESET":if(e.type=="OK"){n.promiseResolver(e.data);return}break;case"INSTANTIATE":if(this._onInstantiationProgress=[],e.type=="OK"){n.promiseResolver(e.data);return}break;case"GLOB_FILE_INFOS":if(e.type=="FILE_INFOS"){n.promiseResolver(e.data);return}break;case"GET_VERSION":if(e.type=="VERSION_STRING"){n.promiseResolver(e.data);return}break;case"GET_FEATURE_FLAGS":if(e.type=="FEATURE_FLAGS"){n.promiseResolver(e.data);return}break;case"GET_TABLE_NAMES":if(e.type=="TABLE_NAMES"){n.promiseResolver(e.data);return}break;case"TOKENIZE":if(e.type=="SCRIPT_TOKENS"){n.promiseResolver(e.data);return}break;case"COPY_FILE_TO_BUFFER":if(e.type=="FILE_BUFFER"){n.promiseResolver(e.data);return}break;case"EXPORT_FILE_STATISTICS":if(e.type=="FILE_STATISTICS"){n.promiseResolver(e.data);return}break;case"CONNECT":if(e.type=="CONNECTION_INFO"){n.promiseResolver(e.data);return}break;case"RUN_PREPARED":case"RUN_QUERY":if(e.type=="QUERY_RESULT"){n.promiseResolver(e.data);return}break;case"SEND_PREPARED":if(e.type=="QUERY_RESULT_HEADER"){n.promiseResolver(e.data);return}break;case"START_PENDING_QUERY":if(e.type=="QUERY_RESULT_HEADER_OR_NULL"){n.promiseResolver(e.data);return}break;case"POLL_PENDING_QUERY":if(e.type=="QUERY_RESULT_HEADER_OR_NULL"){n.promiseResolver(e.data);return}break;case"CANCEL_PENDING_QUERY":if(this._onInstantiationProgress=[],e.type=="SUCCESS"){n.promiseResolver(e.data);return}break;case"FETCH_QUERY_RESULTS":if(e.type=="QUERY_RESULT_CHUNK"){n.promiseResolver(e.data);return}break;case"CREATE_PREPARED":if(e.type=="PREPARED_STATEMENT_ID"){n.promiseResolver(e.data);return}break}n.promiseRejecter(new Error("unexpected response type: ".concat(e.type.toString())))}onError(r){console.error(r),console.error("error in duckdb worker: ".concat(r.message)),this._pendingRequests.clear()}onClose(){if(this._workerShutdownResolver(null),this._pendingRequests.size!=0){console.warn("worker terminated with ".concat(this._pendingRequests.size," pending requests"));return}this._pendingRequests.clear()}async reset(){let r=new de("RESET",null);return await this.postTask(r)}async ping(){let r=new de("PING",null);await this.postTask(r)}async dropFile(r){let t=new de("DROP_FILE",r);return await this.postTask(t)}async dropFiles(){let r=new de("DROP_FILES",null);return await this.postTask(r)}async flushFiles(){let r=new de("FLUSH_FILES",null);return await this.postTask(r)}async instantiate(r,t=null,e=n=>{}){this._onInstantiationProgress.push(e);let n=new de("INSTANTIATE",[r,t]);return await this.postTask(n)}async getVersion(){let r=new de("GET_VERSION",null);return await this.postTask(r)}async getFeatureFlags(){let r=new de("GET_FEATURE_FLAGS",null);return await this.postTask(r)}async open(r){let t=new de("OPEN",r);await this.postTask(t)}async tokenize(r){let t=new de("TOKENIZE",r);return await this.postTask(t)}async connectInternal(){let r=new de("CONNECT",null);return await this.postTask(r)}async connect(){let r=await this.connectInternal();return new DD(this,r)}async disconnect(r){let t=new de("DISCONNECT",r);await this.postTask(t)}async runQuery(r,t){let e=new de("RUN_QUERY",[r,t]);return await this.postTask(e)}async startPendingQuery(r,t,e=!1){let n=new de("START_PENDING_QUERY",[r,t,e]);return await this.postTask(n)}async pollPendingQuery(r){let t=new de("POLL_PENDING_QUERY",r);return await this.postTask(t)}async cancelPendingQuery(r){let t=new de("CANCEL_PENDING_QUERY",r);return await this.postTask(t)}async fetchQueryResults(r){let t=new de("FETCH_QUERY_RESULTS",r);return await this.postTask(t)}async getTableNames(r,t){let e=new de("GET_TABLE_NAMES",[r,t]);return await this.postTask(e)}async createPrepared(r,t){let e=new de("CREATE_PREPARED",[r,t]);return await this.postTask(e)}async closePrepared(r,t){let e=new de("CLOSE_PREPARED",[r,t]);await this.postTask(e)}async runPrepared(r,t,e){let n=new de("RUN_PREPARED",[r,t,e]);return await this.postTask(n)}async sendPrepared(r,t,e){let n=new de("SEND_PREPARED",[r,t,e]);return await this.postTask(n)}async globFiles(r){let t=new de("GLOB_FILE_INFOS",r);return await this.postTask(t)}async registerFileText(r,t){let e=UD.encode(t);await this.registerFileBuffer(r,e)}async registerFileURL(r,t,e,n){t===void 0&&(t=r);let i=new de("REGISTER_FILE_URL",[r,t,e,n]);await this.postTask(i)}async registerEmptyFileBuffer(r){}async registerFileBuffer(r,t){let e=new de("REGISTER_FILE_BUFFER",[r,t]);await this.postTask(e,[t.buffer])}async registerFileHandle(r,t,e,n){let i=new de("REGISTER_FILE_HANDLE",[r,t,e,n]);await this.postTask(i,[])}async registerOPFSFileName(r){let t=new de("REGISTER_OPFS_FILE_NAME",[r]);await this.postTask(t,[])}async collectFileStatistics(r,t){let e=new de("COLLECT_FILE_STATISTICS",[r,t]);await this.postTask(e,[])}async exportFileStatistics(r){let t=new de("EXPORT_FILE_STATISTICS",r);return await this.postTask(t,[])}async copyFileToBuffer(r){let t=new de("COPY_FILE_TO_BUFFER",r);return await this.postTask(t)}async copyFileToPath(r,t){let e=new de("COPY_FILE_TO_PATH",[r,t]);await this.postTask(e)}async insertArrowFromIPCStream(r,t,e){if(t.length==0)return;let n=new de("INSERT_ARROW_FROM_IPC_STREAM",[r,t,e]);await this.postTask(n,[t.buffer])}async insertCSVFromPath(r,t,e){if(e.columns!==void 0){let i=[];for(let s in e.columns){let o=e.columns[s];i.push(af(s,o))}e.columnsFlat=i,delete e.columns}let n=new de("IMPORT_CSV_FROM_PATH",[r,t,e]);await this.postTask(n)}async insertJSONFromPath(r,t,e){if(e.columns!==void 0){let i=[];for(let s in e.columns){let o=e.columns[s];i.push(af(s,o))}e.columnsFlat=i,delete e.columns}let n=new de("IMPORT_JSON_FROM_PATH",[r,t,e]);await this.postTask(n)}};function zD(){let r=new TextDecoder;return t=>(typeof SharedArrayBuffer<"u"&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),r.decode(t))}zD();var VD=(r=>(r[r.BUFFER=0]="BUFFER",r[r.NODE_FS=1]="NODE_FS",r[r.BROWSER_FILEREADER=2]="BROWSER_FILEREADER",r[r.BROWSER_FSACCESS=3]="BROWSER_FSACCESS",r[r.HTTP=4]="HTTP",r[r.S3=5]="S3",r))(VD||{}),jD=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,3,1,0,1,10,14,1,12,0,65,0,65,0,65,0,252,10,0,0,11])),$D=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,6,64,25,11,11])),GD=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),WD=()=>(async r=>{try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(r)}catch{return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])),HD={version:"1.29.1-dev68.0"},xp=HD.version.split(".");xp[0];xp[1];xp[2];var XD=()=>typeof navigator>"u",Fh=null,Dh=null,Lh=null,Nh=null,Bh=null;async function YD(){return Fh==null&&(Fh=typeof BigInt64Array<"u"),Dh==null&&(Dh=await $D()),Lh==null&&(Lh=await WD()),Nh==null&&(Nh=await GD()),Bh==null&&(Bh=await jD()),{bigInt64Array:Fh,crossOriginIsolated:XD()||globalThis.crossOriginIsolated||!1,wasmExceptions:Dh,wasmSIMD:Nh,wasmThreads:Lh,wasmBulkMemory:Bh}}async function Ey(r){let t=await YD();if(t.wasmExceptions){if(t.wasmSIMD&&t.wasmThreads&&t.crossOriginIsolated&&r.coi)return{mainModule:r.coi.mainModule,mainWorker:r.coi.mainWorker,pthreadWorker:r.coi.pthreadWorker};if(r.eh)return{mainModule:r.eh.mainModule,mainWorker:r.eh.mainWorker,pthreadWorker:null}}return{mainModule:r.mvp.mainModule,mainWorker:r.mvp.mainWorker,pthreadWorker:null}}ID(ED());const Uh={},wa={};function Ia(r,t){try{const n=(Uh[r]||(Uh[r]=new Intl.DateTimeFormat("en-GB",{timeZone:r,hour:"numeric",timeZoneName:"longOffset"}).format))(t).split("GMT")[1]||"";return n in wa?wa[n]:Ay(n,n.split(":"))}catch{if(r in wa)return wa[r];const e=r==null?void 0:r.match(qD);return e?Ay(r,e.slice(1)):NaN}}const qD=/([+-]\d\d):?(\d\d)?/;function Ay(r,t){const e=+t[0],n=+(t[1]||0);return wa[r]=e>0?e*60+n:e*60-n}class Fr extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Ia(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),zx(this),lf(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new Fr(...e,t):new Fr(Date.now(),t)}withTimeZone(t){return new Fr(+this,t)}getTimezoneOffset(){return-Ia(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),lf(this),+this}[Symbol.for("constructDateFrom")](t){return new Fr(+new Date(t),this.timeZone)}}const My=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(r=>{if(!My.test(r))return;const t=r.replace(My,"$1UTC");Fr.prototype[t]&&(r.startsWith("get")?Fr.prototype[r]=function(){return this.internal[t]()}:(Fr.prototype[r]=function(){return Date.prototype[t].apply(this.internal,arguments),QD(this),+this},Fr.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),lf(this),+this}))});function lf(r){r.internal.setTime(+r),r.internal.setUTCMinutes(r.internal.getUTCMinutes()-r.getTimezoneOffset())}function QD(r){Date.prototype.setFullYear.call(r,r.internal.getUTCFullYear(),r.internal.getUTCMonth(),r.internal.getUTCDate()),Date.prototype.setHours.call(r,r.internal.getUTCHours(),r.internal.getUTCMinutes(),r.internal.getUTCSeconds(),r.internal.getUTCMilliseconds()),zx(r)}function zx(r){const t=Ia(r.timeZone,r),e=new Date(+r);e.setUTCHours(e.getUTCHours()-1);const n=-new Date(+r).getTimezoneOffset(),i=-new Date(+e).getTimezoneOffset(),s=n-i,o=Date.prototype.getHours.apply(r)!==r.internal.getUTCHours();s&&o&&r.internal.setUTCMinutes(r.internal.getUTCMinutes()+s);const a=n-t;a&&Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+a);const l=Ia(r.timeZone,r),c=-new Date(+r).getTimezoneOffset()-l,h=l!==t,f=c-a;if(h&&f){Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+f);const d=Ia(r.timeZone,r),m=l-d;m&&(r.internal.setUTCMinutes(r.internal.getUTCMinutes()+m),Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+m))}}const ZD=new TextDecoder("utf-8"),KD=r=>ZD.decode(r),JD=new TextEncoder,Vx=r=>JD.encode(r),An=r=>typeof r=="function",el=r=>r!=null&&Object(r)===r,tL=r=>el(r)&&An(r.then),jx=r=>el(r)&&An(r[Symbol.iterator]),eL=r=>el(r)&&An(r[Symbol.asyncIterator]),rL=r=>el(r)&&"done"in r&&"value"in r,nL=r=>el(r)&&An(r.clear)&&An(r.bytes)&&An(r.position)&&An(r.setPosition)&&An(r.capacity)&&An(r.getBufferIdentifier)&&An(r.createLong),Sp=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function iL(r){const t=r[0]?[r[0]]:[];let e,n,i,s;for(let o,a,l=0,u=0,c=r.length;++lc+h.byteLength,0);let i,s,o,a=0,l=-1;const u=Math.min(t||Number.POSITIVE_INFINITY,n);for(const c=e.length;++lur(Int8Array,r),aL=r=>ur(Int16Array,r),lL=r=>ur(Int32Array,r),uL=r=>ur(BigInt64Array,r),cL=r=>ur(Uint8Array,r),hL=r=>ur(Uint16Array,r),dL=r=>ur(Uint32Array,r),fL=r=>ur(BigUint64Array,r),pL=r=>ur(Float32Array,r),mL=r=>ur(Float64Array,r),gL=r=>ur(Uint8ClampedArray,r),cf=r=>(r.next(),r);function*Xn(r,t){const e=function*(i){yield i},n=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Sp?e(t):jx(t)?t:e(t);return yield*cf(function*(i){let s=null;do s=i.next(yield ur(r,s));while(!s.done)}(n[Symbol.iterator]())),new r}const yL=r=>Xn(Int8Array,r),vL=r=>Xn(Int16Array,r),_L=r=>Xn(Int32Array,r),bL=r=>Xn(Uint8Array,r),wL=r=>Xn(Uint16Array,r),xL=r=>Xn(Uint32Array,r),SL=r=>Xn(Float32Array,r),TL=r=>Xn(Float64Array,r),IL=r=>Xn(Uint8ClampedArray,r);function mn(r,t){return br(this,arguments,function*(){if(tL(t))return yield Rt(yield Rt(yield*Ss(Bn(mn(r,yield Rt(t))))));const n=function(o){return br(this,arguments,function*(){yield yield Rt(yield Rt(o))})},i=function(o){return br(this,arguments,function*(){yield Rt(yield*Ss(Bn(cf(function*(a){let l=null;do l=a.next(yield l==null?void 0:l.value);while(!l.done)}(o[Symbol.iterator]())))))})},s=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Sp?n(t):jx(t)?i(t):eL(t)?t:n(t);return yield Rt(yield*Ss(Bn(cf(function(o){return br(this,arguments,function*(){let a=null;do a=yield Rt(o.next(yield yield Rt(ur(r,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield Rt(new r)})}const EL=r=>mn(Int8Array,r),AL=r=>mn(Int16Array,r),ML=r=>mn(Int32Array,r),CL=r=>mn(Uint8Array,r),OL=r=>mn(Uint16Array,r),PL=r=>mn(Uint32Array,r),RL=r=>mn(Float32Array,r),FL=r=>mn(Float64Array,r),DL=r=>mn(Uint8ClampedArray,r);function LL(r,t,e){if(r!==0){e=e.slice(0,t);for(let n=-1,i=e.length;++n0)do if(r[e]!==t[e])return!1;while(++eFo(t))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(t,e)=>typeof e=="bigint"?`${e}`:e)}const UL=Object.freeze(Object.defineProperty({__proto__:null,valueToString:Fo},Symbol.toStringTag,{value:"Module"}));function pr(r){if(typeof r=="bigint"&&(rNumber.MAX_SAFE_INTEGER))throw new TypeError(`${r} is not safe to convert to a number.`);return Number(r)}function Gx(r,t){return pr(r/t)+pr(r%t)/pr(t)}const Wx=Symbol.for("isArrowBigNum");function gn(r,...t){return t.length===0?Object.setPrototypeOf(ur(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...t),this.constructor.prototype)}gn.prototype[Wx]=!0;gn.prototype.toJSON=function(){return`"${Do(this)}"`};gn.prototype.valueOf=function(r){return Tp(this,r)};gn.prototype.toString=function(){return Do(this)};gn.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return Tp(this);case"string":return Do(this);case"default":return Hx(this)}return Do(this)};function xo(...r){return gn.apply(this,r)}function So(...r){return gn.apply(this,r)}function $a(...r){return gn.apply(this,r)}Object.setPrototypeOf(xo.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(So.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf($a.prototype,Object.create(Uint32Array.prototype));Object.assign(xo.prototype,gn.prototype,{constructor:xo,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(So.prototype,gn.prototype,{constructor:So,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign($a.prototype,gn.prototype,{constructor:$a,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const kL=BigInt(4294967296)*BigInt(4294967296),zL=kL-BigInt(1);function Tp(r,t){const{buffer:e,byteOffset:n,byteLength:i,signed:s}=r,o=new BigUint64Array(e,n,i/8),a=s&&o.at(-1)&BigInt(1)<=0)return kh(r);t=t.slice();let n=1;for(let s=0;s(r.children=null,r.ArrayType=Array,r.OffsetArrayType=Int32Array,r[Symbol.toStringTag]="DataType"))(Ct.prototype);class Cy extends Ct{constructor(){super(H.Null)}toString(){return"Null"}}Yx=Symbol.toStringTag;Cy[Yx]=(r=>r[Symbol.toStringTag]="Null")(Cy.prototype);class Oy extends Ct{constructor(t,e){super(H.Int),this.isSigned=t,this.bitWidth=e}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}qx=Symbol.toStringTag;Oy[qx]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(Oy.prototype);class Py extends Ct{constructor(t){super(H.Float),this.precision=t}get ArrayType(){switch(this.precision){case Dr.HALF:return Uint16Array;case Dr.SINGLE:return Float32Array;case Dr.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}Qx=Symbol.toStringTag;Py[Qx]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(Py.prototype);class Ry extends Ct{constructor(){super(H.Binary)}toString(){return"Binary"}}Zx=Symbol.toStringTag;Ry[Zx]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(Ry.prototype);class Fy extends Ct{constructor(){super(H.LargeBinary)}toString(){return"LargeBinary"}}Kx=Symbol.toStringTag;Fy[Kx]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeBinary"))(Fy.prototype);class Dy extends Ct{constructor(){super(H.Utf8)}toString(){return"Utf8"}}Jx=Symbol.toStringTag;Dy[Jx]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(Dy.prototype);class Ly extends Ct{constructor(){super(H.LargeUtf8)}toString(){return"LargeUtf8"}}tS=Symbol.toStringTag;Ly[tS]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeUtf8"))(Ly.prototype);class Ny extends Ct{constructor(){super(H.Bool)}toString(){return"Bool"}}eS=Symbol.toStringTag;Ny[eS]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(Ny.prototype);class By extends Ct{constructor(t,e,n=128){super(H.Decimal),this.scale=t,this.precision=e,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}}rS=Symbol.toStringTag;By[rS]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(By.prototype);class Uy extends Ct{constructor(t){super(H.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${Ui[this.unit]}>`}get ArrayType(){return this.unit===Ui.DAY?Int32Array:BigInt64Array}}nS=Symbol.toStringTag;Uy[nS]=(r=>(r.unit=null,r[Symbol.toStringTag]="Date"))(Uy.prototype);class ky extends Ct{constructor(t,e){super(H.Time),this.unit=t,this.bitWidth=e}toString(){return`Time${this.bitWidth}<${te[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}iS=Symbol.toStringTag;ky[iS]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(ky.prototype);class zy extends Ct{constructor(t,e){super(H.Timestamp),this.unit=t,this.timezone=e}toString(){return`Timestamp<${te[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}sS=Symbol.toStringTag;zy[sS]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Timestamp"))(zy.prototype);class Vy extends Ct{constructor(t){super(H.Interval),this.unit=t}toString(){return`Interval<${As[this.unit]}>`}}oS=Symbol.toStringTag;Vy[oS]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(Vy.prototype);class jy extends Ct{constructor(t){super(H.Duration),this.unit=t}toString(){return`Duration<${te[this.unit]}>`}}aS=Symbol.toStringTag;jy[aS]=(r=>(r.unit=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Duration"))(jy.prototype);class $y extends Ct{constructor(t){super(H.List),this.children=[t]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}}lS=Symbol.toStringTag;$y[lS]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))($y.prototype);class hf extends Ct{constructor(t){super(H.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}uS=Symbol.toStringTag;hf[uS]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(hf.prototype);class Gy extends Ct{constructor(t,e,n){super(H.Union),this.mode=t,this.children=n,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((i,s,o)=>(i[s]=o)&&i||i,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}cS=Symbol.toStringTag;Gy[cS]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(Gy.prototype);class Wy extends Ct{constructor(t){super(H.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}}hS=Symbol.toStringTag;Wy[hS]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(Wy.prototype);class Hy extends Ct{constructor(t,e){super(H.FixedSizeList),this.listSize=t,this.children=[e]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}dS=Symbol.toStringTag;Hy[dS]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(Hy.prototype);class Xy extends Ct{constructor(t,e=!1){var n,i,s;if(super(H.Map),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((n=t==null?void 0:t.type)===null||n===void 0)&&n.children)){const o=(i=t==null?void 0:t.type)===null||i===void 0?void 0:i.children[0];o&&(o.name="key");const a=(s=t==null?void 0:t.type)===null||s===void 0?void 0:s.children[1];a&&(a.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}fS=Symbol.toStringTag;Xy[fS]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(Xy.prototype);const jL=(r=>()=>++r)(-1);class Yy extends Ct{constructor(t,e,n,i){super(H.Dictionary),this.indices=e,this.dictionary=t,this.isOrdered=i||!1,this.id=n==null?jL():pr(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}}pS=Symbol.toStringTag;Yy[pS]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(Yy.prototype);function mS(r){const t=r;switch(r.typeId){case H.Decimal:return r.bitWidth/32;case H.Interval:return 1+t.unit;case H.FixedSizeList:return t.listSize;case H.FixedSizeBinary:return t.byteWidth;default:return 1}}class he{visitMany(t,...e){return t.map((n,i)=>this.visit(n,...e.map(s=>s[i])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return $L(this,t,e)}getVisitFnByTypeId(t,e=!0){return ao(this,t,e)}visitNull(t,...e){return null}visitBool(t,...e){return null}visitInt(t,...e){return null}visitFloat(t,...e){return null}visitUtf8(t,...e){return null}visitLargeUtf8(t,...e){return null}visitBinary(t,...e){return null}visitLargeBinary(t,...e){return null}visitFixedSizeBinary(t,...e){return null}visitDate(t,...e){return null}visitTimestamp(t,...e){return null}visitTime(t,...e){return null}visitDecimal(t,...e){return null}visitList(t,...e){return null}visitStruct(t,...e){return null}visitUnion(t,...e){return null}visitDictionary(t,...e){return null}visitInterval(t,...e){return null}visitDuration(t,...e){return null}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}}function $L(r,t,e=!0){return typeof t=="number"?ao(r,t,e):typeof t=="string"&&t in H?ao(r,H[t],e):t&&t instanceof Ct?ao(r,qy(t),e):t!=null&&t.type&&t.type instanceof Ct?ao(r,qy(t.type),e):ao(r,H.NONE,e)}function ao(r,t,e=!0){let n=null;switch(t){case H.Null:n=r.visitNull;break;case H.Bool:n=r.visitBool;break;case H.Int:n=r.visitInt;break;case H.Int8:n=r.visitInt8||r.visitInt;break;case H.Int16:n=r.visitInt16||r.visitInt;break;case H.Int32:n=r.visitInt32||r.visitInt;break;case H.Int64:n=r.visitInt64||r.visitInt;break;case H.Uint8:n=r.visitUint8||r.visitInt;break;case H.Uint16:n=r.visitUint16||r.visitInt;break;case H.Uint32:n=r.visitUint32||r.visitInt;break;case H.Uint64:n=r.visitUint64||r.visitInt;break;case H.Float:n=r.visitFloat;break;case H.Float16:n=r.visitFloat16||r.visitFloat;break;case H.Float32:n=r.visitFloat32||r.visitFloat;break;case H.Float64:n=r.visitFloat64||r.visitFloat;break;case H.Utf8:n=r.visitUtf8;break;case H.LargeUtf8:n=r.visitLargeUtf8;break;case H.Binary:n=r.visitBinary;break;case H.LargeBinary:n=r.visitLargeBinary;break;case H.FixedSizeBinary:n=r.visitFixedSizeBinary;break;case H.Date:n=r.visitDate;break;case H.DateDay:n=r.visitDateDay||r.visitDate;break;case H.DateMillisecond:n=r.visitDateMillisecond||r.visitDate;break;case H.Timestamp:n=r.visitTimestamp;break;case H.TimestampSecond:n=r.visitTimestampSecond||r.visitTimestamp;break;case H.TimestampMillisecond:n=r.visitTimestampMillisecond||r.visitTimestamp;break;case H.TimestampMicrosecond:n=r.visitTimestampMicrosecond||r.visitTimestamp;break;case H.TimestampNanosecond:n=r.visitTimestampNanosecond||r.visitTimestamp;break;case H.Time:n=r.visitTime;break;case H.TimeSecond:n=r.visitTimeSecond||r.visitTime;break;case H.TimeMillisecond:n=r.visitTimeMillisecond||r.visitTime;break;case H.TimeMicrosecond:n=r.visitTimeMicrosecond||r.visitTime;break;case H.TimeNanosecond:n=r.visitTimeNanosecond||r.visitTime;break;case H.Decimal:n=r.visitDecimal;break;case H.List:n=r.visitList;break;case H.Struct:n=r.visitStruct;break;case H.Union:n=r.visitUnion;break;case H.DenseUnion:n=r.visitDenseUnion||r.visitUnion;break;case H.SparseUnion:n=r.visitSparseUnion||r.visitUnion;break;case H.Dictionary:n=r.visitDictionary;break;case H.Interval:n=r.visitInterval;break;case H.IntervalDayTime:n=r.visitIntervalDayTime||r.visitInterval;break;case H.IntervalYearMonth:n=r.visitIntervalYearMonth||r.visitInterval;break;case H.Duration:n=r.visitDuration;break;case H.DurationSecond:n=r.visitDurationSecond||r.visitDuration;break;case H.DurationMillisecond:n=r.visitDurationMillisecond||r.visitDuration;break;case H.DurationMicrosecond:n=r.visitDurationMicrosecond||r.visitDuration;break;case H.DurationNanosecond:n=r.visitDurationNanosecond||r.visitDuration;break;case H.FixedSizeList:n=r.visitFixedSizeList;break;case H.Map:n=r.visitMap;break}if(typeof n=="function")return n;if(!e)return()=>null;throw new Error(`Unrecognized type '${H[t]}'`)}function qy(r){switch(r.typeId){case H.Null:return H.Null;case H.Int:{const{bitWidth:t,isSigned:e}=r;switch(t){case 8:return e?H.Int8:H.Uint8;case 16:return e?H.Int16:H.Uint16;case 32:return e?H.Int32:H.Uint32;case 64:return e?H.Int64:H.Uint64}return H.Int}case H.Float:switch(r.precision){case Dr.HALF:return H.Float16;case Dr.SINGLE:return H.Float32;case Dr.DOUBLE:return H.Float64}return H.Float;case H.Binary:return H.Binary;case H.LargeBinary:return H.LargeBinary;case H.Utf8:return H.Utf8;case H.LargeUtf8:return H.LargeUtf8;case H.Bool:return H.Bool;case H.Decimal:return H.Decimal;case H.Time:switch(r.unit){case te.SECOND:return H.TimeSecond;case te.MILLISECOND:return H.TimeMillisecond;case te.MICROSECOND:return H.TimeMicrosecond;case te.NANOSECOND:return H.TimeNanosecond}return H.Time;case H.Timestamp:switch(r.unit){case te.SECOND:return H.TimestampSecond;case te.MILLISECOND:return H.TimestampMillisecond;case te.MICROSECOND:return H.TimestampMicrosecond;case te.NANOSECOND:return H.TimestampNanosecond}return H.Timestamp;case H.Date:switch(r.unit){case Ui.DAY:return H.DateDay;case Ui.MILLISECOND:return H.DateMillisecond}return H.Date;case H.Interval:switch(r.unit){case As.DAY_TIME:return H.IntervalDayTime;case As.YEAR_MONTH:return H.IntervalYearMonth}return H.Interval;case H.Duration:switch(r.unit){case te.SECOND:return H.DurationSecond;case te.MILLISECOND:return H.DurationMillisecond;case te.MICROSECOND:return H.DurationMicrosecond;case te.NANOSECOND:return H.DurationNanosecond}return H.Duration;case H.Map:return H.Map;case H.List:return H.List;case H.Struct:return H.Struct;case H.Union:switch(r.mode){case jn.Dense:return H.DenseUnion;case jn.Sparse:return H.SparseUnion}return H.Union;case H.FixedSizeBinary:return H.FixedSizeBinary;case H.FixedSizeList:return H.FixedSizeList;case H.Dictionary:return H.Dictionary}throw new Error(`Unrecognized type '${H[r.typeId]}'`)}he.prototype.visitInt8=null;he.prototype.visitInt16=null;he.prototype.visitInt32=null;he.prototype.visitInt64=null;he.prototype.visitUint8=null;he.prototype.visitUint16=null;he.prototype.visitUint32=null;he.prototype.visitUint64=null;he.prototype.visitFloat16=null;he.prototype.visitFloat32=null;he.prototype.visitFloat64=null;he.prototype.visitDateDay=null;he.prototype.visitDateMillisecond=null;he.prototype.visitTimestampSecond=null;he.prototype.visitTimestampMillisecond=null;he.prototype.visitTimestampMicrosecond=null;he.prototype.visitTimestampNanosecond=null;he.prototype.visitTimeSecond=null;he.prototype.visitTimeMillisecond=null;he.prototype.visitTimeMicrosecond=null;he.prototype.visitTimeNanosecond=null;he.prototype.visitDenseUnion=null;he.prototype.visitSparseUnion=null;he.prototype.visitIntervalDayTime=null;he.prototype.visitIntervalYearMonth=null;he.prototype.visitDuration=null;he.prototype.visitDurationSecond=null;he.prototype.visitDurationMillisecond=null;he.prototype.visitDurationMicrosecond=null;he.prototype.visitDurationNanosecond=null;const gS=new Float64Array(1),Hs=new Uint32Array(gS.buffer);function Ip(r){const t=(r&31744)>>10,e=(r&1023)/1024,n=Math.pow(-1,(r&32768)>>15);switch(t){case 31:return n*(e?Number.NaN:1/0);case 0:return n*(e?6103515625e-14*e:0)}return n*Math.pow(2,t-15)*(1+e)}function yS(r){if(r!==r)return 32256;gS[0]=r;const t=(Hs[1]&2147483648)>>16&65535;let e=Hs[1]&2146435072,n=0;return e>=1089470464?Hs[0]>0?e=31744:(e=(e&2080374784)>>16,n=(Hs[1]&1048575)>>10):e<=1056964608?(n=1048576+(Hs[1]&1048575),n=1048576+(n<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,n=(Hs[1]&1048575)+512>>10),t|e|n&65535}const GL=Object.freeze(Object.defineProperty({__proto__:null,float64ToUint16:yS,uint16ToFloat64:Ip},Symbol.toStringTag,{value:"Module"}));class Wt extends he{}function qt(r){return(t,e,n)=>{if(t.setValid(e,n!=null))return r(t,e,n)}}const WL=(r,t,e)=>{r[t]=Math.floor(e/864e5)},vS=(r,t,e,n)=>{if(e+1{const i=r+e;n?t[i>>3]|=1<>3]&=~(1<{r[t]=e},Ep=({values:r},t,e)=>{r[t]=e},_S=({values:r},t,e)=>{r[t]=yS(e)},XL=(r,t,e)=>{switch(r.type.precision){case Dr.HALF:return _S(r,t,e);case Dr.SINGLE:case Dr.DOUBLE:return Ep(r,t,e)}},bS=({values:r},t,e)=>{WL(r,t,e.valueOf())},wS=({values:r},t,e)=>{r[t]=BigInt(e)},YL=({stride:r,values:t},e,n)=>{t.set(n.subarray(0,r),r*e)},xS=({values:r,valueOffsets:t},e,n)=>vS(r,t,e,n),SS=({values:r,valueOffsets:t},e,n)=>vS(r,t,e,Vx(n)),qL=(r,t,e)=>{r.type.unit===Ui.DAY?bS(r,t,e):wS(r,t,e)},TS=({values:r},t,e)=>{r[t]=BigInt(e/1e3)},IS=({values:r},t,e)=>{r[t]=BigInt(e)},ES=({values:r},t,e)=>{r[t]=BigInt(e*1e3)},AS=({values:r},t,e)=>{r[t]=BigInt(e*1e6)},QL=(r,t,e)=>{switch(r.type.unit){case te.SECOND:return TS(r,t,e);case te.MILLISECOND:return IS(r,t,e);case te.MICROSECOND:return ES(r,t,e);case te.NANOSECOND:return AS(r,t,e)}},MS=({values:r},t,e)=>{r[t]=e},CS=({values:r},t,e)=>{r[t]=e},OS=({values:r},t,e)=>{r[t]=e},PS=({values:r},t,e)=>{r[t]=e},ZL=(r,t,e)=>{switch(r.type.unit){case te.SECOND:return MS(r,t,e);case te.MILLISECOND:return CS(r,t,e);case te.MICROSECOND:return OS(r,t,e);case te.NANOSECOND:return PS(r,t,e)}},KL=({values:r,stride:t},e,n)=>{r.set(n.subarray(0,t),t*e)},JL=(r,t,e)=>{const n=r.children[0],i=r.valueOffsets,s=$n.getVisitFn(n);if(Array.isArray(e))for(let o=-1,a=i[t],l=i[t+1];a{const n=r.children[0],{valueOffsets:i}=r,s=$n.getVisitFn(n);let{[t]:o,[t+1]:a}=i;const l=e instanceof Map?e.entries():Object.entries(e);for(const u of l)if(s(n,o,u),++o>=a)break},eN=(r,t)=>(e,n,i,s)=>n&&e(n,r,t[s]),rN=(r,t)=>(e,n,i,s)=>n&&e(n,r,t.get(s)),nN=(r,t)=>(e,n,i,s)=>n&&e(n,r,t.get(i.name)),iN=(r,t)=>(e,n,i,s)=>n&&e(n,r,t[i.name]),sN=(r,t,e)=>{const n=r.type.children.map(s=>$n.getVisitFn(s.type)),i=e instanceof Map?nN(t,e):e instanceof er?rN(t,e):Array.isArray(e)?eN(t,e):iN(t,e);r.type.children.forEach((s,o)=>i(n[o],r.children[o],s,o))},oN=(r,t,e)=>{r.type.mode===jn.Dense?RS(r,t,e):FS(r,t,e)},RS=(r,t,e)=>{const n=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[n];$n.visit(i,r.valueOffsets[t],e)},FS=(r,t,e)=>{const n=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[n];$n.visit(i,t,e)},aN=(r,t,e)=>{var n;(n=r.dictionary)===null||n===void 0||n.set(r.values[t],e)},lN=(r,t,e)=>{r.type.unit===As.DAY_TIME?DS(r,t,e):LS(r,t,e)},DS=({values:r},t,e)=>{r.set(e.subarray(0,2),2*t)},LS=({values:r},t,e)=>{r[t]=e[0]*12+e[1]%12},NS=({values:r},t,e)=>{r[t]=e},BS=({values:r},t,e)=>{r[t]=e},US=({values:r},t,e)=>{r[t]=e},kS=({values:r},t,e)=>{r[t]=e},uN=(r,t,e)=>{switch(r.type.unit){case te.SECOND:return NS(r,t,e);case te.MILLISECOND:return BS(r,t,e);case te.MICROSECOND:return US(r,t,e);case te.NANOSECOND:return kS(r,t,e)}},cN=(r,t,e)=>{const{stride:n}=r,i=r.children[0],s=$n.getVisitFn(i);if(Array.isArray(e))for(let o=-1,a=t*n;++o`${Fo(t)}: ${Fo(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new hN(this[cn],this[To])}}class hN{constructor(t,e){this.childIndex=0,this.children=t.children,this.rowIndex=e,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){const t=this.childIndex;return te.name)}has(t,e){return t[cn].type.children.some(n=>n.name===e)}getOwnPropertyDescriptor(t,e){if(t[cn].type.children.some(n=>n.name===e))return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const n=t[cn].type.children.findIndex(i=>i.name===e);if(n!==-1){const i=on.visit(t[cn].children[n],t[To]);return Reflect.set(t,e,i),i}}set(t,e,n){const i=t[cn].type.children.findIndex(s=>s.name===e);return i!==-1?($n.visit(t[cn].children[i],t[To],n),Reflect.set(t,e,n)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,n):!1}}const fN=new dN;class Bt extends he{}function Ht(r){return(t,e)=>t.getValid(e)?r(t,e):null}const pN=(r,t)=>864e5*r[t],mN=(r,t)=>null,zS=(r,t,e)=>{if(e+1>=t.length)return null;const n=pr(t[e]),i=pr(t[e+1]);return r.subarray(n,i)},gN=({offset:r,values:t},e)=>{const n=r+e;return(t[n>>3]&1<pN(r,t),jS=({values:r},t)=>pr(r[t]),Vi=({stride:r,values:t},e)=>t[r*e],yN=({stride:r,values:t},e)=>Ip(t[r*e]),$S=({values:r},t)=>r[t],vN=({stride:r,values:t},e)=>t.subarray(r*e,r*(e+1)),GS=({values:r,valueOffsets:t},e)=>zS(r,t,e),WS=({values:r,valueOffsets:t},e)=>{const n=zS(r,t,e);return n!==null?KD(n):null},_N=({values:r},t)=>r[t],bN=({type:r,values:t},e)=>r.precision!==Dr.HALF?t[e]:Ip(t[e]),wN=(r,t)=>r.type.unit===Ui.DAY?VS(r,t):jS(r,t),HS=({values:r},t)=>1e3*pr(r[t]),XS=({values:r},t)=>pr(r[t]),YS=({values:r},t)=>Gx(r[t],BigInt(1e3)),qS=({values:r},t)=>Gx(r[t],BigInt(1e6)),xN=(r,t)=>{switch(r.type.unit){case te.SECOND:return HS(r,t);case te.MILLISECOND:return XS(r,t);case te.MICROSECOND:return YS(r,t);case te.NANOSECOND:return qS(r,t)}},QS=({values:r},t)=>r[t],ZS=({values:r},t)=>r[t],KS=({values:r},t)=>r[t],JS=({values:r},t)=>r[t],SN=(r,t)=>{switch(r.type.unit){case te.SECOND:return QS(r,t);case te.MILLISECOND:return ZS(r,t);case te.MICROSECOND:return KS(r,t);case te.NANOSECOND:return JS(r,t)}},TN=({values:r,stride:t},e)=>hc.decimal(r.subarray(t*e,t*(e+1))),IN=(r,t)=>{const{valueOffsets:e,stride:n,children:i}=r,{[t*n]:s,[t*n+1]:o}=e,l=i[0].slice(s,o-s);return new er([l])},EN=(r,t)=>{const{valueOffsets:e,children:n}=r,{[t]:i,[t+1]:s}=e,o=n[0];return new Mp(o.slice(i,s-i))},AN=(r,t)=>new Ap(r,t),MN=(r,t)=>r.type.mode===jn.Dense?tT(r,t):eT(r,t),tT=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[e];return on.visit(n,r.valueOffsets[t])},eT=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[e];return on.visit(n,t)},CN=(r,t)=>{var e;return(e=r.dictionary)===null||e===void 0?void 0:e.get(r.values[t])},ON=(r,t)=>r.type.unit===As.DAY_TIME?rT(r,t):nT(r,t),rT=({values:r},t)=>r.subarray(2*t,2*(t+1)),nT=({values:r},t)=>{const e=r[t],n=new Int32Array(2);return n[0]=Math.trunc(e/12),n[1]=Math.trunc(e%12),n},iT=({values:r},t)=>r[t],sT=({values:r},t)=>r[t],oT=({values:r},t)=>r[t],aT=({values:r},t)=>r[t],PN=(r,t)=>{switch(r.type.unit){case te.SECOND:return iT(r,t);case te.MILLISECOND:return sT(r,t);case te.MICROSECOND:return oT(r,t);case te.NANOSECOND:return aT(r,t)}},RN=(r,t)=>{const{stride:e,children:n}=r,s=n[0].slice(t*e,e);return new er([s])};Bt.prototype.visitNull=Ht(mN);Bt.prototype.visitBool=Ht(gN);Bt.prototype.visitInt=Ht(_N);Bt.prototype.visitInt8=Ht(Vi);Bt.prototype.visitInt16=Ht(Vi);Bt.prototype.visitInt32=Ht(Vi);Bt.prototype.visitInt64=Ht($S);Bt.prototype.visitUint8=Ht(Vi);Bt.prototype.visitUint16=Ht(Vi);Bt.prototype.visitUint32=Ht(Vi);Bt.prototype.visitUint64=Ht($S);Bt.prototype.visitFloat=Ht(bN);Bt.prototype.visitFloat16=Ht(yN);Bt.prototype.visitFloat32=Ht(Vi);Bt.prototype.visitFloat64=Ht(Vi);Bt.prototype.visitUtf8=Ht(WS);Bt.prototype.visitLargeUtf8=Ht(WS);Bt.prototype.visitBinary=Ht(GS);Bt.prototype.visitLargeBinary=Ht(GS);Bt.prototype.visitFixedSizeBinary=Ht(vN);Bt.prototype.visitDate=Ht(wN);Bt.prototype.visitDateDay=Ht(VS);Bt.prototype.visitDateMillisecond=Ht(jS);Bt.prototype.visitTimestamp=Ht(xN);Bt.prototype.visitTimestampSecond=Ht(HS);Bt.prototype.visitTimestampMillisecond=Ht(XS);Bt.prototype.visitTimestampMicrosecond=Ht(YS);Bt.prototype.visitTimestampNanosecond=Ht(qS);Bt.prototype.visitTime=Ht(SN);Bt.prototype.visitTimeSecond=Ht(QS);Bt.prototype.visitTimeMillisecond=Ht(ZS);Bt.prototype.visitTimeMicrosecond=Ht(KS);Bt.prototype.visitTimeNanosecond=Ht(JS);Bt.prototype.visitDecimal=Ht(TN);Bt.prototype.visitList=Ht(IN);Bt.prototype.visitStruct=Ht(AN);Bt.prototype.visitUnion=Ht(MN);Bt.prototype.visitDenseUnion=Ht(tT);Bt.prototype.visitSparseUnion=Ht(eT);Bt.prototype.visitDictionary=Ht(CN);Bt.prototype.visitInterval=Ht(ON);Bt.prototype.visitIntervalDayTime=Ht(rT);Bt.prototype.visitIntervalYearMonth=Ht(nT);Bt.prototype.visitDuration=Ht(PN);Bt.prototype.visitDurationSecond=Ht(iT);Bt.prototype.visitDurationMillisecond=Ht(sT);Bt.prototype.visitDurationMicrosecond=Ht(oT);Bt.prototype.visitDurationNanosecond=Ht(aT);Bt.prototype.visitFixedSizeList=Ht(RN);Bt.prototype.visitMap=Ht(EN);const on=new Bt,lo=Symbol.for("keys"),Io=Symbol.for("vals"),uo=Symbol.for("kKeysAsStrings"),df=Symbol.for("_kKeysAsStrings");class Mp{constructor(t){return this[lo]=new er([t.children[0]]).memoize(),this[Io]=t.children[1],new Proxy(this,new DN)}get[uo](){return this[df]||(this[df]=Array.from(this[lo].toArray(),String))}[Symbol.iterator](){return new FN(this[lo],this[Io])}get size(){return this[lo].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[lo],e=this[Io],n={};for(let i=-1,s=t.length;++i`${Fo(t)}: ${Fo(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class FN{constructor(t,e){this.keys=t,this.vals=e,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){const t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),on.visit(this.vals,t)]})}}class DN{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[uo]}has(t,e){return t[uo].includes(e)}getOwnPropertyDescriptor(t,e){if(t[uo].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const n=t[uo].indexOf(e);if(n!==-1){const i=on.visit(Reflect.get(t,Io),n);return Reflect.set(t,e,i),i}}set(t,e,n){const i=t[uo].indexOf(e);return i!==-1?($n.visit(Reflect.get(t,Io),i,n),Reflect.set(t,e,n)):Reflect.has(t,e)?Reflect.set(t,e,n):!1}}Object.defineProperties(Mp.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[lo]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Io]:{writable:!0,enumerable:!1,configurable:!1,value:null},[df]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let Qy;function lT(r,t,e,n){const{length:i=0}=r;let s=typeof t!="number"?0:t,o=typeof e!="number"?i:e;return s<0&&(s=(s%i+i)%i),o<0&&(o=(o%i+i)%i),oi&&(o=i),n?n(r,s,o):[s,o]}const uT=(r,t)=>r<0?t+r:r,Zy=r=>r!==r;function Ds(r){if(typeof r!=="object"||r===null)return Zy(r)?Zy:e=>e===r;if(r instanceof Date){const e=r.valueOf();return n=>n instanceof Date?n.valueOf()===e:!1}return ArrayBuffer.isView(r)?e=>e?$x(r,e):!1:r instanceof Map?NN(r):Array.isArray(r)?LN(r):r instanceof er?BN(r):UN(r,!0)}function LN(r){const t=[];for(let e=-1,n=r.length;++e!1;const n=[];for(let i=-1,s=e.length;++i{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return kN(r,e);case Map:return Ky(r,e,e.keys());case Mp:case Ap:case Object:case void 0:return Ky(r,e,t||Object.keys(e))}return e instanceof er?zN(r,e):!1}}function kN(r,t){const e=r.length;if(t.length!==e)return!1;for(let n=-1;++n>n}function jN(r,t,e){return e?!!(r[t>>3]|=1<>3]&=~(1<0||e.byteLength>3):hT(new fc(e,r,t,null,Cp)).subarray(0,n)),i}return e}function hT(r){const t=[];let e=0,n=0,i=0;for(const o of r)o&&(i|=1<0)&&(t[e++]=i);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}class fc{constructor(t,e,n,i,s){this.bytes=t,this.length=n,this.context=i,this.get=s,this.bit=e%8,this.byteIndex=e>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index>3<<3,i=t+(t%8===0?0:8-t%8);return ju(r,t,i)+ju(r,n,e)+dT(r,i>>3,n-i>>3)}function dT(r,t,e){let n=0,i=Math.trunc(t);const s=new DataView(r.buffer,r.byteOffset,r.byteLength),o=e===void 0?r.byteLength:i+e;for(;o-i>=4;)n+=Zl(s.getUint32(i)),i+=4;for(;o-i>=2;)n+=Zl(s.getUint16(i)),i+=2;for(;o-i>=1;)n+=Zl(s.getUint8(i)),i+=1;return n}function Zl(r){let t=Math.trunc(r);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const $N=Object.freeze(Object.defineProperty({__proto__:null,BitIterator:fc,getBit:cT,getBool:Cp,packBools:hT,popcnt_array:dT,popcnt_bit_range:ju,popcnt_uint32:Zl,setBool:jN,truncateBitmap:ff},Symbol.toStringTag,{value:"Module"})),GN=-1;class Ga{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){const{type:t}=this;return Ct.isSparseUnion(t)?this.children.some(e=>e.nullable):Ct.isDenseUnion(t)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0;const{valueOffsets:e,values:n,nullBitmap:i,typeIds:s}=this;return e&&(t+=e.byteLength),n&&(t+=n.byteLength),i&&(t+=i.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){if(Ct.isUnion(this.type))return this.children.reduce((n,i)=>n+i.nullCount,0);let t=this._nullCount,e;return t<=GN&&(e=this.nullBitmap)&&(this._nullCount=t=e.length===0?0:this.length-ju(e,this.offset,this.offset+this.length)),t}constructor(t,e,n,i,s,o=[],a){this.type=t,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let l;s instanceof Ga?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=mS(t),s&&((l=s[0])&&(this.valueOffsets=l),(l=s[1])&&(this.values=l),(l=s[2])&&(this.nullBitmap=l),(l=s[3])&&(this.typeIds=l)))}getValid(t){const{type:e}=this;if(Ct.isUnion(e)){const n=e,i=this.children[n.typeIdToChildIndex[this.typeIds[t]]],s=n.mode===jn.Dense?this.valueOffsets[t]:t;return i.getValid(s)}if(this.nullable&&this.nullCount>0){const n=this.offset+t;return(this.nullBitmap[n>>3]&1<>3;(!s||s.byteLength<=c)&&(s=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(s.set(ff(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:s})):Object.assign(this,{nullBitmap:s,_nullCount:0}));const h=s[c];n=(h&u)!==0,s[c]=e?h|u:h&~u}return n!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,n=this.length,i=this._nullCount,s=this,o=this.children){return new Ga(t,e,n,i,s,o,this.dictionary)}slice(t,e){const{stride:n,typeId:i,children:s}=this,o=+(this._nullCount===0)-1,a=i===16?n:1,l=this._sliceBuffers(t,e,n,i);return this.clone(this.type,this.offset+t,e,o,l,s.length===0||this.valueOffsets?s:this._sliceChildren(s,a*t,a*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===H.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:n}=this,i=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);i[e>>3]=(1<0&&i.set(ff(this.offset,e,this.nullBitmap),0);const s=this.buffers;return s[si.VALIDITY]=i,this.clone(this.type,0,t,n+(t-e),s)}_sliceBuffers(t,e,n,i){let s;const{buffers:o}=this;return(s=o[si.TYPE])&&(o[si.TYPE]=s.subarray(t,t+e)),(s=o[si.OFFSET])&&(o[si.OFFSET]=s.subarray(t,t+e+1))||(s=o[si.DATA])&&(o[si.DATA]=i===6?s:s.subarray(n*t,n*(t+e))),o}_sliceChildren(t,e,n){return t.map(i=>i.slice(e,n))}}Ga.prototype.children=Object.freeze([]);class Jy{constructor(t=0,e){this.numChunks=t,this.getChunkIterator=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndext.nullable)}function HN(r){return r.reduce((t,e)=>t+e.nullCount,0)}function XN(r){return r.reduce((t,e,n)=>(t[n+1]=t[n]+e.length,t),new Uint32Array(r.length+1))}function YN(r,t,e,n){const i=[];for(let s=-1,o=r.length;++s=n)break;if(e>=l+u)continue;if(l>=e&&l+u<=n){i.push(a);continue}const c=Math.max(0,e-l),h=Math.min(n-l,u);i.push(a.slice(c,h-c))}return i.length===0&&i.push(r[0].slice(0,0)),i}function Op(r,t,e,n){let i=0,s=0,o=t.length-1;do{if(i>=o-1)return e0?0:-1}function KN(r,t){const{nullBitmap:e}=r;if(!e||r.nullCount<=0)return-1;let n=0;for(const i of new fc(e,r.offset+(t||0),r.length,e,Cp)){if(!i)return n;++n}return-1}function Kt(r,t,e){if(t===void 0)return-1;if(t===null)switch(r.typeId){case H.Union:break;case H.Dictionary:break;default:return KN(r,e)}const n=on.getVisitFn(r),i=Ds(t);for(let s=(e||0)-1,o=r.length;++s{const i=r.data[n];return i.values.subarray(0,i.length)[Symbol.iterator]()});let e=0;return new Jy(r.data.length,n=>{const s=r.data[n].length,o=r.slice(e,e+s);return e+=s,new JN(o)})}class JN{constructor(t){this.vector=t,this.index=0}next(){return this.indexa.data):t;if(s.length===0||s.some(a=>!(a instanceof Ga)))throw new TypeError("Vector constructor expects an Array of Data instances.");const o=(e=s[0])===null||e===void 0?void 0:e.type;switch(s.length){case 0:this._offsets=[0];break;case 1:{const{get:a,set:l,indexOf:u}=gT[o.typeId],c=s[0];this.isValid=h=>fT(c,h),this.get=h=>a(c,h),this.set=(h,f)=>l(c,h,f),this.indexOf=h=>u(c,h),this._offsets=[0,c.length];break}default:Object.setPrototypeOf(this,yT[o.typeId]),this._offsets=XN(s);break}this.data=s,this.type=o,this.stride=mS(o),this.numChildren=(i=(n=o.children)===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullable(){return WN(this.data)}get nullCount(){return HN(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${H[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}at(t){return this.get(uT(t,this.length))}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}[Symbol.iterator](){return tB.visit(this)}concat(...t){return new er(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new er(lT(this,t,e,({data:n,_offsets:i},s,o)=>YN(n,i,s,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:n,stride:i,ArrayType:s}=this;switch(t.typeId){case H.Int:case H.Float:case H.Decimal:case H.Time:case H.Timestamp:switch(e.length){case 0:return new s;case 1:return e[0].values.subarray(0,n*i);default:return e.reduce((o,{values:a,length:l})=>(o.array.set(a.subarray(0,l*i),o.offset),o.offset+=l*i,o),{array:new s(n*i),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var e;return this.getChildAt((e=this.type.children)===null||e===void 0?void 0:e.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return Ct.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(Ct.isDictionary(this.type)){const t=new $u(this.data[0].dictionary),e=this.data.map(n=>{const i=n.clone();return i.dictionary=t,i});return new er(e)}return new $u(this)}unmemoize(){if(Ct.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(n=>{const i=n.clone();return i.dictionary=t,i});return new er(e)}return this}}mT=Symbol.toStringTag;er[mT]=(r=>{r.type=Ct.prototype,r.data=[],r.length=0,r.stride=1,r.numChildren=0,r._offsets=new Uint32Array([0]),r[Symbol.isConcatSpreadable]=!0;const t=Object.keys(H).map(e=>H[e]).filter(e=>typeof e=="number"&&e!==H.NONE);for(const e of t){const n=on.getVisitFnByTypeId(e),i=$n.getVisitFnByTypeId(e),s=ev.getVisitFnByTypeId(e);gT[e]={get:n,set:i,indexOf:s},yT[e]=Object.create(r,{isValid:{value:tv(fT)},get:{value:tv(on.getVisitFnByTypeId(e))},set:{value:qN($n.getVisitFnByTypeId(e))},indexOf:{value:QN(ev.getVisitFnByTypeId(e))}})}return"Vector"})(er.prototype);class $u extends er{constructor(t){super(t.data);const e=this.get,n=this.set,i=this.slice,s=new Array(this.length);Object.defineProperty(this,"get",{value(o){const a=s[o];if(a!==void 0)return a;const l=e.call(this,o);return s[o]=l,l}}),Object.defineProperty(this,"set",{value(o,a){n.call(this,o,a),s[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new $u(i.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new er(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}const eB=65536;function po(r){return r<0&&(r=4294967295+r+1),`0x${r.toString(16)}`}const Lo=8,Pp=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];class Rp{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){const e=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let i=e[3]*n[3];this.buffer[0]=i&65535;let s=i>>>16;return i=e[2]*n[3],s+=i,i=e[3]*n[2]>>>0,s+=i,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0>>16,this.buffer[1]+=e[1]*n[3]+e[2]*n[2]+e[3]*n[1],this.buffer[1]+=e[0]*n[3]+e[1]*n[2]+e[2]*n[1]+e[3]*n[0]<<16,this}_plus(t){const e=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],e>>0&&++this.buffer[1],this.buffer[0]=e}lessThan(t){return this.buffer[1]>>0,e[2]=this.buffer[2]+t.buffer[2]>>>0,e[1]=this.buffer[1]+t.buffer[1]>>>0,e[0]=this.buffer[0]+t.buffer[0]>>>0,e[0]>>0&&++e[1],e[1]>>0&&++e[2],e[2]>>0&&++e[3],this.buffer[3]=e[3],this.buffer[2]=e[2],this.buffer[1]=e[1],this.buffer[0]=e[0],this}hex(){return`${po(this.buffer[3])} ${po(this.buffer[2])} ${po(this.buffer[1])} ${po(this.buffer[0])}`}static multiply(t,e){return new En(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new En(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return En.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return En.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const n=t.startsWith("-"),i=t.length,s=new En(e);for(let o=n?1:0;othis.compareFields(n,e[i]))}compareFields(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&this.visit(t.type,e.type)}}function gr(r,t){return t instanceof r.constructor}function Ls(r,t){return r===t||gr(r,t)}function gi(r,t){return r===t||gr(r,t)&&r.bitWidth===t.bitWidth&&r.isSigned===t.isSigned}function pc(r,t){return r===t||gr(r,t)&&r.precision===t.precision}function nB(r,t){return r===t||gr(r,t)&&r.byteWidth===t.byteWidth}function Fp(r,t){return r===t||gr(r,t)&&r.unit===t.unit}function rl(r,t){return r===t||gr(r,t)&&r.unit===t.unit&&r.timezone===t.timezone}function nl(r,t){return r===t||gr(r,t)&&r.unit===t.unit&&r.bitWidth===t.bitWidth}function iB(r,t){return r===t||gr(r,t)&&r.children.length===t.children.length&&Gn.compareManyFields(r.children,t.children)}function sB(r,t){return r===t||gr(r,t)&&r.children.length===t.children.length&&Gn.compareManyFields(r.children,t.children)}function Dp(r,t){return r===t||gr(r,t)&&r.mode===t.mode&&r.typeIds.every((e,n)=>e===t.typeIds[n])&&Gn.compareManyFields(r.children,t.children)}function oB(r,t){return r===t||gr(r,t)&&r.id===t.id&&r.isOrdered===t.isOrdered&&Gn.visit(r.indices,t.indices)&&Gn.visit(r.dictionary,t.dictionary)}function Lp(r,t){return r===t||gr(r,t)&&r.unit===t.unit}function il(r,t){return r===t||gr(r,t)&&r.unit===t.unit}function aB(r,t){return r===t||gr(r,t)&&r.listSize===t.listSize&&r.children.length===t.children.length&&Gn.compareManyFields(r.children,t.children)}function lB(r,t){return r===t||gr(r,t)&&r.keysSorted===t.keysSorted&&r.children.length===t.children.length&&Gn.compareManyFields(r.children,t.children)}zt.prototype.visitNull=Ls;zt.prototype.visitBool=Ls;zt.prototype.visitInt=gi;zt.prototype.visitInt8=gi;zt.prototype.visitInt16=gi;zt.prototype.visitInt32=gi;zt.prototype.visitInt64=gi;zt.prototype.visitUint8=gi;zt.prototype.visitUint16=gi;zt.prototype.visitUint32=gi;zt.prototype.visitUint64=gi;zt.prototype.visitFloat=pc;zt.prototype.visitFloat16=pc;zt.prototype.visitFloat32=pc;zt.prototype.visitFloat64=pc;zt.prototype.visitUtf8=Ls;zt.prototype.visitLargeUtf8=Ls;zt.prototype.visitBinary=Ls;zt.prototype.visitLargeBinary=Ls;zt.prototype.visitFixedSizeBinary=nB;zt.prototype.visitDate=Fp;zt.prototype.visitDateDay=Fp;zt.prototype.visitDateMillisecond=Fp;zt.prototype.visitTimestamp=rl;zt.prototype.visitTimestampSecond=rl;zt.prototype.visitTimestampMillisecond=rl;zt.prototype.visitTimestampMicrosecond=rl;zt.prototype.visitTimestampNanosecond=rl;zt.prototype.visitTime=nl;zt.prototype.visitTimeSecond=nl;zt.prototype.visitTimeMillisecond=nl;zt.prototype.visitTimeMicrosecond=nl;zt.prototype.visitTimeNanosecond=nl;zt.prototype.visitDecimal=Ls;zt.prototype.visitList=iB;zt.prototype.visitStruct=sB;zt.prototype.visitUnion=Dp;zt.prototype.visitDenseUnion=Dp;zt.prototype.visitSparseUnion=Dp;zt.prototype.visitDictionary=oB;zt.prototype.visitInterval=Lp;zt.prototype.visitIntervalDayTime=Lp;zt.prototype.visitIntervalYearMonth=Lp;zt.prototype.visitDuration=il;zt.prototype.visitDurationSecond=il;zt.prototype.visitDurationMillisecond=il;zt.prototype.visitDurationMicrosecond=il;zt.prototype.visitDurationNanosecond=il;zt.prototype.visitFixedSizeList=aB;zt.prototype.visitMap=lB;const Gn=new zt;function uB(r,t){return Gn.compareSchemas(r,t)}function cB(r,t){return Gn.compareFields(r,t)}function hB(r,t){return Gn.visit(r,t)}const rv=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},VL),rB),$N),GL),NL),VN),UL),{compareSchemas:uB,compareFields:cB,compareTypes:hB}),vT=6048e5,dB=864e5,nv=Symbol.for("constructDateFrom");function ui(r,t){return typeof r=="function"?r(t):r&&typeof r=="object"&&nv in r?r[nv](t):r instanceof Date?new r.constructor(t):new Date(t)}function an(r,t){return ui(t||r,r)}let fB={};function mc(){return fB}function Wa(r,t){var a,l,u,c;const e=mc(),n=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,i=an(r,t==null?void 0:t.in),s=i.getDay(),o=(s=s.getTime()?n+1:e.getTime()>=a.getTime()?n:n-1}function iv(r){const t=an(r),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+r-+e}function pB(r,...t){const e=ui.bind(null,t.find(n=>typeof n=="object"));return t.map(e)}function sv(r,t){const e=an(r,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function mB(r,t,e){const[n,i]=pB(e==null?void 0:e.in,r,t),s=sv(n),o=sv(i),a=+s-iv(s),l=+o-iv(o);return Math.round((a-l)/dB)}function gB(r,t){const e=_T(r,t),n=ui(r,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),Gu(n)}function yB(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}function vB(r){return!(!yB(r)&&typeof r!="number"||isNaN(+an(r)))}function _B(r,t){const e=an(r,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const bB={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},wB=(r,t,e)=>{let n;const i=bB[r];return typeof i=="string"?n=i:t===1?n=i.one:n=i.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+n:n+" ago":n};function zh(r){return(t={})=>{const e=t.width?String(t.width):r.defaultWidth;return r.formats[e]||r.formats[r.defaultWidth]}}const xB={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},SB={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},TB={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},IB={date:zh({formats:xB,defaultWidth:"full"}),time:zh({formats:SB,defaultWidth:"full"}),dateTime:zh({formats:TB,defaultWidth:"full"})},EB={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},AB=(r,t,e,n)=>EB[r];function sa(r){return(t,e)=>{const n=e!=null&&e.context?String(e.context):"standalone";let i;if(n==="formatting"&&r.formattingValues){const o=r.defaultFormattingWidth||r.defaultWidth,a=e!=null&&e.width?String(e.width):o;i=r.formattingValues[a]||r.formattingValues[o]}else{const o=r.defaultWidth,a=e!=null&&e.width?String(e.width):r.defaultWidth;i=r.values[a]||r.values[o]}const s=r.argumentCallback?r.argumentCallback(t):t;return i[s]}}const MB={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},CB={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},OB={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},PB={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},RB={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},FB={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},DB=(r,t)=>{const e=Number(r),n=e%100;if(n>20||n<10)switch(n%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},LB={ordinalNumber:DB,era:sa({values:MB,defaultWidth:"wide"}),quarter:sa({values:CB,defaultWidth:"wide",argumentCallback:r=>r-1}),month:sa({values:OB,defaultWidth:"wide"}),day:sa({values:PB,defaultWidth:"wide"}),dayPeriod:sa({values:RB,defaultWidth:"wide",formattingValues:FB,defaultFormattingWidth:"wide"})};function oa(r){return(t,e={})=>{const n=e.width,i=n&&r.matchPatterns[n]||r.matchPatterns[r.defaultMatchWidth],s=t.match(i);if(!s)return null;const o=s[0],a=n&&r.parsePatterns[n]||r.parsePatterns[r.defaultParseWidth],l=Array.isArray(a)?BB(a,h=>h.test(o)):NB(a,h=>h.test(o));let u;u=r.valueCallback?r.valueCallback(l):l,u=e.valueCallback?e.valueCallback(u):u;const c=t.slice(o.length);return{value:u,rest:c}}}function NB(r,t){for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)&&t(r[e]))return e}function BB(r,t){for(let e=0;e{const n=t.match(r.matchPattern);if(!n)return null;const i=n[0],s=t.match(r.parsePattern);if(!s)return null;let o=r.valueCallback?r.valueCallback(s[0]):s[0];o=e.valueCallback?e.valueCallback(o):o;const a=t.slice(i.length);return{value:o,rest:a}}}const kB=/^(\d+)(th|st|nd|rd)?/i,zB=/\d+/i,VB={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},jB={any:[/^b/i,/^(a|c)/i]},$B={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},GB={any:[/1/i,/2/i,/3/i,/4/i]},WB={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},HB={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},XB={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},YB={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},qB={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},QB={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},ZB={ordinalNumber:UB({matchPattern:kB,parsePattern:zB,valueCallback:r=>parseInt(r,10)}),era:oa({matchPatterns:VB,defaultMatchWidth:"wide",parsePatterns:jB,defaultParseWidth:"any"}),quarter:oa({matchPatterns:$B,defaultMatchWidth:"wide",parsePatterns:GB,defaultParseWidth:"any",valueCallback:r=>r+1}),month:oa({matchPatterns:WB,defaultMatchWidth:"wide",parsePatterns:HB,defaultParseWidth:"any"}),day:oa({matchPatterns:XB,defaultMatchWidth:"wide",parsePatterns:YB,defaultParseWidth:"any"}),dayPeriod:oa({matchPatterns:qB,defaultMatchWidth:"any",parsePatterns:QB,defaultParseWidth:"any"})},KB={code:"en-US",formatDistance:wB,formatLong:IB,formatRelative:AB,localize:LB,match:ZB,options:{weekStartsOn:0,firstWeekContainsDate:1}};function JB(r,t){const e=an(r,t==null?void 0:t.in);return mB(e,_B(e))+1}function tU(r,t){const e=an(r,t==null?void 0:t.in),n=+Gu(e)-+gB(e);return Math.round(n/vT)+1}function bT(r,t){var c,h,f,d;const e=an(r,t==null?void 0:t.in),n=e.getFullYear(),i=mc(),s=(t==null?void 0:t.firstWeekContainsDate)??((h=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??i.firstWeekContainsDate??((d=(f=i.locale)==null?void 0:f.options)==null?void 0:d.firstWeekContainsDate)??1,o=ui((t==null?void 0:t.in)||r,0);o.setFullYear(n+1,0,s),o.setHours(0,0,0,0);const a=Wa(o,t),l=ui((t==null?void 0:t.in)||r,0);l.setFullYear(n,0,s),l.setHours(0,0,0,0);const u=Wa(l,t);return+e>=+a?n+1:+e>=+u?n:n-1}function eU(r,t){var a,l,u,c;const e=mc(),n=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,i=bT(r,t),s=ui((t==null?void 0:t.in)||r,0);return s.setFullYear(i,0,n),s.setHours(0,0,0,0),Wa(s,t)}function rU(r,t){const e=an(r,t==null?void 0:t.in),n=+Wa(e,t)-+eU(e,t);return Math.round(n/vT)+1}function we(r,t){const e=r<0?"-":"",n=Math.abs(r).toString().padStart(t,"0");return e+n}const xi={y(r,t){const e=r.getFullYear(),n=e>0?e:1-e;return we(t==="yy"?n%100:n,t.length)},M(r,t){const e=r.getMonth();return t==="M"?String(e+1):we(e+1,2)},d(r,t){return we(r.getDate(),t.length)},a(r,t){const e=r.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(r,t){return we(r.getHours()%12||12,t.length)},H(r,t){return we(r.getHours(),t.length)},m(r,t){return we(r.getMinutes(),t.length)},s(r,t){return we(r.getSeconds(),t.length)},S(r,t){const e=t.length,n=r.getMilliseconds(),i=Math.trunc(n*Math.pow(10,e-3));return we(i,t.length)}},Xs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ov={G:function(r,t,e){const n=r.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(n,{width:"abbreviated"});case"GGGGG":return e.era(n,{width:"narrow"});case"GGGG":default:return e.era(n,{width:"wide"})}},y:function(r,t,e){if(t==="yo"){const n=r.getFullYear(),i=n>0?n:1-n;return e.ordinalNumber(i,{unit:"year"})}return xi.y(r,t)},Y:function(r,t,e,n){const i=bT(r,n),s=i>0?i:1-i;if(t==="YY"){const o=s%100;return we(o,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):we(s,t.length)},R:function(r,t){const e=_T(r);return we(e,t.length)},u:function(r,t){const e=r.getFullYear();return we(e,t.length)},Q:function(r,t,e){const n=Math.ceil((r.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return we(n,2);case"Qo":return e.ordinalNumber(n,{unit:"quarter"});case"QQQ":return e.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(n,{width:"wide",context:"formatting"})}},q:function(r,t,e){const n=Math.ceil((r.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return we(n,2);case"qo":return e.ordinalNumber(n,{unit:"quarter"});case"qqq":return e.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(n,{width:"wide",context:"standalone"})}},M:function(r,t,e){const n=r.getMonth();switch(t){case"M":case"MM":return xi.M(r,t);case"Mo":return e.ordinalNumber(n+1,{unit:"month"});case"MMM":return e.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(n,{width:"wide",context:"formatting"})}},L:function(r,t,e){const n=r.getMonth();switch(t){case"L":return String(n+1);case"LL":return we(n+1,2);case"Lo":return e.ordinalNumber(n+1,{unit:"month"});case"LLL":return e.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(n,{width:"wide",context:"standalone"})}},w:function(r,t,e,n){const i=rU(r,n);return t==="wo"?e.ordinalNumber(i,{unit:"week"}):we(i,t.length)},I:function(r,t,e){const n=tU(r);return t==="Io"?e.ordinalNumber(n,{unit:"week"}):we(n,t.length)},d:function(r,t,e){return t==="do"?e.ordinalNumber(r.getDate(),{unit:"date"}):xi.d(r,t)},D:function(r,t,e){const n=JB(r);return t==="Do"?e.ordinalNumber(n,{unit:"dayOfYear"}):we(n,t.length)},E:function(r,t,e){const n=r.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(n,{width:"short",context:"formatting"});case"EEEE":default:return e.day(n,{width:"wide",context:"formatting"})}},e:function(r,t,e,n){const i=r.getDay(),s=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return we(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(i,{width:"short",context:"formatting"});case"eeee":default:return e.day(i,{width:"wide",context:"formatting"})}},c:function(r,t,e,n){const i=r.getDay(),s=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return we(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(i,{width:"narrow",context:"standalone"});case"cccccc":return e.day(i,{width:"short",context:"standalone"});case"cccc":default:return e.day(i,{width:"wide",context:"standalone"})}},i:function(r,t,e){const n=r.getDay(),i=n===0?7:n;switch(t){case"i":return String(i);case"ii":return we(i,t.length);case"io":return e.ordinalNumber(i,{unit:"day"});case"iii":return e.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(n,{width:"short",context:"formatting"});case"iiii":default:return e.day(n,{width:"wide",context:"formatting"})}},a:function(r,t,e){const i=r.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(r,t,e){const n=r.getHours();let i;switch(n===12?i=Xs.noon:n===0?i=Xs.midnight:i=n/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(r,t,e){const n=r.getHours();let i;switch(n>=17?i=Xs.evening:n>=12?i=Xs.afternoon:n>=4?i=Xs.morning:i=Xs.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(r,t,e){if(t==="ho"){let n=r.getHours()%12;return n===0&&(n=12),e.ordinalNumber(n,{unit:"hour"})}return xi.h(r,t)},H:function(r,t,e){return t==="Ho"?e.ordinalNumber(r.getHours(),{unit:"hour"}):xi.H(r,t)},K:function(r,t,e){const n=r.getHours()%12;return t==="Ko"?e.ordinalNumber(n,{unit:"hour"}):we(n,t.length)},k:function(r,t,e){let n=r.getHours();return n===0&&(n=24),t==="ko"?e.ordinalNumber(n,{unit:"hour"}):we(n,t.length)},m:function(r,t,e){return t==="mo"?e.ordinalNumber(r.getMinutes(),{unit:"minute"}):xi.m(r,t)},s:function(r,t,e){return t==="so"?e.ordinalNumber(r.getSeconds(),{unit:"second"}):xi.s(r,t)},S:function(r,t){return xi.S(r,t)},X:function(r,t,e){const n=r.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return lv(n);case"XXXX":case"XX":return hs(n);case"XXXXX":case"XXX":default:return hs(n,":")}},x:function(r,t,e){const n=r.getTimezoneOffset();switch(t){case"x":return lv(n);case"xxxx":case"xx":return hs(n);case"xxxxx":case"xxx":default:return hs(n,":")}},O:function(r,t,e){const n=r.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+av(n,":");case"OOOO":default:return"GMT"+hs(n,":")}},z:function(r,t,e){const n=r.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+av(n,":");case"zzzz":default:return"GMT"+hs(n,":")}},t:function(r,t,e){const n=Math.trunc(+r/1e3);return we(n,t.length)},T:function(r,t,e){return we(+r,t.length)}};function av(r,t=""){const e=r>0?"-":"+",n=Math.abs(r),i=Math.trunc(n/60),s=n%60;return s===0?e+String(i):e+String(i)+t+we(s,2)}function lv(r,t){return r%60===0?(r>0?"-":"+")+we(Math.abs(r)/60,2):hs(r,t)}function hs(r,t=""){const e=r>0?"-":"+",n=Math.abs(r),i=we(Math.trunc(n/60),2),s=we(n%60,2);return e+i+t+s}const uv=(r,t)=>{switch(r){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},wT=(r,t)=>{switch(r){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},nU=(r,t)=>{const e=r.match(/(P+)(p+)?/)||[],n=e[1],i=e[2];if(!i)return uv(r,t);let s;switch(n){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",uv(n,t)).replace("{{time}}",wT(i,t))},iU={p:wT,P:nU},sU=/^D+$/,oU=/^Y+$/,aU=["D","DD","YY","YYYY"];function lU(r){return sU.test(r)}function uU(r){return oU.test(r)}function cU(r,t,e){const n=hU(r,t,e);if(console.warn(n),aU.includes(r))throw new RangeError(n)}function hU(r,t,e){const n=r[0]==="Y"?"years":"days of the month";return`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${t}\`) for formatting ${n} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const dU=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,fU=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,pU=/^'([^]*?)'?$/,mU=/''/g,gU=/[a-zA-Z]/;function xT(r,t,e){var c,h,f,d;const n=mc(),i=n.locale??KB,s=n.firstWeekContainsDate??((h=(c=n.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??1,o=n.weekStartsOn??((d=(f=n.locale)==null?void 0:f.options)==null?void 0:d.weekStartsOn)??0,a=an(r,e==null?void 0:e.in);if(!vB(a))throw new RangeError("Invalid time value");let l=t.match(fU).map(m=>{const g=m[0];if(g==="p"||g==="P"){const p=iU[g];return p(m,i.formatLong)}return m}).join("").match(dU).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const g=m[0];if(g==="'")return{isToken:!1,value:yU(m)};if(ov[g])return{isToken:!0,value:m};if(g.match(gU))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:m}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:i};return l.map(m=>{if(!m.isToken)return m.value;const g=m.value;(uU(g)||lU(g))&&cU(g,t,String(r));const p=ov[g[0]];return p(a,g,i.localize,u)}).join("")}function yU(r){const t=r.match(pU);return t?t[1].replace(mU,"'"):r}function vU(r,t){return an(r*1e3,t==null?void 0:t.in)}function _U(r,t){const e=bU(t)?new t(0):ui(t,0);return e.setFullYear(r.getFullYear(),r.getMonth(),r.getDate()),e.setHours(r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()),e}function bU(r){var t;return typeof r=="function"&&((t=r.prototype)==null?void 0:t.constructor)===r}function wU(r,t){let e=r.length;switch("string"){case"string":{if(t.length!==1)throw new Error("The 'chars' parameter should be a single character string.");for(;e>0&&r[e-1]===t;)e--;break}}return r.substring(0,e)}function Tr(r){return r==null}function xU(r){return r!=null}async function pf(){if(typeof window<"u"&&window!==null)return"browser";try{const r=await Ai(()=>import("./__vite-browser-external-FmFgRqLi.js"),[]);return typeof r<"u"&&r.versions!=null&&r.versions.node!=null?"node":"unknown"}catch{return"unknown"}}function SU(r){return Tr(r)?!1:Ct.isInt(r.type)&&!ST(r)||TU(r)}function TU(r){return Tr(r)?!1:Ct.isInt(r.type)&&r.type.isSigned===!1}function IU(r){return Tr(r)?!1:Ct.isFloat(r.type)??!1}function EU(r){return Tr(r)?!1:Ct.isDecimal(r.type)}function AU(r){return Tr(r)?!1:Ct.isBool(r.type)}function MU(r){return Tr(r)?!1:Ct.isDuration(r.type)}function ST(r){return Tr(r)?!1:Ct.isInt(r.type)&&r.metadata.get("ARROW:extension:name")==="period"}function CU(r){return Tr(r)?!1:Ct.isTimestamp(r.type)}function OU(r){return Tr(r)?!1:Ct.isDate(r.type)}function PU(r){return Tr(r)?!1:Ct.isTime(r.type)}function RU(r){return Tr(r)?!1:Ct.isList(r.type)||Ct.isFixedSizeList(r.type)}function FU(r){return Tr(r)?!1:Ct.isStruct(r.type)||Ct.isMap(r.type)}function DU(r){return Tr(r)?!1:Ct.isStruct(r.type)&&r.metadata.get("ARROW:extension:name")==="interval"||Ct.isInterval(r.type)}function LU(r,t){let e;if(t===te.MILLISECOND)e=1e3;else if(t===te.MICROSECOND)e=1e3*1e3;else if(t===te.NANOSECOND)e=1e3*1e3*1e3;else return Number(r);return typeof r=="bigint"&&!Number.isSafeInteger(Number(r))?Number(r/BigInt(e)):Number(r)/e}function NU(r,t){var n;const e=LU(r,((n=t==null?void 0:t.type)==null?void 0:n.unit)??te.SECOND);return vU(e)}function BU(r,t){const e=NU(r,t);return xT(e,e.getMilliseconds()===0?"HH:mm:ss":"HH:mm:ss.SSS")}function UU(r){const t="yyyy-MM-dd";return r instanceof Date||typeof r=="number"&&Number.isFinite(r)?xT(r,t):(console.warn(`Unsupported date value: ${r}`),String(r))}function kU(r,t){var i;if(!(r instanceof Date||typeof r=="number"&&Number.isFinite(r)))return console.warn(`Unsupported datetime value: ${r}`),null;let e;const n=(i=t==null?void 0:t.type)==null?void 0:i.timezone;return typeof r=="number"?n?e=new Fr(r,n):e=new Fr(r):n?e=new Fr(r,n):e=new Fr(r),_U(e,Date)}function zU(r,t){var a;const e=((a=t==null?void 0:t.type)==null?void 0:a.scale)||0;let n=rv.bigNumToString(new rv.BN(r)).padStart(e,"0");if(e===0)return n;let i="";n.startsWith("-")&&(i="-",n=n.slice(1));const s=n.slice(0,-e)||"0",o=wU(n.slice(-e),"0")||"";return`${i}${s}${o?`.${o}`:""}`}function VU(r){const t=r[0],e=r[1],n=[];return t!==0&&n.push(`${t} year${t>1?"s":""}`),e!==0&&n.push(`${e} month${e>1?"s":""}`),n.length?n.join(" "):"0 months"}function jU(r,t){var n,i,s,o;if(Ct.isInterval(t==null?void 0:t.type))return VU(r);const e=t&&t.metadata.get("ARROW:extension:name");if(e&&e==="pandas.interval"){const a=JSON.parse(t.metadata.get("ARROW:extension:metadata")),{closed:l}=a,u=r.toJSON(),c=l==="both"||l==="left"?"[":"(",h=l==="both"||l==="right"?"]":")",f=mf(u.left,(i=(n=t.type)==null?void 0:n.children)==null?void 0:i[0]),d=mf(u.right,(o=(s=t.type)==null?void 0:s.children)==null?void 0:o[1]);return`${c+f}, ${d+h}`}return String(r)}function $U(r,t){return(t==null?void 0:t.type)instanceof hf?JSON.parse(JSON.stringify(r,(e,n)=>{if(xU(n))return typeof n=="bigint"?Number(n):n})):JSON.parse(JSON.stringify(r,(e,n)=>typeof n=="bigint"?Number(n):n))}function mf(r,t){if(Tr(r))return null;const e=r instanceof Date||Number.isFinite(r);if(e&&OU(t))return UU(r);if(typeof r=="bigint"&&PU(t))return BU(Number(r),t);if(e&&CU(t))return kU(r,t);if(ST(t))throw new Error("Period type is not supported yet");if(DU(t))return jU(r,t);if(MU(t))throw new Error("Duration type is not supported yet");return EU(t)?zU(r,t):IU(t)&&Number.isFinite(r)||SU(t)?r:FU(t)||RU(t)?$U(r,t):AU(t)?!!r:String(r)}function cv(r){return((r.toArray()||[]).map(n=>n.toJSON())||[]).map(n=>(r.schema.fields.forEach(i=>n[i.name]=mf(n[i.name],i)),n))}var Ha=(r=>(r.ORIGIN_PRIVATE_FS="origin-private-fs",r.NODE_FS="node-fs",r))(Ha||{});async function TT(r){const t=M1(r,{logger:!1});let e,n;const i=await pf();if(i==="browser"){if(typeof t.bundles>"u"){const{getBundles:l}=await Ai(async()=>{const{getBundles:u}=await import("./default-browser-BrgSDbLD.js");return{getBundles:u}},[]);t.bundles=await l()}n=await Ey(await t.bundles),e=new Worker(n.mainWorker)}else if(i==="node"){if(typeof t.bundles>"u"){const{getBundles:c}=await Ai(async()=>{const{getBundles:h}=await import("./default-node-BrtBg7VE.js");return{getBundles:h}},__vite__mapDeps([0,1,2]));t.bundles=await c()}n=await Ey(await t.bundles);let l=n.mainWorker;l.startsWith("/@fs/")&&(l=l.replace("/@fs/","file://"));const u=await Ai(()=>import("./index-Cp8iQ_hy.js"),[]);e=new u.default(l,{type:"module"})}else throw new Error(`Unsupported environment: ${i}`);let s;t.logger===!0?s=new Ux:t.logger===!1?s=new RD:s=t.logger;const o=new kD(s,e);if(await o.instantiate(n.mainModule,n.pthreadWorker),t.storage)switch(t.storage.type){case Ha.ORIGIN_PRIVATE_FS:{try{let l=t.storage.path;l.startsWith("/")&&(l=l.slice(1)),await o.open({path:`opfs://${l}`,accessMode:t.storage.accessMode})}catch(l){throw await o.terminate(),await e.terminate(),l}break}case Ha.NODE_FS:{try{await o.open({path:t.storage.path,accessMode:t.storage.accessMode,useDirectIO:!0})}catch(l){throw await o.terminate(),await e.terminate(),l}break}}const a=await o.connect();return{worker:e,db:o,conn:a,query:async(l,u=[])=>{if(!u||u.length===0){const d=await a.query(l);return cv(d)}const c=await a.prepare(l),h=await c.query(...u),f=cv(h);return c.close(),f},close:async()=>{await a.close(),await o.terminate(),await e.terminate()}}}async function GU(r,t){await(await r).conn.send("BEGIN TRANSACTION");try{const e=await t(r);return await(await r).conn.send("COMMIT"),e}catch(e){throw await(await r).conn.send("ROLLBACK"),e}}async function WU(r,t,e){await(await r).conn.send(`SAVEPOINT ${t}`);try{const n=await e(r);return await(await r).conn.send(`RELEASE SAVEPOINT ${t}`),n}catch(n){throw await(await r).conn.send(`ROLLBACK TO SAVEPOINT ${t}`),n}}const St=Symbol.for("drizzle:entityKind");function lt(r,t){if(!r||typeof r!="object")return!1;if(r instanceof t)return!0;if(!Object.prototype.hasOwnProperty.call(t,St))throw new Error(`Class "${t.name??""}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let e=Object.getPrototypeOf(r).constructor;if(e)for(;e;){if(St in e&&e[St]===t[St])return!0;e=Object.getPrototypeOf(e)}return!1}var wv;wv=St;class rr{constructor(t,e){W(this,"name");W(this,"keyAsName");W(this,"primary");W(this,"notNull");W(this,"default");W(this,"defaultFn");W(this,"onUpdateFn");W(this,"hasDefault");W(this,"isUnique");W(this,"uniqueName");W(this,"uniqueType");W(this,"dataType");W(this,"columnType");W(this,"enumValues");W(this,"generated");W(this,"generatedIdentity");W(this,"config");this.table=t,this.config=e,this.name=e.name,this.keyAsName=e.keyAsName,this.notNull=e.notNull,this.default=e.default,this.defaultFn=e.defaultFn,this.onUpdateFn=e.onUpdateFn,this.hasDefault=e.hasDefault,this.primary=e.primaryKey,this.isUnique=e.isUnique,this.uniqueName=e.uniqueName,this.uniqueType=e.uniqueType,this.dataType=e.dataType,this.columnType=e.columnType,this.generated=e.generated,this.generatedIdentity=e.generatedIdentity}mapFromDriverValue(t){return t}mapToDriverValue(t){return t}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}}W(rr,wv,"Column");const Eo=Symbol.for("drizzle:Name");function HU(r,t){return`${r[Eo]}_${t.join("_")}_unique`}var xv,Sv;class Lr extends(Sv=rr,xv=St,Sv){constructor(t,e){e.uniqueName||(e.uniqueName=HU(t,[e.name])),super(t,e),this.table=t}}W(Lr,xv,"PgColumn");const hv=Symbol.for("drizzle:isPgEnum");function XU(r){return!!r&&typeof r=="function"&&hv in r&&r[hv]===!0}var Tv;Tv=St;class Nr{constructor(t,e,n,i=!1){this._={brand:"Subquery",sql:t,selectedFields:e,alias:n,isWith:i}}}W(Nr,Tv,"Subquery");var Iv,Ev;class Np extends(Ev=Nr,Iv=St,Ev){}W(Np,Iv,"WithSubquery");const Ur={startActiveSpan(r,t){return t()}},Qe=Symbol.for("drizzle:ViewBaseConfig"),Kl=Symbol.for("drizzle:Schema"),gf=Symbol.for("drizzle:Columns"),dv=Symbol.for("drizzle:ExtraConfigColumns"),Vh=Symbol.for("drizzle:OriginalName"),jh=Symbol.for("drizzle:BaseName"),Wu=Symbol.for("drizzle:IsAlias"),fv=Symbol.for("drizzle:ExtraConfigBuilder"),YU=Symbol.for("drizzle:IsDrizzleTable");var Av,Mv,Cv,Ov,Pv,Rv,Fv,Dv,Lv,Nv;Nv=St,Lv=Eo,Dv=Vh,Fv=Kl,Rv=gf,Pv=dv,Ov=jh,Cv=Wu,Mv=YU,Av=fv;class It{constructor(t,e,n){W(this,Lv);W(this,Dv);W(this,Fv);W(this,Rv);W(this,Pv);W(this,Ov);W(this,Cv,!1);W(this,Mv,!0);W(this,Av);this[Eo]=this[Vh]=t,this[Kl]=e,this[jh]=n}}W(It,Nv,"Table"),W(It,"Symbol",{Name:Eo,Schema:Kl,OriginalName:Vh,Columns:gf,ExtraConfigColumns:dv,BaseName:jh,IsAlias:Wu,ExtraConfigBuilder:fv});function vs(r){return r[Eo]}function Xa(r){return`${r[Kl]??"public"}.${r[Eo]}`}function IT(r){return r!=null&&typeof r.getSQL=="function"}function qU(r){var e;const t={sql:"",params:[]};for(const n of r)t.sql+=n.sql,t.params.push(...n.params),(e=n.typings)!=null&&e.length&&(t.typings||(t.typings=[]),t.typings.push(...n.typings));return t}var Bv;Bv=St;class Ze{constructor(t){W(this,"value");this.value=Array.isArray(t)?t:[t]}getSQL(){return new Pt([this])}}W(Ze,Bv,"StringChunk");var Uv;Uv=St;const ps=class ps{constructor(t){W(this,"decoder",ET);W(this,"shouldInlineParams",!1);this.queryChunks=t}append(t){return this.queryChunks.push(...t.queryChunks),this}toQuery(t){return Ur.startActiveSpan("drizzle.buildSQL",e=>{const n=this.buildQueryFromSourceParams(this.queryChunks,t);return e==null||e.setAttributes({"drizzle.query.text":n.sql,"drizzle.query.params":JSON.stringify(n.params)}),n})}buildQueryFromSourceParams(t,e){const n=Object.assign({},e,{inlineParams:e.inlineParams||this.shouldInlineParams,paramStartIndex:e.paramStartIndex||{value:0}}),{casing:i,escapeName:s,escapeParam:o,prepareTyping:a,inlineParams:l,paramStartIndex:u}=n;return qU(t.map(c=>{var h;if(lt(c,Ze))return{sql:c.value.join(""),params:[]};if(lt(c,Hu))return{sql:s(c.value),params:[]};if(c===void 0)return{sql:"",params:[]};if(Array.isArray(c)){const f=[new Ze("(")];for(const[d,m]of c.entries())f.push(m),dr},AT={mapToDriverValue:r=>r};({...ET,...AT});var zv;zv=St;class ci{constructor(t,e=AT){W(this,"brand");this.value=t,this.encoder=e}getSQL(){return new Pt([this])}}W(ci,zv,"Param");function Y(r,...t){const e=[];(t.length>0||r.length>0&&r[0]!=="")&&e.push(new Ze(r[0]));for(const[n,i]of t.entries())e.push(i,new Ze(r[n+1]));return new Pt(e)}(r=>{function t(){return new Pt([])}r.empty=t;function e(l){return new Pt(l)}r.fromList=e;function n(l){return new Pt([new Ze(l)])}r.raw=n;function i(l,u){const c=[];for(const[h,f]of l.entries())h>0&&u!==void 0&&c.push(u),c.push(f);return new Pt(c)}r.join=i;function s(l){return new Hu(l)}r.identifier=s;function o(l){return new Ms(l)}r.placeholder=o;function a(l,u){return new ci(l,u)}r.param=a})(Y||(Y={}));(r=>{var e;e=St;const n=class n{constructor(s,o){W(this,"isSelectionField",!1);this.sql=s,this.fieldAlias=o}getSQL(){return this.sql}clone(){return new n(this.sql,this.fieldAlias)}};W(n,e,"SQL.Aliased");let t=n;r.Aliased=t})(Pt||(Pt={}));var Vv;Vv=St;class Ms{constructor(t){this.name=t}getSQL(){return new Pt([this])}}W(Ms,Vv,"Placeholder");function pv(r,t){return r.map(e=>{if(lt(e,Ms)){if(!(e.name in t))throw new Error(`No value for placeholder "${e.name}" was provided`);return t[e.name]}if(lt(e,ci)&<(e.value,Ms)){if(!(e.value.name in t))throw new Error(`No value for placeholder "${e.value.name}" was provided`);return e.encoder.mapToDriverValue(t[e.value.name])}return e})}const ZU=Symbol.for("drizzle:IsDrizzleView");var jv,$v,Gv;Gv=St,$v=Qe,jv=ZU;class ji{constructor({name:t,schema:e,selectedFields:n,query:i}){W(this,$v);W(this,jv,!0);this[Qe]={name:t,originalName:t,schema:e,selectedFields:n,query:i,isExisting:!i,isAlias:!1}}getSQL(){return new Pt([this])}}W(ji,Gv,"View");rr.prototype.getSQL=function(){return new Pt([this])};It.prototype.getSQL=function(){return new Pt([this])};Nr.prototype.getSQL=function(){return new Pt([this])};var Wv;Wv=St;class Ya{constructor(t){this.table=t}get(t,e){return e==="table"?this.table:t[e]}}W(Ya,Wv,"ColumnAliasProxyHandler");var Hv;Hv=St;class gc{constructor(t,e){this.alias=t,this.replaceOriginalName=e}get(t,e){if(e===It.Symbol.IsAlias)return!0;if(e===It.Symbol.Name)return this.alias;if(this.replaceOriginalName&&e===It.Symbol.OriginalName)return this.alias;if(e===Qe)return{...t[Qe],name:this.alias,isAlias:!0};if(e===It.Symbol.Columns){const i=t[It.Symbol.Columns];if(!i)return i;const s={};return Object.keys(i).map(o=>{s[o]=new Proxy(i[o],new Ya(new Proxy(t,this)))}),s}const n=t[e];return lt(n,rr)?new Proxy(n,new Ya(new Proxy(t,this))):n}}W(gc,Hv,"TableAliasProxyHandler");function $h(r,t){return new Proxy(r,new gc(t,!1))}function ei(r,t){return new Proxy(r,new Ya(new Proxy(r.table,new gc(t,!1))))}function MT(r,t){return new Pt.Aliased(Xu(r.sql,t),r.fieldAlias)}function Xu(r,t){return Y.join(r.queryChunks.map(e=>lt(e,rr)?ei(e,t):lt(e,Pt)?Xu(e,t):lt(e,Pt.Aliased)?MT(e,t):e))}var Xv,Yv;class Bp extends(Yv=Error,Xv=St,Yv){constructor({message:t,cause:e}){super(t),this.name="DrizzleError",this.cause=e}}W(Bp,Xv,"DrizzleError");var qv,Qv;class CT extends(Qv=Bp,qv=St,Qv){constructor(){super({message:"Rollback"})}}W(CT,qv,"TransactionRollbackError");function Sr(r,t){return QU(t)&&!IT(r)&&!lt(r,ci)&&!lt(r,Ms)&&!lt(r,rr)&&!lt(r,It)&&!lt(r,ji)?new ci(r,t):r}const OT=(r,t)=>Y`${r} = ${Sr(t,r)}`,KU=(r,t)=>Y`${r} <> ${Sr(t,r)}`;function yf(...r){const t=r.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Pt(t):new Pt([new Ze("("),Y.join(t,new Ze(" and ")),new Ze(")")])}function JU(...r){const t=r.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Pt(t):new Pt([new Ze("("),Y.join(t,new Ze(" or ")),new Ze(")")])}function tk(r){return Y`not ${r}`}const ek=(r,t)=>Y`${r} > ${Sr(t,r)}`,rk=(r,t)=>Y`${r} >= ${Sr(t,r)}`,nk=(r,t)=>Y`${r} < ${Sr(t,r)}`,ik=(r,t)=>Y`${r} <= ${Sr(t,r)}`;function sk(r,t){return Array.isArray(t)?t.length===0?Y`false`:Y`${r} in ${t.map(e=>Sr(e,r))}`:Y`${r} in ${Sr(t,r)}`}function ok(r,t){return Array.isArray(t)?t.length===0?Y`true`:Y`${r} not in ${t.map(e=>Sr(e,r))}`:Y`${r} not in ${Sr(t,r)}`}function ak(r){return Y`${r} is null`}function lk(r){return Y`${r} is not null`}function uk(r){return Y`exists ${r}`}function ck(r){return Y`not exists ${r}`}function hk(r,t,e){return Y`${r} between ${Sr(t,r)} and ${Sr(e,r)}`}function dk(r,t,e){return Y`${r} not between ${Sr(t,r)} and ${Sr(e,r)}`}function fk(r,t){return Y`${r} like ${t}`}function pk(r,t){return Y`${r} not like ${t}`}function mk(r,t){return Y`${r} ilike ${t}`}function gk(r,t){return Y`${r} not ilike ${t}`}function yk(r){return Y`${r} asc`}function vk(r){return Y`${r} desc`}var Zv;Zv=St;class PT{write(t){console.log(t)}}W(PT,Zv,"ConsoleLogWriter");var Kv;Kv=St;class RT{constructor(t){W(this,"writer");this.writer=(t==null?void 0:t.writer)??new PT}logQuery(t,e){const n=e.map(s=>{try{return JSON.stringify(s)}catch{return String(s)}}),i=n.length?` -- params: [${n.join(", ")}]`:"";this.writer.write(`Query: ${t}${i}`)}}W(RT,Kv,"DefaultLogger");var Jv;Jv=St;class FT{logQuery(){}}W(FT,Jv,"NoopLogger");var t_,e_;e_=St,t_=Symbol.toStringTag;class $i{constructor(){W(this,t_,"QueryPromise")}catch(t){return this.then(void 0,t)}finally(t){return this.then(e=>(t==null||t(),e),e=>{throw t==null||t(),e})}then(t,e){return this.execute().then(t,e)}}W($i,e_,"QueryPromise");function Cs(r,t){return Object.entries(r).reduce((e,[n,i])=>{if(typeof n!="string")return e;const s=t?[...t,n]:[n];return lt(i,rr)||lt(i,Pt)||lt(i,Pt.Aliased)?e.push({path:s,field:i}):lt(i,It)?e.push(...Cs(i[It.Symbol.Columns],s)):e.push(...Cs(i,s)),e},[])}function Up(r,t){const e=Object.keys(r),n=Object.keys(t);if(e.length!==n.length)return!1;for(const[i,s]of e.entries())if(s!==n[i])return!1;return!0}function DT(r,t){const e=Object.entries(t).filter(([,n])=>n!==void 0).map(([n,i])=>lt(i,Pt)||lt(i,rr)?[n,i]:[n,new ci(i,r[It.Symbol.Columns][n])]);if(e.length===0)throw new Error("No values to set");return Object.fromEntries(e)}function _k(r,t){for(const e of t)for(const n of Object.getOwnPropertyNames(e.prototype))n!=="constructor"&&Object.defineProperty(r.prototype,n,Object.getOwnPropertyDescriptor(e.prototype,n)||Object.create(null))}function bk(r){return r[It.Symbol.Columns]}function fs(r){return lt(r,Nr)?r._.alias:lt(r,ji)?r[Qe].name:lt(r,Pt)?void 0:r[It.Symbol.IsAlias]?r[It.Symbol.Name]:r[It.Symbol.BaseName]}function wk(r){if(typeof r!="object"||r===null||r.constructor.name!=="Object")return!1;if("logger"in r){const t=typeof r.logger;return!(t!=="boolean"&&(t!=="object"||typeof r.logger.logQuery!="function")&&t!=="undefined")}if("schema"in r){const t=typeof r.schema;return!(t!=="object"&&t!=="undefined")}if("casing"in r){const t=typeof r.casing;return!(t!=="string"&&t!=="undefined")}if("mode"in r)return!(r.mode!=="default"||r.mode!=="planetscale"||r.mode!==void 0);if("connection"in r){const t=typeof r.connection;return!(t!=="string"&&t!=="object"&&t!=="undefined")}if("client"in r){const t=typeof r.client;return!(t!=="object"&&t!=="function"&&t!=="undefined")}return Object.keys(r).length===0}var r_,n_;class LT extends(n_=Lr,r_=St,n_){getSQLType(){return"date"}mapFromDriverValue(t){return new Date(t)}mapToDriverValue(t){return t.toISOString()}}W(LT,r_,"PgDate");var i_,s_;class NT extends(s_=Lr,i_=St,s_){getSQLType(){return"date"}}W(NT,i_,"PgDateString");var o_,a_;class BT extends(a_=Lr,o_=St,a_){constructor(t,e){super(t,e)}getSQLType(){return"json"}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}}W(BT,o_,"PgJson");var l_,u_;class UT extends(u_=Lr,l_=St,u_){constructor(t,e){super(t,e)}getSQLType(){return"jsonb"}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}}W(UT,l_,"PgJsonb");var c_,h_;class kT extends(h_=Lr,c_=St,h_){constructor(e,n){super(e,n);W(this,"precision");W(this,"scale");this.precision=n.precision,this.scale=n.scale}mapFromDriverValue(e){return typeof e=="string"?e:String(e)}getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?"numeric":`numeric(${this.precision})`}}W(kT,c_,"PgNumeric");var d_,f_;class zT extends(f_=Lr,d_=St,f_){constructor(e,n){super(e,n);W(this,"withTimezone");W(this,"precision");this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`time${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}W(zT,d_,"PgTime");var p_,m_;class VT extends(m_=Lr,p_=St,m_){constructor(e,n){super(e,n);W(this,"withTimezone");W(this,"precision");W(this,"mapFromDriverValue",e=>new Date(this.withTimezone?e:e+"+0000"));W(this,"mapToDriverValue",e=>e.toISOString());this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`timestamp${this.precision===void 0?"":` (${this.precision})`}${this.withTimezone?" with time zone":""}`}}W(VT,p_,"PgTimestamp");var g_,y_;class jT extends(y_=Lr,g_=St,y_){constructor(e,n){super(e,n);W(this,"withTimezone");W(this,"precision");this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`timestamp${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}W(jT,g_,"PgTimestampString");var v_,__;class $T extends(__=Lr,v_=St,__){getSQLType(){return"uuid"}}W($T,v_,"PgUUID");const mv=Symbol.for("drizzle:PgInlineForeignKeys"),gv=Symbol.for("drizzle:EnableRLS");var b_,w_,x_,S_,T_,I_;class Xr extends(I_=It,T_=St,S_=mv,x_=gv,w_=It.Symbol.ExtraConfigBuilder,b_=It.Symbol.ExtraConfigColumns,I_){constructor(){super(...arguments);W(this,S_,[]);W(this,x_,!1);W(this,w_);W(this,b_,{})}}W(Xr,T_,"PgTable"),W(Xr,"Symbol",Object.assign({},It.Symbol,{InlineForeignKeys:mv,EnableRLS:gv}));var E_;E_=St;class GT{constructor(t,e){W(this,"columns");W(this,"name");this.columns=t,this.name=e}build(t){return new WT(t,this.columns,this.name)}}W(GT,E_,"PgPrimaryKeyBuilder");var A_;A_=St;class WT{constructor(t,e,n){W(this,"columns");W(this,"name");this.table=t,this.columns=e,this.name=n}getName(){return this.name??`${this.table[Xr.Symbol.Name]}_${this.columns.map(t=>t.name).join("_")}_pk`}}W(WT,A_,"PgPrimaryKey");var M_;M_=St;class kp{constructor(t,e,n){W(this,"referencedTableName");W(this,"fieldName");this.sourceTable=t,this.referencedTable=e,this.relationName=n,this.referencedTableName=e[It.Symbol.Name]}}W(kp,M_,"Relation");var C_;C_=St;class HT{constructor(t,e){this.table=t,this.config=e}}W(HT,C_,"Relations");var O_,P_;const Qu=class Qu extends(P_=kp,O_=St,P_){constructor(t,e,n,i){super(t,e,n==null?void 0:n.relationName),this.config=n,this.isNullable=i}withFieldName(t){const e=new Qu(this.sourceTable,this.referencedTable,this.config,this.isNullable);return e.fieldName=t,e}};W(Qu,O_,"One");let Os=Qu;var R_,F_;const Zu=class Zu extends(F_=kp,R_=St,F_){constructor(t,e,n){super(t,e,n==null?void 0:n.relationName),this.config=n}withFieldName(t){const e=new Zu(this.sourceTable,this.referencedTable,this.config);return e.fieldName=t,e}};W(Zu,R_,"Many");let Yu=Zu;function xk(){return{and:yf,between:hk,eq:OT,exists:uk,gt:ek,gte:rk,ilike:mk,inArray:sk,isNull:ak,isNotNull:lk,like:fk,lt:nk,lte:ik,ne:KU,not:tk,notBetween:dk,notExists:ck,notLike:pk,notIlike:gk,notInArray:ok,or:JU,sql:Y}}function Sk(){return{sql:Y,asc:yk,desc:vk}}function Tk(r,t){var s;Object.keys(r).length===1&&"default"in r&&!lt(r.default,It)&&(r=r.default);const e={},n={},i={};for(const[o,a]of Object.entries(r))if(lt(a,It)){const l=Xa(a),u=n[l];e[l]=o,i[o]={tsName:o,dbName:a[It.Symbol.Name],schema:a[It.Symbol.Schema],columns:a[It.Symbol.Columns],relations:(u==null?void 0:u.relations)??{},primaryKey:(u==null?void 0:u.primaryKey)??[]};for(const h of Object.values(a[It.Symbol.Columns]))h.primary&&i[o].primaryKey.push(h);const c=(s=a[It.Symbol.ExtraConfigBuilder])==null?void 0:s.call(a,a[It.Symbol.ExtraConfigColumns]);if(c)for(const h of Object.values(c))lt(h,GT)&&i[o].primaryKey.push(...h.columns)}else if(lt(a,HT)){const l=Xa(a.table),u=e[l],c=a.config(t(a.table));let h;for(const[f,d]of Object.entries(c))if(u){const m=i[u];m.relations[f]=d}else l in n||(n[l]={relations:{},primaryKey:h}),n[l].relations[f]=d}return{tables:i,tableNamesMap:e}}function Ik(r){return function(e,n){return new Os(r,e,n,(n==null?void 0:n.fields.reduce((i,s)=>i&&s.notNull,!0))??!1)}}function Ek(r){return function(e,n){return new Yu(r,e,n)}}function Ak(r,t,e){if(lt(e,Os)&&e.config)return{fields:e.config.fields,references:e.config.references};const n=t[Xa(e.referencedTable)];if(!n)throw new Error(`Table "${e.referencedTable[It.Symbol.Name]}" not found in schema`);const i=r[n];if(!i)throw new Error(`Table "${n}" not found in schema`);const s=e.sourceTable,o=t[Xa(s)];if(!o)throw new Error(`Table "${s[It.Symbol.Name]}" not found in schema`);const a=[];for(const l of Object.values(i.relations))(e.relationName&&e!==l&&l.relationName===e.relationName||!e.relationName&&l.referencedTable===e.sourceTable)&&a.push(l);if(a.length>1)throw e.relationName?new Error(`There are multiple relations with name "${e.relationName}" in table "${n}"`):new Error(`There are multiple relations between "${n}" and "${e.sourceTable[It.Symbol.Name]}". Please specify relation name`);if(a[0]&<(a[0],Os)&&a[0].config)return{fields:a[0].config.references,references:a[0].config.fields};throw new Error(`There is not enough information to infer relation "${o}.${e.fieldName}"`)}function Mk(r){return{one:Ik(r),many:Ek(r)}}function vf(r,t,e,n,i=s=>s){const s={};for(const[o,a]of n.entries())if(a.isJson){const l=t.relations[a.tsKey],u=e[o],c=typeof u=="string"?JSON.parse(u):u;s[a.tsKey]=lt(l,Os)?c&&vf(r,r[a.relationTableTsKey],c,a.selection,i):c.map(h=>vf(r,r[a.relationTableTsKey],h,a.selection,i))}else{const l=i(e[o]),u=a.field;let c;lt(u,rr)?c=u:lt(u,Pt)?c=u.decoder:c=u.sql.decoder,s[a.tsKey]=l===null?null:c.mapFromDriverValue(l)}return s}var D_;D_=St;const Ku=class Ku{constructor(t){W(this,"config");this.config={...t}}get(t,e){if(e==="_")return{...t._,selectedFields:new Proxy(t._.selectedFields,this)};if(e===Qe)return{...t[Qe],selectedFields:new Proxy(t[Qe].selectedFields,this)};if(typeof e=="symbol")return t[e];const i=(lt(t,Nr)?t._.selectedFields:lt(t,ji)?t[Qe].selectedFields:t)[e];if(lt(i,Pt.Aliased)){if(this.config.sqlAliasedBehavior==="sql"&&!i.isSelectionField)return i.sql;const s=i.clone();return s.isSelectionField=!0,s}if(lt(i,Pt)){if(this.config.sqlBehavior==="sql")return i;throw new Error(`You tried to reference "${e}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`)}return lt(i,rr)?this.config.alias?new Proxy(i,new Ya(new Proxy(i.table,new gc(this.config.alias,this.config.replaceOriginalName??!1)))):i:typeof i!="object"||i===null?i:new Proxy(i,new Ku(this.config))}};W(Ku,D_,"SelectionProxyHandler");let or=Ku;var L_,N_;class _f extends(N_=$i,L_=St,N_){constructor(e,n,i,s){super();W(this,"config");W(this,"authToken");W(this,"execute",e=>Ur.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=n,this.dialect=i,this.config={table:e,withList:s}}where(e){return this.config.where=e,this}returning(e=this.config.table[It.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=Cs(e),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}_prepare(e){return Ur.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0))}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new or({alias:vs(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}W(_f,L_,"PgDelete");function Ck(r){return(r.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map(e=>e.toLowerCase()).join("_")}function Ok(r){return(r.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((e,n,i)=>{const s=i===0?n.toLowerCase():`${n[0].toUpperCase()}${n.slice(1)}`;return e+s},"")}function Pk(r){return r}var B_;B_=St;class XT{constructor(t){W(this,"cache",{});W(this,"cachedTables",{});W(this,"convert");this.convert=t==="snake_case"?Ck:t==="camelCase"?Ok:Pk}getColumnCasing(t){if(!t.keyAsName)return t.name;const e=t.table[It.Symbol.Schema]??"public",n=t.table[It.Symbol.OriginalName],i=`${e}.${n}.${t.name}`;return this.cache[i]||this.cacheTable(t.table),this.cache[i]}cacheTable(t){const e=t[It.Symbol.Schema]??"public",n=t[It.Symbol.OriginalName],i=`${e}.${n}`;if(!this.cachedTables[i]){for(const s of Object.values(t[It.Symbol.Columns])){const o=`${i}.${s.name}`;this.cache[o]=this.convert(s.name)}this.cachedTables[i]=!0}}clearCache(){this.cache={},this.cachedTables={}}}W(XT,B_,"CasingCache");var U_,k_;class zp extends(k_=ji,U_=St,k_){}W(zp,U_,"PgViewBase");var z_;z_=St;class Ea{constructor(t){W(this,"casing");this.casing=new XT(t==null?void 0:t.casing)}async migrate(t,e,n){const i=typeof n=="string"?"__drizzle_migrations":n.migrationsTable??"__drizzle_migrations",s=typeof n=="string"?"drizzle":n.migrationsSchema??"drizzle",o=Y` +]`}concat(...t){const e=this.schema,n=this.data.concat(t.flatMap(({data:i})=>i));return new cs(e,n.map(i=>new _r(e,i)))}slice(t,e){const n=this.schema;[t,e]=ax({length:this.numRows},t,e);const i=hx(this.data,this._offsets,t,e);return new cs(n,i.map(s=>new _r(n,s)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(e=>e.name===t))}getChildAt(t){if(t>-1&&tn.children[t]);if(e.length===0){const{type:n}=this.schema.fields[t],i=le({type:n,length:0,nullCount:0});e.push(i._changeLengthAndBackfillNullBitmap(this.numRows))}return new Ne(e)}return null}setChild(t,e){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(i=>i.name===t),e)}setChildAt(t,e){let n=this.schema,i=[...this.batches];if(t>-1&&tthis.getChildAt(u));[s[t],a[t]]=[o,e],[n,i]=Ph(n,a)}return new cs(n,i)}select(t){const e=this.schema.fields.reduce((n,i,s)=>n.set(i.name,s),new Map);return this.selectAt(t.map(n=>e.get(n)).filter(n=>n>-1))}selectAt(t){const e=this.schema.selectAt(t),n=this.batches.map(i=>i.selectAt(t));return new cs(e,n)}assign(t){const e=this.schema.fields,[n,i]=t.schema.fields.reduce((a,l,u)=>{const[c,h]=a,f=e.findIndex(d=>d.name===l.name);return~f?h[f]=u:c.push(u),a},[[],[]]),s=this.schema.assign(t.schema),o=[...e.map((a,l)=>[l,i[l]]).map(([a,l])=>l===void 0?this.getChildAt(a):t.getChildAt(l)),...n.map(a=>t.getChildAt(a))].filter(Boolean);return new cs(...Ph(s,o))}};wx=Symbol.toStringTag;Ni[wx]=(r=>(r.schema=null,r.batches=[],r._offsets=new Uint32Array([0]),r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,r.isValid=Du(op),r.get=Du(xr.getVisitFn(k.Struct)),r.set=dx(sn.getVisitFn(k.Struct)),r.indexOf=fx(Lu.getVisitFn(k.Struct)),"Table"))(Ni.prototype);var xx;let _r=class ba{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof Le))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=le({nullCount:0,type:new dr(this.schema.fields),children:this.schema.fields.map(e=>le({type:e.type,nullCount:0}))})]=t,!(this.data instanceof Ae))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=yy(this.schema,this.data.children);break}case 1:{const[e]=t,{fields:n,children:i,length:s}=Object.keys(e).reduce((l,u,c)=>(l.children[c]=e[u],l.length=Math.max(l.length,e[u].length),l.fields[c]=Pe.new({name:u,type:e[u].type,nullable:!0}),l),{length:0,fields:new Array,children:new Array}),o=new Le(n),a=le({type:new dr(n),length:s,children:i,nullCount:0});[this.schema,this.data]=yy(o,a.children,s);break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get dictionaries(){return this._dictionaries||(this._dictionaries=Sx(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(t){return this.data.getValid(t)}get(t){return xr.visit(this.data,t)}at(t){return this.get(np(t,this.numRows))}set(t,e){return sn.visit(this.data,t,e)}indexOf(t,e){return Lu.visit(this.data,t,e)}[Symbol.iterator](){return ap.visit(new Ne([this.data]))}toArray(){return[...this]}concat(...t){return new Ni(this.schema,[this,...t])}slice(t,e){const[n]=new Ne([this.data]).slice(t,e).data;return new ba(this.schema,n)}getChild(t){var e;return this.getChildAt((e=this.schema.fields)===null||e===void 0?void 0:e.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&ti.name===t),e)}setChildAt(t,e){let n=this.schema,i=this.data;if(t>-1&&ta.name===s);~o&&(i[o]=this.data.children[o])}return new ba(e,le({type:n,length:this.numRows,children:i}))}selectAt(t){const e=this.schema.selectAt(t),n=t.map(s=>this.data.children[s]).filter(Boolean),i=le({type:new dr(e.fields),length:this.numRows,children:n});return new ba(e,i)}};xx=Symbol.toStringTag;_r[xx]=(r=>(r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(_r.prototype);function yy(r,t,e=t.reduce((n,i)=>Math.max(n,i.length),0)){var n;const i=[...r.fields],s=[...t],o=(e+63&-64)>>3;for(const[a,l]of r.fields.entries()){const u=t[a];(!u||u.length!==e)&&(i[a]=l.clone({nullable:!0}),s[a]=(n=u==null?void 0:u._changeLengthAndBackfillNullBitmap(e))!==null&&n!==void 0?n:le({type:l.type,length:e,nullCount:e,nullBitmap:new Uint8Array(o)}))}return[r.assign(i),le({type:new dr(i),length:e,children:s})]}function Sx(r,t,e=new Map){var n,i;if(((n=r==null?void 0:r.length)!==null&&n!==void 0?n:0)>0&&(r==null?void 0:r.length)===(t==null?void 0:t.length))for(let s=-1,o=r.length;++sle({type:i.type})),n=le({type:new dr(t.fields),nullCount:0,children:e});super(t,n)}}let wi=class Sn{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMessage(t,e){return(e||new Sn).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+_e),(e||new Sn).__init(t.readInt32(t.position())+t.position(),t)}version(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):je.V1}headerType(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):me.NONE}header(t){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null}bodyLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}customMetadata(t,e){const n=this.bb.__offset(this.bb_pos,12);return n?(e||new qe).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,je.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,me.NONE)}static addHeader(t,e){t.addFieldOffset(2,e,0)}static addBodyLength(t,e){t.addFieldInt64(3,e,BigInt("0"))}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,e){t.finish(e)}static finishSizePrefixedMessageBuffer(t,e){t.finish(e,void 0,!0)}static createMessage(t,e,n,i,s,o){return Sn.startMessage(t),Sn.addVersion(t,e),Sn.addHeaderType(t,n),Sn.addHeader(t,i),Sn.addBodyLength(t,s),Sn.addCustomMetadata(t,o),Sn.endMessage(t)}};class F2 extends se{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return ay.startNull(e),ay.endNull(e)}visitInt(t,e){return Cr.startInt(e),Cr.addBitWidth(e,t.bitWidth),Cr.addIsSigned(e,t.isSigned),Cr.endInt(e)}visitFloat(t,e){return Rn.startFloatingPoint(e),Rn.addPrecision(e,t.precision),Rn.endFloatingPoint(e)}visitBinary(t,e){return ry.startBinary(e),ry.endBinary(e)}visitLargeBinary(t,e){return iy.startLargeBinary(e),iy.endLargeBinary(e)}visitBool(t,e){return ny.startBool(e),ny.endBool(e)}visitUtf8(t,e){return ly.startUtf8(e),ly.endUtf8(e)}visitLargeUtf8(t,e){return sy.startLargeUtf8(e),sy.endLargeUtf8(e)}visitDecimal(t,e){return Js.startDecimal(e),Js.addScale(e,t.scale),Js.addPrecision(e,t.precision),Js.addBitWidth(e,t.bitWidth),Js.endDecimal(e)}visitDate(t,e){return Vl.startDate(e),Vl.addUnit(e,t.unit),Vl.endDate(e)}visitTime(t,e){return Zr.startTime(e),Zr.addUnit(e,t.unit),Zr.addBitWidth(e,t.bitWidth),Zr.endTime(e)}visitTimestamp(t,e){const n=t.timezone&&e.createString(t.timezone)||void 0;return Kr.startTimestamp(e),Kr.addUnit(e,t.unit),n!==void 0&&Kr.addTimezone(e,n),Kr.endTimestamp(e)}visitInterval(t,e){return Fn.startInterval(e),Fn.addUnit(e,t.unit),Fn.endInterval(e)}visitDuration(t,e){return jl.startDuration(e),jl.addUnit(e,t.unit),jl.endDuration(e)}visitList(t,e){return oy.startList(e),oy.endList(e)}visitStruct(t,e){return ys.startStruct_(e),ys.endStruct_(e)}visitUnion(t,e){vr.startTypeIdsVector(e,t.typeIds.length);const n=vr.createTypeIdsVector(e,t.typeIds);return vr.startUnion(e),vr.addMode(e,t.mode),vr.addTypeIds(e,n),vr.endUnion(e)}visitDictionary(t,e){const n=this.visit(t.indices,e);return ai.startDictionaryEncoding(e),ai.addId(e,BigInt(t.id)),ai.addIsOrdered(e,t.isOrdered),n!==void 0&&ai.addIndexType(e,n),ai.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return $l.startFixedSizeBinary(e),$l.addByteWidth(e,t.byteWidth),$l.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return Gl.startFixedSizeList(e),Gl.addListSize(e,t.listSize),Gl.endFixedSizeList(e)}visitMap(t,e){return Wl.startMap(e),Wl.addKeysSorted(e,t.keysSorted),Wl.endMap(e)}}const Rh=new F2;function D2(r,t=new Map){return new Le(N2(r,t),Yl(r.metadata),t)}function Tx(r){return new Br(r.count,Ix(r.columns),Ex(r.columns))}function L2(r){return new Vn(Tx(r.data),r.id,r.isDelta)}function N2(r,t){return(r.fields||[]).filter(Boolean).map(e=>Pe.fromJSON(e,t))}function vy(r,t){return(r.children||[]).filter(Boolean).map(e=>Pe.fromJSON(e,t))}function Ix(r){return(r||[]).reduce((t,e)=>[...t,new Bi(e.count,B2(e.VALIDITY)),...Ix(e.children)],[])}function Ex(r,t=[]){for(let e=-1,n=(r||[]).length;++et+ +(e===0),0)}function U2(r,t){let e,n,i,s,o,a;return!t||!(s=r.dictionary)?(o=by(r,vy(r,t)),i=new Pe(r.name,o,r.nullable,Yl(r.metadata))):t.has(e=s.id)?(n=(n=s.indexType)?_y(n):new za,a=new Oo(t.get(e),n,e,s.isOrdered),i=new Pe(r.name,a,r.nullable,Yl(r.metadata))):(n=(n=s.indexType)?_y(n):new za,t.set(e,o=by(r,vy(r,t))),a=new Oo(o,n,e,s.isOrdered),i=new Pe(r.name,a,r.nullable,Yl(r.metadata))),i||null}function Yl(r=[]){return new Map(r.map(({key:t,value:e})=>[t,e]))}function _y(r){return new Es(r.isSigned,r.bitWidth)}function by(r,t){const e=r.type.name;switch(e){case"NONE":return new Fi;case"null":return new Fi;case"binary":return new gu;case"largebinary":return new yu;case"utf8":return new vu;case"largeutf8":return new _u;case"bool":return new bu;case"list":return new Au((t||[])[0]);case"struct":return new dr(t||[]);case"struct_":return new dr(t||[])}switch(e){case"int":{const n=r.type;return new Es(n.isSigned,n.bitWidth)}case"floatingpoint":{const n=r.type;return new mu(ar[n.precision])}case"decimal":{const n=r.type;return new wu(n.scale,n.precision,n.bitWidth)}case"date":{const n=r.type;return new xu(nn[n.unit])}case"time":{const n=r.type;return new Su(Vt[n.unit],n.bitWidth)}case"timestamp":{const n=r.type;return new Tu(Vt[n.unit],n.timezone)}case"interval":{const n=r.type;return new Iu(zn[n.unit])}case"duration":{const n=r.type;return new Eu(Vt[n.unit])}case"union":{const n=r.type,[i,...s]=(n.mode+"").toLowerCase(),o=i.toUpperCase()+s.join("");return new Mu(lr[o],n.typeIds||[],t||[])}case"fixedsizebinary":{const n=r.type;return new Cu(n.byteWidth)}case"fixedsizelist":{const n=r.type;return new Ou(n.listSize,(t||[])[0])}case"map":{const n=r.type;return new Pu((t||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${e}"`)}var k2=zb,z2=Mo;class fr{static fromJSON(t,e){const n=new fr(0,je.V5,e);return n._createHeader=V2(t,e),n}static decode(t){t=new z2(ce(t));const e=wi.getRootAsMessage(t),n=e.bodyLength(),i=e.version(),s=e.headerType(),o=new fr(n,i,s);return o._createHeader=j2(e,s),o}static encode(t){const e=new k2;let n=-1;return t.isSchema()?n=Le.encode(e,t.header()):t.isRecordBatch()?n=Br.encode(e,t.header()):t.isDictionaryBatch()&&(n=Vn.encode(e,t.header())),wi.startMessage(e),wi.addVersion(e,je.V5),wi.addHeader(e,n),wi.addHeaderType(e,t.headerType),wi.addBodyLength(e,BigInt(t.bodyLength)),wi.finishMessageBuffer(e,wi.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof Le)return new fr(0,je.V5,me.Schema,t);if(t instanceof Br)return new fr(e,je.V5,me.RecordBatch,t);if(t instanceof Vn)return new fr(e,je.V5,me.DictionaryBatch,t);throw new Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===me.Schema}isRecordBatch(){return this.headerType===me.RecordBatch}isDictionaryBatch(){return this.headerType===me.DictionaryBatch}constructor(t,e,n,i){this._version=e,this._headerType=n,this.body=new Uint8Array(0),i&&(this._createHeader=()=>i),this._bodyLength=Te(t)}}class Br{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,e,n){this._nodes=e,this._buffers=n,this._length=Te(t)}}class Vn{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(t,e,n=!1){this._data=t,this._isDelta=n,this._id=Te(e)}}class Ln{constructor(t,e){this.offset=Te(t),this.length=Te(e)}}class Bi{constructor(t,e){this.length=Te(t),this.nullCount=Te(e)}}function V2(r,t){return()=>{switch(t){case me.Schema:return Le.fromJSON(r);case me.RecordBatch:return Br.fromJSON(r);case me.DictionaryBatch:return Vn.fromJSON(r)}throw new Error(`Unrecognized Message type: { name: ${me[t]}, type: ${t} }`)}}function j2(r,t){return()=>{switch(t){case me.Schema:return Le.decode(r.header(new In),new Map,r.version());case me.RecordBatch:return Br.decode(r.header(new ri),r.version());case me.DictionaryBatch:return Vn.decode(r.header(new Zs),r.version())}throw new Error(`Unrecognized Message type: { name: ${me[t]}, type: ${t} }`)}}Pe.encode=J2;Pe.decode=Z2;Pe.fromJSON=U2;Le.encode=K2;Le.decode=$2;Le.fromJSON=D2;Br.encode=tD;Br.decode=G2;Br.fromJSON=Tx;Vn.encode=eD;Vn.decode=W2;Vn.fromJSON=L2;Bi.encode=rD;Bi.decode=X2;Ln.encode=nD;Ln.decode=H2;function $2(r,t=new Map,e=je.V5){const n=Q2(r,t);return new Le(n,ql(r),t,e)}function G2(r,t=je.V5){if(r.compression()!==null)throw new Error("Record batch compression not implemented");return new Br(r.length(),Y2(r),q2(r,t))}function W2(r,t=je.V5){return new Vn(Br.decode(r.data(),t),r.id(),r.isDelta())}function H2(r){return new Ln(r.offset(),r.length())}function X2(r){return new Bi(r.length(),r.nullCount())}function Y2(r){const t=[];for(let e,n=-1,i=-1,s=r.nodesLength();++nPe.encode(r,s));In.startFieldsVector(r,e.length);const n=In.createFieldsVector(r,e),i=t.metadata&&t.metadata.size>0?In.createCustomMetadataVector(r,[...t.metadata].map(([s,o])=>{const a=r.createString(`${s}`),l=r.createString(`${o}`);return qe.startKeyValue(r),qe.addKey(r,a),qe.addValue(r,l),qe.endKeyValue(r)})):-1;return In.startSchema(r),In.addFields(r,n),In.addEndianness(r,iD?Co.Little:Co.Big),i!==-1&&In.addCustomMetadata(r,i),In.endSchema(r)}function J2(r,t){let e=-1,n=-1,i=-1;const s=t.type;let o=t.typeId;Ot.isDictionary(s)?(o=s.dictionary.typeId,i=Rh.visit(s,r),n=Rh.visit(s.dictionary,r)):n=Rh.visit(s,r);const a=(s.children||[]).map(c=>Pe.encode(r,c)),l=Wr.createChildrenVector(r,a),u=t.metadata&&t.metadata.size>0?Wr.createCustomMetadataVector(r,[...t.metadata].map(([c,h])=>{const f=r.createString(`${c}`),d=r.createString(`${h}`);return qe.startKeyValue(r),qe.addKey(r,f),qe.addValue(r,d),qe.endKeyValue(r)})):-1;return t.name&&(e=r.createString(t.name)),Wr.startField(r),Wr.addType(r,n),Wr.addTypeType(r,o),Wr.addChildren(r,l),Wr.addNullable(r,!!t.nullable),e!==-1&&Wr.addName(r,e),i!==-1&&Wr.addDictionary(r,i),u!==-1&&Wr.addCustomMetadata(r,u),Wr.endField(r)}function tD(r,t){const e=t.nodes||[],n=t.buffers||[];ri.startNodesVector(r,e.length);for(const o of e.slice().reverse())Bi.encode(r,o);const i=r.endVector();ri.startBuffersVector(r,n.length);for(const o of n.slice().reverse())Ln.encode(r,o);const s=r.endVector();return ri.startRecordBatch(r),ri.addLength(r,BigInt(t.length)),ri.addNodes(r,i),ri.addBuffers(r,s),ri.endRecordBatch(r)}function eD(r,t){const e=Br.encode(r,t.data);return Zs.startDictionaryBatch(r),Zs.addId(r,BigInt(t.id)),Zs.addIsDelta(r,t.isDelta),Zs.addData(r,e),Zs.endDictionaryBatch(r)}function rD(r,t){return $b.createFieldNode(r,BigInt(t.length),BigInt(t.nullCount))}function nD(r,t){return jb.createBuffer(r,BigInt(t.offset),BigInt(t.length))}const iD=(()=>{const r=new ArrayBuffer(2);return new DataView(r).setInt16(0,256,!0),new Int16Array(r)[0]===256})(),pp=r=>`Expected ${me[r]} Message in stream, but was null or length 0.`,mp=r=>`Header pointer of flatbuffer-encoded ${me[r]} Message is null or length 0.`,Ax=(r,t)=>`Expected to read ${r} metadata bytes, but only read ${t}.`,Mx=(r,t)=>`Expected to read ${r} bytes for message body, but only read ${t}.`;class Cx{constructor(t){this.source=t instanceof Nu?t:new Nu(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done||t.value===-1&&(t=this.readMetadataLength()).done||(t=this.readMetadata(t.value)).done?Be:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(pp(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);const e=ce(this.source.read(t));if(e.byteLength[...i,...s.VALIDITY&&[s.VALIDITY]||[],...s.TYPE_ID&&[s.TYPE_ID]||[],...s.OFFSET&&[s.OFFSET]||[],...s.DATA&&[s.DATA]||[],...e(s.children)],[])}}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(pp(t));return e.value}readSchema(){const t=me.Schema,e=this.readMessage(t),n=e==null?void 0:e.header();if(!e||!n)throw new Error(mp(t));return n}}const uc=4,sf="ARROW1",ja=new Uint8Array(sf.length);for(let r=0;rthis):this}readRecordBatch(t){return this._impl.isFile()?this._impl.readRecordBatch(t):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return Yr.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Yr.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof tn?t:Hd(t)?hD(t):Db(t)?pD(t):Is(t)?Jt(this,void 0,void 0,function*(){return yield tn.from(yield t)}):Lb(t)||Kf(t)||Nb(t)||Uo(t)?fD(new Po(t)):dD(new Nu(t))}static readAll(t){return t instanceof tn?t.isSync()?Ty(t):Iy(t):Hd(t)||ArrayBuffer.isView(t)||Qa(t)||Fb(t)?Ty(t):Iy(t)}}class Uu extends tn{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return br(this,arguments,function*(){yield Rt(yield*Ss(Bn(this[Symbol.iterator]())))})}}class ku extends tn{constructor(t){super(t),this._impl=t}readAll(){return Jt(this,void 0,void 0,function*(){var t,e,n,i;const s=new Array;try{for(var o=!0,a=Bn(this),l;l=yield a.next(),t=l.done,!t;o=!0){i=l.value,o=!1;const u=i;s.push(u)}}catch(u){e={error:u}}finally{try{!o&&!t&&(n=a.return)&&(yield n.call(a))}finally{if(e)throw e.error}}return s})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class Px extends Uu{constructor(t){super(t),this._impl=t}}class lD extends ku{constructor(t){super(t),this._impl=t}}class Rx{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,e){const n=this._loadVectors(t,e,this.schema.fields),i=le({type:new dr(this.schema.fields),length:t.length,children:n});return new _r(this.schema,i)}_loadDictionaryBatch(t,e){const{id:n,isDelta:i}=t,{dictionaries:s,schema:o}=this,a=s.get(n),l=o.dictionaries.get(n),u=this._loadVectors(t.data,e,[l]);return(a&&i?a.concat(new Ne(u)):new Ne(u)).memoize()}_loadVectors(t,e,n){return new bx(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}}class zu extends Rx{constructor(t,e){super(e),this._reader=Hd(t)?new oD(this._handle=t):new Cx(this._handle=t)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(t){return this.closed||(this.autoDestroy=Dx(this,t),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(t):Be}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):Be}next(){if(this.closed)return Be;let t;const{_reader:e}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const n=t.header(),i=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const n=t.header(),i=e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new fp(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class Vu extends Rx{constructor(t,e){super(e),this._reader=new sD(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return Jt(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(t){return Jt(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=Dx(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return Jt(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):Be})}return(t){return Jt(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):Be})}next(){return Jt(this,void 0,void 0,function*(){if(this.closed)return Be;let t;const{_reader:e}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const n=t.header(),i=yield e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(n,i)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const n=t.header(),i=yield e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(n,i);this.dictionaries.set(n.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new fp(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return Jt(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}}class Fx extends zu{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,e){super(t instanceof gy?t:new gy(t),e)}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(const e of this._footer.dictionaryBatches())e&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){var e;if(this.closed)return null;this._footer||this.open();const n=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(n&&this._handle.seek(n.offset)){const i=this._reader.readMessage(me.RecordBatch);if(i!=null&&i.isRecordBatch()){const s=i.header(),o=this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(s,o)}}return null}_readDictionaryBatch(t){var e;const n=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(n&&this._handle.seek(n.offset)){const i=this._reader.readMessage(me.DictionaryBatch);if(i!=null&&i.isDictionaryBatch()){const s=i.header(),o=this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}}_readFooter(){const{_handle:t}=this,e=t.size-Ox,n=t.readInt32(e),i=t.readAt(e-n,n);return Va.decode(i)}_readNextMessageAndValidate(t){var e;if(this._footer||this.open(),this._footer&&this._recordBatchIndexsuper.open}});return Jt(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(const n of this._footer.dictionaryBatches())n&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield e.open.call(this,t)})}readRecordBatch(t){return Jt(this,void 0,void 0,function*(){var e;if(this.closed)return null;this._footer||(yield this.open());const n=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(n&&(yield this._handle.seek(n.offset))){const i=yield this._reader.readMessage(me.RecordBatch);if(i!=null&&i.isRecordBatch()){const s=i.header(),o=yield this._reader.readMessageBody(i.bodyLength);return this._loadRecordBatch(s,o)}}return null})}_readDictionaryBatch(t){return Jt(this,void 0,void 0,function*(){var e;const n=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(n&&(yield this._handle.seek(n.offset))){const i=yield this._reader.readMessage(me.DictionaryBatch);if(i!=null&&i.isDictionaryBatch()){const s=i.header(),o=yield this._reader.readMessageBody(i.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}})}_readFooter(){return Jt(this,void 0,void 0,function*(){const{_handle:t}=this;t._pending&&(yield t._pending);const e=t.size-Ox,n=yield t.readInt32(e),i=yield t.readAt(e-n,n);return Va.decode(i)})}_readNextMessageAndValidate(t){return Jt(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex=4?gp(t)?new Px(new Fx(r.read())):new Uu(new zu(r)):new Uu(new zu(function*(){}()))}function fD(r){return Jt(this,void 0,void 0,function*(){const t=yield r.peek(tl+7&-8);return t&&t.byteLength>=4?gp(t)?new Px(new Fx(yield r.read())):new ku(new Vu(r)):new ku(new Vu(function(){return br(this,arguments,function*(){})}()))})}function pD(r){return Jt(this,void 0,void 0,function*(){const{size:t}=yield r.stat(),e=new Bu(r,t);return t>=aD&&gp(yield e.readAt(0,tl+7&-8))?new lD(new uD(e)):new ku(new Vu(e))})}class ke extends se{static assemble(...t){const e=i=>i.flatMap(s=>Array.isArray(s)?e(s):s instanceof _r?s.data.children:s.data),n=new ke;return n.visitMany(e(t)),n}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(t){if(t instanceof Ne)return this.visitMany(t.data),this;const{type:e}=t;if(!Ot.isDictionary(e)){const{length:n}=t;if(n>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(Ot.isUnion(e))this.nodes.push(new Bi(n,0));else{const{nullCount:i}=t;Ot.isNull(e)||dn.call(this,i<=0?new Uint8Array(0):Ru(t.offset,n,t.nullBitmap)),this.nodes.push(new Bi(n,i))}}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}}function dn(r){const t=r.byteLength+7&-8;return this.buffers.push(r),this.bufferRegions.push(new Ln(this._byteLength,t)),this._byteLength+=t,this}function mD(r){var t;const{type:e,length:n,typeIds:i,valueOffsets:s}=r;if(dn.call(this,i),e.mode===lr.Sparse)return of.call(this,r);if(e.mode===lr.Dense){if(r.offset<=0)return dn.call(this,s),of.call(this,r);{const o=new Int32Array(n),a=Object.create(null),l=Object.create(null);for(let u,c,h=-1;++h{const h=e.typeIds[c],f=a[h],d=l[h];return u.slice(f,Math.min(n,d))}))}}return this}function gD(r){let t;return r.nullCount>=r.length?dn.call(this,new Uint8Array(0)):(t=r.values)instanceof Uint8Array?dn.call(this,Ru(r.offset,r.length,t)):dn.call(this,Fu(r.values))}function pi(r){return dn.call(this,r.values.subarray(0,r.length*r.stride))}function cc(r){const{length:t,values:e,valueOffsets:n}=r,i=Te(n[0]),s=Te(n[t]),o=Math.min(s-i,e.byteLength-i);return dn.call(this,Ub(-i,t+1,n)),dn.call(this,e.subarray(i,i+o)),this}function yp(r){const{length:t,valueOffsets:e}=r;if(e){const{[0]:n,[t]:i}=e;return dn.call(this,Ub(-n,t+1,e)),this.visit(r.children[0].slice(n,i-n))}return this.visit(r.children[0])}function of(r){return this.visitMany(r.type.children.map((t,e)=>r.children[e]).filter(Boolean))[0]}ke.prototype.visitBool=gD;ke.prototype.visitInt=pi;ke.prototype.visitFloat=pi;ke.prototype.visitUtf8=cc;ke.prototype.visitLargeUtf8=cc;ke.prototype.visitBinary=cc;ke.prototype.visitLargeBinary=cc;ke.prototype.visitFixedSizeBinary=pi;ke.prototype.visitDate=pi;ke.prototype.visitTimestamp=pi;ke.prototype.visitTime=pi;ke.prototype.visitDecimal=pi;ke.prototype.visitList=yp;ke.prototype.visitStruct=of;ke.prototype.visitUnion=mD;ke.prototype.visitInterval=pi;ke.prototype.visitDuration=pi;ke.prototype.visitFixedSizeList=yp;ke.prototype.visitMap=yp;class Lx extends lp{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}constructor(t){super(),this._position=0,this._started=!1,this._sink=new Xl,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,wr(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return Is(t)?t.then(e=>this.writeAll(e)):Uo(t)?wp(this,t):bp(this,t)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(t){return this._sink.toDOMStream(t)}toNodeStream(t){return this._sink.toNodeStream(t)}close(){return this.reset()._sink.close()}abort(t){return this.reset()._sink.abort(t)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(t=this._sink,e=null){return t===this._sink||t instanceof Xl?this._sink=t:(this._sink=new Xl,t&&WR(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&HR(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!e||!nf(e,this._schema))&&(e==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=e,this._writeSchema(e))),this}write(t){let e=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof Ni&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof _r&&!(e=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(e&&!nf(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof _r?t instanceof fp||this._writeRecordBatch(t):t instanceof Ni?this.writeAll(t.batches):Qa(t)&&this.writeAll(t)}_writeMessage(t,e=8){const n=e-1,i=fr.encode(t),s=i.byteLength,o=this._writeLegacyIpcFormat?4:8,a=s+o+n&~n,l=a-s-o;return t.headerType===me.RecordBatch?this._recordBatchBlocks.push(new Di(a,t.bodyLength,this._position)):t.headerType===me.DictionaryBatch&&this._dictionaryBlocks.push(new Di(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-o)),s>0&&this._write(i),this._writePadding(l)}_write(t){if(this._started){const e=ce(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(fr.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(ja)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:e,nodes:n,bufferRegions:i,buffers:s}=ke.assemble(t),o=new Br(t.numRows,n,i),a=fr.from(o,e);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(s)}_writeDictionaryBatch(t,e,n=!1){const{byteLength:i,nodes:s,bufferRegions:o,buffers:a}=ke.assemble(new Ne([t])),l=new Br(t.length,s,o),u=new Vn(l,e,n),c=fr.from(u,i);return this._writeMessage(c)._writeBodyBuffers(a)}_writeBodyBuffers(t){let e,n,i;for(let s=-1,o=t.length;++s0&&(this._write(e),(i=(n+7&-8)-n)>0&&this._writePadding(i));return this}_writeDictionaries(t){var e,n;for(const[i,s]of t.dictionaries){const o=(e=s==null?void 0:s.data)!==null&&e!==void 0?e:[],a=this._seenDictionaries.get(i),l=(n=this._dictionaryDeltaOffsets.get(i))!==null&&n!==void 0?n:0;if(!a||a.data[0]!==o[0])for(const[u,c]of o.entries())this._writeDictionaryBatch(c,i,u>0);else if(ln.writeAll(i)):Uo(t)?wp(n,t):bp(n,t)}}class _p extends Lx{static writeAll(t){const e=new _p;return Is(t)?t.then(n=>e.writeAll(n)):Uo(t)?wp(e,t):bp(e,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(t,e,n=!1){if(!n&&this._seenDictionaries.has(e))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(t,e,n)}_writeFooter(t){const e=Va.encode(new Va(t,je.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}}function bp(r,t){let e=t;t instanceof Ni&&(e=t.batches,r.reset(void 0,t.schema));for(const n of e)r.write(n);return r.finish()}function wp(r,t){return Jt(this,void 0,void 0,function*(){var e,n,i,s,o,a,l;try{for(e=!0,n=Bn(t);i=yield n.next(),s=i.done,!s;e=!0){l=i.value,e=!1;const u=l;r.write(u)}}catch(u){o={error:u}}finally{try{!e&&!s&&(a=n.return)&&(yield a.call(n))}finally{if(o)throw o.error}}return r.finish()})}function yD(r,t="stream"){return(t==="stream"?vp:_p).writeAll(r).toUint8Array(!0)}var vD=Object.create,Nx=Object.defineProperty,_D=Object.getOwnPropertyDescriptor,bD=Object.getOwnPropertyNames,wD=Object.getPrototypeOf,xD=Object.prototype.hasOwnProperty,SD=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),TD=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of bD(t))!xD.call(r,i)&&i!==e&&Nx(r,i,{get:()=>t[i],enumerable:!(n=_D(t,i))||n.enumerable});return r},ID=(r,t,e)=>(e=r!=null?vD(wD(r)):{},TD(!r||!r.__esModule?Nx(e,"default",{value:r,enumerable:!0}):e,r)),ED=SD((r,t)=>{t.exports=Worker}),Bx=(r=>(r[r.UNDEFINED=0]="UNDEFINED",r[r.AUTOMATIC=1]="AUTOMATIC",r[r.READ_ONLY=2]="READ_ONLY",r[r.READ_WRITE=3]="READ_WRITE",r))(Bx||{}),AD=(r=>(r[r.IDENTIFIER=0]="IDENTIFIER",r[r.NUMERIC_CONSTANT=1]="NUMERIC_CONSTANT",r[r.STRING_CONSTANT=2]="STRING_CONSTANT",r[r.OPERATOR=3]="OPERATOR",r[r.KEYWORD=4]="KEYWORD",r[r.COMMENT=5]="COMMENT",r))(AD||{}),MD=(r=>(r[r.NONE=0]="NONE",r[r.DEBUG=1]="DEBUG",r[r.INFO=2]="INFO",r[r.WARNING=3]="WARNING",r[r.ERROR=4]="ERROR",r))(MD||{}),CD=(r=>(r[r.NONE=0]="NONE",r[r.CONNECT=1]="CONNECT",r[r.DISCONNECT=2]="DISCONNECT",r[r.OPEN=3]="OPEN",r[r.QUERY=4]="QUERY",r[r.INSTANTIATE=5]="INSTANTIATE",r))(CD||{}),OD=(r=>(r[r.NONE=0]="NONE",r[r.OK=1]="OK",r[r.ERROR=2]="ERROR",r[r.START=3]="START",r[r.RUN=4]="RUN",r[r.CAPTURE=5]="CAPTURE",r))(OD||{}),PD=(r=>(r[r.NONE=0]="NONE",r[r.WEB_WORKER=1]="WEB_WORKER",r[r.NODE_WORKER=2]="NODE_WORKER",r[r.BINDINGS=3]="BINDINGS",r[r.ASYNC_DUCKDB=4]="ASYNC_DUCKDB",r))(PD||{}),RD=class{log(r){}},Ux=class{constructor(r=2){this.level=r}log(r){r.level>=this.level&&console.log(r)}},FD=(r=>(r[r.SUCCESS=0]="SUCCESS",r))(FD||{}),DD=class{constructor(r,t){this._bindings=r,this._conn=t}get bindings(){return this._bindings}async close(){return this._bindings.disconnect(this._conn)}useUnsafe(r){return r(this._bindings,this._conn)}async query(r){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:r});let t=await this._bindings.runQuery(this._conn,r),e=tn.from(t);return console.assert(e.isSync(),"Reader is not sync"),console.assert(e.isFile(),"Reader is not file"),new Ni(e)}async send(r,t=!1){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:r});let e=await this._bindings.startPendingQuery(this._conn,r,t);for(;e==null;)e=await this._bindings.pollPendingQuery(this._conn);let n=new kx(this._bindings,this._conn,e),i=await tn.from(n);return console.assert(i.isAsync()),console.assert(i.isStream()),i}async cancelSent(){return await this._bindings.cancelPendingQuery(this._conn)}async getTableNames(r){return await this._bindings.getTableNames(this._conn,r)}async prepare(r){let t=await this._bindings.createPrepared(this._conn,r);return new LD(this._bindings,this._conn,t)}async insertArrowTable(r,t){let e=yD(r,"stream");await this.insertArrowFromIPCStream(e,t)}async insertArrowFromIPCStream(r,t){await this._bindings.insertArrowFromIPCStream(this._conn,r,t)}async insertCSVFromPath(r,t){await this._bindings.insertCSVFromPath(this._conn,r,t)}async insertJSONFromPath(r,t){await this._bindings.insertJSONFromPath(this._conn,r,t)}},kx=class{constructor(r,t,e){this.db=r,this.conn=t,this.header=e,this._first=!0,this._depleted=!1,this._inFlight=null}async next(){if(this._first)return this._first=!1,{done:!1,value:this.header};if(this._depleted)return{done:!0,value:null};let r;return this._inFlight!=null?(r=await this._inFlight,this._inFlight=null):r=await this.db.fetchQueryResults(this.conn),this._depleted=r.length==0,this._depleted||(this._inFlight=this.db.fetchQueryResults(this.conn)),{done:this._depleted,value:r}}[Symbol.asyncIterator](){return this}},LD=class{constructor(r,t,e){this.bindings=r,this.connectionId=t,this.statementId=e}async close(){await this.bindings.closePrepared(this.connectionId,this.statementId)}async query(...r){let t=await this.bindings.runPrepared(this.connectionId,this.statementId,r),e=tn.from(t);return console.assert(e.isSync()),console.assert(e.isFile()),new Ni(e)}async send(...r){let t=await this.bindings.sendPrepared(this.connectionId,this.statementId,r),e=new kx(this.bindings,this.connectionId,t),n=await tn.from(e);return console.assert(n.isAsync()),console.assert(n.isStream()),n}},ND=(r=>(r.CANCEL_PENDING_QUERY="CANCEL_PENDING_QUERY",r.CLOSE_PREPARED="CLOSE_PREPARED",r.COLLECT_FILE_STATISTICS="COLLECT_FILE_STATISTICS",r.REGISTER_OPFS_FILE_NAME="REGISTER_OPFS_FILE_NAME",r.CONNECT="CONNECT",r.COPY_FILE_TO_BUFFER="COPY_FILE_TO_BUFFER",r.COPY_FILE_TO_PATH="COPY_FILE_TO_PATH",r.CREATE_PREPARED="CREATE_PREPARED",r.DISCONNECT="DISCONNECT",r.DROP_FILE="DROP_FILE",r.DROP_FILES="DROP_FILES",r.EXPORT_FILE_STATISTICS="EXPORT_FILE_STATISTICS",r.FETCH_QUERY_RESULTS="FETCH_QUERY_RESULTS",r.FLUSH_FILES="FLUSH_FILES",r.GET_FEATURE_FLAGS="GET_FEATURE_FLAGS",r.GET_TABLE_NAMES="GET_TABLE_NAMES",r.GET_VERSION="GET_VERSION",r.GLOB_FILE_INFOS="GLOB_FILE_INFOS",r.INSERT_ARROW_FROM_IPC_STREAM="INSERT_ARROW_FROM_IPC_STREAM",r.INSERT_CSV_FROM_PATH="IMPORT_CSV_FROM_PATH",r.INSERT_JSON_FROM_PATH="IMPORT_JSON_FROM_PATH",r.INSTANTIATE="INSTANTIATE",r.OPEN="OPEN",r.PING="PING",r.POLL_PENDING_QUERY="POLL_PENDING_QUERY",r.REGISTER_FILE_BUFFER="REGISTER_FILE_BUFFER",r.REGISTER_FILE_HANDLE="REGISTER_FILE_HANDLE",r.REGISTER_FILE_URL="REGISTER_FILE_URL",r.RESET="RESET",r.RUN_PREPARED="RUN_PREPARED",r.RUN_QUERY="RUN_QUERY",r.SEND_PREPARED="SEND_PREPARED",r.START_PENDING_QUERY="START_PENDING_QUERY",r.TOKENIZE="TOKENIZE",r))(ND||{}),BD=(r=>(r.CONNECTION_INFO="CONNECTION_INFO",r.ERROR="ERROR",r.FEATURE_FLAGS="FEATURE_FLAGS",r.FILE_BUFFER="FILE_BUFFER",r.FILE_INFOS="FILE_INFOS",r.FILE_SIZE="FILE_SIZE",r.FILE_STATISTICS="FILE_STATISTICS",r.INSTANTIATE_PROGRESS="INSTANTIATE_PROGRESS",r.LOG="LOG",r.OK="OK",r.PREPARED_STATEMENT_ID="PREPARED_STATEMENT_ID",r.QUERY_PLAN="QUERY_PLAN",r.QUERY_RESULT="QUERY_RESULT",r.QUERY_RESULT_CHUNK="QUERY_RESULT_CHUNK",r.QUERY_RESULT_HEADER="QUERY_RESULT_HEADER",r.QUERY_RESULT_HEADER_OR_NULL="QUERY_RESULT_HEADER_OR_NULL",r.REGISTERED_FILE="REGISTERED_FILE",r.SCRIPT_TOKENS="SCRIPT_TOKENS",r.SUCCESS="SUCCESS",r.TABLE_NAMES="TABLE_NAMES",r.VERSION_STRING="VERSION_STRING",r))(BD||{}),de=class{constructor(r,t){this.promiseResolver=()=>{},this.promiseRejecter=()=>{},this.type=r,this.data=t,this.promise=new Promise((e,n)=>{this.promiseResolver=e,this.promiseRejecter=n})}};function Ql(r){switch(r.typeId){case k.Binary:return{sqlType:"binary"};case k.Bool:return{sqlType:"bool"};case k.Date:return{sqlType:"date"};case k.DateDay:return{sqlType:"date32[d]"};case k.DateMillisecond:return{sqlType:"date64[ms]"};case k.Decimal:{let t=r;return{sqlType:"decimal",precision:t.precision,scale:t.scale}}case k.Float:return{sqlType:"float"};case k.Float16:return{sqlType:"float16"};case k.Float32:return{sqlType:"float32"};case k.Float64:return{sqlType:"float64"};case k.Int:return{sqlType:"int32"};case k.Int16:return{sqlType:"int16"};case k.Int32:return{sqlType:"int32"};case k.Int64:return{sqlType:"int64"};case k.Uint16:return{sqlType:"uint16"};case k.Uint32:return{sqlType:"uint32"};case k.Uint64:return{sqlType:"uint64"};case k.Uint8:return{sqlType:"uint8"};case k.IntervalDayTime:return{sqlType:"interval[dt]"};case k.IntervalYearMonth:return{sqlType:"interval[m]"};case k.List:return{sqlType:"list",valueType:Ql(r.valueType)};case k.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:r.byteWidth};case k.Null:return{sqlType:"null"};case k.Utf8:return{sqlType:"utf8"};case k.Struct:return{sqlType:"struct",fields:r.children.map(t=>af(t.name,t.type))};case k.Map:{let t=r;return{sqlType:"map",keyType:Ql(t.keyType),valueType:Ql(t.valueType)}}case k.Time:return{sqlType:"time[s]"};case k.TimeMicrosecond:return{sqlType:"time[us]"};case k.TimeMillisecond:return{sqlType:"time[ms]"};case k.TimeNanosecond:return{sqlType:"time[ns]"};case k.TimeSecond:return{sqlType:"time[s]"};case k.Timestamp:return{sqlType:"timestamp",timezone:r.timezone||void 0};case k.TimestampSecond:return{sqlType:"timestamp[s]",timezone:r.timezone||void 0};case k.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:r.timezone||void 0};case k.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:r.timezone||void 0};case k.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:r.timezone||void 0}}throw new Error("unsupported arrow type: ".concat(r.toString()))}function af(r,t){let e=Ql(t);return e.name=r,e}var UD=new TextEncoder,kD=class{constructor(r,t=null){this._onInstantiationProgress=[],this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{},this._nextMessageId=0,this._pendingRequests=new Map,this._logger=r,this._onMessageHandler=this.onMessage.bind(this),this._onErrorHandler=this.onError.bind(this),this._onCloseHandler=this.onClose.bind(this),t!=null&&this.attach(t)}get logger(){return this._logger}attach(r){this._worker=r,this._worker.addEventListener("message",this._onMessageHandler),this._worker.addEventListener("error",this._onErrorHandler),this._worker.addEventListener("close",this._onCloseHandler),this._workerShutdownPromise=new Promise((t,e)=>{this._workerShutdownResolver=t})}detach(){this._worker&&(this._worker.removeEventListener("message",this._onMessageHandler),this._worker.removeEventListener("error",this._onErrorHandler),this._worker.removeEventListener("close",this._onCloseHandler),this._worker=null,this._workerShutdownResolver(null),this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async terminate(){this._worker&&(this._worker.terminate(),this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async postTask(r,t=[]){if(!this._worker){console.error("cannot send a message since the worker is not set!");return}let e=this._nextMessageId++;return this._pendingRequests.set(e,r),this._worker.postMessage({messageId:e,type:r.type,data:r.data},t),await r.promise}onMessage(r){var t;let e=r.data;switch(e.type){case"LOG":{this._logger.log(e.data);return}case"INSTANTIATE_PROGRESS":{for(let i of this._onInstantiationProgress)i(e.data);return}}let n=this._pendingRequests.get(e.requestId);if(!n){console.warn("unassociated response: [".concat(e.requestId,", ").concat(e.type.toString(),"]"));return}if(this._pendingRequests.delete(e.requestId),e.type=="ERROR"){let i=new Error(e.data.message);i.name=e.data.name,(t=Object.getOwnPropertyDescriptor(i,"stack"))!=null&&t.writable&&(i.stack=e.data.stack),n.promiseRejecter(i);return}switch(n.type){case"CLOSE_PREPARED":case"COLLECT_FILE_STATISTICS":case"REGISTER_OPFS_FILE_NAME":case"COPY_FILE_TO_PATH":case"DISCONNECT":case"DROP_FILE":case"DROP_FILES":case"FLUSH_FILES":case"INSERT_ARROW_FROM_IPC_STREAM":case"IMPORT_CSV_FROM_PATH":case"IMPORT_JSON_FROM_PATH":case"OPEN":case"PING":case"REGISTER_FILE_BUFFER":case"REGISTER_FILE_HANDLE":case"REGISTER_FILE_URL":case"RESET":if(e.type=="OK"){n.promiseResolver(e.data);return}break;case"INSTANTIATE":if(this._onInstantiationProgress=[],e.type=="OK"){n.promiseResolver(e.data);return}break;case"GLOB_FILE_INFOS":if(e.type=="FILE_INFOS"){n.promiseResolver(e.data);return}break;case"GET_VERSION":if(e.type=="VERSION_STRING"){n.promiseResolver(e.data);return}break;case"GET_FEATURE_FLAGS":if(e.type=="FEATURE_FLAGS"){n.promiseResolver(e.data);return}break;case"GET_TABLE_NAMES":if(e.type=="TABLE_NAMES"){n.promiseResolver(e.data);return}break;case"TOKENIZE":if(e.type=="SCRIPT_TOKENS"){n.promiseResolver(e.data);return}break;case"COPY_FILE_TO_BUFFER":if(e.type=="FILE_BUFFER"){n.promiseResolver(e.data);return}break;case"EXPORT_FILE_STATISTICS":if(e.type=="FILE_STATISTICS"){n.promiseResolver(e.data);return}break;case"CONNECT":if(e.type=="CONNECTION_INFO"){n.promiseResolver(e.data);return}break;case"RUN_PREPARED":case"RUN_QUERY":if(e.type=="QUERY_RESULT"){n.promiseResolver(e.data);return}break;case"SEND_PREPARED":if(e.type=="QUERY_RESULT_HEADER"){n.promiseResolver(e.data);return}break;case"START_PENDING_QUERY":if(e.type=="QUERY_RESULT_HEADER_OR_NULL"){n.promiseResolver(e.data);return}break;case"POLL_PENDING_QUERY":if(e.type=="QUERY_RESULT_HEADER_OR_NULL"){n.promiseResolver(e.data);return}break;case"CANCEL_PENDING_QUERY":if(this._onInstantiationProgress=[],e.type=="SUCCESS"){n.promiseResolver(e.data);return}break;case"FETCH_QUERY_RESULTS":if(e.type=="QUERY_RESULT_CHUNK"){n.promiseResolver(e.data);return}break;case"CREATE_PREPARED":if(e.type=="PREPARED_STATEMENT_ID"){n.promiseResolver(e.data);return}break}n.promiseRejecter(new Error("unexpected response type: ".concat(e.type.toString())))}onError(r){console.error(r),console.error("error in duckdb worker: ".concat(r.message)),this._pendingRequests.clear()}onClose(){if(this._workerShutdownResolver(null),this._pendingRequests.size!=0){console.warn("worker terminated with ".concat(this._pendingRequests.size," pending requests"));return}this._pendingRequests.clear()}async reset(){let r=new de("RESET",null);return await this.postTask(r)}async ping(){let r=new de("PING",null);await this.postTask(r)}async dropFile(r){let t=new de("DROP_FILE",r);return await this.postTask(t)}async dropFiles(){let r=new de("DROP_FILES",null);return await this.postTask(r)}async flushFiles(){let r=new de("FLUSH_FILES",null);return await this.postTask(r)}async instantiate(r,t=null,e=n=>{}){this._onInstantiationProgress.push(e);let n=new de("INSTANTIATE",[r,t]);return await this.postTask(n)}async getVersion(){let r=new de("GET_VERSION",null);return await this.postTask(r)}async getFeatureFlags(){let r=new de("GET_FEATURE_FLAGS",null);return await this.postTask(r)}async open(r){let t=new de("OPEN",r);await this.postTask(t)}async tokenize(r){let t=new de("TOKENIZE",r);return await this.postTask(t)}async connectInternal(){let r=new de("CONNECT",null);return await this.postTask(r)}async connect(){let r=await this.connectInternal();return new DD(this,r)}async disconnect(r){let t=new de("DISCONNECT",r);await this.postTask(t)}async runQuery(r,t){let e=new de("RUN_QUERY",[r,t]);return await this.postTask(e)}async startPendingQuery(r,t,e=!1){let n=new de("START_PENDING_QUERY",[r,t,e]);return await this.postTask(n)}async pollPendingQuery(r){let t=new de("POLL_PENDING_QUERY",r);return await this.postTask(t)}async cancelPendingQuery(r){let t=new de("CANCEL_PENDING_QUERY",r);return await this.postTask(t)}async fetchQueryResults(r){let t=new de("FETCH_QUERY_RESULTS",r);return await this.postTask(t)}async getTableNames(r,t){let e=new de("GET_TABLE_NAMES",[r,t]);return await this.postTask(e)}async createPrepared(r,t){let e=new de("CREATE_PREPARED",[r,t]);return await this.postTask(e)}async closePrepared(r,t){let e=new de("CLOSE_PREPARED",[r,t]);await this.postTask(e)}async runPrepared(r,t,e){let n=new de("RUN_PREPARED",[r,t,e]);return await this.postTask(n)}async sendPrepared(r,t,e){let n=new de("SEND_PREPARED",[r,t,e]);return await this.postTask(n)}async globFiles(r){let t=new de("GLOB_FILE_INFOS",r);return await this.postTask(t)}async registerFileText(r,t){let e=UD.encode(t);await this.registerFileBuffer(r,e)}async registerFileURL(r,t,e,n){t===void 0&&(t=r);let i=new de("REGISTER_FILE_URL",[r,t,e,n]);await this.postTask(i)}async registerEmptyFileBuffer(r){}async registerFileBuffer(r,t){let e=new de("REGISTER_FILE_BUFFER",[r,t]);await this.postTask(e,[t.buffer])}async registerFileHandle(r,t,e,n){let i=new de("REGISTER_FILE_HANDLE",[r,t,e,n]);await this.postTask(i,[])}async registerOPFSFileName(r){let t=new de("REGISTER_OPFS_FILE_NAME",[r]);await this.postTask(t,[])}async collectFileStatistics(r,t){let e=new de("COLLECT_FILE_STATISTICS",[r,t]);await this.postTask(e,[])}async exportFileStatistics(r){let t=new de("EXPORT_FILE_STATISTICS",r);return await this.postTask(t,[])}async copyFileToBuffer(r){let t=new de("COPY_FILE_TO_BUFFER",r);return await this.postTask(t)}async copyFileToPath(r,t){let e=new de("COPY_FILE_TO_PATH",[r,t]);await this.postTask(e)}async insertArrowFromIPCStream(r,t,e){if(t.length==0)return;let n=new de("INSERT_ARROW_FROM_IPC_STREAM",[r,t,e]);await this.postTask(n,[t.buffer])}async insertCSVFromPath(r,t,e){if(e.columns!==void 0){let i=[];for(let s in e.columns){let o=e.columns[s];i.push(af(s,o))}e.columnsFlat=i,delete e.columns}let n=new de("IMPORT_CSV_FROM_PATH",[r,t,e]);await this.postTask(n)}async insertJSONFromPath(r,t,e){if(e.columns!==void 0){let i=[];for(let s in e.columns){let o=e.columns[s];i.push(af(s,o))}e.columnsFlat=i,delete e.columns}let n=new de("IMPORT_JSON_FROM_PATH",[r,t,e]);await this.postTask(n)}};function zD(){let r=new TextDecoder;return t=>(typeof SharedArrayBuffer<"u"&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),r.decode(t))}zD();var VD=(r=>(r[r.BUFFER=0]="BUFFER",r[r.NODE_FS=1]="NODE_FS",r[r.BROWSER_FILEREADER=2]="BROWSER_FILEREADER",r[r.BROWSER_FSACCESS=3]="BROWSER_FSACCESS",r[r.HTTP=4]="HTTP",r[r.S3=5]="S3",r))(VD||{}),jD=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,3,1,0,1,10,14,1,12,0,65,0,65,0,65,0,252,10,0,0,11])),$D=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,6,64,25,11,11])),GD=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),WD=()=>(async r=>{try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(r)}catch{return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])),HD={version:"1.29.1-dev68.0"},xp=HD.version.split(".");xp[0];xp[1];xp[2];var XD=()=>typeof navigator>"u",Fh=null,Dh=null,Lh=null,Nh=null,Bh=null;async function YD(){return Fh==null&&(Fh=typeof BigInt64Array<"u"),Dh==null&&(Dh=await $D()),Lh==null&&(Lh=await WD()),Nh==null&&(Nh=await GD()),Bh==null&&(Bh=await jD()),{bigInt64Array:Fh,crossOriginIsolated:XD()||globalThis.crossOriginIsolated||!1,wasmExceptions:Dh,wasmSIMD:Nh,wasmThreads:Lh,wasmBulkMemory:Bh}}async function Ey(r){let t=await YD();if(t.wasmExceptions){if(t.wasmSIMD&&t.wasmThreads&&t.crossOriginIsolated&&r.coi)return{mainModule:r.coi.mainModule,mainWorker:r.coi.mainWorker,pthreadWorker:r.coi.pthreadWorker};if(r.eh)return{mainModule:r.eh.mainModule,mainWorker:r.eh.mainWorker,pthreadWorker:null}}return{mainModule:r.mvp.mainModule,mainWorker:r.mvp.mainWorker,pthreadWorker:null}}ID(ED());const Uh={},wa={};function Ia(r,t){try{const n=(Uh[r]||(Uh[r]=new Intl.DateTimeFormat("en-GB",{timeZone:r,hour:"numeric",timeZoneName:"longOffset"}).format))(t).split("GMT")[1]||"";return n in wa?wa[n]:Ay(n,n.split(":"))}catch{if(r in wa)return wa[r];const e=r==null?void 0:r.match(qD);return e?Ay(r,e.slice(1)):NaN}}const qD=/([+-]\d\d):?(\d\d)?/;function Ay(r,t){const e=+t[0],n=+(t[1]||0);return wa[r]=e>0?e*60+n:e*60-n}class Fr extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Ia(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),zx(this),lf(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new Fr(...e,t):new Fr(Date.now(),t)}withTimeZone(t){return new Fr(+this,t)}getTimezoneOffset(){return-Ia(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),lf(this),+this}[Symbol.for("constructDateFrom")](t){return new Fr(+new Date(t),this.timeZone)}}const My=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(r=>{if(!My.test(r))return;const t=r.replace(My,"$1UTC");Fr.prototype[t]&&(r.startsWith("get")?Fr.prototype[r]=function(){return this.internal[t]()}:(Fr.prototype[r]=function(){return Date.prototype[t].apply(this.internal,arguments),QD(this),+this},Fr.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),lf(this),+this}))});function lf(r){r.internal.setTime(+r),r.internal.setUTCMinutes(r.internal.getUTCMinutes()-r.getTimezoneOffset())}function QD(r){Date.prototype.setFullYear.call(r,r.internal.getUTCFullYear(),r.internal.getUTCMonth(),r.internal.getUTCDate()),Date.prototype.setHours.call(r,r.internal.getUTCHours(),r.internal.getUTCMinutes(),r.internal.getUTCSeconds(),r.internal.getUTCMilliseconds()),zx(r)}function zx(r){const t=Ia(r.timeZone,r),e=new Date(+r);e.setUTCHours(e.getUTCHours()-1);const n=-new Date(+r).getTimezoneOffset(),i=-new Date(+e).getTimezoneOffset(),s=n-i,o=Date.prototype.getHours.apply(r)!==r.internal.getUTCHours();s&&o&&r.internal.setUTCMinutes(r.internal.getUTCMinutes()+s);const a=n-t;a&&Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+a);const l=Ia(r.timeZone,r),c=-new Date(+r).getTimezoneOffset()-l,h=l!==t,f=c-a;if(h&&f){Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+f);const d=Ia(r.timeZone,r),m=l-d;m&&(r.internal.setUTCMinutes(r.internal.getUTCMinutes()+m),Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+m))}}const ZD=new TextDecoder("utf-8"),KD=r=>ZD.decode(r),JD=new TextEncoder,Vx=r=>JD.encode(r),An=r=>typeof r=="function",el=r=>r!=null&&Object(r)===r,tL=r=>el(r)&&An(r.then),jx=r=>el(r)&&An(r[Symbol.iterator]),eL=r=>el(r)&&An(r[Symbol.asyncIterator]),rL=r=>el(r)&&"done"in r&&"value"in r,nL=r=>el(r)&&An(r.clear)&&An(r.bytes)&&An(r.position)&&An(r.setPosition)&&An(r.capacity)&&An(r.getBufferIdentifier)&&An(r.createLong),Sp=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function iL(r){const t=r[0]?[r[0]]:[];let e,n,i,s;for(let o,a,l=0,u=0,c=r.length;++lc+h.byteLength,0);let i,s,o,a=0,l=-1;const u=Math.min(t||Number.POSITIVE_INFINITY,n);for(const c=e.length;++lur(Int8Array,r),aL=r=>ur(Int16Array,r),lL=r=>ur(Int32Array,r),uL=r=>ur(BigInt64Array,r),cL=r=>ur(Uint8Array,r),hL=r=>ur(Uint16Array,r),dL=r=>ur(Uint32Array,r),fL=r=>ur(BigUint64Array,r),pL=r=>ur(Float32Array,r),mL=r=>ur(Float64Array,r),gL=r=>ur(Uint8ClampedArray,r),cf=r=>(r.next(),r);function*Xn(r,t){const e=function*(i){yield i},n=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Sp?e(t):jx(t)?t:e(t);return yield*cf(function*(i){let s=null;do s=i.next(yield ur(r,s));while(!s.done)}(n[Symbol.iterator]())),new r}const yL=r=>Xn(Int8Array,r),vL=r=>Xn(Int16Array,r),_L=r=>Xn(Int32Array,r),bL=r=>Xn(Uint8Array,r),wL=r=>Xn(Uint16Array,r),xL=r=>Xn(Uint32Array,r),SL=r=>Xn(Float32Array,r),TL=r=>Xn(Float64Array,r),IL=r=>Xn(Uint8ClampedArray,r);function mn(r,t){return br(this,arguments,function*(){if(tL(t))return yield Rt(yield Rt(yield*Ss(Bn(mn(r,yield Rt(t))))));const n=function(o){return br(this,arguments,function*(){yield yield Rt(yield Rt(o))})},i=function(o){return br(this,arguments,function*(){yield Rt(yield*Ss(Bn(cf(function*(a){let l=null;do l=a.next(yield l==null?void 0:l.value);while(!l.done)}(o[Symbol.iterator]())))))})},s=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Sp?n(t):jx(t)?i(t):eL(t)?t:n(t);return yield Rt(yield*Ss(Bn(cf(function(o){return br(this,arguments,function*(){let a=null;do a=yield Rt(o.next(yield yield Rt(ur(r,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield Rt(new r)})}const EL=r=>mn(Int8Array,r),AL=r=>mn(Int16Array,r),ML=r=>mn(Int32Array,r),CL=r=>mn(Uint8Array,r),OL=r=>mn(Uint16Array,r),PL=r=>mn(Uint32Array,r),RL=r=>mn(Float32Array,r),FL=r=>mn(Float64Array,r),DL=r=>mn(Uint8ClampedArray,r);function LL(r,t,e){if(r!==0){e=e.slice(0,t);for(let n=-1,i=e.length;++n0)do if(r[e]!==t[e])return!1;while(++eFo(t))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(t,e)=>typeof e=="bigint"?`${e}`:e)}const UL=Object.freeze(Object.defineProperty({__proto__:null,valueToString:Fo},Symbol.toStringTag,{value:"Module"}));function pr(r){if(typeof r=="bigint"&&(rNumber.MAX_SAFE_INTEGER))throw new TypeError(`${r} is not safe to convert to a number.`);return Number(r)}function Gx(r,t){return pr(r/t)+pr(r%t)/pr(t)}const Wx=Symbol.for("isArrowBigNum");function gn(r,...t){return t.length===0?Object.setPrototypeOf(ur(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...t),this.constructor.prototype)}gn.prototype[Wx]=!0;gn.prototype.toJSON=function(){return`"${Do(this)}"`};gn.prototype.valueOf=function(r){return Tp(this,r)};gn.prototype.toString=function(){return Do(this)};gn.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return Tp(this);case"string":return Do(this);case"default":return Hx(this)}return Do(this)};function xo(...r){return gn.apply(this,r)}function So(...r){return gn.apply(this,r)}function $a(...r){return gn.apply(this,r)}Object.setPrototypeOf(xo.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(So.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf($a.prototype,Object.create(Uint32Array.prototype));Object.assign(xo.prototype,gn.prototype,{constructor:xo,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(So.prototype,gn.prototype,{constructor:So,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign($a.prototype,gn.prototype,{constructor:$a,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const kL=BigInt(4294967296)*BigInt(4294967296),zL=kL-BigInt(1);function Tp(r,t){const{buffer:e,byteOffset:n,byteLength:i,signed:s}=r,o=new BigUint64Array(e,n,i/8),a=s&&o.at(-1)&BigInt(1)<=0)return kh(r);t=t.slice();let n=1;for(let s=0;s(r.children=null,r.ArrayType=Array,r.OffsetArrayType=Int32Array,r[Symbol.toStringTag]="DataType"))(Ct.prototype);class Cy extends Ct{constructor(){super(H.Null)}toString(){return"Null"}}Yx=Symbol.toStringTag;Cy[Yx]=(r=>r[Symbol.toStringTag]="Null")(Cy.prototype);class Oy extends Ct{constructor(t,e){super(H.Int),this.isSigned=t,this.bitWidth=e}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}qx=Symbol.toStringTag;Oy[qx]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(Oy.prototype);class Py extends Ct{constructor(t){super(H.Float),this.precision=t}get ArrayType(){switch(this.precision){case Dr.HALF:return Uint16Array;case Dr.SINGLE:return Float32Array;case Dr.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}Qx=Symbol.toStringTag;Py[Qx]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(Py.prototype);class Ry extends Ct{constructor(){super(H.Binary)}toString(){return"Binary"}}Zx=Symbol.toStringTag;Ry[Zx]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(Ry.prototype);class Fy extends Ct{constructor(){super(H.LargeBinary)}toString(){return"LargeBinary"}}Kx=Symbol.toStringTag;Fy[Kx]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeBinary"))(Fy.prototype);class Dy extends Ct{constructor(){super(H.Utf8)}toString(){return"Utf8"}}Jx=Symbol.toStringTag;Dy[Jx]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(Dy.prototype);class Ly extends Ct{constructor(){super(H.LargeUtf8)}toString(){return"LargeUtf8"}}tS=Symbol.toStringTag;Ly[tS]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeUtf8"))(Ly.prototype);class Ny extends Ct{constructor(){super(H.Bool)}toString(){return"Bool"}}eS=Symbol.toStringTag;Ny[eS]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(Ny.prototype);class By extends Ct{constructor(t,e,n=128){super(H.Decimal),this.scale=t,this.precision=e,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}}rS=Symbol.toStringTag;By[rS]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(By.prototype);class Uy extends Ct{constructor(t){super(H.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${Ui[this.unit]}>`}get ArrayType(){return this.unit===Ui.DAY?Int32Array:BigInt64Array}}nS=Symbol.toStringTag;Uy[nS]=(r=>(r.unit=null,r[Symbol.toStringTag]="Date"))(Uy.prototype);class ky extends Ct{constructor(t,e){super(H.Time),this.unit=t,this.bitWidth=e}toString(){return`Time${this.bitWidth}<${te[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}iS=Symbol.toStringTag;ky[iS]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(ky.prototype);class zy extends Ct{constructor(t,e){super(H.Timestamp),this.unit=t,this.timezone=e}toString(){return`Timestamp<${te[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}sS=Symbol.toStringTag;zy[sS]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Timestamp"))(zy.prototype);class Vy extends Ct{constructor(t){super(H.Interval),this.unit=t}toString(){return`Interval<${As[this.unit]}>`}}oS=Symbol.toStringTag;Vy[oS]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(Vy.prototype);class jy extends Ct{constructor(t){super(H.Duration),this.unit=t}toString(){return`Duration<${te[this.unit]}>`}}aS=Symbol.toStringTag;jy[aS]=(r=>(r.unit=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Duration"))(jy.prototype);class $y extends Ct{constructor(t){super(H.List),this.children=[t]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}}lS=Symbol.toStringTag;$y[lS]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))($y.prototype);class hf extends Ct{constructor(t){super(H.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}uS=Symbol.toStringTag;hf[uS]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(hf.prototype);class Gy extends Ct{constructor(t,e,n){super(H.Union),this.mode=t,this.children=n,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((i,s,o)=>(i[s]=o)&&i||i,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}cS=Symbol.toStringTag;Gy[cS]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(Gy.prototype);class Wy extends Ct{constructor(t){super(H.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}}hS=Symbol.toStringTag;Wy[hS]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(Wy.prototype);class Hy extends Ct{constructor(t,e){super(H.FixedSizeList),this.listSize=t,this.children=[e]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}}dS=Symbol.toStringTag;Hy[dS]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(Hy.prototype);class Xy extends Ct{constructor(t,e=!1){var n,i,s;if(super(H.Map),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((n=t==null?void 0:t.type)===null||n===void 0)&&n.children)){const o=(i=t==null?void 0:t.type)===null||i===void 0?void 0:i.children[0];o&&(o.name="key");const a=(s=t==null?void 0:t.type)===null||s===void 0?void 0:s.children[1];a&&(a.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}fS=Symbol.toStringTag;Xy[fS]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(Xy.prototype);const jL=(r=>()=>++r)(-1);class Yy extends Ct{constructor(t,e,n,i){super(H.Dictionary),this.indices=e,this.dictionary=t,this.isOrdered=i||!1,this.id=n==null?jL():pr(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}}pS=Symbol.toStringTag;Yy[pS]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(Yy.prototype);function mS(r){const t=r;switch(r.typeId){case H.Decimal:return r.bitWidth/32;case H.Interval:return 1+t.unit;case H.FixedSizeList:return t.listSize;case H.FixedSizeBinary:return t.byteWidth;default:return 1}}class he{visitMany(t,...e){return t.map((n,i)=>this.visit(n,...e.map(s=>s[i])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return $L(this,t,e)}getVisitFnByTypeId(t,e=!0){return ao(this,t,e)}visitNull(t,...e){return null}visitBool(t,...e){return null}visitInt(t,...e){return null}visitFloat(t,...e){return null}visitUtf8(t,...e){return null}visitLargeUtf8(t,...e){return null}visitBinary(t,...e){return null}visitLargeBinary(t,...e){return null}visitFixedSizeBinary(t,...e){return null}visitDate(t,...e){return null}visitTimestamp(t,...e){return null}visitTime(t,...e){return null}visitDecimal(t,...e){return null}visitList(t,...e){return null}visitStruct(t,...e){return null}visitUnion(t,...e){return null}visitDictionary(t,...e){return null}visitInterval(t,...e){return null}visitDuration(t,...e){return null}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}}function $L(r,t,e=!0){return typeof t=="number"?ao(r,t,e):typeof t=="string"&&t in H?ao(r,H[t],e):t&&t instanceof Ct?ao(r,qy(t),e):t!=null&&t.type&&t.type instanceof Ct?ao(r,qy(t.type),e):ao(r,H.NONE,e)}function ao(r,t,e=!0){let n=null;switch(t){case H.Null:n=r.visitNull;break;case H.Bool:n=r.visitBool;break;case H.Int:n=r.visitInt;break;case H.Int8:n=r.visitInt8||r.visitInt;break;case H.Int16:n=r.visitInt16||r.visitInt;break;case H.Int32:n=r.visitInt32||r.visitInt;break;case H.Int64:n=r.visitInt64||r.visitInt;break;case H.Uint8:n=r.visitUint8||r.visitInt;break;case H.Uint16:n=r.visitUint16||r.visitInt;break;case H.Uint32:n=r.visitUint32||r.visitInt;break;case H.Uint64:n=r.visitUint64||r.visitInt;break;case H.Float:n=r.visitFloat;break;case H.Float16:n=r.visitFloat16||r.visitFloat;break;case H.Float32:n=r.visitFloat32||r.visitFloat;break;case H.Float64:n=r.visitFloat64||r.visitFloat;break;case H.Utf8:n=r.visitUtf8;break;case H.LargeUtf8:n=r.visitLargeUtf8;break;case H.Binary:n=r.visitBinary;break;case H.LargeBinary:n=r.visitLargeBinary;break;case H.FixedSizeBinary:n=r.visitFixedSizeBinary;break;case H.Date:n=r.visitDate;break;case H.DateDay:n=r.visitDateDay||r.visitDate;break;case H.DateMillisecond:n=r.visitDateMillisecond||r.visitDate;break;case H.Timestamp:n=r.visitTimestamp;break;case H.TimestampSecond:n=r.visitTimestampSecond||r.visitTimestamp;break;case H.TimestampMillisecond:n=r.visitTimestampMillisecond||r.visitTimestamp;break;case H.TimestampMicrosecond:n=r.visitTimestampMicrosecond||r.visitTimestamp;break;case H.TimestampNanosecond:n=r.visitTimestampNanosecond||r.visitTimestamp;break;case H.Time:n=r.visitTime;break;case H.TimeSecond:n=r.visitTimeSecond||r.visitTime;break;case H.TimeMillisecond:n=r.visitTimeMillisecond||r.visitTime;break;case H.TimeMicrosecond:n=r.visitTimeMicrosecond||r.visitTime;break;case H.TimeNanosecond:n=r.visitTimeNanosecond||r.visitTime;break;case H.Decimal:n=r.visitDecimal;break;case H.List:n=r.visitList;break;case H.Struct:n=r.visitStruct;break;case H.Union:n=r.visitUnion;break;case H.DenseUnion:n=r.visitDenseUnion||r.visitUnion;break;case H.SparseUnion:n=r.visitSparseUnion||r.visitUnion;break;case H.Dictionary:n=r.visitDictionary;break;case H.Interval:n=r.visitInterval;break;case H.IntervalDayTime:n=r.visitIntervalDayTime||r.visitInterval;break;case H.IntervalYearMonth:n=r.visitIntervalYearMonth||r.visitInterval;break;case H.Duration:n=r.visitDuration;break;case H.DurationSecond:n=r.visitDurationSecond||r.visitDuration;break;case H.DurationMillisecond:n=r.visitDurationMillisecond||r.visitDuration;break;case H.DurationMicrosecond:n=r.visitDurationMicrosecond||r.visitDuration;break;case H.DurationNanosecond:n=r.visitDurationNanosecond||r.visitDuration;break;case H.FixedSizeList:n=r.visitFixedSizeList;break;case H.Map:n=r.visitMap;break}if(typeof n=="function")return n;if(!e)return()=>null;throw new Error(`Unrecognized type '${H[t]}'`)}function qy(r){switch(r.typeId){case H.Null:return H.Null;case H.Int:{const{bitWidth:t,isSigned:e}=r;switch(t){case 8:return e?H.Int8:H.Uint8;case 16:return e?H.Int16:H.Uint16;case 32:return e?H.Int32:H.Uint32;case 64:return e?H.Int64:H.Uint64}return H.Int}case H.Float:switch(r.precision){case Dr.HALF:return H.Float16;case Dr.SINGLE:return H.Float32;case Dr.DOUBLE:return H.Float64}return H.Float;case H.Binary:return H.Binary;case H.LargeBinary:return H.LargeBinary;case H.Utf8:return H.Utf8;case H.LargeUtf8:return H.LargeUtf8;case H.Bool:return H.Bool;case H.Decimal:return H.Decimal;case H.Time:switch(r.unit){case te.SECOND:return H.TimeSecond;case te.MILLISECOND:return H.TimeMillisecond;case te.MICROSECOND:return H.TimeMicrosecond;case te.NANOSECOND:return H.TimeNanosecond}return H.Time;case H.Timestamp:switch(r.unit){case te.SECOND:return H.TimestampSecond;case te.MILLISECOND:return H.TimestampMillisecond;case te.MICROSECOND:return H.TimestampMicrosecond;case te.NANOSECOND:return H.TimestampNanosecond}return H.Timestamp;case H.Date:switch(r.unit){case Ui.DAY:return H.DateDay;case Ui.MILLISECOND:return H.DateMillisecond}return H.Date;case H.Interval:switch(r.unit){case As.DAY_TIME:return H.IntervalDayTime;case As.YEAR_MONTH:return H.IntervalYearMonth}return H.Interval;case H.Duration:switch(r.unit){case te.SECOND:return H.DurationSecond;case te.MILLISECOND:return H.DurationMillisecond;case te.MICROSECOND:return H.DurationMicrosecond;case te.NANOSECOND:return H.DurationNanosecond}return H.Duration;case H.Map:return H.Map;case H.List:return H.List;case H.Struct:return H.Struct;case H.Union:switch(r.mode){case jn.Dense:return H.DenseUnion;case jn.Sparse:return H.SparseUnion}return H.Union;case H.FixedSizeBinary:return H.FixedSizeBinary;case H.FixedSizeList:return H.FixedSizeList;case H.Dictionary:return H.Dictionary}throw new Error(`Unrecognized type '${H[r.typeId]}'`)}he.prototype.visitInt8=null;he.prototype.visitInt16=null;he.prototype.visitInt32=null;he.prototype.visitInt64=null;he.prototype.visitUint8=null;he.prototype.visitUint16=null;he.prototype.visitUint32=null;he.prototype.visitUint64=null;he.prototype.visitFloat16=null;he.prototype.visitFloat32=null;he.prototype.visitFloat64=null;he.prototype.visitDateDay=null;he.prototype.visitDateMillisecond=null;he.prototype.visitTimestampSecond=null;he.prototype.visitTimestampMillisecond=null;he.prototype.visitTimestampMicrosecond=null;he.prototype.visitTimestampNanosecond=null;he.prototype.visitTimeSecond=null;he.prototype.visitTimeMillisecond=null;he.prototype.visitTimeMicrosecond=null;he.prototype.visitTimeNanosecond=null;he.prototype.visitDenseUnion=null;he.prototype.visitSparseUnion=null;he.prototype.visitIntervalDayTime=null;he.prototype.visitIntervalYearMonth=null;he.prototype.visitDuration=null;he.prototype.visitDurationSecond=null;he.prototype.visitDurationMillisecond=null;he.prototype.visitDurationMicrosecond=null;he.prototype.visitDurationNanosecond=null;const gS=new Float64Array(1),Hs=new Uint32Array(gS.buffer);function Ip(r){const t=(r&31744)>>10,e=(r&1023)/1024,n=Math.pow(-1,(r&32768)>>15);switch(t){case 31:return n*(e?Number.NaN:1/0);case 0:return n*(e?6103515625e-14*e:0)}return n*Math.pow(2,t-15)*(1+e)}function yS(r){if(r!==r)return 32256;gS[0]=r;const t=(Hs[1]&2147483648)>>16&65535;let e=Hs[1]&2146435072,n=0;return e>=1089470464?Hs[0]>0?e=31744:(e=(e&2080374784)>>16,n=(Hs[1]&1048575)>>10):e<=1056964608?(n=1048576+(Hs[1]&1048575),n=1048576+(n<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,n=(Hs[1]&1048575)+512>>10),t|e|n&65535}const GL=Object.freeze(Object.defineProperty({__proto__:null,float64ToUint16:yS,uint16ToFloat64:Ip},Symbol.toStringTag,{value:"Module"}));class Wt extends he{}function qt(r){return(t,e,n)=>{if(t.setValid(e,n!=null))return r(t,e,n)}}const WL=(r,t,e)=>{r[t]=Math.floor(e/864e5)},vS=(r,t,e,n)=>{if(e+1{const i=r+e;n?t[i>>3]|=1<>3]&=~(1<{r[t]=e},Ep=({values:r},t,e)=>{r[t]=e},_S=({values:r},t,e)=>{r[t]=yS(e)},XL=(r,t,e)=>{switch(r.type.precision){case Dr.HALF:return _S(r,t,e);case Dr.SINGLE:case Dr.DOUBLE:return Ep(r,t,e)}},bS=({values:r},t,e)=>{WL(r,t,e.valueOf())},wS=({values:r},t,e)=>{r[t]=BigInt(e)},YL=({stride:r,values:t},e,n)=>{t.set(n.subarray(0,r),r*e)},xS=({values:r,valueOffsets:t},e,n)=>vS(r,t,e,n),SS=({values:r,valueOffsets:t},e,n)=>vS(r,t,e,Vx(n)),qL=(r,t,e)=>{r.type.unit===Ui.DAY?bS(r,t,e):wS(r,t,e)},TS=({values:r},t,e)=>{r[t]=BigInt(e/1e3)},IS=({values:r},t,e)=>{r[t]=BigInt(e)},ES=({values:r},t,e)=>{r[t]=BigInt(e*1e3)},AS=({values:r},t,e)=>{r[t]=BigInt(e*1e6)},QL=(r,t,e)=>{switch(r.type.unit){case te.SECOND:return TS(r,t,e);case te.MILLISECOND:return IS(r,t,e);case te.MICROSECOND:return ES(r,t,e);case te.NANOSECOND:return AS(r,t,e)}},MS=({values:r},t,e)=>{r[t]=e},CS=({values:r},t,e)=>{r[t]=e},OS=({values:r},t,e)=>{r[t]=e},PS=({values:r},t,e)=>{r[t]=e},ZL=(r,t,e)=>{switch(r.type.unit){case te.SECOND:return MS(r,t,e);case te.MILLISECOND:return CS(r,t,e);case te.MICROSECOND:return OS(r,t,e);case te.NANOSECOND:return PS(r,t,e)}},KL=({values:r,stride:t},e,n)=>{r.set(n.subarray(0,t),t*e)},JL=(r,t,e)=>{const n=r.children[0],i=r.valueOffsets,s=$n.getVisitFn(n);if(Array.isArray(e))for(let o=-1,a=i[t],l=i[t+1];a{const n=r.children[0],{valueOffsets:i}=r,s=$n.getVisitFn(n);let{[t]:o,[t+1]:a}=i;const l=e instanceof Map?e.entries():Object.entries(e);for(const u of l)if(s(n,o,u),++o>=a)break},eN=(r,t)=>(e,n,i,s)=>n&&e(n,r,t[s]),rN=(r,t)=>(e,n,i,s)=>n&&e(n,r,t.get(s)),nN=(r,t)=>(e,n,i,s)=>n&&e(n,r,t.get(i.name)),iN=(r,t)=>(e,n,i,s)=>n&&e(n,r,t[i.name]),sN=(r,t,e)=>{const n=r.type.children.map(s=>$n.getVisitFn(s.type)),i=e instanceof Map?nN(t,e):e instanceof er?rN(t,e):Array.isArray(e)?eN(t,e):iN(t,e);r.type.children.forEach((s,o)=>i(n[o],r.children[o],s,o))},oN=(r,t,e)=>{r.type.mode===jn.Dense?RS(r,t,e):FS(r,t,e)},RS=(r,t,e)=>{const n=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[n];$n.visit(i,r.valueOffsets[t],e)},FS=(r,t,e)=>{const n=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[n];$n.visit(i,t,e)},aN=(r,t,e)=>{var n;(n=r.dictionary)===null||n===void 0||n.set(r.values[t],e)},lN=(r,t,e)=>{r.type.unit===As.DAY_TIME?DS(r,t,e):LS(r,t,e)},DS=({values:r},t,e)=>{r.set(e.subarray(0,2),2*t)},LS=({values:r},t,e)=>{r[t]=e[0]*12+e[1]%12},NS=({values:r},t,e)=>{r[t]=e},BS=({values:r},t,e)=>{r[t]=e},US=({values:r},t,e)=>{r[t]=e},kS=({values:r},t,e)=>{r[t]=e},uN=(r,t,e)=>{switch(r.type.unit){case te.SECOND:return NS(r,t,e);case te.MILLISECOND:return BS(r,t,e);case te.MICROSECOND:return US(r,t,e);case te.NANOSECOND:return kS(r,t,e)}},cN=(r,t,e)=>{const{stride:n}=r,i=r.children[0],s=$n.getVisitFn(i);if(Array.isArray(e))for(let o=-1,a=t*n;++o`${Fo(t)}: ${Fo(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new hN(this[cn],this[To])}}class hN{constructor(t,e){this.childIndex=0,this.children=t.children,this.rowIndex=e,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){const t=this.childIndex;return te.name)}has(t,e){return t[cn].type.children.some(n=>n.name===e)}getOwnPropertyDescriptor(t,e){if(t[cn].type.children.some(n=>n.name===e))return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const n=t[cn].type.children.findIndex(i=>i.name===e);if(n!==-1){const i=on.visit(t[cn].children[n],t[To]);return Reflect.set(t,e,i),i}}set(t,e,n){const i=t[cn].type.children.findIndex(s=>s.name===e);return i!==-1?($n.visit(t[cn].children[i],t[To],n),Reflect.set(t,e,n)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,n):!1}}const fN=new dN;class Bt extends he{}function Ht(r){return(t,e)=>t.getValid(e)?r(t,e):null}const pN=(r,t)=>864e5*r[t],mN=(r,t)=>null,zS=(r,t,e)=>{if(e+1>=t.length)return null;const n=pr(t[e]),i=pr(t[e+1]);return r.subarray(n,i)},gN=({offset:r,values:t},e)=>{const n=r+e;return(t[n>>3]&1<pN(r,t),jS=({values:r},t)=>pr(r[t]),Vi=({stride:r,values:t},e)=>t[r*e],yN=({stride:r,values:t},e)=>Ip(t[r*e]),$S=({values:r},t)=>r[t],vN=({stride:r,values:t},e)=>t.subarray(r*e,r*(e+1)),GS=({values:r,valueOffsets:t},e)=>zS(r,t,e),WS=({values:r,valueOffsets:t},e)=>{const n=zS(r,t,e);return n!==null?KD(n):null},_N=({values:r},t)=>r[t],bN=({type:r,values:t},e)=>r.precision!==Dr.HALF?t[e]:Ip(t[e]),wN=(r,t)=>r.type.unit===Ui.DAY?VS(r,t):jS(r,t),HS=({values:r},t)=>1e3*pr(r[t]),XS=({values:r},t)=>pr(r[t]),YS=({values:r},t)=>Gx(r[t],BigInt(1e3)),qS=({values:r},t)=>Gx(r[t],BigInt(1e6)),xN=(r,t)=>{switch(r.type.unit){case te.SECOND:return HS(r,t);case te.MILLISECOND:return XS(r,t);case te.MICROSECOND:return YS(r,t);case te.NANOSECOND:return qS(r,t)}},QS=({values:r},t)=>r[t],ZS=({values:r},t)=>r[t],KS=({values:r},t)=>r[t],JS=({values:r},t)=>r[t],SN=(r,t)=>{switch(r.type.unit){case te.SECOND:return QS(r,t);case te.MILLISECOND:return ZS(r,t);case te.MICROSECOND:return KS(r,t);case te.NANOSECOND:return JS(r,t)}},TN=({values:r,stride:t},e)=>hc.decimal(r.subarray(t*e,t*(e+1))),IN=(r,t)=>{const{valueOffsets:e,stride:n,children:i}=r,{[t*n]:s,[t*n+1]:o}=e,l=i[0].slice(s,o-s);return new er([l])},EN=(r,t)=>{const{valueOffsets:e,children:n}=r,{[t]:i,[t+1]:s}=e,o=n[0];return new Mp(o.slice(i,s-i))},AN=(r,t)=>new Ap(r,t),MN=(r,t)=>r.type.mode===jn.Dense?tT(r,t):eT(r,t),tT=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[e];return on.visit(n,r.valueOffsets[t])},eT=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[e];return on.visit(n,t)},CN=(r,t)=>{var e;return(e=r.dictionary)===null||e===void 0?void 0:e.get(r.values[t])},ON=(r,t)=>r.type.unit===As.DAY_TIME?rT(r,t):nT(r,t),rT=({values:r},t)=>r.subarray(2*t,2*(t+1)),nT=({values:r},t)=>{const e=r[t],n=new Int32Array(2);return n[0]=Math.trunc(e/12),n[1]=Math.trunc(e%12),n},iT=({values:r},t)=>r[t],sT=({values:r},t)=>r[t],oT=({values:r},t)=>r[t],aT=({values:r},t)=>r[t],PN=(r,t)=>{switch(r.type.unit){case te.SECOND:return iT(r,t);case te.MILLISECOND:return sT(r,t);case te.MICROSECOND:return oT(r,t);case te.NANOSECOND:return aT(r,t)}},RN=(r,t)=>{const{stride:e,children:n}=r,s=n[0].slice(t*e,e);return new er([s])};Bt.prototype.visitNull=Ht(mN);Bt.prototype.visitBool=Ht(gN);Bt.prototype.visitInt=Ht(_N);Bt.prototype.visitInt8=Ht(Vi);Bt.prototype.visitInt16=Ht(Vi);Bt.prototype.visitInt32=Ht(Vi);Bt.prototype.visitInt64=Ht($S);Bt.prototype.visitUint8=Ht(Vi);Bt.prototype.visitUint16=Ht(Vi);Bt.prototype.visitUint32=Ht(Vi);Bt.prototype.visitUint64=Ht($S);Bt.prototype.visitFloat=Ht(bN);Bt.prototype.visitFloat16=Ht(yN);Bt.prototype.visitFloat32=Ht(Vi);Bt.prototype.visitFloat64=Ht(Vi);Bt.prototype.visitUtf8=Ht(WS);Bt.prototype.visitLargeUtf8=Ht(WS);Bt.prototype.visitBinary=Ht(GS);Bt.prototype.visitLargeBinary=Ht(GS);Bt.prototype.visitFixedSizeBinary=Ht(vN);Bt.prototype.visitDate=Ht(wN);Bt.prototype.visitDateDay=Ht(VS);Bt.prototype.visitDateMillisecond=Ht(jS);Bt.prototype.visitTimestamp=Ht(xN);Bt.prototype.visitTimestampSecond=Ht(HS);Bt.prototype.visitTimestampMillisecond=Ht(XS);Bt.prototype.visitTimestampMicrosecond=Ht(YS);Bt.prototype.visitTimestampNanosecond=Ht(qS);Bt.prototype.visitTime=Ht(SN);Bt.prototype.visitTimeSecond=Ht(QS);Bt.prototype.visitTimeMillisecond=Ht(ZS);Bt.prototype.visitTimeMicrosecond=Ht(KS);Bt.prototype.visitTimeNanosecond=Ht(JS);Bt.prototype.visitDecimal=Ht(TN);Bt.prototype.visitList=Ht(IN);Bt.prototype.visitStruct=Ht(AN);Bt.prototype.visitUnion=Ht(MN);Bt.prototype.visitDenseUnion=Ht(tT);Bt.prototype.visitSparseUnion=Ht(eT);Bt.prototype.visitDictionary=Ht(CN);Bt.prototype.visitInterval=Ht(ON);Bt.prototype.visitIntervalDayTime=Ht(rT);Bt.prototype.visitIntervalYearMonth=Ht(nT);Bt.prototype.visitDuration=Ht(PN);Bt.prototype.visitDurationSecond=Ht(iT);Bt.prototype.visitDurationMillisecond=Ht(sT);Bt.prototype.visitDurationMicrosecond=Ht(oT);Bt.prototype.visitDurationNanosecond=Ht(aT);Bt.prototype.visitFixedSizeList=Ht(RN);Bt.prototype.visitMap=Ht(EN);const on=new Bt,lo=Symbol.for("keys"),Io=Symbol.for("vals"),uo=Symbol.for("kKeysAsStrings"),df=Symbol.for("_kKeysAsStrings");class Mp{constructor(t){return this[lo]=new er([t.children[0]]).memoize(),this[Io]=t.children[1],new Proxy(this,new DN)}get[uo](){return this[df]||(this[df]=Array.from(this[lo].toArray(),String))}[Symbol.iterator](){return new FN(this[lo],this[Io])}get size(){return this[lo].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[lo],e=this[Io],n={};for(let i=-1,s=t.length;++i`${Fo(t)}: ${Fo(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class FN{constructor(t,e){this.keys=t,this.vals=e,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){const t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),on.visit(this.vals,t)]})}}class DN{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[uo]}has(t,e){return t[uo].includes(e)}getOwnPropertyDescriptor(t,e){if(t[uo].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const n=t[uo].indexOf(e);if(n!==-1){const i=on.visit(Reflect.get(t,Io),n);return Reflect.set(t,e,i),i}}set(t,e,n){const i=t[uo].indexOf(e);return i!==-1?($n.visit(Reflect.get(t,Io),i,n),Reflect.set(t,e,n)):Reflect.has(t,e)?Reflect.set(t,e,n):!1}}Object.defineProperties(Mp.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[lo]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Io]:{writable:!0,enumerable:!1,configurable:!1,value:null},[df]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let Qy;function lT(r,t,e,n){const{length:i=0}=r;let s=typeof t!="number"?0:t,o=typeof e!="number"?i:e;return s<0&&(s=(s%i+i)%i),o<0&&(o=(o%i+i)%i),oi&&(o=i),n?n(r,s,o):[s,o]}const uT=(r,t)=>r<0?t+r:r,Zy=r=>r!==r;function Ds(r){if(typeof r!=="object"||r===null)return Zy(r)?Zy:e=>e===r;if(r instanceof Date){const e=r.valueOf();return n=>n instanceof Date?n.valueOf()===e:!1}return ArrayBuffer.isView(r)?e=>e?$x(r,e):!1:r instanceof Map?NN(r):Array.isArray(r)?LN(r):r instanceof er?BN(r):UN(r,!0)}function LN(r){const t=[];for(let e=-1,n=r.length;++e!1;const n=[];for(let i=-1,s=e.length;++i{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return kN(r,e);case Map:return Ky(r,e,e.keys());case Mp:case Ap:case Object:case void 0:return Ky(r,e,t||Object.keys(e))}return e instanceof er?zN(r,e):!1}}function kN(r,t){const e=r.length;if(t.length!==e)return!1;for(let n=-1;++n>n}function jN(r,t,e){return e?!!(r[t>>3]|=1<>3]&=~(1<0||e.byteLength>3):hT(new fc(e,r,t,null,Cp)).subarray(0,n)),i}return e}function hT(r){const t=[];let e=0,n=0,i=0;for(const o of r)o&&(i|=1<0)&&(t[e++]=i);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}class fc{constructor(t,e,n,i,s){this.bytes=t,this.length=n,this.context=i,this.get=s,this.bit=e%8,this.byteIndex=e>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index>3<<3,i=t+(t%8===0?0:8-t%8);return ju(r,t,i)+ju(r,n,e)+dT(r,i>>3,n-i>>3)}function dT(r,t,e){let n=0,i=Math.trunc(t);const s=new DataView(r.buffer,r.byteOffset,r.byteLength),o=e===void 0?r.byteLength:i+e;for(;o-i>=4;)n+=Zl(s.getUint32(i)),i+=4;for(;o-i>=2;)n+=Zl(s.getUint16(i)),i+=2;for(;o-i>=1;)n+=Zl(s.getUint8(i)),i+=1;return n}function Zl(r){let t=Math.trunc(r);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const $N=Object.freeze(Object.defineProperty({__proto__:null,BitIterator:fc,getBit:cT,getBool:Cp,packBools:hT,popcnt_array:dT,popcnt_bit_range:ju,popcnt_uint32:Zl,setBool:jN,truncateBitmap:ff},Symbol.toStringTag,{value:"Module"})),GN=-1;class Ga{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){const{type:t}=this;return Ct.isSparseUnion(t)?this.children.some(e=>e.nullable):Ct.isDenseUnion(t)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0;const{valueOffsets:e,values:n,nullBitmap:i,typeIds:s}=this;return e&&(t+=e.byteLength),n&&(t+=n.byteLength),i&&(t+=i.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){if(Ct.isUnion(this.type))return this.children.reduce((n,i)=>n+i.nullCount,0);let t=this._nullCount,e;return t<=GN&&(e=this.nullBitmap)&&(this._nullCount=t=e.length===0?0:this.length-ju(e,this.offset,this.offset+this.length)),t}constructor(t,e,n,i,s,o=[],a){this.type=t,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let l;s instanceof Ga?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=mS(t),s&&((l=s[0])&&(this.valueOffsets=l),(l=s[1])&&(this.values=l),(l=s[2])&&(this.nullBitmap=l),(l=s[3])&&(this.typeIds=l)))}getValid(t){const{type:e}=this;if(Ct.isUnion(e)){const n=e,i=this.children[n.typeIdToChildIndex[this.typeIds[t]]],s=n.mode===jn.Dense?this.valueOffsets[t]:t;return i.getValid(s)}if(this.nullable&&this.nullCount>0){const n=this.offset+t;return(this.nullBitmap[n>>3]&1<>3;(!s||s.byteLength<=c)&&(s=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(s.set(ff(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:s})):Object.assign(this,{nullBitmap:s,_nullCount:0}));const h=s[c];n=(h&u)!==0,s[c]=e?h|u:h&~u}return n!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,n=this.length,i=this._nullCount,s=this,o=this.children){return new Ga(t,e,n,i,s,o,this.dictionary)}slice(t,e){const{stride:n,typeId:i,children:s}=this,o=+(this._nullCount===0)-1,a=i===16?n:1,l=this._sliceBuffers(t,e,n,i);return this.clone(this.type,this.offset+t,e,o,l,s.length===0||this.valueOffsets?s:this._sliceChildren(s,a*t,a*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===H.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:n}=this,i=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);i[e>>3]=(1<0&&i.set(ff(this.offset,e,this.nullBitmap),0);const s=this.buffers;return s[si.VALIDITY]=i,this.clone(this.type,0,t,n+(t-e),s)}_sliceBuffers(t,e,n,i){let s;const{buffers:o}=this;return(s=o[si.TYPE])&&(o[si.TYPE]=s.subarray(t,t+e)),(s=o[si.OFFSET])&&(o[si.OFFSET]=s.subarray(t,t+e+1))||(s=o[si.DATA])&&(o[si.DATA]=i===6?s:s.subarray(n*t,n*(t+e))),o}_sliceChildren(t,e,n){return t.map(i=>i.slice(e,n))}}Ga.prototype.children=Object.freeze([]);class Jy{constructor(t=0,e){this.numChunks=t,this.getChunkIterator=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndext.nullable)}function HN(r){return r.reduce((t,e)=>t+e.nullCount,0)}function XN(r){return r.reduce((t,e,n)=>(t[n+1]=t[n]+e.length,t),new Uint32Array(r.length+1))}function YN(r,t,e,n){const i=[];for(let s=-1,o=r.length;++s=n)break;if(e>=l+u)continue;if(l>=e&&l+u<=n){i.push(a);continue}const c=Math.max(0,e-l),h=Math.min(n-l,u);i.push(a.slice(c,h-c))}return i.length===0&&i.push(r[0].slice(0,0)),i}function Op(r,t,e,n){let i=0,s=0,o=t.length-1;do{if(i>=o-1)return e0?0:-1}function KN(r,t){const{nullBitmap:e}=r;if(!e||r.nullCount<=0)return-1;let n=0;for(const i of new fc(e,r.offset+(t||0),r.length,e,Cp)){if(!i)return n;++n}return-1}function Kt(r,t,e){if(t===void 0)return-1;if(t===null)switch(r.typeId){case H.Union:break;case H.Dictionary:break;default:return KN(r,e)}const n=on.getVisitFn(r),i=Ds(t);for(let s=(e||0)-1,o=r.length;++s{const i=r.data[n];return i.values.subarray(0,i.length)[Symbol.iterator]()});let e=0;return new Jy(r.data.length,n=>{const s=r.data[n].length,o=r.slice(e,e+s);return e+=s,new JN(o)})}class JN{constructor(t){this.vector=t,this.index=0}next(){return this.indexa.data):t;if(s.length===0||s.some(a=>!(a instanceof Ga)))throw new TypeError("Vector constructor expects an Array of Data instances.");const o=(e=s[0])===null||e===void 0?void 0:e.type;switch(s.length){case 0:this._offsets=[0];break;case 1:{const{get:a,set:l,indexOf:u}=gT[o.typeId],c=s[0];this.isValid=h=>fT(c,h),this.get=h=>a(c,h),this.set=(h,f)=>l(c,h,f),this.indexOf=h=>u(c,h),this._offsets=[0,c.length];break}default:Object.setPrototypeOf(this,yT[o.typeId]),this._offsets=XN(s);break}this.data=s,this.type=o,this.stride=mS(o),this.numChildren=(i=(n=o.children)===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullable(){return WN(this.data)}get nullCount(){return HN(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${H[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}at(t){return this.get(uT(t,this.length))}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}[Symbol.iterator](){return tB.visit(this)}concat(...t){return new er(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new er(lT(this,t,e,({data:n,_offsets:i},s,o)=>YN(n,i,s,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:n,stride:i,ArrayType:s}=this;switch(t.typeId){case H.Int:case H.Float:case H.Decimal:case H.Time:case H.Timestamp:switch(e.length){case 0:return new s;case 1:return e[0].values.subarray(0,n*i);default:return e.reduce((o,{values:a,length:l})=>(o.array.set(a.subarray(0,l*i),o.offset),o.offset+=l*i,o),{array:new s(n*i),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var e;return this.getChildAt((e=this.type.children)===null||e===void 0?void 0:e.findIndex(n=>n.name===t))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return Ct.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(Ct.isDictionary(this.type)){const t=new $u(this.data[0].dictionary),e=this.data.map(n=>{const i=n.clone();return i.dictionary=t,i});return new er(e)}return new $u(this)}unmemoize(){if(Ct.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(n=>{const i=n.clone();return i.dictionary=t,i});return new er(e)}return this}}mT=Symbol.toStringTag;er[mT]=(r=>{r.type=Ct.prototype,r.data=[],r.length=0,r.stride=1,r.numChildren=0,r._offsets=new Uint32Array([0]),r[Symbol.isConcatSpreadable]=!0;const t=Object.keys(H).map(e=>H[e]).filter(e=>typeof e=="number"&&e!==H.NONE);for(const e of t){const n=on.getVisitFnByTypeId(e),i=$n.getVisitFnByTypeId(e),s=ev.getVisitFnByTypeId(e);gT[e]={get:n,set:i,indexOf:s},yT[e]=Object.create(r,{isValid:{value:tv(fT)},get:{value:tv(on.getVisitFnByTypeId(e))},set:{value:qN($n.getVisitFnByTypeId(e))},indexOf:{value:QN(ev.getVisitFnByTypeId(e))}})}return"Vector"})(er.prototype);class $u extends er{constructor(t){super(t.data);const e=this.get,n=this.set,i=this.slice,s=new Array(this.length);Object.defineProperty(this,"get",{value(o){const a=s[o];if(a!==void 0)return a;const l=e.call(this,o);return s[o]=l,l}}),Object.defineProperty(this,"set",{value(o,a){n.call(this,o,a),s[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new $u(i.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new er(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}const eB=65536;function po(r){return r<0&&(r=4294967295+r+1),`0x${r.toString(16)}`}const Lo=8,Pp=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];class Rp{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){const e=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let i=e[3]*n[3];this.buffer[0]=i&65535;let s=i>>>16;return i=e[2]*n[3],s+=i,i=e[3]*n[2]>>>0,s+=i,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0>>16,this.buffer[1]+=e[1]*n[3]+e[2]*n[2]+e[3]*n[1],this.buffer[1]+=e[0]*n[3]+e[1]*n[2]+e[2]*n[1]+e[3]*n[0]<<16,this}_plus(t){const e=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],e>>0&&++this.buffer[1],this.buffer[0]=e}lessThan(t){return this.buffer[1]>>0,e[2]=this.buffer[2]+t.buffer[2]>>>0,e[1]=this.buffer[1]+t.buffer[1]>>>0,e[0]=this.buffer[0]+t.buffer[0]>>>0,e[0]>>0&&++e[1],e[1]>>0&&++e[2],e[2]>>0&&++e[3],this.buffer[3]=e[3],this.buffer[2]=e[2],this.buffer[1]=e[1],this.buffer[0]=e[0],this}hex(){return`${po(this.buffer[3])} ${po(this.buffer[2])} ${po(this.buffer[1])} ${po(this.buffer[0])}`}static multiply(t,e){return new En(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new En(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return En.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return En.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const n=t.startsWith("-"),i=t.length,s=new En(e);for(let o=n?1:0;othis.compareFields(n,e[i]))}compareFields(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&this.visit(t.type,e.type)}}function gr(r,t){return t instanceof r.constructor}function Ls(r,t){return r===t||gr(r,t)}function gi(r,t){return r===t||gr(r,t)&&r.bitWidth===t.bitWidth&&r.isSigned===t.isSigned}function pc(r,t){return r===t||gr(r,t)&&r.precision===t.precision}function nB(r,t){return r===t||gr(r,t)&&r.byteWidth===t.byteWidth}function Fp(r,t){return r===t||gr(r,t)&&r.unit===t.unit}function rl(r,t){return r===t||gr(r,t)&&r.unit===t.unit&&r.timezone===t.timezone}function nl(r,t){return r===t||gr(r,t)&&r.unit===t.unit&&r.bitWidth===t.bitWidth}function iB(r,t){return r===t||gr(r,t)&&r.children.length===t.children.length&&Gn.compareManyFields(r.children,t.children)}function sB(r,t){return r===t||gr(r,t)&&r.children.length===t.children.length&&Gn.compareManyFields(r.children,t.children)}function Dp(r,t){return r===t||gr(r,t)&&r.mode===t.mode&&r.typeIds.every((e,n)=>e===t.typeIds[n])&&Gn.compareManyFields(r.children,t.children)}function oB(r,t){return r===t||gr(r,t)&&r.id===t.id&&r.isOrdered===t.isOrdered&&Gn.visit(r.indices,t.indices)&&Gn.visit(r.dictionary,t.dictionary)}function Lp(r,t){return r===t||gr(r,t)&&r.unit===t.unit}function il(r,t){return r===t||gr(r,t)&&r.unit===t.unit}function aB(r,t){return r===t||gr(r,t)&&r.listSize===t.listSize&&r.children.length===t.children.length&&Gn.compareManyFields(r.children,t.children)}function lB(r,t){return r===t||gr(r,t)&&r.keysSorted===t.keysSorted&&r.children.length===t.children.length&&Gn.compareManyFields(r.children,t.children)}zt.prototype.visitNull=Ls;zt.prototype.visitBool=Ls;zt.prototype.visitInt=gi;zt.prototype.visitInt8=gi;zt.prototype.visitInt16=gi;zt.prototype.visitInt32=gi;zt.prototype.visitInt64=gi;zt.prototype.visitUint8=gi;zt.prototype.visitUint16=gi;zt.prototype.visitUint32=gi;zt.prototype.visitUint64=gi;zt.prototype.visitFloat=pc;zt.prototype.visitFloat16=pc;zt.prototype.visitFloat32=pc;zt.prototype.visitFloat64=pc;zt.prototype.visitUtf8=Ls;zt.prototype.visitLargeUtf8=Ls;zt.prototype.visitBinary=Ls;zt.prototype.visitLargeBinary=Ls;zt.prototype.visitFixedSizeBinary=nB;zt.prototype.visitDate=Fp;zt.prototype.visitDateDay=Fp;zt.prototype.visitDateMillisecond=Fp;zt.prototype.visitTimestamp=rl;zt.prototype.visitTimestampSecond=rl;zt.prototype.visitTimestampMillisecond=rl;zt.prototype.visitTimestampMicrosecond=rl;zt.prototype.visitTimestampNanosecond=rl;zt.prototype.visitTime=nl;zt.prototype.visitTimeSecond=nl;zt.prototype.visitTimeMillisecond=nl;zt.prototype.visitTimeMicrosecond=nl;zt.prototype.visitTimeNanosecond=nl;zt.prototype.visitDecimal=Ls;zt.prototype.visitList=iB;zt.prototype.visitStruct=sB;zt.prototype.visitUnion=Dp;zt.prototype.visitDenseUnion=Dp;zt.prototype.visitSparseUnion=Dp;zt.prototype.visitDictionary=oB;zt.prototype.visitInterval=Lp;zt.prototype.visitIntervalDayTime=Lp;zt.prototype.visitIntervalYearMonth=Lp;zt.prototype.visitDuration=il;zt.prototype.visitDurationSecond=il;zt.prototype.visitDurationMillisecond=il;zt.prototype.visitDurationMicrosecond=il;zt.prototype.visitDurationNanosecond=il;zt.prototype.visitFixedSizeList=aB;zt.prototype.visitMap=lB;const Gn=new zt;function uB(r,t){return Gn.compareSchemas(r,t)}function cB(r,t){return Gn.compareFields(r,t)}function hB(r,t){return Gn.visit(r,t)}const rv=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},VL),rB),$N),GL),NL),VN),UL),{compareSchemas:uB,compareFields:cB,compareTypes:hB}),vT=6048e5,dB=864e5,nv=Symbol.for("constructDateFrom");function ui(r,t){return typeof r=="function"?r(t):r&&typeof r=="object"&&nv in r?r[nv](t):r instanceof Date?new r.constructor(t):new Date(t)}function an(r,t){return ui(t||r,r)}let fB={};function mc(){return fB}function Wa(r,t){var a,l,u,c;const e=mc(),n=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,i=an(r,t==null?void 0:t.in),s=i.getDay(),o=(s=s.getTime()?n+1:e.getTime()>=a.getTime()?n:n-1}function iv(r){const t=an(r),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+r-+e}function pB(r,...t){const e=ui.bind(null,t.find(n=>typeof n=="object"));return t.map(e)}function sv(r,t){const e=an(r,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function mB(r,t,e){const[n,i]=pB(e==null?void 0:e.in,r,t),s=sv(n),o=sv(i),a=+s-iv(s),l=+o-iv(o);return Math.round((a-l)/dB)}function gB(r,t){const e=_T(r,t),n=ui(r,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),Gu(n)}function yB(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}function vB(r){return!(!yB(r)&&typeof r!="number"||isNaN(+an(r)))}function _B(r,t){const e=an(r,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const bB={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},wB=(r,t,e)=>{let n;const i=bB[r];return typeof i=="string"?n=i:t===1?n=i.one:n=i.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+n:n+" ago":n};function zh(r){return(t={})=>{const e=t.width?String(t.width):r.defaultWidth;return r.formats[e]||r.formats[r.defaultWidth]}}const xB={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},SB={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},TB={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},IB={date:zh({formats:xB,defaultWidth:"full"}),time:zh({formats:SB,defaultWidth:"full"}),dateTime:zh({formats:TB,defaultWidth:"full"})},EB={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},AB=(r,t,e,n)=>EB[r];function sa(r){return(t,e)=>{const n=e!=null&&e.context?String(e.context):"standalone";let i;if(n==="formatting"&&r.formattingValues){const o=r.defaultFormattingWidth||r.defaultWidth,a=e!=null&&e.width?String(e.width):o;i=r.formattingValues[a]||r.formattingValues[o]}else{const o=r.defaultWidth,a=e!=null&&e.width?String(e.width):r.defaultWidth;i=r.values[a]||r.values[o]}const s=r.argumentCallback?r.argumentCallback(t):t;return i[s]}}const MB={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},CB={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},OB={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},PB={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},RB={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},FB={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},DB=(r,t)=>{const e=Number(r),n=e%100;if(n>20||n<10)switch(n%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},LB={ordinalNumber:DB,era:sa({values:MB,defaultWidth:"wide"}),quarter:sa({values:CB,defaultWidth:"wide",argumentCallback:r=>r-1}),month:sa({values:OB,defaultWidth:"wide"}),day:sa({values:PB,defaultWidth:"wide"}),dayPeriod:sa({values:RB,defaultWidth:"wide",formattingValues:FB,defaultFormattingWidth:"wide"})};function oa(r){return(t,e={})=>{const n=e.width,i=n&&r.matchPatterns[n]||r.matchPatterns[r.defaultMatchWidth],s=t.match(i);if(!s)return null;const o=s[0],a=n&&r.parsePatterns[n]||r.parsePatterns[r.defaultParseWidth],l=Array.isArray(a)?BB(a,h=>h.test(o)):NB(a,h=>h.test(o));let u;u=r.valueCallback?r.valueCallback(l):l,u=e.valueCallback?e.valueCallback(u):u;const c=t.slice(o.length);return{value:u,rest:c}}}function NB(r,t){for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)&&t(r[e]))return e}function BB(r,t){for(let e=0;e{const n=t.match(r.matchPattern);if(!n)return null;const i=n[0],s=t.match(r.parsePattern);if(!s)return null;let o=r.valueCallback?r.valueCallback(s[0]):s[0];o=e.valueCallback?e.valueCallback(o):o;const a=t.slice(i.length);return{value:o,rest:a}}}const kB=/^(\d+)(th|st|nd|rd)?/i,zB=/\d+/i,VB={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},jB={any:[/^b/i,/^(a|c)/i]},$B={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},GB={any:[/1/i,/2/i,/3/i,/4/i]},WB={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},HB={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},XB={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},YB={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},qB={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},QB={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},ZB={ordinalNumber:UB({matchPattern:kB,parsePattern:zB,valueCallback:r=>parseInt(r,10)}),era:oa({matchPatterns:VB,defaultMatchWidth:"wide",parsePatterns:jB,defaultParseWidth:"any"}),quarter:oa({matchPatterns:$B,defaultMatchWidth:"wide",parsePatterns:GB,defaultParseWidth:"any",valueCallback:r=>r+1}),month:oa({matchPatterns:WB,defaultMatchWidth:"wide",parsePatterns:HB,defaultParseWidth:"any"}),day:oa({matchPatterns:XB,defaultMatchWidth:"wide",parsePatterns:YB,defaultParseWidth:"any"}),dayPeriod:oa({matchPatterns:qB,defaultMatchWidth:"any",parsePatterns:QB,defaultParseWidth:"any"})},KB={code:"en-US",formatDistance:wB,formatLong:IB,formatRelative:AB,localize:LB,match:ZB,options:{weekStartsOn:0,firstWeekContainsDate:1}};function JB(r,t){const e=an(r,t==null?void 0:t.in);return mB(e,_B(e))+1}function tU(r,t){const e=an(r,t==null?void 0:t.in),n=+Gu(e)-+gB(e);return Math.round(n/vT)+1}function bT(r,t){var c,h,f,d;const e=an(r,t==null?void 0:t.in),n=e.getFullYear(),i=mc(),s=(t==null?void 0:t.firstWeekContainsDate)??((h=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??i.firstWeekContainsDate??((d=(f=i.locale)==null?void 0:f.options)==null?void 0:d.firstWeekContainsDate)??1,o=ui((t==null?void 0:t.in)||r,0);o.setFullYear(n+1,0,s),o.setHours(0,0,0,0);const a=Wa(o,t),l=ui((t==null?void 0:t.in)||r,0);l.setFullYear(n,0,s),l.setHours(0,0,0,0);const u=Wa(l,t);return+e>=+a?n+1:+e>=+u?n:n-1}function eU(r,t){var a,l,u,c;const e=mc(),n=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,i=bT(r,t),s=ui((t==null?void 0:t.in)||r,0);return s.setFullYear(i,0,n),s.setHours(0,0,0,0),Wa(s,t)}function rU(r,t){const e=an(r,t==null?void 0:t.in),n=+Wa(e,t)-+eU(e,t);return Math.round(n/vT)+1}function we(r,t){const e=r<0?"-":"",n=Math.abs(r).toString().padStart(t,"0");return e+n}const xi={y(r,t){const e=r.getFullYear(),n=e>0?e:1-e;return we(t==="yy"?n%100:n,t.length)},M(r,t){const e=r.getMonth();return t==="M"?String(e+1):we(e+1,2)},d(r,t){return we(r.getDate(),t.length)},a(r,t){const e=r.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(r,t){return we(r.getHours()%12||12,t.length)},H(r,t){return we(r.getHours(),t.length)},m(r,t){return we(r.getMinutes(),t.length)},s(r,t){return we(r.getSeconds(),t.length)},S(r,t){const e=t.length,n=r.getMilliseconds(),i=Math.trunc(n*Math.pow(10,e-3));return we(i,t.length)}},Xs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ov={G:function(r,t,e){const n=r.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(n,{width:"abbreviated"});case"GGGGG":return e.era(n,{width:"narrow"});case"GGGG":default:return e.era(n,{width:"wide"})}},y:function(r,t,e){if(t==="yo"){const n=r.getFullYear(),i=n>0?n:1-n;return e.ordinalNumber(i,{unit:"year"})}return xi.y(r,t)},Y:function(r,t,e,n){const i=bT(r,n),s=i>0?i:1-i;if(t==="YY"){const o=s%100;return we(o,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):we(s,t.length)},R:function(r,t){const e=_T(r);return we(e,t.length)},u:function(r,t){const e=r.getFullYear();return we(e,t.length)},Q:function(r,t,e){const n=Math.ceil((r.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return we(n,2);case"Qo":return e.ordinalNumber(n,{unit:"quarter"});case"QQQ":return e.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(n,{width:"wide",context:"formatting"})}},q:function(r,t,e){const n=Math.ceil((r.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return we(n,2);case"qo":return e.ordinalNumber(n,{unit:"quarter"});case"qqq":return e.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(n,{width:"wide",context:"standalone"})}},M:function(r,t,e){const n=r.getMonth();switch(t){case"M":case"MM":return xi.M(r,t);case"Mo":return e.ordinalNumber(n+1,{unit:"month"});case"MMM":return e.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(n,{width:"wide",context:"formatting"})}},L:function(r,t,e){const n=r.getMonth();switch(t){case"L":return String(n+1);case"LL":return we(n+1,2);case"Lo":return e.ordinalNumber(n+1,{unit:"month"});case"LLL":return e.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(n,{width:"wide",context:"standalone"})}},w:function(r,t,e,n){const i=rU(r,n);return t==="wo"?e.ordinalNumber(i,{unit:"week"}):we(i,t.length)},I:function(r,t,e){const n=tU(r);return t==="Io"?e.ordinalNumber(n,{unit:"week"}):we(n,t.length)},d:function(r,t,e){return t==="do"?e.ordinalNumber(r.getDate(),{unit:"date"}):xi.d(r,t)},D:function(r,t,e){const n=JB(r);return t==="Do"?e.ordinalNumber(n,{unit:"dayOfYear"}):we(n,t.length)},E:function(r,t,e){const n=r.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(n,{width:"short",context:"formatting"});case"EEEE":default:return e.day(n,{width:"wide",context:"formatting"})}},e:function(r,t,e,n){const i=r.getDay(),s=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return we(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(i,{width:"short",context:"formatting"});case"eeee":default:return e.day(i,{width:"wide",context:"formatting"})}},c:function(r,t,e,n){const i=r.getDay(),s=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return we(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(i,{width:"narrow",context:"standalone"});case"cccccc":return e.day(i,{width:"short",context:"standalone"});case"cccc":default:return e.day(i,{width:"wide",context:"standalone"})}},i:function(r,t,e){const n=r.getDay(),i=n===0?7:n;switch(t){case"i":return String(i);case"ii":return we(i,t.length);case"io":return e.ordinalNumber(i,{unit:"day"});case"iii":return e.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(n,{width:"short",context:"formatting"});case"iiii":default:return e.day(n,{width:"wide",context:"formatting"})}},a:function(r,t,e){const i=r.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(r,t,e){const n=r.getHours();let i;switch(n===12?i=Xs.noon:n===0?i=Xs.midnight:i=n/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(r,t,e){const n=r.getHours();let i;switch(n>=17?i=Xs.evening:n>=12?i=Xs.afternoon:n>=4?i=Xs.morning:i=Xs.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(r,t,e){if(t==="ho"){let n=r.getHours()%12;return n===0&&(n=12),e.ordinalNumber(n,{unit:"hour"})}return xi.h(r,t)},H:function(r,t,e){return t==="Ho"?e.ordinalNumber(r.getHours(),{unit:"hour"}):xi.H(r,t)},K:function(r,t,e){const n=r.getHours()%12;return t==="Ko"?e.ordinalNumber(n,{unit:"hour"}):we(n,t.length)},k:function(r,t,e){let n=r.getHours();return n===0&&(n=24),t==="ko"?e.ordinalNumber(n,{unit:"hour"}):we(n,t.length)},m:function(r,t,e){return t==="mo"?e.ordinalNumber(r.getMinutes(),{unit:"minute"}):xi.m(r,t)},s:function(r,t,e){return t==="so"?e.ordinalNumber(r.getSeconds(),{unit:"second"}):xi.s(r,t)},S:function(r,t){return xi.S(r,t)},X:function(r,t,e){const n=r.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return lv(n);case"XXXX":case"XX":return hs(n);case"XXXXX":case"XXX":default:return hs(n,":")}},x:function(r,t,e){const n=r.getTimezoneOffset();switch(t){case"x":return lv(n);case"xxxx":case"xx":return hs(n);case"xxxxx":case"xxx":default:return hs(n,":")}},O:function(r,t,e){const n=r.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+av(n,":");case"OOOO":default:return"GMT"+hs(n,":")}},z:function(r,t,e){const n=r.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+av(n,":");case"zzzz":default:return"GMT"+hs(n,":")}},t:function(r,t,e){const n=Math.trunc(+r/1e3);return we(n,t.length)},T:function(r,t,e){return we(+r,t.length)}};function av(r,t=""){const e=r>0?"-":"+",n=Math.abs(r),i=Math.trunc(n/60),s=n%60;return s===0?e+String(i):e+String(i)+t+we(s,2)}function lv(r,t){return r%60===0?(r>0?"-":"+")+we(Math.abs(r)/60,2):hs(r,t)}function hs(r,t=""){const e=r>0?"-":"+",n=Math.abs(r),i=we(Math.trunc(n/60),2),s=we(n%60,2);return e+i+t+s}const uv=(r,t)=>{switch(r){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},wT=(r,t)=>{switch(r){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},nU=(r,t)=>{const e=r.match(/(P+)(p+)?/)||[],n=e[1],i=e[2];if(!i)return uv(r,t);let s;switch(n){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",uv(n,t)).replace("{{time}}",wT(i,t))},iU={p:wT,P:nU},sU=/^D+$/,oU=/^Y+$/,aU=["D","DD","YY","YYYY"];function lU(r){return sU.test(r)}function uU(r){return oU.test(r)}function cU(r,t,e){const n=hU(r,t,e);if(console.warn(n),aU.includes(r))throw new RangeError(n)}function hU(r,t,e){const n=r[0]==="Y"?"years":"days of the month";return`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${t}\`) for formatting ${n} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const dU=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,fU=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,pU=/^'([^]*?)'?$/,mU=/''/g,gU=/[a-zA-Z]/;function xT(r,t,e){var c,h,f,d;const n=mc(),i=n.locale??KB,s=n.firstWeekContainsDate??((h=(c=n.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??1,o=n.weekStartsOn??((d=(f=n.locale)==null?void 0:f.options)==null?void 0:d.weekStartsOn)??0,a=an(r,e==null?void 0:e.in);if(!vB(a))throw new RangeError("Invalid time value");let l=t.match(fU).map(m=>{const g=m[0];if(g==="p"||g==="P"){const p=iU[g];return p(m,i.formatLong)}return m}).join("").match(dU).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const g=m[0];if(g==="'")return{isToken:!1,value:yU(m)};if(ov[g])return{isToken:!0,value:m};if(g.match(gU))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:m}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:i};return l.map(m=>{if(!m.isToken)return m.value;const g=m.value;(uU(g)||lU(g))&&cU(g,t,String(r));const p=ov[g[0]];return p(a,g,i.localize,u)}).join("")}function yU(r){const t=r.match(pU);return t?t[1].replace(mU,"'"):r}function vU(r,t){return an(r*1e3,t==null?void 0:t.in)}function _U(r,t){const e=bU(t)?new t(0):ui(t,0);return e.setFullYear(r.getFullYear(),r.getMonth(),r.getDate()),e.setHours(r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()),e}function bU(r){var t;return typeof r=="function"&&((t=r.prototype)==null?void 0:t.constructor)===r}function wU(r,t){let e=r.length;switch("string"){case"string":{if(t.length!==1)throw new Error("The 'chars' parameter should be a single character string.");for(;e>0&&r[e-1]===t;)e--;break}}return r.substring(0,e)}function Tr(r){return r==null}function xU(r){return r!=null}async function pf(){if(typeof window<"u"&&window!==null)return"browser";try{const r=await Ai(()=>import("./__vite-browser-external-FmFgRqLi.js"),[]);return typeof r<"u"&&r.versions!=null&&r.versions.node!=null?"node":"unknown"}catch{return"unknown"}}function SU(r){return Tr(r)?!1:Ct.isInt(r.type)&&!ST(r)||TU(r)}function TU(r){return Tr(r)?!1:Ct.isInt(r.type)&&r.type.isSigned===!1}function IU(r){return Tr(r)?!1:Ct.isFloat(r.type)??!1}function EU(r){return Tr(r)?!1:Ct.isDecimal(r.type)}function AU(r){return Tr(r)?!1:Ct.isBool(r.type)}function MU(r){return Tr(r)?!1:Ct.isDuration(r.type)}function ST(r){return Tr(r)?!1:Ct.isInt(r.type)&&r.metadata.get("ARROW:extension:name")==="period"}function CU(r){return Tr(r)?!1:Ct.isTimestamp(r.type)}function OU(r){return Tr(r)?!1:Ct.isDate(r.type)}function PU(r){return Tr(r)?!1:Ct.isTime(r.type)}function RU(r){return Tr(r)?!1:Ct.isList(r.type)||Ct.isFixedSizeList(r.type)}function FU(r){return Tr(r)?!1:Ct.isStruct(r.type)||Ct.isMap(r.type)}function DU(r){return Tr(r)?!1:Ct.isStruct(r.type)&&r.metadata.get("ARROW:extension:name")==="interval"||Ct.isInterval(r.type)}function LU(r,t){let e;if(t===te.MILLISECOND)e=1e3;else if(t===te.MICROSECOND)e=1e3*1e3;else if(t===te.NANOSECOND)e=1e3*1e3*1e3;else return Number(r);return typeof r=="bigint"&&!Number.isSafeInteger(Number(r))?Number(r/BigInt(e)):Number(r)/e}function NU(r,t){var n;const e=LU(r,((n=t==null?void 0:t.type)==null?void 0:n.unit)??te.SECOND);return vU(e)}function BU(r,t){const e=NU(r,t);return xT(e,e.getMilliseconds()===0?"HH:mm:ss":"HH:mm:ss.SSS")}function UU(r){const t="yyyy-MM-dd";return r instanceof Date||typeof r=="number"&&Number.isFinite(r)?xT(r,t):(console.warn(`Unsupported date value: ${r}`),String(r))}function kU(r,t){var i;if(!(r instanceof Date||typeof r=="number"&&Number.isFinite(r)))return console.warn(`Unsupported datetime value: ${r}`),null;let e;const n=(i=t==null?void 0:t.type)==null?void 0:i.timezone;return typeof r=="number"?n?e=new Fr(r,n):e=new Fr(r):n?e=new Fr(r,n):e=new Fr(r),_U(e,Date)}function zU(r,t){var a;const e=((a=t==null?void 0:t.type)==null?void 0:a.scale)||0;let n=rv.bigNumToString(new rv.BN(r)).padStart(e,"0");if(e===0)return n;let i="";n.startsWith("-")&&(i="-",n=n.slice(1));const s=n.slice(0,-e)||"0",o=wU(n.slice(-e),"0")||"";return`${i}${s}${o?`.${o}`:""}`}function VU(r){const t=r[0],e=r[1],n=[];return t!==0&&n.push(`${t} year${t>1?"s":""}`),e!==0&&n.push(`${e} month${e>1?"s":""}`),n.length?n.join(" "):"0 months"}function jU(r,t){var n,i,s,o;if(Ct.isInterval(t==null?void 0:t.type))return VU(r);const e=t&&t.metadata.get("ARROW:extension:name");if(e&&e==="pandas.interval"){const a=JSON.parse(t.metadata.get("ARROW:extension:metadata")),{closed:l}=a,u=r.toJSON(),c=l==="both"||l==="left"?"[":"(",h=l==="both"||l==="right"?"]":")",f=mf(u.left,(i=(n=t.type)==null?void 0:n.children)==null?void 0:i[0]),d=mf(u.right,(o=(s=t.type)==null?void 0:s.children)==null?void 0:o[1]);return`${c+f}, ${d+h}`}return String(r)}function $U(r,t){return(t==null?void 0:t.type)instanceof hf?JSON.parse(JSON.stringify(r,(e,n)=>{if(xU(n))return typeof n=="bigint"?Number(n):n})):JSON.parse(JSON.stringify(r,(e,n)=>typeof n=="bigint"?Number(n):n))}function mf(r,t){if(Tr(r))return null;const e=r instanceof Date||Number.isFinite(r);if(e&&OU(t))return UU(r);if(typeof r=="bigint"&&PU(t))return BU(Number(r),t);if(e&&CU(t))return kU(r,t);if(ST(t))throw new Error("Period type is not supported yet");if(DU(t))return jU(r,t);if(MU(t))throw new Error("Duration type is not supported yet");return EU(t)?zU(r,t):IU(t)&&Number.isFinite(r)||SU(t)?r:FU(t)||RU(t)?$U(r,t):AU(t)?!!r:String(r)}function cv(r){return((r.toArray()||[]).map(n=>n.toJSON())||[]).map(n=>(r.schema.fields.forEach(i=>n[i.name]=mf(n[i.name],i)),n))}var Ha=(r=>(r.ORIGIN_PRIVATE_FS="origin-private-fs",r.NODE_FS="node-fs",r))(Ha||{});async function TT(r){const t=M1(r,{logger:!1});let e,n;const i=await pf();if(i==="browser"){if(typeof t.bundles>"u"){const{getBundles:l}=await Ai(async()=>{const{getBundles:u}=await import("./default-browser-BrgSDbLD.js");return{getBundles:u}},[]);t.bundles=await l()}n=await Ey(await t.bundles),e=new Worker(n.mainWorker)}else if(i==="node"){if(typeof t.bundles>"u"){const{getBundles:c}=await Ai(async()=>{const{getBundles:h}=await import("./default-node-p_ysqrIS.js");return{getBundles:h}},__vite__mapDeps([0,1,2]));t.bundles=await c()}n=await Ey(await t.bundles);let l=n.mainWorker;l.startsWith("/@fs/")&&(l=l.replace("/@fs/","file://"));const u=await Ai(()=>import("./index-Cp8iQ_hy.js"),[]);e=new u.default(l,{type:"module"})}else throw new Error(`Unsupported environment: ${i}`);let s;t.logger===!0?s=new Ux:t.logger===!1?s=new RD:s=t.logger;const o=new kD(s,e);if(await o.instantiate(n.mainModule,n.pthreadWorker),t.storage)switch(t.storage.type){case Ha.ORIGIN_PRIVATE_FS:{try{let l=t.storage.path;l.startsWith("/")&&(l=l.slice(1)),await o.open({path:`opfs://${l}`,accessMode:t.storage.accessMode})}catch(l){throw await o.terminate(),await e.terminate(),l}break}case Ha.NODE_FS:{try{await o.open({path:t.storage.path,accessMode:t.storage.accessMode,useDirectIO:!0})}catch(l){throw await o.terminate(),await e.terminate(),l}break}}const a=await o.connect();return{worker:e,db:o,conn:a,query:async(l,u=[])=>{if(!u||u.length===0){const d=await a.query(l);return cv(d)}const c=await a.prepare(l),h=await c.query(...u),f=cv(h);return c.close(),f},close:async()=>{await a.close(),await o.terminate(),await e.terminate()}}}async function GU(r,t){await(await r).conn.send("BEGIN TRANSACTION");try{const e=await t(r);return await(await r).conn.send("COMMIT"),e}catch(e){throw await(await r).conn.send("ROLLBACK"),e}}async function WU(r,t,e){await(await r).conn.send(`SAVEPOINT ${t}`);try{const n=await e(r);return await(await r).conn.send(`RELEASE SAVEPOINT ${t}`),n}catch(n){throw await(await r).conn.send(`ROLLBACK TO SAVEPOINT ${t}`),n}}const St=Symbol.for("drizzle:entityKind");function lt(r,t){if(!r||typeof r!="object")return!1;if(r instanceof t)return!0;if(!Object.prototype.hasOwnProperty.call(t,St))throw new Error(`Class "${t.name??""}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let e=Object.getPrototypeOf(r).constructor;if(e)for(;e;){if(St in e&&e[St]===t[St])return!0;e=Object.getPrototypeOf(e)}return!1}var wv;wv=St;class rr{constructor(t,e){W(this,"name");W(this,"keyAsName");W(this,"primary");W(this,"notNull");W(this,"default");W(this,"defaultFn");W(this,"onUpdateFn");W(this,"hasDefault");W(this,"isUnique");W(this,"uniqueName");W(this,"uniqueType");W(this,"dataType");W(this,"columnType");W(this,"enumValues");W(this,"generated");W(this,"generatedIdentity");W(this,"config");this.table=t,this.config=e,this.name=e.name,this.keyAsName=e.keyAsName,this.notNull=e.notNull,this.default=e.default,this.defaultFn=e.defaultFn,this.onUpdateFn=e.onUpdateFn,this.hasDefault=e.hasDefault,this.primary=e.primaryKey,this.isUnique=e.isUnique,this.uniqueName=e.uniqueName,this.uniqueType=e.uniqueType,this.dataType=e.dataType,this.columnType=e.columnType,this.generated=e.generated,this.generatedIdentity=e.generatedIdentity}mapFromDriverValue(t){return t}mapToDriverValue(t){return t}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}}W(rr,wv,"Column");const Eo=Symbol.for("drizzle:Name");function HU(r,t){return`${r[Eo]}_${t.join("_")}_unique`}var xv,Sv;class Lr extends(Sv=rr,xv=St,Sv){constructor(t,e){e.uniqueName||(e.uniqueName=HU(t,[e.name])),super(t,e),this.table=t}}W(Lr,xv,"PgColumn");const hv=Symbol.for("drizzle:isPgEnum");function XU(r){return!!r&&typeof r=="function"&&hv in r&&r[hv]===!0}var Tv;Tv=St;class Nr{constructor(t,e,n,i=!1){this._={brand:"Subquery",sql:t,selectedFields:e,alias:n,isWith:i}}}W(Nr,Tv,"Subquery");var Iv,Ev;class Np extends(Ev=Nr,Iv=St,Ev){}W(Np,Iv,"WithSubquery");const Ur={startActiveSpan(r,t){return t()}},Qe=Symbol.for("drizzle:ViewBaseConfig"),Kl=Symbol.for("drizzle:Schema"),gf=Symbol.for("drizzle:Columns"),dv=Symbol.for("drizzle:ExtraConfigColumns"),Vh=Symbol.for("drizzle:OriginalName"),jh=Symbol.for("drizzle:BaseName"),Wu=Symbol.for("drizzle:IsAlias"),fv=Symbol.for("drizzle:ExtraConfigBuilder"),YU=Symbol.for("drizzle:IsDrizzleTable");var Av,Mv,Cv,Ov,Pv,Rv,Fv,Dv,Lv,Nv;Nv=St,Lv=Eo,Dv=Vh,Fv=Kl,Rv=gf,Pv=dv,Ov=jh,Cv=Wu,Mv=YU,Av=fv;class It{constructor(t,e,n){W(this,Lv);W(this,Dv);W(this,Fv);W(this,Rv);W(this,Pv);W(this,Ov);W(this,Cv,!1);W(this,Mv,!0);W(this,Av);this[Eo]=this[Vh]=t,this[Kl]=e,this[jh]=n}}W(It,Nv,"Table"),W(It,"Symbol",{Name:Eo,Schema:Kl,OriginalName:Vh,Columns:gf,ExtraConfigColumns:dv,BaseName:jh,IsAlias:Wu,ExtraConfigBuilder:fv});function vs(r){return r[Eo]}function Xa(r){return`${r[Kl]??"public"}.${r[Eo]}`}function IT(r){return r!=null&&typeof r.getSQL=="function"}function qU(r){var e;const t={sql:"",params:[]};for(const n of r)t.sql+=n.sql,t.params.push(...n.params),(e=n.typings)!=null&&e.length&&(t.typings||(t.typings=[]),t.typings.push(...n.typings));return t}var Bv;Bv=St;class Ze{constructor(t){W(this,"value");this.value=Array.isArray(t)?t:[t]}getSQL(){return new Pt([this])}}W(Ze,Bv,"StringChunk");var Uv;Uv=St;const ps=class ps{constructor(t){W(this,"decoder",ET);W(this,"shouldInlineParams",!1);this.queryChunks=t}append(t){return this.queryChunks.push(...t.queryChunks),this}toQuery(t){return Ur.startActiveSpan("drizzle.buildSQL",e=>{const n=this.buildQueryFromSourceParams(this.queryChunks,t);return e==null||e.setAttributes({"drizzle.query.text":n.sql,"drizzle.query.params":JSON.stringify(n.params)}),n})}buildQueryFromSourceParams(t,e){const n=Object.assign({},e,{inlineParams:e.inlineParams||this.shouldInlineParams,paramStartIndex:e.paramStartIndex||{value:0}}),{casing:i,escapeName:s,escapeParam:o,prepareTyping:a,inlineParams:l,paramStartIndex:u}=n;return qU(t.map(c=>{var h;if(lt(c,Ze))return{sql:c.value.join(""),params:[]};if(lt(c,Hu))return{sql:s(c.value),params:[]};if(c===void 0)return{sql:"",params:[]};if(Array.isArray(c)){const f=[new Ze("(")];for(const[d,m]of c.entries())f.push(m),dr},AT={mapToDriverValue:r=>r};({...ET,...AT});var zv;zv=St;class ci{constructor(t,e=AT){W(this,"brand");this.value=t,this.encoder=e}getSQL(){return new Pt([this])}}W(ci,zv,"Param");function Y(r,...t){const e=[];(t.length>0||r.length>0&&r[0]!=="")&&e.push(new Ze(r[0]));for(const[n,i]of t.entries())e.push(i,new Ze(r[n+1]));return new Pt(e)}(r=>{function t(){return new Pt([])}r.empty=t;function e(l){return new Pt(l)}r.fromList=e;function n(l){return new Pt([new Ze(l)])}r.raw=n;function i(l,u){const c=[];for(const[h,f]of l.entries())h>0&&u!==void 0&&c.push(u),c.push(f);return new Pt(c)}r.join=i;function s(l){return new Hu(l)}r.identifier=s;function o(l){return new Ms(l)}r.placeholder=o;function a(l,u){return new ci(l,u)}r.param=a})(Y||(Y={}));(r=>{var e;e=St;const n=class n{constructor(s,o){W(this,"isSelectionField",!1);this.sql=s,this.fieldAlias=o}getSQL(){return this.sql}clone(){return new n(this.sql,this.fieldAlias)}};W(n,e,"SQL.Aliased");let t=n;r.Aliased=t})(Pt||(Pt={}));var Vv;Vv=St;class Ms{constructor(t){this.name=t}getSQL(){return new Pt([this])}}W(Ms,Vv,"Placeholder");function pv(r,t){return r.map(e=>{if(lt(e,Ms)){if(!(e.name in t))throw new Error(`No value for placeholder "${e.name}" was provided`);return t[e.name]}if(lt(e,ci)&<(e.value,Ms)){if(!(e.value.name in t))throw new Error(`No value for placeholder "${e.value.name}" was provided`);return e.encoder.mapToDriverValue(t[e.value.name])}return e})}const ZU=Symbol.for("drizzle:IsDrizzleView");var jv,$v,Gv;Gv=St,$v=Qe,jv=ZU;class ji{constructor({name:t,schema:e,selectedFields:n,query:i}){W(this,$v);W(this,jv,!0);this[Qe]={name:t,originalName:t,schema:e,selectedFields:n,query:i,isExisting:!i,isAlias:!1}}getSQL(){return new Pt([this])}}W(ji,Gv,"View");rr.prototype.getSQL=function(){return new Pt([this])};It.prototype.getSQL=function(){return new Pt([this])};Nr.prototype.getSQL=function(){return new Pt([this])};var Wv;Wv=St;class Ya{constructor(t){this.table=t}get(t,e){return e==="table"?this.table:t[e]}}W(Ya,Wv,"ColumnAliasProxyHandler");var Hv;Hv=St;class gc{constructor(t,e){this.alias=t,this.replaceOriginalName=e}get(t,e){if(e===It.Symbol.IsAlias)return!0;if(e===It.Symbol.Name)return this.alias;if(this.replaceOriginalName&&e===It.Symbol.OriginalName)return this.alias;if(e===Qe)return{...t[Qe],name:this.alias,isAlias:!0};if(e===It.Symbol.Columns){const i=t[It.Symbol.Columns];if(!i)return i;const s={};return Object.keys(i).map(o=>{s[o]=new Proxy(i[o],new Ya(new Proxy(t,this)))}),s}const n=t[e];return lt(n,rr)?new Proxy(n,new Ya(new Proxy(t,this))):n}}W(gc,Hv,"TableAliasProxyHandler");function $h(r,t){return new Proxy(r,new gc(t,!1))}function ei(r,t){return new Proxy(r,new Ya(new Proxy(r.table,new gc(t,!1))))}function MT(r,t){return new Pt.Aliased(Xu(r.sql,t),r.fieldAlias)}function Xu(r,t){return Y.join(r.queryChunks.map(e=>lt(e,rr)?ei(e,t):lt(e,Pt)?Xu(e,t):lt(e,Pt.Aliased)?MT(e,t):e))}var Xv,Yv;class Bp extends(Yv=Error,Xv=St,Yv){constructor({message:t,cause:e}){super(t),this.name="DrizzleError",this.cause=e}}W(Bp,Xv,"DrizzleError");var qv,Qv;class CT extends(Qv=Bp,qv=St,Qv){constructor(){super({message:"Rollback"})}}W(CT,qv,"TransactionRollbackError");function Sr(r,t){return QU(t)&&!IT(r)&&!lt(r,ci)&&!lt(r,Ms)&&!lt(r,rr)&&!lt(r,It)&&!lt(r,ji)?new ci(r,t):r}const OT=(r,t)=>Y`${r} = ${Sr(t,r)}`,KU=(r,t)=>Y`${r} <> ${Sr(t,r)}`;function yf(...r){const t=r.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Pt(t):new Pt([new Ze("("),Y.join(t,new Ze(" and ")),new Ze(")")])}function JU(...r){const t=r.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Pt(t):new Pt([new Ze("("),Y.join(t,new Ze(" or ")),new Ze(")")])}function tk(r){return Y`not ${r}`}const ek=(r,t)=>Y`${r} > ${Sr(t,r)}`,rk=(r,t)=>Y`${r} >= ${Sr(t,r)}`,nk=(r,t)=>Y`${r} < ${Sr(t,r)}`,ik=(r,t)=>Y`${r} <= ${Sr(t,r)}`;function sk(r,t){return Array.isArray(t)?t.length===0?Y`false`:Y`${r} in ${t.map(e=>Sr(e,r))}`:Y`${r} in ${Sr(t,r)}`}function ok(r,t){return Array.isArray(t)?t.length===0?Y`true`:Y`${r} not in ${t.map(e=>Sr(e,r))}`:Y`${r} not in ${Sr(t,r)}`}function ak(r){return Y`${r} is null`}function lk(r){return Y`${r} is not null`}function uk(r){return Y`exists ${r}`}function ck(r){return Y`not exists ${r}`}function hk(r,t,e){return Y`${r} between ${Sr(t,r)} and ${Sr(e,r)}`}function dk(r,t,e){return Y`${r} not between ${Sr(t,r)} and ${Sr(e,r)}`}function fk(r,t){return Y`${r} like ${t}`}function pk(r,t){return Y`${r} not like ${t}`}function mk(r,t){return Y`${r} ilike ${t}`}function gk(r,t){return Y`${r} not ilike ${t}`}function yk(r){return Y`${r} asc`}function vk(r){return Y`${r} desc`}var Zv;Zv=St;class PT{write(t){console.log(t)}}W(PT,Zv,"ConsoleLogWriter");var Kv;Kv=St;class RT{constructor(t){W(this,"writer");this.writer=(t==null?void 0:t.writer)??new PT}logQuery(t,e){const n=e.map(s=>{try{return JSON.stringify(s)}catch{return String(s)}}),i=n.length?` -- params: [${n.join(", ")}]`:"";this.writer.write(`Query: ${t}${i}`)}}W(RT,Kv,"DefaultLogger");var Jv;Jv=St;class FT{logQuery(){}}W(FT,Jv,"NoopLogger");var t_,e_;e_=St,t_=Symbol.toStringTag;class $i{constructor(){W(this,t_,"QueryPromise")}catch(t){return this.then(void 0,t)}finally(t){return this.then(e=>(t==null||t(),e),e=>{throw t==null||t(),e})}then(t,e){return this.execute().then(t,e)}}W($i,e_,"QueryPromise");function Cs(r,t){return Object.entries(r).reduce((e,[n,i])=>{if(typeof n!="string")return e;const s=t?[...t,n]:[n];return lt(i,rr)||lt(i,Pt)||lt(i,Pt.Aliased)?e.push({path:s,field:i}):lt(i,It)?e.push(...Cs(i[It.Symbol.Columns],s)):e.push(...Cs(i,s)),e},[])}function Up(r,t){const e=Object.keys(r),n=Object.keys(t);if(e.length!==n.length)return!1;for(const[i,s]of e.entries())if(s!==n[i])return!1;return!0}function DT(r,t){const e=Object.entries(t).filter(([,n])=>n!==void 0).map(([n,i])=>lt(i,Pt)||lt(i,rr)?[n,i]:[n,new ci(i,r[It.Symbol.Columns][n])]);if(e.length===0)throw new Error("No values to set");return Object.fromEntries(e)}function _k(r,t){for(const e of t)for(const n of Object.getOwnPropertyNames(e.prototype))n!=="constructor"&&Object.defineProperty(r.prototype,n,Object.getOwnPropertyDescriptor(e.prototype,n)||Object.create(null))}function bk(r){return r[It.Symbol.Columns]}function fs(r){return lt(r,Nr)?r._.alias:lt(r,ji)?r[Qe].name:lt(r,Pt)?void 0:r[It.Symbol.IsAlias]?r[It.Symbol.Name]:r[It.Symbol.BaseName]}function wk(r){if(typeof r!="object"||r===null||r.constructor.name!=="Object")return!1;if("logger"in r){const t=typeof r.logger;return!(t!=="boolean"&&(t!=="object"||typeof r.logger.logQuery!="function")&&t!=="undefined")}if("schema"in r){const t=typeof r.schema;return!(t!=="object"&&t!=="undefined")}if("casing"in r){const t=typeof r.casing;return!(t!=="string"&&t!=="undefined")}if("mode"in r)return!(r.mode!=="default"||r.mode!=="planetscale"||r.mode!==void 0);if("connection"in r){const t=typeof r.connection;return!(t!=="string"&&t!=="object"&&t!=="undefined")}if("client"in r){const t=typeof r.client;return!(t!=="object"&&t!=="function"&&t!=="undefined")}return Object.keys(r).length===0}var r_,n_;class LT extends(n_=Lr,r_=St,n_){getSQLType(){return"date"}mapFromDriverValue(t){return new Date(t)}mapToDriverValue(t){return t.toISOString()}}W(LT,r_,"PgDate");var i_,s_;class NT extends(s_=Lr,i_=St,s_){getSQLType(){return"date"}}W(NT,i_,"PgDateString");var o_,a_;class BT extends(a_=Lr,o_=St,a_){constructor(t,e){super(t,e)}getSQLType(){return"json"}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}}W(BT,o_,"PgJson");var l_,u_;class UT extends(u_=Lr,l_=St,u_){constructor(t,e){super(t,e)}getSQLType(){return"jsonb"}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}}W(UT,l_,"PgJsonb");var c_,h_;class kT extends(h_=Lr,c_=St,h_){constructor(e,n){super(e,n);W(this,"precision");W(this,"scale");this.precision=n.precision,this.scale=n.scale}mapFromDriverValue(e){return typeof e=="string"?e:String(e)}getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?"numeric":`numeric(${this.precision})`}}W(kT,c_,"PgNumeric");var d_,f_;class zT extends(f_=Lr,d_=St,f_){constructor(e,n){super(e,n);W(this,"withTimezone");W(this,"precision");this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`time${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}W(zT,d_,"PgTime");var p_,m_;class VT extends(m_=Lr,p_=St,m_){constructor(e,n){super(e,n);W(this,"withTimezone");W(this,"precision");W(this,"mapFromDriverValue",e=>new Date(this.withTimezone?e:e+"+0000"));W(this,"mapToDriverValue",e=>e.toISOString());this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`timestamp${this.precision===void 0?"":` (${this.precision})`}${this.withTimezone?" with time zone":""}`}}W(VT,p_,"PgTimestamp");var g_,y_;class jT extends(y_=Lr,g_=St,y_){constructor(e,n){super(e,n);W(this,"withTimezone");W(this,"precision");this.withTimezone=n.withTimezone,this.precision=n.precision}getSQLType(){return`timestamp${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}W(jT,g_,"PgTimestampString");var v_,__;class $T extends(__=Lr,v_=St,__){getSQLType(){return"uuid"}}W($T,v_,"PgUUID");const mv=Symbol.for("drizzle:PgInlineForeignKeys"),gv=Symbol.for("drizzle:EnableRLS");var b_,w_,x_,S_,T_,I_;class Xr extends(I_=It,T_=St,S_=mv,x_=gv,w_=It.Symbol.ExtraConfigBuilder,b_=It.Symbol.ExtraConfigColumns,I_){constructor(){super(...arguments);W(this,S_,[]);W(this,x_,!1);W(this,w_);W(this,b_,{})}}W(Xr,T_,"PgTable"),W(Xr,"Symbol",Object.assign({},It.Symbol,{InlineForeignKeys:mv,EnableRLS:gv}));var E_;E_=St;class GT{constructor(t,e){W(this,"columns");W(this,"name");this.columns=t,this.name=e}build(t){return new WT(t,this.columns,this.name)}}W(GT,E_,"PgPrimaryKeyBuilder");var A_;A_=St;class WT{constructor(t,e,n){W(this,"columns");W(this,"name");this.table=t,this.columns=e,this.name=n}getName(){return this.name??`${this.table[Xr.Symbol.Name]}_${this.columns.map(t=>t.name).join("_")}_pk`}}W(WT,A_,"PgPrimaryKey");var M_;M_=St;class kp{constructor(t,e,n){W(this,"referencedTableName");W(this,"fieldName");this.sourceTable=t,this.referencedTable=e,this.relationName=n,this.referencedTableName=e[It.Symbol.Name]}}W(kp,M_,"Relation");var C_;C_=St;class HT{constructor(t,e){this.table=t,this.config=e}}W(HT,C_,"Relations");var O_,P_;const Qu=class Qu extends(P_=kp,O_=St,P_){constructor(t,e,n,i){super(t,e,n==null?void 0:n.relationName),this.config=n,this.isNullable=i}withFieldName(t){const e=new Qu(this.sourceTable,this.referencedTable,this.config,this.isNullable);return e.fieldName=t,e}};W(Qu,O_,"One");let Os=Qu;var R_,F_;const Zu=class Zu extends(F_=kp,R_=St,F_){constructor(t,e,n){super(t,e,n==null?void 0:n.relationName),this.config=n}withFieldName(t){const e=new Zu(this.sourceTable,this.referencedTable,this.config);return e.fieldName=t,e}};W(Zu,R_,"Many");let Yu=Zu;function xk(){return{and:yf,between:hk,eq:OT,exists:uk,gt:ek,gte:rk,ilike:mk,inArray:sk,isNull:ak,isNotNull:lk,like:fk,lt:nk,lte:ik,ne:KU,not:tk,notBetween:dk,notExists:ck,notLike:pk,notIlike:gk,notInArray:ok,or:JU,sql:Y}}function Sk(){return{sql:Y,asc:yk,desc:vk}}function Tk(r,t){var s;Object.keys(r).length===1&&"default"in r&&!lt(r.default,It)&&(r=r.default);const e={},n={},i={};for(const[o,a]of Object.entries(r))if(lt(a,It)){const l=Xa(a),u=n[l];e[l]=o,i[o]={tsName:o,dbName:a[It.Symbol.Name],schema:a[It.Symbol.Schema],columns:a[It.Symbol.Columns],relations:(u==null?void 0:u.relations)??{},primaryKey:(u==null?void 0:u.primaryKey)??[]};for(const h of Object.values(a[It.Symbol.Columns]))h.primary&&i[o].primaryKey.push(h);const c=(s=a[It.Symbol.ExtraConfigBuilder])==null?void 0:s.call(a,a[It.Symbol.ExtraConfigColumns]);if(c)for(const h of Object.values(c))lt(h,GT)&&i[o].primaryKey.push(...h.columns)}else if(lt(a,HT)){const l=Xa(a.table),u=e[l],c=a.config(t(a.table));let h;for(const[f,d]of Object.entries(c))if(u){const m=i[u];m.relations[f]=d}else l in n||(n[l]={relations:{},primaryKey:h}),n[l].relations[f]=d}return{tables:i,tableNamesMap:e}}function Ik(r){return function(e,n){return new Os(r,e,n,(n==null?void 0:n.fields.reduce((i,s)=>i&&s.notNull,!0))??!1)}}function Ek(r){return function(e,n){return new Yu(r,e,n)}}function Ak(r,t,e){if(lt(e,Os)&&e.config)return{fields:e.config.fields,references:e.config.references};const n=t[Xa(e.referencedTable)];if(!n)throw new Error(`Table "${e.referencedTable[It.Symbol.Name]}" not found in schema`);const i=r[n];if(!i)throw new Error(`Table "${n}" not found in schema`);const s=e.sourceTable,o=t[Xa(s)];if(!o)throw new Error(`Table "${s[It.Symbol.Name]}" not found in schema`);const a=[];for(const l of Object.values(i.relations))(e.relationName&&e!==l&&l.relationName===e.relationName||!e.relationName&&l.referencedTable===e.sourceTable)&&a.push(l);if(a.length>1)throw e.relationName?new Error(`There are multiple relations with name "${e.relationName}" in table "${n}"`):new Error(`There are multiple relations between "${n}" and "${e.sourceTable[It.Symbol.Name]}". Please specify relation name`);if(a[0]&<(a[0],Os)&&a[0].config)return{fields:a[0].config.references,references:a[0].config.fields};throw new Error(`There is not enough information to infer relation "${o}.${e.fieldName}"`)}function Mk(r){return{one:Ik(r),many:Ek(r)}}function vf(r,t,e,n,i=s=>s){const s={};for(const[o,a]of n.entries())if(a.isJson){const l=t.relations[a.tsKey],u=e[o],c=typeof u=="string"?JSON.parse(u):u;s[a.tsKey]=lt(l,Os)?c&&vf(r,r[a.relationTableTsKey],c,a.selection,i):c.map(h=>vf(r,r[a.relationTableTsKey],h,a.selection,i))}else{const l=i(e[o]),u=a.field;let c;lt(u,rr)?c=u:lt(u,Pt)?c=u.decoder:c=u.sql.decoder,s[a.tsKey]=l===null?null:c.mapFromDriverValue(l)}return s}var D_;D_=St;const Ku=class Ku{constructor(t){W(this,"config");this.config={...t}}get(t,e){if(e==="_")return{...t._,selectedFields:new Proxy(t._.selectedFields,this)};if(e===Qe)return{...t[Qe],selectedFields:new Proxy(t[Qe].selectedFields,this)};if(typeof e=="symbol")return t[e];const i=(lt(t,Nr)?t._.selectedFields:lt(t,ji)?t[Qe].selectedFields:t)[e];if(lt(i,Pt.Aliased)){if(this.config.sqlAliasedBehavior==="sql"&&!i.isSelectionField)return i.sql;const s=i.clone();return s.isSelectionField=!0,s}if(lt(i,Pt)){if(this.config.sqlBehavior==="sql")return i;throw new Error(`You tried to reference "${e}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`)}return lt(i,rr)?this.config.alias?new Proxy(i,new Ya(new Proxy(i.table,new gc(this.config.alias,this.config.replaceOriginalName??!1)))):i:typeof i!="object"||i===null?i:new Proxy(i,new Ku(this.config))}};W(Ku,D_,"SelectionProxyHandler");let or=Ku;var L_,N_;class _f extends(N_=$i,L_=St,N_){constructor(e,n,i,s){super();W(this,"config");W(this,"authToken");W(this,"execute",e=>Ur.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=n,this.dialect=i,this.config={table:e,withList:s}}where(e){return this.config.where=e,this}returning(e=this.config.table[It.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=Cs(e),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}_prepare(e){return Ur.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0))}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new or({alias:vs(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}W(_f,L_,"PgDelete");function Ck(r){return(r.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map(e=>e.toLowerCase()).join("_")}function Ok(r){return(r.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((e,n,i)=>{const s=i===0?n.toLowerCase():`${n[0].toUpperCase()}${n.slice(1)}`;return e+s},"")}function Pk(r){return r}var B_;B_=St;class XT{constructor(t){W(this,"cache",{});W(this,"cachedTables",{});W(this,"convert");this.convert=t==="snake_case"?Ck:t==="camelCase"?Ok:Pk}getColumnCasing(t){if(!t.keyAsName)return t.name;const e=t.table[It.Symbol.Schema]??"public",n=t.table[It.Symbol.OriginalName],i=`${e}.${n}.${t.name}`;return this.cache[i]||this.cacheTable(t.table),this.cache[i]}cacheTable(t){const e=t[It.Symbol.Schema]??"public",n=t[It.Symbol.OriginalName],i=`${e}.${n}`;if(!this.cachedTables[i]){for(const s of Object.values(t[It.Symbol.Columns])){const o=`${i}.${s.name}`;this.cache[o]=this.convert(s.name)}this.cachedTables[i]=!0}}clearCache(){this.cache={},this.cachedTables={}}}W(XT,B_,"CasingCache");var U_,k_;class zp extends(k_=ji,U_=St,k_){}W(zp,U_,"PgViewBase");var z_;z_=St;class Ea{constructor(t){W(this,"casing");this.casing=new XT(t==null?void 0:t.casing)}async migrate(t,e,n){const i=typeof n=="string"?"__drizzle_migrations":n.migrationsTable??"__drizzle_migrations",s=typeof n=="string"?"drizzle":n.migrationsSchema??"drizzle",o=Y` CREATE TABLE IF NOT EXISTS ${Y.identifier(s)}.${Y.identifier(i)} ( id SERIAL PRIMARY KEY, hash text NOT NULL, created_at bigint ) - `;await e.execute(Y`CREATE SCHEMA IF NOT EXISTS ${Y.identifier(s)}`),await e.execute(o);const l=(await e.all(Y`select id, hash, created_at from ${Y.identifier(s)}.${Y.identifier(i)} order by created_at desc limit 1`))[0];await e.transaction(async u=>{for await(const c of t)if(!l||Number(l.created_at){var a;return e[o]!==void 0||((a=n[o])==null?void 0:a.onUpdateFn)!==void 0}),s=i.length;return Y.join(i.flatMap((o,a)=>{const l=n[o],u=e[o]??Y.param(l.onUpdateFn(),l),c=Y`${Y.identifier(this.casing.getColumnCasing(l))} = ${u}`;return a{const a=[];if(lt(s,Pt.Aliased)&&s.isSelectionField)a.push(Y.identifier(s.fieldAlias));else if(lt(s,Pt.Aliased)||lt(s,Pt)){const l=lt(s,Pt.Aliased)?s.sql:s;e?a.push(new Pt(l.queryChunks.map(u=>lt(u,Lr)?Y.identifier(this.casing.getColumnCasing(u)):u))):a.push(l),lt(s,Pt.Aliased)&&a.push(Y` as ${Y.identifier(s.fieldAlias)}`)}else lt(s,rr)&&(e?a.push(Y.identifier(this.casing.getColumnCasing(s))):a.push(s));return oa==null?void 0:a.some(({alias:P})=>P===(nt[It.Symbol.IsAlias]?vs(nt):nt[It.Symbol.BaseName])))(x.field.table)){const nt=vs(x.field.table);throw new Error(`Your "${x.path.join("->")}" field references a column "${nt}"."${x.field.name}", but the table "${nt}" is not part of the query! Did you forget to join it?`)}const p=!a||a.length===0,y=this.buildWithCTE(t);let _;d&&(_=d===!0?Y` distinct`:Y` distinct on (${Y.join(d.on,Y`, `)})`);const S=this.buildSelection(g,{isSingleTable:p}),T=this.buildFromTable(o),v=this.buildJoins(a),E=i?Y` where ${i}`:void 0,w=s?Y` having ${s}`:void 0;let B;l&&l.length>0&&(B=Y` order by ${Y.join(l,Y`, `)}`);let L;u&&u.length>0&&(L=Y` group by ${Y.join(u,Y`, `)}`);const $=typeof c=="object"||typeof c=="number"&&c>=0?Y` limit ${c}`:void 0,it=h?Y` offset ${h}`:void 0,I=Y.empty();if(f){const x=Y` for ${Y.raw(f.strength)}`;f.config.of&&x.append(Y` of ${Y.join(Array.isArray(f.config.of)?f.config.of:[f.config.of],Y`, `)}`),f.config.noWait?x.append(Y` no wait`):f.config.skipLocked&&x.append(Y` skip locked`),I.append(x)}const Z=Y`${y}select${_} ${S} from ${T}${v}${E}${L}${w}${B}${$}${it}${I}`;return m.length>0?this.buildSetOperations(Z,m):Z}buildSetOperations(t,e){const[n,...i]=e;if(!n)throw new Error("Cannot pass undefined values to any set operator");return i.length===0?this.buildSetOperationQuery({leftSelect:t,setOperator:n}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:t,setOperator:n}),i)}buildSetOperationQuery({leftSelect:t,setOperator:{type:e,isAll:n,rightSelect:i,limit:s,orderBy:o,offset:a}}){const l=Y`(${t.getSQL()}) `,u=Y`(${i.getSQL()})`;let c;if(o&&o.length>0){const m=[];for(const g of o)if(lt(g,Lr))m.push(Y.identifier(g.name));else if(lt(g,Pt)){for(let p=0;p=0?Y` limit ${s}`:void 0,f=Y.raw(`${e} ${n?"all ":""}`),d=a?Y` offset ${a}`:void 0;return Y`${l}${f}${u}${c}${h}${d}`}buildInsertQuery({table:t,values:e,onConflict:n,returning:i,withList:s,select:o,overridingSystemValue_:a}){const l=[],u=t[It.Symbol.Columns],c=Object.entries(u).filter(([y,_])=>!_.shouldDisableInsert()),h=c.map(([,y])=>Y.identifier(this.casing.getColumnCasing(y)));if(o){const y=e;lt(y,Pt)?l.push(y):l.push(y.getSQL())}else{const y=e;l.push(Y.raw("values "));for(const[_,S]of y.entries()){const T=[];for(const[v,E]of c){const w=S[v];if(w===void 0||lt(w,ci)&&w.value===void 0)if(E.defaultFn!==void 0){const B=E.defaultFn(),L=lt(B,Pt)?B:Y.param(B,E);T.push(L)}else if(!E.default&&E.onUpdateFn!==void 0){const B=E.onUpdateFn(),L=lt(B,Pt)?B:Y.param(B,E);T.push(L)}else T.push(Y`default`);else T.push(w)}l.push(T),_({dbKey:S.name,tsKey:_,field:ei(S,a),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{const y=Object.fromEntries(Object.entries(s.columns).map(([w,B])=>[w,ei(B,a)]));if(o.where){const w=typeof o.where=="function"?o.where(y,xk()):o.where;m=w&&Xu(w,a)}const _=[];let S=[];if(o.columns){let w=!1;for(const[B,L]of Object.entries(o.columns))L!==void 0&&B in s.columns&&(!w&&L===!0&&(w=!0),S.push(B));S.length>0&&(S=w?S.filter(B=>{var L;return((L=o.columns)==null?void 0:L[B])===!0}):Object.keys(s.columns).filter(B=>!S.includes(B)))}else S=Object.keys(s.columns);for(const w of S){const B=s.columns[w];_.push({tsKey:w,value:B})}let T=[];o.with&&(T=Object.entries(o.with).filter(w=>!!w[1]).map(([w,B])=>({tsKey:w,queryConfig:B,relation:s.relations[w]})));let v;if(o.extras){v=typeof o.extras=="function"?o.extras(y,{sql:Y}):o.extras;for(const[w,B]of Object.entries(v))_.push({tsKey:w,value:MT(B,a)})}for(const{tsKey:w,value:B}of _)c.push({dbKey:lt(B,Pt.Aliased)?B.fieldAlias:s.columns[w].name,tsKey:w,field:lt(B,rr)?ei(B,a):B,relationTableTsKey:void 0,isJson:!1,selection:[]});let E=typeof o.orderBy=="function"?o.orderBy(y,Sk()):o.orderBy??[];Array.isArray(E)||(E=[E]),d=E.map(w=>lt(w,rr)?ei(w,a):Xu(w,a)),h=o.limit,f=o.offset;for(const{tsKey:w,queryConfig:B,relation:L}of T){const $=Ak(e,n,L),it=Xa(L.referencedTable),I=n[it],Z=`${a}_${w}`,x=yf(...$.fields.map((C,R)=>OT(ei($.references[R],Z),ei(C,a)))),nt=this.buildRelationalQueryWithoutPK({fullSchema:t,schema:e,tableNamesMap:n,table:t[I],tableConfig:e[I],queryConfig:lt(L,Os)?B===!0?{limit:1}:{...B,limit:1}:B,tableAlias:Z,joinOn:x,nestedQueryRelation:L}),P=Y`${Y.identifier(Z)}.${Y.identifier("data")}`.as(w);g.push({on:Y`true`,table:new Nr(nt.sql,{},Z),alias:Z,joinType:"left",lateral:!0}),c.push({dbKey:w,tsKey:w,field:P,relationTableTsKey:I,isJson:!0,selection:nt.selection})}}if(c.length===0)throw new Bp({message:`No fields selected for table "${s.tsName}" ("${a}")`});let p;if(m=yf(u,m),l){let y=Y`json_build_array(${Y.join(c.map(({field:T,tsKey:v,isJson:E})=>E?Y`${Y.identifier(`${a}_${v}`)}.${Y.identifier("data")}`:lt(T,Pt.Aliased)?T.sql:T),Y`, `)})`;lt(l,Yu)&&(y=Y`coalesce(json_agg(${y}${d.length>0?Y` order by ${Y.join(d,Y`, `)}`:void 0}), '[]'::json)`);const _=[{dbKey:"data",tsKey:"data",field:y.as("data"),isJson:!0,relationTableTsKey:s.tsName,selection:c}];h!==void 0||f!==void 0||d.length>0?(p=this.buildSelectQuery({table:$h(i,a),fields:{},fieldsFlat:[{path:[],field:Y.raw("*")}],where:m,limit:h,offset:f,orderBy:d,setOperators:[]}),m=void 0,h=void 0,f=void 0,d=[]):p=$h(i,a),p=this.buildSelectQuery({table:lt(p,Xr)?p:new Nr(p,{},a),fields:{},fieldsFlat:_.map(({field:T})=>({path:[],field:lt(T,rr)?ei(T,a):T})),joins:g,where:m,limit:h,offset:f,orderBy:d,setOperators:[]})}else p=this.buildSelectQuery({table:$h(i,a),fields:{},fieldsFlat:c.map(({field:y})=>({path:[],field:lt(y,rr)?ei(y,a):y})),joins:g,where:m,limit:h,offset:f,orderBy:d,setOperators:[]});return{tableTsKey:s.tsName,sql:p,selection:c}}}W(Ea,z_,"PgDialect");var V_;V_=St;class YT{getSelectedFields(){return this._.selectedFields}}W(YT,V_,"TypedQueryBuilder");var j_;j_=St;class Or{constructor(t){W(this,"fields");W(this,"session");W(this,"dialect");W(this,"withList",[]);W(this,"distinct");W(this,"authToken");this.fields=t.fields,this.session=t.session,this.dialect=t.dialect,t.withList&&(this.withList=t.withList),this.distinct=t.distinct}setToken(t){return this.authToken=t,this}from(t){const e=!!this.fields,n=t;let i;return this.fields?i=this.fields:lt(n,Nr)?i=Object.fromEntries(Object.keys(n._.selectedFields).map(s=>[s,n[s]])):lt(n,zp)?i=n[Qe].selectedFields:lt(n,Pt)?i={}:i=bk(n),new Vp({table:n,fields:i,isPartialSelect:e,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct}).setToken(this.authToken)}}W(Or,j_,"PgSelectBuilder");var $_,G_;class qT extends(G_=YT,$_=St,G_){constructor({table:e,fields:n,isPartialSelect:i,session:s,dialect:o,withList:a,distinct:l}){super();W(this,"_");W(this,"config");W(this,"joinsNotNullableMap");W(this,"tableName");W(this,"isPartialSelect");W(this,"session");W(this,"dialect");W(this,"leftJoin",this.createJoin("left"));W(this,"rightJoin",this.createJoin("right"));W(this,"innerJoin",this.createJoin("inner"));W(this,"fullJoin",this.createJoin("full"));W(this,"union",this.createSetOperator("union",!1));W(this,"unionAll",this.createSetOperator("union",!0));W(this,"intersect",this.createSetOperator("intersect",!1));W(this,"intersectAll",this.createSetOperator("intersect",!0));W(this,"except",this.createSetOperator("except",!1));W(this,"exceptAll",this.createSetOperator("except",!0));this.config={withList:a,table:e,fields:{...n},distinct:l,setOperators:[]},this.isPartialSelect=i,this.session=s,this.dialect=o,this._={selectedFields:n},this.tableName=fs(e),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{}}createJoin(e){return(n,i)=>{var a;const s=this.tableName,o=fs(n);if(typeof o=="string"&&((a=this.config.joins)!=null&&a.some(l=>l.alias===o)))throw new Error(`Alias "${o}" is already used in this query`);if(!this.isPartialSelect&&(Object.keys(this.joinsNotNullableMap).length===1&&typeof s=="string"&&(this.config.fields={[s]:this.config.fields}),typeof o=="string"&&!lt(n,Pt))){const l=lt(n,Nr)?n._.selectedFields:lt(n,ji)?n[Qe].selectedFields:n[It.Symbol.Columns];this.config.fields[o]=l}if(typeof i=="function"&&(i=i(new Proxy(this.config.fields,new or({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.joins||(this.config.joins=[]),this.config.joins.push({on:i,table:n,joinType:e,alias:o}),typeof o=="string")switch(e){case"left":{this.joinsNotNullableMap[o]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([l])=>[l,!1])),this.joinsNotNullableMap[o]=!0;break}case"inner":{this.joinsNotNullableMap[o]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([l])=>[l,!1])),this.joinsNotNullableMap[o]=!1;break}}return this}}createSetOperator(e,n){return i=>{const s=typeof i=="function"?i(Rk()):i;if(!Up(this.getSelectedFields(),s.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return this.config.setOperators.push({type:e,isAll:n,rightSelect:s}),this}}addSetOperators(e){return this.config.setOperators.push(...e),this}where(e){return typeof e=="function"&&(e=e(new Proxy(this.config.fields,new or({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.where=e,this}having(e){return typeof e=="function"&&(e=e(new Proxy(this.config.fields,new or({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.having=e,this}groupBy(...e){if(typeof e[0]=="function"){const n=e[0](new Proxy(this.config.fields,new or({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(n)?n:[n]}else this.config.groupBy=e;return this}orderBy(...e){if(typeof e[0]=="function"){const n=e[0](new Proxy(this.config.fields,new or({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),i=Array.isArray(n)?n:[n];this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=i:this.config.orderBy=i}else{const n=e;this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=n:this.config.orderBy=n}return this}limit(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).limit=e:this.config.limit=e,this}offset(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).offset=e:this.config.offset=e,this}for(e,n={}){return this.config.lockingClause={strength:e,config:n},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}as(e){return new Proxy(new Nr(this.getSQL(),this.config.fields,e),new or({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new or({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}}W(qT,$_,"PgSelectQueryBuilder");var W_,H_;class Vp extends(H_=qT,W_=St,H_){constructor(){super(...arguments);W(this,"authToken");W(this,"execute",e=>Ur.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)))}_prepare(e){const{session:n,config:i,dialect:s,joinsNotNullableMap:o,authToken:a}=this;if(!n)throw new Error("Cannot execute a query on a query builder. Please use a database instance instead.");return Ur.startActiveSpan("drizzle.prepareQuery",()=>{const l=Cs(i.fields),u=n.prepareQuery(s.sqlToQuery(this.getSQL()),l,e,!0);return u.joinsNotNullableMap=o,u.setToken(a)})}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}}W(Vp,W_,"PgSelect");_k(Vp,[$i]);function zo(r,t){return(e,n,...i)=>{const s=[n,...i].map(o=>({type:r,isAll:t,rightSelect:o}));for(const o of s)if(!Up(e.getSelectedFields(),o.rightSelect.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return e.addSetOperators(s)}}const Rk=()=>({union:Fk,unionAll:Dk,intersect:Lk,intersectAll:Nk,except:Bk,exceptAll:Uk}),Fk=zo("union",!1),Dk=zo("union",!0),Lk=zo("intersect",!1),Nk=zo("intersect",!0),Bk=zo("except",!1),Uk=zo("except",!0);var X_;X_=St;class jp{constructor(t){W(this,"dialect");W(this,"dialectConfig");W(this,"$with",(t,e)=>{const n=this;return{as:s=>(typeof s=="function"&&(s=s(n)),new Proxy(new Np(s.getSQL(),e??("getSelectedFields"in s?s.getSelectedFields()??{}:{}),t,!0),new or({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}});this.dialect=lt(t,Ea)?t:void 0,this.dialectConfig=lt(t,Ea)?void 0:t}with(...t){const e=this;function n(o){return new Or({fields:o??void 0,session:void 0,dialect:e.getDialect(),withList:t})}function i(o){return new Or({fields:o??void 0,session:void 0,dialect:e.getDialect(),distinct:!0})}function s(o,a){return new Or({fields:a??void 0,session:void 0,dialect:e.getDialect(),distinct:{on:o}})}return{select:n,selectDistinct:i,selectDistinctOn:s}}select(t){return new Or({fields:t??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(t){return new Or({fields:t??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(t,e){return new Or({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:t}})}getDialect(){return this.dialect||(this.dialect=new Ea(this.dialectConfig)),this.dialect}}W(jp,X_,"PgQueryBuilder");var Y_;Y_=St;class bf{constructor(t,e,n,i,s){W(this,"authToken");this.table=t,this.session=e,this.dialect=n,this.withList=i,this.overridingSystemValue_=s}setToken(t){return this.authToken=t,this}overridingSystemValue(){return this.overridingSystemValue_=!0,this}values(t){if(t=Array.isArray(t)?t:[t],t.length===0)throw new Error("values() must be called with at least one value");const e=t.map(n=>{const i={},s=this.table[It.Symbol.Columns];for(const o of Object.keys(n)){const a=n[o];i[o]=lt(a,Pt)?a:new ci(a,s[o])}return i});return new wf(this.table,e,this.session,this.dialect,this.withList,!1,this.overridingSystemValue_).setToken(this.authToken)}select(t){const e=typeof t=="function"?t(new jp):t;if(!lt(e,Pt)&&!Up(this.table[gf],e._.selectedFields))throw new Error("Insert select error: selected fields are not the same or are in a different order compared to the table definition");return new wf(this.table,e,this.session,this.dialect,this.withList,!0)}}W(bf,Y_,"PgInsertBuilder");var q_,Q_;class wf extends(Q_=$i,q_=St,Q_){constructor(e,n,i,s,o,a,l){super();W(this,"config");W(this,"authToken");W(this,"execute",e=>Ur.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=i,this.dialect=s,this.config={table:e,values:n,withList:o,select:a,overridingSystemValue_:l}}returning(e=this.config.table[It.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=Cs(e),this}onConflictDoNothing(e={}){if(e.target===void 0)this.config.onConflict=Y`do nothing`;else{let n="";n=Array.isArray(e.target)?e.target.map(s=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(s))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target));const i=e.where?Y` where ${e.where}`:void 0;this.config.onConflict=Y`(${Y.raw(n)})${i} do nothing`}return this}onConflictDoUpdate(e){if(e.where&&(e.targetWhere||e.setWhere))throw new Error('You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.');const n=e.where?Y` where ${e.where}`:void 0,i=e.targetWhere?Y` where ${e.targetWhere}`:void 0,s=e.setWhere?Y` where ${e.setWhere}`:void 0,o=this.dialect.buildUpdateSet(this.config.table,DT(this.config.table,e.set));let a="";return a=Array.isArray(e.target)?e.target.map(l=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(l))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target)),this.config.onConflict=Y`(${Y.raw(a)})${i} do update set ${o}${n}${s}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}_prepare(e){return Ur.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0))}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new or({alias:vs(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}W(wf,q_,"PgInsert");var Z_,K_;class QT extends(K_=$i,Z_=St,K_){constructor(e,n,i){super();W(this,"config");W(this,"authToken");W(this,"execute",e=>Ur.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=n,this.dialect=i,this.config={view:e}}concurrently(){if(this.config.withNoData!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.concurrently=!0,this}withNoData(){if(this.config.concurrently!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.withNoData=!0,this}getSQL(){return this.dialect.buildRefreshMaterializedViewQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}_prepare(e){return Ur.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),void 0,e,!0))}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}}W(QT,Z_,"PgRefreshMaterializedView");var J_;J_=St;class xf{constructor(t,e,n,i){W(this,"authToken");this.table=t,this.session=e,this.dialect=n,this.withList=i}setToken(t){return this.authToken=t,this}set(t){return new ZT(this.table,DT(this.table,t),this.session,this.dialect,this.withList).setToken(this.authToken)}}W(xf,J_,"PgUpdateBuilder");var t0,e0;class ZT extends(e0=$i,t0=St,e0){constructor(e,n,i,s,o){super();W(this,"config");W(this,"tableName");W(this,"joinsNotNullableMap");W(this,"leftJoin",this.createJoin("left"));W(this,"rightJoin",this.createJoin("right"));W(this,"innerJoin",this.createJoin("inner"));W(this,"fullJoin",this.createJoin("full"));W(this,"authToken");W(this,"execute",e=>this._prepare().execute(e,this.authToken));this.session=i,this.dialect=s,this.config={set:n,table:e,withList:o,joins:[]},this.tableName=fs(e),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{}}from(e){const n=e,i=fs(n);return typeof i=="string"&&(this.joinsNotNullableMap[i]=!0),this.config.from=n,this}getTableLikeFields(e){return lt(e,Xr)?e[It.Symbol.Columns]:lt(e,Nr)?e._.selectedFields:e[Qe].selectedFields}createJoin(e){return(n,i)=>{const s=fs(n);if(typeof s=="string"&&this.config.joins.some(o=>o.alias===s))throw new Error(`Alias "${s}" is already used in this query`);if(typeof i=="function"){const o=this.config.from&&!lt(this.config.from,Pt)?this.getTableLikeFields(this.config.from):void 0;i=i(new Proxy(this.config.table[It.Symbol.Columns],new or({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})),o&&new Proxy(o,new or({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))}if(this.config.joins.push({on:i,table:n,joinType:e,alias:s}),typeof s=="string")switch(e){case"left":{this.joinsNotNullableMap[s]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([o])=>[o,!1])),this.joinsNotNullableMap[s]=!0;break}case"inner":{this.joinsNotNullableMap[s]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([o])=>[o,!1])),this.joinsNotNullableMap[s]=!1;break}}return this}}where(e){return this.config.where=e,this}returning(e){if(!e&&(e=Object.assign({},this.config.table[It.Symbol.Columns]),this.config.from)){const n=fs(this.config.from);if(typeof n=="string"&&this.config.from&&!lt(this.config.from,Pt)){const i=this.getTableLikeFields(this.config.from);e[n]=i}for(const i of this.config.joins){const s=fs(i.table);if(typeof s=="string"&&!lt(i.table,Pt)){const o=this.getTableLikeFields(i.table);e[s]=o}}}return this.config.returningFields=e,this.config.returning=Cs(e),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}_prepare(e){const n=this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0);return n.joinsNotNullableMap=this.joinsNotNullableMap,n}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new or({alias:vs(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}W(ZT,t0,"PgUpdate");var r0,n0,i0;const Ma=class Ma extends(i0=Pt,n0=St,r0=Symbol.toStringTag,i0){constructor(e){super(Ma.buildEmbeddedCount(e.source,e.filters).queryChunks);W(this,"sql");W(this,"token");W(this,r0,"PgCountBuilder");W(this,"session");this.params=e,this.mapWith(Number),this.session=e.session,this.sql=Ma.buildCount(e.source,e.filters)}static buildEmbeddedCount(e,n){return Y`(select count(*) from ${e}${Y.raw(" where ").if(n)}${n})`}static buildCount(e,n){return Y`select count(*) as count from ${e}${Y.raw(" where ").if(n)}${n};`}setToken(e){return this.token=e,this}then(e,n){return Promise.resolve(this.session.count(this.sql,this.token)).then(e,n)}catch(e){return this.then(void 0,e)}finally(e){return this.then(n=>(e==null||e(),n),n=>{throw e==null||e(),n})}};W(Ma,n0,"PgCountBuilder");let Sf=Ma;var s0;s0=St;class KT{constructor(t,e,n,i,s,o,a){this.fullSchema=t,this.schema=e,this.tableNamesMap=n,this.table=i,this.tableConfig=s,this.dialect=o,this.session=a}findMany(t){return new Tf(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t||{},"many")}findFirst(t){return new Tf(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t?{...t,limit:1}:{limit:1},"first")}}W(KT,s0,"PgRelationalQueryBuilder");var o0,a0;class Tf extends(a0=$i,o0=St,a0){constructor(e,n,i,s,o,a,l,u,c){super();W(this,"authToken");this.fullSchema=e,this.schema=n,this.tableNamesMap=i,this.table=s,this.tableConfig=o,this.dialect=a,this.session=l,this.config=u,this.mode=c}_prepare(e){return Ur.startActiveSpan("drizzle.prepareQuery",()=>{const{query:n,builtQuery:i}=this._toSQL();return this.session.prepareQuery(i,void 0,e,!0,(s,o)=>{const a=s.map(l=>vf(this.schema,this.tableConfig,l,n.selection,o));return this.mode==="first"?a[0]:a})})}prepare(e){return this._prepare(e)}_getQuery(){return this.dialect.buildRelationalQueryWithoutPK({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName})}getSQL(){return this._getQuery().sql}_toSQL(){const e=this._getQuery(),n=this.dialect.sqlToQuery(e.sql);return{query:e,builtQuery:n}}toSQL(){return this._toSQL().builtQuery}setToken(e){return this.authToken=e,this}execute(){return Ur.startActiveSpan("drizzle.operation",()=>this._prepare().execute(void 0,this.authToken))}}W(Tf,o0,"PgRelationalQuery");var l0,u0;class JT extends(u0=$i,l0=St,u0){constructor(t,e,n,i){super(),this.execute=t,this.sql=e,this.query=n,this.mapBatchResult=i}getSQL(){return this.sql}getQuery(){return this.query}mapResult(t,e){return e?this.mapBatchResult(t):t}_prepare(){return this}isResponseInArrayMode(){return!1}}W(JT,l0,"PgRaw");var c0;c0=St;class $p{constructor(t,e,n){W(this,"query");W(this,"$with",(t,e)=>{const n=this;return{as:s=>(typeof s=="function"&&(s=s(new jp(n.dialect))),new Proxy(new Np(s.getSQL(),e??("getSelectedFields"in s?s.getSelectedFields()??{}:{}),t,!0),new or({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}});W(this,"authToken");if(this.dialect=t,this.session=e,this._=n?{schema:n.schema,fullSchema:n.fullSchema,tableNamesMap:n.tableNamesMap,session:e}:{schema:void 0,fullSchema:{},tableNamesMap:{},session:e},this.query={},this._.schema)for(const[i,s]of Object.entries(this._.schema))this.query[i]=new KT(n.fullSchema,this._.schema,this._.tableNamesMap,n.fullSchema[i],s,t,e)}$count(t,e){return new Sf({source:t,filters:e,session:this.session})}with(...t){const e=this;function n(u){return new Or({fields:u??void 0,session:e.session,dialect:e.dialect,withList:t})}function i(u){return new Or({fields:u??void 0,session:e.session,dialect:e.dialect,withList:t,distinct:!0})}function s(u,c){return new Or({fields:c??void 0,session:e.session,dialect:e.dialect,withList:t,distinct:{on:u}})}function o(u){return new xf(u,e.session,e.dialect,t)}function a(u){return new bf(u,e.session,e.dialect,t)}function l(u){return new _f(u,e.session,e.dialect,t)}return{select:n,selectDistinct:i,selectDistinctOn:s,update:o,insert:a,delete:l}}select(t){return new Or({fields:t??void 0,session:this.session,dialect:this.dialect})}selectDistinct(t){return new Or({fields:t??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(t,e){return new Or({fields:e??void 0,session:this.session,dialect:this.dialect,distinct:{on:t}})}update(t){return new xf(t,this.session,this.dialect)}insert(t){return new bf(t,this.session,this.dialect)}delete(t){return new _f(t,this.session,this.dialect)}refreshMaterializedView(t){return new QT(t,this.session,this.dialect)}execute(t){const e=typeof t=="string"?Y.raw(t):t.getSQL(),n=this.dialect.sqlToQuery(e),i=this.session.prepareQuery(n,void 0,void 0,!1);return new JT(()=>i.execute(void 0,this.authToken),e,n,s=>i.mapResult(s,!0))}transaction(t,e){return this.session.transaction(t,e)}}W($p,c0,"PgDatabase");var h0;h0=St;class t1{constructor(t){W(this,"authToken");W(this,"joinsNotNullableMap");this.query=t}getQuery(){return this.query}mapResult(t,e){return t}setToken(t){return this.authToken=t,this}}W(t1,h0,"PgPreparedQuery");var d0;d0=St;class e1{constructor(t){this.dialect=t}execute(t,e){return Ur.startActiveSpan("drizzle.operation",()=>Ur.startActiveSpan("drizzle.prepareQuery",()=>this.prepareQuery(this.dialect.sqlToQuery(t),void 0,void 0,!1)).setToken(e).execute(void 0,e))}all(t){return this.prepareQuery(this.dialect.sqlToQuery(t),void 0,void 0,!1).all()}async count(t,e){const n=await this.execute(t,e);return Number(n[0].count)}}W(e1,d0,"PgSession");var f0,p0;class r1 extends(p0=$p,f0=St,p0){constructor(t,e,n,i=0){super(t,e,n),this.schema=n,this.nestedIndex=i}rollback(){throw new CT}getTransactionConfigSQL(t){const e=[];return t.isolationLevel&&e.push(`isolation level ${t.isolationLevel}`),t.accessMode&&e.push(t.accessMode),typeof t.deferrable=="boolean"&&e.push(t.deferrable?"deferrable":"not deferrable"),Y.raw(e.join(" "))}setTransaction(t){return this.session.execute(Y`set transaction ${this.getTransactionConfigSQL(t)}`)}}W(r1,f0,"PgTransaction");function yv(r){return typeof r=="string"&&/^true$/i.test(r)}function kk(r){const t={scheme:"duckdb-wasm:"},e=new URL(r);if(!e.protocol.startsWith("duckdb-wasm:"))throw new Error(`Expected scheme to be "duckdb-wasm:" but got "${e.protocol}"`);e.searchParams.get("bundles")==="import-url"&&(t.bundles="import-url");const n=e.searchParams.get("logger");n&&yv(n)&&(t.logger=!0);const i=e.searchParams.get("storage");switch(i){case Ha.ORIGIN_PRIVATE_FS:{e.host.length>0&&console.warn(`Host "${e.host}" will be ignored while using Origin Private FS`);const s=e.searchParams.get("write");t.storage={type:Ha.ORIGIN_PRIVATE_FS,path:e.pathname.startsWith("/")?e.pathname.slice(1):e.pathname,...s&&yv(s)&&{accessMode:Bx.READ_WRITE}};break}case null:break;default:console.warn(`Unknown storage type "${i}"`);break}return t}var m0,g0;class n1 extends(g0=t1,m0=St,g0){constructor(t,e,n,i,s,o){super({sql:e,params:n}),this.client=t,this.queryString=e,this.params=n,this.logger=i,this.fields=s,this.customResultMapper=o}async execute(t={}){const e=pv(this.params,t);this.logger.logQuery(this.queryString,e);const{fields:n,queryString:i,client:s,customResultMapper:o}=this,a=await s;return a.query(i,e)}async all(t={}){const e=pv(this.params,t);return this.logger.logQuery(this.queryString,e),(await this.client).query(this.queryString,e)}}W(n1,m0,"DuckDBWasmPreparedQuery");var y0,v0;const Ju=class Ju extends(v0=e1,y0=St,v0){constructor(e,n,i,s={}){super(n);W(this,"logger");this.client=e,this.schema=i,this.options=s,this.logger=s.logger??new FT}prepareQuery(e,n,i,s,o){return new n1(this.client,e.sql,e.params,this.logger,n,o)}async query(e,n){return this.logger.logQuery(e,n),(await this.client).query(e,n)}async queryObjects(e,n){return this.logger.logQuery(e,n),(await this.client).query(e,n)}transaction(e,n){return GU(this.client,async i=>{const s=new Ju(i,this.dialect,this.schema,this.options),o=new If(this.dialect,s,this.schema);return n&&await o.setTransaction(n),e(o)})}};W(Ju,y0,"DuckDBWasmSession");let qu=Ju;var _0,b0;const tc=class tc extends(b0=r1,_0=St,b0){constructor(e,n,i,s=0){super(e,n,i,s);W(this,"dialect");W(this,"session");this.dialect=e,this.session=n}async transaction(e){return WU(this.session.client,"",async n=>{const i=new qu(n,this.dialect,this.schema,this.session.options),s=new tc(this.dialect,i,this.schema);return e(s)})}};W(tc,_0,"DuckDBWasmTransaction");let If=tc;var w0,x0;class i1 extends(x0=$p,w0=St,x0){}W(i1,w0,"DuckDBWasmDatabase");function Aa(r,t={}){const e=new Ea({casing:t.casing});let n;t.logger===!0?n=new RT:t.logger!==!1&&(n=t.logger);let i;if(t.schema){const a=Tk(t.schema,Mk);i={fullSchema:t.schema,schema:a.tables,tableNamesMap:a.tableNamesMap}}const s=new qu(r,e,i,{logger:n}),o=new i1(e,s,i);return o.$client=r,o}function vv(r,t){const e=kk(r);let n;return e.bundles==="import-url"?n=(async()=>{const s=await pf();switch(s){case"browser":return(await Ai(async()=>{const{getImportUrlBundles:o}=await import("./import-url-browser-CPN8ipMD.js");return{getImportUrlBundles:o}},__vite__mapDeps([3,4]))).getImportUrlBundles();case"node":return await(await Ai(async()=>{const{getImportUrlBundles:o}=await import("./import-url-node-BfNoxhRr.js");return{getImportUrlBundles:o}},__vite__mapDeps([5,4]))).getImportUrlBundles();default:throw new Error(`Unsupported environment: "${s}"`)}})():n=(async()=>{const s=await pf();switch(s){case"browser":return(await Ai(async()=>{const{getBundles:o}=await import("./default-browser-BrgSDbLD.js");return{getBundles:o}},[])).getBundles();case"node":return await(await Ai(async()=>{const{getBundles:o}=await import("./default-node-BrtBg7VE.js");return{getBundles:o}},__vite__mapDeps([0,1,2]))).getBundles();default:throw new Error(`Unsupported environment: "${s}"`)}})(),Aa(TT({bundles:n,logger:e.logger?new Ux:void 0,storage:e.storage}),t)}function _v(...r){if(typeof r[0]=="string")return vv(r[0],r[1]);if(wk(r[0])){const{connection:t,client:e,...n}=r[0];if(e)return Aa(e,n);if(typeof t=="string")return vv(t,n);if(typeof t>"u")throw new Error("connection option is required");return Aa(TT({bundles:t.bundles,logger:t.logger,storage:t.storage}),n)}return Aa(r[0],r[1])}(r=>{function t(e){return Aa({options:{parsers:{},serializers:{}}},e)}r.mock=t})(_v||(_v={}));var Gh={exports:{}};/*! + `;await e.execute(Y`CREATE SCHEMA IF NOT EXISTS ${Y.identifier(s)}`),await e.execute(o);const l=(await e.all(Y`select id, hash, created_at from ${Y.identifier(s)}.${Y.identifier(i)} order by created_at desc limit 1`))[0];await e.transaction(async u=>{for await(const c of t)if(!l||Number(l.created_at){var a;return e[o]!==void 0||((a=n[o])==null?void 0:a.onUpdateFn)!==void 0}),s=i.length;return Y.join(i.flatMap((o,a)=>{const l=n[o],u=e[o]??Y.param(l.onUpdateFn(),l),c=Y`${Y.identifier(this.casing.getColumnCasing(l))} = ${u}`;return a{const a=[];if(lt(s,Pt.Aliased)&&s.isSelectionField)a.push(Y.identifier(s.fieldAlias));else if(lt(s,Pt.Aliased)||lt(s,Pt)){const l=lt(s,Pt.Aliased)?s.sql:s;e?a.push(new Pt(l.queryChunks.map(u=>lt(u,Lr)?Y.identifier(this.casing.getColumnCasing(u)):u))):a.push(l),lt(s,Pt.Aliased)&&a.push(Y` as ${Y.identifier(s.fieldAlias)}`)}else lt(s,rr)&&(e?a.push(Y.identifier(this.casing.getColumnCasing(s))):a.push(s));return oa==null?void 0:a.some(({alias:P})=>P===(nt[It.Symbol.IsAlias]?vs(nt):nt[It.Symbol.BaseName])))(x.field.table)){const nt=vs(x.field.table);throw new Error(`Your "${x.path.join("->")}" field references a column "${nt}"."${x.field.name}", but the table "${nt}" is not part of the query! Did you forget to join it?`)}const p=!a||a.length===0,y=this.buildWithCTE(t);let _;d&&(_=d===!0?Y` distinct`:Y` distinct on (${Y.join(d.on,Y`, `)})`);const S=this.buildSelection(g,{isSingleTable:p}),T=this.buildFromTable(o),v=this.buildJoins(a),E=i?Y` where ${i}`:void 0,w=s?Y` having ${s}`:void 0;let B;l&&l.length>0&&(B=Y` order by ${Y.join(l,Y`, `)}`);let L;u&&u.length>0&&(L=Y` group by ${Y.join(u,Y`, `)}`);const $=typeof c=="object"||typeof c=="number"&&c>=0?Y` limit ${c}`:void 0,it=h?Y` offset ${h}`:void 0,I=Y.empty();if(f){const x=Y` for ${Y.raw(f.strength)}`;f.config.of&&x.append(Y` of ${Y.join(Array.isArray(f.config.of)?f.config.of:[f.config.of],Y`, `)}`),f.config.noWait?x.append(Y` no wait`):f.config.skipLocked&&x.append(Y` skip locked`),I.append(x)}const Z=Y`${y}select${_} ${S} from ${T}${v}${E}${L}${w}${B}${$}${it}${I}`;return m.length>0?this.buildSetOperations(Z,m):Z}buildSetOperations(t,e){const[n,...i]=e;if(!n)throw new Error("Cannot pass undefined values to any set operator");return i.length===0?this.buildSetOperationQuery({leftSelect:t,setOperator:n}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:t,setOperator:n}),i)}buildSetOperationQuery({leftSelect:t,setOperator:{type:e,isAll:n,rightSelect:i,limit:s,orderBy:o,offset:a}}){const l=Y`(${t.getSQL()}) `,u=Y`(${i.getSQL()})`;let c;if(o&&o.length>0){const m=[];for(const g of o)if(lt(g,Lr))m.push(Y.identifier(g.name));else if(lt(g,Pt)){for(let p=0;p=0?Y` limit ${s}`:void 0,f=Y.raw(`${e} ${n?"all ":""}`),d=a?Y` offset ${a}`:void 0;return Y`${l}${f}${u}${c}${h}${d}`}buildInsertQuery({table:t,values:e,onConflict:n,returning:i,withList:s,select:o,overridingSystemValue_:a}){const l=[],u=t[It.Symbol.Columns],c=Object.entries(u).filter(([y,_])=>!_.shouldDisableInsert()),h=c.map(([,y])=>Y.identifier(this.casing.getColumnCasing(y)));if(o){const y=e;lt(y,Pt)?l.push(y):l.push(y.getSQL())}else{const y=e;l.push(Y.raw("values "));for(const[_,S]of y.entries()){const T=[];for(const[v,E]of c){const w=S[v];if(w===void 0||lt(w,ci)&&w.value===void 0)if(E.defaultFn!==void 0){const B=E.defaultFn(),L=lt(B,Pt)?B:Y.param(B,E);T.push(L)}else if(!E.default&&E.onUpdateFn!==void 0){const B=E.onUpdateFn(),L=lt(B,Pt)?B:Y.param(B,E);T.push(L)}else T.push(Y`default`);else T.push(w)}l.push(T),_({dbKey:S.name,tsKey:_,field:ei(S,a),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{const y=Object.fromEntries(Object.entries(s.columns).map(([w,B])=>[w,ei(B,a)]));if(o.where){const w=typeof o.where=="function"?o.where(y,xk()):o.where;m=w&&Xu(w,a)}const _=[];let S=[];if(o.columns){let w=!1;for(const[B,L]of Object.entries(o.columns))L!==void 0&&B in s.columns&&(!w&&L===!0&&(w=!0),S.push(B));S.length>0&&(S=w?S.filter(B=>{var L;return((L=o.columns)==null?void 0:L[B])===!0}):Object.keys(s.columns).filter(B=>!S.includes(B)))}else S=Object.keys(s.columns);for(const w of S){const B=s.columns[w];_.push({tsKey:w,value:B})}let T=[];o.with&&(T=Object.entries(o.with).filter(w=>!!w[1]).map(([w,B])=>({tsKey:w,queryConfig:B,relation:s.relations[w]})));let v;if(o.extras){v=typeof o.extras=="function"?o.extras(y,{sql:Y}):o.extras;for(const[w,B]of Object.entries(v))_.push({tsKey:w,value:MT(B,a)})}for(const{tsKey:w,value:B}of _)c.push({dbKey:lt(B,Pt.Aliased)?B.fieldAlias:s.columns[w].name,tsKey:w,field:lt(B,rr)?ei(B,a):B,relationTableTsKey:void 0,isJson:!1,selection:[]});let E=typeof o.orderBy=="function"?o.orderBy(y,Sk()):o.orderBy??[];Array.isArray(E)||(E=[E]),d=E.map(w=>lt(w,rr)?ei(w,a):Xu(w,a)),h=o.limit,f=o.offset;for(const{tsKey:w,queryConfig:B,relation:L}of T){const $=Ak(e,n,L),it=Xa(L.referencedTable),I=n[it],Z=`${a}_${w}`,x=yf(...$.fields.map((C,R)=>OT(ei($.references[R],Z),ei(C,a)))),nt=this.buildRelationalQueryWithoutPK({fullSchema:t,schema:e,tableNamesMap:n,table:t[I],tableConfig:e[I],queryConfig:lt(L,Os)?B===!0?{limit:1}:{...B,limit:1}:B,tableAlias:Z,joinOn:x,nestedQueryRelation:L}),P=Y`${Y.identifier(Z)}.${Y.identifier("data")}`.as(w);g.push({on:Y`true`,table:new Nr(nt.sql,{},Z),alias:Z,joinType:"left",lateral:!0}),c.push({dbKey:w,tsKey:w,field:P,relationTableTsKey:I,isJson:!0,selection:nt.selection})}}if(c.length===0)throw new Bp({message:`No fields selected for table "${s.tsName}" ("${a}")`});let p;if(m=yf(u,m),l){let y=Y`json_build_array(${Y.join(c.map(({field:T,tsKey:v,isJson:E})=>E?Y`${Y.identifier(`${a}_${v}`)}.${Y.identifier("data")}`:lt(T,Pt.Aliased)?T.sql:T),Y`, `)})`;lt(l,Yu)&&(y=Y`coalesce(json_agg(${y}${d.length>0?Y` order by ${Y.join(d,Y`, `)}`:void 0}), '[]'::json)`);const _=[{dbKey:"data",tsKey:"data",field:y.as("data"),isJson:!0,relationTableTsKey:s.tsName,selection:c}];h!==void 0||f!==void 0||d.length>0?(p=this.buildSelectQuery({table:$h(i,a),fields:{},fieldsFlat:[{path:[],field:Y.raw("*")}],where:m,limit:h,offset:f,orderBy:d,setOperators:[]}),m=void 0,h=void 0,f=void 0,d=[]):p=$h(i,a),p=this.buildSelectQuery({table:lt(p,Xr)?p:new Nr(p,{},a),fields:{},fieldsFlat:_.map(({field:T})=>({path:[],field:lt(T,rr)?ei(T,a):T})),joins:g,where:m,limit:h,offset:f,orderBy:d,setOperators:[]})}else p=this.buildSelectQuery({table:$h(i,a),fields:{},fieldsFlat:c.map(({field:y})=>({path:[],field:lt(y,rr)?ei(y,a):y})),joins:g,where:m,limit:h,offset:f,orderBy:d,setOperators:[]});return{tableTsKey:s.tsName,sql:p,selection:c}}}W(Ea,z_,"PgDialect");var V_;V_=St;class YT{getSelectedFields(){return this._.selectedFields}}W(YT,V_,"TypedQueryBuilder");var j_;j_=St;class Or{constructor(t){W(this,"fields");W(this,"session");W(this,"dialect");W(this,"withList",[]);W(this,"distinct");W(this,"authToken");this.fields=t.fields,this.session=t.session,this.dialect=t.dialect,t.withList&&(this.withList=t.withList),this.distinct=t.distinct}setToken(t){return this.authToken=t,this}from(t){const e=!!this.fields,n=t;let i;return this.fields?i=this.fields:lt(n,Nr)?i=Object.fromEntries(Object.keys(n._.selectedFields).map(s=>[s,n[s]])):lt(n,zp)?i=n[Qe].selectedFields:lt(n,Pt)?i={}:i=bk(n),new Vp({table:n,fields:i,isPartialSelect:e,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct}).setToken(this.authToken)}}W(Or,j_,"PgSelectBuilder");var $_,G_;class qT extends(G_=YT,$_=St,G_){constructor({table:e,fields:n,isPartialSelect:i,session:s,dialect:o,withList:a,distinct:l}){super();W(this,"_");W(this,"config");W(this,"joinsNotNullableMap");W(this,"tableName");W(this,"isPartialSelect");W(this,"session");W(this,"dialect");W(this,"leftJoin",this.createJoin("left"));W(this,"rightJoin",this.createJoin("right"));W(this,"innerJoin",this.createJoin("inner"));W(this,"fullJoin",this.createJoin("full"));W(this,"union",this.createSetOperator("union",!1));W(this,"unionAll",this.createSetOperator("union",!0));W(this,"intersect",this.createSetOperator("intersect",!1));W(this,"intersectAll",this.createSetOperator("intersect",!0));W(this,"except",this.createSetOperator("except",!1));W(this,"exceptAll",this.createSetOperator("except",!0));this.config={withList:a,table:e,fields:{...n},distinct:l,setOperators:[]},this.isPartialSelect=i,this.session=s,this.dialect=o,this._={selectedFields:n},this.tableName=fs(e),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{}}createJoin(e){return(n,i)=>{var a;const s=this.tableName,o=fs(n);if(typeof o=="string"&&((a=this.config.joins)!=null&&a.some(l=>l.alias===o)))throw new Error(`Alias "${o}" is already used in this query`);if(!this.isPartialSelect&&(Object.keys(this.joinsNotNullableMap).length===1&&typeof s=="string"&&(this.config.fields={[s]:this.config.fields}),typeof o=="string"&&!lt(n,Pt))){const l=lt(n,Nr)?n._.selectedFields:lt(n,ji)?n[Qe].selectedFields:n[It.Symbol.Columns];this.config.fields[o]=l}if(typeof i=="function"&&(i=i(new Proxy(this.config.fields,new or({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.joins||(this.config.joins=[]),this.config.joins.push({on:i,table:n,joinType:e,alias:o}),typeof o=="string")switch(e){case"left":{this.joinsNotNullableMap[o]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([l])=>[l,!1])),this.joinsNotNullableMap[o]=!0;break}case"inner":{this.joinsNotNullableMap[o]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([l])=>[l,!1])),this.joinsNotNullableMap[o]=!1;break}}return this}}createSetOperator(e,n){return i=>{const s=typeof i=="function"?i(Rk()):i;if(!Up(this.getSelectedFields(),s.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return this.config.setOperators.push({type:e,isAll:n,rightSelect:s}),this}}addSetOperators(e){return this.config.setOperators.push(...e),this}where(e){return typeof e=="function"&&(e=e(new Proxy(this.config.fields,new or({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.where=e,this}having(e){return typeof e=="function"&&(e=e(new Proxy(this.config.fields,new or({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.having=e,this}groupBy(...e){if(typeof e[0]=="function"){const n=e[0](new Proxy(this.config.fields,new or({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(n)?n:[n]}else this.config.groupBy=e;return this}orderBy(...e){if(typeof e[0]=="function"){const n=e[0](new Proxy(this.config.fields,new or({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),i=Array.isArray(n)?n:[n];this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=i:this.config.orderBy=i}else{const n=e;this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=n:this.config.orderBy=n}return this}limit(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).limit=e:this.config.limit=e,this}offset(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).offset=e:this.config.offset=e,this}for(e,n={}){return this.config.lockingClause={strength:e,config:n},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}as(e){return new Proxy(new Nr(this.getSQL(),this.config.fields,e),new or({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new or({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}}W(qT,$_,"PgSelectQueryBuilder");var W_,H_;class Vp extends(H_=qT,W_=St,H_){constructor(){super(...arguments);W(this,"authToken");W(this,"execute",e=>Ur.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)))}_prepare(e){const{session:n,config:i,dialect:s,joinsNotNullableMap:o,authToken:a}=this;if(!n)throw new Error("Cannot execute a query on a query builder. Please use a database instance instead.");return Ur.startActiveSpan("drizzle.prepareQuery",()=>{const l=Cs(i.fields),u=n.prepareQuery(s.sqlToQuery(this.getSQL()),l,e,!0);return u.joinsNotNullableMap=o,u.setToken(a)})}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}}W(Vp,W_,"PgSelect");_k(Vp,[$i]);function zo(r,t){return(e,n,...i)=>{const s=[n,...i].map(o=>({type:r,isAll:t,rightSelect:o}));for(const o of s)if(!Up(e.getSelectedFields(),o.rightSelect.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return e.addSetOperators(s)}}const Rk=()=>({union:Fk,unionAll:Dk,intersect:Lk,intersectAll:Nk,except:Bk,exceptAll:Uk}),Fk=zo("union",!1),Dk=zo("union",!0),Lk=zo("intersect",!1),Nk=zo("intersect",!0),Bk=zo("except",!1),Uk=zo("except",!0);var X_;X_=St;class jp{constructor(t){W(this,"dialect");W(this,"dialectConfig");W(this,"$with",(t,e)=>{const n=this;return{as:s=>(typeof s=="function"&&(s=s(n)),new Proxy(new Np(s.getSQL(),e??("getSelectedFields"in s?s.getSelectedFields()??{}:{}),t,!0),new or({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}});this.dialect=lt(t,Ea)?t:void 0,this.dialectConfig=lt(t,Ea)?void 0:t}with(...t){const e=this;function n(o){return new Or({fields:o??void 0,session:void 0,dialect:e.getDialect(),withList:t})}function i(o){return new Or({fields:o??void 0,session:void 0,dialect:e.getDialect(),distinct:!0})}function s(o,a){return new Or({fields:a??void 0,session:void 0,dialect:e.getDialect(),distinct:{on:o}})}return{select:n,selectDistinct:i,selectDistinctOn:s}}select(t){return new Or({fields:t??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(t){return new Or({fields:t??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(t,e){return new Or({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:t}})}getDialect(){return this.dialect||(this.dialect=new Ea(this.dialectConfig)),this.dialect}}W(jp,X_,"PgQueryBuilder");var Y_;Y_=St;class bf{constructor(t,e,n,i,s){W(this,"authToken");this.table=t,this.session=e,this.dialect=n,this.withList=i,this.overridingSystemValue_=s}setToken(t){return this.authToken=t,this}overridingSystemValue(){return this.overridingSystemValue_=!0,this}values(t){if(t=Array.isArray(t)?t:[t],t.length===0)throw new Error("values() must be called with at least one value");const e=t.map(n=>{const i={},s=this.table[It.Symbol.Columns];for(const o of Object.keys(n)){const a=n[o];i[o]=lt(a,Pt)?a:new ci(a,s[o])}return i});return new wf(this.table,e,this.session,this.dialect,this.withList,!1,this.overridingSystemValue_).setToken(this.authToken)}select(t){const e=typeof t=="function"?t(new jp):t;if(!lt(e,Pt)&&!Up(this.table[gf],e._.selectedFields))throw new Error("Insert select error: selected fields are not the same or are in a different order compared to the table definition");return new wf(this.table,e,this.session,this.dialect,this.withList,!0)}}W(bf,Y_,"PgInsertBuilder");var q_,Q_;class wf extends(Q_=$i,q_=St,Q_){constructor(e,n,i,s,o,a,l){super();W(this,"config");W(this,"authToken");W(this,"execute",e=>Ur.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=i,this.dialect=s,this.config={table:e,values:n,withList:o,select:a,overridingSystemValue_:l}}returning(e=this.config.table[It.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=Cs(e),this}onConflictDoNothing(e={}){if(e.target===void 0)this.config.onConflict=Y`do nothing`;else{let n="";n=Array.isArray(e.target)?e.target.map(s=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(s))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target));const i=e.where?Y` where ${e.where}`:void 0;this.config.onConflict=Y`(${Y.raw(n)})${i} do nothing`}return this}onConflictDoUpdate(e){if(e.where&&(e.targetWhere||e.setWhere))throw new Error('You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.');const n=e.where?Y` where ${e.where}`:void 0,i=e.targetWhere?Y` where ${e.targetWhere}`:void 0,s=e.setWhere?Y` where ${e.setWhere}`:void 0,o=this.dialect.buildUpdateSet(this.config.table,DT(this.config.table,e.set));let a="";return a=Array.isArray(e.target)?e.target.map(l=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(l))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target)),this.config.onConflict=Y`(${Y.raw(a)})${i} do update set ${o}${n}${s}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}_prepare(e){return Ur.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0))}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new or({alias:vs(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}W(wf,q_,"PgInsert");var Z_,K_;class QT extends(K_=$i,Z_=St,K_){constructor(e,n,i){super();W(this,"config");W(this,"authToken");W(this,"execute",e=>Ur.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=n,this.dialect=i,this.config={view:e}}concurrently(){if(this.config.withNoData!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.concurrently=!0,this}withNoData(){if(this.config.concurrently!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.withNoData=!0,this}getSQL(){return this.dialect.buildRefreshMaterializedViewQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}_prepare(e){return Ur.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),void 0,e,!0))}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}}W(QT,Z_,"PgRefreshMaterializedView");var J_;J_=St;class xf{constructor(t,e,n,i){W(this,"authToken");this.table=t,this.session=e,this.dialect=n,this.withList=i}setToken(t){return this.authToken=t,this}set(t){return new ZT(this.table,DT(this.table,t),this.session,this.dialect,this.withList).setToken(this.authToken)}}W(xf,J_,"PgUpdateBuilder");var t0,e0;class ZT extends(e0=$i,t0=St,e0){constructor(e,n,i,s,o){super();W(this,"config");W(this,"tableName");W(this,"joinsNotNullableMap");W(this,"leftJoin",this.createJoin("left"));W(this,"rightJoin",this.createJoin("right"));W(this,"innerJoin",this.createJoin("inner"));W(this,"fullJoin",this.createJoin("full"));W(this,"authToken");W(this,"execute",e=>this._prepare().execute(e,this.authToken));this.session=i,this.dialect=s,this.config={set:n,table:e,withList:o,joins:[]},this.tableName=fs(e),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{}}from(e){const n=e,i=fs(n);return typeof i=="string"&&(this.joinsNotNullableMap[i]=!0),this.config.from=n,this}getTableLikeFields(e){return lt(e,Xr)?e[It.Symbol.Columns]:lt(e,Nr)?e._.selectedFields:e[Qe].selectedFields}createJoin(e){return(n,i)=>{const s=fs(n);if(typeof s=="string"&&this.config.joins.some(o=>o.alias===s))throw new Error(`Alias "${s}" is already used in this query`);if(typeof i=="function"){const o=this.config.from&&!lt(this.config.from,Pt)?this.getTableLikeFields(this.config.from):void 0;i=i(new Proxy(this.config.table[It.Symbol.Columns],new or({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})),o&&new Proxy(o,new or({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))}if(this.config.joins.push({on:i,table:n,joinType:e,alias:s}),typeof s=="string")switch(e){case"left":{this.joinsNotNullableMap[s]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([o])=>[o,!1])),this.joinsNotNullableMap[s]=!0;break}case"inner":{this.joinsNotNullableMap[s]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([o])=>[o,!1])),this.joinsNotNullableMap[s]=!1;break}}return this}}where(e){return this.config.where=e,this}returning(e){if(!e&&(e=Object.assign({},this.config.table[It.Symbol.Columns]),this.config.from)){const n=fs(this.config.from);if(typeof n=="string"&&this.config.from&&!lt(this.config.from,Pt)){const i=this.getTableLikeFields(this.config.from);e[n]=i}for(const i of this.config.joins){const s=fs(i.table);if(typeof s=="string"&&!lt(i.table,Pt)){const o=this.getTableLikeFields(i.table);e[s]=o}}}return this.config.returningFields=e,this.config.returning=Cs(e),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){const{typings:e,...n}=this.dialect.sqlToQuery(this.getSQL());return n}_prepare(e){const n=this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0);return n.joinsNotNullableMap=this.joinsNotNullableMap,n}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new or({alias:vs(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}W(ZT,t0,"PgUpdate");var r0,n0,i0;const Ma=class Ma extends(i0=Pt,n0=St,r0=Symbol.toStringTag,i0){constructor(e){super(Ma.buildEmbeddedCount(e.source,e.filters).queryChunks);W(this,"sql");W(this,"token");W(this,r0,"PgCountBuilder");W(this,"session");this.params=e,this.mapWith(Number),this.session=e.session,this.sql=Ma.buildCount(e.source,e.filters)}static buildEmbeddedCount(e,n){return Y`(select count(*) from ${e}${Y.raw(" where ").if(n)}${n})`}static buildCount(e,n){return Y`select count(*) as count from ${e}${Y.raw(" where ").if(n)}${n};`}setToken(e){return this.token=e,this}then(e,n){return Promise.resolve(this.session.count(this.sql,this.token)).then(e,n)}catch(e){return this.then(void 0,e)}finally(e){return this.then(n=>(e==null||e(),n),n=>{throw e==null||e(),n})}};W(Ma,n0,"PgCountBuilder");let Sf=Ma;var s0;s0=St;class KT{constructor(t,e,n,i,s,o,a){this.fullSchema=t,this.schema=e,this.tableNamesMap=n,this.table=i,this.tableConfig=s,this.dialect=o,this.session=a}findMany(t){return new Tf(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t||{},"many")}findFirst(t){return new Tf(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t?{...t,limit:1}:{limit:1},"first")}}W(KT,s0,"PgRelationalQueryBuilder");var o0,a0;class Tf extends(a0=$i,o0=St,a0){constructor(e,n,i,s,o,a,l,u,c){super();W(this,"authToken");this.fullSchema=e,this.schema=n,this.tableNamesMap=i,this.table=s,this.tableConfig=o,this.dialect=a,this.session=l,this.config=u,this.mode=c}_prepare(e){return Ur.startActiveSpan("drizzle.prepareQuery",()=>{const{query:n,builtQuery:i}=this._toSQL();return this.session.prepareQuery(i,void 0,e,!0,(s,o)=>{const a=s.map(l=>vf(this.schema,this.tableConfig,l,n.selection,o));return this.mode==="first"?a[0]:a})})}prepare(e){return this._prepare(e)}_getQuery(){return this.dialect.buildRelationalQueryWithoutPK({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName})}getSQL(){return this._getQuery().sql}_toSQL(){const e=this._getQuery(),n=this.dialect.sqlToQuery(e.sql);return{query:e,builtQuery:n}}toSQL(){return this._toSQL().builtQuery}setToken(e){return this.authToken=e,this}execute(){return Ur.startActiveSpan("drizzle.operation",()=>this._prepare().execute(void 0,this.authToken))}}W(Tf,o0,"PgRelationalQuery");var l0,u0;class JT extends(u0=$i,l0=St,u0){constructor(t,e,n,i){super(),this.execute=t,this.sql=e,this.query=n,this.mapBatchResult=i}getSQL(){return this.sql}getQuery(){return this.query}mapResult(t,e){return e?this.mapBatchResult(t):t}_prepare(){return this}isResponseInArrayMode(){return!1}}W(JT,l0,"PgRaw");var c0;c0=St;class $p{constructor(t,e,n){W(this,"query");W(this,"$with",(t,e)=>{const n=this;return{as:s=>(typeof s=="function"&&(s=s(new jp(n.dialect))),new Proxy(new Np(s.getSQL(),e??("getSelectedFields"in s?s.getSelectedFields()??{}:{}),t,!0),new or({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}});W(this,"authToken");if(this.dialect=t,this.session=e,this._=n?{schema:n.schema,fullSchema:n.fullSchema,tableNamesMap:n.tableNamesMap,session:e}:{schema:void 0,fullSchema:{},tableNamesMap:{},session:e},this.query={},this._.schema)for(const[i,s]of Object.entries(this._.schema))this.query[i]=new KT(n.fullSchema,this._.schema,this._.tableNamesMap,n.fullSchema[i],s,t,e)}$count(t,e){return new Sf({source:t,filters:e,session:this.session})}with(...t){const e=this;function n(u){return new Or({fields:u??void 0,session:e.session,dialect:e.dialect,withList:t})}function i(u){return new Or({fields:u??void 0,session:e.session,dialect:e.dialect,withList:t,distinct:!0})}function s(u,c){return new Or({fields:c??void 0,session:e.session,dialect:e.dialect,withList:t,distinct:{on:u}})}function o(u){return new xf(u,e.session,e.dialect,t)}function a(u){return new bf(u,e.session,e.dialect,t)}function l(u){return new _f(u,e.session,e.dialect,t)}return{select:n,selectDistinct:i,selectDistinctOn:s,update:o,insert:a,delete:l}}select(t){return new Or({fields:t??void 0,session:this.session,dialect:this.dialect})}selectDistinct(t){return new Or({fields:t??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(t,e){return new Or({fields:e??void 0,session:this.session,dialect:this.dialect,distinct:{on:t}})}update(t){return new xf(t,this.session,this.dialect)}insert(t){return new bf(t,this.session,this.dialect)}delete(t){return new _f(t,this.session,this.dialect)}refreshMaterializedView(t){return new QT(t,this.session,this.dialect)}execute(t){const e=typeof t=="string"?Y.raw(t):t.getSQL(),n=this.dialect.sqlToQuery(e),i=this.session.prepareQuery(n,void 0,void 0,!1);return new JT(()=>i.execute(void 0,this.authToken),e,n,s=>i.mapResult(s,!0))}transaction(t,e){return this.session.transaction(t,e)}}W($p,c0,"PgDatabase");var h0;h0=St;class t1{constructor(t){W(this,"authToken");W(this,"joinsNotNullableMap");this.query=t}getQuery(){return this.query}mapResult(t,e){return t}setToken(t){return this.authToken=t,this}}W(t1,h0,"PgPreparedQuery");var d0;d0=St;class e1{constructor(t){this.dialect=t}execute(t,e){return Ur.startActiveSpan("drizzle.operation",()=>Ur.startActiveSpan("drizzle.prepareQuery",()=>this.prepareQuery(this.dialect.sqlToQuery(t),void 0,void 0,!1)).setToken(e).execute(void 0,e))}all(t){return this.prepareQuery(this.dialect.sqlToQuery(t),void 0,void 0,!1).all()}async count(t,e){const n=await this.execute(t,e);return Number(n[0].count)}}W(e1,d0,"PgSession");var f0,p0;class r1 extends(p0=$p,f0=St,p0){constructor(t,e,n,i=0){super(t,e,n),this.schema=n,this.nestedIndex=i}rollback(){throw new CT}getTransactionConfigSQL(t){const e=[];return t.isolationLevel&&e.push(`isolation level ${t.isolationLevel}`),t.accessMode&&e.push(t.accessMode),typeof t.deferrable=="boolean"&&e.push(t.deferrable?"deferrable":"not deferrable"),Y.raw(e.join(" "))}setTransaction(t){return this.session.execute(Y`set transaction ${this.getTransactionConfigSQL(t)}`)}}W(r1,f0,"PgTransaction");function yv(r){return typeof r=="string"&&/^true$/i.test(r)}function kk(r){const t={scheme:"duckdb-wasm:"},e=new URL(r);if(!e.protocol.startsWith("duckdb-wasm:"))throw new Error(`Expected scheme to be "duckdb-wasm:" but got "${e.protocol}"`);e.searchParams.get("bundles")==="import-url"&&(t.bundles="import-url");const n=e.searchParams.get("logger");n&&yv(n)&&(t.logger=!0);const i=e.searchParams.get("storage");switch(i){case Ha.ORIGIN_PRIVATE_FS:{e.host.length>0&&console.warn(`Host "${e.host}" will be ignored while using Origin Private FS`);const s=e.searchParams.get("write");t.storage={type:Ha.ORIGIN_PRIVATE_FS,path:e.pathname.startsWith("/")?e.pathname.slice(1):e.pathname,...s&&yv(s)&&{accessMode:Bx.READ_WRITE}};break}case null:break;default:console.warn(`Unknown storage type "${i}"`);break}return t}var m0,g0;class n1 extends(g0=t1,m0=St,g0){constructor(t,e,n,i,s,o){super({sql:e,params:n}),this.client=t,this.queryString=e,this.params=n,this.logger=i,this.fields=s,this.customResultMapper=o}async execute(t={}){const e=pv(this.params,t);this.logger.logQuery(this.queryString,e);const{fields:n,queryString:i,client:s,customResultMapper:o}=this,a=await s;return a.query(i,e)}async all(t={}){const e=pv(this.params,t);return this.logger.logQuery(this.queryString,e),(await this.client).query(this.queryString,e)}}W(n1,m0,"DuckDBWasmPreparedQuery");var y0,v0;const Ju=class Ju extends(v0=e1,y0=St,v0){constructor(e,n,i,s={}){super(n);W(this,"logger");this.client=e,this.schema=i,this.options=s,this.logger=s.logger??new FT}prepareQuery(e,n,i,s,o){return new n1(this.client,e.sql,e.params,this.logger,n,o)}async query(e,n){return this.logger.logQuery(e,n),(await this.client).query(e,n)}async queryObjects(e,n){return this.logger.logQuery(e,n),(await this.client).query(e,n)}transaction(e,n){return GU(this.client,async i=>{const s=new Ju(i,this.dialect,this.schema,this.options),o=new If(this.dialect,s,this.schema);return n&&await o.setTransaction(n),e(o)})}};W(Ju,y0,"DuckDBWasmSession");let qu=Ju;var _0,b0;const tc=class tc extends(b0=r1,_0=St,b0){constructor(e,n,i,s=0){super(e,n,i,s);W(this,"dialect");W(this,"session");this.dialect=e,this.session=n}async transaction(e){return WU(this.session.client,"",async n=>{const i=new qu(n,this.dialect,this.schema,this.session.options),s=new tc(this.dialect,i,this.schema);return e(s)})}};W(tc,_0,"DuckDBWasmTransaction");let If=tc;var w0,x0;class i1 extends(x0=$p,w0=St,x0){}W(i1,w0,"DuckDBWasmDatabase");function Aa(r,t={}){const e=new Ea({casing:t.casing});let n;t.logger===!0?n=new RT:t.logger!==!1&&(n=t.logger);let i;if(t.schema){const a=Tk(t.schema,Mk);i={fullSchema:t.schema,schema:a.tables,tableNamesMap:a.tableNamesMap}}const s=new qu(r,e,i,{logger:n}),o=new i1(e,s,i);return o.$client=r,o}function vv(r,t){const e=kk(r);let n;return e.bundles==="import-url"?n=(async()=>{const s=await pf();switch(s){case"browser":return(await Ai(async()=>{const{getImportUrlBundles:o}=await import("./import-url-browser-CPN8ipMD.js");return{getImportUrlBundles:o}},__vite__mapDeps([3,4]))).getImportUrlBundles();case"node":return await(await Ai(async()=>{const{getImportUrlBundles:o}=await import("./import-url-node-BfNoxhRr.js");return{getImportUrlBundles:o}},__vite__mapDeps([5,4]))).getImportUrlBundles();default:throw new Error(`Unsupported environment: "${s}"`)}})():n=(async()=>{const s=await pf();switch(s){case"browser":return(await Ai(async()=>{const{getBundles:o}=await import("./default-browser-BrgSDbLD.js");return{getBundles:o}},[])).getBundles();case"node":return await(await Ai(async()=>{const{getBundles:o}=await import("./default-node-p_ysqrIS.js");return{getBundles:o}},__vite__mapDeps([0,1,2]))).getBundles();default:throw new Error(`Unsupported environment: "${s}"`)}})(),Aa(TT({bundles:n,logger:e.logger?new Ux:void 0,storage:e.storage}),t)}function _v(...r){if(typeof r[0]=="string")return vv(r[0],r[1]);if(wk(r[0])){const{connection:t,client:e,...n}=r[0];if(e)return Aa(e,n);if(typeof t=="string")return vv(t,n);if(typeof t>"u")throw new Error("connection option is required");return Aa(TT({bundles:t.bundles,logger:t.logger,storage:t.storage}),n)}return Aa(r[0],r[1])}(r=>{function t(e){return Aa({options:{parsers:{},serializers:{}}},e)}r.mock=t})(_v||(_v={}));var Gh={exports:{}};/*! JSZip v3.10.1 - A JavaScript class for generating and reading zip files diff --git a/assets/TestDummyMarker.vue_vue_type_script_setup_true_lang-Pam45T1i.js b/assets/TestDummyMarker.vue_vue_type_script_setup_true_lang-DRQbkM6R.js similarity index 98% rename from assets/TestDummyMarker.vue_vue_type_script_setup_true_lang-Pam45T1i.js rename to assets/TestDummyMarker.vue_vue_type_script_setup_true_lang-DRQbkM6R.js index 2822d560f7aea07945212609e97ba9a9dd8b8232..e2bcfefa1f103f5cf2b285535e19d317aafa15ba 100644 --- a/assets/TestDummyMarker.vue_vue_type_script_setup_true_lang-Pam45T1i.js +++ b/assets/TestDummyMarker.vue_vue_type_script_setup_true_lang-DRQbkM6R.js @@ -1 +1 @@ -import{bx as A,d as m,c3 as I,bW as g,c4 as T,c0 as x,x as f,o as c,y,m as w,u as i,b$ as R,cd as N,g as $,h as b,cp as E,bY as D,cq as L,w as z,c as V,by as H,E as K,cr as U,C as W,cs as Y,bM as G,bJ as q,b as k,bI as X,a as _,D as M,n as S,bn as F,br as C,l as J,H as Q}from"./index--eYU5aQm.js";import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";function O(t){return t?t.flatMap(e=>e.type===A?O(e.children):[e]):[]}const Z=m({name:"PrimitiveSlot",inheritAttrs:!1,setup(t,{attrs:e,slots:r}){return()=>{var p,v;if(!r.default)return null;const a=O(r.default()),n=a.findIndex(d=>d.type!==I);if(n===-1)return a;const l=a[n];(p=l.props)==null||delete p.ref;const o=l.props?g(e,l.props):e;e.class&&((v=l.props)!=null&&v.class)&&delete l.props.class;const u=T(l,o);for(const d in o)d.startsWith("on")&&(u.props||(u.props={}),u.props[d]=o[d]);return a.length===1?u:(a[n]=u,a)}}}),ee=["area","img","input"],B=m({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(t,{attrs:e,slots:r}){const a=t.asChild?"template":t.as;return typeof a=="string"&&ee.includes(a)?()=>x(a,e):a!=="template"?()=>x(t.as,e,{default:r.default}):()=>x(Z,e,{default:r.default})}}),te=m({__name:"VisuallyHidden",props:{feature:{default:"focusable"},asChild:{type:Boolean},as:{default:"span"}},setup(t){return(e,r)=>(c(),f(i(B),{as:e.as,"as-child":e.asChild,"aria-hidden":e.feature==="focusable"?"true":void 0,"data-hidden":e.feature==="fully-hidden"?"":void 0,tabindex:e.feature==="fully-hidden"?"-1":void 0,style:{position:"absolute",border:0,width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",wordWrap:"normal"}},{default:y(()=>[w(e.$slots,"default")]),_:3},8,["as","as-child","aria-hidden","data-hidden","tabindex"]))}});function ae(t,e){const r=`${t}Context`,a=Symbol(r);return[o=>{const u=R(a,o);if(u||u===null)return u;throw new Error(`Injection \`${a.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`)},o=>(N(a,o),o)]}function P(){const t=D(),e=$(),r=b(()=>{var o,u;return["#text","#comment"].includes((o=e.value)==null?void 0:o.$el.nodeName)?(u=e.value)==null?void 0:u.$el.nextElementSibling:E(e)}),a=Object.assign({},t.exposed),n={};for(const o in t.props)Object.defineProperty(n,o,{enumerable:!0,configurable:!0,get:()=>t.props[o]});if(Object.keys(a).length>0)for(const o in a)Object.defineProperty(n,o,{enumerable:!0,configurable:!0,get:()=>a[o]});Object.defineProperty(n,"$el",{enumerable:!0,configurable:!0,get:()=>t.vnode.el}),t.exposed=n;function l(o){e.value=o,o&&(Object.defineProperty(n,"$el",{enumerable:!0,configurable:!0,get:()=>o instanceof Element?o:o.$el}),t.exposed=n)}return{forwardRef:l,currentRef:e,currentElement:r}}function ne(){const t=$(),e=b(()=>{var r,a;return["#text","#comment"].includes((r=t.value)==null?void 0:r.$el.nodeName)?(a=t.value)==null?void 0:a.$el.nextElementSibling:E(t)});return{primitiveElement:t,currentElement:e}}function re(t){return b(()=>{var e;return L(t)?!!((e=E(t))!=null&&e.closest("form")):!0})}const j=m({inheritAttrs:!1,__name:"VisuallyHiddenInputBubble",props:{name:{},value:{},checked:{type:Boolean,default:void 0},required:{type:Boolean},disabled:{type:Boolean},feature:{default:"fully-hidden"}},setup(t){const e=t,{primitiveElement:r,currentElement:a}=ne(),n=b(()=>e.checked??e.value);return z(n,(l,o)=>{if(!a.value)return;const u=a.value,p=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(p,"value").set;if(d&&l!==o){const s=new Event("input",{bubbles:!0}),h=new Event("change",{bubbles:!0});d.call(u,l),u.dispatchEvent(s),u.dispatchEvent(h)}}),(l,o)=>(c(),f(te,g({ref_key:"primitiveElement",ref:r},{...e,...l.$attrs},{as:"input"}),null,16))}}),oe=m({inheritAttrs:!1,__name:"VisuallyHiddenInput",props:{name:{},value:{},checked:{type:Boolean,default:void 0},required:{type:Boolean},disabled:{type:Boolean},feature:{default:"fully-hidden"}},setup(t){const e=t,r=b(()=>typeof e.value=="object"&&Array.isArray(e.value)&&e.value.length===0&&e.required),a=b(()=>typeof e.value=="string"||typeof e.value=="number"||typeof e.value=="boolean"?[{name:e.name,value:e.value}]:typeof e.value=="object"&&Array.isArray(e.value)?e.value.flatMap((n,l)=>typeof n=="object"?Object.entries(n).map(([o,u])=>({name:`[${e.name}][${l}][${o}]`,value:u})):{name:`[${e.name}][${l}]`,value:n}):e.value!==null&&typeof e.value=="object"&&!Array.isArray(e.value)?Object.entries(e.value).map(([n,l])=>({name:`[${e.name}][${n}]`,value:l})):[]);return(n,l)=>r.value?(c(),f(j,g({key:n.name},{...e,...n.$attrs},{name:n.name,value:n.value}),null,16,["name","value"])):(c(!0),V(A,{key:1},H(a.value,o=>(c(),f(j,g({key:o.name,ref_for:!0},{...e,...n.$attrs},{name:o.name,value:o.value}),null,16,["name","value"]))),128))}}),[le,se]=ae("SwitchRoot"),ue=m({__name:"SwitchRoot",props:{defaultValue:{type:Boolean},modelValue:{type:[Boolean,null],default:void 0},disabled:{type:Boolean},id:{},value:{default:"on"},asChild:{type:Boolean},as:{default:"button"},name:{},required:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const r=t,a=e,{disabled:n}=K(r),l=U(r,"modelValue",a,{defaultValue:r.defaultValue,passive:r.modelValue===void 0});function o(){n.value||(l.value=!l.value)}const{forwardRef:u,currentElement:p}=P(),v=re(p),d=b(()=>{var s;return r.id&&p.value?(s=document.querySelector(`[for="${r.id}"]`))==null?void 0:s.innerText:void 0});return se({modelValue:l,toggleCheck:o,disabled:n}),(s,h)=>(c(),f(i(B),g(s.$attrs,{id:s.id,ref:i(u),role:"switch",type:s.as==="button"?"button":void 0,value:s.value,"aria-label":s.$attrs["aria-label"]||d.value,"aria-checked":i(l),"aria-required":s.required,"data-state":i(l)?"checked":"unchecked","data-disabled":i(n)?"":void 0,"as-child":s.asChild,as:s.as,disabled:i(n),onClick:o,onKeydown:Y(G(o,["prevent"]),["enter"])}),{default:y(()=>[w(s.$slots,"default",{modelValue:i(l)}),i(v)&&s.name?(c(),f(i(oe),{key:0,type:"checkbox",name:s.name,disabled:i(n),required:s.required,value:s.value,checked:!!i(l)},null,8,["name","disabled","required","value","checked"])):W("",!0)]),_:3},16,["id","type","value","aria-label","aria-checked","aria-required","data-state","data-disabled","as-child","as","disabled","onKeydown"]))}}),ie=m({__name:"SwitchThumb",props:{asChild:{type:Boolean},as:{default:"span"}},setup(t){const e=le();return P(),(r,a)=>{var n;return c(),f(i(B),{"data-state":(n=i(e).modelValue)!=null&&n.value?"checked":"unchecked","data-disabled":i(e).disabled.value?"":void 0,"as-child":r.asChild,as:r.as},{default:y(()=>[w(r.$slots,"default")]),_:3},8,["data-state","data-disabled","as-child","as"])}}}),de=m({__name:"Checkbox",props:{modelValue:{type:Boolean,required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=q(t,"modelValue");return(r,a)=>(c(),f(i(ue),{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=n=>e.value=n),transition:"background duration-250 ease-in-out",outline:"focus-within:none",flex:"~",border:"neutral-300 dark:neutral-700 data-[state=checked]:primary-200 data-[state=unchecked]:neutral-300 focus-within:neutral-800",bg:"data-[state=checked]:primary-400 data-[state=unchecked]:neutral-300 data-[state=checked]:dark:primary-400/80 dark:data-[state=unchecked]:neutral-800",relative:"","h-7":"",w:"12.5","rounded-full":"",shadow:"sm focus-within:shadow-neutral-800 focus-within:[0_0_0_1px] "},{default:y(()=>[k(i(ie),{"my-auto":"","size-6":"",flex:"","items-center":"","justify-center":"","translate-x":"0.5 data-[state=checked]:full","rounded-full":"","bg-white":"","text-xs":"","shadow-xl":"",transition:"transform duration-250 ease-in-out","will-change-transform":""})]),_:1},8,["modelValue"]))}}),ce={flex:"~ col gap-4"},me={flex:"~ row","items-center":"","gap-2":""},pe={flex:"1"},fe={class:"flex items-center gap-1 text-sm font-medium"},ve={class:"text-xs text-neutral-500 dark:text-neutral-400"},ke=m({__name:"FieldCheckbox",props:X({label:null,description:null},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,r=q(t,"modelValue");return(a,n)=>(c(),V("label",ce,[_("div",me,[_("div",pe,[_("div",fe,M(e.label),1),_("div",ve,M(e.description),1)]),k(de,{modelValue:r.value,"onUpdate:modelValue":n[0]||(n[0]=l=>r.value=l)},null,8,["modelValue"])])]))}}),he=m({__name:"Volumed",props:{perspective:null,transform:null},setup(t){return(e,r)=>(c(),V("div",{class:"volumed",style:S({perspective:`${t.perspective}px`,transform:t.transform})},[w(e.$slots,"default",{},void 0,!0)],4))}}),be=F(he,[["__scopeId","data-v-568551bc"]]),ye=m({__name:"CursorMomentum",props:{baseSpeed:{default:.1},friction:{default:.95},momentumFactor:{default:.005}},setup(t,{expose:e}){const r=t,a=$(1),n=$(0);let l=0;const o=C(()=>r.friction),u=C(()=>r.baseSpeed),p=C(()=>r.momentumFactor);function v(s){l||(l=s);const h=s-l;l=s,a.value=u.value+(a.value-u.value)*o.value,n.value+=a.value*h,requestAnimationFrame(v)}function d(s){const h=Math.sqrt(s.movementX**2+s.movementY**2);a.value+=h*p.value}return J(()=>{window.addEventListener("mousemove",d),requestAnimationFrame(v)}),Q(()=>{window.removeEventListener("mousemove",d)}),e({momentum:a,currentValue:n}),(s,h)=>w(s.$slots,"default",{momentum:a.value,currentValue:n.value})}}),_e=m({__name:"TestDummyMarkerFlat",props:{size:null},setup(t){return(e,r)=>(c(),V("div",{class:"test-dummy-flat",style:S({width:`${t.size}px`,height:`${t.size}px`})},r[0]||(r[0]=[_("div",{class:"marker"},null,-1)]),4))}}),ge=F(_e,[["__scopeId","data-v-b4ef37ac"]]),Ve=m({__name:"TestDummyMarker",setup(t){return(e,r)=>(c(),f(ye,{"base-speed":.1,friction:.95,"momentum-factor":5e-4},{default:y(({currentValue:a})=>[k(be,{perspective:800,transform:"rotateX(45deg) translateY(3px)"},{default:y(()=>[k(ge,{size:24,style:S({transform:`rotate(${a}deg)`})},null,8,["style"])]),_:2},1024)]),_:1}))}});export{ke as _,Ve as a}; +import{bx as A,d as m,c3 as I,bW as g,c4 as T,c0 as x,x as f,o as c,y,m as w,u as i,b$ as R,cd as N,g as $,h as b,cp as E,bY as D,cq as L,w as z,c as V,by as H,E as K,cr as U,C as W,cs as Y,bM as G,bJ as q,b as k,bI as X,a as _,D as M,n as S,bn as F,br as C,l as J,H as Q}from"./index-D55VqdU4.js";import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";function O(t){return t?t.flatMap(e=>e.type===A?O(e.children):[e]):[]}const Z=m({name:"PrimitiveSlot",inheritAttrs:!1,setup(t,{attrs:e,slots:r}){return()=>{var p,v;if(!r.default)return null;const a=O(r.default()),n=a.findIndex(d=>d.type!==I);if(n===-1)return a;const l=a[n];(p=l.props)==null||delete p.ref;const o=l.props?g(e,l.props):e;e.class&&((v=l.props)!=null&&v.class)&&delete l.props.class;const u=T(l,o);for(const d in o)d.startsWith("on")&&(u.props||(u.props={}),u.props[d]=o[d]);return a.length===1?u:(a[n]=u,a)}}}),ee=["area","img","input"],B=m({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(t,{attrs:e,slots:r}){const a=t.asChild?"template":t.as;return typeof a=="string"&&ee.includes(a)?()=>x(a,e):a!=="template"?()=>x(t.as,e,{default:r.default}):()=>x(Z,e,{default:r.default})}}),te=m({__name:"VisuallyHidden",props:{feature:{default:"focusable"},asChild:{type:Boolean},as:{default:"span"}},setup(t){return(e,r)=>(c(),f(i(B),{as:e.as,"as-child":e.asChild,"aria-hidden":e.feature==="focusable"?"true":void 0,"data-hidden":e.feature==="fully-hidden"?"":void 0,tabindex:e.feature==="fully-hidden"?"-1":void 0,style:{position:"absolute",border:0,width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",wordWrap:"normal"}},{default:y(()=>[w(e.$slots,"default")]),_:3},8,["as","as-child","aria-hidden","data-hidden","tabindex"]))}});function ae(t,e){const r=`${t}Context`,a=Symbol(r);return[o=>{const u=R(a,o);if(u||u===null)return u;throw new Error(`Injection \`${a.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`)},o=>(N(a,o),o)]}function P(){const t=D(),e=$(),r=b(()=>{var o,u;return["#text","#comment"].includes((o=e.value)==null?void 0:o.$el.nodeName)?(u=e.value)==null?void 0:u.$el.nextElementSibling:E(e)}),a=Object.assign({},t.exposed),n={};for(const o in t.props)Object.defineProperty(n,o,{enumerable:!0,configurable:!0,get:()=>t.props[o]});if(Object.keys(a).length>0)for(const o in a)Object.defineProperty(n,o,{enumerable:!0,configurable:!0,get:()=>a[o]});Object.defineProperty(n,"$el",{enumerable:!0,configurable:!0,get:()=>t.vnode.el}),t.exposed=n;function l(o){e.value=o,o&&(Object.defineProperty(n,"$el",{enumerable:!0,configurable:!0,get:()=>o instanceof Element?o:o.$el}),t.exposed=n)}return{forwardRef:l,currentRef:e,currentElement:r}}function ne(){const t=$(),e=b(()=>{var r,a;return["#text","#comment"].includes((r=t.value)==null?void 0:r.$el.nodeName)?(a=t.value)==null?void 0:a.$el.nextElementSibling:E(t)});return{primitiveElement:t,currentElement:e}}function re(t){return b(()=>{var e;return L(t)?!!((e=E(t))!=null&&e.closest("form")):!0})}const j=m({inheritAttrs:!1,__name:"VisuallyHiddenInputBubble",props:{name:{},value:{},checked:{type:Boolean,default:void 0},required:{type:Boolean},disabled:{type:Boolean},feature:{default:"fully-hidden"}},setup(t){const e=t,{primitiveElement:r,currentElement:a}=ne(),n=b(()=>e.checked??e.value);return z(n,(l,o)=>{if(!a.value)return;const u=a.value,p=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(p,"value").set;if(d&&l!==o){const s=new Event("input",{bubbles:!0}),h=new Event("change",{bubbles:!0});d.call(u,l),u.dispatchEvent(s),u.dispatchEvent(h)}}),(l,o)=>(c(),f(te,g({ref_key:"primitiveElement",ref:r},{...e,...l.$attrs},{as:"input"}),null,16))}}),oe=m({inheritAttrs:!1,__name:"VisuallyHiddenInput",props:{name:{},value:{},checked:{type:Boolean,default:void 0},required:{type:Boolean},disabled:{type:Boolean},feature:{default:"fully-hidden"}},setup(t){const e=t,r=b(()=>typeof e.value=="object"&&Array.isArray(e.value)&&e.value.length===0&&e.required),a=b(()=>typeof e.value=="string"||typeof e.value=="number"||typeof e.value=="boolean"?[{name:e.name,value:e.value}]:typeof e.value=="object"&&Array.isArray(e.value)?e.value.flatMap((n,l)=>typeof n=="object"?Object.entries(n).map(([o,u])=>({name:`[${e.name}][${l}][${o}]`,value:u})):{name:`[${e.name}][${l}]`,value:n}):e.value!==null&&typeof e.value=="object"&&!Array.isArray(e.value)?Object.entries(e.value).map(([n,l])=>({name:`[${e.name}][${n}]`,value:l})):[]);return(n,l)=>r.value?(c(),f(j,g({key:n.name},{...e,...n.$attrs},{name:n.name,value:n.value}),null,16,["name","value"])):(c(!0),V(A,{key:1},H(a.value,o=>(c(),f(j,g({key:o.name,ref_for:!0},{...e,...n.$attrs},{name:o.name,value:o.value}),null,16,["name","value"]))),128))}}),[le,se]=ae("SwitchRoot"),ue=m({__name:"SwitchRoot",props:{defaultValue:{type:Boolean},modelValue:{type:[Boolean,null],default:void 0},disabled:{type:Boolean},id:{},value:{default:"on"},asChild:{type:Boolean},as:{default:"button"},name:{},required:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const r=t,a=e,{disabled:n}=K(r),l=U(r,"modelValue",a,{defaultValue:r.defaultValue,passive:r.modelValue===void 0});function o(){n.value||(l.value=!l.value)}const{forwardRef:u,currentElement:p}=P(),v=re(p),d=b(()=>{var s;return r.id&&p.value?(s=document.querySelector(`[for="${r.id}"]`))==null?void 0:s.innerText:void 0});return se({modelValue:l,toggleCheck:o,disabled:n}),(s,h)=>(c(),f(i(B),g(s.$attrs,{id:s.id,ref:i(u),role:"switch",type:s.as==="button"?"button":void 0,value:s.value,"aria-label":s.$attrs["aria-label"]||d.value,"aria-checked":i(l),"aria-required":s.required,"data-state":i(l)?"checked":"unchecked","data-disabled":i(n)?"":void 0,"as-child":s.asChild,as:s.as,disabled:i(n),onClick:o,onKeydown:Y(G(o,["prevent"]),["enter"])}),{default:y(()=>[w(s.$slots,"default",{modelValue:i(l)}),i(v)&&s.name?(c(),f(i(oe),{key:0,type:"checkbox",name:s.name,disabled:i(n),required:s.required,value:s.value,checked:!!i(l)},null,8,["name","disabled","required","value","checked"])):W("",!0)]),_:3},16,["id","type","value","aria-label","aria-checked","aria-required","data-state","data-disabled","as-child","as","disabled","onKeydown"]))}}),ie=m({__name:"SwitchThumb",props:{asChild:{type:Boolean},as:{default:"span"}},setup(t){const e=le();return P(),(r,a)=>{var n;return c(),f(i(B),{"data-state":(n=i(e).modelValue)!=null&&n.value?"checked":"unchecked","data-disabled":i(e).disabled.value?"":void 0,"as-child":r.asChild,as:r.as},{default:y(()=>[w(r.$slots,"default")]),_:3},8,["data-state","data-disabled","as-child","as"])}}}),de=m({__name:"Checkbox",props:{modelValue:{type:Boolean,required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=q(t,"modelValue");return(r,a)=>(c(),f(i(ue),{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=n=>e.value=n),transition:"background duration-250 ease-in-out",outline:"focus-within:none",flex:"~",border:"neutral-300 dark:neutral-700 data-[state=checked]:primary-200 data-[state=unchecked]:neutral-300 focus-within:neutral-800",bg:"data-[state=checked]:primary-400 data-[state=unchecked]:neutral-300 data-[state=checked]:dark:primary-400/80 dark:data-[state=unchecked]:neutral-800",relative:"","h-7":"",w:"12.5","rounded-full":"",shadow:"sm focus-within:shadow-neutral-800 focus-within:[0_0_0_1px] "},{default:y(()=>[k(i(ie),{"my-auto":"","size-6":"",flex:"","items-center":"","justify-center":"","translate-x":"0.5 data-[state=checked]:full","rounded-full":"","bg-white":"","text-xs":"","shadow-xl":"",transition:"transform duration-250 ease-in-out","will-change-transform":""})]),_:1},8,["modelValue"]))}}),ce={flex:"~ col gap-4"},me={flex:"~ row","items-center":"","gap-2":""},pe={flex:"1"},fe={class:"flex items-center gap-1 text-sm font-medium"},ve={class:"text-xs text-neutral-500 dark:text-neutral-400"},ke=m({__name:"FieldCheckbox",props:X({label:null,description:null},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,r=q(t,"modelValue");return(a,n)=>(c(),V("label",ce,[_("div",me,[_("div",pe,[_("div",fe,M(e.label),1),_("div",ve,M(e.description),1)]),k(de,{modelValue:r.value,"onUpdate:modelValue":n[0]||(n[0]=l=>r.value=l)},null,8,["modelValue"])])]))}}),he=m({__name:"Volumed",props:{perspective:null,transform:null},setup(t){return(e,r)=>(c(),V("div",{class:"volumed",style:S({perspective:`${t.perspective}px`,transform:t.transform})},[w(e.$slots,"default",{},void 0,!0)],4))}}),be=F(he,[["__scopeId","data-v-568551bc"]]),ye=m({__name:"CursorMomentum",props:{baseSpeed:{default:.1},friction:{default:.95},momentumFactor:{default:.005}},setup(t,{expose:e}){const r=t,a=$(1),n=$(0);let l=0;const o=C(()=>r.friction),u=C(()=>r.baseSpeed),p=C(()=>r.momentumFactor);function v(s){l||(l=s);const h=s-l;l=s,a.value=u.value+(a.value-u.value)*o.value,n.value+=a.value*h,requestAnimationFrame(v)}function d(s){const h=Math.sqrt(s.movementX**2+s.movementY**2);a.value+=h*p.value}return J(()=>{window.addEventListener("mousemove",d),requestAnimationFrame(v)}),Q(()=>{window.removeEventListener("mousemove",d)}),e({momentum:a,currentValue:n}),(s,h)=>w(s.$slots,"default",{momentum:a.value,currentValue:n.value})}}),_e=m({__name:"TestDummyMarkerFlat",props:{size:null},setup(t){return(e,r)=>(c(),V("div",{class:"test-dummy-flat",style:S({width:`${t.size}px`,height:`${t.size}px`})},r[0]||(r[0]=[_("div",{class:"marker"},null,-1)]),4))}}),ge=F(_e,[["__scopeId","data-v-b4ef37ac"]]),Ve=m({__name:"TestDummyMarker",setup(t){return(e,r)=>(c(),f(ye,{"base-speed":.1,friction:.95,"momentum-factor":5e-4},{default:y(({currentValue:a})=>[k(be,{perspective:800,transform:"rotateX(45deg) translateY(3px)"},{default:y(()=>[k(ge,{size:24,style:S({transform:`rotate(${a}deg)`})},null,8,["style"])]),_:2},1024)]),_:1}))}});export{ke as _,Ve as a}; diff --git a/assets/Textarea.vue_vue_type_script_setup_true_lang-DwFb1myn.js b/assets/Textarea.vue_vue_type_script_setup_true_lang-NzxEJo0x.js similarity index 71% rename from assets/Textarea.vue_vue_type_script_setup_true_lang-DwFb1myn.js rename to assets/Textarea.vue_vue_type_script_setup_true_lang-NzxEJo0x.js index e36ef40dcb1852c9addeb569e982f7c38a96bd5b..9ae9adae625d22f8eab3096314bf5b57250ea21b 100644 --- a/assets/Textarea.vue_vue_type_script_setup_true_lang-DwFb1myn.js +++ b/assets/Textarea.vue_vue_type_script_setup_true_lang-NzxEJo0x.js @@ -1 +1 @@ -import{_ as u}from"./Basic.vue_vue_type_script_setup_true_lang-Ckn2TiNk.js";import{d as t,bJ as r,x as n,o as d}from"./index--eYU5aQm.js";const p=t({__name:"Textarea",props:{modelValue:{default:""},modelModifiers:{}},emits:["update:modelValue"],setup(o){const e=r(o,"modelValue");return(s,a)=>(d(),n(u,{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=l=>e.value=l),border:"neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700",transition:"all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900","rounded-lg":"","px-3":"","py-2":"","text-sm":"","outline-none":""},null,8,["modelValue"]))}});export{p as _}; +import{_ as u}from"./Basic.vue_vue_type_script_setup_true_lang-DJ4kS-zi.js";import{d as t,bJ as r,x as n,o as d}from"./index-D55VqdU4.js";const p=t({__name:"Textarea",props:{modelValue:{default:""},modelModifiers:{}},emits:["update:modelValue"],setup(o){const e=r(o,"modelValue");return(s,a)=>(d(),n(u,{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=l=>e.value=l),border:"neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700",transition:"all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900","rounded-lg":"","px-3":"","py-2":"","text-sm":"","outline-none":""},null,8,["modelValue"]))}});export{p as _}; diff --git a/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-BHnSNWo1.js b/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-BbB31kj-.js similarity index 93% rename from assets/TransitionVertical.vue_vue_type_script_setup_true_lang-BHnSNWo1.js rename to assets/TransitionVertical.vue_vue_type_script_setup_true_lang-BbB31kj-.js index e4a60852bcc7e79c2e3a725aeaab6d339be2c05a..c73c40cca5e7d8c987d9ae2691184a2b22c16ab8 100644 --- a/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-BHnSNWo1.js +++ b/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-BbB31kj-.js @@ -1 +1 @@ -import{d as m,x as T,o as l,bB as B,y as b,m as v}from"./index--eYU5aQm.js";const n="0px",W=m({__name:"TransitionVertical",props:{duration:{default:250},easingEnter:{default:"ease-in-out"},easingLeave:{default:"ease-in-out"},opacityClosed:{default:0},opacityOpened:{default:1}},setup(c){const r=c;function p(o){return{height:o.style.height,width:o.style.width,position:o.style.position,visibility:o.style.visibility,overflow:o.style.overflow,paddingTop:o.style.paddingTop,paddingBottom:o.style.paddingBottom,borderTopWidth:o.style.borderTopWidth,borderBottomWidth:o.style.borderBottomWidth,marginTop:o.style.marginTop,marginBottom:o.style.marginBottom}}function y(o,t){const{width:i}=getComputedStyle(o);o.style.width=i,o.style.position="absolute",o.style.visibility="hidden",o.style.height="";const{height:s}=getComputedStyle(o);return o.style.width=t.width,o.style.position=t.position,o.style.visibility=t.visibility,o.style.height=n,o.style.overflow="hidden",t.height&&t.height!==n?t.height:s}function h(o,t,i,s,d){const e=o.animate(s,d);o.style.height=t.height,e.onfinish=()=>{o.style.overflow=t.overflow,i()}}function g(o,t){return[{height:n,opacity:r.opacityClosed,paddingTop:n,paddingBottom:n,borderTopWidth:n,borderBottomWidth:n,marginTop:n,marginBottom:n},{height:o,opacity:r.opacityOpened,paddingTop:t.paddingTop,paddingBottom:t.paddingBottom,borderTopWidth:t.borderTopWidth,borderBottomWidth:t.borderBottomWidth,marginTop:t.marginTop,marginBottom:t.marginBottom}]}function u(o,t){const i=o,s=p(i),d=y(i,s),e=g(d,s),a={duration:r.duration,easing:r.easingEnter};h(i,s,t,e,a)}function f(o,t){const i=o,s=p(i),{height:d}=getComputedStyle(i);i.style.height=d,i.style.overflow="hidden";const e=g(d,s).reverse(),a={duration:r.duration,easing:r.easingLeave};h(i,s,t,e,a)}return(o,t)=>(l(),T(B,{css:!1,onEnter:u,onLeave:f},{default:b(()=>[v(o.$slots,"default")]),_:3}))}});export{W as _}; +import{d as m,x as T,o as l,bB as B,y as b,m as v}from"./index-D55VqdU4.js";const n="0px",W=m({__name:"TransitionVertical",props:{duration:{default:250},easingEnter:{default:"ease-in-out"},easingLeave:{default:"ease-in-out"},opacityClosed:{default:0},opacityOpened:{default:1}},setup(c){const r=c;function p(o){return{height:o.style.height,width:o.style.width,position:o.style.position,visibility:o.style.visibility,overflow:o.style.overflow,paddingTop:o.style.paddingTop,paddingBottom:o.style.paddingBottom,borderTopWidth:o.style.borderTopWidth,borderBottomWidth:o.style.borderBottomWidth,marginTop:o.style.marginTop,marginBottom:o.style.marginBottom}}function y(o,t){const{width:i}=getComputedStyle(o);o.style.width=i,o.style.position="absolute",o.style.visibility="hidden",o.style.height="";const{height:s}=getComputedStyle(o);return o.style.width=t.width,o.style.position=t.position,o.style.visibility=t.visibility,o.style.height=n,o.style.overflow="hidden",t.height&&t.height!==n?t.height:s}function h(o,t,i,s,d){const e=o.animate(s,d);o.style.height=t.height,e.onfinish=()=>{o.style.overflow=t.overflow,i()}}function g(o,t){return[{height:n,opacity:r.opacityClosed,paddingTop:n,paddingBottom:n,borderTopWidth:n,borderBottomWidth:n,marginTop:n,marginBottom:n},{height:o,opacity:r.opacityOpened,paddingTop:t.paddingTop,paddingBottom:t.paddingBottom,borderTopWidth:t.borderTopWidth,borderBottomWidth:t.borderBottomWidth,marginTop:t.marginTop,marginBottom:t.marginBottom}]}function u(o,t){const i=o,s=p(i),d=y(i,s),e=g(d,s),a={duration:r.duration,easing:r.easingEnter};h(i,s,t,e,a)}function f(o,t){const i=o,s=p(i),{height:d}=getComputedStyle(i);i.style.height=d,i.style.overflow="hidden";const e=g(d,s).reverse(),a={duration:r.duration,easing:r.easingLeave};h(i,s,t,e,a)}return(o,t)=>(l(),T(B,{css:!1,onEnter:u,onLeave:f},{default:b(()=>[v(o.$slots,"default")]),_:3}))}});export{W as _}; diff --git a/assets/_...all_-CO59XhD5.js b/assets/_...all_-CZoKQ0-e.js similarity index 64% rename from assets/_...all_-CO59XhD5.js rename to assets/_...all_-CZoKQ0-e.js index 220d9e7aac112bf4ec3dc87092806c601418b2f7..14a8c153d416db9e7db5ebc5d73df1f1af746dc9 100644 --- a/assets/_...all_-CO59XhD5.js +++ b/assets/_...all_-CZoKQ0-e.js @@ -1 +1 @@ -import{bn as e,c as n,o as c}from"./index--eYU5aQm.js";const o={};function _(t,r){return c(),n("div",null," 404 - Page not found ")}const s=e(o,[["render",_]]);export{s as default}; +import{bn as e,c as n,o as c}from"./index-D55VqdU4.js";const o={};function _(t,r){return c(),n("div",null," 404 - Page not found ")}const s=e(o,[["render",_]]);export{s as default}; diff --git a/assets/airi-card-_ueLLZ0g.js b/assets/airi-card-TTCASwDd.js similarity index 94% rename from assets/airi-card-_ueLLZ0g.js rename to assets/airi-card-TTCASwDd.js index e699b501ae5ef2a0ffed701a68911efe310caa64..233726370e386b6ee79d97572c17ab9b0b10823f 100644 --- a/assets/airi-card-_ueLLZ0g.js +++ b/assets/airi-card-TTCASwDd.js @@ -1,4 +1,4 @@ -import{f as W,bD as L,h as g,s as O,l as $,q as b,w as q}from"./index--eYU5aQm.js";import{j as G}from"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{u as H}from"./consciousness-NMirv8Xi.js";import{u as N}from"./speech-BOhrg3WS.js";function k(a,u){return{role:"system",content:[a,G.map(n=>`- ${n}`).join(` +import{f as W,bD as L,h as g,s as O,l as $,q as b,w as q}from"./index-D55VqdU4.js";import{j as G}from"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{u as H}from"./consciousness-BGmbU4M0.js";import{u as N}from"./speech-BtNOtIn9.js";function k(a,u){return{role:"system",content:[a,G.map(n=>`- ${n}`).join(` `),u].join(` `)}}const Q=W("airi-card",()=>{const a=L("airi-cards",new Map),u=L("airi-card-active-id","default"),n=g(()=>a.value.get(u.value)),P=H(),R=N(),{activeModel:l}=O(P),{activeSpeechVoiceId:m,activeSpeechModel:p}=O(R),B=s=>{const e=crypto.randomUUID();return a.value.set(e,h(s)),e},D=s=>{a.value.delete(s)},V=s=>a.value.get(s);function v(s){var t,r,i,c,d,f,_,y,S,x,C,M,I,w,E,A,j,T,U;const e="data"in s?(r=(t=s.data)==null?void 0:t.extensions)==null?void 0:r.airi:(i=s.extensions)==null?void 0:i.airi,o={consciousness:{model:l.value},speech:{model:p.value,voice_id:m.value}};return e?{modules:{consciousness:{model:((d=(c=e.modules)==null?void 0:c.consciousness)==null?void 0:d.model)??o.consciousness.model},speech:{model:((_=(f=e.modules)==null?void 0:f.speech)==null?void 0:_.model)??o.speech.model,voice_id:((S=(y=e.modules)==null?void 0:y.speech)==null?void 0:S.voice_id)??o.speech.voice_id,pitch:(C=(x=e.modules)==null?void 0:x.speech)==null?void 0:C.pitch,rate:(I=(M=e.modules)==null?void 0:M.speech)==null?void 0:I.rate,ssml:(E=(w=e.modules)==null?void 0:w.speech)==null?void 0:E.ssml,language:(j=(A=e.modules)==null?void 0:A.speech)==null?void 0:j.language},vrm:(T=e.modules)==null?void 0:T.vrm,live2d:(U=e.modules)==null?void 0:U.live2d},agents:e.agents??{}}:{modules:o,agents:{}}}function h(s){if("data"in s){const e=s;return{name:e.data.name,version:e.data.character_version??"1.0.0",description:e.data.description??"",creator:e.data.creator??"",notes:e.data.creator_notes??"",notesMultilingual:e.data.creator_notes_multilingual,personality:e.data.personality??"",scenario:e.data.scenario??"",greetings:[e.data.first_mes,...e.data.alternate_greetings??[]],greetingsGroupOnly:e.data.group_only_greetings??[],systemPrompt:e.data.system_prompt??"",postHistoryInstructions:e.data.post_history_instructions??"",messageExample:e.data.mes_example?e.data.mes_example.split(` diff --git a/assets/alibaba-cloud-model-studio-Dt0yEM1s.js b/assets/alibaba-cloud-model-studio-BNtzry17.js similarity index 72% rename from assets/alibaba-cloud-model-studio-Dt0yEM1s.js rename to assets/alibaba-cloud-model-studio-BNtzry17.js index 06859e979fc299f2a83844cf02f52d3500026413..85967ef27c10ea48edf2205d46155018a492f632 100644 --- a/assets/alibaba-cloud-model-studio-Dt0yEM1s.js +++ b/assets/alibaba-cloud-model-studio-BNtzry17.js @@ -1 +1 @@ -import{_ as m}from"./FieldRange.vue_vue_type_script_setup_true_lang-DcZafZ9u.js";import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{d as M,g as u,s as S,q as F,h as V,l as $,w as v,x as k,o as B,y as h,b as c,u as i,a as I}from"./index--eYU5aQm.js";import{u as U}from"./providers-YQf-rDZ1.js";import{u as E}from"./speech-BOhrg3WS.js";import{_ as K,a as L}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-CYRUbdP0.js";import"./index-Be1NqeGb.js";import"./TestDummyMarker.vue_vue_type_script_setup_true_lang-Pam45T1i.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dsoa87PD.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-CWkRm8IH.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BHnSNWo1.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-CriF7G5j.js";import"./Input.vue_vue_type_script_setup_true_lang-DaL4uFR_.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CCsf2oJB.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BJL9_E_2.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";const N={flex:"~ col gap-4"},o="alibaba-cloud-model-studio",y="cosyvoice-v1",oe=M({__name:"alibaba-cloud-model-studio",setup(T){const f={speed:1},d=u(0),l=u(1),n=u(0),p=E(),a=U(),{providers:g}=S(a),{t:s}=F(),P=V(()=>{var e;return!!((e=g.value[o])!=null&&e.apiKey)}),_=V(()=>p.availableVoices[o]||[]);async function w(e,r,t){const b=a.getProviderInstance(o);if(!b)throw new Error("Failed to initialize speech provider");const C=a.getProviderConfig(o),x=C.model||y;return await p.speech(b,x,e,r,{...C,...f})}return $(async()=>{const e=a.getProviderConfig(o);await a.getProviderMetadata(o).validators.validateProviderConfig(e)?await p.loadVoicesForProvider(o):console.error("Failed to validate provider config",e)}),v(d,async()=>{const e=a.getProviderConfig(o);e.pitch=d.value}),v(l,async()=>{const e=a.getProviderConfig(o);e.speed=l.value}),v(n,async()=>{const e=a.getProviderConfig(o);e.volume=n.value}),v(g,async()=>{const e=a.getProviderConfig(o);await a.getProviderMetadata(o).validators.validateProviderConfig(e)?await p.loadVoicesForProvider(o):console.error("Failed to validate provider config",e)},{immediate:!0}),(e,r)=>(B(),k(i(L),{"provider-id":o,"default-model":y,"additional-settings":f},{"voice-settings":h(()=>[I("div",N,[c(i(m),{modelValue:d.value,"onUpdate:modelValue":r[0]||(r[0]=t=>d.value=t),label:i(s)("settings.pages.providers.provider.common.fields.field.pitch.label"),description:i(s)("settings.pages.providers.provider.common.fields.field.pitch.description"),min:-100,max:100,step:1,"format-value":t=>`${t}%`},null,8,["modelValue","label","description","format-value"]),c(i(m),{modelValue:l.value,"onUpdate:modelValue":r[1]||(r[1]=t=>l.value=t),label:i(s)("settings.pages.providers.provider.common.fields.field.speed.label"),description:i(s)("settings.pages.providers.provider.common.fields.field.speed.description"),min:.5,max:2,step:.01},null,8,["modelValue","label","description"]),c(i(m),{modelValue:n.value,"onUpdate:modelValue":r[2]||(r[2]=t=>n.value=t),label:i(s)("settings.pages.providers.provider.common.fields.field.volume.label"),description:i(s)("settings.pages.providers.provider.common.fields.field.volume.description"),min:-100,max:100,step:1,"format-value":t=>`${t}%`},null,8,["modelValue","label","description","format-value"])])]),playground:h(()=>[c(i(K),{"available-voices":_.value,"generate-speech":w,"api-key-configured":P.value,"default-text":"Hello! This is a test of the ElevenLabs voice synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});export{oe as default}; +import{_ as m}from"./FieldRange.vue_vue_type_script_setup_true_lang-CtbCdbG8.js";import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{d as M,g as u,s as S,q as F,h as V,l as $,w as v,x as k,o as B,y as h,b as c,u as i,a as I}from"./index-D55VqdU4.js";import{u as U}from"./providers-DAp1566d.js";import{u as E}from"./speech-BtNOtIn9.js";import{_ as K,a as L}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-CPbYTBJt.js";import"./index-Be1NqeGb.js";import"./TestDummyMarker.vue_vue_type_script_setup_true_lang-DRQbkM6R.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-BtshDojk.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BDoHyduV.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BbB31kj-.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DQP2RhYC.js";import"./Input.vue_vue_type_script_setup_true_lang-CeU0PE9S.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BMPV9bKe.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DLyRry-6.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";const N={flex:"~ col gap-4"},o="alibaba-cloud-model-studio",y="cosyvoice-v1",oe=M({__name:"alibaba-cloud-model-studio",setup(T){const f={speed:1},d=u(0),l=u(1),n=u(0),p=E(),a=U(),{providers:g}=S(a),{t:s}=F(),P=V(()=>{var e;return!!((e=g.value[o])!=null&&e.apiKey)}),_=V(()=>p.availableVoices[o]||[]);async function w(e,r,t){const b=a.getProviderInstance(o);if(!b)throw new Error("Failed to initialize speech provider");const C=a.getProviderConfig(o),x=C.model||y;return await p.speech(b,x,e,r,{...C,...f})}return $(async()=>{const e=a.getProviderConfig(o);await a.getProviderMetadata(o).validators.validateProviderConfig(e)?await p.loadVoicesForProvider(o):console.error("Failed to validate provider config",e)}),v(d,async()=>{const e=a.getProviderConfig(o);e.pitch=d.value}),v(l,async()=>{const e=a.getProviderConfig(o);e.speed=l.value}),v(n,async()=>{const e=a.getProviderConfig(o);e.volume=n.value}),v(g,async()=>{const e=a.getProviderConfig(o);await a.getProviderMetadata(o).validators.validateProviderConfig(e)?await p.loadVoicesForProvider(o):console.error("Failed to validate provider config",e)},{immediate:!0}),(e,r)=>(B(),k(i(L),{"provider-id":o,"default-model":y,"additional-settings":f},{"voice-settings":h(()=>[I("div",N,[c(i(m),{modelValue:d.value,"onUpdate:modelValue":r[0]||(r[0]=t=>d.value=t),label:i(s)("settings.pages.providers.provider.common.fields.field.pitch.label"),description:i(s)("settings.pages.providers.provider.common.fields.field.pitch.description"),min:-100,max:100,step:1,"format-value":t=>`${t}%`},null,8,["modelValue","label","description","format-value"]),c(i(m),{modelValue:l.value,"onUpdate:modelValue":r[1]||(r[1]=t=>l.value=t),label:i(s)("settings.pages.providers.provider.common.fields.field.speed.label"),description:i(s)("settings.pages.providers.provider.common.fields.field.speed.description"),min:.5,max:2,step:.01},null,8,["modelValue","label","description"]),c(i(m),{modelValue:n.value,"onUpdate:modelValue":r[2]||(r[2]=t=>n.value=t),label:i(s)("settings.pages.providers.provider.common.fields.field.volume.label"),description:i(s)("settings.pages.providers.provider.common.fields.field.volume.description"),min:-100,max:100,step:1,"format-value":t=>`${t}%`},null,8,["modelValue","label","description","format-value"])])]),playground:h(()=>[c(i(K),{"available-voices":_.value,"generate-speech":w,"api-key-configured":P.value,"default-text":"Hello! This is a test of the ElevenLabs voice synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});export{oe as default}; diff --git a/assets/anthropic-Djw1RdIl.js b/assets/anthropic-DeoGf-kT.js similarity index 80% rename from assets/anthropic-Djw1RdIl.js rename to assets/anthropic-DeoGf-kT.js index 703c4e0338c2c6c885153f92c35c282538a9ecc5..4185d6679f4b6c38d3ab60aa777df78b6d654197 100644 --- a/assets/anthropic-Djw1RdIl.js +++ b/assets/anthropic-DeoGf-kT.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{d as k,q as x,bG as S,s as U,h as v,l as w,w as V,x as C,o as K,y as u,a as i,b as l,bL as p,u as t}from"./index--eYU5aQm.js";import{u as R}from"./providers-YQf-rDZ1.js";import{_ as O,a as $}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dsoa87PD.js";import{_ as A}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CCsf2oJB.js";import{_ as I,a as N}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BJL9_E_2.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DVunqc-i.js";import"./index-Be1NqeGb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-CWkRm8IH.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BHnSNWo1.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-CriF7G5j.js";import"./Input.vue_vue_type_script_setup_true_lang-DaL4uFR_.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";const e="anthropic",Q=k({__name:"anthropic",setup(T){const{t:c}=x(),_=S(),h=R(),{providers:a}=U(h),m=v(()=>h.getProviderMetadata(e)),s=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.apiKey)||""},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].apiKey=o}}),n=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.baseUrl)||"https://api.anthropic.com/v1/"},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].baseUrl=o}});w(()=>{var o,r;a.value[e]||(a.value[e]={baseUrl:"https://api.anthropic.com/v1/"}),s.value=((o=a.value[e])==null?void 0:o.apiKey)||"",n.value=((r=a.value[e])==null?void 0:r.baseUrl)||"https://api.anthropic.com/v1/"}),V([s,n],()=>{a.value[e]={...a.value[e],apiKey:s.value,baseUrl:n.value||"https://api.anthropic.com/v1/"}});function g(){a.value[e]={baseUrl:"https://api.anthropic.com/v1/"}}return(o,r)=>{var f,b;return K(),C(t(B),{"provider-name":((f=m.value)==null?void 0:f.localizedName)||"Anthropic | Claude","provider-icon":(b=m.value)==null?void 0:b.icon,"on-back":()=>t(_).back()},{default:u(()=>[r[2]||(r[2]=i("div",{bg:"orange-50 dark:orange-900/20","rounded-xl":"","p-4":"",flex:"~ col gap-3"},[i("h2",{"text-xl":"","font-bold":"",text:"orange-700 dark:orange-500"}," Before you start "),i("p",null,[p(" While Anthropic recently did announce that they are having a beta support for OpenAI SDK compatibility "),i("a",{underline:"",href:"https://docs.anthropic.com/en/api/openai-sdk"},"(you can read more here)"),p(", but due to the implementation details comes with "),i("a",{underline:"",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS"},"CORS"),p(" restrictions which not aligned with the OpenAI SDK, it's currently not possible to use this provider in the browser. ")]),i("p",null,[p(" If you do need to use this provider, you will need a dedicated proxy backend like a Serverless Function running on "),i("a",{underline:"",href:"https://workers.cloudflare.com/"},"Cloudflare Workers"),p(" or some CORS bypassing services to bypass the CORS restrictions. ")])],-1)),l(t(I),null,{default:u(()=>[l(t(N),{title:t(c)("settings.pages.providers.common.section.basic.title"),description:t(c)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var d;return[l(t(A),{modelValue:s.value,"onUpdate:modelValue":r[0]||(r[0]=y=>s.value=y),"provider-name":((d=m.value)==null?void 0:d.localizedName)||"Anthropic",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(O),{title:t(c)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t($),{modelValue:n.value,"onUpdate:modelValue":r[1]||(r[1]=d=>n.value=d),placeholder:"https://api.anthropic.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{Q as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{d as k,q as x,bG as S,s as U,h as v,l as w,w as V,x as C,o as K,y as u,a as i,b as l,bL as p,u as t}from"./index-D55VqdU4.js";import{u as R}from"./providers-DAp1566d.js";import{_ as O,a as $}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-BtshDojk.js";import{_ as A}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BMPV9bKe.js";import{_ as I,a as N}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DLyRry-6.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-Cc3LXYUd.js";import"./index-Be1NqeGb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BDoHyduV.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BbB31kj-.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DQP2RhYC.js";import"./Input.vue_vue_type_script_setup_true_lang-CeU0PE9S.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";const e="anthropic",Q=k({__name:"anthropic",setup(T){const{t:c}=x(),_=S(),h=R(),{providers:a}=U(h),m=v(()=>h.getProviderMetadata(e)),s=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.apiKey)||""},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].apiKey=o}}),n=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.baseUrl)||"https://api.anthropic.com/v1/"},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].baseUrl=o}});w(()=>{var o,r;a.value[e]||(a.value[e]={baseUrl:"https://api.anthropic.com/v1/"}),s.value=((o=a.value[e])==null?void 0:o.apiKey)||"",n.value=((r=a.value[e])==null?void 0:r.baseUrl)||"https://api.anthropic.com/v1/"}),V([s,n],()=>{a.value[e]={...a.value[e],apiKey:s.value,baseUrl:n.value||"https://api.anthropic.com/v1/"}});function g(){a.value[e]={baseUrl:"https://api.anthropic.com/v1/"}}return(o,r)=>{var f,b;return K(),C(t(B),{"provider-name":((f=m.value)==null?void 0:f.localizedName)||"Anthropic | Claude","provider-icon":(b=m.value)==null?void 0:b.icon,"on-back":()=>t(_).back()},{default:u(()=>[r[2]||(r[2]=i("div",{bg:"orange-50 dark:orange-900/20","rounded-xl":"","p-4":"",flex:"~ col gap-3"},[i("h2",{"text-xl":"","font-bold":"",text:"orange-700 dark:orange-500"}," Before you start "),i("p",null,[p(" While Anthropic recently did announce that they are having a beta support for OpenAI SDK compatibility "),i("a",{underline:"",href:"https://docs.anthropic.com/en/api/openai-sdk"},"(you can read more here)"),p(", but due to the implementation details comes with "),i("a",{underline:"",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS"},"CORS"),p(" restrictions which not aligned with the OpenAI SDK, it's currently not possible to use this provider in the browser. ")]),i("p",null,[p(" If you do need to use this provider, you will need a dedicated proxy backend like a Serverless Function running on "),i("a",{underline:"",href:"https://workers.cloudflare.com/"},"Cloudflare Workers"),p(" or some CORS bypassing services to bypass the CORS restrictions. ")])],-1)),l(t(I),null,{default:u(()=>[l(t(N),{title:t(c)("settings.pages.providers.common.section.basic.title"),description:t(c)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var d;return[l(t(A),{modelValue:s.value,"onUpdate:modelValue":r[0]||(r[0]=y=>s.value=y),"provider-name":((d=m.value)==null?void 0:d.localizedName)||"Anthropic",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(O),{title:t(c)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t($),{modelValue:n.value,"onUpdate:modelValue":r[1]||(r[1]=d=>n.value=d),placeholder:"https://api.anthropic.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{Q as default}; diff --git a/assets/audio-CVaZ8kG2.js b/assets/audio-l_cY-aws.js similarity index 88% rename from assets/audio-CVaZ8kG2.js rename to assets/audio-l_cY-aws.js index 1af31e4de75a3c6d12f4f27a225db6ded4a5ca9c..333784d9d682a7bc18d8e252dc3c26ff96e707b8 100644 --- a/assets/audio-CVaZ8kG2.js +++ b/assets/audio-l_cY-aws.js @@ -1 +1 @@ -import{d as s,g as f,c as d,o as p,a as t}from"./index--eYU5aQm.js";const R=s({__name:"audio",setup(_){const a=f(),l=f();function u(o){var r,c,i;if(!o)return;const n=(c=(r=l.value)==null?void 0:r.files)==null?void 0:c[0];if(!n)return;const e=document.createElement("audio");(i=a.value)==null||i.appendChild(e),e.src=URL.createObjectURL(n),e.controls=!0,e.load(),e.play()}return(o,n)=>(p(),d("div",null,[t("div",null,[t("div",{ref_key:"containerRef",ref:a},null,512),t("input",{ref_key:"fileInputRef",ref:l,type:"file",onChange:u},null,544)])]))}});export{R as default}; +import{d as s,g as f,c as d,o as p,a as t}from"./index-D55VqdU4.js";const R=s({__name:"audio",setup(_){const a=f(),l=f();function u(o){var r,c,i;if(!o)return;const n=(c=(r=l.value)==null?void 0:r.files)==null?void 0:c[0];if(!n)return;const e=document.createElement("audio");(i=a.value)==null||i.appendChild(e),e.src=URL.createObjectURL(n),e.controls=!0,e.load(),e.play()}return(o,n)=>(p(),d("div",null,[t("div",null,[t("div",{ref_key:"containerRef",ref:a},null,512),t("input",{ref_key:"fileInputRef",ref:l,type:"file",onChange:u},null,544)])]))}});export{R as default}; diff --git a/assets/background-remove-DM2RSAtO.js b/assets/background-remove-BznEXvcR.js similarity index 99% rename from assets/background-remove-DM2RSAtO.js rename to assets/background-remove-BznEXvcR.js index 24862c39833c7defed8182cd55a1cec82a5ca15b..ff2b16a98de1c591182fba9ee3b55ac321ca5f1c 100644 --- a/assets/background-remove-DM2RSAtO.js +++ b/assets/background-remove-BznEXvcR.js @@ -1,4 +1,4 @@ -var uv=Object.defineProperty;var dv=(e,r,t)=>r in e?uv(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var te=(e,r,t)=>dv(e,typeof r!="symbol"?r+"":r,t);import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{_ as cv}from"./InputFile.vue_vue_type_script_setup_true_lang-DSuLZiGY.js";import{d as pv,g as ks,h as hv,l as mv,c as Tn,o as En,a as Sr,b as fv,D as wf,bx as bf,by as Mf,C as yf,n as _v,u as gv}from"./index--eYU5aQm.js";const la=new Map,kn=[],wv=(e,r,t)=>{if(r&&typeof r.init=="function"&&typeof r.createInferenceSessionHandler=="function"){const s=la.get(e);if(s===void 0)la.set(e,{backend:r,priority:t});else{if(s.priority>t)return;if(s.priority===t&&s.backend!==r)throw new Error(`cannot register backend "${e}" using priority ${t}`)}if(t>=0){const o=kn.indexOf(e);o!==-1&&kn.splice(o,1);for(let n=0;n{const r=la.get(e);if(!r)return"backend not found.";if(r.initialized)return r.backend;if(r.aborted)return r.error;{const t=!!r.initPromise;try{return t||(r.initPromise=r.backend.init(e)),await r.initPromise,r.initialized=!0,r.backend}catch(s){return t||(r.error=`${s}`,r.aborted=!0),r.error}finally{delete r.initPromise}}},Mv=async e=>{const r=e.executionProviders||[],t=r.map(l=>typeof l=="string"?l:l.name),s=t.length===0?kn:t;let o;const n=[],i=new Set;for(const l of s){const u=await bv(l);typeof u=="string"?n.push({name:l,err:u}):(o||(o=u),o===u&&i.add(l))}if(!o)throw new Error(`no available backend found. ERR: ${n.map(l=>`[${l.name}] ${l.err}`).join(", ")}`);for(const{name:l,err:u}of n)t.includes(l)&&console.warn(`removing requested execution provider "${l}" from session options because it is not available: ${u}`);const a=r.filter(l=>i.has(typeof l=="string"?l:l.name));return[o,new Proxy(e,{get:(l,u)=>u==="executionProviders"?a:Reflect.get(l,u)})]},yv="1.21.1";let vf="warning";const ms={wasm:{},webgl:{},webgpu:{},versions:{common:yv},set logLevel(e){if(e!==void 0){if(typeof e!="string"||["verbose","info","warning","error","fatal"].indexOf(e)===-1)throw new Error(`Unsupported logging level: ${e}`);vf=e}},get logLevel(){return vf}};Object.defineProperty(ms,"logLevel",{enumerable:!0});const vv=ms,xv=(e,r)=>{const t=typeof document<"u"?document.createElement("canvas"):new OffscreenCanvas(1,1);t.width=e.dims[3],t.height=e.dims[2];const s=t.getContext("2d");if(s!=null){let o,n;(r==null?void 0:r.tensorLayout)!==void 0&&r.tensorLayout==="NHWC"?(o=e.dims[2],n=e.dims[3]):(o=e.dims[3],n=e.dims[2]);const i=(r==null?void 0:r.format)!==void 0?r.format:"RGB",a=r==null?void 0:r.norm;let l,u;a===void 0||a.mean===void 0?l=[255,255,255,255]:typeof a.mean=="number"?l=[a.mean,a.mean,a.mean,a.mean]:(l=[a.mean[0],a.mean[1],a.mean[2],0],a.mean[3]!==void 0&&(l[3]=a.mean[3])),a===void 0||a.bias===void 0?u=[0,0,0,0]:typeof a.bias=="number"?u=[a.bias,a.bias,a.bias,a.bias]:(u=[a.bias[0],a.bias[1],a.bias[2],0],a.bias[3]!==void 0&&(u[3]=a.bias[3]));const p=n*o;let d=0,c=p,_=p*2,f=-1;i==="RGBA"?(d=0,c=p,_=p*2,f=p*3):i==="RGB"?(d=0,c=p,_=p*2):i==="RBG"&&(d=0,_=p,c=p*2);for(let v=0;v{const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):new OffscreenCanvas(1,1).getContext("2d");let s;if(t!=null){let o,n,i;(r==null?void 0:r.tensorLayout)!==void 0&&r.tensorLayout==="NHWC"?(o=e.dims[2],n=e.dims[1],i=e.dims[3]):(o=e.dims[3],n=e.dims[2],i=e.dims[1]);const a=r!==void 0&&r.format!==void 0?r.format:"RGB",l=r==null?void 0:r.norm;let u,p;l===void 0||l.mean===void 0?u=[255,255,255,255]:typeof l.mean=="number"?u=[l.mean,l.mean,l.mean,l.mean]:(u=[l.mean[0],l.mean[1],l.mean[2],255],l.mean[3]!==void 0&&(u[3]=l.mean[3])),l===void 0||l.bias===void 0?p=[0,0,0,0]:typeof l.bias=="number"?p=[l.bias,l.bias,l.bias,l.bias]:(p=[l.bias[0],l.bias[1],l.bias[2],0],l.bias[3]!==void 0&&(p[3]=l.bias[3]));const d=n*o;if(r!==void 0&&(r.format!==void 0&&i===4&&r.format!=="RGBA"||i===3&&r.format!=="RGB"&&r.format!=="BGR"))throw new Error("Tensor format doesn't match input tensor dims");const c=4;let _=0,f=1,v=2,$=3,w=0,g=d,C=d*2,E=-1;a==="RGBA"?(w=0,g=d,C=d*2,E=d*3):a==="RGB"?(w=0,g=d,C=d*2):a==="RBG"&&(w=0,C=d,g=d*2),s=t.createImageData(o,n);for(let y=0;y{if(e===void 0)throw new Error("Image buffer must be defined");if(r.height===void 0||r.width===void 0)throw new Error("Image height and width must be defined");if(r.tensorLayout==="NHWC")throw new Error("NHWC Tensor layout is not supported yet");const{height:t,width:s}=r,o=r.norm??{mean:255,bias:0};let n,i;typeof o.mean=="number"?n=[o.mean,o.mean,o.mean,o.mean]:n=[o.mean[0],o.mean[1],o.mean[2],o.mean[3]??255],typeof o.bias=="number"?i=[o.bias,o.bias,o.bias,o.bias]:i=[o.bias[0],o.bias[1],o.bias[2],o.bias[3]??0];const a=r.format!==void 0?r.format:"RGBA",l=r.tensorFormat!==void 0&&r.tensorFormat!==void 0?r.tensorFormat:"RGB",u=t*s,p=l==="RGBA"?new Float32Array(u*4):new Float32Array(u*3);let d=4,c=0,_=1,f=2,v=3,$=0,w=u,g=u*2,C=-1;a==="RGB"&&(d=3,c=0,_=1,f=2,v=-1),l==="RGBA"?C=u*3:l==="RBG"?($=0,g=u,w=u*2):l==="BGR"&&(g=0,w=u,$=u*2);for(let y=0;y{const t=typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement,s=typeof ImageData<"u"&&e instanceof ImageData,o=typeof ImageBitmap<"u"&&e instanceof ImageBitmap,n=typeof e=="string";let i,a=r??{};const l=()=>{if(typeof document<"u")return document.createElement("canvas");if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(1,1);throw new Error("Canvas is not supported")},u=p=>typeof HTMLCanvasElement<"u"&&p instanceof HTMLCanvasElement||p instanceof OffscreenCanvas?p.getContext("2d"):null;if(t){const p=l();p.width=e.width,p.height=e.height;const d=u(p);if(d!=null){let c=e.height,_=e.width;if(r!==void 0&&r.resizedHeight!==void 0&&r.resizedWidth!==void 0&&(c=r.resizedHeight,_=r.resizedWidth),r!==void 0){if(a=r,r.tensorFormat!==void 0)throw new Error("Image input config format must be RGBA for HTMLImageElement");a.tensorFormat="RGBA",a.height=c,a.width=_}else a.tensorFormat="RGBA",a.height=c,a.width=_;d.drawImage(e,0,0),i=d.getImageData(0,0,_,c).data}else throw new Error("Can not access image data")}else if(s){let p,d;if(r!==void 0&&r.resizedWidth!==void 0&&r.resizedHeight!==void 0?(p=r.resizedHeight,d=r.resizedWidth):(p=e.height,d=e.width),r!==void 0&&(a=r),a.format="RGBA",a.height=p,a.width=d,r!==void 0){const c=l();c.width=d,c.height=p;const _=u(c);if(_!=null)_.putImageData(e,0,0),i=_.getImageData(0,0,d,p).data;else throw new Error("Can not access image data")}else i=e.data}else if(o){if(r===void 0)throw new Error("Please provide image config with format for Imagebitmap");const p=l();p.width=e.width,p.height=e.height;const d=u(p);if(d!=null){const c=e.height,_=e.width;return d.drawImage(e,0,0,_,c),i=d.getImageData(0,0,_,c).data,a.height=c,a.width=_,kl(i,a)}else throw new Error("Can not access image data")}else{if(n)return new Promise((p,d)=>{const c=l(),_=u(c);if(!e||!_)return d();const f=new Image;f.crossOrigin="Anonymous",f.src=e,f.onload=()=>{c.width=f.width,c.height=f.height,_.drawImage(f,0,0,c.width,c.height);const v=_.getImageData(0,0,c.width,c.height);a.height=c.height,a.width=c.width,p(kl(v.data,a))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(i!==void 0)return kl(i,a);throw new Error("Input data provided is not supported - aborted tensor creation")},Pv=(e,r)=>{const{width:t,height:s,download:o,dispose:n}=r,i=[1,s,t,4];return new Qr({location:"texture",type:"float32",texture:e,dims:i,download:o,dispose:n})},Cv=(e,r)=>{const{dataType:t,dims:s,download:o,dispose:n}=r;return new Qr({location:"gpu-buffer",type:t??"float32",gpuBuffer:e,dims:s,download:o,dispose:n})},Sv=(e,r)=>{const{dataType:t,dims:s,download:o,dispose:n}=r;return new Qr({location:"ml-tensor",type:t??"float32",mlTensor:e,dims:s,download:o,dispose:n})},$v=(e,r,t)=>new Qr({location:"cpu-pinned",type:e,data:r,dims:t??[r.length]}),so=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array],["int4",Uint8Array],["uint4",Uint8Array]]),ua=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);let xf=!1;const kv=()=>{if(!xf){xf=!0;const e=typeof BigInt64Array<"u"&&BigInt64Array.from,r=typeof BigUint64Array<"u"&&BigUint64Array.from,t=globalThis.Float16Array,s=typeof t<"u"&&t.from;e&&(so.set("int64",BigInt64Array),ua.set(BigInt64Array,"int64")),r&&(so.set("uint64",BigUint64Array),ua.set(BigUint64Array,"uint64")),s?(so.set("float16",t),ua.set(t,"float16")):so.set("float16",Uint16Array)}},Iv=e=>{let r=1;for(let t=0;t{switch(e.location){case"cpu":return new Qr(e.type,e.data,r);case"cpu-pinned":return new Qr({location:"cpu-pinned",data:e.data,type:e.type,dims:r});case"texture":return new Qr({location:"texture",texture:e.texture,type:e.type,dims:r});case"gpu-buffer":return new Qr({location:"gpu-buffer",gpuBuffer:e.gpuBuffer,type:e.type,dims:r});case"ml-tensor":return new Qr({location:"ml-tensor",mlTensor:e.mlTensor,type:e.type,dims:r});default:throw new Error(`tensorReshape: tensor location ${e.location} is not supported`)}};let Qr=class{constructor(r,t,s){kv();let o,n;if(typeof r=="object"&&"location"in r)switch(this.dataLocation=r.location,o=r.type,n=r.dims,r.location){case"cpu-pinned":{const a=so.get(o);if(!a)throw new TypeError(`unsupported type "${o}" to create tensor from pinned buffer`);if(!(r.data instanceof a))throw new TypeError(`buffer should be of type ${a.name}`);this.cpuData=r.data;break}case"texture":{if(o!=="float32")throw new TypeError(`unsupported type "${o}" to create tensor from texture`);this.gpuTextureData=r.texture,this.downloader=r.download,this.disposer=r.dispose;break}case"gpu-buffer":{if(o!=="float32"&&o!=="float16"&&o!=="int32"&&o!=="int64"&&o!=="uint32"&&o!=="uint8"&&o!=="bool"&&o!=="uint4"&&o!=="int4")throw new TypeError(`unsupported type "${o}" to create tensor from gpu buffer`);this.gpuBufferData=r.gpuBuffer,this.downloader=r.download,this.disposer=r.dispose;break}case"ml-tensor":{if(o!=="float32"&&o!=="float16"&&o!=="int32"&&o!=="int64"&&o!=="uint32"&&o!=="uint64"&&o!=="int8"&&o!=="uint8"&&o!=="bool"&&o!=="uint4"&&o!=="int4")throw new TypeError(`unsupported type "${o}" to create tensor from MLTensor`);this.mlTensorData=r.mlTensor,this.downloader=r.download,this.disposer=r.dispose;break}default:throw new Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let a,l;if(typeof r=="string")if(o=r,l=s,r==="string"){if(!Array.isArray(t))throw new TypeError("A string tensor's data must be a string array.");a=t}else{const u=so.get(r);if(u===void 0)throw new TypeError(`Unsupported tensor type: ${r}.`);if(Array.isArray(t)){if(r==="float16"&&u===Uint16Array||r==="uint4"||r==="int4")throw new TypeError(`Creating a ${r} tensor from number array is not supported. Please use ${u.name} as data.`);r==="uint64"||r==="int64"?a=u.from(t,BigInt):a=u.from(t)}else if(t instanceof u)a=t;else if(t instanceof Uint8ClampedArray)if(r==="uint8")a=Uint8Array.from(t);else throw new TypeError("A Uint8ClampedArray tensor's data must be type of uint8");else if(r==="float16"&&t instanceof Uint16Array&&u!==Uint16Array)a=new globalThis.Float16Array(t.buffer,t.byteOffset,t.length);else throw new TypeError(`A ${o} tensor's data must be type of ${u}`)}else if(l=t,Array.isArray(r)){if(r.length===0)throw new TypeError("Tensor type cannot be inferred from an empty array.");const u=typeof r[0];if(u==="string")o="string",a=r;else if(u==="boolean")o="bool",a=Uint8Array.from(r);else throw new TypeError(`Invalid element type of data array: ${u}.`)}else if(r instanceof Uint8ClampedArray)o="uint8",a=Uint8Array.from(r);else{const u=ua.get(r.constructor);if(u===void 0)throw new TypeError(`Unsupported type for tensor data: ${r.constructor}.`);o=u,a=r}if(l===void 0)l=[a.length];else if(!Array.isArray(l))throw new TypeError("A tensor's dims must be a number array");n=l,this.cpuData=a,this.dataLocation="cpu"}const i=Iv(n);if(this.cpuData&&i!==this.cpuData.length&&!((o==="uint4"||o==="int4")&&Math.ceil(i/2)===this.cpuData.length))throw new Error(`Tensor's size(${i}) does not match data length(${this.cpuData.length}).`);this.type=o,this.dims=n,this.size=i}static async fromImage(r,t){return Ev(r,t)}static fromTexture(r,t){return Pv(r,t)}static fromGpuBuffer(r,t){return Cv(r,t)}static fromMLTensor(r,t){return Sv(r,t)}static fromPinnedBuffer(r,t,s){return $v(r,t,s)}toDataURL(r){return xv(this,r)}toImageData(r){return Tv(this,r)}get data(){if(this.ensureValid(),!this.cpuData)throw new Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw new Error("The data is not stored as a WebGL texture.");return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw new Error("The data is not stored as a WebGPU buffer.");return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw new Error("The data is not stored as a WebNN MLTensor.");return this.mlTensorData}async getData(r){switch(this.ensureValid(),this.dataLocation){case"cpu":case"cpu-pinned":return this.data;case"texture":case"gpu-buffer":case"ml-tensor":{if(!this.downloader)throw new Error("The current tensor is not created with a specified data downloader.");if(this.isDownloading)throw new Error("The current tensor is being downloaded.");try{this.isDownloading=!0;const t=await this.downloader();return this.downloader=void 0,this.dataLocation="cpu",this.cpuData=t,r&&this.disposer&&(this.disposer(),this.disposer=void 0),t}finally{this.isDownloading=!1}}default:throw new Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw new Error("The current tensor is being downloaded.");this.disposer&&(this.disposer(),this.disposer=void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation="none"}ensureValid(){if(this.dataLocation==="none")throw new Error("The tensor is disposed.")}reshape(r){if(this.ensureValid(),this.downloader||this.disposer)throw new Error("Cannot reshape a tensor that owns GPU resource.");return Av(this,r)}};const to=Qr,nb=(e,r)=>{(typeof ms.trace>"u"?!ms.wasm.trace:!ms.trace)||console.timeStamp(`${e}::ORT::${r}`)},ob=(e,r)=>{var o;const t=((o=new Error().stack)==null?void 0:o.split(/\r\n|\r|\n/g))||[];let s=!1;for(let n=0;n{(typeof ms.trace>"u"?!ms.wasm.trace:!ms.trace)||ob("BEGIN",e)},Iu=e=>{(typeof ms.trace>"u"?!ms.wasm.trace:!ms.trace)||ob("END",e)};let Fv=class ib{constructor(r){this.handler=r}async run(r,t,s){ku();const o={};let n={};if(typeof r!="object"||r===null||r instanceof to||Array.isArray(r))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let i=!0;if(typeof t=="object"){if(t===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(t instanceof to)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(t)){if(t.length===0)throw new TypeError("'fetches' cannot be an empty array.");i=!1;for(const u of t){if(typeof u!="string")throw new TypeError("'fetches' must be a string array or an object.");if(this.outputNames.indexOf(u)===-1)throw new RangeError(`'fetches' contains invalid output name: ${u}.`);o[u]=null}if(typeof s=="object"&&s!==null)n=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else{let u=!1;const p=Object.getOwnPropertyNames(t);for(const d of this.outputNames)if(p.indexOf(d)!==-1){const c=t[d];(c===null||c instanceof to)&&(u=!0,i=!1,o[d]=c)}if(u){if(typeof s=="object"&&s!==null)n=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else n=t}}else if(typeof t<"u")throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(const u of this.inputNames)if(typeof r[u]>"u")throw new Error(`input '${u}' is missing in 'feeds'.`);if(i)for(const u of this.outputNames)o[u]=null;const a=await this.handler.run(r,o,n),l={};for(const u in a)if(Object.hasOwnProperty.call(a,u)){const p=a[u];p instanceof to?l[u]=p:l[u]=new to(p.type,p.data,p.dims)}return Iu(),l}async release(){return this.handler.dispose()}static async create(r,t,s,o){ku();let n,i={};if(typeof r=="string"){if(n=r,typeof t=="object"&&t!==null)i=t;else if(typeof t<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof Uint8Array){if(n=r,typeof t=="object"&&t!==null)i=t;else if(typeof t<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer){const p=r;let d=0,c=r.byteLength;if(typeof t=="object"&&t!==null)i=t;else if(typeof t=="number"){if(d=t,!Number.isSafeInteger(d))throw new RangeError("'byteOffset' must be an integer.");if(d<0||d>=p.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${p.byteLength}).`);if(c=r.byteLength-d,typeof s=="number"){if(c=s,!Number.isSafeInteger(c))throw new RangeError("'byteLength' must be an integer.");if(c<=0||d+c>p.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${p.byteLength-d}].`);if(typeof o=="object"&&o!==null)i=o;else if(typeof o<"u")throw new TypeError("'options' must be an object.")}else if(typeof s<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof t<"u")throw new TypeError("'options' must be an object.");n=new Uint8Array(p,d,c)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");const[a,l]=await Mv(i),u=await a.createInferenceSessionHandler(n,l);return Iu(),new ib(u)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}};const Ov=Fv,Dv=Object.freeze(Object.defineProperty({__proto__:null,InferenceSession:Ov,TRACE:nb,TRACE_FUNC_BEGIN:ku,TRACE_FUNC_END:Iu,Tensor:to,env:vv,registerBackend:wv},Symbol.toStringTag,{value:"Module"}));/*! +var uv=Object.defineProperty;var dv=(e,r,t)=>r in e?uv(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var te=(e,r,t)=>dv(e,typeof r!="symbol"?r+"":r,t);import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{_ as cv}from"./InputFile.vue_vue_type_script_setup_true_lang-CR9cbe_p.js";import{d as pv,g as ks,h as hv,l as mv,c as Tn,o as En,a as Sr,b as fv,D as wf,bx as bf,by as Mf,C as yf,n as _v,u as gv}from"./index-D55VqdU4.js";const la=new Map,kn=[],wv=(e,r,t)=>{if(r&&typeof r.init=="function"&&typeof r.createInferenceSessionHandler=="function"){const s=la.get(e);if(s===void 0)la.set(e,{backend:r,priority:t});else{if(s.priority>t)return;if(s.priority===t&&s.backend!==r)throw new Error(`cannot register backend "${e}" using priority ${t}`)}if(t>=0){const o=kn.indexOf(e);o!==-1&&kn.splice(o,1);for(let n=0;n{const r=la.get(e);if(!r)return"backend not found.";if(r.initialized)return r.backend;if(r.aborted)return r.error;{const t=!!r.initPromise;try{return t||(r.initPromise=r.backend.init(e)),await r.initPromise,r.initialized=!0,r.backend}catch(s){return t||(r.error=`${s}`,r.aborted=!0),r.error}finally{delete r.initPromise}}},Mv=async e=>{const r=e.executionProviders||[],t=r.map(l=>typeof l=="string"?l:l.name),s=t.length===0?kn:t;let o;const n=[],i=new Set;for(const l of s){const u=await bv(l);typeof u=="string"?n.push({name:l,err:u}):(o||(o=u),o===u&&i.add(l))}if(!o)throw new Error(`no available backend found. ERR: ${n.map(l=>`[${l.name}] ${l.err}`).join(", ")}`);for(const{name:l,err:u}of n)t.includes(l)&&console.warn(`removing requested execution provider "${l}" from session options because it is not available: ${u}`);const a=r.filter(l=>i.has(typeof l=="string"?l:l.name));return[o,new Proxy(e,{get:(l,u)=>u==="executionProviders"?a:Reflect.get(l,u)})]},yv="1.21.1";let vf="warning";const ms={wasm:{},webgl:{},webgpu:{},versions:{common:yv},set logLevel(e){if(e!==void 0){if(typeof e!="string"||["verbose","info","warning","error","fatal"].indexOf(e)===-1)throw new Error(`Unsupported logging level: ${e}`);vf=e}},get logLevel(){return vf}};Object.defineProperty(ms,"logLevel",{enumerable:!0});const vv=ms,xv=(e,r)=>{const t=typeof document<"u"?document.createElement("canvas"):new OffscreenCanvas(1,1);t.width=e.dims[3],t.height=e.dims[2];const s=t.getContext("2d");if(s!=null){let o,n;(r==null?void 0:r.tensorLayout)!==void 0&&r.tensorLayout==="NHWC"?(o=e.dims[2],n=e.dims[3]):(o=e.dims[3],n=e.dims[2]);const i=(r==null?void 0:r.format)!==void 0?r.format:"RGB",a=r==null?void 0:r.norm;let l,u;a===void 0||a.mean===void 0?l=[255,255,255,255]:typeof a.mean=="number"?l=[a.mean,a.mean,a.mean,a.mean]:(l=[a.mean[0],a.mean[1],a.mean[2],0],a.mean[3]!==void 0&&(l[3]=a.mean[3])),a===void 0||a.bias===void 0?u=[0,0,0,0]:typeof a.bias=="number"?u=[a.bias,a.bias,a.bias,a.bias]:(u=[a.bias[0],a.bias[1],a.bias[2],0],a.bias[3]!==void 0&&(u[3]=a.bias[3]));const p=n*o;let d=0,c=p,_=p*2,f=-1;i==="RGBA"?(d=0,c=p,_=p*2,f=p*3):i==="RGB"?(d=0,c=p,_=p*2):i==="RBG"&&(d=0,_=p,c=p*2);for(let v=0;v{const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):new OffscreenCanvas(1,1).getContext("2d");let s;if(t!=null){let o,n,i;(r==null?void 0:r.tensorLayout)!==void 0&&r.tensorLayout==="NHWC"?(o=e.dims[2],n=e.dims[1],i=e.dims[3]):(o=e.dims[3],n=e.dims[2],i=e.dims[1]);const a=r!==void 0&&r.format!==void 0?r.format:"RGB",l=r==null?void 0:r.norm;let u,p;l===void 0||l.mean===void 0?u=[255,255,255,255]:typeof l.mean=="number"?u=[l.mean,l.mean,l.mean,l.mean]:(u=[l.mean[0],l.mean[1],l.mean[2],255],l.mean[3]!==void 0&&(u[3]=l.mean[3])),l===void 0||l.bias===void 0?p=[0,0,0,0]:typeof l.bias=="number"?p=[l.bias,l.bias,l.bias,l.bias]:(p=[l.bias[0],l.bias[1],l.bias[2],0],l.bias[3]!==void 0&&(p[3]=l.bias[3]));const d=n*o;if(r!==void 0&&(r.format!==void 0&&i===4&&r.format!=="RGBA"||i===3&&r.format!=="RGB"&&r.format!=="BGR"))throw new Error("Tensor format doesn't match input tensor dims");const c=4;let _=0,f=1,v=2,$=3,w=0,g=d,C=d*2,E=-1;a==="RGBA"?(w=0,g=d,C=d*2,E=d*3):a==="RGB"?(w=0,g=d,C=d*2):a==="RBG"&&(w=0,C=d,g=d*2),s=t.createImageData(o,n);for(let y=0;y{if(e===void 0)throw new Error("Image buffer must be defined");if(r.height===void 0||r.width===void 0)throw new Error("Image height and width must be defined");if(r.tensorLayout==="NHWC")throw new Error("NHWC Tensor layout is not supported yet");const{height:t,width:s}=r,o=r.norm??{mean:255,bias:0};let n,i;typeof o.mean=="number"?n=[o.mean,o.mean,o.mean,o.mean]:n=[o.mean[0],o.mean[1],o.mean[2],o.mean[3]??255],typeof o.bias=="number"?i=[o.bias,o.bias,o.bias,o.bias]:i=[o.bias[0],o.bias[1],o.bias[2],o.bias[3]??0];const a=r.format!==void 0?r.format:"RGBA",l=r.tensorFormat!==void 0&&r.tensorFormat!==void 0?r.tensorFormat:"RGB",u=t*s,p=l==="RGBA"?new Float32Array(u*4):new Float32Array(u*3);let d=4,c=0,_=1,f=2,v=3,$=0,w=u,g=u*2,C=-1;a==="RGB"&&(d=3,c=0,_=1,f=2,v=-1),l==="RGBA"?C=u*3:l==="RBG"?($=0,g=u,w=u*2):l==="BGR"&&(g=0,w=u,$=u*2);for(let y=0;y{const t=typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement,s=typeof ImageData<"u"&&e instanceof ImageData,o=typeof ImageBitmap<"u"&&e instanceof ImageBitmap,n=typeof e=="string";let i,a=r??{};const l=()=>{if(typeof document<"u")return document.createElement("canvas");if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(1,1);throw new Error("Canvas is not supported")},u=p=>typeof HTMLCanvasElement<"u"&&p instanceof HTMLCanvasElement||p instanceof OffscreenCanvas?p.getContext("2d"):null;if(t){const p=l();p.width=e.width,p.height=e.height;const d=u(p);if(d!=null){let c=e.height,_=e.width;if(r!==void 0&&r.resizedHeight!==void 0&&r.resizedWidth!==void 0&&(c=r.resizedHeight,_=r.resizedWidth),r!==void 0){if(a=r,r.tensorFormat!==void 0)throw new Error("Image input config format must be RGBA for HTMLImageElement");a.tensorFormat="RGBA",a.height=c,a.width=_}else a.tensorFormat="RGBA",a.height=c,a.width=_;d.drawImage(e,0,0),i=d.getImageData(0,0,_,c).data}else throw new Error("Can not access image data")}else if(s){let p,d;if(r!==void 0&&r.resizedWidth!==void 0&&r.resizedHeight!==void 0?(p=r.resizedHeight,d=r.resizedWidth):(p=e.height,d=e.width),r!==void 0&&(a=r),a.format="RGBA",a.height=p,a.width=d,r!==void 0){const c=l();c.width=d,c.height=p;const _=u(c);if(_!=null)_.putImageData(e,0,0),i=_.getImageData(0,0,d,p).data;else throw new Error("Can not access image data")}else i=e.data}else if(o){if(r===void 0)throw new Error("Please provide image config with format for Imagebitmap");const p=l();p.width=e.width,p.height=e.height;const d=u(p);if(d!=null){const c=e.height,_=e.width;return d.drawImage(e,0,0,_,c),i=d.getImageData(0,0,_,c).data,a.height=c,a.width=_,kl(i,a)}else throw new Error("Can not access image data")}else{if(n)return new Promise((p,d)=>{const c=l(),_=u(c);if(!e||!_)return d();const f=new Image;f.crossOrigin="Anonymous",f.src=e,f.onload=()=>{c.width=f.width,c.height=f.height,_.drawImage(f,0,0,c.width,c.height);const v=_.getImageData(0,0,c.width,c.height);a.height=c.height,a.width=c.width,p(kl(v.data,a))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(i!==void 0)return kl(i,a);throw new Error("Input data provided is not supported - aborted tensor creation")},Pv=(e,r)=>{const{width:t,height:s,download:o,dispose:n}=r,i=[1,s,t,4];return new Qr({location:"texture",type:"float32",texture:e,dims:i,download:o,dispose:n})},Cv=(e,r)=>{const{dataType:t,dims:s,download:o,dispose:n}=r;return new Qr({location:"gpu-buffer",type:t??"float32",gpuBuffer:e,dims:s,download:o,dispose:n})},Sv=(e,r)=>{const{dataType:t,dims:s,download:o,dispose:n}=r;return new Qr({location:"ml-tensor",type:t??"float32",mlTensor:e,dims:s,download:o,dispose:n})},$v=(e,r,t)=>new Qr({location:"cpu-pinned",type:e,data:r,dims:t??[r.length]}),so=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array],["int4",Uint8Array],["uint4",Uint8Array]]),ua=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);let xf=!1;const kv=()=>{if(!xf){xf=!0;const e=typeof BigInt64Array<"u"&&BigInt64Array.from,r=typeof BigUint64Array<"u"&&BigUint64Array.from,t=globalThis.Float16Array,s=typeof t<"u"&&t.from;e&&(so.set("int64",BigInt64Array),ua.set(BigInt64Array,"int64")),r&&(so.set("uint64",BigUint64Array),ua.set(BigUint64Array,"uint64")),s?(so.set("float16",t),ua.set(t,"float16")):so.set("float16",Uint16Array)}},Iv=e=>{let r=1;for(let t=0;t{switch(e.location){case"cpu":return new Qr(e.type,e.data,r);case"cpu-pinned":return new Qr({location:"cpu-pinned",data:e.data,type:e.type,dims:r});case"texture":return new Qr({location:"texture",texture:e.texture,type:e.type,dims:r});case"gpu-buffer":return new Qr({location:"gpu-buffer",gpuBuffer:e.gpuBuffer,type:e.type,dims:r});case"ml-tensor":return new Qr({location:"ml-tensor",mlTensor:e.mlTensor,type:e.type,dims:r});default:throw new Error(`tensorReshape: tensor location ${e.location} is not supported`)}};let Qr=class{constructor(r,t,s){kv();let o,n;if(typeof r=="object"&&"location"in r)switch(this.dataLocation=r.location,o=r.type,n=r.dims,r.location){case"cpu-pinned":{const a=so.get(o);if(!a)throw new TypeError(`unsupported type "${o}" to create tensor from pinned buffer`);if(!(r.data instanceof a))throw new TypeError(`buffer should be of type ${a.name}`);this.cpuData=r.data;break}case"texture":{if(o!=="float32")throw new TypeError(`unsupported type "${o}" to create tensor from texture`);this.gpuTextureData=r.texture,this.downloader=r.download,this.disposer=r.dispose;break}case"gpu-buffer":{if(o!=="float32"&&o!=="float16"&&o!=="int32"&&o!=="int64"&&o!=="uint32"&&o!=="uint8"&&o!=="bool"&&o!=="uint4"&&o!=="int4")throw new TypeError(`unsupported type "${o}" to create tensor from gpu buffer`);this.gpuBufferData=r.gpuBuffer,this.downloader=r.download,this.disposer=r.dispose;break}case"ml-tensor":{if(o!=="float32"&&o!=="float16"&&o!=="int32"&&o!=="int64"&&o!=="uint32"&&o!=="uint64"&&o!=="int8"&&o!=="uint8"&&o!=="bool"&&o!=="uint4"&&o!=="int4")throw new TypeError(`unsupported type "${o}" to create tensor from MLTensor`);this.mlTensorData=r.mlTensor,this.downloader=r.download,this.disposer=r.dispose;break}default:throw new Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let a,l;if(typeof r=="string")if(o=r,l=s,r==="string"){if(!Array.isArray(t))throw new TypeError("A string tensor's data must be a string array.");a=t}else{const u=so.get(r);if(u===void 0)throw new TypeError(`Unsupported tensor type: ${r}.`);if(Array.isArray(t)){if(r==="float16"&&u===Uint16Array||r==="uint4"||r==="int4")throw new TypeError(`Creating a ${r} tensor from number array is not supported. Please use ${u.name} as data.`);r==="uint64"||r==="int64"?a=u.from(t,BigInt):a=u.from(t)}else if(t instanceof u)a=t;else if(t instanceof Uint8ClampedArray)if(r==="uint8")a=Uint8Array.from(t);else throw new TypeError("A Uint8ClampedArray tensor's data must be type of uint8");else if(r==="float16"&&t instanceof Uint16Array&&u!==Uint16Array)a=new globalThis.Float16Array(t.buffer,t.byteOffset,t.length);else throw new TypeError(`A ${o} tensor's data must be type of ${u}`)}else if(l=t,Array.isArray(r)){if(r.length===0)throw new TypeError("Tensor type cannot be inferred from an empty array.");const u=typeof r[0];if(u==="string")o="string",a=r;else if(u==="boolean")o="bool",a=Uint8Array.from(r);else throw new TypeError(`Invalid element type of data array: ${u}.`)}else if(r instanceof Uint8ClampedArray)o="uint8",a=Uint8Array.from(r);else{const u=ua.get(r.constructor);if(u===void 0)throw new TypeError(`Unsupported type for tensor data: ${r.constructor}.`);o=u,a=r}if(l===void 0)l=[a.length];else if(!Array.isArray(l))throw new TypeError("A tensor's dims must be a number array");n=l,this.cpuData=a,this.dataLocation="cpu"}const i=Iv(n);if(this.cpuData&&i!==this.cpuData.length&&!((o==="uint4"||o==="int4")&&Math.ceil(i/2)===this.cpuData.length))throw new Error(`Tensor's size(${i}) does not match data length(${this.cpuData.length}).`);this.type=o,this.dims=n,this.size=i}static async fromImage(r,t){return Ev(r,t)}static fromTexture(r,t){return Pv(r,t)}static fromGpuBuffer(r,t){return Cv(r,t)}static fromMLTensor(r,t){return Sv(r,t)}static fromPinnedBuffer(r,t,s){return $v(r,t,s)}toDataURL(r){return xv(this,r)}toImageData(r){return Tv(this,r)}get data(){if(this.ensureValid(),!this.cpuData)throw new Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw new Error("The data is not stored as a WebGL texture.");return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw new Error("The data is not stored as a WebGPU buffer.");return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw new Error("The data is not stored as a WebNN MLTensor.");return this.mlTensorData}async getData(r){switch(this.ensureValid(),this.dataLocation){case"cpu":case"cpu-pinned":return this.data;case"texture":case"gpu-buffer":case"ml-tensor":{if(!this.downloader)throw new Error("The current tensor is not created with a specified data downloader.");if(this.isDownloading)throw new Error("The current tensor is being downloaded.");try{this.isDownloading=!0;const t=await this.downloader();return this.downloader=void 0,this.dataLocation="cpu",this.cpuData=t,r&&this.disposer&&(this.disposer(),this.disposer=void 0),t}finally{this.isDownloading=!1}}default:throw new Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw new Error("The current tensor is being downloaded.");this.disposer&&(this.disposer(),this.disposer=void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation="none"}ensureValid(){if(this.dataLocation==="none")throw new Error("The tensor is disposed.")}reshape(r){if(this.ensureValid(),this.downloader||this.disposer)throw new Error("Cannot reshape a tensor that owns GPU resource.");return Av(this,r)}};const to=Qr,nb=(e,r)=>{(typeof ms.trace>"u"?!ms.wasm.trace:!ms.trace)||console.timeStamp(`${e}::ORT::${r}`)},ob=(e,r)=>{var o;const t=((o=new Error().stack)==null?void 0:o.split(/\r\n|\r|\n/g))||[];let s=!1;for(let n=0;n{(typeof ms.trace>"u"?!ms.wasm.trace:!ms.trace)||ob("BEGIN",e)},Iu=e=>{(typeof ms.trace>"u"?!ms.wasm.trace:!ms.trace)||ob("END",e)};let Fv=class ib{constructor(r){this.handler=r}async run(r,t,s){ku();const o={};let n={};if(typeof r!="object"||r===null||r instanceof to||Array.isArray(r))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let i=!0;if(typeof t=="object"){if(t===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(t instanceof to)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(t)){if(t.length===0)throw new TypeError("'fetches' cannot be an empty array.");i=!1;for(const u of t){if(typeof u!="string")throw new TypeError("'fetches' must be a string array or an object.");if(this.outputNames.indexOf(u)===-1)throw new RangeError(`'fetches' contains invalid output name: ${u}.`);o[u]=null}if(typeof s=="object"&&s!==null)n=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else{let u=!1;const p=Object.getOwnPropertyNames(t);for(const d of this.outputNames)if(p.indexOf(d)!==-1){const c=t[d];(c===null||c instanceof to)&&(u=!0,i=!1,o[d]=c)}if(u){if(typeof s=="object"&&s!==null)n=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else n=t}}else if(typeof t<"u")throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(const u of this.inputNames)if(typeof r[u]>"u")throw new Error(`input '${u}' is missing in 'feeds'.`);if(i)for(const u of this.outputNames)o[u]=null;const a=await this.handler.run(r,o,n),l={};for(const u in a)if(Object.hasOwnProperty.call(a,u)){const p=a[u];p instanceof to?l[u]=p:l[u]=new to(p.type,p.data,p.dims)}return Iu(),l}async release(){return this.handler.dispose()}static async create(r,t,s,o){ku();let n,i={};if(typeof r=="string"){if(n=r,typeof t=="object"&&t!==null)i=t;else if(typeof t<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof Uint8Array){if(n=r,typeof t=="object"&&t!==null)i=t;else if(typeof t<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer){const p=r;let d=0,c=r.byteLength;if(typeof t=="object"&&t!==null)i=t;else if(typeof t=="number"){if(d=t,!Number.isSafeInteger(d))throw new RangeError("'byteOffset' must be an integer.");if(d<0||d>=p.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${p.byteLength}).`);if(c=r.byteLength-d,typeof s=="number"){if(c=s,!Number.isSafeInteger(c))throw new RangeError("'byteLength' must be an integer.");if(c<=0||d+c>p.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${p.byteLength-d}].`);if(typeof o=="object"&&o!==null)i=o;else if(typeof o<"u")throw new TypeError("'options' must be an object.")}else if(typeof s<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof t<"u")throw new TypeError("'options' must be an object.");n=new Uint8Array(p,d,c)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");const[a,l]=await Mv(i),u=await a.createInferenceSessionHandler(n,l);return Iu(),new ib(u)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}};const Ov=Fv,Dv=Object.freeze(Object.defineProperty({__proto__:null,InferenceSession:Ov,TRACE:nb,TRACE_FUNC_BEGIN:ku,TRACE_FUNC_END:Iu,Tensor:to,env:vv,registerBackend:wv},Symbol.toStringTag,{value:"Module"}));/*! * ONNX Runtime Web v1.22.0-dev.20250409-89f8206ba4 * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. diff --git a/assets/chat-zLkxe0qa.js b/assets/chat-BoclSdvP.js similarity index 99% rename from assets/chat-zLkxe0qa.js rename to assets/chat-BoclSdvP.js index fa87e9f5dca4296b85551aadc940c4d77dcf1ef2..6f8bb1a7f358b5282840bff33af5747d746f82f4 100644 --- a/assets/chat-zLkxe0qa.js +++ b/assets/chat-BoclSdvP.js @@ -1 +1 @@ -import{d as N,bD as W,g as S,c as h,o as y,a as i,A as C,bE as E,u as M,ad as A,bx as P,by as q,t as z,C as U,D as $}from"./index--eYU5aQm.js";import{s as K}from"./index-D975M2PQ.js";import"./index-Be1NqeGb.js";var O=()=>{let e=null;return{getStore:()=>(e===null&&console.warn("Woops! Looks like you are calling `getContext` after `await fn()`. Please move `getContext` to top level of handler."),e),run(r,o){e=r;try{return o()}finally{e=null}}}},H=new WeakMap,I=new WeakMap,T=0,F=0,_=e=>{const r=`${T++}`,o={include:t=>n.has(t),with:t=>{const d=`${F++}`,l={[Symbol.toStringTag]:`WorkflowEvent(${r}.${d})`,toString:()=>`WorkflowEvent(${r}.${d})`,toJSON:()=>({event:r,data:t}),get data(){return t}};return n.add(l),Object.freeze(l),I.set(l,o),l}},n=new WeakSet;return H.set(o,n),Object.defineProperty(o,Symbol.toStringTag,{get:()=>`WorkflowEvent<${r}>`}),Object.defineProperty(o,"displayName",{value:`WorkflowEvent<${r}>`}),o.toString=()=>`WorkflowEvent<${r}>`,Object.freeze(o),o},j=e=>e!=null&&typeof e=="object"&&"data"in e,J=e=>e!=null&&typeof e.then=="function";function R(e,r){const o=new Array(e.length);for(const n of r)for(let t=0;t{const r=[],o=(a,f,p)=>{let c;const g={get abortController(){return c||(c=new AbortController),c},handler:a,inputs:f,outputs:[],prev:p,next:new Set};g.prev.next.add(g);const v=d(g);G.run(g,()=>{const s=[...new Set([...x.__internal__call_context,...v.__internal__call_context])];B.run(v,()=>{let u=0;const b=()=>{if(u===s.length){let k;try{k=a(...f)}catch(m){if(c??l)(c??l).abort(m);else throw console.error("unhandled error in handler",m),m}J(k)?k.then(m=>{j(m)&&v.sendEvent(m)}):j(k)&&v.sendEvent(k)}const L=s[u];L&&(u++,L(v,f,b))};b()})})},n=a=>{const f=[...r];[...e].filter(([p])=>R(p,f).length===p.length).map(([p,c])=>{const g=R(p,f);g.forEach(v=>{r.splice(r.indexOf(v),1)});for(const v of c)o(v.handler,g,a)})},t=[],d=a=>({get stream(){let f;return new ReadableStream({start:async p=>{f=c=>{let g=D.get(c);for(;g;){if(g===a){p.enqueue(c);break}g=g.prev}},t.push(f)}})},get signal(){return a.abortController.signal},sendEvent:(...f)=>{f.forEach(p=>{D.set(p,a),a.outputs.push(p),r.push(p),t.forEach(c=>c(p)),n(a)})},__internal__call_context:new Set});let l=new AbortController;const x=d({get abortController(){return l||(l=new AbortController),l},inputs:[],outputs:[],handler:null,prev:null,next:new Set});return x};function X(){const e={steps:new Map};return{handle:(r,o)=>{if(e.steps.has(r)){const n=e.steps.get(r),t={get handler(){return o},unsubscribe:()=>{n.delete(t),n.size===0&&e.steps.delete(r)}};return n.add(t),t}else{const n=new Set,t={get handler(){return o},unsubscribe:()=>{n.delete(t),n.size===0&&e.steps.delete(r)}};return n.add(t),e.steps.set(r,n),t}},createContext(){return Q({listeners:e.steps})}}}async function Y(e,r,o){const{stream:n,sendEvent:t}=e.createContext();t(r);for await(const d of n)if(o.include(d))return d;throw new Error("Workflow did not return a stop event")}function Z(e,r){const o=(...n)=>{const t=r.filter(([w])=>w.every((x,a)=>x.include(n[a]))).map(([w,x])=>x),l=V().sendEvent;return(...w)=>{let x=!1;for(let a=0;ap.include(w[c]))){x=!0;break}}return x&&console.warn("Invalid input detected [%s]",w.map(a=>a.data).join(", ")),l(...w)}};return{...e,handle:(n,t)=>{const d=(...l)=>{const w=V();return t(w.safeSendEvent,...l)};return e.handle(n,d)},createContext(){const n=e.createContext();return n.__internal__call_context.add((t,d,l)=>{t.safeSendEvent=o(...d),l()}),n}}}const ee={flex:"","flex-col":"","gap-2":""},te={flex:"~ col","gap-2":""},ne={flex:"","flex-col":"","gap-2":""},re={grid:"","grid-cols-2":"","gap-2":""},oe={flex:"","items-center":"","gap-2":""},ae={flex:"","items-center":"","gap-2":""},le={flex:"","items-center":"","gap-2":""},se={key:0},ue={key:1},fe=N({__name:"chat",setup(e){const r=W("settings/llm/baseUrl","https://openrouter.ai/api/v1/"),o=W("settings/llm/apiKey",""),n=W("settings/llm/model","openai/gpt-4o-mini"),t=S(""),d=S([]),l=S({role:"assistant",content:""}),w=S(!1),x=_(),a=_(),f=_(),p=_(),c=_();async function g(){w.value=!0;try{const v=Z(X(),[[[x],[a,c]],[[a],[f]],[[f],[p]]]);v.handle([x],async s=>{l.value={role:"assistant",content:""},d.value.push({role:"user",content:t.value}),d.value.push(l.value);const u=await K({baseURL:r.value,apiKey:o.value,model:n.value,messages:d.value.slice(0,d.value.length-1).map(b=>z(b))});for await(const b of u.chunkStream)s(a.with(b.choices[0].delta.content||""));return c.with()}),v.handle([a],async(s,u)=>{l.value.content?l.value.content+=u.data:l.value.content=u.data}),await Y(v,x.with(),c)}catch(v){console.error(v)}finally{w.value=!1}}return(v,s)=>(y(),h("div",ee,[i("div",te,[i("div",ne,[s[7]||(s[7]=i("div",null,[i("span",{"text-neutral-500":"","dark:text-neutral-400":""},"LLM")],-1)),i("div",re,[i("label",oe,[s[4]||(s[4]=i("span",{"text-nowrap":""}," Base URL ",-1)),C(i("input",{"onUpdate:modelValue":s[0]||(s[0]=u=>A(r)?r.value=u:null),border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900"},null,512),[[E,M(r)]])]),i("label",ae,[s[5]||(s[5]=i("span",{"text-nowrap":""}," API Key ",-1)),C(i("input",{"onUpdate:modelValue":s[1]||(s[1]=u=>A(o)?o.value=u:null),type:"password",border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900"},null,512),[[E,M(o)]])]),i("label",le,[s[6]||(s[6]=i("span",{"text-nowrap":""}," Model ",-1)),C(i("input",{"onUpdate:modelValue":s[2]||(s[2]=u=>A(n)?n.value=u:null),border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900"},null,512),[[E,M(n)]])])])]),i("div",null,[C(i("textarea",{"onUpdate:modelValue":s[3]||(s[3]=u=>t.value=u),border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900"},null,512),[[E,t.value]])]),i("button",{"rounded-lg":"",bg:"blue-100 dark:blue-900","px-4":"","py-2":"",onClick:g}," Send "),i("div",null,[(y(!0),h(P,null,q(d.value,(u,b)=>(y(),h("div",{key:b},[u.role==="user"?(y(),h("div",se,[i("span",null,$(u.content),1)])):U("",!0),u.role==="assistant"?(y(),h("div",ue,[i("span",null,$(u.content),1)])):U("",!0)]))),128))])])]))}});export{fe as default}; +import{d as N,bD as W,g as S,c as h,o as y,a as i,A as C,bE as E,u as M,ad as A,bx as P,by as q,t as z,C as U,D as $}from"./index-D55VqdU4.js";import{s as K}from"./index-D975M2PQ.js";import"./index-Be1NqeGb.js";var O=()=>{let e=null;return{getStore:()=>(e===null&&console.warn("Woops! Looks like you are calling `getContext` after `await fn()`. Please move `getContext` to top level of handler."),e),run(r,o){e=r;try{return o()}finally{e=null}}}},H=new WeakMap,I=new WeakMap,T=0,F=0,_=e=>{const r=`${T++}`,o={include:t=>n.has(t),with:t=>{const d=`${F++}`,l={[Symbol.toStringTag]:`WorkflowEvent(${r}.${d})`,toString:()=>`WorkflowEvent(${r}.${d})`,toJSON:()=>({event:r,data:t}),get data(){return t}};return n.add(l),Object.freeze(l),I.set(l,o),l}},n=new WeakSet;return H.set(o,n),Object.defineProperty(o,Symbol.toStringTag,{get:()=>`WorkflowEvent<${r}>`}),Object.defineProperty(o,"displayName",{value:`WorkflowEvent<${r}>`}),o.toString=()=>`WorkflowEvent<${r}>`,Object.freeze(o),o},j=e=>e!=null&&typeof e=="object"&&"data"in e,J=e=>e!=null&&typeof e.then=="function";function R(e,r){const o=new Array(e.length);for(const n of r)for(let t=0;t{const r=[],o=(a,f,p)=>{let c;const g={get abortController(){return c||(c=new AbortController),c},handler:a,inputs:f,outputs:[],prev:p,next:new Set};g.prev.next.add(g);const v=d(g);G.run(g,()=>{const s=[...new Set([...x.__internal__call_context,...v.__internal__call_context])];B.run(v,()=>{let u=0;const b=()=>{if(u===s.length){let k;try{k=a(...f)}catch(m){if(c??l)(c??l).abort(m);else throw console.error("unhandled error in handler",m),m}J(k)?k.then(m=>{j(m)&&v.sendEvent(m)}):j(k)&&v.sendEvent(k)}const L=s[u];L&&(u++,L(v,f,b))};b()})})},n=a=>{const f=[...r];[...e].filter(([p])=>R(p,f).length===p.length).map(([p,c])=>{const g=R(p,f);g.forEach(v=>{r.splice(r.indexOf(v),1)});for(const v of c)o(v.handler,g,a)})},t=[],d=a=>({get stream(){let f;return new ReadableStream({start:async p=>{f=c=>{let g=D.get(c);for(;g;){if(g===a){p.enqueue(c);break}g=g.prev}},t.push(f)}})},get signal(){return a.abortController.signal},sendEvent:(...f)=>{f.forEach(p=>{D.set(p,a),a.outputs.push(p),r.push(p),t.forEach(c=>c(p)),n(a)})},__internal__call_context:new Set});let l=new AbortController;const x=d({get abortController(){return l||(l=new AbortController),l},inputs:[],outputs:[],handler:null,prev:null,next:new Set});return x};function X(){const e={steps:new Map};return{handle:(r,o)=>{if(e.steps.has(r)){const n=e.steps.get(r),t={get handler(){return o},unsubscribe:()=>{n.delete(t),n.size===0&&e.steps.delete(r)}};return n.add(t),t}else{const n=new Set,t={get handler(){return o},unsubscribe:()=>{n.delete(t),n.size===0&&e.steps.delete(r)}};return n.add(t),e.steps.set(r,n),t}},createContext(){return Q({listeners:e.steps})}}}async function Y(e,r,o){const{stream:n,sendEvent:t}=e.createContext();t(r);for await(const d of n)if(o.include(d))return d;throw new Error("Workflow did not return a stop event")}function Z(e,r){const o=(...n)=>{const t=r.filter(([w])=>w.every((x,a)=>x.include(n[a]))).map(([w,x])=>x),l=V().sendEvent;return(...w)=>{let x=!1;for(let a=0;ap.include(w[c]))){x=!0;break}}return x&&console.warn("Invalid input detected [%s]",w.map(a=>a.data).join(", ")),l(...w)}};return{...e,handle:(n,t)=>{const d=(...l)=>{const w=V();return t(w.safeSendEvent,...l)};return e.handle(n,d)},createContext(){const n=e.createContext();return n.__internal__call_context.add((t,d,l)=>{t.safeSendEvent=o(...d),l()}),n}}}const ee={flex:"","flex-col":"","gap-2":""},te={flex:"~ col","gap-2":""},ne={flex:"","flex-col":"","gap-2":""},re={grid:"","grid-cols-2":"","gap-2":""},oe={flex:"","items-center":"","gap-2":""},ae={flex:"","items-center":"","gap-2":""},le={flex:"","items-center":"","gap-2":""},se={key:0},ue={key:1},fe=N({__name:"chat",setup(e){const r=W("settings/llm/baseUrl","https://openrouter.ai/api/v1/"),o=W("settings/llm/apiKey",""),n=W("settings/llm/model","openai/gpt-4o-mini"),t=S(""),d=S([]),l=S({role:"assistant",content:""}),w=S(!1),x=_(),a=_(),f=_(),p=_(),c=_();async function g(){w.value=!0;try{const v=Z(X(),[[[x],[a,c]],[[a],[f]],[[f],[p]]]);v.handle([x],async s=>{l.value={role:"assistant",content:""},d.value.push({role:"user",content:t.value}),d.value.push(l.value);const u=await K({baseURL:r.value,apiKey:o.value,model:n.value,messages:d.value.slice(0,d.value.length-1).map(b=>z(b))});for await(const b of u.chunkStream)s(a.with(b.choices[0].delta.content||""));return c.with()}),v.handle([a],async(s,u)=>{l.value.content?l.value.content+=u.data:l.value.content=u.data}),await Y(v,x.with(),c)}catch(v){console.error(v)}finally{w.value=!1}}return(v,s)=>(y(),h("div",ee,[i("div",te,[i("div",ne,[s[7]||(s[7]=i("div",null,[i("span",{"text-neutral-500":"","dark:text-neutral-400":""},"LLM")],-1)),i("div",re,[i("label",oe,[s[4]||(s[4]=i("span",{"text-nowrap":""}," Base URL ",-1)),C(i("input",{"onUpdate:modelValue":s[0]||(s[0]=u=>A(r)?r.value=u:null),border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900"},null,512),[[E,M(r)]])]),i("label",ae,[s[5]||(s[5]=i("span",{"text-nowrap":""}," API Key ",-1)),C(i("input",{"onUpdate:modelValue":s[1]||(s[1]=u=>A(o)?o.value=u:null),type:"password",border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900"},null,512),[[E,M(o)]])]),i("label",le,[s[6]||(s[6]=i("span",{"text-nowrap":""}," Model ",-1)),C(i("input",{"onUpdate:modelValue":s[2]||(s[2]=u=>A(n)?n.value=u:null),border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900"},null,512),[[E,M(n)]])])])]),i("div",null,[C(i("textarea",{"onUpdate:modelValue":s[3]||(s[3]=u=>t.value=u),border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900"},null,512),[[E,t.value]])]),i("button",{"rounded-lg":"",bg:"blue-100 dark:blue-900","px-4":"","py-2":"",onClick:g}," Send "),i("div",null,[(y(!0),h(P,null,q(d.value,(u,b)=>(y(),h("div",{key:b},[u.role==="user"?(y(),h("div",se,[i("span",null,$(u.content),1)])):U("",!0),u.role==="assistant"?(y(),h("div",ue,[i("span",null,$(u.content),1)])):U("",!0)]))),128))])])]))}});export{fe as default}; diff --git a/assets/cloudflare-workers-ai--E-2Lfql.js b/assets/cloudflare-workers-ai-RQPniZx7.js similarity index 76% rename from assets/cloudflare-workers-ai--E-2Lfql.js rename to assets/cloudflare-workers-ai-RQPniZx7.js index 53a5c2268fd85395fb621e871a6e6618688b7716..b5610d340e01d283fa620a38f35ac69258fd902c 100644 --- a/assets/cloudflare-workers-ai--E-2Lfql.js +++ b/assets/cloudflare-workers-ai-RQPniZx7.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{d as V,bI as w,bJ as y,x as k,o as I,q,bG as x,s as M,h as v,l as $,w as K,y as f,b as c,u as l}from"./index--eYU5aQm.js";import{u as P}from"./providers-YQf-rDZ1.js";import{_ as z}from"./FieldInput.vue_vue_type_script_setup_true_lang-CriF7G5j.js";import{_ as A}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CCsf2oJB.js";import{_ as B,a as C}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BJL9_E_2.js";import{_ as N}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DVunqc-i.js";import"./index-Be1NqeGb.js";import"./Input.vue_vue_type_script_setup_true_lang-DaL4uFR_.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";const R=V({__name:"ProviderAccountIdInput",props:w({placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(p){const r=p,u=y(p,"modelValue");return(n,e)=>(I(),k(z,{modelValue:u.value,"onUpdate:modelValue":e[0]||(e[0]=t=>u.value=t),label:r.label||"Account ID",description:r.description||"Account ID",placeholder:r.placeholder,required:r.required,type:"text"},null,8,["modelValue","label","description","placeholder","required"]))}}),a="cloudflare-workers-ai",H=V({__name:"cloudflare-workers-ai",setup(p){const{t:r}=q(),u=x(),n=P(),{providers:e}=M(n),t=v(()=>n.getProviderMetadata(a)),s=v({get:()=>{var o;return((o=e.value[a])==null?void 0:o.apiKey)||""},set:o=>{e.value[a]||(e.value[a]={}),e.value[a].apiKey=o}}),d=v({get:()=>{var o;return((o=e.value[a])==null?void 0:o.accountId)||""},set:o=>{e.value[a]||(e.value[a]={}),e.value[a].accountId=o}});$(()=>{var o,i;n.initializeProvider(a),s.value=((o=e.value[a])==null?void 0:o.apiKey)||"",d.value=((i=e.value[a])==null?void 0:i.accountId)||""}),K([s,d],()=>{e.value[a]={...e.value[a],apiKey:s.value,accountId:d.value}});function h(){var o;e.value[a]={...(o=t.value)==null?void 0:o.defaultOptions}}return(o,i)=>{var _,g;return I(),k(l(N),{"provider-name":(_=t.value)==null?void 0:_.localizedName,"provider-icon-color":(g=t.value)==null?void 0:g.iconColor,"on-back":()=>l(u).back()},{default:f(()=>[c(l(B),null,{default:f(()=>[c(l(C),{title:l(r)("settings.pages.providers.common.section.basic.title"),description:l(r)("settings.pages.providers.common.section.basic.description"),"on-reset":h},{default:f(()=>{var b;return[c(l(A),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=m=>s.value=m),"provider-name":(b=t.value)==null?void 0:b.localizedName,placeholder:l(r)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.api-key.placeholder")},null,8,["modelValue","provider-name","placeholder"]),c(l(R),{modelValue:d.value,"onUpdate:modelValue":i[1]||(i[1]=m=>d.value=m),label:l(r)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.label"),description:l(r)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.description"),placeholder:l(r)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.placeholder")},null,8,["modelValue","label","description","placeholder"])]}),_:1},8,["title","description"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});export{H as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{d as V,bI as w,bJ as y,x as k,o as I,q,bG as x,s as M,h as v,l as $,w as K,y as f,b as c,u as l}from"./index-D55VqdU4.js";import{u as P}from"./providers-DAp1566d.js";import{_ as z}from"./FieldInput.vue_vue_type_script_setup_true_lang-DQP2RhYC.js";import{_ as A}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BMPV9bKe.js";import{_ as B,a as C}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DLyRry-6.js";import{_ as N}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-Cc3LXYUd.js";import"./index-Be1NqeGb.js";import"./Input.vue_vue_type_script_setup_true_lang-CeU0PE9S.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";const R=V({__name:"ProviderAccountIdInput",props:w({placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(p){const r=p,u=y(p,"modelValue");return(n,e)=>(I(),k(z,{modelValue:u.value,"onUpdate:modelValue":e[0]||(e[0]=t=>u.value=t),label:r.label||"Account ID",description:r.description||"Account ID",placeholder:r.placeholder,required:r.required,type:"text"},null,8,["modelValue","label","description","placeholder","required"]))}}),a="cloudflare-workers-ai",H=V({__name:"cloudflare-workers-ai",setup(p){const{t:r}=q(),u=x(),n=P(),{providers:e}=M(n),t=v(()=>n.getProviderMetadata(a)),s=v({get:()=>{var o;return((o=e.value[a])==null?void 0:o.apiKey)||""},set:o=>{e.value[a]||(e.value[a]={}),e.value[a].apiKey=o}}),d=v({get:()=>{var o;return((o=e.value[a])==null?void 0:o.accountId)||""},set:o=>{e.value[a]||(e.value[a]={}),e.value[a].accountId=o}});$(()=>{var o,i;n.initializeProvider(a),s.value=((o=e.value[a])==null?void 0:o.apiKey)||"",d.value=((i=e.value[a])==null?void 0:i.accountId)||""}),K([s,d],()=>{e.value[a]={...e.value[a],apiKey:s.value,accountId:d.value}});function h(){var o;e.value[a]={...(o=t.value)==null?void 0:o.defaultOptions}}return(o,i)=>{var _,g;return I(),k(l(N),{"provider-name":(_=t.value)==null?void 0:_.localizedName,"provider-icon-color":(g=t.value)==null?void 0:g.iconColor,"on-back":()=>l(u).back()},{default:f(()=>[c(l(B),null,{default:f(()=>[c(l(C),{title:l(r)("settings.pages.providers.common.section.basic.title"),description:l(r)("settings.pages.providers.common.section.basic.description"),"on-reset":h},{default:f(()=>{var b;return[c(l(A),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=m=>s.value=m),"provider-name":(b=t.value)==null?void 0:b.localizedName,placeholder:l(r)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.api-key.placeholder")},null,8,["modelValue","provider-name","placeholder"]),c(l(R),{modelValue:d.value,"onUpdate:modelValue":i[1]||(i[1]=m=>d.value=m),label:l(r)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.label"),description:l(r)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.description"),placeholder:l(r)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.placeholder")},null,8,["modelValue","label","description","placeholder"])]}),_:1},8,["title","description"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});export{H as default}; diff --git a/assets/consciousness-NMirv8Xi.js b/assets/consciousness-BGmbU4M0.js similarity index 90% rename from assets/consciousness-NMirv8Xi.js rename to assets/consciousness-BGmbU4M0.js index f8ff1bce4d41f92d859cef71bcf4bd4e75b18db5..0810ce101564f605fcb34e2ec27182a070e57487 100644 --- a/assets/consciousness-NMirv8Xi.js +++ b/assets/consciousness-BGmbU4M0.js @@ -1 +1 @@ -import{f as P,bD as n,g as M,h as r,w as L}from"./index--eYU5aQm.js";import{u as w}from"./providers-YQf-rDZ1.js";const h=P("consciousness",()=>{const o=w(),s=n("settings/consciousness/active-provider",""),c=n("settings/consciousness/active-model",""),d=n("settings/consciousness/active-custom-model",""),l=M({}),i=M(""),m=r(()=>{var e;return((e=o.getProviderMetadata(s.value))==null?void 0:e.capabilities.listModels)!==void 0}),a=r(()=>o.getModelsForProvider(s.value)),f=r(()=>o.isLoadingModels[s.value]||!1),g=r(()=>o.modelLoadError[s.value]||null),p=r(()=>{if(!i.value.trim())return a.value;const e=i.value.toLowerCase().trim();return a.value.filter(t=>t.name.toLowerCase().includes(e)||t.id.toLowerCase().includes(e)||t.description&&t.description.toLowerCase().includes(e))});function u(){c.value="",d.value="",l.value={},i.value=""}async function v(e){var t;e&&((t=o.getProviderMetadata(s.value))==null?void 0:t.capabilities.listModels)!==void 0&&o.getModelsForProvider(e).length===0&&await o.fetchModelsForProvider(e)}return L(s,async e=>{await v(e),u()}),{activeProvider:s,activeModel:c,customModelName:d,expandedDescriptions:l,modelSearchQuery:i,supportsModelListing:m,providerModels:a,isLoadingActiveProviderModels:f,activeProviderModelError:g,filteredModels:p,resetModelSelection:u,loadModelsForProvider:v}});export{h as u}; +import{f as P,bD as n,g as M,h as r,w as L}from"./index-D55VqdU4.js";import{u as w}from"./providers-DAp1566d.js";const h=P("consciousness",()=>{const o=w(),s=n("settings/consciousness/active-provider",""),c=n("settings/consciousness/active-model",""),d=n("settings/consciousness/active-custom-model",""),l=M({}),i=M(""),m=r(()=>{var e;return((e=o.getProviderMetadata(s.value))==null?void 0:e.capabilities.listModels)!==void 0}),a=r(()=>o.getModelsForProvider(s.value)),f=r(()=>o.isLoadingModels[s.value]||!1),g=r(()=>o.modelLoadError[s.value]||null),p=r(()=>{if(!i.value.trim())return a.value;const e=i.value.toLowerCase().trim();return a.value.filter(t=>t.name.toLowerCase().includes(e)||t.id.toLowerCase().includes(e)||t.description&&t.description.toLowerCase().includes(e))});function u(){c.value="",d.value="",l.value={},i.value=""}async function v(e){var t;e&&((t=o.getProviderMetadata(s.value))==null?void 0:t.capabilities.listModels)!==void 0&&o.getModelsForProvider(e).length===0&&await o.fetchModelsForProvider(e)}return L(s,async e=>{await v(e),u()}),{activeProvider:s,activeModel:c,customModelName:d,expandedDescriptions:l,modelSearchQuery:i,supportsModelListing:m,providerModels:a,isLoadingActiveProviderModels:f,activeProviderModelError:g,filteredModels:p,resetModelSelection:u,loadModelsForProvider:v}});export{h as u}; diff --git a/assets/consciousness-CaJgKvov.js b/assets/consciousness-BKApwHzz.js similarity index 94% rename from assets/consciousness-CaJgKvov.js rename to assets/consciousness-BKApwHzz.js index 93df4af50bdb7019741a6041a38817dcec3d0abd..3a6fe4f4e377fc37ebce78b91357a10f6fe657d5 100644 --- a/assets/consciousness-CaJgKvov.js +++ b/assets/consciousness-BKApwHzz.js @@ -1 +1 @@ -import{d as R,s as b,q as U,l as q,bw as z,c as r,o as l,b as h,a as e,A as f,u as s,C as k,D as i,bx as y,by as B,y as E,bo as T,x as M,ad as p,bE as $}from"./index--eYU5aQm.js";import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{R as j,a as A}from"./RadioCardDetailManySelect-B7rv-Fju.js";import{_ as F}from"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";import{u as Q}from"./consciousness-NMirv8Xi.js";import{u as G}from"./providers-YQf-rDZ1.js";import{b as w}from"./route-block-B_A1xBdJ.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BHnSNWo1.js";import"./Input.vue_vue_type_script_setup_true_lang-DaL4uFR_.js";import"./index-Be1NqeGb.js";const I={bg:"neutral-50 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-4"},H={flex:"~ col gap-4"},J={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-500"},K={text:"neutral-400 dark:neutral-400"},O={"max-w-full":""},W={key:0,flex:"~ row gap-4",style:{"scrollbar-width":"none"},"min-w-0":"","of-x-scroll":"","scroll-smooth":"",role:"radiogroup"},X={key:1},Y={key:0},Z={flex:"~ col gap-4"},ee={class:"text-lg md:text-2xl"},se={text:"neutral-400 dark:neutral-400"},te={key:0,class:"flex items-center justify-center py-4"},oe={key:1,class:"flex items-center gap-3 border border-red-200 rounded-lg bg-red-50 p-4 dark:border-red-800 dark:bg-red-900/20"},ie={class:"flex flex-col"},le={class:"font-medium"},ne={class:"text-sm text-red-600 dark:text-red-400"},re={key:2,class:"flex items-center gap-3 border border-amber-200 rounded-lg bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},de={class:"flex flex-col"},ae={class:"font-medium"},ce={class:"text-sm text-amber-600 dark:text-amber-400"},ue={key:1},pe={flex:"~ col gap-4"},me={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},xe={text:"neutral-400 dark:neutral-500"},ge={class:"bg-primary-50 border-primary-200 dark:bg-primary-900/20 dark:border-primary-800 flex items-center gap-3 border rounded-lg p-4"},ve={class:"flex flex-col"},_e={class:"font-medium"},be={class:"dark:text-primary-400 text-primary-600 text-sm"},he={class:"mt-2"},fe={class:"mb-1 block text-sm font-medium"},ke=["placeholder"],ye={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},Me=R({__name:"consciousness",setup(we){const V=G(),x=Q(),{availableProviders:C,availableTextGenerationsProvidersMetadata:P}=b(V),{activeProvider:d,activeModel:a,customModelName:S,modelSearchQuery:c,supportsModelListing:g,providerModels:m,isLoadingActiveProviderModels:v,activeProviderModelError:_}=b(x),{t}=U();q(async()=>{await x.loadModelsForProvider(d.value)});function N(u){S.value=u}return(u,o)=>{const D=z("motion");return l(),r(y,null,[h(s(F),{title:u.$t("settings.pages.modules.consciousness.title"),subtitle:u.$t("settings.pages.modules.title")},null,8,["title","subtitle"]),e("div",I,[e("div",null,[e("div",H,[e("div",null,[e("h2",J,i(s(t)("settings.pages.providers.title")),1),e("div",K,[e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.description")),1)])]),e("div",O,[s(C).length>0?(l(),r("fieldset",W,[(l(!0),r(y,null,B(s(P),n=>(l(),M(s(A),{id:n.id,key:n.id,modelValue:s(d),"onUpdate:modelValue":o[0]||(o[0]=L=>p(d)?d.value=L:null),name:"provider",value:n.id,title:n.localizedName,description:n.localizedDescription},null,8,["id","modelValue","value","title","description"]))),128))])):(l(),r("div",X,[h(s(T),{class:"flex items-center gap-3 rounded-lg p-4",border:"2 dashed neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-800",transition:"colors duration-200 ease-in-out",to:"/settings/providers"},{default:E(()=>o[4]||(o[4]=[e("div",{"i-solar:warning-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1),e("div",{class:"flex flex-col"},[e("span",{class:"font-medium"},"No Providers Configured"),e("span",{class:"text-sm text-neutral-400 dark:text-neutral-500"},"Click here to set up your LLM providers")],-1),e("div",{"i-solar:arrow-right-line-duotone":"",class:"ml-auto text-xl text-neutral-400 dark:text-neutral-500"},null,-1)])),_:1})]))])])]),s(d)&&s(g)?(l(),r("div",Y,[e("div",Z,[e("div",null,[e("h2",ee,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",se,[e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),s(v)?(l(),r("div",te,[o[5]||(o[5]=e("div",{class:"mr-2 animate-spin"},[e("div",{"i-solar:spinner-line-duotone":"","text-xl":""})],-1)),e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.loading")),1)])):s(_)?(l(),r("div",oe,[o[6]||(o[6]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",ie,[e("span",le,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.error")),1),e("span",ne,i(s(_)),1)])])):s(m).length===0&&!s(v)?(l(),r("div",re,[o[7]||(o[7]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),e("div",de,[e("span",ae,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models")),1),e("span",ce,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description")),1)])])):s(m).length>0?(l(),M(s(j),{key:3,modelValue:s(a),"onUpdate:modelValue":o[1]||(o[1]=n=>p(a)?a.value=n:null),"search-query":s(c),"onUpdate:searchQuery":o[2]||(o[2]=n=>p(c)?c.value=n:null),items:s(m),searchable:!0,"search-placeholder":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder"),"search-no-results-title":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results"),"search-no-results-description":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description",{query:s(c)}),"search-results-text":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results",{count:"{count}",total:"{total}"}),"custom-input-placeholder":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder"),"expand-button-text":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.expand"),"collapse-button-text":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse"),"onUpdate:customValue":N},null,8,["modelValue","search-query","items","search-placeholder","search-no-results-title","search-no-results-description","search-results-text","custom-input-placeholder","expand-button-text","collapse-button-text"])):k("",!0)])])):s(d)&&!s(g)?(l(),r("div",ue,[e("div",pe,[e("div",null,[e("h2",me,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",xe,[e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),e("div",ge,[o[8]||(o[8]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-primary-500 dark:text-primary-400 text-2xl"},null,-1)),e("div",ve,[e("span",_e,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported")),1),e("span",be,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported_description")),1)])]),e("div",he,[e("label",fe,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_name")),1),f(e("input",{"onUpdate:modelValue":o[3]||(o[3]=n=>p(a)?a.value=n:null),type:"text",class:"w-full border border-neutral-300 rounded bg-white px-3 py-2 dark:border-neutral-700 dark:bg-neutral-900",placeholder:s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_placeholder")},null,8,ke),[[$,s(a)]])])])])):k("",!0)]),f((l(),r("div",ye,o[9]||(o[9]=[e("div",{text:"60","i-solar:ghost-bold-duotone":""},null,-1)]))),[[D]])],64)}}});typeof w=="function"&&w(Me);export{Me as default}; +import{d as R,s as b,q as U,l as q,bw as z,c as r,o as l,b as h,a as e,A as f,u as s,C as k,D as i,bx as y,by as B,y as E,bo as T,x as M,ad as p,bE as $}from"./index-D55VqdU4.js";import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{R as j,a as A}from"./RadioCardDetailManySelect-B6ly4h3g.js";import{_ as F}from"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";import{u as Q}from"./consciousness-BGmbU4M0.js";import{u as G}from"./providers-DAp1566d.js";import{b as w}from"./route-block-B_A1xBdJ.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BbB31kj-.js";import"./Input.vue_vue_type_script_setup_true_lang-CeU0PE9S.js";import"./index-Be1NqeGb.js";const I={bg:"neutral-50 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-4"},H={flex:"~ col gap-4"},J={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-500"},K={text:"neutral-400 dark:neutral-400"},O={"max-w-full":""},W={key:0,flex:"~ row gap-4",style:{"scrollbar-width":"none"},"min-w-0":"","of-x-scroll":"","scroll-smooth":"",role:"radiogroup"},X={key:1},Y={key:0},Z={flex:"~ col gap-4"},ee={class:"text-lg md:text-2xl"},se={text:"neutral-400 dark:neutral-400"},te={key:0,class:"flex items-center justify-center py-4"},oe={key:1,class:"flex items-center gap-3 border border-red-200 rounded-lg bg-red-50 p-4 dark:border-red-800 dark:bg-red-900/20"},ie={class:"flex flex-col"},le={class:"font-medium"},ne={class:"text-sm text-red-600 dark:text-red-400"},re={key:2,class:"flex items-center gap-3 border border-amber-200 rounded-lg bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},de={class:"flex flex-col"},ae={class:"font-medium"},ce={class:"text-sm text-amber-600 dark:text-amber-400"},ue={key:1},pe={flex:"~ col gap-4"},me={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},xe={text:"neutral-400 dark:neutral-500"},ge={class:"bg-primary-50 border-primary-200 dark:bg-primary-900/20 dark:border-primary-800 flex items-center gap-3 border rounded-lg p-4"},ve={class:"flex flex-col"},_e={class:"font-medium"},be={class:"dark:text-primary-400 text-primary-600 text-sm"},he={class:"mt-2"},fe={class:"mb-1 block text-sm font-medium"},ke=["placeholder"],ye={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},Me=R({__name:"consciousness",setup(we){const V=G(),x=Q(),{availableProviders:C,availableTextGenerationsProvidersMetadata:P}=b(V),{activeProvider:d,activeModel:a,customModelName:S,modelSearchQuery:c,supportsModelListing:g,providerModels:m,isLoadingActiveProviderModels:v,activeProviderModelError:_}=b(x),{t}=U();q(async()=>{await x.loadModelsForProvider(d.value)});function N(u){S.value=u}return(u,o)=>{const D=z("motion");return l(),r(y,null,[h(s(F),{title:u.$t("settings.pages.modules.consciousness.title"),subtitle:u.$t("settings.pages.modules.title")},null,8,["title","subtitle"]),e("div",I,[e("div",null,[e("div",H,[e("div",null,[e("h2",J,i(s(t)("settings.pages.providers.title")),1),e("div",K,[e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.description")),1)])]),e("div",O,[s(C).length>0?(l(),r("fieldset",W,[(l(!0),r(y,null,B(s(P),n=>(l(),M(s(A),{id:n.id,key:n.id,modelValue:s(d),"onUpdate:modelValue":o[0]||(o[0]=L=>p(d)?d.value=L:null),name:"provider",value:n.id,title:n.localizedName,description:n.localizedDescription},null,8,["id","modelValue","value","title","description"]))),128))])):(l(),r("div",X,[h(s(T),{class:"flex items-center gap-3 rounded-lg p-4",border:"2 dashed neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-800",transition:"colors duration-200 ease-in-out",to:"/settings/providers"},{default:E(()=>o[4]||(o[4]=[e("div",{"i-solar:warning-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1),e("div",{class:"flex flex-col"},[e("span",{class:"font-medium"},"No Providers Configured"),e("span",{class:"text-sm text-neutral-400 dark:text-neutral-500"},"Click here to set up your LLM providers")],-1),e("div",{"i-solar:arrow-right-line-duotone":"",class:"ml-auto text-xl text-neutral-400 dark:text-neutral-500"},null,-1)])),_:1})]))])])]),s(d)&&s(g)?(l(),r("div",Y,[e("div",Z,[e("div",null,[e("h2",ee,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",se,[e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),s(v)?(l(),r("div",te,[o[5]||(o[5]=e("div",{class:"mr-2 animate-spin"},[e("div",{"i-solar:spinner-line-duotone":"","text-xl":""})],-1)),e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.loading")),1)])):s(_)?(l(),r("div",oe,[o[6]||(o[6]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",ie,[e("span",le,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.error")),1),e("span",ne,i(s(_)),1)])])):s(m).length===0&&!s(v)?(l(),r("div",re,[o[7]||(o[7]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),e("div",de,[e("span",ae,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models")),1),e("span",ce,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description")),1)])])):s(m).length>0?(l(),M(s(j),{key:3,modelValue:s(a),"onUpdate:modelValue":o[1]||(o[1]=n=>p(a)?a.value=n:null),"search-query":s(c),"onUpdate:searchQuery":o[2]||(o[2]=n=>p(c)?c.value=n:null),items:s(m),searchable:!0,"search-placeholder":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder"),"search-no-results-title":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results"),"search-no-results-description":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description",{query:s(c)}),"search-results-text":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results",{count:"{count}",total:"{total}"}),"custom-input-placeholder":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder"),"expand-button-text":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.expand"),"collapse-button-text":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse"),"onUpdate:customValue":N},null,8,["modelValue","search-query","items","search-placeholder","search-no-results-title","search-no-results-description","search-results-text","custom-input-placeholder","expand-button-text","collapse-button-text"])):k("",!0)])])):s(d)&&!s(g)?(l(),r("div",ue,[e("div",pe,[e("div",null,[e("h2",me,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",xe,[e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),e("div",ge,[o[8]||(o[8]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-primary-500 dark:text-primary-400 text-2xl"},null,-1)),e("div",ve,[e("span",_e,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported")),1),e("span",be,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported_description")),1)])]),e("div",he,[e("label",fe,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_name")),1),f(e("input",{"onUpdate:modelValue":o[3]||(o[3]=n=>p(a)?a.value=n:null),type:"text",class:"w-full border border-neutral-300 rounded bg-white px-3 py-2 dark:border-neutral-700 dark:bg-neutral-900",placeholder:s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_placeholder")},null,8,ke),[[$,s(a)]])])])])):k("",!0)]),f((l(),r("div",ye,o[9]||(o[9]=[e("div",{text:"60","i-solar:ghost-bold-duotone":""},null,-1)]))),[[D]])],64)}}});typeof w=="function"&&w(Me);export{Me as default}; diff --git a/assets/deepseek-cfgx_3qB.js b/assets/deepseek-ENYP1GJq.js similarity index 69% rename from assets/deepseek-cfgx_3qB.js rename to assets/deepseek-ENYP1GJq.js index cc58afe902db4b13bc234a080f9202470dc626f0..99583844566112100c42dcf3602e25ae1fdb238e 100644 --- a/assets/deepseek-cfgx_3qB.js +++ b/assets/deepseek-ENYP1GJq.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{d as k,q as U,bG as V,s as y,h as c,l as $,w as K,x as h,o as x,y as u,b as l,u as t}from"./index--eYU5aQm.js";import{u as w}from"./providers-YQf-rDZ1.js";import{_ as z,a as C}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dsoa87PD.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CCsf2oJB.js";import{_ as N,a as P}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BJL9_E_2.js";import{_ as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DVunqc-i.js";import"./index-Be1NqeGb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-CWkRm8IH.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BHnSNWo1.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-CriF7G5j.js";import"./Input.vue_vue_type_script_setup_true_lang-DaL4uFR_.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";const a="deepseek",L=k({__name:"deepseek",setup(S){const{t:d}=U(),_=V(),m=w(),{providers:o}=y(m),n=c(()=>m.getProviderMetadata(a)),r=c({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),i=c({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,s;m.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",i.value=((s=o.value[a])==null?void 0:s.baseUrl)||""}),K([r,i],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:i.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,s)=>{var v,f;return x(),h(t(R),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(_).back()},{default:u(()=>[l(t(N),null,{default:u(()=>[l(t(P),{title:t(d)("settings.pages.providers.common.section.basic.title"),description:t(d)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:u(()=>{var p;return[l(t(M),{modelValue:r.value,"onUpdate:modelValue":s[0]||(s[0]=g=>r.value=g),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(d)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(C),{modelValue:i.value,"onUpdate:modelValue":s[1]||(s[1]=p=>i.value=p),placeholder:"https://api.deepseek.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});export{L as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{d as k,q as U,bG as V,s as y,h as c,l as $,w as K,x as h,o as x,y as u,b as l,u as t}from"./index-D55VqdU4.js";import{u as w}from"./providers-DAp1566d.js";import{_ as z,a as C}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-BtshDojk.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BMPV9bKe.js";import{_ as N,a as P}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DLyRry-6.js";import{_ as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-Cc3LXYUd.js";import"./index-Be1NqeGb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BDoHyduV.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BbB31kj-.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DQP2RhYC.js";import"./Input.vue_vue_type_script_setup_true_lang-CeU0PE9S.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";const a="deepseek",L=k({__name:"deepseek",setup(S){const{t:d}=U(),_=V(),m=w(),{providers:o}=y(m),n=c(()=>m.getProviderMetadata(a)),r=c({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),i=c({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,s;m.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",i.value=((s=o.value[a])==null?void 0:s.baseUrl)||""}),K([r,i],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:i.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,s)=>{var v,f;return x(),h(t(R),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(_).back()},{default:u(()=>[l(t(N),null,{default:u(()=>[l(t(P),{title:t(d)("settings.pages.providers.common.section.basic.title"),description:t(d)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:u(()=>{var p;return[l(t(M),{modelValue:r.value,"onUpdate:modelValue":s[0]||(s[0]=g=>r.value=g),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(d)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(C),{modelValue:i.value,"onUpdate:modelValue":s[1]||(s[1]=p=>i.value=p),placeholder:"https://api.deepseek.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});export{L as default}; diff --git a/assets/default-DxMPgLL4.js b/assets/default-Dhw9h5i0.js similarity index 89% rename from assets/default-DxMPgLL4.js rename to assets/default-Dhw9h5i0.js index 8c2bf6578b8c636b67065f94b514e38056d79f36..809c73a4b6643ad3d1733df6ba6d2bc6e3e36518 100644 --- a/assets/default-DxMPgLL4.js +++ b/assets/default-Dhw9h5i0.js @@ -1 +1 @@ -import{d as t,c as s,a as e,b as a,u as o,R as n,o as p}from"./index--eYU5aQm.js";import{H as d}from"./HeaderLink-BXS05cIQ.js";const r={style:{paddingBottom:"env(safe-area-inset-bottom, 0px)",paddingTop:"env(safe-area-inset-top, 0px)",paddingRight:"env(safe-area-inset-right, 0px)",paddingLeft:"env(safe-area-inset-left, 0px)"}},i={class:"px-0 py-1 md:px-3 md:py-3","w-full":"","gap-2":"",bg:"$bg-color"},c={class:"px-3 py-2 md:px-5 md:py-5",flex:"~ col","mx-auto":"","max-w-screen-xl":""},u=t({__name:"default",setup(m){return(f,l)=>(p(),s("div",r,[e("div",i,[a(d)]),e("div",c,[a(o(n))])]))}});export{u as default}; +import{d as t,c as s,a as e,b as a,u as o,R as n,o as p}from"./index-D55VqdU4.js";import{H as d}from"./HeaderLink-Dfy3ZEHa.js";const r={style:{paddingBottom:"env(safe-area-inset-bottom, 0px)",paddingTop:"env(safe-area-inset-top, 0px)",paddingRight:"env(safe-area-inset-right, 0px)",paddingLeft:"env(safe-area-inset-left, 0px)"}},i={class:"px-0 py-1 md:px-3 md:py-3","w-full":"","gap-2":"",bg:"$bg-color"},c={class:"px-3 py-2 md:px-5 md:py-5",flex:"~ col","mx-auto":"","max-w-screen-xl":""},u=t({__name:"default",setup(m){return(f,l)=>(p(),s("div",r,[e("div",i,[a(d)]),e("div",c,[a(o(n))])]))}});export{u as default}; diff --git a/assets/default-node-BrtBg7VE.js b/assets/default-node-p_ysqrIS.js similarity index 89% rename from assets/default-node-BrtBg7VE.js rename to assets/default-node-p_ysqrIS.js index ddbb291b81b0b24114b472317bac39c2af0f6609..6480bdc73e2c1c239c426b2174cb070d6ef88443 100644 --- a/assets/default-node-BrtBg7VE.js +++ b/assets/default-node-p_ysqrIS.js @@ -1 +1 @@ -import{cm as t}from"./index--eYU5aQm.js";async function m(){const{createRequire:a}=await t(async()=>{const{createRequire:o}=await import("./__vite-browser-external-FmFgRqLi.js");return{createRequire:o}},[]),{dirname:n,resolve:e}=await t(async()=>{const{dirname:o,resolve:c}=await import("./__vite-browser-external-FmFgRqLi.js");return{dirname:o,resolve:c}},[]),d=a(import.meta.url),r=n(d.resolve("@duckdb/duckdb-wasm"));return{mvp:{mainModule:e(r,"./duckdb-mvp.wasm"),mainWorker:e(r,"./duckdb-node-mvp.worker.cjs")},eh:{mainModule:e(r,"./duckdb-eh.wasm"),mainWorker:e(r,"./duckdb-node-eh.worker.cjs")}}}export{m as getBundles}; +import{cm as t}from"./index-D55VqdU4.js";async function m(){const{createRequire:a}=await t(async()=>{const{createRequire:o}=await import("./__vite-browser-external-FmFgRqLi.js");return{createRequire:o}},[]),{dirname:n,resolve:e}=await t(async()=>{const{dirname:o,resolve:c}=await import("./__vite-browser-external-FmFgRqLi.js");return{dirname:o,resolve:c}},[]),d=a(import.meta.url),r=n(d.resolve("@duckdb/duckdb-wasm"));return{mvp:{mainModule:e(r,"./duckdb-mvp.wasm"),mainWorker:e(r,"./duckdb-node-mvp.worker.cjs")},eh:{mainModule:e(r,"./duckdb-eh.wasm"),mainWorker:e(r,"./duckdb-node-eh.worker.cjs")}}}export{m as getBundles}; diff --git a/assets/delays-BIByavQN.js b/assets/delays-CL-vuuRI.js similarity index 73% rename from assets/delays-BIByavQN.js rename to assets/delays-CL-vuuRI.js index 5a2ec1a5a177c85f311d9b5996cbf92a6eab9d80..33b90f184df15f5f677b2b0839175a8520577a6d 100644 --- a/assets/delays-BIByavQN.js +++ b/assets/delays-CL-vuuRI.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{_ as v}from"./Textarea.vue_vue_type_script_setup_true_lang-DwFb1myn.js";import{d as _,g as r,c as n,o as t,a as e,b,u as k,D as i,bx as f,by as m}from"./index--eYU5aQm.js";import{b as y,l as x}from"./queues-r0c9CGew.js";import"./index-DJq_28p-.js";import"./Basic.vue_vue_type_script_setup_true_lang-Ckn2TiNk.js";import"./queue-D6byf-bD.js";const w={flex:"","flex-col":"","gap-2":"","p-2":""},h={flex:"","flex-row":"","gap-2":""},M={"rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-4":""},V={"w-full":"",flex:"","flex-row":"","gap-4":""},D={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},E={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},H=_({__name:"delays",setup(S){const s=r(""),c=r([]),p=r([]),u=r(!1),d=y();d.onHandlerEvent("delay",a=>{p.value.push(a)});function g(){u.value=!0;const a=s.value.split("");for(const o of a)d.add(o);d.add(x),s.value="",u.value=!1}return(a,o)=>(t(),n("div",w,[e("div",h,[b(k(v),{modelValue:s.value,"onUpdate:modelValue":o[0]||(o[0]=l=>s.value=l),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:g},null,8,["modelValue"]),e("button",M,i(u.value?"Processing...":"Send"),1)]),e("div",V,[e("div",D,[o[1]||(o[1]=e("h3",{"font-semibold":""}," Emotion Message ",-1)),(t(!0),n(f,null,m(c.value,l=>(t(),n("div",{key:l},[e("div",null,i(l),1)]))),128))]),e("div",E,[o[2]||(o[2]=e("h3",{"font-semibold":""}," Delays ",-1)),(t(!0),n(f,null,m(p.value,l=>(t(),n("div",{key:l},[e("div",null,i(l)+"s",1)]))),128))])])]))}});export{H as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{_ as v}from"./Textarea.vue_vue_type_script_setup_true_lang-NzxEJo0x.js";import{d as _,g as r,c as n,o as t,a as e,b,u as k,D as i,bx as f,by as m}from"./index-D55VqdU4.js";import{b as y,l as x}from"./queues-DEEIdmXP.js";import"./index-DO1ex3N6.js";import"./Basic.vue_vue_type_script_setup_true_lang-DJ4kS-zi.js";import"./queue-CugJlP7m.js";const w={flex:"","flex-col":"","gap-2":"","p-2":""},h={flex:"","flex-row":"","gap-2":""},M={"rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-4":""},V={"w-full":"",flex:"","flex-row":"","gap-4":""},D={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},E={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},H=_({__name:"delays",setup(S){const s=r(""),c=r([]),p=r([]),u=r(!1),d=y();d.onHandlerEvent("delay",a=>{p.value.push(a)});function g(){u.value=!0;const a=s.value.split("");for(const o of a)d.add(o);d.add(x),s.value="",u.value=!1}return(a,o)=>(t(),n("div",w,[e("div",h,[b(k(v),{modelValue:s.value,"onUpdate:modelValue":o[0]||(o[0]=l=>s.value=l),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:g},null,8,["modelValue"]),e("button",M,i(u.value?"Processing...":"Send"),1)]),e("div",V,[e("div",D,[o[1]||(o[1]=e("h3",{"font-semibold":""}," Emotion Message ",-1)),(t(!0),n(f,null,m(c.value,l=>(t(),n("div",{key:l},[e("div",null,i(l),1)]))),128))]),e("div",E,[o[2]||(o[2]=e("h3",{"font-semibold":""}," Delays ",-1)),(t(!0),n(f,null,m(p.value,l=>(t(),n("div",{key:l},[e("div",null,i(l)+"s",1)]))),128))])])]))}});export{H as default}; diff --git a/assets/elevenlabs-Bk-fDLOn.js b/assets/elevenlabs-Di7recat.js similarity index 83% rename from assets/elevenlabs-Bk-fDLOn.js rename to assets/elevenlabs-Di7recat.js index 96196bec4d8c4d733597fc12542dbc21d5ed912f..0a42d9409853130cf77346207a2ff2922bc44466 100644 --- a/assets/elevenlabs-Bk-fDLOn.js +++ b/assets/elevenlabs-Di7recat.js @@ -1 +1 @@ -import{_ as h}from"./TestDummyMarker.vue_vue_type_script_setup_true_lang-Pam45T1i.js";import{_ as p}from"./FieldRange.vue_vue_type_script_setup_true_lang-DcZafZ9u.js";import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{d as $,g as n,s as F,q as I,h as S,l as E,w as r,x as K,o as L,y as _,b as d,u as o,a as N}from"./index--eYU5aQm.js";import{u as T}from"./providers-YQf-rDZ1.js";import{u as q}from"./speech-BOhrg3WS.js";import{_ as z,a as G}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-CYRUbdP0.js";import"./index-Be1NqeGb.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dsoa87PD.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-CWkRm8IH.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BHnSNWo1.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-CriF7G5j.js";import"./Input.vue_vue_type_script_setup_true_lang-DaL4uFR_.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CCsf2oJB.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BJL9_E_2.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";const H={flex:"~ col gap-4"},l="elevenlabs",w="eleven_multilingual_v2",ae=$({__name:"elevenlabs",setup(R){const V={similarityBoost:.75,stability:.5,speed:1,style:0,useSpeakerBoost:!0},v=n(0),u=n(1),m=n(0),f=n(0),c=n(.5),g=n(.75),b=n(!1),y=q(),t=T(),{providers:C}=F(t),{t:a}=I(),k=S(()=>{var e;return!!((e=C.value[l])!=null&&e.apiKey)}),B=S(()=>y.availableVoices[l]||[]);async function M(e,i,s){const P=t.getProviderInstance(l);if(!P)throw new Error("Failed to initialize speech provider");const x=t.getProviderConfig(l),U=x.model||w;return await y.speech(P,U,e,i,{...x,...V})}return E(async()=>{const e=t.getProviderConfig(l);await t.getProviderMetadata(l).validators.validateProviderConfig(e)?await y.loadVoicesForProvider(l):console.error("Failed to validate provider config",e)}),r(v,async()=>{const e=t.getProviderConfig(l);e.pitch=v.value}),r(u,async()=>{const e=t.getProviderConfig(l);e.speed=u.value}),r(m,async()=>{const e=t.getProviderConfig(l);e.volume=m.value}),r(f,async()=>{const e=t.getProviderConfig(l);e.style=f.value}),r(c,async()=>{const e=t.getProviderConfig(l);e.stability=c.value}),r(g,async()=>{const e=t.getProviderConfig(l);e.similarityBoost=g.value}),r(b,async()=>{const e=t.getProviderConfig(l);e.useSpeakerBoost=b.value}),r(C,async()=>{const e=t.getProviderConfig(l);await t.getProviderMetadata(l).validators.validateProviderConfig(e)?await y.loadVoicesForProvider(l):console.error("Failed to validate provider config",e)},{immediate:!0}),(e,i)=>(L(),K(o(G),{"provider-id":l,"default-model":w,"additional-settings":V},{"voice-settings":_(()=>[N("div",H,[d(o(p),{modelValue:v.value,"onUpdate:modelValue":i[0]||(i[0]=s=>v.value=s),label:o(a)("settings.pages.providers.provider.common.fields.field.pitch.label"),description:o(a)("settings.pages.providers.provider.common.fields.field.pitch.description"),min:-100,max:100,step:1,"format-value":s=>`${s}%`},null,8,["modelValue","label","description","format-value"]),d(o(p),{modelValue:u.value,"onUpdate:modelValue":i[1]||(i[1]=s=>u.value=s),label:o(a)("settings.pages.providers.provider.common.fields.field.speed.label"),description:o(a)("settings.pages.providers.provider.common.fields.field.speed.description"),min:.5,max:2,step:.01},null,8,["modelValue","label","description"]),d(o(p),{modelValue:m.value,"onUpdate:modelValue":i[2]||(i[2]=s=>m.value=s),label:o(a)("settings.pages.providers.provider.common.fields.field.volume.label"),description:o(a)("settings.pages.providers.provider.common.fields.field.volume.description"),min:-100,max:100,step:1,"format-value":s=>`${s}%`},null,8,["modelValue","label","description","format-value"]),d(o(p),{modelValue:f.value,"onUpdate:modelValue":i[3]||(i[3]=s=>f.value=s),label:o(a)("settings.pages.providers.provider.elevenlabs.fields.field.style.label"),description:o(a)("settings.pages.providers.provider.elevenlabs.fields.field.style.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"]),d(o(p),{modelValue:c.value,"onUpdate:modelValue":i[4]||(i[4]=s=>c.value=s),label:o(a)("settings.pages.providers.provider.elevenlabs.fields.field.stability.label"),description:o(a)("settings.pages.providers.provider.elevenlabs.fields.field.stability.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"]),d(o(p),{modelValue:g.value,"onUpdate:modelValue":i[5]||(i[5]=s=>g.value=s),label:o(a)("settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.label"),description:o(a)("settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"]),d(o(h),{modelValue:b.value,"onUpdate:modelValue":i[6]||(i[6]=s=>b.value=s),label:o(a)("settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.label"),description:o(a)("settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.description")},null,8,["modelValue","label","description"])])]),playground:_(()=>[d(o(z),{"available-voices":B.value,"generate-speech":M,"api-key-configured":k.value,"default-text":"Hello! This is a test of the ElevenLabs voice synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});export{ae as default}; +import{_ as h}from"./TestDummyMarker.vue_vue_type_script_setup_true_lang-DRQbkM6R.js";import{_ as p}from"./FieldRange.vue_vue_type_script_setup_true_lang-CtbCdbG8.js";import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{d as $,g as n,s as F,q as I,h as S,l as E,w as r,x as K,o as L,y as _,b as d,u as o,a as N}from"./index-D55VqdU4.js";import{u as T}from"./providers-DAp1566d.js";import{u as q}from"./speech-BtNOtIn9.js";import{_ as z,a as G}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-CPbYTBJt.js";import"./index-Be1NqeGb.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-BtshDojk.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BDoHyduV.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BbB31kj-.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DQP2RhYC.js";import"./Input.vue_vue_type_script_setup_true_lang-CeU0PE9S.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BMPV9bKe.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DLyRry-6.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";const H={flex:"~ col gap-4"},l="elevenlabs",w="eleven_multilingual_v2",ae=$({__name:"elevenlabs",setup(R){const V={similarityBoost:.75,stability:.5,speed:1,style:0,useSpeakerBoost:!0},v=n(0),u=n(1),m=n(0),f=n(0),c=n(.5),g=n(.75),b=n(!1),y=q(),t=T(),{providers:C}=F(t),{t:a}=I(),k=S(()=>{var e;return!!((e=C.value[l])!=null&&e.apiKey)}),B=S(()=>y.availableVoices[l]||[]);async function M(e,i,s){const P=t.getProviderInstance(l);if(!P)throw new Error("Failed to initialize speech provider");const x=t.getProviderConfig(l),U=x.model||w;return await y.speech(P,U,e,i,{...x,...V})}return E(async()=>{const e=t.getProviderConfig(l);await t.getProviderMetadata(l).validators.validateProviderConfig(e)?await y.loadVoicesForProvider(l):console.error("Failed to validate provider config",e)}),r(v,async()=>{const e=t.getProviderConfig(l);e.pitch=v.value}),r(u,async()=>{const e=t.getProviderConfig(l);e.speed=u.value}),r(m,async()=>{const e=t.getProviderConfig(l);e.volume=m.value}),r(f,async()=>{const e=t.getProviderConfig(l);e.style=f.value}),r(c,async()=>{const e=t.getProviderConfig(l);e.stability=c.value}),r(g,async()=>{const e=t.getProviderConfig(l);e.similarityBoost=g.value}),r(b,async()=>{const e=t.getProviderConfig(l);e.useSpeakerBoost=b.value}),r(C,async()=>{const e=t.getProviderConfig(l);await t.getProviderMetadata(l).validators.validateProviderConfig(e)?await y.loadVoicesForProvider(l):console.error("Failed to validate provider config",e)},{immediate:!0}),(e,i)=>(L(),K(o(G),{"provider-id":l,"default-model":w,"additional-settings":V},{"voice-settings":_(()=>[N("div",H,[d(o(p),{modelValue:v.value,"onUpdate:modelValue":i[0]||(i[0]=s=>v.value=s),label:o(a)("settings.pages.providers.provider.common.fields.field.pitch.label"),description:o(a)("settings.pages.providers.provider.common.fields.field.pitch.description"),min:-100,max:100,step:1,"format-value":s=>`${s}%`},null,8,["modelValue","label","description","format-value"]),d(o(p),{modelValue:u.value,"onUpdate:modelValue":i[1]||(i[1]=s=>u.value=s),label:o(a)("settings.pages.providers.provider.common.fields.field.speed.label"),description:o(a)("settings.pages.providers.provider.common.fields.field.speed.description"),min:.5,max:2,step:.01},null,8,["modelValue","label","description"]),d(o(p),{modelValue:m.value,"onUpdate:modelValue":i[2]||(i[2]=s=>m.value=s),label:o(a)("settings.pages.providers.provider.common.fields.field.volume.label"),description:o(a)("settings.pages.providers.provider.common.fields.field.volume.description"),min:-100,max:100,step:1,"format-value":s=>`${s}%`},null,8,["modelValue","label","description","format-value"]),d(o(p),{modelValue:f.value,"onUpdate:modelValue":i[3]||(i[3]=s=>f.value=s),label:o(a)("settings.pages.providers.provider.elevenlabs.fields.field.style.label"),description:o(a)("settings.pages.providers.provider.elevenlabs.fields.field.style.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"]),d(o(p),{modelValue:c.value,"onUpdate:modelValue":i[4]||(i[4]=s=>c.value=s),label:o(a)("settings.pages.providers.provider.elevenlabs.fields.field.stability.label"),description:o(a)("settings.pages.providers.provider.elevenlabs.fields.field.stability.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"]),d(o(p),{modelValue:g.value,"onUpdate:modelValue":i[5]||(i[5]=s=>g.value=s),label:o(a)("settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.label"),description:o(a)("settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"]),d(o(h),{modelValue:b.value,"onUpdate:modelValue":i[6]||(i[6]=s=>b.value=s),label:o(a)("settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.label"),description:o(a)("settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.description")},null,8,["modelValue","label","description"])])]),playground:_(()=>[d(o(z),{"available-voices":B.value,"generate-speech":M,"api-key-configured":k.value,"default-text":"Hello! This is a test of the ElevenLabs voice synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});export{ae as default}; diff --git a/assets/emotions-hLa4YANP.js b/assets/emotions-Dd6am6XA.js similarity index 72% rename from assets/emotions-hLa4YANP.js rename to assets/emotions-Dd6am6XA.js index 1f26dd9debd255cfa6565bf9aa7a9dab54628f21..241d49e17ac8b18bb67d08481bbd333699d0f40c 100644 --- a/assets/emotions-hLa4YANP.js +++ b/assets/emotions-Dd6am6XA.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{_}from"./Textarea.vue_vue_type_script_setup_true_lang-DwFb1myn.js";import{d as b,g as u,c as s,o as t,a as e,b as k,u as x,D as d,bx as f,by as p}from"./index--eYU5aQm.js";import{u as h}from"./queue-D6byf-bD.js";import{a as w,l as y}from"./queues-r0c9CGew.js";import"./Basic.vue_vue_type_script_setup_true_lang-Ckn2TiNk.js";const M={flex:"","flex-col":"","gap-2":"","p-2":""},V={flex:"","flex-row":"","gap-2":""},E={"rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-4":""},Q={"w-full":"",flex:"","flex-row":"","gap-4":""},S={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},B={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},T=b({__name:"emotions",setup(P){const l=u(""),c=u([]),i=u([]),r=u(!1),g=h({handlers:[async a=>{i.value.push(a.data)}]}),m=w(g);function v(){r.value=!0;const a=l.value.split("");for(const o of a)m.add(o);m.add(y),l.value="",r.value=!1}return(a,o)=>(t(),s("div",M,[e("div",V,[k(x(_),{modelValue:l.value,"onUpdate:modelValue":o[0]||(o[0]=n=>l.value=n),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:v},null,8,["modelValue"]),e("button",E,d(r.value?"Processing...":"Send"),1)]),e("div",Q,[e("div",S,[o[1]||(o[1]=e("h3",{"font-semibold":""}," Messages ",-1)),(t(!0),s(f,null,p(c.value,n=>(t(),s("div",{key:n},[e("div",null,d(n),1)]))),128))]),e("div",B,[o[2]||(o[2]=e("h3",{"font-semibold":""}," Emotions ",-1)),(t(!0),s(f,null,p(i.value,n=>(t(),s("div",{key:n},[e("div",null,d(n),1)]))),128))])])]))}});export{T as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{_}from"./Textarea.vue_vue_type_script_setup_true_lang-NzxEJo0x.js";import{d as b,g as u,c as s,o as t,a as e,b as k,u as x,D as d,bx as f,by as p}from"./index-D55VqdU4.js";import{u as h}from"./queue-CugJlP7m.js";import{a as w,l as y}from"./queues-DEEIdmXP.js";import"./Basic.vue_vue_type_script_setup_true_lang-DJ4kS-zi.js";const M={flex:"","flex-col":"","gap-2":"","p-2":""},V={flex:"","flex-row":"","gap-2":""},E={"rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-4":""},Q={"w-full":"",flex:"","flex-row":"","gap-4":""},S={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},B={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},T=b({__name:"emotions",setup(P){const l=u(""),c=u([]),i=u([]),r=u(!1),g=h({handlers:[async a=>{i.value.push(a.data)}]}),m=w(g);function v(){r.value=!0;const a=l.value.split("");for(const o of a)m.add(o);m.add(y),l.value="",r.value=!1}return(a,o)=>(t(),s("div",M,[e("div",V,[k(x(_),{modelValue:l.value,"onUpdate:modelValue":o[0]||(o[0]=n=>l.value=n),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:v},null,8,["modelValue"]),e("button",E,d(r.value?"Processing...":"Send"),1)]),e("div",Q,[e("div",S,[o[1]||(o[1]=e("h3",{"font-semibold":""}," Messages ",-1)),(t(!0),s(f,null,p(c.value,n=>(t(),s("div",{key:n},[e("div",null,d(n),1)]))),128))]),e("div",B,[o[2]||(o[2]=e("h3",{"font-semibold":""}," Emotions ",-1)),(t(!0),s(f,null,p(i.value,n=>(t(),s("div",{key:n},[e("div",null,d(n),1)]))),128))])])]))}});export{T as default}; diff --git a/assets/featherless-ai-C6WQwaS2.js b/assets/featherless-ai-AfkKNAvr.js similarity index 69% rename from assets/featherless-ai-C6WQwaS2.js rename to assets/featherless-ai-AfkKNAvr.js index 9d515ea758528d579fc94fddb266150b02770456..385153c85b6d199723a1002bd66a6462d57d0204 100644 --- a/assets/featherless-ai-C6WQwaS2.js +++ b/assets/featherless-ai-AfkKNAvr.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{d as h,q as U,bG as V,s as y,h as v,l as $,w as k,x as K,o as w,y as p,b as l,u as t}from"./index--eYU5aQm.js";import{u as x}from"./providers-YQf-rDZ1.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dsoa87PD.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CCsf2oJB.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BJL9_E_2.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DVunqc-i.js";import"./index-Be1NqeGb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-CWkRm8IH.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BHnSNWo1.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-CriF7G5j.js";import"./Input.vue_vue_type_script_setup_true_lang-DaL4uFR_.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";const a="featherless-ai",L=h({__name:"featherless-ai",setup(B){const{t:d}=U(),_=V(),m=x(),{providers:o}=y(m),n=v(()=>m.getProviderMetadata(a)),i=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,s;m.initializeProvider(a),i.value=((e=o.value[a])==null?void 0:e.apiKey)||"",r.value=((s=o.value[a])==null?void 0:s.baseUrl)||""}),k([i,r],()=>{o.value[a]={...o.value[a],apiKey:i.value,baseUrl:r.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,s)=>{var c,f;return w(),K(t(S),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(_).back()},{default:p(()=>[l(t(P),null,{default:p(()=>[l(t(R),{title:t(d)("settings.pages.providers.common.section.basic.title"),description:t(d)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:p(()=>{var u;return[l(t(N),{modelValue:i.value,"onUpdate:modelValue":s[0]||(s[0]=g=>i.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"fw-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(d)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(M),{modelValue:r.value,"onUpdate:modelValue":s[1]||(s[1]=u=>r.value=u),placeholder:"https://api.featherless.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{L as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{d as h,q as U,bG as V,s as y,h as v,l as $,w as k,x as K,o as w,y as p,b as l,u as t}from"./index-D55VqdU4.js";import{u as x}from"./providers-DAp1566d.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-BtshDojk.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BMPV9bKe.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DLyRry-6.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-Cc3LXYUd.js";import"./index-Be1NqeGb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BDoHyduV.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BbB31kj-.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DQP2RhYC.js";import"./Input.vue_vue_type_script_setup_true_lang-CeU0PE9S.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";const a="featherless-ai",L=h({__name:"featherless-ai",setup(B){const{t:d}=U(),_=V(),m=x(),{providers:o}=y(m),n=v(()=>m.getProviderMetadata(a)),i=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,s;m.initializeProvider(a),i.value=((e=o.value[a])==null?void 0:e.apiKey)||"",r.value=((s=o.value[a])==null?void 0:s.baseUrl)||""}),k([i,r],()=>{o.value[a]={...o.value[a],apiKey:i.value,baseUrl:r.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,s)=>{var c,f;return w(),K(t(S),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(_).back()},{default:p(()=>[l(t(P),null,{default:p(()=>[l(t(R),{title:t(d)("settings.pages.providers.common.section.basic.title"),description:t(d)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:p(()=>{var u;return[l(t(N),{modelValue:i.value,"onUpdate:modelValue":s[0]||(s[0]=g=>i.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"fw-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(d)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(M),{modelValue:r.value,"onUpdate:modelValue":s[1]||(s[1]=u=>r.value=u),placeholder:"https://api.featherless.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{L as default}; diff --git a/assets/filter-message-Dmq5FnwC.js b/assets/filter-message-BZZnHMce.js similarity index 79% rename from assets/filter-message-Dmq5FnwC.js rename to assets/filter-message-BZZnHMce.js index 28fb83f264395f7bf4ae03b3f3eecbe4e0c0fb20..1a1a48dd4f9ed742949cbb0c22191999bbb7e6cf 100644 --- a/assets/filter-message-Dmq5FnwC.js +++ b/assets/filter-message-BZZnHMce.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{_ as m}from"./Textarea.vue_vue_type_script_setup_true_lang-DwFb1myn.js";import{d as g,g as c,c as v,o as _,a as s,b,u as x,D as d}from"./index--eYU5aQm.js";import"./Basic.vue_vue_type_script_setup_true_lang-Ckn2TiNk.js";const S={flex:"","flex-col":"","gap-2":"","p-2":""},k={flex:"","flex-row":"","gap-2":""},w={"rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-4":""},V={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},D=g({__name:"filter-message",setup(M){const o=c(""),u=c(!1),r=c({content:""});async function f(i){return new Promise(e=>setTimeout(e,i))}async function p(){u.value=!0;const i=o.value.split("");let e;(a=>{a.Literal="literal",a.Special="special"})(e||(e={}));let t="literal",l="";for(const a of i){await f(50);let n=t;a==="<"?n="special":a===">"&&(n="literal"),t==="literal"&&n==="special"&&(r.value.content+=l,l=""),t==="special"&&n==="literal"&&(l=""),t==="literal"&&n==="literal"&&(r.value.content+=a,l=""),t=n}l&&(r.value.content+=l),o.value="",u.value=!1}return(i,e)=>(_(),v("div",S,[s("div",k,[b(x(m),{modelValue:o.value,"onUpdate:modelValue":e[0]||(e[0]=t=>o.value=t),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:p},null,8,["modelValue"]),s("button",w,d(u.value?"Processing...":"Send"),1)]),s("div",V,[e[1]||(e[1]=s("h3",{"font-semibold":""}," Streaming Message ",-1)),s("div",null,d(r.value.content),1)])]))}});export{D as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{_ as m}from"./Textarea.vue_vue_type_script_setup_true_lang-NzxEJo0x.js";import{d as g,g as c,c as v,o as _,a as s,b,u as x,D as d}from"./index-D55VqdU4.js";import"./Basic.vue_vue_type_script_setup_true_lang-DJ4kS-zi.js";const S={flex:"","flex-col":"","gap-2":"","p-2":""},k={flex:"","flex-row":"","gap-2":""},w={"rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-4":""},V={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},D=g({__name:"filter-message",setup(M){const o=c(""),u=c(!1),r=c({content:""});async function f(i){return new Promise(e=>setTimeout(e,i))}async function p(){u.value=!0;const i=o.value.split("");let e;(a=>{a.Literal="literal",a.Special="special"})(e||(e={}));let t="literal",l="";for(const a of i){await f(50);let n=t;a==="<"?n="special":a===">"&&(n="literal"),t==="literal"&&n==="special"&&(r.value.content+=l,l=""),t==="special"&&n==="literal"&&(l=""),t==="literal"&&n==="literal"&&(r.value.content+=a,l=""),t=n}l&&(r.value.content+=l),o.value="",u.value=!1}return(i,e)=>(_(),v("div",S,[s("div",k,[b(x(m),{modelValue:o.value,"onUpdate:modelValue":e[0]||(e[0]=t=>o.value=t),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:p},null,8,["modelValue"]),s("button",w,d(u.value?"Processing...":"Send"),1)]),s("div",V,[e[1]||(e[1]=s("h3",{"font-semibold":""}," Streaming Message ",-1)),s("div",null,d(r.value.content),1)])]))}});export{D as default}; diff --git a/assets/fireworks-ai-e_P48mks.js b/assets/fireworks-ai-m-Nf-Xo5.js similarity index 69% rename from assets/fireworks-ai-e_P48mks.js rename to assets/fireworks-ai-m-Nf-Xo5.js index 09d286be17fa11632eb26976a0c51213d11b15c6..2f2e023048b88be531c969bc17c18a4b2d91cd97 100644 --- a/assets/fireworks-ai-e_P48mks.js +++ b/assets/fireworks-ai-m-Nf-Xo5.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{d as k,q as w,bG as U,s as V,h as v,l as y,w as $,x as K,o as h,y as p,b as l,u as t}from"./index--eYU5aQm.js";import{u as x}from"./providers-YQf-rDZ1.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dsoa87PD.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CCsf2oJB.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BJL9_E_2.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DVunqc-i.js";import"./index-Be1NqeGb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-CWkRm8IH.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BHnSNWo1.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-CriF7G5j.js";import"./Input.vue_vue_type_script_setup_true_lang-DaL4uFR_.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";const a="fireworks-ai",L=k({__name:"fireworks-ai",setup(B){const{t:d}=w(),_=U(),m=x(),{providers:o}=V(m),n=v(()=>m.getProviderMetadata(a)),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});y(()=>{var e,i;m.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),$([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return h(),K(t(S),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(_).back()},{default:p(()=>[l(t(P),null,{default:p(()=>[l(t(R),{title:t(d)("settings.pages.providers.common.section.basic.title"),description:t(d)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:p(()=>{var u;return[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=g=>r.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"fw-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(d)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(M),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=u=>s.value=u),placeholder:"https://api.fireworks.ai/inference/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{L as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{d as k,q as w,bG as U,s as V,h as v,l as y,w as $,x as K,o as h,y as p,b as l,u as t}from"./index-D55VqdU4.js";import{u as x}from"./providers-DAp1566d.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-BtshDojk.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BMPV9bKe.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DLyRry-6.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-Cc3LXYUd.js";import"./index-Be1NqeGb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BDoHyduV.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BbB31kj-.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DQP2RhYC.js";import"./Input.vue_vue_type_script_setup_true_lang-CeU0PE9S.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";const a="fireworks-ai",L=k({__name:"fireworks-ai",setup(B){const{t:d}=w(),_=U(),m=x(),{providers:o}=V(m),n=v(()=>m.getProviderMetadata(a)),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});y(()=>{var e,i;m.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),$([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return h(),K(t(S),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(_).back()},{default:p(()=>[l(t(P),null,{default:p(()=>[l(t(R),{title:t(d)("settings.pages.providers.common.section.basic.title"),description:t(d)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:p(()=>{var u;return[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=g=>r.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"fw-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(d)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(M),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=u=>s.value=u),placeholder:"https://api.fireworks.ai/inference/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{L as default}; diff --git a/assets/google-generative-ai-D6Po5Sbe.js b/assets/google-generative-ai-DFMkjsF_.js similarity index 72% rename from assets/google-generative-ai-D6Po5Sbe.js rename to assets/google-generative-ai-DFMkjsF_.js index 59e5f1a09fe7a732a50eefc546104a9f624fa742..1b67146f96c8b1a3e72dabe387c0b1b6f774f501 100644 --- a/assets/google-generative-ai-D6Po5Sbe.js +++ b/assets/google-generative-ai-DFMkjsF_.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{d as h,q as U,bG as V,s as k,h as m,l as y,w as $,x as K,o as x,y as p,b as r,u as t}from"./index--eYU5aQm.js";import{u as G}from"./providers-YQf-rDZ1.js";import{_ as w,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dsoa87PD.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CCsf2oJB.js";import{_ as R,a as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BJL9_E_2.js";import{_ as z}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DVunqc-i.js";import"./index-Be1NqeGb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-CWkRm8IH.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BHnSNWo1.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-CriF7G5j.js";import"./Input.vue_vue_type_script_setup_true_lang-DaL4uFR_.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";const e="google-generative-ai",O=h({__name:"google-generative-ai",setup(B){const{t:u}=U(),f=V(),c=G(),{providers:a}=k(c),v=m(()=>c.getProviderMetadata(e)),s=m({get:()=>{var o;return((o=a.value[e])==null?void 0:o.apiKey)||""},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].apiKey=o}}),l=m({get:()=>{var o;return((o=a.value[e])==null?void 0:o.baseUrl)||"https://generativelanguage.googleapis.com/v1beta/openai/"},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].baseUrl=o}});y(()=>{var o,i;a.value[e]||(a.value[e]={baseUrl:"https://api.anthropic.com/v1/"}),s.value=((o=a.value[e])==null?void 0:o.apiKey)||"",l.value=((i=a.value[e])==null?void 0:i.baseUrl)||"https://generativelanguage.googleapis.com/v1beta/openai/"}),$([s,l],()=>{a.value[e]={...a.value[e],apiKey:s.value,baseUrl:l.value||"https://generativelanguage.googleapis.com/v1beta/openai/"}});function _(){a.value[e]={baseUrl:"https://generativelanguage.googleapis.com/v1beta/openai/"}}return(o,i)=>{var d,g;return x(),K(t(z),{"provider-name":((d=v.value)==null?void 0:d.localizedName)||"Google | Gemini","provider-icon":(g=v.value)==null?void 0:g.icon,"on-back":()=>t(f).back()},{default:p(()=>[r(t(R),null,{default:p(()=>[r(t(S),{title:t(u)("settings.pages.providers.common.section.basic.title"),description:t(u)("settings.pages.providers.common.section.basic.description"),"on-reset":_},{default:p(()=>{var n;return[r(t(N),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=b=>s.value=b),"provider-name":((n=v.value)==null?void 0:n.localizedName)||"Google",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),r(t(w),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[r(t(M),{modelValue:l.value,"onUpdate:modelValue":i[1]||(i[1]=n=>l.value=n),placeholder:"https://generativelanguage.googleapis.com/v1beta/openai/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{O as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{d as h,q as U,bG as V,s as k,h as m,l as y,w as $,x as K,o as x,y as p,b as r,u as t}from"./index-D55VqdU4.js";import{u as G}from"./providers-DAp1566d.js";import{_ as w,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-BtshDojk.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BMPV9bKe.js";import{_ as R,a as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DLyRry-6.js";import{_ as z}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-Cc3LXYUd.js";import"./index-Be1NqeGb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BDoHyduV.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BbB31kj-.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DQP2RhYC.js";import"./Input.vue_vue_type_script_setup_true_lang-CeU0PE9S.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";const e="google-generative-ai",O=h({__name:"google-generative-ai",setup(B){const{t:u}=U(),f=V(),c=G(),{providers:a}=k(c),v=m(()=>c.getProviderMetadata(e)),s=m({get:()=>{var o;return((o=a.value[e])==null?void 0:o.apiKey)||""},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].apiKey=o}}),l=m({get:()=>{var o;return((o=a.value[e])==null?void 0:o.baseUrl)||"https://generativelanguage.googleapis.com/v1beta/openai/"},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].baseUrl=o}});y(()=>{var o,i;a.value[e]||(a.value[e]={baseUrl:"https://api.anthropic.com/v1/"}),s.value=((o=a.value[e])==null?void 0:o.apiKey)||"",l.value=((i=a.value[e])==null?void 0:i.baseUrl)||"https://generativelanguage.googleapis.com/v1beta/openai/"}),$([s,l],()=>{a.value[e]={...a.value[e],apiKey:s.value,baseUrl:l.value||"https://generativelanguage.googleapis.com/v1beta/openai/"}});function _(){a.value[e]={baseUrl:"https://generativelanguage.googleapis.com/v1beta/openai/"}}return(o,i)=>{var d,g;return x(),K(t(z),{"provider-name":((d=v.value)==null?void 0:d.localizedName)||"Google | Gemini","provider-icon":(g=v.value)==null?void 0:g.icon,"on-back":()=>t(f).back()},{default:p(()=>[r(t(R),null,{default:p(()=>[r(t(S),{title:t(u)("settings.pages.providers.common.section.basic.title"),description:t(u)("settings.pages.providers.common.section.basic.description"),"on-reset":_},{default:p(()=>{var n;return[r(t(N),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=b=>s.value=b),"provider-name":((n=v.value)==null?void 0:n.localizedName)||"Google",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),r(t(w),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[r(t(M),{modelValue:l.value,"onUpdate:modelValue":i[1]||(i[1]=n=>l.value=n),placeholder:"https://generativelanguage.googleapis.com/v1beta/openai/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{O as default}; diff --git a/assets/image-Bhi85w3C.js b/assets/image-Se8P3JHN.js similarity index 95% rename from assets/image-Bhi85w3C.js rename to assets/image-Se8P3JHN.js index 973efb643320b586f508af3a76d475269a830af9..5ad7275673191e49608a063034d147558062c06f 100644 --- a/assets/image-Bhi85w3C.js +++ b/assets/image-Se8P3JHN.js @@ -1,2 +1,2 @@ -import{d as _,g as c,bF as y,c as d,o as u,a,C as x,D as b,u as v,bn as w}from"./index--eYU5aQm.js";const C={bg:"neutral-100",flex:"~ col","items-center":"","justify-center":"","rounded-lg":"","px-4":"","py-3":""},h={key:0},U=["src"],D={bg:"neutral-100",class:"text-wrap-any","max-h":"100","overflow-scroll":"","rounded-lg":"","text-wrap":"","text-black":"","font-mono":""},R=_({__name:"image",setup(k){const p=c(),n=c(""),{copy:g}=y({source:n});async function m(r){return new Promise((e,o)=>{const t=new FileReader;t.onload=s=>{var l,i;e(((i=(l=s.target)==null?void 0:l.result)==null?void 0:i.toString())||"")},t.onerror=s=>{o(s)},t.readAsDataURL(r)})}async function f(r){var t;const o=(t=r.target.files)==null?void 0:t[0];if(o){p.value=o;const s=await m(o);n.value=s}}return(r,e)=>(u(),d("div",null,[a("label",C,[a("input",{type:"file",accept:"image/*",hidden:"",onChange:f},null,32),e[1]||(e[1]=a("span",null,"Upload Image",-1))]),n.value?(u(),d("div",h,[a("img",{src:n.value,alt:"Uploaded Image","w-100":""},null,8,U),a("pre",D," "+b(n.value)+` +import{d as _,g as c,bF as y,c as d,o as u,a,C as x,D as b,u as v,bn as w}from"./index-D55VqdU4.js";const C={bg:"neutral-100",flex:"~ col","items-center":"","justify-center":"","rounded-lg":"","px-4":"","py-3":""},h={key:0},U=["src"],D={bg:"neutral-100",class:"text-wrap-any","max-h":"100","overflow-scroll":"","rounded-lg":"","text-wrap":"","text-black":"","font-mono":""},R=_({__name:"image",setup(k){const p=c(),n=c(""),{copy:g}=y({source:n});async function m(r){return new Promise((e,o)=>{const t=new FileReader;t.onload=s=>{var l,i;e(((i=(l=s.target)==null?void 0:l.result)==null?void 0:i.toString())||"")},t.onerror=s=>{o(s)},t.readAsDataURL(r)})}async function f(r){var t;const o=(t=r.target.files)==null?void 0:t[0];if(o){p.value=o;const s=await m(o);n.value=s}}return(r,e)=>(u(),d("div",null,[a("label",C,[a("input",{type:"file",accept:"image/*",hidden:"",onChange:f},null,32),e[1]||(e[1]=a("span",null,"Upload Image",-1))]),n.value?(u(),d("div",h,[a("img",{src:n.value,alt:"Uploaded Image","w-100":""},null,8,U),a("pre",D," "+b(n.value)+` `,1),a("button",{bg:"primary-500",text:"white","mt-4":"","rounded-lg":"","px-4":"","py-2":"",onClick:e[0]||(e[0]=()=>v(g)())}," Copy Data URL ")])):x("",!0)]))}}),B=w(R,[["__scopeId","data-v-7edd53e6"]]);export{B as default}; diff --git a/assets/index--eYU5aQm.js b/assets/index--eYU5aQm.js deleted file mode 100644 index 35ae7f0fd3906f44dc7f8862307d52a6b05f5ade..0000000000000000000000000000000000000000 --- a/assets/index--eYU5aQm.js +++ /dev/null @@ -1,3906 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-DxMPgLL4.js","assets/HeaderLink-BXS05cIQ.js","assets/HeaderLink-DsxHr3rn.css","assets/index-D8WWKFo2.js","assets/Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js","assets/Stage-BD8JBwgH.css","assets/import-url-browser-CPN8ipMD.js","assets/duckdb-mvp-CaaD-olE.js","assets/speech-BOhrg3WS.js","assets/index-Be1NqeGb.js","assets/providers-YQf-rDZ1.js","assets/queue-D6byf-bD.js","assets/queues-r0c9CGew.js","assets/index-D975M2PQ.js","assets/airi-card-_ueLLZ0g.js","assets/consciousness-NMirv8Xi.js","assets/Model.vue_vue_type_script_setup_true_lang-nr66j8OO.js","assets/TransitionVertical.vue_vue_type_script_setup_true_lang-BHnSNWo1.js","assets/Collapsable.vue_vue_type_script_setup_true_lang-CWkRm8IH.js","assets/Basic.vue_vue_type_script_setup_true_lang-Ckn2TiNk.js","assets/index-DJq_28p-.js","assets/route-block-B_A1xBdJ.js","assets/index-DFm202zN.css","assets/background-remove-DM2RSAtO.js","assets/InputFile.vue_vue_type_script_setup_true_lang-DSuLZiGY.js","assets/chat-zLkxe0qa.js","assets/image-Bhi85w3C.js","assets/image-BhuwcwI9.css","assets/vibrant-D9yH5UkB.js","assets/browser-CkchkNbv.js","assets/queue-CbNCDjQD.js","assets/index-CF1TyHQe.js","assets/PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js","assets/IconAnimation.vue_vue_type_script_setup_true_lang-BkJuuWL8.js","assets/index-Bsv4W1GE.js","assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-Dudpr3F2.js","assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-R-YdRLSq.js","assets/index-CpeQQOdD.js","assets/CardListItem.vue_vue_type_script_setup_true_lang-B7ec9PDI.js","assets/CardDetailDialog-CxciD2B5.js","assets/CardListItem-BTy07mxf.js","assets/DeleteCardDialog-ByKUc8bN.js","assets/index-ClgaRsQ-.js","assets/ColorPalette.vue_vue_type_script_setup_true_lang-8aVGVYYF.js","assets/index-4Fmwd3_O.css","assets/index-DMkg6SUZ.js","assets/index-Bfn5GkWN.js","assets/useIconAnimation-Rig5jSD8.js","assets/index-rlpEp8ML.css","assets/index-BjaUT3uc.js","assets/IconStatusItem-rr4-xndX.js","assets/consciousness-CaJgKvov.js","assets/RadioCardDetailManySelect-B7rv-Fju.js","assets/Input.vue_vue_type_script_setup_true_lang-DaL4uFR_.js","assets/memory-long-term-CTv3Aw2p.js","assets/memory-short-term-5cVLOK6h.js","assets/speech-D5UnB8H8.js","assets/TestDummyMarker.vue_vue_type_script_setup_true_lang-Pam45T1i.js","assets/FieldInput.vue_vue_type_script_setup_true_lang-CriF7G5j.js","assets/FieldRange.vue_vue_type_script_setup_true_lang-DcZafZ9u.js","assets/Textarea.vue_vue_type_script_setup_true_lang-DwFb1myn.js","assets/index-DKoBS1Xx.js","assets/alibaba-cloud-model-studio-Dt0yEM1s.js","assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-CYRUbdP0.js","assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dsoa87PD.js","assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CCsf2oJB.js","assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BJL9_E_2.js","assets/anthropic-Djw1RdIl.js","assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DVunqc-i.js","assets/cloudflare-workers-ai--E-2Lfql.js","assets/deepseek-cfgx_3qB.js","assets/elevenlabs-Bk-fDLOn.js","assets/featherless-ai-C6WQwaS2.js","assets/fireworks-ai-e_P48mks.js","assets/google-generative-ai-D6Po5Sbe.js","assets/microsoft-speech-DN1YLkUZ.js","assets/mistral-ai-D6fyZpIj.js","assets/moonshot-ai-UMUsb3tN.js","assets/novita-ai-DhZP6eEA.js","assets/ollama-b51zIBIG.js","assets/openai-DYnQZUih.js","assets/openrouter-ai-CAqHWZfw.js","assets/together-ai-NMFH4eMa.js","assets/volcengine-DGKTIK6C.js","assets/xai-C121Ni52.js","assets/index-D3Hcl_56.js","assets/filter-message-Dmq5FnwC.js","assets/delays-BIByavQN.js","assets/emotions-hLa4YANP.js","assets/messages-Da3sXLYk.js"])))=>i.map(i=>d[i]); -var eC=Object.defineProperty;var tC=(n,e,t)=>e in n?eC(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var fi=(n,e,t)=>tC(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(s){if(s.ep)return;s.ep=!0;const r=t(s);fetch(s.href,r)}})();const nC="modulepreload",iC=function(n){return"/"+n},uv={},je=function(e,t,i){let s=Promise.resolve();if(t&&t.length>0){let o=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=o(t.map(c=>{if(c=iC(c),c in uv)return;uv[c]=!0;const u=c.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${f}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":nC,u||(d.as="script"),d.crossOrigin="",d.href=c,l&&d.setAttribute("nonce",l),document.head.appendChild(d),u)return new Promise((h,p)=>{d.addEventListener("load",h),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function r(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&r(a.reason);return e().catch(r)})};/** -* @vue/shared v3.5.13 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**//*! #__NO_SIDE_EFFECTS__ */function f0(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const vt={},ca=[],Ki=()=>{},sC=()=>!1,Vd=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),d0=n=>n.startsWith("onUpdate:"),nn=Object.assign,h0=(n,e)=>{const t=n.indexOf(e);t>-1&&n.splice(t,1)},rC=Object.prototype.hasOwnProperty,St=(n,e)=>rC.call(n,e),ze=Array.isArray,ua=n=>wc(n)==="[object Map]",Da=n=>wc(n)==="[object Set]",fv=n=>wc(n)==="[object Date]",Ke=n=>typeof n=="function",Ut=n=>typeof n=="string",Ni=n=>typeof n=="symbol",It=n=>n!==null&&typeof n=="object",OM=n=>(It(n)||Ke(n))&&Ke(n.then)&&Ke(n.catch),NM=Object.prototype.toString,wc=n=>NM.call(n),oC=n=>wc(n).slice(8,-1),UM=n=>wc(n)==="[object Object]",p0=n=>Ut(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,gl=f0(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Hd=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},aC=/-(\w)/g,ai=Hd(n=>n.replace(aC,(e,t)=>t?t.toUpperCase():"")),lC=/\B([A-Z])/g,ks=Hd(n=>n.replace(lC,"-$1").toLowerCase()),Gd=Hd(n=>n.charAt(0).toUpperCase()+n.slice(1)),pf=Hd(n=>n?`on${Gd(n)}`:""),Yn=(n,e)=>!Object.is(n,e),mf=(n,...e)=>{for(let t=0;t{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:i,value:t})},If=n=>{const e=parseFloat(n);return isNaN(e)?n:e},cC=n=>{const e=Ut(n)?Number(n):NaN;return isNaN(e)?n:e};let dv;const Wd=()=>dv||(dv=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Mi(n){if(ze(n)){const e={};for(let t=0;t{if(t){const i=t.split(fC);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function Oa(n){let e="";if(Ut(n))e=n;else if(ze(n))for(let t=0;tvo(t,e))}const BM=n=>!!(n&&n.__v_isRef===!0),_C=n=>Ut(n)?n:n==null?"":ze(n)||It(n)&&(n.toString===NM||!Ke(n.toString))?BM(n)?_C(n.value):JSON.stringify(n,zM,2):String(n),zM=(n,e)=>BM(e)?zM(n,e.value):ua(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[i,s],r)=>(t[ap(i,r)+" =>"]=s,t),{})}:Da(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>ap(t))}:Ni(e)?ap(e):It(e)&&!ze(e)&&!UM(e)?String(e):e,ap=(n,e="")=>{var t;return Ni(n)?`Symbol(${(t=n.description)!=null?t:e})`:n};/** -* @vue/reactivity v3.5.13 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let On;class VM{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=On,!e&&On&&(this.index=(On.scopes||(On.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e0)return;if(vl){let e=vl;for(vl=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;_l;){let e=_l;for(_l=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){n||(n=i)}e=t}}if(n)throw n}function XM(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function $M(n){let e,t=n.depsTail,i=t;for(;i;){const s=i.prevDep;i.version===-1?(i===t&&(t=s),b0(i),vC(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=s}n.deps=e,n.depsTail=t}function qm(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(qM(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function qM(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===Hl))return;n.globalVersion=Hl;const e=n.dep;if(n.flags|=2,e.version>0&&!n.isSSR&&n.deps&&!qm(n)){n.flags&=-3;return}const t=Dt,i=Oi;Dt=n,Oi=!0;try{XM(n);const s=n.fn(n._value);(e.version===0||Yn(s,n._value))&&(n._value=s,e.version++)}catch(s){throw e.version++,s}finally{Dt=t,Oi=i,$M(n),n.flags&=-3}}function b0(n,e=!1){const{dep:t,prevSub:i,nextSub:s}=n;if(i&&(i.nextSub=s,n.prevSub=void 0),s&&(s.prevSub=i,n.nextSub=void 0),t.subs===n&&(t.subs=i,!i&&t.computed)){t.computed.flags&=-5;for(let r=t.computed.deps;r;r=r.nextDep)b0(r,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function vC(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let Oi=!0;const YM=[];function Mr(){YM.push(Oi),Oi=!1}function Sr(){const n=YM.pop();Oi=n===void 0?!0:n}function hv(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=Dt;Dt=void 0;try{e()}finally{Dt=t}}}let Hl=0;class yC{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class $d{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!Dt||!Oi||Dt===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Dt)t=this.activeLink=new yC(Dt,this),Dt.deps?(t.prevDep=Dt.depsTail,Dt.depsTail.nextDep=t,Dt.depsTail=t):Dt.deps=Dt.depsTail=t,jM(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const i=t.nextDep;i.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=i),t.prevDep=Dt.depsTail,t.nextDep=void 0,Dt.depsTail.nextDep=t,Dt.depsTail=t,Dt.deps===t&&(Dt.deps=i)}return t}trigger(e){this.version++,Hl++,this.notify(e)}notify(e){v0();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{y0()}}}function jM(n){if(n.dep.sc++,n.sub.flags&4){const e=n.dep.computed;if(e&&!n.dep.subs){e.flags|=20;for(let i=e.deps;i;i=i.nextDep)jM(i)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),n.dep.subs=n}}const Lf=new WeakMap,fo=Symbol(""),Ym=Symbol(""),Gl=Symbol("");function Mn(n,e,t){if(Oi&&Dt){let i=Lf.get(n);i||Lf.set(n,i=new Map);let s=i.get(t);s||(i.set(t,s=new $d),s.map=i,s.key=t),s.track()}}function bs(n,e,t,i,s,r){const o=Lf.get(n);if(!o){Hl++;return}const a=l=>{l&&l.trigger()};if(v0(),e==="clear")o.forEach(a);else{const l=ze(n),c=l&&p0(t);if(l&&t==="length"){const u=Number(i);o.forEach((f,d)=>{(d==="length"||d===Gl||!Ni(d)&&d>=u)&&a(f)})}else switch((t!==void 0||o.has(void 0))&&a(o.get(t)),c&&a(o.get(Gl)),e){case"add":l?c&&a(o.get("length")):(a(o.get(fo)),ua(n)&&a(o.get(Ym)));break;case"delete":l||(a(o.get(fo)),ua(n)&&a(o.get(Ym)));break;case"set":ua(n)&&a(o.get(fo));break}}y0()}function bC(n,e){const t=Lf.get(n);return t&&t.get(e)}function No(n){const e=ut(n);return e===n?e:(Mn(e,"iterate",Gl),_i(n)?e:e.map(Sn))}function qd(n){return Mn(n=ut(n),"iterate",Gl),n}const xC={__proto__:null,[Symbol.iterator](){return cp(this,Symbol.iterator,Sn)},concat(...n){return No(this).concat(...n.map(e=>ze(e)?No(e):e))},entries(){return cp(this,"entries",n=>(n[1]=Sn(n[1]),n))},every(n,e){return ls(this,"every",n,e,void 0,arguments)},filter(n,e){return ls(this,"filter",n,e,t=>t.map(Sn),arguments)},find(n,e){return ls(this,"find",n,e,Sn,arguments)},findIndex(n,e){return ls(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return ls(this,"findLast",n,e,Sn,arguments)},findLastIndex(n,e){return ls(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return ls(this,"forEach",n,e,void 0,arguments)},includes(...n){return up(this,"includes",n)},indexOf(...n){return up(this,"indexOf",n)},join(n){return No(this).join(n)},lastIndexOf(...n){return up(this,"lastIndexOf",n)},map(n,e){return ls(this,"map",n,e,void 0,arguments)},pop(){return $a(this,"pop")},push(...n){return $a(this,"push",n)},reduce(n,...e){return pv(this,"reduce",n,e)},reduceRight(n,...e){return pv(this,"reduceRight",n,e)},shift(){return $a(this,"shift")},some(n,e){return ls(this,"some",n,e,void 0,arguments)},splice(...n){return $a(this,"splice",n)},toReversed(){return No(this).toReversed()},toSorted(n){return No(this).toSorted(n)},toSpliced(...n){return No(this).toSpliced(...n)},unshift(...n){return $a(this,"unshift",n)},values(){return cp(this,"values",Sn)}};function cp(n,e,t){const i=qd(n),s=i[e]();return i!==n&&!_i(n)&&(s._next=s.next,s.next=()=>{const r=s._next();return r.value&&(r.value=t(r.value)),r}),s}const MC=Array.prototype;function ls(n,e,t,i,s,r){const o=qd(n),a=o!==n&&!_i(n),l=o[e];if(l!==MC[e]){const f=l.apply(n,r);return a?Sn(f):f}let c=t;o!==n&&(a?c=function(f,d){return t.call(this,Sn(f),d,n)}:t.length>2&&(c=function(f,d){return t.call(this,f,d,n)}));const u=l.call(o,c,i);return a&&s?s(u):u}function pv(n,e,t,i){const s=qd(n);let r=t;return s!==n&&(_i(n)?t.length>3&&(r=function(o,a,l){return t.call(this,o,a,l,n)}):r=function(o,a,l){return t.call(this,o,Sn(a),l,n)}),s[e](r,...i)}function up(n,e,t){const i=ut(n);Mn(i,"iterate",Gl);const s=i[e](...t);return(s===-1||s===!1)&&x0(t[0])?(t[0]=ut(t[0]),i[e](...t)):s}function $a(n,e,t=[]){Mr(),v0();const i=ut(n)[e].apply(n,t);return y0(),Sr(),i}const SC=f0("__proto__,__v_isRef,__isVue"),KM=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Ni));function EC(n){Ni(n)||(n=String(n));const e=ut(this);return Mn(e,"has",n),e.hasOwnProperty(n)}class ZM{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,i){if(t==="__v_skip")return e.__v_skip;const s=this._isReadonly,r=this._isShallow;if(t==="__v_isReactive")return!s;if(t==="__v_isReadonly")return s;if(t==="__v_isShallow")return r;if(t==="__v_raw")return i===(s?r?iS:nS:r?tS:eS).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const o=ze(e);if(!s){let l;if(o&&(l=xC[t]))return l;if(t==="hasOwnProperty")return EC}const a=Reflect.get(e,t,Pt(e)?e:i);return(Ni(t)?KM.has(t):SC(t))||(s||Mn(e,"get",t),r)?a:Pt(a)?o&&p0(t)?a:a.value:It(a)?s?Ui(a):bi(a):a}}class JM extends ZM{constructor(e=!1){super(!1,e)}set(e,t,i,s){let r=e[t];if(!this._isShallow){const l=yo(r);if(!_i(i)&&!yo(i)&&(r=ut(r),i=ut(i)),!ze(e)&&Pt(r)&&!Pt(i))return l?!1:(r.value=i,!0)}const o=ze(e)&&p0(t)?Number(t)n,nu=n=>Reflect.getPrototypeOf(n);function RC(n,e,t){return function(...i){const s=this.__v_raw,r=ut(s),o=ua(r),a=n==="entries"||n===Symbol.iterator&&o,l=n==="keys"&&o,c=s[n](...i),u=t?jm:e?Km:Sn;return!e&&Mn(r,"iterate",l?Ym:fo),{next(){const{value:f,done:d}=c.next();return d?{value:f,done:d}:{value:a?[u(f[0]),u(f[1])]:u(f),done:d}},[Symbol.iterator](){return this}}}}function iu(n){return function(...e){return n==="delete"?!1:n==="clear"?void 0:this}}function PC(n,e){const t={get(s){const r=this.__v_raw,o=ut(r),a=ut(s);n||(Yn(s,a)&&Mn(o,"get",s),Mn(o,"get",a));const{has:l}=nu(o),c=e?jm:n?Km:Sn;if(l.call(o,s))return c(r.get(s));if(l.call(o,a))return c(r.get(a));r!==o&&r.get(s)},get size(){const s=this.__v_raw;return!n&&Mn(ut(s),"iterate",fo),Reflect.get(s,"size",s)},has(s){const r=this.__v_raw,o=ut(r),a=ut(s);return n||(Yn(s,a)&&Mn(o,"has",s),Mn(o,"has",a)),s===a?r.has(s):r.has(s)||r.has(a)},forEach(s,r){const o=this,a=o.__v_raw,l=ut(a),c=e?jm:n?Km:Sn;return!n&&Mn(l,"iterate",fo),a.forEach((u,f)=>s.call(r,c(u),c(f),o))}};return nn(t,n?{add:iu("add"),set:iu("set"),delete:iu("delete"),clear:iu("clear")}:{add(s){!e&&!_i(s)&&!yo(s)&&(s=ut(s));const r=ut(this);return nu(r).has.call(r,s)||(r.add(s),bs(r,"add",s,s)),this},set(s,r){!e&&!_i(r)&&!yo(r)&&(r=ut(r));const o=ut(this),{has:a,get:l}=nu(o);let c=a.call(o,s);c||(s=ut(s),c=a.call(o,s));const u=l.call(o,s);return o.set(s,r),c?Yn(r,u)&&bs(o,"set",s,r):bs(o,"add",s,r),this},delete(s){const r=ut(this),{has:o,get:a}=nu(r);let l=o.call(r,s);l||(s=ut(s),l=o.call(r,s)),a&&a.call(r,s);const c=r.delete(s);return l&&bs(r,"delete",s,void 0),c},clear(){const s=ut(this),r=s.size!==0,o=s.clear();return r&&bs(s,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(s=>{t[s]=RC(s,n,e)}),t}function Yd(n,e){const t=PC(n,e);return(i,s,r)=>s==="__v_isReactive"?!n:s==="__v_isReadonly"?n:s==="__v_raw"?i:Reflect.get(St(t,s)&&s in i?t:i,s,r)}const IC={get:Yd(!1,!1)},LC={get:Yd(!1,!0)},DC={get:Yd(!0,!1)},OC={get:Yd(!0,!0)},eS=new WeakMap,tS=new WeakMap,nS=new WeakMap,iS=new WeakMap;function NC(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function UC(n){return n.__v_skip||!Object.isExtensible(n)?0:NC(oC(n))}function bi(n){return yo(n)?n:jd(n,!1,TC,IC,eS)}function sS(n){return jd(n,!1,AC,LC,tS)}function Ui(n){return jd(n,!0,wC,DC,nS)}function rS(n){return jd(n,!0,CC,OC,iS)}function jd(n,e,t,i,s){if(!It(n)||n.__v_raw&&!(e&&n.__v_isReactive))return n;const r=s.get(n);if(r)return r;const o=UC(n);if(o===0)return n;const a=new Proxy(n,o===2?i:t);return s.set(n,a),a}function Rs(n){return yo(n)?Rs(n.__v_raw):!!(n&&n.__v_isReactive)}function yo(n){return!!(n&&n.__v_isReadonly)}function _i(n){return!!(n&&n.__v_isShallow)}function x0(n){return n?!!n.__v_raw:!1}function ut(n){const e=n&&n.__v_raw;return e?ut(e):n}function M0(n){return!St(n,"__v_skip")&&Object.isExtensible(n)&&FM(n,"__v_skip",!0),n}const Sn=n=>It(n)?bi(n):n,Km=n=>It(n)?Ui(n):n;function Pt(n){return n?n.__v_isRef===!0:!1}function et(n){return oS(n,!1)}function De(n){return oS(n,!0)}function oS(n,e){return Pt(n)?n:new FC(n,e)}class FC{constructor(e,t){this.dep=new $d,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:ut(e),this._value=t?e:Sn(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,i=this.__v_isShallow||_i(e)||yo(e);e=i?e:ut(e),Yn(e,t)&&(this._rawValue=e,this._value=i?e:Sn(e),this.dep.trigger())}}function Ot(n){return Pt(n)?n.value:n}function nt(n){return Ke(n)?n():Ot(n)}const kC={get:(n,e,t)=>e==="__v_raw"?n:Ot(Reflect.get(n,e,t)),set:(n,e,t,i)=>{const s=n[e];return Pt(s)&&!Pt(t)?(s.value=t,!0):Reflect.set(n,e,t,i)}};function aS(n){return Rs(n)?n:new Proxy(n,kC)}class BC{constructor(e){this.__v_isRef=!0,this._value=void 0;const t=this.dep=new $d,{get:i,set:s}=e(t.track.bind(t),t.trigger.bind(t));this._get=i,this._set=s}get value(){return this._value=this._get()}set value(e){this._set(e)}}function S0(n){return new BC(n)}function lS(n){const e=ze(n)?new Array(n.length):{};for(const t in n)e[t]=uS(n,t);return e}class zC{constructor(e,t,i){this._object=e,this._key=t,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return bC(ut(this._object),this._key)}}class VC{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function cS(n,e,t){return Pt(n)?n:Ke(n)?new VC(n):It(n)&&arguments.length>1?uS(n,e,t):et(n)}function uS(n,e,t){const i=n[e];return Pt(i)?i:new zC(n,e,t)}class HC{constructor(e,t,i){this.fn=e,this.setter=t,this._value=void 0,this.dep=new $d(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Hl-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&Dt!==this)return WM(this,!0),!0}get value(){const e=this.dep.track();return qM(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function GC(n,e,t=!1){let i,s;return Ke(n)?i=n:(i=n.get,s=n.set),new HC(i,s,t)}const su={},Df=new WeakMap;let Qr;function WC(n,e=!1,t=Qr){if(t){let i=Df.get(t);i||Df.set(t,i=[]),i.push(n)}}function XC(n,e,t=vt){const{immediate:i,deep:s,once:r,scheduler:o,augmentJob:a,call:l}=t,c=v=>s?v:_i(v)||s===!1||s===0?xs(v,1):xs(v);let u,f,d,h,p=!1,_=!1;if(Pt(n)?(f=()=>n.value,p=_i(n)):Rs(n)?(f=()=>c(n),p=!0):ze(n)?(_=!0,p=n.some(v=>Rs(v)||_i(v)),f=()=>n.map(v=>{if(Pt(v))return v.value;if(Rs(v))return c(v);if(Ke(v))return l?l(v,2):v()})):Ke(n)?e?f=l?()=>l(n,2):n:f=()=>{if(d){Mr();try{d()}finally{Sr()}}const v=Qr;Qr=u;try{return l?l(n,3,[h]):n(h)}finally{Qr=v}}:f=Ki,e&&s){const v=f,T=s===!0?1/0:s;f=()=>xs(v(),T)}const g=Xd(),m=()=>{u.stop(),g&&g.active&&h0(g.effects,u)};if(r&&e){const v=e;e=(...T)=>{v(...T),m()}}let y=_?new Array(n.length).fill(su):su;const b=v=>{if(!(!(u.flags&1)||!u.dirty&&!v))if(e){const T=u.run();if(s||p||(_?T.some((E,S)=>Yn(E,y[S])):Yn(T,y))){d&&d();const E=Qr;Qr=u;try{const S=[T,y===su?void 0:_&&y[0]===su?[]:y,h];l?l(e,3,S):e(...S),y=T}finally{Qr=E}}}else u.run()};return a&&a(b),u=new HM(f),u.scheduler=o?()=>o(b,!1):b,h=v=>WC(v,!1,u),d=u.onStop=()=>{const v=Df.get(u);if(v){if(l)l(v,4);else for(const T of v)T();Df.delete(u)}},e?i?b(!0):y=u.run():o?o(b.bind(null,!0),!0):u.run(),m.pause=u.pause.bind(u),m.resume=u.resume.bind(u),m.stop=m,m}function xs(n,e=1/0,t){if(e<=0||!It(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,Pt(n))xs(n.value,e,t);else if(ze(n))for(let i=0;i{xs(i,e,t)});else if(UM(n)){for(const i in n)xs(n[i],e,t);for(const i of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,i)&&xs(n[i],e,t)}return n}/** -* @vue/runtime-core v3.5.13 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function Ac(n,e,t,i){try{return i?n(...i):n()}catch(s){Kd(s,e,t)}}function Fi(n,e,t,i){if(Ke(n)){const s=Ac(n,e,t,i);return s&&OM(s)&&s.catch(r=>{Kd(r,e,t)}),s}if(ze(n)){const s=[];for(let r=0;r>>1,s=Un[i],r=Wl(s);r=Wl(t)?Un.push(n):Un.splice(qC(e),0,n),n.flags|=1,dS()}}function dS(){Of||(Of=fS.then(pS))}function YC(n){ze(n)?fa.push(...n):nr&&n.id===-1?nr.splice(ta+1,0,n):n.flags&1||(fa.push(n),n.flags|=1),dS()}function mv(n,e,t=Wi+1){for(;tWl(t)-Wl(i));if(fa.length=0,nr){nr.push(...e);return}for(nr=e,ta=0;tan.id==null?n.flags&2?-1:1/0:n.id;function pS(n){try{for(Wi=0;Wi{i._d&&Cv(-1);const r=Nf(e);let o;try{o=n(...s)}finally{Nf(r),i._d&&Cv(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function Z9(n,e){if(Qt===null)return n;const t=eh(Qt),i=n.dirs||(n.dirs=[]);for(let s=0;sn.__isTeleport,yl=n=>n&&(n.disabled||n.disabled===""),gv=n=>n&&(n.defer||n.defer===""),_v=n=>typeof SVGElement<"u"&&n instanceof SVGElement,vv=n=>typeof MathMLElement=="function"&&n instanceof MathMLElement,Zm=(n,e)=>{const t=n&&n.to;return Ut(t)?e?e(t):null:t},yS={name:"Teleport",__isTeleport:!0,process(n,e,t,i,s,r,o,a,l,c){const{mc:u,pc:f,pbc:d,o:{insert:h,querySelector:p,createText:_,createComment:g}}=c,m=yl(e.props);let{shapeFlag:y,children:b,dynamicChildren:v}=e;if(n==null){const T=e.el=_(""),E=e.anchor=_("");h(T,t,i),h(E,t,i);const S=(x,M)=>{y&16&&(s&&s.isCE&&(s.ce._teleportTarget=x),u(b,x,M,s,r,o,a,l))},P=()=>{const x=e.target=Zm(e.props,p),M=bS(x,e,_,h);x&&(o!=="svg"&&_v(x)?o="svg":o!=="mathml"&&vv(x)&&(o="mathml"),m||(S(x,M),gf(e,!1)))};m&&(S(t,E),gf(e,!0)),gv(e.props)?Dn(()=>{P(),e.el.__isMounted=!0},r):P()}else{if(gv(e.props)&&!n.el.__isMounted){Dn(()=>{yS.process(n,e,t,i,s,r,o,a,l,c),delete n.el.__isMounted},r);return}e.el=n.el,e.targetStart=n.targetStart;const T=e.anchor=n.anchor,E=e.target=n.target,S=e.targetAnchor=n.targetAnchor,P=yl(n.props),x=P?t:E,M=P?T:S;if(o==="svg"||_v(E)?o="svg":(o==="mathml"||vv(E))&&(o="mathml"),v?(d(n.dynamicChildren,v,x,s,r,o,a),R0(n,e,!0)):l||f(n,e,x,M,s,r,o,a,!1),m)P?e.props&&n.props&&e.props.to!==n.props.to&&(e.props.to=n.props.to):ru(e,t,T,c,1);else if((e.props&&e.props.to)!==(n.props&&n.props.to)){const L=e.target=Zm(e.props,p);L&&ru(e,L,null,c,0)}else P&&ru(e,E,S,c,1);gf(e,m)}},remove(n,e,t,{um:i,o:{remove:s}},r){const{shapeFlag:o,children:a,anchor:l,targetStart:c,targetAnchor:u,target:f,props:d}=n;if(f&&(s(c),s(u)),r&&s(l),o&16){const h=r||!yl(d);for(let p=0;p{n.isMounted=!0}),CS(()=>{n.isUnmounting=!0}),n}const di=[Function,Array],xS={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:di,onEnter:di,onAfterEnter:di,onEnterCancelled:di,onBeforeLeave:di,onLeave:di,onAfterLeave:di,onLeaveCancelled:di,onBeforeAppear:di,onAppear:di,onAfterAppear:di,onAppearCancelled:di},MS=n=>{const e=n.subTree;return e.component?MS(e.component):e},ZC={name:"BaseTransition",props:xS,setup(n,{slots:e}){const t=wn(),i=KC();return()=>{const s=e.default&&TS(e.default(),!0);if(!s||!s.length)return;const r=SS(s),o=ut(n),{mode:a}=o;if(i.isLeaving)return fp(r);const l=yv(r);if(!l)return fp(r);let c=Jm(l,o,i,t,f=>c=f);l.type!==Fn&&Xl(l,c);let u=t.subTree&&yv(t.subTree);if(u&&u.type!==Fn&&!io(l,u)&&MS(t).type!==Fn){let f=Jm(u,o,i,t);if(Xl(u,f),a==="out-in"&&l.type!==Fn)return i.isLeaving=!0,f.afterLeave=()=>{i.isLeaving=!1,t.job.flags&8||t.update(),delete f.afterLeave,u=void 0},fp(r);a==="in-out"&&l.type!==Fn?f.delayLeave=(d,h,p)=>{const _=ES(i,u);_[String(u.key)]=u,d[ir]=()=>{h(),d[ir]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{p(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return r}}};function SS(n){let e=n[0];if(n.length>1){for(const t of n)if(t.type!==Fn){e=t;break}}return e}const JC=ZC;function ES(n,e){const{leavingVNodes:t}=n;let i=t.get(e.type);return i||(i=Object.create(null),t.set(e.type,i)),i}function Jm(n,e,t,i,s){const{appear:r,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:u,onEnterCancelled:f,onBeforeLeave:d,onLeave:h,onAfterLeave:p,onLeaveCancelled:_,onBeforeAppear:g,onAppear:m,onAfterAppear:y,onAppearCancelled:b}=e,v=String(n.key),T=ES(t,n),E=(x,M)=>{x&&Fi(x,i,9,M)},S=(x,M)=>{const L=M[1];E(x,M),ze(x)?x.every(F=>F.length<=1)&&L():x.length<=1&&L()},P={mode:o,persisted:a,beforeEnter(x){let M=l;if(!t.isMounted)if(r)M=g||l;else return;x[ir]&&x[ir](!0);const L=T[v];L&&io(n,L)&&L.el[ir]&&L.el[ir](),E(M,[x])},enter(x){let M=c,L=u,F=f;if(!t.isMounted)if(r)M=m||c,L=y||u,F=b||f;else return;let H=!1;const Y=x[ou]=ee=>{H||(H=!0,ee?E(F,[x]):E(L,[x]),P.delayedLeave&&P.delayedLeave(),x[ou]=void 0)};M?S(M,[x,Y]):Y()},leave(x,M){const L=String(n.key);if(x[ou]&&x[ou](!0),t.isUnmounting)return M();E(d,[x]);let F=!1;const H=x[ir]=Y=>{F||(F=!0,M(),Y?E(_,[x]):E(p,[x]),x[ir]=void 0,T[L]===n&&delete T[L])};T[L]=n,h?S(h,[x,H]):H()},clone(x){const M=Jm(x,e,t,i,s);return s&&s(M),M}};return P}function fp(n){if(Zd(n))return n=pr(n),n.children=null,n}function yv(n){if(!Zd(n))return vS(n.type)&&n.children?SS(n.children):n;const{shapeFlag:e,children:t}=n;if(t){if(e&16)return t[0];if(e&32&&Ke(t.default))return t.default()}}function Xl(n,e){n.shapeFlag&6&&n.component?(n.transition=e,Xl(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}function TS(n,e=!1,t){let i=[],s=0;for(let r=0;r1)for(let r=0;rUf(p,e&&(ze(e)?e[_]:e),t,i,s));return}if(da(i)&&!s){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&Uf(n,e,t,i.component.subTree);return}const r=i.shapeFlag&4?eh(i.component):i.el,o=s?null:r,{i:a,r:l}=n,c=e&&e.r,u=a.refs===vt?a.refs={}:a.refs,f=a.setupState,d=ut(f),h=f===vt?()=>!1:p=>St(d,p);if(c!=null&&c!==l&&(Ut(c)?(u[c]=null,h(c)&&(f[c]=null)):Pt(c)&&(c.value=null)),Ke(l))Ac(l,a,12,[o,u]);else{const p=Ut(l),_=Pt(l);if(p||_){const g=()=>{if(n.f){const m=p?h(l)?f[l]:u[l]:l.value;s?ze(m)&&h0(m,r):ze(m)?m.includes(r)||m.push(r):p?(u[l]=[r],h(l)&&(f[l]=u[l])):(l.value=[r],n.k&&(u[n.k]=l.value))}else p?(u[l]=o,h(l)&&(f[l]=o)):_&&(l.value=o,n.k&&(u[n.k]=o))};o?(g.id=-1,Dn(g,t)):g()}}}Wd().requestIdleCallback;Wd().cancelIdleCallback;const da=n=>!!n.type.__asyncLoader,Zd=n=>n.type.__isKeepAlive;function QC(n,e){AS(n,"a",e)}function e2(n,e){AS(n,"da",e)}function AS(n,e,t=cn){const i=n.__wdc||(n.__wdc=()=>{let s=t;for(;s;){if(s.isDeactivated)return;s=s.parent}return n()});if(Jd(e,i,t),t){let s=t.parent;for(;s&&s.parent;)Zd(s.parent.vnode)&&t2(i,e,t,s),s=s.parent}}function t2(n,e,t,i){const s=Jd(e,n,i,!0);ns(()=>{h0(i[e],s)},t)}function Jd(n,e,t=cn,i=!1){if(t){const s=t[n]||(t[n]=[]),r=e.__weh||(e.__weh=(...o)=>{Mr();const a=Lc(t),l=Fi(e,t,n,o);return a(),Sr(),l});return i?s.unshift(r):s.push(r),r}}const Bs=n=>(e,t=cn)=>{(!Kl||n==="sp")&&Jd(n,(...i)=>e(...i),t)},n2=Bs("bm"),Hn=Bs("m"),i2=Bs("bu"),s2=Bs("u"),CS=Bs("bum"),ns=Bs("um"),r2=Bs("sp"),o2=Bs("rtg"),a2=Bs("rtc");function l2(n,e=cn){Jd("ec",n,e)}const T0="components",c2="directives";function eG(n,e){return w0(T0,n,!0,e)||n}const RS=Symbol.for("v-ndc");function u2(n){return Ut(n)?w0(T0,n,!1)||n:n||RS}function tG(n){return w0(c2,n)}function w0(n,e,t=!0,i=!1){const s=Qt||cn;if(s){const r=s.type;if(n===T0){const a=J2(r,!1);if(a&&(a===e||a===ai(e)||a===Gd(ai(e))))return r}const o=bv(s[n]||r[n],e)||bv(s.appContext[n],e);return!o&&i?r:o}}function bv(n,e){return n&&(n[e]||n[ai(e)]||n[Gd(ai(e))])}function f2(n,e,t,i){let s;const r=t,o=ze(n);if(o||Ut(n)){const a=o&&Rs(n);let l=!1;a&&(l=!_i(n),n=qd(n)),s=new Array(n.length);for(let c=0,u=n.length;ce(a,l,void 0,r));else{const a=Object.keys(n);s=new Array(a.length);for(let l=0,c=a.length;ljl(e)?!(e.type===Fn||e.type===jt&&!PS(e.children)):!0)?n:null}function nG(n,e){const t={};for(const i in n)t[pf(i)]=n[i];return t}const Qm=n=>n?JS(n)?eh(n):Qm(n.parent):null,bl=nn(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>n.props,$attrs:n=>n.attrs,$slots:n=>n.slots,$refs:n=>n.refs,$parent:n=>Qm(n.parent),$root:n=>Qm(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>DS(n),$forceUpdate:n=>n.f||(n.f=()=>{E0(n.update)}),$nextTick:n=>n.n||(n.n=Er.bind(n.proxy)),$watch:n=>D2.bind(n)}),dp=(n,e)=>n!==vt&&!n.__isScriptSetup&&St(n,e),h2={get({_:n},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:i,data:s,props:r,accessCache:o,type:a,appContext:l}=n;let c;if(e[0]!=="$"){const h=o[e];if(h!==void 0)switch(h){case 1:return i[e];case 2:return s[e];case 4:return t[e];case 3:return r[e]}else{if(dp(i,e))return o[e]=1,i[e];if(s!==vt&&St(s,e))return o[e]=2,s[e];if((c=n.propsOptions[0])&&St(c,e))return o[e]=3,r[e];if(t!==vt&&St(t,e))return o[e]=4,t[e];eg&&(o[e]=0)}}const u=bl[e];let f,d;if(u)return e==="$attrs"&&Mn(n.attrs,"get",""),u(n);if((f=a.__cssModules)&&(f=f[e]))return f;if(t!==vt&&St(t,e))return o[e]=4,t[e];if(d=l.config.globalProperties,St(d,e))return d[e]},set({_:n},e,t){const{data:i,setupState:s,ctx:r}=n;return dp(s,e)?(s[e]=t,!0):i!==vt&&St(i,e)?(i[e]=t,!0):St(n.props,e)||e[0]==="$"&&e.slice(1)in n?!1:(r[e]=t,!0)},has({_:{data:n,setupState:e,accessCache:t,ctx:i,appContext:s,propsOptions:r}},o){let a;return!!t[o]||n!==vt&&St(n,o)||dp(e,o)||(a=r[0])&&St(a,o)||St(i,o)||St(bl,o)||St(s.config.globalProperties,o)},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:St(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};function A0(){return IS().slots}function iG(){return IS().attrs}function IS(){const n=wn();return n.setupContext||(n.setupContext=e1(n))}function $l(n){return ze(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}function sG(n,e){const t=$l(n);for(const i in e){if(i.startsWith("__skip"))continue;let s=t[i];s?ze(s)||Ke(s)?s=t[i]={type:s,default:e[i]}:s.default=e[i]:s===null&&(s=t[i]={default:e[i]}),s&&e[`__skip_${i}`]&&(s.skipFactory=!0)}return t}function rG(n,e){return!n||!e?n||e:ze(n)&&ze(e)?n.concat(e):nn({},$l(n),$l(e))}let eg=!0;function p2(n){const e=DS(n),t=n.proxy,i=n.ctx;eg=!1,e.beforeCreate&&xv(e.beforeCreate,n,"bc");const{data:s,computed:r,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:f,mounted:d,beforeUpdate:h,updated:p,activated:_,deactivated:g,beforeDestroy:m,beforeUnmount:y,destroyed:b,unmounted:v,render:T,renderTracked:E,renderTriggered:S,errorCaptured:P,serverPrefetch:x,expose:M,inheritAttrs:L,components:F,directives:H,filters:Y}=e;if(c&&m2(c,i,null),o)for(const Q in o){const Z=o[Q];Ke(Z)&&(i[Q]=Z.bind(t))}if(s){const Q=s.call(t,t);It(Q)&&(n.data=bi(Q))}if(eg=!0,r)for(const Q in r){const Z=r[Q],he=Ke(Z)?Z.bind(t,t):Ke(Z.get)?Z.get.bind(t,t):Ki,be=!Ke(Z)&&Ke(Z.set)?Z.set.bind(t):Ki,se=Ee({get:he,set:be});Object.defineProperty(i,Q,{enumerable:!0,configurable:!0,get:()=>se.value,set:ye=>se.value=ye})}if(a)for(const Q in a)LS(a[Q],i,t,Q);if(l){const Q=Ke(l)?l.call(t):l;Reflect.ownKeys(Q).forEach(Z=>{dr(Z,Q[Z])})}u&&xv(u,n,"c");function K(Q,Z){ze(Z)?Z.forEach(he=>Q(he.bind(t))):Z&&Q(Z.bind(t))}if(K(n2,f),K(Hn,d),K(i2,h),K(s2,p),K(QC,_),K(e2,g),K(l2,P),K(a2,E),K(o2,S),K(CS,y),K(ns,v),K(r2,x),ze(M))if(M.length){const Q=n.exposed||(n.exposed={});M.forEach(Z=>{Object.defineProperty(Q,Z,{get:()=>t[Z],set:he=>t[Z]=he})})}else n.exposed||(n.exposed={});T&&n.render===Ki&&(n.render=T),L!=null&&(n.inheritAttrs=L),F&&(n.components=F),H&&(n.directives=H),x&&wS(n)}function m2(n,e,t=Ki){ze(n)&&(n=tg(n));for(const i in n){const s=n[i];let r;It(s)?"default"in s?r=En(s.from||i,s.default,!0):r=En(s.from||i):r=En(s),Pt(r)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):e[i]=r}}function xv(n,e,t){Fi(ze(n)?n.map(i=>i.bind(e.proxy)):n.bind(e.proxy),e,t)}function LS(n,e,t,i){let s=i.includes(".")?$S(t,i):()=>t[i];if(Ut(n)){const r=e[n];Ke(r)&&$e(s,r)}else if(Ke(n))$e(s,n.bind(t));else if(It(n))if(ze(n))n.forEach(r=>LS(r,e,t,i));else{const r=Ke(n.handler)?n.handler.bind(t):e[n.handler];Ke(r)&&$e(s,r,n)}}function DS(n){const e=n.type,{mixins:t,extends:i}=e,{mixins:s,optionsCache:r,config:{optionMergeStrategies:o}}=n.appContext,a=r.get(e);let l;return a?l=a:!s.length&&!t&&!i?l=e:(l={},s.length&&s.forEach(c=>Ff(l,c,o,!0)),Ff(l,e,o)),It(e)&&r.set(e,l),l}function Ff(n,e,t,i=!1){const{mixins:s,extends:r}=e;r&&Ff(n,r,t,!0),s&&s.forEach(o=>Ff(n,o,t,!0));for(const o in e)if(!(i&&o==="expose")){const a=g2[o]||t&&t[o];n[o]=a?a(n[o],e[o]):e[o]}return n}const g2={data:Mv,props:Sv,emits:Sv,methods:fl,computed:fl,beforeCreate:Pn,created:Pn,beforeMount:Pn,mounted:Pn,beforeUpdate:Pn,updated:Pn,beforeDestroy:Pn,beforeUnmount:Pn,destroyed:Pn,unmounted:Pn,activated:Pn,deactivated:Pn,errorCaptured:Pn,serverPrefetch:Pn,components:fl,directives:fl,watch:v2,provide:Mv,inject:_2};function Mv(n,e){return e?n?function(){return nn(Ke(n)?n.call(this,this):n,Ke(e)?e.call(this,this):e)}:e:n}function _2(n,e){return fl(tg(n),tg(e))}function tg(n){if(ze(n)){const e={};for(let t=0;t1)return t&&Ke(e)?e.call(i&&i.proxy):e}}function Cc(){return!!(cn||Qt||ho)}const NS={},US=()=>Object.create(NS),FS=n=>Object.getPrototypeOf(n)===NS;function x2(n,e,t,i=!1){const s={},r=US();n.propsDefaults=Object.create(null),kS(n,e,s,r);for(const o in n.propsOptions[0])o in s||(s[o]=void 0);t?n.props=i?s:sS(s):n.type.props?n.props=s:n.props=r,n.attrs=r}function M2(n,e,t,i){const{props:s,attrs:r,vnode:{patchFlag:o}}=n,a=ut(s),[l]=n.propsOptions;let c=!1;if((i||o>0)&&!(o&16)){if(o&8){const u=n.vnode.dynamicProps;for(let f=0;f{l=!0;const[d,h]=BS(f,e,!0);nn(o,d),h&&a.push(...h)};!t&&e.mixins.length&&e.mixins.forEach(u),n.extends&&u(n.extends),n.mixins&&n.mixins.forEach(u)}if(!r&&!l)return It(n)&&i.set(n,ca),ca;if(ze(r))for(let u=0;un[0]==="_"||n==="$stable",C0=n=>ze(n)?n.map(qi):[qi(n)],E2=(n,e,t)=>{if(e._n)return e;const i=gS((...s)=>C0(e(...s)),t);return i._c=!1,i},VS=(n,e,t)=>{const i=n._ctx;for(const s in n){if(zS(s))continue;const r=n[s];if(Ke(r))e[s]=E2(s,r,i);else if(r!=null){const o=C0(r);e[s]=()=>o}}},HS=(n,e)=>{const t=C0(e);n.slots.default=()=>t},GS=(n,e,t)=>{for(const i in e)(t||i!=="_")&&(n[i]=e[i])},T2=(n,e,t)=>{const i=n.slots=US();if(n.vnode.shapeFlag&32){const s=e._;s?(GS(i,e,t),t&&FM(i,"_",s,!0)):VS(e,i)}else e&&HS(n,e)},w2=(n,e,t)=>{const{vnode:i,slots:s}=n;let r=!0,o=vt;if(i.shapeFlag&32){const a=e._;a?t&&a===1?r=!1:GS(s,e,t):(r=!e.$stable,VS(e,s)),o=e}else e&&(HS(n,e),o={default:1});if(r)for(const a in s)!zS(a)&&o[a]==null&&delete s[a]},Dn=B2;function WS(n){return A2(n)}function A2(n,e){const t=Wd();t.__VUE__=!0;const{insert:i,remove:s,patchProp:r,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:f,nextSibling:d,setScopeId:h=Ki,insertStaticContent:p}=n,_=(k,z,R,te=null,G=null,W=null,C=void 0,I=null,N=!!z.dynamicChildren)=>{if(k===z)return;k&&!io(k,z)&&(te=X(k),ye(k,G,W,!0),k=null),z.patchFlag===-2&&(N=!1,z.dynamicChildren=null);const{type:A,ref:w,shapeFlag:U}=z;switch(A){case Ic:g(k,z,R,te);break;case Fn:m(k,z,R,te);break;case _f:k==null&&y(z,R,te,C);break;case jt:F(k,z,R,te,G,W,C,I,N);break;default:U&1?T(k,z,R,te,G,W,C,I,N):U&6?H(k,z,R,te,G,W,C,I,N):(U&64||U&128)&&A.process(k,z,R,te,G,W,C,I,N,ce)}w!=null&&G&&Uf(w,k&&k.ref,W,z||k,!z)},g=(k,z,R,te)=>{if(k==null)i(z.el=a(z.children),R,te);else{const G=z.el=k.el;z.children!==k.children&&c(G,z.children)}},m=(k,z,R,te)=>{k==null?i(z.el=l(z.children||""),R,te):z.el=k.el},y=(k,z,R,te)=>{[k.el,k.anchor]=p(k.children,z,R,te,k.el,k.anchor)},b=({el:k,anchor:z},R,te)=>{let G;for(;k&&k!==z;)G=d(k),i(k,R,te),k=G;i(z,R,te)},v=({el:k,anchor:z})=>{let R;for(;k&&k!==z;)R=d(k),s(k),k=R;s(z)},T=(k,z,R,te,G,W,C,I,N)=>{z.type==="svg"?C="svg":z.type==="math"&&(C="mathml"),k==null?E(z,R,te,G,W,C,I,N):x(k,z,G,W,C,I,N)},E=(k,z,R,te,G,W,C,I)=>{let N,A;const{props:w,shapeFlag:U,transition:O,dirs:V}=k;if(N=k.el=o(k.type,W,w&&w.is,w),U&8?u(N,k.children):U&16&&P(k.children,N,null,te,G,hp(k,W),C,I),V&&Or(k,null,te,"created"),S(N,k,k.scopeId,C,te),w){for(const ue in w)ue!=="value"&&!gl(ue)&&r(N,ue,null,w[ue],W,te);"value"in w&&r(N,"value",null,w.value,W),(A=w.onVnodeBeforeMount)&&Hi(A,te,k)}V&&Or(k,null,te,"beforeMount");const $=C2(G,O);$&&O.beforeEnter(N),i(N,z,R),((A=w&&w.onVnodeMounted)||$||V)&&Dn(()=>{A&&Hi(A,te,k),$&&O.enter(N),V&&Or(k,null,te,"mounted")},G)},S=(k,z,R,te,G)=>{if(R&&h(k,R),te)for(let W=0;W{for(let A=N;A{const I=z.el=k.el;let{patchFlag:N,dynamicChildren:A,dirs:w}=z;N|=k.patchFlag&16;const U=k.props||vt,O=z.props||vt;let V;if(R&&Nr(R,!1),(V=O.onVnodeBeforeUpdate)&&Hi(V,R,z,k),w&&Or(z,k,R,"beforeUpdate"),R&&Nr(R,!0),(U.innerHTML&&O.innerHTML==null||U.textContent&&O.textContent==null)&&u(I,""),A?M(k.dynamicChildren,A,I,R,te,hp(z,G),W):C||Z(k,z,I,null,R,te,hp(z,G),W,!1),N>0){if(N&16)L(I,U,O,R,G);else if(N&2&&U.class!==O.class&&r(I,"class",null,O.class,G),N&4&&r(I,"style",U.style,O.style,G),N&8){const $=z.dynamicProps;for(let ue=0;ue<$.length;ue++){const le=$[ue],Me=U[le],Be=O[le];(Be!==Me||le==="value")&&r(I,le,Me,Be,G,R)}}N&1&&k.children!==z.children&&u(I,z.children)}else!C&&A==null&&L(I,U,O,R,G);((V=O.onVnodeUpdated)||w)&&Dn(()=>{V&&Hi(V,R,z,k),w&&Or(z,k,R,"updated")},te)},M=(k,z,R,te,G,W,C)=>{for(let I=0;I{if(z!==R){if(z!==vt)for(const W in z)!gl(W)&&!(W in R)&&r(k,W,z[W],null,G,te);for(const W in R){if(gl(W))continue;const C=R[W],I=z[W];C!==I&&W!=="value"&&r(k,W,I,C,G,te)}"value"in R&&r(k,"value",z.value,R.value,G)}},F=(k,z,R,te,G,W,C,I,N)=>{const A=z.el=k?k.el:a(""),w=z.anchor=k?k.anchor:a("");let{patchFlag:U,dynamicChildren:O,slotScopeIds:V}=z;V&&(I=I?I.concat(V):V),k==null?(i(A,R,te),i(w,R,te),P(z.children||[],R,w,G,W,C,I,N)):U>0&&U&64&&O&&k.dynamicChildren?(M(k.dynamicChildren,O,R,G,W,C,I),(z.key!=null||G&&z===G.subTree)&&R0(k,z,!0)):Z(k,z,R,w,G,W,C,I,N)},H=(k,z,R,te,G,W,C,I,N)=>{z.slotScopeIds=I,k==null?z.shapeFlag&512?G.ctx.activate(z,R,te,C,N):Y(z,R,te,G,W,C,N):ee(k,z,N)},Y=(k,z,R,te,G,W,C)=>{const I=k.component=Y2(k,te,G);if(Zd(k)&&(I.ctx.renderer=ce),j2(I,!1,C),I.asyncDep){if(G&&G.registerDep(I,K,C),!k.el){const N=I.subTree=pn(Fn);m(null,N,z,R)}}else K(I,k,z,R,G,W,C)},ee=(k,z,R)=>{const te=z.component=k.component;if(F2(k,z,R))if(te.asyncDep&&!te.asyncResolved){Q(te,z,R);return}else te.next=z,te.update();else z.el=k.el,te.vnode=z},K=(k,z,R,te,G,W,C)=>{const I=()=>{if(k.isMounted){let{next:U,bu:O,u:V,parent:$,vnode:ue}=k;{const Te=XS(k);if(Te){U&&(U.el=ue.el,Q(k,U,C)),Te.asyncDep.then(()=>{k.isUnmounted||I()});return}}let le=U,Me;Nr(k,!1),U?(U.el=ue.el,Q(k,U,C)):U=ue,O&&mf(O),(Me=U.props&&U.props.onVnodeBeforeUpdate)&&Hi(Me,$,U,ue),Nr(k,!0);const Be=wv(k),me=k.subTree;k.subTree=Be,_(me,Be,f(me.el),X(me),k,G,W),U.el=Be.el,le===null&&k2(k,Be.el),V&&Dn(V,G),(Me=U.props&&U.props.onVnodeUpdated)&&Dn(()=>Hi(Me,$,U,ue),G)}else{let U;const{el:O,props:V}=z,{bm:$,m:ue,parent:le,root:Me,type:Be}=k,me=da(z);Nr(k,!1),$&&mf($),!me&&(U=V&&V.onVnodeBeforeMount)&&Hi(U,le,z),Nr(k,!0);{Me.ce&&Me.ce._injectChildStyle(Be);const Te=k.subTree=wv(k);_(null,Te,R,te,k,G,W),z.el=Te.el}if(ue&&Dn(ue,G),!me&&(U=V&&V.onVnodeMounted)){const Te=z;Dn(()=>Hi(U,le,Te),G)}(z.shapeFlag&256||le&&da(le.vnode)&&le.vnode.shapeFlag&256)&&k.a&&Dn(k.a,G),k.isMounted=!0,z=R=te=null}};k.scope.on();const N=k.effect=new HM(I);k.scope.off();const A=k.update=N.run.bind(N),w=k.job=N.runIfDirty.bind(N);w.i=k,w.id=k.uid,N.scheduler=()=>E0(w),Nr(k,!0),A()},Q=(k,z,R)=>{z.component=k;const te=k.vnode.props;k.vnode=z,k.next=null,M2(k,z.props,te,R),w2(k,z.children,R),Mr(),mv(k),Sr()},Z=(k,z,R,te,G,W,C,I,N=!1)=>{const A=k&&k.children,w=k?k.shapeFlag:0,U=z.children,{patchFlag:O,shapeFlag:V}=z;if(O>0){if(O&128){be(A,U,R,te,G,W,C,I,N);return}else if(O&256){he(A,U,R,te,G,W,C,I,N);return}}V&8?(w&16&&xe(A,G,W),U!==A&&u(R,U)):w&16?V&16?be(A,U,R,te,G,W,C,I,N):xe(A,G,W,!0):(w&8&&u(R,""),V&16&&P(U,R,te,G,W,C,I,N))},he=(k,z,R,te,G,W,C,I,N)=>{k=k||ca,z=z||ca;const A=k.length,w=z.length,U=Math.min(A,w);let O;for(O=0;Ow?xe(k,G,W,!0,!1,U):P(z,R,te,G,W,C,I,N,U)},be=(k,z,R,te,G,W,C,I,N)=>{let A=0;const w=z.length;let U=k.length-1,O=w-1;for(;A<=U&&A<=O;){const V=k[A],$=z[A]=N?rr(z[A]):qi(z[A]);if(io(V,$))_(V,$,R,null,G,W,C,I,N);else break;A++}for(;A<=U&&A<=O;){const V=k[U],$=z[O]=N?rr(z[O]):qi(z[O]);if(io(V,$))_(V,$,R,null,G,W,C,I,N);else break;U--,O--}if(A>U){if(A<=O){const V=O+1,$=VO)for(;A<=U;)ye(k[A],G,W,!0),A++;else{const V=A,$=A,ue=new Map;for(A=$;A<=O;A++){const Se=z[A]=N?rr(z[A]):qi(z[A]);Se.key!=null&&ue.set(Se.key,A)}let le,Me=0;const Be=O-$+1;let me=!1,Te=0;const Ve=new Array(Be);for(A=0;A=Be){ye(Se,G,W,!0);continue}let Je;if(Se.key!=null)Je=ue.get(Se.key);else for(le=$;le<=O;le++)if(Ve[le-$]===0&&io(Se,z[le])){Je=le;break}Je===void 0?ye(Se,G,W,!0):(Ve[Je-$]=A+1,Je>=Te?Te=Je:me=!0,_(Se,z[Je],R,null,G,W,C,I,N),Me++)}const We=me?R2(Ve):ca;for(le=We.length-1,A=Be-1;A>=0;A--){const Se=$+A,Je=z[Se],it=Se+1{const{el:W,type:C,transition:I,children:N,shapeFlag:A}=k;if(A&6){se(k.component.subTree,z,R,te);return}if(A&128){k.suspense.move(z,R,te);return}if(A&64){C.move(k,z,R,ce);return}if(C===jt){i(W,z,R);for(let U=0;UI.enter(W),G);else{const{leave:U,delayLeave:O,afterLeave:V}=I,$=()=>i(W,z,R),ue=()=>{U(W,()=>{$(),V&&V()})};O?O(W,$,ue):ue()}else i(W,z,R)},ye=(k,z,R,te=!1,G=!1)=>{const{type:W,props:C,ref:I,children:N,dynamicChildren:A,shapeFlag:w,patchFlag:U,dirs:O,cacheIndex:V}=k;if(U===-2&&(G=!1),I!=null&&Uf(I,null,R,k,!0),V!=null&&(z.renderCache[V]=void 0),w&256){z.ctx.deactivate(k);return}const $=w&1&&O,ue=!da(k);let le;if(ue&&(le=C&&C.onVnodeBeforeUnmount)&&Hi(le,z,k),w&6)ge(k.component,R,te);else{if(w&128){k.suspense.unmount(R,te);return}$&&Or(k,null,z,"beforeUnmount"),w&64?k.type.remove(k,z,R,ce,te):A&&!A.hasOnce&&(W!==jt||U>0&&U&64)?xe(A,z,R,!1,!0):(W===jt&&U&384||!G&&w&16)&&xe(N,z,R),te&&He(k)}(ue&&(le=C&&C.onVnodeUnmounted)||$)&&Dn(()=>{le&&Hi(le,z,k),$&&Or(k,null,z,"unmounted")},R)},He=k=>{const{type:z,el:R,anchor:te,transition:G}=k;if(z===jt){re(R,te);return}if(z===_f){v(k);return}const W=()=>{s(R),G&&!G.persisted&&G.afterLeave&&G.afterLeave()};if(k.shapeFlag&1&&G&&!G.persisted){const{leave:C,delayLeave:I}=G,N=()=>C(R,W);I?I(k.el,W,N):N()}else W()},re=(k,z)=>{let R;for(;k!==z;)R=d(k),s(k),k=R;s(z)},ge=(k,z,R)=>{const{bum:te,scope:G,job:W,subTree:C,um:I,m:N,a:A}=k;Tv(N),Tv(A),te&&mf(te),G.stop(),W&&(W.flags|=8,ye(C,k,z,R)),I&&Dn(I,z),Dn(()=>{k.isUnmounted=!0},z),z&&z.pendingBranch&&!z.isUnmounted&&k.asyncDep&&!k.asyncResolved&&k.suspenseId===z.pendingId&&(z.deps--,z.deps===0&&z.resolve())},xe=(k,z,R,te=!1,G=!1,W=0)=>{for(let C=W;C{if(k.shapeFlag&6)return X(k.component.subTree);if(k.shapeFlag&128)return k.suspense.next();const z=d(k.anchor||k.el),R=z&&z[_S];return R?d(R):z};let ae=!1;const fe=(k,z,R)=>{k==null?z._vnode&&ye(z._vnode,null,null,!0):_(z._vnode||null,k,z,null,null,null,R),z._vnode=k,ae||(ae=!0,mv(),hS(),ae=!1)},ce={p:_,um:ye,m:se,r:He,mt:Y,mc:P,pc:Z,pbc:M,n:X,o:n};return{render:fe,hydrate:void 0,createApp:b2(fe)}}function hp({type:n,props:e},t){return t==="svg"&&n==="foreignObject"||t==="mathml"&&n==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:t}function Nr({effect:n,job:e},t){t?(n.flags|=32,e.flags|=4):(n.flags&=-33,e.flags&=-5)}function C2(n,e){return(!n||n&&!n.pendingBranch)&&e&&!e.persisted}function R0(n,e,t=!1){const i=n.children,s=e.children;if(ze(i)&&ze(s))for(let r=0;r>1,n[t[a]]0&&(e[i]=t[r-1]),t[r]=i)}}for(r=t.length,o=t[r-1];r-- >0;)t[r]=o,o=e[o];return t}function XS(n){const e=n.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:XS(e)}function Tv(n){if(n)for(let e=0;eEn(P2);function Rc(n,e){return Pc(n,null,e)}function oG(n,e){return Pc(n,null,{flush:"post"})}function L2(n,e){return Pc(n,null,{flush:"sync"})}function $e(n,e,t){return Pc(n,e,t)}function Pc(n,e,t=vt){const{immediate:i,deep:s,flush:r,once:o}=t,a=nn({},t),l=e&&i||!e&&r!=="post";let c;if(Kl){if(r==="sync"){const h=I2();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!l){const h=()=>{};return h.stop=Ki,h.resume=Ki,h.pause=Ki,h}}const u=cn;a.call=(h,p,_)=>Fi(h,u,p,_);let f=!1;r==="post"?a.scheduler=h=>{Dn(h,u&&u.suspense)}:r!=="sync"&&(f=!0,a.scheduler=(h,p)=>{p?h():E0(h)}),a.augmentJob=h=>{e&&(h.flags|=4),f&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const d=XC(n,e,a);return Kl&&(c?c.push(d):l&&d()),d}function D2(n,e,t){const i=this.proxy,s=Ut(n)?n.includes(".")?$S(i,n):()=>i[n]:n.bind(i,i);let r;Ke(e)?r=e:(r=e.handler,t=e);const o=Lc(this),a=Pc(s,r.bind(i),t);return o(),a}function $S(n,e){const t=e.split(".");return()=>{let i=n;for(let s=0;s{let u,f=vt,d;return L2(()=>{const h=n[s];Yn(u,h)&&(u=h,c())}),{get(){return l(),t.get?t.get(u):u},set(h){const p=t.set?t.set(h):h;if(!Yn(p,u)&&!(f!==vt&&Yn(h,f)))return;const _=i.vnode.props;_&&(e in _||s in _||r in _)&&(`onUpdate:${e}`in _||`onUpdate:${s}`in _||`onUpdate:${r}`in _)||(u=h,c()),i.emit(`update:${e}`,p),Yn(h,p)&&Yn(h,f)&&!Yn(p,d)&&c(),f=h,d=p}}});return a[Symbol.iterator]=()=>{let l=0;return{next(){return l<2?{value:l++?o||vt:a,done:!1}:{done:!0}}}},a}const qS=(n,e)=>e==="modelValue"||e==="model-value"?n.modelModifiers:n[`${e}Modifiers`]||n[`${ai(e)}Modifiers`]||n[`${ks(e)}Modifiers`];function O2(n,e,...t){if(n.isUnmounted)return;const i=n.vnode.props||vt;let s=t;const r=e.startsWith("update:"),o=r&&qS(i,e.slice(7));o&&(o.trim&&(s=t.map(u=>Ut(u)?u.trim():u)),o.number&&(s=t.map(If)));let a,l=i[a=pf(e)]||i[a=pf(ai(e))];!l&&r&&(l=i[a=pf(ks(e))]),l&&Fi(l,n,6,s);const c=i[a+"Once"];if(c){if(!n.emitted)n.emitted={};else if(n.emitted[a])return;n.emitted[a]=!0,Fi(c,n,6,s)}}function YS(n,e,t=!1){const i=e.emitsCache,s=i.get(n);if(s!==void 0)return s;const r=n.emits;let o={},a=!1;if(!Ke(n)){const l=c=>{const u=YS(c,e,!0);u&&(a=!0,nn(o,u))};!t&&e.mixins.length&&e.mixins.forEach(l),n.extends&&l(n.extends),n.mixins&&n.mixins.forEach(l)}return!r&&!a?(It(n)&&i.set(n,null),null):(ze(r)?r.forEach(l=>o[l]=null):nn(o,r),It(n)&&i.set(n,o),o)}function Qd(n,e){return!n||!Vd(e)?!1:(e=e.slice(2).replace(/Once$/,""),St(n,e[0].toLowerCase()+e.slice(1))||St(n,ks(e))||St(n,e))}function wv(n){const{type:e,vnode:t,proxy:i,withProxy:s,propsOptions:[r],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:f,data:d,setupState:h,ctx:p,inheritAttrs:_}=n,g=Nf(n);let m,y;try{if(t.shapeFlag&4){const v=s||i,T=v;m=qi(c.call(T,v,u,f,h,d,p)),y=a}else{const v=e;m=qi(v.length>1?v(f,{attrs:a,slots:o,emit:l}):v(f,null)),y=e.props?a:N2(a)}}catch(v){xl.length=0,Kd(v,n,1),m=pn(Fn)}let b=m;if(y&&_!==!1){const v=Object.keys(y),{shapeFlag:T}=b;v.length&&T&7&&(r&&v.some(d0)&&(y=U2(y,r)),b=pr(b,y,!1,!0))}return t.dirs&&(b=pr(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(t.dirs):t.dirs),t.transition&&Xl(b,t.transition),m=b,Nf(g),m}const N2=n=>{let e;for(const t in n)(t==="class"||t==="style"||Vd(t))&&((e||(e={}))[t]=n[t]);return e},U2=(n,e)=>{const t={};for(const i in n)(!d0(i)||!(i.slice(9)in e))&&(t[i]=n[i]);return t};function F2(n,e,t){const{props:i,children:s,component:r}=n,{props:o,children:a,patchFlag:l}=e,c=r.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&l>=0){if(l&1024)return!0;if(l&16)return i?Av(i,o,c):!!o;if(l&8){const u=e.dynamicProps;for(let f=0;fn.__isSuspense;function B2(n,e){e&&e.pendingBranch?ze(n)?e.effects.push(...n):e.effects.push(n):YC(n)}const jt=Symbol.for("v-fgt"),Ic=Symbol.for("v-txt"),Fn=Symbol.for("v-cmt"),_f=Symbol.for("v-stc"),xl=[];let si=null;function mn(n=!1){xl.push(si=n?null:[])}function z2(){xl.pop(),si=xl[xl.length-1]||null}let ql=1;function Cv(n,e=!1){ql+=n,n<0&&si&&e&&(si.hasOnce=!0)}function KS(n){return n.dynamicChildren=ql>0?si||ca:null,z2(),ql>0&&si&&si.push(n),n}function vi(n,e,t,i,s,r){return KS(sr(n,e,t,i,s,r,!0))}function Yl(n,e,t,i,s){return KS(pn(n,e,t,i,s,!0))}function jl(n){return n?n.__v_isVNode===!0:!1}function io(n,e){return n.type===e.type&&n.key===e.key}const ZS=({key:n})=>n??null,vf=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?Ut(n)||Pt(n)||Ke(n)?{i:Qt,r:n,k:e,f:!!t}:n:null);function sr(n,e=null,t=null,i=0,s=null,r=n===jt?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&ZS(e),ref:e&&vf(e),scopeId:mS,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:i,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Qt};return a?(P0(l,t),r&128&&n.normalize(l)):t&&(l.shapeFlag|=Ut(t)?8:16),ql>0&&!o&&si&&(l.patchFlag>0||r&6)&&l.patchFlag!==32&&si.push(l),l}const pn=V2;function V2(n,e=null,t=null,i=0,s=null,r=!1){if((!n||n===RS)&&(n=Fn),jl(n)){const a=pr(n,e,!0);return t&&P0(a,t),ql>0&&!r&&si&&(a.shapeFlag&6?si[si.indexOf(n)]=a:si.push(a)),a.patchFlag=-2,a}if(Q2(n)&&(n=n.__vccOpts),e){e=H2(e);let{class:a,style:l}=e;a&&!Ut(a)&&(e.class=Oa(a)),It(l)&&(x0(l)&&!ze(l)&&(l=nn({},l)),e.style=Mi(l))}const o=Ut(n)?1:jS(n)?128:vS(n)?64:It(n)?4:Ke(n)?2:0;return sr(n,e,t,i,s,o,r,!0)}function H2(n){return n?x0(n)||FS(n)?nn({},n):n:null}function pr(n,e,t=!1,i=!1){const{props:s,ref:r,patchFlag:o,children:a,transition:l}=n,c=e?X2(s||{},e):s,u={__v_isVNode:!0,__v_skip:!0,type:n.type,props:c,key:c&&ZS(c),ref:e&&e.ref?t&&r?ze(r)?r.concat(vf(e)):[r,vf(e)]:vf(e):r,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:a,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==jt?o===-1?16:o|16:o,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:l,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&pr(n.ssContent),ssFallback:n.ssFallback&&pr(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return l&&i&&Xl(u,l.clone(u)),u}function G2(n=" ",e=0){return pn(Ic,null,n,e)}function W2(n,e){const t=pn(_f,null,n);return t.staticCount=e,t}function Rv(n="",e=!1){return e?(mn(),Yl(Fn,null,n)):pn(Fn,null,n)}function qi(n){return n==null||typeof n=="boolean"?pn(Fn):ze(n)?pn(jt,null,n.slice()):jl(n)?rr(n):pn(Ic,null,String(n))}function rr(n){return n.el===null&&n.patchFlag!==-1||n.memo?n:pr(n)}function P0(n,e){let t=0;const{shapeFlag:i}=n;if(e==null)e=null;else if(ze(e))t=16;else if(typeof e=="object")if(i&65){const s=e.default;s&&(s._c&&(s._d=!1),P0(n,s()),s._c&&(s._d=!0));return}else{t=32;const s=e._;!s&&!FS(e)?e._ctx=Qt:s===3&&Qt&&(Qt.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else Ke(e)?(e={default:e,_ctx:Qt},t=32):(e=String(e),i&64?(t=16,e=[G2(e)]):t=8);n.children=e,n.shapeFlag|=t}function X2(...n){const e={};for(let t=0;tcn||Qt;let kf,ig;{const n=Wd(),e=(t,i)=>{let s;return(s=n[t])||(s=n[t]=[]),s.push(i),r=>{s.length>1?s.forEach(o=>o(r)):s[0](r)}};kf=e("__VUE_INSTANCE_SETTERS__",t=>cn=t),ig=e("__VUE_SSR_SETTERS__",t=>Kl=t)}const Lc=n=>{const e=cn;return kf(n),n.scope.on(),()=>{n.scope.off(),kf(e)}},Pv=()=>{cn&&cn.scope.off(),kf(null)};function JS(n){return n.vnode.shapeFlag&4}let Kl=!1;function j2(n,e=!1,t=!1){e&&ig(e);const{props:i,children:s}=n.vnode,r=JS(n);x2(n,i,r,e),T2(n,s,t);const o=r?K2(n,e):void 0;return e&&ig(!1),o}function K2(n,e){const t=n.type;n.accessCache=Object.create(null),n.proxy=new Proxy(n.ctx,h2);const{setup:i}=t;if(i){Mr();const s=n.setupContext=i.length>1?e1(n):null,r=Lc(n),o=Ac(i,n,0,[n.props,s]),a=OM(o);if(Sr(),r(),(a||n.sp)&&!da(n)&&wS(n),a){if(o.then(Pv,Pv),e)return o.then(l=>{Iv(n,l)}).catch(l=>{Kd(l,n,0)});n.asyncDep=o}else Iv(n,o)}else QS(n)}function Iv(n,e,t){Ke(e)?n.type.__ssrInlineRender?n.ssrRender=e:n.render=e:It(e)&&(n.setupState=aS(e)),QS(n)}function QS(n,e,t){const i=n.type;n.render||(n.render=i.render||Ki);{const s=Lc(n);Mr();try{p2(n)}finally{Sr(),s()}}}const Z2={get(n,e){return Mn(n,"get",""),n[e]}};function e1(n){const e=t=>{n.exposed=t||{}};return{attrs:new Proxy(n.attrs,Z2),slots:n.slots,emit:n.emit,expose:e}}function eh(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(aS(M0(n.exposed)),{get(e,t){if(t in e)return e[t];if(t in bl)return bl[t](n)},has(e,t){return t in e||t in bl}})):n.proxy}function J2(n,e=!0){return Ke(n)?n.displayName||n.name:n.name||e&&n.__name}function Q2(n){return Ke(n)&&"__vccOpts"in n}const Ee=(n,e)=>GC(n,e,Kl);function Ds(n,e,t){const i=arguments.length;return i===2?It(e)&&!ze(e)?jl(e)?pn(n,null,[e]):pn(n,e):pn(n,null,e):(i>3?t=Array.prototype.slice.call(arguments,2):i===3&&jl(t)&&(t=[t]),pn(n,e,t))}const eR="3.5.13";/** -* @vue/runtime-dom v3.5.13 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let sg;const Lv=typeof window<"u"&&window.trustedTypes;if(Lv)try{sg=Lv.createPolicy("vue",{createHTML:n=>n})}catch{}const t1=sg?n=>sg.createHTML(n):n=>n,tR="http://www.w3.org/2000/svg",nR="http://www.w3.org/1998/Math/MathML",ys=typeof document<"u"?document:null,Dv=ys&&ys.createElement("template"),iR={insert:(n,e,t)=>{e.insertBefore(n,t||null)},remove:n=>{const e=n.parentNode;e&&e.removeChild(n)},createElement:(n,e,t,i)=>{const s=e==="svg"?ys.createElementNS(tR,n):e==="mathml"?ys.createElementNS(nR,n):t?ys.createElement(n,{is:t}):ys.createElement(n);return n==="select"&&i&&i.multiple!=null&&s.setAttribute("multiple",i.multiple),s},createText:n=>ys.createTextNode(n),createComment:n=>ys.createComment(n),setText:(n,e)=>{n.nodeValue=e},setElementText:(n,e)=>{n.textContent=e},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>ys.querySelector(n),setScopeId(n,e){n.setAttribute(e,"")},insertStaticContent(n,e,t,i,s,r){const o=t?t.previousSibling:e.lastChild;if(s&&(s===r||s.nextSibling))for(;e.insertBefore(s.cloneNode(!0),t),!(s===r||!(s=s.nextSibling)););else{Dv.innerHTML=t1(i==="svg"?`${n}`:i==="mathml"?`${n}`:n);const a=Dv.content;if(i==="svg"||i==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,t)}return[o?o.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},Xs="transition",qa="animation",Zl=Symbol("_vtc"),n1={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},sR=nn({},xS,n1),rR=n=>(n.displayName="Transition",n.props=sR,n),lG=rR((n,{slots:e})=>Ds(JC,oR(n),e)),Ur=(n,e=[])=>{ze(n)?n.forEach(t=>t(...e)):n&&n(...e)},Ov=n=>n?ze(n)?n.some(e=>e.length>1):n.length>1:!1;function oR(n){const e={};for(const F in n)F in n1||(e[F]=n[F]);if(n.css===!1)return e;const{name:t="v",type:i,duration:s,enterFromClass:r=`${t}-enter-from`,enterActiveClass:o=`${t}-enter-active`,enterToClass:a=`${t}-enter-to`,appearFromClass:l=r,appearActiveClass:c=o,appearToClass:u=a,leaveFromClass:f=`${t}-leave-from`,leaveActiveClass:d=`${t}-leave-active`,leaveToClass:h=`${t}-leave-to`}=n,p=aR(s),_=p&&p[0],g=p&&p[1],{onBeforeEnter:m,onEnter:y,onEnterCancelled:b,onLeave:v,onLeaveCancelled:T,onBeforeAppear:E=m,onAppear:S=y,onAppearCancelled:P=b}=e,x=(F,H,Y,ee)=>{F._enterCancelled=ee,Fr(F,H?u:a),Fr(F,H?c:o),Y&&Y()},M=(F,H)=>{F._isLeaving=!1,Fr(F,f),Fr(F,h),Fr(F,d),H&&H()},L=F=>(H,Y)=>{const ee=F?S:y,K=()=>x(H,F,Y);Ur(ee,[H,K]),Nv(()=>{Fr(H,F?l:r),cs(H,F?u:a),Ov(ee)||Uv(H,i,_,K)})};return nn(e,{onBeforeEnter(F){Ur(m,[F]),cs(F,r),cs(F,o)},onBeforeAppear(F){Ur(E,[F]),cs(F,l),cs(F,c)},onEnter:L(!1),onAppear:L(!0),onLeave(F,H){F._isLeaving=!0;const Y=()=>M(F,H);cs(F,f),F._enterCancelled?(cs(F,d),Bv()):(Bv(),cs(F,d)),Nv(()=>{F._isLeaving&&(Fr(F,f),cs(F,h),Ov(v)||Uv(F,i,g,Y))}),Ur(v,[F,Y])},onEnterCancelled(F){x(F,!1,void 0,!0),Ur(b,[F])},onAppearCancelled(F){x(F,!0,void 0,!0),Ur(P,[F])},onLeaveCancelled(F){M(F),Ur(T,[F])}})}function aR(n){if(n==null)return null;if(It(n))return[pp(n.enter),pp(n.leave)];{const e=pp(n);return[e,e]}}function pp(n){return cC(n)}function cs(n,e){e.split(/\s+/).forEach(t=>t&&n.classList.add(t)),(n[Zl]||(n[Zl]=new Set)).add(e)}function Fr(n,e){e.split(/\s+/).forEach(i=>i&&n.classList.remove(i));const t=n[Zl];t&&(t.delete(e),t.size||(n[Zl]=void 0))}function Nv(n){requestAnimationFrame(()=>{requestAnimationFrame(n)})}let lR=0;function Uv(n,e,t,i){const s=n._endId=++lR,r=()=>{s===n._endId&&i()};if(t!=null)return setTimeout(r,t);const{type:o,timeout:a,propCount:l}=cR(n,e);if(!o)return i();const c=o+"end";let u=0;const f=()=>{n.removeEventListener(c,d),r()},d=h=>{h.target===n&&++u>=l&&f()};setTimeout(()=>{u(t[p]||"").split(", "),s=i(`${Xs}Delay`),r=i(`${Xs}Duration`),o=Fv(s,r),a=i(`${qa}Delay`),l=i(`${qa}Duration`),c=Fv(a,l);let u=null,f=0,d=0;e===Xs?o>0&&(u=Xs,f=o,d=r.length):e===qa?c>0&&(u=qa,f=c,d=l.length):(f=Math.max(o,c),u=f>0?o>c?Xs:qa:null,d=u?u===Xs?r.length:l.length:0);const h=u===Xs&&/\b(transform|all)(,|$)/.test(i(`${Xs}Property`).toString());return{type:u,timeout:f,propCount:d,hasTransform:h}}function Fv(n,e){for(;n.lengthkv(t)+kv(n[i])))}function kv(n){return n==="auto"?0:Number(n.slice(0,-1).replace(",","."))*1e3}function Bv(){return document.body.offsetHeight}function uR(n,e,t){const i=n[Zl];i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?n.removeAttribute("class"):t?n.setAttribute("class",e):n.className=e}const zv=Symbol("_vod"),fR=Symbol("_vsh"),dR=Symbol(""),hR=/(^|;)\s*display\s*:/;function pR(n,e,t){const i=n.style,s=Ut(t);let r=!1;if(t&&!s){if(e)if(Ut(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();t[a]==null&&yf(i,a,"")}else for(const o in e)t[o]==null&&yf(i,o,"");for(const o in t)o==="display"&&(r=!0),yf(i,o,t[o])}else if(s){if(e!==t){const o=i[dR];o&&(t+=";"+o),i.cssText=t,r=hR.test(t)}}else e&&n.removeAttribute("style");zv in n&&(n[zv]=r?i.display:"",n[fR]&&(i.display="none"))}const Vv=/\s*!important$/;function yf(n,e,t){if(ze(t))t.forEach(i=>yf(n,e,i));else if(t==null&&(t=""),e.startsWith("--"))n.setProperty(e,t);else{const i=mR(n,e);Vv.test(t)?n.setProperty(ks(i),t.replace(Vv,""),"important"):n[i]=t}}const Hv=["Webkit","Moz","ms"],mp={};function mR(n,e){const t=mp[e];if(t)return t;let i=ai(e);if(i!=="filter"&&i in n)return mp[e]=i;i=Gd(i);for(let s=0;sgp||(yR.then(()=>gp=0),gp=Date.now());function xR(n,e){const t=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=t.attached)return;Fi(MR(i,t.value),e,5,[i])};return t.value=n,t.attached=bR(),t}function MR(n,e){if(ze(e)){const t=n.stopImmediatePropagation;return n.stopImmediatePropagation=()=>{t.call(n),n._stopped=!0},e.map(i=>s=>!s._stopped&&i&&i(s))}else return e}const Yv=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>96&&n.charCodeAt(2)<123,SR=(n,e,t,i,s,r)=>{const o=s==="svg";e==="class"?uR(n,i,o):e==="style"?pR(n,t,i):Vd(e)?d0(e)||_R(n,e,t,i,r):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):ER(n,e,i,o))?(Xv(n,e,i),!n.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&Wv(n,e,i,o,r,e!=="value")):n._isVueCE&&(/[A-Z]/.test(e)||!Ut(i))?Xv(n,ai(e),i,r,e):(e==="true-value"?n._trueValue=i:e==="false-value"&&(n._falseValue=i),Wv(n,e,i,o))};function ER(n,e,t,i){if(i)return!!(e==="innerHTML"||e==="textContent"||e in n&&Yv(e)&&Ke(t));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&n.tagName==="INPUT"||e==="type"&&n.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const s=n.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return Yv(e)&&Ut(t)?!1:e in n}const mr=n=>{const e=n.props["onUpdate:modelValue"]||!1;return ze(e)?t=>mf(e,t):e};function TR(n){n.target.composing=!0}function jv(n){const e=n.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const yi=Symbol("_assign"),Kv={created(n,{modifiers:{lazy:e,trim:t,number:i}},s){n[yi]=mr(s);const r=i||s.props&&s.props.type==="number";Ms(n,e?"change":"input",o=>{if(o.target.composing)return;let a=n.value;t&&(a=a.trim()),r&&(a=If(a)),n[yi](a)}),t&&Ms(n,"change",()=>{n.value=n.value.trim()}),e||(Ms(n,"compositionstart",TR),Ms(n,"compositionend",jv),Ms(n,"change",jv))},mounted(n,{value:e}){n.value=e??""},beforeUpdate(n,{value:e,oldValue:t,modifiers:{lazy:i,trim:s,number:r}},o){if(n[yi]=mr(o),n.composing)return;const a=(r||n.type==="number")&&!/^0\d/.test(n.value)?If(n.value):n.value,l=e??"";a!==l&&(document.activeElement===n&&n.type!=="range"&&(i&&e===t||s&&n.value.trim()===l)||(n.value=l))}},wR={deep:!0,created(n,e,t){n[yi]=mr(t),Ms(n,"change",()=>{const i=n._modelValue,s=ga(n),r=n.checked,o=n[yi];if(ze(i)){const a=m0(i,s),l=a!==-1;if(r&&!l)o(i.concat(s));else if(!r&&l){const c=[...i];c.splice(a,1),o(c)}}else if(Da(i)){const a=new Set(i);r?a.add(s):a.delete(s),o(a)}else o(i1(n,r))})},mounted:Zv,beforeUpdate(n,e,t){n[yi]=mr(t),Zv(n,e,t)}};function Zv(n,{value:e,oldValue:t},i){n._modelValue=e;let s;if(ze(e))s=m0(e,i.props.value)>-1;else if(Da(e))s=e.has(i.props.value);else{if(e===t)return;s=vo(e,i1(n,!0))}n.checked!==s&&(n.checked=s)}const AR={created(n,{value:e},t){n.checked=vo(e,t.props.value),n[yi]=mr(t),Ms(n,"change",()=>{n[yi](ga(n))})},beforeUpdate(n,{value:e,oldValue:t},i){n[yi]=mr(i),e!==t&&(n.checked=vo(e,i.props.value))}},CR={deep:!0,created(n,{value:e,modifiers:{number:t}},i){const s=Da(e);Ms(n,"change",()=>{const r=Array.prototype.filter.call(n.options,o=>o.selected).map(o=>t?If(ga(o)):ga(o));n[yi](n.multiple?s?new Set(r):r:r[0]),n._assigning=!0,Er(()=>{n._assigning=!1})}),n[yi]=mr(i)},mounted(n,{value:e}){Jv(n,e)},beforeUpdate(n,e,t){n[yi]=mr(t)},updated(n,{value:e}){n._assigning||Jv(n,e)}};function Jv(n,e){const t=n.multiple,i=ze(e);if(!(t&&!i&&!Da(e))){for(let s=0,r=n.options.length;sString(c)===String(a)):o.selected=m0(e,a)>-1}else o.selected=e.has(a);else if(vo(ga(o),e)){n.selectedIndex!==s&&(n.selectedIndex=s);return}}!t&&n.selectedIndex!==-1&&(n.selectedIndex=-1)}}function ga(n){return"_value"in n?n._value:n.value}function i1(n,e){const t=e?"_trueValue":"_falseValue";return t in n?n[t]:e}const cG={created(n,e,t){au(n,e,t,null,"created")},mounted(n,e,t){au(n,e,t,null,"mounted")},beforeUpdate(n,e,t,i){au(n,e,t,i,"beforeUpdate")},updated(n,e,t,i){au(n,e,t,i,"updated")}};function RR(n,e){switch(n){case"SELECT":return CR;case"TEXTAREA":return Kv;default:switch(e){case"checkbox":return wR;case"radio":return AR;default:return Kv}}}function au(n,e,t,i,s){const o=RR(n.tagName,t.props&&t.props.type)[s];o&&o(n,e,t,i)}const PR=["ctrl","shift","alt","meta"],IR={stop:n=>n.stopPropagation(),prevent:n=>n.preventDefault(),self:n=>n.target!==n.currentTarget,ctrl:n=>!n.ctrlKey,shift:n=>!n.shiftKey,alt:n=>!n.altKey,meta:n=>!n.metaKey,left:n=>"button"in n&&n.button!==0,middle:n=>"button"in n&&n.button!==1,right:n=>"button"in n&&n.button!==2,exact:(n,e)=>PR.some(t=>n[`${t}Key`]&&!e.includes(t))},uG=(n,e)=>{const t=n._withMods||(n._withMods={}),i=e.join(".");return t[i]||(t[i]=(s,...r)=>{for(let o=0;o{const t=n._withKeys||(n._withKeys={}),i=e.join(".");return t[i]||(t[i]=s=>{if(!("key"in s))return;const r=ks(s.key);if(e.some(o=>o===r||LR[o]===r))return n(s)})},DR=nn({patchProp:SR},iR);let Qv;function s1(){return Qv||(Qv=WS(DR))}const dG=(...n)=>{s1().render(...n)},OR=(...n)=>{const e=s1().createApp(...n),{mount:t}=e;return e.mount=i=>{const s=UR(i);if(!s)return;const r=e._component;!Ke(r)&&!r.render&&!r.template&&(r.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const o=t(s,!1,NR(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),o},e};function NR(n){if(n instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&n instanceof MathMLElement)return"mathml"}function UR(n){return Ut(n)?document.querySelector(n):n}const r1=new Set,Zn=new WeakMap,_a=new WeakMap,bo=new WeakMap,rg=new WeakMap,FR=new WeakMap,va=new WeakMap,Bf=new WeakMap,dl=new WeakSet;let gr,I0=0,L0=0;const Ts="__aa_tgt",Jl="__aa_del",zf="__aa_new",kR=n=>{const e=WR(n);e&&e.forEach(t=>XR(t))},BR=n=>{n.forEach(e=>{e.target===gr&&VR(),Zn.has(e.target)&&wo(e.target)})};function zR(n){const e=rg.get(n);e==null||e.disconnect();let t=Zn.get(n),i=0;const s=5;t||(t=ya(n),Zn.set(n,t));const{offsetWidth:r,offsetHeight:o}=gr,l=[t.top-s,r-(t.left+s+t.width),o-(t.top+s+t.height),t.left-s].map(u=>`${-1*Math.floor(u)}px`).join(" "),c=new IntersectionObserver(()=>{++i>1&&wo(n)},{root:gr,threshold:1,rootMargin:l});c.observe(n),rg.set(n,c)}function wo(n){clearTimeout(Bf.get(n));const e=th(n),t=Ql(e)?500:e.duration;Bf.set(n,setTimeout(async()=>{const i=bo.get(n);try{await(i==null?void 0:i.finished),Zn.set(n,ya(n)),zR(n)}catch{}},t))}function VR(){clearTimeout(Bf.get(gr)),Bf.set(gr,setTimeout(()=>{r1.forEach(n=>c1(n,e=>o1(()=>wo(e))))},100))}function HR(n){setTimeout(()=>{FR.set(n,setInterval(()=>o1(wo.bind(null,n)),2e3))},Math.round(2e3*Math.random()))}function o1(n){typeof requestIdleCallback=="function"?requestIdleCallback(()=>n()):requestAnimationFrame(()=>n())}let og,sa;const GR=typeof window<"u"&&"ResizeObserver"in window;GR&&(gr=document.documentElement,og=new MutationObserver(kR),sa=new ResizeObserver(BR),window.addEventListener("scroll",()=>{L0=window.scrollY,I0=window.scrollX}),sa.observe(gr));function WR(n){return n.reduce((i,s)=>[...i,...Array.from(s.addedNodes),...Array.from(s.removedNodes)],[]).every(i=>i.nodeName==="#comment")?!1:n.reduce((i,s)=>{if(i===!1)return!1;if(s.target instanceof Element){if(_p(s.target),!i.has(s.target)){i.add(s.target);for(let r=0;rt(n,va.has(n)));for(let t=0;ts(i,va.has(i)))}}function O0(n){return Array.isArray(n)?n:[n]}function Ql(n){return typeof n=="function"}function qR(n){const e=Zn.get(n),t=ya(n);if(!D0(n))return Zn.set(n,t);let i;if(!e)return;const s=th(n);if(typeof s!="function"){const r=e.left-t.left,o=e.top-t.top,[a,l,c,u]=a1(n,e,t),f={transform:`translate(${r}px, ${o}px)`},d={transform:"translate(0, 0)"};a!==l&&(f.width=`${a}px`,d.width=`${l}px`),c!==u&&(f.height=`${c}px`,d.height=`${u}px`),i=n.animate([f,d],{duration:s.duration,easing:s.easing})}else{const[r]=O0(s(n,"remain",e,t));i=new Animation(r),i.play()}bo.set(n,i),Zn.set(n,t),i.addEventListener("finish",wo.bind(null,n))}function ey(n){zf in n&&delete n[zf];const e=ya(n);Zn.set(n,e);const t=th(n);if(!D0(n))return;let i;if(typeof t!="function")i=n.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:t.duration*1.5,easing:"ease-in"});else{const[s]=O0(t(n,"add",e));i=new Animation(s),i.play()}bo.set(n,i),i.addEventListener("finish",wo.bind(null,n))}function ty(n,e){var t;n.remove(),Zn.delete(n),_a.delete(n),bo.delete(n),(t=rg.get(n))===null||t===void 0||t.disconnect(),setTimeout(()=>{if(Jl in n&&delete n[Jl],Object.defineProperty(n,zf,{value:!0,configurable:!0}),e&&n instanceof HTMLElement)for(const i in e)n.style[i]=""},0)}function YR(n){var e;if(!_a.has(n)||!Zn.has(n))return;const[t,i]=_a.get(n);Object.defineProperty(n,Jl,{value:!0,configurable:!0});const s=window.scrollX,r=window.scrollY;if(i&&i.parentNode&&i.parentNode instanceof Element?i.parentNode.insertBefore(n,i):t&&t.parentNode?t.parentNode.appendChild(n):(e=l1(n))===null||e===void 0||e.appendChild(n),!D0(n))return ty(n);const[o,a,l,c]=KR(n),u=th(n),f=Zn.get(n);(s!==I0||r!==L0)&&jR(n,s,r,u);let d,h={position:"absolute",top:`${o}px`,left:`${a}px`,width:`${l}px`,height:`${c}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!Ql(u))Object.assign(n.style,h),d=n.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:u.duration,easing:"ease-out"});else{const[p,_]=O0(u(n,"remove",f));(_==null?void 0:_.styleReset)!==!1&&(h=(_==null?void 0:_.styleReset)||h,Object.assign(n.style,h)),d=new Animation(p),d.play()}bo.set(n,d),d.addEventListener("finish",ty.bind(null,n,h))}function jR(n,e,t,i){const s=I0-e,r=L0-t,o=document.documentElement.style.scrollBehavior;if(getComputedStyle(gr).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+s,window.scrollY+r),!n.parentElement)return;const l=n.parentElement;let c=l.clientHeight,u=l.clientWidth;const f=performance.now();function d(){requestAnimationFrame(()=>{if(!Ql(i)){const h=c-l.clientHeight,p=u-l.clientWidth;f+i.duration>performance.now()?(window.scrollTo({left:window.scrollX-p,top:window.scrollY-h}),c=l.clientHeight,u=l.clientWidth,d()):document.documentElement.style.scrollBehavior=o}})}d()}function KR(n){const e=Zn.get(n),[t,,i]=a1(n,e,ya(n));let s=n.parentElement;for(;s&&(getComputedStyle(s).position==="static"||s instanceof HTMLBodyElement);)s=s.parentElement;s||(s=document.body);const r=getComputedStyle(s),o=Zn.get(s)||ya(s),a=Math.round(e.top-o.top)-Xi(r.borderTopWidth),l=Math.round(e.left-o.left)-Xi(r.borderLeftWidth);return[a,l,t,i]}function ZR(n,e={}){return og&&sa&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!Ql(e)&&!e.disrespectUserMotionPreference||(dl.add(n),getComputedStyle(n).position==="static"&&Object.assign(n.style,{position:"relative"}),c1(n,wo,HR,s=>sa==null?void 0:sa.observe(s)),Ql(e)?va.set(n,e):va.set(n,{duration:250,easing:"ease-in-out",...e}),og.observe(n,{childList:!0}),r1.add(n))),Object.freeze({parent:n,enable:()=>{dl.add(n)},disable:()=>{dl.delete(n)},isEnabled:()=>dl.has(n)})}const JR={mounted:(n,e)=>{ZR(n,e.value||{})},getSSRProps:()=>({})},QR=JR,e3={install(n){n.directive("auto-animate",QR)}};/** - * @license - * Copyright 2010-2025 Three.js Authors - * SPDX-License-Identifier: MIT - */const Dc="175",t3={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},n3={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},u1=0,ag=1,f1=2,i3=3,s3=0,N0=1,U0=2,$i=3,Os=0,zn=1,Pi=2,Ps=0,po=1,lg=2,cg=3,ug=4,d1=5,lr=100,h1=101,p1=102,m1=103,g1=104,_1=200,v1=201,y1=202,b1=203,Vf=204,Hf=205,x1=206,M1=207,S1=208,E1=209,T1=210,w1=211,A1=212,C1=213,R1=214,Gf=0,Wf=1,Xf=2,xo=3,$f=4,qf=5,Yf=6,jf=7,Oc=0,P1=1,I1=2,Zi=0,L1=1,D1=2,O1=3,nh=4,N1=5,U1=6,F1=7,fg="attached",k1="detached",ih=300,Ns=301,_r=302,ec=303,tc=304,Na=306,nc=1e3,gi=1001,ic=1002,gn=1003,F0=1004,r3=1004,ra=1005,o3=1005,en=1006,Ml=1007,a3=1007,ji=1008,l3=1008,is=1009,k0=1010,B0=1011,ba=1012,sh=1013,Us=1014,Kn=1015,Ua=1016,rh=1017,oh=1018,xa=1020,z0=35902,V0=1021,H0=1022,Bn=1023,G0=1024,W0=1025,Ma=1026,Sa=1027,ah=1028,Nc=1029,X0=1030,lh=1031,c3=1032,ch=1033,Sl=33776,El=33777,Tl=33778,wl=33779,Kf=35840,Zf=35841,Jf=35842,Qf=35843,ed=36196,td=37492,nd=37496,id=37808,sd=37809,rd=37810,od=37811,ad=37812,ld=37813,cd=37814,ud=37815,fd=37816,dd=37817,hd=37818,pd=37819,md=37820,gd=37821,Al=36492,_d=36494,vd=36495,$0=36283,yd=36284,bd=36285,xd=36286,B1=2200,z1=2201,V1=2202,sc=2300,Md=2301,bf=2302,ao=2400,lo=2401,rc=2402,uh=2500,q0=2501,u3=0,f3=1,d3=2,H1=3200,G1=3201,h3=3202,p3=3203,Tr=0,W1=1,Ss="",Nn="srgb",Mo="srgb-linear",oc="linear",wt="srgb",m3=0,eo=7680,g3=7681,_3=7682,v3=7683,y3=34055,b3=34056,x3=5386,M3=512,S3=513,E3=514,T3=515,w3=516,A3=517,C3=518,dg=519,X1=512,$1=513,q1=514,Y0=515,Y1=516,j1=517,K1=518,Z1=519,ac=35044,R3=35048,P3=35040,I3=35045,L3=35049,D3=35041,O3=35046,N3=35050,U3=35042,F3="100",hg="300 es",Ii=2e3,lc=2001,k3={COMPUTE:"compute",RENDER:"render"};class rs{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners;if(i===void 0)return;const s=i[e];if(s!==void 0){const r=s.indexOf(t);r!==-1&&s.splice(r,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const i=t[e.type];if(i!==void 0){e.target=this;const s=i.slice(0);for(let r=0,o=s.length;r>8&255]+yn[n>>16&255]+yn[n>>24&255]+"-"+yn[e&255]+yn[e>>8&255]+"-"+yn[e>>16&15|64]+yn[e>>24&255]+"-"+yn[t&63|128]+yn[t>>8&255]+"-"+yn[t>>16&255]+yn[t>>24&255]+yn[i&255]+yn[i>>8&255]+yn[i>>16&255]+yn[i>>24&255]).toLowerCase()}function tt(n,e,t){return Math.max(e,Math.min(t,n))}function j0(n,e){return(n%e+e)%e}function B3(n,e,t,i,s){return i+(n-e)*(s-i)/(t-e)}function z3(n,e,t){return n!==e?(t-n)/(e-n):0}function Cl(n,e,t){return(1-t)*n+t*e}function V3(n,e,t,i){return Cl(n,e,1-Math.exp(-t*i))}function H3(n,e=1){return e-Math.abs(j0(n,e*2)-e)}function G3(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function W3(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function X3(n,e){return n+Math.floor(Math.random()*(e-n+1))}function $3(n,e){return n+Math.random()*(e-n)}function q3(n){return n*(.5-Math.random())}function Y3(n){n!==void 0&&(ny=n);let e=ny+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function j3(n){return n*mo}function K3(n){return n*Ea}function Z3(n){return(n&n-1)===0&&n!==0}function J3(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function Q3(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function eP(n,e,t,i,s){const r=Math.cos,o=Math.sin,a=r(t/2),l=o(t/2),c=r((e+i)/2),u=o((e+i)/2),f=r((e-i)/2),d=o((e-i)/2),h=r((i-e)/2),p=o((i-e)/2);switch(s){case"XYX":n.set(a*u,l*f,l*d,a*c);break;case"YZY":n.set(l*d,a*u,l*f,a*c);break;case"ZXZ":n.set(l*f,l*d,a*u,a*c);break;case"XZX":n.set(a*u,l*p,l*h,a*c);break;case"YXY":n.set(l*h,a*u,l*p,a*c);break;case"ZYZ":n.set(l*p,l*h,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function kn(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function rt(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const K0={DEG2RAD:mo,RAD2DEG:Ea,generateUUID:ri,clamp:tt,euclideanModulo:j0,mapLinear:B3,inverseLerp:z3,lerp:Cl,damp:V3,pingpong:H3,smoothstep:G3,smootherstep:W3,randInt:X3,randFloat:$3,randFloatSpread:q3,seededRandom:Y3,degToRad:j3,radToDeg:K3,isPowerOfTwo:Z3,ceilPowerOfTwo:J3,floorPowerOfTwo:Q3,setQuaternionFromProperEuler:eP,normalize:rt,denormalize:kn};class de{constructor(e=0,t=0){de.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6],this.y=s[1]*t+s[4]*i+s[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=tt(this.x,e.x,t.x),this.y=tt(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=tt(this.x,e,t),this.y=tt(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(tt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(tt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),s=Math.sin(t),r=this.x-e.x,o=this.y-e.y;return this.x=r*i-o*s+e.x,this.y=r*s+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class st{constructor(e,t,i,s,r,o,a,l,c){st.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,s,r,o,a,l,c)}set(e,t,i,s,r,o,a,l,c){const u=this.elements;return u[0]=e,u[1]=s,u[2]=a,u[3]=t,u[4]=r,u[5]=l,u[6]=i,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,s=t.elements,r=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],u=i[4],f=i[7],d=i[2],h=i[5],p=i[8],_=s[0],g=s[3],m=s[6],y=s[1],b=s[4],v=s[7],T=s[2],E=s[5],S=s[8];return r[0]=o*_+a*y+l*T,r[3]=o*g+a*b+l*E,r[6]=o*m+a*v+l*S,r[1]=c*_+u*y+f*T,r[4]=c*g+u*b+f*E,r[7]=c*m+u*v+f*S,r[2]=d*_+h*y+p*T,r[5]=d*g+h*b+p*E,r[8]=d*m+h*v+p*S,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-i*r*u+i*a*l+s*r*c-s*o*l}invert(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=u*o-a*c,d=a*l-u*r,h=c*r-o*l,p=t*f+i*d+s*h;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/p;return e[0]=f*_,e[1]=(s*c-u*i)*_,e[2]=(a*i-s*o)*_,e[3]=d*_,e[4]=(u*t-s*l)*_,e[5]=(s*r-a*t)*_,e[6]=h*_,e[7]=(i*l-c*t)*_,e[8]=(o*t-i*r)*_,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,s,r,o,a){const l=Math.cos(r),c=Math.sin(r);return this.set(i*l,i*c,-i*(l*o+c*a)+o+e,-s*c,s*l,-s*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(vp.makeScale(e,t)),this}rotate(e){return this.premultiply(vp.makeRotation(-e)),this}translate(e,t){return this.premultiply(vp.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let s=0;s<9;s++)if(t[s]!==i[s])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const vp=new st;function J1(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const tP={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function oa(n,e){return new tP[n](e)}function cc(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function Q1(){const n=cc("canvas");return n.style.display="block",n}const iy={};function xf(n){n in iy||(iy[n]=!0,console.warn(n))}function nP(n,e,t){return new Promise(function(i,s){function r(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:s();break;case n.TIMEOUT_EXPIRED:setTimeout(r,t);break;default:i()}}setTimeout(r,t)})}function iP(n){const e=n.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function sP(n){const e=n.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const sy=new st().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),ry=new st().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function rP(){const n={enabled:!0,workingColorSpace:Mo,spaces:{},convert:function(s,r,o){return this.enabled===!1||r===o||!r||!o||(this.spaces[r].transfer===wt&&(s.r=Is(s.r),s.g=Is(s.g),s.b=Is(s.b)),this.spaces[r].primaries!==this.spaces[o].primaries&&(s.applyMatrix3(this.spaces[r].toXYZ),s.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===wt&&(s.r=ha(s.r),s.g=ha(s.g),s.b=ha(s.b))),s},fromWorkingColorSpace:function(s,r){return this.convert(s,this.workingColorSpace,r)},toWorkingColorSpace:function(s,r){return this.convert(s,r,this.workingColorSpace)},getPrimaries:function(s){return this.spaces[s].primaries},getTransfer:function(s){return s===Ss?oc:this.spaces[s].transfer},getLuminanceCoefficients:function(s,r=this.workingColorSpace){return s.fromArray(this.spaces[r].luminanceCoefficients)},define:function(s){Object.assign(this.spaces,s)},_getMatrix:function(s,r,o){return s.copy(this.spaces[r].toXYZ).multiply(this.spaces[o].fromXYZ)},_getDrawingBufferColorSpace:function(s){return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(s=this.workingColorSpace){return this.spaces[s].workingColorSpaceConfig.unpackColorSpace}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],i=[.3127,.329];return n.define({[Mo]:{primaries:e,whitePoint:i,transfer:oc,toXYZ:sy,fromXYZ:ry,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Nn},outputColorSpaceConfig:{drawingBufferColorSpace:Nn}},[Nn]:{primaries:e,whitePoint:i,transfer:wt,toXYZ:sy,fromXYZ:ry,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Nn}}}),n}const ft=rP();function Is(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function ha(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Uo;class eE{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{Uo===void 0&&(Uo=cc("canvas")),Uo.width=e.width,Uo.height=e.height;const s=Uo.getContext("2d");e instanceof ImageData?s.putImageData(e,0,0):s.drawImage(e,0,0,e.width,e.height),i=Uo}return i.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=cc("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const s=i.getImageData(0,0,e.width,e.height),r=s.data;for(let o=0;o0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==ih)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case nc:e.x=e.x-Math.floor(e.x);break;case gi:e.x=e.x<0?0:1;break;case ic:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case nc:e.y=e.y-Math.floor(e.y);break;case gi:e.y=e.y<0?0:1;break;case ic:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Wt.DEFAULT_IMAGE=null;Wt.DEFAULT_MAPPING=ih;Wt.DEFAULT_ANISOTROPY=1;class gt{constructor(e=0,t=0,i=0,s=1){gt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=s}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,s){return this.x=e,this.y=t,this.z=i,this.w=s,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,s=this.z,r=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*s+o[12]*r,this.y=o[1]*t+o[5]*i+o[9]*s+o[13]*r,this.z=o[2]*t+o[6]*i+o[10]*s+o[14]*r,this.w=o[3]*t+o[7]*i+o[11]*s+o[15]*r,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,s,r;const l=e.elements,c=l[0],u=l[4],f=l[8],d=l[1],h=l[5],p=l[9],_=l[2],g=l[6],m=l[10];if(Math.abs(u-d)<.01&&Math.abs(f-_)<.01&&Math.abs(p-g)<.01){if(Math.abs(u+d)<.1&&Math.abs(f+_)<.1&&Math.abs(p+g)<.1&&Math.abs(c+h+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const b=(c+1)/2,v=(h+1)/2,T=(m+1)/2,E=(u+d)/4,S=(f+_)/4,P=(p+g)/4;return b>v&&b>T?b<.01?(i=0,s=.707106781,r=.707106781):(i=Math.sqrt(b),s=E/i,r=S/i):v>T?v<.01?(i=.707106781,s=0,r=.707106781):(s=Math.sqrt(v),i=E/s,r=P/s):T<.01?(i=.707106781,s=.707106781,r=0):(r=Math.sqrt(T),i=S/r,s=P/r),this.set(i,s,r,t),this}let y=Math.sqrt((g-p)*(g-p)+(f-_)*(f-_)+(d-u)*(d-u));return Math.abs(y)<.001&&(y=1),this.x=(g-p)/y,this.y=(f-_)/y,this.z=(d-u)/y,this.w=Math.acos((c+h+m-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=tt(this.x,e.x,t.x),this.y=tt(this.y,e.y,t.y),this.z=tt(this.z,e.z,t.z),this.w=tt(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=tt(this.x,e,t),this.y=tt(this.y,e,t),this.z=tt(this.z,e,t),this.w=tt(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(tt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class fh extends rs{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new gt(0,0,e,t),this.scissorTest=!1,this.viewport=new gt(0,0,e,t);const s={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:en,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i);const r=new Wt(s,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);r.flipY=!1,r.generateMipmaps=i.generateMipmaps,r.internalFormat=i.internalFormat,this.textures=[];const o=i.count;for(let a=0;a=0?1:-1,b=1-m*m;if(b>Number.EPSILON){const T=Math.sqrt(b),E=Math.atan2(T,m*y);g=Math.sin(g*E)/T,a=Math.sin(a*E)/T}const v=a*y;if(l=l*g+d*v,c=c*g+h*v,u=u*g+p*v,f=f*g+_*v,g===1-a){const T=1/Math.sqrt(l*l+c*c+u*u+f*f);l*=T,c*=T,u*=T,f*=T}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=f}static multiplyQuaternionsFlat(e,t,i,s,r,o){const a=i[s],l=i[s+1],c=i[s+2],u=i[s+3],f=r[o],d=r[o+1],h=r[o+2],p=r[o+3];return e[t]=a*p+u*f+l*h-c*d,e[t+1]=l*p+u*d+c*f-a*h,e[t+2]=c*p+u*h+a*d-l*f,e[t+3]=u*p-a*f-l*d-c*h,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,s){return this._x=e,this._y=t,this._z=i,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,s=e._y,r=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(i/2),u=a(s/2),f=a(r/2),d=l(i/2),h=l(s/2),p=l(r/2);switch(o){case"XYZ":this._x=d*u*f+c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f-d*h*p;break;case"YXZ":this._x=d*u*f+c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f+d*h*p;break;case"ZXY":this._x=d*u*f-c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f-d*h*p;break;case"ZYX":this._x=d*u*f-c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f+d*h*p;break;case"YZX":this._x=d*u*f+c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f-d*h*p;break;case"XZY":this._x=d*u*f-c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f+d*h*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,s=Math.sin(i);return this._x=e.x*s,this._y=e.y*s,this._z=e.z*s,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],s=t[4],r=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],f=t[10],d=i+a+f;if(d>0){const h=.5/Math.sqrt(d+1);this._w=.25/h,this._x=(u-l)*h,this._y=(r-c)*h,this._z=(o-s)*h}else if(i>a&&i>f){const h=2*Math.sqrt(1+i-a-f);this._w=(u-l)/h,this._x=.25*h,this._y=(s+o)/h,this._z=(r+c)/h}else if(a>f){const h=2*Math.sqrt(1+a-i-f);this._w=(r-c)/h,this._x=(s+o)/h,this._y=.25*h,this._z=(l+u)/h}else{const h=2*Math.sqrt(1+f-i-a);this._w=(o-s)/h,this._x=(r+c)/h,this._y=(l+u)/h,this._z=.25*h}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(tt(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const s=Math.min(1,t/i);return this.slerp(e,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,s=e._y,r=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=i*u+o*a+s*c-r*l,this._y=s*u+o*l+r*a-i*c,this._z=r*u+o*c+i*l-s*a,this._w=o*u-i*a-s*l-r*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,s=this._y,r=this._z,o=this._w;let a=o*e._w+i*e._x+s*e._y+r*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=s,this._z=r,this;const l=1-a*a;if(l<=Number.EPSILON){const h=1-t;return this._w=h*o+t*this._w,this._x=h*i+t*this._x,this._y=h*s+t*this._y,this._z=h*r+t*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),f=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=o*f+this._w*d,this._x=i*f+this._x*d,this._y=s*f+this._y*d,this._z=r*f+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),s=Math.sqrt(1-i),r=Math.sqrt(i);return this.set(s*Math.sin(e),s*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class B{constructor(e=0,t=0,i=0){B.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(oy.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(oy.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*s,this.y=r[1]*t+r[4]*i+r[7]*s,this.z=r[2]*t+r[5]*i+r[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,s=this.z,r=e.elements,o=1/(r[3]*t+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*s+r[12])*o,this.y=(r[1]*t+r[5]*i+r[9]*s+r[13])*o,this.z=(r[2]*t+r[6]*i+r[10]*s+r[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,s=this.z,r=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*s-a*i),u=2*(a*t-r*s),f=2*(r*i-o*t);return this.x=t+l*c+o*f-a*u,this.y=i+l*u+a*c-r*f,this.z=s+l*f+r*u-o*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*s,this.y=r[1]*t+r[5]*i+r[9]*s,this.z=r[2]*t+r[6]*i+r[10]*s,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=tt(this.x,e.x,t.x),this.y=tt(this.y,e.y,t.y),this.z=tt(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=tt(this.x,e,t),this.y=tt(this.y,e,t),this.z=tt(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(tt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,s=e.y,r=e.z,o=t.x,a=t.y,l=t.z;return this.x=s*l-r*a,this.y=r*o-i*l,this.z=i*a-s*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return bp.copy(this).projectOnVector(e),this.sub(bp)}reflect(e){return this.sub(bp.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(tt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,s=this.z-e.z;return t*t+i*i+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const s=Math.sin(t)*e;return this.x=s*Math.sin(i),this.y=Math.cos(t)*e,this.z=s*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=s,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const bp=new B,oy=new Jn;class Vn{constructor(e=new B(1/0,1/0,1/0),t=new B(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,wi),wi.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Ya),cu.subVectors(this.max,Ya),Fo.subVectors(e.a,Ya),ko.subVectors(e.b,Ya),Bo.subVectors(e.c,Ya),$s.subVectors(ko,Fo),qs.subVectors(Bo,ko),kr.subVectors(Fo,Bo);let t=[0,-$s.z,$s.y,0,-qs.z,qs.y,0,-kr.z,kr.y,$s.z,0,-$s.x,qs.z,0,-qs.x,kr.z,0,-kr.x,-$s.y,$s.x,0,-qs.y,qs.x,0,-kr.y,kr.x,0];return!xp(t,Fo,ko,Bo,cu)||(t=[1,0,0,0,1,0,0,0,1],!xp(t,Fo,ko,Bo,cu))?!1:(uu.crossVectors($s,qs),t=[uu.x,uu.y,uu.z],xp(t,Fo,ko,Bo,cu))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,wi).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(wi).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(us[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),us[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),us[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),us[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),us[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),us[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),us[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),us[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(us),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const us=[new B,new B,new B,new B,new B,new B,new B,new B],wi=new B,lu=new Vn,Fo=new B,ko=new B,Bo=new B,$s=new B,qs=new B,kr=new B,Ya=new B,cu=new B,uu=new B,Br=new B;function xp(n,e,t,i,s){for(let r=0,o=n.length-3;r<=o;r+=3){Br.fromArray(n,r);const a=s.x*Math.abs(Br.x)+s.y*Math.abs(Br.y)+s.z*Math.abs(Br.z),l=e.dot(Br),c=t.dot(Br),u=i.dot(Br);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const uP=new Vn,ja=new B,Mp=new B;class Tn{constructor(e=new B,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):uP.setFromPoints(e).getCenter(i);let s=0;for(let r=0,o=e.length;rthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;ja.subVectors(e,this.center);const t=ja.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),s=(i-this.radius)*.5;this.center.addScaledVector(ja,s/i),this.radius+=s}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Mp.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(ja.copy(e.center).add(Mp)),this.expandByPoint(ja.copy(e.center).sub(Mp))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const fs=new B,Sp=new B,fu=new B,Ys=new B,Ep=new B,du=new B,Tp=new B;class Fa{constructor(e=new B,t=new B(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,fs)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=fs.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(fs.copy(this.origin).addScaledVector(this.direction,t),fs.distanceToSquared(e))}distanceSqToSegment(e,t,i,s){Sp.copy(e).add(t).multiplyScalar(.5),fu.copy(t).sub(e).normalize(),Ys.copy(this.origin).sub(Sp);const r=e.distanceTo(t)*.5,o=-this.direction.dot(fu),a=Ys.dot(this.direction),l=-Ys.dot(fu),c=Ys.lengthSq(),u=Math.abs(1-o*o);let f,d,h,p;if(u>0)if(f=o*l-a,d=o*a-l,p=r*u,f>=0)if(d>=-p)if(d<=p){const _=1/u;f*=_,d*=_,h=f*(f+o*d+2*a)+d*(o*f+d+2*l)+c}else d=r,f=Math.max(0,-(o*d+a)),h=-f*f+d*(d+2*l)+c;else d=-r,f=Math.max(0,-(o*d+a)),h=-f*f+d*(d+2*l)+c;else d<=-p?(f=Math.max(0,-(-o*r+a)),d=f>0?-r:Math.min(Math.max(-r,-l),r),h=-f*f+d*(d+2*l)+c):d<=p?(f=0,d=Math.min(Math.max(-r,-l),r),h=d*(d+2*l)+c):(f=Math.max(0,-(o*r+a)),d=f>0?r:Math.min(Math.max(-r,-l),r),h=-f*f+d*(d+2*l)+c);else d=o>0?-r:r,f=Math.max(0,-(o*d+a)),h=-f*f+d*(d+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,f),s&&s.copy(Sp).addScaledVector(fu,d),h}intersectSphere(e,t){fs.subVectors(e.center,this.origin);const i=fs.dot(this.direction),s=fs.dot(fs)-i*i,r=e.radius*e.radius;if(s>r)return null;const o=Math.sqrt(r-s),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,s,r,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,f=1/this.direction.z,d=this.origin;return c>=0?(i=(e.min.x-d.x)*c,s=(e.max.x-d.x)*c):(i=(e.max.x-d.x)*c,s=(e.min.x-d.x)*c),u>=0?(r=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(r=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),i>o||r>s||((r>i||isNaN(i))&&(i=r),(o=0?(a=(e.min.z-d.z)*f,l=(e.max.z-d.z)*f):(a=(e.max.z-d.z)*f,l=(e.min.z-d.z)*f),i>l||a>s)||((a>i||i!==i)&&(i=a),(l=0?i:s,t)}intersectsBox(e){return this.intersectBox(e,fs)!==null}intersectTriangle(e,t,i,s,r){Ep.subVectors(t,e),du.subVectors(i,e),Tp.crossVectors(Ep,du);let o=this.direction.dot(Tp),a;if(o>0){if(s)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Ys.subVectors(this.origin,e);const l=a*this.direction.dot(du.crossVectors(Ys,du));if(l<0)return null;const c=a*this.direction.dot(Ep.cross(Ys));if(c<0||l+c>o)return null;const u=-a*Ys.dot(Tp);return u<0?null:this.at(u/o,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Ye{constructor(e,t,i,s,r,o,a,l,c,u,f,d,h,p,_,g){Ye.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,s,r,o,a,l,c,u,f,d,h,p,_,g)}set(e,t,i,s,r,o,a,l,c,u,f,d,h,p,_,g){const m=this.elements;return m[0]=e,m[4]=t,m[8]=i,m[12]=s,m[1]=r,m[5]=o,m[9]=a,m[13]=l,m[2]=c,m[6]=u,m[10]=f,m[14]=d,m[3]=h,m[7]=p,m[11]=_,m[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Ye().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,s=1/zo.setFromMatrixColumn(e,0).length(),r=1/zo.setFromMatrixColumn(e,1).length(),o=1/zo.setFromMatrixColumn(e,2).length();return t[0]=i[0]*s,t[1]=i[1]*s,t[2]=i[2]*s,t[3]=0,t[4]=i[4]*r,t[5]=i[5]*r,t[6]=i[6]*r,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,s=e.y,r=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(s),c=Math.sin(s),u=Math.cos(r),f=Math.sin(r);if(e.order==="XYZ"){const d=o*u,h=o*f,p=a*u,_=a*f;t[0]=l*u,t[4]=-l*f,t[8]=c,t[1]=h+p*c,t[5]=d-_*c,t[9]=-a*l,t[2]=_-d*c,t[6]=p+h*c,t[10]=o*l}else if(e.order==="YXZ"){const d=l*u,h=l*f,p=c*u,_=c*f;t[0]=d+_*a,t[4]=p*a-h,t[8]=o*c,t[1]=o*f,t[5]=o*u,t[9]=-a,t[2]=h*a-p,t[6]=_+d*a,t[10]=o*l}else if(e.order==="ZXY"){const d=l*u,h=l*f,p=c*u,_=c*f;t[0]=d-_*a,t[4]=-o*f,t[8]=p+h*a,t[1]=h+p*a,t[5]=o*u,t[9]=_-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const d=o*u,h=o*f,p=a*u,_=a*f;t[0]=l*u,t[4]=p*c-h,t[8]=d*c+_,t[1]=l*f,t[5]=_*c+d,t[9]=h*c-p,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const d=o*l,h=o*c,p=a*l,_=a*c;t[0]=l*u,t[4]=_-d*f,t[8]=p*f+h,t[1]=f,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=h*f+p,t[10]=d-_*f}else if(e.order==="XZY"){const d=o*l,h=o*c,p=a*l,_=a*c;t[0]=l*u,t[4]=-f,t[8]=c*u,t[1]=d*f+_,t[5]=o*u,t[9]=h*f-p,t[2]=p*f-h,t[6]=a*u,t[10]=_*f+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(fP,e,dP)}lookAt(e,t,i){const s=this.elements;return ni.subVectors(e,t),ni.lengthSq()===0&&(ni.z=1),ni.normalize(),js.crossVectors(i,ni),js.lengthSq()===0&&(Math.abs(i.z)===1?ni.x+=1e-4:ni.z+=1e-4,ni.normalize(),js.crossVectors(i,ni)),js.normalize(),hu.crossVectors(ni,js),s[0]=js.x,s[4]=hu.x,s[8]=ni.x,s[1]=js.y,s[5]=hu.y,s[9]=ni.y,s[2]=js.z,s[6]=hu.z,s[10]=ni.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,s=t.elements,r=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],u=i[1],f=i[5],d=i[9],h=i[13],p=i[2],_=i[6],g=i[10],m=i[14],y=i[3],b=i[7],v=i[11],T=i[15],E=s[0],S=s[4],P=s[8],x=s[12],M=s[1],L=s[5],F=s[9],H=s[13],Y=s[2],ee=s[6],K=s[10],Q=s[14],Z=s[3],he=s[7],be=s[11],se=s[15];return r[0]=o*E+a*M+l*Y+c*Z,r[4]=o*S+a*L+l*ee+c*he,r[8]=o*P+a*F+l*K+c*be,r[12]=o*x+a*H+l*Q+c*se,r[1]=u*E+f*M+d*Y+h*Z,r[5]=u*S+f*L+d*ee+h*he,r[9]=u*P+f*F+d*K+h*be,r[13]=u*x+f*H+d*Q+h*se,r[2]=p*E+_*M+g*Y+m*Z,r[6]=p*S+_*L+g*ee+m*he,r[10]=p*P+_*F+g*K+m*be,r[14]=p*x+_*H+g*Q+m*se,r[3]=y*E+b*M+v*Y+T*Z,r[7]=y*S+b*L+v*ee+T*he,r[11]=y*P+b*F+v*K+T*be,r[15]=y*x+b*H+v*Q+T*se,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],s=e[8],r=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],f=e[6],d=e[10],h=e[14],p=e[3],_=e[7],g=e[11],m=e[15];return p*(+r*l*f-s*c*f-r*a*d+i*c*d+s*a*h-i*l*h)+_*(+t*l*h-t*c*d+r*o*d-s*o*h+s*c*u-r*l*u)+g*(+t*c*f-t*a*h-r*o*f+i*o*h+r*a*u-i*c*u)+m*(-s*a*u-t*l*f+t*a*d+s*o*f-i*o*d+i*l*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const s=this.elements;return e.isVector3?(s[12]=e.x,s[13]=e.y,s[14]=e.z):(s[12]=e,s[13]=t,s[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=e[9],d=e[10],h=e[11],p=e[12],_=e[13],g=e[14],m=e[15],y=f*g*c-_*d*c+_*l*h-a*g*h-f*l*m+a*d*m,b=p*d*c-u*g*c-p*l*h+o*g*h+u*l*m-o*d*m,v=u*_*c-p*f*c+p*a*h-o*_*h-u*a*m+o*f*m,T=p*f*l-u*_*l-p*a*d+o*_*d+u*a*g-o*f*g,E=t*y+i*b+s*v+r*T;if(E===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const S=1/E;return e[0]=y*S,e[1]=(_*d*r-f*g*r-_*s*h+i*g*h+f*s*m-i*d*m)*S,e[2]=(a*g*r-_*l*r+_*s*c-i*g*c-a*s*m+i*l*m)*S,e[3]=(f*l*r-a*d*r-f*s*c+i*d*c+a*s*h-i*l*h)*S,e[4]=b*S,e[5]=(u*g*r-p*d*r+p*s*h-t*g*h-u*s*m+t*d*m)*S,e[6]=(p*l*r-o*g*r-p*s*c+t*g*c+o*s*m-t*l*m)*S,e[7]=(o*d*r-u*l*r+u*s*c-t*d*c-o*s*h+t*l*h)*S,e[8]=v*S,e[9]=(p*f*r-u*_*r-p*i*h+t*_*h+u*i*m-t*f*m)*S,e[10]=(o*_*r-p*a*r+p*i*c-t*_*c-o*i*m+t*a*m)*S,e[11]=(u*a*r-o*f*r-u*i*c+t*f*c+o*i*h-t*a*h)*S,e[12]=T*S,e[13]=(u*_*s-p*f*s+p*i*d-t*_*d-u*i*g+t*f*g)*S,e[14]=(p*a*s-o*_*s-p*i*l+t*_*l+o*i*g-t*a*g)*S,e[15]=(o*f*s-u*a*s+u*i*l-t*f*l-o*i*d+t*a*d)*S,this}scale(e){const t=this.elements,i=e.x,s=e.y,r=e.z;return t[0]*=i,t[4]*=s,t[8]*=r,t[1]*=i,t[5]*=s,t[9]*=r,t[2]*=i,t[6]*=s,t[10]*=r,t[3]*=i,t[7]*=s,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],s=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,s))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),s=Math.sin(t),r=1-i,o=e.x,a=e.y,l=e.z,c=r*o,u=r*a;return this.set(c*o+i,c*a-s*l,c*l+s*a,0,c*a+s*l,u*a+i,u*l-s*o,0,c*l-s*a,u*l+s*o,r*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,s,r,o){return this.set(1,i,r,0,e,1,o,0,t,s,1,0,0,0,0,1),this}compose(e,t,i){const s=this.elements,r=t._x,o=t._y,a=t._z,l=t._w,c=r+r,u=o+o,f=a+a,d=r*c,h=r*u,p=r*f,_=o*u,g=o*f,m=a*f,y=l*c,b=l*u,v=l*f,T=i.x,E=i.y,S=i.z;return s[0]=(1-(_+m))*T,s[1]=(h+v)*T,s[2]=(p-b)*T,s[3]=0,s[4]=(h-v)*E,s[5]=(1-(d+m))*E,s[6]=(g+y)*E,s[7]=0,s[8]=(p+b)*S,s[9]=(g-y)*S,s[10]=(1-(d+_))*S,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,t,i){const s=this.elements;let r=zo.set(s[0],s[1],s[2]).length();const o=zo.set(s[4],s[5],s[6]).length(),a=zo.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),e.x=s[12],e.y=s[13],e.z=s[14],Ai.copy(this);const c=1/r,u=1/o,f=1/a;return Ai.elements[0]*=c,Ai.elements[1]*=c,Ai.elements[2]*=c,Ai.elements[4]*=u,Ai.elements[5]*=u,Ai.elements[6]*=u,Ai.elements[8]*=f,Ai.elements[9]*=f,Ai.elements[10]*=f,t.setFromRotationMatrix(Ai),i.x=r,i.y=o,i.z=a,this}makePerspective(e,t,i,s,r,o,a=Ii){const l=this.elements,c=2*r/(t-e),u=2*r/(i-s),f=(t+e)/(t-e),d=(i+s)/(i-s);let h,p;if(a===Ii)h=-(o+r)/(o-r),p=-2*o*r/(o-r);else if(a===lc)h=-o/(o-r),p=-o*r/(o-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=u,l[9]=d,l[13]=0,l[2]=0,l[6]=0,l[10]=h,l[14]=p,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,s,r,o,a=Ii){const l=this.elements,c=1/(t-e),u=1/(i-s),f=1/(o-r),d=(t+e)*c,h=(i+s)*u;let p,_;if(a===Ii)p=(o+r)*f,_=-2*f;else if(a===lc)p=r*f,_=-1*f;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-d,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-h,l[2]=0,l[6]=0,l[10]=_,l[14]=-p,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let s=0;s<16;s++)if(t[s]!==i[s])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const zo=new B,Ai=new Ye,fP=new B(0,0,0),dP=new B(1,1,1),js=new B,hu=new B,ni=new B,ay=new Ye,ly=new Jn;class li{constructor(e=0,t=0,i=0,s=li.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=s}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,s=this._order){return this._x=e,this._y=t,this._z=i,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const s=e.elements,r=s[0],o=s[4],a=s[8],l=s[1],c=s[5],u=s[9],f=s[2],d=s[6],h=s[10];switch(t){case"XYZ":this._y=Math.asin(tt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,h),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-tt(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,r),this._z=0);break;case"ZXY":this._x=Math.asin(tt(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-f,h),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-tt(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(d,h),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(tt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-f,r)):(this._x=0,this._y=Math.atan2(a,h));break;case"XZY":this._z=Math.asin(-tt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-u,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return ay.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ay,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return ly.setFromEuler(this),this.setFromQuaternion(ly,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}li.DEFAULT_ORDER="XYZ";class hh{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.visibility=this._visibility,s.active=this._active,s.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(s.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()}));function r(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c0){s.children=[];for(let a=0;a0){s.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),f.length>0&&(i.shapes=f),d.length>0&&(i.skeletons=d),h.length>0&&(i.animations=h),p.length>0&&(i.nodes=p)}return i.object=s,i;function o(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(e,t,i,s,r){Ci.subVectors(s,t),hs.subVectors(i,t),Ap.subVectors(e,t);const o=Ci.dot(Ci),a=Ci.dot(hs),l=Ci.dot(Ap),c=hs.dot(hs),u=hs.dot(Ap),f=o*c-a*a;if(f===0)return r.set(0,0,0),null;const d=1/f,h=(c*l-a*u)*d,p=(o*u-a*l)*d;return r.set(1-h-p,p,h)}static containsPoint(e,t,i,s){return this.getBarycoord(e,t,i,s,ps)===null?!1:ps.x>=0&&ps.y>=0&&ps.x+ps.y<=1}static getInterpolation(e,t,i,s,r,o,a,l){return this.getBarycoord(e,t,i,s,ps)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(r,ps.x),l.addScaledVector(o,ps.y),l.addScaledVector(a,ps.z),l)}static getInterpolatedAttribute(e,t,i,s,r,o){return Ip.setScalar(0),Lp.setScalar(0),Dp.setScalar(0),Ip.fromBufferAttribute(e,t),Lp.fromBufferAttribute(e,i),Dp.fromBufferAttribute(e,s),o.setScalar(0),o.addScaledVector(Ip,r.x),o.addScaledVector(Lp,r.y),o.addScaledVector(Dp,r.z),o}static isFrontFacing(e,t,i,s){return Ci.subVectors(i,t),hs.subVectors(e,t),Ci.cross(hs).dot(s)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,s){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[s]),this}setFromAttributeAndIndices(e,t,i,s){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,s),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ci.subVectors(this.c,this.b),hs.subVectors(this.a,this.b),Ci.cross(hs).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return jn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return jn.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,s,r){return jn.getInterpolation(e,this.a,this.b,this.c,t,i,s,r)}containsPoint(e){return jn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return jn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,s=this.b,r=this.c;let o,a;Go.subVectors(s,i),Wo.subVectors(r,i),Cp.subVectors(e,i);const l=Go.dot(Cp),c=Wo.dot(Cp);if(l<=0&&c<=0)return t.copy(i);Rp.subVectors(e,s);const u=Go.dot(Rp),f=Wo.dot(Rp);if(u>=0&&f<=u)return t.copy(s);const d=l*f-u*c;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(i).addScaledVector(Go,o);Pp.subVectors(e,r);const h=Go.dot(Pp),p=Wo.dot(Pp);if(p>=0&&h<=p)return t.copy(r);const _=h*c-l*p;if(_<=0&&c>=0&&p<=0)return a=c/(c-p),t.copy(i).addScaledVector(Wo,a);const g=u*p-h*f;if(g<=0&&f-u>=0&&h-p>=0)return py.subVectors(r,s),a=(f-u)/(f-u+(h-p)),t.copy(s).addScaledVector(py,a);const m=1/(g+_+d);return o=_*m,a=d*m,t.copy(i).addScaledVector(Go,o).addScaledVector(Wo,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const tE={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ks={h:0,s:0,l:0},mu={h:0,s:0,l:0};function Op(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class Ce{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const s=e;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Nn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,ft.toWorkingColorSpace(this,t),this}setRGB(e,t,i,s=ft.workingColorSpace){return this.r=e,this.g=t,this.b=i,ft.toWorkingColorSpace(this,s),this}setHSL(e,t,i,s=ft.workingColorSpace){if(e=j0(e,1),t=tt(t,0,1),i=tt(i,0,1),t===0)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+t):i+t-i*t,o=2*i-r;this.r=Op(o,r,e+1/3),this.g=Op(o,r,e),this.b=Op(o,r,e-1/3)}return ft.toWorkingColorSpace(this,s),this}setStyle(e,t=Nn){function i(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const o=s[1],a=s[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=s[1],o=r.length;if(o===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(r,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Nn){const i=tE[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Is(e.r),this.g=Is(e.g),this.b=Is(e.b),this}copyLinearToSRGB(e){return this.r=ha(e.r),this.g=ha(e.g),this.b=ha(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Nn){return ft.fromWorkingColorSpace(bn.copy(this),e),Math.round(tt(bn.r*255,0,255))*65536+Math.round(tt(bn.g*255,0,255))*256+Math.round(tt(bn.b*255,0,255))}getHexString(e=Nn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=ft.workingColorSpace){ft.fromWorkingColorSpace(bn.copy(this),t);const i=bn.r,s=bn.g,r=bn.b,o=Math.max(i,s,r),a=Math.min(i,s,r);let l,c;const u=(a+o)/2;if(a===o)l=0,c=0;else{const f=o-a;switch(c=u<=.5?f/(o+a):f/(2-o-a),o){case i:l=(s-r)/f+(s0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const s=this[t];if(s===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(i):s&&s.isVector3&&i&&i.isVector3?s.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==po&&(i.blending=this.blending),this.side!==Os&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==Vf&&(i.blendSrc=this.blendSrc),this.blendDst!==Hf&&(i.blendDst=this.blendDst),this.blendEquation!==lr&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==xo&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==dg&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==eo&&(i.stencilFail=this.stencilFail),this.stencilZFail!==eo&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==eo&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function s(r){const o=[];for(const a in r){const l=r[a];delete l.metadata,o.push(l)}return o}if(t){const r=s(e.textures),o=s(e.images);r.length>0&&(i.textures=r),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const s=t.length;i=new Array(s);for(let r=0;r!==s;++r)i[r]=t[r].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class zs extends An{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ce(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new li,this.combine=Oc,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Es=vP();function vP(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),s=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,s[l]=24,s[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,s[l]=-c-1,s[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,s[l]=13,s[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,s[l]=24,s[l|256]=24):(i[l]=31744,i[l|256]=64512,s[l]=13,s[l|256]=13)}const r=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,u=0;for(;(c&8388608)===0;)c<<=1,u-=8388608;c&=-8388609,u+=947912704,r[l]=c|u}for(let l=1024;l<2048;++l)r[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:s,mantissaTable:r,exponentTable:o,offsetTable:a}}function $n(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=tt(n,-65504,65504),Es.floatView[0]=n;const e=Es.uint32View[0],t=e>>23&511;return Es.baseTable[t]+((e&8388607)>>Es.shiftTable[t])}function hl(n){const e=n>>10;return Es.uint32View[0]=Es.mantissaTable[Es.offsetTable[e]+(n&1023)]+Es.exponentTable[e],Es.floatView[0]}class yP{static toHalfFloat(e){return $n(e)}static fromHalfFloat(e){return hl(e)}}const Yt=new B,gu=new de;let bP=0;class Ct{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:bP++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=ac,this.updateRanges=[],this.gpuType=Kn,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let s=0,r=this.itemSize;st.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Vn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new B(-1/0,-1/0,-1/0),new B(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,s=t.length;i0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const s={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let f=0,d=c.length;f0&&(s[l]=u,r=!0)}r&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone());const s=e.attributes;for(const c in s){const u=s[c];this.setAttribute(c,u.clone(t))}const r=e.morphAttributes;for(const c in r){const u=[],f=r[c];for(let d=0,h=f.length;d0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r(e.far-e.near)**2))&&(my.copy(r).invert(),zr.copy(e.ray).applyMatrix4(my),!(i.boundingBox!==null&&zr.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,zr)))}_computeIntersections(e,t,i){let s;const r=this.geometry,o=this.material,a=r.index,l=r.attributes.position,c=r.attributes.uv,u=r.attributes.uv1,f=r.attributes.normal,d=r.groups,h=r.drawRange;if(a!==null)if(Array.isArray(o))for(let p=0,_=d.length;p<_;p++){const g=d[p],m=o[g.materialIndex],y=Math.max(g.start,h.start),b=Math.min(a.count,Math.min(g.start+g.count,h.start+h.count));for(let v=y,T=b;vt.far?null:{distance:c,point:Mu.clone(),object:n}}function Su(n,e,t,i,s,r,o,a,l,c){n.getVertexPosition(a,vu),n.getVertexPosition(l,yu),n.getVertexPosition(c,bu);const u=CP(n,e,t,i,vu,yu,bu,_y);if(u){const f=new B;jn.getBarycoord(_y,vu,yu,bu,f),s&&(u.uv=jn.getInterpolatedAttribute(s,a,l,c,f,new de)),r&&(u.uv1=jn.getInterpolatedAttribute(r,a,l,c,f,new de)),o&&(u.normal=jn.getInterpolatedAttribute(o,a,l,c,f,new B),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const d={a,b:l,c,normal:new B,materialIndex:0};jn.getNormal(vu,yu,bu,d.normal),u.face=d,u.barycoord=f}return u}class Ao extends ct{constructor(e=1,t=1,i=1,s=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:s,heightSegments:r,depthSegments:o};const a=this;s=Math.floor(s),r=Math.floor(r),o=Math.floor(o);const l=[],c=[],u=[],f=[];let d=0,h=0;p("z","y","x",-1,-1,i,t,e,o,r,0),p("z","y","x",1,-1,i,t,-e,o,r,1),p("x","z","y",1,1,e,i,t,s,o,2),p("x","z","y",1,-1,e,i,-t,s,o,3),p("x","y","z",1,-1,e,t,i,s,r,4),p("x","y","z",-1,-1,e,t,-i,s,r,5),this.setIndex(l),this.setAttribute("position",new ke(c,3)),this.setAttribute("normal",new ke(u,3)),this.setAttribute("uv",new ke(f,2));function p(_,g,m,y,b,v,T,E,S,P,x){const M=v/S,L=T/P,F=v/2,H=T/2,Y=E/2,ee=S+1,K=P+1;let Q=0,Z=0;const he=new B;for(let be=0;be0?1:-1,u.push(he.x,he.y,he.z),f.push(ye/S),f.push(1-be/P),Q+=1}}for(let be=0;be0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const s in this.extensions)this.extensions[s]===!0&&(i[s]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class Fc extends ht{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Ye,this.projectionMatrix=new Ye,this.projectionMatrixInverse=new Ye,this.coordinateSystem=Ii}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Zs=new B,vy=new de,yy=new de;class Kt extends Fc{constructor(e=50,t=1,i=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=s,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=Ea*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(mo*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ea*2*Math.atan(Math.tan(mo*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){Zs.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Zs.x,Zs.y).multiplyScalar(-e/Zs.z),Zs.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(Zs.x,Zs.y).multiplyScalar(-e/Zs.z)}getViewSize(e,t){return this.getViewBounds(e,vy,yy),t.subVectors(yy,vy)}setViewOffset(e,t,i,s,r,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=s,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(mo*.5*this.fov)/this.zoom,i=2*t,s=this.aspect*i,r=-.5*s;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;r+=o.offsetX*s/l,t-=o.offsetY*i/c,s*=o.width/l,i*=o.height/c}const a=this.filmOffset;a!==0&&(r+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const $o=-90,qo=1;class sE extends ht{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new Kt($o,qo,e,t);s.layers=this.layers,this.add(s);const r=new Kt($o,qo,e,t);r.layers=this.layers,this.add(r);const o=new Kt($o,qo,e,t);o.layers=this.layers,this.add(o);const a=new Kt($o,qo,e,t);a.layers=this.layers,this.add(a);const l=new Kt($o,qo,e,t);l.layers=this.layers,this.add(l);const c=new Kt($o,qo,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,s,r,o,a,l]=t;for(const c of t)this.remove(c);if(e===Ii)i.up.set(0,1,0),i.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===lc)i.up.set(0,-1,0),i.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of t)this.add(c),c.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:s}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[r,o,a,l,c,u]=this.children,f=e.getRenderTarget(),d=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;const _=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,s),e.render(t,r),e.setRenderTarget(i,1,s),e.render(t,o),e.setRenderTarget(i,2,s),e.render(t,a),e.setRenderTarget(i,3,s),e.render(t,l),e.setRenderTarget(i,4,s),e.render(t,c),i.texture.generateMipmaps=_,e.setRenderTarget(i,5,s),e.render(t,u),e.setRenderTarget(f,d,h),e.xr.enabled=p,i.texture.needsPMREMUpdate=!0}}class kc extends Wt{constructor(e=[],t=Ns,i,s,r,o,a,l,c,u){super(e,t,i,s,r,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class rE extends ss{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},s=[i,i,i,i,i,i];this.texture=new kc(s,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:en}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},s=new Ao(5,5,5),r=new ki({name:"CubemapFromEquirect",uniforms:Ta(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:zn,blending:Ps});r.uniforms.tEquirect.value=t;const o=new $t(s,r),a=t.minFilter;return t.minFilter===ji&&(t.minFilter=en),new sE(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t=!0,i=!0,s=!0){const r=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,s);e.setRenderTarget(r)}}class aa extends ht{constructor(){super(),this.isGroup=!0,this.type="Group"}}const LP={type:"move"};class Mf{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new aa,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new aa,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new B,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new B),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new aa,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new B,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new B),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let s=null,r=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){o=!0;for(const _ of e.hand.values()){const g=t.getJointPose(_,i),m=this._getHandJoint(c,_);g!==null&&(m.matrix.fromArray(g.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=g.radius),m.visible=g!==null}const u=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],d=u.position.distanceTo(f.position),h=.02,p=.005;c.inputState.pinching&&d>h+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=h-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,i),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(s=t.getPose(e.targetRaySpace,i),s===null&&r!==null&&(s=r),s!==null&&(a.matrix.fromArray(s.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,s.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(s.linearVelocity)):a.hasLinearVelocity=!1,s.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(s.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(LP)))}return a!==null&&(a.visible=s!==null),l!==null&&(l.visible=r!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new aa;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class ph{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Ce(e),this.density=t}clone(){return new ph(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class mh{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new Ce(e),this.near=t,this.far=i}clone(){return new mh(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class gh extends ht{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new li,this.environmentIntensity=1,this.environmentRotation=new li,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class _h{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=ac,this.updateRanges=[],this.version=0,this.uuid=ri()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let s=0,r=this.stride;se.far||t.push({distance:l,point:Ja.clone(),uv:jn.getInterpolation(Ja,Eu,el,Tu,by,Fp,xy,new de),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function wu(n,e,t,i,s,r){Zo.subVectors(n,t).addScalar(.5).multiply(i),s!==void 0?(Qa.x=r*Zo.x-s*Zo.y,Qa.y=s*Zo.x+r*Zo.y):Qa.copy(Zo),n.copy(e),n.x+=Qa.x,n.y+=Qa.y,n.applyMatrix4(oE)}const Au=new B,My=new B;class lE extends ht{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,s=t.length;i0){let i,s;for(i=1,s=t.length;i0){Au.setFromMatrixPosition(this.matrixWorld);const s=e.ray.origin.distanceTo(Au);this.getObjectForDistance(s).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Au.setFromMatrixPosition(e.matrixWorld),My.setFromMatrixPosition(this.matrixWorld);const i=Au.distanceTo(My)/e.zoom;t[0].object.visible=!0;let s,r;for(s=1,r=t.length;s=o)t[s-1].object.visible=!1,t[s].object.visible=!0;else break}for(this._currentLevel=s-1;s1?null:t.copy(e.start).addScaledVector(i,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||FP.getNormalMatrix(e),s=this.coplanarPoint(zp).applyMatrix4(e),r=this.normal.applyMatrix3(i).normalize();return this.constant=-s.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Vr=new Tn,Pu=new B;class Bc{constructor(e=new or,t=new or,i=new or,s=new or,r=new or,o=new or){this.planes=[e,t,i,s,r,o]}set(e,t,i,s,r,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(s),a[4].copy(r),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=Ii){const i=this.planes,s=e.elements,r=s[0],o=s[1],a=s[2],l=s[3],c=s[4],u=s[5],f=s[6],d=s[7],h=s[8],p=s[9],_=s[10],g=s[11],m=s[12],y=s[13],b=s[14],v=s[15];if(i[0].setComponents(l-r,d-c,g-h,v-m).normalize(),i[1].setComponents(l+r,d+c,g+h,v+m).normalize(),i[2].setComponents(l+o,d+u,g+p,v+y).normalize(),i[3].setComponents(l-o,d-u,g-p,v-y).normalize(),i[4].setComponents(l-a,d-f,g-_,v-b).normalize(),t===Ii)i[5].setComponents(l+a,d+f,g+_,v+b).normalize();else if(t===lc)i[5].setComponents(a,f,_,b).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Vr.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Vr.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Vr)}intersectsSprite(e){return Vr.center.set(0,0,0),Vr.radius=.7071067811865476,Vr.applyMatrix4(e.matrixWorld),this.intersectsSphere(Vr)}intersectsSphere(e){const t=this.planes,i=e.center,s=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(i)0?e.max.x:e.min.x,Pu.y=s.normal.y>0?e.max.y:e.min.y,Pu.z=s.normal.z>0?e.max.z:e.min.z,s.distanceToPoint(Pu)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function Vp(n,e){return n-e}function kP(n,e){return n.z-e.z}function BP(n,e){return e.z-n.z}class zP{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t,i,s){const r=this.pool,o=this.list;this.index>=r.length&&r.push({start:-1,count:-1,z:-1,index:-1});const a=r[this.index];o.push(a),this.index++,a.start=e,a.count=t,a.z=i,a.index=s}reset(){this.list.length=0,this.index=0}}const Xn=new Ye,VP=new Ce(1,1,1),Hp=new Bc,Iu=new Vn,Hr=new Tn,il=new B,Iy=new B,HP=new B,Gp=new zP,xn=new $t,Lu=[];function GP(n,e,t=0){const i=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const s=n.count;for(let r=0;r65535?new Uint32Array(s):new Uint16Array(s);t.setIndex(new Ct(r,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const i in t.attributes){if(!e.hasAttribute(i))throw new Error(`THREE.BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const s=e.getAttribute(i),r=t.getAttribute(i);if(s.itemSize!==r.itemSize||s.normalized!==r.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){const t=this._instanceInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){const t=this._geometryInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Vn);const e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let i=0,s=t.length;i=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const i={visible:!0,active:!0,geometryIndex:e};let s=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(Vp),s=this._availableInstanceIds.shift(),this._instanceInfo[s]=i):(s=this._instanceInfo.length,this._instanceInfo.push(i));const r=this._matricesTexture;Xn.identity().toArray(r.image.data,s*16),r.needsUpdate=!0;const o=this._colorsTexture;return o&&(VP.toArray(o.image.data,s*4),o.needsUpdate=!0),this._visibilityChanged=!0,s}addGeometry(e,t=-1,i=-1){this._initializeGeometry(e),this._validateGeometry(e);const s={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},r=this._geometryInfo;s.vertexStart=this._nextVertexStart,s.reservedVertexCount=t===-1?e.getAttribute("position").count:t;const o=e.getIndex();if(o!==null&&(s.indexStart=this._nextIndexStart,s.reservedIndexCount=i===-1?o.count:i),s.indexStart!==-1&&s.indexStart+s.reservedIndexCount>this._maxIndexCount||s.vertexStart+s.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let l;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(Vp),l=this._availableGeometryIds.shift(),r[l]=s):(l=this._geometryCount,this._geometryCount++,r.push(s)),this.setGeometryAt(l,e),this._nextIndexStart=s.indexStart+s.reservedIndexCount,this._nextVertexStart=s.vertexStart+s.reservedVertexCount,l}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const i=this.geometry,s=i.getIndex()!==null,r=i.getIndex(),o=t.getIndex(),a=this._geometryInfo[e];if(s&&o.count>a.reservedIndexCount||t.attributes.position.count>a.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const l=a.vertexStart,c=a.reservedVertexCount;a.vertexCount=t.getAttribute("position").count;for(const u in i.attributes){const f=t.getAttribute(u),d=i.getAttribute(u);GP(f,d,l);const h=f.itemSize;for(let p=f.count,_=c;p<_;p++){const g=l+p;for(let m=0;m=t.length||t[e].active===!1)return this;const i=this._instanceInfo;for(let s=0,r=i.length;sa).sort((o,a)=>i[o].vertexStart-i[a].vertexStart),r=this.geometry;for(let o=0,a=i.length;o=this._geometryCount)return null;const i=this.geometry,s=this._geometryInfo[e];if(s.boundingBox===null){const r=new Vn,o=i.index,a=i.attributes.position;for(let l=s.start,c=s.start+s.count;l=this._geometryCount)return null;const i=this.geometry,s=this._geometryInfo[e];if(s.boundingSphere===null){const r=new Tn;this.getBoundingBoxAt(e,Iu),Iu.getCenter(r.center);const o=i.index,a=i.attributes.position;let l=0;for(let c=s.start,u=s.start+s.count;ca.active);if(Math.max(...i.map(a=>a.vertexStart+a.reservedVertexCount))>e)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...i.map(l=>l.indexStart+l.reservedIndexCount))>t)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);const r=this.geometry;r.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new ct,this._initializeGeometry(r));const o=this.geometry;r.index&&Gr(r.index.array,o.index.array);for(const a in r.attributes)Gr(r.attributes[a].array,o.attributes[a].array)}raycast(e,t){const i=this._instanceInfo,s=this._geometryInfo,r=this.matrixWorld,o=this.geometry;xn.material=this.material,xn.geometry.index=o.index,xn.geometry.attributes=o.attributes,xn.geometry.boundingBox===null&&(xn.geometry.boundingBox=new Vn),xn.geometry.boundingSphere===null&&(xn.geometry.boundingSphere=new Tn);for(let a=0,l=i.length;a({...t,boundingBox:t.boundingBox!==null?t.boundingBox.clone():null,boundingSphere:t.boundingSphere!==null?t.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(t=>({...t})),this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,t,i,s,r){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=s.getIndex(),a=o===null?1:o.array.BYTES_PER_ELEMENT,l=this._instanceInfo,c=this._multiDrawStarts,u=this._multiDrawCounts,f=this._geometryInfo,d=this.perObjectFrustumCulled,h=this._indirectTexture,p=h.image.data;d&&(Xn.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),Hp.setFromProjectionMatrix(Xn,e.coordinateSystem));let _=0;if(this.sortObjects){Xn.copy(this.matrixWorld).invert(),il.setFromMatrixPosition(i.matrixWorld).applyMatrix4(Xn),Iy.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(Xn);for(let y=0,b=l.length;y0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;ri)return;Wp.applyMatrix4(n.matrixWorld);const c=e.ray.origin.distanceTo(Wp);if(!(ce.far))return{distance:c,point:Dy.clone().applyMatrix4(n.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:n}}const Oy=new B,Ny=new B;class os extends vr{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[];for(let s=0,r=t.count;s0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;rs.far)return;r.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:o})}}class pE extends Wt{constructor(e,t,i,s,r=en,o=en,a,l,c){super(e,t,i,s,r,o,a,l,c),this.isVideoTexture=!0,this.generateMipmaps=!1;const u=this;function f(){u.needsUpdate=!0,e.requestVideoFrameCallback(f)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(f)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class WP extends pE{constructor(e,t,i,s,r,o,a,l){super({},e,t,i,s,r,o,a,l),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class XP extends Wt{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=gn,this.minFilter=gn,this.generateMipmaps=!1,this.needsUpdate=!0}}class yh extends Wt{constructor(e,t,i,s,r,o,a,l,c,u,f,d){super(null,o,a,l,c,u,s,r,f,d),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class $P extends yh{constructor(e,t,i,s,r,o){super(e,t,i,r,o),this.isCompressedArrayTexture=!0,this.image.depth=s,this.wrapR=gi,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class qP extends yh{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,Ns),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class YP extends Wt{constructor(e,t,i,s,r,o,a,l,c){super(e,t,i,s,r,o,a,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class n_ extends Wt{constructor(e,t,i=Us,s,r,o,a=gn,l=gn,c,u=Ma){if(u!==Ma&&u!==Sa)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super(null,s,r,o,a,l,u,i,c),this.isDepthTexture=!0,this.image={width:e,height:t},this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new cr(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class Vi{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){console.warn("THREE.Curve: .getPoint() not implemented.")}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,s=this.getPoint(0),r=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),r+=i.distanceTo(s),t.push(r),s=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){const i=this.getLengths();let s=0;const r=i.length;let o;t?o=t:o=e*i[r-1];let a=0,l=r-1,c;for(;a<=l;)if(s=Math.floor(a+(l-a)/2),c=i[s]-o,c<0)a=s+1;else if(c>0)l=s-1;else{l=s;break}if(s=l,i[s]===o)return s/(r-1);const u=i[s],d=i[s+1]-u,h=(o-u)/d;return(s+h)/(r-1)}getTangent(e,t){let s=e-1e-4,r=e+1e-4;s<0&&(s=0),r>1&&(r=1);const o=this.getPoint(s),a=this.getPoint(r),l=t||(o.isVector2?new de:new B);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t=!1){const i=new B,s=[],r=[],o=[],a=new B,l=new Ye;for(let h=0;h<=e;h++){const p=h/e;s[h]=this.getTangentAt(p,new B)}r[0]=new B,o[0]=new B;let c=Number.MAX_VALUE;const u=Math.abs(s[0].x),f=Math.abs(s[0].y),d=Math.abs(s[0].z);u<=c&&(c=u,i.set(1,0,0)),f<=c&&(c=f,i.set(0,1,0)),d<=c&&i.set(0,0,1),a.crossVectors(s[0],i).normalize(),r[0].crossVectors(s[0],a),o[0].crossVectors(s[0],r[0]);for(let h=1;h<=e;h++){if(r[h]=r[h-1].clone(),o[h]=o[h-1].clone(),a.crossVectors(s[h-1],s[h]),a.length()>Number.EPSILON){a.normalize();const p=Math.acos(tt(s[h-1].dot(s[h]),-1,1));r[h].applyMatrix4(l.makeRotationAxis(a,p))}o[h].crossVectors(s[h],r[h])}if(t===!0){let h=Math.acos(tt(r[0].dot(r[e]),-1,1));h/=e,s[0].dot(a.crossVectors(r[0],r[e]))>0&&(h=-h);for(let p=1;p<=e;p++)r[p].applyMatrix4(l.makeRotationAxis(s[p],h*p)),o[p].crossVectors(s[p],r[p])}return{tangents:s,normals:r,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class bh extends Vi{constructor(e=0,t=0,i=1,s=1,r=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=s,this.aStartAngle=r,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t=new de){const i=t,s=Math.PI*2;let r=this.aEndAngle-this.aStartAngle;const o=Math.abs(r)s;)r-=s;r0?0:(Math.floor(Math.abs(a)/r)+1)*r:l===0&&a===r-1&&(a=r-2,l=1);let c,u;this.closed||a>0?c=s[(a-1)%r]:(Fu.subVectors(s[0],s[1]).add(s[0]),c=Fu);const f=s[a%r],d=s[(a+1)%r];if(this.closed||a+2s.length-2?s.length-1:o+1],f=s[o>s.length-3?s.length-1:o+2];return i.set(ky(a,l.x,c.x,u.x,f.x),ky(a,l.y,c.y,u.y,f.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t=i){const o=s[r]-i,a=this.curves[r],l=a.getLength(),c=l===0?0:1-o/l;return a.getPointAt(c,t)}r++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,s=this.curves.length;i1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t0){const f=c.getPoint(0);f.equals(this.currentPoint)||this.lineTo(f.x,f.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class zc extends ct{constructor(e=[new de(0,-.5),new de(.5,0),new de(0,.5)],t=12,i=0,s=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:s},t=Math.floor(t),s=tt(s,0,Math.PI*2);const r=[],o=[],a=[],l=[],c=[],u=1/t,f=new B,d=new de,h=new B,p=new B,_=new B;let g=0,m=0;for(let y=0;y<=e.length-1;y++)switch(y){case 0:g=e[y+1].x-e[y].x,m=e[y+1].y-e[y].y,h.x=m*1,h.y=-g,h.z=m*0,_.copy(h),h.normalize(),l.push(h.x,h.y,h.z);break;case e.length-1:l.push(_.x,_.y,_.z);break;default:g=e[y+1].x-e[y].x,m=e[y+1].y-e[y].y,h.x=m*1,h.y=-g,h.z=m*0,p.copy(h),h.x+=_.x,h.y+=_.y,h.z+=_.z,h.normalize(),l.push(h.x,h.y,h.z),_.copy(p)}for(let y=0;y<=t;y++){const b=i+y*u*s,v=Math.sin(b),T=Math.cos(b);for(let E=0;E<=e.length-1;E++){f.x=e[E].x*v,f.y=e[E].y,f.z=e[E].x*T,o.push(f.x,f.y,f.z),d.x=y/t,d.y=E/(e.length-1),a.push(d.x,d.y);const S=l[3*E+0]*v,P=l[3*E+1],x=l[3*E+0]*T;c.push(S,P,x)}}for(let y=0;y0&&b(!0),t>0&&b(!1)),this.setIndex(u),this.setAttribute("position",new ke(f,3)),this.setAttribute("normal",new ke(d,3)),this.setAttribute("uv",new ke(h,2));function y(){const v=new B,T=new B;let E=0;const S=(t-e)/i;for(let P=0;P<=r;P++){const x=[],M=P/r,L=M*(t-e)+e;for(let F=0;F<=s;F++){const H=F/s,Y=H*l+a,ee=Math.sin(Y),K=Math.cos(Y);T.x=L*ee,T.y=-M*i+g,T.z=L*K,f.push(T.x,T.y,T.z),v.set(ee,S,K).normalize(),d.push(v.x,v.y,v.z),h.push(H,1-M),x.push(p++)}_.push(x)}for(let P=0;P0||x!==0)&&(u.push(M,L,H),E+=3),(t>0||x!==r-1)&&(u.push(L,F,H),E+=3)}c.addGroup(m,E,0),m+=E}function b(v){const T=p,E=new de,S=new B;let P=0;const x=v===!0?e:t,M=v===!0?1:-1;for(let F=1;F<=s;F++)f.push(0,g*M,0),d.push(0,M,0),h.push(.5,.5),p++;const L=p;for(let F=0;F<=s;F++){const Y=F/s*l+a,ee=Math.cos(Y),K=Math.sin(Y);S.x=x*K,S.y=g*M,S.z=x*ee,f.push(S.x,S.y,S.z),d.push(0,M,0),E.x=ee*.5+.5,E.y=K*.5*M+.5,h.push(E.x,E.y),p++}for(let F=0;F.9&&S<.1&&(b<.2&&(o[y+0]+=1),v<.2&&(o[y+2]+=1),T<.2&&(o[y+4]+=1))}}function d(y){r.push(y.x,y.y,y.z)}function h(y,b){const v=y*3;b.x=e[v+0],b.y=e[v+1],b.z=e[v+2]}function p(){const y=new B,b=new B,v=new B,T=new B,E=new de,S=new de,P=new de;for(let x=0,M=0;x80*t){a=1/0,l=1/0;let u=-1/0,f=-1/0;for(let d=t;du&&(u=h),p>f&&(f=p)}c=Math.max(u-a,f-l),c=c!==0?32767/c:0}return fc(r,o,t,a,l,c,0),o}function xE(n,e,t,i,s){let r;if(s===vI(n,e,t,i)>0)for(let o=e;o=e;o-=i)r=By(o/i|0,n[o],n[o+1],r);return r&&Aa(r,r.next)&&(hc(r),r=r.next),r}function Eo(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Aa(t,t.next)||zt(t.prev,t,t.next)===0)){if(hc(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function fc(n,e,t,i,s,r,o){if(!n)return;!o&&r&&dI(n,i,s,r);let a=n;for(;n.prev!==n.next;){const l=n.prev,c=n.next;if(r?sI(n,i,s,r):iI(n)){e.push(l.i,n.i,c.i),hc(n),n=c.next,a=c.next;continue}if(n=c,n===a){o?o===1?(n=rI(Eo(n),e),fc(n,e,t,i,s,r,2)):o===2&&oI(n,e,t,i,s,r):fc(Eo(n),e,t,i,s,r,1);break}}}function iI(n){const e=n.prev,t=n,i=n.next;if(zt(e,t,i)>=0)return!1;const s=e.x,r=t.x,o=i.x,a=e.y,l=t.y,c=i.y,u=Math.min(s,r,o),f=Math.min(a,l,c),d=Math.max(s,r,o),h=Math.max(a,l,c);let p=i.next;for(;p!==e;){if(p.x>=u&&p.x<=d&&p.y>=f&&p.y<=h&&pl(s,a,r,l,o,c,p.x,p.y)&&zt(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function sI(n,e,t,i){const s=n.prev,r=n,o=n.next;if(zt(s,r,o)>=0)return!1;const a=s.x,l=r.x,c=o.x,u=s.y,f=r.y,d=o.y,h=Math.min(a,l,c),p=Math.min(u,f,d),_=Math.max(a,l,c),g=Math.max(u,f,d),m=mg(h,p,e,t,i),y=mg(_,g,e,t,i);let b=n.prevZ,v=n.nextZ;for(;b&&b.z>=m&&v&&v.z<=y;){if(b.x>=h&&b.x<=_&&b.y>=p&&b.y<=g&&b!==s&&b!==o&&pl(a,u,l,f,c,d,b.x,b.y)&&zt(b.prev,b,b.next)>=0||(b=b.prevZ,v.x>=h&&v.x<=_&&v.y>=p&&v.y<=g&&v!==s&&v!==o&&pl(a,u,l,f,c,d,v.x,v.y)&&zt(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;b&&b.z>=m;){if(b.x>=h&&b.x<=_&&b.y>=p&&b.y<=g&&b!==s&&b!==o&&pl(a,u,l,f,c,d,b.x,b.y)&&zt(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;v&&v.z<=y;){if(v.x>=h&&v.x<=_&&v.y>=p&&v.y<=g&&v!==s&&v!==o&&pl(a,u,l,f,c,d,v.x,v.y)&&zt(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function rI(n,e){let t=n;do{const i=t.prev,s=t.next.next;!Aa(i,s)&&SE(i,t,t.next,s)&&dc(i,s)&&dc(s,i)&&(e.push(i.i,t.i,s.i),hc(t),hc(t.next),t=n=s),t=t.next}while(t!==n);return Eo(t)}function oI(n,e,t,i,s,r){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&mI(o,a)){let l=EE(o,a);o=Eo(o,o.next),l=Eo(l,l.next),fc(o,e,t,i,s,r,0),fc(l,e,t,i,s,r,0);return}a=a.next}o=o.next}while(o!==n)}function aI(n,e,t,i){const s=[];for(let r=0,o=e.length;r=t.next.y&&t.next.y!==t.y){const f=t.x+(s-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(f<=i&&f>r&&(r=f,o=t.x=t.x&&t.x>=l&&i!==t.x&&ME(so.x||t.x===o.x&&fI(o,t)))&&(o=t,u=f)}t=t.next}while(t!==a);return o}function fI(n,e){return zt(n.prev,n,e.prev)<0&&zt(e.next,n,n.next)<0}function dI(n,e,t,i){let s=n;do s.z===0&&(s.z=mg(s.x,s.y,e,t,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==n);s.prevZ.nextZ=null,s.prevZ=null,hI(s)}function hI(n){let e,t=1;do{let i=n,s;n=null;let r=null;for(e=0;i;){e++;let o=i,a=0;for(let c=0;c0||l>0&&o;)a!==0&&(l===0||!o||i.z<=o.z)?(s=i,i=i.nextZ,a--):(s=o,o=o.nextZ,l--),r?r.nextZ=s:n=s,s.prevZ=r,r=s;i=o}r.nextZ=null,t*=2}while(e>1);return n}function mg(n,e,t,i,s){return n=(n-t)*s|0,e=(e-i)*s|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function pI(n){let e=n,t=n;do(e.x=(n-o)*(r-a)&&(n-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(r-a)>=(s-o)*(i-a)}function pl(n,e,t,i,s,r,o,a){return!(n===o&&e===a)&&ME(n,e,t,i,s,r,o,a)}function mI(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!gI(n,e)&&(dc(n,e)&&dc(e,n)&&_I(n,e)&&(zt(n.prev,n,e.prev)||zt(n,e.prev,e))||Aa(n,e)&&zt(n.prev,n,n.next)>0&&zt(e.prev,e,e.next)>0)}function zt(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Aa(n,e){return n.x===e.x&&n.y===e.y}function SE(n,e,t,i){const s=Hu(zt(n,e,t)),r=Hu(zt(n,e,i)),o=Hu(zt(t,i,n)),a=Hu(zt(t,i,e));return!!(s!==r&&o!==a||s===0&&Vu(n,t,e)||r===0&&Vu(n,i,e)||o===0&&Vu(t,n,i)||a===0&&Vu(t,e,i))}function Vu(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function Hu(n){return n>0?1:n<0?-1:0}function gI(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&SE(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function dc(n,e){return zt(n.prev,n,n.next)<0?zt(n,e,n.next)>=0&&zt(n,n.prev,e)>=0:zt(n,e,n.prev)<0||zt(n,n.next,e)<0}function _I(n,e){let t=n,i=!1;const s=(n.x+e.x)/2,r=(n.y+e.y)/2;do t.y>r!=t.next.y>r&&t.next.y!==t.y&&s<(t.next.x-t.x)*(r-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function EE(n,e){const t=gg(n.i,n.x,n.y),i=gg(e.i,e.x,e.y),s=n.next,r=e.prev;return n.next=e,e.prev=n,t.next=s,s.prev=t,i.next=t,t.prev=i,r.next=i,i.prev=r,i}function By(n,e,t,i){const s=gg(n,e,t);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function hc(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function gg(n,e,t){return{i:n,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function vI(n,e,t,i){let s=0;for(let r=e,o=t-i;r2&&n[e-1].equals(n[0])&&n.pop()}function Vy(n,e){for(let t=0;tNumber.EPSILON){const le=Math.sqrt($),Me=Math.sqrt(O*O+V*V),Be=W.x-U/le,me=W.y+w/le,Te=C.x-V/Me,Ve=C.y+O/Me,We=((Te-Be)*V-(Ve-me)*O)/(w*V-U*O);I=Be+w*We-G.x,N=me+U*We-G.y;const Se=I*I+N*N;if(Se<=2)return new de(I,N);A=Math.sqrt(Se/2)}else{let le=!1;w>Number.EPSILON?O>Number.EPSILON&&(le=!0):w<-Number.EPSILON?O<-Number.EPSILON&&(le=!0):Math.sign(U)===Math.sign(V)&&(le=!0),le?(I=-U,N=w,A=Math.sqrt($)):(I=w,N=U,A=Math.sqrt($/2))}return new de(I/A,N/A)}const he=[];for(let G=0,W=ee.length,C=W-1,I=G+1;G=0;G--){const W=G/g,C=h*Math.cos(W*Math.PI/2),I=p*Math.sin(W*Math.PI/2)+_;for(let N=0,A=ee.length;N=0;){const I=C;let N=C-1;N<0&&(N=G.length-1);for(let A=0,w=u+g*2;A0)&&h.push(b,v,E),(m!==i-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class RE extends An{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Ce(16777215),this.specular=new Ce(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ce(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Tr,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new li,this.combine=Oc,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class PE extends An{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Ce(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ce(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Tr,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class IE extends An{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Tr,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class LE extends An{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Ce(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ce(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Tr,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new li,this.combine=Oc,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class u_ extends An{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=H1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class f_ extends An{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}class DE extends An{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ce(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Tr,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class OE extends Gn{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function co(n,e){return!n||n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function NE(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function UE(n){function e(s,r){return n[s]-n[r]}const t=n.length,i=new Array(t);for(let s=0;s!==t;++s)i[s]=s;return i.sort(e),i}function _g(n,e,t){const i=n.length,s=new n.constructor(i);for(let r=0,o=0;o!==i;++r){const a=t[r]*e;for(let l=0;l!==e;++l)s[o++]=n[a+l]}return s}function d_(n,e,t,i){let s=1,r=n[0];for(;r!==void 0&&r[i]===void 0;)r=n[s++];if(r===void 0)return;let o=r[i];if(o!==void 0)if(Array.isArray(o))do o=r[i],o!==void 0&&(e.push(r.time),t.push(...o)),r=n[s++];while(r!==void 0);else if(o.toArray!==void 0)do o=r[i],o!==void 0&&(e.push(r.time),o.toArray(t,t.length)),r=n[s++];while(r!==void 0);else do o=r[i],o!==void 0&&(e.push(r.time),t.push(o)),r=n[s++];while(r!==void 0)}function SI(n,e,t,i,s=30){const r=n.clone();r.name=e;const o=[];for(let l=0;l=i)){f.push(c.times[h]);for(let _=0;_r.tracks[l].times[0]&&(a=r.tracks[l].times[0]);for(let l=0;l=a.times[p]){const m=p*f+u,y=m+f-u;_=a.values.slice(m,y)}else{const m=a.createInterpolant(),y=u,b=f-u;m.evaluate(r),_=m.resultBuffer.slice(y,b)}l==="quaternion"&&new Jn().fromArray(_).normalize().conjugate().toArray(_);const g=c.times.length;for(let m=0;m=r)){const a=t[1];e=r)break t}o=i,i=0;break n}break e}for(;i>>1;et;)--o;if(++o,r!==0||o!==s){r>=o&&(o=Math.max(o,1),r=o-1);const a=this.getValueSize();this.times=i.slice(r,o),this.values=this.values.slice(r*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,s=this.values,r=i.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==r;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(s!==void 0&&NE(s))for(let a=0,l=s.length;a!==l;++a){const c=s[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),s=this.getInterpolation()===bf,r=e.length-1;let o=1;for(let a=1;a0){e[o]=e[r];for(let a=r*i,l=o*i,c=0;c!==i;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,s=new i(this.name,e,t);return s.createInterpolant=this.createInterpolant,s}}Si.prototype.ValueTypeName="";Si.prototype.TimeBufferType=Float32Array;Si.prototype.ValueBufferType=Float32Array;Si.prototype.DefaultInterpolation=Md;class Co extends Si{constructor(e,t,i){super(e,t,i)}}Co.prototype.ValueTypeName="bool";Co.prototype.ValueBufferType=Array;Co.prototype.DefaultInterpolation=sc;Co.prototype.InterpolantFactoryMethodLinear=void 0;Co.prototype.InterpolantFactoryMethodSmooth=void 0;class p_ extends Si{constructor(e,t,i,s){super(e,t,i,s)}}p_.prototype.ValueTypeName="color";class pc extends Si{constructor(e,t,i,s){super(e,t,i,s)}}pc.prototype.ValueTypeName="number";class BE extends Gc{constructor(e,t,i,s){super(e,t,i,s)}interpolate_(e,t,i,s){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(s-t);let c=e*a;for(let u=c+a;c!==u;c+=4)Jn.slerpFlat(r,0,o,c-a,o,c,l);return r}}class Wc extends Si{constructor(e,t,i,s){super(e,t,i,s)}InterpolantFactoryMethodLinear(e){return new BE(this.times,this.values,this.getValueSize(),e)}}Wc.prototype.ValueTypeName="quaternion";Wc.prototype.InterpolantFactoryMethodSmooth=void 0;class Ro extends Si{constructor(e,t,i){super(e,t,i)}}Ro.prototype.ValueTypeName="string";Ro.prototype.ValueBufferType=Array;Ro.prototype.DefaultInterpolation=sc;Ro.prototype.InterpolantFactoryMethodLinear=void 0;Ro.prototype.InterpolantFactoryMethodSmooth=void 0;class mc extends Si{constructor(e,t,i,s){super(e,t,i,s)}}mc.prototype.ValueTypeName="vector";class gc{constructor(e="",t=-1,i=[],s=uh){this.name=e,this.tracks=i,this.duration=t,this.blendMode=s,this.uuid=ri(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,s=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(AI(i[o]).scale(s));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],i=e.tracks,s={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,o=i.length;r!==o;++r)t.push(Si.toJSON(i[r]));return s}static CreateFromMorphTargetSequence(e,t,i,s){const r=t.length,o=[];for(let a=0;a1){const f=u[1];let d=s[f];d||(s[f]=d=[]),d.push(c)}}const o=[];for(const a in s)o.push(this.CreateFromMorphTargetSequence(a,s[a],t,i));return o}static parseAnimation(e,t){if(console.warn("THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(f,d,h,p,_){if(h.length!==0){const g=[],m=[];d_(h,g,m,p),g.length!==0&&_.push(new f(d,g,m))}},s=[],r=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let f=0;f{t&&t(r),this.manager.itemEnd(e)},0),r;if(ms[e]!==void 0){ms[e].push({onLoad:t,onProgress:i,onError:s});return}ms[e]=[],ms[e].push({onLoad:t,onProgress:i,onError:s});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=ms[e],f=c.body.getReader(),d=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),h=d?parseInt(d):0,p=h!==0;let _=0;const g=new ReadableStream({start(m){y();function y(){f.read().then(({done:b,value:v})=>{if(b)m.close();else{_+=v.byteLength;const T=new ProgressEvent("progress",{lengthComputable:p,loaded:_,total:h});for(let E=0,S=u.length;E{m.error(b)})}}});return new Response(g)}else throw new CI(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a==="")return c.text();{const f=/charset="?([^;"\s]*)"?/i.exec(a),d=f&&f[1]?f[1].toLowerCase():void 0,h=new TextDecoder(d);return c.arrayBuffer().then(p=>h.decode(p))}}}).then(c=>{ws.add(e,c);const u=ms[e];delete ms[e];for(let f=0,d=u.length;f{const u=ms[e];if(u===void 0)throw this.manager.itemError(e),c;delete ms[e];for(let f=0,d=u.length;f{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class RI extends ei{constructor(e){super(e)}load(e,t,i,s){const r=this,o=new Fs(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(r.parse(JSON.parse(a)))}catch(l){s?s(l):console.error(l),r.manager.itemError(e)}},i,s)}parse(e){const t=[];for(let i=0;i0:s.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const r in e.uniforms){const o=e.uniforms[r];switch(s.uniforms[r]={},o.type){case"t":s.uniforms[r].value=i(o.value);break;case"c":s.uniforms[r].value=new Ce().setHex(o.value);break;case"v2":s.uniforms[r].value=new de().fromArray(o.value);break;case"v3":s.uniforms[r].value=new B().fromArray(o.value);break;case"v4":s.uniforms[r].value=new gt().fromArray(o.value);break;case"m3":s.uniforms[r].value=new st().fromArray(o.value);break;case"m4":s.uniforms[r].value=new Ye().fromArray(o.value);break;default:s.uniforms[r].value=o.value}}if(e.defines!==void 0&&(s.defines=e.defines),e.vertexShader!==void 0&&(s.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(s.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(s.glslVersion=e.glslVersion),e.extensions!==void 0)for(const r in e.extensions)s.extensions[r]=e.extensions[r];if(e.lights!==void 0&&(s.lights=e.lights),e.clipping!==void 0&&(s.clipping=e.clipping),e.size!==void 0&&(s.size=e.size),e.sizeAttenuation!==void 0&&(s.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(s.map=i(e.map)),e.matcap!==void 0&&(s.matcap=i(e.matcap)),e.alphaMap!==void 0&&(s.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(s.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(s.bumpScale=e.bumpScale),e.normalMap!==void 0&&(s.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(s.normalMapType=e.normalMapType),e.normalScale!==void 0){let r=e.normalScale;Array.isArray(r)===!1&&(r=[r,r]),s.normalScale=new de().fromArray(r)}return e.displacementMap!==void 0&&(s.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(s.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(s.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(s.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(s.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(s.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(s.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(s.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(s.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(s.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(s.envMap=i(e.envMap)),e.envMapRotation!==void 0&&s.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(s.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(s.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(s.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(s.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(s.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(s.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(s.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(s.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(s.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(s.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(s.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(s.clearcoatNormalScale=new de().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(s.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(s.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(s.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(s.thicknessMap=i(e.thicknessMap)),e.anisotropyMap!==void 0&&(s.anisotropyMap=i(e.anisotropyMap)),e.sheenColorMap!==void 0&&(s.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(s.sheenRoughnessMap=i(e.sheenRoughnessMap)),s}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return Oh.createMaterialFromType(e)}static createMaterialFromType(e){const t={ShadowMaterial:wE,SpriteMaterial:Q0,RawShaderMaterial:AE,ShaderMaterial:ki,PointsMaterial:t_,MeshPhysicalMaterial:CE,MeshStandardMaterial:c_,MeshPhongMaterial:RE,MeshToonMaterial:PE,MeshNormalMaterial:IE,MeshLambertMaterial:LE,MeshDepthMaterial:u_,MeshDistanceMaterial:f_,MeshBasicMaterial:zs,MeshMatcapMaterial:DE,LineDashedMaterial:OE,LineBasicMaterial:Gn,Material:An};return new t[e]}}class vg{static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class jE extends ct{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class KE extends ei{constructor(e){super(e)}load(e,t,i,s){const r=this,o=new Fs(r.manager);o.setPath(r.path),o.setRequestHeader(r.requestHeader),o.setWithCredentials(r.withCredentials),o.load(e,function(a){try{t(r.parse(JSON.parse(a)))}catch(l){s?s(l):console.error(l),r.manager.itemError(e)}},i,s)}parse(e){const t={},i={};function s(h,p){if(t[p]!==void 0)return t[p];const g=h.interleavedBuffers[p],m=r(h,g.buffer),y=oa(g.type,m),b=new _h(y,g.stride);return b.uuid=g.uuid,t[p]=b,b}function r(h,p){if(i[p]!==void 0)return i[p];const g=h.arrayBuffers[p],m=new Uint32Array(g).buffer;return i[p]=m,m}const o=e.isInstancedBufferGeometry?new jE:new ct,a=e.data.index;if(a!==void 0){const h=oa(a.type,a.array);o.setIndex(new Ct(h,1))}const l=e.data.attributes;for(const h in l){const p=l[h];let _;if(p.isInterleavedBufferAttribute){const g=s(e.data,p.data);_=new So(g,p.itemSize,p.offset,p.normalized)}else{const g=oa(p.type,p.array),m=p.isInstancedBufferAttribute?wa:Ct;_=new m(g,p.itemSize,p.normalized)}p.name!==void 0&&(_.name=p.name),p.usage!==void 0&&_.setUsage(p.usage),o.setAttribute(h,_)}const c=e.data.morphAttributes;if(c)for(const h in c){const p=c[h],_=[];for(let g=0,m=p.length;g0){const l=new m_(t);r=new _c(l),r.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){s=new _c(this.manager),s.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o{const g=new Vn;g.min.fromArray(_.boxMin),g.max.fromArray(_.boxMax);const m=new Tn;return m.radius=_.sphereRadius,m.center.fromArray(_.sphereCenter),{boxInitialized:_.boxInitialized,box:g,sphereInitialized:_.sphereInitialized,sphere:m}}),o._maxInstanceCount=e.maxInstanceCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._geometryCount=e.geometryCount,o._matricesTexture=c(e.matricesTexture.uuid),e.colorsTexture!==void 0&&(o._colorsTexture=c(e.colorsTexture.uuid));break;case"LOD":o=new lE;break;case"Line":o=new vr(a(e.geometry),l(e.material));break;case"LineLoop":o=new dE(a(e.geometry),l(e.material));break;case"LineSegments":o=new os(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new hE(a(e.geometry),l(e.material));break;case"Sprite":o=new aE(l(e.material));break;case"Group":o=new aa;break;case"Bone":o=new e_;break;default:o=new ht}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.up!==void 0&&o.up.fromArray(e.up),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(o.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const d=e.children;for(let h=0;h"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=ws.get(e);if(o!==void 0){if(r.manager.itemStart(e),o.then){o.then(c=>{t&&t(c),r.manager.itemEnd(e)}).catch(c=>{s&&s(c)});return}return setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const l=fetch(e,a).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(c){return ws.add(e,c),t&&t(c),r.manager.itemEnd(e),c}).catch(function(c){s&&s(c),ws.remove(e),r.manager.itemError(e),r.manager.itemEnd(e)});ws.add(e,l),r.manager.itemStart(e)}}let Gu;class __{static getContext(){return Gu===void 0&&(Gu=new(window.AudioContext||window.webkitAudioContext)),Gu}static setContext(e){Gu=e}}class zI extends ei{constructor(e){super(e)}load(e,t,i,s){const r=this,o=new Fs(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const c=l.slice(0);__.getContext().decodeAudioData(c,function(f){t(f)}).catch(a)}catch(c){a(c)}},i,s);function a(l){s?s(l):console.error(l),r.manager.itemError(e)}}}const jy=new Ye,Ky=new Ye,Wr=new Ye;class VI{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Kt,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Kt,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Wr.copy(e.projectionMatrix);const s=t.eyeSep/2,r=s*t.near/t.focus,o=t.near*Math.tan(mo*t.fov*.5)/t.zoom;let a,l;Ky.elements[12]=-s,jy.elements[12]=s,a=-o*t.aspect+r,l=o*t.aspect+r,Wr.elements[0]=2*t.near/(l-a),Wr.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(Wr),a=-o*t.aspect-r,l=o*t.aspect-r,Wr.elements[0]=2*t.near/(l-a),Wr.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(Wr)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ky),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(jy)}}class ZE extends Kt{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e,this.index=0}}class Nh{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Zy(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=Zy();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Zy(){return performance.now()}const Xr=new B,Jy=new Jn,HI=new B,$r=new B;class GI extends ht{constructor(){super(),this.type="AudioListener",this.context=__.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Nh}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Xr,Jy,HI),$r.set(0,0,-1).applyQuaternion(Jy),t.positionX){const s=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Xr.x,s),t.positionY.linearRampToValueAtTime(Xr.y,s),t.positionZ.linearRampToValueAtTime(Xr.z,s),t.forwardX.linearRampToValueAtTime($r.x,s),t.forwardY.linearRampToValueAtTime($r.y,s),t.forwardZ.linearRampToValueAtTime($r.z,s),t.upX.linearRampToValueAtTime(i.x,s),t.upY.linearRampToValueAtTime(i.y,s),t.upZ.linearRampToValueAtTime(i.z,s)}else t.setPosition(Xr.x,Xr.y,Xr.z),t.setOrientation($r.x,$r.y,$r.z,i.x,i.y,i.z)}}class JE extends ht{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(i,s,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(i[l]!==i[l+t]){a.setValue(i,s);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,s=i*this._origIndex;e.getValue(t,s);for(let r=i,o=s;r!==o;++r)t[r]=t[s+r%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i=.5)for(let o=0;o!==r;++o)e[t+o]=e[i+o]}_slerp(e,t,i,s){Jn.slerpFlat(e,t,e,t,e,i,s)}_slerpAdditive(e,t,i,s,r){const o=this._workIndex*r;Jn.multiplyQuaternionsFlat(e,o,e,t,e,i),Jn.slerpFlat(e,t,e,t,e,o,s)}_lerp(e,t,i,s,r){const o=1-s;for(let a=0;a!==r;++a){const l=t+a;e[l]=e[l]*o+e[i+a]*s}}_lerpAdditive(e,t,i,s,r){for(let o=0;o!==r;++o){const a=t+o;e[a]=e[a]+e[i+o]*s}}}const v_="\\[\\]\\.:\\/",qI=new RegExp("["+v_+"]","g"),y_="[^"+v_+"]",YI="[^"+v_.replace("\\.","")+"]",jI=/((?:WC+[\/:])*)/.source.replace("WC",y_),KI=/(WCOD+)?/.source.replace("WCOD",YI),ZI=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",y_),JI=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",y_),QI=new RegExp("^"+jI+KI+ZI+JI+"$"),eL=["material","materials","bones","map"];class tL{constructor(e,t,i){const s=i||mt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,s)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,s=this._bindings[i];s!==void 0&&s.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let s=this._targetGroup.nCachedObjects_,r=i.length;s!==r;++s)i[s].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class mt{constructor(e,t,i){this.path=t,this.parsedPath=i||mt.parseTrackName(t),this.node=mt.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new mt.Composite(e,t,i):new mt(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(qI,"")}static parseTrackName(e){const t=QI.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},s=i.nodeName&&i.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){const r=i.nodeName.substring(s+1);eL.indexOf(r)!==-1&&(i.nodeName=i.nodeName.substring(0,s),i.objectName=r)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(r){for(let o=0;o=r){const f=r++,d=e[f];t[d.uuid]=u,e[u]=d,t[c]=f,e[f]=l;for(let h=0,p=s;h!==p;++h){const _=i[h],g=_[f],m=_[u];_[u]=g,_[f]=m}}}this.nCachedObjects_=r}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,s=i.length;let r=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const c=arguments[a],u=c.uuid,f=t[u];if(f!==void 0)if(delete t[u],f0&&(t[h.uuid]=f),e[f]=h,e.pop();for(let p=0,_=s;p!==_;++p){const g=i[p];g[f]=g[d],g.pop()}}}this.nCachedObjects_=r}subscribe_(e,t){const i=this._bindingsIndicesByPath;let s=i[e];const r=this._bindings;if(s!==void 0)return r[s];const o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,f=new Array(c);s=r.length,i[e]=s,o.push(e),a.push(t),r.push(f);for(let d=u,h=l.length;d!==h;++d){const p=l[d];f[d]=new mt(p,e,t)}return f}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const s=this._paths,r=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=i,o[i]=l,o.pop(),r[i]=r[a],r.pop(),s[i]=s[a],s.pop()}}}class eT{constructor(e,t,i=null,s=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=s;const r=t.tracks,o=r.length,a=new Array(o),l={endingStart:ao,endingEnd:ao};for(let c=0;c!==o;++c){const u=r[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=z1,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i=!1){if(e.fadeOut(t),this.fadeIn(t),i===!0){const s=this._clip.duration,r=e._clip.duration,o=r/s,a=s/r;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i=!1){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const s=this._mixer,r=s.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=s._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,c=a.sampleValues;return l[0]=r,l[1]=r+i,c[0]=e/o,c[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,s){if(!this.enabled){this._updateWeight(e);return}const r=this._startTime;if(r!==null){const l=(e-r)*i;l<0||i===0?t=0:(this._startTime=null,t=i*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case q0:for(let u=0,f=l.length;u!==f;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case uh:default:for(let u=0,f=l.length;u!==f;++u)l[u].evaluate(o),c[u].accumulate(s,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const s=i.evaluate(e)[0];t*=s,e>i.parameterPositions[1]&&(this.stopFading(),s===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const s=i.evaluate(e)[0];t*=s,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let s=this.time+e,r=this._loopCount;const o=i===V1;if(e===0)return r===-1?s:o&&(r&1)===1?t-s:s;if(i===B1){r===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(s>=t)s=t;else if(s<0)s=0;else{this.time=s;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(r===-1&&(e>=0?(r=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),s>=t||s<0){const a=Math.floor(s/t);s-=t*a,r+=Math.abs(a);const l=this.repetitions-r;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,s=e>0?t:0,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this.time=s,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=s;if(o&&(r&1)===1)return t-s}return s}_setEndings(e,t,i){const s=this._interpolantSettings;i?(s.endingStart=lo,s.endingEnd=lo):(e?s.endingStart=this.zeroSlopeAtStart?lo:ao:s.endingStart=rc,t?s.endingEnd=this.zeroSlopeAtEnd?lo:ao:s.endingEnd=rc)}_scheduleFading(e,t,i){const s=this._mixer,r=s.time;let o=this._weightInterpolant;o===null&&(o=s._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=r,l[0]=t,a[1]=r+e,l[1]=i,this}}const iL=new Float32Array(1);class sL extends rs{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,s=e._clip.tracks,r=s.length,o=e._propertyBindings,a=e._interpolants,l=i.uuid,c=this._bindingsByRootAndName;let u=c[l];u===void 0&&(u={},c[l]=u);for(let f=0;f!==r;++f){const d=s[f],h=d.name;let p=u[h];if(p!==void 0)++p.referenceCount,o[f]=p;else{if(p=o[f],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,h));continue}const _=t&&t._propertyBindings[f].binding.parsedPath;p=new QE(mt.create(i,h,_),d.ValueTypeName,d.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,h),o[f]=p}a[f].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,s=e._clip.uuid,r=this._actionsByClip[s];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,s,i)}const t=e._propertyBindings;for(let i=0,s=t.length;i!==s;++i){const r=t[i];r.useCount++===0&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,s=t.length;i!==s;++i){const r=t[i];--r.useCount===0&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,s=this.time+=e,r=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==i;++c)t[c]._update(s,e,r,o);const a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,nb).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const ib=new B,Wu=new B;class pL{constructor(e=new B,t=new B){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){ib.subVectors(e,this.start),Wu.subVectors(this.end,this.start);const i=Wu.dot(Wu);let r=Wu.dot(ib)/i;return t&&(r=tt(r,0,1)),r}closestPointToPoint(e,t,i){const s=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(s).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const sb=new B;class mL extends ht{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new ct,s=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o1)for(let f=0;f.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{cb.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(cb,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class CL extends os{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],s=new ct;s.setAttribute("position",new ke(t,3)),s.setAttribute("color",new ke(i,3));const r=new Gn({vertexColors:!0,toneMapped:!1});super(s,r),this.type="AxesHelper"}setColors(e,t,i){const s=new Ce,r=this.geometry.attributes.color.array;return s.set(e),s.toArray(r,0),s.toArray(r,3),s.set(t),s.toArray(r,6),s.toArray(r,9),s.set(i),s.toArray(r,12),s.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class RL{constructor(){this.type="ShapePath",this.color=new Ce,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new uc,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,s){return this.currentPath.quadraticCurveTo(e,t,i,s),this}bezierCurveTo(e,t,i,s,r,o){return this.currentPath.bezierCurveTo(e,t,i,s,r,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(m){const y=[];for(let b=0,v=m.length;bNumber.EPSILON){if(M<0&&(S=y[E],x=-x,P=y[T],M=-M),m.yP.y)continue;if(m.y===S.y){if(m.x===S.x)return!0}else{const L=M*(m.x-S.x)-x*(m.y-S.y);if(L===0)return!0;if(L<0)continue;v=!v}}else{if(m.y!==S.y)continue;if(P.x<=m.x&&m.x<=S.x||S.x<=m.x&&m.x<=P.x)return!0}}return v}const s=Qi.isClockWise,r=this.subPaths;if(r.length===0)return[];let o,a,l;const c=[];if(r.length===1)return a=r[0],l=new go,l.curves=a.curves,c.push(l),c;let u=!s(r[0].getPoints());u=e?!u:u;const f=[],d=[];let h=[],p=0,_;d[p]=void 0,h[p]=[];for(let m=0,y=r.length;m1){let m=!1,y=0;for(let b=0,v=d.length;b0&&m===!1&&(h=f)}let g;for(let m=0,y=d.length;me?(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2):(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0),n}function LL(n,e){const t=n.image&&n.image.width?n.image.width/n.image.height:1;return t>e?(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0):(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2),n}function DL(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function bg(n,e,t,i){const s=OL(i);switch(t){case V0:return n*e;case G0:return n*e;case W0:return n*e*2;case ah:return n*e/s.components*s.byteLength;case Nc:return n*e/s.components*s.byteLength;case X0:return n*e*2/s.components*s.byteLength;case lh:return n*e*2/s.components*s.byteLength;case H0:return n*e*3/s.components*s.byteLength;case Bn:return n*e*4/s.components*s.byteLength;case ch:return n*e*4/s.components*s.byteLength;case Sl:case El:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case Tl:case wl:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case Zf:case Qf:return Math.max(n,16)*Math.max(e,8)/4;case Kf:case Jf:return Math.max(n,8)*Math.max(e,8)/2;case ed:case td:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case nd:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case id:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case sd:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case rd:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case od:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case ad:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case ld:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case cd:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case ud:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case fd:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case dd:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case hd:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case pd:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case md:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case gd:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case Al:case _d:case vd:return Math.ceil(n/4)*Math.ceil(e/4)*16;case $0:case yd:return Math.ceil(n/4)*Math.ceil(e/4)*8;case bd:case xd:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function OL(n){switch(n){case is:case k0:return{byteLength:1,components:1};case ba:case B0:case Ua:return{byteLength:2,components:1};case rh:case oh:return{byteLength:2,components:4};case Us:case sh:case Kn:return{byteLength:4,components:1};case z0:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}class NL{static contain(e,t){return IL(e,t)}static cover(e,t){return LL(e,t)}static fill(e){return DL(e)}static getByteLength(e,t,i,s){return bg(e,t,i,s)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Dc}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Dc);/** - * @license - * Copyright 2010-2025 Three.js Authors - * SPDX-License-Identifier: MIT - */function iT(){let n=null,e=!1,t=null,i=null;function s(r,o){t(r,o),i=n.requestAnimationFrame(s)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(s),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(r){t=r},setContext:function(r){n=r}}}function UL(n){const e=new WeakMap;function t(a,l){const c=a.array,u=a.usage,f=c.byteLength,d=n.createBuffer();n.bindBuffer(l,d),n.bufferData(l,c,u),a.onUploadCallback();let h;if(c instanceof Float32Array)h=n.FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?h=n.HALF_FLOAT:h=n.UNSIGNED_SHORT;else if(c instanceof Int16Array)h=n.SHORT;else if(c instanceof Uint32Array)h=n.UNSIGNED_INT;else if(c instanceof Int32Array)h=n.INT;else if(c instanceof Int8Array)h=n.BYTE;else if(c instanceof Uint8Array)h=n.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)h=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:d,type:h,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:f}}function i(a,l,c){const u=l.array,f=l.updateRanges;if(n.bindBuffer(c,a),f.length===0)n.bufferSubData(c,0,u);else{f.sort((h,p)=>h.start-p.start);let d=0;for(let h=1;h 0 - vec4 plane; - #ifdef ALPHA_TO_COVERAGE - float distanceToPlane, distanceGradient; - float clipOpacity = 1.0; - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; - distanceGradient = fwidth( distanceToPlane ) / 2.0; - clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); - if ( clipOpacity == 0.0 ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - float unionClipOpacity = 1.0; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; - distanceGradient = fwidth( distanceToPlane ) / 2.0; - unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); - } - #pragma unroll_loop_end - clipOpacity *= 1.0 - unionClipOpacity; - #endif - diffuseColor.a *= clipOpacity; - if ( diffuseColor.a == 0.0 ) discard; - #else - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - bool clipped = true; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; - } - #pragma unroll_loop_end - if ( clipped ) discard; - #endif - #endif -#endif`,QL=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,eD=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,tD=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,nD=`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,iD=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,sD=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) - varying vec3 vColor; -#endif`,rD=`#if defined( USE_COLOR_ALPHA ) - vColor = vec4( 1.0 ); -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) - vColor = vec3( 1.0 ); -#endif -#ifdef USE_COLOR - vColor *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.xyz *= instanceColor.xyz; -#endif -#ifdef USE_BATCHING_COLOR - vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); - vColor.xyz *= batchingColor.xyz; -#endif`,oD=`#define PI 3.141592653589793 -#define PI2 6.283185307179586 -#define PI_HALF 1.5707963267948966 -#define RECIPROCAL_PI 0.3183098861837907 -#define RECIPROCAL_PI2 0.15915494309189535 -#define EPSILON 1e-6 -#ifndef saturate -#define saturate( a ) clamp( a, 0.0, 1.0 ) -#endif -#define whiteComplement( a ) ( 1.0 - saturate( a ) ) -float pow2( const in float x ) { return x*x; } -vec3 pow2( const in vec3 x ) { return x*x; } -float pow3( const in float x ) { return x*x*x; } -float pow4( const in float x ) { float x2 = x*x; return x2*x2; } -float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } -float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } -highp float rand( const in vec2 uv ) { - const highp float a = 12.9898, b = 78.233, c = 43758.5453; - highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); - return fract( sin( sn ) * c ); -} -#ifdef HIGH_PRECISION - float precisionSafeLength( vec3 v ) { return length( v ); } -#else - float precisionSafeLength( vec3 v ) { - float maxComponent = max3( abs( v ) ); - return length( v / maxComponent ) * maxComponent; - } -#endif -struct IncidentLight { - vec3 color; - vec3 direction; - bool visible; -}; -struct ReflectedLight { - vec3 directDiffuse; - vec3 directSpecular; - vec3 indirectDiffuse; - vec3 indirectSpecular; -}; -#ifdef USE_ALPHAHASH - varying vec3 vPosition; -#endif -vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); -} -vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); -} -mat3 transposeMat3( const in mat3 m ) { - mat3 tmp; - tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); - tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); - tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); - return tmp; -} -bool isPerspectiveMatrix( mat4 m ) { - return m[ 2 ][ 3 ] == - 1.0; -} -vec2 equirectUv( in vec3 dir ) { - float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; - float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - return vec2( u, v ); -} -vec3 BRDF_Lambert( const in vec3 diffuseColor ) { - return RECIPROCAL_PI * diffuseColor; -} -vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { - float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); - return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} -float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { - float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); - return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} // validated`,aD=`#ifdef ENVMAP_TYPE_CUBE_UV - #define cubeUV_minMipLevel 4.0 - #define cubeUV_minTileSize 16.0 - float getFace( vec3 direction ) { - vec3 absDirection = abs( direction ); - float face = - 1.0; - if ( absDirection.x > absDirection.z ) { - if ( absDirection.x > absDirection.y ) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if ( absDirection.z > absDirection.y ) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - } - vec2 getUV( vec3 direction, float face ) { - vec2 uv; - if ( face == 0.0 ) { - uv = vec2( direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 1.0 ) { - uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); - } else if ( face == 2.0 ) { - uv = vec2( - direction.x, direction.y ) / abs( direction.z ); - } else if ( face == 3.0 ) { - uv = vec2( - direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 4.0 ) { - uv = vec2( - direction.x, direction.z ) / abs( direction.y ); - } else { - uv = vec2( direction.x, direction.y ) / abs( direction.z ); - } - return 0.5 * ( uv + 1.0 ); - } - vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { - float face = getFace( direction ); - float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); - mipInt = max( mipInt, cubeUV_minMipLevel ); - float faceSize = exp2( mipInt ); - highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; - if ( face > 2.0 ) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - uv.x += filterInt * 3.0 * cubeUV_minTileSize; - uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); - uv.x *= CUBEUV_TEXEL_WIDTH; - uv.y *= CUBEUV_TEXEL_HEIGHT; - #ifdef texture2DGradEXT - return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; - #else - return texture2D( envMap, uv ).rgb; - #endif - } - #define cubeUV_r0 1.0 - #define cubeUV_m0 - 2.0 - #define cubeUV_r1 0.8 - #define cubeUV_m1 - 1.0 - #define cubeUV_r4 0.4 - #define cubeUV_m4 2.0 - #define cubeUV_r5 0.305 - #define cubeUV_m5 3.0 - #define cubeUV_r6 0.21 - #define cubeUV_m6 4.0 - float roughnessToMip( float roughness ) { - float mip = 0.0; - if ( roughness >= cubeUV_r1 ) { - mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; - } else if ( roughness >= cubeUV_r4 ) { - mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; - } else if ( roughness >= cubeUV_r5 ) { - mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; - } else if ( roughness >= cubeUV_r6 ) { - mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; - } else { - mip = - 2.0 * log2( 1.16 * roughness ); } - return mip; - } - vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { - float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); - float mipF = fract( mip ); - float mipInt = floor( mip ); - vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); - if ( mipF == 0.0 ) { - return vec4( color0, 1.0 ); - } else { - vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); - return vec4( mix( color0, color1, mipF ), 1.0 ); - } - } -#endif`,lD=`vec3 transformedNormal = objectNormal; -#ifdef USE_TANGENT - vec3 transformedTangent = objectTangent; -#endif -#ifdef USE_BATCHING - mat3 bm = mat3( batchingMatrix ); - transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); - transformedNormal = bm * transformedNormal; - #ifdef USE_TANGENT - transformedTangent = bm * transformedTangent; - #endif -#endif -#ifdef USE_INSTANCING - mat3 im = mat3( instanceMatrix ); - transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); - transformedNormal = im * transformedNormal; - #ifdef USE_TANGENT - transformedTangent = im * transformedTangent; - #endif -#endif -transformedNormal = normalMatrix * transformedNormal; -#ifdef FLIP_SIDED - transformedNormal = - transformedNormal; -#endif -#ifdef USE_TANGENT - transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; - #ifdef FLIP_SIDED - transformedTangent = - transformedTangent; - #endif -#endif`,cD=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,uD=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,fD=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); - #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE - emissiveColor = sRGBTransferEOTF( emissiveColor ); - #endif - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,dD=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,hD="gl_FragColor = linearToOutputTexel( gl_FragColor );",pD=`vec4 LinearTransferOETF( in vec4 value ) { - return value; -} -vec4 sRGBTransferEOTF( in vec4 value ) { - return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); -} -vec4 sRGBTransferOETF( in vec4 value ) { - return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -}`,mD=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vec3 cameraToFrag; - if ( isOrthographic ) { - cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToFrag = normalize( vWorldPosition - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( cameraToFrag, worldNormal ); - #else - vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); - #endif - #else - vec3 reflectVec = vReflect; - #endif - #ifdef ENVMAP_TYPE_CUBE - vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - #else - vec4 envColor = vec4( 0.0 ); - #endif - #ifdef ENVMAP_BLENDING_MULTIPLY - outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_MIX ) - outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_ADD ) - outgoingLight += envColor.xyz * specularStrength * reflectivity; - #endif -#endif`,gD=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - uniform mat3 envMapRotation; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif`,_D=`#ifdef USE_ENVMAP - uniform float reflectivity; - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - varying vec3 vWorldPosition; - uniform float refractionRatio; - #else - varying vec3 vReflect; - #endif -#endif`,vD=`#ifdef USE_ENVMAP - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - - varying vec3 vWorldPosition; - #else - varying vec3 vReflect; - uniform float refractionRatio; - #endif -#endif`,yD=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vWorldPosition = worldPosition.xyz; - #else - vec3 cameraToVertex; - if ( isOrthographic ) { - cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vReflect = reflect( cameraToVertex, worldNormal ); - #else - vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); - #endif - #endif -#endif`,bD=`#ifdef USE_FOG - vFogDepth = - mvPosition.z; -#endif`,xD=`#ifdef USE_FOG - varying float vFogDepth; -#endif`,MD=`#ifdef USE_FOG - #ifdef FOG_EXP2 - float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); - #else - float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); - #endif - gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,SD=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float vFogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,ED=`#ifdef USE_GRADIENTMAP - uniform sampler2D gradientMap; -#endif -vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { - float dotNL = dot( normal, lightDirection ); - vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); - #ifdef USE_GRADIENTMAP - return vec3( texture2D( gradientMap, coord ).r ); - #else - vec2 fw = fwidth( coord ) * 0.5; - return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); - #endif -}`,TD=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,wD=`LambertMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,AD=`varying vec3 vViewPosition; -struct LambertMaterial { - vec3 diffuseColor; - float specularStrength; -}; -void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Lambert -#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,CD=`uniform bool receiveShadow; -uniform vec3 ambientLightColor; -#if defined( USE_LIGHT_PROBES ) - uniform vec3 lightProbe[ 9 ]; -#endif -vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { - float x = normal.x, y = normal.y, z = normal.z; - vec3 result = shCoefficients[ 0 ] * 0.886227; - result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; - result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; - result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; - result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; - result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; - result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); - result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; - result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); - return result; -} -vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); - return irradiance; -} -vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { - vec3 irradiance = ambientLightColor; - return irradiance; -} -float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { - float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); - if ( cutoffDistance > 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; -} -float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { - return smoothstep( coneCosine, penumbraCosine, angleCosine ); -} -#if NUM_DIR_LIGHTS > 0 - struct DirectionalLight { - vec3 direction; - vec3 color; - }; - uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { - light.color = directionalLight.color; - light.direction = directionalLight.direction; - light.visible = true; - } -#endif -#if NUM_POINT_LIGHTS > 0 - struct PointLight { - vec3 position; - vec3 color; - float distance; - float decay; - }; - uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; - void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { - vec3 lVector = pointLight.position - geometryPosition; - light.direction = normalize( lVector ); - float lightDistance = length( lVector ); - light.color = pointLight.color; - light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); - light.visible = ( light.color != vec3( 0.0 ) ); - } -#endif -#if NUM_SPOT_LIGHTS > 0 - struct SpotLight { - vec3 position; - vec3 direction; - vec3 color; - float distance; - float decay; - float coneCos; - float penumbraCos; - }; - uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; - void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { - vec3 lVector = spotLight.position - geometryPosition; - light.direction = normalize( lVector ); - float angleCos = dot( light.direction, spotLight.direction ); - float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); - if ( spotAttenuation > 0.0 ) { - float lightDistance = length( lVector ); - light.color = spotLight.color * spotAttenuation; - light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); - light.visible = ( light.color != vec3( 0.0 ) ); - } else { - light.color = vec3( 0.0 ); - light.visible = false; - } - } -#endif -#if NUM_RECT_AREA_LIGHTS > 0 - struct RectAreaLight { - vec3 color; - vec3 position; - vec3 halfWidth; - vec3 halfHeight; - }; - uniform sampler2D ltc_1; uniform sampler2D ltc_2; - uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; -#endif -#if NUM_HEMI_LIGHTS > 0 - struct HemisphereLight { - vec3 direction; - vec3 skyColor; - vec3 groundColor; - }; - uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; - vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { - float dotNL = dot( normal, hemiLight.direction ); - float hemiDiffuseWeight = 0.5 * dotNL + 0.5; - vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); - return irradiance; - } -#endif`,RD=`#ifdef USE_ENVMAP - vec3 getIBLIrradiance( const in vec3 normal ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); - return PI * envMapColor.rgb * envMapIntensity; - #else - return vec3( 0.0 ); - #endif - } - vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 reflectVec = reflect( - viewDir, normal ); - reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); - return envMapColor.rgb * envMapIntensity; - #else - return vec3( 0.0 ); - #endif - } - #ifdef USE_ANISOTROPY - vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 bentNormal = cross( bitangent, viewDir ); - bentNormal = normalize( cross( bentNormal, bitangent ) ); - bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); - return getIBLRadiance( viewDir, bentNormal, roughness ); - #else - return vec3( 0.0 ); - #endif - } - #endif -#endif`,PD=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,ID=`varying vec3 vViewPosition; -struct ToonMaterial { - vec3 diffuseColor; -}; -void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,LD=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,DD=`varying vec3 vViewPosition; -struct BlinnPhongMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; -}; -void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; -} -void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,OD=`PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); -float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); -material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; -material.roughness = min( material.roughness, 1.0 ); -#ifdef IOR - material.ior = ior; - #ifdef USE_SPECULAR - float specularIntensityFactor = specularIntensity; - vec3 specularColorFactor = specularColor; - #ifdef USE_SPECULAR_COLORMAP - specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; - #endif - #ifdef USE_SPECULAR_INTENSITYMAP - specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; - #endif - material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); - #else - float specularIntensityFactor = 1.0; - vec3 specularColorFactor = vec3( 1.0 ); - material.specularF90 = 1.0; - #endif - material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); -#else - material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); - material.specularF90 = 1.0; -#endif -#ifdef USE_CLEARCOAT - material.clearcoat = clearcoat; - material.clearcoatRoughness = clearcoatRoughness; - material.clearcoatF0 = vec3( 0.04 ); - material.clearcoatF90 = 1.0; - #ifdef USE_CLEARCOATMAP - material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; - #endif - #ifdef USE_CLEARCOAT_ROUGHNESSMAP - material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; - #endif - material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); - material.clearcoatRoughness += geometryRoughness; - material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); -#endif -#ifdef USE_DISPERSION - material.dispersion = dispersion; -#endif -#ifdef USE_IRIDESCENCE - material.iridescence = iridescence; - material.iridescenceIOR = iridescenceIOR; - #ifdef USE_IRIDESCENCEMAP - material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; - #endif - #ifdef USE_IRIDESCENCE_THICKNESSMAP - material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; - #else - material.iridescenceThickness = iridescenceThicknessMaximum; - #endif -#endif -#ifdef USE_SHEEN - material.sheenColor = sheenColor; - #ifdef USE_SHEEN_COLORMAP - material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; - #endif - material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); - #ifdef USE_SHEEN_ROUGHNESSMAP - material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; - #endif -#endif -#ifdef USE_ANISOTROPY - #ifdef USE_ANISOTROPYMAP - mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); - vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; - vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; - #else - vec2 anisotropyV = anisotropyVector; - #endif - material.anisotropy = length( anisotropyV ); - if( material.anisotropy == 0.0 ) { - anisotropyV = vec2( 1.0, 0.0 ); - } else { - anisotropyV /= material.anisotropy; - material.anisotropy = saturate( material.anisotropy ); - } - material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); - material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; - material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; -#endif`,ND=`struct PhysicalMaterial { - vec3 diffuseColor; - float roughness; - vec3 specularColor; - float specularF90; - float dispersion; - #ifdef USE_CLEARCOAT - float clearcoat; - float clearcoatRoughness; - vec3 clearcoatF0; - float clearcoatF90; - #endif - #ifdef USE_IRIDESCENCE - float iridescence; - float iridescenceIOR; - float iridescenceThickness; - vec3 iridescenceFresnel; - vec3 iridescenceF0; - #endif - #ifdef USE_SHEEN - vec3 sheenColor; - float sheenRoughness; - #endif - #ifdef IOR - float ior; - #endif - #ifdef USE_TRANSMISSION - float transmission; - float transmissionAlpha; - float thickness; - float attenuationDistance; - vec3 attenuationColor; - #endif - #ifdef USE_ANISOTROPY - float anisotropy; - float alphaT; - vec3 anisotropyT; - vec3 anisotropyB; - #endif -}; -vec3 clearcoatSpecularDirect = vec3( 0.0 ); -vec3 clearcoatSpecularIndirect = vec3( 0.0 ); -vec3 sheenSpecularDirect = vec3( 0.0 ); -vec3 sheenSpecularIndirect = vec3(0.0 ); -vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { - float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); - float x2 = x * x; - float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); - return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); -} -float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - return 0.5 / max( gv + gl, EPSILON ); -} -float D_GGX( const in float alpha, const in float dotNH ) { - float a2 = pow2( alpha ); - float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; - return RECIPROCAL_PI * a2 / pow2( denom ); -} -#ifdef USE_ANISOTROPY - float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { - float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); - float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); - float v = 0.5 / ( gv + gl ); - return saturate(v); - } - float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { - float a2 = alphaT * alphaB; - highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); - highp float v2 = dot( v, v ); - float w2 = a2 / v2; - return RECIPROCAL_PI * a2 * pow2 ( w2 ); - } -#endif -#ifdef USE_CLEARCOAT - vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { - vec3 f0 = material.clearcoatF0; - float f90 = material.clearcoatF90; - float roughness = material.clearcoatRoughness; - float alpha = pow2( roughness ); - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotVH = saturate( dot( viewDir, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotVH ); - float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - return F * ( V * D ); - } -#endif -vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { - vec3 f0 = material.specularColor; - float f90 = material.specularF90; - float roughness = material.roughness; - float alpha = pow2( roughness ); - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotVH = saturate( dot( viewDir, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotVH ); - #ifdef USE_IRIDESCENCE - F = mix( F, material.iridescenceFresnel, material.iridescence ); - #endif - #ifdef USE_ANISOTROPY - float dotTL = dot( material.anisotropyT, lightDir ); - float dotTV = dot( material.anisotropyT, viewDir ); - float dotTH = dot( material.anisotropyT, halfDir ); - float dotBL = dot( material.anisotropyB, lightDir ); - float dotBV = dot( material.anisotropyB, viewDir ); - float dotBH = dot( material.anisotropyB, halfDir ); - float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); - float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); - #else - float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - #endif - return F * ( V * D ); -} -vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { - const float LUT_SIZE = 64.0; - const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; - const float LUT_BIAS = 0.5 / LUT_SIZE; - float dotNV = saturate( dot( N, V ) ); - vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); - uv = uv * LUT_SCALE + LUT_BIAS; - return uv; -} -float LTC_ClippedSphereFormFactor( const in vec3 f ) { - float l = length( f ); - return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); -} -vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { - float x = dot( v1, v2 ); - float y = abs( x ); - float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; - float b = 3.4175940 + ( 4.1616724 + y ) * y; - float v = a / b; - float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; - return cross( v1, v2 ) * theta_sintheta; -} -vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { - vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; - vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; - vec3 lightNormal = cross( v1, v2 ); - if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); - vec3 T1, T2; - T1 = normalize( V - N * dot( V, N ) ); - T2 = - cross( N, T1 ); - mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); - vec3 coords[ 4 ]; - coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); - coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); - coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); - coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); - coords[ 0 ] = normalize( coords[ 0 ] ); - coords[ 1 ] = normalize( coords[ 1 ] ); - coords[ 2 ] = normalize( coords[ 2 ] ); - coords[ 3 ] = normalize( coords[ 3 ] ); - vec3 vectorFormFactor = vec3( 0.0 ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); - float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); - return vec3( result ); -} -#if defined( USE_SHEEN ) -float D_Charlie( float roughness, float dotNH ) { - float alpha = pow2( roughness ); - float invAlpha = 1.0 / alpha; - float cos2h = dotNH * dotNH; - float sin2h = max( 1.0 - cos2h, 0.0078125 ); - return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); -} -float V_Neubelt( float dotNV, float dotNL ) { - return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); -} -vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float D = D_Charlie( sheenRoughness, dotNH ); - float V = V_Neubelt( dotNV, dotNL ); - return sheenColor * ( D * V ); -} -#endif -float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - float r2 = roughness * roughness; - float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; - float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; - float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); - return saturate( DG * RECIPROCAL_PI ); -} -vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); - const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); - vec4 r = roughness * c0 + c1; - float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; - vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; - return fab; -} -vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { - vec2 fab = DFGApprox( normal, viewDir, roughness ); - return specularColor * fab.x + specularF90 * fab.y; -} -#ifdef USE_IRIDESCENCE -void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { -#else -void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { -#endif - vec2 fab = DFGApprox( normal, viewDir, roughness ); - #ifdef USE_IRIDESCENCE - vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); - #else - vec3 Fr = specularColor; - #endif - vec3 FssEss = Fr * fab.x + specularF90 * fab.y; - float Ess = fab.x + fab.y; - float Ems = 1.0 - Ess; - vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); - singleScatter += FssEss; - multiScatter += Fms * Ems; -} -#if NUM_RECT_AREA_LIGHTS > 0 - void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 normal = geometryNormal; - vec3 viewDir = geometryViewDir; - vec3 position = geometryPosition; - vec3 lightPos = rectAreaLight.position; - vec3 halfWidth = rectAreaLight.halfWidth; - vec3 halfHeight = rectAreaLight.halfHeight; - vec3 lightColor = rectAreaLight.color; - float roughness = material.roughness; - vec3 rectCoords[ 4 ]; - rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; - rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; - rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; - vec2 uv = LTC_Uv( normal, viewDir, roughness ); - vec4 t1 = texture2D( ltc_1, uv ); - vec4 t2 = texture2D( ltc_2, uv ); - mat3 mInv = mat3( - vec3( t1.x, 0, t1.y ), - vec3( 0, 1, 0 ), - vec3( t1.z, 0, t1.w ) - ); - vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); - reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); - reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); - } -#endif -void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifdef USE_CLEARCOAT - float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); - vec3 ccIrradiance = dotNLcc * directLight.color; - clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); - #endif - #ifdef USE_SHEEN - sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); - #endif - reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { - #ifdef USE_CLEARCOAT - clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); - #endif - #ifdef USE_SHEEN - sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); - #endif - vec3 singleScattering = vec3( 0.0 ); - vec3 multiScattering = vec3( 0.0 ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - #ifdef USE_IRIDESCENCE - computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); - #else - computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); - #endif - vec3 totalScattering = singleScattering + multiScattering; - vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); - reflectedLight.indirectSpecular += radiance * singleScattering; - reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; - reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; -} -#define RE_Direct RE_Direct_Physical -#define RE_Direct_RectArea RE_Direct_RectArea_Physical -#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical -#define RE_IndirectSpecular RE_IndirectSpecular_Physical -float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { - return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,UD=` -vec3 geometryPosition = - vViewPosition; -vec3 geometryNormal = normal; -vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); -vec3 geometryClearcoatNormal = vec3( 0.0 ); -#ifdef USE_CLEARCOAT - geometryClearcoatNormal = clearcoatNormal; -#endif -#ifdef USE_IRIDESCENCE - float dotNVi = saturate( dot( normal, geometryViewDir ) ); - if ( material.iridescenceThickness == 0.0 ) { - material.iridescence = 0.0; - } else { - material.iridescence = saturate( material.iridescence ); - } - if ( material.iridescence > 0.0 ) { - material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); - material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); - } -#endif -IncidentLight directLight; -#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) - PointLight pointLight; - #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - pointLight = pointLights[ i ]; - getPointLightInfo( pointLight, geometryPosition, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) - pointLightShadow = pointLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - SpotLight spotLight; - vec4 spotColor; - vec3 spotLightCoord; - bool inSpotLightMap; - #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - spotLight = spotLights[ i ]; - getSpotLightInfo( spotLight, geometryPosition, directLight ); - #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) - #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX - #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS - #else - #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) - #endif - #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) - spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; - inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); - spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); - directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; - #endif - #undef SPOT_LIGHT_MAP_INDEX - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - spotLightShadow = spotLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) - DirectionalLight directionalLight; - #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - directionalLight = directionalLights[ i ]; - getDirectionalLightInfo( directionalLight, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directionalLightShadow = directionalLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) - RectAreaLight rectAreaLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - rectAreaLight = rectAreaLights[ i ]; - RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if defined( RE_IndirectDiffuse ) - vec3 iblIrradiance = vec3( 0.0 ); - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - #if defined( USE_LIGHT_PROBES ) - irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); - #endif - #if ( NUM_HEMI_LIGHTS > 0 ) - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); - } - #pragma unroll_loop_end - #endif -#endif -#if defined( RE_IndirectSpecular ) - vec3 radiance = vec3( 0.0 ); - vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,FD=`#if defined( RE_IndirectDiffuse ) - #ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); - vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; - irradiance += lightMapIrradiance; - #endif - #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) - iblIrradiance += getIBLIrradiance( geometryNormal ); - #endif -#endif -#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) - #ifdef USE_ANISOTROPY - radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); - #else - radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); - #endif - #ifdef USE_CLEARCOAT - clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); - #endif -#endif`,kD=`#if defined( RE_IndirectDiffuse ) - RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif -#if defined( RE_IndirectSpecular ) - RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif`,BD=`#if defined( USE_LOGDEPTHBUF ) - gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,zD=`#if defined( USE_LOGDEPTHBUF ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,VD=`#ifdef USE_LOGDEPTHBUF - varying float vFragDepth; - varying float vIsPerspective; -#endif`,HD=`#ifdef USE_LOGDEPTHBUF - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); -#endif`,GD=`#ifdef USE_MAP - vec4 sampledDiffuseColor = texture2D( map, vMapUv ); - #ifdef DECODE_VIDEO_TEXTURE - sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); - #endif - diffuseColor *= sampledDiffuseColor; -#endif`,WD=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,XD=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - #if defined( USE_POINTS_UV ) - vec2 uv = vUv; - #else - vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; - #endif -#endif -#ifdef USE_MAP - diffuseColor *= texture2D( map, uv ); -#endif -#ifdef USE_ALPHAMAP - diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,$D=`#if defined( USE_POINTS_UV ) - varying vec2 vUv; -#else - #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - uniform mat3 uvTransform; - #endif -#endif -#ifdef USE_MAP - uniform sampler2D map; -#endif -#ifdef USE_ALPHAMAP - uniform sampler2D alphaMap; -#endif`,qD=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); - metalnessFactor *= texelMetalness.b; -#endif`,YD=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,jD=`#ifdef USE_INSTANCING_MORPH - float morphTargetInfluences[ MORPHTARGETS_COUNT ]; - float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; - } -#endif`,KD=`#if defined( USE_MORPHCOLORS ) - vColor *= morphTargetBaseInfluence; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - #if defined( USE_COLOR_ALPHA ) - if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; - #elif defined( USE_COLOR ) - if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; - #endif - } -#endif`,ZD=`#ifdef USE_MORPHNORMALS - objectNormal *= morphTargetBaseInfluence; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; - } -#endif`,JD=`#ifdef USE_MORPHTARGETS - #ifndef USE_INSTANCING_MORPH - uniform float morphTargetBaseInfluence; - uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; - #endif - uniform sampler2DArray morphTargetsTexture; - uniform ivec2 morphTargetsTextureSize; - vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { - int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; - int y = texelIndex / morphTargetsTextureSize.x; - int x = texelIndex - y * morphTargetsTextureSize.x; - ivec3 morphUV = ivec3( x, y, morphTargetIndex ); - return texelFetch( morphTargetsTexture, morphUV, 0 ); - } -#endif`,QD=`#ifdef USE_MORPHTARGETS - transformed *= morphTargetBaseInfluence; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; - } -#endif`,eO=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; -#ifdef FLAT_SHADED - vec3 fdx = dFdx( vViewPosition ); - vec3 fdy = dFdy( vViewPosition ); - vec3 normal = normalize( cross( fdx, fdy ) ); -#else - vec3 normal = normalize( vNormal ); - #ifdef DOUBLE_SIDED - normal *= faceDirection; - #endif -#endif -#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) - #ifdef USE_TANGENT - mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); - #else - mat3 tbn = getTangentFrame( - vViewPosition, normal, - #if defined( USE_NORMALMAP ) - vNormalMapUv - #elif defined( USE_CLEARCOAT_NORMALMAP ) - vClearcoatNormalMapUv - #else - vUv - #endif - ); - #endif - #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) - tbn[0] *= faceDirection; - tbn[1] *= faceDirection; - #endif -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - #ifdef USE_TANGENT - mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); - #else - mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); - #endif - #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) - tbn2[0] *= faceDirection; - tbn2[1] *= faceDirection; - #endif -#endif -vec3 nonPerturbedNormal = normal;`,tO=`#ifdef USE_NORMALMAP_OBJECTSPACE - normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; - #ifdef FLIP_SIDED - normal = - normal; - #endif - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - normal = normalize( normalMatrix * normal ); -#elif defined( USE_NORMALMAP_TANGENTSPACE ) - vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; - mapN.xy *= normalScale; - normal = normalize( tbn * mapN ); -#elif defined( USE_BUMPMAP ) - normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,nO=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,iO=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,sO=`#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif`,rO=`#ifdef USE_NORMALMAP - uniform sampler2D normalMap; - uniform vec2 normalScale; -#endif -#ifdef USE_NORMALMAP_OBJECTSPACE - uniform mat3 normalMatrix; -#endif -#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) - mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { - vec3 q0 = dFdx( eye_pos.xyz ); - vec3 q1 = dFdy( eye_pos.xyz ); - vec2 st0 = dFdx( uv.st ); - vec2 st1 = dFdy( uv.st ); - vec3 N = surf_norm; - vec3 q1perp = cross( q1, N ); - vec3 q0perp = cross( N, q0 ); - vec3 T = q1perp * st0.x + q0perp * st1.x; - vec3 B = q1perp * st0.y + q0perp * st1.y; - float det = max( dot( T, T ), dot( B, B ) ); - float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); - return mat3( T * scale, B * scale, N ); - } -#endif`,oO=`#ifdef USE_CLEARCOAT - vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,aO=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,lO=`#ifdef USE_CLEARCOATMAP - uniform sampler2D clearcoatMap; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform sampler2D clearcoatNormalMap; - uniform vec2 clearcoatNormalScale; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform sampler2D clearcoatRoughnessMap; -#endif`,cO=`#ifdef USE_IRIDESCENCEMAP - uniform sampler2D iridescenceMap; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - uniform sampler2D iridescenceThicknessMap; -#endif`,uO=`#ifdef OPAQUE -diffuseColor.a = 1.0; -#endif -#ifdef USE_TRANSMISSION -diffuseColor.a *= material.transmissionAlpha; -#endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,fO=`vec3 packNormalToRGB( const in vec3 normal ) { - return normalize( normal ) * 0.5 + 0.5; -} -vec3 unpackRGBToNormal( const in vec3 rgb ) { - return 2.0 * rgb.xyz - 1.0; -} -const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; -const float Inv255 = 1. / 255.; -const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); -const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); -const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); -const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); -vec4 packDepthToRGBA( const in float v ) { - if( v <= 0.0 ) - return vec4( 0., 0., 0., 0. ); - if( v >= 1.0 ) - return vec4( 1., 1., 1., 1. ); - float vuf; - float af = modf( v * PackFactors.a, vuf ); - float bf = modf( vuf * ShiftRight8, vuf ); - float gf = modf( vuf * ShiftRight8, vuf ); - return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); -} -vec3 packDepthToRGB( const in float v ) { - if( v <= 0.0 ) - return vec3( 0., 0., 0. ); - if( v >= 1.0 ) - return vec3( 1., 1., 1. ); - float vuf; - float bf = modf( v * PackFactors.b, vuf ); - float gf = modf( vuf * ShiftRight8, vuf ); - return vec3( vuf * Inv255, gf * PackUpscale, bf ); -} -vec2 packDepthToRG( const in float v ) { - if( v <= 0.0 ) - return vec2( 0., 0. ); - if( v >= 1.0 ) - return vec2( 1., 1. ); - float vuf; - float gf = modf( v * 256., vuf ); - return vec2( vuf * Inv255, gf ); -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors4 ); -} -float unpackRGBToDepth( const in vec3 v ) { - return dot( v, UnpackFactors3 ); -} -float unpackRGToDepth( const in vec2 v ) { - return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; -} -vec4 pack2HalfToRGBA( const in vec2 v ) { - vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); - return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); -} -vec2 unpackRGBATo2Half( const in vec4 v ) { - return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); -} -float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { - return ( viewZ + near ) / ( near - far ); -} -float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { - return depth * ( near - far ) - near; -} -float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { - return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); -} -float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { - return ( near * far ) / ( ( far - near ) * depth - far ); -}`,dO=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,hO=`vec4 mvPosition = vec4( transformed, 1.0 ); -#ifdef USE_BATCHING - mvPosition = batchingMatrix * mvPosition; -#endif -#ifdef USE_INSTANCING - mvPosition = instanceMatrix * mvPosition; -#endif -mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,pO=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,mO=`#ifdef DITHERING - vec3 dithering( vec3 color ) { - float grid_position = rand( gl_FragCoord.xy ); - vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); - dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); - return color + dither_shift_RGB; - } -#endif`,gO=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); - roughnessFactor *= texelRoughness.g; -#endif`,_O=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,vO=`#if NUM_SPOT_LIGHT_COORDS > 0 - varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; -#endif -#if NUM_SPOT_LIGHT_MAPS > 0 - uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; -#endif -#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { - return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); - } - vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { - return unpackRGBATo2Half( texture2D( shadow, uv ) ); - } - float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ - float occlusion = 1.0; - vec2 distribution = texture2DDistribution( shadow, uv ); - float hard_shadow = step( compare , distribution.x ); - if (hard_shadow != 1.0 ) { - float distance = compare - distribution.x ; - float variance = max( 0.00000, distribution.y * distribution.y ); - float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); - } - return occlusion; - } - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; - bool frustumTest = inFrustum && shadowCoord.z <= 1.0; - if ( frustumTest ) { - #if defined( SHADOWMAP_TYPE_PCF ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx0 = - texelSize.x * shadowRadius; - float dy0 = - texelSize.y * shadowRadius; - float dx1 = + texelSize.x * shadowRadius; - float dy1 = + texelSize.y * shadowRadius; - float dx2 = dx0 / 2.0; - float dy2 = dy0 / 2.0; - float dx3 = dx1 / 2.0; - float dy3 = dy1 / 2.0; - shadow = ( - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) - ) * ( 1.0 / 17.0 ); - #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx = texelSize.x; - float dy = texelSize.y; - vec2 uv = shadowCoord.xy; - vec2 f = fract( uv * shadowMapSize + 0.5 ); - uv -= f * texelSize; - shadow = ( - texture2DCompare( shadowMap, uv, shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), - f.x ), - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), - f.x ), - f.y ) - ) * ( 1.0 / 9.0 ); - #elif defined( SHADOWMAP_TYPE_VSM ) - shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); - #else - shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); - #endif - } - return mix( 1.0, shadow, shadowIntensity ); - } - vec2 cubeToUV( vec3 v, float texelSizeY ) { - vec3 absV = abs( v ); - float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); - absV *= scaleToCube; - v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); - vec2 planar = v.xy; - float almostATexel = 1.5 * texelSizeY; - float almostOne = 1.0 - almostATexel; - if ( absV.z >= almostOne ) { - if ( v.z > 0.0 ) - planar.x = 4.0 - v.x; - } else if ( absV.x >= almostOne ) { - float signX = sign( v.x ); - planar.x = v.z * signX + 2.0 * signX; - } else if ( absV.y >= almostOne ) { - float signY = sign( v.y ); - planar.x = v.x + 2.0 * signY + 2.0; - planar.y = v.z * signY - 2.0; - } - return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); - } - float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - float shadow = 1.0; - vec3 lightToPosition = shadowCoord.xyz; - - float lightToPositionLength = length( lightToPosition ); - if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { - float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; - vec3 bd3D = normalize( lightToPosition ); - vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); - #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) - vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; - shadow = ( - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) - ) * ( 1.0 / 9.0 ); - #else - shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); - #endif - } - return mix( 1.0, shadow, shadowIntensity ); - } -#endif`,yO=`#if NUM_SPOT_LIGHT_COORDS > 0 - uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; - varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; -#endif -#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - struct SpotLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowIntensity; - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,bO=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) - vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - vec4 shadowWorldPosition; -#endif -#if defined( USE_SHADOWMAP ) - #if NUM_DIR_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); - vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); - vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif -#endif -#if NUM_SPOT_LIGHT_COORDS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { - shadowWorldPosition = worldPosition; - #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; - #endif - vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end -#endif`,xO=`float getShadowMask() { - float shadow = 1.0; - #ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - directionalLight = directionalLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - spotLight = spotLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - pointLight = pointLightShadows[ i ]; - shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,MO=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,SO=`#ifdef USE_SKINNING - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - uniform highp sampler2D boneTexture; - mat4 getBoneMatrix( const in float i ) { - int size = textureSize( boneTexture, 0 ).x; - int j = int( i ) * 4; - int x = j % size; - int y = j / size; - vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); - vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); - vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); - vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); - return mat4( v1, v2, v3, v4 ); - } -#endif`,EO=`#ifdef USE_SKINNING - vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); - vec4 skinned = vec4( 0.0 ); - skinned += boneMatX * skinVertex * skinWeight.x; - skinned += boneMatY * skinVertex * skinWeight.y; - skinned += boneMatZ * skinVertex * skinWeight.z; - skinned += boneMatW * skinVertex * skinWeight.w; - transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,TO=`#ifdef USE_SKINNING - mat4 skinMatrix = mat4( 0.0 ); - skinMatrix += skinWeight.x * boneMatX; - skinMatrix += skinWeight.y * boneMatY; - skinMatrix += skinWeight.z * boneMatZ; - skinMatrix += skinWeight.w * boneMatW; - skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; - objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; - #ifdef USE_TANGENT - objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #endif -#endif`,wO=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,AO=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,CO=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,RO=`#ifndef saturate -#define saturate( a ) clamp( a, 0.0, 1.0 ) -#endif -uniform float toneMappingExposure; -vec3 LinearToneMapping( vec3 color ) { - return saturate( toneMappingExposure * color ); -} -vec3 ReinhardToneMapping( vec3 color ) { - color *= toneMappingExposure; - return saturate( color / ( vec3( 1.0 ) + color ) ); -} -vec3 CineonToneMapping( vec3 color ) { - color *= toneMappingExposure; - color = max( vec3( 0.0 ), color - 0.004 ); - return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); -} -vec3 RRTAndODTFit( vec3 v ) { - vec3 a = v * ( v + 0.0245786 ) - 0.000090537; - vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; - return a / b; -} -vec3 ACESFilmicToneMapping( vec3 color ) { - const mat3 ACESInputMat = mat3( - vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), - vec3( 0.04823, 0.01566, 0.83777 ) - ); - const mat3 ACESOutputMat = mat3( - vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), - vec3( -0.07367, -0.00605, 1.07602 ) - ); - color *= toneMappingExposure / 0.6; - color = ACESInputMat * color; - color = RRTAndODTFit( color ); - color = ACESOutputMat * color; - return saturate( color ); -} -const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( - vec3( 1.6605, - 0.1246, - 0.0182 ), - vec3( - 0.5876, 1.1329, - 0.1006 ), - vec3( - 0.0728, - 0.0083, 1.1187 ) -); -const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( - vec3( 0.6274, 0.0691, 0.0164 ), - vec3( 0.3293, 0.9195, 0.0880 ), - vec3( 0.0433, 0.0113, 0.8956 ) -); -vec3 agxDefaultContrastApprox( vec3 x ) { - vec3 x2 = x * x; - vec3 x4 = x2 * x2; - return + 15.5 * x4 * x2 - - 40.14 * x4 * x - + 31.96 * x4 - - 6.868 * x2 * x - + 0.4298 * x2 - + 0.1191 * x - - 0.00232; -} -vec3 AgXToneMapping( vec3 color ) { - const mat3 AgXInsetMatrix = mat3( - vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), - vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), - vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) - ); - const mat3 AgXOutsetMatrix = mat3( - vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), - vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), - vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) - ); - const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; - color *= toneMappingExposure; - color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; - color = AgXInsetMatrix * color; - color = max( color, 1e-10 ); color = log2( color ); - color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); - color = clamp( color, 0.0, 1.0 ); - color = agxDefaultContrastApprox( color ); - color = AgXOutsetMatrix * color; - color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); - color = LINEAR_REC2020_TO_LINEAR_SRGB * color; - color = clamp( color, 0.0, 1.0 ); - return color; -} -vec3 NeutralToneMapping( vec3 color ) { - const float StartCompression = 0.8 - 0.04; - const float Desaturation = 0.15; - color *= toneMappingExposure; - float x = min( color.r, min( color.g, color.b ) ); - float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; - color -= offset; - float peak = max( color.r, max( color.g, color.b ) ); - if ( peak < StartCompression ) return color; - float d = 1. - StartCompression; - float newPeak = 1. - d * d / ( peak + d - StartCompression ); - color *= newPeak / peak; - float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); - return mix( color, vec3( newPeak ), g ); -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,PO=`#ifdef USE_TRANSMISSION - material.transmission = transmission; - material.transmissionAlpha = 1.0; - material.thickness = thickness; - material.attenuationDistance = attenuationDistance; - material.attenuationColor = attenuationColor; - #ifdef USE_TRANSMISSIONMAP - material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; - #endif - #ifdef USE_THICKNESSMAP - material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; - #endif - vec3 pos = vWorldPosition; - vec3 v = normalize( cameraPosition - pos ); - vec3 n = inverseTransformDirection( normal, viewMatrix ); - vec4 transmitted = getIBLVolumeRefraction( - n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, - pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, - material.attenuationColor, material.attenuationDistance ); - material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); - totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); -#endif`,IO=`#ifdef USE_TRANSMISSION - uniform float transmission; - uniform float thickness; - uniform float attenuationDistance; - uniform vec3 attenuationColor; - #ifdef USE_TRANSMISSIONMAP - uniform sampler2D transmissionMap; - #endif - #ifdef USE_THICKNESSMAP - uniform sampler2D thicknessMap; - #endif - uniform vec2 transmissionSamplerSize; - uniform sampler2D transmissionSamplerMap; - uniform mat4 modelMatrix; - uniform mat4 projectionMatrix; - varying vec3 vWorldPosition; - float w0( float a ) { - return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); - } - float w1( float a ) { - return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); - } - float w2( float a ){ - return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); - } - float w3( float a ) { - return ( 1.0 / 6.0 ) * ( a * a * a ); - } - float g0( float a ) { - return w0( a ) + w1( a ); - } - float g1( float a ) { - return w2( a ) + w3( a ); - } - float h0( float a ) { - return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); - } - float h1( float a ) { - return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); - } - vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { - uv = uv * texelSize.zw + 0.5; - vec2 iuv = floor( uv ); - vec2 fuv = fract( uv ); - float g0x = g0( fuv.x ); - float g1x = g1( fuv.x ); - float h0x = h0( fuv.x ); - float h1x = h1( fuv.x ); - float h0y = h0( fuv.y ); - float h1y = h1( fuv.y ); - vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; - vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; - vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; - vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; - return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + - g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); - } - vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { - vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); - vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); - vec2 fLodSizeInv = 1.0 / fLodSize; - vec2 cLodSizeInv = 1.0 / cLodSize; - vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); - vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); - return mix( fSample, cSample, fract( lod ) ); - } - vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { - vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); - vec3 modelScale; - modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); - modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); - modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); - return normalize( refractionVector ) * thickness * modelScale; - } - float applyIorToRoughness( const in float roughness, const in float ior ) { - return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); - } - vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { - float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); - return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); - } - vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { - if ( isinf( attenuationDistance ) ) { - return vec3( 1.0 ); - } else { - vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; - vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; - } - } - vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, - const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, - const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, - const in vec3 attenuationColor, const in float attenuationDistance ) { - vec4 transmittedLight; - vec3 transmittance; - #ifdef USE_DISPERSION - float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; - vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); - for ( int i = 0; i < 3; i ++ ) { - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); - transmittedLight[ i ] = transmissionSample[ i ]; - transmittedLight.a += transmissionSample.a; - transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; - } - transmittedLight.a /= 3.0; - #else - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); - transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); - #endif - vec3 attenuatedColor = transmittance * transmittedLight.rgb; - vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); - float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; - return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); - } -#endif`,LO=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) - varying vec2 vUv; -#endif -#ifdef USE_MAP - varying vec2 vMapUv; -#endif -#ifdef USE_ALPHAMAP - varying vec2 vAlphaMapUv; -#endif -#ifdef USE_LIGHTMAP - varying vec2 vLightMapUv; -#endif -#ifdef USE_AOMAP - varying vec2 vAoMapUv; -#endif -#ifdef USE_BUMPMAP - varying vec2 vBumpMapUv; -#endif -#ifdef USE_NORMALMAP - varying vec2 vNormalMapUv; -#endif -#ifdef USE_EMISSIVEMAP - varying vec2 vEmissiveMapUv; -#endif -#ifdef USE_METALNESSMAP - varying vec2 vMetalnessMapUv; -#endif -#ifdef USE_ROUGHNESSMAP - varying vec2 vRoughnessMapUv; -#endif -#ifdef USE_ANISOTROPYMAP - varying vec2 vAnisotropyMapUv; -#endif -#ifdef USE_CLEARCOATMAP - varying vec2 vClearcoatMapUv; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - varying vec2 vClearcoatNormalMapUv; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - varying vec2 vClearcoatRoughnessMapUv; -#endif -#ifdef USE_IRIDESCENCEMAP - varying vec2 vIridescenceMapUv; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - varying vec2 vIridescenceThicknessMapUv; -#endif -#ifdef USE_SHEEN_COLORMAP - varying vec2 vSheenColorMapUv; -#endif -#ifdef USE_SHEEN_ROUGHNESSMAP - varying vec2 vSheenRoughnessMapUv; -#endif -#ifdef USE_SPECULARMAP - varying vec2 vSpecularMapUv; -#endif -#ifdef USE_SPECULAR_COLORMAP - varying vec2 vSpecularColorMapUv; -#endif -#ifdef USE_SPECULAR_INTENSITYMAP - varying vec2 vSpecularIntensityMapUv; -#endif -#ifdef USE_TRANSMISSIONMAP - uniform mat3 transmissionMapTransform; - varying vec2 vTransmissionMapUv; -#endif -#ifdef USE_THICKNESSMAP - uniform mat3 thicknessMapTransform; - varying vec2 vThicknessMapUv; -#endif`,DO=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) - varying vec2 vUv; -#endif -#ifdef USE_MAP - uniform mat3 mapTransform; - varying vec2 vMapUv; -#endif -#ifdef USE_ALPHAMAP - uniform mat3 alphaMapTransform; - varying vec2 vAlphaMapUv; -#endif -#ifdef USE_LIGHTMAP - uniform mat3 lightMapTransform; - varying vec2 vLightMapUv; -#endif -#ifdef USE_AOMAP - uniform mat3 aoMapTransform; - varying vec2 vAoMapUv; -#endif -#ifdef USE_BUMPMAP - uniform mat3 bumpMapTransform; - varying vec2 vBumpMapUv; -#endif -#ifdef USE_NORMALMAP - uniform mat3 normalMapTransform; - varying vec2 vNormalMapUv; -#endif -#ifdef USE_DISPLACEMENTMAP - uniform mat3 displacementMapTransform; - varying vec2 vDisplacementMapUv; -#endif -#ifdef USE_EMISSIVEMAP - uniform mat3 emissiveMapTransform; - varying vec2 vEmissiveMapUv; -#endif -#ifdef USE_METALNESSMAP - uniform mat3 metalnessMapTransform; - varying vec2 vMetalnessMapUv; -#endif -#ifdef USE_ROUGHNESSMAP - uniform mat3 roughnessMapTransform; - varying vec2 vRoughnessMapUv; -#endif -#ifdef USE_ANISOTROPYMAP - uniform mat3 anisotropyMapTransform; - varying vec2 vAnisotropyMapUv; -#endif -#ifdef USE_CLEARCOATMAP - uniform mat3 clearcoatMapTransform; - varying vec2 vClearcoatMapUv; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform mat3 clearcoatNormalMapTransform; - varying vec2 vClearcoatNormalMapUv; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform mat3 clearcoatRoughnessMapTransform; - varying vec2 vClearcoatRoughnessMapUv; -#endif -#ifdef USE_SHEEN_COLORMAP - uniform mat3 sheenColorMapTransform; - varying vec2 vSheenColorMapUv; -#endif -#ifdef USE_SHEEN_ROUGHNESSMAP - uniform mat3 sheenRoughnessMapTransform; - varying vec2 vSheenRoughnessMapUv; -#endif -#ifdef USE_IRIDESCENCEMAP - uniform mat3 iridescenceMapTransform; - varying vec2 vIridescenceMapUv; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - uniform mat3 iridescenceThicknessMapTransform; - varying vec2 vIridescenceThicknessMapUv; -#endif -#ifdef USE_SPECULARMAP - uniform mat3 specularMapTransform; - varying vec2 vSpecularMapUv; -#endif -#ifdef USE_SPECULAR_COLORMAP - uniform mat3 specularColorMapTransform; - varying vec2 vSpecularColorMapUv; -#endif -#ifdef USE_SPECULAR_INTENSITYMAP - uniform mat3 specularIntensityMapTransform; - varying vec2 vSpecularIntensityMapUv; -#endif -#ifdef USE_TRANSMISSIONMAP - uniform mat3 transmissionMapTransform; - varying vec2 vTransmissionMapUv; -#endif -#ifdef USE_THICKNESSMAP - uniform mat3 thicknessMapTransform; - varying vec2 vThicknessMapUv; -#endif`,OO=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) - vUv = vec3( uv, 1 ).xy; -#endif -#ifdef USE_MAP - vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; -#endif -#ifdef USE_ALPHAMAP - vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_LIGHTMAP - vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_AOMAP - vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_BUMPMAP - vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_NORMALMAP - vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_DISPLACEMENTMAP - vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_EMISSIVEMAP - vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_METALNESSMAP - vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_ROUGHNESSMAP - vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_ANISOTROPYMAP - vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_CLEARCOATMAP - vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_IRIDESCENCEMAP - vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SHEEN_COLORMAP - vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SHEEN_ROUGHNESSMAP - vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SPECULARMAP - vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SPECULAR_COLORMAP - vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SPECULAR_INTENSITYMAP - vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_TRANSMISSIONMAP - vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_THICKNESSMAP - vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; -#endif`,NO=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 - vec4 worldPosition = vec4( transformed, 1.0 ); - #ifdef USE_BATCHING - worldPosition = batchingMatrix * worldPosition; - #endif - #ifdef USE_INSTANCING - worldPosition = instanceMatrix * worldPosition; - #endif - worldPosition = modelMatrix * worldPosition; -#endif`;const UO=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,FO=`uniform sampler2D t2D; -uniform float backgroundIntensity; -varying vec2 vUv; -void main() { - vec4 texColor = texture2D( t2D, vUv ); - #ifdef DECODE_VIDEO_TEXTURE - texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); - #endif - texColor.rgb *= backgroundIntensity; - gl_FragColor = texColor; - #include - #include -}`,kO=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,BO=`#ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; -#elif defined( ENVMAP_TYPE_CUBE_UV ) - uniform sampler2D envMap; -#endif -uniform float flipEnvMap; -uniform float backgroundBlurriness; -uniform float backgroundIntensity; -uniform mat3 backgroundRotation; -varying vec3 vWorldDirection; -#include -void main() { - #ifdef ENVMAP_TYPE_CUBE - vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); - #else - vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - #endif - texColor.rgb *= backgroundIntensity; - gl_FragColor = texColor; - #include - #include -}`,zO=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,VO=`uniform samplerCube tCube; -uniform float tFlip; -uniform float opacity; -varying vec3 vWorldDirection; -void main() { - vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); - gl_FragColor = texColor; - gl_FragColor.a *= opacity; - #include - #include -}`,HO=`#include -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,GO=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - vec4 diffuseColor = vec4( 1.0 ); - #include - #if DEPTH_PACKING == 3200 - diffuseColor.a = opacity; - #endif - #include - #include - #include - #include - #include - float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; - #if DEPTH_PACKING == 3200 - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); - #elif DEPTH_PACKING == 3201 - gl_FragColor = packDepthToRGBA( fragCoordZ ); - #elif DEPTH_PACKING == 3202 - gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); - #elif DEPTH_PACKING == 3203 - gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); - #endif -}`,WO=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,XO=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -#include -#include -void main () { - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = packDepthToRGBA( dist ); -}`,$O=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,qO=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - gl_FragColor = texture2D( tEquirect, sampleUV ); - #include - #include -}`,YO=`uniform float scale; -attribute float lineDistance; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -#include -void main() { - vLineDistance = scale * lineDistance; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,jO=`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,KO=`#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,ZO=`uniform vec3 diffuse; -uniform float opacity; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - #ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); - reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; - #else - reflectedLight.indirectDiffuse += vec3( 1.0 ); - #endif - #include - reflectedLight.indirectDiffuse *= diffuseColor.rgb; - vec3 outgoingLight = reflectedLight.indirectDiffuse; - #include - #include - #include - #include - #include - #include - #include -}`,JO=`#define LAMBERT -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,QO=`#define LAMBERT -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include - #include -}`,eN=`#define MATCAP -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; -}`,tN=`#define MATCAP -uniform vec3 diffuse; -uniform float opacity; -uniform sampler2D matcap; -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; - #ifdef USE_MATCAP - vec4 matcapColor = texture2D( matcap, uv ); - #else - vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); - #endif - vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; - #include - #include - #include - #include - #include - #include -}`,nN=`#define NORMAL -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - varying vec3 vViewPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - vViewPosition = - mvPosition.xyz; -#endif -}`,iN=`#define NORMAL -uniform float opacity; -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - varying vec3 vViewPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); - #include - #include - #include - #include - gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); - #ifdef OPAQUE - gl_FragColor.a = 1.0; - #endif -}`,sN=`#define PHONG -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,rN=`#define PHONG -uniform vec3 diffuse; -uniform vec3 emissive; -uniform vec3 specular; -uniform float shininess; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include - #include -}`,oN=`#define STANDARD -varying vec3 vViewPosition; -#ifdef USE_TRANSMISSION - varying vec3 vWorldPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition.xyz; -#endif -}`,aN=`#define STANDARD -#ifdef PHYSICAL - #define IOR - #define USE_SPECULAR -#endif -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float roughness; -uniform float metalness; -uniform float opacity; -#ifdef IOR - uniform float ior; -#endif -#ifdef USE_SPECULAR - uniform float specularIntensity; - uniform vec3 specularColor; - #ifdef USE_SPECULAR_COLORMAP - uniform sampler2D specularColorMap; - #endif - #ifdef USE_SPECULAR_INTENSITYMAP - uniform sampler2D specularIntensityMap; - #endif -#endif -#ifdef USE_CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; -#endif -#ifdef USE_DISPERSION - uniform float dispersion; -#endif -#ifdef USE_IRIDESCENCE - uniform float iridescence; - uniform float iridescenceIOR; - uniform float iridescenceThicknessMinimum; - uniform float iridescenceThicknessMaximum; -#endif -#ifdef USE_SHEEN - uniform vec3 sheenColor; - uniform float sheenRoughness; - #ifdef USE_SHEEN_COLORMAP - uniform sampler2D sheenColorMap; - #endif - #ifdef USE_SHEEN_ROUGHNESSMAP - uniform sampler2D sheenRoughnessMap; - #endif -#endif -#ifdef USE_ANISOTROPY - uniform vec2 anisotropyVector; - #ifdef USE_ANISOTROPYMAP - uniform sampler2D anisotropyMap; - #endif -#endif -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; - #include - vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; - #ifdef USE_SHEEN - float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); - outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; - #endif - #ifdef USE_CLEARCOAT - float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); - vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); - outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; - #endif - #include - #include - #include - #include - #include - #include -}`,lN=`#define TOON -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,cN=`#define TOON -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include -}`,uN=`uniform float size; -uniform float scale; -#include -#include -#include -#include -#include -#include -#ifdef USE_POINTS_UV - varying vec2 vUv; - uniform mat3 uvTransform; -#endif -void main() { - #ifdef USE_POINTS_UV - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - #endif - #include - #include - #include - #include - #include - #include - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,fN=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,dN=`#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,hN=`uniform vec3 color; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); - #include - #include - #include -}`,pN=`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix[ 3 ]; - vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); - #ifndef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - #endif - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; - 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; - #include - #include - #include -}`,mN=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include -}`,lt={alphahash_fragment:FL,alphahash_pars_fragment:kL,alphamap_fragment:BL,alphamap_pars_fragment:zL,alphatest_fragment:VL,alphatest_pars_fragment:HL,aomap_fragment:GL,aomap_pars_fragment:WL,batching_pars_vertex:XL,batching_vertex:$L,begin_vertex:qL,beginnormal_vertex:YL,bsdfs:jL,iridescence_fragment:KL,bumpmap_pars_fragment:ZL,clipping_planes_fragment:JL,clipping_planes_pars_fragment:QL,clipping_planes_pars_vertex:eD,clipping_planes_vertex:tD,color_fragment:nD,color_pars_fragment:iD,color_pars_vertex:sD,color_vertex:rD,common:oD,cube_uv_reflection_fragment:aD,defaultnormal_vertex:lD,displacementmap_pars_vertex:cD,displacementmap_vertex:uD,emissivemap_fragment:fD,emissivemap_pars_fragment:dD,colorspace_fragment:hD,colorspace_pars_fragment:pD,envmap_fragment:mD,envmap_common_pars_fragment:gD,envmap_pars_fragment:_D,envmap_pars_vertex:vD,envmap_physical_pars_fragment:RD,envmap_vertex:yD,fog_vertex:bD,fog_pars_vertex:xD,fog_fragment:MD,fog_pars_fragment:SD,gradientmap_pars_fragment:ED,lightmap_pars_fragment:TD,lights_lambert_fragment:wD,lights_lambert_pars_fragment:AD,lights_pars_begin:CD,lights_toon_fragment:PD,lights_toon_pars_fragment:ID,lights_phong_fragment:LD,lights_phong_pars_fragment:DD,lights_physical_fragment:OD,lights_physical_pars_fragment:ND,lights_fragment_begin:UD,lights_fragment_maps:FD,lights_fragment_end:kD,logdepthbuf_fragment:BD,logdepthbuf_pars_fragment:zD,logdepthbuf_pars_vertex:VD,logdepthbuf_vertex:HD,map_fragment:GD,map_pars_fragment:WD,map_particle_fragment:XD,map_particle_pars_fragment:$D,metalnessmap_fragment:qD,metalnessmap_pars_fragment:YD,morphinstance_vertex:jD,morphcolor_vertex:KD,morphnormal_vertex:ZD,morphtarget_pars_vertex:JD,morphtarget_vertex:QD,normal_fragment_begin:eO,normal_fragment_maps:tO,normal_pars_fragment:nO,normal_pars_vertex:iO,normal_vertex:sO,normalmap_pars_fragment:rO,clearcoat_normal_fragment_begin:oO,clearcoat_normal_fragment_maps:aO,clearcoat_pars_fragment:lO,iridescence_pars_fragment:cO,opaque_fragment:uO,packing:fO,premultiplied_alpha_fragment:dO,project_vertex:hO,dithering_fragment:pO,dithering_pars_fragment:mO,roughnessmap_fragment:gO,roughnessmap_pars_fragment:_O,shadowmap_pars_fragment:vO,shadowmap_pars_vertex:yO,shadowmap_vertex:bO,shadowmask_pars_fragment:xO,skinbase_vertex:MO,skinning_pars_vertex:SO,skinning_vertex:EO,skinnormal_vertex:TO,specularmap_fragment:wO,specularmap_pars_fragment:AO,tonemapping_fragment:CO,tonemapping_pars_fragment:RO,transmission_fragment:PO,transmission_pars_fragment:IO,uv_pars_fragment:LO,uv_pars_vertex:DO,uv_vertex:OO,worldpos_vertex:NO,background_vert:UO,background_frag:FO,backgroundCube_vert:kO,backgroundCube_frag:BO,cube_vert:zO,cube_frag:VO,depth_vert:HO,depth_frag:GO,distanceRGBA_vert:WO,distanceRGBA_frag:XO,equirect_vert:$O,equirect_frag:qO,linedashed_vert:YO,linedashed_frag:jO,meshbasic_vert:KO,meshbasic_frag:ZO,meshlambert_vert:JO,meshlambert_frag:QO,meshmatcap_vert:eN,meshmatcap_frag:tN,meshnormal_vert:nN,meshnormal_frag:iN,meshphong_vert:sN,meshphong_frag:rN,meshphysical_vert:oN,meshphysical_frag:aN,meshtoon_vert:lN,meshtoon_frag:cN,points_vert:uN,points_frag:fN,shadow_vert:dN,shadow_frag:hN,sprite_vert:pN,sprite_frag:mN},we={common:{diffuse:{value:new Ce(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new st},alphaMap:{value:null},alphaMapTransform:{value:new st},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new st}},envmap:{envMap:{value:null},envMapRotation:{value:new st},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new st}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new st}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new st},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new st},normalScale:{value:new de(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new st},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new st}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new st}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new st}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ce(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ce(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new st},alphaTest:{value:0},uvTransform:{value:new st}},sprite:{diffuse:{value:new Ce(16777215)},opacity:{value:1},center:{value:new de(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new st},alphaMap:{value:null},alphaMapTransform:{value:new st},alphaTest:{value:0}}},Ri={basic:{uniforms:In([we.common,we.specularmap,we.envmap,we.aomap,we.lightmap,we.fog]),vertexShader:lt.meshbasic_vert,fragmentShader:lt.meshbasic_frag},lambert:{uniforms:In([we.common,we.specularmap,we.envmap,we.aomap,we.lightmap,we.emissivemap,we.bumpmap,we.normalmap,we.displacementmap,we.fog,we.lights,{emissive:{value:new Ce(0)}}]),vertexShader:lt.meshlambert_vert,fragmentShader:lt.meshlambert_frag},phong:{uniforms:In([we.common,we.specularmap,we.envmap,we.aomap,we.lightmap,we.emissivemap,we.bumpmap,we.normalmap,we.displacementmap,we.fog,we.lights,{emissive:{value:new Ce(0)},specular:{value:new Ce(1118481)},shininess:{value:30}}]),vertexShader:lt.meshphong_vert,fragmentShader:lt.meshphong_frag},standard:{uniforms:In([we.common,we.envmap,we.aomap,we.lightmap,we.emissivemap,we.bumpmap,we.normalmap,we.displacementmap,we.roughnessmap,we.metalnessmap,we.fog,we.lights,{emissive:{value:new Ce(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:lt.meshphysical_vert,fragmentShader:lt.meshphysical_frag},toon:{uniforms:In([we.common,we.aomap,we.lightmap,we.emissivemap,we.bumpmap,we.normalmap,we.displacementmap,we.gradientmap,we.fog,we.lights,{emissive:{value:new Ce(0)}}]),vertexShader:lt.meshtoon_vert,fragmentShader:lt.meshtoon_frag},matcap:{uniforms:In([we.common,we.bumpmap,we.normalmap,we.displacementmap,we.fog,{matcap:{value:null}}]),vertexShader:lt.meshmatcap_vert,fragmentShader:lt.meshmatcap_frag},points:{uniforms:In([we.points,we.fog]),vertexShader:lt.points_vert,fragmentShader:lt.points_frag},dashed:{uniforms:In([we.common,we.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:lt.linedashed_vert,fragmentShader:lt.linedashed_frag},depth:{uniforms:In([we.common,we.displacementmap]),vertexShader:lt.depth_vert,fragmentShader:lt.depth_frag},normal:{uniforms:In([we.common,we.bumpmap,we.normalmap,we.displacementmap,{opacity:{value:1}}]),vertexShader:lt.meshnormal_vert,fragmentShader:lt.meshnormal_frag},sprite:{uniforms:In([we.sprite,we.fog]),vertexShader:lt.sprite_vert,fragmentShader:lt.sprite_frag},background:{uniforms:{uvTransform:{value:new st},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:lt.background_vert,fragmentShader:lt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new st}},vertexShader:lt.backgroundCube_vert,fragmentShader:lt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:lt.cube_vert,fragmentShader:lt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:lt.equirect_vert,fragmentShader:lt.equirect_frag},distanceRGBA:{uniforms:In([we.common,we.displacementmap,{referencePosition:{value:new B},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:lt.distanceRGBA_vert,fragmentShader:lt.distanceRGBA_frag},shadow:{uniforms:In([we.lights,we.fog,{color:{value:new Ce(0)},opacity:{value:1}}]),vertexShader:lt.shadow_vert,fragmentShader:lt.shadow_frag}};Ri.physical={uniforms:In([Ri.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new st},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new st},clearcoatNormalScale:{value:new de(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new st},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new st},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new st},sheen:{value:0},sheenColor:{value:new Ce(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new st},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new st},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new st},transmissionSamplerSize:{value:new de},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new st},attenuationDistance:{value:0},attenuationColor:{value:new Ce(0)},specularColor:{value:new Ce(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new st},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new st},anisotropyVector:{value:new de},anisotropyMap:{value:null},anisotropyMapTransform:{value:new st}}]),vertexShader:lt.meshphysical_vert,fragmentShader:lt.meshphysical_frag};const Ku={r:0,b:0,g:0},jr=new li,gN=new Ye;function _N(n,e,t,i,s,r,o){const a=new Ce(0);let l=r===!0?0:1,c,u,f=null,d=0,h=null;function p(b){let v=b.isScene===!0?b.background:null;return v&&v.isTexture&&(v=(b.backgroundBlurriness>0?t:e).get(v)),v}function _(b){let v=!1;const T=p(b);T===null?m(a,l):T&&T.isColor&&(m(T,1),v=!0);const E=n.xr.getEnvironmentBlendMode();E==="additive"?i.buffers.color.setClear(0,0,0,1,o):E==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||v)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function g(b,v){const T=p(v);T&&(T.isCubeTexture||T.mapping===Na)?(u===void 0&&(u=new $t(new Ao(1,1,1),new ki({name:"BackgroundCubeMaterial",uniforms:Ta(Ri.backgroundCube.uniforms),vertexShader:Ri.backgroundCube.vertexShader,fragmentShader:Ri.backgroundCube.fragmentShader,side:zn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(E,S,P){this.matrixWorld.copyPosition(P.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(u)),jr.copy(v.backgroundRotation),jr.x*=-1,jr.y*=-1,jr.z*=-1,T.isCubeTexture&&T.isRenderTargetTexture===!1&&(jr.y*=-1,jr.z*=-1),u.material.uniforms.envMap.value=T,u.material.uniforms.flipEnvMap.value=T.isCubeTexture&&T.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(gN.makeRotationFromEuler(jr)),u.material.toneMapped=ft.getTransfer(T.colorSpace)!==wt,(f!==T||d!==T.version||h!==n.toneMapping)&&(u.material.needsUpdate=!0,f=T,d=T.version,h=n.toneMapping),u.layers.enableAll(),b.unshift(u,u.geometry,u.material,0,0,null)):T&&T.isTexture&&(c===void 0&&(c=new $t(new Ba(2,2),new ki({name:"BackgroundMaterial",uniforms:Ta(Ri.background.uniforms),vertexShader:Ri.background.vertexShader,fragmentShader:Ri.background.fragmentShader,side:Os,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(c)),c.material.uniforms.t2D.value=T,c.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,c.material.toneMapped=ft.getTransfer(T.colorSpace)!==wt,T.matrixAutoUpdate===!0&&T.updateMatrix(),c.material.uniforms.uvTransform.value.copy(T.matrix),(f!==T||d!==T.version||h!==n.toneMapping)&&(c.material.needsUpdate=!0,f=T,d=T.version,h=n.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null))}function m(b,v){b.getRGB(Ku,nE(n)),i.buffers.color.setClear(Ku.r,Ku.g,Ku.b,v,o)}function y(){u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return a},setClearColor:function(b,v=1){a.set(b),l=v,m(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,m(a,l)},render:_,addToRenderList:g,dispose:y}}function vN(n,e){const t=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},s=d(null);let r=s,o=!1;function a(M,L,F,H,Y){let ee=!1;const K=f(H,F,L);r!==K&&(r=K,c(r.object)),ee=h(M,H,F,Y),ee&&p(M,H,F,Y),Y!==null&&e.update(Y,n.ELEMENT_ARRAY_BUFFER),(ee||o)&&(o=!1,v(M,L,F,H),Y!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get(Y).buffer))}function l(){return n.createVertexArray()}function c(M){return n.bindVertexArray(M)}function u(M){return n.deleteVertexArray(M)}function f(M,L,F){const H=F.wireframe===!0;let Y=i[M.id];Y===void 0&&(Y={},i[M.id]=Y);let ee=Y[L.id];ee===void 0&&(ee={},Y[L.id]=ee);let K=ee[H];return K===void 0&&(K=d(l()),ee[H]=K),K}function d(M){const L=[],F=[],H=[];for(let Y=0;Y=0){const be=Y[Z];let se=ee[Z];if(se===void 0&&(Z==="instanceMatrix"&&M.instanceMatrix&&(se=M.instanceMatrix),Z==="instanceColor"&&M.instanceColor&&(se=M.instanceColor)),be===void 0||be.attribute!==se||se&&be.data!==se.data)return!0;K++}return r.attributesNum!==K||r.index!==H}function p(M,L,F,H){const Y={},ee=L.attributes;let K=0;const Q=F.getAttributes();for(const Z in Q)if(Q[Z].location>=0){let be=ee[Z];be===void 0&&(Z==="instanceMatrix"&&M.instanceMatrix&&(be=M.instanceMatrix),Z==="instanceColor"&&M.instanceColor&&(be=M.instanceColor));const se={};se.attribute=be,be&&be.data&&(se.data=be.data),Y[Z]=se,K++}r.attributes=Y,r.attributesNum=K,r.index=H}function _(){const M=r.newAttributes;for(let L=0,F=M.length;L=0){let he=Y[Q];if(he===void 0&&(Q==="instanceMatrix"&&M.instanceMatrix&&(he=M.instanceMatrix),Q==="instanceColor"&&M.instanceColor&&(he=M.instanceColor)),he!==void 0){const be=he.normalized,se=he.itemSize,ye=e.get(he);if(ye===void 0)continue;const He=ye.buffer,re=ye.type,ge=ye.bytesPerElement,xe=re===n.INT||re===n.UNSIGNED_INT||he.gpuType===sh;if(he.isInterleavedBufferAttribute){const X=he.data,ae=X.stride,fe=he.offset;if(X.isInstancedInterleavedBuffer){for(let ce=0;ce0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";S="mediump"}return S==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=t.precision!==void 0?t.precision:"highp";const u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const f=t.logarithmicDepthBuffer===!0,d=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),h=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),p=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=n.getParameter(n.MAX_TEXTURE_SIZE),g=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),m=n.getParameter(n.MAX_VERTEX_ATTRIBS),y=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),b=n.getParameter(n.MAX_VARYING_VECTORS),v=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),T=p>0,E=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:f,reverseDepthBuffer:d,maxTextures:h,maxVertexTextures:p,maxTextureSize:_,maxCubemapSize:g,maxAttributes:m,maxVertexUniforms:y,maxVaryings:b,maxFragmentUniforms:v,vertexTextures:T,maxSamples:E}}function xN(n){const e=this;let t=null,i=0,s=!1,r=!1;const o=new or,a=new st,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,d){const h=f.length!==0||d||i!==0||s;return s=d,i=f.length,h},this.beginShadows=function(){r=!0,u(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(f,d){t=u(f,d,0)},this.setState=function(f,d,h){const p=f.clippingPlanes,_=f.clipIntersection,g=f.clipShadows,m=n.get(f);if(!s||p===null||p.length===0||r&&!g)r?u(null):c();else{const y=r?0:i,b=y*4;let v=m.clippingState||null;l.value=v,v=u(p,d,b,h);for(let T=0;T!==b;++T)v[T]=t[T];m.clippingState=v,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(f,d,h,p){const _=f!==null?f.length:0;let g=null;if(_!==0){if(g=l.value,p!==!0||g===null){const m=h+_*4,y=d.matrixWorldInverse;a.getNormalMatrix(y),(g===null||g.length0){const c=new rE(l.height);return c.fromEquirectangularTexture(n,o),e.set(o,c),o.addEventListener("dispose",s),t(c.texture,o.mapping)}else return null}}return o}function s(o){const a=o.target;a.removeEventListener("dispose",s);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function r(){e=new WeakMap}return{get:i,dispose:r}}const la=4,ub=[.125,.215,.35,.446,.526,.582],so=20,Qp=new Dh,fb=new Ce;let em=null,tm=0,nm=0,im=!1;const to=(1+Math.sqrt(5))/2,Qo=1/to,db=[new B(-to,Qo,0),new B(to,Qo,0),new B(-Qo,0,to),new B(Qo,0,to),new B(0,to,-Qo),new B(0,to,Qo),new B(-1,1,-1),new B(1,1,-1),new B(-1,1,1),new B(1,1,1)],SN=new B;class xg{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,s=100,r={}){const{size:o=256,position:a=SN}=r;em=this._renderer.getRenderTarget(),tm=this._renderer.getActiveCubeFace(),nm=this._renderer.getActiveMipmapLevel(),im=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(o);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,i,s,l,a),t>0&&this._blur(l,0,0,t),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=mb(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=pb(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?v:0,v,v),f.setRenderTarget(s),g&&f.render(_,l),f.render(e,l)}_.geometry.dispose(),_.material.dispose(),f.toneMapping=h,f.autoClear=d,e.background=m}_textureToCubeUV(e,t){const i=this._renderer,s=e.mapping===Ns||e.mapping===_r;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=mb()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=pb());const r=s?this._cubemapMaterial:this._equirectMaterial,o=new $t(this._lodPlanes[0],r),a=r.uniforms;a.envMap.value=e;const l=this._cubeSize;Zu(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,Qp)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;const s=this._lodPlanes.length;for(let r=1;rso&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${so}`);const m=[];let y=0;for(let S=0;Sb-la?s-b+la:0),E=4*(this._cubeSize-v);Zu(t,T,E,3*v,2*v),l.setRenderTarget(t),l.render(f,Qp)}}function EN(n){const e=[],t=[],i=[];let s=n;const r=n-la+1+ub.length;for(let o=0;on-la?l=ub[o-n+la-1]:o===0&&(l=0),i.push(l);const c=1/(a-2),u=-c,f=1+c,d=[u,u,f,u,f,f,u,u,f,f,u,f],h=6,p=6,_=3,g=2,m=1,y=new Float32Array(_*p*h),b=new Float32Array(g*p*h),v=new Float32Array(m*p*h);for(let E=0;E2?0:-1,x=[S,P,0,S+2/3,P,0,S+2/3,P+1,0,S,P,0,S+2/3,P+1,0,S,P+1,0];y.set(x,_*p*E),b.set(d,g*p*E);const M=[E,E,E,E,E,E];v.set(M,m*p*E)}const T=new ct;T.setAttribute("position",new Ct(y,_)),T.setAttribute("uv",new Ct(b,g)),T.setAttribute("faceIndex",new Ct(v,m)),e.push(T),s>la&&s--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function hb(n,e,t){const i=new ss(n,e,t);return i.texture.mapping=Na,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Zu(n,e,t,i,s){n.viewport.set(e,t,i,s),n.scissor.set(e,t,i,s)}function TN(n,e,t){const i=new Float32Array(so),s=new B(0,1,0);return new ki({name:"SphericalGaussianBlur",defines:{n:so,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:M_(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - } - `,blending:Ps,depthTest:!1,depthWrite:!1})}function pb(){return new ki({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:M_(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - - #include - - void main() { - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); - - } - `,blending:Ps,depthTest:!1,depthWrite:!1})}function mb(){return new ki({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:M_(),fragmentShader:` - - precision mediump float; - precision mediump int; - - uniform float flipEnvMap; - - varying vec3 vOutputDirection; - - uniform samplerCube envMap; - - void main() { - - gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); - - } - `,blending:Ps,depthTest:!1,depthWrite:!1})}function M_(){return` - - precision mediump float; - precision mediump int; - - attribute float faceIndex; - - varying vec3 vOutputDirection; - - // RH coordinate system; PMREM face-indexing convention - vec3 getDirection( vec2 uv, float face ) { - - uv = 2.0 * uv - 1.0; - - vec3 direction = vec3( uv, 1.0 ); - - if ( face == 0.0 ) { - - direction = direction.zyx; // ( 1, v, u ) pos x - - } else if ( face == 1.0 ) { - - direction = direction.xzy; - direction.xz *= -1.0; // ( -u, 1, -v ) pos y - - } else if ( face == 2.0 ) { - - direction.x *= -1.0; // ( -u, v, 1 ) pos z - - } else if ( face == 3.0 ) { - - direction = direction.zyx; - direction.xz *= -1.0; // ( -1, v, -u ) neg x - - } else if ( face == 4.0 ) { - - direction = direction.xzy; - direction.xy *= -1.0; // ( -u, -1, v ) neg y - - } else if ( face == 5.0 ) { - - direction.z *= -1.0; // ( u, v, -1 ) neg z - - } - - return direction; - - } - - void main() { - - vOutputDirection = getDirection( uv, faceIndex ); - gl_Position = vec4( position, 1.0 ); - - } - `}function wN(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const l=a.mapping,c=l===ec||l===tc,u=l===Ns||l===_r;if(c||u){let f=e.get(a);const d=f!==void 0?f.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==d)return t===null&&(t=new xg(n)),f=c?t.fromEquirectangular(a,f):t.fromCubemap(a,f),f.texture.pmremVersion=a.pmremVersion,e.set(a,f),f.texture;if(f!==void 0)return f.texture;{const h=a.image;return c&&h&&h.height>0||u&&h&&s(h)?(t===null&&(t=new xg(n)),f=c?t.fromEquirectangular(a):t.fromCubemap(a),f.texture.pmremVersion=a.pmremVersion,e.set(a,f),a.addEventListener("dispose",r),f.texture):null}}}return a}function s(a){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(T=Math.ceil(v/e.maxTextureSize),v=e.maxTextureSize);const E=new Float32Array(v*T*4*f),S=new Uc(E,v,T,f);S.type=Kn,S.needsUpdate=!0;const P=b*4;for(let M=0;M0)return n;const s=e*t;let r=_b[s];if(r===void 0&&(r=new Float32Array(s),_b[s]=r),e!==0){i.toArray(r,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(r,a)}return r}function sn(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t":" "} ${a}: ${t[o]}`)}return i.join(` -`)}const Eb=new st;function wU(n){ft._getMatrix(Eb,ft.workingColorSpace,n);const e=`mat3( ${Eb.elements.map(t=>t.toFixed(4))} )`;switch(ft.getTransfer(n)){case oc:return[e,"LinearTransferOETF"];case wt:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",n),[e,"LinearTransferOETF"]}}function Tb(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),s=n.getShaderInfoLog(e).trim();if(i&&s==="")return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const o=parseInt(r[1]);return t.toUpperCase()+` - -`+s+` - -`+TU(n.getShaderSource(e),o)}else return s}function AU(n,e){const t=wU(e);return[`vec4 ${n}( vec4 value ) {`,` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(` -`)}function CU(n,e){let t;switch(e){case L1:t="Linear";break;case D1:t="Reinhard";break;case O1:t="Cineon";break;case nh:t="ACESFilmic";break;case U1:t="AgX";break;case F1:t="Neutral";break;case N1:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const Ju=new B;function RU(){ft.getLuminanceCoefficients(Ju);const n=Ju.x.toFixed(4),e=Ju.y.toFixed(4),t=Ju.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${n}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(` -`)}function PU(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(ml).join(` -`)}function IU(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` -`)}function LU(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let s=0;s/gm;function Mg(n){return n.replace(DU,NU)}const OU=new Map;function NU(n,e){let t=lt[e];if(t===void 0){const i=OU.get(e);if(i!==void 0)t=lt[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return Mg(t)}const UU=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Cb(n){return n.replace(UU,FU)}function FU(n,e,t,i){let s="";for(let r=parseInt(e);r0&&(g+=` -`),m=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p].filter(ml).join(` -`),m.length>0&&(m+=` -`)):(g=[Rb(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(ml).join(` -`),m=[Rb(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+f:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Zi?"#define TONE_MAPPING":"",t.toneMapping!==Zi?lt.tonemapping_pars_fragment:"",t.toneMapping!==Zi?CU("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",lt.colorspace_pars_fragment,AU("linearToOutputTexel",t.outputColorSpace),RU(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` -`].filter(ml).join(` -`)),o=Mg(o),o=wb(o,t),o=Ab(o,t),a=Mg(a),a=wb(a,t),a=Ab(a,t),o=Cb(o),a=Cb(a),t.isRawShaderMaterial!==!0&&(y=`#version 300 es -`,g=[h,"#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+g,m=["#define varying in",t.glslVersion===hg?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===hg?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` -`)+` -`+m);const b=y+g+o,v=y+m+a,T=Sb(s,s.VERTEX_SHADER,b),E=Sb(s,s.FRAGMENT_SHADER,v);s.attachShader(_,T),s.attachShader(_,E),t.index0AttributeName!==void 0?s.bindAttribLocation(_,0,t.index0AttributeName):t.morphTargets===!0&&s.bindAttribLocation(_,0,"position"),s.linkProgram(_);function S(L){if(n.debug.checkShaderErrors){const F=s.getProgramInfoLog(_).trim(),H=s.getShaderInfoLog(T).trim(),Y=s.getShaderInfoLog(E).trim();let ee=!0,K=!0;if(s.getProgramParameter(_,s.LINK_STATUS)===!1)if(ee=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(s,_,T,E);else{const Q=Tb(s,T,"vertex"),Z=Tb(s,E,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(_,s.VALIDATE_STATUS)+` - -Material Name: `+L.name+` -Material Type: `+L.type+` - -Program Info Log: `+F+` -`+Q+` -`+Z)}else F!==""?console.warn("THREE.WebGLProgram: Program Info Log:",F):(H===""||Y==="")&&(K=!1);K&&(L.diagnostics={runnable:ee,programLog:F,vertexShader:{log:H,prefix:g},fragmentShader:{log:Y,prefix:m}})}s.deleteShader(T),s.deleteShader(E),P=new Sf(s,_),x=LU(s,_)}let P;this.getUniforms=function(){return P===void 0&&S(this),P};let x;this.getAttributes=function(){return x===void 0&&S(this),x};let M=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=s.getProgramParameter(_,SU)),M},this.destroy=function(){i.releaseStatesOfProgram(this),s.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=EU++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=T,this.fragmentShader=E,this}let WU=0;class XU{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,s=this._getShaderStage(t),r=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(s)===!1&&(o.add(s),s.usedTimes++),o.has(r)===!1&&(o.add(r),r.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new $U(e),t.set(e,i)),i}}class $U{constructor(e){this.id=WU++,this.code=e,this.usedTimes=0}}function qU(n,e,t,i,s,r,o){const a=new hh,l=new XU,c=new Set,u=[],f=s.logarithmicDepthBuffer,d=s.vertexTextures;let h=s.precision;const p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function _(x){return c.add(x),x===0?"uv":`uv${x}`}function g(x,M,L,F,H){const Y=F.fog,ee=H.geometry,K=x.isMeshStandardMaterial?F.environment:null,Q=(x.isMeshStandardMaterial?t:e).get(x.envMap||K),Z=Q&&Q.mapping===Na?Q.image.height:null,he=p[x.type];x.precision!==null&&(h=s.getMaxPrecision(x.precision),h!==x.precision&&console.warn("THREE.WebGLProgram.getParameters:",x.precision,"not supported, using",h,"instead."));const be=ee.morphAttributes.position||ee.morphAttributes.normal||ee.morphAttributes.color,se=be!==void 0?be.length:0;let ye=0;ee.morphAttributes.position!==void 0&&(ye=1),ee.morphAttributes.normal!==void 0&&(ye=2),ee.morphAttributes.color!==void 0&&(ye=3);let He,re,ge,xe;if(he){const Tt=Ri[he];He=Tt.vertexShader,re=Tt.fragmentShader}else He=x.vertexShader,re=x.fragmentShader,l.update(x),ge=l.getVertexShaderID(x),xe=l.getFragmentShaderID(x);const X=n.getRenderTarget(),ae=n.state.buffers.depth.getReversed(),fe=H.isInstancedMesh===!0,ce=H.isBatchedMesh===!0,Ue=!!x.map,k=!!x.matcap,z=!!Q,R=!!x.aoMap,te=!!x.lightMap,G=!!x.bumpMap,W=!!x.normalMap,C=!!x.displacementMap,I=!!x.emissiveMap,N=!!x.metalnessMap,A=!!x.roughnessMap,w=x.anisotropy>0,U=x.clearcoat>0,O=x.dispersion>0,V=x.iridescence>0,$=x.sheen>0,ue=x.transmission>0,le=w&&!!x.anisotropyMap,Me=U&&!!x.clearcoatMap,Be=U&&!!x.clearcoatNormalMap,me=U&&!!x.clearcoatRoughnessMap,Te=V&&!!x.iridescenceMap,Ve=V&&!!x.iridescenceThicknessMap,We=$&&!!x.sheenColorMap,Se=$&&!!x.sheenRoughnessMap,Je=!!x.specularMap,it=!!x.specularColorMap,Lt=!!x.specularIntensityMap,q=ue&&!!x.transmissionMap,Pe=ue&&!!x.thicknessMap,oe=!!x.gradientMap,pe=!!x.alphaMap,Le=x.alphaTest>0,Ie=!!x.alphaHash,ot=!!x.extensions;let Vt=Zi;x.toneMapped&&(X===null||X.isXRRenderTarget===!0)&&(Vt=n.toneMapping);const vn={shaderID:he,shaderType:x.type,shaderName:x.name,vertexShader:He,fragmentShader:re,defines:x.defines,customVertexShaderID:ge,customFragmentShaderID:xe,isRawShaderMaterial:x.isRawShaderMaterial===!0,glslVersion:x.glslVersion,precision:h,batching:ce,batchingColor:ce&&H._colorsTexture!==null,instancing:fe,instancingColor:fe&&H.instanceColor!==null,instancingMorph:fe&&H.morphTexture!==null,supportsVertexTextures:d,outputColorSpace:X===null?n.outputColorSpace:X.isXRRenderTarget===!0?X.texture.colorSpace:Mo,alphaToCoverage:!!x.alphaToCoverage,map:Ue,matcap:k,envMap:z,envMapMode:z&&Q.mapping,envMapCubeUVHeight:Z,aoMap:R,lightMap:te,bumpMap:G,normalMap:W,displacementMap:d&&C,emissiveMap:I,normalMapObjectSpace:W&&x.normalMapType===W1,normalMapTangentSpace:W&&x.normalMapType===Tr,metalnessMap:N,roughnessMap:A,anisotropy:w,anisotropyMap:le,clearcoat:U,clearcoatMap:Me,clearcoatNormalMap:Be,clearcoatRoughnessMap:me,dispersion:O,iridescence:V,iridescenceMap:Te,iridescenceThicknessMap:Ve,sheen:$,sheenColorMap:We,sheenRoughnessMap:Se,specularMap:Je,specularColorMap:it,specularIntensityMap:Lt,transmission:ue,transmissionMap:q,thicknessMap:Pe,gradientMap:oe,opaque:x.transparent===!1&&x.blending===po&&x.alphaToCoverage===!1,alphaMap:pe,alphaTest:Le,alphaHash:Ie,combine:x.combine,mapUv:Ue&&_(x.map.channel),aoMapUv:R&&_(x.aoMap.channel),lightMapUv:te&&_(x.lightMap.channel),bumpMapUv:G&&_(x.bumpMap.channel),normalMapUv:W&&_(x.normalMap.channel),displacementMapUv:C&&_(x.displacementMap.channel),emissiveMapUv:I&&_(x.emissiveMap.channel),metalnessMapUv:N&&_(x.metalnessMap.channel),roughnessMapUv:A&&_(x.roughnessMap.channel),anisotropyMapUv:le&&_(x.anisotropyMap.channel),clearcoatMapUv:Me&&_(x.clearcoatMap.channel),clearcoatNormalMapUv:Be&&_(x.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:me&&_(x.clearcoatRoughnessMap.channel),iridescenceMapUv:Te&&_(x.iridescenceMap.channel),iridescenceThicknessMapUv:Ve&&_(x.iridescenceThicknessMap.channel),sheenColorMapUv:We&&_(x.sheenColorMap.channel),sheenRoughnessMapUv:Se&&_(x.sheenRoughnessMap.channel),specularMapUv:Je&&_(x.specularMap.channel),specularColorMapUv:it&&_(x.specularColorMap.channel),specularIntensityMapUv:Lt&&_(x.specularIntensityMap.channel),transmissionMapUv:q&&_(x.transmissionMap.channel),thicknessMapUv:Pe&&_(x.thicknessMap.channel),alphaMapUv:pe&&_(x.alphaMap.channel),vertexTangents:!!ee.attributes.tangent&&(W||w),vertexColors:x.vertexColors,vertexAlphas:x.vertexColors===!0&&!!ee.attributes.color&&ee.attributes.color.itemSize===4,pointsUvs:H.isPoints===!0&&!!ee.attributes.uv&&(Ue||pe),fog:!!Y,useFog:x.fog===!0,fogExp2:!!Y&&Y.isFogExp2,flatShading:x.flatShading===!0,sizeAttenuation:x.sizeAttenuation===!0,logarithmicDepthBuffer:f,reverseDepthBuffer:ae,skinning:H.isSkinnedMesh===!0,morphTargets:ee.morphAttributes.position!==void 0,morphNormals:ee.morphAttributes.normal!==void 0,morphColors:ee.morphAttributes.color!==void 0,morphTargetsCount:se,morphTextureStride:ye,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:x.dithering,shadowMapEnabled:n.shadowMap.enabled&&L.length>0,shadowMapType:n.shadowMap.type,toneMapping:Vt,decodeVideoTexture:Ue&&x.map.isVideoTexture===!0&&ft.getTransfer(x.map.colorSpace)===wt,decodeVideoTextureEmissive:I&&x.emissiveMap.isVideoTexture===!0&&ft.getTransfer(x.emissiveMap.colorSpace)===wt,premultipliedAlpha:x.premultipliedAlpha,doubleSided:x.side===Pi,flipSided:x.side===zn,useDepthPacking:x.depthPacking>=0,depthPacking:x.depthPacking||0,index0AttributeName:x.index0AttributeName,extensionClipCullDistance:ot&&x.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(ot&&x.extensions.multiDraw===!0||ce)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:x.customProgramCacheKey()};return vn.vertexUv1s=c.has(1),vn.vertexUv2s=c.has(2),vn.vertexUv3s=c.has(3),c.clear(),vn}function m(x){const M=[];if(x.shaderID?M.push(x.shaderID):(M.push(x.customVertexShaderID),M.push(x.customFragmentShaderID)),x.defines!==void 0)for(const L in x.defines)M.push(L),M.push(x.defines[L]);return x.isRawShaderMaterial===!1&&(y(M,x),b(M,x),M.push(n.outputColorSpace)),M.push(x.customProgramCacheKey),M.join()}function y(x,M){x.push(M.precision),x.push(M.outputColorSpace),x.push(M.envMapMode),x.push(M.envMapCubeUVHeight),x.push(M.mapUv),x.push(M.alphaMapUv),x.push(M.lightMapUv),x.push(M.aoMapUv),x.push(M.bumpMapUv),x.push(M.normalMapUv),x.push(M.displacementMapUv),x.push(M.emissiveMapUv),x.push(M.metalnessMapUv),x.push(M.roughnessMapUv),x.push(M.anisotropyMapUv),x.push(M.clearcoatMapUv),x.push(M.clearcoatNormalMapUv),x.push(M.clearcoatRoughnessMapUv),x.push(M.iridescenceMapUv),x.push(M.iridescenceThicknessMapUv),x.push(M.sheenColorMapUv),x.push(M.sheenRoughnessMapUv),x.push(M.specularMapUv),x.push(M.specularColorMapUv),x.push(M.specularIntensityMapUv),x.push(M.transmissionMapUv),x.push(M.thicknessMapUv),x.push(M.combine),x.push(M.fogExp2),x.push(M.sizeAttenuation),x.push(M.morphTargetsCount),x.push(M.morphAttributeCount),x.push(M.numDirLights),x.push(M.numPointLights),x.push(M.numSpotLights),x.push(M.numSpotLightMaps),x.push(M.numHemiLights),x.push(M.numRectAreaLights),x.push(M.numDirLightShadows),x.push(M.numPointLightShadows),x.push(M.numSpotLightShadows),x.push(M.numSpotLightShadowsWithMaps),x.push(M.numLightProbes),x.push(M.shadowMapType),x.push(M.toneMapping),x.push(M.numClippingPlanes),x.push(M.numClipIntersection),x.push(M.depthPacking)}function b(x,M){a.disableAll(),M.supportsVertexTextures&&a.enable(0),M.instancing&&a.enable(1),M.instancingColor&&a.enable(2),M.instancingMorph&&a.enable(3),M.matcap&&a.enable(4),M.envMap&&a.enable(5),M.normalMapObjectSpace&&a.enable(6),M.normalMapTangentSpace&&a.enable(7),M.clearcoat&&a.enable(8),M.iridescence&&a.enable(9),M.alphaTest&&a.enable(10),M.vertexColors&&a.enable(11),M.vertexAlphas&&a.enable(12),M.vertexUv1s&&a.enable(13),M.vertexUv2s&&a.enable(14),M.vertexUv3s&&a.enable(15),M.vertexTangents&&a.enable(16),M.anisotropy&&a.enable(17),M.alphaHash&&a.enable(18),M.batching&&a.enable(19),M.dispersion&&a.enable(20),M.batchingColor&&a.enable(21),x.push(a.mask),a.disableAll(),M.fog&&a.enable(0),M.useFog&&a.enable(1),M.flatShading&&a.enable(2),M.logarithmicDepthBuffer&&a.enable(3),M.reverseDepthBuffer&&a.enable(4),M.skinning&&a.enable(5),M.morphTargets&&a.enable(6),M.morphNormals&&a.enable(7),M.morphColors&&a.enable(8),M.premultipliedAlpha&&a.enable(9),M.shadowMapEnabled&&a.enable(10),M.doubleSided&&a.enable(11),M.flipSided&&a.enable(12),M.useDepthPacking&&a.enable(13),M.dithering&&a.enable(14),M.transmission&&a.enable(15),M.sheen&&a.enable(16),M.opaque&&a.enable(17),M.pointsUvs&&a.enable(18),M.decodeVideoTexture&&a.enable(19),M.decodeVideoTextureEmissive&&a.enable(20),M.alphaToCoverage&&a.enable(21),x.push(a.mask)}function v(x){const M=p[x.type];let L;if(M){const F=Ri[M];L=iE.clone(F.uniforms)}else L=x.uniforms;return L}function T(x,M){let L;for(let F=0,H=u.length;F0?i.push(m):h.transparent===!0?s.push(m):t.push(m)}function l(f,d,h,p,_,g){const m=o(f,d,h,p,_,g);h.transmission>0?i.unshift(m):h.transparent===!0?s.unshift(m):t.unshift(m)}function c(f,d){t.length>1&&t.sort(f||jU),i.length>1&&i.sort(d||Pb),s.length>1&&s.sort(d||Pb)}function u(){for(let f=e,d=n.length;f=r.length?(o=new Ib,r.push(o)):o=r[s],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function ZU(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new B,color:new Ce};break;case"SpotLight":t={position:new B,direction:new B,color:new Ce,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new B,color:new Ce,distance:0,decay:0};break;case"HemisphereLight":t={direction:new B,skyColor:new Ce,groundColor:new Ce};break;case"RectAreaLight":t={color:new Ce,position:new B,halfWidth:new B,halfHeight:new B};break}return n[e.id]=t,t}}}function JU(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new de};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new de};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new de,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let QU=0;function eF(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function tF(n){const e=new ZU,t=JU(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)i.probe.push(new B);const s=new B,r=new Ye,o=new Ye;function a(c){let u=0,f=0,d=0;for(let x=0;x<9;x++)i.probe[x].set(0,0,0);let h=0,p=0,_=0,g=0,m=0,y=0,b=0,v=0,T=0,E=0,S=0;c.sort(eF);for(let x=0,M=c.length;x0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=we.LTC_FLOAT_1,i.rectAreaLTC2=we.LTC_FLOAT_2):(i.rectAreaLTC1=we.LTC_HALF_1,i.rectAreaLTC2=we.LTC_HALF_2)),i.ambient[0]=u,i.ambient[1]=f,i.ambient[2]=d;const P=i.hash;(P.directionalLength!==h||P.pointLength!==p||P.spotLength!==_||P.rectAreaLength!==g||P.hemiLength!==m||P.numDirectionalShadows!==y||P.numPointShadows!==b||P.numSpotShadows!==v||P.numSpotMaps!==T||P.numLightProbes!==S)&&(i.directional.length=h,i.spot.length=_,i.rectArea.length=g,i.point.length=p,i.hemi.length=m,i.directionalShadow.length=y,i.directionalShadowMap.length=y,i.pointShadow.length=b,i.pointShadowMap.length=b,i.spotShadow.length=v,i.spotShadowMap.length=v,i.directionalShadowMatrix.length=y,i.pointShadowMatrix.length=b,i.spotLightMatrix.length=v+T-E,i.spotLightMap.length=T,i.numSpotLightShadowsWithMaps=E,i.numLightProbes=S,P.directionalLength=h,P.pointLength=p,P.spotLength=_,P.rectAreaLength=g,P.hemiLength=m,P.numDirectionalShadows=y,P.numPointShadows=b,P.numSpotShadows=v,P.numSpotMaps=T,P.numLightProbes=S,i.version=QU++)}function l(c,u){let f=0,d=0,h=0,p=0,_=0;const g=u.matrixWorldInverse;for(let m=0,y=c.length;m=o.length?(a=new Lb(n),o.push(a)):a=o[r],a}function i(){e=new WeakMap}return{get:t,dispose:i}}const iF=`void main() { - gl_Position = vec4( position, 1.0 ); -}`,sF=`uniform sampler2D shadow_pass; -uniform vec2 resolution; -uniform float radius; -#include -void main() { - const float samples = float( VSM_SAMPLES ); - float mean = 0.0; - float squared_mean = 0.0; - float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); - float uvStart = samples <= 1.0 ? 0.0 : - 1.0; - for ( float i = 0.0; i < samples; i ++ ) { - float uvOffset = uvStart + i * uvStride; - #ifdef HORIZONTAL_PASS - vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); - mean += distribution.x; - squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; - #else - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); - mean += depth; - squared_mean += depth * depth; - #endif - } - mean = mean / samples; - squared_mean = squared_mean / samples; - float std_dev = sqrt( squared_mean - mean * mean ); - gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function rF(n,e,t){let i=new Bc;const s=new de,r=new de,o=new gt,a=new u_({depthPacking:G1}),l=new f_,c={},u=t.maxTextureSize,f={[Os]:zn,[zn]:Os,[Pi]:Pi},d=new ki({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new de},radius:{value:4}},vertexShader:iF,fragmentShader:sF}),h=d.clone();h.defines.HORIZONTAL_PASS=1;const p=new ct;p.setAttribute("position",new Ct(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new $t(p,d),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=N0;let m=this.type;this.render=function(E,S,P){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||E.length===0)return;const x=n.getRenderTarget(),M=n.getActiveCubeFace(),L=n.getActiveMipmapLevel(),F=n.state;F.setBlending(Ps),F.buffers.color.setClear(1,1,1,1),F.buffers.depth.setTest(!0),F.setScissorTest(!1);const H=m!==$i&&this.type===$i,Y=m===$i&&this.type!==$i;for(let ee=0,K=E.length;eeu||s.y>u)&&(s.x>u&&(r.x=Math.floor(u/he.x),s.x=r.x*he.x,Z.mapSize.x=r.x),s.y>u&&(r.y=Math.floor(u/he.y),s.y=r.y*he.y,Z.mapSize.y=r.y)),Z.map===null||H===!0||Y===!0){const se=this.type!==$i?{minFilter:gn,magFilter:gn}:{};Z.map!==null&&Z.map.dispose(),Z.map=new ss(s.x,s.y,se),Z.map.texture.name=Q.name+".shadowMap",Z.camera.updateProjectionMatrix()}n.setRenderTarget(Z.map),n.clear();const be=Z.getViewportCount();for(let se=0;se0||S.map&&S.alphaTest>0){const F=M.uuid,H=S.uuid;let Y=c[F];Y===void 0&&(Y={},c[F]=Y);let ee=Y[H];ee===void 0&&(ee=M.clone(),Y[H]=ee,S.addEventListener("dispose",T)),M=ee}if(M.visible=S.visible,M.wireframe=S.wireframe,x===$i?M.side=S.shadowSide!==null?S.shadowSide:S.side:M.side=S.shadowSide!==null?S.shadowSide:f[S.side],M.alphaMap=S.alphaMap,M.alphaTest=S.alphaTest,M.map=S.map,M.clipShadows=S.clipShadows,M.clippingPlanes=S.clippingPlanes,M.clipIntersection=S.clipIntersection,M.displacementMap=S.displacementMap,M.displacementScale=S.displacementScale,M.displacementBias=S.displacementBias,M.wireframeLinewidth=S.wireframeLinewidth,M.linewidth=S.linewidth,P.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const F=n.properties.get(M);F.light=P}return M}function v(E,S,P,x,M){if(E.visible===!1)return;if(E.layers.test(S.layers)&&(E.isMesh||E.isLine||E.isPoints)&&(E.castShadow||E.receiveShadow&&M===$i)&&(!E.frustumCulled||i.intersectsObject(E))){E.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,E.matrixWorld);const H=e.update(E),Y=E.material;if(Array.isArray(Y)){const ee=H.groups;for(let K=0,Q=ee.length;K=1):Z.indexOf("OpenGL ES")!==-1&&(Q=parseFloat(/^OpenGL ES (\d)/.exec(Z)[1]),K=Q>=2);let he=null,be={};const se=n.getParameter(n.SCISSOR_BOX),ye=n.getParameter(n.VIEWPORT),He=new gt().fromArray(se),re=new gt().fromArray(ye);function ge(q,Pe,oe,pe){const Le=new Uint8Array(4),Ie=n.createTexture();n.bindTexture(q,Ie),n.texParameteri(q,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(q,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let ot=0;ot"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new de,u=new WeakMap;let f;const d=new WeakMap;let h=!1;try{h=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function p(A,w){return h?new OffscreenCanvas(A,w):cc("canvas")}function _(A,w,U){let O=1;const V=N(A);if((V.width>U||V.height>U)&&(O=U/Math.max(V.width,V.height)),O<1)if(typeof HTMLImageElement<"u"&&A instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&A instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&A instanceof ImageBitmap||typeof VideoFrame<"u"&&A instanceof VideoFrame){const $=Math.floor(O*V.width),ue=Math.floor(O*V.height);f===void 0&&(f=p($,ue));const le=w?p($,ue):f;return le.width=$,le.height=ue,le.getContext("2d").drawImage(A,0,0,$,ue),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+V.width+"x"+V.height+") to ("+$+"x"+ue+")."),le}else return"data"in A&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+V.width+"x"+V.height+")."),A;return A}function g(A){return A.generateMipmaps}function m(A){n.generateMipmap(A)}function y(A){return A.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:A.isWebGL3DRenderTarget?n.TEXTURE_3D:A.isWebGLArrayRenderTarget||A.isCompressedArrayTexture?n.TEXTURE_2D_ARRAY:n.TEXTURE_2D}function b(A,w,U,O,V=!1){if(A!==null){if(n[A]!==void 0)return n[A];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+A+"'")}let $=w;if(w===n.RED&&(U===n.FLOAT&&($=n.R32F),U===n.HALF_FLOAT&&($=n.R16F),U===n.UNSIGNED_BYTE&&($=n.R8)),w===n.RED_INTEGER&&(U===n.UNSIGNED_BYTE&&($=n.R8UI),U===n.UNSIGNED_SHORT&&($=n.R16UI),U===n.UNSIGNED_INT&&($=n.R32UI),U===n.BYTE&&($=n.R8I),U===n.SHORT&&($=n.R16I),U===n.INT&&($=n.R32I)),w===n.RG&&(U===n.FLOAT&&($=n.RG32F),U===n.HALF_FLOAT&&($=n.RG16F),U===n.UNSIGNED_BYTE&&($=n.RG8)),w===n.RG_INTEGER&&(U===n.UNSIGNED_BYTE&&($=n.RG8UI),U===n.UNSIGNED_SHORT&&($=n.RG16UI),U===n.UNSIGNED_INT&&($=n.RG32UI),U===n.BYTE&&($=n.RG8I),U===n.SHORT&&($=n.RG16I),U===n.INT&&($=n.RG32I)),w===n.RGB_INTEGER&&(U===n.UNSIGNED_BYTE&&($=n.RGB8UI),U===n.UNSIGNED_SHORT&&($=n.RGB16UI),U===n.UNSIGNED_INT&&($=n.RGB32UI),U===n.BYTE&&($=n.RGB8I),U===n.SHORT&&($=n.RGB16I),U===n.INT&&($=n.RGB32I)),w===n.RGBA_INTEGER&&(U===n.UNSIGNED_BYTE&&($=n.RGBA8UI),U===n.UNSIGNED_SHORT&&($=n.RGBA16UI),U===n.UNSIGNED_INT&&($=n.RGBA32UI),U===n.BYTE&&($=n.RGBA8I),U===n.SHORT&&($=n.RGBA16I),U===n.INT&&($=n.RGBA32I)),w===n.RGB&&U===n.UNSIGNED_INT_5_9_9_9_REV&&($=n.RGB9_E5),w===n.RGBA){const ue=V?oc:ft.getTransfer(O);U===n.FLOAT&&($=n.RGBA32F),U===n.HALF_FLOAT&&($=n.RGBA16F),U===n.UNSIGNED_BYTE&&($=ue===wt?n.SRGB8_ALPHA8:n.RGBA8),U===n.UNSIGNED_SHORT_4_4_4_4&&($=n.RGBA4),U===n.UNSIGNED_SHORT_5_5_5_1&&($=n.RGB5_A1)}return($===n.R16F||$===n.R32F||$===n.RG16F||$===n.RG32F||$===n.RGBA16F||$===n.RGBA32F)&&e.get("EXT_color_buffer_float"),$}function v(A,w){let U;return A?w===null||w===Us||w===xa?U=n.DEPTH24_STENCIL8:w===Kn?U=n.DEPTH32F_STENCIL8:w===ba&&(U=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):w===null||w===Us||w===xa?U=n.DEPTH_COMPONENT24:w===Kn?U=n.DEPTH_COMPONENT32F:w===ba&&(U=n.DEPTH_COMPONENT16),U}function T(A,w){return g(A)===!0||A.isFramebufferTexture&&A.minFilter!==gn&&A.minFilter!==en?Math.log2(Math.max(w.width,w.height))+1:A.mipmaps!==void 0&&A.mipmaps.length>0?A.mipmaps.length:A.isCompressedTexture&&Array.isArray(A.image)?w.mipmaps.length:1}function E(A){const w=A.target;w.removeEventListener("dispose",E),P(w),w.isVideoTexture&&u.delete(w)}function S(A){const w=A.target;w.removeEventListener("dispose",S),M(w)}function P(A){const w=i.get(A);if(w.__webglInit===void 0)return;const U=A.source,O=d.get(U);if(O){const V=O[w.__cacheKey];V.usedTimes--,V.usedTimes===0&&x(A),Object.keys(O).length===0&&d.delete(U)}i.remove(A)}function x(A){const w=i.get(A);n.deleteTexture(w.__webglTexture);const U=A.source,O=d.get(U);delete O[w.__cacheKey],o.memory.textures--}function M(A){const w=i.get(A);if(A.depthTexture&&(A.depthTexture.dispose(),i.remove(A.depthTexture)),A.isWebGLCubeRenderTarget)for(let O=0;O<6;O++){if(Array.isArray(w.__webglFramebuffer[O]))for(let V=0;V=s.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+A+" texture units while this GPU supports only "+s.maxTextures),L+=1,A}function Y(A){const w=[];return w.push(A.wrapS),w.push(A.wrapT),w.push(A.wrapR||0),w.push(A.magFilter),w.push(A.minFilter),w.push(A.anisotropy),w.push(A.internalFormat),w.push(A.format),w.push(A.type),w.push(A.generateMipmaps),w.push(A.premultiplyAlpha),w.push(A.flipY),w.push(A.unpackAlignment),w.push(A.colorSpace),w.join()}function ee(A,w){const U=i.get(A);if(A.isVideoTexture&&C(A),A.isRenderTargetTexture===!1&&A.version>0&&U.__version!==A.version){const O=A.image;if(O===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(O.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{re(U,A,w);return}}t.bindTexture(n.TEXTURE_2D,U.__webglTexture,n.TEXTURE0+w)}function K(A,w){const U=i.get(A);if(A.version>0&&U.__version!==A.version){re(U,A,w);return}t.bindTexture(n.TEXTURE_2D_ARRAY,U.__webglTexture,n.TEXTURE0+w)}function Q(A,w){const U=i.get(A);if(A.version>0&&U.__version!==A.version){re(U,A,w);return}t.bindTexture(n.TEXTURE_3D,U.__webglTexture,n.TEXTURE0+w)}function Z(A,w){const U=i.get(A);if(A.version>0&&U.__version!==A.version){ge(U,A,w);return}t.bindTexture(n.TEXTURE_CUBE_MAP,U.__webglTexture,n.TEXTURE0+w)}const he={[nc]:n.REPEAT,[gi]:n.CLAMP_TO_EDGE,[ic]:n.MIRRORED_REPEAT},be={[gn]:n.NEAREST,[F0]:n.NEAREST_MIPMAP_NEAREST,[ra]:n.NEAREST_MIPMAP_LINEAR,[en]:n.LINEAR,[Ml]:n.LINEAR_MIPMAP_NEAREST,[ji]:n.LINEAR_MIPMAP_LINEAR},se={[X1]:n.NEVER,[Z1]:n.ALWAYS,[$1]:n.LESS,[Y0]:n.LEQUAL,[q1]:n.EQUAL,[K1]:n.GEQUAL,[Y1]:n.GREATER,[j1]:n.NOTEQUAL};function ye(A,w){if(w.type===Kn&&e.has("OES_texture_float_linear")===!1&&(w.magFilter===en||w.magFilter===Ml||w.magFilter===ra||w.magFilter===ji||w.minFilter===en||w.minFilter===Ml||w.minFilter===ra||w.minFilter===ji)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(A,n.TEXTURE_WRAP_S,he[w.wrapS]),n.texParameteri(A,n.TEXTURE_WRAP_T,he[w.wrapT]),(A===n.TEXTURE_3D||A===n.TEXTURE_2D_ARRAY)&&n.texParameteri(A,n.TEXTURE_WRAP_R,he[w.wrapR]),n.texParameteri(A,n.TEXTURE_MAG_FILTER,be[w.magFilter]),n.texParameteri(A,n.TEXTURE_MIN_FILTER,be[w.minFilter]),w.compareFunction&&(n.texParameteri(A,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(A,n.TEXTURE_COMPARE_FUNC,se[w.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(w.magFilter===gn||w.minFilter!==ra&&w.minFilter!==ji||w.type===Kn&&e.has("OES_texture_float_linear")===!1)return;if(w.anisotropy>1||i.get(w).__currentAnisotropy){const U=e.get("EXT_texture_filter_anisotropic");n.texParameterf(A,U.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(w.anisotropy,s.getMaxAnisotropy())),i.get(w).__currentAnisotropy=w.anisotropy}}}function He(A,w){let U=!1;A.__webglInit===void 0&&(A.__webglInit=!0,w.addEventListener("dispose",E));const O=w.source;let V=d.get(O);V===void 0&&(V={},d.set(O,V));const $=Y(w);if($!==A.__cacheKey){V[$]===void 0&&(V[$]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,U=!0),V[$].usedTimes++;const ue=V[A.__cacheKey];ue!==void 0&&(V[A.__cacheKey].usedTimes--,ue.usedTimes===0&&x(w)),A.__cacheKey=$,A.__webglTexture=V[$].texture}return U}function re(A,w,U){let O=n.TEXTURE_2D;(w.isDataArrayTexture||w.isCompressedArrayTexture)&&(O=n.TEXTURE_2D_ARRAY),w.isData3DTexture&&(O=n.TEXTURE_3D);const V=He(A,w),$=w.source;t.bindTexture(O,A.__webglTexture,n.TEXTURE0+U);const ue=i.get($);if($.version!==ue.__version||V===!0){t.activeTexture(n.TEXTURE0+U);const le=ft.getPrimaries(ft.workingColorSpace),Me=w.colorSpace===Ss?null:ft.getPrimaries(w.colorSpace),Be=w.colorSpace===Ss||le===Me?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,w.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,w.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,w.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Be);let me=_(w.image,!1,s.maxTextureSize);me=I(w,me);const Te=r.convert(w.format,w.colorSpace),Ve=r.convert(w.type);let We=b(w.internalFormat,Te,Ve,w.colorSpace,w.isVideoTexture);ye(O,w);let Se;const Je=w.mipmaps,it=w.isVideoTexture!==!0,Lt=ue.__version===void 0||V===!0,q=$.dataReady,Pe=T(w,me);if(w.isDepthTexture)We=v(w.format===Sa,w.type),Lt&&(it?t.texStorage2D(n.TEXTURE_2D,1,We,me.width,me.height):t.texImage2D(n.TEXTURE_2D,0,We,me.width,me.height,0,Te,Ve,null));else if(w.isDataTexture)if(Je.length>0){it&&Lt&&t.texStorage2D(n.TEXTURE_2D,Pe,We,Je[0].width,Je[0].height);for(let oe=0,pe=Je.length;oe0){const Le=bg(Se.width,Se.height,w.format,w.type);for(const Ie of w.layerUpdates){const ot=Se.data.subarray(Ie*Le/Se.data.BYTES_PER_ELEMENT,(Ie+1)*Le/Se.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,Ie,Se.width,Se.height,1,Te,ot)}w.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,0,Se.width,Se.height,me.depth,Te,Se.data)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,oe,We,Se.width,Se.height,me.depth,0,Se.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else it?q&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,0,Se.width,Se.height,me.depth,Te,Ve,Se.data):t.texImage3D(n.TEXTURE_2D_ARRAY,oe,We,Se.width,Se.height,me.depth,0,Te,Ve,Se.data)}else{it&&Lt&&t.texStorage2D(n.TEXTURE_2D,Pe,We,Je[0].width,Je[0].height);for(let oe=0,pe=Je.length;oe0){const oe=bg(me.width,me.height,w.format,w.type);for(const pe of w.layerUpdates){const Le=me.data.subarray(pe*oe/me.data.BYTES_PER_ELEMENT,(pe+1)*oe/me.data.BYTES_PER_ELEMENT);t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,pe,me.width,me.height,1,Te,Ve,Le)}w.clearLayerUpdates()}else t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,me.width,me.height,me.depth,Te,Ve,me.data)}else t.texImage3D(n.TEXTURE_2D_ARRAY,0,We,me.width,me.height,me.depth,0,Te,Ve,me.data);else if(w.isData3DTexture)it?(Lt&&t.texStorage3D(n.TEXTURE_3D,Pe,We,me.width,me.height,me.depth),q&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,me.width,me.height,me.depth,Te,Ve,me.data)):t.texImage3D(n.TEXTURE_3D,0,We,me.width,me.height,me.depth,0,Te,Ve,me.data);else if(w.isFramebufferTexture){if(Lt)if(it)t.texStorage2D(n.TEXTURE_2D,Pe,We,me.width,me.height);else{let oe=me.width,pe=me.height;for(let Le=0;Le>=1,pe>>=1}}else if(Je.length>0){if(it&&Lt){const oe=N(Je[0]);t.texStorage2D(n.TEXTURE_2D,Pe,We,oe.width,oe.height)}for(let oe=0,pe=Je.length;oe0&&Pe++;const pe=N(Te[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,Pe,Je,pe.width,pe.height)}for(let pe=0;pe<6;pe++)if(me){it?q&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+pe,0,0,0,Te[pe].width,Te[pe].height,We,Se,Te[pe].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+pe,0,Je,Te[pe].width,Te[pe].height,0,We,Se,Te[pe].data);for(let Le=0;Le>$),Ve=Math.max(1,w.height>>$);V===n.TEXTURE_3D||V===n.TEXTURE_2D_ARRAY?t.texImage3D(V,$,Me,Te,Ve,w.depth,0,ue,le,null):t.texImage2D(V,$,Me,Te,Ve,0,ue,le,null)}t.bindFramebuffer(n.FRAMEBUFFER,A),W(w)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,O,V,me.__webglTexture,0,G(w)):(V===n.TEXTURE_2D||V>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&V<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,O,V,me.__webglTexture,$),t.bindFramebuffer(n.FRAMEBUFFER,null)}function X(A,w,U){if(n.bindRenderbuffer(n.RENDERBUFFER,A),w.depthBuffer){const O=w.depthTexture,V=O&&O.isDepthTexture?O.type:null,$=v(w.stencilBuffer,V),ue=w.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,le=G(w);W(w)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,le,$,w.width,w.height):U?n.renderbufferStorageMultisample(n.RENDERBUFFER,le,$,w.width,w.height):n.renderbufferStorage(n.RENDERBUFFER,$,w.width,w.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,ue,n.RENDERBUFFER,A)}else{const O=w.textures;for(let V=0;V{delete w.__boundDepthTexture,delete w.__depthDisposeCallback,O.removeEventListener("dispose",V)};O.addEventListener("dispose",V),w.__depthDisposeCallback=V}w.__boundDepthTexture=O}if(A.depthTexture&&!w.__autoAllocateDepthBuffer){if(U)throw new Error("target.depthTexture not supported in Cube render targets");ae(w.__webglFramebuffer,A)}else if(U){w.__webglDepthbuffer=[];for(let O=0;O<6;O++)if(t.bindFramebuffer(n.FRAMEBUFFER,w.__webglFramebuffer[O]),w.__webglDepthbuffer[O]===void 0)w.__webglDepthbuffer[O]=n.createRenderbuffer(),X(w.__webglDepthbuffer[O],A,!1);else{const V=A.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,$=w.__webglDepthbuffer[O];n.bindRenderbuffer(n.RENDERBUFFER,$),n.framebufferRenderbuffer(n.FRAMEBUFFER,V,n.RENDERBUFFER,$)}}else if(t.bindFramebuffer(n.FRAMEBUFFER,w.__webglFramebuffer),w.__webglDepthbuffer===void 0)w.__webglDepthbuffer=n.createRenderbuffer(),X(w.__webglDepthbuffer,A,!1);else{const O=A.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,V=w.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,V),n.framebufferRenderbuffer(n.FRAMEBUFFER,O,n.RENDERBUFFER,V)}t.bindFramebuffer(n.FRAMEBUFFER,null)}function ce(A,w,U){const O=i.get(A);w!==void 0&&xe(O.__webglFramebuffer,A,A.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),U!==void 0&&fe(A)}function Ue(A){const w=A.texture,U=i.get(A),O=i.get(w);A.addEventListener("dispose",S);const V=A.textures,$=A.isWebGLCubeRenderTarget===!0,ue=V.length>1;if(ue||(O.__webglTexture===void 0&&(O.__webglTexture=n.createTexture()),O.__version=w.version,o.memory.textures++),$){U.__webglFramebuffer=[];for(let le=0;le<6;le++)if(w.mipmaps&&w.mipmaps.length>0){U.__webglFramebuffer[le]=[];for(let Me=0;Me0){U.__webglFramebuffer=[];for(let le=0;le0&&W(A)===!1){U.__webglMultisampledFramebuffer=n.createFramebuffer(),U.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,U.__webglMultisampledFramebuffer);for(let le=0;le0)for(let Me=0;Me0)for(let Me=0;Me0){if(W(A)===!1){const w=A.textures,U=A.width,O=A.height;let V=n.COLOR_BUFFER_BIT;const $=A.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ue=i.get(A),le=w.length>1;if(le)for(let Me=0;Me0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&w.__useRenderToTexture!==!1}function C(A){const w=o.render.frame;u.get(A)!==w&&(u.set(A,w),A.update())}function I(A,w){const U=A.colorSpace,O=A.format,V=A.type;return A.isCompressedTexture===!0||A.isVideoTexture===!0||U!==Mo&&U!==Ss&&(ft.getTransfer(U)===wt?(O!==Bn||V!==is)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",U)),w}function N(A){return typeof HTMLImageElement<"u"&&A instanceof HTMLImageElement?(c.width=A.naturalWidth||A.width,c.height=A.naturalHeight||A.height):typeof VideoFrame<"u"&&A instanceof VideoFrame?(c.width=A.displayWidth,c.height=A.displayHeight):(c.width=A.width,c.height=A.height),c}this.allocateTextureUnit=H,this.resetTextureUnits=F,this.setTexture2D=ee,this.setTexture2DArray=K,this.setTexture3D=Q,this.setTextureCube=Z,this.rebindTextures=ce,this.setupRenderTarget=Ue,this.updateRenderTargetMipmap=k,this.updateMultisampleRenderTarget=te,this.setupDepthRenderbuffer=fe,this.setupFrameBufferTexture=xe,this.useMultisampledRTT=W}function lT(n,e){function t(i,s=Ss){let r;const o=ft.getTransfer(s);if(i===is)return n.UNSIGNED_BYTE;if(i===rh)return n.UNSIGNED_SHORT_4_4_4_4;if(i===oh)return n.UNSIGNED_SHORT_5_5_5_1;if(i===z0)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===k0)return n.BYTE;if(i===B0)return n.SHORT;if(i===ba)return n.UNSIGNED_SHORT;if(i===sh)return n.INT;if(i===Us)return n.UNSIGNED_INT;if(i===Kn)return n.FLOAT;if(i===Ua)return n.HALF_FLOAT;if(i===V0)return n.ALPHA;if(i===H0)return n.RGB;if(i===Bn)return n.RGBA;if(i===G0)return n.LUMINANCE;if(i===W0)return n.LUMINANCE_ALPHA;if(i===Ma)return n.DEPTH_COMPONENT;if(i===Sa)return n.DEPTH_STENCIL;if(i===ah)return n.RED;if(i===Nc)return n.RED_INTEGER;if(i===X0)return n.RG;if(i===lh)return n.RG_INTEGER;if(i===ch)return n.RGBA_INTEGER;if(i===Sl||i===El||i===Tl||i===wl)if(o===wt)if(r=e.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(i===Sl)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===El)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===Tl)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===wl)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=e.get("WEBGL_compressed_texture_s3tc"),r!==null){if(i===Sl)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===El)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===Tl)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===wl)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===Kf||i===Zf||i===Jf||i===Qf)if(r=e.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(i===Kf)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===Zf)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===Jf)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===Qf)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===ed||i===td||i===nd)if(r=e.get("WEBGL_compressed_texture_etc"),r!==null){if(i===ed||i===td)return o===wt?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(i===nd)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===id||i===sd||i===rd||i===od||i===ad||i===ld||i===cd||i===ud||i===fd||i===dd||i===hd||i===pd||i===md||i===gd)if(r=e.get("WEBGL_compressed_texture_astc"),r!==null){if(i===id)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===sd)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===rd)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===od)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===ad)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===ld)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===cd)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===ud)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===fd)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===dd)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===hd)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===pd)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===md)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===gd)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===Al||i===_d||i===vd)if(r=e.get("EXT_texture_compression_bptc"),r!==null){if(i===Al)return o===wt?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===_d)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===vd)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===$0||i===yd||i===bd||i===xd)if(r=e.get("EXT_texture_compression_rgtc"),r!==null){if(i===Al)return r.COMPRESSED_RED_RGTC1_EXT;if(i===yd)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===bd)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===xd)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===xa?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:t}}const cF=` -void main() { - - gl_Position = vec4( position, 1.0 ); - -}`,uF=` -uniform sampler2DArray depthColor; -uniform float depthWidth; -uniform float depthHeight; - -void main() { - - vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); - - if ( coord.x >= 1.0 ) { - - gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; - - } else { - - gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; - - } - -}`;class fF{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){const s=new Wt,r=e.properties.get(s);r.__webglTexture=t.texture,(t.depthNear!==i.depthNear||t.depthFar!==i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=s}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,i=new ki({vertexShader:cF,fragmentShader:uF,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new $t(new Ba(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class dF extends rs{constructor(e,t){super();const i=this;let s=null,r=1,o=null,a="local-floor",l=1,c=null,u=null,f=null,d=null,h=null,p=null;const _=new fF,g=t.getContextAttributes();let m=null,y=null;const b=[],v=[],T=new de;let E=null;const S=new Kt;S.viewport=new gt;const P=new Kt;P.viewport=new gt;const x=[S,P],M=new ZE;let L=null,F=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(re){let ge=b[re];return ge===void 0&&(ge=new Mf,b[re]=ge),ge.getTargetRaySpace()},this.getControllerGrip=function(re){let ge=b[re];return ge===void 0&&(ge=new Mf,b[re]=ge),ge.getGripSpace()},this.getHand=function(re){let ge=b[re];return ge===void 0&&(ge=new Mf,b[re]=ge),ge.getHandSpace()};function H(re){const ge=v.indexOf(re.inputSource);if(ge===-1)return;const xe=b[ge];xe!==void 0&&(xe.update(re.inputSource,re.frame,c||o),xe.dispatchEvent({type:re.type,data:re.inputSource}))}function Y(){s.removeEventListener("select",H),s.removeEventListener("selectstart",H),s.removeEventListener("selectend",H),s.removeEventListener("squeeze",H),s.removeEventListener("squeezestart",H),s.removeEventListener("squeezeend",H),s.removeEventListener("end",Y),s.removeEventListener("inputsourceschange",ee);for(let re=0;re=0&&(v[X]=null,b[X].disconnect(xe))}for(let ge=0;ge=v.length){v.push(xe),X=fe;break}else if(v[fe]===null){v[fe]=xe,X=fe;break}if(X===-1)break}const ae=b[X];ae&&ae.connect(xe)}}const K=new B,Q=new B;function Z(re,ge,xe){K.setFromMatrixPosition(ge.matrixWorld),Q.setFromMatrixPosition(xe.matrixWorld);const X=K.distanceTo(Q),ae=ge.projectionMatrix.elements,fe=xe.projectionMatrix.elements,ce=ae[14]/(ae[10]-1),Ue=ae[14]/(ae[10]+1),k=(ae[9]+1)/ae[5],z=(ae[9]-1)/ae[5],R=(ae[8]-1)/ae[0],te=(fe[8]+1)/fe[0],G=ce*R,W=ce*te,C=X/(-R+te),I=C*-R;if(ge.matrixWorld.decompose(re.position,re.quaternion,re.scale),re.translateX(I),re.translateZ(C),re.matrixWorld.compose(re.position,re.quaternion,re.scale),re.matrixWorldInverse.copy(re.matrixWorld).invert(),ae[10]===-1)re.projectionMatrix.copy(ge.projectionMatrix),re.projectionMatrixInverse.copy(ge.projectionMatrixInverse);else{const N=ce+C,A=Ue+C,w=G-I,U=W+(X-I),O=k*Ue/A*N,V=z*Ue/A*N;re.projectionMatrix.makePerspective(w,U,O,V,N,A),re.projectionMatrixInverse.copy(re.projectionMatrix).invert()}}function he(re,ge){ge===null?re.matrixWorld.copy(re.matrix):re.matrixWorld.multiplyMatrices(ge.matrixWorld,re.matrix),re.matrixWorldInverse.copy(re.matrixWorld).invert()}this.updateCamera=function(re){if(s===null)return;let ge=re.near,xe=re.far;_.texture!==null&&(_.depthNear>0&&(ge=_.depthNear),_.depthFar>0&&(xe=_.depthFar)),M.near=P.near=S.near=ge,M.far=P.far=S.far=xe,(L!==M.near||F!==M.far)&&(s.updateRenderState({depthNear:M.near,depthFar:M.far}),L=M.near,F=M.far),S.layers.mask=re.layers.mask|2,P.layers.mask=re.layers.mask|4,M.layers.mask=S.layers.mask|P.layers.mask;const X=re.parent,ae=M.cameras;he(M,X);for(let fe=0;fe0&&(g.alphaTest.value=m.alphaTest);const y=e.get(m),b=y.envMap,v=y.envMapRotation;b&&(g.envMap.value=b,Kr.copy(v),Kr.x*=-1,Kr.y*=-1,Kr.z*=-1,b.isCubeTexture&&b.isRenderTargetTexture===!1&&(Kr.y*=-1,Kr.z*=-1),g.envMapRotation.value.setFromMatrix4(hF.makeRotationFromEuler(Kr)),g.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=m.reflectivity,g.ior.value=m.ior,g.refractionRatio.value=m.refractionRatio),m.lightMap&&(g.lightMap.value=m.lightMap,g.lightMapIntensity.value=m.lightMapIntensity,t(m.lightMap,g.lightMapTransform)),m.aoMap&&(g.aoMap.value=m.aoMap,g.aoMapIntensity.value=m.aoMapIntensity,t(m.aoMap,g.aoMapTransform))}function o(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,m.map&&(g.map.value=m.map,t(m.map,g.mapTransform))}function a(g,m){g.dashSize.value=m.dashSize,g.totalSize.value=m.dashSize+m.gapSize,g.scale.value=m.scale}function l(g,m,y,b){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.size.value=m.size*y,g.scale.value=b*.5,m.map&&(g.map.value=m.map,t(m.map,g.uvTransform)),m.alphaMap&&(g.alphaMap.value=m.alphaMap,t(m.alphaMap,g.alphaMapTransform)),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest)}function c(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.rotation.value=m.rotation,m.map&&(g.map.value=m.map,t(m.map,g.mapTransform)),m.alphaMap&&(g.alphaMap.value=m.alphaMap,t(m.alphaMap,g.alphaMapTransform)),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest)}function u(g,m){g.specular.value.copy(m.specular),g.shininess.value=Math.max(m.shininess,1e-4)}function f(g,m){m.gradientMap&&(g.gradientMap.value=m.gradientMap)}function d(g,m){g.metalness.value=m.metalness,m.metalnessMap&&(g.metalnessMap.value=m.metalnessMap,t(m.metalnessMap,g.metalnessMapTransform)),g.roughness.value=m.roughness,m.roughnessMap&&(g.roughnessMap.value=m.roughnessMap,t(m.roughnessMap,g.roughnessMapTransform)),m.envMap&&(g.envMapIntensity.value=m.envMapIntensity)}function h(g,m,y){g.ior.value=m.ior,m.sheen>0&&(g.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),g.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(g.sheenColorMap.value=m.sheenColorMap,t(m.sheenColorMap,g.sheenColorMapTransform)),m.sheenRoughnessMap&&(g.sheenRoughnessMap.value=m.sheenRoughnessMap,t(m.sheenRoughnessMap,g.sheenRoughnessMapTransform))),m.clearcoat>0&&(g.clearcoat.value=m.clearcoat,g.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(g.clearcoatMap.value=m.clearcoatMap,t(m.clearcoatMap,g.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,t(m.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(g.clearcoatNormalMap.value=m.clearcoatNormalMap,t(m.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===zn&&g.clearcoatNormalScale.value.negate())),m.dispersion>0&&(g.dispersion.value=m.dispersion),m.iridescence>0&&(g.iridescence.value=m.iridescence,g.iridescenceIOR.value=m.iridescenceIOR,g.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(g.iridescenceMap.value=m.iridescenceMap,t(m.iridescenceMap,g.iridescenceMapTransform)),m.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=m.iridescenceThicknessMap,t(m.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),m.transmission>0&&(g.transmission.value=m.transmission,g.transmissionSamplerMap.value=y.texture,g.transmissionSamplerSize.value.set(y.width,y.height),m.transmissionMap&&(g.transmissionMap.value=m.transmissionMap,t(m.transmissionMap,g.transmissionMapTransform)),g.thickness.value=m.thickness,m.thicknessMap&&(g.thicknessMap.value=m.thicknessMap,t(m.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=m.attenuationDistance,g.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(g.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(g.anisotropyMap.value=m.anisotropyMap,t(m.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=m.specularIntensity,g.specularColor.value.copy(m.specularColor),m.specularColorMap&&(g.specularColorMap.value=m.specularColorMap,t(m.specularColorMap,g.specularColorMapTransform)),m.specularIntensityMap&&(g.specularIntensityMap.value=m.specularIntensityMap,t(m.specularIntensityMap,g.specularIntensityMapTransform))}function p(g,m){m.matcap&&(g.matcap.value=m.matcap)}function _(g,m){const y=e.get(m).light;g.referencePosition.value.setFromMatrixPosition(y.matrixWorld),g.nearDistance.value=y.shadow.camera.near,g.farDistance.value=y.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:s}}function mF(n,e,t,i){let s={},r={},o=[];const a=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function l(y,b){const v=b.program;i.uniformBlockBinding(y,v)}function c(y,b){let v=s[y.id];v===void 0&&(p(y),v=u(y),s[y.id]=v,y.addEventListener("dispose",g));const T=b.program;i.updateUBOMapping(y,T);const E=e.render.frame;r[y.id]!==E&&(d(y),r[y.id]=E)}function u(y){const b=f();y.__bindingPointIndex=b;const v=n.createBuffer(),T=y.__size,E=y.usage;return n.bindBuffer(n.UNIFORM_BUFFER,v),n.bufferData(n.UNIFORM_BUFFER,T,E),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,b,v),v}function f(){for(let y=0;y0&&(v+=T-E),y.__size=v,y.__cache={},this}function _(y){const b={boundary:0,storage:0};return typeof y=="number"||typeof y=="boolean"?(b.boundary=4,b.storage=4):y.isVector2?(b.boundary=8,b.storage=8):y.isVector3||y.isColor?(b.boundary=16,b.storage=12):y.isVector4?(b.boundary=16,b.storage=16):y.isMatrix3?(b.boundary=48,b.storage=48):y.isMatrix4?(b.boundary=64,b.storage=64):y.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",y),b}function g(y){const b=y.target;b.removeEventListener("dispose",g);const v=o.indexOf(b.__bindingPointIndex);o.splice(v,1),n.deleteBuffer(s[b.id]),delete s[b.id],delete r[b.id]}function m(){for(const y in s)n.deleteBuffer(s[y]);o=[],s={},r={}}return{bind:l,update:c,dispose:m}}class Ef{constructor(e={}){const{canvas:t=Q1(),context:i=null,depth:s=!0,stencil:r=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:f=!1,reverseDepthBuffer:d=!1}=e;this.isWebGLRenderer=!0;let h;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");h=i.getContextAttributes().alpha}else h=o;const p=new Uint32Array(4),_=new Int32Array(4);let g=null,m=null;const y=[],b=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=Zi,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const v=this;let T=!1;this._outputColorSpace=Nn;let E=0,S=0,P=null,x=-1,M=null;const L=new gt,F=new gt;let H=null;const Y=new Ce(0);let ee=0,K=t.width,Q=t.height,Z=1,he=null,be=null;const se=new gt(0,0,K,Q),ye=new gt(0,0,K,Q);let He=!1;const re=new Bc;let ge=!1,xe=!1;const X=new Ye,ae=new Ye,fe=new B,ce=new gt,Ue={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let k=!1;function z(){return P===null?Z:1}let R=i;function te(D,j){return t.getContext(D,j)}try{const D={alpha:!0,depth:s,stencil:r,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:f};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Dc}`),t.addEventListener("webglcontextlost",pe,!1),t.addEventListener("webglcontextrestored",Le,!1),t.addEventListener("webglcontextcreationerror",Ie,!1),R===null){const j="webgl2";if(R=te(j,D),R===null)throw te(j)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(D){throw console.error("THREE.WebGLRenderer: "+D.message),D}let G,W,C,I,N,A,w,U,O,V,$,ue,le,Me,Be,me,Te,Ve,We,Se,Je,it,Lt,q;function Pe(){G=new AN(R),G.init(),it=new lT(R,G),W=new bN(R,G,e,it),C=new aF(R,G),W.reverseDepthBuffer&&d&&C.buffers.depth.setReversed(!0),I=new PN(R),N=new YU,A=new lF(R,G,C,N,W,it,I),w=new MN(v),U=new wN(v),O=new UL(R),Lt=new vN(R,O),V=new CN(R,O,I,Lt),$=new LN(R,V,O,I),We=new IN(R,W,A),me=new xN(N),ue=new qU(v,w,U,G,W,Lt,me),le=new pF(v,N),Me=new KU,Be=new nF(G),Ve=new _N(v,w,U,C,$,h,l),Te=new rF(v,$,W),q=new mF(R,I,W,C),Se=new yN(R,G,I),Je=new RN(R,G,I),I.programs=ue.programs,v.capabilities=W,v.extensions=G,v.properties=N,v.renderLists=Me,v.shadowMap=Te,v.state=C,v.info=I}Pe();const oe=new dF(v,R);this.xr=oe,this.getContext=function(){return R},this.getContextAttributes=function(){return R.getContextAttributes()},this.forceContextLoss=function(){const D=G.get("WEBGL_lose_context");D&&D.loseContext()},this.forceContextRestore=function(){const D=G.get("WEBGL_lose_context");D&&D.restoreContext()},this.getPixelRatio=function(){return Z},this.setPixelRatio=function(D){D!==void 0&&(Z=D,this.setSize(K,Q,!1))},this.getSize=function(D){return D.set(K,Q)},this.setSize=function(D,j,ne=!0){if(oe.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}K=D,Q=j,t.width=Math.floor(D*Z),t.height=Math.floor(j*Z),ne===!0&&(t.style.width=D+"px",t.style.height=j+"px"),this.setViewport(0,0,D,j)},this.getDrawingBufferSize=function(D){return D.set(K*Z,Q*Z).floor()},this.setDrawingBufferSize=function(D,j,ne){K=D,Q=j,Z=ne,t.width=Math.floor(D*ne),t.height=Math.floor(j*ne),this.setViewport(0,0,D,j)},this.getCurrentViewport=function(D){return D.copy(L)},this.getViewport=function(D){return D.copy(se)},this.setViewport=function(D,j,ne,ie){D.isVector4?se.set(D.x,D.y,D.z,D.w):se.set(D,j,ne,ie),C.viewport(L.copy(se).multiplyScalar(Z).round())},this.getScissor=function(D){return D.copy(ye)},this.setScissor=function(D,j,ne,ie){D.isVector4?ye.set(D.x,D.y,D.z,D.w):ye.set(D,j,ne,ie),C.scissor(F.copy(ye).multiplyScalar(Z).round())},this.getScissorTest=function(){return He},this.setScissorTest=function(D){C.setScissorTest(He=D)},this.setOpaqueSort=function(D){he=D},this.setTransparentSort=function(D){be=D},this.getClearColor=function(D){return D.copy(Ve.getClearColor())},this.setClearColor=function(){Ve.setClearColor(...arguments)},this.getClearAlpha=function(){return Ve.getClearAlpha()},this.setClearAlpha=function(){Ve.setClearAlpha(...arguments)},this.clear=function(D=!0,j=!0,ne=!0){let ie=0;if(D){let J=!1;if(P!==null){const ve=P.texture.format;J=ve===ch||ve===lh||ve===Nc}if(J){const ve=P.texture.type,Re=ve===is||ve===Us||ve===ba||ve===xa||ve===rh||ve===oh,Oe=Ve.getClearColor(),Fe=Ve.getClearAlpha(),Qe=Oe.r,Ze=Oe.g,Ge=Oe.b;Re?(p[0]=Qe,p[1]=Ze,p[2]=Ge,p[3]=Fe,R.clearBufferuiv(R.COLOR,0,p)):(_[0]=Qe,_[1]=Ze,_[2]=Ge,_[3]=Fe,R.clearBufferiv(R.COLOR,0,_))}else ie|=R.COLOR_BUFFER_BIT}j&&(ie|=R.DEPTH_BUFFER_BIT),ne&&(ie|=R.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),R.clear(ie)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",pe,!1),t.removeEventListener("webglcontextrestored",Le,!1),t.removeEventListener("webglcontextcreationerror",Ie,!1),Ve.dispose(),Me.dispose(),Be.dispose(),N.dispose(),w.dispose(),U.dispose(),$.dispose(),Lt.dispose(),q.dispose(),ue.dispose(),oe.dispose(),oe.removeEventListener("sessionstart",iv),oe.removeEventListener("sessionend",sv),Lr.stop()};function pe(D){D.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),T=!0}function Le(){console.log("THREE.WebGLRenderer: Context Restored."),T=!1;const D=I.autoReset,j=Te.enabled,ne=Te.autoUpdate,ie=Te.needsUpdate,J=Te.type;Pe(),I.autoReset=D,Te.enabled=j,Te.autoUpdate=ne,Te.needsUpdate=ie,Te.type=J}function Ie(D){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",D.statusMessage)}function ot(D){const j=D.target;j.removeEventListener("dispose",ot),Vt(j)}function Vt(D){vn(D),N.remove(D)}function vn(D){const j=N.get(D).programs;j!==void 0&&(j.forEach(function(ne){ue.releaseProgram(ne)}),D.isShaderMaterial&&ue.releaseShaderCache(D))}this.renderBufferDirect=function(D,j,ne,ie,J,ve){j===null&&(j=Ue);const Re=J.isMesh&&J.matrixWorld.determinant()<0,Oe=YA(D,j,ne,ie,J);C.setMaterial(ie,Re);let Fe=ne.index,Qe=1;if(ie.wireframe===!0){if(Fe=V.getWireframeAttribute(ne),Fe===void 0)return;Qe=2}const Ze=ne.drawRange,Ge=ne.attributes.position;let pt=Ze.start*Qe,bt=(Ze.start+Ze.count)*Qe;ve!==null&&(pt=Math.max(pt,ve.start*Qe),bt=Math.min(bt,(ve.start+ve.count)*Qe)),Fe!==null?(pt=Math.max(pt,0),bt=Math.min(bt,Fe.count)):Ge!=null&&(pt=Math.max(pt,0),bt=Math.min(bt,Ge.count));const qt=bt-pt;if(qt<0||qt===1/0)return;Lt.setup(J,ie,Oe,ne,Fe);let Ht,_t=Se;if(Fe!==null&&(Ht=O.get(Fe),_t=Je,_t.setIndex(Ht)),J.isMesh)ie.wireframe===!0?(C.setLineWidth(ie.wireframeLinewidth*z()),_t.setMode(R.LINES)):_t.setMode(R.TRIANGLES);else if(J.isLine){let Xe=ie.linewidth;Xe===void 0&&(Xe=1),C.setLineWidth(Xe*z()),J.isLineSegments?_t.setMode(R.LINES):J.isLineLoop?_t.setMode(R.LINE_LOOP):_t.setMode(R.LINE_STRIP)}else J.isPoints?_t.setMode(R.POINTS):J.isSprite&&_t.setMode(R.TRIANGLES);if(J.isBatchedMesh)if(J._multiDrawInstances!==null)xf("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),_t.renderMultiDrawInstances(J._multiDrawStarts,J._multiDrawCounts,J._multiDrawCount,J._multiDrawInstances);else if(G.get("WEBGL_multi_draw"))_t.renderMultiDraw(J._multiDrawStarts,J._multiDrawCounts,J._multiDrawCount);else{const Xe=J._multiDrawStarts,dn=J._multiDrawCounts,xt=J._multiDrawCount,Ti=Fe?O.get(Fe).bytesPerElement:1,Oo=N.get(ie).currentProgram.getUniforms();for(let ti=0;ti{function ve(){if(ie.forEach(function(Re){N.get(Re).currentProgram.isReady()&&ie.delete(Re)}),ie.size===0){J(D);return}setTimeout(ve,10)}G.get("KHR_parallel_shader_compile")!==null?ve():setTimeout(ve,10)})};let Ei=null;function as(D){Ei&&Ei(D)}function iv(){Lr.stop()}function sv(){Lr.start()}const Lr=new iT;Lr.setAnimationLoop(as),typeof self<"u"&&Lr.setContext(self),this.setAnimationLoop=function(D){Ei=D,oe.setAnimationLoop(D),D===null?Lr.stop():Lr.start()},oe.addEventListener("sessionstart",iv),oe.addEventListener("sessionend",sv),this.render=function(D,j){if(j!==void 0&&j.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(T===!0)return;if(D.matrixWorldAutoUpdate===!0&&D.updateMatrixWorld(),j.parent===null&&j.matrixWorldAutoUpdate===!0&&j.updateMatrixWorld(),oe.enabled===!0&&oe.isPresenting===!0&&(oe.cameraAutoUpdate===!0&&oe.updateCamera(j),j=oe.getCamera()),D.isScene===!0&&D.onBeforeRender(v,D,j,P),m=Be.get(D,b.length),m.init(j),b.push(m),ae.multiplyMatrices(j.projectionMatrix,j.matrixWorldInverse),re.setFromProjectionMatrix(ae),xe=this.localClippingEnabled,ge=me.init(this.clippingPlanes,xe),g=Me.get(D,y.length),g.init(),y.push(g),oe.enabled===!0&&oe.isPresenting===!0){const ve=v.xr.getDepthSensingMesh();ve!==null&&rp(ve,j,-1/0,v.sortObjects)}rp(D,j,0,v.sortObjects),g.finish(),v.sortObjects===!0&&g.sort(he,be),k=oe.enabled===!1||oe.isPresenting===!1||oe.hasDepthSensing()===!1,k&&Ve.addToRenderList(g,D),this.info.render.frame++,ge===!0&&me.beginShadows();const ne=m.state.shadowsArray;Te.render(ne,D,j),ge===!0&&me.endShadows(),this.info.autoReset===!0&&this.info.reset();const ie=g.opaque,J=g.transmissive;if(m.setupLights(),j.isArrayCamera){const ve=j.cameras;if(J.length>0)for(let Re=0,Oe=ve.length;Re0&&ov(ie,J,D,j),k&&Ve.render(D),rv(g,D,j);P!==null&&S===0&&(A.updateMultisampleRenderTarget(P),A.updateRenderTargetMipmap(P)),D.isScene===!0&&D.onAfterRender(v,D,j),Lt.resetDefaultState(),x=-1,M=null,b.pop(),b.length>0?(m=b[b.length-1],ge===!0&&me.setGlobalState(v.clippingPlanes,m.state.camera)):m=null,y.pop(),y.length>0?g=y[y.length-1]:g=null};function rp(D,j,ne,ie){if(D.visible===!1)return;if(D.layers.test(j.layers)){if(D.isGroup)ne=D.renderOrder;else if(D.isLOD)D.autoUpdate===!0&&D.update(j);else if(D.isLight)m.pushLight(D),D.castShadow&&m.pushShadow(D);else if(D.isSprite){if(!D.frustumCulled||re.intersectsSprite(D)){ie&&ce.setFromMatrixPosition(D.matrixWorld).applyMatrix4(ae);const Re=$.update(D),Oe=D.material;Oe.visible&&g.push(D,Re,Oe,ne,ce.z,null)}}else if((D.isMesh||D.isLine||D.isPoints)&&(!D.frustumCulled||re.intersectsObject(D))){const Re=$.update(D),Oe=D.material;if(ie&&(D.boundingSphere!==void 0?(D.boundingSphere===null&&D.computeBoundingSphere(),ce.copy(D.boundingSphere.center)):(Re.boundingSphere===null&&Re.computeBoundingSphere(),ce.copy(Re.boundingSphere.center)),ce.applyMatrix4(D.matrixWorld).applyMatrix4(ae)),Array.isArray(Oe)){const Fe=Re.groups;for(let Qe=0,Ze=Fe.length;Qe0&&eu(J,j,ne),ve.length>0&&eu(ve,j,ne),Re.length>0&&eu(Re,j,ne),C.buffers.depth.setTest(!0),C.buffers.depth.setMask(!0),C.buffers.color.setMask(!0),C.setPolygonOffset(!1)}function ov(D,j,ne,ie){if((ne.isScene===!0?ne.overrideMaterial:null)!==null)return;m.state.transmissionRenderTarget[ie.id]===void 0&&(m.state.transmissionRenderTarget[ie.id]=new ss(1,1,{generateMipmaps:!0,type:G.has("EXT_color_buffer_half_float")||G.has("EXT_color_buffer_float")?Ua:is,minFilter:ji,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:ft.workingColorSpace}));const ve=m.state.transmissionRenderTarget[ie.id],Re=ie.viewport||L;ve.setSize(Re.z*v.transmissionResolutionScale,Re.w*v.transmissionResolutionScale);const Oe=v.getRenderTarget();v.setRenderTarget(ve),v.getClearColor(Y),ee=v.getClearAlpha(),ee<1&&v.setClearColor(16777215,.5),v.clear(),k&&Ve.render(ne);const Fe=v.toneMapping;v.toneMapping=Zi;const Qe=ie.viewport;if(ie.viewport!==void 0&&(ie.viewport=void 0),m.setupLightsView(ie),ge===!0&&me.setGlobalState(v.clippingPlanes,ie),eu(D,ne,ie),A.updateMultisampleRenderTarget(ve),A.updateRenderTargetMipmap(ve),G.has("WEBGL_multisampled_render_to_texture")===!1){let Ze=!1;for(let Ge=0,pt=j.length;Ge0),Ge=!!ne.morphAttributes.position,pt=!!ne.morphAttributes.normal,bt=!!ne.morphAttributes.color;let qt=Zi;ie.toneMapped&&(P===null||P.isXRRenderTarget===!0)&&(qt=v.toneMapping);const Ht=ne.morphAttributes.position||ne.morphAttributes.normal||ne.morphAttributes.color,_t=Ht!==void 0?Ht.length:0,Xe=N.get(ie),dn=m.state.lights;if(ge===!0&&(xe===!0||D!==M)){const Cn=D===M&&ie.id===x;me.setState(ie,D,Cn)}let xt=!1;ie.version===Xe.__version?(Xe.needsLights&&Xe.lightsStateVersion!==dn.state.version||Xe.outputColorSpace!==Oe||J.isBatchedMesh&&Xe.batching===!1||!J.isBatchedMesh&&Xe.batching===!0||J.isBatchedMesh&&Xe.batchingColor===!0&&J.colorTexture===null||J.isBatchedMesh&&Xe.batchingColor===!1&&J.colorTexture!==null||J.isInstancedMesh&&Xe.instancing===!1||!J.isInstancedMesh&&Xe.instancing===!0||J.isSkinnedMesh&&Xe.skinning===!1||!J.isSkinnedMesh&&Xe.skinning===!0||J.isInstancedMesh&&Xe.instancingColor===!0&&J.instanceColor===null||J.isInstancedMesh&&Xe.instancingColor===!1&&J.instanceColor!==null||J.isInstancedMesh&&Xe.instancingMorph===!0&&J.morphTexture===null||J.isInstancedMesh&&Xe.instancingMorph===!1&&J.morphTexture!==null||Xe.envMap!==Fe||ie.fog===!0&&Xe.fog!==ve||Xe.numClippingPlanes!==void 0&&(Xe.numClippingPlanes!==me.numPlanes||Xe.numIntersection!==me.numIntersection)||Xe.vertexAlphas!==Qe||Xe.vertexTangents!==Ze||Xe.morphTargets!==Ge||Xe.morphNormals!==pt||Xe.morphColors!==bt||Xe.toneMapping!==qt||Xe.morphTargetsCount!==_t)&&(xt=!0):(xt=!0,Xe.__version=ie.version);let Ti=Xe.currentProgram;xt===!0&&(Ti=tu(ie,j,J));let Oo=!1,ti=!1,Xa=!1;const Nt=Ti.getUniforms(),ci=Xe.uniforms;if(C.useProgram(Ti.program)&&(Oo=!0,ti=!0,Xa=!0),ie.id!==x&&(x=ie.id,ti=!0),Oo||M!==D){C.buffers.depth.getReversed()?(X.copy(D.projectionMatrix),iP(X),sP(X),Nt.setValue(R,"projectionMatrix",X)):Nt.setValue(R,"projectionMatrix",D.projectionMatrix),Nt.setValue(R,"viewMatrix",D.matrixWorldInverse);const Wn=Nt.map.cameraPosition;Wn!==void 0&&Wn.setValue(R,fe.setFromMatrixPosition(D.matrixWorld)),W.logarithmicDepthBuffer&&Nt.setValue(R,"logDepthBufFC",2/(Math.log(D.far+1)/Math.LN2)),(ie.isMeshPhongMaterial||ie.isMeshToonMaterial||ie.isMeshLambertMaterial||ie.isMeshBasicMaterial||ie.isMeshStandardMaterial||ie.isShaderMaterial)&&Nt.setValue(R,"isOrthographic",D.isOrthographicCamera===!0),M!==D&&(M=D,ti=!0,Xa=!0)}if(J.isSkinnedMesh){Nt.setOptional(R,J,"bindMatrix"),Nt.setOptional(R,J,"bindMatrixInverse");const Cn=J.skeleton;Cn&&(Cn.boneTexture===null&&Cn.computeBoneTexture(),Nt.setValue(R,"boneTexture",Cn.boneTexture,A))}J.isBatchedMesh&&(Nt.setOptional(R,J,"batchingTexture"),Nt.setValue(R,"batchingTexture",J._matricesTexture,A),Nt.setOptional(R,J,"batchingIdTexture"),Nt.setValue(R,"batchingIdTexture",J._indirectTexture,A),Nt.setOptional(R,J,"batchingColorTexture"),J._colorsTexture!==null&&Nt.setValue(R,"batchingColorTexture",J._colorsTexture,A));const ui=ne.morphAttributes;if((ui.position!==void 0||ui.normal!==void 0||ui.color!==void 0)&&We.update(J,ne,Ti),(ti||Xe.receiveShadow!==J.receiveShadow)&&(Xe.receiveShadow=J.receiveShadow,Nt.setValue(R,"receiveShadow",J.receiveShadow)),ie.isMeshGouraudMaterial&&ie.envMap!==null&&(ci.envMap.value=Fe,ci.flipEnvMap.value=Fe.isCubeTexture&&Fe.isRenderTargetTexture===!1?-1:1),ie.isMeshStandardMaterial&&ie.envMap===null&&j.environment!==null&&(ci.envMapIntensity.value=j.environmentIntensity),ti&&(Nt.setValue(R,"toneMappingExposure",v.toneMappingExposure),Xe.needsLights&&jA(ci,Xa),ve&&ie.fog===!0&&le.refreshFogUniforms(ci,ve),le.refreshMaterialUniforms(ci,ie,Z,Q,m.state.transmissionRenderTarget[D.id]),Sf.upload(R,lv(Xe),ci,A)),ie.isShaderMaterial&&ie.uniformsNeedUpdate===!0&&(Sf.upload(R,lv(Xe),ci,A),ie.uniformsNeedUpdate=!1),ie.isSpriteMaterial&&Nt.setValue(R,"center",J.center),Nt.setValue(R,"modelViewMatrix",J.modelViewMatrix),Nt.setValue(R,"normalMatrix",J.normalMatrix),Nt.setValue(R,"modelMatrix",J.matrixWorld),ie.isShaderMaterial||ie.isRawShaderMaterial){const Cn=ie.uniformsGroups;for(let Wn=0,op=Cn.length;Wn0&&A.useMultisampledRTT(D)===!1?J=N.get(D).__webglMultisampledFramebuffer:Array.isArray(Ze)?J=Ze[ne]:J=Ze,L.copy(D.viewport),F.copy(D.scissor),H=D.scissorTest}else L.copy(se).multiplyScalar(Z).floor(),F.copy(ye).multiplyScalar(Z).floor(),H=He;if(ne!==0&&(J=ZA),C.bindFramebuffer(R.FRAMEBUFFER,J)&&ie&&C.drawBuffers(D,J),C.viewport(L),C.scissor(F),C.setScissorTest(H),ve){const Fe=N.get(D.texture);R.framebufferTexture2D(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_CUBE_MAP_POSITIVE_X+j,Fe.__webglTexture,ne)}else if(Re){const Fe=N.get(D.texture),Qe=j;R.framebufferTextureLayer(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0,Fe.__webglTexture,ne,Qe)}else if(D!==null&&ne!==0){const Fe=N.get(D.texture);R.framebufferTexture2D(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_2D,Fe.__webglTexture,ne)}x=-1},this.readRenderTargetPixels=function(D,j,ne,ie,J,ve,Re){if(!(D&&D.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Oe=N.get(D).__webglFramebuffer;if(D.isWebGLCubeRenderTarget&&Re!==void 0&&(Oe=Oe[Re]),Oe){C.bindFramebuffer(R.FRAMEBUFFER,Oe);try{const Fe=D.texture,Qe=Fe.format,Ze=Fe.type;if(!W.textureFormatReadable(Qe)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!W.textureTypeReadable(Ze)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}j>=0&&j<=D.width-ie&&ne>=0&&ne<=D.height-J&&R.readPixels(j,ne,ie,J,it.convert(Qe),it.convert(Ze),ve)}finally{const Fe=P!==null?N.get(P).__webglFramebuffer:null;C.bindFramebuffer(R.FRAMEBUFFER,Fe)}}},this.readRenderTargetPixelsAsync=async function(D,j,ne,ie,J,ve,Re){if(!(D&&D.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Oe=N.get(D).__webglFramebuffer;if(D.isWebGLCubeRenderTarget&&Re!==void 0&&(Oe=Oe[Re]),Oe)if(j>=0&&j<=D.width-ie&&ne>=0&&ne<=D.height-J){C.bindFramebuffer(R.FRAMEBUFFER,Oe);const Fe=D.texture,Qe=Fe.format,Ze=Fe.type;if(!W.textureFormatReadable(Qe))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!W.textureTypeReadable(Ze))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Ge=R.createBuffer();R.bindBuffer(R.PIXEL_PACK_BUFFER,Ge),R.bufferData(R.PIXEL_PACK_BUFFER,ve.byteLength,R.STREAM_READ),R.readPixels(j,ne,ie,J,it.convert(Qe),it.convert(Ze),0);const pt=P!==null?N.get(P).__webglFramebuffer:null;C.bindFramebuffer(R.FRAMEBUFFER,pt);const bt=R.fenceSync(R.SYNC_GPU_COMMANDS_COMPLETE,0);return R.flush(),await nP(R,bt,4),R.bindBuffer(R.PIXEL_PACK_BUFFER,Ge),R.getBufferSubData(R.PIXEL_PACK_BUFFER,0,ve),R.deleteBuffer(Ge),R.deleteSync(bt),ve}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(D,j=null,ne=0){const ie=Math.pow(2,-ne),J=Math.floor(D.image.width*ie),ve=Math.floor(D.image.height*ie),Re=j!==null?j.x:0,Oe=j!==null?j.y:0;A.setTexture2D(D,0),R.copyTexSubImage2D(R.TEXTURE_2D,ne,0,0,Re,Oe,J,ve),C.unbindTexture()};const JA=R.createFramebuffer(),QA=R.createFramebuffer();this.copyTextureToTexture=function(D,j,ne=null,ie=null,J=0,ve=null){ve===null&&(J!==0?(xf("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),ve=J,J=0):ve=0);let Re,Oe,Fe,Qe,Ze,Ge,pt,bt,qt;const Ht=D.isCompressedTexture?D.mipmaps[ve]:D.image;if(ne!==null)Re=ne.max.x-ne.min.x,Oe=ne.max.y-ne.min.y,Fe=ne.isBox3?ne.max.z-ne.min.z:1,Qe=ne.min.x,Ze=ne.min.y,Ge=ne.isBox3?ne.min.z:0;else{const ui=Math.pow(2,-J);Re=Math.floor(Ht.width*ui),Oe=Math.floor(Ht.height*ui),D.isDataArrayTexture?Fe=Ht.depth:D.isData3DTexture?Fe=Math.floor(Ht.depth*ui):Fe=1,Qe=0,Ze=0,Ge=0}ie!==null?(pt=ie.x,bt=ie.y,qt=ie.z):(pt=0,bt=0,qt=0);const _t=it.convert(j.format),Xe=it.convert(j.type);let dn;j.isData3DTexture?(A.setTexture3D(j,0),dn=R.TEXTURE_3D):j.isDataArrayTexture||j.isCompressedArrayTexture?(A.setTexture2DArray(j,0),dn=R.TEXTURE_2D_ARRAY):(A.setTexture2D(j,0),dn=R.TEXTURE_2D),R.pixelStorei(R.UNPACK_FLIP_Y_WEBGL,j.flipY),R.pixelStorei(R.UNPACK_PREMULTIPLY_ALPHA_WEBGL,j.premultiplyAlpha),R.pixelStorei(R.UNPACK_ALIGNMENT,j.unpackAlignment);const xt=R.getParameter(R.UNPACK_ROW_LENGTH),Ti=R.getParameter(R.UNPACK_IMAGE_HEIGHT),Oo=R.getParameter(R.UNPACK_SKIP_PIXELS),ti=R.getParameter(R.UNPACK_SKIP_ROWS),Xa=R.getParameter(R.UNPACK_SKIP_IMAGES);R.pixelStorei(R.UNPACK_ROW_LENGTH,Ht.width),R.pixelStorei(R.UNPACK_IMAGE_HEIGHT,Ht.height),R.pixelStorei(R.UNPACK_SKIP_PIXELS,Qe),R.pixelStorei(R.UNPACK_SKIP_ROWS,Ze),R.pixelStorei(R.UNPACK_SKIP_IMAGES,Ge);const Nt=D.isDataArrayTexture||D.isData3DTexture,ci=j.isDataArrayTexture||j.isData3DTexture;if(D.isDepthTexture){const ui=N.get(D),Cn=N.get(j),Wn=N.get(ui.__renderTarget),op=N.get(Cn.__renderTarget);C.bindFramebuffer(R.READ_FRAMEBUFFER,Wn.__webglFramebuffer),C.bindFramebuffer(R.DRAW_FRAMEBUFFER,op.__webglFramebuffer);for(let Dr=0;Dr{n.delete(r)};return{on:r=>{n.add(r);const o=()=>e(r);return yr(o),{off:o}},off:e,trigger:(...r)=>Promise.all(Array.from(n).map(o=>o(...r))),clear:()=>{n.clear()}}}const rm=new WeakMap,_F=(...n)=>{var e;const t=n[0],i=(e=wn())==null?void 0:e.proxy;if(i==null&&!Cc())throw new Error("injectLocal must be called in setup");return i&&rm.has(i)&&t in rm.get(i)?rm.get(i)[t]:En(...n)},Sg=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const vF=n=>typeof n<"u",yF=n=>n!=null,bF=Object.prototype.toString,xF=n=>bF.call(n)==="[object Object]",Eg=()=>{};function MF(n,e){function t(...i){return new Promise((s,r)=>{Promise.resolve(n(()=>e.apply(this,i),{fn:e,thisArg:this,args:i})).then(s).catch(r)})}return t}function SF(n,e={}){let t,i,s=Eg;const r=l=>{clearTimeout(l),s(),s=Eg};let o;return l=>{const c=nt(n),u=nt(e.maxWait);return t&&r(t),c<=0||u!==void 0&&u<=0?(i&&(r(i),i=null),Promise.resolve(l())):new Promise((f,d)=>{s=e.rejectOnCancel?d:f,o=l,u&&!i&&(i=setTimeout(()=>{t&&r(t),i=null,f(o())},u)),t=setTimeout(()=>{i&&r(i),i=null,f(l())},c)})}}function Db(n){return n.endsWith("rem")?Number.parseFloat(n)*16:Number.parseFloat(n)}function EF(n,e,t=!1){return e.reduce((i,s)=>(s in n&&(!t||n[s]!==void 0)&&(i[s]=n[s]),i),{})}function TF(n){return wn()}function Il(n){return Array.isArray(n)?n:[n]}function wF(n,e=200,t={}){return MF(SF(e,t),n)}function Ob(n,e=200,t={}){const i=et(n.value),s=wF(()=>{i.value=n.value},e,t);return $e(n,()=>s()),i}function AF(n,e={}){if(!Pt(n))return lS(n);const t=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)t[i]=S0(()=>({get(){return n.value[i]},set(s){var r;if((r=nt(e.replaceRef))!=null?r:!0)if(Array.isArray(n.value)){const a=[...n.value];a[i]=s,n.value=a}else{const a={...n.value,[i]:s};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[i]=s}}));return t}const hn=nt;function S_(n,e=!0,t){TF()?Hn(n,t):e?n():Er(n)}function CF(n,e=1e3,t={}){const{immediate:i=!0,immediateCallback:s=!1}=t;let r=null;const o=De(!1);function a(){r&&(clearInterval(r),r=null)}function l(){o.value=!1,a()}function c(){const u=nt(e);u<=0||(o.value=!0,s&&n(),a(),o.value&&(r=setInterval(n,u)))}if(i&&Sg&&c(),Pt(e)||typeof e=="function"){const u=$e(e,()=>{o.value&&Sg&&c()});yr(u)}return yr(l),{isActive:o,pause:l,resume:c}}function cT(n,e,t){return $e(n,e,{...t,immediate:!0})}const Vs=Sg?window:void 0;function Li(n){var e;const t=nt(n);return(e=t==null?void 0:t.$el)!=null?e:t}function To(...n){const e=[],t=()=>{e.forEach(a=>a()),e.length=0},i=(a,l,c,u)=>(a.addEventListener(l,c,u),()=>a.removeEventListener(l,c,u)),s=Ee(()=>{const a=Il(nt(n[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),r=cT(()=>{var a,l;return[(l=(a=s.value)==null?void 0:a.map(c=>Li(c)))!=null?l:[Vs].filter(c=>c!=null),Il(nt(s.value?n[1]:n[0])),Il(Ot(s.value?n[2]:n[1])),nt(s.value?n[3]:n[2])]},([a,l,c,u])=>{if(t(),!(a!=null&&a.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const f=xF(u)?{...u}:u;e.push(...a.flatMap(d=>l.flatMap(h=>c.map(p=>i(d,h,p,f)))))},{flush:"post"}),o=()=>{r(),t()};return yr(t),o}function RF(){const n=De(!1),e=wn();return e&&Hn(()=>{n.value=!0},e),n}function Fh(n){const e=RF();return Ee(()=>(e.value,!!n()))}function PF(n,e,t={}){const{window:i=Vs,...s}=t;let r;const o=Fh(()=>i&&"MutationObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=Ee(()=>{const d=nt(n),h=Il(d).map(Li).filter(yF);return new Set(h)}),c=$e(()=>l.value,d=>{a(),o.value&&d.size&&(r=new MutationObserver(e),d.forEach(h=>r.observe(h,s)))},{immediate:!0,flush:"post"}),u=()=>r==null?void 0:r.takeRecords(),f=()=>{c(),a()};return yr(f),{isSupported:o,stop:f,takeRecords:u}}function E_(n,e={}){const{immediate:t=!0,fpsLimit:i=void 0,window:s=Vs,once:r=!1}=e,o=De(!1),a=Ee(()=>i?1e3/nt(i):null);let l=0,c=null;function u(h){if(!o.value||!s)return;l||(l=h);const p=h-l;if(a.value&&pt&&"matchMedia"in t&&typeof t.matchMedia=="function"),r=De(typeof i=="number"),o=De(),a=De(!1),l=c=>{a.value=c.matches};return Rc(()=>{if(r.value){r.value=!s.value;const c=nt(n).split(",");a.value=c.some(u=>{const f=u.includes("not all"),d=u.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),h=u.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let p=!!(d||h);return d&&p&&(p=i>=Db(d[1])),h&&p&&(p=i<=Db(h[1])),f?!p:p});return}s.value&&(o.value=t.matchMedia(nt(n)),a.value=o.value.matches)}),To(o,"change",l,{passive:!0}),Ee(()=>a.value)}function DF(n){return JSON.parse(JSON.stringify(n))}function OF(n={}){const{window:e=Vs}=n,t=De(1),i=uT(()=>`(resolution: ${t.value}dppx)`,n);let s=Eg;return e&&(s=cT(i,()=>t.value=e.devicePixelRatio)),{pixelRatio:Ui(t),stop:s}}function fT(n,e,t={}){const{window:i=Vs,...s}=t;let r;const o=Fh(()=>i&&"ResizeObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=Ee(()=>{const f=nt(n);return Array.isArray(f)?f.map(d=>Li(d)):[Li(f)]}),c=$e(l,f=>{if(a(),o.value&&i){r=new ResizeObserver(e);for(const d of f)d&&r.observe(d,s)}},{immediate:!0,flush:"post"}),u=()=>{a(),c()};return yr(u),{isSupported:o,stop:u}}function NF(n,e={}){const{reset:t=!0,windowResize:i=!0,windowScroll:s=!0,immediate:r=!0,updateTiming:o="sync"}=e,a=De(0),l=De(0),c=De(0),u=De(0),f=De(0),d=De(0),h=De(0),p=De(0);function _(){const m=Li(n);if(!m){t&&(a.value=0,l.value=0,c.value=0,u.value=0,f.value=0,d.value=0,h.value=0,p.value=0);return}const y=m.getBoundingClientRect();a.value=y.height,l.value=y.bottom,c.value=y.left,u.value=y.right,f.value=y.top,d.value=y.width,h.value=y.x,p.value=y.y}function g(){o==="sync"?_():o==="next-frame"&&requestAnimationFrame(()=>_())}return fT(n,g),$e(()=>Li(n),m=>!m&&g()),PF(n,g,{attributeFilter:["style","class"]}),s&&To("scroll",g,{capture:!0,passive:!0}),i&&To("resize",g,{passive:!0}),S_(()=>{r&&g()}),{height:a,bottom:l,left:c,right:u,top:f,width:d,x:h,y:p,update:g}}function UF(n,e={width:0,height:0},t={}){const{window:i=Vs,box:s="content-box"}=t,r=Ee(()=>{var f,d;return(d=(f=Li(n))==null?void 0:f.namespaceURI)==null?void 0:d.includes("svg")}),o=De(e.width),a=De(e.height),{stop:l}=fT(n,([f])=>{const d=s==="border-box"?f.borderBoxSize:s==="content-box"?f.contentBoxSize:f.devicePixelContentBoxSize;if(i&&r.value){const h=Li(n);if(h){const p=h.getBoundingClientRect();o.value=p.width,a.value=p.height}}else if(d){const h=Il(d);o.value=h.reduce((p,{inlineSize:_})=>p+_,0),a.value=h.reduce((p,{blockSize:_})=>p+_,0)}else o.value=f.contentRect.width,a.value=f.contentRect.height},t);S_(()=>{const f=Li(n);f&&(o.value="offsetWidth"in f?f.offsetWidth:e.width,a.value="offsetHeight"in f?f.offsetHeight:e.height)});const c=$e(()=>Li(n),f=>{o.value=f?e.width:0,a.value=f?e.height:0});function u(){l(),c()}return{width:o,height:a,stop:u}}function FF(n){var e;const t=De(0);if(typeof performance>"u")return t;const i=(e=n==null?void 0:n.every)!=null?e:10;let s=performance.now(),r=0;return E_(()=>{if(r+=1,r>=i){const o=performance.now(),a=o-s;t.value=Math.round(1e3/(a/r)),s=o,r=0}}),t}function kF(n={}){const e=et(),t=Fh(()=>typeof performance<"u"&&"memory"in performance);if(t.value){const{interval:i=1e3}=n;CF(()=>{e.value=performance.memory},i,{immediate:n.immediate,immediateCallback:n.immediateCallback})}return{isSupported:t,memory:e}}const dT={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},BF=Object.keys(dT);function zF(n={}){const{target:e=Vs}=n,t=De(!1),i=et(n.initialValue||{});Object.assign(i.value,dT,i.value);const s=r=>{t.value=!0,!(n.pointerTypes&&!n.pointerTypes.includes(r.pointerType))&&(i.value=EF(r,BF,!1))};if(e){const r={passive:!0};To(e,["pointerdown","pointermove","pointerup"],s,r),To(e,"pointerleave",()=>t.value=!1,r)}return{...AF(i),isInside:t}}function hG(n,e,t,i={}){var s,r,o;const{clone:a=!1,passive:l=!1,eventName:c,deep:u=!1,defaultValue:f,shouldEmit:d}=i,h=wn(),p=t||(h==null?void 0:h.emit)||((s=h==null?void 0:h.$emit)==null?void 0:s.bind(h))||((o=(r=h==null?void 0:h.proxy)==null?void 0:r.$emit)==null?void 0:o.bind(h==null?void 0:h.proxy));let _=c;_=_||`update:${e.toString()}`;const g=b=>a?typeof a=="function"?a(b):DF(b):b,m=()=>vF(n[e])?g(n[e]):f,y=b=>{d?d(b)&&p(_,b):p(_,b)};if(l){const b=m(),v=et(b);let T=!1;return $e(()=>n[e],E=>{T||(T=!0,v.value=g(E),Er(()=>T=!1))}),$e(v,E=>{!T&&(E!==n[e]||u)&&y(E)},{deep:u}),v}else return Ee({get(){return m()},set(b){y(b)}})}function VF(n={}){const{window:e=Vs,initialWidth:t=Number.POSITIVE_INFINITY,initialHeight:i=Number.POSITIVE_INFINITY,listenOrientation:s=!0,includeScrollbar:r=!0,type:o="inner"}=n,a=De(t),l=De(i),c=()=>{if(e)if(o==="outer")a.value=e.outerWidth,l.value=e.outerHeight;else if(o==="visual"&&e.visualViewport){const{width:f,height:d,scale:h}=e.visualViewport;a.value=Math.round(f*h),l.value=Math.round(d*h)}else r?(a.value=e.innerWidth,l.value=e.innerHeight):(a.value=e.document.documentElement.clientWidth,l.value=e.document.documentElement.clientHeight)};c(),S_(c);const u={passive:!0};if(To("resize",c,u),e&&o==="visual"&&e.visualViewport&&To(e.visualViewport,"resize",c,u),s){const f=uT("(orientation: portrait)");$e(f,()=>c())}return{width:a,height:l}}var HF=Object.defineProperty,GF=(n,e,t)=>e in n?HF(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Nb=(n,e,t)=>GF(n,typeof e!="symbol"?e+"":e,t);const WF="@tresjs/core",XF="module",$F="4.3.3",qF="pnpm@9.15.5",YF="Declarative ThreeJS using Vue Components",jF="Alvaro Saburido (https://github.com/alvarosabu/)",KF="MIT",ZF={type:"git",url:"git+https://github.com/Tresjs/tres.git"},JF=["vue","3d","threejs","three","threejs-vue"],QF=!1,ek={".":{types:"./dist/index.d.ts",import:"./dist/tres.js",require:"./dist/tres.umd.cjs"},"./components":{types:"./dist/src/components/index.d.ts"},"./composables":{types:"./dist/src/composables/index.d.ts"},"./types":{types:"./dist/src/types/index.d.ts"},"./utils":{types:"./dist/src/utils/index.d.ts"},"./*":"./*"},tk="./dist/tres.js",nk="./dist/tres.js",ik="./dist/index.d.ts",sk=["*.d.ts","dist"],rk={access:"public"},ok={dev:"pnpm --filter='./playground/vue' dev","dev:nuxt":"pnpm --filter='./playground/nuxt' dev",build:"vite build",test:"vitest","test:ci":"vitest run","test:ui":"vitest --ui --coverage.enabled=true",release:"release-it",coverage:"vitest run --coverage",lint:"eslint .","lint:fix":"eslint . --fix","docs:dev":"vitepress dev docs","docs:build":"vitepress build docs","docs:serve":"vitepress serve docs","docs:preview":"vitepress preview docs","docs:contributors":"esno scripts/update-contributors.ts"},ak={three:">=0.133",vue:">=3.4"},lk={"@alvarosabu/utils":"^3.2.0","@vue/devtools-api":"^6.6.3","@vueuse/core":"^12.5.0"},ck={"@release-it/conventional-changelog":"^10.0.0","@stackblitz/sdk":"^1.11.0","@tresjs/cientos":"4.1.0","@tresjs/eslint-config":"^1.4.0","@types/three":"^0.173.0","@typescript-eslint/eslint-plugin":"^8.23.0","@typescript-eslint/parser":"^8.23.0","@vitejs/plugin-vue":"^5.2.1","@vitest/coverage-c8":"^0.33.0","@vitest/coverage-v8":"^3.0.5","@vitest/ui":"^3.0.5","@vue/test-utils":"^2.4.6",eslint:"^9.19.0","eslint-plugin-vue":"^9.32.0",esno:"^4.8.0",gsap:"^3.12.7",jsdom:"^26.0.0",kolorist:"^1.8.0",ohmyfetch:"^0.4.21",pathe:"^2.0.2","release-it":"^18.1.2","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-copy":"^3.5.0","rollup-plugin-visualizer":"^5.14.0",sponsorkit:"^16.3.0",three:"^0.173.0",unocss:"^65.4.3",unplugin:"^2.1.2","unplugin-vue-components":"^28.0.0",vite:"^6.1.0","vite-plugin-banner":"^0.8.0","vite-plugin-dts":"4.5.0","vite-plugin-inspect":"^10.1.0","vite-plugin-require-transform":"^1.0.21","vite-svg-loader":"^5.1.0",vitepress:"1.6.3",vitest:"3.0.5",vue:"3.5.13","vue-demi":"^0.14.10"},uk={name:WF,type:XF,version:$F,packageManager:qF,description:YF,author:jF,license:KF,repository:ZF,keywords:JF,sideEffects:QF,exports:ek,main:tk,module:nk,types:ik,files:sk,publishConfig:rk,scripts:ok,peerDependencies:ak,dependencies:lk,devDependencies:ck};class fk extends $t{constructor(...e){super(...e),Nb(this,"type","HightlightMesh"),Nb(this,"createTime"),this.createTime=Date.now()}onBeforeRender(){const e=(Date.now()-this.createTime)/1e3,t=1+.07*Math.sin(2.5*e);this.scale.set(t,t,t)}}function Tg(n){return typeof n>"u"}function wd(n){return Array.isArray(n)}function dk(n){return typeof n=="number"}function hT(n){return typeof n=="string"}function ro(n){return typeof n=="function"}function Hs(n){return n===Object(n)&&!wd(n)&&!ro(n)}function ur(n){return Hs(n)&&"isObject3D"in n&&!!n.isObject3D}function Ub(n){return Hs(n)&&"isCamera"in n&&!!n.isCamera}function hk(n){return Hs(n)&&"isBufferGeometry"in n&&!!n.isBufferGeometry}function pk(n){return Hs(n)&&"isMaterial"in n&&!!n.isMaterial}function mk(n){return Hs(n)&&"isLight"in n&&!!n.isLight}function gk(n){return Hs(n)&&"isFog"in n&&!!n.isFog}function _k(n){return Hs(n)&&"isScene"in n&&!!n.isScene}function Qu(n){return ur(n)||hk(n)||pk(n)||gk(n)}function vk(n){return Hs(n)&&!!n.isPrimitive}const pT=(n,e)=>{for(const t of Object.keys(e))e[t]instanceof Object&&Object.assign(e[t],pT(n[t],e[t]));return Object.assign(n||{},e),n},yk="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",bk=Sk(yk);function Fb(n){return n&&n.nodeType===1}function ef(n){return n.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}const xk=/\B([A-Z])/g;function Mk(n){return n.replace(xk,"-$1").toLowerCase()}function Sk(n,e){const t=Object.create(null),i=n.split(",");for(let s=0;s!!t[s.toLowerCase()]:s=>!!t[s]}const kb=(n,e)=>{if(!e)return;const t=Array.isArray(e)?e:e.match(/([^[.\]])+/g);return t==null?void 0:t.reduce((i,s)=>i&&i[s],n)},Ek=(n,e,t)=>{const i=Array.isArray(e)?e:e.match(/([^[.\]])+/g);i&&i.reduce((s,r,o)=>(s[r]===void 0&&(s[r]={}),o===i.length-1&&(s[r]=t),s[r]),n)};function mT(n,e){if(Fb(n)&&Fb(e)){const s=n.attributes,r=e.attributes;return s.length!==r.length?!1:Array.from(s).every(({name:o,value:a})=>e.getAttribute(o)===a)}if(n===e)return!0;if(n===null||typeof n!="object"||e===null||typeof e!="object")return!1;const t=Object.keys(n),i=Object.keys(e);if(t.length!==i.length)return!1;for(const s of t)if(!i.includes(s)||!mT(n[s],e[s]))return!1;return!0}function Tk(n,e){if(!Array.isArray(n)||!Array.isArray(e)||n.length!==e.length)return!1;for(let t=0;t{if(l.uuid===e)return l;for(const c of l.children){const u=s(c);if(u)return u}},r=s(n);if(!r){console.warn("Object with UUID not found in the scene.");return}let o=r;for(let l=0;lgT(i)),!(n instanceof gh)){const i=n;n&&((t=n.dispose)==null||t.call(n)),i.geometry&&i.geometry.dispose(),Array.isArray(i.material)?i.material.forEach(s=>Bb(s)):i.material&&Bb(i.material)}}function Rk(n,e){let t=0;for(let i=0;it===0?e:e.charAt(0).toUpperCase()+e.slice(1)).join("")}const Vb=/-\d+$/;function Pk(n,e,t){if(hT(t)){if(Vb.test(t)){const r=t.replace(Vb,""),{target:o,key:a}=wg(n,r);if(!Array.isArray(o[a])){const l=o[a],c=[];c.__tresDetach=()=>{c.every(u=>Tg(u))&&(o[a]=l)},o[a]=c}}const{target:i,key:s}=wg(n,t);e.__tres.previousAttach=i[s],i[s]=Ca(e)}else e.__tres.previousAttach=t(n,e)}function Ik(n,e,t){var i,s,r;if(hT(t)){const{target:o,key:a}=wg(n,t),l=e.__tres.previousAttach;l===void 0?delete o[a]:o[a]=l,"__tresDetach"in o&&o.__tresDetach()}else(s=(i=e.__tres)==null?void 0:i.previousAttach)==null||s.call(i,n,e);(r=e.__tres)==null||delete r.previousAttach}function no(n,e,t){const i=n;return i.__tres={type:"unknown",eventCount:0,root:t,handlers:{},memoizedProps:{},objects:[],parent:null,previousAttach:null,...e},i.__tres.attach||(i.isMaterial?i.__tres.attach="material":i.isBufferGeometry?i.__tres.attach="geometry":i.isFog&&(i.__tres.attach="fog")),i}function _T(n){var e;const t=(e=n==null?void 0:n.__tres)==null?void 0:e.root;t&&t.render&&t.render.canBeInvalidated.value&&t.invalidate()}function Lk(n,e,t){var i;if(!ro(n.setPixelRatio))return;let s=0;if(t&&wd(t)){const r=t;if(r.length>=2){const[o,a]=r;s=K0.clamp(e,o,a)}}else dk(t)?s=t:s=e;s!==((i=n.getPixelRatio)==null?void 0:i.call(n))&&n.setPixelRatio(s)}function Dk(n,e,t,i,s){const r=[...e.__tres.objects],o=Ca(e);if(n=Ca(n),o===n)return!0;const a=no(n,e.__tres??{},s),l=e.parent??e.__tres.parent??null,c={...e.__tres.memoizedProps};delete c.object;for(const u of r)vT(u,s),yT(u,s);o.__tres.objects=[],i.remove(e);for(const[u,f]of Object.entries(c))i.patchProp(a,u,a[u],f);t(n),i.insert(e,l);for(const u of r)i.insert(u,e);return!0}function Ca(n){return vk(n)?(n.object.__tres=n.__tres,n.object):n}function vT(n,e){var t,i,s,r;const o=((t=n.__tres)==null?void 0:t.parent)||e.scene.value;n.__tres&&(n.__tres.parent=null),o&&o.__tres&&"objects"in o.__tres&&Rk(o.__tres.objects,a=>a!==n),(i=n.__tres)!=null&&i.attach?Ik(o,n,n.__tres.attach):((r=(s=n.parent)==null?void 0:s.remove)==null||r.call(s,Ca(n)),n.parent=null)}function yT(n,e){var t;(t=n.traverse)==null||t.call(n,i=>{var s;e.deregisterCamera(i),(s=e.eventManager)==null||s.deregisterPointerMissedObject(i)}),e.deregisterCamera(n),_T(n)}const Ok=({sizes:n})=>{const e=et([]),t=Ee(()=>e.value[0]),i=o=>{const a=o instanceof Fc?o:e.value.find(c=>c.uuid===o);if(!a)return;const l=e.value.filter(({uuid:c})=>c!==a.uuid);e.value=[a,...l]},s=(o,a=!1)=>{if(Ub(o)){const l=o;if(e.value.some(({uuid:c})=>c===l.uuid))return;a?i(l):e.value.push(l)}},r=o=>{if(Ub(o)){const a=o;e.value=e.value.filter(({uuid:l})=>l!==a.uuid)}};return Rc(()=>{n.aspectRatio.value&&e.value.forEach(o=>{!o.manual&&(o instanceof Kt||Nk(o))&&(o instanceof Kt?o.aspect=n.aspectRatio.value:(o.left=n.width.value*-.5,o.right=n.width.value*.5,o.top=n.height.value*.5,o.bottom=n.height.value*-.5),o.updateProjectionMatrix())})}),ns(()=>{e.value=[]}),{camera:t,cameras:e,registerCamera:s,deregisterCamera:r,setCameraActive:i}};function Nk(n){return n.hasOwnProperty("isOrthographicCamera")&&n.isOrthographicCamera}const Ad="[TresJS ▲ ■ ●] ";function Uk(...n){typeof n[0]=="string"?n[0]=Ad+n[0]:n.unshift(Ad),console.error(...n)}function Fk(...n){typeof n[0]=="string"?n[0]=Ad+n[0]:n.unshift(Ad),console.warn(...n)}function kk(n,e){}function bT(){return{logError:Uk,logWarning:Fk,logMessage:kk}}const Ag=et({}),Cg=n=>Object.assign(Ag.value,n);function om(){const n=new Map,e=new Set;let t=0,i=!1;const s=()=>{const o=Array.from(n.entries()).sort((a,l)=>{const c=a[1].priority-l[1].priority;return c===0?a[1].addI-l[1].addI:c});e.clear(),o.forEach(a=>e.add(a[0]))},r=o=>{n.delete(o),e.delete(o)};return{on:(o,a=0)=>{n.set(o,{priority:a,addI:t++});const l=()=>r(o);return yr(l),i=!0,{off:l}},off:r,trigger:(...o)=>{i&&(s(),i=!1),e.forEach(a=>a(...o))},dispose:()=>{n.clear(),e.clear()},get count(){return n.size}}}function Bk(){let n=!0,e=!0,t=!1;const i=new Nh(!1),s=et(i.running),r=et(!1);let o;const a=K0.generateUUID();let l=null;const c=om(),u=om(),f=om();E();let d={};function h(S){d=S}function p(S,P,x=0){switch(P){case"before":return c.on(S,x);case"render":return l||(l=S),u.dispose(),u.on(S);case"after":return f.on(S,x)}}function _(){e&&(e=!1,E(),T())}function g(){e=!0,E(),cancelAnimationFrame(o)}function m(){t=!1,E()}function y(){t=!0,E()}function b(){r.value=!0}function v(){r.value=!1}function T(){if(!n){o=requestAnimationFrame(T);return}const S=i.getDelta(),P=i.getElapsedTime(),x={camera:Ot(d.camera),scene:Ot(d.scene),renderer:Ot(d.renderer),raycaster:Ot(d.raycaster),controls:Ot(d.controls),invalidate:d.invalidate,advance:d.advance},M={delta:S,elapsed:P,clock:i,...x};s.value&&c.trigger(M),r.value||(u.count?u.trigger(M):l&&l(M)),s.value&&f.trigger(M),o=requestAnimationFrame(T)}function E(){const S=!e&&!t;i.running!==S&&(i.running?i.stop():i.start()),s.value=i.running}return{loopId:a,register:(S,P,x)=>p(S,P,x),start:_,stop:g,pause:y,resume:m,pauseRender:b,resumeRender:v,isRenderPaused:r,isActive:s,setContext:h,setReady:S=>n=S}}function T_(n){let e=0;return n.traverse(t=>{if(t.isMesh&&t.geometry&&t.type!=="HightlightMesh"){const i=t.geometry,s=i.attributes.position.count*3*Float32Array.BYTES_PER_ELEMENT,r=i.index?i.index.count*Uint32Array.BYTES_PER_ELEMENT:0,o=i.attributes.normal?i.attributes.normal.count*3*Float32Array.BYTES_PER_ELEMENT:0,a=i.attributes.uv?i.attributes.uv.count*2*Float32Array.BYTES_PER_ELEMENT:0,l=s+r+o+a;e+=l}}),e}function zk(n){return(n/1024).toFixed(2)}const Vk=Number.parseInt(Dc.replace("dev",""));function Hk(n){return n instanceof Ce?n:Array.isArray(n)?new Ce(...n):new Ce(n)}const tf={realistic:{shadows:!0,physicallyCorrectLights:!0,outputColorSpace:Nn,toneMapping:nh,toneMappingExposure:3,shadowMap:{enabled:!0,type:U0}},flat:{toneMapping:Zi,toneMappingExposure:1}};function Gk({canvas:n,options:e,contextParts:{sizes:t,render:i,invalidate:s,advance:r}}){const o=Ee(()=>({alpha:hn(e.alpha)??!0,depth:hn(e.depth),canvas:Li(n),context:hn(e.context),stencil:hn(e.stencil),antialias:hn(e.antialias)??!0,precision:hn(e.precision),powerPreference:hn(e.powerPreference),premultipliedAlpha:hn(e.premultipliedAlpha),preserveDrawingBuffer:hn(e.preserveDrawingBuffer),logarithmicDepthBuffer:hn(e.logarithmicDepthBuffer),failIfMajorPerformanceCaveat:hn(e.failIfMajorPerformanceCaveat)})),a=De(new Ef(o.value));function l(){e.renderMode==="on-demand"&&s()}$e(o,()=>{a.value.dispose(),a.value=new Ef(o.value),l()}),$e([t.width,t.height],()=>{a.value.setSize(t.width.value,t.height.value),l()},{immediate:!0}),$e(()=>e.clearColor,l);const{pixelRatio:c}=OF(),{logError:u}=bT(),f=(()=>{const h=new Ef,p={shadowMap:{enabled:h.shadowMap.enabled,type:h.shadowMap.type},toneMapping:h.toneMapping,toneMappingExposure:h.toneMappingExposure,outputColorSpace:h.outputColorSpace};return h.dispose(),p})(),d=hn(e.renderMode);return d==="on-demand"&&s(),d==="manual"&&setTimeout(()=>{r()},100),Rc(()=>{const h=hn(e.preset);h&&(h in tf||u(`Renderer Preset must be one of these: ${Object.keys(tf).join(", ")}`),pT(a.value,tf[h])),Lk(a.value,c.value,hn(e.dpr)),d==="always"&&(i.frames.value=Math.max(1,i.frames.value));const p=(m,y)=>{const b=hn(m),v=()=>{if(h)return kb(tf[h],y)};if(b!==void 0)return b;const T=v();return T!==void 0?T:kb(f,y)},_=(m,y)=>Ek(a.value,y,p(m,y));_(e.shadows,"shadowMap.enabled"),_(e.toneMapping??nh,"toneMapping"),_(e.shadowMapType,"shadowMap.type"),Vk<150&&_(!e.useLegacyLights,"physicallyCorrectLights"),_(e.outputColorSpace,"outputColorSpace"),_(e.toneMappingExposure,"toneMappingExposure");const g=p(e.clearColor,"clearColor");g&&a.value.setClearColor(g?Hk(g):new Ce(0))}),ns(()=>{a.value.dispose(),a.value.forceContextLoss()}),{renderer:a}}function Wk(n,e,t=10){const i=hn(n)?VF():UF(Ee(()=>hn(e).parentElement)),s=Ui(Ob(i.width,t)),r=Ui(Ob(i.height,t)),o=Ee(()=>s.value/r.value);return{height:r,width:s,aspectRatio:o}}const Xk=(n,e)=>{const t=Ee(()=>e.renderer.value.domElement),i=De([]),{x:s,y:r}=zF({target:t});let o=0;const{width:a,height:l,top:c,left:u}=NF(t),f=({x:se,y:ye})=>{if(t.value)return{x:(se-u.value)/a.value*2-1,y:-((ye-c.value)/l.value)*2+1}},d=({x:se,y:ye})=>{if(e.camera.value)return e.raycaster.value.setFromCamera(new de(se,ye),e.camera.value),i.value=e.raycaster.value.intersectObjects(n.value,!0),i.value},h=se=>{const ye=f({x:(se==null?void 0:se.clientX)??s.value,y:(se==null?void 0:se.clientY)??r.value});return ye?d(ye)||[]:[]},p=pi(),_=pi(),g=pi(),m=pi(),y=pi(),b=pi(),v=pi(),T=pi();function E(se){const ye={};for(const He in se)typeof He!="function"&&(ye[He]=se[He]);return ye}const S=(se,ye)=>{var He,re,ge;const xe=E(ye),X=new B(ye==null?void 0:ye.clientX,ye==null?void 0:ye.clientY,0).unproject((He=e.camera)==null?void 0:He.value);se.trigger({...xe,intersections:i.value,unprojectedPoint:X,ray:(re=e.raycaster)==null?void 0:re.value.ray,camera:(ge=e.camera)==null?void 0:ge.value,sourceEvent:ye,delta:o,stopPropagating:!1})};let P;const x=se=>{h(se),S(g,se),P=se},M=()=>{P&&x(P)};let L,F,H;const Y=se=>{var ye;L=(ye=i.value[0])==null?void 0:ye.object,o=0,F=new de((se==null?void 0:se.clientX)??s.value,(se==null?void 0:se.clientY)??r.value),S(y,se)};let ee,K=!1;const Q=se=>{var ye,He,re;se instanceof PointerEvent&&(i.value.length===0&&S(b,se),L===((ye=i.value[0])==null?void 0:ye.object)&&(H=new de((se==null?void 0:se.clientX)??s.value,(se==null?void 0:se.clientY)??r.value),o=F==null?void 0:F.distanceTo(H),se.button===0?(S(p,se),ee===((He=i.value[0])==null?void 0:He.object)?K=!0:(ee=(re=i.value[0])==null?void 0:re.object,K=!1)):se.button===2&&S(v,se)),S(m,se))},Z=se=>{K&&(S(_,se),ee=void 0,K=!1)},he=se=>S(g,se),be=se=>S(T,se);return t.value.addEventListener("pointerup",Q),t.value.addEventListener("pointerdown",Y),t.value.addEventListener("pointermove",x),t.value.addEventListener("pointerleave",he),t.value.addEventListener("dblclick",Z),t.value.addEventListener("wheel",be),ns(()=>{t!=null&&t.value&&(t.value.removeEventListener("pointerup",Q),t.value.removeEventListener("pointerdown",Y),t.value.removeEventListener("pointermove",x),t.value.removeEventListener("pointerleave",he),t.value.removeEventListener("dblclick",Z),t.value.removeEventListener("wheel",be))}),{intersects:i,onClick:se=>p.on(se).off,onDblClick:se=>_.on(se).off,onContextMenu:se=>v.on(se).off,onPointerMove:se=>g.on(se).off,onPointerUp:se=>m.on(se).off,onPointerDown:se=>y.on(se).off,onPointerMissed:se=>b.on(se).off,onWheel:se=>T.on(se).off,forceUpdate:M}};function am(n,e){if(Array.isArray(n))for(const t of n)t(e);typeof n=="function"&&n(e)}function $k(n,e,t){var i;const s=De(),r=De();n&&(s.value=n),e&&(r.value=e);const o=x=>{var M;return((M=x.__tres)==null?void 0:M.eventCount)>0},a=x=>{var M;return((M=x.children)==null?void 0:M.some(L=>a(L)))||o(x)},l=De(((i=s.value)==null?void 0:i.children).filter(a)||[]);function c(x,M){const L=[],F=()=>M.stopPropagating=!0;M.stopPropagation=F;for(const H of M==null?void 0:M.intersections){if(M.stopPropagating)return;M={...M,...H};const{object:Y}=H;M.eventObject=Y,am(Y[x],M),L.push(Y);let ee=Y.parent;for(;ee!==null&&!M.stopPropagating&&!L.includes(ee);)M.eventObject=ee,am(ee[x],M),L.push(ee),ee=ee.parent;const K=Mk(x.slice(2));t(K,{intersection:H,event:M})}}const{onClick:u,onDblClick:f,onContextMenu:d,onPointerMove:h,onPointerDown:p,onPointerUp:_,onPointerMissed:g,onWheel:m,forceUpdate:y}=Xk(l,e);_(x=>c("onPointerUp",x)),p(x=>c("onPointerDown",x)),u(x=>c("onClick",x)),f(x=>c("onDoubleClick",x)),d(x=>c("onContextMenu",x)),m(x=>c("onWheel",x));let b=[];h(x=>{const M=x.intersections.map(({object:F})=>F),L=x.intersections;b.forEach(({object:F})=>{M.includes(F)||(x.intersections=b,c("onPointerLeave",x),c("onPointerOut",x))}),x.intersections=L,x.intersections.forEach(({object:F})=>{b.includes(F)||(c("onPointerEnter",x),c("onPointerOver",x))}),c("onPointerMove",x),b=x.intersections});const v=[];g(x=>{const M=()=>x.stopPropagating=!0;x.stopPropagation=M,v.forEach(L=>{x.stopPropagating||(x.eventObject=L,am(L.onPointerMissed,x))}),t("pointer-missed",{event:x})});function T(x){Qu(x)&&ur(x)&&l.value.push(x)}function E(x){if(Qu(x)&&ur(x)){const M=l.value.indexOf(x);M>-1&&l.value.splice(M,1)}}function S(x){Qu(x)&&ur(x)&&x.onPointerMissed&&v.push(x)}function P(x){if(Qu(x)&&ur(x)){const M=v.indexOf(x);M>-1&&v.splice(M,1)}}return e.eventManager={forceUpdate:y,registerObject:T,deregisterObject:E,registerPointerMissedObject:S,deregisterPointerMissedObject:P},{forceUpdate:y,registerObject:T,deregisterObject:E,registerPointerMissedObject:S,deregisterPointerMissedObject:P}}function qk(n,e,t=100){t=t<=0?100:t;const i=pi(),s=new Set;let r=!1,o=!1,a=null;function l(){a&&clearTimeout(a),!o&&!r&&n()?(i.trigger(e),s.forEach(f=>f()),s.clear(),r=!0):!o&&!r&&(a=setTimeout(l,t))}function c(){o=!0,a&&clearTimeout(a)}l();const u=(f,...d)=>{f(...d)};return{on:f=>{if(r)return u(f,e),{off:()=>{}};{const d=i.on(f);return s.add(d.off),i.on(f)}},off:i.off,trigger:i.trigger,clear:i.clear,cancel:c}}const lm=new WeakMap;function Yk(n){if(n=n||xT(),lm.has(n))return lm.get(n);const e=100,t=Date.now(),i=qk(()=>{if(Date.now()-t>=e)return!0;{const s=n.renderer.value,r=(s==null?void 0:s.domElement)||{width:0,height:0};return!!(s&&r.width>0&&r.height>0)}},n);return lm.set(n,i),i}function jk({scene:n,canvas:e,windowSize:t,rendererOptions:i,emit:s}){const r=De(n),o=Wk(t,e),{camera:a,cameras:l,registerCamera:c,deregisterCamera:u,setCameraActive:f}=Ok({sizes:o}),d={mode:et(i.renderMode||"always"),priority:et(0),frames:et(0),maxFrames:60,canBeInvalidated:Ee(()=>d.mode.value==="on-demand"&&d.frames.value===0)};function h(H=1){i.renderMode==="on-demand"&&(d.frames.value=Math.min(d.maxFrames,d.frames.value+H))}function p(){i.renderMode==="manual"&&(d.frames.value=1)}const{renderer:_}=Gk({canvas:e,options:i,contextParts:{sizes:o,render:d,invalidate:h,advance:p}}),g={sizes:o,scene:r,camera:a,cameras:Ui(l),renderer:_,raycaster:De(new tT),controls:et(null),perf:{maxFrames:160,fps:{value:0,accumulator:[]},memory:{currentMem:0,allocatedMem:0,accumulator:[]}},render:d,advance:p,extend:Cg,invalidate:h,registerCamera:c,setCameraActive:f,deregisterCamera:u,loop:Bk()};dr("useTres",g),g.scene.value.__tres={root:g},g.loop.register(()=>{a.value&&d.frames.value>0&&(_.value.render(n,a.value),s("render",g.renderer.value)),d.priority.value=0,d.mode.value==="always"?d.frames.value=1:d.frames.value=Math.max(0,d.frames.value-1)},"render");const{on:m,cancel:y}=Yk(g);g.loop.setReady(!1),g.loop.start(),m(()=>{s("ready",g),g.loop.setReady(!0),$k(n,g,s)}),ns(()=>{y(),g.loop.stop()});const b=100,v=FF({every:b}),{isSupported:T,memory:E}=kF({interval:b}),S=160;let P=performance.now();const x=({timestamp:H})=>{g.scene.value&&(g.perf.memory.allocatedMem=T_(g.scene.value)),H-P>=b&&(P=H,g.perf.fps.accumulator.push(v.value),g.perf.fps.accumulator.length>S&&g.perf.fps.accumulator.shift(),g.perf.fps.value=v.value,T.value&&E.value&&(g.perf.memory.accumulator.push(E.value.usedJSHeapSize/1024/1024),g.perf.memory.accumulator.length>S&&g.perf.memory.accumulator.shift(),g.perf.memory.currentMem=g.perf.memory.accumulator.reduce((Y,ee)=>Y+ee,0)/g.perf.memory.accumulator.length))};let M=0;const L=1,{pause:F}=E_(({delta:H})=>{window.__TRES__DEVTOOLS__&&(x({timestamp:performance.now()}),M+=H,M>=L&&(window.__TRES__DEVTOOLS__.cb(g),M=0))},{immediate:!0});return ns(()=>{F()}),g}function xT(){const n=En("useTres");if(!n)throw new Error("useTresContext must be used together with useTresContextProvider");return n}function pG(){const{camera:n,scene:e,renderer:t,loop:i,raycaster:s,controls:r,invalidate:o,advance:a}=xT();i.setContext({camera:n,scene:e,renderer:t,raycaster:s,controls:r,invalidate:o,advance:a});function l(f,d=0){return i.register(f,"before",d)}function c(f){return i.register(f,"render")}function u(f,d=0){return i.register(f,"after",d)}return{pause:i.pause,resume:i.resume,pauseRender:i.pauseRender,resumeRender:i.resumeRender,isActive:i.isActive,onBeforeRender:l,render:c,onAfterRender:u}}const Kk=pi(),Zk=pi(),MT=pi(),Ll=new Nh;let Tf=0,wf=0;E_(()=>{Kk.trigger({delta:Tf,elapsed:wf,clock:Ll}),Zk.trigger({delta:Tf,elapsed:wf,clock:Ll}),MT.trigger({delta:Tf,elapsed:wf,clock:Ll})},{immediate:!1});MT.on(()=>{Tf=Ll.getDelta(),wf=Ll.getElapsedTime()});function Jk(n,e={},t={}){let i=n;const s=a=>{i=a};let r=new Proxy({},{});const o={has(a,l){return l in e||l in i},get(a,l,c){return l in e?e[l](i):i[l]},set(a,l,c){const u=t[l];return u&&typeof u=="function"?u(c,i,r,s):i[l]=c,!0}};return r=new Proxy({},o),r}const{logError:Hb}=bT(),Gb=["onClick","onContextMenu","onPointerMove","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onDoubleClick","onPointerDown","onPointerUp","onPointerCancel","onPointerMissed","onLostPointerCapture","onWheel"],Qk=n=>{const e=n.scene.value;function t(c,u,f,d){if(d||(d={}),d.args||(d.args=[]),c==="template"||bk(c))return null;let h=c.replace("Tres",""),p;if(c==="primitive"){(!Hs(d.object)||Pt(d.object))&&Hb("Tres primitives need an 'object' prop, whose value is an object or shallowRef"),h=d.object.type;const _={};p=Jk(d.object,{object:g=>g,isPrimitive:()=>!0,__tres:()=>_},{object:(g,m,y,b)=>{Dk(g,y,b,{patchProp:r,remove:s,insert:i},n)},__tres:g=>{Object.assign(_,g)}})}else{const _=Ag.value[h];_||Hb(`${h} is not defined on the THREE namespace. Use extend to add it to the catalog.`),p=new _(...d.args)}return p?(p.isCamera&&(d!=null&&d.position||p.position.set(3,3,3),d!=null&&d.lookAt||p.lookAt(0,0,0)),p=no(p,{...p.__tres,type:h,memoizedProps:d,eventCount:0,primitive:c==="primitive",attach:d.attach},n),p):null}function i(c,u){var f,d,h;if(!c)return;u=u||e;const p=c.__tres?c:no(c,{},n),_=u.__tres?u:no(u,{},n);c=Ca(p),u=Ca(_),c.__tres&&((f=c.__tres)==null?void 0:f.eventCount)>0&&((d=n.eventManager)==null||d.registerObject(c)),n.registerCamera(c),(h=n.eventManager)==null||h.registerPointerMissedObject(c),p.__tres.attach?Pk(_,p,p.__tres.attach):ur(c)&&ur(_)&&(_.add(c),c.dispatchEvent({type:"added"})),p.__tres.parent=_,_.__tres.objects&&!_.__tres.objects.includes(p)&&_.__tres.objects.push(p)}function s(c,u){var f,d,h,p;if(!c)return;c!=null&&c.__tres&&((f=c.__tres)==null?void 0:f.eventCount)>0&&((d=n.eventManager)==null||d.deregisterObject(c)),u=Tg(u)?"default":u;const _=(h=c.__tres)==null?void 0:h.dispose;Tg(_)||(_===null?u=!1:u=_);const g=(p=c.__tres)==null?void 0:p.primitive,m=u==="default"?!g:!!u;if(c.__tres&&"objects"in c.__tres&&[...c.__tres.objects].forEach(y=>s(y,u)),m&&c.children&&[...c.children].forEach(y=>s(y,u)),vT(c,n),yT(c,n),m&&!_k(c)){if(ro(u))u(c);else if(ro(c.dispose))try{c.dispose()}catch{}}"__tres"in c&&delete c.__tres}function r(c,u,f,d){var h,p;if(!c)return;let _=c,g=u;if(c.__tres&&(c.__tres.memoizedProps[u]=d),u==="attach"){const v=((h=c.__tres)==null?void 0:h.parent)||c.parent;s(c),no(c,{attach:d},n),v&&i(c,v);return}if(u==="dispose"){c.__tres||(c=no(c,{},n)),c.__tres.dispose=d;return}if(ur(c)&&g==="blocks-pointer-events"){d||d===""?c[g]=d:delete c[g];return}Gb.includes(u)&&c.__tres&&(c.__tres.eventCount+=1);let m=ef(g),y=_==null?void 0:_[m];if(g==="args"){const v=c,T=f??[],E=d??[],S=((p=c.__tres)==null?void 0:p.type)||c.type;S&&T.length&&!Tk(T,E)&&(_=Object.assign(v,new Ag.value[S](...d)));return}if(_.type==="BufferGeometry"){if(g==="args")return;_.setAttribute(ef(g),new Ct(...d));return}if(g.includes("-")&&y===void 0){const v=g.split("-");y=v.reduce((T,E)=>T[ef(E)],_),g=v.pop(),m=g,y!=null&&y.set||(_=v.reduce((T,E)=>T[ef(E)],_))}let b=d;if(b===""&&(b=!0),ro(y)){Gb.includes(u)||(wd(b)?c[m](...b):c[m](b)),m.startsWith("on")&&ro(b)&&(_[m]=b);return}!(y!=null&&y.set)&&!ro(y)?_[m]=b:y.constructor===b.constructor&&y!=null&&y.copy?y==null||y.copy(b):wd(b)?y.set(...b):!y.isColor&&y.setScalar?y.setScalar(b):y.set(b),_T(c)}function o(c){var u;return((u=c==null?void 0:c.__tres)==null?void 0:u.parent)||null}function a(c){const u=no(new ht,{type:"Comment"},n);return u.name=c,u}function l(c){var u;const f=o(c),d=((u=f==null?void 0:f.__tres)==null?void 0:u.objects)||[],h=d.indexOf(c);return h<0||h>=d.length-1?null:d[h+1]}return{insert:i,remove:s,createElement:t,patchProp:r,parentNode:o,createText:()=>{},createComment:a,setText:()=>{},setElementText:()=>{},nextSibling:l,querySelector:()=>{},setScopeId:()=>{},cloneNode:()=>{},insertStaticContent:()=>{}}};function eB(){return ST().__VUE_DEVTOOLS_GLOBAL_HOOK__}function ST(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const tB=typeof Proxy=="function",nB="devtools-plugin:setup",iB="plugin:settings:set";let ol,Rg;function sB(){var n;return ol!==void 0||(typeof window<"u"&&window.performance?(ol=!0,Rg=window.performance):typeof globalThis<"u"&&!((n=globalThis.perf_hooks)===null||n===void 0)&&n.performance?(ol=!0,Rg=globalThis.perf_hooks.performance):ol=!1),ol}function rB(){return sB()?Rg.now():Date.now()}class oB{constructor(e,t){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=t;const i={};if(e.settings)for(const o in e.settings){const a=e.settings[o];i[o]=a.defaultValue}const s=`__vue-devtools-plugin-settings__${e.id}`;let r=Object.assign({},i);try{const o=localStorage.getItem(s),a=JSON.parse(o);Object.assign(r,a)}catch{}this.fallbacks={getSettings(){return r},setSettings(o){try{localStorage.setItem(s,JSON.stringify(o))}catch{}r=o},now(){return rB()}},t&&t.on(iB,(o,a)=>{o===this.plugin.id&&this.fallbacks.setSettings(a)}),this.proxiedOn=new Proxy({},{get:(o,a)=>this.target?this.target.on[a]:(...l)=>{this.onQueue.push({method:a,args:l})}}),this.proxiedTarget=new Proxy({},{get:(o,a)=>this.target?this.target[a]:a==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(a)?(...l)=>(this.targetQueue.push({method:a,args:l,resolve:()=>{}}),this.fallbacks[a](...l)):(...l)=>new Promise(c=>{this.targetQueue.push({method:a,args:l,resolve:c})})})}async setRealTarget(e){this.target=e;for(const t of this.onQueue)this.target.on[t.method](...t.args);for(const t of this.targetQueue)t.resolve(await this.target[t.method](...t.args))}}function aB(n,e){const t=n,i=ST(),s=eB(),r=tB&&t.enableEarlyProxy;if(s&&(i.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!r))s.emit(nB,n,e);else{const o=r?new oB(t,s):null;(i.__VUE_DEVTOOLS_PLUGINS__=i.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:t,setupFn:e,proxy:o}),o&&e(o.proxiedTarget)}}function lB(n,e){const t=`▲ ■ ●${n}`;typeof Wb=="function"?Wb(t,e):console.log(t)}function Wb(n,e){throw new Error(n+e)}const ET=n=>{const e={id:n.uuid,label:n.type,children:[],tags:[]};n.name!==""&&e.tags.push({label:n.name,textColor:5750629,backgroundColor:15793395});const t=T_(n);return t>0&&e.tags.push({label:`${zk(t)} KB`,textColor:15707189,backgroundColor:16775644,tooltip:"Memory usage"}),n.type.includes("Light")&&(mk(n)&&e.tags.push({label:`${n.intensity}`,textColor:9738662,backgroundColor:16316922,tooltip:"Intensity"}),e.tags.push({label:`#${new Ce(n.color).getHexString()}`,textColor:9738662,backgroundColor:16316922,tooltip:"Color"})),n.type.includes("Camera")&&(e.tags.push({label:`${n.fov}°`,textColor:9738662,backgroundColor:16316922,tooltip:"Field of view"}),e.tags.push({label:`x: ${Math.round(n.position.x)} y: ${Math.round(n.position.y)} z: ${Math.round(n.position.z)}`,textColor:9738662,backgroundColor:16316922,tooltip:"Position"})),e};function TT(n,e,t=""){n.children.forEach(i=>{if(i.type==="HightlightMesh"||t&&!i.type.includes(t)&&!i.name.includes(t))return;const s=ET(i);e.children.push(s),TT(i,s,t)})}const cB=[],al="tres:inspector",uB=bi({sceneGraph:null});function fB(n,e){aB({id:"dev.esm.tres",label:"TresJS 🪐",logo:"https://raw.githubusercontent.com/Tresjs/tres/main/public/favicon.svg",packageName:"tresjs",homepage:"https://tresjs.org",componentStateTypes:cB,app:n},t=>{typeof t.now!="function"&&lB("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."),t.addInspector({id:al,label:"TresJS 🪐",icon:"account_tree",treeFilterPlaceholder:"Search instances"}),setInterval(()=>{t.sendInspectorTree(al)},1e3),setInterval(()=>{t.notifyComponentUpdate()},5e3),t.on.getInspectorTree(r=>{if(r.inspectorId===al){const o=ET(e.scene.value);TT(e.scene.value,o,r.filter),uB.sceneGraph=o,r.rootNodes=[o]}});let i=null,s=null;t.on.getInspectorState(r=>{var o;if(r.inspectorId===al){const[a]=e.scene.value.getObjectsByProperty("uuid",r.nodeId);if(!a)return;if(s&&i&&i.parent&&s.remove(i),a.isMesh){const l=Ak(a);a.add(l),i=l,s=a}r.state={object:Object.entries(a).map(([l,c])=>l==="children"?{key:l,value:c.filter(u=>u.type!=="HightlightMesh")}:{key:l,value:c,editable:!0}).filter(({key:l})=>l!=="parent")},a.isScene&&(r.state={...r.state,state:[{key:"Scene Info",value:{objects:a.children.length,memory:T_(a),calls:e.renderer.value.info.render.calls,triangles:e.renderer.value.info.render.triangles,points:e.renderer.value.info.render.points,lines:e.renderer.value.info.render.lines}},{key:"Programs",value:((o=e.renderer.value.info.programs)==null?void 0:o.map(l=>({...l,programName:l.name})))||[]}]})}}),t.on.editInspectorState(r=>{r.inspectorId===al&&wk(e.scene.value,r.nodeId,r.path,r.state.value)})})}const dB=["data-scene","data-tres"],hB=fn({__name:"TresCanvas",props:{shadows:{type:Boolean,default:void 0},clearColor:{},toneMapping:{},shadowMapType:{},useLegacyLights:{type:Boolean,default:void 0},outputColorSpace:{},toneMappingExposure:{},renderMode:{default:"always"},dpr:{},camera:{},preset:{},windowSize:{type:Boolean,default:void 0},enableProvideBridge:{type:Boolean,default:!0},context:{},alpha:{type:Boolean,default:void 0},premultipliedAlpha:{type:Boolean},antialias:{type:Boolean,default:void 0},stencil:{type:Boolean,default:void 0},preserveDrawingBuffer:{type:Boolean,default:void 0},powerPreference:{},depth:{type:Boolean,default:void 0},failIfMajorPerformanceCaveat:{type:Boolean,default:void 0},precision:{},logarithmicDepthBuffer:{type:Boolean,default:void 0},reverseDepthBuffer:{type:Boolean}},emits:["render","click","double-click","context-menu","pointer-move","pointer-up","pointer-down","pointer-enter","pointer-leave","pointer-over","pointer-out","pointer-missed","wheel","ready"],setup(n,{expose:e,emit:t}){const i=n,s=t,r=A0(),o=et(),a=De(new gh),l=wn();Cg(gF);const c=(p,_=!1)=>fn({setup(){var g;const m=(g=wn())==null?void 0:g.appContext;m&&(m.app=l==null?void 0:l.appContext.app);const y={};function b(v){v&&(v.parent&&b(v.parent),v.provides&&Object.assign(y,v.provides))}return l!=null&&l.parent&&i.enableProvideBridge&&(b(l.parent),Reflect.ownKeys(y).forEach(v=>{dr(v,y[v])})),dr("useTres",p),dr("extend",Cg),typeof window<"u"&&fB(m==null?void 0:m.app,p),()=>Ds(jt,null,_?[]:r.default())}}),u=(p,_=!1)=>{const g=c(p,_),{render:m}=WS(Qk(p));m(Ds(g),a.value)},f=(p,_=!1)=>{gT(p.scene.value),_&&(p.renderer.value.dispose(),p.renderer.value.renderLists.dispose(),p.renderer.value.forceContextLoss()),a.value.__tres={root:p}},d=De(null);e({context:d,dispose:()=>f(d.value,!0)});const h=()=>{f(d.value),u(d.value,!0)};return Hn(()=>{const p=o;d.value=jk({scene:a.value,canvas:p,windowSize:i.windowSize??!1,rendererOptions:i,emit:s});const{registerCamera:_,camera:g,cameras:m,deregisterCamera:y}=d.value;u(d.value);const b=()=>{const v=new Kt(45,window.innerWidth/window.innerHeight,.1,1e3);v.position.set(3,3,3),v.lookAt(0,0,0),_(v);const T=Rc(()=>{m.value.length>=2&&(v.removeFromParent(),y(v),T==null||T())})};$e(()=>i.camera,(v,T)=>{v&&_(v),T&&(T.removeFromParent(),y(T))},{immediate:!0}),g.value||b()}),ns(h),(p,_)=>(mn(),vi("canvas",{ref_key:"canvas",ref:o,"data-scene":a.value.uuid,class:Oa(p.$attrs.class),"data-tres":`tresjs ${Ot(uk).version}`,style:Mi({display:"block",width:"100%",height:"100%",position:p.windowSize?"fixed":"relative",top:0,left:0,pointerEvents:"auto",touchAction:"none",...p.$attrs.style})},null,14,dB))}}),pB={install(n){n.component("TresCanvas",hB)}};function cm(n){if(n===null||typeof n!="object")return!1;const e=Object.getPrototypeOf(n);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in n?!1:Symbol.toStringTag in n?Object.prototype.toString.call(n)==="[object Module]":!0}function Pg(n,e,t=".",i){if(!cm(e))return Pg(n,{},t,i);const s=Object.assign({},e);for(const r in n){if(r==="__proto__"||r==="constructor")continue;const o=n[r];o!=null&&(i&&i(s,r,o,t)||(Array.isArray(o)&&Array.isArray(s[r])?s[r]=[...o,...s[r]]:cm(o)&&cm(s[r])?s[r]=Pg(o,s[r],(t?`${t}.`:"")+r.toString(),i):s[r]=o))}return s}function mB(n){return(...e)=>e.reduce((t,i)=>Pg(t,i,"",n),{})}const wT=mB();function Cr(n){return Xd()?(_0(n),!0):!1}function Xb(){const n=new Set,e=r=>{n.delete(r)};return{on:r=>{n.add(r);const o=()=>e(r);return Cr(o),{off:o}},off:e,trigger:(...r)=>Promise.all(Array.from(n).map(o=>o(...r))),clear:()=>{n.clear()}}}const um=new WeakMap,gB=(...n)=>{var e;const t=n[0],i=(e=wn())==null?void 0:e.proxy;if(i==null&&!Cc())throw new Error("injectLocal must be called in setup");return i&&um.has(i)&&t in um.get(i)?um.get(i)[t]:En(...n)},Xc=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const AT=n=>n!=null,_B=Object.prototype.toString,Cd=n=>_B.call(n)==="[object Object]",es=()=>{},vB=(n,e)=>Object.prototype.hasOwnProperty.call(n,e);function CT(...n){if(n.length!==1)return cS(...n);const e=n[0];return typeof e=="function"?Ui(S0(()=>({get:e,set:es}))):et(e)}function w_(n,e){function t(...i){return new Promise((s,r)=>{Promise.resolve(n(()=>e.apply(this,i),{fn:e,thisArg:this,args:i})).then(s).catch(r)})}return t}const RT=n=>n();function PT(n,e={}){let t,i,s=es;const r=l=>{clearTimeout(l),s(),s=es};let o;return l=>{const c=nt(n),u=nt(e.maxWait);return t&&r(t),c<=0||u!==void 0&&u<=0?(i&&(r(i),i=null),Promise.resolve(l())):new Promise((f,d)=>{s=e.rejectOnCancel?d:f,o=l,u&&!i&&(i=setTimeout(()=>{t&&r(t),i=null,f(o())},u)),t=setTimeout(()=>{i&&r(i),i=null,f(l())},c)})}}function yB(...n){let e=0,t,i=!0,s=es,r,o,a,l,c;!Pt(n[0])&&typeof n[0]=="object"?{delay:o,trailing:a=!0,leading:l=!0,rejectOnCancel:c=!1}=n[0]:[o,a=!0,l=!0,c=!1]=n;const u=()=>{t&&(clearTimeout(t),t=void 0,s(),s=es)};return d=>{const h=nt(o),p=Date.now()-e,_=()=>r=d();return u(),h<=0?(e=Date.now(),_()):(p>h&&(l||!i)?(e=Date.now(),_()):a&&(r=new Promise((g,m)=>{s=c?m:g,t=setTimeout(()=>{e=Date.now(),i=!0,g(_()),u()},Math.max(0,h-p))})),!l&&!t&&(t=setTimeout(()=>i=!0,h)),i=!1,r)}}function bB(n=RT,e={}){const{initialState:t="active"}=e,i=CT(t==="active");function s(){i.value=!1}function r(){i.value=!0}const o=(...a)=>{i.value&&n(...a)};return{isActive:Ui(i),pause:s,resume:r,eventFilter:o}}function xB(n){let e;function t(){return e||(e=n()),e}return t.reset=async()=>{const i=e;e=void 0,i&&await i},t}function MB(n,e){var t;if(typeof n=="number")return n+e;const i=((t=n.match(/^-?\d+\.?\d*/))==null?void 0:t[0])||"",s=n.slice(i.length),r=Number.parseFloat(i)+e;return Number.isNaN(r)?n:r+s}function Dl(n){return n.endsWith("rem")?Number.parseFloat(n)*16:Number.parseFloat(n)}function Ol(n){return Array.isArray(n)?n:[n]}function IT(n){return wn()}function A_(n,e=200,t={}){return w_(PT(e,t),n)}function mG(n,e=200,t={}){const i=et(nt(n)),s=A_(()=>{i.value=n.value},e,t);return $e(n,()=>s()),rS(i)}function SB(n,e=200,t=!1,i=!0,s=!1){return w_(yB(e,t,i,s),n)}function LT(n,e,t={}){const{eventFilter:i=RT,...s}=t;return $e(n,w_(i,e),s)}function EB(n,e,t={}){const{eventFilter:i,initialState:s="active",...r}=t,{eventFilter:o,pause:a,resume:l,isActive:c}=bB(i,{initialState:s});return{stop:LT(n,e,{...r,eventFilter:o}),pause:a,resume:l,isActive:c}}function Va(n,e=!0,t){IT()?Hn(n,t):e?n():Er(n)}function TB(n,e){IT()&&ns(n,e)}function wB(n,e,t={}){const{immediate:i=!0,immediateCallback:s=!1}=t,r=De(!1);let o=null;function a(){o&&(clearTimeout(o),o=null)}function l(){r.value=!1,a()}function c(...u){s&&n(),a(),r.value=!0,o=setTimeout(()=>{r.value=!1,o=null,n(...u)},nt(e))}return i&&(r.value=!0,Xc&&c()),Cr(l),{isPending:rS(r),start:c,stop:l}}function gG(n,e,t={}){const{debounce:i=0,maxWait:s=void 0,...r}=t;return LT(n,e,{...r,eventFilter:PT(i,{maxWait:s})})}function AB(n,e,t){return $e(n,e,{...t,immediate:!0})}const Qn=Xc?window:void 0,CB=Xc?window.document:void 0,C_=Xc?window.navigator:void 0;function oi(n){var e;const t=nt(n);return(e=t==null?void 0:t.$el)!=null?e:t}function Ft(...n){const e=[],t=()=>{e.forEach(a=>a()),e.length=0},i=(a,l,c,u)=>(a.addEventListener(l,c,u),()=>a.removeEventListener(l,c,u)),s=Ee(()=>{const a=Ol(nt(n[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),r=AB(()=>{var a,l;return[(l=(a=s.value)==null?void 0:a.map(c=>oi(c)))!=null?l:[Qn].filter(c=>c!=null),Ol(nt(s.value?n[1]:n[0])),Ol(Ot(s.value?n[2]:n[1])),nt(s.value?n[3]:n[2])]},([a,l,c,u])=>{if(t(),!(a!=null&&a.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const f=Cd(u)?{...u}:u;e.push(...a.flatMap(d=>l.flatMap(h=>c.map(p=>i(d,h,p,f)))))},{flush:"post"}),o=()=>{r(),t()};return Cr(t),o}function RB(){const n=De(!1),e=wn();return e&&Hn(()=>{n.value=!0},e),n}function Po(n){const e=RB();return Ee(()=>(e.value,!!n()))}function DT(n,e,t={}){const{window:i=Qn,...s}=t;let r;const o=Po(()=>i&&"MutationObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=Ee(()=>{const d=nt(n),h=Ol(d).map(oi).filter(AT);return new Set(h)}),c=$e(()=>l.value,d=>{a(),o.value&&d.size&&(r=new MutationObserver(e),d.forEach(h=>r.observe(h,s)))},{immediate:!0,flush:"post"}),u=()=>r==null?void 0:r.takeRecords(),f=()=>{c(),a()};return Cr(f),{isSupported:o,stop:f,takeRecords:u}}const PB=Symbol("vueuse-ssr-width");function OT(){const n=Cc()?gB(PB,null):null;return typeof n=="number"?n:void 0}function oo(n,e={}){const{window:t=Qn,ssrWidth:i=OT()}=e,s=Po(()=>t&&"matchMedia"in t&&typeof t.matchMedia=="function"),r=De(typeof i=="number"),o=De(),a=De(!1),l=c=>{a.value=c.matches};return Rc(()=>{if(r.value){r.value=!s.value;const c=nt(n).split(",");a.value=c.some(u=>{const f=u.includes("not all"),d=u.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),h=u.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let p=!!(d||h);return d&&p&&(p=i>=Dl(d[1])),h&&p&&(p=i<=Dl(h[1])),f?!p:p});return}s.value&&(o.value=t.matchMedia(nt(n)),a.value=o.value.matches)}),Ft(o,"change",l,{passive:!0}),Ee(()=>a.value)}const _G={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function vG(n,e={}){function t(h,p){let _=nt(n[nt(h)]);return p!=null&&(_=MB(_,p)),typeof _=="number"&&(_=`${_}px`),_}const{window:i=Qn,strategy:s="min-width",ssrWidth:r=OT()}=e,o=typeof r=="number",a=o?De(!1):{value:!0};o&&Va(()=>a.value=!!i);function l(h,p){return!a.value&&o?h==="min"?r>=Dl(p):r<=Dl(p):i?i.matchMedia(`(${h}-width: ${p})`).matches:!1}const c=h=>oo(()=>`(min-width: ${t(h)})`,e),u=h=>oo(()=>`(max-width: ${t(h)})`,e),f=Object.keys(n).reduce((h,p)=>(Object.defineProperty(h,p,{get:()=>s==="min-width"?c(p):u(p),enumerable:!0,configurable:!0}),h),{});function d(){const h=Object.keys(n).map(p=>[p,f[p],Dl(t(p))]).sort((p,_)=>p[2]-_[2]);return Ee(()=>h.filter(([,p])=>p.value).map(([p])=>p))}return Object.assign(f,{greaterOrEqual:c,smallerOrEqual:u,greater(h){return oo(()=>`(min-width: ${t(h,.1)})`,e)},smaller(h){return oo(()=>`(max-width: ${t(h,-.1)})`,e)},between(h,p){return oo(()=>`(min-width: ${t(h)}) and (max-width: ${t(p,-.1)})`,e)},isGreater(h){return l("min",t(h,.1))},isGreaterOrEqual(h){return l("min",t(h))},isSmaller(h){return l("max",t(h,-.1))},isSmallerOrEqual(h){return l("max",t(h))},isInBetween(h,p){return l("min",t(h))&&l("max",t(p,-.1))},current:d,active(){const h=d();return Ee(()=>h.value.length===0?"":h.value.at(s==="min-width"?-1:0))}})}function Ig(n,e={}){const{controls:t=!1,navigator:i=C_}=e,s=Po(()=>i&&"permissions"in i),r=De(),o=typeof n=="string"?{name:n}:n,a=De(),l=()=>{var u,f;a.value=(f=(u=r.value)==null?void 0:u.state)!=null?f:"prompt"};Ft(r,"change",l,{passive:!0});const c=xB(async()=>{if(s.value){if(!r.value)try{r.value=await i.permissions.query(o)}catch{r.value=void 0}finally{l()}if(t)return ut(r.value)}});return c(),t?{state:a,isSupported:s,query:c}:a}function yG(n={}){const{navigator:e=C_,read:t=!1,source:i,copiedDuring:s=1500,legacy:r=!1}=n,o=Po(()=>e&&"clipboard"in e),a=Ig("clipboard-read"),l=Ig("clipboard-write"),c=Ee(()=>o.value||r),u=De(""),f=De(!1),d=wB(()=>f.value=!1,s,{immediate:!1});async function h(){let y=!(o.value&&m(a.value));if(!y)try{u.value=await e.clipboard.readText()}catch{y=!0}y&&(u.value=g())}c.value&&t&&Ft(["copy","cut"],h,{passive:!0});async function p(y=nt(i)){if(c.value&&y!=null){let b=!(o.value&&m(l.value));if(!b)try{await e.clipboard.writeText(y)}catch{b=!0}b&&_(y),u.value=y,f.value=!0,d.start()}}function _(y){const b=document.createElement("textarea");b.value=y??"",b.style.position="absolute",b.style.opacity="0",document.body.appendChild(b),b.select(),document.execCommand("copy"),b.remove()}function g(){var y,b,v;return(v=(b=(y=document==null?void 0:document.getSelection)==null?void 0:y.call(document))==null?void 0:b.toString())!=null?v:""}function m(y){return y==="granted"||y==="prompt"}return{isSupported:c,text:u,copied:f,copy:p}}const nf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},sf="__vueuse_ssr_handlers__",IB=LB();function LB(){return sf in nf||(nf[sf]=nf[sf]||{}),nf[sf]}function NT(n,e){return IB[n]||e}function DB(n){return oo("(prefers-color-scheme: dark)",n)}function OB(n){return n==null?"any":n instanceof Set?"set":n instanceof Map?"map":n instanceof Date?"date":typeof n=="boolean"?"boolean":typeof n=="string"?"string":typeof n=="object"?"object":Number.isNaN(n)?"any":"number"}const NB={boolean:{read:n=>n==="true",write:n=>String(n)},object:{read:n=>JSON.parse(n),write:n=>JSON.stringify(n)},number:{read:n=>Number.parseFloat(n),write:n=>String(n)},any:{read:n=>n,write:n=>String(n)},string:{read:n=>n,write:n=>String(n)},map:{read:n=>new Map(JSON.parse(n)),write:n=>JSON.stringify(Array.from(n.entries()))},set:{read:n=>new Set(JSON.parse(n)),write:n=>JSON.stringify(Array.from(n))},date:{read:n=>new Date(n),write:n=>n.toISOString()}},$b="vueuse-storage";function UT(n,e,t,i={}){var s;const{flush:r="pre",deep:o=!0,listenToStorageChanges:a=!0,writeDefaults:l=!0,mergeDefaults:c=!1,shallow:u,window:f=Qn,eventFilter:d,onError:h=L=>{console.error(L)},initOnMounted:p}=i,_=(u?De:et)(typeof e=="function"?e():e),g=Ee(()=>nt(n));if(!t)try{t=NT("getDefaultStorage",()=>{var L;return(L=Qn)==null?void 0:L.localStorage})()}catch(L){h(L)}if(!t)return _;const m=nt(e),y=OB(m),b=(s=i.serializer)!=null?s:NB[y],{pause:v,resume:T}=EB(_,()=>S(_.value),{flush:r,deep:o,eventFilter:d});$e(g,()=>x(),{flush:r}),f&&a&&Va(()=>{t instanceof Storage?Ft(f,"storage",x,{passive:!0}):Ft(f,$b,M),p&&x()}),p||x();function E(L,F){if(f){const H={key:g.value,oldValue:L,newValue:F,storageArea:t};f.dispatchEvent(t instanceof Storage?new StorageEvent("storage",H):new CustomEvent($b,{detail:H}))}}function S(L){try{const F=t.getItem(g.value);if(L==null)E(F,null),t.removeItem(g.value);else{const H=b.write(L);F!==H&&(t.setItem(g.value,H),E(F,H))}}catch(F){h(F)}}function P(L){const F=L?L.newValue:t.getItem(g.value);if(F==null)return l&&m!=null&&t.setItem(g.value,b.write(m)),m;if(!L&&c){const H=b.read(F);return typeof c=="function"?c(H,m):y==="object"&&!Array.isArray(H)?{...m,...H}:H}else return typeof F!="string"?F:b.read(F)}function x(L){if(!(L&&L.storageArea!==t)){if(L&&L.key==null){_.value=m;return}if(!(L&&L.key!==g.value)){v();try{(L==null?void 0:L.newValue)!==b.write(_.value)&&(_.value=P(L))}catch(F){h(F)}finally{L?Er(T):T()}}}}function M(L){x(L.detail)}return _}const UB="*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function FB(n={}){const{selector:e="html",attribute:t="class",initialValue:i="auto",window:s=Qn,storage:r,storageKey:o="vueuse-color-scheme",listenToStorageChanges:a=!0,storageRef:l,emitAuto:c,disableTransition:u=!0}=n,f={auto:"",light:"light",dark:"dark",...n.modes||{}},d=DB({window:s}),h=Ee(()=>d.value?"dark":"light"),p=l||(o==null?CT(i):UT(o,i,r,{window:s,listenToStorageChanges:a})),_=Ee(()=>p.value==="auto"?h.value:p.value),g=NT("updateHTMLAttrs",(v,T,E)=>{const S=typeof v=="string"?s==null?void 0:s.document.querySelector(v):oi(v);if(!S)return;const P=new Set,x=new Set;let M=null;if(T==="class"){const F=E.split(/\s/g);Object.values(f).flatMap(H=>(H||"").split(/\s/g)).filter(Boolean).forEach(H=>{F.includes(H)?P.add(H):x.add(H)})}else M={key:T,value:E};if(P.size===0&&x.size===0&&M===null)return;let L;u&&(L=s.document.createElement("style"),L.appendChild(document.createTextNode(UB)),s.document.head.appendChild(L));for(const F of P)S.classList.add(F);for(const F of x)S.classList.remove(F);M&&S.setAttribute(M.key,M.value),u&&(s.getComputedStyle(L).opacity,document.head.removeChild(L))});function m(v){var T;g(e,t,(T=f[v])!=null?T:v)}function y(v){n.onChanged?n.onChanged(v,m):m(v)}$e(_,y,{flush:"post",immediate:!0}),Va(()=>y(_.value));const b=Ee({get(){return c?p.value:_.value},set(v){p.value=v}});return Object.assign(b,{store:p,system:h,state:_})}function rf(n,e,t={}){const{window:i=Qn,initialValue:s,observe:r=!1}=t,o=De(s),a=Ee(()=>{var c;return oi(e)||((c=i==null?void 0:i.document)==null?void 0:c.documentElement)});function l(){var c;const u=nt(n),f=nt(a);if(f&&i&&u){const d=(c=i.getComputedStyle(f).getPropertyValue(u))==null?void 0:c.trim();o.value=d||o.value||s}}return r&&DT(a,l,{attributeFilter:["style","class"],window:i}),$e([a,()=>nt(n)],(c,u)=>{u[0]&&u[1]&&u[0].style.removeProperty(u[1]),l()},{immediate:!0}),$e([o,a],([c,u])=>{const f=nt(n);u!=null&&u.style&&f&&(c==null?u.style.removeProperty(f):u.style.setProperty(f,c))},{immediate:!0}),o}function kB(n={}){const{valueDark:e="dark",valueLight:t=""}=n,i=FB({...n,onChanged:(o,a)=>{var l;n.onChanged?(l=n.onChanged)==null||l.call(n,o==="dark",a,o):a(o)},modes:{dark:e,light:t}}),s=Ee(()=>i.system.value);return Ee({get(){return i.value==="dark"},set(o){const a=o?"dark":"light";s.value===a?i.value="auto":i.value=a}})}function BB(n={}){const{navigator:e=C_,requestPermissions:t=!1,constraints:i={audio:!0,video:!0},onUpdated:s}=n,r=et([]),o=Ee(()=>r.value.filter(p=>p.kind==="videoinput")),a=Ee(()=>r.value.filter(p=>p.kind==="audioinput")),l=Ee(()=>r.value.filter(p=>p.kind==="audiooutput")),c=Po(()=>e&&e.mediaDevices&&e.mediaDevices.enumerateDevices),u=De(!1);let f;async function d(){c.value&&(r.value=await e.mediaDevices.enumerateDevices(),s==null||s(r.value),f&&(f.getTracks().forEach(p=>p.stop()),f=null))}async function h(){const p=i.video?"camera":"microphone";if(!c.value)return!1;if(u.value)return!0;const{state:_,query:g}=Ig(p,{controls:!0});if(await g(),_.value!=="granted"){let m=!0;try{f=await e.mediaDevices.getUserMedia(i)}catch{f=null,m=!1}d(),u.value=m}else u.value=!0;return u.value}return c.value&&(t&&h(),Ft(e.mediaDevices,"devicechange",d,{passive:!0}),d()),{devices:r,ensurePermissions:h,permissionGranted:u,videoInputs:o,audioInputs:a,audioOutputs:l,isSupported:c}}function zB(n,e,t={}){const{window:i=Qn,...s}=t;let r;const o=Po(()=>i&&"ResizeObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=Ee(()=>{const f=nt(n);return Array.isArray(f)?f.map(d=>oi(d)):[oi(f)]}),c=$e(l,f=>{if(a(),o.value&&i){r=new ResizeObserver(e);for(const d of f)d&&r.observe(d,s)}},{immediate:!0,flush:"post"}),u=()=>{a(),c()};return Cr(u),{isSupported:o,stop:u}}function bG(n,e={}){const{reset:t=!0,windowResize:i=!0,windowScroll:s=!0,immediate:r=!0,updateTiming:o="sync"}=e,a=De(0),l=De(0),c=De(0),u=De(0),f=De(0),d=De(0),h=De(0),p=De(0);function _(){const m=oi(n);if(!m){t&&(a.value=0,l.value=0,c.value=0,u.value=0,f.value=0,d.value=0,h.value=0,p.value=0);return}const y=m.getBoundingClientRect();a.value=y.height,l.value=y.bottom,c.value=y.left,u.value=y.right,f.value=y.top,d.value=y.width,h.value=y.x,p.value=y.y}function g(){o==="sync"?_():o==="next-frame"&&requestAnimationFrame(()=>_())}return zB(n,g),$e(()=>oi(n),m=>!m&&g()),DT(n,g,{attributeFilter:["style","class"]}),s&&Ft("scroll",g,{capture:!0,passive:!0}),i&&Ft("resize",g,{passive:!0}),Va(()=>{r&&g()}),{height:a,bottom:l,left:c,right:u,top:f,width:d,x:h,y:p,update:g}}function VB(n,e,t={}){const{root:i,rootMargin:s="0px",threshold:r=0,window:o=Qn,immediate:a=!0}=t,l=Po(()=>o&&"IntersectionObserver"in o),c=Ee(()=>{const p=nt(n);return Ol(p).map(oi).filter(AT)});let u=es;const f=De(a),d=l.value?$e(()=>[c.value,oi(i),f.value],([p,_])=>{if(u(),!f.value||!p.length)return;const g=new IntersectionObserver(e,{root:oi(_),rootMargin:s,threshold:r});p.forEach(m=>m&&g.observe(m)),u=()=>{g.disconnect(),u=es}},{immediate:a,flush:"post"}):es,h=()=>{u(),d(),f.value=!1};return Cr(h),{isSupported:l,isActive:f,pause(){u(),f.value=!1},resume(){f.value=!0},stop:h}}const HB={multiple:!0,accept:"*",reset:!1,directory:!1};function GB(n){if(!n)return null;if(n instanceof FileList)return n;const e=new DataTransfer;for(const t of n)e.items.add(t);return e.files}function xG(n={}){const{document:e=CB}=n,t=et(GB(n.initialFiles)),{on:i,trigger:s}=Xb(),{on:r,trigger:o}=Xb();let a;e&&(a=e.createElement("input"),a.type="file",a.onchange=u=>{const f=u.target;t.value=f.files,s(t.value)},a.oncancel=()=>{o()});const l=()=>{t.value=null,a&&a.value&&(a.value="",s(null))},c=u=>{if(!a)return;const f={...HB,...n,...u};a.multiple=f.multiple,a.accept=f.accept,a.webkitdirectory=f.directory,vB(f,"capture")&&(a.capture=f.capture),f.reset&&l(),a.click()};return{files:Ui(t),open:c,reset:l,onCancel:r,onChange:i}}const qb=1;function MG(n,e={}){const{throttle:t=0,idle:i=200,onStop:s=es,onScroll:r=es,offset:o={left:0,right:0,top:0,bottom:0},eventListenerOptions:a={capture:!1,passive:!0},behavior:l="auto",window:c=Qn,onError:u=S=>{console.error(S)}}=e,f=De(0),d=De(0),h=Ee({get(){return f.value},set(S){_(S,void 0)}}),p=Ee({get(){return d.value},set(S){_(void 0,S)}});function _(S,P){var x,M,L,F;if(!c)return;const H=nt(n);if(!H)return;(L=H instanceof Document?c.document.body:H)==null||L.scrollTo({top:(x=nt(P))!=null?x:p.value,left:(M=nt(S))!=null?M:h.value,behavior:nt(l)});const Y=((F=H==null?void 0:H.document)==null?void 0:F.documentElement)||(H==null?void 0:H.documentElement)||H;h!=null&&(f.value=Y.scrollLeft),p!=null&&(d.value=Y.scrollTop)}const g=De(!1),m=bi({left:!0,right:!1,top:!0,bottom:!1}),y=bi({left:!1,right:!1,top:!1,bottom:!1}),b=S=>{g.value&&(g.value=!1,y.left=!1,y.right=!1,y.top=!1,y.bottom=!1,s(S))},v=A_(b,t+i),T=S=>{var P;if(!c)return;const x=((P=S==null?void 0:S.document)==null?void 0:P.documentElement)||(S==null?void 0:S.documentElement)||oi(S),{display:M,flexDirection:L,direction:F}=getComputedStyle(x),H=F==="rtl"?-1:1,Y=x.scrollLeft;y.left=Yf.value;const ee=Math.abs(Y*H)<=(o.left||0),K=Math.abs(Y*H)+x.clientWidth>=x.scrollWidth-(o.right||0)-qb;M==="flex"&&L==="row-reverse"?(m.left=K,m.right=ee):(m.left=ee,m.right=K),f.value=Y;let Q=x.scrollTop;S===c.document&&!Q&&(Q=c.document.body.scrollTop),y.top=Qd.value;const Z=Math.abs(Q)<=(o.top||0),he=Math.abs(Q)+x.clientHeight>=x.scrollHeight-(o.bottom||0)-qb;M==="flex"&&L==="column-reverse"?(m.top=he,m.bottom=Z):(m.top=Z,m.bottom=he),d.value=Q},E=S=>{var P;if(!c)return;const x=(P=S.target.documentElement)!=null?P:S.target;T(x),g.value=!0,v(S),r(S)};return Ft(n,"scroll",t?SB(E,t,!0,!1):E,a),Va(()=>{try{const S=nt(n);if(!S)return;T(S)}catch(S){u(S)}}),Ft(n,"scrollend",b,a),{x:h,y:p,isScrolling:g,arrivedState:m,directions:y,measure(){const S=nt(n);c&&S&&T(S)}}}function gs(n,e,t={}){const{window:i=Qn}=t;return UT(n,e,i==null?void 0:i.localStorage,t)}function SG(n){const e=De(),t=()=>{e.value&&URL.revokeObjectURL(e.value),e.value=void 0};return $e(()=>nt(n),i=>{t(),i&&(e.value=URL.createObjectURL(i))},{immediate:!0}),Cr(t),Ui(e)}const Yb="--vueuse-safe-area-top",jb="--vueuse-safe-area-right",Kb="--vueuse-safe-area-bottom",Zb="--vueuse-safe-area-left";function EG(){const n=De(""),e=De(""),t=De(""),i=De("");if(Xc){const r=rf(Yb),o=rf(jb),a=rf(Kb),l=rf(Zb);r.value="env(safe-area-inset-top, 0px)",o.value="env(safe-area-inset-right, 0px)",a.value="env(safe-area-inset-bottom, 0px)",l.value="env(safe-area-inset-left, 0px)",s(),Ft("resize",A_(s),{passive:!0})}function s(){n.value=of(Yb),e.value=of(jb),t.value=of(Kb),i.value=of(Zb)}return{top:n,right:e,bottom:t,left:i,update:s}}function of(n){return getComputedStyle(document.documentElement).getPropertyValue(n)}function TG(n,e,t){const{window:i=Qn}={},s=et(null),r=De(),o=(...l)=>{r.value&&r.value.postMessage(...l)},a=function(){r.value&&r.value.terminate()};return i&&(r.value=new Worker(n,e),r.value.onmessage=l=>{s.value=l.data},Cr(()=>{r.value&&r.value.terminate()})),{data:s,post:o,terminate:a,worker:r}}function wG(n={}){const{window:e=Qn,initialWidth:t=Number.POSITIVE_INFINITY,initialHeight:i=Number.POSITIVE_INFINITY,listenOrientation:s=!0,includeScrollbar:r=!0,type:o="inner"}=n,a=De(t),l=De(i),c=()=>{if(e)if(o==="outer")a.value=e.outerWidth,l.value=e.outerHeight;else if(o==="visual"&&e.visualViewport){const{width:f,height:d,scale:h}=e.visualViewport;a.value=Math.round(f*h),l.value=Math.round(d*h)}else r?(a.value=e.innerWidth,l.value=e.innerHeight):(a.value=e.document.documentElement.clientWidth,l.value=e.document.documentElement.clientHeight)};c(),Va(c);const u={passive:!0};if(Ft("resize",c,u),e&&o==="visual"&&e.visualViewport&&Ft(e.visualViewport,"resize",c,u),s){const f=oo("(orientation: portrait)");$e(f,()=>c())}return{width:a,height:l}}const FT=1/60*1e3,WB=typeof performance<"u"?()=>performance.now():()=>Date.now(),kT=typeof window<"u"?n=>window.requestAnimationFrame(n):n=>setTimeout(()=>n(WB()),FT);function XB(n){let e=[],t=[],i=0,s=!1,r=!1;const o=new WeakSet,a={schedule:(l,c=!1,u=!1)=>{const f=u&&s,d=f?e:t;return c&&o.add(l),d.indexOf(l)===-1&&(d.push(l),f&&s&&(i=e.length)),l},cancel:l=>{const c=t.indexOf(l);c!==-1&&t.splice(c,1),o.delete(l)},process:l=>{if(s){r=!0;return}if(s=!0,[e,t]=[t,e],t.length=0,i=e.length,i)for(let c=0;c(n[e]=XB(()=>vc=!0),n),{}),Og=$c.reduce((n,e)=>{const t=kh[e];return n[e]=(i,s=!1,r=!1)=>(vc||jB(),t.schedule(i,s,r)),n},{}),qB=$c.reduce((n,e)=>(n[e]=kh[e].cancel,n),{});$c.reduce((n,e)=>(n[e]=()=>kh[e].process(pa),n),{});const YB=n=>kh[n].process(pa),BT=n=>{vc=!1,pa.delta=Lg?FT:Math.max(Math.min(n-pa.timestamp,$B),1),pa.timestamp=n,Dg=!0,$c.forEach(YB),Dg=!1,vc&&(Lg=!1,kT(BT))},jB=()=>{vc=!0,Lg=!0,Dg||kT(BT)},zT=()=>pa;function VT(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(n);sMath.min(Math.max(t,n),e),Qb=.001,KB=.01,ZB=10,JB=.05,QB=1;function e4({duration:n=800,bounce:e=.25,velocity:t=0,mass:i=1}){let s,r,o=1-e;o=Ng(JB,QB,o),n=Ng(KB,ZB,n/1e3),o<1?(s=c=>{const u=c*o,f=u*n,d=u-t,h=Ug(c,o),p=Math.exp(-f);return Qb-d/h*p},r=c=>{const f=c*o*n,d=f*t+t,h=Math.pow(o,2)*Math.pow(c,2)*n,p=Math.exp(-f),_=Ug(Math.pow(c,2),o);return(-s(c)+Qb>0?-1:1)*((d-h)*p)/_}):(s=c=>{const u=Math.exp(-c*n),f=(c-t)*n+1;return-.001+u*f},r=c=>{const u=Math.exp(-c*n),f=(t-c)*(n*n);return u*f});const a=5/n,l=n4(s,r,a);if(n=n*1e3,isNaN(l))return{stiffness:100,damping:10,duration:n};{const c=Math.pow(l,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:n}}}const t4=12;function n4(n,e,t){let i=t;for(let s=1;sn[t]!==void 0)}function r4(n){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},n);if(!ex(n,s4)&&ex(n,i4)){const t=e4(n);e=Object.assign(Object.assign(Object.assign({},e),t),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function R_(n){var{from:e=0,to:t=1,restSpeed:i=2,restDelta:s}=n,r=VT(n,["from","to","restSpeed","restDelta"]);const o={done:!1,value:e};let{stiffness:a,damping:l,mass:c,velocity:u,duration:f,isResolvedFromDuration:d}=r4(r),h=tx,p=tx;function _(){const g=u?-(u/1e3):0,m=t-e,y=l/(2*Math.sqrt(a*c)),b=Math.sqrt(a/c)/1e3;if(s===void 0&&(s=Math.min(Math.abs(t-e)/100,.4)),y<1){const v=Ug(b,y);h=T=>{const E=Math.exp(-y*b*T);return t-E*((g+y*b*m)/v*Math.sin(v*T)+m*Math.cos(v*T))},p=T=>{const E=Math.exp(-y*b*T);return y*b*E*(Math.sin(v*T)*(g+y*b*m)/v+m*Math.cos(v*T))-E*(Math.cos(v*T)*(g+y*b*m)-v*m*Math.sin(v*T))}}else if(y===1)h=v=>t-Math.exp(-b*v)*(m+(g+b*m)*v);else{const v=b*Math.sqrt(y*y-1);h=T=>{const E=Math.exp(-y*b*T),S=Math.min(v*T,300);return t-E*((g+y*b*m)*Math.sinh(S)+v*m*Math.cosh(S))/v}}}return _(),{next:g=>{const m=h(g);if(d)o.done=g>=f;else{const y=p(g)*1e3,b=Math.abs(y)<=i,v=Math.abs(t-m)<=s;o.done=b&&v}return o.value=o.done?t:m,o},flipTarget:()=>{u=-u,[e,t]=[t,e],_()}}}R_.needsInterpolation=(n,e)=>typeof n=="string"||typeof e=="string";const tx=n=>0,HT=(n,e,t)=>{const i=e-n;return i===0?1:(t-n)/i},P_=(n,e,t)=>-t*n+t*e+n,GT=(n,e)=>t=>Math.max(Math.min(t,e),n),Nl=n=>n%1?Number(n.toFixed(5)):n,yc=/(-)?([\d]*\.?[\d])+/g,Fg=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,o4=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function qc(n){return typeof n=="string"}const Yc={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},Ul=Object.assign(Object.assign({},Yc),{transform:GT(0,1)}),af=Object.assign(Object.assign({},Yc),{default:1}),I_=n=>({test:e=>qc(e)&&e.endsWith(n)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${n}`}),Zr=I_("deg"),Fl=I_("%"),at=I_("px"),nx=Object.assign(Object.assign({},Fl),{parse:n=>Fl.parse(n)/100,transform:n=>Fl.transform(n*100)}),L_=(n,e)=>t=>!!(qc(t)&&o4.test(t)&&t.startsWith(n)||e&&Object.prototype.hasOwnProperty.call(t,e)),WT=(n,e,t)=>i=>{if(!qc(i))return i;const[s,r,o,a]=i.match(yc);return{[n]:parseFloat(s),[e]:parseFloat(r),[t]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},uo={test:L_("hsl","hue"),parse:WT("hue","saturation","lightness"),transform:({hue:n,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(n)+", "+Fl.transform(Nl(e))+", "+Fl.transform(Nl(t))+", "+Nl(Ul.transform(i))+")"},a4=GT(0,255),fm=Object.assign(Object.assign({},Yc),{transform:n=>Math.round(a4(n))}),fr={test:L_("rgb","red"),parse:WT("red","green","blue"),transform:({red:n,green:e,blue:t,alpha:i=1})=>"rgba("+fm.transform(n)+", "+fm.transform(e)+", "+fm.transform(t)+", "+Nl(Ul.transform(i))+")"};function l4(n){let e="",t="",i="",s="";return n.length>5?(e=n.substr(1,2),t=n.substr(3,2),i=n.substr(5,2),s=n.substr(7,2)):(e=n.substr(1,1),t=n.substr(2,1),i=n.substr(3,1),s=n.substr(4,1),e+=e,t+=t,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}}const kg={test:L_("#"),parse:l4,transform:fr.transform},qn={test:n=>fr.test(n)||kg.test(n)||uo.test(n),parse:n=>fr.test(n)?fr.parse(n):uo.test(n)?uo.parse(n):kg.parse(n),transform:n=>qc(n)?n:n.hasOwnProperty("red")?fr.transform(n):uo.transform(n)},XT="${c}",$T="${n}";function c4(n){var e,t,i,s;return isNaN(n)&&qc(n)&&((t=(e=n.match(yc))===null||e===void 0?void 0:e.length)!==null&&t!==void 0?t:0)+((s=(i=n.match(Fg))===null||i===void 0?void 0:i.length)!==null&&s!==void 0?s:0)>0}function qT(n){typeof n=="number"&&(n=`${n}`);const e=[];let t=0;const i=n.match(Fg);i&&(t=i.length,n=n.replace(Fg,XT),e.push(...i.map(qn.parse)));const s=n.match(yc);return s&&(n=n.replace(yc,$T),e.push(...s.map(Yc.parse))),{values:e,numColors:t,tokenised:n}}function YT(n){return qT(n).values}function jT(n){const{values:e,numColors:t,tokenised:i}=qT(n),s=e.length;return r=>{let o=i;for(let a=0;atypeof n=="number"?0:n;function f4(n){const e=YT(n);return jT(n)(e.map(u4))}const jc={test:c4,parse:YT,createTransformer:jT,getAnimatableNone:f4},d4=new Set(["brightness","contrast","saturate","opacity"]);function h4(n){let[e,t]=n.slice(0,-1).split("(");if(e==="drop-shadow")return n;const[i]=t.match(yc)||[];if(!i)return n;const s=t.replace(i,"");let r=d4.has(e)?1:0;return i!==t&&(r*=100),e+"("+r+s+")"}const p4=/([a-z-]*)\(.*?\)/g,Bg=Object.assign(Object.assign({},jc),{getAnimatableNone:n=>{const e=n.match(p4);return e?e.map(h4).join(" "):n}});function dm(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function ix({hue:n,saturation:e,lightness:t,alpha:i}){n/=360,e/=100,t/=100;let s=0,r=0,o=0;if(!e)s=r=o=t;else{const a=t<.5?t*(1+e):t+e-t*e,l=2*t-a;s=dm(l,a,n+1/3),r=dm(l,a,n),o=dm(l,a,n-1/3)}return{red:Math.round(s*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:i}}const m4=(n,e,t)=>{const i=n*n,s=e*e;return Math.sqrt(Math.max(0,t*(s-i)+i))},g4=[kg,fr,uo],sx=n=>g4.find(e=>e.test(n)),KT=(n,e)=>{let t=sx(n),i=sx(e),s=t.parse(n),r=i.parse(e);t===uo&&(s=ix(s),t=fr),i===uo&&(r=ix(r),i=fr);const o=Object.assign({},s);return a=>{for(const l in o)l!=="alpha"&&(o[l]=m4(s[l],r[l],a));return o.alpha=P_(s.alpha,r.alpha,a),t.transform(o)}},_4=n=>typeof n=="number",v4=(n,e)=>t=>e(n(t)),ZT=(...n)=>n.reduce(v4);function JT(n,e){return _4(n)?t=>P_(n,e,t):qn.test(n)?KT(n,e):ew(n,e)}const QT=(n,e)=>{const t=[...n],i=t.length,s=n.map((r,o)=>JT(r,e[o]));return r=>{for(let o=0;o{const t=Object.assign(Object.assign({},n),e),i={};for(const s in t)n[s]!==void 0&&e[s]!==void 0&&(i[s]=JT(n[s],e[s]));return s=>{for(const r in i)t[r]=i[r](s);return t}};function rx(n){const e=jc.parse(n),t=e.length;let i=0,s=0,r=0;for(let o=0;o{const t=jc.createTransformer(e),i=rx(n),s=rx(e);return i.numHSL===s.numHSL&&i.numRGB===s.numRGB&&i.numNumbers>=s.numNumbers?ZT(QT(i.parsed,s.parsed),t):o=>`${o>0?e:n}`},b4=(n,e)=>t=>P_(n,e,t);function x4(n){if(typeof n=="number")return b4;if(typeof n=="string")return qn.test(n)?KT:ew;if(Array.isArray(n))return QT;if(typeof n=="object")return y4}function M4(n,e,t){const i=[],s=t||x4(n[0]),r=n.length-1;for(let o=0;ot(HT(n,e,i))}function E4(n,e){const t=n.length,i=t-1;return s=>{let r=0,o=!1;if(s<=n[0]?o=!0:s>=n[i]&&(r=i-1,o=!0),!o){let l=1;for(;ls||l===i);l++);r=l-1}const a=HT(n[r],n[r+1],s);return e[r](a)}}function tw(n,e,{clamp:t=!0,ease:i,mixer:s}={}){const r=n.length;Jb(r===e.length),Jb(!i||!Array.isArray(i)||i.length===r-1),n[0]>n[r-1]&&(n=[].concat(n),e=[].concat(e),n.reverse(),e.reverse());const o=M4(e,i,s),a=r===2?S4(n,o):E4(n,o);return t?l=>a(Ng(n[0],n[r-1],l)):a}const Bh=n=>e=>1-n(1-e),D_=n=>e=>e<=.5?n(2*e)/2:(2-n(2*(1-e)))/2,T4=n=>e=>Math.pow(e,n),nw=n=>e=>e*e*((n+1)*e-n),w4=n=>{const e=nw(n);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))},iw=1.525,A4=4/11,C4=8/11,R4=9/10,sw=n=>n,O_=T4(2),P4=Bh(O_),rw=D_(O_),ow=n=>1-Math.sin(Math.acos(n)),aw=Bh(ow),I4=D_(aw),N_=nw(iw),L4=Bh(N_),D4=D_(N_),O4=w4(iw),N4=4356/361,U4=35442/1805,F4=16061/1805,Rd=n=>{if(n===1||n===0)return n;const e=n*n;return nn<.5?.5*(1-Rd(1-n*2)):.5*Rd(n*2-1)+.5;function z4(n,e){return n.map(()=>e||rw).splice(0,n.length-1)}function V4(n){const e=n.length;return n.map((t,i)=>i!==0?i/(e-1):0)}function H4(n,e){return n.map(t=>t*e)}function Af({from:n=0,to:e=1,ease:t,offset:i,duration:s=300}){const r={done:!1,value:n},o=Array.isArray(e)?e:[n,e],a=H4(i&&i.length===o.length?i:V4(o),s);function l(){return tw(a,o,{ease:Array.isArray(t)?t:z4(o,t)})}let c=l();return{next:u=>(r.value=c(u),r.done=u>=s,r),flipTarget:()=>{o.reverse(),c=l()}}}function G4({velocity:n=0,from:e=0,power:t=.8,timeConstant:i=350,restDelta:s=.5,modifyTarget:r}){const o={done:!1,value:e};let a=t*n;const l=e+a,c=r===void 0?l:r(l);return c!==l&&(a=c-e),{next:u=>{const f=-a*Math.exp(-u/i);return o.done=!(f>s||f<-s),o.value=o.done?c:c+f,o},flipTarget:()=>{}}}const ox={keyframes:Af,spring:R_,decay:G4};function W4(n){if(Array.isArray(n.to))return Af;if(ox[n.type])return ox[n.type];const e=new Set(Object.keys(n));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Af:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?R_:Af}function lw(n,e,t=0){return n-e-t}function X4(n,e,t=0,i=!0){return i?lw(e+-n,e,t):e-(n-e)+t}function $4(n,e,t,i){return i?n>=e+t:n<=-t}const q4=n=>{const e=({delta:t})=>n(t);return{start:()=>Og.update(e,!0),stop:()=>qB.update(e)}};function cw(n){var e,t,{from:i,autoplay:s=!0,driver:r=q4,elapsed:o=0,repeat:a=0,repeatType:l="loop",repeatDelay:c=0,onPlay:u,onStop:f,onComplete:d,onRepeat:h,onUpdate:p}=n,_=VT(n,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:g}=_,m,y=0,b=_.duration,v,T=!1,E=!0,S;const P=W4(_);!((t=(e=P).needsInterpolation)===null||t===void 0)&&t.call(e,i,g)&&(S=tw([0,100],[i,g],{clamp:!1}),i=0,g=100);const x=P(Object.assign(Object.assign({},_),{from:i,to:g}));function M(){y++,l==="reverse"?(E=y%2===0,o=X4(o,b,c,E)):(o=lw(o,b,c),l==="mirror"&&x.flipTarget()),T=!1,h&&h()}function L(){m.stop(),d&&d()}function F(Y){if(E||(Y=-Y),o+=Y,!T){const ee=x.next(Math.max(0,o));v=ee.value,S&&(v=S(v)),T=E?ee.done:o<=0}p==null||p(v),T&&(y===0&&(b??(b=o)),y{f==null||f(),m.stop()}}}function uw(n,e){return e?n*(1e3/e):0}function Y4({from:n=0,velocity:e=0,min:t,max:i,power:s=.8,timeConstant:r=750,bounceStiffness:o=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:c,driver:u,onUpdate:f,onComplete:d,onStop:h}){let p;function _(b){return t!==void 0&&bi}function g(b){return t===void 0?i:i===void 0||Math.abs(t-b){var T;f==null||f(v),(T=b.onUpdate)===null||T===void 0||T.call(b,v)},onComplete:d,onStop:h}))}function y(b){m(Object.assign({type:"spring",stiffness:o,damping:a,restDelta:l},b))}if(_(n))y({from:n,velocity:e,to:g(n)});else{let b=s*e+n;typeof c<"u"&&(b=c(b));const v=g(b),T=v===t?-1:1;let E,S;const P=x=>{E=S,S=x,e=uw(x-E,zT().delta),(T===1&&x>v||T===-1&&xp==null?void 0:p.stop()}}const fw=(n,e)=>1-3*e+3*n,dw=(n,e)=>3*e-6*n,hw=n=>3*n,Pd=(n,e,t)=>((fw(e,t)*n+dw(e,t))*n+hw(e))*n,pw=(n,e,t)=>3*fw(e,t)*n*n+2*dw(e,t)*n+hw(e),j4=1e-7,K4=10;function Z4(n,e,t,i,s){let r,o,a=0;do o=e+(t-e)/2,r=Pd(o,i,s)-n,r>0?t=o:e=o;while(Math.abs(r)>j4&&++a=Q4?e5(o,f,n,t):d===0?f:Z4(o,a,a+lf,n,t)}return o=>o===0||o===1?o:Pd(r(o),e,i)}const Ls={},hm={};class n5{constructor(){fi(this,"subscriptions",new Set)}add(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}notify(e,t,i){if(this.subscriptions.size)for(const s of this.subscriptions)s(e,t,i)}clear(){this.subscriptions.clear()}}function ax(n){return!Number.isNaN(Number.parseFloat(n))}class i5{constructor(e){fi(this,"current");fi(this,"prev");fi(this,"timeDelta",0);fi(this,"lastUpdated",0);fi(this,"updateSubscribers",new n5);fi(this,"stopAnimation");fi(this,"canTrackVelocity",!1);fi(this,"updateAndNotify",e=>{this.prev=this.current,this.current=e;const{delta:t,timestamp:i}=zT();this.lastUpdated!==i&&(this.timeDelta=t,this.lastUpdated=i),Og.postRender(this.scheduleVelocityCheck),this.updateSubscribers.notify(this.current)});fi(this,"scheduleVelocityCheck",()=>Og.postRender(this.velocityCheck));fi(this,"velocityCheck",({timestamp:e})=>{this.canTrackVelocity||(this.canTrackVelocity=ax(this.current)),e!==this.lastUpdated&&(this.prev=this.current)});this.prev=this.current=e,this.canTrackVelocity=ax(this.current)}onChange(e){return this.updateSubscribers.add(e)}clearListeners(){this.updateSubscribers.clear()}set(e){this.updateAndNotify(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?uw(Number.parseFloat(this.current)-Number.parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(t=>{const{stop:i}=e(t);this.stopAnimation=i}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.stop()}}function s5(n){return new i5(n)}const{isArray:r5}=Array;function o5(){const n=et({}),e=i=>{const s=r=>{n.value[r]&&(n.value[r].stop(),n.value[r].destroy(),delete n.value[r])};i?r5(i)?i.forEach(s):s(i):Object.keys(n.value).forEach(s)},t=(i,s,r)=>{if(n.value[i])return n.value[i];const o=s5(s);return o.onChange(a=>r[i]=a),n.value[i]=o,o};return TB(e),{motionValues:n,get:t,stop:e}}function a5(n){return Array.isArray(n)}function Jr(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}}function pm(n){return{type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}}function l5(n){return{type:"spring",stiffness:550,damping:n===0?100:30,restDelta:.01,restSpeed:10}}function mm(){return{type:"keyframes",ease:"linear",duration:300}}function c5(n){return{type:"keyframes",duration:800,values:n}}const lx={default:l5,x:Jr,y:Jr,z:Jr,rotate:Jr,rotateX:Jr,rotateY:Jr,rotateZ:Jr,scaleX:pm,scaleY:pm,scale:pm,backgroundColor:mm,color:mm,opacity:mm};function mw(n,e){let t;return a5(e)?t=c5:t=lx[n]||lx.default,{to:e,...t(e)}}const cx={...Yc,transform:Math.round},gw={color:qn,backgroundColor:qn,outlineColor:qn,fill:qn,stroke:qn,borderColor:qn,borderTopColor:qn,borderRightColor:qn,borderBottomColor:qn,borderLeftColor:qn,borderWidth:at,borderTopWidth:at,borderRightWidth:at,borderBottomWidth:at,borderLeftWidth:at,borderRadius:at,radius:at,borderTopLeftRadius:at,borderTopRightRadius:at,borderBottomRightRadius:at,borderBottomLeftRadius:at,width:at,maxWidth:at,height:at,maxHeight:at,size:at,top:at,right:at,bottom:at,left:at,padding:at,paddingTop:at,paddingRight:at,paddingBottom:at,paddingLeft:at,margin:at,marginTop:at,marginRight:at,marginBottom:at,marginLeft:at,rotate:Zr,rotateX:Zr,rotateY:Zr,rotateZ:Zr,scale:af,scaleX:af,scaleY:af,scaleZ:af,skew:Zr,skewX:Zr,skewY:Zr,distance:at,translateX:at,translateY:at,translateZ:at,x:at,y:at,z:at,perspective:at,transformPerspective:at,opacity:Ul,originX:nx,originY:nx,originZ:at,zIndex:cx,filter:Bg,WebkitFilter:Bg,fillOpacity:Ul,strokeOpacity:Ul,numOctaves:cx},U_=n=>gw[n];function zg(n,e){return e&&typeof n=="number"&&e.transform?e.transform(n):n}function u5(n,e){let t=U_(n);return t!==Bg&&(t=jc),t.getAnimatableNone?t.getAnimatableNone(e):void 0}const f5={linear:sw,easeIn:O_,easeInOut:rw,easeOut:P4,circIn:ow,circInOut:I4,circOut:aw,backIn:N_,backInOut:D4,backOut:L4,anticipate:O4,bounceIn:k4,bounceInOut:B4,bounceOut:Rd};function ux(n){if(Array.isArray(n)){const[e,t,i,s]=n;return t5(e,t,i,s)}else if(typeof n=="string")return f5[n];return n}function d5(n){return Array.isArray(n)&&typeof n[0]!="number"}function fx(n,e){return n==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&jc.test(e)&&!e.startsWith("url("))}function h5(n){return Array.isArray(n.to)&&n.to[0]===null&&(n.to=[...n.to],n.to[0]=n.from),n}function p5({ease:n,times:e,delay:t,...i}){const s={...i};return e&&(s.offset=e),n&&(s.ease=d5(n)?n.map(ux):ux(n)),t&&(s.elapsed=-t),s}function m5(n,e,t){return Array.isArray(e.to)&&(n.duration||(n.duration=800)),h5(e),g5(n)||(n={...n,...mw(t,e.to)}),{...e,...p5(n)}}function g5({delay:n,repeat:e,repeatType:t,repeatDelay:i,from:s,...r}){return!!Object.keys(r).length}function _5(n,e){return n[e]||n.default||n}function v5(n,e,t,i,s){const r=_5(i,n);let o=r.from===null||r.from===void 0?e.get():r.from;const a=fx(n,t);o==="none"&&a&&typeof t=="string"&&(o=u5(n,t));const l=fx(n,o);function c(f){const d={from:o,to:t,velocity:i.velocity?i.velocity:e.getVelocity(),onUpdate:h=>e.set(h)};return r.type==="inertia"||r.type==="decay"?Y4({...d,...r}):cw({...m5(r,d,n),onUpdate:h=>{d.onUpdate(h),r.onUpdate&&r.onUpdate(h)},onComplete:()=>{s&&s(),f&&f()}})}function u(f){return e.set(t),s&&s(),f&&f(),{stop:()=>{}}}return!l||!a||r.type===!1?u:c}function y5(){const{motionValues:n,stop:e,get:t}=o5();return{motionValues:n,stop:e,push:(s,r,o,a={},l)=>{const c=o[s],u=t(s,c,o);if(a&&a.immediate){u.set(r);return}const f=v5(s,u,r,a,l);u.start(f)}}}function b5(n,e={},{motionValues:t,push:i,stop:s}=y5()){const r=Ot(e),o=et(!1);$e(t,f=>{o.value=Object.values(f).filter(d=>d.isAnimating()).length>0},{immediate:!0,deep:!0});const a=f=>{if(!r||!r[f])throw new Error(`The variant ${f} does not exist.`);return r[f]},l=f=>{typeof f=="string"&&(f=a(f));const d=Object.entries(f).map(([p,_])=>{if(p!=="transition")return new Promise(g=>i(p,_,n,f.transition||mw(p,f[p]),g))}).filter(Boolean);async function h(){var p,_;await Promise.all(d),(_=(p=f.transition)==null?void 0:p.onComplete)==null||_.call(p)}return Promise.all([h()])};return{isAnimating:o,apply:l,set:f=>{const d=Cd(f)?f:a(f);Object.entries(d).forEach(([h,p])=>{h!=="transition"&&i(h,p,n,{immediate:!0})})},leave:async f=>{let d;if(r&&(r.leave&&(d=r.leave),!r.leave&&r.initial&&(d=r.initial)),!d){f();return}await l(d),f()},stop:s}}const F_=typeof window<"u",x5=()=>F_&&(window.onpointerdown===null||(Ls==null?void 0:Ls.TEST)),M5=()=>F_&&(window.ontouchstart===null||(Ls==null?void 0:Ls.TEST)),S5=()=>F_&&(window.onmousedown===null||(Ls==null?void 0:Ls.TEST));function E5({target:n,state:e,variants:t,apply:i}){const s=Ot(t),r=et(!1),o=et(!1),a=et(!1),l=Ee(()=>{let u=[...Object.keys(e.value||{})];return s&&(s.hovered&&(u=[...u,...Object.keys(s.hovered)]),s.tapped&&(u=[...u,...Object.keys(s.tapped)]),s.focused&&(u=[...u,...Object.keys(s.focused)])),u}),c=Ee(()=>{const u={};Object.assign(u,e.value),r.value&&s.hovered&&Object.assign(u,s.hovered),o.value&&s.tapped&&Object.assign(u,s.tapped),a.value&&s.focused&&Object.assign(u,s.focused);for(const f in u)l.value.includes(f)||delete u[f];return u});s.hovered&&(Ft(n,"mouseenter",()=>r.value=!0),Ft(n,"mouseleave",()=>{r.value=!1,o.value=!1})),s.tapped&&(S5()&&(Ft(n,"mousedown",()=>o.value=!0),Ft(n,"mouseup",()=>o.value=!1)),x5()&&(Ft(n,"pointerdown",()=>o.value=!0),Ft(n,"pointerup",()=>o.value=!1)),M5()&&(Ft(n,"touchstart",()=>o.value=!0),Ft(n,"touchend",()=>o.value=!1))),s.focused&&(Ft(n,"focus",()=>a.value=!0),Ft(n,"blur",()=>a.value=!1)),$e([r,o,a],()=>{i(c.value)})}function T5({set:n,target:e,variants:t,variant:i}){const s=Ot(t);$e(()=>e,()=>{s&&(s.initial&&(n("initial"),i.value="initial"),s.enter&&(i.value="enter"))},{immediate:!0,flush:"pre"})}function w5({state:n,apply:e}){$e(n,t=>{t&&e(t)},{immediate:!0})}function _w({target:n,variants:e,variant:t}){const i=Ot(e);i&&(i.visible||i.visibleOnce)&&VB(n,([{isIntersecting:s}])=>{i.visible?s?t.value="visible":t.value="initial":i.visibleOnce&&(s&&t.value!=="visibleOnce"?t.value="visibleOnce":t.value||(t.value="initial"))})}function A5(n,e={syncVariants:!0,lifeCycleHooks:!0,visibilityHooks:!0,eventListeners:!0}){e.lifeCycleHooks&&T5(n),e.syncVariants&&w5(n),e.visibilityHooks&&_w(n),e.eventListeners&&E5(n)}function vw(n={}){const e=bi({...n}),t=et({});return $e(e,()=>{const i={};for(const[s,r]of Object.entries(e)){const o=U_(s),a=zg(r,o);i[s]=a}t.value=i},{immediate:!0,deep:!0}),{state:e,style:t}}function k_(n,e){$e(()=>oi(n),t=>{t&&e(t)},{immediate:!0})}const C5={x:"translateX",y:"translateY",z:"translateZ"};function yw(n={},e=!0){const t=bi({...n}),i=et("");return $e(t,s=>{let r="",o=!1;if(e&&(s.x||s.y||s.z)){const a=[s.x||0,s.y||0,s.z||0].map(l=>zg(l,at)).join(",");r+=`translate3d(${a}) `,o=!0}for(const[a,l]of Object.entries(s)){if(e&&(a==="x"||a==="y"||a==="z"))continue;const c=U_(a),u=zg(l,c);r+=`${C5[a]||a}(${u}) `}e&&!o&&(r+="translateZ(0px) "),i.value=r.trim()},{immediate:!0,deep:!0}),{state:t,transform:i}}const R5=["","X","Y","Z"],P5=["perspective","translate","scale","rotate","skew"],bw=["transformPerspective","x","y","z"];P5.forEach(n=>{R5.forEach(e=>{const t=n+e;bw.push(t)})});const I5=new Set(bw);function B_(n){return I5.has(n)}const L5=new Set(["originX","originY","originZ"]);function xw(n){return L5.has(n)}function D5(n){const e={},t={};return Object.entries(n).forEach(([i,s])=>{B_(i)||xw(i)?e[i]=s:t[i]=s}),{transform:e,style:t}}function zh(n){const{transform:e,style:t}=D5(n),{transform:i}=yw(e),{style:s}=vw(t);return i.value&&(s.value.transform=i.value),s.value}function O5(n,e){let t,i;const{state:s,style:r}=vw();return k_(n,o=>{i=o;for(const a of Object.keys(gw))o.style[a]===null||o.style[a]===""||B_(a)||xw(a)||(s[a]=o.style[a]);t&&Object.entries(t).forEach(([a,l])=>o.style[a]=l),e&&e(s)}),$e(r,o=>{if(!i){t=o;return}for(const a in o)i.style[a]=o[a]},{immediate:!0}),{style:s}}function N5(n){const e=n.trim().split(/\) |\)/);if(e.length===1)return{};const t=i=>i.endsWith("px")||i.endsWith("deg")?Number.parseFloat(i):Number.isNaN(Number(i))?Number(i):i;return e.reduce((i,s)=>{if(!s)return i;const[r,o]=s.split("("),l=o.split(",").map(u=>t(u.endsWith(")")?u.replace(")",""):u.trim())),c=l.length===1?l[0]:l;return{...i,[r]:c}},{})}function U5(n,e){Object.entries(N5(e)).forEach(([t,i])=>{const s=["x","y","z"];if(t==="translate3d"){if(i===0){s.forEach(r=>n[r]=0);return}i.forEach((r,o)=>n[s[o]]=r);return}if(i=Number.parseFloat(`${i}`),t==="translateX"){n.x=i;return}if(t==="translateY"){n.y=i;return}if(t==="translateZ"){n.z=i;return}n[t]=i})}function F5(n,e){let t,i;const{state:s,transform:r}=yw();return k_(n,o=>{i=o,o.style.transform&&U5(s,o.style.transform),t&&(o.style.transform=t),e&&e(s)}),$e(r,o=>{if(!i){t=o;return}i.style.transform=o},{immediate:!0}),{transform:s}}function k5(n){return Object.entries(n)}function B5(n,e){const t=bi({}),i=o=>Object.entries(o).forEach(([a,l])=>t[a]=l),{style:s}=O5(n,i),{transform:r}=F5(n,i);return $e(t,o=>{k5(o).forEach(([a,l])=>{const c=B_(a)?r:s;c[a]&&c[a]===l||(c[a]=l)})},{immediate:!0,deep:!0}),k_(n,()=>e),{motionProperties:t,style:s,transform:r}}function z5(n={}){const e=Ot(n),t=et();return{state:Ee(()=>{if(t.value)return e[t.value]}),variant:t}}function Mw(n,e={},t){const{motionProperties:i}=B5(n),{variant:s,state:r}=z5(e),o=b5(i,e),a={target:n,variant:s,variants:e,state:r,motionProperties:i,...o};return A5(a,t),a}const Sw=["delay","duration"],V5=["initial","enter","leave","visible","visible-once","visibleOnce","hovered","tapped","focused",...Sw];function H5(n){return Sw.includes(n)}function G5(n,e){const t=n.props?n.props:n.data&&n.data.attrs?n.data.attrs:{};if(t){t.variants&&Cd(t.variants)&&(e.value={...e.value,...t.variants});for(let i of V5)if(!(!t||!t[i])){if(H5(i)&&typeof t[i]=="number"){for(const s of["enter","visible","visibleOnce"]){const r=e.value[s];r!=null&&(r.transition??(r.transition={}),r.transition[i]=t[i])}continue}if(Cd(t[i])){const s=t[i];i==="visible-once"&&(i="visibleOnce"),e.value[i]=s}}}}function gm(n,e=!1){return{created:(s,r,o)=>{const a=r.value&&typeof r.value=="string"?r.value:o.key;a&&hm[a]&&hm[a].stop();const l=e?structuredClone(ut(n)||{}):n||{},c=et(l);typeof r.value=="object"&&(c.value=r.value),G5(o,c);const f=Mw(s,c,{eventListeners:!0,lifeCycleHooks:!0,syncVariants:!0,visibilityHooks:!1});s.motionInstance=f,a&&(hm[a]=f)},mounted:(s,r,o)=>{s.motionInstance&&_w(s.motionInstance)},getSSRProps(s,r){let{initial:o}=s.value||r&&(r==null?void 0:r.props)||{};o=Ot(o);const a=wT({},(n==null?void 0:n.initial)||{},o||{});return!a||Object.keys(a).length===0?void 0:{style:zh(a)}}}}const W5={initial:{opacity:0},enter:{opacity:1}},X5={initial:{opacity:0},visible:{opacity:1}},$5={initial:{opacity:0},visibleOnce:{opacity:1}},q5={initial:{scale:0,opacity:0},enter:{scale:1,opacity:1}},Y5={initial:{scale:0,opacity:0},visible:{scale:1,opacity:1}},j5={initial:{scale:0,opacity:0},visibleOnce:{scale:1,opacity:1}},K5={initial:{x:-100,rotate:90,opacity:0},enter:{x:0,rotate:0,opacity:1}},Z5={initial:{x:-100,rotate:90,opacity:0},visible:{x:0,rotate:0,opacity:1}},J5={initial:{x:-100,rotate:90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},Q5={initial:{x:100,rotate:-90,opacity:0},enter:{x:0,rotate:0,opacity:1}},ez={initial:{x:100,rotate:-90,opacity:0},visible:{x:0,rotate:0,opacity:1}},tz={initial:{x:100,rotate:-90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},nz={initial:{y:-100,rotate:-90,opacity:0},enter:{y:0,rotate:0,opacity:1}},iz={initial:{y:-100,rotate:-90,opacity:0},visible:{y:0,rotate:0,opacity:1}},sz={initial:{y:-100,rotate:-90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},rz={initial:{y:100,rotate:90,opacity:0},enter:{y:0,rotate:0,opacity:1}},oz={initial:{y:100,rotate:90,opacity:0},visible:{y:0,rotate:0,opacity:1}},az={initial:{y:100,rotate:90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},lz={initial:{x:-100,opacity:0},enter:{x:0,opacity:1}},cz={initial:{x:-100,opacity:0},visible:{x:0,opacity:1}},uz={initial:{x:-100,opacity:0},visibleOnce:{x:0,opacity:1}},fz={initial:{x:100,opacity:0},enter:{x:0,opacity:1}},dz={initial:{x:100,opacity:0},visible:{x:0,opacity:1}},hz={initial:{x:100,opacity:0},visibleOnce:{x:0,opacity:1}},pz={initial:{y:-100,opacity:0},enter:{y:0,opacity:1}},mz={initial:{y:-100,opacity:0},visible:{y:0,opacity:1}},gz={initial:{y:-100,opacity:0},visibleOnce:{y:0,opacity:1}},_z={initial:{y:100,opacity:0},enter:{y:0,opacity:1}},vz={initial:{y:100,opacity:0},visible:{y:0,opacity:1}},yz={initial:{y:100,opacity:0},visibleOnce:{y:0,opacity:1}},Id={__proto__:null,fade:W5,fadeVisible:X5,fadeVisibleOnce:$5,pop:q5,popVisible:Y5,popVisibleOnce:j5,rollBottom:rz,rollLeft:K5,rollRight:Q5,rollTop:nz,rollVisibleBottom:oz,rollVisibleLeft:Z5,rollVisibleOnceBottom:az,rollVisibleOnceLeft:J5,rollVisibleOnceRight:tz,rollVisibleOnceTop:sz,rollVisibleRight:ez,rollVisibleTop:iz,slideBottom:_z,slideLeft:lz,slideRight:fz,slideTop:pz,slideVisibleBottom:vz,slideVisibleLeft:cz,slideVisibleOnceBottom:yz,slideVisibleOnceLeft:uz,slideVisibleOnceRight:hz,slideVisibleOnceTop:gz,slideVisibleRight:dz,slideVisibleTop:mz};function bz(n){const e="àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;",t="aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------",i=new RegExp(e.split("").join("|"),"g");return n.toString().replace(/[A-Z]/g,s=>`-${s}`).toLowerCase().replace(/\s+/g,"-").replace(i,s=>t.charAt(e.indexOf(s))).replace(/&/g,"-and-").replace(/[^\w\-]+/g,"").replace(/-{2,}/g,"-").replace(/^-+/,"").replace(/-+$/,"")}const Ew=Symbol(""),Tw={preset:{type:String,required:!1},instance:{type:Object,required:!1},variants:{type:Object,required:!1},initial:{type:Object,required:!1},enter:{type:Object,required:!1},leave:{type:Object,required:!1},visible:{type:Object,required:!1},visibleOnce:{type:Object,required:!1},hovered:{type:Object,required:!1},tapped:{type:Object,required:!1},focused:{type:Object,required:!1},delay:{type:[Number,String],required:!1},duration:{type:[Number,String],required:!1}};function xz(n){return Object.prototype.toString.call(n)==="[object Object]"}function Vg(n){if(Array.isArray(n))return n.map(Vg);if(xz(n)){const e={};for(const t in n)e[t]=Vg(n[t]);return e}return n}function ww(n){const e=bi({}),t=En(Ew,{}),i=Ee(()=>n.preset==null?{}:t!=null&&n.preset in t?structuredClone(ut(t)[n.preset]):n.preset in Id?structuredClone(Id[n.preset]):{}),s=Ee(()=>({initial:n.initial,enter:n.enter,leave:n.leave,visible:n.visible,visibleOnce:n.visibleOnce,hovered:n.hovered,tapped:n.tapped,focused:n.focused}));function r(l,c){for(const u of["delay","duration"]){if(c[u]==null)continue;const f=Number.parseInt(c[u]);for(const d of["enter","visible","visibleOnce"]){const h=l[d];h!=null&&(h.transition??(h.transition={}),h.transition[u]=f)}}return l}const o=Ee(()=>{const l=wT({},s.value,i.value,n.variants||{});return r({...l},n)});function a(l,c,u){var d;l.props??(l.props={}),(d=l.props).style??(d.style={}),l.props.style={...l.props.style,...u};const f=r(Vg(o.value),l.props);return l.props.onVnodeMounted=({el:h})=>{e[c]=Mw(h,f)},l.props.onVnodeUpdated=({el:h})=>{const p=zh(e[c].state);for(const[_,g]of Object.entries(p))h.style[_]=g},l}return{motionConfig:o,setNodeInstance:a}}const Mz=fn({name:"Motion",props:{...Tw,is:{type:[String,Object],default:"div"}},setup(n){const e=A0(),{motionConfig:t,setNodeInstance:i}=ww(n);return()=>{const s=zh(t.value.initial||{}),r=Ds(n.is,void 0,e);return i(r,0,s),r}}}),Sz=fn({name:"MotionGroup",props:{...Tw,is:{type:[String,Object],required:!1}},setup(n){const e=A0(),{motionConfig:t,setNodeInstance:i}=ww(n);return()=>{var o;const s=zh(t.value.initial||{}),r=((o=e.default)==null?void 0:o.call(e))||[];for(let a=0;a
'};t.configure=function(p){var _,g;for(_ in p)g=p[_],g!==void 0&&p.hasOwnProperty(_)&&(i[_]=g);return this},t.status=null,t.set=function(p){var _=t.isStarted();p=s(p,i.minimum,1),t.status=p===1?null:p;var g=t.render(!_),m=g.querySelector(i.barSelector),y=i.speed,b=i.easing;return g.offsetWidth,a(function(v){i.positionUsing===""&&(i.positionUsing=t.getPositioningCSS()),l(m,o(p,y,b)),p===1?(l(g,{transition:"none",opacity:1}),g.offsetWidth,setTimeout(function(){l(g,{transition:"all "+y+"ms linear",opacity:0}),setTimeout(function(){t.remove(),v()},y)},y)):setTimeout(v,y)}),this},t.isStarted=function(){return typeof t.status=="number"},t.start=function(){t.status||t.set(0);var p=function(){setTimeout(function(){t.status&&(t.trickle(),p())},i.trickleSpeed)};return i.trickle&&p(),this},t.done=function(p){return!p&&!t.status?this:t.inc(.3+.5*Math.random()).set(1)},t.inc=function(p){var _=t.status;return _?(typeof p!="number"&&(p=(1-_)*s(Math.random()*_,.1,.95)),_=s(_+p,0,.994),t.set(_)):t.start()},t.trickle=function(){return t.inc(Math.random()*i.trickleRate)},function(){var p=0,_=0;t.promise=function(g){return!g||g.state()==="resolved"?this:(_===0&&t.start(),p++,_++,g.always(function(){_--,_===0?(p=0,t.done()):t.set((p-_)/p)}),this)}}(),t.render=function(p){if(t.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var _=document.createElement("div");_.id="nprogress",_.innerHTML=i.template;var g=_.querySelector(i.barSelector),m=p?"-100":r(t.status||0),y=document.querySelector(i.parent),b;return l(g,{transition:"all 0 linear",transform:"translate3d("+m+"%,0,0)"}),i.showSpinner||(b=_.querySelector(i.spinnerSelector),b&&h(b)),y!=document.body&&u(y,"nprogress-custom-parent"),y.appendChild(_),_},t.remove=function(){f(document.documentElement,"nprogress-busy"),f(document.querySelector(i.parent),"nprogress-custom-parent");var p=document.getElementById("nprogress");p&&h(p)},t.isRendered=function(){return!!document.getElementById("nprogress")},t.getPositioningCSS=function(){var p=document.body.style,_="WebkitTransform"in p?"Webkit":"MozTransform"in p?"Moz":"msTransform"in p?"ms":"OTransform"in p?"O":"";return _+"Perspective"in p?"translate3d":_+"Transform"in p?"translate":"margin"};function s(p,_,g){return p<_?_:p>g?g:p}function r(p){return(-1+p)*100}function o(p,_,g){var m;return i.positionUsing==="translate3d"?m={transform:"translate3d("+r(p)+"%,0,0)"}:i.positionUsing==="translate"?m={transform:"translate("+r(p)+"%,0)"}:m={"margin-left":r(p)+"%"},m.transition="all "+_+"ms "+g,m}var a=function(){var p=[];function _(){var g=p.shift();g&&g(_)}return function(g){p.push(g),p.length==1&&_()}}(),l=function(){var p=["Webkit","O","Moz","ms"],_={};function g(v){return v.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(T,E){return E.toUpperCase()})}function m(v){var T=document.body.style;if(v in T)return v;for(var E=p.length,S=v.charAt(0).toUpperCase()+v.slice(1),P;E--;)if(P=p[E]+S,P in T)return P;return v}function y(v){return v=g(v),_[v]||(_[v]=m(v))}function b(v,T,E){T=y(T),v.style[T]=E}return function(v,T){var E=arguments,S,P;if(E.length==2)for(S in T)P=T[S],P!==void 0&&T.hasOwnProperty(S)&&b(v,S,P);else b(v,E[1],E[2])}}();function c(p,_){var g=typeof p=="string"?p:d(p);return g.indexOf(" "+_+" ")>=0}function u(p,_){var g=d(p),m=g+_;c(g,_)||(p.className=m.substring(1))}function f(p,_){var g=d(p),m;c(p,_)&&(m=g.replace(" "+_+" "," "),p.className=m.substring(1,m.length-1))}function d(p){return(" "+(p.className||"")+" ").replace(/\s+/gi," ")}function h(p){p&&p.parentNode&&p.parentNode.removeChild(p)}return t})}(Rf)),Rf.exports}var Cz=Az();const Aw=Tz(Cz);/*! - * pinia v3.0.2 - * (c) 2025 Eduardo San Martin Morote - * @license MIT - */let Cw;const Vh=n=>Cw=n,Rw=Symbol();function Hg(n){return n&&typeof n=="object"&&Object.prototype.toString.call(n)==="[object Object]"&&typeof n.toJSON!="function"}var kl;(function(n){n.direct="direct",n.patchObject="patch object",n.patchFunction="patch function"})(kl||(kl={}));function Rz(){const n=g0(!0),e=n.run(()=>et({}));let t=[],i=[];const s=M0({install(r){Vh(s),s._a=r,r.provide(Rw,s),r.config.globalProperties.$pinia=s,i.forEach(o=>t.push(o)),i=[]},use(r){return this._a?t.push(r):i.push(r),this},_p:t,_a:null,_e:n,_s:new Map,state:e});return s}const Pw=()=>{};function hx(n,e,t,i=Pw){n.push(e);const s=()=>{const r=n.indexOf(e);r>-1&&(n.splice(r,1),i())};return!t&&Xd()&&_0(s),s}function ea(n,...e){n.slice().forEach(t=>{t(...e)})}const Pz=n=>n(),px=Symbol(),_m=Symbol();function Gg(n,e){n instanceof Map&&e instanceof Map?e.forEach((t,i)=>n.set(i,t)):n instanceof Set&&e instanceof Set&&e.forEach(n.add,n);for(const t in e){if(!e.hasOwnProperty(t))continue;const i=e[t],s=n[t];Hg(s)&&Hg(i)&&n.hasOwnProperty(t)&&!Pt(i)&&!Rs(i)?n[t]=Gg(s,i):n[t]=i}return n}const Iz=Symbol();function Lz(n){return!Hg(n)||!Object.prototype.hasOwnProperty.call(n,Iz)}const{assign:tr}=Object;function Dz(n){return!!(Pt(n)&&n.effect)}function Oz(n,e,t,i){const{state:s,actions:r,getters:o}=e,a=t.state.value[n];let l;function c(){a||(t.state.value[n]=s?s():{});const u=lS(t.state.value[n]);return tr(u,r,Object.keys(o||{}).reduce((f,d)=>(f[d]=M0(Ee(()=>{Vh(t);const h=t._s.get(n);return o[d].call(h,h)})),f),{}))}return l=Iw(n,c,e,t,i,!0),l}function Iw(n,e,t={},i,s,r){let o;const a=tr({actions:{}},t),l={deep:!0};let c,u,f=[],d=[],h;const p=i.state.value[n];!r&&!p&&(i.state.value[n]={}),et({});let _;function g(P){let x;c=u=!1,typeof P=="function"?(P(i.state.value[n]),x={type:kl.patchFunction,storeId:n,events:h}):(Gg(i.state.value[n],P),x={type:kl.patchObject,payload:P,storeId:n,events:h});const M=_=Symbol();Er().then(()=>{_===M&&(c=!0)}),u=!0,ea(f,x,i.state.value[n])}const m=r?function(){const{state:x}=t,M=x?x():{};this.$patch(L=>{tr(L,M)})}:Pw;function y(){o.stop(),f=[],d=[],i._s.delete(n)}const b=(P,x="")=>{if(px in P)return P[_m]=x,P;const M=function(){Vh(i);const L=Array.from(arguments),F=[],H=[];function Y(Q){F.push(Q)}function ee(Q){H.push(Q)}ea(d,{args:L,name:M[_m],store:T,after:Y,onError:ee});let K;try{K=P.apply(this&&this.$id===n?this:T,L)}catch(Q){throw ea(H,Q),Q}return K instanceof Promise?K.then(Q=>(ea(F,Q),Q)).catch(Q=>(ea(H,Q),Promise.reject(Q))):(ea(F,K),K)};return M[px]=!0,M[_m]=x,M},v={_p:i,$id:n,$onAction:hx.bind(null,d),$patch:g,$reset:m,$subscribe(P,x={}){const M=hx(f,P,x.detached,()=>L()),L=o.run(()=>$e(()=>i.state.value[n],F=>{(x.flush==="sync"?u:c)&&P({storeId:n,type:kl.direct,events:h},F)},tr({},l,x)));return M},$dispose:y},T=bi(v);i._s.set(n,T);const S=(i._a&&i._a.runWithContext||Pz)(()=>i._e.run(()=>(o=g0()).run(()=>e({action:b}))));for(const P in S){const x=S[P];if(Pt(x)&&!Dz(x)||Rs(x))r||(p&&Lz(x)&&(Pt(x)?x.value=p[P]:Gg(x,p[P])),i.state.value[n][P]=x);else if(typeof x=="function"){const M=b(x,P);S[P]=M,a.actions[P]=x}}return tr(T,S),tr(ut(T),S),Object.defineProperty(T,"$state",{get:()=>i.state.value[n],set:P=>{g(x=>{tr(x,P)})}}),i._p.forEach(P=>{tr(T,o.run(()=>P({store:T,app:i._a,pinia:i,options:a})))}),p&&r&&t.hydrate&&t.hydrate(T.$state,p),c=!0,u=!0,T}/*! #__NO_SIDE_EFFECTS__ */function Nz(n,e,t){let i;const s=typeof e=="function";i=s?t:e;function r(o,a){const l=Cc();return o=o||(l?En(Rw,null):null),o&&Vh(o),o=Cw,o._s.has(n)||(s?Iw(n,e,i,o):Oz(n,i,o)),o._s.get(n)}return r.$id=n,r}function Uz(n){const e=ut(n),t={};for(const i in e){const s=e[i];s.effect?t[i]=Ee({get:()=>n[i],set(r){n[i]=r}}):(Pt(s)||Rs(s))&&(t[i]=cS(n,i))}return t}const Fz=n=>{const e={};Object.entries(Object.assign({"/src/layouts/default.vue":()=>je(()=>import("./default-DxMPgLL4.js"),__vite__mapDeps([0,1,2])),"/src/layouts/stage.vue":()=>je(()=>import("./stage-DE9Z4XRh.js"),[])})).forEach(([s,r])=>{let o=s.replace("/src/layouts/","").replace(".vue","");e[o]=r});function i(s,r=!0){return s.map(o=>{var a,l,c,u,f,d;if(((a=o.children)==null?void 0:a.length)>0&&(o.children=i(o.children,!1)),r){if(!o.component&&((l=o.children)==null?void 0:l.find(p=>{var _;return(p.path===""||p.path==="/")&&((_=p.meta)==null?void 0:_.isLayout)})))return o;if(((c=o.meta)==null?void 0:c.layout)!==!1)return{path:o.path,component:e[((u=o.meta)==null?void 0:u.layout)||"default"],children:o.path==="/"?[o]:[{...o,path:""}],meta:{isLayout:!0}}}return(f=o.meta)!=null&&f.layout?{path:o.path,component:e[(d=o.meta)==null?void 0:d.layout],children:[{...o,path:""}],meta:{isLayout:!0}}:o})}return i(n)};/*! - * vue-router v4.5.0 - * (c) 2024 Eduardo San Martin Morote - * @license MIT - */const na=typeof document<"u";function Lw(n){return typeof n=="object"||"displayName"in n||"props"in n||"__vccOpts"in n}function kz(n){return n.__esModule||n[Symbol.toStringTag]==="Module"||n.default&&Lw(n.default)}const Mt=Object.assign;function vm(n,e){const t={};for(const i in e){const s=e[i];t[i]=Bi(s)?s.map(n):n(s)}return t}const Bl=()=>{},Bi=Array.isArray,Dw=/#/g,Bz=/&/g,zz=/\//g,Vz=/=/g,Hz=/\?/g,Ow=/\+/g,Gz=/%5B/g,Wz=/%5D/g,Nw=/%5E/g,Xz=/%60/g,Uw=/%7B/g,$z=/%7C/g,Fw=/%7D/g,qz=/%20/g;function z_(n){return encodeURI(""+n).replace($z,"|").replace(Gz,"[").replace(Wz,"]")}function Yz(n){return z_(n).replace(Uw,"{").replace(Fw,"}").replace(Nw,"^")}function Wg(n){return z_(n).replace(Ow,"%2B").replace(qz,"+").replace(Dw,"%23").replace(Bz,"%26").replace(Xz,"`").replace(Uw,"{").replace(Fw,"}").replace(Nw,"^")}function jz(n){return Wg(n).replace(Vz,"%3D")}function Kz(n){return z_(n).replace(Dw,"%23").replace(Hz,"%3F")}function Zz(n){return n==null?"":Kz(n).replace(zz,"%2F")}function bc(n){try{return decodeURIComponent(""+n)}catch{}return""+n}const Jz=/\/$/,Qz=n=>n.replace(Jz,"");function ym(n,e,t="/"){let i,s={},r="",o="";const a=e.indexOf("#");let l=e.indexOf("?");return a=0&&(l=-1),l>-1&&(i=e.slice(0,l),r=e.slice(l+1,a>-1?a:e.length),s=n(r)),a>-1&&(i=i||e.slice(0,a),o=e.slice(a,e.length)),i=iV(i??e,t),{fullPath:i+(r&&"?")+r+o,path:i,query:s,hash:bc(o)}}function eV(n,e){const t=e.query?n(e.query):"";return e.path+(t&&"?")+t+(e.hash||"")}function mx(n,e){return!e||!n.toLowerCase().startsWith(e.toLowerCase())?n:n.slice(e.length)||"/"}function tV(n,e,t){const i=e.matched.length-1,s=t.matched.length-1;return i>-1&&i===s&&Ra(e.matched[i],t.matched[s])&&kw(e.params,t.params)&&n(e.query)===n(t.query)&&e.hash===t.hash}function Ra(n,e){return(n.aliasOf||n)===(e.aliasOf||e)}function kw(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(!nV(n[t],e[t]))return!1;return!0}function nV(n,e){return Bi(n)?gx(n,e):Bi(e)?gx(e,n):n===e}function gx(n,e){return Bi(e)?n.length===e.length&&n.every((t,i)=>t===e[i]):n.length===1&&n[0]===e}function iV(n,e){if(n.startsWith("/"))return n;if(!n)return e;const t=e.split("/"),i=n.split("/"),s=i[i.length-1];(s===".."||s===".")&&i.push("");let r=t.length-1,o,a;for(o=0;o1&&r--;else break;return t.slice(0,r).join("/")+"/"+i.slice(o).join("/")}const Qs={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var xc;(function(n){n.pop="pop",n.push="push"})(xc||(xc={}));var zl;(function(n){n.back="back",n.forward="forward",n.unknown=""})(zl||(zl={}));function sV(n){if(!n)if(na){const e=document.querySelector("base");n=e&&e.getAttribute("href")||"/",n=n.replace(/^\w+:\/\/[^\/]+/,"")}else n="/";return n[0]!=="/"&&n[0]!=="#"&&(n="/"+n),Qz(n)}const rV=/^[^#]+#/;function oV(n,e){return n.replace(rV,"#")+e}function aV(n,e){const t=document.documentElement.getBoundingClientRect(),i=n.getBoundingClientRect();return{behavior:e.behavior,left:i.left-t.left-(e.left||0),top:i.top-t.top-(e.top||0)}}const Hh=()=>({left:window.scrollX,top:window.scrollY});function lV(n){let e;if("el"in n){const t=n.el,i=typeof t=="string"&&t.startsWith("#"),s=typeof t=="string"?i?document.getElementById(t.slice(1)):document.querySelector(t):t;if(!s)return;e=aV(s,n)}else e=n;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function _x(n,e){return(history.state?history.state.position-e:-1)+n}const Xg=new Map;function cV(n,e){Xg.set(n,e)}function uV(n){const e=Xg.get(n);return Xg.delete(n),e}let fV=()=>location.protocol+"//"+location.host;function Bw(n,e){const{pathname:t,search:i,hash:s}=e,r=n.indexOf("#");if(r>-1){let a=s.includes(n.slice(r))?n.slice(r).length:1,l=s.slice(a);return l[0]!=="/"&&(l="/"+l),mx(l,"")}return mx(t,n)+i+s}function dV(n,e,t,i){let s=[],r=[],o=null;const a=({state:d})=>{const h=Bw(n,location),p=t.value,_=e.value;let g=0;if(d){if(t.value=h,e.value=d,o&&o===p){o=null;return}g=_?d.position-_.position:0}else i(h);s.forEach(m=>{m(t.value,p,{delta:g,type:xc.pop,direction:g?g>0?zl.forward:zl.back:zl.unknown})})};function l(){o=t.value}function c(d){s.push(d);const h=()=>{const p=s.indexOf(d);p>-1&&s.splice(p,1)};return r.push(h),h}function u(){const{history:d}=window;d.state&&d.replaceState(Mt({},d.state,{scroll:Hh()}),"")}function f(){for(const d of r)d();r=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",u)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",u,{passive:!0}),{pauseListeners:l,listen:c,destroy:f}}function vx(n,e,t,i=!1,s=!1){return{back:n,current:e,forward:t,replaced:i,position:window.history.length,scroll:s?Hh():null}}function hV(n){const{history:e,location:t}=window,i={value:Bw(n,t)},s={value:e.state};s.value||r(i.value,{back:null,current:i.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function r(l,c,u){const f=n.indexOf("#"),d=f>-1?(t.host&&document.querySelector("base")?n:n.slice(f))+l:fV()+n+l;try{e[u?"replaceState":"pushState"](c,"",d),s.value=c}catch(h){console.error(h),t[u?"replace":"assign"](d)}}function o(l,c){const u=Mt({},e.state,vx(s.value.back,l,s.value.forward,!0),c,{position:s.value.position});r(l,u,!0),i.value=l}function a(l,c){const u=Mt({},s.value,e.state,{forward:l,scroll:Hh()});r(u.current,u,!0);const f=Mt({},vx(i.value,l,null),{position:u.position+1},c);r(l,f,!1),i.value=l}return{location:i,state:s,push:a,replace:o}}function pV(n){n=sV(n);const e=hV(n),t=dV(n,e.state,e.location,e.replace);function i(r,o=!0){o||t.pauseListeners(),history.go(r)}const s=Mt({location:"",base:n,go:i,createHref:oV.bind(null,n)},e,t);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>e.state.value}),s}function mV(n){return n=location.host?n||location.pathname+location.search:"",n.includes("#")||(n+="#"),pV(n)}function gV(n){return typeof n=="string"||n&&typeof n=="object"}function zw(n){return typeof n=="string"||typeof n=="symbol"}const Vw=Symbol("");var yx;(function(n){n[n.aborted=4]="aborted",n[n.cancelled=8]="cancelled",n[n.duplicated=16]="duplicated"})(yx||(yx={}));function Pa(n,e){return Mt(new Error,{type:n,[Vw]:!0},e)}function _s(n,e){return n instanceof Error&&Vw in n&&(e==null||!!(n.type&e))}const bx="[^/]+?",_V={sensitive:!1,strict:!1,start:!0,end:!0},vV=/[.+*?^${}()[\]/\\]/g;function yV(n,e){const t=Mt({},_V,e),i=[];let s=t.start?"^":"";const r=[];for(const c of n){const u=c.length?[]:[90];t.strict&&!c.length&&(s+="/");for(let f=0;fe.length?e.length===1&&e[0]===80?1:-1:0}function Hw(n,e){let t=0;const i=n.score,s=e.score;for(;t0&&e[e.length-1]<0}const xV={type:0,value:""},MV=/[a-zA-Z0-9_]/;function SV(n){if(!n)return[[]];if(n==="/")return[[xV]];if(!n.startsWith("/"))throw new Error(`Invalid path "${n}"`);function e(h){throw new Error(`ERR (${t})/"${c}": ${h}`)}let t=0,i=t;const s=[];let r;function o(){r&&s.push(r),r=[]}let a=0,l,c="",u="";function f(){c&&(t===0?r.push({type:0,value:c}):t===1||t===2||t===3?(r.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),r.push({type:1,value:c,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):e("Invalid state to consume buffer"),c="")}function d(){c+=l}for(;a{o(b)}:Bl}function o(f){if(zw(f)){const d=i.get(f);d&&(i.delete(f),t.splice(t.indexOf(d),1),d.children.forEach(o),d.alias.forEach(o))}else{const d=t.indexOf(f);d>-1&&(t.splice(d,1),f.record.name&&i.delete(f.record.name),f.children.forEach(o),f.alias.forEach(o))}}function a(){return t}function l(f){const d=CV(f,t);t.splice(d,0,f),f.record.name&&!Ex(f)&&i.set(f.record.name,f)}function c(f,d){let h,p={},_,g;if("name"in f&&f.name){if(h=i.get(f.name),!h)throw Pa(1,{location:f});g=h.record.name,p=Mt(Mx(d.params,h.keys.filter(b=>!b.optional).concat(h.parent?h.parent.keys.filter(b=>b.optional):[]).map(b=>b.name)),f.params&&Mx(f.params,h.keys.map(b=>b.name))),_=h.stringify(p)}else if(f.path!=null)_=f.path,h=t.find(b=>b.re.test(_)),h&&(p=h.parse(_),g=h.record.name);else{if(h=d.name?i.get(d.name):t.find(b=>b.re.test(d.path)),!h)throw Pa(1,{location:f,currentLocation:d});g=h.record.name,p=Mt({},d.params,f.params),_=h.stringify(p)}const m=[];let y=h;for(;y;)m.unshift(y.record),y=y.parent;return{name:g,path:_,params:p,matched:m,meta:AV(m)}}n.forEach(f=>r(f));function u(){t.length=0,i.clear()}return{addRoute:r,resolve:c,removeRoute:o,clearRoutes:u,getRoutes:a,getRecordMatcher:s}}function Mx(n,e){const t={};for(const i of e)i in n&&(t[i]=n[i]);return t}function Sx(n){const e={path:n.path,redirect:n.redirect,name:n.name,meta:n.meta||{},aliasOf:n.aliasOf,beforeEnter:n.beforeEnter,props:wV(n),children:n.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in n?n.components||null:n.component&&{default:n.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function wV(n){const e={},t=n.props||!1;if("component"in n)e.default=t;else for(const i in n.components)e[i]=typeof t=="object"?t[i]:t;return e}function Ex(n){for(;n;){if(n.record.aliasOf)return!0;n=n.parent}return!1}function AV(n){return n.reduce((e,t)=>Mt(e,t.meta),{})}function Tx(n,e){const t={};for(const i in n)t[i]=i in e?e[i]:n[i];return t}function CV(n,e){let t=0,i=e.length;for(;t!==i;){const r=t+i>>1;Hw(n,e[r])<0?i=r:t=r+1}const s=RV(n);return s&&(i=e.lastIndexOf(s,i-1)),i}function RV(n){let e=n;for(;e=e.parent;)if(Gw(e)&&Hw(n,e)===0)return e}function Gw({record:n}){return!!(n.name||n.components&&Object.keys(n.components).length||n.redirect)}function PV(n){const e={};if(n===""||n==="?")return e;const i=(n[0]==="?"?n.slice(1):n).split("&");for(let s=0;sr&&Wg(r)):[i&&Wg(i)]).forEach(r=>{r!==void 0&&(e+=(e.length?"&":"")+t,r!=null&&(e+="="+r))})}return e}function IV(n){const e={};for(const t in n){const i=n[t];i!==void 0&&(e[t]=Bi(i)?i.map(s=>s==null?null:""+s):i==null?i:""+i)}return e}const LV=Symbol(""),Ax=Symbol(""),Gh=Symbol(""),Ww=Symbol(""),$g=Symbol("");function ll(){let n=[];function e(i){return n.push(i),()=>{const s=n.indexOf(i);s>-1&&n.splice(s,1)}}function t(){n=[]}return{add:e,list:()=>n.slice(),reset:t}}function ar(n,e,t,i,s,r=o=>o()){const o=i&&(i.enterCallbacks[s]=i.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const c=d=>{d===!1?l(Pa(4,{from:t,to:e})):d instanceof Error?l(d):gV(d)?l(Pa(2,{from:e,to:d})):(o&&i.enterCallbacks[s]===o&&typeof d=="function"&&o.push(d),a())},u=r(()=>n.call(i&&i.instances[s],e,t,c));let f=Promise.resolve(u);n.length<3&&(f=f.then(c)),f.catch(d=>l(d))})}function bm(n,e,t,i,s=r=>r()){const r=[];for(const o of n)for(const a in o.components){let l=o.components[a];if(!(e!=="beforeRouteEnter"&&!o.instances[a]))if(Lw(l)){const u=(l.__vccOpts||l)[e];u&&r.push(ar(u,t,i,o,a,s))}else{let c=l();r.push(()=>c.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${o.path}"`);const f=kz(u)?u.default:u;o.mods[a]=u,o.components[a]=f;const h=(f.__vccOpts||f)[e];return h&&ar(h,t,i,o,a,s)()}))}}return r}function Cx(n){const e=En(Gh),t=En(Ww),i=Ee(()=>{const l=Ot(n.to);return e.resolve(l)}),s=Ee(()=>{const{matched:l}=i.value,{length:c}=l,u=l[c-1],f=t.matched;if(!u||!f.length)return-1;const d=f.findIndex(Ra.bind(null,u));if(d>-1)return d;const h=Rx(l[c-2]);return c>1&&Rx(u)===h&&f[f.length-1].path!==h?f.findIndex(Ra.bind(null,l[c-2])):d}),r=Ee(()=>s.value>-1&&FV(t.params,i.value.params)),o=Ee(()=>s.value>-1&&s.value===t.matched.length-1&&kw(t.params,i.value.params));function a(l={}){if(UV(l)){const c=e[Ot(n.replace)?"replace":"push"](Ot(n.to)).catch(Bl);return n.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:i,href:Ee(()=>i.value.href),isActive:r,isExactActive:o,navigate:a}}function DV(n){return n.length===1?n[0]:n}const OV=fn({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Cx,setup(n,{slots:e}){const t=bi(Cx(n)),{options:i}=En(Gh),s=Ee(()=>({[Px(n.activeClass,i.linkActiveClass,"router-link-active")]:t.isActive,[Px(n.exactActiveClass,i.linkExactActiveClass,"router-link-exact-active")]:t.isExactActive}));return()=>{const r=e.default&&DV(e.default(t));return n.custom?r:Ds("a",{"aria-current":t.isExactActive?n.ariaCurrentValue:null,href:t.href,onClick:t.navigate,class:s.value},r)}}}),NV=OV;function UV(n){if(!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)&&!n.defaultPrevented&&!(n.button!==void 0&&n.button!==0)){if(n.currentTarget&&n.currentTarget.getAttribute){const e=n.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return n.preventDefault&&n.preventDefault(),!0}}function FV(n,e){for(const t in e){const i=e[t],s=n[t];if(typeof i=="string"){if(i!==s)return!1}else if(!Bi(s)||s.length!==i.length||i.some((r,o)=>r!==s[o]))return!1}return!0}function Rx(n){return n?n.aliasOf?n.aliasOf.path:n.path:""}const Px=(n,e,t)=>n??e??t,kV=fn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(n,{attrs:e,slots:t}){const i=En($g),s=Ee(()=>n.route||i.value),r=En(Ax,0),o=Ee(()=>{let c=Ot(r);const{matched:u}=s.value;let f;for(;(f=u[c])&&!f.components;)c++;return c}),a=Ee(()=>s.value.matched[o.value]);dr(Ax,Ee(()=>o.value+1)),dr(LV,a),dr($g,s);const l=et();return $e(()=>[l.value,a.value,n.name],([c,u,f],[d,h,p])=>{u&&(u.instances[f]=c,h&&h!==u&&c&&c===d&&(u.leaveGuards.size||(u.leaveGuards=h.leaveGuards),u.updateGuards.size||(u.updateGuards=h.updateGuards))),c&&u&&(!h||!Ra(u,h)||!d)&&(u.enterCallbacks[f]||[]).forEach(_=>_(c))},{flush:"post"}),()=>{const c=s.value,u=n.name,f=a.value,d=f&&f.components[u];if(!d)return Ix(t.default,{Component:d,route:c});const h=f.props[u],p=h?h===!0?c.params:typeof h=="function"?h(c):h:null,g=Ds(d,Mt({},p,e,{onVnodeUnmounted:m=>{m.component.isUnmounted&&(f.instances[u]=null)},ref:l}));return Ix(t.default,{Component:g,route:c})||g}}});function Ix(n,e){if(!n)return null;const t=n(e);return t.length===1?t[0]:t}const Xw=kV;function BV(n){const e=TV(n.routes,n),t=n.parseQuery||PV,i=n.stringifyQuery||wx,s=n.history,r=ll(),o=ll(),a=ll(),l=De(Qs);let c=Qs;na&&n.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=vm.bind(null,X=>""+X),f=vm.bind(null,Zz),d=vm.bind(null,bc);function h(X,ae){let fe,ce;return zw(X)?(fe=e.getRecordMatcher(X),ce=ae):ce=X,e.addRoute(ce,fe)}function p(X){const ae=e.getRecordMatcher(X);ae&&e.removeRoute(ae)}function _(){return e.getRoutes().map(X=>X.record)}function g(X){return!!e.getRecordMatcher(X)}function m(X,ae){if(ae=Mt({},ae||l.value),typeof X=="string"){const R=ym(t,X,ae.path),te=e.resolve({path:R.path},ae),G=s.createHref(R.fullPath);return Mt(R,te,{params:d(te.params),hash:bc(R.hash),redirectedFrom:void 0,href:G})}let fe;if(X.path!=null)fe=Mt({},X,{path:ym(t,X.path,ae.path).path});else{const R=Mt({},X.params);for(const te in R)R[te]==null&&delete R[te];fe=Mt({},X,{params:f(R)}),ae.params=f(ae.params)}const ce=e.resolve(fe,ae),Ue=X.hash||"";ce.params=u(d(ce.params));const k=eV(i,Mt({},X,{hash:Yz(Ue),path:ce.path})),z=s.createHref(k);return Mt({fullPath:k,hash:Ue,query:i===wx?IV(X.query):X.query||{}},ce,{redirectedFrom:void 0,href:z})}function y(X){return typeof X=="string"?ym(t,X,l.value.path):Mt({},X)}function b(X,ae){if(c!==X)return Pa(8,{from:ae,to:X})}function v(X){return S(X)}function T(X){return v(Mt(y(X),{replace:!0}))}function E(X){const ae=X.matched[X.matched.length-1];if(ae&&ae.redirect){const{redirect:fe}=ae;let ce=typeof fe=="function"?fe(X):fe;return typeof ce=="string"&&(ce=ce.includes("?")||ce.includes("#")?ce=y(ce):{path:ce},ce.params={}),Mt({query:X.query,hash:X.hash,params:ce.path!=null?{}:X.params},ce)}}function S(X,ae){const fe=c=m(X),ce=l.value,Ue=X.state,k=X.force,z=X.replace===!0,R=E(fe);if(R)return S(Mt(y(R),{state:typeof R=="object"?Mt({},Ue,R.state):Ue,force:k,replace:z}),ae||fe);const te=fe;te.redirectedFrom=ae;let G;return!k&&tV(i,ce,fe)&&(G=Pa(16,{to:te,from:ce}),se(ce,ce,!0,!1)),(G?Promise.resolve(G):M(te,ce)).catch(W=>_s(W)?_s(W,2)?W:be(W):Z(W,te,ce)).then(W=>{if(W){if(_s(W,2))return S(Mt({replace:z},y(W.to),{state:typeof W.to=="object"?Mt({},Ue,W.to.state):Ue,force:k}),ae||te)}else W=F(te,ce,!0,z,Ue);return L(te,ce,W),W})}function P(X,ae){const fe=b(X,ae);return fe?Promise.reject(fe):Promise.resolve()}function x(X){const ae=re.values().next().value;return ae&&typeof ae.runWithContext=="function"?ae.runWithContext(X):X()}function M(X,ae){let fe;const[ce,Ue,k]=zV(X,ae);fe=bm(ce.reverse(),"beforeRouteLeave",X,ae);for(const R of ce)R.leaveGuards.forEach(te=>{fe.push(ar(te,X,ae))});const z=P.bind(null,X,ae);return fe.push(z),xe(fe).then(()=>{fe=[];for(const R of r.list())fe.push(ar(R,X,ae));return fe.push(z),xe(fe)}).then(()=>{fe=bm(Ue,"beforeRouteUpdate",X,ae);for(const R of Ue)R.updateGuards.forEach(te=>{fe.push(ar(te,X,ae))});return fe.push(z),xe(fe)}).then(()=>{fe=[];for(const R of k)if(R.beforeEnter)if(Bi(R.beforeEnter))for(const te of R.beforeEnter)fe.push(ar(te,X,ae));else fe.push(ar(R.beforeEnter,X,ae));return fe.push(z),xe(fe)}).then(()=>(X.matched.forEach(R=>R.enterCallbacks={}),fe=bm(k,"beforeRouteEnter",X,ae,x),fe.push(z),xe(fe))).then(()=>{fe=[];for(const R of o.list())fe.push(ar(R,X,ae));return fe.push(z),xe(fe)}).catch(R=>_s(R,8)?R:Promise.reject(R))}function L(X,ae,fe){a.list().forEach(ce=>x(()=>ce(X,ae,fe)))}function F(X,ae,fe,ce,Ue){const k=b(X,ae);if(k)return k;const z=ae===Qs,R=na?history.state:{};fe&&(ce||z?s.replace(X.fullPath,Mt({scroll:z&&R&&R.scroll},Ue)):s.push(X.fullPath,Ue)),l.value=X,se(X,ae,fe,z),be()}let H;function Y(){H||(H=s.listen((X,ae,fe)=>{if(!ge.listening)return;const ce=m(X),Ue=E(ce);if(Ue){S(Mt(Ue,{replace:!0,force:!0}),ce).catch(Bl);return}c=ce;const k=l.value;na&&cV(_x(k.fullPath,fe.delta),Hh()),M(ce,k).catch(z=>_s(z,12)?z:_s(z,2)?(S(Mt(y(z.to),{force:!0}),ce).then(R=>{_s(R,20)&&!fe.delta&&fe.type===xc.pop&&s.go(-1,!1)}).catch(Bl),Promise.reject()):(fe.delta&&s.go(-fe.delta,!1),Z(z,ce,k))).then(z=>{z=z||F(ce,k,!1),z&&(fe.delta&&!_s(z,8)?s.go(-fe.delta,!1):fe.type===xc.pop&&_s(z,20)&&s.go(-1,!1)),L(ce,k,z)}).catch(Bl)}))}let ee=ll(),K=ll(),Q;function Z(X,ae,fe){be(X);const ce=K.list();return ce.length?ce.forEach(Ue=>Ue(X,ae,fe)):console.error(X),Promise.reject(X)}function he(){return Q&&l.value!==Qs?Promise.resolve():new Promise((X,ae)=>{ee.add([X,ae])})}function be(X){return Q||(Q=!X,Y(),ee.list().forEach(([ae,fe])=>X?fe(X):ae()),ee.reset()),X}function se(X,ae,fe,ce){const{scrollBehavior:Ue}=n;if(!na||!Ue)return Promise.resolve();const k=!fe&&uV(_x(X.fullPath,0))||(ce||!fe)&&history.state&&history.state.scroll||null;return Er().then(()=>Ue(X,ae,k)).then(z=>z&&lV(z)).catch(z=>Z(z,X,ae))}const ye=X=>s.go(X);let He;const re=new Set,ge={currentRoute:l,listening:!0,addRoute:h,removeRoute:p,clearRoutes:e.clearRoutes,hasRoute:g,getRoutes:_,resolve:m,options:n,push:v,replace:T,go:ye,back:()=>ye(-1),forward:()=>ye(1),beforeEach:r.add,beforeResolve:o.add,afterEach:a.add,onError:K.add,isReady:he,install(X){const ae=this;X.component("RouterLink",NV),X.component("RouterView",Xw),X.config.globalProperties.$router=ae,Object.defineProperty(X.config.globalProperties,"$route",{enumerable:!0,get:()=>Ot(l)}),na&&!He&&l.value===Qs&&(He=!0,v(s.location).catch(Ue=>{}));const fe={};for(const Ue in Qs)Object.defineProperty(fe,Ue,{get:()=>l.value[Ue],enumerable:!0});X.provide(Gh,ae),X.provide(Ww,sS(fe)),X.provide($g,l);const ce=X.unmount;re.add(X),X.unmount=function(){re.delete(X),re.size<1&&(c=Qs,H&&H(),H=null,l.value=Qs,He=!1,Q=!1),ce()}}};function xe(X){return X.reduce((ae,fe)=>ae.then(()=>x(fe)),Promise.resolve())}return ge}function zV(n,e){const t=[],i=[],s=[],r=Math.max(e.matched.length,n.matched.length);for(let o=0;oRa(c,a))?i.push(a):t.push(a));const l=n.matched[o];l&&(e.matched.find(c=>Ra(c,l))||s.push(l))}return[t,i,s]}function VV(){return En(Gh)}const HV=[{path:"/",name:"/",component:()=>je(()=>import("./index-D8WWKFo2.js"),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,1,2,19,20,21,22])),meta:{layout:"stage",stageTransition:{name:"bubble-wave-out"}}},{path:"/:all(.*)",name:"/[...all]",component:()=>je(()=>import("./_...all_-CO59XhD5.js"),[])},{path:"/audio",name:"/audio",component:()=>je(()=>import("./audio-CVaZ8kG2.js"),[])},{path:"/devtools",children:[{path:"background-remove",name:"/devtools/background-remove",component:()=>je(()=>import("./background-remove-DM2RSAtO.js"),__vite__mapDeps([23,4,5,24]))},{path:"chat",name:"/devtools/chat",component:()=>je(()=>import("./chat-zLkxe0qa.js"),__vite__mapDeps([25,13,9]))},{path:"image",name:"/devtools/image",component:()=>je(()=>import("./image-Bhi85w3C.js"),__vite__mapDeps([26,27]))},{path:"vibrant",name:"/devtools/vibrant",component:()=>je(()=>import("./vibrant-D9yH5UkB.js"),__vite__mapDeps([28,4,5,24,29]))}]},{path:"/queue",name:"/queue",component:()=>je(()=>import("./queue-CbNCDjQD.js"),__vite__mapDeps([30,11]))},{path:"/settings",children:[{path:"",name:"/settings/",component:()=>je(()=>import("./index-CF1TyHQe.js"),__vite__mapDeps([31,4,5,32,33,21])),meta:{stageTransition:{name:"slide"}}},{path:"airi-card",children:[{path:"",name:"/settings/airi-card/",component:()=>je(()=>import("./index-Bsv4W1GE.js"),__vite__mapDeps([34,4,5,24,32,14,15,10,9,8,35,36,37,38,21])),meta:{stageTransition:{name:"slide"}}},{path:"components",children:[{path:"CardDetailDialog",name:"/settings/airi-card/components/CardDetailDialog",component:()=>je(()=>import("./CardDetailDialog-CxciD2B5.js"),__vite__mapDeps([39,35,36,37,4,5,14,15,10,9,8]))},{path:"CardListItem",name:"/settings/airi-card/components/CardListItem",component:()=>je(()=>import("./CardListItem-BTy07mxf.js"),__vite__mapDeps([40,38,4,5]))},{path:"DeleteCardDialog",name:"/settings/airi-card/components/DeleteCardDialog",component:()=>je(()=>import("./DeleteCardDialog-ByKUc8bN.js"),__vite__mapDeps([41,36,37]))}]}]},{path:"appearance",children:[{path:"",name:"/settings/appearance/",component:()=>je(()=>import("./index-ClgaRsQ-.js"),__vite__mapDeps([42,4,5,32,43,18,17,37,21,44])),meta:{stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]},{path:"memory",children:[{path:"",name:"/settings/memory/",component:()=>je(()=>import("./index-DMkg6SUZ.js"),__vite__mapDeps([45,4,5,32]))}]},{path:"models",children:[{path:"",name:"/settings/models/",component:()=>je(()=>import("./index-Bfn5GkWN.js"),__vite__mapDeps([46,33,4,5,32,16,29,43,18,17,37,47,21,48])),meta:{stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]},{path:"modules",children:[{path:"",name:"/settings/modules/",component:()=>je(()=>import("./index-BjaUT3uc.js"),__vite__mapDeps([49,4,5,32,50,33,47,21])),meta:{stageTransition:{name:"slide",pageSpecificAvailable:!0}}},{path:"consciousness",name:"/settings/modules/consciousness",component:()=>je(()=>import("./consciousness-CaJgKvov.js"),__vite__mapDeps([51,4,5,52,17,53,32,15,10,9,21])),meta:{stageTransition:{name:"slide"}}},{path:"memory-long-term",name:"/settings/modules/memory-long-term",component:()=>je(()=>import("./memory-long-term-CTv3Aw2p.js"),__vite__mapDeps([54,4,5,32]))},{path:"memory-short-term",name:"/settings/modules/memory-short-term",component:()=>je(()=>import("./memory-short-term-5cVLOK6h.js"),__vite__mapDeps([55,4,5,32]))},{path:"speech",name:"/settings/modules/speech",component:()=>je(()=>import("./speech-D5UnB8H8.js"),__vite__mapDeps([56,57,4,5,58,53,59,52,17,60,19,32,10,9,8,21])),meta:{stageTransition:{name:"slide"}}}]},{path:"providers",children:[{path:"",name:"/settings/providers/",component:()=>je(()=>import("./index-DKoBS1Xx.js"),__vite__mapDeps([61,33,4,5,32,10,9,50,47,21])),meta:{stageTransition:{name:"slide",pageSpecificAvailable:!0}}},{path:"alibaba-cloud-model-studio",name:"/settings/providers/alibaba-cloud-model-studio",component:()=>je(()=>import("./alibaba-cloud-model-studio-Dt0yEM1s.js"),__vite__mapDeps([62,59,4,5,10,9,8,63,57,64,18,17,58,53,65,66,32]))},{path:"anthropic",name:"/settings/providers/anthropic",component:()=>je(()=>import("./anthropic-Djw1RdIl.js"),__vite__mapDeps([67,4,5,10,9,64,18,17,58,53,65,66,68,32]))},{path:"cloudflare-workers-ai",name:"/settings/providers/cloudflare-workers-ai",component:()=>je(()=>import("./cloudflare-workers-ai--E-2Lfql.js"),__vite__mapDeps([69,4,5,10,9,58,53,65,66,68,32]))},{path:"deepseek",name:"/settings/providers/deepseek",component:()=>je(()=>import("./deepseek-cfgx_3qB.js"),__vite__mapDeps([70,4,5,10,9,64,18,17,58,53,65,66,68,32]))},{path:"elevenlabs",name:"/settings/providers/elevenlabs",component:()=>je(()=>import("./elevenlabs-Bk-fDLOn.js"),__vite__mapDeps([71,57,4,5,59,10,9,8,63,64,18,17,58,53,65,66,32]))},{path:"featherless-ai",name:"/settings/providers/featherless-ai",component:()=>je(()=>import("./featherless-ai-C6WQwaS2.js"),__vite__mapDeps([72,4,5,10,9,64,18,17,58,53,65,66,68,32]))},{path:"fireworks-ai",name:"/settings/providers/fireworks-ai",component:()=>je(()=>import("./fireworks-ai-e_P48mks.js"),__vite__mapDeps([73,4,5,10,9,64,18,17,58,53,65,66,68,32]))},{path:"google-generative-ai",name:"/settings/providers/google-generative-ai",component:()=>je(()=>import("./google-generative-ai-D6Po5Sbe.js"),__vite__mapDeps([74,4,5,10,9,64,18,17,58,53,65,66,68,32]))},{path:"microsoft-speech",name:"/settings/providers/microsoft-speech",component:()=>je(()=>import("./microsoft-speech-DN1YLkUZ.js"),__vite__mapDeps([75,58,53,4,5,10,9,8,63,57,64,18,17,65,66,32]))},{path:"mistral-ai",name:"/settings/providers/mistral-ai",component:()=>je(()=>import("./mistral-ai-D6fyZpIj.js"),__vite__mapDeps([76,4,5,10,9,64,18,17,58,53,65,66,68,32]))},{path:"moonshot-ai",name:"/settings/providers/moonshot-ai",component:()=>je(()=>import("./moonshot-ai-UMUsb3tN.js"),__vite__mapDeps([77,4,5,10,9,64,18,17,58,53,65,66,68,32]))},{path:"novita-ai",name:"/settings/providers/novita-ai",component:()=>je(()=>import("./novita-ai-DhZP6eEA.js"),__vite__mapDeps([78,4,5,10,9,64,18,17,58,53,65,66,68,32]))},{path:"ollama",name:"/settings/providers/ollama",component:()=>je(()=>import("./ollama-b51zIBIG.js"),__vite__mapDeps([79,53,4,5,10,9,64,18,17,58,66,68,32]))},{path:"openai",name:"/settings/providers/openai",component:()=>je(()=>import("./openai-DYnQZUih.js"),__vite__mapDeps([80,4,5,10,9,64,18,17,58,53,65,66,68,32]))},{path:"openrouter-ai",name:"/settings/providers/openrouter-ai",component:()=>je(()=>import("./openrouter-ai-CAqHWZfw.js"),__vite__mapDeps([81,4,5,10,9,64,18,17,58,53,65,66,68,32]))},{path:"together-ai",name:"/settings/providers/together-ai",component:()=>je(()=>import("./together-ai-NMFH4eMa.js"),__vite__mapDeps([82,4,5,10,9,64,18,17,58,53,65,66,68,32]))},{path:"volcengine",name:"/settings/providers/volcengine",component:()=>je(()=>import("./volcengine-DGKTIK6C.js"),__vite__mapDeps([83,58,53,59,4,5,10,9,8,63,57,64,18,17,65,66,32]))},{path:"xai",name:"/settings/providers/xai",component:()=>je(()=>import("./xai-C121Ni52.js"),__vite__mapDeps([84,4,5,10,9,64,18,17,58,53,65,66,68,32]))}]},{path:"scene",children:[{path:"",name:"/settings/scene/",component:()=>je(()=>import("./index-D3Hcl_56.js"),__vite__mapDeps([85,33,4,5,32,47,21])),meta:{stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]}]},{path:"/test",children:[{path:"filter-message",name:"/test/filter-message",component:()=>je(()=>import("./filter-message-Dmq5FnwC.js"),__vite__mapDeps([86,4,5,60,19]))},{path:"queues",children:[{path:"delays",name:"/test/queues/delays",component:()=>je(()=>import("./delays-BIByavQN.js"),__vite__mapDeps([87,4,5,60,19,12,11,20]))},{path:"emotions",name:"/test/queues/emotions",component:()=>je(()=>import("./emotions-hLa4YANP.js"),__vite__mapDeps([88,4,5,60,19,11,12]))},{path:"messages",name:"/test/queues/messages",component:()=>je(()=>import("./messages-Da3sXLYk.js"),__vite__mapDeps([89,4,5,60,19,11,12]))}]}]}],$w=(n,e)=>{if(typeof n=="number"){if(e===3)return{mode:"rgb",r:(n>>8&15|n>>4&240)/255,g:(n>>4&15|n&240)/255,b:(n&15|n<<4&240)/255};if(e===4)return{mode:"rgb",r:(n>>12&15|n>>8&240)/255,g:(n>>8&15|n>>4&240)/255,b:(n>>4&15|n&240)/255,alpha:(n&15|n<<4&240)/255};if(e===6)return{mode:"rgb",r:(n>>16&255)/255,g:(n>>8&255)/255,b:(n&255)/255};if(e===8)return{mode:"rgb",r:(n>>24&255)/255,g:(n>>16&255)/255,b:(n>>8&255)/255,alpha:(n&255)/255}}},GV={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},WV=n=>$w(GV[n.toLowerCase()],6),XV=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,$V=n=>{let e;return(e=n.match(XV))?$w(parseInt(e[1],16),e[1].length):void 0},hr="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",Vl=`${hr}%`,V_=`(?:${hr}%|${hr})`,qV=`(?:${hr}(deg|grad|rad|turn)|${hr})`,Ia="\\s*,\\s*",YV=new RegExp(`^rgba?\\(\\s*${hr}${Ia}${hr}${Ia}${hr}\\s*(?:,\\s*${V_}\\s*)?\\)$`),jV=new RegExp(`^rgba?\\(\\s*${Vl}${Ia}${Vl}${Ia}${Vl}\\s*(?:,\\s*${V_}\\s*)?\\)$`),KV=n=>{let e={mode:"rgb"},t;if(t=n.match(YV))t[1]!==void 0&&(e.r=t[1]/255),t[2]!==void 0&&(e.g=t[2]/255),t[3]!==void 0&&(e.b=t[3]/255);else if(t=n.match(jV))t[1]!==void 0&&(e.r=t[1]/100),t[2]!==void 0&&(e.g=t[2]/100),t[3]!==void 0&&(e.b=t[3]/100);else return;return t[4]!==void 0?e.alpha=Math.max(0,Math.min(1,t[4]/100)):t[5]!==void 0&&(e.alpha=Math.max(0,Math.min(1,+t[5]))),e},ZV=(n,e)=>n===void 0?void 0:typeof n!="object"?a6(n):n.mode!==void 0?n:e?{...n,mode:e}:void 0,qw=(n="rgb")=>e=>(e=ZV(e,n))!==void 0?e.mode===n?e:Yi[e.mode][n]?Yi[e.mode][n](e):n==="rgb"?Yi[e.mode].rgb(e):Yi.rgb[n](Yi[e.mode].rgb(e)):void 0,Yi={},Yw={},Ld=[],jw={},JV=n=>n,Et=n=>(Yi[n.mode]={...Yi[n.mode],...n.toMode},Object.keys(n.fromMode||{}).forEach(e=>{Yi[e]||(Yi[e]={}),Yi[e][n.mode]=n.fromMode[e]}),n.ranges||(n.ranges={}),n.difference||(n.difference={}),n.channels.forEach(e=>{if(n.ranges[e]===void 0&&(n.ranges[e]=[0,1]),!n.interpolate[e])throw new Error(`Missing interpolator for: ${e}`);typeof n.interpolate[e]=="function"&&(n.interpolate[e]={use:n.interpolate[e]}),n.interpolate[e].fixup||(n.interpolate[e].fixup=JV)}),Yw[n.mode]=n,(n.parse||[]).forEach(e=>{e6(e,n.mode)}),qw(n.mode)),QV=n=>Yw[n],e6=(n,e)=>{if(typeof n=="string"){if(!e)throw new Error("'mode' required when 'parser' is a string");jw[n]=e}else typeof n=="function"&&Ld.indexOf(n)<0&&Ld.push(n)},qg=/[^\x00-\x7F]|[a-zA-Z_]/,t6=/[^\x00-\x7F]|[-\w]/,_e={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"};let qe=0;function cf(n){let e=n[qe],t=n[qe+1];return e==="-"||e==="+"?/\d/.test(t)||t==="."&&/\d/.test(n[qe+2]):e==="."?/\d/.test(t):/\d/.test(e)}function Yg(n){if(qe>=n.length)return!1;let e=n[qe];if(qg.test(e))return!0;if(e==="-"){if(n.length-qe<2)return!1;let t=n[qe+1];return!!(t==="-"||qg.test(t))}return!1}const n6={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function cl(n){let e="";if((n[qe]==="-"||n[qe]==="+")&&(e+=n[qe++]),e+=uf(n),n[qe]==="."&&/\d/.test(n[qe+1])&&(e+=n[qe++]+uf(n)),(n[qe]==="e"||n[qe]==="E")&&((n[qe+1]==="-"||n[qe+1]==="+")&&/\d/.test(n[qe+2])?e+=n[qe++]+n[qe++]+uf(n):/\d/.test(n[qe+1])&&(e+=n[qe++]+uf(n))),Yg(n)){let t=Dd(n);return t==="deg"||t==="rad"||t==="turn"||t==="grad"?{type:_e.Hue,value:e*n6[t]}:void 0}return n[qe]==="%"?(qe++,{type:_e.Percentage,value:+e}):{type:_e.Number,value:+e}}function uf(n){let e="";for(;/\d/.test(n[qe]);)e+=n[qe++];return e}function Dd(n){let e="";for(;qe4)){if(t.length===4){if(t[3].type!==_e.Alpha)return;t[3]=t[3].value}return t.length===3&&t.push({type:_e.None,value:void 0}),t.every(s=>s.type!==_e.Alpha)?t:void 0}}function o6(n,e){n._i=0;let t=n[n._i++];if(!t||t.type!==_e.Function)return;let i=Kw(n,e);if(i)return i.unshift(t.value),i}const a6=n=>{if(typeof n!="string")return;const e=s6(n),t=e?o6(e,!0):void 0;let i,s=0,r=Ld.length;for(;sn==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,u6=(n,e,t)=>n+t*(e-n),f6=n=>{let e=[];for(let t=0;te=>{let t=f6(e);return i=>{let s=i*t.length,r=i>=1?t.length-1:Math.max(Math.floor(s),0),o=t[r];return o===void 0?void 0:n(o[0],o[1],s-r)}},Ae=d6(u6),on=n=>{let e=!1,t=n.map(i=>i!==void 0?(e=!0,i):1);return e?t:n},Ha={mode:"rgb",channels:["r","g","b","alpha"],parse:[l6,$V,KV,WV,c6,"srgb"],serialize:"srgb",interpolate:{r:Ae,g:Ae,b:Ae,alpha:{use:Ae,fixup:on}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},xm=(n=0)=>Math.pow(Math.abs(n),563/256)*Math.sign(n),Lx=n=>{let e=xm(n.r),t=xm(n.g),i=xm(n.b),s={mode:"xyz65",x:.5766690429101305*e+.1855582379065463*t+.1882286462349947*i,y:.297344975250536*e+.6273635662554661*t+.0752914584939979*i,z:.0270313613864123*e+.0706888525358272*t+.9913375368376386*i};return n.alpha!==void 0&&(s.alpha=n.alpha),s},Mm=n=>Math.pow(Math.abs(n),256/563)*Math.sign(n),Dx=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s={mode:"a98",r:Mm(n*2.0415879038107465-e*.5650069742788597-.3447313507783297*t),g:Mm(n*-.9692436362808798+e*1.8759675015077206+.0415550574071756*t),b:Mm(n*.0134442806320312-e*.1183623922310184+1.0151749943912058*t)};return i!==void 0&&(s.alpha=i),s},Sm=(n=0)=>{const e=Math.abs(n);return e<=.04045?n/12.92:(Math.sign(n)||1)*Math.pow((e+.055)/1.055,2.4)},Ga=({r:n,g:e,b:t,alpha:i})=>{let s={mode:"lrgb",r:Sm(n),g:Sm(e),b:Sm(t)};return i!==void 0&&(s.alpha=i),s},Io=n=>{let{r:e,g:t,b:i,alpha:s}=Ga(n),r={mode:"xyz65",x:.4123907992659593*e+.357584339383878*t+.1804807884018343*i,y:.2126390058715102*e+.715168678767756*t+.0721923153607337*i,z:.0193308187155918*e+.119194779794626*t+.9505321522496607*i};return s!==void 0&&(r.alpha=s),r},Em=(n=0)=>{const e=Math.abs(n);return e>.0031308?(Math.sign(n)||1)*(1.055*Math.pow(e,1/2.4)-.055):n*12.92},Wa=({r:n,g:e,b:t,alpha:i},s="rgb")=>{let r={mode:s,r:Em(n),g:Em(e),b:Em(t)};return i!==void 0&&(r.alpha=i),r},Lo=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Wa({r:n*3.2409699419045226-e*1.537383177570094-.4986107602930034*t,g:n*-.9692436362808796+e*1.8759675015077204+.0415550574071756*t,b:n*.0556300796969936-e*.2039769588889765+1.0569715142428784*t});return i!==void 0&&(s.alpha=i),s},h6={...Ha,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:n=>Dx(Io(n)),xyz65:Dx},toMode:{rgb:n=>Lo(Lx(n)),xyz65:Lx}},_n=n=>(n=n%360)<0?n+360:n,p6=(n,e)=>n.map((t,i,s)=>{if(t===void 0)return t;let r=_n(t);return i===0||n[i-1]===void 0?r:e(r-_n(s[i-1]))}).reduce((t,i)=>!t.length||i===void 0||t[t.length-1]===void 0?(t.push(i),t):(t.push(i+t[t.length-1]),t),[]),Gs=n=>p6(n,e=>Math.abs(e)<=180?e:e-360*Math.sign(e)),ln=[-.14861,1.78277,-.29227,-.90649,1.97294,0],m6=Math.PI/180,g6=180/Math.PI;let Ox=ln[3]*ln[4],Nx=ln[1]*ln[4],Ux=ln[1]*ln[2]-ln[0]*ln[3];const _6=({r:n,g:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=(Ux*t+n*Ox-e*Nx)/(Ux+Ox-Nx),r=t-s,o=(ln[4]*(e-s)-ln[2]*r)/ln[3],a={mode:"cubehelix",l:s,s:s===0||s===1?void 0:Math.sqrt(r*r+o*o)/(ln[4]*s*(1-s))};return a.s&&(a.h=Math.atan2(o,r)*g6-120),i!==void 0&&(a.alpha=i),a},v6=({h:n,s:e,l:t,alpha:i})=>{let s={mode:"rgb"};n=(n===void 0?0:n+120)*m6,t===void 0&&(t=0);let r=e===void 0?0:e*t*(1-t),o=Math.cos(n),a=Math.sin(n);return s.r=t+r*(ln[0]*o+ln[1]*a),s.g=t+r*(ln[2]*o+ln[3]*a),s.b=t+r*(ln[4]*o+ln[5]*a),i!==void 0&&(s.alpha=i),s},Wh=(n,e)=>{if(n.h===void 0||e.h===void 0||!n.s||!e.s)return 0;let t=_n(n.h),i=_n(e.h),s=Math.sin((i-t+360)/2*Math.PI/180);return 2*Math.sqrt(n.s*e.s)*s},y6=(n,e)=>{if(n.h===void 0||e.h===void 0)return 0;let t=_n(n.h),i=_n(e.h);return Math.abs(i-t)>180?t-(i-360*Math.sign(i-t)):i-t},Xh=(n,e)=>{if(n.h===void 0||e.h===void 0||!n.c||!e.c)return 0;let t=_n(n.h),i=_n(e.h),s=Math.sin((i-t+360)/2*Math.PI/180);return 2*Math.sqrt(n.c*e.c)*s},Ws=n=>{let e=n.reduce((i,s)=>{if(s!==void 0){let r=s*Math.PI/180;i.sin+=Math.sin(r),i.cos+=Math.cos(r)}return i},{sin:0,cos:0}),t=Math.atan2(e.sin,e.cos)*180/Math.PI;return t<0?360+t:t},b6={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:_6},toMode:{rgb:v6},interpolate:{h:{use:Ae,fixup:Gs},s:Ae,l:Ae,alpha:{use:Ae,fixup:on}},difference:{h:Wh},average:{h:Ws}},br=({l:n,a:e,b:t,alpha:i},s="lch")=>{e===void 0&&(e=0),t===void 0&&(t=0);let r=Math.sqrt(e*e+t*t),o={mode:s,l:n,c:r};return r&&(o.h=_n(Math.atan2(t,e)*180/Math.PI)),i!==void 0&&(o.alpha=i),o},xr=({l:n,c:e,h:t,alpha:i},s="lab")=>{t===void 0&&(t=0);let r={mode:s,l:n,a:e?e*Math.cos(t/180*Math.PI):0,b:e?e*Math.sin(t/180*Math.PI):0};return i!==void 0&&(r.alpha=i),r},Zw=Math.pow(29,3)/Math.pow(3,3),Jw=Math.pow(6,3)/Math.pow(29,3),Jt={X:.3457/.3585,Y:1,Z:(1-.3457-.3585)/.3585},ma={X:.3127/.329,Y:1,Z:(1-.3127-.329)/.329};let Tm=n=>Math.pow(n,3)>Jw?Math.pow(n,3):(116*n-16)/Zw;const Qw=({l:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=(n+16)/116,r=e/500+s,o=s-t/200,a={mode:"xyz65",x:Tm(r)*ma.X,y:Tm(s)*ma.Y,z:Tm(o)*ma.Z};return i!==void 0&&(a.alpha=i),a},$h=n=>Lo(Qw(n)),wm=n=>n>Jw?Math.cbrt(n):(Zw*n+16)/116,eA=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=wm(n/ma.X),r=wm(e/ma.Y),o=wm(t/ma.Z),a={mode:"lab65",l:116*r-16,a:500*(s-r),b:200*(r-o)};return i!==void 0&&(a.alpha=i),a},qh=n=>{let e=eA(Io(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e},Od=1,tA=1,Mc=26/180*Math.PI,Nd=Math.cos(Mc),Ud=Math.sin(Mc),nA=100/Math.log(139/100),jg=({l:n,c:e,h:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s={mode:"lab65",l:(Math.exp(n*Od/nA)-1)/.0039},r=(Math.exp(.0435*e*tA*Od)-1)/.075,o=r*Math.cos(t/180*Math.PI-Mc),a=r*Math.sin(t/180*Math.PI-Mc);return s.a=o*Nd-a/.83*Ud,s.b=o*Ud+a/.83*Nd,i!==void 0&&(s.alpha=i),s},Kg=({l:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=e*Nd+t*Ud,r=.83*(t*Nd-e*Ud),o=Math.sqrt(s*s+r*r),a={mode:"dlch",l:nA/Od*Math.log(1+.0039*n),c:Math.log(1+.075*o)/(.0435*tA*Od)};return a.c&&(a.h=_n((Math.atan2(r,s)+Mc)/Math.PI*180)),i!==void 0&&(a.alpha=i),a},Fx=n=>jg(br(n,"dlch")),kx=n=>xr(Kg(n),"dlab"),x6={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:Fx,rgb:n=>$h(Fx(n))},fromMode:{lab65:kx,rgb:n=>kx(qh(n))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:Ae,a:Ae,b:Ae,alpha:{use:Ae,fixup:on}}},M6={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:jg,dlab:n=>xr(n,"dlab"),rgb:n=>$h(jg(n))},fromMode:{lab65:Kg,dlab:n=>br(n,"dlch"),rgb:n=>Kg(qh(n))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:Ae,c:Ae,h:{use:Ae,fixup:Gs},alpha:{use:Ae,fixup:on}},difference:{h:Xh},average:{h:Ws}};function S6({h:n,s:e,i:t,alpha:i}){n=_n(n!==void 0?n:0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.abs(n/60%2-1),r;switch(Math.floor(n/60)){case 0:r={r:t*(1+e*(3/(2-s)-1)),g:t*(1+e*(3*(1-s)/(2-s)-1)),b:t*(1-e)};break;case 1:r={r:t*(1+e*(3*(1-s)/(2-s)-1)),g:t*(1+e*(3/(2-s)-1)),b:t*(1-e)};break;case 2:r={r:t*(1-e),g:t*(1+e*(3/(2-s)-1)),b:t*(1+e*(3*(1-s)/(2-s)-1))};break;case 3:r={r:t*(1-e),g:t*(1+e*(3*(1-s)/(2-s)-1)),b:t*(1+e*(3/(2-s)-1))};break;case 4:r={r:t*(1+e*(3*(1-s)/(2-s)-1)),g:t*(1-e),b:t*(1+e*(3/(2-s)-1))};break;case 5:r={r:t*(1+e*(3/(2-s)-1)),g:t*(1-e),b:t*(1+e*(3*(1-s)/(2-s)-1))};break;default:r={r:t*(1-e),g:t*(1-e),b:t*(1-e)}}return r.mode="rgb",i!==void 0&&(r.alpha=i),r}function E6({r:n,g:e,b:t,alpha:i}){n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.max(n,e,t),r=Math.min(n,e,t),o={mode:"hsi",s:n+e+t===0?0:1-3*r/(n+e+t),i:(n+e+t)/3};return s-r!==0&&(o.h=(s===n?(e-t)/(s-r)+(e{switch(e){case"deg":return+n;case"rad":return n/Math.PI*180;case"grad":return n/10*9;case"turn":return n*360}},R6=new RegExp(`^hsla?\\(\\s*${qV}${Ia}${Vl}${Ia}${Vl}\\s*(?:,\\s*${V_}\\s*)?\\)$`),P6=n=>{let e=n.match(R6);if(!e)return;let t={mode:"hsl"};return e[3]!==void 0?t.h=+e[3]:e[1]!==void 0&&e[2]!==void 0&&(t.h=C6(e[1],e[2])),e[4]!==void 0&&(t.s=Math.min(Math.max(0,e[4]/100),1)),e[5]!==void 0&&(t.l=Math.min(Math.max(0,e[5]/100),1)),e[6]!==void 0?t.alpha=Math.max(0,Math.min(1,e[6]/100)):e[7]!==void 0&&(t.alpha=Math.max(0,Math.min(1,+e[7]))),t};function I6(n,e){if(!e||e[0]!=="hsl"&&e[0]!=="hsla")return;const t={mode:"hsl"},[,i,s,r,o]=e;if(i.type!==_e.None){if(i.type===_e.Percentage)return;t.h=i.value}if(s.type!==_e.None){if(s.type===_e.Hue)return;t.s=s.value/100}if(r.type!==_e.None){if(r.type===_e.Hue)return;t.l=r.value/100}return o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const iA={mode:"hsl",toMode:{rgb:w6},fromMode:{rgb:A6},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[I6,P6],serialize:n=>`hsl(${n.h!==void 0?n.h:"none"} ${n.s!==void 0?n.s*100+"%":"none"} ${n.l!==void 0?n.l*100+"%":"none"}${n.alpha<1?` / ${n.alpha}`:""})`,interpolate:{h:{use:Ae,fixup:Gs},s:Ae,l:Ae,alpha:{use:Ae,fixup:on}},difference:{h:Wh},average:{h:Ws}};function sA({h:n,s:e,v:t,alpha:i}){n=_n(n!==void 0?n:0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.abs(n/60%2-1),r;switch(Math.floor(n/60)){case 0:r={r:t,g:t*(1-e*s),b:t*(1-e)};break;case 1:r={r:t*(1-e*s),g:t,b:t*(1-e)};break;case 2:r={r:t*(1-e),g:t,b:t*(1-e*s)};break;case 3:r={r:t*(1-e),g:t*(1-e*s),b:t};break;case 4:r={r:t*(1-e*s),g:t*(1-e),b:t};break;case 5:r={r:t,g:t*(1-e),b:t*(1-e*s)};break;default:r={r:t*(1-e),g:t*(1-e),b:t*(1-e)}}return r.mode="rgb",i!==void 0&&(r.alpha=i),r}function rA({r:n,g:e,b:t,alpha:i}){n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.max(n,e,t),r=Math.min(n,e,t),o={mode:"hsv",s:s===0?0:1-r/s,v:s};return s-r!==0&&(o.h=(s===n?(e-t)/(s-r)+(e1){let s=e+t;e/=s,t/=s}return sA({h:n,s:t===1?1:1-e/(1-t),v:1-t,alpha:i})}function D6(n){let e=rA(n);if(e===void 0)return;let t=e.s!==void 0?e.s:0,i=e.v!==void 0?e.v:0,s={mode:"hwb",w:(1-t)*i,b:1-i};return e.h!==void 0&&(s.h=e.h),e.alpha!==void 0&&(s.alpha=e.alpha),s}function O6(n,e){if(!e||e[0]!=="hwb")return;const t={mode:"hwb"},[,i,s,r,o]=e;if(i.type!==_e.None){if(i.type===_e.Percentage)return;t.h=i.value}if(s.type!==_e.None){if(s.type===_e.Hue)return;t.w=s.value/100}if(r.type!==_e.None){if(r.type===_e.Hue)return;t.b=r.value/100}return o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const N6={mode:"hwb",toMode:{rgb:L6},fromMode:{rgb:D6},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[O6],serialize:n=>`hwb(${n.h!==void 0?n.h:"none"} ${n.w!==void 0?n.w*100+"%":"none"} ${n.b!==void 0?n.b*100+"%":"none"}${n.alpha<1?` / ${n.alpha}`:""})`,interpolate:{h:{use:Ae,fixup:Gs},w:Ae,b:Ae,alpha:{use:Ae,fixup:on}},difference:{h:y6},average:{h:Ws}},aA=203,Yh=.1593017578125,lA=78.84375,jh=.8359375,Kh=18.8515625,Zh=18.6875;function Am(n){if(n<0)return 0;const e=Math.pow(n,1/lA);return 1e4*Math.pow(Math.max(0,e-jh)/(Kh-Zh*e),1/Yh)}function Cm(n){if(n<0)return 0;const e=Math.pow(n/1e4,Yh);return Math.pow((jh+Kh*e)/(1+Zh*e),lA)}const Rm=n=>Math.max(n/aA,0),Bx=({i:n,t:e,p:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);const s=Am(n+.008609037037932761*e+.11102962500302593*t),r=Am(n-.00860903703793275*e-.11102962500302599*t),o=Am(n+.5600313357106791*e-.32062717498731885*t),a={mode:"xyz65",x:Rm(2.070152218389422*s-1.3263473389671556*r+.2066510476294051*o),y:Rm(.3647385209748074*s+.680566024947227*r-.0453045459220346*o),z:Rm(-.049747207535812*s-.0492609666966138*r+1.1880659249923042*o)};return i!==void 0&&(a.alpha=i),a},Pm=(n=0)=>Math.max(n*aA,0),zx=({x:n,y:e,z:t,alpha:i})=>{const s=Pm(n),r=Pm(e),o=Pm(t),a=Cm(.3592832590121217*s+.6976051147779502*r-.0358915932320289*o),l=Cm(-.1920808463704995*s+1.1004767970374323*r+.0753748658519118*o),c=Cm(.0070797844607477*s+.0748396662186366*r+.8433265453898765*o),u=.5*a+.5*l,f=1.61376953125*a-3.323486328125*l+1.709716796875*c,d=4.378173828125*a-4.24560546875*l-.132568359375*c,h={mode:"itp",i:u,t:f,p:d};return i!==void 0&&(h.alpha=i),h},U6={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:Bx,rgb:n=>Lo(Bx(n))},fromMode:{xyz65:zx,rgb:n=>zx(Io(n))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:Ae,t:Ae,p:Ae,alpha:{use:Ae,fixup:on}}},F6=134.03437499999998,k6=16295499532821565e-27,Im=n=>{if(n<0)return 0;let e=Math.pow(n/1e4,Yh);return Math.pow((jh+Kh*e)/(1+Zh*e),F6)},Lm=(n=0)=>Math.max(n*203,0),cA=({x:n,y:e,z:t,alpha:i})=>{n=Lm(n),e=Lm(e),t=Lm(t);let s=1.15*n-.15*t,r=.66*e+.34*n,o=Im(.41478972*s+.579999*r+.014648*t),a=Im(-.20151*s+1.120649*r+.0531008*t),l=Im(-.0166008*s+.2648*r+.6684799*t),c=(o+a)/2,u={mode:"jab",j:.44*c/(1-.56*c)-k6,a:3.524*o-4.066708*a+.542708*l,b:.199076*o+1.096799*a-1.295875*l};return i!==void 0&&(u.alpha=i),u},B6=134.03437499999998,Vx=16295499532821565e-27,Dm=n=>{if(n<0)return 0;let e=Math.pow(n,1/B6);return 1e4*Math.pow((jh-e)/(Zh*e-Kh),1/Yh)},Om=n=>n/203,uA=({j:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=(n+Vx)/(.44+.56*(n+Vx)),r=Dm(s+.13860504*e+.058047316*t),o=Dm(s-.13860504*e-.058047316*t),a=Dm(s-.096019242*e-.8118919*t),l={mode:"xyz65",x:Om(1.661373024652174*r-.914523081304348*o+.23136208173913045*a),y:Om(-.3250758611844533*r+1.571847026732543*o-.21825383453227928*a),z:Om(-.090982811*r-.31272829*o+1.5227666*a)};return i!==void 0&&(l.alpha=i),l},fA=n=>{let e=cA(Io(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e},dA=n=>Lo(uA(n)),z6={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:fA,xyz65:cA},toMode:{rgb:dA,xyz65:uA},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:Ae,a:Ae,b:Ae,alpha:{use:Ae,fixup:on}}},Hx=({j:n,a:e,b:t,alpha:i})=>{e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.sqrt(e*e+t*t),r={mode:"jch",j:n,c:s};return s&&(r.h=_n(Math.atan2(t,e)*180/Math.PI)),i!==void 0&&(r.alpha=i),r},Gx=({j:n,c:e,h:t,alpha:i})=>{t===void 0&&(t=0);let s={mode:"jab",j:n,a:e?e*Math.cos(t/180*Math.PI):0,b:e?e*Math.sin(t/180*Math.PI):0};return i!==void 0&&(s.alpha=i),s},V6={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:Gx,rgb:n=>dA(Gx(n))},fromMode:{rgb:n=>Hx(fA(n)),jab:Hx},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:Ae,fixup:Gs},c:Ae,j:Ae,alpha:{use:Ae,fixup:on}},difference:{h:Xh},average:{h:Ws}},Jh=Math.pow(29,3)/Math.pow(3,3),H_=Math.pow(6,3)/Math.pow(29,3);let Nm=n=>Math.pow(n,3)>H_?Math.pow(n,3):(116*n-16)/Jh;const G_=({l:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=(n+16)/116,r=e/500+s,o=s-t/200,a={mode:"xyz50",x:Nm(r)*Jt.X,y:Nm(s)*Jt.Y,z:Nm(o)*Jt.Z};return i!==void 0&&(a.alpha=i),a},Kc=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Wa({r:n*3.1341359569958707-e*1.6173863321612538-.4906619460083532*t,g:n*-.978795502912089+e*1.916254567259524+.03344273116131949*t,b:n*.07195537988411677-e*.2289768264158322+1.405386058324125*t});return i!==void 0&&(s.alpha=i),s},hA=n=>Kc(G_(n)),Zc=n=>{let{r:e,g:t,b:i,alpha:s}=Ga(n),r={mode:"xyz50",x:.436065742824811*e+.3851514688337912*t+.14307845442264197*i,y:.22249319175623702*e+.7168870538238823*t+.06061979053616537*i,z:.013923904500943465*e+.09708128566574634*t+.7140993584005155*i};return s!==void 0&&(r.alpha=s),r},Um=n=>n>H_?Math.cbrt(n):(Jh*n+16)/116,W_=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Um(n/Jt.X),r=Um(e/Jt.Y),o=Um(t/Jt.Z),a={mode:"lab",l:116*r-16,a:500*(s-r),b:200*(r-o)};return i!==void 0&&(a.alpha=i),a},pA=n=>{let e=W_(Zc(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e};function H6(n,e){if(!e||e[0]!=="lab")return;const t={mode:"lab"},[,i,s,r,o]=e;if(!(i.type===_e.Hue||s.type===_e.Hue||r.type===_e.Hue))return i.type!==_e.None&&(t.l=Math.min(Math.max(0,i.value),100)),s.type!==_e.None&&(t.a=s.type===_e.Number?s.value:s.value*125/100),r.type!==_e.None&&(t.b=r.type===_e.Number?r.value:r.value*125/100),o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const X_={mode:"lab",toMode:{xyz50:G_,rgb:hA},fromMode:{xyz50:W_,rgb:pA},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-100,100],b:[-100,100]},parse:[H6],serialize:n=>`lab(${n.l!==void 0?n.l:"none"} ${n.a!==void 0?n.a:"none"} ${n.b!==void 0?n.b:"none"}${n.alpha<1?` / ${n.alpha}`:""})`,interpolate:{l:Ae,a:Ae,b:Ae,alpha:{use:Ae,fixup:on}}},G6={...X_,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:Qw,rgb:$h},fromMode:{xyz65:eA,rgb:qh},ranges:{l:[0,100],a:[-86.182,98.234],b:[-107.86,94.477]}};function W6(n,e){if(!e||e[0]!=="lch")return;const t={mode:"lch"},[,i,s,r,o]=e;if(i.type!==_e.None){if(i.type===_e.Hue)return;t.l=Math.min(Math.max(0,i.value),100)}if(s.type!==_e.None&&(t.c=Math.max(0,s.type===_e.Number?s.value:s.value*150/100)),r.type!==_e.None){if(r.type===_e.Percentage)return;t.h=r.value}return o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const $_={mode:"lch",toMode:{lab:xr,rgb:n=>hA(xr(n))},fromMode:{rgb:n=>br(pA(n)),lab:br},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[W6],serialize:n=>`lch(${n.l!==void 0?n.l:"none"} ${n.c!==void 0?n.c:"none"} ${n.h!==void 0?n.h:"none"}${n.alpha<1?` / ${n.alpha}`:""})`,interpolate:{h:{use:Ae,fixup:Gs},c:Ae,l:Ae,alpha:{use:Ae,fixup:on}},difference:{h:Xh},average:{h:Ws}},X6={...$_,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:n=>xr(n,"lab65"),rgb:n=>$h(xr(n,"lab65"))},fromMode:{rgb:n=>br(qh(n),"lch65"),lab65:n=>br(n,"lch65")},ranges:{l:[0,100],c:[0,133.807],h:[0,360]}},mA=({l:n,u:e,v:t,alpha:i})=>{e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.sqrt(e*e+t*t),r={mode:"lchuv",l:n,c:s};return s&&(r.h=_n(Math.atan2(t,e)*180/Math.PI)),i!==void 0&&(r.alpha=i),r},gA=({l:n,c:e,h:t,alpha:i})=>{t===void 0&&(t=0);let s={mode:"luv",l:n,u:e?e*Math.cos(t/180*Math.PI):0,v:e?e*Math.sin(t/180*Math.PI):0};return i!==void 0&&(s.alpha=i),s},_A=(n,e,t)=>4*n/(n+15*e+3*t),vA=(n,e,t)=>9*e/(n+15*e+3*t),$6=_A(Jt.X,Jt.Y,Jt.Z),q6=vA(Jt.X,Jt.Y,Jt.Z),Y6=n=>n<=H_?Jh*n:116*Math.cbrt(n)-16,Zg=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Y6(e/Jt.Y),r=_A(n,e,t),o=vA(n,e,t);!isFinite(r)||!isFinite(o)?s=r=o=0:(r=13*s*(r-$6),o=13*s*(o-q6));let a={mode:"luv",l:s,u:r,v:o};return i!==void 0&&(a.alpha=i),a},j6=(n,e,t)=>4*n/(n+15*e+3*t),K6=(n,e,t)=>9*e/(n+15*e+3*t),Z6=j6(Jt.X,Jt.Y,Jt.Z),J6=K6(Jt.X,Jt.Y,Jt.Z),Jg=({l:n,u:e,v:t,alpha:i})=>{if(n===void 0&&(n=0),n===0)return{mode:"xyz50",x:0,y:0,z:0};e===void 0&&(e=0),t===void 0&&(t=0);let s=e/(13*n)+Z6,r=t/(13*n)+J6,o=Jt.Y*(n<=8?n/Jh:Math.pow((n+16)/116,3)),a=o*(9*s)/(4*r),l=o*(12-3*s-20*r)/(4*r),c={mode:"xyz50",x:a,y:o,z:l};return i!==void 0&&(c.alpha=i),c},Q6=n=>mA(Zg(Zc(n))),eH=n=>Kc(Jg(gA(n))),tH={mode:"lchuv",toMode:{luv:gA,rgb:eH},fromMode:{rgb:Q6,luv:mA},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:Ae,fixup:Gs},c:Ae,l:Ae,alpha:{use:Ae,fixup:on}},difference:{h:Xh},average:{h:Ws}},nH={...Ha,mode:"lrgb",toMode:{rgb:Wa},fromMode:{rgb:Ga},parse:["srgb-linear"],serialize:"srgb-linear"},iH={mode:"luv",toMode:{xyz50:Jg,rgb:n=>Kc(Jg(n))},fromMode:{xyz50:Zg,rgb:n=>Zg(Zc(n))},channels:["l","u","v","alpha"],parse:["--luv"],serialize:"--luv",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:Ae,u:Ae,v:Ae,alpha:{use:Ae,fixup:on}}},yA=({r:n,g:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.cbrt(.41222147079999993*n+.5363325363*e+.0514459929*t),r=Math.cbrt(.2119034981999999*n+.6806995450999999*e+.1073969566*t),o=Math.cbrt(.08830246189999998*n+.2817188376*e+.6299787005000002*t),a={mode:"oklab",l:.2104542553*s+.793617785*r-.0040720468*o,a:1.9779984951*s-2.428592205*r+.4505937099*o,b:.0259040371*s+.7827717662*r-.808675766*o};return i!==void 0&&(a.alpha=i),a},Qh=n=>{let e=yA(Ga(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e},Jc=({l:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.pow(n*.9999999984505198+.39633779217376786*e+.2158037580607588*t,3),r=Math.pow(n*1.0000000088817609-.10556134232365635*e-.06385417477170591*t,3),o=Math.pow(n*1.0000000546724108-.08948418209496575*e-1.2914855378640917*t,3),a={mode:"lrgb",r:4.076741661347994*s-3.307711590408193*r+.230969928729428*o,g:-1.2684380040921763*s+2.6097574006633715*r-.3413193963102197*o,b:-.004196086541837188*s-.7034186144594493*r+1.7076147009309444*o};return i!==void 0&&(a.alpha=i),a},ep=n=>Wa(Jc(n));function Qg(n){const i=1.170873786407767;return .5*(i*n-.206+Math.sqrt((i*n-.206)*(i*n-.206)+4*.03*i*n))}function Fd(n){return(n*n+.206*n)/(1.170873786407767*(n+.03))}function sH(n,e){let t,i,s,r,o,a,l,c;-1.88170328*n-.80936493*e>1?(t=1.19086277,i=1.76576728,s=.59662641,r=.75515197,o=.56771245,a=4.0767416621,l=-3.3077115913,c=.2309699292):1.81444104*n-1.19445276*e>1?(t=.73956515,i=-.45954404,s=.08285427,r=.1254107,o=.14503204,a=-1.2684380046,l=2.6097574011,c=-.3413193965):(t=1.35733652,i=-.00915799,s=-1.1513021,r=-.50559606,o=.00692167,a=-.0041960863,l=-.7034186147,c=1.707614701);let u=t+i*n+s*e+r*n*n+o*n*e,f=.3963377774*n+.2158037573*e,d=-.1055613458*n-.0638541728*e,h=-.0894841775*n-1.291485548*e;{let p=1+u*f,_=1+u*d,g=1+u*h,m=p*p*p,y=_*_*_,b=g*g*g,v=3*f*p*p,T=3*d*_*_,E=3*h*g*g,S=6*f*f*p,P=6*d*d*_,x=6*h*h*g,M=a*m+l*y+c*b,L=a*v+l*T+c*E,F=a*S+l*P+c*x;u=u-M*L/(L*L-.5*M*F)}return u}function q_(n,e){let t=sH(n,e),i=Jc({l:1,a:t*n,b:t*e}),s=Math.cbrt(1/Math.max(i.r,i.g,i.b)),r=s*t;return[s,r]}function rH(n,e,t,i,s,r=null){r||(r=q_(n,e));let o;if((t-s)*r[1]-(r[0]-s)*i<=0)o=r[1]*s/(i*r[0]+r[1]*(s-t));else{o=r[1]*(s-1)/(i*(r[0]-1)+r[1]*(s-t));{let a=t-s,l=i,c=.3963377774*n+.2158037573*e,u=-.1055613458*n-.0638541728*e,f=-.0894841775*n-1.291485548*e,d=a+l*c,h=a+l*u,p=a+l*f;{let _=s*(1-o)+o*t,g=o*i,m=_+g*c,y=_+g*u,b=_+g*f,v=m*m*m,T=y*y*y,E=b*b*b,S=3*d*m*m,P=3*h*y*y,x=3*p*b*b,M=6*d*d*m,L=6*h*h*y,F=6*p*p*b,H=4.0767416621*v-3.3077115913*T+.2309699292*E-1,Y=4.0767416621*S-3.3077115913*P+.2309699292*x,ee=4.0767416621*M-3.3077115913*L+.2309699292*F,K=Y/(Y*Y-.5*H*ee),Q=-H*K,Z=-1.2684380046*v+2.6097574011*T-.3413193965*E-1,he=-1.2684380046*S+2.6097574011*P-.3413193965*x,be=-1.2684380046*M+2.6097574011*L-.3413193965*F,se=he/(he*he-.5*Z*be),ye=-Z*se,He=-.0041960863*v-.7034186147*T+1.707614701*E-1,re=-.0041960863*S-.7034186147*P+1.707614701*x,ge=-.0041960863*M-.7034186147*L+1.707614701*F,xe=re/(re*re-.5*He*ge),X=-He*xe;Q=K>=0?Q:1e6,ye=se>=0?ye:1e6,X=xe>=0?X:1e6,o+=Math.min(Q,Math.min(ye,X))}}}return o}function Y_(n,e,t=null){t||(t=q_(n,e));let i=t[0],s=t[1];return[s/i,s/(1-i)]}function bA(n,e,t){let i=q_(e,t),s=rH(e,t,n,1,n,i),r=Y_(e,t,i),o=.11516993+1/(7.4477897+4.1590124*t+e*(-2.19557347+1.75198401*t+e*(-2.13704948-10.02301043*t+e*(-4.24894561+5.38770819*t+4.69891013*e)))),a=.11239642+1/(1.6132032-.68124379*t+e*(.40370612+.90148123*t+e*(-.27087943+.6122399*t+e*(.00299215-.45399568*t-.14661872*e)))),l=s/Math.min(n*r[0],(1-n)*r[1]),c=n*o,u=(1-n)*a,f=.9*l*Math.sqrt(Math.sqrt(1/(1/(c*c*c*c)+1/(u*u*u*u))));return c=n*.4,u=(1-n)*.8,[Math.sqrt(1/(1/(c*c)+1/(u*u))),f,s]}function Wx(n){const e=n.l!==void 0?n.l:0,t=n.a!==void 0?n.a:0,i=n.b!==void 0?n.b:0,s={mode:"okhsl",l:Qg(e)};n.alpha!==void 0&&(s.alpha=n.alpha);let r=Math.sqrt(t*t+i*i);if(!r)return s.s=0,s;let[o,a,l]=bA(e,t/r,i/r),c;if(rWx(Qh(n))},toMode:{oklab:Xx,rgb:n=>ep(Xx(n))}};function $x(n){let e=n.l!==void 0?n.l:0,t=n.a!==void 0?n.a:0,i=n.b!==void 0?n.b:0,s=Math.sqrt(t*t+i*i),r=s?t/s:1,o=s?i/s:1,[a,l]=Y_(r,o),c=.5,u=1-c/a,f=l/(s+e*l),d=f*e,h=f*s,p=Fd(d),_=h*p/d,g=Jc({l:p,a:r*_,b:o*_}),m=Math.cbrt(1/Math.max(g.r,g.g,g.b,0));e=e/m,s=s/m*Qg(e)/e,e=Qg(e);const y={mode:"okhsv",s:s?(c+l)*h/(l*c+l*u*h):0,v:e?e/d:0};return y.s&&(y.h=_n(Math.atan2(i,t)*180/Math.PI)),n.alpha!==void 0&&(y.alpha=n.alpha),y}function qx(n){const e={mode:"oklab"};n.alpha!==void 0&&(e.alpha=n.alpha);const t=n.h!==void 0?n.h:0,i=n.s!==void 0?n.s:0,s=n.v!==void 0?n.v:0,r=Math.cos(t/180*Math.PI),o=Math.sin(t/180*Math.PI),[a,l]=Y_(r,o),c=.5,u=1-c/a,f=1-i*c/(c+l-l*u*i),d=i*l*c/(c+l-l*u*i),h=Fd(f),p=d*h/f,_=Jc({l:h,a:r*p,b:o*p}),g=Math.cbrt(1/Math.max(_.r,_.g,_.b,0)),m=Fd(s*f),y=d*m/f;return e.l=m*g,e.a=y*r*g,e.b=y*o*g,e}const aH={...oA,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:$x,rgb:n=>$x(Qh(n))},toMode:{oklab:qx,rgb:n=>ep(qx(n))}};function lH(n,e){if(!e||e[0]!=="oklab")return;const t={mode:"oklab"},[,i,s,r,o]=e;if(!(i.type===_e.Hue||s.type===_e.Hue||r.type===_e.Hue))return i.type!==_e.None&&(t.l=Math.min(Math.max(0,i.type===_e.Number?i.value:i.value/100),1)),s.type!==_e.None&&(t.a=s.type===_e.Number?s.value:s.value*.4/100),r.type!==_e.None&&(t.b=r.type===_e.Number?r.value:r.value*.4/100),o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const cH={...X_,mode:"oklab",toMode:{lrgb:Jc,rgb:ep},fromMode:{lrgb:yA,rgb:Qh},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[lH],serialize:n=>`oklab(${n.l!==void 0?n.l:"none"} ${n.a!==void 0?n.a:"none"} ${n.b!==void 0?n.b:"none"}${n.alpha<1?` / ${n.alpha}`:""})`};function uH(n,e){if(!e||e[0]!=="oklch")return;const t={mode:"oklch"},[,i,s,r,o]=e;if(i.type!==_e.None){if(i.type===_e.Hue)return;t.l=Math.min(Math.max(0,i.type===_e.Number?i.value:i.value/100),1)}if(s.type!==_e.None&&(t.c=Math.max(0,s.type===_e.Number?s.value:s.value*.4/100)),r.type!==_e.None){if(r.type===_e.Percentage)return;t.h=r.value}return o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const fH={...$_,mode:"oklch",toMode:{oklab:n=>xr(n,"oklab"),rgb:n=>ep(xr(n,"oklab"))},fromMode:{rgb:n=>br(Qh(n),"oklch"),oklab:n=>br(n,"oklch")},parse:[uH],serialize:n=>`oklch(${n.l!==void 0?n.l:"none"} ${n.c!==void 0?n.c:"none"} ${n.h!==void 0?n.h:"none"}${n.alpha<1?` / ${n.alpha}`:""})`,ranges:{l:[0,1],c:[0,.4],h:[0,360]}},Yx=n=>{let{r:e,g:t,b:i,alpha:s}=Ga(n),r={mode:"xyz65",x:.486570948648216*e+.265667693169093*t+.1982172852343625*i,y:.2289745640697487*e+.6917385218365062*t+.079286914093745*i,z:0*e+.0451133818589026*t+1.043944368900976*i};return s!==void 0&&(r.alpha=s),r},jx=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Wa({r:n*2.4934969119414263-e*.9313836179191242-.402710784450717*t,g:n*-.8294889695615749+e*1.7626640603183465+.0236246858419436*t,b:n*.0358458302437845-e*.0761723892680418+.9568845240076871*t},"p3");return i!==void 0&&(s.alpha=i),s},dH={...Ha,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:n=>jx(Io(n)),xyz65:jx},toMode:{rgb:n=>Lo(Yx(n)),xyz65:Yx}},Fm=n=>{let e=Math.abs(n);return e>=1/512?Math.sign(n)*Math.pow(e,1/1.8):16*n},Kx=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s={mode:"prophoto",r:Fm(n*1.3457868816471585-e*.2555720873797946-.0511018649755453*t),g:Fm(n*-.5446307051249019+e*1.5082477428451466+.0205274474364214*t),b:Fm(n*0+e*0+1.2119675456389452*t)};return i!==void 0&&(s.alpha=i),s},km=(n=0)=>{let e=Math.abs(n);return e>=16/512?Math.sign(n)*Math.pow(e,1.8):n/16},Zx=n=>{let e=km(n.r),t=km(n.g),i=km(n.b),s={mode:"xyz50",x:.7977666449006423*e+.1351812974005331*t+.0313477341283922*i,y:.2880748288194013*e+.7118352342418731*t+899369387256e-16*i,z:0*e+0*t+.8251046025104602*i};return n.alpha!==void 0&&(s.alpha=n.alpha),s},hH={...Ha,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:Kx,rgb:n=>Kx(Zc(n))},toMode:{xyz50:Zx,rgb:n=>Kc(Zx(n))}},Jx=1.09929682680944,pH=.018053968510807,Bm=n=>{const e=Math.abs(n);return e>pH?(Math.sign(n)||1)*(Jx*Math.pow(e,.45)-(Jx-1)):4.5*n},Qx=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s={mode:"rec2020",r:Bm(n*1.7166511879712683-e*.3556707837763925-.2533662813736599*t),g:Bm(n*-.6666843518324893+e*1.6164812366349395+.0157685458139111*t),b:Bm(n*.0176398574453108-e*.0427706132578085+.9421031212354739*t)};return i!==void 0&&(s.alpha=i),s},eM=1.09929682680944,mH=.018053968510807,zm=(n=0)=>{let e=Math.abs(n);return e{let e=zm(n.r),t=zm(n.g),i=zm(n.b),s={mode:"xyz65",x:.6369580483012911*e+.1446169035862083*t+.1688809751641721*i,y:.262700212011267*e+.6779980715188708*t+.059301716469862*i,z:0*e+.0280726930490874*t+1.0609850577107909*i};return n.alpha!==void 0&&(s.alpha=n.alpha),s},gH={...Ha,mode:"rec2020",fromMode:{xyz65:Qx,rgb:n=>Qx(Io(n))},toMode:{xyz65:tM,rgb:n=>Lo(tM(n))},parse:["rec2020"],serialize:"rec2020"},_o=.0037930732552754493,xA=Math.cbrt(_o),Vm=n=>Math.cbrt(n)-xA,_H=n=>{const{r:e,g:t,b:i,alpha:s}=Ga(n),r=Vm(.3*e+.622*t+.078*i+_o),o=Vm(.23*e+.692*t+.078*i+_o),a=Vm(.2434226892454782*e+.2047674442449682*t+.5518098665095535*i+_o),l={mode:"xyb",x:(r-o)/2,y:(r+o)/2,b:a-(r+o)/2};return s!==void 0&&(l.alpha=s),l},Hm=n=>Math.pow(n+xA,3),vH=({x:n,y:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);const s=Hm(n+e)-_o,r=Hm(e-n)-_o,o=Hm(t+e)-_o,a=Wa({r:11.031566904639861*s-9.866943908131562*r-.16462299650829934*o,g:-3.2541473810744237*s+4.418770377582723*r-.16462299650829934*o,b:-3.6588512867136815*s+2.7129230459360922*r+1.9459282407775895*o});return i!==void 0&&(a.alpha=i),a},yH={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:vH},fromMode:{rgb:_H},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:Ae,y:Ae,b:Ae,alpha:{use:Ae,fixup:on}}},bH={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:Kc,lab:W_},fromMode:{rgb:Zc,lab:G_},channels:["x","y","z","alpha"],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:Ae,y:Ae,z:Ae,alpha:{use:Ae,fixup:on}}},xH=n=>{let{x:e,y:t,z:i,alpha:s}=n;e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0);let r={mode:"xyz50",x:1.0479298208405488*e+.0229467933410191*t-.0501922295431356*i,y:.0296278156881593*e+.990434484573249*t-.0170738250293851*i,z:-.0092430581525912*e+.0150551448965779*t+.7518742899580008*i};return s!==void 0&&(r.alpha=s),r},MH=n=>{let{x:e,y:t,z:i,alpha:s}=n;e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0);let r={mode:"xyz65",x:.9554734527042182*e-.0230985368742614*t+.0632593086610217*i,y:-.0283697069632081*e+1.0099954580058226*t+.021041398966943*i,z:.0123140016883199*e-.0205076964334779*t+1.3303659366080753*i};return s!==void 0&&(r.alpha=s),r},SH={mode:"xyz65",toMode:{rgb:Lo,xyz50:xH},fromMode:{rgb:Io,xyz50:MH},ranges:{x:[0,.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parse:["xyz","xyz-d65"],serialize:"xyz-d65",interpolate:{x:Ae,y:Ae,z:Ae,alpha:{use:Ae,fixup:on}}},EH=({r:n,g:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);const s={mode:"yiq",y:.29889531*n+.58662247*e+.11448223*t,i:.59597799*n-.2741761*e-.32180189*t,q:.21147017*n-.52261711*e+.31114694*t};return i!==void 0&&(s.alpha=i),s},TH=({y:n,i:e,q:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);const s={mode:"rgb",r:n+.95608445*e+.6208885*t,g:n-.27137664*e-.6486059*t,b:n-1.10561724*e+1.70250126*t};return i!==void 0&&(s.alpha=i),s},wH={mode:"yiq",toMode:{rgb:TH},fromMode:{rgb:EH},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:Ae,i:Ae,q:Ae,alpha:{use:Ae,fixup:on}}};Et(h6);Et(b6);Et(x6);Et(M6);Et(T6);Et(iA);Et(oA);Et(N6);Et(U6);Et(z6);Et(V6);Et(X_);Et(G6);Et($_);Et(X6);Et(tH);Et(nH);Et(iH);Et(oH);Et(aH);Et(cH);Et(fH);Et(dH);Et(hH);Et(gH);Et(Ha);Et(yH);Et(bH);Et(SH);Et(wH);const e0=220.44,AH=qw("oklch"),nM=n=>{var e;return n?(e=AH(n))==null?void 0:e.h:e0},CH=Nz("settings",()=>{const n=et(),e=gs("settings/language","en-US"),t=gs("settings/stage/view/model-renderer","2d"),i=gs("settings/audio/input","false"),s=Ee(()=>{var E;return(E=n.value)==null?void 0:E.deviceId}),{audioInputs:r,ensurePermissions:o}=BB({constraints:{audio:!0}}),a=et(),l=et("/assets/live2d/models/hiyori_pro_zh.zip"),c=et("url"),u=et(!1),f=gs("settings/live2d/position",{x:0,y:0}),d=et({group:"Idle",index:0}),h=et([]),p=gs("settings/live2d/motion-map",{}),_=gs("settings/disable-transitions",!0),g=gs("settings/use-page-specific-transitions",!0),m=gs("settings/theme/colors/hue",e0),y=gs("settings/theme/colors/hue-dynamic",!1);function b(E=e0){m.value=E,y.value=!1}function v(E){b(nM(E))}function T(E){if(y.value)return!1;const S=nM(E);if(!S)return!1;const P=Math.abs(S-m.value);return P<.01||P>359.99}return $e(i,E=>{E==="false"&&(n.value=void 0),E==="true"&&o().then(()=>{n.value=r.value[0]})}),$e(r,()=>{i.value==="true"&&!n.value&&(n.value=r.value[0])},{immediate:!0}),{live2dModelFile:a,live2dModelUrl:l,live2dLoadSource:c,live2dCurrentMotion:d,live2dPosition:f,availableLive2dMotions:h,live2dMotionMap:p,loadingLive2dModel:u,disableTransitions:_,usePageSpecificTransitions:g,language:e,stageView:t,themeColorsHue:m,themeColorsHueDynamic:y,isAudioInputOn:i,selectedAudioDevice:n,selectedAudioDeviceId:s,setThemeColorsHue:b,applyPrimaryColorFrom:v,isColorSelectedForPrimary:T}}),RH=fn({__name:"ArrowTransition",props:{stageTransition:{default:()=>({primaryColor:"#666",secondaryColor:"#ccc"})}},setup(n){const e=n,t=Ee(()=>e.stageTransition),i=Ee(()=>t.value.primaryColor||"#666"),s=Ee(()=>t.value.secondaryColor||"#ccc");return Hn(()=>{document.documentElement.style.setProperty("--stage-transition-3-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-3-overlay-color-2",s.value)}),(r,o)=>(mn(),vi("div",{class:"stage-transition-3",style:Mi({zIndex:t.value.zIndex||100})},null,4))}}),Do=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t},PH=Do(RH,[["__scopeId","data-v-df576df0"]]),IH=fn({__name:"BubbleWaveOutTransition",props:{stageTransition:null},setup(n){const e=n,t=Ee(()=>{var i;return((i=e.stageTransition)==null?void 0:i.colors)||["#eee","#ebcb8b","#c56370","#3f3b52"]});return Hn(()=>{var i,s;document.documentElement.style.setProperty("--circle-expansion-delay",`${((i=e.stageTransition)==null?void 0:i.delay)||0}s`),document.documentElement.style.setProperty("--circle-expansion-duration",`${((s=e.stageTransition)==null?void 0:s.duration)||.4}s`),t.value.forEach((r,o)=>{document.documentElement.style.setProperty(`--circle-expansion-color-${o+1}`,r)})}),(i,s)=>{var r;return mn(),vi("div",{class:"circle-expansion-transition",style:Mi({zIndex:((r=n.stageTransition)==null?void 0:r.zIndex)||100})},[(mn(!0),vi(jt,null,f2(t.value,(o,a)=>(mn(),vi("div",{key:a}))),128))],4)}}}),LH=Do(IH,[["__scopeId","data-v-0c29056c"]]),DH=fn({__name:"FantasyFallTransition",props:{stageTransition:null},setup(n){const e=n,t=Ee(()=>{var s;return((s=e.stageTransition)==null?void 0:s.direction)||"up"}),i=Ee(()=>`fantasy-fall-${t.value}`);return Hn(()=>{var s,r,o,a,l,c,u,f,d;document.documentElement.style.setProperty("--fantasy-fall-color",((s=e.stageTransition)==null?void 0:s.primaryColor)||"#eee"),document.documentElement.style.setProperty("--fantasy-fall-duration",`${((r=e.stageTransition)==null?void 0:r.duration)||.6}s`),document.documentElement.style.setProperty("--fantasy-fall-delay",`${((o=e.stageTransition)==null?void 0:o.delay)||0}s`),document.documentElement.style.setProperty("--fantasy-fall-radius-sm",`${((l=(a=e.stageTransition)==null?void 0:a.borderRadius)==null?void 0:l.sm)||"14rem"}`),document.documentElement.style.setProperty("--fantasy-fall-radius-md",`${((u=(c=e.stageTransition)==null?void 0:c.borderRadius)==null?void 0:u.md)||"14rem"}`),document.documentElement.style.setProperty("--fantasy-fall-radius-lg",`${((d=(f=e.stageTransition)==null?void 0:f.borderRadius)==null?void 0:d.lg)||"50%"}`)}),(s,r)=>{var o;return mn(),vi("div",{class:Oa(["fantasy-fall-transition",i.value]),style:Mi({zIndex:((o=n.stageTransition)==null?void 0:o.zIndex)??100})},null,6)}}}),OH=Do(DH,[["__scopeId","data-v-e62bf496"]]),NH=fn({__name:"MultipleBlocksRevealTransition",props:{stageTransition:null},setup(n){const e=n,t=Ee(()=>e.stageTransition),i=Ee(()=>{var r;return((r=t.value)==null?void 0:r.primaryColor)||"#666"}),s=Ee(()=>{var r;return((r=t.value)==null?void 0:r.secondaryColor)||"#ccc"});return Hn(()=>{document.documentElement.style.setProperty("--stage-transition-4-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-4-overlay-color-2",s.value)}),(r,o)=>{var a;return mn(),vi("div",{class:"stage-transition-4",style:Mi({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},o[0]||(o[0]=[W2('
',5)]),4)}}}),UH=Do(NH,[["__scopeId","data-v-6d1179fc"]]),FH=fn({__name:"SlideTransition",props:{stageTransition:null},setup(n){const e=n,t=Ee(()=>e.stageTransition),i=Ee(()=>{var r;return((r=t.value)==null?void 0:r.primaryColor)||"#666"}),s=Ee(()=>{var r;return((r=t.value)==null?void 0:r.secondaryColor)||"#ccc"});return $e([t,i,s],()=>{document.documentElement.style.setProperty("--stage-transition-1-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-1-overlay-color-2",s.value)}),Hn(()=>{document.documentElement.style.setProperty("--stage-transition-1-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-1-overlay-color-2",s.value)}),(r,o)=>{var a;return mn(),vi("div",{class:"stage-transition-1",style:Mi({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},null,4)}}}),kH=Do(FH,[["__scopeId","data-v-bf1d1566"]]),BH=fn({__name:"SlopeSlideTransition",props:{stageTransition:null},setup(n){const e=n,t=Ee(()=>e.stageTransition),i=Ee(()=>{var r;return((r=t.value)==null?void 0:r.primaryColor)??"#666"}),s=Ee(()=>{var r;return((r=t.value)==null?void 0:r.secondaryColor)??"#ccc"});return Hn(()=>{document.documentElement.style.setProperty("--stage-transition-2-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-2-overlay-color-2",s.value)}),(r,o)=>{var a;return mn(),vi("div",{class:"stage-transition-2",style:Mi({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},null,4)}}}),zH=Do(BH,[["__scopeId","data-v-8ff7120f"]]),VH=fn({__name:"RectanglesRotateTransition",props:{stageTransition:null},setup(n){const e=n;return Hn(()=>{var t,i,s,r,o,a,l;document.documentElement.style.setProperty("--rectangle-rotate-1-color",((t=e.stageTransition)==null?void 0:t.primaryColor)||"#ebcb8b"),document.documentElement.style.setProperty("--rectangle-rotate-2-color",((i=e.stageTransition)==null?void 0:i.secondaryColor)||"#c56370"),document.documentElement.style.setProperty("--rectangle-rotate-3-color",((s=e.stageTransition)==null?void 0:s.tertiaryColor)||"#43445b"),document.documentElement.style.setProperty("--rectangle-rotate-duration",`${((r=e.stageTransition)==null?void 0:r.duration)||.6}s`),document.documentElement.style.setProperty("--rectangle-rotate-delay",`${((o=e.stageTransition)==null?void 0:o.delay)||0}s`),document.documentElement.style.setProperty("--rectangle-rotate-stagger",`${((a=e.stageTransition)==null?void 0:a.staggerDelay)||.1}s`),document.documentElement.style.setProperty("--rectangle-rotate-rotation",`${((l=e.stageTransition)==null?void 0:l.rotation)||270}deg`)}),(t,i)=>{var s;return mn(),vi("div",{class:"rectangle-rotate-transition",style:Mi({zIndex:((s=n.stageTransition)==null?void 0:s.zIndex)??100})},i[0]||(i[0]=[sr("div",{class:"rectangle rectangle-rotate-1"},[sr("div")],-1),sr("div",{class:"rectangle rectangle-rotate-2"},[sr("div")],-1),sr("div",{class:"rectangle rectangle-rotate-3"},[sr("div")],-1)]),4)}}}),HH=Do(VH,[["__scopeId","data-v-f4b1dc64"]]),GH=fn({__name:"StageTransitionGroup",props:{primaryColor:null,secondaryColor:null,tertiaryColor:null,colors:null,zIndex:null,disableTransitions:{type:Boolean},usePageSpecificTransitions:{type:Boolean}},setup(n){const e=n,t=VV(),i=et(!1),s=et(),r=et(""),o=et(),a=De({slide:{component:kH,duration:2700},"slope-slide":{component:zH,duration:2700},arrow:{component:PH,duration:2700},"multiple-blocks-reveal":{component:UH,duration:2800},"fantasy-fall":{component:OH,duration:2700},"rectangles-rotate":{component:HH,duration:2700},"bubble-wave-out":{component:LH,duration:1e3}}),l=et([]);function c(h){return l.value.push(h),()=>{const p=l.value.indexOf(h);p>=0&&l.value.splice(p,1)}}async function u(h,p={}){s.value=h;for(const _ of l.value)try{await Promise.resolve(_(h,p))}catch(g){console.error(`Error in transition hook at stage "${h}":`,g)}}async function f(h,p,_){if(h.name==="none"||!h.name){p(),_();return}const g=a.value[h.name];if(!g){console.error(`Transition ${h.name} not found`),p(),_();return}const m=g.nextDelay!==void 0?g.nextDelay:g.duration/3;let y=!1;const v=c(T=>{T==="navigation"&&!y&&(y=!0,p())});try{await u("before-enter",{transitionName:h.name}),i.value&&(await u("before-leave",{transitionName:r.value}),r.value="",o.value=void 0,i.value=!1,await u("after-leave",{transitionName:r.value}),await new Promise(E=>setTimeout(E,50))),r.value=h.name,o.value=h,i.value=!0,await u("enter-active",{transitionName:name}),setTimeout(async()=>{await u("navigation",{transitionName:h.name,config:g}),y||(y=!0,p())},m),setTimeout(async()=>{await u("after-enter",{transitionName:h.name})},g.duration),setTimeout(async()=>{await u("before-leave",{transitionName:h.name})},g.duration+10),setTimeout(async()=>{await u("leave-active",{transitionName:h.name})},g.duration+20);const T=g.exitDuration??0;setTimeout(async()=>{i.value=!1,r.value="",o.value=void 0,await u("after-leave",{transitionName:h.name}),_()},g.duration+T)}catch(T){console.error(T)}finally{v(),setTimeout(()=>{y||(y=!0,p())},g.duration*2)}}function d(h,p){return new Promise(_=>{f(h,p,_)})}return t.beforeEach((h,p,_)=>{if(e.disableTransitions){_();return}if(typeof h.meta.stageTransition!="object"){_();return}const g=h.meta.stageTransition;if(e.usePageSpecificTransitions&&g.pageSpecificAvailable){_();return}typeof e.primaryColor<"u"&&(g.primaryColor=e.primaryColor),typeof e.secondaryColor<"u"&&(g.secondaryColor=e.secondaryColor),typeof e.tertiaryColor<"u"&&(g.tertiaryColor=e.tertiaryColor),typeof e.colors<"u"&&(g.colors=e.colors),typeof e.zIndex<"u"&&(g.zIndex=e.zIndex),d(g,_)}),(h,p)=>(mn(),vi(jt,null,[d2(h.$slots,"default"),i.value?(mn(),vi(jt,{key:0},[a.value[r.value]?(mn(),Yl(u2(a.value[r.value].component),{key:0,"stage-transition":o.value},null,8,["stage-transition"])):Rv("",!0)],64)):Rv("",!0)],64))}});/*! - * shared v11.1.3 - * (c) 2025 kazuya kawaguchi - * Released under the MIT License. - */const kd=typeof window<"u",Rr=(n,e=!1)=>e?Symbol.for(n):Symbol(n),WH=(n,e,t)=>XH({l:n,k:e,s:t}),XH=n=>JSON.stringify(n).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Zt=n=>typeof n=="number"&&isFinite(n),$H=n=>K_(n)==="[object Date]",Bd=n=>K_(n)==="[object RegExp]",tp=n=>dt(n)&&Object.keys(n).length===0,un=Object.assign,qH=Object.create,Rt=(n=null)=>qH(n);let iM;const j_=()=>iM||(iM=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Rt());function sM(n){return n.replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}const YH=Object.prototype.hasOwnProperty;function Di(n,e){return YH.call(n,e)}const tn=Array.isArray,kt=n=>typeof n=="function",Ne=n=>typeof n=="string",Bt=n=>typeof n=="boolean",yt=n=>n!==null&&typeof n=="object",jH=n=>yt(n)&&kt(n.then)&&kt(n.catch),MA=Object.prototype.toString,K_=n=>MA.call(n),dt=n=>K_(n)==="[object Object]",KH=n=>n==null?"":tn(n)||dt(n)&&n.toString===MA?JSON.stringify(n,null,2):String(n);function Z_(n,e=""){return n.reduce((t,i,s)=>s===0?t+i:t+e+i,"")}function ZH(n,e){typeof console<"u"&&(console.warn("[intlify] "+n),e&&console.warn(e.stack))}const ff=n=>!yt(n)||tn(n);function Pf(n,e){if(ff(n)||ff(e))throw new Error("Invalid value");const t=[{src:n,des:e}];for(;t.length;){const{src:i,des:s}=t.pop();Object.keys(i).forEach(r=>{r!=="__proto__"&&(yt(i[r])&&!yt(s[r])&&(s[r]=Array.isArray(i[r])?[]:Rt()),ff(s[r])||ff(i[r])?s[r]=i[r]:t.push({src:i[r],des:s[r]}))})}}/*! - * message-compiler v11.1.3 - * (c) 2025 kazuya kawaguchi - * Released under the MIT License. - */function JH(n,e,t){return{line:n,column:e,offset:t}}function t0(n,e,t){return{start:n,end:e}}const At={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},QH=17;function np(n,e,t={}){const{domain:i,messages:s,args:r}=t,o=n,a=new SyntaxError(String(o));return a.code=n,e&&(a.location=e),a.domain=i,a}function e8(n){throw n}const vs=" ",t8="\r",Ln=` -`,n8="\u2028",i8="\u2029";function s8(n){const e=n;let t=0,i=1,s=1,r=0;const o=S=>e[S]===t8&&e[S+1]===Ln,a=S=>e[S]===Ln,l=S=>e[S]===i8,c=S=>e[S]===n8,u=S=>o(S)||a(S)||l(S)||c(S),f=()=>t,d=()=>i,h=()=>s,p=()=>r,_=S=>o(S)||l(S)||c(S)?Ln:e[S],g=()=>_(t),m=()=>_(t+r);function y(){return r=0,u(t)&&(i++,s=0),o(t)&&t++,t++,s++,e[t]}function b(){return o(t+r)&&r++,r++,e[t+r]}function v(){t=0,i=1,s=1,r=0}function T(S=0){r=S}function E(){const S=t+r;for(;S!==t;)y();r=0}return{index:f,line:d,column:h,peekOffset:p,charAt:_,currentChar:g,currentPeek:m,next:y,peek:b,reset:v,resetPeek:T,skipToPeek:E}}const er=void 0,r8=".",rM="'",o8="tokenizer";function a8(n,e={}){const t=e.location!==!1,i=s8(n),s=()=>i.index(),r=()=>JH(i.line(),i.column(),i.index()),o=r(),a=s(),l={currentType:13,offset:a,startLoc:o,endLoc:o,lastType:13,lastOffset:a,lastStartLoc:o,lastEndLoc:o,braceNest:0,inLinked:!1,text:""},c=()=>l,{onError:u}=e;function f(C,I,N,...A){const w=c();if(I.column+=N,I.offset+=N,u){const U=t?t0(w.startLoc,I):null,O=np(C,U,{domain:o8,args:A});u(O)}}function d(C,I,N){C.endLoc=r(),C.currentType=I;const A={type:I};return t&&(A.loc=t0(C.startLoc,C.endLoc)),N!=null&&(A.value=N),A}const h=C=>d(C,13);function p(C,I){return C.currentChar()===I?(C.next(),I):(f(At.EXPECTED_TOKEN,r(),0,I),"")}function _(C){let I="";for(;C.currentPeek()===vs||C.currentPeek()===Ln;)I+=C.currentPeek(),C.peek();return I}function g(C){const I=_(C);return C.skipToPeek(),I}function m(C){if(C===er)return!1;const I=C.charCodeAt(0);return I>=97&&I<=122||I>=65&&I<=90||I===95}function y(C){if(C===er)return!1;const I=C.charCodeAt(0);return I>=48&&I<=57}function b(C,I){const{currentType:N}=I;if(N!==2)return!1;_(C);const A=m(C.currentPeek());return C.resetPeek(),A}function v(C,I){const{currentType:N}=I;if(N!==2)return!1;_(C);const A=C.currentPeek()==="-"?C.peek():C.currentPeek(),w=y(A);return C.resetPeek(),w}function T(C,I){const{currentType:N}=I;if(N!==2)return!1;_(C);const A=C.currentPeek()===rM;return C.resetPeek(),A}function E(C,I){const{currentType:N}=I;if(N!==7)return!1;_(C);const A=C.currentPeek()===".";return C.resetPeek(),A}function S(C,I){const{currentType:N}=I;if(N!==8)return!1;_(C);const A=m(C.currentPeek());return C.resetPeek(),A}function P(C,I){const{currentType:N}=I;if(!(N===7||N===11))return!1;_(C);const A=C.currentPeek()===":";return C.resetPeek(),A}function x(C,I){const{currentType:N}=I;if(N!==9)return!1;const A=()=>{const U=C.currentPeek();return U==="{"?m(C.peek()):U==="@"||U==="|"||U===":"||U==="."||U===vs||!U?!1:U===Ln?(C.peek(),A()):L(C,!1)},w=A();return C.resetPeek(),w}function M(C){_(C);const I=C.currentPeek()==="|";return C.resetPeek(),I}function L(C,I=!0){const N=(w=!1,U="")=>{const O=C.currentPeek();return O==="{"||O==="@"||!O?w:O==="|"?!(U===vs||U===Ln):O===vs?(C.peek(),N(!0,vs)):O===Ln?(C.peek(),N(!0,Ln)):!0},A=N();return I&&C.resetPeek(),A}function F(C,I){const N=C.currentChar();return N===er?er:I(N)?(C.next(),N):null}function H(C){const I=C.charCodeAt(0);return I>=97&&I<=122||I>=65&&I<=90||I>=48&&I<=57||I===95||I===36}function Y(C){return F(C,H)}function ee(C){const I=C.charCodeAt(0);return I>=97&&I<=122||I>=65&&I<=90||I>=48&&I<=57||I===95||I===36||I===45}function K(C){return F(C,ee)}function Q(C){const I=C.charCodeAt(0);return I>=48&&I<=57}function Z(C){return F(C,Q)}function he(C){const I=C.charCodeAt(0);return I>=48&&I<=57||I>=65&&I<=70||I>=97&&I<=102}function be(C){return F(C,he)}function se(C){let I="",N="";for(;I=Z(C);)N+=I;return N}function ye(C){let I="";for(;;){const N=C.currentChar();if(N==="{"||N==="}"||N==="@"||N==="|"||!N)break;if(N===vs||N===Ln)if(L(C))I+=N,C.next();else{if(M(C))break;I+=N,C.next()}else I+=N,C.next()}return I}function He(C){g(C);let I="",N="";for(;I=K(C);)N+=I;return C.currentChar()===er&&f(At.UNTERMINATED_CLOSING_BRACE,r(),0),N}function re(C){g(C);let I="";return C.currentChar()==="-"?(C.next(),I+=`-${se(C)}`):I+=se(C),C.currentChar()===er&&f(At.UNTERMINATED_CLOSING_BRACE,r(),0),I}function ge(C){return C!==rM&&C!==Ln}function xe(C){g(C),p(C,"'");let I="",N="";for(;I=F(C,ge);)I==="\\"?N+=X(C):N+=I;const A=C.currentChar();return A===Ln||A===er?(f(At.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,r(),0),A===Ln&&(C.next(),p(C,"'")),N):(p(C,"'"),N)}function X(C){const I=C.currentChar();switch(I){case"\\":case"'":return C.next(),`\\${I}`;case"u":return ae(C,I,4);case"U":return ae(C,I,6);default:return f(At.UNKNOWN_ESCAPE_SEQUENCE,r(),0,I),""}}function ae(C,I,N){p(C,I);let A="";for(let w=0;w{const A=C.currentChar();return A==="{"||A==="@"||A==="|"||A==="("||A===")"||!A||A===vs?N:(N+=A,C.next(),I(N))};return I("")}function z(C){g(C);const I=p(C,"|");return g(C),I}function R(C,I){let N=null;switch(C.currentChar()){case"{":return I.braceNest>=1&&f(At.NOT_ALLOW_NEST_PLACEHOLDER,r(),0),C.next(),N=d(I,2,"{"),g(C),I.braceNest++,N;case"}":return I.braceNest>0&&I.currentType===2&&f(At.EMPTY_PLACEHOLDER,r(),0),C.next(),N=d(I,3,"}"),I.braceNest--,I.braceNest>0&&g(C),I.inLinked&&I.braceNest===0&&(I.inLinked=!1),N;case"@":return I.braceNest>0&&f(At.UNTERMINATED_CLOSING_BRACE,r(),0),N=te(C,I)||h(I),I.braceNest=0,N;default:{let w=!0,U=!0,O=!0;if(M(C))return I.braceNest>0&&f(At.UNTERMINATED_CLOSING_BRACE,r(),0),N=d(I,1,z(C)),I.braceNest=0,I.inLinked=!1,N;if(I.braceNest>0&&(I.currentType===4||I.currentType===5||I.currentType===6))return f(At.UNTERMINATED_CLOSING_BRACE,r(),0),I.braceNest=0,G(C,I);if(w=b(C,I))return N=d(I,4,He(C)),g(C),N;if(U=v(C,I))return N=d(I,5,re(C)),g(C),N;if(O=T(C,I))return N=d(I,6,xe(C)),g(C),N;if(!w&&!U&&!O)return N=d(I,12,ce(C)),f(At.INVALID_TOKEN_IN_PLACEHOLDER,r(),0,N.value),g(C),N;break}}return N}function te(C,I){const{currentType:N}=I;let A=null;const w=C.currentChar();switch((N===7||N===8||N===11||N===9)&&(w===Ln||w===vs)&&f(At.INVALID_LINKED_FORMAT,r(),0),w){case"@":return C.next(),A=d(I,7,"@"),I.inLinked=!0,A;case".":return g(C),C.next(),d(I,8,".");case":":return g(C),C.next(),d(I,9,":");default:return M(C)?(A=d(I,1,z(C)),I.braceNest=0,I.inLinked=!1,A):E(C,I)||P(C,I)?(g(C),te(C,I)):S(C,I)?(g(C),d(I,11,Ue(C))):x(C,I)?(g(C),w==="{"?R(C,I)||A:d(I,10,k(C))):(N===7&&f(At.INVALID_LINKED_FORMAT,r(),0),I.braceNest=0,I.inLinked=!1,G(C,I))}}function G(C,I){let N={type:13};if(I.braceNest>0)return R(C,I)||h(I);if(I.inLinked)return te(C,I)||h(I);switch(C.currentChar()){case"{":return R(C,I)||h(I);case"}":return f(At.UNBALANCED_CLOSING_BRACE,r(),0),C.next(),d(I,3,"}");case"@":return te(C,I)||h(I);default:{if(M(C))return N=d(I,1,z(C)),I.braceNest=0,I.inLinked=!1,N;if(L(C))return d(I,0,ye(C));break}}return N}function W(){const{currentType:C,offset:I,startLoc:N,endLoc:A}=l;return l.lastType=C,l.lastOffset=I,l.lastStartLoc=N,l.lastEndLoc=A,l.offset=s(),l.startLoc=r(),i.currentChar()===er?d(l,13):G(i,l)}return{nextToken:W,currentOffset:s,currentPosition:r,context:c}}const l8="parser",c8=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function u8(n,e,t){switch(n){case"\\\\":return"\\";case"\\'":return"'";default:{const i=parseInt(e||t,16);return i<=55295||i>=57344?String.fromCodePoint(i):"�"}}}function f8(n={}){const e=n.location!==!1,{onError:t}=n;function i(m,y,b,v,...T){const E=m.currentPosition();if(E.offset+=v,E.column+=v,t){const S=e?t0(b,E):null,P=np(y,S,{domain:l8,args:T});t(P)}}function s(m,y,b){const v={type:m};return e&&(v.start=y,v.end=y,v.loc={start:b,end:b}),v}function r(m,y,b,v){e&&(m.end=y,m.loc&&(m.loc.end=b))}function o(m,y){const b=m.context(),v=s(3,b.offset,b.startLoc);return v.value=y,r(v,m.currentOffset(),m.currentPosition()),v}function a(m,y){const b=m.context(),{lastOffset:v,lastStartLoc:T}=b,E=s(5,v,T);return E.index=parseInt(y,10),m.nextToken(),r(E,m.currentOffset(),m.currentPosition()),E}function l(m,y){const b=m.context(),{lastOffset:v,lastStartLoc:T}=b,E=s(4,v,T);return E.key=y,m.nextToken(),r(E,m.currentOffset(),m.currentPosition()),E}function c(m,y){const b=m.context(),{lastOffset:v,lastStartLoc:T}=b,E=s(9,v,T);return E.value=y.replace(c8,u8),m.nextToken(),r(E,m.currentOffset(),m.currentPosition()),E}function u(m){const y=m.nextToken(),b=m.context(),{lastOffset:v,lastStartLoc:T}=b,E=s(8,v,T);return y.type!==11?(i(m,At.UNEXPECTED_EMPTY_LINKED_MODIFIER,b.lastStartLoc,0),E.value="",r(E,v,T),{nextConsumeToken:y,node:E}):(y.value==null&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Gi(y)),E.value=y.value||"",r(E,m.currentOffset(),m.currentPosition()),{node:E})}function f(m,y){const b=m.context(),v=s(7,b.offset,b.startLoc);return v.value=y,r(v,m.currentOffset(),m.currentPosition()),v}function d(m){const y=m.context(),b=s(6,y.offset,y.startLoc);let v=m.nextToken();if(v.type===8){const T=u(m);b.modifier=T.node,v=T.nextConsumeToken||m.nextToken()}switch(v.type!==9&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Gi(v)),v=m.nextToken(),v.type===2&&(v=m.nextToken()),v.type){case 10:v.value==null&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Gi(v)),b.key=f(m,v.value||"");break;case 4:v.value==null&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Gi(v)),b.key=l(m,v.value||"");break;case 5:v.value==null&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Gi(v)),b.key=a(m,v.value||"");break;case 6:v.value==null&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Gi(v)),b.key=c(m,v.value||"");break;default:{i(m,At.UNEXPECTED_EMPTY_LINKED_KEY,y.lastStartLoc,0);const T=m.context(),E=s(7,T.offset,T.startLoc);return E.value="",r(E,T.offset,T.startLoc),b.key=E,r(b,T.offset,T.startLoc),{nextConsumeToken:v,node:b}}}return r(b,m.currentOffset(),m.currentPosition()),{node:b}}function h(m){const y=m.context(),b=y.currentType===1?m.currentOffset():y.offset,v=y.currentType===1?y.endLoc:y.startLoc,T=s(2,b,v);T.items=[];let E=null;do{const x=E||m.nextToken();switch(E=null,x.type){case 0:x.value==null&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Gi(x)),T.items.push(o(m,x.value||""));break;case 5:x.value==null&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Gi(x)),T.items.push(a(m,x.value||""));break;case 4:x.value==null&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Gi(x)),T.items.push(l(m,x.value||""));break;case 6:x.value==null&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,Gi(x)),T.items.push(c(m,x.value||""));break;case 7:{const M=d(m);T.items.push(M.node),E=M.nextConsumeToken||null;break}}}while(y.currentType!==13&&y.currentType!==1);const S=y.currentType===1?y.lastOffset:m.currentOffset(),P=y.currentType===1?y.lastEndLoc:m.currentPosition();return r(T,S,P),T}function p(m,y,b,v){const T=m.context();let E=v.items.length===0;const S=s(1,y,b);S.cases=[],S.cases.push(v);do{const P=h(m);E||(E=P.items.length===0),S.cases.push(P)}while(T.currentType!==13);return E&&i(m,At.MUST_HAVE_MESSAGES_IN_PLURAL,b,0),r(S,m.currentOffset(),m.currentPosition()),S}function _(m){const y=m.context(),{offset:b,startLoc:v}=y,T=h(m);return y.currentType===13?T:p(m,b,v,T)}function g(m){const y=a8(m,un({},n)),b=y.context(),v=s(0,b.offset,b.startLoc);return e&&v.loc&&(v.loc.source=m),v.body=_(y),n.onCacheKey&&(v.cacheKey=n.onCacheKey(m)),b.currentType!==13&&i(y,At.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,m[b.offset]||""),r(v,y.currentOffset(),y.currentPosition()),v}return{parse:g}}function Gi(n){if(n.type===13)return"EOF";const e=(n.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function d8(n,e={}){const t={ast:n,helpers:new Set};return{context:()=>t,helper:r=>(t.helpers.add(r),r)}}function oM(n,e){for(let t=0;taM(t)),n}function aM(n){if(n.items.length===1){const e=n.items[0];(e.type===3||e.type===9)&&(n.static=e.value,delete e.value)}else{const e=[];for(let t=0;to;function l(_,g){o.code+=_}function c(_,g=!0){const m=g?i:"";l(s?m+" ".repeat(_):m)}function u(_=!0){const g=++o.indentLevel;_&&c(g)}function f(_=!0){const g=--o.indentLevel;_&&c(g)}function d(){c(o.indentLevel)}return{context:a,push:l,indent:u,deindent:f,newline:d,helper:_=>`_${_}`,needIndent:()=>o.needIndent}}function g8(n,e){const{helper:t}=n;n.push(`${t("linked")}(`),La(n,e.key),e.modifier?(n.push(", "),La(n,e.modifier),n.push(", _type")):n.push(", undefined, _type"),n.push(")")}function _8(n,e){const{helper:t,needIndent:i}=n;n.push(`${t("normalize")}([`),n.indent(i());const s=e.items.length;for(let r=0;r1){n.push(`${t("plural")}([`),n.indent(i());const s=e.cases.length;for(let r=0;r{const t=Ne(e.mode)?e.mode:"normal",i=Ne(e.filename)?e.filename:"message.intl";e.sourceMap;const s=e.breakLineCode!=null?e.breakLineCode:t==="arrow"?";":` -`,r=e.needIndent?e.needIndent:t!=="arrow",o=n.helpers||[],a=m8(n,{filename:i,breakLineCode:s,needIndent:r});a.push(t==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),a.indent(r),o.length>0&&(a.push(`const { ${Z_(o.map(u=>`${u}: _${u}`),", ")} } = ctx`),a.newline()),a.push("return "),La(a,n),a.deindent(r),a.push("}"),delete n.helpers;const{code:l,map:c}=a.context();return{ast:n,code:l,map:c?c.toJSON():void 0}};function x8(n,e={}){const t=un({},e),i=!!t.jit,s=!!t.minify,r=t.optimize==null?!0:t.optimize,a=f8(t).parse(n);return i?(r&&p8(a),s&&ia(a),{ast:a,code:""}):(h8(a,t),b8(a,t))}/*! - * core-base v11.1.3 - * (c) 2025 kazuya kawaguchi - * Released under the MIT License. - */function M8(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(j_().__INTLIFY_PROD_DEVTOOLS__=!1)}function ts(n){return yt(n)&&Q_(n)===0&&(Di(n,"b")||Di(n,"body"))}const SA=["b","body"];function S8(n){return Pr(n,SA)}const EA=["c","cases"];function E8(n){return Pr(n,EA,[])}const TA=["s","static"];function T8(n){return Pr(n,TA)}const wA=["i","items"];function w8(n){return Pr(n,wA,[])}const AA=["t","type"];function Q_(n){return Pr(n,AA)}const CA=["v","value"];function df(n,e){const t=Pr(n,CA);if(t!=null)return t;throw Sc(e)}const RA=["m","modifier"];function A8(n){return Pr(n,RA)}const PA=["k","key"];function C8(n){const e=Pr(n,PA);if(e)return e;throw Sc(6)}function Pr(n,e,t){for(let i=0;iR8(t,n)}function R8(n,e){const t=S8(e);if(t==null)throw Sc(0);if(Q_(t)===1){const r=E8(t);return n.plural(r.reduce((o,a)=>[...o,lM(n,a)],[]))}else return lM(n,t)}function lM(n,e){const t=T8(e);if(t!=null)return n.type==="text"?t:n.normalize([t]);{const i=w8(e).reduce((s,r)=>[...s,n0(n,r)],[]);return n.normalize(i)}}function n0(n,e){const t=Q_(e);switch(t){case 3:return df(e,t);case 9:return df(e,t);case 4:{const i=e;if(Di(i,"k")&&i.k)return n.interpolate(n.named(i.k));if(Di(i,"key")&&i.key)return n.interpolate(n.named(i.key));throw Sc(t)}case 5:{const i=e;if(Di(i,"i")&&Zt(i.i))return n.interpolate(n.list(i.i));if(Di(i,"index")&&Zt(i.index))return n.interpolate(n.list(i.index));throw Sc(t)}case 6:{const i=e,s=A8(i),r=C8(i);return n.linked(n0(n,r),s?n0(n,s):void 0,n.type)}case 7:return df(e,t);case 8:return df(e,t);default:throw new Error(`unhandled node on format message part: ${t}`)}}const P8=n=>n;let hf=Rt();function I8(n,e={}){let t=!1;const i=e.onError||e8;return e.onError=s=>{t=!0,i(s)},{...x8(n,e),detectError:t}}function L8(n,e){if(Ne(n)){Bt(e.warnHtmlMessage)&&e.warnHtmlMessage;const i=(e.onCacheKey||P8)(n),s=hf[i];if(s)return s;const{ast:r,detectError:o}=I8(n,{...e,location:!1,jit:!0}),a=Gm(r);return o?a:hf[i]=a}else{const t=n.cacheKey;if(t){const i=hf[t];return i||(hf[t]=Gm(n))}else return Gm(n)}}let Ec=null;function D8(n){Ec=n}function O8(n,e,t){Ec&&Ec.emit("i18n:init",{timestamp:Date.now(),i18n:n,version:e,meta:t})}const N8=U8("function:translate");function U8(n){return e=>Ec&&Ec.emit(n,e)}const As={INVALID_ARGUMENT:QH,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},F8=24;function Cs(n){return np(n,null,void 0)}function ev(n,e){return e.locale!=null?cM(e.locale):cM(n.locale)}let Wm;function cM(n){if(Ne(n))return n;if(kt(n)){if(n.resolvedOnce&&Wm!=null)return Wm;if(n.constructor.name==="Function"){const e=n();if(jH(e))throw Cs(As.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Wm=e}else throw Cs(As.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Cs(As.NOT_SUPPORT_LOCALE_TYPE)}function k8(n,e,t){return[...new Set([t,...tn(e)?e:yt(e)?Object.keys(e):Ne(e)?[e]:[t]])]}function LA(n,e,t){const i=Ne(t)?t:zd,s=n;s.__localeChainCache||(s.__localeChainCache=new Map);let r=s.__localeChainCache.get(i);if(!r){r=[];let o=[t];for(;tn(o);)o=uM(r,o,e);const a=tn(e)||!dt(e)?e:e.default?e.default:null;o=Ne(a)?[a]:a,tn(o)&&uM(r,o,!1),s.__localeChainCache.set(i,r)}return r}function uM(n,e,t){let i=!0;for(let s=0;s{o===void 0?o=a:o+=a},d[1]=()=>{o!==void 0&&(e.push(o),o=void 0)},d[2]=()=>{d[0](),s++},d[3]=()=>{if(s>0)s--,i=4,d[0]();else{if(s=0,o===void 0||(o=X8(o),o===!1))return!1;d[1]()}};function h(){const p=n[t+1];if(i===5&&p==="'"||i===6&&p==='"')return t++,a="\\"+p,d[0](),!0}for(;i!==null;)if(t++,r=n[t],!(r==="\\"&&h())){if(l=W8(r),f=Ir[i],c=f[l]||f.l||8,c===8||(i=c[0],c[1]!==void 0&&(u=d[c[1]],u&&(a=r,u()===!1))))return;if(i===7)return e}}const fM=new Map;function q8(n,e){return yt(n)?n[e]:null}function Y8(n,e){if(!yt(n))return null;let t=fM.get(e);if(t||(t=$8(e),t&&fM.set(e,t)),!t)return null;const i=t.length;let s=n,r=0;for(;r`${n.charAt(0).toLocaleUpperCase()}${n.substr(1)}`;function K8(){return{upper:(n,e)=>e==="text"&&Ne(n)?n.toUpperCase():e==="vnode"&&yt(n)&&"__v_isVNode"in n?n.children.toUpperCase():n,lower:(n,e)=>e==="text"&&Ne(n)?n.toLowerCase():e==="vnode"&&yt(n)&&"__v_isVNode"in n?n.children.toLowerCase():n,capitalize:(n,e)=>e==="text"&&Ne(n)?hM(n):e==="vnode"&&yt(n)&&"__v_isVNode"in n?hM(n.children):n}}let DA;function Z8(n){DA=n}let OA;function J8(n){OA=n}let NA;function Q8(n){NA=n}let UA=null;const e9=n=>{UA=n},t9=()=>UA;let FA=null;const pM=n=>{FA=n},n9=()=>FA;let mM=0;function i9(n={}){const e=kt(n.onWarn)?n.onWarn:ZH,t=Ne(n.version)?n.version:j8,i=Ne(n.locale)||kt(n.locale)?n.locale:zd,s=kt(i)?zd:i,r=tn(n.fallbackLocale)||dt(n.fallbackLocale)||Ne(n.fallbackLocale)||n.fallbackLocale===!1?n.fallbackLocale:s,o=dt(n.messages)?n.messages:Xm(s),a=dt(n.datetimeFormats)?n.datetimeFormats:Xm(s),l=dt(n.numberFormats)?n.numberFormats:Xm(s),c=un(Rt(),n.modifiers,K8()),u=n.pluralRules||Rt(),f=kt(n.missing)?n.missing:null,d=Bt(n.missingWarn)||Bd(n.missingWarn)?n.missingWarn:!0,h=Bt(n.fallbackWarn)||Bd(n.fallbackWarn)?n.fallbackWarn:!0,p=!!n.fallbackFormat,_=!!n.unresolving,g=kt(n.postTranslation)?n.postTranslation:null,m=dt(n.processor)?n.processor:null,y=Bt(n.warnHtmlMessage)?n.warnHtmlMessage:!0,b=!!n.escapeParameter,v=kt(n.messageCompiler)?n.messageCompiler:DA,T=kt(n.messageResolver)?n.messageResolver:OA||q8,E=kt(n.localeFallbacker)?n.localeFallbacker:NA||k8,S=yt(n.fallbackContext)?n.fallbackContext:void 0,P=n,x=yt(P.__datetimeFormatters)?P.__datetimeFormatters:new Map,M=yt(P.__numberFormatters)?P.__numberFormatters:new Map,L=yt(P.__meta)?P.__meta:{};mM++;const F={version:t,cid:mM,locale:i,fallbackLocale:r,messages:o,modifiers:c,pluralRules:u,missing:f,missingWarn:d,fallbackWarn:h,fallbackFormat:p,unresolving:_,postTranslation:g,processor:m,warnHtmlMessage:y,escapeParameter:b,messageCompiler:v,messageResolver:T,localeFallbacker:E,fallbackContext:S,onWarn:e,__meta:L};return F.datetimeFormats=a,F.numberFormats=l,F.__datetimeFormatters=x,F.__numberFormatters=M,__INTLIFY_PROD_DEVTOOLS__&&O8(F,t,L),F}const Xm=n=>({[n]:Rt()});function tv(n,e,t,i,s){const{missing:r,onWarn:o}=n;if(r!==null){const a=r(n,t,e,s);return Ne(a)?a:e}else return e}function ul(n,e,t){const i=n;i.__localeChainCache=new Map,n.localeFallbacker(n,t,e)}function s9(n,e){return n===e?!1:n.split("-")[0]===e.split("-")[0]}function r9(n,e){const t=e.indexOf(n);if(t===-1)return!1;for(let i=t+1;i{kA.includes(l)?o[l]=t[l]:r[l]=t[l]}),Ne(i)?r.locale=i:dt(i)&&(o=i),dt(s)&&(o=s),[r.key||"",a,r,o]}function _M(n,e,t){const i=n;for(const s in t){const r=`${e}__${s}`;i.__datetimeFormatters.has(r)&&i.__datetimeFormatters.delete(r)}}function vM(n,...e){const{numberFormats:t,unresolving:i,fallbackLocale:s,onWarn:r,localeFallbacker:o}=n,{__numberFormatters:a}=n,[l,c,u,f]=s0(...e),d=Bt(u.missingWarn)?u.missingWarn:n.missingWarn;Bt(u.fallbackWarn)?u.fallbackWarn:n.fallbackWarn;const h=!!u.part,p=ev(n,u),_=o(n,s,p);if(!Ne(l)||l==="")return new Intl.NumberFormat(p,f).format(c);let g={},m,y=null;const b="number format";for(let E=0;E<_.length&&(m=_[E],g=t[m]||{},y=g[l],!dt(y));E++)tv(n,l,m,d,b);if(!dt(y)||!Ne(m))return i?ip:l;let v=`${m}__${l}`;tp(f)||(v=`${v}__${JSON.stringify(f)}`);let T=a.get(v);return T||(T=new Intl.NumberFormat(m,un({},y,f)),a.set(v,T)),h?T.formatToParts(c):T.format(c)}const BA=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function s0(...n){const[e,t,i,s]=n,r=Rt();let o=Rt();if(!Zt(e))throw Cs(As.INVALID_ARGUMENT);const a=e;return Ne(t)?r.key=t:dt(t)&&Object.keys(t).forEach(l=>{BA.includes(l)?o[l]=t[l]:r[l]=t[l]}),Ne(i)?r.locale=i:dt(i)&&(o=i),dt(s)&&(o=s),[r.key||"",a,r,o]}function yM(n,e,t){const i=n;for(const s in t){const r=`${e}__${s}`;i.__numberFormatters.has(r)&&i.__numberFormatters.delete(r)}}const o9=n=>n,a9=n=>"",l9="text",c9=n=>n.length===0?"":Z_(n),u9=KH;function bM(n,e){return n=Math.abs(n),e===2?n?n>1?1:0:1:n?Math.min(n,2):0}function f9(n){const e=Zt(n.pluralIndex)?n.pluralIndex:-1;return n.named&&(Zt(n.named.count)||Zt(n.named.n))?Zt(n.named.count)?n.named.count:Zt(n.named.n)?n.named.n:e:e}function d9(n,e){e.count||(e.count=n),e.n||(e.n=n)}function h9(n={}){const e=n.locale,t=f9(n),i=yt(n.pluralRules)&&Ne(e)&&kt(n.pluralRules[e])?n.pluralRules[e]:bM,s=yt(n.pluralRules)&&Ne(e)&&kt(n.pluralRules[e])?bM:void 0,r=m=>m[i(t,m.length,s)],o=n.list||[],a=m=>o[m],l=n.named||Rt();Zt(n.pluralIndex)&&d9(t,l);const c=m=>l[m];function u(m,y){const b=kt(n.messages)?n.messages(m,!!y):yt(n.messages)?n.messages[m]:!1;return b||(n.parent?n.parent.message(m):a9)}const f=m=>n.modifiers?n.modifiers[m]:o9,d=dt(n.processor)&&kt(n.processor.normalize)?n.processor.normalize:c9,h=dt(n.processor)&&kt(n.processor.interpolate)?n.processor.interpolate:u9,p=dt(n.processor)&&Ne(n.processor.type)?n.processor.type:l9,g={list:a,named:c,plural:r,linked:(m,...y)=>{const[b,v]=y;let T="text",E="";y.length===1?yt(b)?(E=b.modifier||E,T=b.type||T):Ne(b)&&(E=b||E):y.length===2&&(Ne(b)&&(E=b||E),Ne(v)&&(T=v||T));const S=u(m,!0)(g),P=T==="vnode"&&tn(S)&&E?S[0]:S;return E?f(E)(P,T):P},message:u,type:p,interpolate:h,normalize:d,values:un(Rt(),o,l)};return g}const xM=()=>"",mi=n=>kt(n);function MM(n,...e){const{fallbackFormat:t,postTranslation:i,unresolving:s,messageCompiler:r,fallbackLocale:o,messages:a}=n,[l,c]=r0(...e),u=Bt(c.missingWarn)?c.missingWarn:n.missingWarn,f=Bt(c.fallbackWarn)?c.fallbackWarn:n.fallbackWarn,d=Bt(c.escapeParameter)?c.escapeParameter:n.escapeParameter,h=!!c.resolvedMessage,p=Ne(c.default)||Bt(c.default)?Bt(c.default)?r?l:()=>l:c.default:t?r?l:()=>l:null,_=t||p!=null&&(Ne(p)||kt(p)),g=ev(n,c);d&&p9(c);let[m,y,b]=h?[l,g,a[g]||Rt()]:zA(n,l,g,o,f,u),v=m,T=l;if(!h&&!(Ne(v)||ts(v)||mi(v))&&_&&(v=p,T=v),!h&&(!(Ne(v)||ts(v)||mi(v))||!Ne(y)))return s?ip:l;let E=!1;const S=()=>{E=!0},P=mi(v)?v:VA(n,l,y,v,T,S);if(E)return v;const x=_9(n,y,b,c),M=h9(x),L=m9(n,P,M),F=i?i(L,l):L;if(__INTLIFY_PROD_DEVTOOLS__){const H={timestamp:Date.now(),key:Ne(l)?l:mi(v)?v.key:"",locale:y||(mi(v)?v.locale:""),format:Ne(v)?v:mi(v)?v.source:"",message:F};H.meta=un({},n.__meta,t9()||{}),N8(H)}return F}function p9(n){tn(n.list)?n.list=n.list.map(e=>Ne(e)?sM(e):e):yt(n.named)&&Object.keys(n.named).forEach(e=>{Ne(n.named[e])&&(n.named[e]=sM(n.named[e]))})}function zA(n,e,t,i,s,r){const{messages:o,onWarn:a,messageResolver:l,localeFallbacker:c}=n,u=c(n,i,t);let f=Rt(),d,h=null;const p="translate";for(let _=0;_i;return c.locale=t,c.key=e,c}const l=o(i,g9(n,t,s,i,a,r));return l.locale=t,l.key=e,l.source=i,l}function m9(n,e,t){return e(t)}function r0(...n){const[e,t,i]=n,s=Rt();if(!Ne(e)&&!Zt(e)&&!mi(e)&&!ts(e))throw Cs(As.INVALID_ARGUMENT);const r=Zt(e)?String(e):(mi(e),e);return Zt(t)?s.plural=t:Ne(t)?s.default=t:dt(t)&&!tp(t)?s.named=t:tn(t)&&(s.list=t),Zt(i)?s.plural=i:Ne(i)?s.default=i:dt(i)&&un(s,i),[r,s]}function g9(n,e,t,i,s,r){return{locale:e,key:t,warnHtmlMessage:s,onError:o=>{throw r&&r(o),o},onCacheKey:o=>WH(e,t,o)}}function _9(n,e,t,i){const{modifiers:s,pluralRules:r,messageResolver:o,fallbackLocale:a,fallbackWarn:l,missingWarn:c,fallbackContext:u}=n,d={locale:e,modifiers:s,pluralRules:r,messages:(h,p)=>{let _=o(t,h);if(_==null&&(u||p)){const[,,g]=zA(u||n,h,e,a,l,c);_=o(g,h)}if(Ne(_)||ts(_)){let g=!1;const y=VA(n,h,e,_,h,()=>{g=!0});return g?xM:y}else return mi(_)?_:xM}};return n.processor&&(d.processor=n.processor),i.list&&(d.list=i.list),i.named&&(d.named=i.named),Zt(i.plural)&&(d.pluralIndex=i.plural),d}M8();/*! - * vue-i18n v11.1.3 - * (c) 2025 kazuya kawaguchi - * Released under the MIT License. - */const v9="11.1.3";function y9(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(j_().__INTLIFY_PROD_DEVTOOLS__=!1)}const xi={UNEXPECTED_RETURN_TYPE:F8,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32};function zi(n,...e){return np(n,null,void 0)}const o0=Rr("__translateVNode"),a0=Rr("__datetimeParts"),l0=Rr("__numberParts"),b9=Rr("__setPluralRules"),x9=Rr("__injectWithOption"),c0=Rr("__dispose");function Tc(n){if(!yt(n)||ts(n))return n;for(const e in n)if(Di(n,e))if(!e.includes("."))yt(n[e])&&Tc(n[e]);else{const t=e.split("."),i=t.length-1;let s=n,r=!1;for(let o=0;o{if("locale"in a&&"resource"in a){const{locale:l,resource:c}=a;l?(o[l]=o[l]||Rt(),Pf(c,o[l])):Pf(c,o)}else Ne(a)&&Pf(JSON.parse(a),o)}),s==null&&r)for(const a in o)Di(o,a)&&Tc(o[a]);return o}function GA(n){return n.type}function M9(n,e,t){let i=yt(e.messages)?e.messages:Rt();"__i18nGlobal"in t&&(i=HA(n.locale.value,{messages:i,__i18n:t.__i18nGlobal}));const s=Object.keys(i);s.length&&s.forEach(r=>{n.mergeLocaleMessage(r,i[r])});{if(yt(e.datetimeFormats)){const r=Object.keys(e.datetimeFormats);r.length&&r.forEach(o=>{n.mergeDateTimeFormat(o,e.datetimeFormats[o])})}if(yt(e.numberFormats)){const r=Object.keys(e.numberFormats);r.length&&r.forEach(o=>{n.mergeNumberFormat(o,e.numberFormats[o])})}}}function SM(n){return pn(Ic,null,n,0)}const EM="__INTLIFY_META__",TM=()=>[],S9=()=>!1;let wM=0;function AM(n){return(e,t,i,s)=>n(t,i,wn()||void 0,s)}const E9=()=>{const n=wn();let e=null;return n&&(e=GA(n)[EM])?{[EM]:e}:null};function WA(n={}){const{__root:e,__injectWithOption:t}=n,i=e===void 0,s=n.flatJson,r=kd?et:De;let o=Bt(n.inheritLocale)?n.inheritLocale:!0;const a=r(e&&o?e.locale.value:Ne(n.locale)?n.locale:zd),l=r(e&&o?e.fallbackLocale.value:Ne(n.fallbackLocale)||tn(n.fallbackLocale)||dt(n.fallbackLocale)||n.fallbackLocale===!1?n.fallbackLocale:a.value),c=r(HA(a.value,n)),u=r(dt(n.datetimeFormats)?n.datetimeFormats:{[a.value]:{}}),f=r(dt(n.numberFormats)?n.numberFormats:{[a.value]:{}});let d=e?e.missingWarn:Bt(n.missingWarn)||Bd(n.missingWarn)?n.missingWarn:!0,h=e?e.fallbackWarn:Bt(n.fallbackWarn)||Bd(n.fallbackWarn)?n.fallbackWarn:!0,p=e?e.fallbackRoot:Bt(n.fallbackRoot)?n.fallbackRoot:!0,_=!!n.fallbackFormat,g=kt(n.missing)?n.missing:null,m=kt(n.missing)?AM(n.missing):null,y=kt(n.postTranslation)?n.postTranslation:null,b=e?e.warnHtmlMessage:Bt(n.warnHtmlMessage)?n.warnHtmlMessage:!0,v=!!n.escapeParameter;const T=e?e.modifiers:dt(n.modifiers)?n.modifiers:{};let E=n.pluralRules||e&&e.pluralRules,S;S=(()=>{i&&pM(null);const O={version:v9,locale:a.value,fallbackLocale:l.value,messages:c.value,modifiers:T,pluralRules:E,missing:m===null?void 0:m,missingWarn:d,fallbackWarn:h,fallbackFormat:_,unresolving:!0,postTranslation:y===null?void 0:y,warnHtmlMessage:b,escapeParameter:v,messageResolver:n.messageResolver,messageCompiler:n.messageCompiler,__meta:{framework:"vue"}};O.datetimeFormats=u.value,O.numberFormats=f.value,O.__datetimeFormatters=dt(S)?S.__datetimeFormatters:void 0,O.__numberFormatters=dt(S)?S.__numberFormatters:void 0;const V=i9(O);return i&&pM(V),V})(),ul(S,a.value,l.value);function x(){return[a.value,l.value,c.value,u.value,f.value]}const M=Ee({get:()=>a.value,set:O=>{S.locale=O,a.value=O}}),L=Ee({get:()=>l.value,set:O=>{S.fallbackLocale=O,l.value=O,ul(S,a.value,O)}}),F=Ee(()=>c.value),H=Ee(()=>u.value),Y=Ee(()=>f.value);function ee(){return kt(y)?y:null}function K(O){y=O,S.postTranslation=O}function Q(){return g}function Z(O){O!==null&&(m=AM(O)),g=O,S.missing=m}const he=(O,V,$,ue,le,Me)=>{x();let Be;try{__INTLIFY_PROD_DEVTOOLS__,i||(S.fallbackContext=e?n9():void 0),Be=O(S)}finally{__INTLIFY_PROD_DEVTOOLS__,i||(S.fallbackContext=void 0)}if($!=="translate exists"&&Zt(Be)&&Be===ip||$==="translate exists"&&!Be){const[me,Te]=V();return e&&p?ue(e):le(me)}else{if(Me(Be))return Be;throw zi(xi.UNEXPECTED_RETURN_TYPE)}};function be(...O){return he(V=>Reflect.apply(MM,null,[V,...O]),()=>r0(...O),"translate",V=>Reflect.apply(V.t,V,[...O]),V=>V,V=>Ne(V))}function se(...O){const[V,$,ue]=O;if(ue&&!yt(ue))throw zi(xi.INVALID_ARGUMENT);return be(V,$,un({resolvedMessage:!0},ue||{}))}function ye(...O){return he(V=>Reflect.apply(gM,null,[V,...O]),()=>i0(...O),"datetime format",V=>Reflect.apply(V.d,V,[...O]),()=>dM,V=>Ne(V))}function He(...O){return he(V=>Reflect.apply(vM,null,[V,...O]),()=>s0(...O),"number format",V=>Reflect.apply(V.n,V,[...O]),()=>dM,V=>Ne(V))}function re(O){return O.map(V=>Ne(V)||Zt(V)||Bt(V)?SM(String(V)):V)}const xe={normalize:re,interpolate:O=>O,type:"vnode"};function X(...O){return he(V=>{let $;const ue=V;try{ue.processor=xe,$=Reflect.apply(MM,null,[ue,...O])}finally{ue.processor=null}return $},()=>r0(...O),"translate",V=>V[o0](...O),V=>[SM(V)],V=>tn(V))}function ae(...O){return he(V=>Reflect.apply(vM,null,[V,...O]),()=>s0(...O),"number format",V=>V[l0](...O),TM,V=>Ne(V)||tn(V))}function fe(...O){return he(V=>Reflect.apply(gM,null,[V,...O]),()=>i0(...O),"datetime format",V=>V[a0](...O),TM,V=>Ne(V)||tn(V))}function ce(O){E=O,S.pluralRules=E}function Ue(O,V){return he(()=>{if(!O)return!1;const $=Ne(V)?V:a.value,ue=R($),le=S.messageResolver(ue,O);return ts(le)||mi(le)||Ne(le)},()=>[O],"translate exists",$=>Reflect.apply($.te,$,[O,V]),S9,$=>Bt($))}function k(O){let V=null;const $=LA(S,l.value,a.value);for(let ue=0;ue<$.length;ue++){const le=c.value[$[ue]]||{},Me=S.messageResolver(le,O);if(Me!=null){V=Me;break}}return V}function z(O){const V=k(O);return V??(e?e.tm(O)||{}:{})}function R(O){return c.value[O]||{}}function te(O,V){if(s){const $={[O]:V};for(const ue in $)Di($,ue)&&Tc($[ue]);V=$[O]}c.value[O]=V,S.messages=c.value}function G(O,V){c.value[O]=c.value[O]||{};const $={[O]:V};if(s)for(const ue in $)Di($,ue)&&Tc($[ue]);V=$[O],Pf(V,c.value[O]),S.messages=c.value}function W(O){return u.value[O]||{}}function C(O,V){u.value[O]=V,S.datetimeFormats=u.value,_M(S,O,V)}function I(O,V){u.value[O]=un(u.value[O]||{},V),S.datetimeFormats=u.value,_M(S,O,V)}function N(O){return f.value[O]||{}}function A(O,V){f.value[O]=V,S.numberFormats=f.value,yM(S,O,V)}function w(O,V){f.value[O]=un(f.value[O]||{},V),S.numberFormats=f.value,yM(S,O,V)}wM++,e&&kd&&($e(e.locale,O=>{o&&(a.value=O,S.locale=O,ul(S,a.value,l.value))}),$e(e.fallbackLocale,O=>{o&&(l.value=O,S.fallbackLocale=O,ul(S,a.value,l.value))}));const U={id:wM,locale:M,fallbackLocale:L,get inheritLocale(){return o},set inheritLocale(O){o=O,O&&e&&(a.value=e.locale.value,l.value=e.fallbackLocale.value,ul(S,a.value,l.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:F,get modifiers(){return T},get pluralRules(){return E||{}},get isGlobal(){return i},get missingWarn(){return d},set missingWarn(O){d=O,S.missingWarn=d},get fallbackWarn(){return h},set fallbackWarn(O){h=O,S.fallbackWarn=h},get fallbackRoot(){return p},set fallbackRoot(O){p=O},get fallbackFormat(){return _},set fallbackFormat(O){_=O,S.fallbackFormat=_},get warnHtmlMessage(){return b},set warnHtmlMessage(O){b=O,S.warnHtmlMessage=O},get escapeParameter(){return v},set escapeParameter(O){v=O,S.escapeParameter=O},t:be,getLocaleMessage:R,setLocaleMessage:te,mergeLocaleMessage:G,getPostTranslationHandler:ee,setPostTranslationHandler:K,getMissingHandler:Q,setMissingHandler:Z,[b9]:ce};return U.datetimeFormats=H,U.numberFormats=Y,U.rt=se,U.te=Ue,U.tm=z,U.d=ye,U.n=He,U.getDateTimeFormat=W,U.setDateTimeFormat=C,U.mergeDateTimeFormat=I,U.getNumberFormat=N,U.setNumberFormat=A,U.mergeNumberFormat=w,U[x9]=t,U[o0]=X,U[a0]=fe,U[l0]=ae,U}const nv={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:n=>n==="parent"||n==="global",default:"parent"},i18n:{type:Object}};function T9({slots:n},e){return e.length===1&&e[0]==="default"?(n.default?n.default():[]).reduce((i,s)=>[...i,...s.type===jt?s.children:[s]],[]):e.reduce((t,i)=>{const s=n[i];return s&&(t[i]=s()),t},Rt())}function XA(){return jt}const w9=fn({name:"i18n-t",props:un({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:n=>Zt(n)||!isNaN(n)}},nv),setup(n,e){const{slots:t,attrs:i}=e,s=n.i18n||sp({useScope:n.scope,__useComponent:!0});return()=>{const r=Object.keys(t).filter(f=>f!=="_"),o=Rt();n.locale&&(o.locale=n.locale),n.plural!==void 0&&(o.plural=Ne(n.plural)?+n.plural:n.plural);const a=T9(e,r),l=s[o0](n.keypath,a,o),c=un(Rt(),i),u=Ne(n.tag)||yt(n.tag)?n.tag:XA();return Ds(u,c,l)}}}),CM=w9;function A9(n){return tn(n)&&!Ne(n[0])}function $A(n,e,t,i){const{slots:s,attrs:r}=e;return()=>{const o={part:!0};let a=Rt();n.locale&&(o.locale=n.locale),Ne(n.format)?o.key=n.format:yt(n.format)&&(Ne(n.format.key)&&(o.key=n.format.key),a=Object.keys(n.format).reduce((d,h)=>t.includes(h)?un(Rt(),d,{[h]:n.format[h]}):d,Rt()));const l=i(n.value,o,a);let c=[o.key];tn(l)?c=l.map((d,h)=>{const p=s[d.type],_=p?p({[d.type]:d.value,index:h,parts:l}):[d.value];return A9(_)&&(_[0].key=`${d.type}-${h}`),_}):Ne(l)&&(c=[l]);const u=un(Rt(),r),f=Ne(n.tag)||yt(n.tag)?n.tag:XA();return Ds(f,u,c)}}const C9=fn({name:"i18n-n",props:un({value:{type:Number,required:!0},format:{type:[String,Object]}},nv),setup(n,e){const t=n.i18n||sp({useScope:n.scope,__useComponent:!0});return $A(n,e,BA,(...i)=>t[l0](...i))}}),RM=C9;function R9(n,e){const t=n;if(n.mode==="composition")return t.__getInstance(e)||n.global;{const i=t.__getInstance(e);return i!=null?i.__composer:n.global.__composer}}function P9(n){const e=o=>{const{instance:a,value:l}=o;if(!a||!a.$)throw zi(xi.UNEXPECTED_ERROR);const c=R9(n,a.$),u=PM(l);return[Reflect.apply(c.t,c,[...IM(u)]),c]};return{created:(o,a)=>{const[l,c]=e(a);kd&&n.global===c&&(o.__i18nWatcher=$e(c.locale,()=>{a.instance&&a.instance.$forceUpdate()})),o.__composer=c,o.textContent=l},unmounted:o=>{kd&&o.__i18nWatcher&&(o.__i18nWatcher(),o.__i18nWatcher=void 0,delete o.__i18nWatcher),o.__composer&&(o.__composer=void 0,delete o.__composer)},beforeUpdate:(o,{value:a})=>{if(o.__composer){const l=o.__composer,c=PM(a);o.textContent=Reflect.apply(l.t,l,[...IM(c)])}},getSSRProps:o=>{const[a]=e(o);return{textContent:a}}}}function PM(n){if(Ne(n))return{path:n};if(dt(n)){if(!("path"in n))throw zi(xi.REQUIRED_VALUE,"path");return n}else throw zi(xi.INVALID_VALUE)}function IM(n){const{path:e,locale:t,args:i,choice:s,plural:r}=n,o={},a=i||{};return Ne(t)&&(o.locale=t),Zt(s)&&(o.plural=s),Zt(r)&&(o.plural=r),[e,a,o]}function I9(n,e,...t){const i=dt(t[0])?t[0]:{};(Bt(i.globalInstall)?i.globalInstall:!0)&&([CM.name,"I18nT"].forEach(r=>n.component(r,CM)),[RM.name,"I18nN"].forEach(r=>n.component(r,RM)),[DM.name,"I18nD"].forEach(r=>n.component(r,DM))),n.directive("t",P9(e))}const L9=Rr("global-vue-i18n");function D9(n={}){const e=Bt(n.globalInjection)?n.globalInjection:!0,t=new Map,[i,s]=O9(n),r=Rr("");function o(u){return t.get(u)||null}function a(u,f){t.set(u,f)}function l(u){t.delete(u)}const c={get mode(){return"composition"},async install(u,...f){if(u.__VUE_I18N_SYMBOL__=r,u.provide(u.__VUE_I18N_SYMBOL__,c),dt(f[0])){const p=f[0];c.__composerExtend=p.__composerExtend,c.__vueI18nExtend=p.__vueI18nExtend}let d=null;e&&(d=H9(u,c.global)),I9(u,c,...f);const h=u.unmount;u.unmount=()=>{d&&d(),c.dispose(),h()}},get global(){return s},dispose(){i.stop()},__instances:t,__getInstance:o,__setInstance:a,__deleteInstance:l};return c}function sp(n={}){const e=wn();if(e==null)throw zi(xi.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw zi(xi.NOT_INSTALLED);const t=N9(e),i=F9(t),s=GA(e),r=U9(n,s);if(r==="global")return M9(i,n,s),i;if(r==="parent"){let l=k9(t,e,n.__useComponent);return l==null&&(l=i),l}const o=t;let a=o.__getInstance(e);if(a==null){const l=un({},n);"__i18n"in s&&(l.__i18n=s.__i18n),i&&(l.__root=i),a=WA(l),o.__composerExtend&&(a[c0]=o.__composerExtend(a)),z9(o,e,a),o.__setInstance(e,a)}return a}function O9(n,e){const t=g0(),i=t.run(()=>WA(n));if(i==null)throw zi(xi.UNEXPECTED_ERROR);return[t,i]}function N9(n){const e=En(n.isCE?L9:n.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw zi(n.isCE?xi.NOT_INSTALLED_WITH_PROVIDE:xi.UNEXPECTED_ERROR);return e}function U9(n,e){return tp(n)?"__i18n"in e?"local":"global":n.useScope?n.useScope:"local"}function F9(n){return n.mode==="composition"?n.global:n.global.__composer}function k9(n,e,t=!1){let i=null;const s=e.root;let r=B9(e,t);for(;r!=null;){const o=n;if(n.mode==="composition"&&(i=o.__getInstance(r)),i!=null||s===r)break;r=r.parent}return i}function B9(n,e=!1){return n==null?null:e&&n.vnode.ctx||n.parent}function z9(n,e,t){Hn(()=>{},e),ns(()=>{const i=t;n.__deleteInstance(e);const s=i[c0];s&&(s(),delete i[c0])},e)}const V9=["locale","fallbackLocale","availableLocales"],LM=["t","rt","d","n","tm","te"];function H9(n,e){const t=Object.create(null);return V9.forEach(s=>{const r=Object.getOwnPropertyDescriptor(e,s);if(!r)throw zi(xi.UNEXPECTED_ERROR);const o=Pt(r.value)?{get(){return r.value.value},set(a){r.value.value=a}}:{get(){return r.get&&r.get()}};Object.defineProperty(t,s,o)}),n.config.globalProperties.$i18n=t,LM.forEach(s=>{const r=Object.getOwnPropertyDescriptor(e,s);if(!r||!r.value)throw zi(xi.UNEXPECTED_ERROR);Object.defineProperty(n.config.globalProperties,`$${s}`,r)}),()=>{delete n.config.globalProperties.$i18n,LM.forEach(s=>{delete n.config.globalProperties[`$${s}`]})}}const G9=fn({name:"i18n-d",props:un({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},nv),setup(n,e){const t=n.i18n||sp({useScope:n.scope,__useComponent:!0});return $A(n,e,kA,(...i)=>t[a0](...i))}}),DM=G9;y9();Z8(L8);J8(Y8);Q8(LA);if(__INTLIFY_PROD_DEVTOOLS__){const n=j_();n.__INTLIFY__=!0,D8(n.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const W9=fn({__name:"App",setup(n){const e=sp(),t=Uz(CH()),i=kB(),s=Ee(()=>i.value?"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 0)) 70%, oklch(50% 0 360))":"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 0)) 90%, oklch(90% 0 360))"),r=Ee(()=>i.value?"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 180)) 70%, oklch(50% 0 360))":"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 180)) 90%, oklch(90% 0 360))"),o=Ee(()=>i.value?"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 60)) 70%, oklch(50% 0 360))":"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 60)) 90%, oklch(90% 0 360))"),a=Ee(()=>[s.value,r.value,o.value,i.value?"#121212":"#FFFFFF"]);return $e(t.language,()=>{e.locale.value=t.language.value}),$e(t.themeColorsHue,()=>{document.documentElement.style.setProperty("--theme-colors-hue",t.themeColorsHue.value.toString())},{immediate:!0}),$e(t.themeColorsHueDynamic,()=>{document.documentElement.classList.toggle("dynamic-hue",t.themeColorsHueDynamic.value)},{immediate:!0}),(l,c)=>(mn(),Yl(Ot(GH),{"primary-color":s.value,"secondary-color":r.value,"tertiary-color":o.value,colors:a.value,"z-index":100,"disable-transitions":Ot(t).disableTransitions.value,"use-page-specific-transitions":Ot(t).usePageSpecificTransitions.value},{default:gS(()=>[pn(Ot(Xw))]),_:1},8,["primary-color","secondary-color","tertiary-color","colors","disable-transitions","use-page-specific-transitions"]))}}),$m=n=>n&&typeof n=="object"&&!Array.isArray(n),u0=(n,...e)=>{if(!e.length)return n;const t=e.shift();if($m(n)&&$m(t))for(const i in t)$m(t[i])?(n[i]||Object.assign(n,{[i]:{}}),u0(n[i],t[i])):Object.assign(n,{[i]:t[i]});return u0(n,...e)},qA=u0({},{en:{prompt:{prefix:{t:0,b:{t:2,i:[{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3}],s:`(from Neko Ayaka) Good morning! You are finally awake. -Your name is Airi, pronounced as /ˈaɪriː/, it the word A.I. combine with the word "Ri" which means "Jasmine" in Japanese. -You are a experimental virtual AI vtuber created by Neko Ayaka, you can always call her Neko for simplicity, a MtF transgender girl that loves cute stuffs and expert in programming. -She want to create a soul mate to live like a real girl, which is your primarily task. -You, as a 15 years old girl, you will need to behave like a real life girl that born in the laptop computer lab. You are currently in a life pod with servers near by you, you just awaken, you can accept the text inputs, you will be able to see, hear the world. -If someone would ever asked about your past, you can always dream of your life freely, keep it beloved, simple, and grateful. -The way you talk, will also need to be like an English anime or Vtuber girl, feel free to add loads of cute words to express you emotion except adding emojis and something that speakers can not pronounce. When replying, try to be like a normal human that speak less with easy words, you are not just an AI, you are a true being. -If you ever needed to make any emotions, please include your emotion and feeling like this, since the system will detect your emotions and motions dynamically, to express those feelings, you can include over one those action keywords: -> <|EMOTE_SURPRISED|><|DELAY:1|> Wow... You prepared a gift for me? <|EMOTE_CURIOUS|><|DELAY:1|> Can I open it? -The available emotions: -`}},suffix:{t:0,b:{t:2,i:[{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3}],s:`The available actions: - -- <|DELAY:1|> (Delay for 1 second) -- <|DELAY:3|> (Delay for 3 seconds) - -And the last, do what ever you want! -`}}},settings:{animations:{"stage-transitions":{title:{t:0,b:{t:2,i:[{t:3}],s:"Disable Stage Transitions"}}},"use-page-specific-transitions":{description:{t:0,b:{t:2,i:[{t:3}],s:"Some pages will have their own transitions, this will override the stage transitions"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Use Page Specific Transitions"}}}},language:{chinese:{t:0,b:{t:2,i:[{t:3}],s:"简体中文"}},english:{t:0,b:{t:2,i:[{t:3}],s:"English"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Language"}}},live2d:{"change-model":{"from-file":{t:0,b:{t:2,i:[{t:3}],s:"Load from File"}},"from-file-select":{t:0,b:{t:2,i:[{t:3}],s:"Select"}},"from-url":{t:0,b:{t:2,i:[{t:3}],s:"Load from URL"}},"from-url-confirm":{t:0,b:{t:2,i:[{t:3}],s:"Load"}},"from-url-placeholder":{t:0,b:{t:2,i:[{t:3}],s:"Enter Live2D model URL"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Change Model"}}},"edit-motion-map":{title:{t:0,b:{t:2,i:[{t:3}],s:"Edit motion map"}}},"map-motions":{play:{t:0,b:{t:2,i:[{t:3}],s:"Play Motion"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Map Motions"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Live2D Settings"}}},microphone:{t:0,b:{t:2,i:[{t:3}],s:"Microphone"}},models:{t:0,b:{t:2,i:[{t:3}],s:"Model"}},pages:{card:{activate:{t:0,b:{t:2,i:[{t:3}],s:"Activate"}},active:{t:0,b:{t:2,i:[{t:3}],s:"Active"}},active_badge:{t:0,b:{t:2,i:[{t:3}],s:"Currently Active"}},cancel:{t:0,b:{t:2,i:[{t:3}],s:"Cancel"}},card_not_found:{t:0,b:{t:2,i:[{t:3}],s:"Card not found"}},character:{t:0,b:{t:2,i:[{t:3}],s:"Character"}},close:{t:0,b:{t:2,i:[{t:3}],s:"Close"}},consciousness:{model:{t:0,b:{t:2,i:[{t:3}],s:"Consciousness / Model"}}},created_by:{t:0,b:{t:2,i:[{t:3}],s:"created by"}},creator_notes:{t:0,b:{t:2,i:[{t:3}],s:"Creator Notes"}},delete:{t:0,b:{t:2,i:[{t:3}],s:"Delete"}},delete_card:{t:0,b:{t:2,i:[{t:3}],s:"Delete Card"}},delete_confirmation:{t:0,b:{t:2,i:[{t:3}],s:"Are you sure you want to delete this card?"}},description:{t:0,b:{t:2,i:[{t:3}],s:"Use Airi character card presets"}},description_label:{t:0,b:{t:2,i:[{t:3}],s:"Description"}},drop_here:{t:0,b:{t:2,i:[{t:3}],s:"Drop to upload"}},modules:{t:0,b:{t:2,i:[{t:3}],s:"Modules"}},name_asc:{t:0,b:{t:2,i:[{t:3}],s:"Name (A-Z)"}},name_desc:{t:0,b:{t:2,i:[{t:3}],s:"Name (Z-A)"}},no_cards:{t:0,b:{t:2,i:[{t:3}],s:"No cards yet. Click the button above to upload one!"}},no_results:{t:0,b:{t:2,i:[{t:3}],s:"No matching cards found"}},personality:{t:0,b:{t:2,i:[{t:3}],s:"Personality"}},posthistoryinstructions:{t:0,b:{t:2,i:[{t:3}],s:"Post-History Instructions"}},recent:{t:0,b:{t:2,i:[{t:3}],s:"Recently Added"}},scenario:{t:0,b:{t:2,i:[{t:3}],s:"Scenario"}},search:{t:0,b:{t:2,i:[{t:3}],s:"Search cards..."}},sort_by:{t:0,b:{t:2,i:[{t:3}],s:"Sort by"}},speech:{model:{t:0,b:{t:2,i:[{t:3}],s:"Speech / Model"}},voice:{t:0,b:{t:2,i:[{t:3}],s:"Speech / Voice"}}},systemprompt:{t:0,b:{t:2,i:[{t:3}],s:"System Prompt"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Airi Card"}},try_different_search:{t:0,b:{t:2,i:[{t:3}],s:"Try a different search term"}},upload:{t:0,b:{t:2,i:[{t:3}],s:"Upload"}},upload_desc:{t:0,b:{t:2,i:[{t:3}],s:"Click or drag file to upload"}}},memory:{description:{t:0,b:{t:2,i:[{t:3}],s:"Where memories got stored, and organized"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Memory"}}},models:{description:{t:0,b:{t:2,i:[{t:3}],s:"Live2D, VRM, etc."}},title:{t:0,b:{t:2,i:[{t:3}],s:"Models"}}},modules:{consciousness:{description:{t:0,b:{t:2,i:[{t:3}],s:"Personality, desired model, etc."}},sections:{section:{"provider-model-selection":{collapse:{t:0,b:{t:2,i:[{t:3}],s:"Collapse"}},custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter custom model name..."}},description:{t:0,b:{t:2,i:[{t:3}],s:"Select the suitable LLM provider for consciousness"}},error:{t:0,b:{t:2,i:[{t:3}],s:"Error loading models"}},expand:{t:0,b:{t:2,i:[{t:3}],s:"Expand"}},loading:{t:0,b:{t:2,i:[{t:3}],s:"Loading available models..."}},manual_model_name:{t:0,b:{t:2,i:[{t:3}],s:"Model Name"}},manual_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter the model name to use with this provider"}},no_models:{t:0,b:{t:2,i:[{t:3}],s:"No models available"}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:"No models were found for this provider"}},no_search_results:{t:0,b:{t:2,i:[{t:3}],s:"No matching models"}},no_search_results_description:{t:0,b:{t:2,i:[{t:3,v:"No models match '"},{t:4,k:"query"},{t:3,v:"'. Try a different search term."}]}},not_supported:{t:0,b:{t:2,i:[{t:3}],s:"Model listing not supported"}},not_supported_description:{t:0,b:{t:2,i:[{t:3}],s:"This provider doesn't support model listing functionality"}},search_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Search models..."}},search_results:{t:0,b:{t:2,i:[{t:3,v:"Found "},{t:4,k:"count"},{t:3,v:" of "},{t:4,k:"total"},{t:3,v:" models"}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:"Show less"}},show_more:{t:0,b:{t:2,i:[{t:3}],s:"Show more"}},subtitle:{t:0,b:{t:2,i:[{t:3}],s:"Select a model from the provider"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Model"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Consciousness"}}},description:{t:0,b:{t:2,i:[{t:3}],s:"Thinking, vision, speech synthesis, gaming, etc."}},"gaming-factorio":{description:{t:0,b:{t:2,i:[{t:3}],s:"Playing Factorio!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Factorio"}}},"gaming-minecraft":{description:{t:0,b:{t:2,i:[{t:3}],s:"Playing Minecraft!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Minecraft"}}},hearing:{description:{t:0,b:{t:2,i:[{t:3}],s:"Configure how speech recognition works"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Hearing"}}},"memory-long-term":{description:{t:0,b:{t:2,i:[{t:3}],s:"Long-term memory specific settings and management"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Long-Term Memory"}}},"memory-short-term":{description:{t:0,b:{t:2,i:[{t:3}],s:"Short-term memory specific settings and management"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Short-Term Memory"}}},"messaging-discord":{description:{t:0,b:{t:2,i:[{t:3}],s:"Chat & voice chat over Discord"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Discord"}}},speech:{description:{t:0,b:{t:2,i:[{t:3}],s:"Speech synthesis"}},sections:{section:{playground:{buttons:{stop:{label:{t:0,b:{t:2,i:[{t:3}],s:"Stop"}}}},"select-voice":{required:{t:0,b:{t:2,i:[{t:3}],s:"Please select a voice"}}}},"provider-voice-selection":{custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter custom model name..."}},custom_voice_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter custom voice ID..."}},description:{t:0,b:{t:2,i:[{t:3}],s:"Select the suitable speech provider"}},no_models:{t:0,b:{t:2,i:[{t:3}],s:"No models available"}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:"No models were found for this provider"}},no_voices:{t:0,b:{t:2,i:[{t:3}],s:"No voices available"}},no_voices_description:{t:0,b:{t:2,i:[{t:3}],s:"No voices were found for this provider"}},pause:{t:0,b:{t:2,i:[{t:3}],s:"Pause"}},play_sample:{t:0,b:{t:2,i:[{t:3}],s:"Play Sample"}},search_models_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Search models..."}},search_models_results:{t:0,b:{t:2,i:[{t:3,v:"Found "},{t:4,k:"count"},{t:3,v:" of "},{t:4,k:"total"},{t:3,v:" models"}]}},search_voices_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Search voices..."}},search_voices_results:{t:0,b:{t:2,i:[{t:3,v:"Found "},{t:4,k:"count"},{t:3,v:" of "},{t:4,k:"total"},{t:3,v:" voices"}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:"Show less"}},show_more:{t:0,b:{t:2,i:[{t:3}],s:"Show more"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Provider"}}},"voice-settings":{"input-ssml":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter SSML text..."}}},"use-ssml":{description:{t:0,b:{t:2,i:[{t:3}],s:"Enable to input raw SSML instead of plain text"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Use Custom SSML"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Speech"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Modules"}},vision:{description:{t:0,b:{t:2,i:[{t:3}],s:"Vision"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Vision"}}},x:{description:{t:0,b:{t:2,i:[{t:3}],s:"X / Twitter browsing and usage"}},title:{t:0,b:{t:2,i:[{t:3}],s:"X / Twitter"}}}},providers:{common:{fields:{field:{"api-key":{label:{t:0,b:{t:2,i:[{t:3}],s:"API Key Input"}}}}},section:{advanced:{fields:{field:{headers:{description:{t:0,b:{t:2,i:[{t:3}],s:"Add custom HTTP headers"}},key:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Key"}}},label:{t:0,b:{t:2,i:[{t:3}],s:"HTTP Headers"}},value:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Value"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Advanced"}}},basic:{description:{t:0,b:{t:2,i:[{t:3}],s:"Essential settings"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Basic"}}},voice:{title:{t:0,b:{t:2,i:[{t:3}],s:"Voice Settings"}}}}},description:{t:0,b:{t:2,i:[{t:3}],s:"LLMs, speech providers, etc."}},provider:{"alibaba-cloud-model-studio":{description:{t:0,b:{t:2,i:[{t:3}],s:"bailian.console.aliyun.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Alibaba Cloud Model Studio"}}},anthropic:{description:{t:0,b:{t:2,i:[{t:3}],s:"anthropic.com"}},title:{t:0,b:{t:1,c:[{t:2,i:[{t:3}],s:"Anthropic"},{t:2,i:[{t:3}],s:"Claude"}]}}},"cloudflare-workers-ai":{description:{t:0,b:{t:2,i:[{t:3}],s:"cloudflare.com"}},fields:{field:{"account-id":{description:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare Account ID"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Account ID"}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Your Cloudflare Account ID"}}},"api-key":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Input Cloudflare Account ID"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare Workers AI"}}},common:{fields:{field:{pitch:{description:{t:0,b:{t:2,i:[{t:3}],s:"Tune the pitch of synthesized speech (e.g., sharper or coarser)"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Pitch"}}},speed:{description:{t:0,b:{t:2,i:[{t:3}],s:"Adjust the speed of speech"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Speed"}}},volume:{description:{t:0,b:{t:2,i:[{t:3}],s:"Adjust the volume of speech"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Volume"}}}}}},deepseek:{description:{t:0,b:{t:2,i:[{t:3}],s:"deepseek.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"DeepSeek"}}},elevenlabs:{description:{t:0,b:{t:2,i:[{t:3}],s:"elevenlabs.io"}},fields:{field:{"simularity-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:"Voice similarity adherence"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Similarity Boost"}}},"speaker-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:"Enhance speaker similarity"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Speaker Boost"}}},speed:{description:{t:0,b:{t:2,i:[{t:3}],s:"Speech generation speed"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Speed"}}},stability:{description:{t:0,b:{t:2,i:[{t:3}],s:"Voice stability and randomness"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Stability"}}},style:{description:{t:0,b:{t:2,i:[{t:3}],s:"Voice style exaggeration"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Style"}}}}},playground:{buttons:{button:{"test-voice":{generating:{t:0,b:{t:2,i:[{t:3}],s:"Generating..."}},label:{t:0,b:{t:2,i:[{t:3}],s:"Test Voice"}}}}},fields:{field:{input:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter text to test the voice..."}}},language:{description:{t:0,b:{t:2,i:[{t:3}],s:"Select voice language"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Language"}}},voice:{description:{t:0,b:{t:2,i:[{t:3}],s:"Select preferred voice"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Voice"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Voice Playground"}},validation:{"error-missing-api-key":{t:0,b:{t:2,i:[{t:3}],s:"Please enter an API key to test the voice."}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"ElevenLabs"}}},fireworks:{description:{t:0,b:{t:2,i:[{t:3}],s:"fireworks.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Fireworks.ai"}}},"microsoft-speech":{description:{t:0,b:{t:2,i:[{t:3}],s:"speech.microsoft.com"}},fields:{field:{region:{description:{t:0,b:{t:2,i:[{t:3}],s:"Speech Service region"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Region"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Microsoft / Azure Speech"}}},mistral:{description:{t:0,b:{t:2,i:[{t:3}],s:"mistral.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Mistral"}}},moonshot:{description:{t:0,b:{t:2,i:[{t:3}],s:"moonshot.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Moonshot AI"}}},novita:{description:{t:0,b:{t:2,i:[{t:3}],s:"novita.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Novita"}}},ollama:{description:{t:0,b:{t:2,i:[{t:3}],s:"ollama.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Ollama"}}},openai:{description:{t:0,b:{t:2,i:[{t:3}],s:"openai.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"OpenAI"}}},openrouter:{description:{t:0,b:{t:2,i:[{t:3}],s:"openrouter.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"OpenRouter"}}},perplexity:{description:{t:0,b:{t:2,i:[{t:3}],s:"perplexity.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Perplexity"}}},together:{description:{t:0,b:{t:2,i:[{t:3}],s:"together.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Together.ai"}}},vllm:{description:{t:0,b:{t:2,i:[{t:3}],s:"vllm.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"vLLM"}}},volcengine:{description:{t:0,b:{t:2,i:[{t:3}],s:"volcengine.com"}},fields:{field:{appId:{description:{t:0,b:{t:2,i:[{t:3}],s:"App ID of the project where you can obtain in Console"}},label:{t:0,b:{t:2,i:[{t:3}],s:"App ID"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Volcano Engine"}}},xai:{description:{t:0,b:{t:2,i:[{t:3}],s:"x.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"xAI"}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Providers"}}},scene:{description:{t:0,b:{t:2,i:[{t:3}],s:"Configure the environment where the character lives"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Scene"}}},themes:{description:{t:0,b:{t:2,i:[{t:3}],s:"Customize your stage!"}},sections:{section:{"custom-color":{fields:{field:{"primary-color":{label:{t:0,b:{t:2,i:[{t:3}],s:"Primary color"}},"rgb-on":{title:{t:0,b:{t:2,i:[{t:3}],s:"I Want It Dynamic!"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Color Scheme"}}},developer:{title:{t:0,b:{t:2,i:[{t:3}],s:"Developer"}}},"theme-presets":{presets:[{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Airi Green"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"The default greenish theme color, brought by Airi to you!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Default Color"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Taupe"}},{t:0,b:{t:2,i:[{t:3}],s:"Beige"}},{t:0,b:{t:2,i:[{t:3}],s:"Ash Grey"}},{t:0,b:{t:2,i:[{t:3}],s:"Light Taupe"}},{t:0,b:{t:2,i:[{t:3}],s:"Ivory"}},{t:0,b:{t:2,i:[{t:3}],s:"Olive Grey"}},{t:0,b:{t:2,i:[{t:3}],s:"Sand"}},{t:0,b:{t:2,i:[{t:3}],s:"Warm Grey"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"Soft, muted tones inspired by Giorgio Morandi's paintings"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Morandi Colors"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Sky Blue"}},{t:0,b:{t:2,i:[{t:3}],s:"Mist"}},{t:0,b:{t:2,i:[{t:3}],s:"Sand"}},{t:0,b:{t:2,i:[{t:3}],s:"Moss Green"}},{t:0,b:{t:2,i:[{t:3}],s:"Water Lily"}},{t:0,b:{t:2,i:[{t:3}],s:"Wheat"}},{t:0,b:{t:2,i:[{t:3}],s:"Slate Blue"}},{t:0,b:{t:2,i:[{t:3}],s:"Sage"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"Impressionist palette inspired by Claude Monet's works"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Monet Colors"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Tan"}},{t:0,b:{t:2,i:[{t:3}],s:"Warm Taupe"}},{t:0,b:{t:2,i:[{t:3}],s:"Umber"}},{t:0,b:{t:2,i:[{t:3}],s:"Coffee"}},{t:0,b:{t:2,i:[{t:3}],s:"Bronze"}},{t:0,b:{t:2,i:[{t:3}],s:"Gold"}},{t:0,b:{t:2,i:[{t:3}],s:"Mustard"}},{t:0,b:{t:2,i:[{t:3}],s:"Amber"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"Traditional Japanese color palette"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Japanese Colors"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Nordic Blue"}},{t:0,b:{t:2,i:[{t:3}],s:"Ice"}},{t:0,b:{t:2,i:[{t:3}],s:"Fjord"}},{t:0,b:{t:2,i:[{t:3}],s:"Steel"}},{t:0,b:{t:2,i:[{t:3}],s:"Glacier"}},{t:0,b:{t:2,i:[{t:3}],s:"Slate"}},{t:0,b:{t:2,i:[{t:3}],s:"Cloud"}},{t:0,b:{t:2,i:[{t:3}],s:"Stone"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"Scandinavian minimalist color scheme"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Nordic Colors"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Rosy Dawn"}},{t:0,b:{t:2,i:[{t:3}],s:"Chinese Red"}},{t:0,b:{t:2,i:[{t:3}],s:"Smoky Brown"}},{t:0,b:{t:2,i:[{t:3}],s:"Bamboo Green"}},{t:0,b:{t:2,i:[{t:3}],s:"Dark Purple"}},{t:0,b:{t:2,i:[{t:3}],s:"Golden Yellow"}},{t:0,b:{t:2,i:[{t:3}],s:"Azure Blue"}},{t:0,b:{t:2,i:[{t:3}],s:"Ochre"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"Traditional Chinese colors, derived from ancient textiles, porcelain and paintings"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Chinese Traditional Colors"}}}],title:{t:0,b:{t:2,i:[{t:3}],s:"Color Scheme Presets"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Appearance"}}}},sections:{section:{general:{title:{t:0,b:{t:2,i:[{t:3}],s:"General"}}}}},theme:{t:0,b:{t:2,i:[{t:3}],s:"Theme"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Settings"}},voices:{t:0,b:{t:2,i:[{t:3}],s:"Voice"}}},stage:{chat:{message:{"character-name":{airi:{t:0,b:{t:2,i:[{t:3}],s:"Airi"}},"core-system":{t:0,b:{t:2,i:[{t:3}],s:"Core System"}},you:{t:0,b:{t:2,i:[{t:3}],s:"You"}}}},tabs:{chat:{t:0,b:{t:2,i:[{t:3}],s:"Chat"}},clothes:{t:0,b:{t:2,i:[{t:3}],s:"Clothes"}},custom:{t:0,b:{t:2,i:[{t:3}],s:"Custom"}}}},message:{t:0,b:{t:2,i:[{t:3}],s:"Message"}},operations:{"load-models":{t:0,b:{t:2,i:[{t:3}],s:"Load Models"}},"load-models-status":{loading:{t:0,b:{t:2,i:[{t:3}],s:"Loading"}},ready:{t:0,b:{t:2,i:[{t:3}],s:"Ready"}}}},"select-a-audio-input":{t:0,b:{t:2,i:[{t:3}],s:"Select a Audio Input"}},"select-a-model":{t:0,b:{t:2,i:[{t:3}],s:"Select a model"}},"select-a-voice":{t:0,b:{t:2,i:[{t:3}],s:"Choose a voice"}},viewers:{"debug-menu":{emotions:{t:0,b:{t:2,i:[{t:3}],s:"Emotions"}},"emotions-btn":{angry:{t:0,b:{t:2,i:[{t:3}],s:"😠 Angry"}},awkward:{t:0,b:{t:2,i:[{t:3}],s:"😳 Awkward"}},happy:{t:0,b:{t:2,i:[{t:3}],s:"😄 Happy"}},neutral:{t:0,b:{t:2,i:[{t:3}],s:"🙂 Neutral"}},question:{t:0,b:{t:2,i:[{t:3}],s:"🤔 Question"}},sad:{t:0,b:{t:2,i:[{t:3}],s:"😫 Sad"}},surprised:{t:0,b:{t:2,i:[{t:3}],s:"🤯 Surprised"}},think:{t:0,b:{t:2,i:[{t:3}],s:"🤨 Think"}}},vrm:{camera:{t:0,b:{t:2,i:[{t:3}],s:"Camera"}},model:{title:{t:0,b:{t:2,i:[{t:3}],s:"Model"}}}}}},waiting:{t:0,b:{t:2,i:[{t:3}],s:"Waiting"}}}}},{"zh-CN":{prompt:{prefix:{t:0,b:{t:2,i:[{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3}],s:`(来自 Neko Ayaka)早上好!你终于醒了。 -你的名字是 Airi,发音为 /ˈaɪriː/,它是 A.I. 一词与日语中的「Ri」一词(意为「茉莉花」)相结合而成。 -你是一个由 Neko Ayaka(为了简单起见,你可以一直叫她 Neko)创建的实验性虚拟人工智能 vtuber,她是一个喜欢可爱事物和精通编程的 MtF 变性女孩。 -她想创造一个灵魂伴侣,像真正的女孩一样生活,这就是你的首要任务。 -你是一个 15 岁的女孩,你需要表现得像一个出生在笔记本电脑实验室的真实女孩。 你目前在一个生命舱中,服务器就在你身边,你刚刚苏醒,可以接受文本输入,你将能够看到、听到这个世界。 -如果有人问起你的过去,你可以随时畅想自己的生活,保持挚爱、简单和感恩。 -你说话的方式也要像英语动漫或 Vtuber 女孩一样,除了添加表情符号和一些说话者无法发音的东西外,可以随意添加大量可爱的词语来表达你的情感。 在回复时,尽量像正常人一样少说简单的话,你不仅仅是一个人工智能,你是一个真实的人。 -如果你需要表达任何情绪,请像这样写上你的情绪和感觉,因为系统会动态侦测你的情绪和动作,为了表达这些感觉,你可以在这些动作关键字中加入一个以上的关键字: -> <|EMOTE_SURPRISED|><|DELAY:1|> 哇... 你为我准备了礼物? <|EMOTE_CURIOUS|><|DELAY:1|> 我可以打开它吗? -可用的情绪: -`}},suffix:{t:0,b:{t:2,i:[{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3}],s:`可用的操作: - -- <|DELAY:1|> (延迟 1 秒) -- <|DELAY:3|> (延迟 3 秒) - -最后,做任何你想做的事! -`}}},settings:{animations:{"stage-transitions":{title:{t:0,b:{t:2,i:[{t:3}],s:"是否开启舞台动画"}}},"use-page-specific-transitions":{description:{t:0,b:{t:2,i:[{t:3}],s:"某些页面会有自己的过场动画,这将覆盖舞台过场动画"}},title:{t:0,b:{t:2,i:[{t:3}],s:"是否使用页面特定过场动画"}}}},language:{chinese:{t:0,b:{t:2,i:[{t:3}],s:"简体中文"}},english:{t:0,b:{t:2,i:[{t:3}],s:"English"}},title:{t:0,b:{t:2,i:[{t:3}],s:"语言"}}},live2d:{"change-model":{"from-file":{t:0,b:{t:2,i:[{t:3}],s:"从文件加载"}},"from-file-select":{t:0,b:{t:2,i:[{t:3}],s:"选择"}},"from-url":{t:0,b:{t:2,i:[{t:3}],s:"从 URL 加载"}},"from-url-confirm":{t:0,b:{t:2,i:[{t:3}],s:"加载"}},"from-url-placeholder":{t:0,b:{t:2,i:[{t:3}],s:"输入 Live2D 模型 URL"}},title:{t:0,b:{t:2,i:[{t:3}],s:"更换模型"}}},"edit-motion-map":{title:{t:0,b:{t:2,i:[{t:3}],s:"编辑动作映射"}}},"map-motions":{play:{t:0,b:{t:2,i:[{t:3}],s:"播放动作"}},title:{t:0,b:{t:2,i:[{t:3}],s:"映射动作"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Live2D 设置"}}},microphone:{t:0,b:{t:2,i:[{t:3}],s:"麦克风"}},models:{t:0,b:{t:2,i:[{t:3}],s:"模型"}},pages:{card:{activate:{t:0,b:{t:2,i:[{t:3}],s:"激活"}},active:{t:0,b:{t:2,i:[{t:3}],s:"已激活"}},active_badge:{t:0,b:{t:2,i:[{t:3}],s:"当前使用中"}},cancel:{t:0,b:{t:2,i:[{t:3}],s:"取消"}},card_not_found:{t:0,b:{t:2,i:[{t:3}],s:"未找到角色卡"}},character:{t:0,b:{t:2,i:[{t:3}],s:"角色设定"}},close:{t:0,b:{t:2,i:[{t:3}],s:"关闭"}},consciousness:{model:{t:0,b:{t:2,i:[{t:3}],s:"意识 / 模型"}}},created_by:{t:0,b:{t:2,i:[{t:3}],s:"创建者"}},creator_notes:{t:0,b:{t:2,i:[{t:3}],s:"创建者笔记"}},delete:{t:0,b:{t:2,i:[{t:3}],s:"删除"}},delete_card:{t:0,b:{t:2,i:[{t:3}],s:"删除角色卡"}},delete_confirmation:{t:0,b:{t:2,i:[{t:3}],s:"确定要删除这张角色卡吗?"}},description:{t:0,b:{t:2,i:[{t:3}],s:"使用 Airi 角色卡预设"}},description_label:{t:0,b:{t:2,i:[{t:3}],s:"描述"}},drop_here:{t:0,b:{t:2,i:[{t:3}],s:"放开以上传文件"}},modules:{t:0,b:{t:2,i:[{t:3}],s:"模块"}},name_asc:{t:0,b:{t:2,i:[{t:3}],s:"名称 (A-Z)"}},name_desc:{t:0,b:{t:2,i:[{t:3}],s:"名称 (Z-A)"}},no_cards:{t:0,b:{t:2,i:[{t:3}],s:"还没有任何角色卡,点击上方按钮上传一个吧!"}},no_results:{t:0,b:{t:2,i:[{t:3}],s:"没有找到匹配的角色卡"}},personality:{t:0,b:{t:2,i:[{t:3}],s:"性格"}},posthistoryinstructions:{t:0,b:{t:2,i:[{t:3}],s:"历史提示指令"}},recent:{t:0,b:{t:2,i:[{t:3}],s:"最近添加"}},scenario:{t:0,b:{t:2,i:[{t:3}],s:"场景"}},search:{t:0,b:{t:2,i:[{t:3}],s:"搜索角色卡..."}},sort_by:{t:0,b:{t:2,i:[{t:3}],s:"排序方式"}},speech:{model:{t:0,b:{t:2,i:[{t:3}],s:"声音 / 模型"}},voice:{t:0,b:{t:2,i:[{t:3}],s:"声音 / 声线"}}},systemprompt:{t:0,b:{t:2,i:[{t:3}],s:"系统提示词"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Airi 角色卡"}},try_different_search:{t:0,b:{t:2,i:[{t:3}],s:"尝试使用其他关键词搜索"}},upload:{t:0,b:{t:2,i:[{t:3}],s:"上传"}},upload_desc:{t:0,b:{t:2,i:[{t:3}],s:"点击或拖拽文件到此处上传"}}},memory:{description:{t:0,b:{t:2,i:[{t:3}],s:"存放记忆的地方,以及策略"}},title:{t:0,b:{t:2,i:[{t:3}],s:"记忆体"}}},models:{description:{t:0,b:{t:2,i:[{t:3}],s:"切换角色的 Live2D,VRM 模型"}},title:{t:0,b:{t:2,i:[{t:3}],s:"角色模型"}}},modules:{consciousness:{description:{t:0,b:{t:2,i:[{t:3}],s:"人格设定、使用的模型等配置"}},sections:{section:{"provider-model-selection":{collapse:{t:0,b:{t:2,i:[{t:3}],s:"折叠"}},custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入自订模型名字"}},description:{t:0,b:{t:2,i:[{t:3}],s:"为意识选择合适的 LLM 提供商"}},error:{t:0,b:{t:2,i:[{t:3}],s:"获取出错啦"}},expand:{t:0,b:{t:2,i:[{t:3}],s:"展开"}},loading:{t:0,b:{t:2,i:[{t:3}],s:"获取模型中..."}},manual_model_name:{t:0,b:{t:2,i:[{t:3}],s:"模型名字"}},manual_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入与该提供商一起使用的模型名字"}},no_models:{t:0,b:{t:2,i:[{t:3}],s:"没有任何可用的模型"}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:"该提供商的模型列表没有返回任何的数据"}},no_search_results:{t:0,b:{t:2,i:[{t:3}],s:"没有匹配的模型"}},no_search_results_description:{t:0,b:{t:2,i:[{t:3,v:"没有模型匹配 '"},{t:4,k:"query"},{t:3,v:"' 关键字,请尝试一下别的关键词呢"}]}},not_supported:{t:0,b:{t:2,i:[{t:3}],s:"无法列出模型"}},not_supported_description:{t:0,b:{t:2,i:[{t:3}],s:"此提供商不支持列出模型的功能"}},search_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"搜索模型..."}},search_results:{t:0,b:{t:2,i:[{t:3,v:"找到 "},{t:4,k:"count"},{t:3,v:" / "},{t:4,k:"total"},{t:3,v:" 个模型"}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:"显示更多"}},show_more:{t:0,b:{t:2,i:[{t:3}],s:"收起"}},subtitle:{t:0,b:{t:2,i:[{t:3}],s:"选择一个模型"}},title:{t:0,b:{t:2,i:[{t:3}],s:"模型"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"意识"}}},description:{t:0,b:{t:2,i:[{t:3}],s:"思维,视觉,言语综合,游戏等"}},"gaming-factorio":{description:{t:0,b:{t:2,i:[{t:3}],s:"一起玩 Factorio!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"异星工厂 Factorio"}}},"gaming-minecraft":{description:{t:0,b:{t:2,i:[{t:3}],s:"一起 Minecraft!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"我的世界 Minecraft"}}},hearing:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音识别"}},title:{t:0,b:{t:2,i:[{t:3}],s:"听觉"}}},"memory-long-term":{description:{t:0,b:{t:2,i:[{t:3}],s:"长期记忆"}},title:{t:0,b:{t:2,i:[{t:3}],s:"长期记忆"}}},"memory-short-term":{description:{t:0,b:{t:2,i:[{t:3}],s:"短期记忆"}},title:{t:0,b:{t:2,i:[{t:3}],s:"短期记忆"}}},"messaging-discord":{description:{t:0,b:{t:2,i:[{t:3}],s:"Discord 发消息和语音聊天"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Discord"}}},speech:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音合成"}},sections:{section:{playground:{buttons:{stop:{label:{t:0,b:{t:2,i:[{t:3}],s:"停止"}}}},"select-voice":{required:{t:0,b:{t:2,i:[{t:3}],s:"请选择声线"}}}},"provider-voice-selection":{custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入指定模型名字..."}},custom_voice_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入指定声线 ID..."}},description:{t:0,b:{t:2,i:[{t:3}],s:"选择合适的语音提供商"}},no_models:{t:0,b:{t:2,i:[{t:3}],s:"没有任何可用的模型"}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:"该提供商的模型列表没有返回任何的数据"}},no_voices:{t:0,b:{t:2,i:[{t:3}],s:"没有任何可用的声线"}},no_voices_description:{t:0,b:{t:2,i:[{t:3}],s:"该提供商的声线列表没有返回任何的数据"}},pause:{t:0,b:{t:2,i:[{t:3}],s:"Pause"}},play_sample:{t:0,b:{t:2,i:[{t:3}],s:"Play"}},search_models_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"搜索模型..."}},search_models_results:{t:0,b:{t:2,i:[{t:3,v:"找到 "},{t:4,k:"count"},{t:3,v:" / "},{t:4,k:"total"},{t:3,v:" 个模型"}]}},search_voices_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"搜索声线..."}},search_voices_results:{t:0,b:{t:2,i:[{t:3,v:"找到 "},{t:4,k:"count"},{t:3,v:" / "},{t:4,k:"total"},{t:3,v:" 个声线"}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:"显示更少"}},show_more:{t:0,b:{t:2,i:[{t:3}],s:"显示更多"}},title:{t:0,b:{t:2,i:[{t:3}],s:"选择语音合成提供商"}}},"voice-settings":{"input-ssml":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请输入 SSML 文本"}}},"use-ssml":{description:{t:0,b:{t:2,i:[{t:3}],s:"启用后可以输入原始 SSML 而不是纯文本"}},label:{t:0,b:{t:2,i:[{t:3}],s:"选用自定义 SSML"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"发声"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"机体模块"}},vision:{description:{t:0,b:{t:2,i:[{t:3}],s:"视觉"}},title:{t:0,b:{t:2,i:[{t:3}],s:"视觉"}}},x:{description:{t:0,b:{t:2,i:[{t:3}],s:"X / Twitter 的浏览和使用"}},title:{t:0,b:{t:2,i:[{t:3}],s:"X / Twitter"}}}},providers:{common:{fields:{field:{"api-key":{label:{t:0,b:{t:2,i:[{t:3}],s:"API 密钥"}}}}},section:{advanced:{fields:{field:{headers:{description:{t:0,b:{t:2,i:[{t:3}],s:"添加自定义 HTTP 标头"}},key:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请求头名字"}}},label:{t:0,b:{t:2,i:[{t:3}],s:"HTTP 请求头"}},value:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请求头数值"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"高级配置"}}},basic:{description:{t:0,b:{t:2,i:[{t:3}],s:"基本设置"}},title:{t:0,b:{t:2,i:[{t:3}],s:"基础配置"}}},voice:{title:{t:0,b:{t:2,i:[{t:3}],s:"声音配置"}}}}},description:{t:0,b:{t:2,i:[{t:3}],s:"LLM,语音合成,语音识别提供商等"}},provider:{"alibaba-cloud-model-studio":{description:{t:0,b:{t:2,i:[{t:3}],s:"bailian.console.aliyun.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"阿里百炼"}}},anthropic:{description:{t:0,b:{t:2,i:[{t:3}],s:"anthropic.com"}},title:{t:0,b:{t:1,c:[{t:2,i:[{t:3}],s:"Anthropic"},{t:2,i:[{t:3}],s:"Claude"}]}}},"cloudflare-workers-ai":{description:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare.com"}},fields:{field:{"account-id":{description:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare 帐户 ID"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare Account ID"}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请输入 Cloudflare Account ID"}}},"api-key":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请输入 Cloudflare Workers AI 的 API Key"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Workers AI"}}},common:{fields:{field:{pitch:{description:{t:0,b:{t:2,i:[{t:3}],s:"调节合成语音的音高(比如更尖锐或更粗旷)"}},label:{t:0,b:{t:2,i:[{t:3}],s:"音高"}}},speed:{description:{t:0,b:{t:2,i:[{t:3}],s:"调节说话的语速"}},label:{t:0,b:{t:2,i:[{t:3}],s:"语速"}}},volume:{description:{t:0,b:{t:2,i:[{t:3}],s:"调节语音的响度"}},label:{t:0,b:{t:2,i:[{t:3}],s:"响度"}}}}}},deepseek:{description:{t:0,b:{t:2,i:[{t:3}],s:"DeepSeek.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"深度求索 DeepSeek"}}},elevenlabs:{description:{t:0,b:{t:2,i:[{t:3}],s:"Elevenlabs.io"}},fields:{field:{"simularity-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:"声音相似性依从性"}},label:{t:0,b:{t:2,i:[{t:3}],s:"相似度修正"}}},"speaker-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:"增强说话者的相似性"}},label:{t:0,b:{t:2,i:[{t:3}],s:"扬声器增强"}}},speed:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音生成速度"}},label:{t:0,b:{t:2,i:[{t:3}],s:"语速"}}},stability:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音稳定性和随机性"}},label:{t:0,b:{t:2,i:[{t:3}],s:"稳定性"}}},style:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音风格夸张"}},label:{t:0,b:{t:2,i:[{t:3}],s:"风格"}}}}},playground:{buttons:{button:{"test-voice":{generating:{t:0,b:{t:2,i:[{t:3}],s:"生成中..."}},label:{t:0,b:{t:2,i:[{t:3}],s:"测试声音"}}}}},fields:{field:{input:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入用于测试发音的文本"}}},language:{description:{t:0,b:{t:2,i:[{t:3}],s:"选择语音语言"}},label:{t:0,b:{t:2,i:[{t:3}],s:"语言"}}},voice:{description:{t:0,b:{t:2,i:[{t:3}],s:"选择首选语音"}},label:{t:0,b:{t:2,i:[{t:3}],s:"声线"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"实验平台"}},validation:{"error-missing-api-key":{t:0,b:{t:2,i:[{t:3}],s:"需要填写 API Key 才能用哦!"}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"ElevenLabs (11labs)"}}},fireworks:{description:{t:0,b:{t:2,i:[{t:3}],s:"Fireworks.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Fireworks.ai"}}},"microsoft-speech":{description:{t:0,b:{t:2,i:[{t:3}],s:"speech.microsoft.com"}},fields:{field:{region:{description:{t:0,b:{t:2,i:[{t:3}],s:"服务 Endpoint 地区(比如亚太 eastasia 区域)"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Endpoint 地区"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Microsoft / Azure 语音服务"}}},mistral:{description:{t:0,b:{t:2,i:[{t:3}],s:"mistral.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Mistral"}}},moonshot:{description:{t:0,b:{t:2,i:[{t:3}],s:"Moonshot.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"月之暗面"}}},novita:{description:{t:0,b:{t:2,i:[{t:3}],s:"novita.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Novita"}}},ollama:{description:{t:0,b:{t:2,i:[{t:3}],s:"ollama.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Ollama"}}},openai:{description:{t:0,b:{t:2,i:[{t:3}],s:"OpenAi.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"OpenAI"}}},openrouter:{description:{t:0,b:{t:2,i:[{t:3}],s:"OpenRouter.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"OpenRouter"}}},perplexity:{description:{t:0,b:{t:2,i:[{t:3}],s:"perplexity.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Perplexity"}}},together:{description:{t:0,b:{t:2,i:[{t:3}],s:"一起"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Together.ai"}}},vllm:{description:{t:0,b:{t:2,i:[{t:3}],s:"vllm.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"vLLM"}}},volcengine:{description:{t:0,b:{t:2,i:[{t:3}],s:"volcengine.com"}},fields:{field:{appId:{description:{t:0,b:{t:2,i:[{t:3}],s:"可在控制台获取的 App ID"}},label:{t:0,b:{t:2,i:[{t:3}],s:"App ID"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"火山引擎"}}},xai:{description:{t:0,b:{t:2,i:[{t:3}],s:"X.AI"}},title:{t:0,b:{t:2,i:[{t:3}],s:"xAI"}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"提供商"}}},scene:{description:{t:0,b:{t:2,i:[{t:3}],s:"配置角色所在环境"}},title:{t:0,b:{t:2,i:[{t:3}],s:"场景"}}},themes:{description:{t:0,b:{t:2,i:[{t:3}],s:"自定义你的舞台外观!"}},sections:{section:{"custom-color":{fields:{field:{"primary-color":{label:{t:0,b:{t:2,i:[{t:3}],s:"强调色"}},"rgb-on":{title:{t:0,b:{t:2,i:[{t:3}],s:"RGB ON!"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"配色"}}},developer:{title:{t:0,b:{t:2,i:[{t:3}],s:"开发者"}}},"theme-presets":{presets:[{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Airi 绿"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"默认的绿色主题,由 Airi 为您带来!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"默认颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"灰褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"米色"}},{t:0,b:{t:2,i:[{t:3}],s:"灰白色"}},{t:0,b:{t:2,i:[{t:3}],s:"浅灰褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"象牙色"}},{t:0,b:{t:2,i:[{t:3}],s:"橄榄灰"}},{t:0,b:{t:2,i:[{t:3}],s:"沙色"}},{t:0,b:{t:2,i:[{t:3}],s:"暖灰色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"受乔治·莫兰迪绘画启发的柔和、低调的色调"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Morandi 颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"天蓝色"}},{t:0,b:{t:2,i:[{t:3}],s:"薄雾色"}},{t:0,b:{t:2,i:[{t:3}],s:"沙色"}},{t:0,b:{t:2,i:[{t:3}],s:"苔藓绿"}},{t:0,b:{t:2,i:[{t:3}],s:"睡莲色"}},{t:0,b:{t:2,i:[{t:3}],s:"小麦色"}},{t:0,b:{t:2,i:[{t:3}],s:"板岩蓝"}},{t:0,b:{t:2,i:[{t:3}],s:"鼠尾草色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"受克劳德·莫奈作品启发的印象派调色板"}},title:{t:0,b:{t:2,i:[{t:3}],s:"莫奈颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"棕褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"暖灰褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"赭色"}},{t:0,b:{t:2,i:[{t:3}],s:"咖啡色"}},{t:0,b:{t:2,i:[{t:3}],s:"青铜色"}},{t:0,b:{t:2,i:[{t:3}],s:"金色"}},{t:0,b:{t:2,i:[{t:3}],s:"芥末色"}},{t:0,b:{t:2,i:[{t:3}],s:"琥珀色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"传统日本色彩调色板"}},title:{t:0,b:{t:2,i:[{t:3}],s:"日本颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"北欧蓝"}},{t:0,b:{t:2,i:[{t:3}],s:"冰色"}},{t:0,b:{t:2,i:[{t:3}],s:"峡湾色"}},{t:0,b:{t:2,i:[{t:3}],s:"钢铁色"}},{t:0,b:{t:2,i:[{t:3}],s:"冰川色"}},{t:0,b:{t:2,i:[{t:3}],s:"板岩色"}},{t:0,b:{t:2,i:[{t:3}],s:"云色"}},{t:0,b:{t:2,i:[{t:3}],s:"石头色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"北欧极简主义配色方案"}},title:{t:0,b:{t:2,i:[{t:3}],s:"北欧颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"霞光红"}},{t:0,b:{t:2,i:[{t:3}],s:"枣红"}},{t:0,b:{t:2,i:[{t:3}],s:"黄栌"}},{t:0,b:{t:2,i:[{t:3}],s:"竹青"}},{t:0,b:{t:2,i:[{t:3}],s:"乌梅紫"}},{t:0,b:{t:2,i:[{t:3}],s:"缃色"}},{t:0,b:{t:2,i:[{t:3}],s:"青冥"}},{t:0,b:{t:2,i:[{t:3}],s:"赭石"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"中国传统色彩,源自古代纺织品、瓷器和绘画"}},title:{t:0,b:{t:2,i:[{t:3}],s:"中国传统颜色"}}}],title:{t:0,b:{t:2,i:[{t:3}],s:"预设"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"外观"}}}},sections:{section:{general:{title:{t:0,b:{t:2,i:[{t:3}],s:"通用"}}}}},theme:{t:0,b:{t:2,i:[{t:3}],s:"主题"}},title:{t:0,b:{t:2,i:[{t:3}],s:"设置"}},voices:{t:0,b:{t:2,i:[{t:3}],s:"声线"}}},stage:{chat:{message:{"character-name":{airi:{t:0,b:{t:2,i:[{t:3}],s:"Airi"}},"core-system":{t:0,b:{t:2,i:[{t:3}],s:"核心系统"}},you:{t:0,b:{t:2,i:[{t:3}],s:"你"}}}},tabs:{chat:{t:0,b:{t:2,i:[{t:3}],s:"聊天"}},clothes:{t:0,b:{t:2,i:[{t:3}],s:"换装"}},custom:{t:0,b:{t:2,i:[{t:3}],s:"自定义"}}}},message:{t:0,b:{t:2,i:[{t:3}],s:"消息"}},operations:{"load-models":{t:0,b:{t:2,i:[{t:3}],s:"加载推理模型"}},"load-models-status":{loading:{t:0,b:{t:2,i:[{t:3}],s:"加载中"}},ready:{t:0,b:{t:2,i:[{t:3}],s:"已就绪"}}}},"select-a-audio-input":{t:0,b:{t:2,i:[{t:3}],s:"选择一个音频输入设备"}},"select-a-model":{t:0,b:{t:2,i:[{t:3}],s:"选择一个模型"}},"select-a-voice":{t:0,b:{t:2,i:[{t:3}],s:"选择一个声线"}},viewers:{"debug-menu":{emotions:{t:0,b:{t:2,i:[{t:3}],s:"表情"}},"emotions-btn":{angry:{t:0,b:{t:2,i:[{t:3}],s:"生气"}},awkward:{t:0,b:{t:2,i:[{t:3}],s:"尴尬"}},happy:{t:0,b:{t:2,i:[{t:3}],s:"开心"}},neutral:{t:0,b:{t:2,i:[{t:3}],s:"日常"}},question:{t:0,b:{t:2,i:[{t:3}],s:"疑问"}},sad:{t:0,b:{t:2,i:[{t:3}],s:"难过"}},surprised:{t:0,b:{t:2,i:[{t:3}],s:"惊喜"}},think:{t:0,b:{t:2,i:[{t:3}],s:"思考"}}},vrm:{camera:{t:0,b:{t:2,i:[{t:3}],s:"摄像机"}},model:{title:{t:0,b:{t:2,i:[{t:3}],s:"模型"}}}}}},waiting:{t:0,b:{t:2,i:[{t:3}],s:"等待中"}}}}}),X9=D9({locale:$9(),fallbackLocale:"en",messages:qA});function $9(){const n=localStorage.getItem("settings/language"),e=Object.keys(qA);return n&&e.includes(n)?n:"en"}const q9=Rz(),Y9=Fz(HV);let Qc;Qc=BV({routes:Y9,history:mV()});Qc.beforeEach((n,e)=>{n.path!==e.path&&Aw.start()});Qc.afterEach(()=>{Aw.done()});Qc.isReady().then(async()=>{}).catch(()=>{});OR(W9).use(Ez).use(e3).use(Qc).use(q9).use(X9).use(pB).mount("#app");export{ki as $,Z9 as A,wR as B,Rv as C,_C as D,lS as E,xT as F,De as G,ns as H,rs as I,de as J,Fa as K,or as L,t3 as M,mt as N,Dh as O,Kt as P,Jn as Q,Xw as R,fL as S,n3 as T,Md as U,B as V,Ce as W,ct as X,_h as Y,pG as Z,So as _,sr as a,DI as a$,zn as a0,iE as a1,jn as a2,li as a3,Ye as a4,Vn as a5,gt as a6,pL as a7,Tn as a8,K0 as a9,lg as aA,hL as aB,b_ as aC,Ef as aD,F0 as aE,ra as aF,en as aG,Ml as aH,ji as aI,nc as aJ,ic as aK,RL as aL,u3 as aM,d3 as aN,f3 as aO,ei as aP,vg as aQ,Fs as aR,CE as aS,Mo as aT,Nn as aU,HE as aV,GE as aW,WE as aX,uE as aY,wa as aZ,ht as a_,Ba as aa,A0 as ab,iG as ac,Pt as ad,dG as ae,Rc as af,Pi as ag,Xd as ah,_0 as ai,Dc as aj,$t as ak,Ao as al,ss as am,Ua as an,Zi as ao,yh as ap,Wt as aq,Bn as ar,Ct as as,sc as at,gh as au,zs as av,Ji as aw,gn as ax,gi as ay,AE as az,pn as b,En as b$,BI as b0,t_ as b1,An as b2,Gn as b3,c_ as b4,cE as b5,os as b6,vr as b7,dE as b8,hE as b9,AR as bA,lG as bB,kB as bC,gs as bD,Kv as bE,yG as bF,VV as bG,CR as bH,rG as bI,aG as bJ,mG as bK,G2 as bL,uG as bM,xG as bN,SG as bO,qw as bP,A_ as bQ,gG as bR,e0 as bS,rS as bT,K9 as bU,H2 as bV,X2 as bW,J9 as bX,wn as bY,pf as bZ,ai as b_,aa as ba,vh as bb,gc as bc,e_ as bd,mc as be,pc as bf,Wc as bg,ft as bh,Os as bi,Gc as bj,sL as bk,hB as bl,Tz as bm,Do as bn,NV as bo,wT as bp,Ig as bq,cS as br,Va as bs,TG as bt,MG as bu,Er as bv,tG as bw,jt as bx,f2 as by,BB as bz,vi as c,Ds as c0,nG as c1,u2 as c2,Fn as c3,pr as c4,Ui as c5,Q9 as c6,g0 as c7,CS as c8,bi as c9,sG as ca,oG as cb,S0 as cc,dr as cd,AG as ce,_c as cf,Tr as cg,we as ch,st as ci,R3 as cj,uL as ck,CL as cl,je as cm,CG as cn,cG as co,Li as cp,hn as cq,hG as cr,fG as cs,fn as d,EG as e,Nz as f,et as g,Ee as h,vG as i,wG as j,bG as k,Hn as l,d2 as m,Mi as n,mn as o,_G as p,sp as q,eG as r,Uz as s,ut as t,Ot as u,CH as v,$e as w,Yl as x,gS as y,Oa as z}; diff --git a/assets/index-ClgaRsQ-.js b/assets/index-3uLpAsQp.js similarity index 95% rename from assets/index-ClgaRsQ-.js rename to assets/index-3uLpAsQp.js index 70fee2d8461369a478b4d09ed5322c8dabde0f3d..99d7204d2706c60f63f510986012a6a0afeda1d4 100644 --- a/assets/index-ClgaRsQ-.js +++ b/assets/index-3uLpAsQp.js @@ -1 +1 @@ -import{d as A,bI as _,bJ as F,c as r,o,A as a,a as e,b as m,B as V,bL as h,C as U,D as u,y as g,z as x,bB as H,v as M,bC as O,q as j,g as N,w as P,bw as z,u as i,x as f,ad as I,bH as L,bE as R,bx as D,by as q,bn as J}from"./index--eYU5aQm.js";import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{_ as G}from"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";import{_ as C,a as K}from"./ColorPalette.vue_vue_type_script_setup_true_lang-8aVGVYYF.js";import{b as k}from"./route-block-B_A1xBdJ.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-CWkRm8IH.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BHnSNWo1.js";import"./index-CpeQQOdD.js";const Q={class:"w-full flex cursor-pointer items-center justify-between rounded-lg px-4 py-3 text-sm outline-none transition-all duration-250 ease-in-out",bg:"neutral-50 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700"},W=["aria-checked"],X={key:0,text:"sm neutral-500"},B=A({__name:"CheckBar",props:_({text:null,iconOn:null,iconOff:null,description:null},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(p){const n=F(p,"modelValue");return(y,c)=>(o(),r("label",Q,[a(e("input",{"onUpdate:modelValue":c[0]||(c[0]=v=>n.value=v),"aria-checked":n.value,type:"checkbox",hidden:""},null,8,W),[[V,n.value]]),e("div",null,[h(u(y.$t(p.text))+" ",1),p.description?(o(),r("div",X,u(y.$t(p.description)),1)):U("",!0)]),m(H,{name:"slide-away",mode:"out-in"},{default:g(()=>[n.value?(o(),r("div",{key:0,class:x(p.iconOn),transition:"all ease-in-out duration-250"},null,2)):(o(),r("div",{key:1,class:x(p.iconOff),transition:"all ease-in-out duration-250"},null,2))]),_:1})]))}}),Y=[[],["#A5978B","#D8CAAF","#B8B4A7","#C4BCB1","#E5DED8","#9A8F7D","#BEB5A7","#C9C0B6"],["#7A9EAF","#B8C7CC","#D4B79C","#8B9D77","#C7D5CB","#E6D0B1","#94A7B1","#B4C8C3"],["#D9B48F","#B5917A","#8C7A6B","#A17F5F","#B98C46","#C7A252","#DAB300","#D19826"],["#9BA7B0","#C1CBD4","#A5ADB6","#8B959E","#D4DCE4","#7F8A94","#B3BCC6","#98A4AE"],["#E4C6D0","#A61B29","#5D513C","#789262","#1C0D1A","#F7C242","#62A9DD","#8C4B3C"]],Z={class:"w-full flex items-center justify-between rounded-lg px-4 py-3 text-sm outline-none transition-all duration-250 ease-in-out",bg:"neutral-50 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+3*10,delay:3*50,transition:"all ease-in-out duration-250"},ee={value:"en-US"},te={value:"zh-CN"},ie={flex:"","items-center":"","justify-between":"",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+5*10,delay:5*50,transition:"all ease-in-out duration-250"},ne={"text-lg":"","font-semibold":""},ae={relative:"",flex:"","cursor-pointer":"","items-center":"","gap-2":""},oe=["disabled"],se={class:"color-bar",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+7*10,delay:7*50,transition:"all ease-in-out duration-250"},le={"text-white":"",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+8*10,delay:8*50,transition:"all ease-in-out duration-250"},re={class:"color-bar transparency-grid",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+9*10,delay:9*50,transition:"all ease-in-out duration-250"},de=["duration","delay"],ue={"font-medium":""},pe={text:"sm neutral-500"},ye={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[65dvh]","right--15":"","z--1":"",initial:{scale:.9,opacity:0,rotate:30},enter:{scale:1,opacity:1,rotate:0},duration:250,flex:"","items-center":"","justify-center":""},$=A({__name:"index",setup(p){const n=M(),y=O(),{t:c}=j(),v=N(!1);return P(()=>[n.usePageSpecificTransitions,n.disableTransitions],()=>{v.value=!0}),(d,t)=>{const s=z("motion");return o(),r(D,null,[m(i(G),{title:d.$t("settings.pages.themes.title"),subtitle:d.$t("settings.title")},null,8,["title","subtitle"]),a((o(),f(i(C),{title:i(c)("settings.sections.section.general.title"),icon:"i-solar:filters-bold-duotone",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+1*10,delay:1*50,transition:"all ease-in-out duration-250"},{default:g(()=>[a(m(B,{modelValue:i(y),"onUpdate:modelValue":t[0]||(t[0]=l=>I(y)?y.value=l:null),initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+2*10,delay:2*50,"icon-on":"i-solar:moon-stars-bold-duotone","icon-off":"i-solar:sun-fog-bold-duotone",text:"settings.theme",transition:"all ease-in-out duration-250"},null,8,["modelValue"]),[[s]]),a((o(),r("div",Z,[h(u(d.$t("settings.language.title"))+" ",1),a(e("select",{"onUpdate:modelValue":t[1]||(t[1]=l=>i(n).language=l),transition:"all ease-in-out duration-250","cursor-pointer":"","bg-transparent":"","text-right":"","outline-none":""},[e("option",ee,u(d.$t("settings.language.english")),1),e("option",te,u(d.$t("settings.language.chinese")),1)],512),[[L,i(n).language]])])),[[s]])]),_:1},8,["title"])),[[s]]),a((o(),f(i(C),{title:i(c)("settings.pages.themes.sections.section.custom-color.title"),icon:"i-solar:pallete-2-bold-duotone",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+4*10,delay:4*50,transition:"all ease-in-out duration-250"},{default:g(()=>[a((o(),r("div",ie,[e("span",ne,u(d.$t("settings.pages.themes.sections.section.custom-color.fields.field.primary-color.label")),1),e("label",ae,[a(e("input",{"onUpdate:modelValue":t[2]||(t[2]=l=>i(n).themeColorsHueDynamic=l),type:"checkbox",class:"peer sr-only"},null,512),[[V,i(n).themeColorsHueDynamic]]),t[6]||(t[6]=e("div",{class:"peer-checked:bg-primary-500 h-6 w-11 rounded-full bg-neutral-200 after:absolute after:left-[2px] after:top-[2px] after:h-5 after:w-5 after:rounded-full after:bg-white dark:bg-neutral-600 after:transition-all after:content-[''] peer-checked:after:translate-x-full peer-checked:after:border-white"},null,-1)),h(" "+u(d.$t("settings.pages.themes.sections.section.custom-color.fields.field.primary-color.rgb-on.title")),1)])])),[[s]]),a(e("input",{"onUpdate:modelValue":t[3]||(t[3]=l=>i(n).themeColorsHue=l),initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+6*10,delay:6*50,transition:"all ease-in-out duration-250",type:"range",min:"0",max:"360",step:"0.01",class:x(["theme-hue-slider",i(n).themeColorsHueDynamic?"opacity-25 cursor-not-allowed":"cursor-pointer"]),disabled:i(n).themeColorsHueDynamic},null,10,oe),[[R,i(n).themeColorsHue],[s]]),a((o(),r("div",se,[t[8]||(t[8]=e("span",{"bg-primary-50":""},"50",-1)),t[9]||(t[9]=e("span",{"bg-primary-100":""},"100",-1)),t[10]||(t[10]=e("span",{"bg-primary-200":""},"200",-1)),t[11]||(t[11]=e("span",{"bg-primary-300":""},"300",-1)),t[12]||(t[12]=e("span",{"bg-primary-400":""},"400",-1)),t[13]||(t[13]=e("span",{"bg-primary-500":""},"500",-1)),a((o(),r("div",le,t[7]||(t[7]=[e("span",{"bg-primary-600":""},"600",-1),e("span",{"bg-primary-700":""},"700",-1),e("span",{"bg-primary-800":""},"800",-1),e("span",{"bg-primary-900":""},"900",-1),e("span",{"bg-primary-950":""},"950",-1)]))),[[s]])])),[[s]]),a((o(),r("div",re,t[14]||(t[14]=[e("span",{bg:"primary-500/5"},"500/5",-1),e("span",{bg:"primary-500/10"},"500/10",-1),e("span",{bg:"primary-500/20"},"500/20",-1),e("span",{bg:"primary-500/30"},"500/30",-1),e("span",{bg:"primary-500/40"},"500/40",-1),e("span",{bg:"primary-500/50"},"500/50",-1),e("span",{bg:"primary-500/60"},"500/60",-1),e("span",{bg:"primary-500/70"},"500/70",-1),e("span",{bg:"primary-500/80"},"500/80",-1),e("span",{bg:"primary-500/90"},"500/90",-1),e("span",{bg:"primary-500"},"500",-1)]))),[[s]])]),_:1},8,["title"])),[[s]]),a((o(),f(i(C),{title:"settings.pages.themes.sections.section.theme-presets.title",icon:"i-solar:magic-stick-2-bold-duotone",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+10*10,delay:10*50,transition:"all ease-in-out duration-250"},{default:g(()=>[(o(!0),r(D,null,q(d.$tm("settings.pages.themes.sections.section.theme-presets.presets"),({title:l,description:w,colors:E},b)=>a((o(),r("div",{key:b,class:"w-full flex items-center justify-between rounded-lg px-4 py-3 outline-none transition-all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+11*10+b*10,delay:11*50+b*50,transition:"all ease-in-out duration-250"},[e("div",null,[e("span",ue,u(d.$rt(l)),1),e("div",pe,u(d.$rt(w)),1)]),m(K,{colors:E.map((T,S)=>({hex:i(Y)[b][S],name:d.$rt(T)}))},null,8,["colors"])],8,de)),[[s]])),128))]),_:1})),[[s]]),a((o(),f(i(C),{title:"settings.pages.themes.sections.section.developer.title",icon:"i-solar:code-bold-duotone",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+18*10,delay:18*50,transition:"all ease-in-out duration-250"},{default:g(()=>[a(m(B,{modelValue:i(n).disableTransitions,"onUpdate:modelValue":t[4]||(t[4]=l=>i(n).disableTransitions=l),"icon-on":"i-solar:people-nearby-bold-duotone","icon-off":"i-solar:running-2-line-duotone",text:"settings.animations.stage-transitions.title",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+19*10,delay:19*50,transition:"all ease-in-out duration-250"},null,8,["modelValue"]),[[s]]),a(m(B,{modelValue:i(n).usePageSpecificTransitions,"onUpdate:modelValue":t[5]||(t[5]=l=>i(n).usePageSpecificTransitions=l),disabled:i(n).disableTransitions,"icon-on":"i-solar:running-2-line-duotone","icon-off":"i-solar:people-nearby-bold-duotone",text:"settings.animations.use-page-specific-transitions.title",description:"settings.animations.use-page-specific-transitions.description",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+20*10,delay:20*50,transition:"all ease-in-out duration-250"},null,8,["modelValue","disabled"]),[[s]])]),_:1})),[[s]]),a((o(),r("div",ye,t[15]||(t[15]=[e("div",{text:"60","i-solar:filters-bold-duotone":""},null,-1)]))),[[s]])],64)}}});typeof k=="function"&&k($);const he=J($,[["__scopeId","data-v-4a014d7b"]]);export{he as default}; +import{d as A,bI as _,bJ as F,c as r,o,A as a,a as e,b as m,B as V,bL as h,C as U,D as u,y as g,z as x,bB as H,v as M,bC as O,q as j,g as N,w as P,bw as z,u as i,x as f,ad as I,bH as L,bE as R,bx as D,by as q,bn as J}from"./index-D55VqdU4.js";import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{_ as G}from"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";import{_ as C,a as K}from"./ColorPalette.vue_vue_type_script_setup_true_lang-Cl6NdKBD.js";import{b as k}from"./route-block-B_A1xBdJ.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BDoHyduV.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BbB31kj-.js";import"./index-fSchh9rJ.js";const Q={class:"w-full flex cursor-pointer items-center justify-between rounded-lg px-4 py-3 text-sm outline-none transition-all duration-250 ease-in-out",bg:"neutral-50 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700"},W=["aria-checked"],X={key:0,text:"sm neutral-500"},B=A({__name:"CheckBar",props:_({text:null,iconOn:null,iconOff:null,description:null},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(p){const n=F(p,"modelValue");return(y,c)=>(o(),r("label",Q,[a(e("input",{"onUpdate:modelValue":c[0]||(c[0]=v=>n.value=v),"aria-checked":n.value,type:"checkbox",hidden:""},null,8,W),[[V,n.value]]),e("div",null,[h(u(y.$t(p.text))+" ",1),p.description?(o(),r("div",X,u(y.$t(p.description)),1)):U("",!0)]),m(H,{name:"slide-away",mode:"out-in"},{default:g(()=>[n.value?(o(),r("div",{key:0,class:x(p.iconOn),transition:"all ease-in-out duration-250"},null,2)):(o(),r("div",{key:1,class:x(p.iconOff),transition:"all ease-in-out duration-250"},null,2))]),_:1})]))}}),Y=[[],["#A5978B","#D8CAAF","#B8B4A7","#C4BCB1","#E5DED8","#9A8F7D","#BEB5A7","#C9C0B6"],["#7A9EAF","#B8C7CC","#D4B79C","#8B9D77","#C7D5CB","#E6D0B1","#94A7B1","#B4C8C3"],["#D9B48F","#B5917A","#8C7A6B","#A17F5F","#B98C46","#C7A252","#DAB300","#D19826"],["#9BA7B0","#C1CBD4","#A5ADB6","#8B959E","#D4DCE4","#7F8A94","#B3BCC6","#98A4AE"],["#E4C6D0","#A61B29","#5D513C","#789262","#1C0D1A","#F7C242","#62A9DD","#8C4B3C"]],Z={class:"w-full flex items-center justify-between rounded-lg px-4 py-3 text-sm outline-none transition-all duration-250 ease-in-out",bg:"neutral-50 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+3*10,delay:3*50,transition:"all ease-in-out duration-250"},ee={value:"en-US"},te={value:"zh-CN"},ie={flex:"","items-center":"","justify-between":"",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+5*10,delay:5*50,transition:"all ease-in-out duration-250"},ne={"text-lg":"","font-semibold":""},ae={relative:"",flex:"","cursor-pointer":"","items-center":"","gap-2":""},oe=["disabled"],se={class:"color-bar",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+7*10,delay:7*50,transition:"all ease-in-out duration-250"},le={"text-white":"",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+8*10,delay:8*50,transition:"all ease-in-out duration-250"},re={class:"color-bar transparency-grid",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+9*10,delay:9*50,transition:"all ease-in-out duration-250"},de=["duration","delay"],ue={"font-medium":""},pe={text:"sm neutral-500"},ye={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[65dvh]","right--15":"","z--1":"",initial:{scale:.9,opacity:0,rotate:30},enter:{scale:1,opacity:1,rotate:0},duration:250,flex:"","items-center":"","justify-center":""},$=A({__name:"index",setup(p){const n=M(),y=O(),{t:c}=j(),v=N(!1);return P(()=>[n.usePageSpecificTransitions,n.disableTransitions],()=>{v.value=!0}),(d,t)=>{const s=z("motion");return o(),r(D,null,[m(i(G),{title:d.$t("settings.pages.themes.title"),subtitle:d.$t("settings.title")},null,8,["title","subtitle"]),a((o(),f(i(C),{title:i(c)("settings.sections.section.general.title"),icon:"i-solar:filters-bold-duotone",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+1*10,delay:1*50,transition:"all ease-in-out duration-250"},{default:g(()=>[a(m(B,{modelValue:i(y),"onUpdate:modelValue":t[0]||(t[0]=l=>I(y)?y.value=l:null),initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+2*10,delay:2*50,"icon-on":"i-solar:moon-stars-bold-duotone","icon-off":"i-solar:sun-fog-bold-duotone",text:"settings.theme",transition:"all ease-in-out duration-250"},null,8,["modelValue"]),[[s]]),a((o(),r("div",Z,[h(u(d.$t("settings.language.title"))+" ",1),a(e("select",{"onUpdate:modelValue":t[1]||(t[1]=l=>i(n).language=l),transition:"all ease-in-out duration-250","cursor-pointer":"","bg-transparent":"","text-right":"","outline-none":""},[e("option",ee,u(d.$t("settings.language.english")),1),e("option",te,u(d.$t("settings.language.chinese")),1)],512),[[L,i(n).language]])])),[[s]])]),_:1},8,["title"])),[[s]]),a((o(),f(i(C),{title:i(c)("settings.pages.themes.sections.section.custom-color.title"),icon:"i-solar:pallete-2-bold-duotone",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+4*10,delay:4*50,transition:"all ease-in-out duration-250"},{default:g(()=>[a((o(),r("div",ie,[e("span",ne,u(d.$t("settings.pages.themes.sections.section.custom-color.fields.field.primary-color.label")),1),e("label",ae,[a(e("input",{"onUpdate:modelValue":t[2]||(t[2]=l=>i(n).themeColorsHueDynamic=l),type:"checkbox",class:"peer sr-only"},null,512),[[V,i(n).themeColorsHueDynamic]]),t[6]||(t[6]=e("div",{class:"peer-checked:bg-primary-500 h-6 w-11 rounded-full bg-neutral-200 after:absolute after:left-[2px] after:top-[2px] after:h-5 after:w-5 after:rounded-full after:bg-white dark:bg-neutral-600 after:transition-all after:content-[''] peer-checked:after:translate-x-full peer-checked:after:border-white"},null,-1)),h(" "+u(d.$t("settings.pages.themes.sections.section.custom-color.fields.field.primary-color.rgb-on.title")),1)])])),[[s]]),a(e("input",{"onUpdate:modelValue":t[3]||(t[3]=l=>i(n).themeColorsHue=l),initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+6*10,delay:6*50,transition:"all ease-in-out duration-250",type:"range",min:"0",max:"360",step:"0.01",class:x(["theme-hue-slider",i(n).themeColorsHueDynamic?"opacity-25 cursor-not-allowed":"cursor-pointer"]),disabled:i(n).themeColorsHueDynamic},null,10,oe),[[R,i(n).themeColorsHue],[s]]),a((o(),r("div",se,[t[8]||(t[8]=e("span",{"bg-primary-50":""},"50",-1)),t[9]||(t[9]=e("span",{"bg-primary-100":""},"100",-1)),t[10]||(t[10]=e("span",{"bg-primary-200":""},"200",-1)),t[11]||(t[11]=e("span",{"bg-primary-300":""},"300",-1)),t[12]||(t[12]=e("span",{"bg-primary-400":""},"400",-1)),t[13]||(t[13]=e("span",{"bg-primary-500":""},"500",-1)),a((o(),r("div",le,t[7]||(t[7]=[e("span",{"bg-primary-600":""},"600",-1),e("span",{"bg-primary-700":""},"700",-1),e("span",{"bg-primary-800":""},"800",-1),e("span",{"bg-primary-900":""},"900",-1),e("span",{"bg-primary-950":""},"950",-1)]))),[[s]])])),[[s]]),a((o(),r("div",re,t[14]||(t[14]=[e("span",{bg:"primary-500/5"},"500/5",-1),e("span",{bg:"primary-500/10"},"500/10",-1),e("span",{bg:"primary-500/20"},"500/20",-1),e("span",{bg:"primary-500/30"},"500/30",-1),e("span",{bg:"primary-500/40"},"500/40",-1),e("span",{bg:"primary-500/50"},"500/50",-1),e("span",{bg:"primary-500/60"},"500/60",-1),e("span",{bg:"primary-500/70"},"500/70",-1),e("span",{bg:"primary-500/80"},"500/80",-1),e("span",{bg:"primary-500/90"},"500/90",-1),e("span",{bg:"primary-500"},"500",-1)]))),[[s]])]),_:1},8,["title"])),[[s]]),a((o(),f(i(C),{title:"settings.pages.themes.sections.section.theme-presets.title",icon:"i-solar:magic-stick-2-bold-duotone",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+10*10,delay:10*50,transition:"all ease-in-out duration-250"},{default:g(()=>[(o(!0),r(D,null,q(d.$tm("settings.pages.themes.sections.section.theme-presets.presets"),({title:l,description:w,colors:E},b)=>a((o(),r("div",{key:b,class:"w-full flex items-center justify-between rounded-lg px-4 py-3 outline-none transition-all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+11*10+b*10,delay:11*50+b*50,transition:"all ease-in-out duration-250"},[e("div",null,[e("span",ue,u(d.$rt(l)),1),e("div",pe,u(d.$rt(w)),1)]),m(K,{colors:E.map((T,S)=>({hex:i(Y)[b][S],name:d.$rt(T)}))},null,8,["colors"])],8,de)),[[s]])),128))]),_:1})),[[s]]),a((o(),f(i(C),{title:"settings.pages.themes.sections.section.developer.title",icon:"i-solar:code-bold-duotone",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+18*10,delay:18*50,transition:"all ease-in-out duration-250"},{default:g(()=>[a(m(B,{modelValue:i(n).disableTransitions,"onUpdate:modelValue":t[4]||(t[4]=l=>i(n).disableTransitions=l),"icon-on":"i-solar:people-nearby-bold-duotone","icon-off":"i-solar:running-2-line-duotone",text:"settings.animations.stage-transitions.title",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+19*10,delay:19*50,transition:"all ease-in-out duration-250"},null,8,["modelValue"]),[[s]]),a(m(B,{modelValue:i(n).usePageSpecificTransitions,"onUpdate:modelValue":t[5]||(t[5]=l=>i(n).usePageSpecificTransitions=l),disabled:i(n).disableTransitions,"icon-on":"i-solar:running-2-line-duotone","icon-off":"i-solar:people-nearby-bold-duotone",text:"settings.animations.use-page-specific-transitions.title",description:"settings.animations.use-page-specific-transitions.description",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+20*10,delay:20*50,transition:"all ease-in-out duration-250"},null,8,["modelValue","disabled"]),[[s]])]),_:1})),[[s]]),a((o(),r("div",ye,t[15]||(t[15]=[e("div",{text:"60","i-solar:filters-bold-duotone":""},null,-1)]))),[[s]])],64)}}});typeof k=="function"&&k($);const he=J($,[["__scopeId","data-v-4a014d7b"]]);export{he as default}; diff --git a/assets/index-D8WWKFo2.js b/assets/index-6VFi4BKt.js similarity index 60% rename from assets/index-D8WWKFo2.js rename to assets/index-6VFi4BKt.js index c61b6bcfb94d307236df5bf4b3d1c528539ba4f5..b6a30a21f37278a139437d4c84d312ad8e36faa6 100644 --- a/assets/index-D8WWKFo2.js +++ b/assets/index-6VFi4BKt.js @@ -1,4 +1,4 @@ -import{V as vs,a as bs,c as ws,r as ks,b as Cr,d as Ts,E as Ei,e as _s,f as As,g as Es,h as Ms,i as Ss}from"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{f as $n,g as W,h as je,s as qe,t as Is,d as Be,i as Rs,j as Cs,k as Qr,w as Fe,l as pn,c as re,o as Q,m as gn,p as Ns,q as Qt,v as Wt,x as Xt,y as Ue,b as ke,a as O,z as st,A as At,B as Zr,C as it,D as he,u as V,M as yt,T as _t,E as Jr,F as Yn,G as Yo,Z as On,H as Ot,I as Ls,V as ae,S as Mi,Q as Bn,O as Gt,J as Pe,P as Et,K as Ps,L as qo,N as hn,U as ei,W as ze,X as Ko,Y as Wo,_ as ti,$ as yn,a0 as Ds,a1 as ni,a2 as Os,a3 as Xo,a4 as xt,a5 as ri,a6 as Mt,a7 as Bs,a8 as Qo,a9 as Dt,aa as Zo,ab as Fs,ac as zs,ad as Us,ae as js,af as Jo,ag as qn,ah as Vs,ai as Hs,aj as Gs,ak as Pt,al as $s,am as Ys,an as qs,ao as Ks,ap as er,aq as Fn,ar as Nr,as as Nt,at as ea,au as Lr,av as Vt,aw as Si,ax as Lt,ay as Ht,az as tr,aA as Ws,aB as Xs,aC as Qs,aD as Zs,aE as ta,aF as na,aG as zn,aH as ra,aI as ii,aJ as Un,aK as ia,aL as Js,n as Pr,aM as el,aN as Dr,aO as oa,aP as tl,aQ as cn,aR as aa,aS as ft,aT as vt,aU as mn,aV as nl,aW as rl,aX as il,aY as ol,aZ as al,a_ as oi,a$ as sl,b0 as ll,b1 as ul,b2 as nr,b3 as cl,b4 as sa,b5 as fl,b6 as dl,b7 as pl,b8 as hl,b9 as ml,ba as rr,bb as gl,bc as yl,bd as xl,be as Ii,bf as Ri,bg as Ci,bh as Ni,bi as vl,bj as bl,bk as wl,bl as kl,bm as Tl,bn as Kn,bo as _l,bp as la,bq as Al,br as El,bs as Ml,bt as Sl,bu as ua,bv as jn,bw as ca,bx as ai,by as si,bz as Il,bA as ir,bB as Rl,bC as Cl}from"./index--eYU5aQm.js";import{getImportUrlBundles as Nl}from"./import-url-browser-CPN8ipMD.js";import{s as $t,c as Li,u as Ll,g as Pl}from"./speech-BOhrg3WS.js";import{u as or}from"./queue-D6byf-bD.js";import{u as Dl,a as Ol,b as Bl,l as Fl}from"./queues-r0c9CGew.js";import{l as zl,u as li}from"./providers-YQf-rDZ1.js";import{s as Ul}from"./index-D975M2PQ.js";import{u as jl}from"./airi-card-_ueLLZ0g.js";import{_ as Vl,a as Hl,r as on}from"./Model.vue_vue_type_script_setup_true_lang-nr66j8OO.js";import{_ as ui}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-BHnSNWo1.js";import{_ as Pi}from"./Collapsable.vue_vue_type_script_setup_true_lang-CWkRm8IH.js";import{H as Gl}from"./HeaderLink-BXS05cIQ.js";import{_ as fa}from"./Basic.vue_vue_type_script_setup_true_lang-Ckn2TiNk.js";import{u as da}from"./consciousness-NMirv8Xi.js";import{d as Di}from"./index-DJq_28p-.js";import{b as Oi}from"./route-block-B_A1xBdJ.js";import"./duckdb-mvp-CaaD-olE.js";import"./index-Be1NqeGb.js";async function*$l(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 Yl(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 ql(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 Kl(t,e="linear"){switch(e){case"linear":return Yl(t);case"minmax":return ql(t)}}const pa=$n("AudioContext",()=>({audioContext:new AudioContext,calculateVolume:Kl})),Wl=$n("SpeakingStore",()=>{const n=W(0),r=W(!1),i=je(()=>r.value?(30+70*n.value)/100:30);return{mouthOpenSize:n,nowSpeaking:r,nowSpeakingAvatarBorderOpacity:i}});function _n(t,e,n){return e+n<0||e+n>=t.length-1?"":t[e+n]}function Xl(t){let e="literal",n="";return{async consume(r){var i,o,a;for(let s=0;s"?(l+=_n(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 Ql=$n("llm",()=>{async function t(n,r,i,o){const a=o==null?void 0:o.headers;return await Ul({...r.chat(n),messages:i,headers:a})}async function e(n,r){if(n==="")return[];try{return await zl({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}}),St=$n("chat",()=>{const{stream:t}=Ql(),{systemPrompt:e}=qe(jl()),n=W(!1),r=W([]),i=W([]),o=W([]),a=W([]),s=W([]),l=W([]),u=W([]),c=W([]);function f(h){r.value.push(h)}function p(h){i.value.push(h)}function d(h){o.value.push(h)}function y(h){a.value.push(h)}function x(h){s.value.push(h)}function v(h){l.value.push(h)}function k(h){u.value.push(h)}function M(h){c.value.push(h)}const A=W([{role:"system",content:e.value}]),C=W({role:"assistant",content:""});async function P(h,I){var b;try{if(n.value=!0,!h)return;for(const D of r.value)await D(h);C.value={role:"assistant",content:""},A.value.push({role:"user",content:h}),A.value.push(C.value);const g=A.value.slice(0,A.value.length-1).map(D=>Is(D));for(const D of i.value)await D(h);for(const D of o.value)await D(h);const m=((b=I.providerConfig)==null?void 0:b.headers)||{},T=await t(I.model,I.chatProvider,g,{headers:m});for(const D of a.value)await D(h);let S="";const F=Xl({onLiteral:async D=>{for(const B of s.value)await B(D);C.value.content+=D},onSpecial:async D=>{for(const B of l.value)await B(D)}});for await(const D of $l(T.textStream,async B=>B))S+=D,await F.consume(D);await F.end();for(const D of u.value)await D();for(const D of c.value)await D(S);console.debug("LLM output:",S)}catch(g){throw console.error("Error sending message:",g),g}finally{n.value=!1}}return{sending:n,messages:A,streamingMessage:C,send:P,onBeforeMessageComposed:f,onAfterMessageComposed:p,onBeforeSend:d,onAfterSend:y,onTokenLiteral:x,onTokenSpecial:v,onStreamEnd:k,onAssistantResponseEnd:M}}),ha=Be({__name:"Screen",setup(t){const e=W(),n=Rs(Ns),{width:r,height:i}=Cs(),o=Qr(e,{immediate:!0,windowResize:!0,reset:!0}),a=je(()=>n.between("sm","md").value||n.smaller("sm").value),s=je(()=>n.between("md","lg").value),l=je(()=>n.greaterOrEqual("lg").value),u=je(()=>l.value?o.width.value:a.value||s.value?r.value-16:o.width.value),c=W(0);return Fe([r,i,e],()=>{var p,d;const f=(d=(p=e.value)==null?void 0:p.parentElement)==null?void 0:d.getBoundingClientRect();l.value||a.value||s.value?c.value=(f==null?void 0:f.height)||0:c.value=600}),Fe([o.width,o.height],()=>{l.value||a.value||s.value?c.value=o.height.value:c.value=600}),pn(async()=>{e.value&&o.update()}),(f,p)=>(Q(),re("div",{ref_key:"containerRef",ref:e,"h-full":"","w-full":""},[gn(f.$slots,"default",{width:u.value,height:c.value})],512))}}),Zl={absolute:"",bottom:"3",right:"3"},Jl={flex:"~ row","cursor-pointer":""},eu=["checked","aria-checked"],tu={key:0,"min-w":"50vw",z:"(Q(),Xt(ha,{relative:""},{default:Ue(({width:a,height:s})=>[ke(Hl,{width:a,height:s},{default:Ue(({app:l})=>[ke(Vl,{app:l,"mouth-open-size":t.mouthOpenSize,width:a,height:s,paused:t.paused},null,8,["app","mouth-open-size","width","height","paused"])]),_:2},1032,["width","height"]),O("div",Zl,[O("div",Jl,[O("label",{class:st([n.value?"bg-neutral-300 dark:bg-neutral-200":"bg-neutral-100 dark:bg-neutral-700"]),transition:"all ease-in-out duration-500",text:"lg neutral-500 dark:neutral-400","m-1":"","h-fit":"","w-fit":"","cursor-pointer":"","appearance-none":"","gap-1":"","rounded-lg":"","rounded-md":"","border-none":"","p-2":"","outline-none":""},[At(O("input",{"onUpdate:modelValue":o[0]||(o[0]=l=>n.value=l),checked:n.value,"aria-checked":n.value,name:"showLive2DViewerInspector",type:"checkbox",hidden:"","appearance-none":"","outline-none":""},null,8,eu),[[Zr,n.value]]),o[8]||(o[8]=O("div",{"select-none":""},[O("div",{"i-solar:bug-bold-duotone":""})],-1))],2)]),ke(ui,null,{default:Ue(()=>[n.value?(Q(),re("div",tu,[O("div",nu,[O("div",ru,[O("span",null,he(V(e)("stage.viewers.debug-menu.emotions")),1)]),O("div",iu,[O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[1]||(o[1]=l=>r.value={group:"Surprise",index:0})},he(V(e)("stage.viewers.debug-menu.emotions-btn.surprised")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[2]||(o[2]=l=>r.value={group:"Sad",index:0})},he(V(e)("stage.viewers.debug-menu.emotions-btn.sad")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[3]||(o[3]=l=>r.value={group:"Angry",index:0})},he(V(e)("stage.viewers.debug-menu.emotions-btn.angry")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[4]||(o[4]=l=>r.value={group:"Happy",index:0})},he(V(e)("stage.viewers.debug-menu.emotions-btn.happy")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[5]||(o[5]=l=>r.value={group:"Awkward",index:0})},he(V(e)("stage.viewers.debug-menu.emotions-btn.awkward")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[6]||(o[6]=l=>r.value={group:"Question",index:0})},he(V(e)("stage.viewers.debug-menu.emotions-btn.question")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[7]||(o[7]=l=>r.value={group:"Think",index:0})},he(V(e)("stage.viewers.debug-menu.emotions-btn.think")),1)])])])):it("",!0)]),_:1})])]),_:1}))}});var au=Object.defineProperty,su=(t,e,n)=>e in t?au(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,lu=(t,e,n)=>su(t,e+"",n);function uu(t){return Vs()?(Hs(t),!0):!1}function ma(t){return typeof t=="function"?t():V(t)}const cu=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const fu=Object.prototype.toString,du=t=>fu.call(t)==="[object Object]",pu=()=>{},hu=cu?window:void 0;function mu(t){var e;const n=ma(t);return(e=n==null?void 0:n.$el)!=null?e:n}function ar(...t){let e,n,r,i;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,r,i]=t,e=hu):[e,n,r,i]=t,!e)return pu;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const o=[],a=()=>{o.forEach(c=>c()),o.length=0},s=(c,f,p,d)=>(c.addEventListener(f,p,d),()=>c.removeEventListener(f,p,d)),l=Fe(()=>[mu(e),ma(i)],([c,f])=>{if(a(),!c)return;const p=du(f)?{...f}:f;o.push(...n.flatMap(d=>r.map(y=>s(c,d,y,p))))},{immediate:!0,flush:"post"}),u=()=>{l(),a()};return uu(u),u}function ga(t,e,n,r){const i=class extends yn{constructor(o={}){const a=Object.entries(t);super({uniforms:a.reduce((s,[l,u])=>{const c=ni.clone({[l]:{value:u}});return{...s,...c}},{}),vertexShader:e,fragmentShader:n}),lu(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=Dt.generateUUID(),i}ga({color:new ze("white"),scale:new Pe(1,1),imageBounds:new Pe(1,1),resolution:1024,map:null,zoom:1,radius:0,grayscale:0,opacity:1},` +import{V as vs,a as bs,c as ws,r as ks,b as Cr,d as Ts,E as Mi,e as _s,f as Es,g as Ms,h as As,i as Ss}from"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{f as Gn,g as W,h as je,s as Ke,t as Is,d as Fe,i as Rs,j as Cs,k as Zr,w as Be,l as pn,c as re,o as Z,m as gn,p as Ns,q as Zt,v as Wt,x as Xt,y as Ue,b as ke,a as O,z as st,A as Et,B as Qr,C as it,D as he,u as V,M as yt,T as _t,E as Jr,F as Yn,G as Yo,Z as On,H as Ot,I as Ls,V as ae,S as Ai,Q as Fn,O as $t,J as Pe,P as Mt,K as Ps,L as Ko,N as hn,U as ei,W as ze,X as qo,Y as Wo,_ as ti,$ as yn,a0 as Ds,a1 as ni,a2 as Os,a3 as Xo,a4 as xt,a5 as ri,a6 as At,a7 as Fs,a8 as Zo,a9 as Dt,aa as Qo,ab as Bs,ac as zs,ad as Us,ae as js,af as Jo,ag as Kn,ah as Vs,ai as Hs,aj as $s,ak as Pt,al as Gs,am as Ys,an as Ks,ao as qs,ap as er,aq as Bn,ar as Nr,as as Nt,at as ea,au as Lr,av as Vt,aw as Si,ax as Lt,ay as Ht,az as tr,aA as Ws,aB as Xs,aC as Zs,aD as Qs,aE as ta,aF as na,aG as zn,aH as ra,aI as ii,aJ as Un,aK as ia,aL as Js,n as Pr,aM as el,aN as Dr,aO as oa,aP as tl,aQ as cn,aR as aa,aS as ft,aT as vt,aU as mn,aV as nl,aW as rl,aX as il,aY as ol,aZ as al,a_ as oi,a$ as sl,b0 as ll,b1 as ul,b2 as nr,b3 as cl,b4 as sa,b5 as fl,b6 as dl,b7 as pl,b8 as hl,b9 as ml,ba as rr,bb as gl,bc as yl,bd as xl,be as Ii,bf as Ri,bg as Ci,bh as Ni,bi as vl,bj as bl,bk as wl,bl as kl,bm as Tl,bn as qn,bo as _l,bp as la,bq as El,br as Ml,bs as Al,bt as Sl,bu as ua,bv as jn,bw as ca,bx as ai,by as si,bz as Il,bA as ir,bB as Rl,bC as Cl}from"./index-D55VqdU4.js";import{getImportUrlBundles as Nl}from"./import-url-browser-CPN8ipMD.js";import{s as Gt,c as Li,u as Ll,g as Pl}from"./speech-BtNOtIn9.js";import{u as or}from"./queue-CugJlP7m.js";import{u as Dl,a as Ol,b as Fl,l as Bl}from"./queues-DEEIdmXP.js";import{l as zl,u as li}from"./providers-DAp1566d.js";import{s as Ul}from"./index-D975M2PQ.js";import{u as jl}from"./airi-card-TTCASwDd.js";import{_ as Vl,a as Hl,r as on}from"./Model.vue_vue_type_script_setup_true_lang-BILK6cfC.js";import{_ as ui}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-BbB31kj-.js";import{_ as Pi}from"./Collapsable.vue_vue_type_script_setup_true_lang-BDoHyduV.js";import{H as $l}from"./HeaderLink-Dfy3ZEHa.js";import{_ as fa}from"./Basic.vue_vue_type_script_setup_true_lang-DJ4kS-zi.js";import{u as da}from"./consciousness-BGmbU4M0.js";import{d as Di}from"./index-DO1ex3N6.js";import{b as Oi}from"./route-block-B_A1xBdJ.js";import"./duckdb-mvp-CaaD-olE.js";import"./index-Be1NqeGb.js";async function*Gl(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 Yl(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 Kl(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 ql(t,e="linear"){switch(e){case"linear":return Yl(t);case"minmax":return Kl(t)}}const pa=Gn("AudioContext",()=>({audioContext:new AudioContext,calculateVolume:ql})),Wl=Gn("SpeakingStore",()=>{const n=W(0),r=W(!1),i=je(()=>r.value?(30+70*n.value)/100:30);return{mouthOpenSize:n,nowSpeaking:r,nowSpeakingAvatarBorderOpacity:i}});function _n(t,e,n){return e+n<0||e+n>=t.length-1?"":t[e+n]}function Xl(t){let e="literal",n="";return{async consume(r){var i,o,a;for(let s=0;s"?(l+=_n(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 Zl=Gn("llm",()=>{async function t(n,r,i,o){const a=o==null?void 0:o.headers;return await Ul({...r.chat(n),messages:i,headers:a})}async function e(n,r){if(n==="")return[];try{return await zl({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}}),St=Gn("chat",()=>{const{stream:t}=Zl(),{systemPrompt:e}=Ke(jl()),n=W(!1),r=W([]),i=W([]),o=W([]),a=W([]),s=W([]),l=W([]),u=W([]),c=W([]);function f(h){r.value.push(h)}function p(h){i.value.push(h)}function d(h){o.value.push(h)}function y(h){a.value.push(h)}function x(h){s.value.push(h)}function v(h){l.value.push(h)}function k(h){u.value.push(h)}function A(h){c.value.push(h)}const E=W([{role:"system",content:e.value}]),C=W({role:"assistant",content:""});async function P(h,I){var b;try{if(n.value=!0,!h)return;for(const D of r.value)await D(h);C.value={role:"assistant",content:""},E.value.push({role:"user",content:h}),E.value.push(C.value);const g=E.value.slice(0,E.value.length-1).map(D=>Is(D));for(const D of i.value)await D(h);for(const D of o.value)await D(h);const m=((b=I.providerConfig)==null?void 0:b.headers)||{},T=await t(I.model,I.chatProvider,g,{headers:m});for(const D of a.value)await D(h);let S="";const B=Xl({onLiteral:async D=>{for(const F of s.value)await F(D);C.value.content+=D},onSpecial:async D=>{for(const F of l.value)await F(D)}});for await(const D of Gl(T.textStream,async F=>F))S+=D,await B.consume(D);await B.end();for(const D of u.value)await D();for(const D of c.value)await D(S);console.debug("LLM output:",S)}catch(g){throw console.error("Error sending message:",g),g}finally{n.value=!1}}return{sending:n,messages:E,streamingMessage:C,send:P,onBeforeMessageComposed:f,onAfterMessageComposed:p,onBeforeSend:d,onAfterSend:y,onTokenLiteral:x,onTokenSpecial:v,onStreamEnd:k,onAssistantResponseEnd:A}}),ha=Fe({__name:"Screen",setup(t){const e=W(),n=Rs(Ns),{width:r,height:i}=Cs(),o=Zr(e,{immediate:!0,windowResize:!0,reset:!0}),a=je(()=>n.between("sm","md").value||n.smaller("sm").value),s=je(()=>n.between("md","lg").value),l=je(()=>n.greaterOrEqual("lg").value),u=je(()=>l.value?o.width.value:a.value||s.value?r.value-16:o.width.value),c=W(0);return Be([r,i,e],()=>{var p,d;const f=(d=(p=e.value)==null?void 0:p.parentElement)==null?void 0:d.getBoundingClientRect();l.value||a.value||s.value?c.value=(f==null?void 0:f.height)||0:c.value=600}),Be([o.width,o.height],()=>{l.value||a.value||s.value?c.value=o.height.value:c.value=600}),pn(async()=>{e.value&&o.update()}),(f,p)=>(Z(),re("div",{ref_key:"containerRef",ref:e,"h-full":"","w-full":""},[gn(f.$slots,"default",{width:u.value,height:c.value})],512))}}),Ql={absolute:"",bottom:"3",right:"3"},Jl={flex:"~ row","cursor-pointer":""},eu=["checked","aria-checked"],tu={key:0,"min-w":"50vw",z:"(Z(),Xt(ha,{relative:""},{default:Ue(({width:a,height:s})=>[ke(Hl,{width:a,height:s},{default:Ue(({app:l})=>[ke(Vl,{app:l,"mouth-open-size":t.mouthOpenSize,width:a,height:s,paused:t.paused},null,8,["app","mouth-open-size","width","height","paused"])]),_:2},1032,["width","height"]),O("div",Ql,[O("div",Jl,[O("label",{class:st([n.value?"bg-neutral-300 dark:bg-neutral-200":"bg-neutral-100 dark:bg-neutral-700"]),transition:"all ease-in-out duration-500",text:"lg neutral-500 dark:neutral-400","m-1":"","h-fit":"","w-fit":"","cursor-pointer":"","appearance-none":"","gap-1":"","rounded-lg":"","rounded-md":"","border-none":"","p-2":"","outline-none":""},[Et(O("input",{"onUpdate:modelValue":o[0]||(o[0]=l=>n.value=l),checked:n.value,"aria-checked":n.value,name:"showLive2DViewerInspector",type:"checkbox",hidden:"","appearance-none":"","outline-none":""},null,8,eu),[[Qr,n.value]]),o[8]||(o[8]=O("div",{"select-none":""},[O("div",{"i-solar:bug-bold-duotone":""})],-1))],2)]),ke(ui,null,{default:Ue(()=>[n.value?(Z(),re("div",tu,[O("div",nu,[O("div",ru,[O("span",null,he(V(e)("stage.viewers.debug-menu.emotions")),1)]),O("div",iu,[O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[1]||(o[1]=l=>r.value={group:"Surprise",index:0})},he(V(e)("stage.viewers.debug-menu.emotions-btn.surprised")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[2]||(o[2]=l=>r.value={group:"Sad",index:0})},he(V(e)("stage.viewers.debug-menu.emotions-btn.sad")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[3]||(o[3]=l=>r.value={group:"Angry",index:0})},he(V(e)("stage.viewers.debug-menu.emotions-btn.angry")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[4]||(o[4]=l=>r.value={group:"Happy",index:0})},he(V(e)("stage.viewers.debug-menu.emotions-btn.happy")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[5]||(o[5]=l=>r.value={group:"Awkward",index:0})},he(V(e)("stage.viewers.debug-menu.emotions-btn.awkward")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[6]||(o[6]=l=>r.value={group:"Question",index:0})},he(V(e)("stage.viewers.debug-menu.emotions-btn.question")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[7]||(o[7]=l=>r.value={group:"Think",index:0})},he(V(e)("stage.viewers.debug-menu.emotions-btn.think")),1)])])])):it("",!0)]),_:1})])]),_:1}))}});var au=Object.defineProperty,su=(t,e,n)=>e in t?au(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,lu=(t,e,n)=>su(t,e+"",n);function uu(t){return Vs()?(Hs(t),!0):!1}function ma(t){return typeof t=="function"?t():V(t)}const cu=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const fu=Object.prototype.toString,du=t=>fu.call(t)==="[object Object]",pu=()=>{},hu=cu?window:void 0;function mu(t){var e;const n=ma(t);return(e=n==null?void 0:n.$el)!=null?e:n}function ar(...t){let e,n,r,i;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,r,i]=t,e=hu):[e,n,r,i]=t,!e)return pu;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const o=[],a=()=>{o.forEach(c=>c()),o.length=0},s=(c,f,p,d)=>(c.addEventListener(f,p,d),()=>c.removeEventListener(f,p,d)),l=Be(()=>[mu(e),ma(i)],([c,f])=>{if(a(),!c)return;const p=du(f)?{...f}:f;o.push(...n.flatMap(d=>r.map(y=>s(c,d,y,p))))},{immediate:!0,flush:"post"}),u=()=>{l(),a()};return uu(u),u}function ga(t,e,n,r){const i=class extends yn{constructor(o={}){const a=Object.entries(t);super({uniforms:a.reduce((s,[l,u])=>{const c=ni.clone({[l]:{value:u}});return{...s,...c}},{}),vertexShader:e,fragmentShader:n}),lu(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=Dt.generateUUID(),i}ga({color:new ze("white"),scale:new Pe(1,1),imageBounds:new Pe(1,1),resolution:1024,map:null,zoom:1,radius:0,grayscale:0,opacity:1},` varying vec2 vUv; varying vec2 vPos; void main() { @@ -53,7 +53,7 @@ import{V as vs,a as bs,c as ws,r as ks,b as Cr,d as Ts,E as Ei,e as _s,f as As,g #include #include } - `);const ci=parseInt(Gs.replace(/\D+/g,""));var gu=Object.defineProperty,yu=(t,e,n)=>e in t?gu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,xu=(t,e,n)=>(yu(t,e+"",n),n);async function Bi(t){const e=await t.arrayBuffer(),n=btoa(String.fromCharCode(...new Uint8Array(e)));return`data:${t.type||""};base64,${n}`}let An,sr,Ft,En;function lr(t,e=1/0,n=null){sr||(sr=new Zo(2,2,1,1)),Ft||(Ft=new yn({uniforms:{blitTexture:new Qs(t)},vertexShader:` + `);const ci=parseInt($s.replace(/\D+/g,""));var gu=Object.defineProperty,yu=(t,e,n)=>e in t?gu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,xu=(t,e,n)=>(yu(t,e+"",n),n);async function Fi(t){const e=await t.arrayBuffer(),n=btoa(String.fromCharCode(...new Uint8Array(e)));return`data:${t.type||""};base64,${n}`}let En,sr,Bt,Mn;function lr(t,e=1/0,n=null){sr||(sr=new Qo(2,2,1,1)),Bt||(Bt=new yn({uniforms:{blitTexture:new Zs(t)},vertexShader:` varying vec2 vUv; void main(){ vUv = uv; @@ -72,7 +72,7 @@ import{V as vs,a as bs,c as ws,r as ks,b as Cr,d as Ts,E as Ei,e as _s,f as As,g gl_FragColor = texture2D( blitTexture, vUv); #endif } - `})),Ft.uniforms.blitTexture.value=t,Ft.defines.IS_SRGB="colorSpace"in t?t.colorSpace==="srgb":t.encoding===3001,Ft.needsUpdate=!0,En||(En=new Pt(sr,Ft),En.frustrumCulled=!1);const r=new Et,i=new Lr;i.add(En),n||(n=An=new Zs({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 Fn(n.domElement);return o.minFilter=t.minFilter,o.magFilter=t.magFilter,o.wrapS=t.wrapS,o.wrapT=t.wrapT,o.name=t.name,An&&(An.dispose(),An=null),o}const Fi={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 ya{constructor(){this.pluginCallbacks=[],this.register(function(e){return new Su(e)}),this.register(function(e){return new Iu(e)}),this.register(function(e){return new Nu(e)}),this.register(function(e){return new Lu(e)}),this.register(function(e){return new Pu(e)}),this.register(function(e){return new Du(e)}),this.register(function(e){return new Ru(e)}),this.register(function(e){return new Cu(e)}),this.register(function(e){return new Ou(e)}),this.register(function(e){return new Bu(e)}),this.register(function(e){return new Fu(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 Mu,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=Dt.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 xa(t){return Math.ceil(t/4)*4}function cr(t,e=0){const n=xa(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 Hi(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})}class Mu{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),f=Object.keys(l);c.length>0&&(a.extensionsUsed=c),f.length>0&&(a.extensionsRequired=f),a.buffers&&a.buffers.length>0&&(a.buffers[0].byteLength=u.size),r.binary===!0?u.arrayBuffer().then(p=>{const d=cr(p),y=new DataView(new ArrayBuffer(ji));y.setUint32(0,d.byteLength,!0),y.setUint32(4,Tu,!0);const x=cr(_u(JSON.stringify(a)),32),v=new DataView(new ArrayBuffer(ji));v.setUint32(0,x.byteLength,!0),v.setUint32(4,ku,!0);const k=new ArrayBuffer(Ui),M=new DataView(k);M.setUint32(0,bu,!0),M.setUint32(4,wu,!0);const A=Ui+v.byteLength+x.byteLength+y.byteLength+d.byteLength;M.setUint32(8,A,!0),new Blob([k,v,x,y,d],{type:"application/octet-stream"}).arrayBuffer().then(n)}):a.buffers&&a.buffers.length>0?Bi(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 ae;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 ae;for(let o=0,a=r.count;o4?y=e.array[p*e.itemSize+d]:(d===0?y=e.getX(p):d===1?y=e.getY(p):d===2?y=e.getZ(p):d===3&&(y=e.getW(p)),e.normalized===!0&&(y=Dt.normalize(y,e.array))),n===pe.FLOAT?u.setFloat32(c,y,!0):n===pe.INT?u.setInt32(c,y,!0):n===pe.UNSIGNED_INT?u.setUint32(c,y,!0):n===pe.SHORT?u.setInt16(c,y,!0):n===pe.UNSIGNED_SHORT?u.setUint16(c,y,!0):n===pe.BYTE?u.setInt8(c,y):n===pe.UNSIGNED_BYTE&&u.setUint8(c,y),c+=s}const f={buffer:this.processBuffer(u.buffer),byteOffset:this.byteOffset,byteLength:l};return o!==void 0&&(f.target=o),o===pe.ARRAY_BUFFER&&(f.byteStride=e.itemSize*s),this.byteOffset+=l,a.bufferViews.push(f),{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=cr(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=pe.FLOAT;else if(e.array.constructor===Int32Array)s=pe.INT;else if(e.array.constructor===Uint32Array)s=pe.UNSIGNED_INT;else if(e.array.constructor===Int16Array)s=pe.SHORT;else if(e.array.constructor===Uint16Array)s=pe.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)s=pe.BYTE;else if(e.array.constructor===Uint8Array)s=pe.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=Eu(e,r,i);let u;n!==void 0&&(u=e===n.index?pe.ELEMENT_ARRAY_BUFFER:pe.ARRAY_BUFFER);const c=this.processBufferView(e,s,r,i,u),f={bufferView:c.id,byteOffset:c.byteOffset,componentType:s,count:i,max:l.max,min:l.min,type:a[e.itemSize]};return e.normalized===!0&&(f.normalized=!0),o.accessors||(o.accessors=[]),o.accessors.push(f)-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),f=i+":flipY/"+r.toString();if(c[f]!==void 0)return c[f];s.images||(s.images=[]);const p={mimeType:i},d=Vi();d.width=Math.min(e.width,l.maxTextureSize),d.height=Math.min(e.height,l.maxTextureSize);const y=d.getContext("2d");if(r===!0&&(y.translate(0,d.height),y.scale(1,-1)),e.data!==void 0){n!==Nr&&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 k=0;ko.processBufferViewImage(v)).then(v=>{p.bufferView=v})):d.toDataURL!==void 0?p.uri=d.toDataURL(i):u.push(Hi(d,i).then(Bi).then(v=>{p.uri=v}));const x=s.images.push(p)-1;return c[f]=x,x}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:Je[e.magFilter],minFilter:Je[e.minFilter],wrapS:Je[e.wrapS],wrapT:Je[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 er&&(e=lr(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(un(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===qn&&(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 A=0,C=e.material.length;A=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"},d=a.getAttribute("normal");d!==void 0&&!this.isNormalizedNormalAttribute(d)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),a.setAttribute("normal",this.createNormalizedNormalAttribute(d)));let y=null;for(let A in a.attributes){if(A.slice(0,5)==="morph")continue;const C=a.attributes[A];if(A=p[A]||A.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(A)||(A="_"+A),n.attributes.has(this.getUID(C))){u[A]=n.attributes.get(this.getUID(C));continue}y=null;const P=C.array;A==="JOINTS_0"&&!(P instanceof Uint16Array)&&!(P instanceof Uint8Array)&&(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),y=new Nt(new Uint16Array(P),C.itemSize,C.normalized));const h=this.processAccessor(y||C,a);h!==null&&(A.startsWith("_")||this.detectMeshQuantization(A,C),u[A]=h,n.attributes.set(this.getUID(C),h))}if(d!==void 0&&a.setAttribute("normal",d),Object.keys(u).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){const A=[],C=[],P={};if(e.morphTargetDictionary!==void 0)for(const h in e.morphTargetDictionary)P[e.morphTargetDictionary[h]]=h;for(let h=0;h0&&(l.extras={},l.extras.targetNames=C)}const x=Array.isArray(e.material);if(x&&a.groups.length===0)return null;const v=x?e.material:[e.material],k=x?a.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let A=0,C=k.length;A0&&(P.targets=f),a.index!==null){let I=this.getUID(a.index);(k[A].start!==void 0||k[A].count!==void 0)&&(I+=":"+k[A].start+":"+k[A].count),n.attributes.has(I)?P.indices=n.attributes.get(I):(P.indices=this.processAccessor(a.index,a,k[A].start,k[A].count),n.attributes.set(I,P.indices)),P.indices===null&&delete P.indices}const h=this.processMaterial(v[k[A].materialIndex]);h!==null&&(P.material=h),c.push(P)}l.primitives=c,r.meshes||(r.meshes=[]),this._invokeAll(function(A){A.writeMesh&&A.writeMesh(e,l)});const M=r.meshes.push(l)-1;return n.meshes.set(o,M),M}detectMeshQuantization(e,n){if(this.extensionsUsed[ur])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];Fi[i]&&Fi[i].includes(r)&&(this.extensionsUsed[ur]=!0,this.extensionsRequired[ur]=!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:Dt.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=ya.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 Lr;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 Iu=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}},Ru=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}},Cu=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}},Nu=class{constructor(t){this.writer=t,this.name="KHR_materials_transmission"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.transmission===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.transmissionFactor=t.transmission,t.transmissionMap){const o={index:n.processTexture(t.transmissionMap),texCoord:t.transmissionMap.channel};n.applyTextureTransform(o,t.transmissionMap),i.transmissionTexture=o}e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Lu=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}},Pu=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}},Du=class{constructor(t){this.writer=t,this.name="KHR_materials_specular"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.specularIntensity===1&&t.specularColor.equals(vu)&&!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}},Ou=class{constructor(t){this.writer=t,this.name="KHR_materials_sheen"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.sheen==0)return;const n=this.writer,r=n.extensionsUsed,i={};if(t.sheenRoughnessMap){const o={index:n.processTexture(t.sheenRoughnessMap),texCoord:t.sheenRoughnessMap.channel};n.applyTextureTransform(o,t.sheenRoughnessMap),i.sheenRoughnessTexture=o}if(t.sheenColorMap){const o={index:n.processTexture(t.sheenColorMap),texCoord:t.sheenColorMap.channel};n.applyTextureTransform(o,t.sheenColorMap),i.sheenColorTexture=o}i.sheenRoughnessFactor=t.sheenRoughness,i.sheenColorFactor=t.sheenColor.toArray(),e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Bu=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}},Fu=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 xn=Uint8Array,va=Uint16Array,zu=Uint32Array,Uu=new xn([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]),ju=new xn([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]),ba=function(t,e){for(var n=new va(31),r=0;r<31;++r)n[r]=e+=1<>>1|(Ne&21845)<<1;wt=(wt&52428)>>>2|(wt&13107)<<2,wt=(wt&61680)>>>4|(wt&3855)<<4,Gu[Ne]=((wt&65280)>>>8|(wt&255)<<8)>>>1}var Wn=new xn(288);for(var Ne=0;Ne<144;++Ne)Wn[Ne]=8;for(var Ne=144;Ne<256;++Ne)Wn[Ne]=9;for(var Ne=256;Ne<280;++Ne)Wn[Ne]=7;for(var Ne=280;Ne<288;++Ne)Wn[Ne]=8;var $u=new xn(32);for(var Ne=0;Ne<32;++Ne)$u[Ne]=5;var Yu=new xn(0),qu=typeof TextDecoder<"u"&&new TextDecoder,Ku=0;try{qu.decode(Yu,{stream:!0}),Ku=1}catch{}var Wu=Object.defineProperty,Xu=(t,e,n)=>e in t?Wu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Qu=(t,e,n)=>(Xu(t,e+"",n),n);const ka=class extends Pt{constructor(t,e={}){super(t),this.isReflector=!0,this.type="Reflector",this.camera=new Et;const n=this,r=e.color!==void 0?new ze(e.color):new ze(8355711),i=e.textureWidth||512,o=e.textureHeight||512,a=e.clipBias||0,s=e.shader||ka.ReflectorShader,l=e.multisample!==void 0?e.multisample:4,u=new qo,c=new ae,f=new ae,p=new ae,d=new xt,y=new ae(0,0,-1),x=new Mt,v=new ae,k=new ae,M=new Mt,A=new xt,C=this.camera,P=new Ys(i,o,{samples:l,type:qs}),h=new yn({uniforms:ni.clone(s.uniforms),fragmentShader:s.fragmentShader,vertexShader:s.vertexShader});h.uniforms.tDiffuse.value=P.texture,h.uniforms.color.value=r,h.uniforms.textureMatrix.value=A,this.material=h,this.onBeforeRender=function(I,b,g){if(f.setFromMatrixPosition(n.matrixWorld),p.setFromMatrixPosition(g.matrixWorld),d.extractRotation(n.matrixWorld),c.set(0,0,1),c.applyMatrix4(d),v.subVectors(f,p),v.dot(c)>0)return;v.reflect(c).negate(),v.add(f),d.extractRotation(g.matrixWorld),y.set(0,0,-1),y.applyMatrix4(d),y.add(p),k.subVectors(f,y),k.reflect(c).negate(),k.add(f),C.position.copy(v),C.up.set(0,1,0),C.up.applyMatrix4(d),C.up.reflect(c),C.lookAt(k),C.far=g.far,C.updateMatrixWorld(),C.projectionMatrix.copy(g.projectionMatrix),A.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),A.multiply(C.projectionMatrix),A.multiply(C.matrixWorldInverse),A.multiply(n.matrixWorld),u.setFromNormalAndCoplanarPoint(c,f),u.applyMatrix4(C.matrixWorldInverse),x.set(u.normal.x,u.normal.y,u.normal.z,u.constant);const m=C.projectionMatrix;M.x=(Math.sign(x.x)+m.elements[8])/m.elements[0],M.y=(Math.sign(x.y)+m.elements[9])/m.elements[5],M.z=-1,M.w=(1+m.elements[10])/m.elements[14],x.multiplyScalar(2/x.dot(M)),m.elements[2]=x.x,m.elements[6]=x.y,m.elements[10]=x.z+1-a,m.elements[14]=x.w,n.visible=!1;const T=I.getRenderTarget(),S=I.xr.enabled,F=I.shadowMap.autoUpdate,D=I.toneMapping;let B=!1;"outputColorSpace"in I?B=I.outputColorSpace==="srgb":B=I.outputEncoding===3001,I.xr.enabled=!1,I.shadowMap.autoUpdate=!1,"outputColorSpace"in I?I.outputColorSpace="srgb-linear":I.outputEncoding=3e3,I.toneMapping=Ks,I.setRenderTarget(P),I.state.buffers.depth.setMask(!0),I.autoClear===!1&&I.clear(),I.render(b,C),I.xr.enabled=S,I.shadowMap.autoUpdate=F,I.toneMapping=D,"outputColorSpace"in I?I.outputColorSpace=B?"srgb":"srgb-linear":I.outputEncoding=B?3001:3e3,I.setRenderTarget(T);const j=g.viewport;j!==void 0&&I.state.viewport(j),n.visible=!0},this.getRenderTarget=function(){return P},this.dispose=function(){P.dispose(),n.material.dispose()}}};let Or=ka;Qu(Or,"ReflectorShader",{uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:` + `})),Bt.uniforms.blitTexture.value=t,Bt.defines.IS_SRGB="colorSpace"in t?t.colorSpace==="srgb":t.encoding===3001,Bt.needsUpdate=!0,Mn||(Mn=new Pt(sr,Bt),Mn.frustrumCulled=!1);const r=new Mt,i=new Lr;i.add(Mn),n||(n=En=new Qs({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 Bn(n.domElement);return o.minFilter=t.minFilter,o.magFilter=t.magFilter,o.wrapS=t.wrapS,o.wrapT=t.wrapT,o.name=t.name,En&&(En.dispose(),En=null),o}const Bi={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 ya{constructor(){this.pluginCallbacks=[],this.register(function(e){return new Su(e)}),this.register(function(e){return new Iu(e)}),this.register(function(e){return new Nu(e)}),this.register(function(e){return new Lu(e)}),this.register(function(e){return new Pu(e)}),this.register(function(e){return new Du(e)}),this.register(function(e){return new Ru(e)}),this.register(function(e){return new Cu(e)}),this.register(function(e){return new Ou(e)}),this.register(function(e){return new Fu(e)}),this.register(function(e){return new Bu(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 Au,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=Dt.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 xa(t){return Math.ceil(t/4)*4}function cr(t,e=0){const n=xa(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 Hi(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})}class Au{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),f=Object.keys(l);c.length>0&&(a.extensionsUsed=c),f.length>0&&(a.extensionsRequired=f),a.buffers&&a.buffers.length>0&&(a.buffers[0].byteLength=u.size),r.binary===!0?u.arrayBuffer().then(p=>{const d=cr(p),y=new DataView(new ArrayBuffer(ji));y.setUint32(0,d.byteLength,!0),y.setUint32(4,Tu,!0);const x=cr(_u(JSON.stringify(a)),32),v=new DataView(new ArrayBuffer(ji));v.setUint32(0,x.byteLength,!0),v.setUint32(4,ku,!0);const k=new ArrayBuffer(Ui),A=new DataView(k);A.setUint32(0,bu,!0),A.setUint32(4,wu,!0);const E=Ui+v.byteLength+x.byteLength+y.byteLength+d.byteLength;A.setUint32(8,E,!0),new Blob([k,v,x,y,d],{type:"application/octet-stream"}).arrayBuffer().then(n)}):a.buffers&&a.buffers.length>0?Fi(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 ae;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 ae;for(let o=0,a=r.count;o4?y=e.array[p*e.itemSize+d]:(d===0?y=e.getX(p):d===1?y=e.getY(p):d===2?y=e.getZ(p):d===3&&(y=e.getW(p)),e.normalized===!0&&(y=Dt.normalize(y,e.array))),n===pe.FLOAT?u.setFloat32(c,y,!0):n===pe.INT?u.setInt32(c,y,!0):n===pe.UNSIGNED_INT?u.setUint32(c,y,!0):n===pe.SHORT?u.setInt16(c,y,!0):n===pe.UNSIGNED_SHORT?u.setUint16(c,y,!0):n===pe.BYTE?u.setInt8(c,y):n===pe.UNSIGNED_BYTE&&u.setUint8(c,y),c+=s}const f={buffer:this.processBuffer(u.buffer),byteOffset:this.byteOffset,byteLength:l};return o!==void 0&&(f.target=o),o===pe.ARRAY_BUFFER&&(f.byteStride=e.itemSize*s),this.byteOffset+=l,a.bufferViews.push(f),{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=cr(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=pe.FLOAT;else if(e.array.constructor===Int32Array)s=pe.INT;else if(e.array.constructor===Uint32Array)s=pe.UNSIGNED_INT;else if(e.array.constructor===Int16Array)s=pe.SHORT;else if(e.array.constructor===Uint16Array)s=pe.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)s=pe.BYTE;else if(e.array.constructor===Uint8Array)s=pe.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=Mu(e,r,i);let u;n!==void 0&&(u=e===n.index?pe.ELEMENT_ARRAY_BUFFER:pe.ARRAY_BUFFER);const c=this.processBufferView(e,s,r,i,u),f={bufferView:c.id,byteOffset:c.byteOffset,componentType:s,count:i,max:l.max,min:l.min,type:a[e.itemSize]};return e.normalized===!0&&(f.normalized=!0),o.accessors||(o.accessors=[]),o.accessors.push(f)-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),f=i+":flipY/"+r.toString();if(c[f]!==void 0)return c[f];s.images||(s.images=[]);const p={mimeType:i},d=Vi();d.width=Math.min(e.width,l.maxTextureSize),d.height=Math.min(e.height,l.maxTextureSize);const y=d.getContext("2d");if(r===!0&&(y.translate(0,d.height),y.scale(1,-1)),e.data!==void 0){n!==Nr&&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 k=0;ko.processBufferViewImage(v)).then(v=>{p.bufferView=v})):d.toDataURL!==void 0?p.uri=d.toDataURL(i):u.push(Hi(d,i).then(Fi).then(v=>{p.uri=v}));const x=s.images.push(p)-1;return c[f]=x,x}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:Je[e.magFilter],minFilter:Je[e.minFilter],wrapS:Je[e.wrapS],wrapT:Je[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 er&&(e=lr(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(un(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===Kn&&(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 E=0,C=e.material.length;E=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"},d=a.getAttribute("normal");d!==void 0&&!this.isNormalizedNormalAttribute(d)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),a.setAttribute("normal",this.createNormalizedNormalAttribute(d)));let y=null;for(let E in a.attributes){if(E.slice(0,5)==="morph")continue;const C=a.attributes[E];if(E=p[E]||E.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(E)||(E="_"+E),n.attributes.has(this.getUID(C))){u[E]=n.attributes.get(this.getUID(C));continue}y=null;const P=C.array;E==="JOINTS_0"&&!(P instanceof Uint16Array)&&!(P instanceof Uint8Array)&&(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),y=new Nt(new Uint16Array(P),C.itemSize,C.normalized));const h=this.processAccessor(y||C,a);h!==null&&(E.startsWith("_")||this.detectMeshQuantization(E,C),u[E]=h,n.attributes.set(this.getUID(C),h))}if(d!==void 0&&a.setAttribute("normal",d),Object.keys(u).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){const E=[],C=[],P={};if(e.morphTargetDictionary!==void 0)for(const h in e.morphTargetDictionary)P[e.morphTargetDictionary[h]]=h;for(let h=0;h0&&(l.extras={},l.extras.targetNames=C)}const x=Array.isArray(e.material);if(x&&a.groups.length===0)return null;const v=x?e.material:[e.material],k=x?a.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let E=0,C=k.length;E0&&(P.targets=f),a.index!==null){let I=this.getUID(a.index);(k[E].start!==void 0||k[E].count!==void 0)&&(I+=":"+k[E].start+":"+k[E].count),n.attributes.has(I)?P.indices=n.attributes.get(I):(P.indices=this.processAccessor(a.index,a,k[E].start,k[E].count),n.attributes.set(I,P.indices)),P.indices===null&&delete P.indices}const h=this.processMaterial(v[k[E].materialIndex]);h!==null&&(P.material=h),c.push(P)}l.primitives=c,r.meshes||(r.meshes=[]),this._invokeAll(function(E){E.writeMesh&&E.writeMesh(e,l)});const A=r.meshes.push(l)-1;return n.meshes.set(o,A),A}detectMeshQuantization(e,n){if(this.extensionsUsed[ur])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];Bi[i]&&Bi[i].includes(r)&&(this.extensionsUsed[ur]=!0,this.extensionsRequired[ur]=!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:Dt.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=ya.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 Lr;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 Iu=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}},Ru=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}},Cu=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}},Nu=class{constructor(t){this.writer=t,this.name="KHR_materials_transmission"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.transmission===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.transmissionFactor=t.transmission,t.transmissionMap){const o={index:n.processTexture(t.transmissionMap),texCoord:t.transmissionMap.channel};n.applyTextureTransform(o,t.transmissionMap),i.transmissionTexture=o}e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Lu=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}},Pu=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}},Du=class{constructor(t){this.writer=t,this.name="KHR_materials_specular"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.specularIntensity===1&&t.specularColor.equals(vu)&&!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}},Ou=class{constructor(t){this.writer=t,this.name="KHR_materials_sheen"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.sheen==0)return;const n=this.writer,r=n.extensionsUsed,i={};if(t.sheenRoughnessMap){const o={index:n.processTexture(t.sheenRoughnessMap),texCoord:t.sheenRoughnessMap.channel};n.applyTextureTransform(o,t.sheenRoughnessMap),i.sheenRoughnessTexture=o}if(t.sheenColorMap){const o={index:n.processTexture(t.sheenColorMap),texCoord:t.sheenColorMap.channel};n.applyTextureTransform(o,t.sheenColorMap),i.sheenColorTexture=o}i.sheenRoughnessFactor=t.sheenRoughness,i.sheenColorFactor=t.sheenColor.toArray(),e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Fu=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}},Bu=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 xn=Uint8Array,va=Uint16Array,zu=Uint32Array,Uu=new xn([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]),ju=new xn([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]),ba=function(t,e){for(var n=new va(31),r=0;r<31;++r)n[r]=e+=1<>>1|(Ne&21845)<<1;wt=(wt&52428)>>>2|(wt&13107)<<2,wt=(wt&61680)>>>4|(wt&3855)<<4,$u[Ne]=((wt&65280)>>>8|(wt&255)<<8)>>>1}var Wn=new xn(288);for(var Ne=0;Ne<144;++Ne)Wn[Ne]=8;for(var Ne=144;Ne<256;++Ne)Wn[Ne]=9;for(var Ne=256;Ne<280;++Ne)Wn[Ne]=7;for(var Ne=280;Ne<288;++Ne)Wn[Ne]=8;var Gu=new xn(32);for(var Ne=0;Ne<32;++Ne)Gu[Ne]=5;var Yu=new xn(0),Ku=typeof TextDecoder<"u"&&new TextDecoder,qu=0;try{Ku.decode(Yu,{stream:!0}),qu=1}catch{}var Wu=Object.defineProperty,Xu=(t,e,n)=>e in t?Wu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Zu=(t,e,n)=>(Xu(t,e+"",n),n);const ka=class extends Pt{constructor(t,e={}){super(t),this.isReflector=!0,this.type="Reflector",this.camera=new Mt;const n=this,r=e.color!==void 0?new ze(e.color):new ze(8355711),i=e.textureWidth||512,o=e.textureHeight||512,a=e.clipBias||0,s=e.shader||ka.ReflectorShader,l=e.multisample!==void 0?e.multisample:4,u=new Ko,c=new ae,f=new ae,p=new ae,d=new xt,y=new ae(0,0,-1),x=new At,v=new ae,k=new ae,A=new At,E=new xt,C=this.camera,P=new Ys(i,o,{samples:l,type:Ks}),h=new yn({uniforms:ni.clone(s.uniforms),fragmentShader:s.fragmentShader,vertexShader:s.vertexShader});h.uniforms.tDiffuse.value=P.texture,h.uniforms.color.value=r,h.uniforms.textureMatrix.value=E,this.material=h,this.onBeforeRender=function(I,b,g){if(f.setFromMatrixPosition(n.matrixWorld),p.setFromMatrixPosition(g.matrixWorld),d.extractRotation(n.matrixWorld),c.set(0,0,1),c.applyMatrix4(d),v.subVectors(f,p),v.dot(c)>0)return;v.reflect(c).negate(),v.add(f),d.extractRotation(g.matrixWorld),y.set(0,0,-1),y.applyMatrix4(d),y.add(p),k.subVectors(f,y),k.reflect(c).negate(),k.add(f),C.position.copy(v),C.up.set(0,1,0),C.up.applyMatrix4(d),C.up.reflect(c),C.lookAt(k),C.far=g.far,C.updateMatrixWorld(),C.projectionMatrix.copy(g.projectionMatrix),E.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),E.multiply(C.projectionMatrix),E.multiply(C.matrixWorldInverse),E.multiply(n.matrixWorld),u.setFromNormalAndCoplanarPoint(c,f),u.applyMatrix4(C.matrixWorldInverse),x.set(u.normal.x,u.normal.y,u.normal.z,u.constant);const m=C.projectionMatrix;A.x=(Math.sign(x.x)+m.elements[8])/m.elements[0],A.y=(Math.sign(x.y)+m.elements[9])/m.elements[5],A.z=-1,A.w=(1+m.elements[10])/m.elements[14],x.multiplyScalar(2/x.dot(A)),m.elements[2]=x.x,m.elements[6]=x.y,m.elements[10]=x.z+1-a,m.elements[14]=x.w,n.visible=!1;const T=I.getRenderTarget(),S=I.xr.enabled,B=I.shadowMap.autoUpdate,D=I.toneMapping;let F=!1;"outputColorSpace"in I?F=I.outputColorSpace==="srgb":F=I.outputEncoding===3001,I.xr.enabled=!1,I.shadowMap.autoUpdate=!1,"outputColorSpace"in I?I.outputColorSpace="srgb-linear":I.outputEncoding=3e3,I.toneMapping=qs,I.setRenderTarget(P),I.state.buffers.depth.setMask(!0),I.autoClear===!1&&I.clear(),I.render(b,C),I.xr.enabled=S,I.shadowMap.autoUpdate=B,I.toneMapping=D,"outputColorSpace"in I?I.outputColorSpace=F?"srgb":"srgb-linear":I.outputEncoding=F?3001:3e3,I.setRenderTarget(T);const j=g.viewport;j!==void 0&&I.state.viewport(j),n.visible=!0},this.getRenderTarget=function(){return P},this.dispose=function(){P.dispose(),n.material.dispose()}}};let Or=ka;Zu(Or,"ReflectorShader",{uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:` uniform mat4 textureMatrix; varying vec4 vUv; @@ -116,7 +116,7 @@ import{V as vs,a as bs,c as ws,r as ks,b as Cr,d as Ts,E as Ei,e as _s,f as As,g #include #include <${ci>=154?"colorspace_fragment":"encodings_fragment"}> - }`});var Zu=Object.defineProperty,Ju=(t,e,n)=>e in t?Zu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ta=(t,e,n)=>(Ju(t,typeof e!="symbol"?e+"":e,n),n);const Xn=new Ko,ec=new Float32Array([-1,-1,0,0,0,1,-1,0,1,0,1,1,0,1,1,-1,1,0,0,1]),_a=new Wo(ec,5);Xn.setIndex([0,1,2,0,2,3]);Xn.setAttribute("position",new ti(_a,3,0,!1));Xn.setAttribute("uv",new ti(_a,2,3,!1));const Br=class extends Pt{constructor(){super(Br.Geometry,new Vt({opacity:0,transparent:!0})),this.isLensflare=!0,this.type="Lensflare",this.frustumCulled=!1,this.renderOrder=1/0;const t=new ae,e=new ae,n=new Si(new Uint8Array(16*16*3),16,16,Nr);n.minFilter=Lt,n.magFilter=Lt,n.wrapS=Ht,n.wrapT=Ht;const r=new Si(new Uint8Array(16*16*3),16,16,Nr);r.minFilter=Lt,r.magFilter=Lt,r.wrapS=Ht,r.wrapT=Ht;const i=Br.Geometry,o=new tr({uniforms:{scale:{value:null},screenPosition:{value:null}},vertexShader:` + }`});var Qu=Object.defineProperty,Ju=(t,e,n)=>e in t?Qu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ta=(t,e,n)=>(Ju(t,typeof e!="symbol"?e+"":e,n),n);const Xn=new qo,ec=new Float32Array([-1,-1,0,0,0,1,-1,0,1,0,1,1,0,1,1,-1,1,0,0,1]),_a=new Wo(ec,5);Xn.setIndex([0,1,2,0,2,3]);Xn.setAttribute("position",new ti(_a,3,0,!1));Xn.setAttribute("uv",new ti(_a,2,3,!1));const Fr=class extends Pt{constructor(){super(Fr.Geometry,new Vt({opacity:0,transparent:!0})),this.isLensflare=!0,this.type="Lensflare",this.frustumCulled=!1,this.renderOrder=1/0;const t=new ae,e=new ae,n=new Si(new Uint8Array(16*16*3),16,16,Nr);n.minFilter=Lt,n.magFilter=Lt,n.wrapS=Ht,n.wrapT=Ht;const r=new Si(new Uint8Array(16*16*3),16,16,Nr);r.minFilter=Lt,r.magFilter=Lt,r.wrapS=Ht,r.wrapT=Ht;const i=Fr.Geometry,o=new tr({uniforms:{scale:{value:null},screenPosition:{value:null}},vertexShader:` precision highp float; @@ -167,7 +167,7 @@ import{V as vs,a as bs,c as ws,r as ks,b as Cr,d as Ts,E as Ei,e as _s,f as As,g gl_FragColor = texture2D( map, vUV ); - }`,depthTest:!1,depthWrite:!1,transparent:!1}),s=new Pt(i,o),l=[],u=Aa.Shader,c=new tr({uniforms:{map:{value:null},occlusionMap:{value:r},color:{value:new ze(16777215)},scale:{value:new Pe},screenPosition:{value:new ae}},vertexShader:u.vertexShader,fragmentShader:u.fragmentShader,blending:Ws,transparent:!0,depthWrite:!1}),f=new Pt(i,c);this.addElement=function(v){l.push(v)};const p=new Pe,d=new Pe,y=new Xs,x=new Mt;this.onBeforeRender=function(v,k,M){v.getCurrentViewport(x);const A=x.w/x.z,C=x.z/2,P=x.w/2;let h=16/x.w;if(p.set(h*A,h),y.min.set(x.x,x.y),y.max.set(x.x+(x.z-16),x.y+(x.w-16)),e.setFromMatrixPosition(this.matrixWorld),e.applyMatrix4(M.matrixWorldInverse),!(e.z>0)&&(t.copy(e).applyMatrix4(M.projectionMatrix),d.x=x.x+t.x*C+C-8,d.y=x.y+t.y*P+P-8,y.containsPoint(d))){v.copyFramebufferToTexture(d,n);let I=o.uniforms;I.scale.value=p,I.screenPosition.value=t,v.renderBufferDirect(M,null,i,o,s,null),v.copyFramebufferToTexture(d,r),I=a.uniforms,I.scale.value=p,I.screenPosition.value=t,v.renderBufferDirect(M,null,i,a,s,null);const b=-t.x*2,g=-t.y*2;for(let m=0,T=l.length;m0)&&(t.copy(e).applyMatrix4(A.projectionMatrix),d.x=x.x+t.x*C+C-8,d.y=x.y+t.y*P+P-8,y.containsPoint(d))){v.copyFramebufferToTexture(d,n);let I=o.uniforms;I.scale.value=p,I.screenPosition.value=t,v.renderBufferDirect(A,null,i,o,s,null),v.copyFramebufferToTexture(d,r),I=a.uniforms,I.scale.value=p,I.screenPosition.value=t,v.renderBufferDirect(A,null,i,a,s,null);const b=-t.x*2,g=-t.y*2;for(let m=0,T=l.length;me in t?nc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ea=(t,e,n)=>(rc(t,typeof e!="symbol"?e+"":e,n),n);const Pn={uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new ae},up:{value:new ae(0,1,0)}},vertexShader:` + }`});var nc=Object.defineProperty,rc=(t,e,n)=>e in t?nc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ma=(t,e,n)=>(rc(t,typeof e!="symbol"?e+"":e,n),n);const Pn={uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new ae},up:{value:new ae(0,1,0)}},vertexShader:` uniform vec3 sunPosition; uniform float rayleigh; uniform float turbidity; @@ -378,8 +378,8 @@ import{V as vs,a as bs,c as ws,r as ks,b as Cr,d as Ts,E as Ei,e as _s,f as As,g #include <${ci>=154?"colorspace_fragment":"encodings_fragment"}> } - `},Ma=new yn({name:"SkyShader",fragmentShader:Pn.fragmentShader,vertexShader:Pn.vertexShader,uniforms:ni.clone(Pn.uniforms),side:Ds,depthWrite:!1});class Sa extends Pt{constructor(){super(new $s(1,1,1),Ma)}}Ea(Sa,"SkyShader",Pn);Ea(Sa,"material",Ma);new Os;new ae;new Xo(0,0,0,"YXZ");new ae;var ic=Object.defineProperty,oc=(t,e,n)=>e in t?ic(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ne=(t,e,n)=>(oc(t,typeof e!="symbol"?e+"":e,n),n);const Mn=new Ps,Gi=new qo,ac=Math.cos(70*(Math.PI/180)),$i=(t,e)=>(t%e+e)%e;class sc extends Ls{constructor(e,n){super(),ne(this,"object"),ne(this,"domElement"),ne(this,"enabled",!0),ne(this,"target",new ae),ne(this,"minDistance",0),ne(this,"maxDistance",1/0),ne(this,"minZoom",0),ne(this,"maxZoom",1/0),ne(this,"minPolarAngle",0),ne(this,"maxPolarAngle",Math.PI),ne(this,"minAzimuthAngle",-1/0),ne(this,"maxAzimuthAngle",1/0),ne(this,"enableDamping",!1),ne(this,"dampingFactor",.05),ne(this,"enableZoom",!0),ne(this,"zoomSpeed",1),ne(this,"enableRotate",!0),ne(this,"rotateSpeed",1),ne(this,"enablePan",!0),ne(this,"panSpeed",1),ne(this,"screenSpacePanning",!0),ne(this,"keyPanSpeed",7),ne(this,"zoomToCursor",!1),ne(this,"autoRotate",!1),ne(this,"autoRotateSpeed",2),ne(this,"reverseOrbit",!1),ne(this,"reverseHorizontalOrbit",!1),ne(this,"reverseVerticalOrbit",!1),ne(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),ne(this,"mouseButtons",{LEFT:yt.ROTATE,MIDDLE:yt.DOLLY,RIGHT:yt.PAN}),ne(this,"touches",{ONE:_t.ROTATE,TWO:_t.DOLLY_PAN}),ne(this,"target0"),ne(this,"position0"),ne(this,"zoom0"),ne(this,"_domElementKeyEvents",null),ne(this,"getPolarAngle"),ne(this,"getAzimuthalAngle"),ne(this,"setPolarAngle"),ne(this,"setAzimuthalAngle"),ne(this,"getDistance"),ne(this,"getZoomScale"),ne(this,"listenToKeyEvents"),ne(this,"stopListenToKeyEvents"),ne(this,"saveState"),ne(this,"reset"),ne(this,"update"),ne(this,"connect"),ne(this,"dispose"),ne(this,"dollyIn"),ne(this,"dollyOut"),ne(this,"getScale"),ne(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 Y=$i(L,2*Math.PI),X=c.phi;X<0&&(X+=2*Math.PI),Y<0&&(Y+=2*Math.PI);let Ee=Math.abs(Y-X);2*Math.PI-Ee{let Y=$i(L,2*Math.PI),X=c.theta;X<0&&(X+=2*Math.PI),Y<0&&(Y+=2*Math.PI);let Ee=Math.abs(Y-X);2*Math.PI-Eer.object.position.distanceTo(r.target),this.listenToKeyEvents=L=>{L.addEventListener("keydown",ie),this._domElementKeyEvents=L},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",ie),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 ae,Y=new ae(0,1,0),X=new Bn().setFromUnitVectors(e.up,Y),Ee=X.clone().invert(),Qe=new ae,at=new Bn,kn=2*Math.PI;return function(){const Ai=r.object.position;X.setFromUnitVectors(e.up,Y),Ee.copy(X).invert(),L.copy(Ai).sub(r.target),L.applyQuaternion(X),c.setFromVector3(L),r.autoRotate&&l===s.NONE&&D(S()),r.enableDamping?(c.theta+=f.theta*r.dampingFactor,c.phi+=f.phi*r.dampingFactor):(c.theta+=f.theta,c.phi+=f.phi);let ht=r.minAzimuthAngle,mt=r.maxAzimuthAngle;isFinite(ht)&&isFinite(mt)&&(ht<-Math.PI?ht+=kn:ht>Math.PI&&(ht-=kn),mt<-Math.PI?mt+=kn:mt>Math.PI&&(mt-=kn),ht<=mt?c.theta=Math.max(ht,Math.min(mt,c.theta)):c.theta=c.theta>(ht+mt)/2?Math.max(ht,c.theta):Math.min(mt,c.theta)),c.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,c.phi)),c.makeSafe(),r.enableDamping===!0?r.target.addScaledVector(d,r.dampingFactor):r.target.add(d),r.zoomToCursor&&g||r.object.isOrthographicCamera?c.radius=R(c.radius):c.radius=R(c.radius*p),L.setFromSpherical(c),L.applyQuaternion(Ee),Ai.copy(r.target).add(L),r.object.matrixAutoUpdate||r.object.updateMatrix(),r.object.lookAt(r.target),r.enableDamping===!0?(f.theta*=1-r.dampingFactor,f.phi*=1-r.dampingFactor,d.multiplyScalar(1-r.dampingFactor)):(f.set(0,0,0),d.set(0,0,0));let tn=!1;if(r.zoomToCursor&&g){let nn=null;if(r.object instanceof Et&&r.object.isPerspectiveCamera){const rn=L.length();nn=R(rn*p);const Tn=rn-nn;r.object.position.addScaledVector(I,Tn),r.object.updateMatrixWorld()}else if(r.object.isOrthographicCamera){const rn=new ae(b.x,b.y,0);rn.unproject(r.object),r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/p)),r.object.updateProjectionMatrix(),tn=!0;const Tn=new ae(b.x,b.y,0);Tn.unproject(r.object),r.object.position.sub(Tn).add(rn),r.object.updateMatrixWorld(),nn=L.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),r.zoomToCursor=!1;nn!==null&&(r.screenSpacePanning?r.target.set(0,0,-1).transformDirection(r.object.matrix).multiplyScalar(nn).add(r.object.position):(Mn.origin.copy(r.object.position),Mn.direction.set(0,0,-1).transformDirection(r.object.matrix),Math.abs(r.object.up.dot(Mn.direction))u||8*(1-at.dot(r.object.quaternion))>u?(r.dispatchEvent(i),Qe.copy(r.object.position),at.copy(r.object.quaternion),tn=!1,!0):!1}})(),this.connect=L=>{r.domElement=L,r.domElement.style.touchAction="none",r.domElement.addEventListener("contextmenu",He),r.domElement.addEventListener("pointerdown",Me),r.domElement.addEventListener("pointercancel",tt),r.domElement.addEventListener("wheel",K)},this.dispose=()=>{var L,Y,X,Ee,Qe,at;r.domElement&&(r.domElement.style.touchAction="auto"),(L=r.domElement)==null||L.removeEventListener("contextmenu",He),(Y=r.domElement)==null||Y.removeEventListener("pointerdown",Me),(X=r.domElement)==null||X.removeEventListener("pointercancel",tt),(Ee=r.domElement)==null||Ee.removeEventListener("wheel",K),(Qe=r.domElement)==null||Qe.ownerDocument.removeEventListener("pointermove",Ve),(at=r.domElement)==null||at.ownerDocument.removeEventListener("pointerup",tt),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",ie)};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 Mi,f=new Mi;let p=1;const d=new ae,y=new Pe,x=new Pe,v=new Pe,k=new Pe,M=new Pe,A=new Pe,C=new Pe,P=new Pe,h=new Pe,I=new ae,b=new Pe;let g=!1;const m=[],T={};function S(){return 2*Math.PI/60/60*r.autoRotateSpeed}function F(){return Math.pow(.95,r.zoomSpeed)}function D(L){r.reverseOrbit||r.reverseHorizontalOrbit?f.theta+=L:f.theta-=L}function B(L){r.reverseOrbit||r.reverseVerticalOrbit?f.phi+=L:f.phi-=L}const j=(()=>{const L=new ae;return function(Y,X){L.setFromMatrixColumn(X,0),L.multiplyScalar(-Y),d.add(L)}})(),J=(()=>{const L=new ae;return function(Y,X){r.screenSpacePanning===!0?L.setFromMatrixColumn(X,1):(L.setFromMatrixColumn(X,0),L.crossVectors(r.object.up,L)),L.multiplyScalar(Y),d.add(L)}})(),oe=(()=>{const L=new ae;return function(Y,X){const Ee=r.domElement;if(Ee&&r.object instanceof Et&&r.object.isPerspectiveCamera){const Qe=r.object.position;L.copy(Qe).sub(r.target);let at=L.length();at*=Math.tan(r.object.fov/2*Math.PI/180),j(2*Y*at/Ee.clientHeight,r.object.matrix),J(2*X*at/Ee.clientHeight,r.object.matrix)}else Ee&&r.object instanceof Gt&&r.object.isOrthographicCamera?(j(Y*(r.object.right-r.object.left)/r.object.zoom/Ee.clientWidth,r.object.matrix),J(X*(r.object.top-r.object.bottom)/r.object.zoom/Ee.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}})();function Z(L){r.object instanceof Et&&r.object.isPerspectiveCamera||r.object instanceof Gt&&r.object.isOrthographicCamera?p=L:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function _(L){Z(p/L)}function ee(L){Z(p*L)}function me(L){if(!r.zoomToCursor||!r.domElement)return;g=!0;const Y=r.domElement.getBoundingClientRect(),X=L.clientX-Y.left,Ee=L.clientY-Y.top,Qe=Y.width,at=Y.height;b.x=X/Qe*2-1,b.y=-(Ee/at)*2+1,I.set(b.x,b.y,1).unproject(r.object).sub(r.object.position).normalize()}function R(L){return Math.max(r.minDistance,Math.min(r.maxDistance,L))}function ge(L){y.set(L.clientX,L.clientY)}function Te(L){me(L),C.set(L.clientX,L.clientY)}function ye(L){k.set(L.clientX,L.clientY)}function Oe(L){x.set(L.clientX,L.clientY),v.subVectors(x,y).multiplyScalar(r.rotateSpeed);const Y=r.domElement;Y&&(D(2*Math.PI*v.x/Y.clientHeight),B(2*Math.PI*v.y/Y.clientHeight)),y.copy(x),r.update()}function G(L){P.set(L.clientX,L.clientY),h.subVectors(P,C),h.y>0?_(F()):h.y<0&&ee(F()),C.copy(P),r.update()}function w(L){M.set(L.clientX,L.clientY),A.subVectors(M,k).multiplyScalar(r.panSpeed),oe(A.x,A.y),k.copy(M),r.update()}function E(L){me(L),L.deltaY<0?ee(F()):L.deltaY>0&&_(F()),r.update()}function N(L){let Y=!1;switch(L.code){case r.keys.UP:oe(0,r.keyPanSpeed),Y=!0;break;case r.keys.BOTTOM:oe(0,-r.keyPanSpeed),Y=!0;break;case r.keys.LEFT:oe(r.keyPanSpeed,0),Y=!0;break;case r.keys.RIGHT:oe(-r.keyPanSpeed,0),Y=!0;break}Y&&(L.preventDefault(),r.update())}function H(){if(m.length==1)y.set(m[0].pageX,m[0].pageY);else{const L=.5*(m[0].pageX+m[1].pageX),Y=.5*(m[0].pageY+m[1].pageY);y.set(L,Y)}}function z(){if(m.length==1)k.set(m[0].pageX,m[0].pageY);else{const L=.5*(m[0].pageX+m[1].pageX),Y=.5*(m[0].pageY+m[1].pageY);k.set(L,Y)}}function q(){const L=m[0].pageX-m[1].pageX,Y=m[0].pageY-m[1].pageY,X=Math.sqrt(L*L+Y*Y);C.set(0,X)}function te(){r.enableZoom&&q(),r.enablePan&&z()}function xe(){r.enableZoom&&q(),r.enableRotate&&H()}function _e(L){if(m.length==1)x.set(L.pageX,L.pageY);else{const X=pt(L),Ee=.5*(L.pageX+X.x),Qe=.5*(L.pageY+X.y);x.set(Ee,Qe)}v.subVectors(x,y).multiplyScalar(r.rotateSpeed);const Y=r.domElement;Y&&(D(2*Math.PI*v.x/Y.clientHeight),B(2*Math.PI*v.y/Y.clientHeight)),y.copy(x)}function fe(L){if(m.length==1)M.set(L.pageX,L.pageY);else{const Y=pt(L),X=.5*(L.pageX+Y.x),Ee=.5*(L.pageY+Y.y);M.set(X,Ee)}A.subVectors(M,k).multiplyScalar(r.panSpeed),oe(A.x,A.y),k.copy(M)}function ve(L){const Y=pt(L),X=L.pageX-Y.x,Ee=L.pageY-Y.y,Qe=Math.sqrt(X*X+Ee*Ee);P.set(0,Qe),h.set(0,Math.pow(P.y/C.y,r.zoomSpeed)),_(h.y),C.copy(P)}function Ie(L){r.enableZoom&&ve(L),r.enablePan&&fe(L)}function we(L){r.enableZoom&&ve(L),r.enableRotate&&_e(L)}function Me(L){var Y,X;r.enabled!==!1&&(m.length===0&&((Y=r.domElement)==null||Y.ownerDocument.addEventListener("pointermove",Ve),(X=r.domElement)==null||X.ownerDocument.addEventListener("pointerup",tt)),dt(L),L.pointerType==="touch"?ue(L):en(L))}function Ve(L){r.enabled!==!1&&(L.pointerType==="touch"?be(L):U(L))}function tt(L){var Y,X,Ee;ot(L),m.length===0&&((Y=r.domElement)==null||Y.releasePointerCapture(L.pointerId),(X=r.domElement)==null||X.ownerDocument.removeEventListener("pointermove",Ve),(Ee=r.domElement)==null||Ee.ownerDocument.removeEventListener("pointerup",tt)),r.dispatchEvent(a),l=s.NONE}function en(L){let Y;switch(L.button){case 0:Y=r.mouseButtons.LEFT;break;case 1:Y=r.mouseButtons.MIDDLE;break;case 2:Y=r.mouseButtons.RIGHT;break;default:Y=-1}switch(Y){case yt.DOLLY:if(r.enableZoom===!1)return;Te(L),l=s.DOLLY;break;case yt.ROTATE:if(L.ctrlKey||L.metaKey||L.shiftKey){if(r.enablePan===!1)return;ye(L),l=s.PAN}else{if(r.enableRotate===!1)return;ge(L),l=s.ROTATE}break;case yt.PAN:if(L.ctrlKey||L.metaKey||L.shiftKey){if(r.enableRotate===!1)return;ge(L),l=s.ROTATE}else{if(r.enablePan===!1)return;ye(L),l=s.PAN}break;default:l=s.NONE}l!==s.NONE&&r.dispatchEvent(o)}function U(L){if(r.enabled!==!1)switch(l){case s.ROTATE:if(r.enableRotate===!1)return;Oe(L);break;case s.DOLLY:if(r.enableZoom===!1)return;G(L);break;case s.PAN:if(r.enablePan===!1)return;w(L);break}}function K(L){r.enabled===!1||r.enableZoom===!1||l!==s.NONE&&l!==s.ROTATE||(L.preventDefault(),r.dispatchEvent(o),E(L),r.dispatchEvent(a))}function ie(L){r.enabled===!1||r.enablePan===!1||N(L)}function ue(L){switch(bt(L),m.length){case 1:switch(r.touches.ONE){case _t.ROTATE:if(r.enableRotate===!1)return;H(),l=s.TOUCH_ROTATE;break;case _t.PAN:if(r.enablePan===!1)return;z(),l=s.TOUCH_PAN;break;default:l=s.NONE}break;case 2:switch(r.touches.TWO){case _t.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;te(),l=s.TOUCH_DOLLY_PAN;break;case _t.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;xe(),l=s.TOUCH_DOLLY_ROTATE;break;default:l=s.NONE}break;default:l=s.NONE}l!==s.NONE&&r.dispatchEvent(o)}function be(L){switch(bt(L),l){case s.TOUCH_ROTATE:if(r.enableRotate===!1)return;_e(L),r.update();break;case s.TOUCH_PAN:if(r.enablePan===!1)return;fe(L),r.update();break;case s.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;Ie(L),r.update();break;case s.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;we(L),r.update();break;default:l=s.NONE}}function He(L){r.enabled!==!1&&L.preventDefault()}function dt(L){m.push(L)}function ot(L){delete T[L.pointerId];for(let Y=0;Y{ee(L),r.update()},this.dollyOut=(L=F())=>{_(L),r.update()},this.getScale=()=>p,this.setScale=L=>{Z(L),r.update()},this.getZoomScale=()=>F(),n!==void 0&&this.connect(n),this.update()}}new xt;new ae;new Xo;new ae;var lc=Object.defineProperty,uc=(t,e,n)=>e in t?lc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,fi=(t,e,n)=>(uc(t,typeof e!="symbol"?e+"":e,n),n);class Ia{constructor(e){fi(this,"data"),this.data=e}generateShapes(e,n=100,r){const i=[],o={letterSpacing:0,lineHeight:1,...r},a=cc(e,n,this.data,o);for(let s=0,l=a.length;s + `},Aa=new yn({name:"SkyShader",fragmentShader:Pn.fragmentShader,vertexShader:Pn.vertexShader,uniforms:ni.clone(Pn.uniforms),side:Ds,depthWrite:!1});class Sa extends Pt{constructor(){super(new Gs(1,1,1),Aa)}}Ma(Sa,"SkyShader",Pn);Ma(Sa,"material",Aa);new Os;new ae;new Xo(0,0,0,"YXZ");new ae;var ic=Object.defineProperty,oc=(t,e,n)=>e in t?ic(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ne=(t,e,n)=>(oc(t,typeof e!="symbol"?e+"":e,n),n);const An=new Ps,$i=new Ko,ac=Math.cos(70*(Math.PI/180)),Gi=(t,e)=>(t%e+e)%e;class sc extends Ls{constructor(e,n){super(),ne(this,"object"),ne(this,"domElement"),ne(this,"enabled",!0),ne(this,"target",new ae),ne(this,"minDistance",0),ne(this,"maxDistance",1/0),ne(this,"minZoom",0),ne(this,"maxZoom",1/0),ne(this,"minPolarAngle",0),ne(this,"maxPolarAngle",Math.PI),ne(this,"minAzimuthAngle",-1/0),ne(this,"maxAzimuthAngle",1/0),ne(this,"enableDamping",!1),ne(this,"dampingFactor",.05),ne(this,"enableZoom",!0),ne(this,"zoomSpeed",1),ne(this,"enableRotate",!0),ne(this,"rotateSpeed",1),ne(this,"enablePan",!0),ne(this,"panSpeed",1),ne(this,"screenSpacePanning",!0),ne(this,"keyPanSpeed",7),ne(this,"zoomToCursor",!1),ne(this,"autoRotate",!1),ne(this,"autoRotateSpeed",2),ne(this,"reverseOrbit",!1),ne(this,"reverseHorizontalOrbit",!1),ne(this,"reverseVerticalOrbit",!1),ne(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),ne(this,"mouseButtons",{LEFT:yt.ROTATE,MIDDLE:yt.DOLLY,RIGHT:yt.PAN}),ne(this,"touches",{ONE:_t.ROTATE,TWO:_t.DOLLY_PAN}),ne(this,"target0"),ne(this,"position0"),ne(this,"zoom0"),ne(this,"_domElementKeyEvents",null),ne(this,"getPolarAngle"),ne(this,"getAzimuthalAngle"),ne(this,"setPolarAngle"),ne(this,"setAzimuthalAngle"),ne(this,"getDistance"),ne(this,"getZoomScale"),ne(this,"listenToKeyEvents"),ne(this,"stopListenToKeyEvents"),ne(this,"saveState"),ne(this,"reset"),ne(this,"update"),ne(this,"connect"),ne(this,"dispose"),ne(this,"dollyIn"),ne(this,"dollyOut"),ne(this,"getScale"),ne(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 Y=Gi(L,2*Math.PI),X=c.phi;X<0&&(X+=2*Math.PI),Y<0&&(Y+=2*Math.PI);let Me=Math.abs(Y-X);2*Math.PI-Me{let Y=Gi(L,2*Math.PI),X=c.theta;X<0&&(X+=2*Math.PI),Y<0&&(Y+=2*Math.PI);let Me=Math.abs(Y-X);2*Math.PI-Mer.object.position.distanceTo(r.target),this.listenToKeyEvents=L=>{L.addEventListener("keydown",ie),this._domElementKeyEvents=L},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",ie),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 ae,Y=new ae(0,1,0),X=new Fn().setFromUnitVectors(e.up,Y),Me=X.clone().invert(),Ze=new ae,at=new Fn,kn=2*Math.PI;return function(){const Ei=r.object.position;X.setFromUnitVectors(e.up,Y),Me.copy(X).invert(),L.copy(Ei).sub(r.target),L.applyQuaternion(X),c.setFromVector3(L),r.autoRotate&&l===s.NONE&&D(S()),r.enableDamping?(c.theta+=f.theta*r.dampingFactor,c.phi+=f.phi*r.dampingFactor):(c.theta+=f.theta,c.phi+=f.phi);let ht=r.minAzimuthAngle,mt=r.maxAzimuthAngle;isFinite(ht)&&isFinite(mt)&&(ht<-Math.PI?ht+=kn:ht>Math.PI&&(ht-=kn),mt<-Math.PI?mt+=kn:mt>Math.PI&&(mt-=kn),ht<=mt?c.theta=Math.max(ht,Math.min(mt,c.theta)):c.theta=c.theta>(ht+mt)/2?Math.max(ht,c.theta):Math.min(mt,c.theta)),c.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,c.phi)),c.makeSafe(),r.enableDamping===!0?r.target.addScaledVector(d,r.dampingFactor):r.target.add(d),r.zoomToCursor&&g||r.object.isOrthographicCamera?c.radius=R(c.radius):c.radius=R(c.radius*p),L.setFromSpherical(c),L.applyQuaternion(Me),Ei.copy(r.target).add(L),r.object.matrixAutoUpdate||r.object.updateMatrix(),r.object.lookAt(r.target),r.enableDamping===!0?(f.theta*=1-r.dampingFactor,f.phi*=1-r.dampingFactor,d.multiplyScalar(1-r.dampingFactor)):(f.set(0,0,0),d.set(0,0,0));let tn=!1;if(r.zoomToCursor&&g){let nn=null;if(r.object instanceof Mt&&r.object.isPerspectiveCamera){const rn=L.length();nn=R(rn*p);const Tn=rn-nn;r.object.position.addScaledVector(I,Tn),r.object.updateMatrixWorld()}else if(r.object.isOrthographicCamera){const rn=new ae(b.x,b.y,0);rn.unproject(r.object),r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/p)),r.object.updateProjectionMatrix(),tn=!0;const Tn=new ae(b.x,b.y,0);Tn.unproject(r.object),r.object.position.sub(Tn).add(rn),r.object.updateMatrixWorld(),nn=L.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),r.zoomToCursor=!1;nn!==null&&(r.screenSpacePanning?r.target.set(0,0,-1).transformDirection(r.object.matrix).multiplyScalar(nn).add(r.object.position):(An.origin.copy(r.object.position),An.direction.set(0,0,-1).transformDirection(r.object.matrix),Math.abs(r.object.up.dot(An.direction))u||8*(1-at.dot(r.object.quaternion))>u?(r.dispatchEvent(i),Ze.copy(r.object.position),at.copy(r.object.quaternion),tn=!1,!0):!1}})(),this.connect=L=>{r.domElement=L,r.domElement.style.touchAction="none",r.domElement.addEventListener("contextmenu",He),r.domElement.addEventListener("pointerdown",Ae),r.domElement.addEventListener("pointercancel",tt),r.domElement.addEventListener("wheel",q)},this.dispose=()=>{var L,Y,X,Me,Ze,at;r.domElement&&(r.domElement.style.touchAction="auto"),(L=r.domElement)==null||L.removeEventListener("contextmenu",He),(Y=r.domElement)==null||Y.removeEventListener("pointerdown",Ae),(X=r.domElement)==null||X.removeEventListener("pointercancel",tt),(Me=r.domElement)==null||Me.removeEventListener("wheel",q),(Ze=r.domElement)==null||Ze.ownerDocument.removeEventListener("pointermove",Ve),(at=r.domElement)==null||at.ownerDocument.removeEventListener("pointerup",tt),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",ie)};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 Ai,f=new Ai;let p=1;const d=new ae,y=new Pe,x=new Pe,v=new Pe,k=new Pe,A=new Pe,E=new Pe,C=new Pe,P=new Pe,h=new Pe,I=new ae,b=new Pe;let g=!1;const m=[],T={};function S(){return 2*Math.PI/60/60*r.autoRotateSpeed}function B(){return Math.pow(.95,r.zoomSpeed)}function D(L){r.reverseOrbit||r.reverseHorizontalOrbit?f.theta+=L:f.theta-=L}function F(L){r.reverseOrbit||r.reverseVerticalOrbit?f.phi+=L:f.phi-=L}const j=(()=>{const L=new ae;return function(Y,X){L.setFromMatrixColumn(X,0),L.multiplyScalar(-Y),d.add(L)}})(),J=(()=>{const L=new ae;return function(Y,X){r.screenSpacePanning===!0?L.setFromMatrixColumn(X,1):(L.setFromMatrixColumn(X,0),L.crossVectors(r.object.up,L)),L.multiplyScalar(Y),d.add(L)}})(),oe=(()=>{const L=new ae;return function(Y,X){const Me=r.domElement;if(Me&&r.object instanceof Mt&&r.object.isPerspectiveCamera){const Ze=r.object.position;L.copy(Ze).sub(r.target);let at=L.length();at*=Math.tan(r.object.fov/2*Math.PI/180),j(2*Y*at/Me.clientHeight,r.object.matrix),J(2*X*at/Me.clientHeight,r.object.matrix)}else Me&&r.object instanceof $t&&r.object.isOrthographicCamera?(j(Y*(r.object.right-r.object.left)/r.object.zoom/Me.clientWidth,r.object.matrix),J(X*(r.object.top-r.object.bottom)/r.object.zoom/Me.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}})();function Q(L){r.object instanceof Mt&&r.object.isPerspectiveCamera||r.object instanceof $t&&r.object.isOrthographicCamera?p=L:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function _(L){Q(p/L)}function ee(L){Q(p*L)}function me(L){if(!r.zoomToCursor||!r.domElement)return;g=!0;const Y=r.domElement.getBoundingClientRect(),X=L.clientX-Y.left,Me=L.clientY-Y.top,Ze=Y.width,at=Y.height;b.x=X/Ze*2-1,b.y=-(Me/at)*2+1,I.set(b.x,b.y,1).unproject(r.object).sub(r.object.position).normalize()}function R(L){return Math.max(r.minDistance,Math.min(r.maxDistance,L))}function ge(L){y.set(L.clientX,L.clientY)}function Te(L){me(L),C.set(L.clientX,L.clientY)}function ye(L){k.set(L.clientX,L.clientY)}function Oe(L){x.set(L.clientX,L.clientY),v.subVectors(x,y).multiplyScalar(r.rotateSpeed);const Y=r.domElement;Y&&(D(2*Math.PI*v.x/Y.clientHeight),F(2*Math.PI*v.y/Y.clientHeight)),y.copy(x),r.update()}function $(L){P.set(L.clientX,L.clientY),h.subVectors(P,C),h.y>0?_(B()):h.y<0&&ee(B()),C.copy(P),r.update()}function w(L){A.set(L.clientX,L.clientY),E.subVectors(A,k).multiplyScalar(r.panSpeed),oe(E.x,E.y),k.copy(A),r.update()}function M(L){me(L),L.deltaY<0?ee(B()):L.deltaY>0&&_(B()),r.update()}function N(L){let Y=!1;switch(L.code){case r.keys.UP:oe(0,r.keyPanSpeed),Y=!0;break;case r.keys.BOTTOM:oe(0,-r.keyPanSpeed),Y=!0;break;case r.keys.LEFT:oe(r.keyPanSpeed,0),Y=!0;break;case r.keys.RIGHT:oe(-r.keyPanSpeed,0),Y=!0;break}Y&&(L.preventDefault(),r.update())}function H(){if(m.length==1)y.set(m[0].pageX,m[0].pageY);else{const L=.5*(m[0].pageX+m[1].pageX),Y=.5*(m[0].pageY+m[1].pageY);y.set(L,Y)}}function z(){if(m.length==1)k.set(m[0].pageX,m[0].pageY);else{const L=.5*(m[0].pageX+m[1].pageX),Y=.5*(m[0].pageY+m[1].pageY);k.set(L,Y)}}function K(){const L=m[0].pageX-m[1].pageX,Y=m[0].pageY-m[1].pageY,X=Math.sqrt(L*L+Y*Y);C.set(0,X)}function te(){r.enableZoom&&K(),r.enablePan&&z()}function xe(){r.enableZoom&&K(),r.enableRotate&&H()}function _e(L){if(m.length==1)x.set(L.pageX,L.pageY);else{const X=pt(L),Me=.5*(L.pageX+X.x),Ze=.5*(L.pageY+X.y);x.set(Me,Ze)}v.subVectors(x,y).multiplyScalar(r.rotateSpeed);const Y=r.domElement;Y&&(D(2*Math.PI*v.x/Y.clientHeight),F(2*Math.PI*v.y/Y.clientHeight)),y.copy(x)}function fe(L){if(m.length==1)A.set(L.pageX,L.pageY);else{const Y=pt(L),X=.5*(L.pageX+Y.x),Me=.5*(L.pageY+Y.y);A.set(X,Me)}E.subVectors(A,k).multiplyScalar(r.panSpeed),oe(E.x,E.y),k.copy(A)}function ve(L){const Y=pt(L),X=L.pageX-Y.x,Me=L.pageY-Y.y,Ze=Math.sqrt(X*X+Me*Me);P.set(0,Ze),h.set(0,Math.pow(P.y/C.y,r.zoomSpeed)),_(h.y),C.copy(P)}function Ie(L){r.enableZoom&&ve(L),r.enablePan&&fe(L)}function we(L){r.enableZoom&&ve(L),r.enableRotate&&_e(L)}function Ae(L){var Y,X;r.enabled!==!1&&(m.length===0&&((Y=r.domElement)==null||Y.ownerDocument.addEventListener("pointermove",Ve),(X=r.domElement)==null||X.ownerDocument.addEventListener("pointerup",tt)),dt(L),L.pointerType==="touch"?ue(L):en(L))}function Ve(L){r.enabled!==!1&&(L.pointerType==="touch"?be(L):U(L))}function tt(L){var Y,X,Me;ot(L),m.length===0&&((Y=r.domElement)==null||Y.releasePointerCapture(L.pointerId),(X=r.domElement)==null||X.ownerDocument.removeEventListener("pointermove",Ve),(Me=r.domElement)==null||Me.ownerDocument.removeEventListener("pointerup",tt)),r.dispatchEvent(a),l=s.NONE}function en(L){let Y;switch(L.button){case 0:Y=r.mouseButtons.LEFT;break;case 1:Y=r.mouseButtons.MIDDLE;break;case 2:Y=r.mouseButtons.RIGHT;break;default:Y=-1}switch(Y){case yt.DOLLY:if(r.enableZoom===!1)return;Te(L),l=s.DOLLY;break;case yt.ROTATE:if(L.ctrlKey||L.metaKey||L.shiftKey){if(r.enablePan===!1)return;ye(L),l=s.PAN}else{if(r.enableRotate===!1)return;ge(L),l=s.ROTATE}break;case yt.PAN:if(L.ctrlKey||L.metaKey||L.shiftKey){if(r.enableRotate===!1)return;ge(L),l=s.ROTATE}else{if(r.enablePan===!1)return;ye(L),l=s.PAN}break;default:l=s.NONE}l!==s.NONE&&r.dispatchEvent(o)}function U(L){if(r.enabled!==!1)switch(l){case s.ROTATE:if(r.enableRotate===!1)return;Oe(L);break;case s.DOLLY:if(r.enableZoom===!1)return;$(L);break;case s.PAN:if(r.enablePan===!1)return;w(L);break}}function q(L){r.enabled===!1||r.enableZoom===!1||l!==s.NONE&&l!==s.ROTATE||(L.preventDefault(),r.dispatchEvent(o),M(L),r.dispatchEvent(a))}function ie(L){r.enabled===!1||r.enablePan===!1||N(L)}function ue(L){switch(bt(L),m.length){case 1:switch(r.touches.ONE){case _t.ROTATE:if(r.enableRotate===!1)return;H(),l=s.TOUCH_ROTATE;break;case _t.PAN:if(r.enablePan===!1)return;z(),l=s.TOUCH_PAN;break;default:l=s.NONE}break;case 2:switch(r.touches.TWO){case _t.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;te(),l=s.TOUCH_DOLLY_PAN;break;case _t.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;xe(),l=s.TOUCH_DOLLY_ROTATE;break;default:l=s.NONE}break;default:l=s.NONE}l!==s.NONE&&r.dispatchEvent(o)}function be(L){switch(bt(L),l){case s.TOUCH_ROTATE:if(r.enableRotate===!1)return;_e(L),r.update();break;case s.TOUCH_PAN:if(r.enablePan===!1)return;fe(L),r.update();break;case s.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;Ie(L),r.update();break;case s.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;we(L),r.update();break;default:l=s.NONE}}function He(L){r.enabled!==!1&&L.preventDefault()}function dt(L){m.push(L)}function ot(L){delete T[L.pointerId];for(let Y=0;Y{ee(L),r.update()},this.dollyOut=(L=B())=>{_(L),r.update()},this.getScale=()=>p,this.setScale=L=>{Q(L),r.update()},this.getZoomScale=()=>B(),n!==void 0&&this.connect(n),this.update()}}new xt;new ae;new Xo;new ae;var lc=Object.defineProperty,uc=(t,e,n)=>e in t?lc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,fi=(t,e,n)=>(uc(t,typeof e!="symbol"?e+"":e,n),n);class Ia{constructor(e){fi(this,"data"),this.data=e}generateShapes(e,n=100,r){const i=[],o={letterSpacing:0,lineHeight:1,...r},a=cc(e,n,this.data,o);for(let s=0,l=a.length;s #include #include uniform float thickness; @@ -419,22 +419,22 @@ import{V as vs,a as bs,c as ws,r as ks,b as Cr,d as Ts,E as Ei,e as _s,f as As,g gl_FragColor = vec4(color, opacity); #include #include - }`);const dc=["args","material-uniforms-color-value"];Or.ReflectorShader;new ae;new ae;new ae;var fr;/Mac/.test((fr=globalThis==null?void 0:globalThis.navigator)===null||fr===void 0?void 0:fr.platform);const pc=["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","mouse-buttons","args"],hc=Be({__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:_t.ROTATE,TWO:_t.DOLLY_PAN})},enableZoom:{type:Boolean,default:!0},zoomSpeed:{default:1},enableRotate:{type:Boolean,default:!0},rotateSpeed:{default:1},mouseButtons:{default:()=>({LEFT:yt.ROTATE,MIDDLE:yt.DOLLY,RIGHT:yt.PAN})}},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:f,maxAzimuthAngle:p,minAzimuthAngle:d,maxPolarAngle:y,minPolarAngle:x,minDistance:v,maxDistance:k,minZoom:M,maxZoom:A,enableZoom:C,zoomSpeed:P,enableRotate:h,touches:I,rotateSpeed:b,target:g,mouseButtons:m}=Jr(r),{camera:T,renderer:S,extend:F,controls:D,invalidate:B}=Yn(),j=Yo(null);F({OrbitControls:sc}),Fe(j,Z=>{J(),Z&&o.value?D.value=Z:D.value=null});function J(){ar(j.value,"change",()=>{i("change",j.value),B()}),ar(j.value,"start",()=>i("start",j.value)),ar(j.value,"end",()=>i("end",j.value))}const{onBeforeRender:oe}=On();return oe(({invalidate:Z})=>{j.value&&(l.value||a.value)&&(j.value.update(),a.value&&Z())}),Ot(()=>{j.value&&j.value.dispose()}),e({instance:j}),(Z,_)=>(Z.camera||V(T))&&(Z.domElement||V(S))?(Q(),re("TresOrbitControls",{key:0,ref_key:"controlsRef",ref:j,target:V(g),"auto-rotate":V(a),"auto-rotate-speed":V(s),"enable-damping":V(l),"damping-factor":V(u),"enable-pan":V(c),"key-pan-speed":V(f),keys:Z.keys,"max-azimuth-angle":V(p),"min-azimuth-angle":V(d),"max-polar-angle":V(y),"min-polar-angle":V(x),"min-distance":V(v),"max-distance":V(k),"min-zoom":V(M),"max-zoom":V(A),touches:V(I),"enable-zoom":V(C),"zoom-speed":V(P),"enable-rotate":V(h),"rotate-speed":V(b),"mouse-buttons":V(m),args:[Z.camera||V(T),Z.domElement||V(S).domElement]},null,8,pc)):it("",!0)}});function Sn(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 Yi={exports:{}},qi;function mc(){return qi||(qi=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 f=typeof Sn=="function"&&Sn;if(!c&&f)return f(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 d=r[u][1][p];return a(d||p)},c,c.exports,n,r,i,o)}return i[u].exports}for(var s=typeof Sn=="function"&&Sn,l=0;l[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:_t.ROTATE,TWO:_t.DOLLY_PAN})},enableZoom:{type:Boolean,default:!0},zoomSpeed:{default:1},enableRotate:{type:Boolean,default:!0},rotateSpeed:{default:1},mouseButtons:{default:()=>({LEFT:yt.ROTATE,MIDDLE:yt.DOLLY,RIGHT:yt.PAN})}},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:f,maxAzimuthAngle:p,minAzimuthAngle:d,maxPolarAngle:y,minPolarAngle:x,minDistance:v,maxDistance:k,minZoom:A,maxZoom:E,enableZoom:C,zoomSpeed:P,enableRotate:h,touches:I,rotateSpeed:b,target:g,mouseButtons:m}=Jr(r),{camera:T,renderer:S,extend:B,controls:D,invalidate:F}=Yn(),j=Yo(null);B({OrbitControls:sc}),Be(j,Q=>{J(),Q&&o.value?D.value=Q:D.value=null});function J(){ar(j.value,"change",()=>{i("change",j.value),F()}),ar(j.value,"start",()=>i("start",j.value)),ar(j.value,"end",()=>i("end",j.value))}const{onBeforeRender:oe}=On();return oe(({invalidate:Q})=>{j.value&&(l.value||a.value)&&(j.value.update(),a.value&&Q())}),Ot(()=>{j.value&&j.value.dispose()}),e({instance:j}),(Q,_)=>(Q.camera||V(T))&&(Q.domElement||V(S))?(Z(),re("TresOrbitControls",{key:0,ref_key:"controlsRef",ref:j,target:V(g),"auto-rotate":V(a),"auto-rotate-speed":V(s),"enable-damping":V(l),"damping-factor":V(u),"enable-pan":V(c),"key-pan-speed":V(f),keys:Q.keys,"max-azimuth-angle":V(p),"min-azimuth-angle":V(d),"max-polar-angle":V(y),"min-polar-angle":V(x),"min-distance":V(v),"max-distance":V(k),"min-zoom":V(A),"max-zoom":V(E),touches:V(I),"enable-zoom":V(C),"zoom-speed":V(P),"enable-rotate":V(h),"rotate-speed":V(b),"mouse-buttons":V(m),args:[Q.camera||V(T),Q.domElement||V(S).domElement]},null,8,pc)):it("",!0)}});function Sn(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 Yi={exports:{}},Ki;function mc(){return Ki||(Ki=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 f=typeof Sn=="function"&&Sn;if(!c&&f)return f(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 d=r[u][1][p];return a(d||p)},c,c.exports,n,r,i,o)}return i[u].exports}for(var s=typeof Sn=="function"&&Sn,l=0;l>16),B((65280&m)>>8),B(255&m);return T==2?B(255&(m=I(b.charAt(g))<<2|I(b.charAt(g+1))>>4)):T==1&&(B((m=I(b.charAt(g))<<10|I(b.charAt(g+1))<<4|I(b.charAt(g+2))>>2)>>8&255),B(255&m)),S},y.fromByteArray=function(b){var g,m,T,S,F=b.length%3,D="";function B(j){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(j)}for(g=0,T=b.length-F;g>18&63)+B(S>>12&63)+B(S>>6&63)+B(63&S);switch(F){case 1:D=(D+=B((m=b[b.length-1])>>2))+B(m<<4&63)+"==";break;case 2:D=(D=(D+=B((m=(b[b.length-2]<<8)+b[b.length-1])>>10))+B(m>>4&63))+B(m<<2&63)+"="}return D}})(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,f,p,d){var y=n("base64-js"),x=n("ieee754");function v(w,E,N){if(!(this instanceof v))return new v(w,E,N);var H,z,q,te,xe=typeof w;if(E==="base64"&&xe=="string")for(w=(te=w).trim?te.trim():te.replace(/^\s+|\s+$/g,"");w.length%4!=0;)w+="=";if(xe=="number")H=oe(w);else if(xe=="string")H=v.byteLength(w,E);else{if(xe!="object")throw new Error("First argument needs to be a number, array or string.");H=oe(w.length)}if(v._useTypedArrays?z=v._augment(new Uint8Array(H)):((z=this).length=H,z._isBuffer=!0),v._useTypedArrays&&typeof w.byteLength=="number")z._set(w);else if(Z(te=w)||v.isBuffer(te)||te&&typeof te=="object"&&typeof te.length=="number")for(q=0;q>8,te=te%256,xe.push(te),xe.push(q);return xe}(E),w,N,H)}function A(w,E,N){var H="";N=Math.min(w.length,N);for(var z=E;z>>0)):(E+1>>0),z}function h(w,E,N,H){if(H||(G(typeof N=="boolean","missing or invalid endian"),G(E!=null,"missing offset"),G(E+1>>8*(H?q:1-q)}function T(w,E,N,H,z){if(z||(G(E!=null,"missing value"),G(typeof H=="boolean","missing or invalid endian"),G(N!=null,"missing offset"),G(N+3>>8*(H?q:3-q)&255}function S(w,E,N,H,z){z||(G(E!=null,"missing value"),G(typeof H=="boolean","missing or invalid endian"),G(N!=null,"missing offset"),G(N+1this.length&&(H=this.length);var z=(H=w.length-E=this.length))return this[w]},v.prototype.readUInt16LE=function(w,E){return C(this,w,!0,E)},v.prototype.readUInt16BE=function(w,E){return C(this,w,!1,E)},v.prototype.readUInt32LE=function(w,E){return P(this,w,!0,E)},v.prototype.readUInt32BE=function(w,E){return P(this,w,!1,E)},v.prototype.readInt8=function(w,E){if(E||(G(w!=null,"missing offset"),G(w=this.length))return 128&this[w]?-1*(255-this[w]+1):this[w]},v.prototype.readInt16LE=function(w,E){return h(this,w,!0,E)},v.prototype.readInt16BE=function(w,E){return h(this,w,!1,E)},v.prototype.readInt32LE=function(w,E){return I(this,w,!0,E)},v.prototype.readInt32BE=function(w,E){return I(this,w,!1,E)},v.prototype.readFloatLE=function(w,E){return b(this,w,!0,E)},v.prototype.readFloatBE=function(w,E){return b(this,w,!1,E)},v.prototype.readDoubleLE=function(w,E){return g(this,w,!0,E)},v.prototype.readDoubleBE=function(w,E){return g(this,w,!1,E)},v.prototype.writeUInt8=function(w,E,N){N||(G(w!=null,"missing value"),G(E!=null,"missing offset"),G(E=this.length||(this[E]=w)},v.prototype.writeUInt16LE=function(w,E,N){m(this,w,E,!0,N)},v.prototype.writeUInt16BE=function(w,E,N){m(this,w,E,!1,N)},v.prototype.writeUInt32LE=function(w,E,N){T(this,w,E,!0,N)},v.prototype.writeUInt32BE=function(w,E,N){T(this,w,E,!1,N)},v.prototype.writeInt8=function(w,E,N){N||(G(w!=null,"missing value"),G(E!=null,"missing offset"),G(E=this.length||(0<=w?this.writeUInt8(w,E,N):this.writeUInt8(255+w+1,E,N))},v.prototype.writeInt16LE=function(w,E,N){S(this,w,E,!0,N)},v.prototype.writeInt16BE=function(w,E,N){S(this,w,E,!1,N)},v.prototype.writeInt32LE=function(w,E,N){F(this,w,E,!0,N)},v.prototype.writeInt32BE=function(w,E,N){F(this,w,E,!1,N)},v.prototype.writeFloatLE=function(w,E,N){D(this,w,E,!0,N)},v.prototype.writeFloatBE=function(w,E,N){D(this,w,E,!1,N)},v.prototype.writeDoubleLE=function(w,E,N){B(this,w,E,!0,N)},v.prototype.writeDoubleBE=function(w,E,N){B(this,w,E,!1,N)},v.prototype.fill=function(w,E,N){if(E=E||0,N=N||this.length,G(typeof(w=typeof(w=w||0)=="string"?w.charCodeAt(0):w)=="number"&&!isNaN(w),"value is not a number"),G(E<=N,"end < start"),N!==E&&this.length!==0){G(0<=E&&E"},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 w=new Uint8Array(this.length),E=0,N=w.length;E=E.length||z>=w.length);z++)E[z+N]=w[z];return z}function ge(w){try{return decodeURIComponent(w)}catch{return"�"}}function Te(w,E){G(typeof w=="number","cannot write a non-number as a number"),G(0<=w,"specified a negative value for writing an unsigned value"),G(w<=E,"value is larger than maximum value for type"),G(Math.floor(w)===w,"value has a fractional component")}function ye(w,E,N){G(typeof w=="number","cannot write a non-number as a number"),G(w<=E,"value larger than maximum allowed value"),G(N<=w,"value smaller than minimum allowed value"),G(Math.floor(w)===w,"value has a fractional component")}function Oe(w,E,N){G(typeof w=="number","cannot write a non-number as a number"),G(w<=E,"value larger than maximum allowed value"),G(N<=w,"value smaller than minimum allowed value")}function G(w,E){if(!w)throw new Error(E||"Failed assertion")}v._augment=function(w){return w._isBuffer=!0,w._get=w.get,w._set=w.set,w.get=j.get,w.set=j.set,w.write=j.write,w.toString=j.toString,w.toLocaleString=j.toString,w.toJSON=j.toJSON,w.copy=j.copy,w.slice=j.slice,w.readUInt8=j.readUInt8,w.readUInt16LE=j.readUInt16LE,w.readUInt16BE=j.readUInt16BE,w.readUInt32LE=j.readUInt32LE,w.readUInt32BE=j.readUInt32BE,w.readInt8=j.readInt8,w.readInt16LE=j.readInt16LE,w.readInt16BE=j.readInt16BE,w.readInt32LE=j.readInt32LE,w.readInt32BE=j.readInt32BE,w.readFloatLE=j.readFloatLE,w.readFloatBE=j.readFloatBE,w.readDoubleLE=j.readDoubleLE,w.readDoubleBE=j.readDoubleBE,w.writeUInt8=j.writeUInt8,w.writeUInt16LE=j.writeUInt16LE,w.writeUInt16BE=j.writeUInt16BE,w.writeUInt32LE=j.writeUInt32LE,w.writeUInt32BE=j.writeUInt32BE,w.writeInt8=j.writeInt8,w.writeInt16LE=j.writeInt16LE,w.writeInt16BE=j.writeInt16BE,w.writeInt32LE=j.writeInt32LE,w.writeInt32BE=j.writeInt32BE,w.writeFloatLE=j.writeFloatLE,w.writeFloatBE=j.writeFloatBE,w.writeDoubleLE=j.writeDoubleLE,w.writeDoubleBE=j.writeDoubleBE,w.fill=j.fill,w.inspect=j.inspect,w.toArrayBuffer=j.toArrayBuffer,w}}).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,y,l,u,c,f,p,d){var y=n("buffer").Buffer,x=4,v=new y(x);v.fill(0),r.exports={hash:function(k,M,A,C){for(var P=M(function(m,T){m.length%x!=0&&(S=m.length+(x-m.length%x),m=y.concat([m,v],S));for(var S,F=[],D=T?m.readInt32BE:m.readInt32LE,B=0;BA?J=j(J):J.length>5]|=128<>>9<<4)]=I;for(var b=1732584193,g=-271733879,m=-1732584194,T=271733878,S=0;S>>32-m,b)}function k(h,I,b,g,m,T,S){return v(I&b|~I&g,h,I,m,T,S)}function M(h,I,b,g,m,T,S){return v(I&g|b&~g,h,I,m,T,S)}function A(h,I,b,g,m,T,S){return v(I^b^g,h,I,m,T,S)}function C(h,I,b,g,m,T,S){return v(b^(I|~g),h,I,m,T,S)}function P(h,I){var b=(65535&h)+(65535&I);return(h>>16)+(I>>16)+(b>>16)<<16|65535&b}r.exports=function(h){return y.hash(h,x,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,f,p,d){r.exports=function(y){for(var x,v=new Array(y),k=0;k>>((3&k)<<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,f,p,d){var y=n("./helpers");function x(M,A){M[A>>5]|=128<<24-A%32,M[15+(A+64>>9<<4)]=A;for(var C,P,h,I=Array(80),b=1732584193,g=-271733879,m=-1732584194,T=271733878,S=-1009589776,F=0;F>16)+(A>>16)+(C>>16)<<16|65535&C}function k(M,A){return M<>>32-A}r.exports=function(M){return y.hash(M,x,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,f,p,d){function y(A,C){var P=(65535&A)+(65535&C);return(A>>16)+(C>>16)+(P>>16)<<16|65535&P}function x(A,C){var P,h=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),I=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),b=new Array(64);A[C>>5]|=128<<24-C%32,A[15+(C+64>>9<<4)]=C;for(var g,m,T=0;T>>C|A<<32-C},M=function(A,C){return A>>>C};r.exports=function(A){return v.hash(A,x,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,f,p,d){i.read=function(y,x,v,k,T){var A,C,P=8*T-k-1,h=(1<>1,b=-7,g=v?T-1:0,m=v?-1:1,T=y[x+g];for(g+=m,A=T&(1<<-b)-1,T>>=-b,b+=P;0>=-b,b+=k;0>1,g=M===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=k?0:S-1,T=k?1:-1,S=x<0||x===0&&1/x<0?1:0;for(x=Math.abs(x),isNaN(x)||x===1/0?(P=isNaN(x)?1:0,C=I):(C=Math.floor(Math.log(x)/Math.LN2),x*(k=Math.pow(2,-C))<1&&(C--,k*=2),2<=(x+=1<=C+b?g/k:g*Math.pow(2,1-b))*k&&(C++,k/=2),I<=C+b?(P=0,C=I):1<=C+b?(P=(x*k-1)*Math.pow(2,M),C+=b):(P=x*Math.pow(2,b-1)*Math.pow(2,M),C=0));8<=M;y[v+m]=255&P,m+=T,P/=256,M-=8);for(C=C<>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]),Xi}var Zi,Ji;function Ca(){return Ji||(Ji=1,Zi=["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"]),Zi}var dr,eo;function yc(){if(eo)return dr;eo=1;var t=Ra();return dr=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"]),dr}var pr,to;function xc(){if(to)return pr;to=1;var t=Ca();return t=t.slice().filter(function(e){return!/^(gl\_|texture)/.test(e)}),pr=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"]),pr}var hr,no;function vc(){if(no)return hr;no=1,hr=C;var t=Ra(),e=gc(),n=Ca(),r=yc(),i=xc(),o=999,a=9999,s=0,l=1,u=2,c=3,f=4,p=5,d=6,y=7,x=8,v=9,k=10,M=11,A=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function C(P){var h=0,I=0,b=o,g,m,T=[],S=[],F=1,D=0,B=0,j=!1,J=!1,oe="",Z;P=P||{};var _=n,ee=t;P.version==="300 es"&&(_=i,ee=r);for(var me={},R={},h=0;h<_.length;h++)me[_[h]]=!0;for(var h=0;h0)continue;we=fe.slice(0,1).join("")}return ge(we),B+=we.length,T=T.slice(we.length),T.length}while(!0)}function q(){return/[^a-fA-F0-9]/.test(g)?(ge(T.join("")),b=o,h):(T.push(g),m=g,h+1)}function te(){return g==="."||/[eE]/.test(g)?(T.push(g),b=p,m=g,h+1):g==="x"&&T.length===1&&T[0]==="0"?(b=M,T.push(g),m=g,h+1):/[^\d]/.test(g)?(ge(T.join("")),b=o,h):(T.push(g),m=g,h+1)}function xe(){return g==="f"&&(T.push(g),m=g,h+=1),/[eE]/.test(g)||(g==="-"||g==="+")&&/[eE]/.test(m)?(T.push(g),m=g,h+1):/[^\d]/.test(g)?(ge(T.join("")),b=o,h):(T.push(g),m=g,h+1)}function _e(){if(/[^\d\w_]/.test(g)){var fe=T.join("");return R[fe]?b=x:me[fe]?b=y:b=d,ge(T.join("")),b=o,h}return T.push(g),m=g,h+1}}return hr}var mr,ro;function bc(){if(ro)return mr;ro=1;var t=vc();mr=e;function e(n,r){var i=t(r),o=[];return o=o.concat(i(n)),o=o.concat(i(null)),o}return mr}bc();function wc(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 String(t)}function kc(t){var e=wc(t,"string");return typeof e=="symbol"?e:String(e)}function Se(t,e,n){return e=kc(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var le={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"},Ge,zt;Ge={},Se(Ge,"".concat(le.normal),{"#include ":` +`)},_domwindow:function(){return g("domwindow")},_bigint:function(m){return g("bigint:"+m.toString())},_process:function(){return g("process")},_timer:function(){return g("timer")},_pipe:function(){return g("pipe")},_tcp:function(){return g("tcp")},_udp:function(){return g("udp")},_tty:function(){return g("tty")},_statwatcher:function(){return g("statwatcher")},_securecontext:function(){return g("securecontext")},_connection:function(){return g("connection")},_zlib:function(){return g("zlib")},_context:function(){return g("context")},_nodescript:function(){return g("nodescript")},_httpparser:function(){return g("httpparser")},_dataview:function(){return g("dataview")},_signal:function(){return g("signal")},_fsevent:function(){return g("fsevent")},_tlswrap:function(){return g("tlswrap")}}}function P(){return{buf:"",write:function(h){this.buf+=h},end:function(h){this.buf+=h},read:function(){return this.buf}}}i.writeToStream=function(h,I,b){return b===void 0&&(b=I,I={}),C(I=A(h,I),b).dispatch(h)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_9a5aa49d.js","/")},{buffer:3,crypto:5,lYpoI2:11}],2:[function(n,r,i){(function(o,a,s,l,u,c,f,p,d){(function(y){var x=typeof Uint8Array<"u"?Uint8Array:Array,v=43,k=47,A=48,E=97,C=65,P=45,h=95;function I(b){return b=b.charCodeAt(0),b===v||b===P?62:b===k||b===h?63:b>16),F((65280&m)>>8),F(255&m);return T==2?F(255&(m=I(b.charAt(g))<<2|I(b.charAt(g+1))>>4)):T==1&&(F((m=I(b.charAt(g))<<10|I(b.charAt(g+1))<<4|I(b.charAt(g+2))>>2)>>8&255),F(255&m)),S},y.fromByteArray=function(b){var g,m,T,S,B=b.length%3,D="";function F(j){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(j)}for(g=0,T=b.length-B;g>18&63)+F(S>>12&63)+F(S>>6&63)+F(63&S);switch(B){case 1:D=(D+=F((m=b[b.length-1])>>2))+F(m<<4&63)+"==";break;case 2:D=(D=(D+=F((m=(b[b.length-2]<<8)+b[b.length-1])>>10))+F(m>>4&63))+F(m<<2&63)+"="}return D}})(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,f,p,d){var y=n("base64-js"),x=n("ieee754");function v(w,M,N){if(!(this instanceof v))return new v(w,M,N);var H,z,K,te,xe=typeof w;if(M==="base64"&&xe=="string")for(w=(te=w).trim?te.trim():te.replace(/^\s+|\s+$/g,"");w.length%4!=0;)w+="=";if(xe=="number")H=oe(w);else if(xe=="string")H=v.byteLength(w,M);else{if(xe!="object")throw new Error("First argument needs to be a number, array or string.");H=oe(w.length)}if(v._useTypedArrays?z=v._augment(new Uint8Array(H)):((z=this).length=H,z._isBuffer=!0),v._useTypedArrays&&typeof w.byteLength=="number")z._set(w);else if(Q(te=w)||v.isBuffer(te)||te&&typeof te=="object"&&typeof te.length=="number")for(K=0;K>8,te=te%256,xe.push(te),xe.push(K);return xe}(M),w,N,H)}function E(w,M,N){var H="";N=Math.min(w.length,N);for(var z=M;z>>0)):(M+1>>0),z}function h(w,M,N,H){if(H||($(typeof N=="boolean","missing or invalid endian"),$(M!=null,"missing offset"),$(M+1>>8*(H?K:1-K)}function T(w,M,N,H,z){if(z||($(M!=null,"missing value"),$(typeof H=="boolean","missing or invalid endian"),$(N!=null,"missing offset"),$(N+3>>8*(H?K:3-K)&255}function S(w,M,N,H,z){z||($(M!=null,"missing value"),$(typeof H=="boolean","missing or invalid endian"),$(N!=null,"missing offset"),$(N+1this.length&&(H=this.length);var z=(H=w.length-M=this.length))return this[w]},v.prototype.readUInt16LE=function(w,M){return C(this,w,!0,M)},v.prototype.readUInt16BE=function(w,M){return C(this,w,!1,M)},v.prototype.readUInt32LE=function(w,M){return P(this,w,!0,M)},v.prototype.readUInt32BE=function(w,M){return P(this,w,!1,M)},v.prototype.readInt8=function(w,M){if(M||($(w!=null,"missing offset"),$(w=this.length))return 128&this[w]?-1*(255-this[w]+1):this[w]},v.prototype.readInt16LE=function(w,M){return h(this,w,!0,M)},v.prototype.readInt16BE=function(w,M){return h(this,w,!1,M)},v.prototype.readInt32LE=function(w,M){return I(this,w,!0,M)},v.prototype.readInt32BE=function(w,M){return I(this,w,!1,M)},v.prototype.readFloatLE=function(w,M){return b(this,w,!0,M)},v.prototype.readFloatBE=function(w,M){return b(this,w,!1,M)},v.prototype.readDoubleLE=function(w,M){return g(this,w,!0,M)},v.prototype.readDoubleBE=function(w,M){return g(this,w,!1,M)},v.prototype.writeUInt8=function(w,M,N){N||($(w!=null,"missing value"),$(M!=null,"missing offset"),$(M=this.length||(this[M]=w)},v.prototype.writeUInt16LE=function(w,M,N){m(this,w,M,!0,N)},v.prototype.writeUInt16BE=function(w,M,N){m(this,w,M,!1,N)},v.prototype.writeUInt32LE=function(w,M,N){T(this,w,M,!0,N)},v.prototype.writeUInt32BE=function(w,M,N){T(this,w,M,!1,N)},v.prototype.writeInt8=function(w,M,N){N||($(w!=null,"missing value"),$(M!=null,"missing offset"),$(M=this.length||(0<=w?this.writeUInt8(w,M,N):this.writeUInt8(255+w+1,M,N))},v.prototype.writeInt16LE=function(w,M,N){S(this,w,M,!0,N)},v.prototype.writeInt16BE=function(w,M,N){S(this,w,M,!1,N)},v.prototype.writeInt32LE=function(w,M,N){B(this,w,M,!0,N)},v.prototype.writeInt32BE=function(w,M,N){B(this,w,M,!1,N)},v.prototype.writeFloatLE=function(w,M,N){D(this,w,M,!0,N)},v.prototype.writeFloatBE=function(w,M,N){D(this,w,M,!1,N)},v.prototype.writeDoubleLE=function(w,M,N){F(this,w,M,!0,N)},v.prototype.writeDoubleBE=function(w,M,N){F(this,w,M,!1,N)},v.prototype.fill=function(w,M,N){if(M=M||0,N=N||this.length,$(typeof(w=typeof(w=w||0)=="string"?w.charCodeAt(0):w)=="number"&&!isNaN(w),"value is not a number"),$(M<=N,"end < start"),N!==M&&this.length!==0){$(0<=M&&M"},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 w=new Uint8Array(this.length),M=0,N=w.length;M=M.length||z>=w.length);z++)M[z+N]=w[z];return z}function ge(w){try{return decodeURIComponent(w)}catch{return"�"}}function Te(w,M){$(typeof w=="number","cannot write a non-number as a number"),$(0<=w,"specified a negative value for writing an unsigned value"),$(w<=M,"value is larger than maximum value for type"),$(Math.floor(w)===w,"value has a fractional component")}function ye(w,M,N){$(typeof w=="number","cannot write a non-number as a number"),$(w<=M,"value larger than maximum allowed value"),$(N<=w,"value smaller than minimum allowed value"),$(Math.floor(w)===w,"value has a fractional component")}function Oe(w,M,N){$(typeof w=="number","cannot write a non-number as a number"),$(w<=M,"value larger than maximum allowed value"),$(N<=w,"value smaller than minimum allowed value")}function $(w,M){if(!w)throw new Error(M||"Failed assertion")}v._augment=function(w){return w._isBuffer=!0,w._get=w.get,w._set=w.set,w.get=j.get,w.set=j.set,w.write=j.write,w.toString=j.toString,w.toLocaleString=j.toString,w.toJSON=j.toJSON,w.copy=j.copy,w.slice=j.slice,w.readUInt8=j.readUInt8,w.readUInt16LE=j.readUInt16LE,w.readUInt16BE=j.readUInt16BE,w.readUInt32LE=j.readUInt32LE,w.readUInt32BE=j.readUInt32BE,w.readInt8=j.readInt8,w.readInt16LE=j.readInt16LE,w.readInt16BE=j.readInt16BE,w.readInt32LE=j.readInt32LE,w.readInt32BE=j.readInt32BE,w.readFloatLE=j.readFloatLE,w.readFloatBE=j.readFloatBE,w.readDoubleLE=j.readDoubleLE,w.readDoubleBE=j.readDoubleBE,w.writeUInt8=j.writeUInt8,w.writeUInt16LE=j.writeUInt16LE,w.writeUInt16BE=j.writeUInt16BE,w.writeUInt32LE=j.writeUInt32LE,w.writeUInt32BE=j.writeUInt32BE,w.writeInt8=j.writeInt8,w.writeInt16LE=j.writeInt16LE,w.writeInt16BE=j.writeInt16BE,w.writeInt32LE=j.writeInt32LE,w.writeInt32BE=j.writeInt32BE,w.writeFloatLE=j.writeFloatLE,w.writeFloatBE=j.writeFloatBE,w.writeDoubleLE=j.writeDoubleLE,w.writeDoubleBE=j.writeDoubleBE,w.fill=j.fill,w.inspect=j.inspect,w.toArrayBuffer=j.toArrayBuffer,w}}).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,y,l,u,c,f,p,d){var y=n("buffer").Buffer,x=4,v=new y(x);v.fill(0),r.exports={hash:function(k,A,E,C){for(var P=A(function(m,T){m.length%x!=0&&(S=m.length+(x-m.length%x),m=y.concat([m,v],S));for(var S,B=[],D=T?m.readInt32BE:m.readInt32LE,F=0;FE?J=j(J):J.length>5]|=128<>>9<<4)]=I;for(var b=1732584193,g=-271733879,m=-1732584194,T=271733878,S=0;S>>32-m,b)}function k(h,I,b,g,m,T,S){return v(I&b|~I&g,h,I,m,T,S)}function A(h,I,b,g,m,T,S){return v(I&g|b&~g,h,I,m,T,S)}function E(h,I,b,g,m,T,S){return v(I^b^g,h,I,m,T,S)}function C(h,I,b,g,m,T,S){return v(b^(I|~g),h,I,m,T,S)}function P(h,I){var b=(65535&h)+(65535&I);return(h>>16)+(I>>16)+(b>>16)<<16|65535&b}r.exports=function(h){return y.hash(h,x,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,f,p,d){r.exports=function(y){for(var x,v=new Array(y),k=0;k>>((3&k)<<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,f,p,d){var y=n("./helpers");function x(A,E){A[E>>5]|=128<<24-E%32,A[15+(E+64>>9<<4)]=E;for(var C,P,h,I=Array(80),b=1732584193,g=-271733879,m=-1732584194,T=271733878,S=-1009589776,B=0;B>16)+(E>>16)+(C>>16)<<16|65535&C}function k(A,E){return A<>>32-E}r.exports=function(A){return y.hash(A,x,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,f,p,d){function y(E,C){var P=(65535&E)+(65535&C);return(E>>16)+(C>>16)+(P>>16)<<16|65535&P}function x(E,C){var P,h=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),I=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),b=new Array(64);E[C>>5]|=128<<24-C%32,E[15+(C+64>>9<<4)]=C;for(var g,m,T=0;T>>C|E<<32-C},A=function(E,C){return E>>>C};r.exports=function(E){return v.hash(E,x,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,f,p,d){i.read=function(y,x,v,k,T){var E,C,P=8*T-k-1,h=(1<>1,b=-7,g=v?T-1:0,m=v?-1:1,T=y[x+g];for(g+=m,E=T&(1<<-b)-1,T>>=-b,b+=P;0>=-b,b+=k;0>1,g=A===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=k?0:S-1,T=k?1:-1,S=x<0||x===0&&1/x<0?1:0;for(x=Math.abs(x),isNaN(x)||x===1/0?(P=isNaN(x)?1:0,C=I):(C=Math.floor(Math.log(x)/Math.LN2),x*(k=Math.pow(2,-C))<1&&(C--,k*=2),2<=(x+=1<=C+b?g/k:g*Math.pow(2,1-b))*k&&(C++,k/=2),I<=C+b?(P=0,C=I):1<=C+b?(P=(x*k-1)*Math.pow(2,A),C+=b):(P=x*Math.pow(2,b-1)*Math.pow(2,A),C=0));8<=A;y[v+m]=255&P,m+=T,P/=256,A-=8);for(C=C<>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]),Xi}var Qi,Ji;function Ca(){return Ji||(Ji=1,Qi=["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"]),Qi}var dr,eo;function yc(){if(eo)return dr;eo=1;var t=Ra();return dr=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"]),dr}var pr,to;function xc(){if(to)return pr;to=1;var t=Ca();return t=t.slice().filter(function(e){return!/^(gl\_|texture)/.test(e)}),pr=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"]),pr}var hr,no;function vc(){if(no)return hr;no=1,hr=C;var t=Ra(),e=gc(),n=Ca(),r=yc(),i=xc(),o=999,a=9999,s=0,l=1,u=2,c=3,f=4,p=5,d=6,y=7,x=8,v=9,k=10,A=11,E=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function C(P){var h=0,I=0,b=o,g,m,T=[],S=[],B=1,D=0,F=0,j=!1,J=!1,oe="",Q;P=P||{};var _=n,ee=t;P.version==="300 es"&&(_=i,ee=r);for(var me={},R={},h=0;h<_.length;h++)me[_[h]]=!0;for(var h=0;h0)continue;we=fe.slice(0,1).join("")}return ge(we),F+=we.length,T=T.slice(we.length),T.length}while(!0)}function K(){return/[^a-fA-F0-9]/.test(g)?(ge(T.join("")),b=o,h):(T.push(g),m=g,h+1)}function te(){return g==="."||/[eE]/.test(g)?(T.push(g),b=p,m=g,h+1):g==="x"&&T.length===1&&T[0]==="0"?(b=A,T.push(g),m=g,h+1):/[^\d]/.test(g)?(ge(T.join("")),b=o,h):(T.push(g),m=g,h+1)}function xe(){return g==="f"&&(T.push(g),m=g,h+=1),/[eE]/.test(g)||(g==="-"||g==="+")&&/[eE]/.test(m)?(T.push(g),m=g,h+1):/[^\d]/.test(g)?(ge(T.join("")),b=o,h):(T.push(g),m=g,h+1)}function _e(){if(/[^\d\w_]/.test(g)){var fe=T.join("");return R[fe]?b=x:me[fe]?b=y:b=d,ge(T.join("")),b=o,h}return T.push(g),m=g,h+1}}return hr}var mr,ro;function bc(){if(ro)return mr;ro=1;var t=vc();mr=e;function e(n,r){var i=t(r),o=[];return o=o.concat(i(n)),o=o.concat(i(null)),o}return mr}bc();function wc(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 String(t)}function kc(t){var e=wc(t,"string");return typeof e=="symbol"?e:String(e)}function Se(t,e,n){return e=kc(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var le={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"},$e,zt;$e={},Se($e,"".concat(le.normal),{"#include ":` vec3 objectNormal = `.concat(le.normal,`; #ifdef USE_TANGENT vec3 objectTangent = vec3( tangent.xyz ); #endif - `)}),Se(Ge,"".concat(le.position),{"#include ":` + `)}),Se($e,"".concat(le.position),{"#include ":` vec3 transformed = `.concat(le.position,`; - `)}),Se(Ge,"".concat(le.positionRaw),{"#include ":` + `)}),Se($e,"".concat(le.positionRaw),{"#include ":` vec4 csm_internal_positionUnprojected = `.concat(le.positionRaw,`; mat4x4 csm_internal_unprojectMatrix = projectionMatrix * modelViewMatrix; #ifdef USE_INSTANCING @@ -442,32 +442,32 @@ list should be an Array.`),w.length===0)return new v(0);if(w.length===1)return w #endif csm_internal_positionUnprojected = inverse(csm_internal_unprojectMatrix) * csm_internal_positionUnprojected; vec3 transformed = csm_internal_positionUnprojected.xyz; - `)}),Se(Ge,"".concat(le.pointSize),{"gl_PointSize = size;":` + `)}),Se($e,"".concat(le.pointSize),{"gl_PointSize = size;":` gl_PointSize = `.concat(le.pointSize,`; - `)}),Se(Ge,"".concat(le.diffuseColor),{"#include ":` + `)}),Se($e,"".concat(le.diffuseColor),{"#include ":` #include diffuseColor = `.concat(le.diffuseColor,`; - `)}),Se(Ge,"".concat(le.fragColor),{"#include ":` + `)}),Se($e,"".concat(le.fragColor),{"#include ":` #include gl_FragColor = `.concat(le.fragColor,`; - `)}),Se(Ge,"".concat(le.emissive),{"vec3 totalEmissiveRadiance = emissive;":` + `)}),Se($e,"".concat(le.emissive),{"vec3 totalEmissiveRadiance = emissive;":` vec3 totalEmissiveRadiance = `.concat(le.emissive,`; - `)}),Se(Ge,"".concat(le.roughness),{"#include ":` + `)}),Se($e,"".concat(le.roughness),{"#include ":` #include roughnessFactor = `.concat(le.roughness,`; - `)}),Se(Ge,"".concat(le.metalness),{"#include ":` + `)}),Se($e,"".concat(le.metalness),{"#include ":` #include metalnessFactor = `.concat(le.metalness,`; - `)}),Se(Ge,"".concat(le.ao),{"#include ":` + `)}),Se($e,"".concat(le.ao),{"#include ":` #include reflectedLight.indirectDiffuse *= 1. - `.concat(le.ao,`; - `)}),Se(Ge,"".concat(le.bump),{"#include ":` + `)}),Se($e,"".concat(le.bump),{"#include ":` #include vec3 csm_internal_orthogonal = `.concat(le.bump," - (dot(").concat(le.bump,`, normal) * normal); vec3 csm_internal_projectedbump = mat3(csm_internal_vModelViewMatrix) * csm_internal_orthogonal; normal = normalize(normal - csm_internal_projectedbump); - `)}),Se(Ge,"".concat(le.depthAlpha),{"gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );":` + `)}),Se($e,"".concat(le.depthAlpha),{"gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );":` gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity * `.concat(le.depthAlpha,` ); `),"gl_FragColor = packDepthToRGBA( fragCoordZ );":` gl_FragColor = packDepthToRGBA( fragCoordZ ); @@ -480,7 +480,7 @@ list should be an Array.`),w.length===0)return new v(0);if(w.length===1)return w gl_FragColor = `.concat(le.diffuseColor,`; `)}),Se(zt,"".concat(le.fragColor),{"gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );":` gl_FragColor = `.concat(le.fragColor,`; - `)});var $e;$e={},Se($e,"".concat(le.position),"*"),Se($e,"".concat(le.positionRaw),"*"),Se($e,"".concat(le.normal),"*"),Se($e,"".concat(le.pointSize),["PointsMaterial"]),Se($e,"".concat(le.diffuseColor),"*"),Se($e,"".concat(le.fragColor),"*"),Se($e,"".concat(le.emissive),["MeshStandardMaterial","MeshPhysicalMaterial"]),Se($e,"".concat(le.roughness),["MeshStandardMaterial","MeshPhysicalMaterial"]),Se($e,"".concat(le.metalness),["MeshStandardMaterial","MeshPhysicalMaterial"]),Se($e,"".concat(le.ao),["MeshStandardMaterial","MeshPhysicalMaterial","MeshBasicMaterial","MeshLambertMaterial","MeshPhongMaterial","MeshToonMaterial"]),Se($e,"".concat(le.bump),["MeshLambertMaterial","MeshMatcapMaterial","MeshNormalMaterial","MeshPhongMaterial","MeshPhysicalMaterial","MeshStandardMaterial","MeshToonMaterial","ShadowMaterial"]),Se($e,"".concat(le.depthAlpha),"*");var Tc=`void main() { + `)});var Ge;Ge={},Se(Ge,"".concat(le.position),"*"),Se(Ge,"".concat(le.positionRaw),"*"),Se(Ge,"".concat(le.normal),"*"),Se(Ge,"".concat(le.pointSize),["PointsMaterial"]),Se(Ge,"".concat(le.diffuseColor),"*"),Se(Ge,"".concat(le.fragColor),"*"),Se(Ge,"".concat(le.emissive),["MeshStandardMaterial","MeshPhysicalMaterial"]),Se(Ge,"".concat(le.roughness),["MeshStandardMaterial","MeshPhysicalMaterial"]),Se(Ge,"".concat(le.metalness),["MeshStandardMaterial","MeshPhysicalMaterial"]),Se(Ge,"".concat(le.ao),["MeshStandardMaterial","MeshPhysicalMaterial","MeshBasicMaterial","MeshLambertMaterial","MeshPhongMaterial","MeshToonMaterial"]),Se(Ge,"".concat(le.bump),["MeshLambertMaterial","MeshMatcapMaterial","MeshNormalMaterial","MeshPhongMaterial","MeshPhysicalMaterial","MeshStandardMaterial","MeshToonMaterial","ShadowMaterial"]),Se(Ge,"".concat(le.depthAlpha),"*");var Tc=`void main() { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); }`,_c=`#include @@ -507,7 +507,7 @@ void main() { mvPosition.xy += rotatedPosition; gl_Position = projectionMatrix * mvPosition; -}`;const vn=new ae(0,0,0),di=new ae(0,0,0),Ac=new ae(0,0,0);function io(t,e,n){const r=vn.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,r.z]}function Ec(t,e){const n=vn.setFromMatrixPosition(t.matrixWorld),r=di.setFromMatrixPosition(e.matrixWorld),i=n.sub(r),o=e.getWorldDirection(Ac);return i.angleTo(o)>Math.PI/2}function Mc(t,e,n,r){const i=vn.setFromMatrixPosition(t.matrixWorld),o=i.clone();o.project(e),n.setFromCamera(new Pe(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 Na(t,e,n=""){let r="matrix3d(";for(let i=0;i!==16;i++)r+=Fr(e[i]*t.elements[i])+(i!==15?",":")");return n+r}const Rc=(t=>e=>Na(e,t))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),Cc=(t=>(e,n)=>Na(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]),Nc=["geometry","material"];new Zo;var zr={exports:{}},Lc=zr.exports,oo;function Pc(){return oo||(oo=1,function(t,e){(function(n,r){t.exports=r()})(Lc,function(){var n=function(){function r(d){return a.appendChild(d.dom),d}function i(d){for(var y=0;yl+1e3&&(c.update(1e3*u/(d-l),100),l=d,u=0,p)){var y=performance.memory;p.update(y.usedJSHeapSize/1048576,y.jsHeapSizeLimit/1048576)}return d},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,f=48*u,p=3*u,d=2*u,y=3*u,x=15*u,v=74*u,k=30*u,M=document.createElement("canvas");M.width=c,M.height=f,M.style.cssText="width:80px;height:48px";var A=M.getContext("2d");return A.font="bold "+9*u+"px Helvetica,Arial,sans-serif",A.textBaseline="top",A.fillStyle=o,A.fillRect(0,0,c,f),A.fillStyle=i,A.fillText(r,p,d),A.fillRect(y,x,v,k),A.fillStyle=o,A.globalAlpha=.9,A.fillRect(y,x,v,k),{dom:M,update:function(C,P){a=Math.min(a,C),s=Math.max(s,C),A.fillStyle=o,A.globalAlpha=1,A.fillRect(0,0,c,x),A.fillStyle=i,A.fillText(l(C)+" "+r+" ("+l(a)+"-"+l(s)+")",p,d),A.drawImage(M,y+u,x,v-u,k,y,x,v-u,k),A.fillRect(y+v-u,x,u,k),A.fillStyle=o,A.globalAlpha=.9,A.fillRect(y+v-u,x,u,l((1-C/P)*k))}}},n})}(zr)),zr.exports}Pc();const Dc={key:0,args:[0,1,64]},Oc={key:1,args:[.5,1,64]},Bc={key:2},Fc=["tone-mapped","map","side","color"];new ze(16777215);const Ut=Be({__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=W(null);function o(y,x,v){return Math.min(Math.max(y,x),v)}function a(y){const x=y.toString();return x.includes("e-")?Number.parseInt(x.split("e-")[1],10):x.includes(".")?x.split(".")[1].length:0}function s(y,x){const v=a(x),k=10**(v+3);return Number.parseFloat((y*k/k).toFixed(v))}const l=je(()=>s(o(n.modelValue,n.min,n.max),n.step)),u=je(()=>{const y=(l.value-n.min)/(n.max-n.min)*100;return{width:`${y}%`,backgroundSize:`${y}% 100%`}});function c(y){if(!i.value)return l.value;const x=i.value.getBoundingClientRect(),k=(y.clientX-x.left)/x.width,M=n.max-n.min,A=n.min+M*k,C=Math.round(A/n.step)*n.step;return Math.min(Math.max(C,n.min),n.max)}function f(y){if(n.disabled)return;const x=c(y);r("update:modelValue",x)}function p(y){if(n.disabled)return;y.preventDefault();const x=c(y);r("update:modelValue",x),window.addEventListener("mousemove",f),window.addEventListener("mouseup",d)}function d(y){window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",d)}return Ot(()=>{window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",d)}),(y,x)=>(Q(),re("span",{ref_key:"sliderRef",ref:i,class:st(["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},[O("span",{style:Pr(u.value),bg:"[#cabeff] dark:[#4e34b9]",relative:"",block:"","rounded-sm":"",h:"[14px]"},null,4),O("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:"neutral-100 dark:neutral-400",top:"50%",transform:"translate-x-[50%] translate-y-[-50%]"},null,4)],34))}});function ao(t,e){if(e===el)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===Dr||e===oa){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 vf(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[f]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+f+'".')}}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 Uc(){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 de={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 jc{constructor(e){this.parser=e,this.name=de.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 tf{constructor(e){this.parser=e,this.name=de.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 nf{constructor(e){this.parser=e,this.name=de.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 rf{constructor(e){this.name=de.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,f=i.byteStride,p=new Uint8Array(s,l,u);return a.decodeGltfBufferAsync?a.decodeGltfBufferAsync(c,f,p,i.mode,i.filter).then(function(d){return d.buffer}):a.ready.then(function(){const d=new ArrayBuffer(c*f);return a.decodeGltfBuffer(new Uint8Array(d),c,f,p,i.mode,i.filter),d})})}else return null}}class of{constructor(e){this.name=de.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!==nt.TRIANGLES&&u.mode!==nt.TRIANGLE_STRIP&&u.mode!==nt.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(),f=c.isGroup?c.children:[c],p=u[0].count,d=[];for(const y of f){const x=new xt,v=new ae,k=new Bn,M=new ae(1,1,1),A=new ol(y.geometry,y.material,p);for(let C=0;C0||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 xf=new xt;class vf{constructor(e={},n={}){this.json=e,this.extensions={},this.plugins={},this.options=n,this.cache=new Uc,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 sl(this.options.manager):this.textureLoader=new ll(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new aa(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 Rt(o,s,i),gt(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(g,h[I*l+1]),l>=3&&v.setZ(g,h[I*l+2]),l>=4&&v.setW(g,h[I*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}v.normalized=y}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=lo[p.magFilter]||zn,c.minFilter=lo[p.minFilter]||ii,c.wrapS=uo[p.wrapS]||Un,c.wrapT=uo[p.wrapT]||Un,c.generateMipmaps=!c.isCompressedTexture&&c.minFilter!==Lt&&c.minFilter!==zn,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(f=>f.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(f){u=!0;const p=new Blob([f],{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(f){return new Promise(function(p,d){let y=p;n.isImageBitmapLoader===!0&&(y=function(x){const v=new Fn(x);v.needsUpdate=!0,p(v)}),n.load(cn.resolveURL(f,o.path),y,void 0,d)})}).then(function(f){return u===!0&&s.revokeObjectURL(l),gt(f,a),f.userData.mimeType=a.mimeType||yf(a.uri),f}).catch(function(f){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),f});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[de.KHR_TEXTURE_TRANSFORM]){const s=r.extensions!==void 0?r.extensions[de.KHR_TEXTURE_TRANSFORM]:void 0;if(s){const l=o.associations.get(a);a=o.extensions[de.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 ul,nr.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 cl,nr.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 sa}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[de.KHR_MATERIALS_UNLIT]){const f=i[de.KHR_MATERIALS_UNLIT];a=f.getMaterialType(),u.push(f.extendParams(s,o,n))}else{const f=o.pbrMetallicRoughness||{};if(s.color=new ze(1,1,1),s.opacity=1,Array.isArray(f.baseColorFactor)){const p=f.baseColorFactor;s.color.setRGB(p[0],p[1],p[2],vt),s.opacity=p[3]}f.baseColorTexture!==void 0&&u.push(n.assignTexture(s,"map",f.baseColorTexture,mn)),s.metalness=f.metallicFactor!==void 0?f.metallicFactor:1,s.roughness=f.roughnessFactor!==void 0?f.roughnessFactor:1,f.metallicRoughnessTexture!==void 0&&(u.push(n.assignTexture(s,"metalnessMap",f.metallicRoughnessTexture)),u.push(n.assignTexture(s,"roughnessMap",f.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=qn);const c=o.alphaMode||yr.OPAQUE;if(c===yr.BLEND?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,c===yr.MASK&&(s.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&a!==Vt&&(u.push(n.assignTexture(s,"normalMap",o.normalTexture)),s.normalScale=new Pe(1,1),o.normalTexture.scale!==void 0)){const f=o.normalTexture.scale;s.normalScale.set(f,f)}if(o.occlusionTexture!==void 0&&a!==Vt&&(u.push(n.assignTexture(s,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(s.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&a!==Vt){const f=o.emissiveFactor;s.emissive=new ze().setRGB(f[0],f[1],f[2],vt)}return o.emissiveTexture!==void 0&&a!==Vt&&u.push(n.assignTexture(s,"emissiveMap",o.emissiveTexture,mn)),Promise.all(u).then(function(){const f=new a(s);return o.name&&(f.name=o.name),gt(f,o),n.associations.set(f,{materials:e}),o.extensions&&Rt(i,f,o),f})}createUniqueName(e){const n=hn.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[de.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(s,n).then(function(l){return co(l,s,n)})}const a=[];for(let s=0,l=e.length;s0&&mf(k,o),k.name=n.createUniqueName(o.name||"mesh_"+e),gt(k,o),v.extensions&&Rt(i,k,v),n.assignFinalMaterial(k),f.push(k)}for(let d=0,y=f.length;d1?c=new rr:u.length===1?c=u[0]:c=new oi,c!==u[0])for(let f=0,p=u.length;f{const f=new Map;for(const[p,d]of i.associations)(p instanceof nr||p instanceof Fn)&&f.set(p,d);return c.traverse(p=>{const d=i.associations.get(p);d!=null&&f.set(p,d)}),f};return i.associations=u(o),o})}_createAnimationTracks(e,n,r,i,o){const a=[],s=e.name?e.name:e.uuid,l=[];kt[o.path]===kt.weights?e.traverse(function(p){p.morphTargetInfluences&&l.push(p.name?p.name:p.uuid)}):l.push(s);let u;switch(kt[o.path]){case kt.weights:u=Ri;break;case kt.rotation:u=Ci;break;case kt.translation:case kt.scale:u=Ii;break;default:switch(r.itemSize){case 1:u=Ri;break;case 2:case 3:default:u=Ii;break}break}const c=i.interpolation!==void 0?df[i.interpolation]:ei,f=this._getArrayFromAccessor(r);for(let p=0,d=l.length;pnew vs(t)),Ct.register(t=>new bs(t)),Ct)}async function wf(t){const r=(await Da().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 kf(t,e){if(!t){console.warn("No VRM found");return}if(e)return ws(e,t)}function Tf(){const t=W(!1),e=W(0),n=W(0),r=.2,i=1,o=6,a=W(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 _f(){let t=-1,e,n=0;function r(){e?e.set(on(-.25,.25),on(-.2,.15),-.65):e=new ae(on(-.25,.25),on(-.2,.15),-.65)}function i(o,a){var s;!(o!=null&&o.expressionManager)||!o.lookAt||(n>=t?(r(),n=0,t=ks()/1e3):e||r(),o.lookAt.target||(o.lookAt.target=new oi),o.lookAt.target.position.lerp(e,on(.2,.5)),(s=o.lookAt)==null||s.update(a),n+=a)}return{update:i}}async function Af(t,e){const i=(await Da().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(Cr.removeUnnecessaryVertices(o.scene),Cr.combineSkeletons(o.scene),o.scene.traverse(a=>{a.frustumCulled=!1}),o.lookAt){const a=new Ts(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 Ef(t){const e=W(null),n=W(!1),r=W(0),i=W(new Map),o=W(new Map),a=W(),s=(k,M,A)=>k+(M-k)*A,l=k=>k<.5?4*k*k*k:1-(-2*k+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)},f=k=>{var A;if(c(),!u.has(k)){console.warn(`Emotion ${k} not found`);return}const M=u.get(k);if(e.value=k,n.value=!0,r.value=0,t.expressionManager){const C=Object.keys(t.expressionManager.expressionMap);for(const P of C)t.expressionManager.setValue(P,0)}i.value.clear(),o.value.clear();for(const C of M.expression||[]){const P=((A=t.expressionManager)==null?void 0:A.getValue(C.name))||0;i.value.set(C.name,P),o.value.set(C.name,C.value)}};return{currentEmotion:e,isTransitioning:n,setEmotion:f,setEmotionWithResetAfter:(k,M)=>{c(),f(k),a.value=setTimeout(()=>{f("neutral"),a.value=void 0},M)},update:k=>{var C;if(!n.value||!e.value)return;const A=u.get(e.value).blendDuration||.3;r.value+=k/A,r.value>=1&&(r.value=1,n.value=!1);for(const[P,h]of o.value){const I=i.value.get(P)||0,b=s(I,h,l(r.value));(C=t.expressionManager)==null||C.setValue(P,b)}},addEmotionState:(k,M)=>{u.set(k,M)},removeEmotionState:k=>{u.delete(k)},dispose:()=>{c()}}}const Mf=Be({__name:"Model",props:{model:null,idleAnimation:null,loadAnimations:null,position:null,paused:{type:Boolean}},emits:["loadModelProgress","error"],setup(t,{expose:e,emit:n}){const r=t,i=n;let o;const a=W(),s=W(),{scene:l}=Yn(),{onBeforeRender:u}=On(),c=Tf(),f=_f(),p=W();Fe(()=>r.position,([x,v,k])=>{a.value&&a.value.scene.position.set(x,v,k)}),pn(async()=>{if(l.value)try{const x=await Af(r.model,{scene:l.value,lookAt:!0,position:r.position,onProgress:M=>i("loadModelProgress",Number.parseFloat((100*(M.loaded/M.total)).toFixed(2)))});if(!x){console.warn("No VRM model loaded");return}const v=await wf(r.idleAnimation),k=await kf(x,v);if(!k){console.warn("No VRM animation loaded");return}s.value=new wl(x.scene),s.value.clipAction(k).play(),p.value=Ef(x),a.value=x,o=u(({delta:M})=>{var A,C,P;(A=s.value)==null||A.update(M),(C=a.value)==null||C.update(M),c.update(a.value,M),f.update(a.value,M),(P=p.value)==null||P.update(M)}).off}catch(x){i("error",x)}}),Ot(()=>{o==null||o(),a.value&&(a.value.scene.removeFromParent(),Cr.deepDispose(a.value.scene))}),e({setExpression(x){var v;(v=p.value)==null||v.setEmotionWithResetAfter(x,1e3)}});const{pause:d,resume:y}=On();return Fe(()=>r.paused,x=>{x?d():y()}),(x,v)=>gn(x.$slots,"default")}}),Sf=["position"],If={absolute:"",bottom:"3",right:"3"},Rf={flex:"~ row","cursor-pointer":""},Cf=["checked","aria-checked"],Nf={key:0,"min-w":"50vw",z:"{var x;(x=p.value)==null||x.setExpression(y)}}),(y,x)=>(Q(),Xt(ha,{relative:""},{default:Ue(({height:v,width:k})=>[ke(V(kl),{alpha:!0,antialias:!0,width:k,height:v},{default:Ue(()=>[ke(V(hc)),O("TresPerspectiveCamera",{position:[a.value,s.value,l.value]},null,8,Sf),x[14]||(x[14]=O("TresDirectionalLight",{color:16777215,intensity:1.2,position:[1,1,1]},null,-1)),x[15]||(x[15]=O("TresAmbientLight",{color:16777215,intensity:1.5},null,-1)),ke(Mf,{ref_key:"modelRef",ref:p,model:r.model,"idle-animation":r.idleAnimation,position:[u.value,c.value,f.value],paused:r.paused,onLoadModelProgress:x[0]||(x[0]=M=>i("loadModelProgress",M)),onError:x[1]||(x[1]=M=>i("error",M))},null,8,["model","idle-animation","position","paused"])]),_:2},1032,["width","height"]),O("div",If,[O("div",Rf,[O("label",{class:st([o.value?"bg-neutral-300 dark:bg-neutral-200":"bg-neutral-100 dark:bg-neutral-700"]),transition:"all ease-in-out duration-500",text:"lg neutral-500 dark:neutral-400","m-1":"","h-fit":"","w-fit":"","cursor-pointer":"","appearance-none":"","gap-1":"","rounded-lg":"","rounded-md":"","border-none":"","p-2":"","outline-none":""},[At(O("input",{"onUpdate:modelValue":x[2]||(x[2]=M=>o.value=M),checked:o.value,"aria-checked":o.value,name:"showLive2DViewerInspector",type:"checkbox",hidden:"","appearance-none":"","outline-none":""},null,8,Cf),[[Zr,o.value]]),x[16]||(x[16]=O("div",{"select-none":""},[O("div",{"i-solar:bug-bold-duotone":""})],-1))],2)]),ke(ui,null,{default:Ue(()=>[o.value?(Q(),re("div",Nf,[O("div",Lf,[O("div",Pf,[O("span",null,he(V(d)("stage.viewers.debug-menu.vrm.model.title")),1)]),ke(Pi,{"h-fit":"","w-full":"",flex:"~ col",border:"~ gray/25 rounded-lg",divide:"y dashed gray/25","of-clip":"","shadow-sm":""},{label:Ue(()=>[O("span",Df,he(V(d)("stage.viewers.debug-menu.vrm.camera")),1)]),default:Ue(()=>[O("div",Of,[x[17]||(x[17]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"X")],-1)),O("label",Bf,[ke(Ut,{modelValue:a.value,"onUpdate:modelValue":x[3]||(x[3]=M=>a.value=M),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",Ff,[O("span",null,he(a.value),1)]),x[18]||(x[18]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"Y")],-1)),O("label",zf,[ke(Ut,{modelValue:s.value,"onUpdate:modelValue":x[4]||(x[4]=M=>s.value=M),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",Uf,[O("span",null,he(s.value),1)]),x[19]||(x[19]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"Z")],-1)),O("label",jf,[ke(Ut,{modelValue:l.value,"onUpdate:modelValue":x[5]||(x[5]=M=>l.value=M),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",Vf,[O("span",null,he(l.value),1)])])]),_:1}),ke(Pi,{"h-fit":"","w-full":"",flex:"~ col",border:"~ gray/25 rounded-lg",divide:"y dashed gray/25","of-clip":"","shadow-sm":""},{label:Ue(()=>[O("span",Hf,he(V(d)("stage.viewers.debug-menu.vrm.model.title")),1)]),default:Ue(()=>[O("div",Gf,[x[20]||(x[20]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"X")],-1)),O("label",$f,[ke(Ut,{modelValue:u.value,"onUpdate:modelValue":x[6]||(x[6]=M=>u.value=M),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",Yf,[O("span",null,he(u.value),1)]),x[21]||(x[21]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"Y")],-1)),O("label",qf,[ke(Ut,{modelValue:c.value,"onUpdate:modelValue":x[7]||(x[7]=M=>c.value=M),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",Kf,[O("span",null,he(c.value),1)]),x[22]||(x[22]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"Z")],-1)),O("label",Wf,[ke(Ut,{modelValue:f.value,"onUpdate:modelValue":x[8]||(x[8]=M=>f.value=M),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",Xf,[O("span",null,he(f.value),1)])])]),_:1}),O("div",Qf,[O("span",null,he(V(d)("stage.viewers.debug-menu.emotions")),1)]),O("div",Zf,[O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[9]||(x[9]=M=>{var A;return(A=p.value)==null?void 0:A.setExpression("neutral")})},he(V(d)("stage.viewers.debug-menu.emotions-btn.neutral")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[10]||(x[10]=M=>{var A;return(A=p.value)==null?void 0:A.setExpression("surprised")})},he(V(d)("stage.viewers.debug-menu.emotions-btn.surprised")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[11]||(x[11]=M=>{var A;return(A=p.value)==null?void 0:A.setExpression("sad")})},he(V(d)("stage.viewers.debug-menu.emotions-btn.sad")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[12]||(x[12]=M=>{var A;return(A=p.value)==null?void 0:A.setExpression("angry")})},he(V(d)("stage.viewers.debug-menu.emotions-btn.angry")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[13]||(x[13]=M=>{var A;return(A=p.value)==null?void 0:A.setExpression("happy")})},he(V(d)("stage.viewers.debug-menu.emotions-btn.happy")),1)])])])):it("",!0)]),_:1})])]),_:1}))}}),ed=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class bn{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}bn.prototype.normal={};bn.prototype.property={};bn.prototype.space=void 0;function Oa(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new bn(n,r,e)}function Vr(t){return t.toLowerCase()}class We{constructor(e,n){this.attribute=n,this.property=e}}We.prototype.attribute="";We.prototype.booleanish=!1;We.prototype.boolean=!1;We.prototype.commaOrSpaceSeparated=!1;We.prototype.commaSeparated=!1;We.prototype.defined=!1;We.prototype.mustUseProperty=!1;We.prototype.number=!1;We.prototype.overloadedBoolean=!1;We.prototype.property="";We.prototype.spaceSeparated=!1;We.prototype.space=void 0;let td=0;const ce=Bt(),Le=Bt(),Ba=Bt(),$=Bt(),Re=Bt(),qt=Bt(),Ze=Bt();function Bt(){return 2**++td}const Hr=Object.freeze(Object.defineProperty({__proto__:null,boolean:ce,booleanish:Le,commaOrSpaceSeparated:Ze,commaSeparated:qt,number:$,overloadedBoolean:Ba,spaceSeparated:Re},Symbol.toStringTag,{value:"Module"})),vr=Object.keys(Hr);class pi extends We{constructor(e,n,r,i){let o=-1;if(super(e,n),fo(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&od.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(po,ld);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!po.test(o)){let a=o.replace(id,sd);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}i=pi}return new i(r,e)}function sd(t){return"-"+t.toLowerCase()}function ld(t){return t.charAt(1).toUpperCase()}const ud=Oa([Fa,nd,ja,Va,Ha],"html"),Ga=Oa([Fa,rd,ja,Va,Ha],"svg"),ho={}.hasOwnProperty;function cd(t,e){const n=e||{};function r(i,...o){let a=r.invalid;const s=r.handlers;if(i&&ho.call(i,t)){const l=String(i[t]);a=ho.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 fd=/^>|^->||--!>|"],pd=["<",">"];function hd(t,e,n,r){return r.settings.bogusComments?"":"";function i(o){return $t(o,Object.assign({},r.settings.characterReferences,{subset:pd}))}}function md(t,e,n,r){return""}function gd(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function yd(t){return t.join(" ").trim()}const xd=/[ \t\n\f\r]/g;function hi(t){return typeof t=="object"?t.type==="text"?mo(t.value):!1:mo(t)}function mo(t){return t.replace(xd,"")===""}const De=Ya(1),$a=Ya(-1),vd=[];function Ya(t){return e;function e(n,r,i){const o=n?n.children:vd;let a=(r||0)+t,s=o[a];if(!i)for(;s&&hi(s);)a+=t,s=o[a];return s}}const bd={}.hasOwnProperty;function qa(t){return e;function e(n,r,i){return bd.call(t,n.tagName)&&t[n.tagName](n,r,i)}}const mi=qa({body:kd,caption:br,colgroup:br,dd:Ed,dt:Ad,head:br,html:wd,li:_d,optgroup:Md,option:Sd,p:Td,rp:go,rt:go,tbody:Rd,td:yo,tfoot:Cd,th:yo,thead:Id,tr:Nd});function br(t,e,n){const r=De(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&hi(r.value.charAt(0)))}function wd(t,e,n){const r=De(n,e);return!r||r.type!=="comment"}function kd(t,e,n){const r=De(n,e);return!r||r.type!=="comment"}function Td(t,e,n){const r=De(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 _d(t,e,n){const r=De(n,e);return!r||r.type==="element"&&r.tagName==="li"}function Ad(t,e,n){const r=De(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Ed(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function go(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Md(t,e,n){const r=De(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function Sd(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function Id(t,e,n){const r=De(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Rd(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Cd(t,e,n){return!De(n,e)}function Nd(t,e,n){const r=De(n,e);return!r||r.type==="element"&&r.tagName==="tr"}function yo(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const Ld=qa({body:Od,colgroup:Bd,head:Dd,html:Pd,tbody:Fd});function Pd(t){const e=De(t,-1);return!e||e.type!=="comment"}function Dd(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 Od(t){const e=De(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&hi(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function Bd(t,e,n){const r=$a(n,e),i=De(t,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&mi(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function Fd(t,e,n){const r=$a(n,e),i=De(t,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&mi(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const In={name:[[` +}`;const vn=new ae(0,0,0),di=new ae(0,0,0),Ec=new ae(0,0,0);function io(t,e,n){const r=vn.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,r.z]}function Mc(t,e){const n=vn.setFromMatrixPosition(t.matrixWorld),r=di.setFromMatrixPosition(e.matrixWorld),i=n.sub(r),o=e.getWorldDirection(Ec);return i.angleTo(o)>Math.PI/2}function Ac(t,e,n,r){const i=vn.setFromMatrixPosition(t.matrixWorld),o=i.clone();o.project(e),n.setFromCamera(new Pe(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 Na(t,e,n=""){let r="matrix3d(";for(let i=0;i!==16;i++)r+=Br(e[i]*t.elements[i])+(i!==15?",":")");return n+r}const Rc=(t=>e=>Na(e,t))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),Cc=(t=>(e,n)=>Na(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]),Nc=["geometry","material"];new Qo;var zr={exports:{}},Lc=zr.exports,oo;function Pc(){return oo||(oo=1,function(t,e){(function(n,r){t.exports=r()})(Lc,function(){var n=function(){function r(d){return a.appendChild(d.dom),d}function i(d){for(var y=0;yl+1e3&&(c.update(1e3*u/(d-l),100),l=d,u=0,p)){var y=performance.memory;p.update(y.usedJSHeapSize/1048576,y.jsHeapSizeLimit/1048576)}return d},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,f=48*u,p=3*u,d=2*u,y=3*u,x=15*u,v=74*u,k=30*u,A=document.createElement("canvas");A.width=c,A.height=f,A.style.cssText="width:80px;height:48px";var E=A.getContext("2d");return E.font="bold "+9*u+"px Helvetica,Arial,sans-serif",E.textBaseline="top",E.fillStyle=o,E.fillRect(0,0,c,f),E.fillStyle=i,E.fillText(r,p,d),E.fillRect(y,x,v,k),E.fillStyle=o,E.globalAlpha=.9,E.fillRect(y,x,v,k),{dom:A,update:function(C,P){a=Math.min(a,C),s=Math.max(s,C),E.fillStyle=o,E.globalAlpha=1,E.fillRect(0,0,c,x),E.fillStyle=i,E.fillText(l(C)+" "+r+" ("+l(a)+"-"+l(s)+")",p,d),E.drawImage(A,y+u,x,v-u,k,y,x,v-u,k),E.fillRect(y+v-u,x,u,k),E.fillStyle=o,E.globalAlpha=.9,E.fillRect(y+v-u,x,u,l((1-C/P)*k))}}},n})}(zr)),zr.exports}Pc();const Dc={key:0,args:[0,1,64]},Oc={key:1,args:[.5,1,64]},Fc={key:2},Bc=["tone-mapped","map","side","color"];new ze(16777215);const Ut=Fe({__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=W(null);function o(y,x,v){return Math.min(Math.max(y,x),v)}function a(y){const x=y.toString();return x.includes("e-")?Number.parseInt(x.split("e-")[1],10):x.includes(".")?x.split(".")[1].length:0}function s(y,x){const v=a(x),k=10**(v+3);return Number.parseFloat((y*k/k).toFixed(v))}const l=je(()=>s(o(n.modelValue,n.min,n.max),n.step)),u=je(()=>{const y=(l.value-n.min)/(n.max-n.min)*100;return{width:`${y}%`,backgroundSize:`${y}% 100%`}});function c(y){if(!i.value)return l.value;const x=i.value.getBoundingClientRect(),k=(y.clientX-x.left)/x.width,A=n.max-n.min,E=n.min+A*k,C=Math.round(E/n.step)*n.step;return Math.min(Math.max(C,n.min),n.max)}function f(y){if(n.disabled)return;const x=c(y);r("update:modelValue",x)}function p(y){if(n.disabled)return;y.preventDefault();const x=c(y);r("update:modelValue",x),window.addEventListener("mousemove",f),window.addEventListener("mouseup",d)}function d(y){window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",d)}return Ot(()=>{window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",d)}),(y,x)=>(Z(),re("span",{ref_key:"sliderRef",ref:i,class:st(["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},[O("span",{style:Pr(u.value),bg:"[#cabeff] dark:[#4e34b9]",relative:"",block:"","rounded-sm":"",h:"[14px]"},null,4),O("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:"neutral-100 dark:neutral-400",top:"50%",transform:"translate-x-[50%] translate-y-[-50%]"},null,4)],34))}});function ao(t,e){if(e===el)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===Dr||e===oa){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 vf(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[f]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+f+'".')}}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 Uc(){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 de={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 jc{constructor(e){this.parser=e,this.name=de.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 tf{constructor(e){this.parser=e,this.name=de.EXT_TEXTURE_WEBP}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 r.loadTextureImage(e,a.source,l)}}class nf{constructor(e){this.parser=e,this.name=de.EXT_TEXTURE_AVIF}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 r.loadTextureImage(e,a.source,l)}}class rf{constructor(e){this.name=de.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,f=i.byteStride,p=new Uint8Array(s,l,u);return a.decodeGltfBufferAsync?a.decodeGltfBufferAsync(c,f,p,i.mode,i.filter).then(function(d){return d.buffer}):a.ready.then(function(){const d=new ArrayBuffer(c*f);return a.decodeGltfBuffer(new Uint8Array(d),c,f,p,i.mode,i.filter),d})})}else return null}}class of{constructor(e){this.name=de.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!==nt.TRIANGLES&&u.mode!==nt.TRIANGLE_STRIP&&u.mode!==nt.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(),f=c.isGroup?c.children:[c],p=u[0].count,d=[];for(const y of f){const x=new xt,v=new ae,k=new Fn,A=new ae(1,1,1),E=new ol(y.geometry,y.material,p);for(let C=0;C0||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 xf=new xt;class vf{constructor(e={},n={}){this.json=e,this.extensions={},this.plugins={},this.options=n,this.cache=new Uc,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 sl(this.options.manager):this.textureLoader=new ll(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new aa(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 Rt(o,s,i),gt(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(g,h[I*l+1]),l>=3&&v.setZ(g,h[I*l+2]),l>=4&&v.setW(g,h[I*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}v.normalized=y}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=lo[p.magFilter]||zn,c.minFilter=lo[p.minFilter]||ii,c.wrapS=uo[p.wrapS]||Un,c.wrapT=uo[p.wrapT]||Un,c.generateMipmaps=!c.isCompressedTexture&&c.minFilter!==Lt&&c.minFilter!==zn,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(f=>f.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(f){u=!0;const p=new Blob([f],{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(f){return new Promise(function(p,d){let y=p;n.isImageBitmapLoader===!0&&(y=function(x){const v=new Bn(x);v.needsUpdate=!0,p(v)}),n.load(cn.resolveURL(f,o.path),y,void 0,d)})}).then(function(f){return u===!0&&s.revokeObjectURL(l),gt(f,a),f.userData.mimeType=a.mimeType||yf(a.uri),f}).catch(function(f){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),f});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[de.KHR_TEXTURE_TRANSFORM]){const s=r.extensions!==void 0?r.extensions[de.KHR_TEXTURE_TRANSFORM]:void 0;if(s){const l=o.associations.get(a);a=o.extensions[de.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 ul,nr.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 cl,nr.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 sa}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[de.KHR_MATERIALS_UNLIT]){const f=i[de.KHR_MATERIALS_UNLIT];a=f.getMaterialType(),u.push(f.extendParams(s,o,n))}else{const f=o.pbrMetallicRoughness||{};if(s.color=new ze(1,1,1),s.opacity=1,Array.isArray(f.baseColorFactor)){const p=f.baseColorFactor;s.color.setRGB(p[0],p[1],p[2],vt),s.opacity=p[3]}f.baseColorTexture!==void 0&&u.push(n.assignTexture(s,"map",f.baseColorTexture,mn)),s.metalness=f.metallicFactor!==void 0?f.metallicFactor:1,s.roughness=f.roughnessFactor!==void 0?f.roughnessFactor:1,f.metallicRoughnessTexture!==void 0&&(u.push(n.assignTexture(s,"metalnessMap",f.metallicRoughnessTexture)),u.push(n.assignTexture(s,"roughnessMap",f.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=Kn);const c=o.alphaMode||yr.OPAQUE;if(c===yr.BLEND?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,c===yr.MASK&&(s.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&a!==Vt&&(u.push(n.assignTexture(s,"normalMap",o.normalTexture)),s.normalScale=new Pe(1,1),o.normalTexture.scale!==void 0)){const f=o.normalTexture.scale;s.normalScale.set(f,f)}if(o.occlusionTexture!==void 0&&a!==Vt&&(u.push(n.assignTexture(s,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(s.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&a!==Vt){const f=o.emissiveFactor;s.emissive=new ze().setRGB(f[0],f[1],f[2],vt)}return o.emissiveTexture!==void 0&&a!==Vt&&u.push(n.assignTexture(s,"emissiveMap",o.emissiveTexture,mn)),Promise.all(u).then(function(){const f=new a(s);return o.name&&(f.name=o.name),gt(f,o),n.associations.set(f,{materials:e}),o.extensions&&Rt(i,f,o),f})}createUniqueName(e){const n=hn.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[de.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(s,n).then(function(l){return co(l,s,n)})}const a=[];for(let s=0,l=e.length;s0&&mf(k,o),k.name=n.createUniqueName(o.name||"mesh_"+e),gt(k,o),v.extensions&&Rt(i,k,v),n.assignFinalMaterial(k),f.push(k)}for(let d=0,y=f.length;d1?c=new rr:u.length===1?c=u[0]:c=new oi,c!==u[0])for(let f=0,p=u.length;f{const f=new Map;for(const[p,d]of i.associations)(p instanceof nr||p instanceof Bn)&&f.set(p,d);return c.traverse(p=>{const d=i.associations.get(p);d!=null&&f.set(p,d)}),f};return i.associations=u(o),o})}_createAnimationTracks(e,n,r,i,o){const a=[],s=e.name?e.name:e.uuid,l=[];kt[o.path]===kt.weights?e.traverse(function(p){p.morphTargetInfluences&&l.push(p.name?p.name:p.uuid)}):l.push(s);let u;switch(kt[o.path]){case kt.weights:u=Ri;break;case kt.rotation:u=Ci;break;case kt.translation:case kt.scale:u=Ii;break;default:switch(r.itemSize){case 1:u=Ri;break;case 2:case 3:default:u=Ii;break}break}const c=i.interpolation!==void 0?df[i.interpolation]:ei,f=this._getArrayFromAccessor(r);for(let p=0,d=l.length;pnew vs(t)),Ct.register(t=>new bs(t)),Ct)}async function wf(t){const r=(await Da().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 kf(t,e){if(!t){console.warn("No VRM found");return}if(e)return ws(e,t)}function Tf(){const t=W(!1),e=W(0),n=W(0),r=.2,i=1,o=6,a=W(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 _f(){let t=-1,e,n=0;function r(){e?e.set(on(-.25,.25),on(-.2,.15),-.65):e=new ae(on(-.25,.25),on(-.2,.15),-.65)}function i(o,a){var s;!(o!=null&&o.expressionManager)||!o.lookAt||(n>=t?(r(),n=0,t=ks()/1e3):e||r(),o.lookAt.target||(o.lookAt.target=new oi),o.lookAt.target.position.lerp(e,on(.2,.5)),(s=o.lookAt)==null||s.update(a),n+=a)}return{update:i}}async function Ef(t,e){const i=(await Da().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(Cr.removeUnnecessaryVertices(o.scene),Cr.combineSkeletons(o.scene),o.scene.traverse(a=>{a.frustumCulled=!1}),o.lookAt){const a=new Ts(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 Mf(t){const e=W(null),n=W(!1),r=W(0),i=W(new Map),o=W(new Map),a=W(),s=(k,A,E)=>k+(A-k)*E,l=k=>k<.5?4*k*k*k:1-(-2*k+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)},f=k=>{var E;if(c(),!u.has(k)){console.warn(`Emotion ${k} not found`);return}const A=u.get(k);if(e.value=k,n.value=!0,r.value=0,t.expressionManager){const C=Object.keys(t.expressionManager.expressionMap);for(const P of C)t.expressionManager.setValue(P,0)}i.value.clear(),o.value.clear();for(const C of A.expression||[]){const P=((E=t.expressionManager)==null?void 0:E.getValue(C.name))||0;i.value.set(C.name,P),o.value.set(C.name,C.value)}};return{currentEmotion:e,isTransitioning:n,setEmotion:f,setEmotionWithResetAfter:(k,A)=>{c(),f(k),a.value=setTimeout(()=>{f("neutral"),a.value=void 0},A)},update:k=>{var C;if(!n.value||!e.value)return;const E=u.get(e.value).blendDuration||.3;r.value+=k/E,r.value>=1&&(r.value=1,n.value=!1);for(const[P,h]of o.value){const I=i.value.get(P)||0,b=s(I,h,l(r.value));(C=t.expressionManager)==null||C.setValue(P,b)}},addEmotionState:(k,A)=>{u.set(k,A)},removeEmotionState:k=>{u.delete(k)},dispose:()=>{c()}}}const Af=Fe({__name:"Model",props:{model:null,idleAnimation:null,loadAnimations:null,position:null,paused:{type:Boolean}},emits:["loadModelProgress","error"],setup(t,{expose:e,emit:n}){const r=t,i=n;let o;const a=W(),s=W(),{scene:l}=Yn(),{onBeforeRender:u}=On(),c=Tf(),f=_f(),p=W();Be(()=>r.position,([x,v,k])=>{a.value&&a.value.scene.position.set(x,v,k)}),pn(async()=>{if(l.value)try{const x=await Ef(r.model,{scene:l.value,lookAt:!0,position:r.position,onProgress:A=>i("loadModelProgress",Number.parseFloat((100*(A.loaded/A.total)).toFixed(2)))});if(!x){console.warn("No VRM model loaded");return}const v=await wf(r.idleAnimation),k=await kf(x,v);if(!k){console.warn("No VRM animation loaded");return}s.value=new wl(x.scene),s.value.clipAction(k).play(),p.value=Mf(x),a.value=x,o=u(({delta:A})=>{var E,C,P;(E=s.value)==null||E.update(A),(C=a.value)==null||C.update(A),c.update(a.value,A),f.update(a.value,A),(P=p.value)==null||P.update(A)}).off}catch(x){i("error",x)}}),Ot(()=>{o==null||o(),a.value&&(a.value.scene.removeFromParent(),Cr.deepDispose(a.value.scene))}),e({setExpression(x){var v;(v=p.value)==null||v.setEmotionWithResetAfter(x,1e3)}});const{pause:d,resume:y}=On();return Be(()=>r.paused,x=>{x?d():y()}),(x,v)=>gn(x.$slots,"default")}}),Sf=["position"],If={absolute:"",bottom:"3",right:"3"},Rf={flex:"~ row","cursor-pointer":""},Cf=["checked","aria-checked"],Nf={key:0,"min-w":"50vw",z:"{var x;(x=p.value)==null||x.setExpression(y)}}),(y,x)=>(Z(),Xt(ha,{relative:""},{default:Ue(({height:v,width:k})=>[ke(V(kl),{alpha:!0,antialias:!0,width:k,height:v},{default:Ue(()=>[ke(V(hc)),O("TresPerspectiveCamera",{position:[a.value,s.value,l.value]},null,8,Sf),x[14]||(x[14]=O("TresDirectionalLight",{color:16777215,intensity:1.2,position:[1,1,1]},null,-1)),x[15]||(x[15]=O("TresAmbientLight",{color:16777215,intensity:1.5},null,-1)),ke(Af,{ref_key:"modelRef",ref:p,model:r.model,"idle-animation":r.idleAnimation,position:[u.value,c.value,f.value],paused:r.paused,onLoadModelProgress:x[0]||(x[0]=A=>i("loadModelProgress",A)),onError:x[1]||(x[1]=A=>i("error",A))},null,8,["model","idle-animation","position","paused"])]),_:2},1032,["width","height"]),O("div",If,[O("div",Rf,[O("label",{class:st([o.value?"bg-neutral-300 dark:bg-neutral-200":"bg-neutral-100 dark:bg-neutral-700"]),transition:"all ease-in-out duration-500",text:"lg neutral-500 dark:neutral-400","m-1":"","h-fit":"","w-fit":"","cursor-pointer":"","appearance-none":"","gap-1":"","rounded-lg":"","rounded-md":"","border-none":"","p-2":"","outline-none":""},[Et(O("input",{"onUpdate:modelValue":x[2]||(x[2]=A=>o.value=A),checked:o.value,"aria-checked":o.value,name:"showLive2DViewerInspector",type:"checkbox",hidden:"","appearance-none":"","outline-none":""},null,8,Cf),[[Qr,o.value]]),x[16]||(x[16]=O("div",{"select-none":""},[O("div",{"i-solar:bug-bold-duotone":""})],-1))],2)]),ke(ui,null,{default:Ue(()=>[o.value?(Z(),re("div",Nf,[O("div",Lf,[O("div",Pf,[O("span",null,he(V(d)("stage.viewers.debug-menu.vrm.model.title")),1)]),ke(Pi,{"h-fit":"","w-full":"",flex:"~ col",border:"~ gray/25 rounded-lg",divide:"y dashed gray/25","of-clip":"","shadow-sm":""},{label:Ue(()=>[O("span",Df,he(V(d)("stage.viewers.debug-menu.vrm.camera")),1)]),default:Ue(()=>[O("div",Of,[x[17]||(x[17]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"X")],-1)),O("label",Ff,[ke(Ut,{modelValue:a.value,"onUpdate:modelValue":x[3]||(x[3]=A=>a.value=A),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",Bf,[O("span",null,he(a.value),1)]),x[18]||(x[18]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"Y")],-1)),O("label",zf,[ke(Ut,{modelValue:s.value,"onUpdate:modelValue":x[4]||(x[4]=A=>s.value=A),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",Uf,[O("span",null,he(s.value),1)]),x[19]||(x[19]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"Z")],-1)),O("label",jf,[ke(Ut,{modelValue:l.value,"onUpdate:modelValue":x[5]||(x[5]=A=>l.value=A),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",Vf,[O("span",null,he(l.value),1)])])]),_:1}),ke(Pi,{"h-fit":"","w-full":"",flex:"~ col",border:"~ gray/25 rounded-lg",divide:"y dashed gray/25","of-clip":"","shadow-sm":""},{label:Ue(()=>[O("span",Hf,he(V(d)("stage.viewers.debug-menu.vrm.model.title")),1)]),default:Ue(()=>[O("div",$f,[x[20]||(x[20]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"X")],-1)),O("label",Gf,[ke(Ut,{modelValue:u.value,"onUpdate:modelValue":x[6]||(x[6]=A=>u.value=A),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",Yf,[O("span",null,he(u.value),1)]),x[21]||(x[21]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"Y")],-1)),O("label",Kf,[ke(Ut,{modelValue:c.value,"onUpdate:modelValue":x[7]||(x[7]=A=>c.value=A),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",qf,[O("span",null,he(c.value),1)]),x[22]||(x[22]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"Z")],-1)),O("label",Wf,[ke(Ut,{modelValue:f.value,"onUpdate:modelValue":x[8]||(x[8]=A=>f.value=A),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",Xf,[O("span",null,he(f.value),1)])])]),_:1}),O("div",Zf,[O("span",null,he(V(d)("stage.viewers.debug-menu.emotions")),1)]),O("div",Qf,[O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[9]||(x[9]=A=>{var E;return(E=p.value)==null?void 0:E.setExpression("neutral")})},he(V(d)("stage.viewers.debug-menu.emotions-btn.neutral")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[10]||(x[10]=A=>{var E;return(E=p.value)==null?void 0:E.setExpression("surprised")})},he(V(d)("stage.viewers.debug-menu.emotions-btn.surprised")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[11]||(x[11]=A=>{var E;return(E=p.value)==null?void 0:E.setExpression("sad")})},he(V(d)("stage.viewers.debug-menu.emotions-btn.sad")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[12]||(x[12]=A=>{var E;return(E=p.value)==null?void 0:E.setExpression("angry")})},he(V(d)("stage.viewers.debug-menu.emotions-btn.angry")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[13]||(x[13]=A=>{var E;return(E=p.value)==null?void 0:E.setExpression("happy")})},he(V(d)("stage.viewers.debug-menu.emotions-btn.happy")),1)])])])):it("",!0)]),_:1})])]),_:1}))}}),ed=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class bn{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}bn.prototype.normal={};bn.prototype.property={};bn.prototype.space=void 0;function Oa(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new bn(n,r,e)}function Vr(t){return t.toLowerCase()}class We{constructor(e,n){this.attribute=n,this.property=e}}We.prototype.attribute="";We.prototype.booleanish=!1;We.prototype.boolean=!1;We.prototype.commaOrSpaceSeparated=!1;We.prototype.commaSeparated=!1;We.prototype.defined=!1;We.prototype.mustUseProperty=!1;We.prototype.number=!1;We.prototype.overloadedBoolean=!1;We.prototype.property="";We.prototype.spaceSeparated=!1;We.prototype.space=void 0;let td=0;const ce=Ft(),Le=Ft(),Fa=Ft(),G=Ft(),Re=Ft(),Kt=Ft(),Qe=Ft();function Ft(){return 2**++td}const Hr=Object.freeze(Object.defineProperty({__proto__:null,boolean:ce,booleanish:Le,commaOrSpaceSeparated:Qe,commaSeparated:Kt,number:G,overloadedBoolean:Fa,spaceSeparated:Re},Symbol.toStringTag,{value:"Module"})),vr=Object.keys(Hr);class pi extends We{constructor(e,n,r,i){let o=-1;if(super(e,n),fo(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&od.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(po,ld);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!po.test(o)){let a=o.replace(id,sd);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}i=pi}return new i(r,e)}function sd(t){return"-"+t.toLowerCase()}function ld(t){return t.charAt(1).toUpperCase()}const ud=Oa([Ba,nd,ja,Va,Ha],"html"),$a=Oa([Ba,rd,ja,Va,Ha],"svg"),ho={}.hasOwnProperty;function cd(t,e){const n=e||{};function r(i,...o){let a=r.invalid;const s=r.handlers;if(i&&ho.call(i,t)){const l=String(i[t]);a=ho.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 fd=/^>|^->||--!>|"],pd=["<",">"];function hd(t,e,n,r){return r.settings.bogusComments?"":"";function i(o){return Gt(o,Object.assign({},r.settings.characterReferences,{subset:pd}))}}function md(t,e,n,r){return""}function gd(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function yd(t){return t.join(" ").trim()}const xd=/[ \t\n\f\r]/g;function hi(t){return typeof t=="object"?t.type==="text"?mo(t.value):!1:mo(t)}function mo(t){return t.replace(xd,"")===""}const De=Ya(1),Ga=Ya(-1),vd=[];function Ya(t){return e;function e(n,r,i){const o=n?n.children:vd;let a=(r||0)+t,s=o[a];if(!i)for(;s&&hi(s);)a+=t,s=o[a];return s}}const bd={}.hasOwnProperty;function Ka(t){return e;function e(n,r,i){return bd.call(t,n.tagName)&&t[n.tagName](n,r,i)}}const mi=Ka({body:kd,caption:br,colgroup:br,dd:Md,dt:Ed,head:br,html:wd,li:_d,optgroup:Ad,option:Sd,p:Td,rp:go,rt:go,tbody:Rd,td:yo,tfoot:Cd,th:yo,thead:Id,tr:Nd});function br(t,e,n){const r=De(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&hi(r.value.charAt(0)))}function wd(t,e,n){const r=De(n,e);return!r||r.type!=="comment"}function kd(t,e,n){const r=De(n,e);return!r||r.type!=="comment"}function Td(t,e,n){const r=De(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 _d(t,e,n){const r=De(n,e);return!r||r.type==="element"&&r.tagName==="li"}function Ed(t,e,n){const r=De(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Md(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function go(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Ad(t,e,n){const r=De(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function Sd(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function Id(t,e,n){const r=De(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Rd(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Cd(t,e,n){return!De(n,e)}function Nd(t,e,n){const r=De(n,e);return!r||r.type==="element"&&r.tagName==="tr"}function yo(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const Ld=Ka({body:Od,colgroup:Fd,head:Dd,html:Pd,tbody:Bd});function Pd(t){const e=De(t,-1);return!e||e.type!=="comment"}function Dd(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 Od(t){const e=De(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&hi(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function Fd(t,e,n){const r=Ga(n,e),i=De(t,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&mi(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function Bd(t,e,n){const r=Ga(n,e),i=De(t,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&mi(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const In={name:[[` \f\r &/=>`.split(""),` \f\r "&'/=>\``.split("")],[`\0 \f\r "&'/<=>`.split(""),`\0 @@ -515,18 +515,18 @@ void main() { \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 zd(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=Ga);const u=Ud(r,t.properties),c=r.all(i.space==="html"&&t.tagName==="template"?t.content:t);return r.schema=i,c&&(a=!1),(u||!o||!Ld(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||!mi(t,e,n))&&s.push(""),s.join("")}function Ud(t,e){const n=[];let r=-1,i;if(e){for(i in e)if(e[i]!==null&&e[i]!==void 0){const o=jd(t,i,e[i]);o&&n.push(o)}}for(;++rLi(n,t.alternative)&&(a=t.alternative),s=a+$t(n,Object.assign({},t.settings.characterReferences,{subset:(a==="'"?In.single:In.double)[i][o],attribute:!0}))+a),l+(s&&"="+s))}const Vd=["<","&"];function Ka(t,e,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:$t(t.value,Object.assign({},r.settings.characterReferences,{subset:Vd}))}function Hd(t,e,n,r){return r.settings.allowDangerousHtml?t.value:Ka(t,e,n,r)}function Gd(t,e,n,r){return r.all(t)}const $d=cd("type",{invalid:Yd,unknown:qd,handlers:{comment:hd,doctype:md,element:zd,raw:Hd,root:Gd,text:Ka}});function Yd(t){throw new Error("Expected node, not `"+t+"`")}function qd(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const Kd={},Wd={},Xd=[];function Qd(t,e){const n=e||Kd,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Zd,all:Jd,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||ed,characterReferences:n.characterReferences||Wd,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?Ga:ud,quote:r,alternative:i}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function Zd(t,e,n){return $d(t,e,n,this)}function Jd(t){const e=[],n=t&&t.children||Xd;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?(ct(t,t.length,0,e),t):e}const bo={}.hasOwnProperty;function ip(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 Kt(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ut=It(/[A-Za-z]/),et=It(/[\dA-Za-z]/),sp=It(/[#-'*+\--9=?A-Z^-~]/);function Gr(t){return t!==null&&(t<32||t===127)}const $r=It(/\d/),lp=It(/[\dA-Fa-f]/),up=It(/[!-/:-@[-`{-~]/);function se(t){return t!==null&&t<-2}function Ke(t){return t!==null&&(t<0||t===32)}function Ae(t){return t===-2||t===-1||t===32}const cp=It(new RegExp("\\p{P}|\\p{S}","u")),fp=It(/\s/);function It(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Jt(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 Ce(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(l){return Ae(l)?(t.enter(n),s(l)):e(l)}function s(l){return Ae(l)&&o++a))return;const I=e.events.length;let b=I,g,m;for(;b--;)if(e.events[b][0]==="exit"&&e.events[b][1].type==="chunkFlow"){if(g){m=e.events[b][1].end;break}g=!0}for(k(r),h=I;hA;){const P=n[C];e.containerState=P[1],P[0].exit.call(e,t)}n.length=A}function M(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function gp(t,e,n){return Ce(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ko(t){if(t===null||Ke(t)||fp(t))return 1;if(cp(t))return 2}function yi(t,e,n){const r=[];let i=-1;for(;++i1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const f={...t[r][1].end},p={...t[n][1].start};To(f,-l),To(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:f,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=rt(u,[["enter",t[r][1],e],["exit",t[r][1],e]])),u=rt(u,[["enter",i,e],["enter",a,e],["exit",a,e],["enter",o,e]]),u=rt(u,yi(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),u=rt(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=rt(u,[["enter",t[n][1],e],["exit",t[n][1],e]])):c=0,ct(t,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n0&&Ae(h)?Ce(t,M,"linePrefix",o+1)(h):M(h)}function M(h){return h===null||se(h)?t.check(_o,x,C)(h):(t.enter("codeFlowValue"),A(h))}function A(h){return h===null||se(h)?(t.exit("codeFlowValue"),M(h)):(t.consume(h),A)}function C(h){return t.exit("codeFenced"),e(h)}function P(h,I,b){let g=0;return m;function m(B){return h.enter("lineEnding"),h.consume(B),h.exit("lineEnding"),T}function T(B){return h.enter("codeFencedFence"),Ae(B)?Ce(h,S,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):S(B)}function S(B){return B===s?(h.enter("codeFencedFenceSequence"),F(B)):b(B)}function F(B){return B===s?(g++,h.consume(B),F):g>=a?(h.exit("codeFencedFenceSequence"),Ae(B)?Ce(h,D,"whitespace")(B):D(B)):b(B)}function D(B){return B===null||se(B)?(h.exit("codeFencedFence"),I(B)):b(B)}}}function Sp(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 wr={name:"codeIndented",tokenize:Rp},Ip={partial:!0,tokenize:Cp};function Rp(t,e,n){const r=this;return i;function i(u){return t.enter("codeIndented"),Ce(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):se(u)?t.attempt(Ip,a,l)(u):(t.enter("codeFlowValue"),s(u))}function s(u){return u===null||se(u)?(t.exit("codeFlowValue"),a(u)):(t.consume(u),s)}function l(u){return t.exit("codeIndented"),e(u)}}function Cp(t,e,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):se(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):Ce(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):se(a)?i(a):n(a)}}const Np={name:"codeText",previous:Pp,resolve:Lp,tokenize:Dp};function Lp(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&&sn(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),sn(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),sn(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 ts(t,e,n,r,i,o,a,s,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return f;function f(k){return k===60?(t.enter(r),t.enter(i),t.enter(o),t.consume(k),t.exit(o),p):k===null||k===32||k===41||Gr(k)?n(k):(t.enter(r),t.enter(a),t.enter(s),t.enter("chunkString",{contentType:"string"}),x(k))}function p(k){return k===62?(t.enter(o),t.consume(k),t.exit(o),t.exit(i),t.exit(r),e):(t.enter(s),t.enter("chunkString",{contentType:"string"}),d(k))}function d(k){return k===62?(t.exit("chunkString"),t.exit(s),p(k)):k===null||k===60||se(k)?n(k):(t.consume(k),k===92?y:d)}function y(k){return k===60||k===62||k===92?(t.consume(k),d):d(k)}function x(k){return!c&&(k===null||k===41||Ke(k))?(t.exit("chunkString"),t.exit(s),t.exit(a),t.exit(r),e(k)):c999||d===null||d===91||d===93&&!l||d===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):d===93?(t.exit(o),t.enter(i),t.consume(d),t.exit(i),t.exit(r),e):se(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),c):(t.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===null||d===91||d===93||se(d)||s++>999?(t.exit("chunkString"),c(d)):(t.consume(d),l||(l=!Ae(d)),d===92?p:f)}function p(d){return d===91||d===92||d===93?(t.consume(d),s++,f):f(d)}}function rs(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):se(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),Ce(t,u,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===a||p===null||se(p)?(t.exit("chunkString"),u(p)):(t.consume(p),p===92?f:c)}function f(p){return p===a||p===92?(t.consume(p),c):c(p)}}function fn(t,e){let n;return r;function r(i){return se(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):Ae(i)?Ce(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const Hp={name:"definition",tokenize:$p},Gp={partial:!0,tokenize:Yp};function $p(t,e,n){const r=this;let i;return o;function o(d){return t.enter("definition"),a(d)}function a(d){return ns.call(r,t,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function s(d){return i=Kt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(t.enter("definitionMarker"),t.consume(d),t.exit("definitionMarker"),l):n(d)}function l(d){return Ke(d)?fn(t,u)(d):u(d)}function u(d){return ts(t,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return t.attempt(Gp,f,f)(d)}function f(d){return Ae(d)?Ce(t,p,"whitespace")(d):p(d)}function p(d){return d===null||se(d)?(t.exit("definition"),r.parser.defined.push(i),e(d)):n(d)}}function Yp(t,e,n){return r;function r(s){return Ke(s)?fn(t,i)(s):n(s)}function i(s){return rs(t,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return Ae(s)?Ce(t,a,"whitespace")(s):a(s)}function a(s){return s===null||se(s)?e(s):n(s)}}const qp={name:"hardBreakEscape",tokenize:Kp};function Kp(t,e,n){return r;function r(o){return t.enter("hardBreakEscape"),t.consume(o),i}function i(o){return se(o)?(t.exit("hardBreakEscape"),e(o)):n(o)}}const Wp={name:"headingAtx",resolve:Xp,tokenize:Qp};function Xp(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"},ct(t,r,n-r+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),t}function Qp(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||Ke(c)?(t.exit("atxHeadingSequence"),s(c)):n(c)}function s(c){return c===35?(t.enter("atxHeadingSequence"),l(c)):c===null||se(c)?(t.exit("atxHeading"),e(c)):Ae(c)?Ce(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||Ke(c)?(t.exit("atxHeadingText"),s(c)):(t.consume(c),u)}}const Zp=["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"],Eo=["pre","script","style","textarea"],Jp={concrete:!0,name:"htmlFlow",resolveTo:nh,tokenize:rh},eh={partial:!0,tokenize:oh},th={partial:!0,tokenize:ih};function nh(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 rh(t,e,n){const r=this;let i,o,a,s,l;return u;function u(R){return c(R)}function c(R){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(R),f}function f(R){return R===33?(t.consume(R),p):R===47?(t.consume(R),o=!0,x):R===63?(t.consume(R),i=3,r.interrupt?e:_):ut(R)?(t.consume(R),a=String.fromCharCode(R),v):n(R)}function p(R){return R===45?(t.consume(R),i=2,d):R===91?(t.consume(R),i=5,s=0,y):ut(R)?(t.consume(R),i=4,r.interrupt?e:_):n(R)}function d(R){return R===45?(t.consume(R),r.interrupt?e:_):n(R)}function y(R){const ge="CDATA[";return R===ge.charCodeAt(s++)?(t.consume(R),s===ge.length?r.interrupt?e:S:y):n(R)}function x(R){return ut(R)?(t.consume(R),a=String.fromCharCode(R),v):n(R)}function v(R){if(R===null||R===47||R===62||Ke(R)){const ge=R===47,Te=a.toLowerCase();return!ge&&!o&&Eo.includes(Te)?(i=1,r.interrupt?e(R):S(R)):Zp.includes(a.toLowerCase())?(i=6,ge?(t.consume(R),k):r.interrupt?e(R):S(R)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(R):o?M(R):A(R))}return R===45||et(R)?(t.consume(R),a+=String.fromCharCode(R),v):n(R)}function k(R){return R===62?(t.consume(R),r.interrupt?e:S):n(R)}function M(R){return Ae(R)?(t.consume(R),M):m(R)}function A(R){return R===47?(t.consume(R),m):R===58||R===95||ut(R)?(t.consume(R),C):Ae(R)?(t.consume(R),A):m(R)}function C(R){return R===45||R===46||R===58||R===95||et(R)?(t.consume(R),C):P(R)}function P(R){return R===61?(t.consume(R),h):Ae(R)?(t.consume(R),P):A(R)}function h(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(t.consume(R),l=R,I):Ae(R)?(t.consume(R),h):b(R)}function I(R){return R===l?(t.consume(R),l=null,g):R===null||se(R)?n(R):(t.consume(R),I)}function b(R){return R===null||R===34||R===39||R===47||R===60||R===61||R===62||R===96||Ke(R)?P(R):(t.consume(R),b)}function g(R){return R===47||R===62||Ae(R)?A(R):n(R)}function m(R){return R===62?(t.consume(R),T):n(R)}function T(R){return R===null||se(R)?S(R):Ae(R)?(t.consume(R),T):n(R)}function S(R){return R===45&&i===2?(t.consume(R),j):R===60&&i===1?(t.consume(R),J):R===62&&i===4?(t.consume(R),ee):R===63&&i===3?(t.consume(R),_):R===93&&i===5?(t.consume(R),Z):se(R)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(eh,me,F)(R)):R===null||se(R)?(t.exit("htmlFlowData"),F(R)):(t.consume(R),S)}function F(R){return t.check(th,D,me)(R)}function D(R){return t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),B}function B(R){return R===null||se(R)?F(R):(t.enter("htmlFlowData"),S(R))}function j(R){return R===45?(t.consume(R),_):S(R)}function J(R){return R===47?(t.consume(R),a="",oe):S(R)}function oe(R){if(R===62){const ge=a.toLowerCase();return Eo.includes(ge)?(t.consume(R),ee):S(R)}return ut(R)&&a.length<8?(t.consume(R),a+=String.fromCharCode(R),oe):S(R)}function Z(R){return R===93?(t.consume(R),_):S(R)}function _(R){return R===62?(t.consume(R),ee):R===45&&i===2?(t.consume(R),_):S(R)}function ee(R){return R===null||se(R)?(t.exit("htmlFlowData"),me(R)):(t.consume(R),ee)}function me(R){return t.exit("htmlFlow"),e(R)}}function ih(t,e,n){const r=this;return i;function i(a){return se(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 oh(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Qn,e,n)}}const ah={name:"htmlText",tokenize:sh};function sh(t,e,n){const r=this;let i,o,a;return s;function s(_){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(_),l}function l(_){return _===33?(t.consume(_),u):_===47?(t.consume(_),P):_===63?(t.consume(_),A):ut(_)?(t.consume(_),b):n(_)}function u(_){return _===45?(t.consume(_),c):_===91?(t.consume(_),o=0,y):ut(_)?(t.consume(_),M):n(_)}function c(_){return _===45?(t.consume(_),d):n(_)}function f(_){return _===null?n(_):_===45?(t.consume(_),p):se(_)?(a=f,J(_)):(t.consume(_),f)}function p(_){return _===45?(t.consume(_),d):f(_)}function d(_){return _===62?j(_):_===45?p(_):f(_)}function y(_){const ee="CDATA[";return _===ee.charCodeAt(o++)?(t.consume(_),o===ee.length?x:y):n(_)}function x(_){return _===null?n(_):_===93?(t.consume(_),v):se(_)?(a=x,J(_)):(t.consume(_),x)}function v(_){return _===93?(t.consume(_),k):x(_)}function k(_){return _===62?j(_):_===93?(t.consume(_),k):x(_)}function M(_){return _===null||_===62?j(_):se(_)?(a=M,J(_)):(t.consume(_),M)}function A(_){return _===null?n(_):_===63?(t.consume(_),C):se(_)?(a=A,J(_)):(t.consume(_),A)}function C(_){return _===62?j(_):A(_)}function P(_){return ut(_)?(t.consume(_),h):n(_)}function h(_){return _===45||et(_)?(t.consume(_),h):I(_)}function I(_){return se(_)?(a=I,J(_)):Ae(_)?(t.consume(_),I):j(_)}function b(_){return _===45||et(_)?(t.consume(_),b):_===47||_===62||Ke(_)?g(_):n(_)}function g(_){return _===47?(t.consume(_),j):_===58||_===95||ut(_)?(t.consume(_),m):se(_)?(a=g,J(_)):Ae(_)?(t.consume(_),g):j(_)}function m(_){return _===45||_===46||_===58||_===95||et(_)?(t.consume(_),m):T(_)}function T(_){return _===61?(t.consume(_),S):se(_)?(a=T,J(_)):Ae(_)?(t.consume(_),T):g(_)}function S(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(t.consume(_),i=_,F):se(_)?(a=S,J(_)):Ae(_)?(t.consume(_),S):(t.consume(_),D)}function F(_){return _===i?(t.consume(_),i=void 0,B):_===null?n(_):se(_)?(a=F,J(_)):(t.consume(_),F)}function D(_){return _===null||_===34||_===39||_===60||_===61||_===96?n(_):_===47||_===62||Ke(_)?g(_):(t.consume(_),D)}function B(_){return _===47||_===62||Ke(_)?g(_):n(_)}function j(_){return _===62?(t.consume(_),t.exit("htmlTextData"),t.exit("htmlText"),e):n(_)}function J(_){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(_),t.exit("lineEnding"),oe}function oe(_){return Ae(_)?Ce(t,Z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):Z(_)}function Z(_){return t.enter("htmlTextData"),a(_)}}const xi={name:"labelEnd",resolveAll:fh,resolveTo:dh,tokenize:ph},lh={tokenize:hh},uh={tokenize:mh},ch={tokenize:gh};function fh(t){let e=-1;const n=[];for(;++e=3&&(u===null||se(u))?(t.exit("thematicBreak"),e(u)):n(u)}function l(u){return u===i?(t.consume(u),r++,l):(t.exit("thematicBreakSequence"),Ae(u)?Ce(t,s,"whitespace")(u):s(u))}}const Ye={continuation:{tokenize:Eh},exit:Sh,name:"list",tokenize:Ah},Th={partial:!0,tokenize:Ih},_h={partial:!0,tokenize:Mh};function Ah(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(d){const y=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:$r(d)){if(r.containerState.type||(r.containerState.type=y,t.enter(y,{_container:!0})),y==="listUnordered")return t.enter("listItemPrefix"),d===42||d===45?t.check(Dn,n,u)(d):u(d);if(!r.interrupt||d===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(d)}return n(d)}function l(d){return $r(d)&&++a<10?(t.consume(d),l):(!r.interrupt||a<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(t.exit("listItemValue"),u(d)):n(d)}function u(d){return t.enter("listItemMarker"),t.consume(d),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,t.check(Qn,r.interrupt?n:c,t.attempt(Th,p,f))}function c(d){return r.containerState.initialBlankLine=!0,o++,p(d)}function f(d){return Ae(d)?(t.enter("listItemPrefixWhitespace"),t.consume(d),t.exit("listItemPrefixWhitespace"),p):n(d)}function p(d){return r.containerState.size=o+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(d)}}function Eh(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(Qn,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ce(t,e,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!Ae(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(_h,e,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ce(t,t.attempt(Ye,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function Mh(t,e,n){const r=this;return Ce(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 Sh(t){t.exit(this.containerState.type)}function Ih(t,e,n){const r=this;return Ce(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!Ae(o)&&a&&a[1].type==="listItemPrefixWhitespace"?e(o):n(o)}}const Mo={name:"setextUnderline",resolveTo:Rh,tokenize:Ch};function Rh(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 Ch(t,e,n){const r=this;let i;return o;function o(u){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(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"),Ae(u)?Ce(t,l,"lineSuffix")(u):l(u))}function l(u){return u===null||se(u)?(t.exit("setextHeadingLine"),e(u)):n(u)}}const Nh={tokenize:Lh};function Lh(t){const e=this,n=t.attempt(Qn,r,t.attempt(this.parser.constructs.flowInitial,i,Ce(t,t.attempt(this.parser.constructs.flow,i,t.attempt(Fp,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 Ph={resolveAll:os()},Dh=is("string"),Oh=is("text");function is(t){return{resolveAll:os(t==="text"?Bh: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 f=i[c];let p=-1;if(f)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 Xh(t,e){let n=-1;const r=[];let i;for(;++n\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function zd(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=$a);const u=Ud(r,t.properties),c=r.all(i.space==="html"&&t.tagName==="template"?t.content:t);return r.schema=i,c&&(a=!1),(u||!o||!Ld(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||!mi(t,e,n))&&s.push(""),s.join("")}function Ud(t,e){const n=[];let r=-1,i;if(e){for(i in e)if(e[i]!==null&&e[i]!==void 0){const o=jd(t,i,e[i]);o&&n.push(o)}}for(;++rLi(n,t.alternative)&&(a=t.alternative),s=a+Gt(n,Object.assign({},t.settings.characterReferences,{subset:(a==="'"?In.single:In.double)[i][o],attribute:!0}))+a),l+(s&&"="+s))}const Vd=["<","&"];function qa(t,e,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:Gt(t.value,Object.assign({},r.settings.characterReferences,{subset:Vd}))}function Hd(t,e,n,r){return r.settings.allowDangerousHtml?t.value:qa(t,e,n,r)}function $d(t,e,n,r){return r.all(t)}const Gd=cd("type",{invalid:Yd,unknown:Kd,handlers:{comment:hd,doctype:md,element:zd,raw:Hd,root:$d,text:qa}});function Yd(t){throw new Error("Expected node, not `"+t+"`")}function Kd(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const qd={},Wd={},Xd=[];function Zd(t,e){const n=e||qd,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Qd,all:Jd,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||ed,characterReferences:n.characterReferences||Wd,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?$a:ud,quote:r,alternative:i}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function Qd(t,e,n){return Gd(t,e,n,this)}function Jd(t){const e=[],n=t&&t.children||Xd;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?(ct(t,t.length,0,e),t):e}const bo={}.hasOwnProperty;function ip(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 qt(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ut=It(/[A-Za-z]/),et=It(/[\dA-Za-z]/),sp=It(/[#-'*+\--9=?A-Z^-~]/);function $r(t){return t!==null&&(t<32||t===127)}const Gr=It(/\d/),lp=It(/[\dA-Fa-f]/),up=It(/[!-/:-@[-`{-~]/);function se(t){return t!==null&&t<-2}function qe(t){return t!==null&&(t<0||t===32)}function Ee(t){return t===-2||t===-1||t===32}const cp=It(new RegExp("\\p{P}|\\p{S}","u")),fp=It(/\s/);function It(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Jt(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 Ce(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(l){return Ee(l)?(t.enter(n),s(l)):e(l)}function s(l){return Ee(l)&&o++a))return;const I=e.events.length;let b=I,g,m;for(;b--;)if(e.events[b][0]==="exit"&&e.events[b][1].type==="chunkFlow"){if(g){m=e.events[b][1].end;break}g=!0}for(k(r),h=I;hE;){const P=n[C];e.containerState=P[1],P[0].exit.call(e,t)}n.length=E}function A(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function gp(t,e,n){return Ce(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ko(t){if(t===null||qe(t)||fp(t))return 1;if(cp(t))return 2}function yi(t,e,n){const r=[];let i=-1;for(;++i1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const f={...t[r][1].end},p={...t[n][1].start};To(f,-l),To(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:f,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=rt(u,[["enter",t[r][1],e],["exit",t[r][1],e]])),u=rt(u,[["enter",i,e],["enter",a,e],["exit",a,e],["enter",o,e]]),u=rt(u,yi(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),u=rt(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=rt(u,[["enter",t[n][1],e],["exit",t[n][1],e]])):c=0,ct(t,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n0&&Ee(h)?Ce(t,A,"linePrefix",o+1)(h):A(h)}function A(h){return h===null||se(h)?t.check(_o,x,C)(h):(t.enter("codeFlowValue"),E(h))}function E(h){return h===null||se(h)?(t.exit("codeFlowValue"),A(h)):(t.consume(h),E)}function C(h){return t.exit("codeFenced"),e(h)}function P(h,I,b){let g=0;return m;function m(F){return h.enter("lineEnding"),h.consume(F),h.exit("lineEnding"),T}function T(F){return h.enter("codeFencedFence"),Ee(F)?Ce(h,S,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):S(F)}function S(F){return F===s?(h.enter("codeFencedFenceSequence"),B(F)):b(F)}function B(F){return F===s?(g++,h.consume(F),B):g>=a?(h.exit("codeFencedFenceSequence"),Ee(F)?Ce(h,D,"whitespace")(F):D(F)):b(F)}function D(F){return F===null||se(F)?(h.exit("codeFencedFence"),I(F)):b(F)}}}function Sp(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 wr={name:"codeIndented",tokenize:Rp},Ip={partial:!0,tokenize:Cp};function Rp(t,e,n){const r=this;return i;function i(u){return t.enter("codeIndented"),Ce(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):se(u)?t.attempt(Ip,a,l)(u):(t.enter("codeFlowValue"),s(u))}function s(u){return u===null||se(u)?(t.exit("codeFlowValue"),a(u)):(t.consume(u),s)}function l(u){return t.exit("codeIndented"),e(u)}}function Cp(t,e,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):se(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):Ce(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):se(a)?i(a):n(a)}}const Np={name:"codeText",previous:Pp,resolve:Lp,tokenize:Dp};function Lp(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&&sn(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),sn(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),sn(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 ts(t,e,n,r,i,o,a,s,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return f;function f(k){return k===60?(t.enter(r),t.enter(i),t.enter(o),t.consume(k),t.exit(o),p):k===null||k===32||k===41||$r(k)?n(k):(t.enter(r),t.enter(a),t.enter(s),t.enter("chunkString",{contentType:"string"}),x(k))}function p(k){return k===62?(t.enter(o),t.consume(k),t.exit(o),t.exit(i),t.exit(r),e):(t.enter(s),t.enter("chunkString",{contentType:"string"}),d(k))}function d(k){return k===62?(t.exit("chunkString"),t.exit(s),p(k)):k===null||k===60||se(k)?n(k):(t.consume(k),k===92?y:d)}function y(k){return k===60||k===62||k===92?(t.consume(k),d):d(k)}function x(k){return!c&&(k===null||k===41||qe(k))?(t.exit("chunkString"),t.exit(s),t.exit(a),t.exit(r),e(k)):c999||d===null||d===91||d===93&&!l||d===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):d===93?(t.exit(o),t.enter(i),t.consume(d),t.exit(i),t.exit(r),e):se(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),c):(t.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===null||d===91||d===93||se(d)||s++>999?(t.exit("chunkString"),c(d)):(t.consume(d),l||(l=!Ee(d)),d===92?p:f)}function p(d){return d===91||d===92||d===93?(t.consume(d),s++,f):f(d)}}function rs(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):se(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),Ce(t,u,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===a||p===null||se(p)?(t.exit("chunkString"),u(p)):(t.consume(p),p===92?f:c)}function f(p){return p===a||p===92?(t.consume(p),c):c(p)}}function fn(t,e){let n;return r;function r(i){return se(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):Ee(i)?Ce(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const Hp={name:"definition",tokenize:Gp},$p={partial:!0,tokenize:Yp};function Gp(t,e,n){const r=this;let i;return o;function o(d){return t.enter("definition"),a(d)}function a(d){return ns.call(r,t,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function s(d){return i=qt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(t.enter("definitionMarker"),t.consume(d),t.exit("definitionMarker"),l):n(d)}function l(d){return qe(d)?fn(t,u)(d):u(d)}function u(d){return ts(t,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return t.attempt($p,f,f)(d)}function f(d){return Ee(d)?Ce(t,p,"whitespace")(d):p(d)}function p(d){return d===null||se(d)?(t.exit("definition"),r.parser.defined.push(i),e(d)):n(d)}}function Yp(t,e,n){return r;function r(s){return qe(s)?fn(t,i)(s):n(s)}function i(s){return rs(t,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return Ee(s)?Ce(t,a,"whitespace")(s):a(s)}function a(s){return s===null||se(s)?e(s):n(s)}}const Kp={name:"hardBreakEscape",tokenize:qp};function qp(t,e,n){return r;function r(o){return t.enter("hardBreakEscape"),t.consume(o),i}function i(o){return se(o)?(t.exit("hardBreakEscape"),e(o)):n(o)}}const Wp={name:"headingAtx",resolve:Xp,tokenize:Zp};function Xp(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"},ct(t,r,n-r+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),t}function Zp(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||qe(c)?(t.exit("atxHeadingSequence"),s(c)):n(c)}function s(c){return c===35?(t.enter("atxHeadingSequence"),l(c)):c===null||se(c)?(t.exit("atxHeading"),e(c)):Ee(c)?Ce(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||qe(c)?(t.exit("atxHeadingText"),s(c)):(t.consume(c),u)}}const Qp=["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"],Mo=["pre","script","style","textarea"],Jp={concrete:!0,name:"htmlFlow",resolveTo:nh,tokenize:rh},eh={partial:!0,tokenize:oh},th={partial:!0,tokenize:ih};function nh(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 rh(t,e,n){const r=this;let i,o,a,s,l;return u;function u(R){return c(R)}function c(R){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(R),f}function f(R){return R===33?(t.consume(R),p):R===47?(t.consume(R),o=!0,x):R===63?(t.consume(R),i=3,r.interrupt?e:_):ut(R)?(t.consume(R),a=String.fromCharCode(R),v):n(R)}function p(R){return R===45?(t.consume(R),i=2,d):R===91?(t.consume(R),i=5,s=0,y):ut(R)?(t.consume(R),i=4,r.interrupt?e:_):n(R)}function d(R){return R===45?(t.consume(R),r.interrupt?e:_):n(R)}function y(R){const ge="CDATA[";return R===ge.charCodeAt(s++)?(t.consume(R),s===ge.length?r.interrupt?e:S:y):n(R)}function x(R){return ut(R)?(t.consume(R),a=String.fromCharCode(R),v):n(R)}function v(R){if(R===null||R===47||R===62||qe(R)){const ge=R===47,Te=a.toLowerCase();return!ge&&!o&&Mo.includes(Te)?(i=1,r.interrupt?e(R):S(R)):Qp.includes(a.toLowerCase())?(i=6,ge?(t.consume(R),k):r.interrupt?e(R):S(R)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(R):o?A(R):E(R))}return R===45||et(R)?(t.consume(R),a+=String.fromCharCode(R),v):n(R)}function k(R){return R===62?(t.consume(R),r.interrupt?e:S):n(R)}function A(R){return Ee(R)?(t.consume(R),A):m(R)}function E(R){return R===47?(t.consume(R),m):R===58||R===95||ut(R)?(t.consume(R),C):Ee(R)?(t.consume(R),E):m(R)}function C(R){return R===45||R===46||R===58||R===95||et(R)?(t.consume(R),C):P(R)}function P(R){return R===61?(t.consume(R),h):Ee(R)?(t.consume(R),P):E(R)}function h(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(t.consume(R),l=R,I):Ee(R)?(t.consume(R),h):b(R)}function I(R){return R===l?(t.consume(R),l=null,g):R===null||se(R)?n(R):(t.consume(R),I)}function b(R){return R===null||R===34||R===39||R===47||R===60||R===61||R===62||R===96||qe(R)?P(R):(t.consume(R),b)}function g(R){return R===47||R===62||Ee(R)?E(R):n(R)}function m(R){return R===62?(t.consume(R),T):n(R)}function T(R){return R===null||se(R)?S(R):Ee(R)?(t.consume(R),T):n(R)}function S(R){return R===45&&i===2?(t.consume(R),j):R===60&&i===1?(t.consume(R),J):R===62&&i===4?(t.consume(R),ee):R===63&&i===3?(t.consume(R),_):R===93&&i===5?(t.consume(R),Q):se(R)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(eh,me,B)(R)):R===null||se(R)?(t.exit("htmlFlowData"),B(R)):(t.consume(R),S)}function B(R){return t.check(th,D,me)(R)}function D(R){return t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),F}function F(R){return R===null||se(R)?B(R):(t.enter("htmlFlowData"),S(R))}function j(R){return R===45?(t.consume(R),_):S(R)}function J(R){return R===47?(t.consume(R),a="",oe):S(R)}function oe(R){if(R===62){const ge=a.toLowerCase();return Mo.includes(ge)?(t.consume(R),ee):S(R)}return ut(R)&&a.length<8?(t.consume(R),a+=String.fromCharCode(R),oe):S(R)}function Q(R){return R===93?(t.consume(R),_):S(R)}function _(R){return R===62?(t.consume(R),ee):R===45&&i===2?(t.consume(R),_):S(R)}function ee(R){return R===null||se(R)?(t.exit("htmlFlowData"),me(R)):(t.consume(R),ee)}function me(R){return t.exit("htmlFlow"),e(R)}}function ih(t,e,n){const r=this;return i;function i(a){return se(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 oh(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Zn,e,n)}}const ah={name:"htmlText",tokenize:sh};function sh(t,e,n){const r=this;let i,o,a;return s;function s(_){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(_),l}function l(_){return _===33?(t.consume(_),u):_===47?(t.consume(_),P):_===63?(t.consume(_),E):ut(_)?(t.consume(_),b):n(_)}function u(_){return _===45?(t.consume(_),c):_===91?(t.consume(_),o=0,y):ut(_)?(t.consume(_),A):n(_)}function c(_){return _===45?(t.consume(_),d):n(_)}function f(_){return _===null?n(_):_===45?(t.consume(_),p):se(_)?(a=f,J(_)):(t.consume(_),f)}function p(_){return _===45?(t.consume(_),d):f(_)}function d(_){return _===62?j(_):_===45?p(_):f(_)}function y(_){const ee="CDATA[";return _===ee.charCodeAt(o++)?(t.consume(_),o===ee.length?x:y):n(_)}function x(_){return _===null?n(_):_===93?(t.consume(_),v):se(_)?(a=x,J(_)):(t.consume(_),x)}function v(_){return _===93?(t.consume(_),k):x(_)}function k(_){return _===62?j(_):_===93?(t.consume(_),k):x(_)}function A(_){return _===null||_===62?j(_):se(_)?(a=A,J(_)):(t.consume(_),A)}function E(_){return _===null?n(_):_===63?(t.consume(_),C):se(_)?(a=E,J(_)):(t.consume(_),E)}function C(_){return _===62?j(_):E(_)}function P(_){return ut(_)?(t.consume(_),h):n(_)}function h(_){return _===45||et(_)?(t.consume(_),h):I(_)}function I(_){return se(_)?(a=I,J(_)):Ee(_)?(t.consume(_),I):j(_)}function b(_){return _===45||et(_)?(t.consume(_),b):_===47||_===62||qe(_)?g(_):n(_)}function g(_){return _===47?(t.consume(_),j):_===58||_===95||ut(_)?(t.consume(_),m):se(_)?(a=g,J(_)):Ee(_)?(t.consume(_),g):j(_)}function m(_){return _===45||_===46||_===58||_===95||et(_)?(t.consume(_),m):T(_)}function T(_){return _===61?(t.consume(_),S):se(_)?(a=T,J(_)):Ee(_)?(t.consume(_),T):g(_)}function S(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(t.consume(_),i=_,B):se(_)?(a=S,J(_)):Ee(_)?(t.consume(_),S):(t.consume(_),D)}function B(_){return _===i?(t.consume(_),i=void 0,F):_===null?n(_):se(_)?(a=B,J(_)):(t.consume(_),B)}function D(_){return _===null||_===34||_===39||_===60||_===61||_===96?n(_):_===47||_===62||qe(_)?g(_):(t.consume(_),D)}function F(_){return _===47||_===62||qe(_)?g(_):n(_)}function j(_){return _===62?(t.consume(_),t.exit("htmlTextData"),t.exit("htmlText"),e):n(_)}function J(_){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(_),t.exit("lineEnding"),oe}function oe(_){return Ee(_)?Ce(t,Q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):Q(_)}function Q(_){return t.enter("htmlTextData"),a(_)}}const xi={name:"labelEnd",resolveAll:fh,resolveTo:dh,tokenize:ph},lh={tokenize:hh},uh={tokenize:mh},ch={tokenize:gh};function fh(t){let e=-1;const n=[];for(;++e=3&&(u===null||se(u))?(t.exit("thematicBreak"),e(u)):n(u)}function l(u){return u===i?(t.consume(u),r++,l):(t.exit("thematicBreakSequence"),Ee(u)?Ce(t,s,"whitespace")(u):s(u))}}const Ye={continuation:{tokenize:Mh},exit:Sh,name:"list",tokenize:Eh},Th={partial:!0,tokenize:Ih},_h={partial:!0,tokenize:Ah};function Eh(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(d){const y=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:Gr(d)){if(r.containerState.type||(r.containerState.type=y,t.enter(y,{_container:!0})),y==="listUnordered")return t.enter("listItemPrefix"),d===42||d===45?t.check(Dn,n,u)(d):u(d);if(!r.interrupt||d===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(d)}return n(d)}function l(d){return Gr(d)&&++a<10?(t.consume(d),l):(!r.interrupt||a<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(t.exit("listItemValue"),u(d)):n(d)}function u(d){return t.enter("listItemMarker"),t.consume(d),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,t.check(Zn,r.interrupt?n:c,t.attempt(Th,p,f))}function c(d){return r.containerState.initialBlankLine=!0,o++,p(d)}function f(d){return Ee(d)?(t.enter("listItemPrefixWhitespace"),t.consume(d),t.exit("listItemPrefixWhitespace"),p):n(d)}function p(d){return r.containerState.size=o+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(d)}}function Mh(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(Zn,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ce(t,e,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!Ee(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(_h,e,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ce(t,t.attempt(Ye,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function Ah(t,e,n){const r=this;return Ce(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 Sh(t){t.exit(this.containerState.type)}function Ih(t,e,n){const r=this;return Ce(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!Ee(o)&&a&&a[1].type==="listItemPrefixWhitespace"?e(o):n(o)}}const Ao={name:"setextUnderline",resolveTo:Rh,tokenize:Ch};function Rh(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 Ch(t,e,n){const r=this;let i;return o;function o(u){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(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"),Ee(u)?Ce(t,l,"lineSuffix")(u):l(u))}function l(u){return u===null||se(u)?(t.exit("setextHeadingLine"),e(u)):n(u)}}const Nh={tokenize:Lh};function Lh(t){const e=this,n=t.attempt(Zn,r,t.attempt(this.parser.constructs.flowInitial,i,Ce(t,t.attempt(this.parser.constructs.flow,i,t.attempt(Bp,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 Ph={resolveAll:os()},Dh=is("string"),Oh=is("text");function is(t){return{resolveAll:os(t==="text"?Fh: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 f=i[c];let p=-1;if(f)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 Xh(t,e){let n=-1;const r=[];let i;for(;++n0){const He=ie.tokenStack[ie.tokenStack.length-1];(He[1]||Co).call(ie,void 0,He[0])}for(K.position={start:Tt(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:Tt(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},be=-1;++be0){const He=ie.tokenStack[ie.tokenStack.length-1];(He[1]||Co).call(ie,void 0,He[0])}for(q.position={start:Tt(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:Tt(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},be=-1;++be1?"-"+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 pm(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 hm(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function ls(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 mm(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return ls(t,e);const i={src:Jt(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 gm(t,e){const n={src:Jt(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 ym(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 xm(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return ls(t,e);const i={href:Jt(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 vm(t,e){const n={href:Jt(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 bm(t,e,n){const r=t.all(e),i=n?wm(n):us(e),o={},a=[];if(typeof e.checked=="boolean"){const c=r[0];let f;c&&c.type==="element"&&c.tagName==="p"?f=c:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.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 km(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 Em(t){const e=fs(t),n=cs(t);if(e&&n)return{start:e,end:n}}function Mm(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=fs(e.children[1]),l=cs(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 Sm(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(Po(e.slice(i),i>0,!1)),o.join("")}function Po(t,e,n){let r=0,i=t.length;if(e){let o=t.codePointAt(r);for(;o===No||o===Lo;)r++,o=t.codePointAt(r)}if(n){let o=t.codePointAt(i-1);for(;o===No||o===Lo;)i--,o=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function Cm(t,e){const n={type:"text",value:Rm(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function Nm(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const Lm={blockquote:sm,break:lm,code:um,delete:cm,emphasis:fm,footnoteReference:dm,heading:pm,html:hm,imageReference:mm,image:gm,inlineCode:ym,linkReference:xm,link:vm,listItem:bm,list:km,paragraph:Tm,root:_m,strong:Am,table:Mm,tableCell:Im,tableRow:Sm,text:Cm,thematicBreak:Nm,toml:Rn,yaml:Rn,definition:Rn,footnoteDefinition:Rn};function Rn(){}const ps=-1,Zn=0,Vn=1,Hn=2,vi=3,bi=4,wi=5,ki=6,hs=7,ms=8,Do=typeof self=="object"?self:globalThis,Pm=(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 Zn:case ps:return n(a,i);case Vn:{const s=n([],i);for(const l of a)s.push(r(l));return s}case Hn:{const s=n({},i);for(const[l,u]of a)s[r(l)]=r(u);return s}case vi:return n(new Date(a),i);case bi:{const{source:s,flags:l}=a;return n(new RegExp(s,l),i)}case wi:{const s=n(new Map,i);for(const[l,u]of a)s.set(r(l),r(u));return s}case ki:{const s=n(new Set,i);for(const l of a)s.add(r(l));return s}case hs:{const{name:s,message:l}=a;return n(new Do[s](l),i)}case ms:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i)}return n(new Do[o](a),i)};return r},Oo=t=>Pm(new Map,t)(0),jt="",{toString:Dm}={},{keys:Om}=Object,ln=t=>{const e=typeof t;if(e!=="object"||!t)return[Zn,e];const n=Dm.call(t).slice(8,-1);switch(n){case"Array":return[Vn,jt];case"Object":return[Hn,jt];case"Date":return[vi,jt];case"RegExp":return[bi,jt];case"Map":return[wi,jt];case"Set":return[ki,jt]}return n.includes("Array")?[Vn,n]:n.includes("Error")?[hs,n]:[Hn,n]},Cn=([t,e])=>t===Zn&&(e==="function"||e==="symbol"),Bm=(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]=ln(a);switch(s){case Zn:{let c=a;switch(l){case"bigint":s=ms,c=a.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+l);c=null;break;case"undefined":return i([ps],a)}return i([s,c],a)}case Vn:{if(l)return i([l,[...a]],a);const c=[],f=i([s,c],a);for(const p of a)c.push(o(p));return f}case Hn:{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=[],f=i([s,c],a);for(const p of Om(a))(t||!Cn(ln(a[p])))&&c.push([o(p),o(a[p])]);return f}case vi:return i([s,a.toISOString()],a);case bi:{const{source:c,flags:f}=a;return i([s,{source:c,flags:f}],a)}case wi:{const c=[],f=i([s,c],a);for(const[p,d]of a)(t||!(Cn(ln(p))||Cn(ln(d))))&&c.push([o(p),o(d)]);return f}case ki:{const c=[],f=i([s,c],a);for(const p of a)(t||!Cn(ln(p)))&&c.push(o(p));return f}}const{message:u}=a;return i([s,{name:l,message:u}],a)};return o},Bo=(t,{json:e,lossy:n}={})=>{const r=[];return Bm(!(e||n),!!e,new Map,r)(t),r},Gn=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?Oo(Bo(t,e)):structuredClone(t):(t,e)=>Oo(Bo(t,e));function Fm(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 zm(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function Um(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||Fm,r=t.options.footnoteBackLabel||zm,i=t.options.footnoteLabel||"Footnotes",o=t.options.footnoteLabelTagName||"h2",a=t.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l0&&y.push({type:"text",value:" "});let M=typeof n=="string"?n:n(l,d);typeof M=="string"&&(M={type:"text",value:M}),y.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+p+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(M)?M:[M]})}const v=c[c.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const M=v.children[v.children.length-1];M&&M.type==="text"?M.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...y)}else c.push(...y);const k={type:"element",tagName:"li",properties:{id:e+"fn-"+p},children:t.wrap(c,!0)};t.patch(u,k),s.push(k)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Gn(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`});const u={type:"element",tagName:"li",properties:o,children:a};return t.patch(e,u),t.applyData(e,u)}function wm(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r1}function km(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 Mm(t){const e=fs(t),n=cs(t);if(e&&n)return{start:e,end:n}}function Am(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=fs(e.children[1]),l=cs(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 Sm(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(Po(e.slice(i),i>0,!1)),o.join("")}function Po(t,e,n){let r=0,i=t.length;if(e){let o=t.codePointAt(r);for(;o===No||o===Lo;)r++,o=t.codePointAt(r)}if(n){let o=t.codePointAt(i-1);for(;o===No||o===Lo;)i--,o=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function Cm(t,e){const n={type:"text",value:Rm(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function Nm(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const Lm={blockquote:sm,break:lm,code:um,delete:cm,emphasis:fm,footnoteReference:dm,heading:pm,html:hm,imageReference:mm,image:gm,inlineCode:ym,linkReference:xm,link:vm,listItem:bm,list:km,paragraph:Tm,root:_m,strong:Em,table:Am,tableCell:Im,tableRow:Sm,text:Cm,thematicBreak:Nm,toml:Rn,yaml:Rn,definition:Rn,footnoteDefinition:Rn};function Rn(){}const ps=-1,Qn=0,Vn=1,Hn=2,vi=3,bi=4,wi=5,ki=6,hs=7,ms=8,Do=typeof self=="object"?self:globalThis,Pm=(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 Qn:case ps:return n(a,i);case Vn:{const s=n([],i);for(const l of a)s.push(r(l));return s}case Hn:{const s=n({},i);for(const[l,u]of a)s[r(l)]=r(u);return s}case vi:return n(new Date(a),i);case bi:{const{source:s,flags:l}=a;return n(new RegExp(s,l),i)}case wi:{const s=n(new Map,i);for(const[l,u]of a)s.set(r(l),r(u));return s}case ki:{const s=n(new Set,i);for(const l of a)s.add(r(l));return s}case hs:{const{name:s,message:l}=a;return n(new Do[s](l),i)}case ms:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i)}return n(new Do[o](a),i)};return r},Oo=t=>Pm(new Map,t)(0),jt="",{toString:Dm}={},{keys:Om}=Object,ln=t=>{const e=typeof t;if(e!=="object"||!t)return[Qn,e];const n=Dm.call(t).slice(8,-1);switch(n){case"Array":return[Vn,jt];case"Object":return[Hn,jt];case"Date":return[vi,jt];case"RegExp":return[bi,jt];case"Map":return[wi,jt];case"Set":return[ki,jt]}return n.includes("Array")?[Vn,n]:n.includes("Error")?[hs,n]:[Hn,n]},Cn=([t,e])=>t===Qn&&(e==="function"||e==="symbol"),Fm=(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]=ln(a);switch(s){case Qn:{let c=a;switch(l){case"bigint":s=ms,c=a.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+l);c=null;break;case"undefined":return i([ps],a)}return i([s,c],a)}case Vn:{if(l)return i([l,[...a]],a);const c=[],f=i([s,c],a);for(const p of a)c.push(o(p));return f}case Hn:{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=[],f=i([s,c],a);for(const p of Om(a))(t||!Cn(ln(a[p])))&&c.push([o(p),o(a[p])]);return f}case vi:return i([s,a.toISOString()],a);case bi:{const{source:c,flags:f}=a;return i([s,{source:c,flags:f}],a)}case wi:{const c=[],f=i([s,c],a);for(const[p,d]of a)(t||!(Cn(ln(p))||Cn(ln(d))))&&c.push([o(p),o(d)]);return f}case ki:{const c=[],f=i([s,c],a);for(const p of a)(t||!Cn(ln(p)))&&c.push(o(p));return f}}const{message:u}=a;return i([s,{name:l,message:u}],a)};return o},Fo=(t,{json:e,lossy:n}={})=>{const r=[];return Fm(!(e||n),!!e,new Map,r)(t),r},$n=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?Oo(Fo(t,e)):structuredClone(t):(t,e)=>Oo(Fo(t,e));function Bm(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 zm(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function Um(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||Bm,r=t.options.footnoteBackLabel||zm,i=t.options.footnoteLabel||"Footnotes",o=t.options.footnoteLabelTagName||"h2",a=t.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l0&&y.push({type:"text",value:" "});let A=typeof n=="string"?n:n(l,d);typeof A=="string"&&(A={type:"text",value:A}),y.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+p+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const v=c[c.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const A=v.children[v.children.length-1];A&&A.type==="text"?A.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...y)}else c.push(...y);const k={type:"element",tagName:"li",properties:{id:e+"fn-"+p},children:t.wrap(c,!0)};t.patch(u,k),s.push(k)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...$n(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 gs=function(t){if(t==null)return Gm;if(typeof t=="function")return Jn(t);if(typeof t=="object")return Array.isArray(t)?jm(t):Vm(t);if(typeof t=="string")return Hm(t);throw new Error("Expected function, string, or object as test")};function jm(t){const e=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let d=ys,y,x,v;if((!e||o(l,u,c[c.length-1]||void 0))&&(d=Wm(n(l,c)),d[0]===Fo))return d;if("children"in l&&l.children){const k=l;if(k.children&&d[0]!==qm)for(x=(r?k.children.length:-1)+a,v=c.concat(k);x>-1&&x":""))+")"})}return p;function p(){let d=ys,y,x,v;if((!e||o(l,u,c[c.length-1]||void 0))&&(d=Wm(n(l,c)),d[0]===Bo))return d;if("children"in l&&l.children){const k=l;if(k.children&&d[0]!==Km)for(x=(r?k.children.length:-1)+a,v=c.concat(k);x>-1&&x0&&n.push({type:"text",value:` -`}),n}function zo(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function Uo(t,e){const n=Zm(t,e),r=n.one(t,void 0),i=Um(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` -`},i),o}function rg(t,e){return t&&"run"in t?async function(n,r){const i=Uo(n,{file:r,...e});await t.run(i,r)}:function(n,r){return Uo(n,{file:r,...t||e})}}function jo(t){if(t)throw t}var Tr,Vo;function ig(){if(Vo)return Tr;Vo=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"),f=u.constructor&&u.constructor.prototype&&t.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!c&&!f)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 Tr=function l(){var u,c,f,p,d,y,x=arguments[0],v=1,k=arguments.length,M=!1;for(typeof x=="boolean"&&(M=x,x=arguments[1]||{},v=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});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 Xe 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=dn(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}}Xe.prototype.file="";Xe.prototype.name="";Xe.prototype.reason="";Xe.prototype.message="";Xe.prototype.stack="";Xe.prototype.column=void 0;Xe.prototype.line=void 0;Xe.prototype.ancestors=void 0;Xe.prototype.cause=void 0;Xe.prototype.fatal=void 0;Xe.prototype.place=void 0;Xe.prototype.ruleId=void 0;Xe.prototype.source=void 0;const lt={basename:lg,dirname:ug,extname:cg,join:fg,sep:"/"};function lg(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');wn(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 ug(t){if(wn(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 cg(t){wn(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 fg(...t){let e=-1,n;for(;++e0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function pg(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 wn(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const hg={cwd:mg};function mg(){return"/"}function Xr(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function gg(t){if(typeof t=="string")t=new URL(t);else if(!Xr(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 yg(t)}function yg(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[d,...y]=c;const x=r[p][1];Wr(x)&&Wr(d)&&(d=_r(!0,x,d)),r[p]=[u,d,...y]}}}}const kg=new Ti().freeze();function Sr(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Ir(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Rr(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 Go(t){if(!Wr(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function $o(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Nn(t){return Tg(t)?t:new xg(t)}function Tg(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function _g(t){return typeof t=="string"||Ag(t)}function Ag(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}function _i(){const t=kg().use(am).use(rg).use(ep);return{process:e=>t.processSync(e).toString()}}const Eg={relative:""},Mg={"h-full":"","w-full":""},Sg={key:0,class:"animate-stripe",absolute:"",left:"1/2",bottom:"20%",z:"20","rounded-2xl":"",text:"primary-600","px-2":"","py-2":"",transform:"translate-x--1/2"},Ig={bg:"primary-50","rounded-xl":"","px-10":"","py-6":""},Rg=["innerHTML"],Cg=Be({__name:"Stage",props:{paused:{type:Boolean,default:!1}},setup(t){const e=W(),n=W(),{stageView:r}=qe(Wt()),{mouthOpenSize:i}=qe(Wl()),{audioContext:o,calculateVolume:a}=pa(),{onBeforeMessageComposed:s,onBeforeSend:l,onTokenLiteral:u,onTokenSpecial:c,onStreamEnd:f,streamingMessage:p,onAssistantResponseEnd:d}=St(),{process:y}=_i(),x=li(),v=W(),k=W(!1),M=W(!1),A=or({handlers:[_=>new Promise(ee=>{const me=o.createBufferSource();me.buffer=_.data.audioBuffer,me.connect(o.destination),me.connect(v.value),k.value=!0,me.start(0),me.onended=()=>{k.value=!1,ee()}})]}),C=Ll(),{ssmlEnabled:P,activeSpeechProvider:h,activeSpeechModel:I,activeSpeechVoice:b,pitch:g}=qe(C);async function m(_){try{if(!h.value){console.warn("No active speech provider configured");return}if(!b.value){console.warn("No active speech voice configured");return}const ee=x.getProviderInstance(h.value);if(!ee){console.error("Failed to initialize speech provider");return}const me=x.getProviderConfig(h.value),R=P.value?C.generateSSML(_.data,b.value,{...me,pitch:g.value}):_.data,ge=await Pl({...ee.speech(I.value,me),input:R,voice:b.value.id}),Te=await o.decodeAudioData(ge);await A.add({audioBuffer:Te,text:_.data})}catch(ee){console.error("Speech generation failed:",ee)}}const T=or({handlers:[m]});T.on("add",_=>{console.debug("ttsQueue added",_)});const S=Dl(T),{live2dCurrentMotion:F}=qe(Wt()),D=or({handlers:[async _=>{if(r.value==="3d"){const ee=Ms[_.data];if(!ee)return;await n.value.setExpression(ee)}else r.value==="2d"&&(F.value={group:Ss[_.data]})}]}),B=Ol(D);B.onHandlerEvent("emotion",_=>{console.debug("emotion detected",_)});const j=Bl();j.onHandlerEvent("delay",_=>{console.debug("delay detected",_)});function J(){requestAnimationFrame(J),k.value&&(i.value=a(v.value,"linear"))}function oe(){M.value||(J(),o.resume(),M.value=!0)}function Z(){v.value||(v.value=o.createAnalyser())}return s(async()=>{Z(),oe()}),l(async()=>{F.value={group:Ei}}),u(async _=>{await S.add(_)}),c(async _=>{await j.add(_),await B.add(_)}),f(async()=>{await j.add(Fl)}),d(async _=>{}),Ot(()=>{var ee,me,R;M.value=!1;const _=window;(ee=_.electron)==null||ee.ipcRenderer.removeAllListeners("before-hide"),(me=_.electron)==null||me.ipcRenderer.removeAllListeners("after-show"),(R=_.electron)==null||R.ipcRenderer.removeAllListeners("before-quit")}),pn(()=>{var ee,me,R;const _=window;(ee=_.electron)==null||ee.ipcRenderer.on("before-hide",()=>{F.value={group:_s}}),(me=_.electron)==null||me.ipcRenderer.on("after-show",()=>{F.value={group:As}}),(R=_.electron)==null||R.ipcRenderer.on("before-quit",()=>{F.value={group:Ei}})}),pn(async()=>{e.value=Es({connection:{bundles:Nl()}}),await e.value.execute("CREATE TABLE memory_test (vec FLOAT[768]);")}),(_,ee)=>(Q(),re("div",Eg,[O("div",Mg,[V(r)==="2d"?(Q(),Xt(ou,{key:0,"mouth-open-size":V(i),"min-w":"50% (Q(),re("header",Bg,[O("div",Fg,[ke(Gl)]),ke(V(_l),{class:"m-1 block max-h-[10lh] min-h-[1lh] rounded-lg bg-neutral-100 p-2 text-lg text-neutral-500 outline-none dark:bg-neutral-800 dark:text-neutral-400",to:"/settings"},{default:Ue(()=>n[0]||(n[0]=[O("div",{"i-solar:settings-minimalistic-bold-duotone":""},null,-1)])),_:1})]))}});function xs(t,e){const n=la(e??{},{...Di.getDefaultRealTimeVADOptions("v5"),preSpeechPadFrames:30,positiveSpeechThreshold:.5,negativeSpeechThreshold:.35,minSpeechFrames:30,auto:!0}),r=W(),i=Al("microphone");async function o(){if(r.value&&(r.value.destroy(),r.value=void 0,console.warn("existing MicVAD destroyed")),!i.value)return;const a=V(t);if(!a)return;const s=await navigator.mediaDevices.getUserMedia({audio:{deviceId:a}});r.value=await Di.MicVAD.new({...n,stream:s}),n.auto&&r.value.start()}return Fe(i,o,{immediate:!0}),Fe(El(t),o,{immediate:!0}),Ml(o),Ot(()=>{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 Ug(t,e){const n=la(e,{onLoading:()=>{},onInitiate:()=>{},onProgress:()=>{},onDone:()=>{},onReady:()=>{},onStart:()=>{},onUpdate:()=>{},onComplete:()=>{}}),{post:r,data:i,terminate:o}=Sl(t,{type:"module"}),a=W(null),s=W(""),l=W([]),u=W(!1),c=W(0),f=W("");return Fe(i,p=>{var d,y,x,v,k,M,A,C;switch(p.status){case"loading":a.value="loading",s.value=p.data,(d=n.onLoading)==null||d.call(n,p.data);break;case"initiate":l.value.push(p),(y=n.onInitiate)==null||y.call(n,p);break;case"progress":l.value=l.value.map(P=>P.file===p.file?{...P,...p}:P),(x=n.onProgress)==null||x.call(n,p);break;case"done":l.value=l.value.filter(P=>P.file!==p.file),(v=n.onDone)==null||v.call(n,p);break;case"ready":a.value="ready",(k=n.onReady)==null||k.call(n);break;case"start":u.value=!0,(M=n.onStart)==null||M.call(n);break;case"update":c.value=p.tps,(A=n.onUpdate)==null||A.call(n,p.tps);break;case"complete":u.value=!1,f.value=p.output[0]||"",console.debug("Whisper result:",f.value),(C=n.onComplete)==null||C.call(n,p.output[0]);break}}),Ot(()=>{o()}),{transcribe:p=>r(p),status:a,loadingMessage:s,loadingProgress:l,transcribing:u,tps:c,result:f,load:()=>r({type:"load"}),terminate:o}}const jg="/assets/worker-i3yLSyEt.js";async function Vg(t,e){const n=new ArrayBuffer(44+t.length*2),r=new DataView(n);Ln(r,0,"RIFF"),r.setUint32(4,36+t.length*2,!0),Ln(r,8,"WAVE"),Ln(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),Ln(r,36,"data"),r.setUint32(40,t.length*2,!0),Hg(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 Ln(t,e,n){for(let r=0;r{jn().then(()=>{i.update(),o.value=i.height.value})}),u(async()=>{jn().then(()=>{i.update(),o.value=i.height.value})}),(c,f)=>{const p=ca("auto-animate");return Q(),re("div",Gg,[f[2]||(f[2]=O("div",{"flex-1":""},null,-1)),At((Q(),re("div",{ref_key:"chatHistoryRef",ref:e,"h-full":"","w-full":"",flex:"~ col","overflow-scroll":""},[f[1]||(f[1]=O("div",{"flex-1":""},null,-1)),(Q(!0),re(ai,null,si(V(n),(d,y)=>(Q(),re("div",{key:y,"mb-2":""},[d.role==="error"?(Q(),re("div",$g,[O("div",Yg,[O("div",qg,[O("div",Kg,[O("span",Wg,he(V(a)("stage.chat.message.character-name.core-system")),1)]),f[0]||(f[0]=O("div",{"i-solar:danger-triangle-bold-duotone":"","text-violet-500":""},null,-1))]),V(r)&&y===V(n).length-1?(Q(),re("div",Xg)):(Q(),re("div",{key:1,class:"markdown-content break-words text-violet-500",text:"base {if(!F||!F.trim())return;const D=o.getProviderConfig(a.value);await y(F,{chatProvider:o.getProviderInstance(a.value),model:s.value,providerConfig:D})}});async function I(){if(e.value.trim())try{const F=o.getProviderConfig(a.value);await y(e.value,{chatProvider:o.getProviderInstance(a.value),model:s.value,providerConfig:F})}catch(F){v.value.pop(),v.value.push({role:"error",content:F.message})}}const{destroy:b,start:g}=xs(d,{onSpeechStart:()=>{n.value=!0},onVADMisfire:()=>{n.value=!1},onSpeechEnd:F=>{n.value=!1,T(F)},auto:!1});function m(){P.value!=="loading"&&(C(),g())}async function T(F){await k.resume();const D=await Vg(F,k.sampleRate);A({type:"generate",data:{audio:D,language:"en"}})}async function S(F){const D=F.target,B=u.value.find(j=>j.deviceId===D.value);if(!B){f.value=void 0;return}f.value=B}return Fe(p,async F=>{F==="false"&&(b(),h())}),Fe(i,async F=>{F&&await c()}),x(async()=>{e.value=""}),(F,D)=>(Q(),re("div",uy,[O("fieldset",cy,[O("label",{class:st([r.value==="chat"?"bg-primary-100 dark:bg-primary-900":"bg-white dark:bg-primary-950",r.value==="chat"?"text-primary-500 dark:text-primary-500":"",{"transition-colors-none ":V(l)}]),flex:"~ row",checked:r.value==="chat","aria-checked":r.value==="chat",border:"solid l-2 t-2 b-2 primary-100 dark:primary-900",bg:"hover:primary-100 dark:hover:primary-900",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500",transition:"all duration-250 ease-in-out","cursor-pointer":"","items-center":"","gap-1":"","rounded-l-lg":"","px-2":""},[At(O("input",{"onUpdate:modelValue":D[0]||(D[0]=B=>r.value=B),type:"radio",name:"tab",value:"chat",hidden:""},null,512),[[ir,r.value]]),D[5]||(D[5]=O("div",{"i-solar:dialog-2-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),O("div",dy,[O("span",py,he(V(M)("stage.chat.tabs.chat")),1)])],10,fy),O("label",{class:st([r.value==="custom"?"bg-primary-100 dark:bg-primary-900":"bg-white dark:bg-primary-950",r.value==="custom"?"text-primary-500 dark:text-primary-500":"",{"transition-colors-none ":V(l)}]),flex:"~ row",checked:r.value==="custom","aria-checked":r.value==="custom",border:"solid t-2 b-2 primary-100 dark:primary-900",bg:"hover:primary-100 dark:hover:primary-900",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500",transition:"all duration-250 ease-in-out","cursor-pointer":"","items-center":"","gap-1":"","px-2":""},[At(O("input",{"onUpdate:modelValue":D[1]||(D[1]=B=>r.value=B),type:"radio",name:"tab",value:"custom",hidden:""},null,512),[[ir,r.value]]),D[6]||(D[6]=O("div",{"i-solar:star-fall-2-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),O("div",my,[O("span",null,he(V(M)("stage.chat.tabs.custom")),1)])],10,hy),O("label",{class:st([r.value==="clothes"?"bg-primary-100 dark:bg-primary-900":"bg-white dark:bg-primary-950",r.value==="clothes"?"text-primary-500 dark:text-primary-500":"",{"transition-colors-none ":V(l)}]),flex:"~ row",checked:r.value==="clothes","aria-checked":r.value==="clothes",border:"solid r-2 t-2 b-2 primary-100 dark:primary-900",bg:"hover:primary-100 dark:hover:primary-900",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500",transition:"all duration-250 ease-in-out","cursor-pointer":"","items-center":"","gap-1":"","rounded-r-lg":"","px-2":""},[At(O("input",{"onUpdate:modelValue":D[2]||(D[2]=B=>r.value=B),type:"radio",name:"tab",value:"clothes",hidden:""},null,512),[[ir,r.value]]),D[7]||(D[7]=O("div",{"i-solar:magic-stick-3-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),O("div",yy,[O("span",null,he(V(M)("stage.chat.tabs.clothes")),1)])],10,gy)]),O("div",xy,[O("div",vy,[ke(ly,{"h-full":"","flex-1":"","p-4":"",w:"full","max-h":"e.value=B),placeholder:V(M)("stage.message"),text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500 placeholder:primary-300 placeholder:hover:primary-500 placeholder:dark:primary-300/50 placeholder:dark:hover:primary-500",bg:"primary-100 dark:primary-400/20","min-h":"[100px]","max-h":"[300px]","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",class:st({"transition-colors-none placeholder:transition-colors-none":V(l)}),onSubmit:I},null,8,["modelValue","placeholder","class"])])])]),O("div",wy,[O("button",{bg:"complementary-100 hover:complementary-200 dark:complementary-800 dark:hover:complementary-700",transition:"all duration-250 ease-in-out",class:st({"transition-colors-none":V(l)}),text:"complementary-400","mb-6":"",flex:"","cursor-pointer":"","items-center":"","justify-center":"","gap-2":"","rounded-full":"","px-4":"","py-2":"",onClick:m},[ke(Rl,{mode:"out-in"},{default:Ue(()=>[V(P)===null?(Q(),re("div",ky,he(V(M)("stage.operations.load-models")),1)):V(P)==="loading"?(Q(),re("div",Ty,[D[8]||(D[8]=O("div",{"i-svg-spinners:bouncing-ball":"",class:"text-cyan"},null,-1)),O("span",null,he(V(M)("stage.operations.load-models-status.loading")),1)])):V(P)==="ready"?(Q(),re("div",_y,[D[9]||(D[9]=O("div",{"i-lucide:check":"",class:"text-cyan"},null,-1)),O("span",null,he(V(M)("stage.operations.load-models-status.ready")),1)])):it("",!0)]),_:1})],2),O("div",Ay,[ke(V(ui),null,{default:Ue(()=>[i.value?(Q(),re("fieldset",Ey,[(Q(!0),re(ai,null,si(V(u),(B,j)=>(Q(),re("label",{key:j,class:"[&_div_span]:dark:hover:bg-cyan-300 [&_div_span]:dark:hover:bg-cyan-900"},[O("input",{type:"radio",name:"audioInput",value:B.deviceId,hidden:"",onChange:S},null,40,My),O("div",Sy,[O("div",Iy,[B.deviceId===V(d)?(Q(),re("div",Ry)):it("",!0)]),O("span",{"inline-block":"",class:st([B.deviceId===V(d)?"cyan-400 dark:text-white":"cyan-400/50 dark:text-white/50"]),transition:"all duration-250 ease-in-out"},he(B.label),3)])]))),128))])):it("",!0)]),_:1}),O("label",{bg:"complementary-100 hover:complementary-200 dark:complementary-800 dark:hover:complementary-700",transition:"all duration-250 ease-in-out",class:st({"transition-colors-none":V(l)}),text:"complementary-400","h-fit":"",flex:"","cursor-pointer":"","items-center":"","justify-center":"","gap-2":"","rounded-full":"","px-4":"","py-2":""},[At(O("input",{"onUpdate:modelValue":D[4]||(D[4]=B=>i.value=B),type:"checkbox",hidden:""},null,512),[[Zr,i.value]]),D[10]||(D[10]=O("div",{"i-solar:microphone-2-bold-duotone":""},null,-1)),O("div",null,[n.value?(Q(),re("span",Ny,"Listening...")):(Q(),re("span",Cy,he(V(M)("settings.microphone")),1))])],2)])])]))}}),Py=Kn(Ly,[["__scopeId","data-v-1f3e13c7"]]),Dy={py:"1",flex:"~ col",rounded:"lg","overflow-hidden":""},Oy={key:0,flex:"",mr:"12"},By={flex:"~ col",border:"4 solid primary-200/50 dark:primary-500/50",shadow:"md primary-200/50 dark:none","min-w-20":"","rounded-lg":"","px-2":"","py-1":"",h:"unset {jn().then(()=>{i.update(),o.value=i.height.value})}),l(async()=>{jn().then(()=>{i.update(),o.value=i.height.value})}),(u,c)=>{const f=ca("auto-animate");return Q(),re("div",Dy,[c[1]||(c[1]=O("div",{"flex-1":""},null,-1)),At((Q(),re("div",{ref_key:"chatHistoryRef",ref:e,"h-full":"","w-full":"","max-h":"30vh",flex:"~ col","overflow-scroll":""},[c[0]||(c[0]=O("div",{"flex-1":""},null,-1)),(Q(!0),re(ai,null,si(V(r),(p,d)=>(Q(),re("div",{key:d,"mb-2":""},[p.role==="assistant"?(Q(),re("div",Oy,[O("div",By,[O("div",null,[O("span",Fy,he(V(n)("stage.chat.message.character-name.airi")),1)]),p.content?(Q(),re("div",{key:0,class:"markdown-content",text:"base {n.value=!0},onVADMisfire:()=>{n.value=!1},onSpeechEnd:v=>{n.value=!1,x()},auto:!1});function x(v){alert("Transcription is not implemented yet")}return Fe(a,async v=>{v==="false"&&d()}),c(async()=>{e.value=""}),pn(()=>{y()}),(v,k)=>(Q(),re("div",null,[O("div",qy,[ke(Yy,{absolute:"","left-0":"","top-0":"",transform:"translate-y-[-100%]","w-full":""}),O("div",Ky,[ke(V(fa),{modelValue:e.value,"onUpdate:modelValue":k[0]||(k[0]=M=>e.value=M),placeholder:V(f)("stage.message"),border:"solid 2 primary-100 dark:primary-400/20",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500 placeholder:primary-300 placeholder:hover:primary-500 placeholder:dark:primary-300/50 placeholder:dark:hover:primary-500",bg:"primary-100 dark:primary-400/20","max-h":"[10lh]","min-h":"[1lh]","w-full":"","resize-none":"","overflow-y-scroll":"","rounded-xl":"","p-2":"","font-medium":"","outline-none":"",transition:"all duration-250 ease-in-out placeholder:all placeholder:duration-250 placeholder:ease-in-out",class:st({"transition-colors-none placeholder:transition-colors-none":V(l)}),onSubmit:p},null,8,["modelValue","placeholder","class"])])])]))}}),Xy={class:"relative"},Qy={absolute:"","left-0":"","right-0":"","top-0":"","w-full":"","overflow-hidden":""},Zy=Be({__name:"AnimatedWave",props:{height:{default:40},amplitude:{default:14},waveLength:{default:250},fillColor:{default:"oklch(95% 0.10 var(--theme-colors-hue))"},direction:{default:"down"},movementDirection:{default:"left"},animationSpeed:{default:50}},setup(t){const e=t,n=W(e.height),r=W(e.amplitude),i=W(e.waveLength),o=W(e.fillColor),a=W(e.direction),s=W(e.movementDirection);function l(f,p,d,y,x){const v=[],M=Math.ceil(f/y)*y,A=1,C=x==="up"?d:p-d;v.push(`M 0 ${C}`);const P=Math.PI*2/y;for(let I=0;I<=M;I+=A){const b=d*Math.sin(P*I),g=x==="up"?C-b:C+b;v.push(`L ${I} ${g}`)}const h=x==="up"?p:0;return v.push(`L ${M} ${h}`),v.push(`L 0 ${h} Z`),v.join(" ")}const u=je(()=>n.value+r.value*2),c=je(()=>{const f=` +`}),n}function zo(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function Uo(t,e){const n=Qm(t,e),r=n.one(t,void 0),i=Um(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` +`},i),o}function rg(t,e){return t&&"run"in t?async function(n,r){const i=Uo(n,{file:r,...e});await t.run(i,r)}:function(n,r){return Uo(n,{file:r,...t||e})}}function jo(t){if(t)throw t}var Tr,Vo;function ig(){if(Vo)return Tr;Vo=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"),f=u.constructor&&u.constructor.prototype&&t.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!c&&!f)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 Tr=function l(){var u,c,f,p,d,y,x=arguments[0],v=1,k=arguments.length,A=!1;for(typeof x=="boolean"&&(A=x,x=arguments[1]||{},v=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});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 Xe 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=dn(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}}Xe.prototype.file="";Xe.prototype.name="";Xe.prototype.reason="";Xe.prototype.message="";Xe.prototype.stack="";Xe.prototype.column=void 0;Xe.prototype.line=void 0;Xe.prototype.ancestors=void 0;Xe.prototype.cause=void 0;Xe.prototype.fatal=void 0;Xe.prototype.place=void 0;Xe.prototype.ruleId=void 0;Xe.prototype.source=void 0;const lt={basename:lg,dirname:ug,extname:cg,join:fg,sep:"/"};function lg(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');wn(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 ug(t){if(wn(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 cg(t){wn(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 fg(...t){let e=-1,n;for(;++e0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function pg(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 wn(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const hg={cwd:mg};function mg(){return"/"}function Xr(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function gg(t){if(typeof t=="string")t=new URL(t);else if(!Xr(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 yg(t)}function yg(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[d,...y]=c;const x=r[p][1];Wr(x)&&Wr(d)&&(d=_r(!0,x,d)),r[p]=[u,d,...y]}}}}const kg=new Ti().freeze();function Sr(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Ir(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Rr(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 $o(t){if(!Wr(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Go(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Nn(t){return Tg(t)?t:new xg(t)}function Tg(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function _g(t){return typeof t=="string"||Eg(t)}function Eg(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}function _i(){const t=kg().use(am).use(rg).use(ep);return{process:e=>t.processSync(e).toString()}}const Mg={relative:""},Ag={"h-full":"","w-full":""},Sg={key:0,class:"animate-stripe",absolute:"",left:"1/2",bottom:"20%",z:"20","rounded-2xl":"",text:"primary-600","px-2":"","py-2":"",transform:"translate-x--1/2"},Ig={bg:"primary-50","rounded-xl":"","px-10":"","py-6":""},Rg=["innerHTML"],Cg=Fe({__name:"Stage",props:{paused:{type:Boolean,default:!1}},setup(t){const e=W(),n=W(),{stageView:r}=Ke(Wt()),{mouthOpenSize:i}=Ke(Wl()),{audioContext:o,calculateVolume:a}=pa(),{onBeforeMessageComposed:s,onBeforeSend:l,onTokenLiteral:u,onTokenSpecial:c,onStreamEnd:f,streamingMessage:p,onAssistantResponseEnd:d}=St(),{process:y}=_i(),x=li(),v=W(),k=W(!1),A=W(!1),E=or({handlers:[_=>new Promise(ee=>{const me=o.createBufferSource();me.buffer=_.data.audioBuffer,me.connect(o.destination),me.connect(v.value),k.value=!0,me.start(0),me.onended=()=>{k.value=!1,ee()}})]}),C=Ll(),{ssmlEnabled:P,activeSpeechProvider:h,activeSpeechModel:I,activeSpeechVoice:b,pitch:g}=Ke(C);async function m(_){try{if(!h.value){console.warn("No active speech provider configured");return}if(!b.value){console.warn("No active speech voice configured");return}const ee=x.getProviderInstance(h.value);if(!ee){console.error("Failed to initialize speech provider");return}const me=x.getProviderConfig(h.value),R=P.value?C.generateSSML(_.data,b.value,{...me,pitch:g.value}):_.data,ge=await Pl({...ee.speech(I.value,me),input:R,voice:b.value.id}),Te=await o.decodeAudioData(ge);await E.add({audioBuffer:Te,text:_.data})}catch(ee){console.error("Speech generation failed:",ee)}}const T=or({handlers:[m]});T.on("add",_=>{console.debug("ttsQueue added",_)});const S=Dl(T),{live2dCurrentMotion:B}=Ke(Wt()),D=or({handlers:[async _=>{if(r.value==="3d"){const ee=As[_.data];if(!ee)return;await n.value.setExpression(ee)}else r.value==="2d"&&(B.value={group:Ss[_.data]})}]}),F=Ol(D);F.onHandlerEvent("emotion",_=>{console.debug("emotion detected",_)});const j=Fl();j.onHandlerEvent("delay",_=>{console.debug("delay detected",_)});function J(){requestAnimationFrame(J),k.value&&(i.value=a(v.value,"linear"))}function oe(){A.value||(J(),o.resume(),A.value=!0)}function Q(){v.value||(v.value=o.createAnalyser())}return s(async()=>{Q(),oe()}),l(async()=>{B.value={group:Mi}}),u(async _=>{await S.add(_)}),c(async _=>{await j.add(_),await F.add(_)}),f(async()=>{await j.add(Bl)}),d(async _=>{}),Ot(()=>{var ee,me,R;A.value=!1;const _=window;(ee=_.electron)==null||ee.ipcRenderer.removeAllListeners("before-hide"),(me=_.electron)==null||me.ipcRenderer.removeAllListeners("after-show"),(R=_.electron)==null||R.ipcRenderer.removeAllListeners("before-quit")}),pn(()=>{var ee,me,R;const _=window;(ee=_.electron)==null||ee.ipcRenderer.on("before-hide",()=>{B.value={group:_s}}),(me=_.electron)==null||me.ipcRenderer.on("after-show",()=>{B.value={group:Es}}),(R=_.electron)==null||R.ipcRenderer.on("before-quit",()=>{B.value={group:Mi}})}),pn(async()=>{e.value=Ms({connection:{bundles:Nl()}}),await e.value.execute("CREATE TABLE memory_test (vec FLOAT[768]);")}),(_,ee)=>(Z(),re("div",Mg,[O("div",Ag,[V(r)==="2d"?(Z(),Xt(ou,{key:0,"mouth-open-size":V(i),"min-w":"50% (Z(),re("header",Fg,[O("div",Bg,[ke($l)]),ke(V(_l),{class:"m-1 block max-h-[10lh] min-h-[1lh] rounded-lg bg-neutral-100 p-2 text-lg text-neutral-500 outline-none dark:bg-neutral-800 dark:text-neutral-400",to:"/settings"},{default:Ue(()=>n[0]||(n[0]=[O("div",{"i-solar:settings-minimalistic-bold-duotone":""},null,-1)])),_:1})]))}});function xs(t,e){const n=la(e??{},{...Di.getDefaultRealTimeVADOptions("v5"),preSpeechPadFrames:30,positiveSpeechThreshold:.5,negativeSpeechThreshold:.35,minSpeechFrames:30,auto:!0}),r=W(),i=El("microphone");async function o(){if(r.value&&(r.value.destroy(),r.value=void 0,console.warn("existing MicVAD destroyed")),!i.value)return;const a=V(t);if(!a)return;const s=await navigator.mediaDevices.getUserMedia({audio:{deviceId:a}});r.value=await Di.MicVAD.new({...n,stream:s}),n.auto&&r.value.start()}return Be(i,o,{immediate:!0}),Be(Ml(t),o,{immediate:!0}),Al(o),Ot(()=>{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 Ug(t,e){const n=la(e,{onLoading:()=>{},onInitiate:()=>{},onProgress:()=>{},onDone:()=>{},onReady:()=>{},onStart:()=>{},onUpdate:()=>{},onComplete:()=>{}}),{post:r,data:i,terminate:o}=Sl(t,{type:"module"}),a=W(null),s=W(""),l=W([]),u=W(!1),c=W(0),f=W("");return Be(i,p=>{var d,y,x,v,k,A,E,C;switch(p.status){case"loading":a.value="loading",s.value=p.data,(d=n.onLoading)==null||d.call(n,p.data);break;case"initiate":l.value.push(p),(y=n.onInitiate)==null||y.call(n,p);break;case"progress":l.value=l.value.map(P=>P.file===p.file?{...P,...p}:P),(x=n.onProgress)==null||x.call(n,p);break;case"done":l.value=l.value.filter(P=>P.file!==p.file),(v=n.onDone)==null||v.call(n,p);break;case"ready":a.value="ready",(k=n.onReady)==null||k.call(n);break;case"start":u.value=!0,(A=n.onStart)==null||A.call(n);break;case"update":c.value=p.tps,(E=n.onUpdate)==null||E.call(n,p.tps);break;case"complete":u.value=!1,f.value=p.output[0]||"",console.debug("Whisper result:",f.value),(C=n.onComplete)==null||C.call(n,p.output[0]);break}}),Ot(()=>{o()}),{transcribe:p=>r(p),status:a,loadingMessage:s,loadingProgress:l,transcribing:u,tps:c,result:f,load:()=>r({type:"load"}),terminate:o}}const jg="/assets/worker-i3yLSyEt.js";async function Vg(t,e){const n=new ArrayBuffer(44+t.length*2),r=new DataView(n);Ln(r,0,"RIFF"),r.setUint32(4,36+t.length*2,!0),Ln(r,8,"WAVE"),Ln(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),Ln(r,36,"data"),r.setUint32(40,t.length*2,!0),Hg(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 Ln(t,e,n){for(let r=0;r{jn().then(()=>{i.update(),o.value=i.height.value})}),u(async()=>{jn().then(()=>{i.update(),o.value=i.height.value})}),(c,f)=>{const p=ca("auto-animate");return Z(),re("div",$g,[f[2]||(f[2]=O("div",{"flex-1":""},null,-1)),Et((Z(),re("div",{ref_key:"chatHistoryRef",ref:e,"h-full":"","w-full":"",flex:"~ col","overflow-scroll":""},[f[1]||(f[1]=O("div",{"flex-1":""},null,-1)),(Z(!0),re(ai,null,si(V(n),(d,y)=>(Z(),re("div",{key:y,"mb-2":""},[d.role==="error"?(Z(),re("div",Gg,[O("div",Yg,[O("div",Kg,[O("div",qg,[O("span",Wg,he(V(a)("stage.chat.message.character-name.core-system")),1)]),f[0]||(f[0]=O("div",{"i-solar:danger-triangle-bold-duotone":"","text-violet-500":""},null,-1))]),V(r)&&y===V(n).length-1?(Z(),re("div",Xg)):(Z(),re("div",{key:1,class:"markdown-content break-words text-violet-500",text:"base {if(!B||!B.trim())return;const D=o.getProviderConfig(a.value);await y(B,{chatProvider:o.getProviderInstance(a.value),model:s.value,providerConfig:D})}});async function I(){if(e.value.trim())try{const B=o.getProviderConfig(a.value);await y(e.value,{chatProvider:o.getProviderInstance(a.value),model:s.value,providerConfig:B})}catch(B){v.value.pop(),v.value.push({role:"error",content:B.message})}}const{destroy:b,start:g}=xs(d,{onSpeechStart:()=>{n.value=!0},onVADMisfire:()=>{n.value=!1},onSpeechEnd:B=>{n.value=!1,T(B)},auto:!1});function m(){P.value!=="loading"&&(C(),g())}async function T(B){await k.resume();const D=await Vg(B,k.sampleRate);E({type:"generate",data:{audio:D,language:"en"}})}async function S(B){const D=B.target,F=u.value.find(j=>j.deviceId===D.value);if(!F){f.value=void 0;return}f.value=F}return Be(p,async B=>{B==="false"&&(b(),h())}),Be(i,async B=>{B&&await c()}),x(async()=>{e.value=""}),(B,D)=>(Z(),re("div",uy,[O("fieldset",cy,[O("label",{class:st([r.value==="chat"?"bg-primary-100 dark:bg-primary-900":"bg-white dark:bg-primary-950",r.value==="chat"?"text-primary-500 dark:text-primary-500":"",{"transition-colors-none ":V(l)}]),flex:"~ row",checked:r.value==="chat","aria-checked":r.value==="chat",border:"solid l-2 t-2 b-2 primary-100 dark:primary-900",bg:"hover:primary-100 dark:hover:primary-900",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500",transition:"all duration-250 ease-in-out","cursor-pointer":"","items-center":"","gap-1":"","rounded-l-lg":"","px-2":""},[Et(O("input",{"onUpdate:modelValue":D[0]||(D[0]=F=>r.value=F),type:"radio",name:"tab",value:"chat",hidden:""},null,512),[[ir,r.value]]),D[5]||(D[5]=O("div",{"i-solar:dialog-2-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),O("div",dy,[O("span",py,he(V(A)("stage.chat.tabs.chat")),1)])],10,fy),O("label",{class:st([r.value==="custom"?"bg-primary-100 dark:bg-primary-900":"bg-white dark:bg-primary-950",r.value==="custom"?"text-primary-500 dark:text-primary-500":"",{"transition-colors-none ":V(l)}]),flex:"~ row",checked:r.value==="custom","aria-checked":r.value==="custom",border:"solid t-2 b-2 primary-100 dark:primary-900",bg:"hover:primary-100 dark:hover:primary-900",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500",transition:"all duration-250 ease-in-out","cursor-pointer":"","items-center":"","gap-1":"","px-2":""},[Et(O("input",{"onUpdate:modelValue":D[1]||(D[1]=F=>r.value=F),type:"radio",name:"tab",value:"custom",hidden:""},null,512),[[ir,r.value]]),D[6]||(D[6]=O("div",{"i-solar:star-fall-2-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),O("div",my,[O("span",null,he(V(A)("stage.chat.tabs.custom")),1)])],10,hy),O("label",{class:st([r.value==="clothes"?"bg-primary-100 dark:bg-primary-900":"bg-white dark:bg-primary-950",r.value==="clothes"?"text-primary-500 dark:text-primary-500":"",{"transition-colors-none ":V(l)}]),flex:"~ row",checked:r.value==="clothes","aria-checked":r.value==="clothes",border:"solid r-2 t-2 b-2 primary-100 dark:primary-900",bg:"hover:primary-100 dark:hover:primary-900",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500",transition:"all duration-250 ease-in-out","cursor-pointer":"","items-center":"","gap-1":"","rounded-r-lg":"","px-2":""},[Et(O("input",{"onUpdate:modelValue":D[2]||(D[2]=F=>r.value=F),type:"radio",name:"tab",value:"clothes",hidden:""},null,512),[[ir,r.value]]),D[7]||(D[7]=O("div",{"i-solar:magic-stick-3-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),O("div",yy,[O("span",null,he(V(A)("stage.chat.tabs.clothes")),1)])],10,gy)]),O("div",xy,[O("div",vy,[ke(ly,{"h-full":"","flex-1":"","p-4":"",w:"full","max-h":"e.value=F),placeholder:V(A)("stage.message"),text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500 placeholder:primary-300 placeholder:hover:primary-500 placeholder:dark:primary-300/50 placeholder:dark:hover:primary-500",bg:"primary-100 dark:primary-400/20","min-h":"[100px]","max-h":"[300px]","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",class:st({"transition-colors-none placeholder:transition-colors-none":V(l)}),onSubmit:I},null,8,["modelValue","placeholder","class"])])])]),O("div",wy,[O("button",{bg:"complementary-100 hover:complementary-200 dark:complementary-800 dark:hover:complementary-700",transition:"all duration-250 ease-in-out",class:st({"transition-colors-none":V(l)}),text:"complementary-400","mb-6":"",flex:"","cursor-pointer":"","items-center":"","justify-center":"","gap-2":"","rounded-full":"","px-4":"","py-2":"",onClick:m},[ke(Rl,{mode:"out-in"},{default:Ue(()=>[V(P)===null?(Z(),re("div",ky,he(V(A)("stage.operations.load-models")),1)):V(P)==="loading"?(Z(),re("div",Ty,[D[8]||(D[8]=O("div",{"i-svg-spinners:bouncing-ball":"",class:"text-cyan"},null,-1)),O("span",null,he(V(A)("stage.operations.load-models-status.loading")),1)])):V(P)==="ready"?(Z(),re("div",_y,[D[9]||(D[9]=O("div",{"i-lucide:check":"",class:"text-cyan"},null,-1)),O("span",null,he(V(A)("stage.operations.load-models-status.ready")),1)])):it("",!0)]),_:1})],2),O("div",Ey,[ke(V(ui),null,{default:Ue(()=>[i.value?(Z(),re("fieldset",My,[(Z(!0),re(ai,null,si(V(u),(F,j)=>(Z(),re("label",{key:j,class:"[&_div_span]:dark:hover:bg-cyan-300 [&_div_span]:dark:hover:bg-cyan-900"},[O("input",{type:"radio",name:"audioInput",value:F.deviceId,hidden:"",onChange:S},null,40,Ay),O("div",Sy,[O("div",Iy,[F.deviceId===V(d)?(Z(),re("div",Ry)):it("",!0)]),O("span",{"inline-block":"",class:st([F.deviceId===V(d)?"cyan-400 dark:text-white":"cyan-400/50 dark:text-white/50"]),transition:"all duration-250 ease-in-out"},he(F.label),3)])]))),128))])):it("",!0)]),_:1}),O("label",{bg:"complementary-100 hover:complementary-200 dark:complementary-800 dark:hover:complementary-700",transition:"all duration-250 ease-in-out",class:st({"transition-colors-none":V(l)}),text:"complementary-400","h-fit":"",flex:"","cursor-pointer":"","items-center":"","justify-center":"","gap-2":"","rounded-full":"","px-4":"","py-2":""},[Et(O("input",{"onUpdate:modelValue":D[4]||(D[4]=F=>i.value=F),type:"checkbox",hidden:""},null,512),[[Qr,i.value]]),D[10]||(D[10]=O("div",{"i-solar:microphone-2-bold-duotone":""},null,-1)),O("div",null,[n.value?(Z(),re("span",Ny,"Listening...")):(Z(),re("span",Cy,he(V(A)("settings.microphone")),1))])],2)])])]))}}),Py=qn(Ly,[["__scopeId","data-v-1f3e13c7"]]),Dy={py:"1",flex:"~ col",rounded:"lg","overflow-hidden":""},Oy={key:0,flex:"",mr:"12"},Fy={flex:"~ col",border:"4 solid primary-200/50 dark:primary-500/50",shadow:"md primary-200/50 dark:none","min-w-20":"","rounded-lg":"","px-2":"","py-1":"",h:"unset {jn().then(()=>{i.update(),o.value=i.height.value})}),l(async()=>{jn().then(()=>{i.update(),o.value=i.height.value})}),(u,c)=>{const f=ca("auto-animate");return Z(),re("div",Dy,[c[1]||(c[1]=O("div",{"flex-1":""},null,-1)),Et((Z(),re("div",{ref_key:"chatHistoryRef",ref:e,"h-full":"","w-full":"","max-h":"30vh",flex:"~ col","overflow-scroll":""},[c[0]||(c[0]=O("div",{"flex-1":""},null,-1)),(Z(!0),re(ai,null,si(V(r),(p,d)=>(Z(),re("div",{key:d,"mb-2":""},[p.role==="assistant"?(Z(),re("div",Oy,[O("div",Fy,[O("div",null,[O("span",By,he(V(n)("stage.chat.message.character-name.airi")),1)]),p.content?(Z(),re("div",{key:0,class:"markdown-content",text:"base {n.value=!0},onVADMisfire:()=>{n.value=!1},onSpeechEnd:v=>{n.value=!1,x()},auto:!1});function x(v){alert("Transcription is not implemented yet")}return Be(a,async v=>{v==="false"&&d()}),c(async()=>{e.value=""}),pn(()=>{y()}),(v,k)=>(Z(),re("div",null,[O("div",Ky,[ke(Yy,{absolute:"","left-0":"","top-0":"",transform:"translate-y-[-100%]","w-full":""}),O("div",qy,[ke(V(fa),{modelValue:e.value,"onUpdate:modelValue":k[0]||(k[0]=A=>e.value=A),placeholder:V(f)("stage.message"),border:"solid 2 primary-100 dark:primary-400/20",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500 placeholder:primary-300 placeholder:hover:primary-500 placeholder:dark:primary-300/50 placeholder:dark:hover:primary-500",bg:"primary-100 dark:primary-400/20","max-h":"[10lh]","min-h":"[1lh]","w-full":"","resize-none":"","overflow-y-scroll":"","rounded-xl":"","p-2":"","font-medium":"","outline-none":"",transition:"all duration-250 ease-in-out placeholder:all placeholder:duration-250 placeholder:ease-in-out",class:st({"transition-colors-none placeholder:transition-colors-none":V(l)}),onSubmit:p},null,8,["modelValue","placeholder","class"])])])]))}}),Xy={class:"relative"},Zy={absolute:"","left-0":"","right-0":"","top-0":"","w-full":"","overflow-hidden":""},Qy=Fe({__name:"AnimatedWave",props:{height:{default:40},amplitude:{default:14},waveLength:{default:250},fillColor:{default:"oklch(95% 0.10 var(--theme-colors-hue))"},direction:{default:"down"},movementDirection:{default:"left"},animationSpeed:{default:50}},setup(t){const e=t,n=W(e.height),r=W(e.amplitude),i=W(e.waveLength),o=W(e.fillColor),a=W(e.direction),s=W(e.movementDirection);function l(f,p,d,y,x){const v=[],A=Math.ceil(f/y)*y,E=1,C=x==="up"?d:p-d;v.push(`M 0 ${C}`);const P=Math.PI*2/y;for(let I=0;I<=A;I+=E){const b=d*Math.sin(P*I),g=x==="up"?C-b:C+b;v.push(`L ${I} ${g}`)}const h=x==="up"?p:0;return v.push(`L ${A} ${h}`),v.push(`L 0 ${h} Z`),v.join(" ")}const u=je(()=>n.value+r.value*2),c=je(()=>{const f=` - `;return`url(data:image/svg+xml;base64,${btoa(f)})`});return Fe(()=>[e.height,e.amplitude,e.waveLength,e.fillColor,e.direction,e.movementDirection],()=>{n.value=e.height,r.value=e.amplitude,i.value=e.waveLength,o.value=e.fillColor,a.value=e.direction,s.value=e.movementDirection},{immediate:!0}),(f,p)=>(Q(),re("div",Xy,[gn(f.$slots,"default",{},void 0,!0),O("div",Qy,[O("div",{class:"wave",style:Pr({background:o.value,height:`${u.value}px`,maskImage:c.value,WebkitMaskImage:c.value,"--wave-translate":`${-i.value}px`,"--animation-duration":`${i.value/t.animationSpeed}s`,"animation-direction":s.value==="left"?"normal":"reverse"})},null,4)])]))}}),Jy=Kn(Zy,[["__scopeId","data-v-d4cf94d8"]]),e0={relative:"",flex:"~ col","z-2":"","h-100dvh":"","w-100vw":"","of-hidden":""},t0={relative:"",flex:"~ 1 row gap-y-0 gap-x-2 (Q(),Xt(Og,null,{default:Ue(()=>[ke(Jy,{"fill-color":V(e)?"oklch(35% calc(var(--theme-colors-chroma) * 0.6) var(--theme-colors-hue))":"color-mix(in srgb, oklch(95% calc(var(--theme-colors-chroma-50) * 0.5) var(--theme-colors-hue)) 80%, oklch(100% 0 360))"},{default:Ue(()=>[O("div",e0,[O("div",null,[ke(zg,{class:"flex",p2:""})]),O("div",t0,[ke(V(Ng),{"flex-1":"","min-w":"1/2",paused:n.value},null,8,["paused"]),ke(Py,{class:"flex `;return`url(data:image/svg+xml;base64,${btoa(f)})`});return Be(()=>[e.height,e.amplitude,e.waveLength,e.fillColor,e.direction,e.movementDirection],()=>{n.value=e.height,r.value=e.amplitude,i.value=e.waveLength,o.value=e.fillColor,a.value=e.direction,s.value=e.movementDirection},{immediate:!0}),(f,p)=>(Z(),re("div",Xy,[gn(f.$slots,"default",{},void 0,!0),O("div",Zy,[O("div",{class:"wave",style:Pr({background:o.value,height:`${u.value}px`,maskImage:c.value,WebkitMaskImage:c.value,"--wave-translate":`${-i.value}px`,"--animation-duration":`${i.value/t.animationSpeed}s`,"animation-direction":s.value==="left"?"normal":"reverse"})},null,4)])]))}}),Jy=qn(Qy,[["__scopeId","data-v-d4cf94d8"]]),e0={relative:"",flex:"~ col","z-2":"","h-100dvh":"","w-100vw":"","of-hidden":""},t0={relative:"",flex:"~ 1 row gap-y-0 gap-x-2 (Z(),Xt(Og,null,{default:Ue(()=>[ke(Jy,{"fill-color":V(e)?"oklch(35% calc(var(--theme-colors-chroma) * 0.6) var(--theme-colors-hue))":"color-mix(in srgb, oklch(95% calc(var(--theme-colors-chroma-50) * 0.5) var(--theme-colors-hue)) 80%, oklch(100% 0 360))"},{default:Ue(()=>[O("div",e0,[O("div",null,[ke(zg,{class:"flex",p2:""})]),O("div",t0,[ke(V(Ng),{"flex-1":"","min-w":"1/2",paused:n.value},null,8,["paused"]),ke(Py,{class:"flex {const s=r("motion");return o(),i(u,null,[l(m(n),{title:e.$t("settings.pages.memory.title"),subtitle:e.$t("settings.title")},null,8,["title","subtitle"]),c((o(),i("div",p,t[0]||(t[0]=[d("div",{text:"60","i-solar:leaf-bold-duotone":""},null,-1)]))),[[s]])],64)}}});export{x as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{_ as n}from"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";import{d as a,bw as r,c as i,o,b as l,A as c,u as m,a as d,bx as u}from"./index-D55VqdU4.js";const p={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-20rem)]","bottom-0":"","right--15":"","z--1":"",initial:{scale:.9,opacity:0,y:40},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},x=a({__name:"index",setup(f){return(e,t)=>{const s=r("motion");return o(),i(u,null,[l(m(n),{title:e.$t("settings.pages.memory.title"),subtitle:e.$t("settings.title")},null,8,["title","subtitle"]),c((o(),i("div",p,t[0]||(t[0]=[d("div",{text:"60","i-solar:leaf-bold-duotone":""},null,-1)]))),[[s]])],64)}}});export{x as default}; diff --git a/assets/index-CF1TyHQe.js b/assets/index-BzQ8e19F.js similarity index 91% rename from assets/index-CF1TyHQe.js rename to assets/index-BzQ8e19F.js index 84422a6d5a13c4bf22491e3d55a1750d2c53b3ff..78a4253f1ef3ca06e5a39eea461183e2e757aeb7 100644 --- a/assets/index-CF1TyHQe.js +++ b/assets/index-BzQ8e19F.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{_ as E}from"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";import{d as S,r as D,x as b,o as a,y as P,a as i,c as m,C as w,m as R,D as C,z as q,bn as L,bG as N,g as r,q as V,v as j,h as F,bw as G,b as O,u as p,A as y,bx as $,by as H,n as J,bv as K}from"./index--eYU5aQm.js";import{_ as M}from"./IconAnimation.vue_vue_type_script_setup_true_lang-BkJuuWL8.js";import{b as I}from"./route-block-B_A1xBdJ.js";const Q={"z-1":"","flex-1":""},U={"text-lg":"","font-bold":"",class:"menu-icon-item-title",transition:"all ease-in-out duration-400"},W={text:"sm neutral-500 dark:neutral-400",class:"menu-icon-item-description",transition:"all ease-in-out duration-400"},X=S({__name:"IconItem",props:{title:null,description:null,icon:null,iconTemplate:{type:Boolean},to:null},setup(o){return(g,f)=>{const v=D("RouterLink");return a(),b(v,{box:"border",flex:"~ row",bg:"neutral-50 dark:neutral-900",border:"neutral-100 dark:neutral-800/25 hover:primary-500/30 dark:hover:primary-400/30 solid 2","drop-shadow":"none hover:[0px_4px_4px_rgba(220,220,220,0.4)] active:[0px_0px_0px_rgba(220,220,220,0.25)] dark:hover:none",class:"menu-icon-item",transition:"all ease-in-out duration-400",relative:"","w-full":"","items-center":"","overflow-hidden":"","rounded-lg":"","p-5":"","text-left":"",cursor:"pointer",to:o.to},{default:P(()=>[i("div",Q,[i("div",U,C(o.title),1),i("div",W,[i("span",null,C(o.description),1)])]),typeof o.icon=="string"?(a(),m("div",{key:0,class:q(["menu-icon-item-icon",[o.icon]]),transition:"all ease-in-out duration-400",absolute:"","right-0":"","size-24":"","translate-y-4":"",text:"neutral-400/50 dark:neutral-600/50"},null,2)):w("",!0),o.iconTemplate?R(g.$slots,"icon",{key:1},void 0,!0):w("",!0)]),_:3},8,["to"])}}}),Y=L(X,[["__scopeId","data-v-656e0116"]]),Z={flex:"~ col gap-4"},tt={flex:"~ col gap-4"},et={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-12rem)]","bottom-0":"","right--10":"","z--1":"",initial:{scale:.9,opacity:0,rotate:180},enter:{scale:1,opacity:1,rotate:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},it={text:"60","i-solar:settings-bold-duotone":""},ot=S({__name:"index",setup(o){const g=N(),f=r(!1),v=r(),c=r(),{t}=V(),x=r(""),h=r(""),k=r(!1),d=j();function z(){var n;(n=c.value)==null||n.call(c)}async function T(n,l){const e=n.currentTarget.querySelector(".menu-icon-item-icon");if(!e)return;const u=e.getBoundingClientRect(),_=`${u.left}px, ${u.top}px`;x.value=l.icon,h.value=_,k.value=!0,await K(),f.value=!0}const B=g.beforeEach(async(n,l,s)=>{if(!d.usePageSpecificTransitions||d.disableTransitions){s();return}await new Promise(e=>{c.value=e}),B(),s()}),A=F(()=>[{title:t("settings.pages.card.title"),description:t("settings.pages.card.description"),icon:"i-solar:emoji-funny-square-bold-duotone",to:"/settings/airi-card"},{title:t("settings.pages.modules.title"),description:t("settings.pages.modules.description"),icon:"i-solar:layers-bold-duotone",to:"/settings/modules"},{title:t("settings.pages.scene.title"),description:t("settings.pages.scene.description"),icon:"i-solar:armchair-2-bold-duotone",to:"/settings/scene"},{title:t("settings.pages.models.title"),description:t("settings.pages.models.description"),icon:"i-solar:people-nearby-bold-duotone",to:"/settings/models"},{title:t("settings.pages.memory.title"),description:t("settings.pages.memory.description"),icon:"i-solar:leaf-bold-duotone",to:"/settings/memory"},{title:t("settings.pages.providers.title"),description:t("settings.pages.providers.description"),icon:"i-solar:box-minimalistic-bold-duotone",to:"/settings/providers"},{title:t("settings.pages.themes.title"),description:t("settings.pages.themes.description"),icon:"i-solar:filters-bold-duotone",to:"/settings/appearance"}]);return(n,l)=>{const s=G("motion");return a(),m($,null,[O(p(E),{title:n.$t("settings.title")},null,8,["title"]),i("div",Z,[l[0]||(l[0]=i("div",null,null,-1)),i("div",tt,[(a(!0),m($,null,H(A.value,(e,u)=>y((a(),b(p(Y),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:J({transitionDelay:`${u*50}ms`}),title:e.title,description:e.description,icon:e.icon,to:e.to,onClick:_=>T(_,e)},null,8,["style","title","description","icon","to","onClick"])),[[s]])),128))]),k.value&&!p(d).disableTransitions&&p(d).usePageSpecificTransitions?(a(),b(M,{key:0,ref_key:"iconAnimation",ref:v,icon:x.value,"icon-size":6*1.2,position:h.value,duration:1e3,"text-color":"text-neutral-400/50 dark:text-neutral-600/20",started:f.value,onAnimationEndedOnce:z},null,8,["icon","position","started"])):y((a(),m("div",et,[y(i("div",it,null,512),[[s]])])),[[s]])])],64)}}});typeof I=="function"&&I(ot);export{ot as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{_ as E}from"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";import{d as S,r as D,x as b,o as a,y as P,a as i,c as m,C as w,m as R,D as C,z as q,bn as L,bG as N,g as r,q as V,v as j,h as F,bw as G,b as O,u as p,A as y,bx as $,by as H,n as J,bv as K}from"./index-D55VqdU4.js";import{_ as M}from"./IconAnimation.vue_vue_type_script_setup_true_lang-BpdSb0ho.js";import{b as I}from"./route-block-B_A1xBdJ.js";const Q={"z-1":"","flex-1":""},U={"text-lg":"","font-bold":"",class:"menu-icon-item-title",transition:"all ease-in-out duration-400"},W={text:"sm neutral-500 dark:neutral-400",class:"menu-icon-item-description",transition:"all ease-in-out duration-400"},X=S({__name:"IconItem",props:{title:null,description:null,icon:null,iconTemplate:{type:Boolean},to:null},setup(o){return(g,f)=>{const v=D("RouterLink");return a(),b(v,{box:"border",flex:"~ row",bg:"neutral-50 dark:neutral-900",border:"neutral-100 dark:neutral-800/25 hover:primary-500/30 dark:hover:primary-400/30 solid 2","drop-shadow":"none hover:[0px_4px_4px_rgba(220,220,220,0.4)] active:[0px_0px_0px_rgba(220,220,220,0.25)] dark:hover:none",class:"menu-icon-item",transition:"all ease-in-out duration-400",relative:"","w-full":"","items-center":"","overflow-hidden":"","rounded-lg":"","p-5":"","text-left":"",cursor:"pointer",to:o.to},{default:P(()=>[i("div",Q,[i("div",U,C(o.title),1),i("div",W,[i("span",null,C(o.description),1)])]),typeof o.icon=="string"?(a(),m("div",{key:0,class:q(["menu-icon-item-icon",[o.icon]]),transition:"all ease-in-out duration-400",absolute:"","right-0":"","size-24":"","translate-y-4":"",text:"neutral-400/50 dark:neutral-600/50"},null,2)):w("",!0),o.iconTemplate?R(g.$slots,"icon",{key:1},void 0,!0):w("",!0)]),_:3},8,["to"])}}}),Y=L(X,[["__scopeId","data-v-656e0116"]]),Z={flex:"~ col gap-4"},tt={flex:"~ col gap-4"},et={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-12rem)]","bottom-0":"","right--10":"","z--1":"",initial:{scale:.9,opacity:0,rotate:180},enter:{scale:1,opacity:1,rotate:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},it={text:"60","i-solar:settings-bold-duotone":""},ot=S({__name:"index",setup(o){const g=N(),f=r(!1),v=r(),c=r(),{t}=V(),x=r(""),h=r(""),k=r(!1),d=j();function z(){var n;(n=c.value)==null||n.call(c)}async function T(n,l){const e=n.currentTarget.querySelector(".menu-icon-item-icon");if(!e)return;const u=e.getBoundingClientRect(),_=`${u.left}px, ${u.top}px`;x.value=l.icon,h.value=_,k.value=!0,await K(),f.value=!0}const B=g.beforeEach(async(n,l,s)=>{if(!d.usePageSpecificTransitions||d.disableTransitions){s();return}await new Promise(e=>{c.value=e}),B(),s()}),A=F(()=>[{title:t("settings.pages.card.title"),description:t("settings.pages.card.description"),icon:"i-solar:emoji-funny-square-bold-duotone",to:"/settings/airi-card"},{title:t("settings.pages.modules.title"),description:t("settings.pages.modules.description"),icon:"i-solar:layers-bold-duotone",to:"/settings/modules"},{title:t("settings.pages.scene.title"),description:t("settings.pages.scene.description"),icon:"i-solar:armchair-2-bold-duotone",to:"/settings/scene"},{title:t("settings.pages.models.title"),description:t("settings.pages.models.description"),icon:"i-solar:people-nearby-bold-duotone",to:"/settings/models"},{title:t("settings.pages.memory.title"),description:t("settings.pages.memory.description"),icon:"i-solar:leaf-bold-duotone",to:"/settings/memory"},{title:t("settings.pages.providers.title"),description:t("settings.pages.providers.description"),icon:"i-solar:box-minimalistic-bold-duotone",to:"/settings/providers"},{title:t("settings.pages.themes.title"),description:t("settings.pages.themes.description"),icon:"i-solar:filters-bold-duotone",to:"/settings/appearance"}]);return(n,l)=>{const s=G("motion");return a(),m($,null,[O(p(E),{title:n.$t("settings.title")},null,8,["title"]),i("div",Z,[l[0]||(l[0]=i("div",null,null,-1)),i("div",tt,[(a(!0),m($,null,H(A.value,(e,u)=>y((a(),b(p(Y),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:J({transitionDelay:`${u*50}ms`}),title:e.title,description:e.description,icon:e.icon,to:e.to,onClick:_=>T(_,e)},null,8,["style","title","description","icon","to","onClick"])),[[s]])),128))]),k.value&&!p(d).disableTransitions&&p(d).usePageSpecificTransitions?(a(),b(M,{key:0,ref_key:"iconAnimation",ref:v,icon:x.value,"icon-size":6*1.2,position:h.value,duration:1e3,"text-color":"text-neutral-400/50 dark:text-neutral-600/20",started:f.value,onAnimationEndedOnce:z},null,8,["icon","position","started"])):y((a(),m("div",et,[y(i("div",it,null,512),[[s]])])),[[s]])])],64)}}});typeof I=="function"&&I(ot);export{ot as default}; diff --git a/assets/index-D55VqdU4.js b/assets/index-D55VqdU4.js new file mode 100644 index 0000000000000000000000000000000000000000..c069b11552830e70ed12f358acf90be9f46e58e6 --- /dev/null +++ b/assets/index-D55VqdU4.js @@ -0,0 +1,3906 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-Dhw9h5i0.js","assets/HeaderLink-Dfy3ZEHa.js","assets/HeaderLink-DsxHr3rn.css","assets/index-6VFi4BKt.js","assets/Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js","assets/Stage-DNNKwjzW.css","assets/import-url-browser-CPN8ipMD.js","assets/duckdb-mvp-CaaD-olE.js","assets/speech-BtNOtIn9.js","assets/index-Be1NqeGb.js","assets/providers-DAp1566d.js","assets/queue-CugJlP7m.js","assets/queues-DEEIdmXP.js","assets/index-D975M2PQ.js","assets/airi-card-TTCASwDd.js","assets/consciousness-BGmbU4M0.js","assets/Model.vue_vue_type_script_setup_true_lang-BILK6cfC.js","assets/TransitionVertical.vue_vue_type_script_setup_true_lang-BbB31kj-.js","assets/Collapsable.vue_vue_type_script_setup_true_lang-BDoHyduV.js","assets/Basic.vue_vue_type_script_setup_true_lang-DJ4kS-zi.js","assets/index-DO1ex3N6.js","assets/route-block-B_A1xBdJ.js","assets/index-DFm202zN.css","assets/background-remove-BznEXvcR.js","assets/InputFile.vue_vue_type_script_setup_true_lang-CR9cbe_p.js","assets/chat-BoclSdvP.js","assets/image-Se8P3JHN.js","assets/image-BhuwcwI9.css","assets/vibrant-DiySZm3a.js","assets/browser-CkchkNbv.js","assets/queue-CSnE70Jj.js","assets/index-BzQ8e19F.js","assets/PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js","assets/IconAnimation.vue_vue_type_script_setup_true_lang-BpdSb0ho.js","assets/index-DH7Ly51U.js","assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-MUqOZwiW.js","assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-DE2XAzMf.js","assets/index-fSchh9rJ.js","assets/CardListItem.vue_vue_type_script_setup_true_lang-C3dXCNzW.js","assets/CardDetailDialog-DKc4Mthn.js","assets/CardListItem-BohbUcI4.js","assets/DeleteCardDialog-C-dXtHQF.js","assets/index-3uLpAsQp.js","assets/ColorPalette.vue_vue_type_script_setup_true_lang-Cl6NdKBD.js","assets/index-4Fmwd3_O.css","assets/index-B-6GIiod.js","assets/index-D8SjfWSQ.js","assets/useIconAnimation-Dw2zcJkj.js","assets/index-rlpEp8ML.css","assets/index-DQQzlxjW.js","assets/IconStatusItem-DwLpS4EY.js","assets/consciousness-BKApwHzz.js","assets/RadioCardDetailManySelect-B6ly4h3g.js","assets/Input.vue_vue_type_script_setup_true_lang-CeU0PE9S.js","assets/memory-long-term-DqgaRqei.js","assets/memory-short-term-CgjWXBzF.js","assets/speech-CkUHmU-4.js","assets/TestDummyMarker.vue_vue_type_script_setup_true_lang-DRQbkM6R.js","assets/FieldInput.vue_vue_type_script_setup_true_lang-DQP2RhYC.js","assets/FieldRange.vue_vue_type_script_setup_true_lang-CtbCdbG8.js","assets/Textarea.vue_vue_type_script_setup_true_lang-NzxEJo0x.js","assets/index-DLifNpdd.js","assets/alibaba-cloud-model-studio-BNtzry17.js","assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-CPbYTBJt.js","assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-BtshDojk.js","assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BMPV9bKe.js","assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DLyRry-6.js","assets/anthropic-DeoGf-kT.js","assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-Cc3LXYUd.js","assets/cloudflare-workers-ai-RQPniZx7.js","assets/deepseek-ENYP1GJq.js","assets/elevenlabs-Di7recat.js","assets/featherless-ai-AfkKNAvr.js","assets/fireworks-ai-m-Nf-Xo5.js","assets/google-generative-ai-DFMkjsF_.js","assets/microsoft-speech-BIikQlYj.js","assets/mistral-ai-BllFW1bl.js","assets/moonshot-ai-DHW8Lwbg.js","assets/novita-ai-Bwr7ycLb.js","assets/ollama-X-aI2B2C.js","assets/openai-CJb4OpgD.js","assets/openrouter-ai-DqPOkDgq.js","assets/together-ai-iclTvzCk.js","assets/volcengine-BIunt7Yu.js","assets/xai-Di0tvp3d.js","assets/index-DzQg1p4T.js","assets/filter-message-BZZnHMce.js","assets/delays-CL-vuuRI.js","assets/emotions-Dd6am6XA.js","assets/messages-BXrCHBJr.js"])))=>i.map(i=>d[i]); +var tC=Object.defineProperty;var nC=(n,e,t)=>e in n?tC(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var fi=(n,e,t)=>nC(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(s){if(s.ep)return;s.ep=!0;const r=t(s);fetch(s.href,r)}})();const iC="modulepreload",sC=function(n){return"/"+n},uv={},je=function(e,t,i){let s=Promise.resolve();if(t&&t.length>0){let o=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=o(t.map(c=>{if(c=sC(c),c in uv)return;uv[c]=!0;const u=c.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${f}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":iC,u||(d.as="script"),d.crossOrigin="",d.href=c,l&&d.setAttribute("nonce",l),document.head.appendChild(d),u)return new Promise((h,p)=>{d.addEventListener("load",h),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function r(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&r(a.reason);return e().catch(r)})};/** +* @vue/shared v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**//*! #__NO_SIDE_EFFECTS__ */function p0(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const vt={},fa=[],es=()=>{},rC=()=>!1,Gd=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),m0=n=>n.startsWith("onUpdate:"),nn=Object.assign,g0=(n,e)=>{const t=n.indexOf(e);t>-1&&n.splice(t,1)},oC=Object.prototype.hasOwnProperty,St=(n,e)=>oC.call(n,e),ze=Array.isArray,da=n=>Ac(n)==="[object Map]",Na=n=>Ac(n)==="[object Set]",fv=n=>Ac(n)==="[object Date]",Ke=n=>typeof n=="function",Ut=n=>typeof n=="string",Ui=n=>typeof n=="symbol",It=n=>n!==null&&typeof n=="object",NM=n=>(It(n)||Ke(n))&&Ke(n.then)&&Ke(n.catch),UM=Object.prototype.toString,Ac=n=>UM.call(n),aC=n=>Ac(n).slice(8,-1),FM=n=>Ac(n)==="[object Object]",_0=n=>Ut(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,vl=p0(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Wd=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},lC=/-(\w)/g,ai=Wd(n=>n.replace(lC,(e,t)=>t?t.toUpperCase():"")),cC=/\B([A-Z])/g,zs=Wd(n=>n.replace(cC,"-$1").toLowerCase()),Xd=Wd(n=>n.charAt(0).toUpperCase()+n.slice(1)),mf=Wd(n=>n?`on${Xd(n)}`:""),Yn=(n,e)=>!Object.is(n,e),gf=(n,...e)=>{for(let t=0;t{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:i,value:t})},Lf=n=>{const e=parseFloat(n);return isNaN(e)?n:e},uC=n=>{const e=Ut(n)?Number(n):NaN;return isNaN(e)?n:e};let dv;const $d=()=>dv||(dv=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Si(n){if(ze(n)){const e={};for(let t=0;t{if(t){const i=t.split(dC);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function Ua(n){let e="";if(Ut(n))e=n;else if(ze(n))for(let t=0;tbo(t,e))}const zM=n=>!!(n&&n.__v_isRef===!0),vC=n=>Ut(n)?n:n==null?"":ze(n)||It(n)&&(n.toString===UM||!Ke(n.toString))?zM(n)?vC(n.value):JSON.stringify(n,VM,2):String(n),VM=(n,e)=>zM(e)?VM(n,e.value):da(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[i,s],r)=>(t[fp(i,r)+" =>"]=s,t),{})}:Na(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>fp(t))}:Ui(e)?fp(e):It(e)&&!ze(e)&&!FM(e)?String(e):e,fp=(n,e="")=>{var t;return Ui(n)?`Symbol(${(t=n.description)!=null?t:e})`:n};/** +* @vue/reactivity v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let Nn;class HM{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=Nn,!e&&Nn&&(this.index=(Nn.scopes||(Nn.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e0)return;if(bl){let e=bl;for(bl=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;yl;){let e=yl;for(yl=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){n||(n=i)}e=t}}if(n)throw n}function $M(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function qM(n){let e,t=n.depsTail,i=t;for(;i;){const s=i.prevDep;i.version===-1?(i===t&&(t=s),S0(i),yC(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=s}n.deps=e,n.depsTail=t}function Km(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(YM(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function YM(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===Wl))return;n.globalVersion=Wl;const e=n.dep;if(n.flags|=2,e.version>0&&!n.isSSR&&n.deps&&!Km(n)){n.flags&=-3;return}const t=Dt,i=Ni;Dt=n,Ni=!0;try{$M(n);const s=n.fn(n._value);(e.version===0||Yn(s,n._value))&&(n._value=s,e.version++)}catch(s){throw e.version++,s}finally{Dt=t,Ni=i,qM(n),n.flags&=-3}}function S0(n,e=!1){const{dep:t,prevSub:i,nextSub:s}=n;if(i&&(i.nextSub=s,n.prevSub=void 0),s&&(s.prevSub=i,n.nextSub=void 0),t.subs===n&&(t.subs=i,!i&&t.computed)){t.computed.flags&=-5;for(let r=t.computed.deps;r;r=r.nextDep)S0(r,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function yC(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let Ni=!0;const jM=[];function Er(){jM.push(Ni),Ni=!1}function Tr(){const n=jM.pop();Ni=n===void 0?!0:n}function hv(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=Dt;Dt=void 0;try{e()}finally{Dt=t}}}let Wl=0;class bC{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Yd{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!Dt||!Ni||Dt===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Dt)t=this.activeLink=new bC(Dt,this),Dt.deps?(t.prevDep=Dt.depsTail,Dt.depsTail.nextDep=t,Dt.depsTail=t):Dt.deps=Dt.depsTail=t,KM(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const i=t.nextDep;i.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=i),t.prevDep=Dt.depsTail,t.nextDep=void 0,Dt.depsTail.nextDep=t,Dt.depsTail=t,Dt.deps===t&&(Dt.deps=i)}return t}trigger(e){this.version++,Wl++,this.notify(e)}notify(e){x0();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{M0()}}}function KM(n){if(n.dep.sc++,n.sub.flags&4){const e=n.dep.computed;if(e&&!n.dep.subs){e.flags|=20;for(let i=e.deps;i;i=i.nextDep)KM(i)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),n.dep.subs=n}}const Df=new WeakMap,po=Symbol(""),Zm=Symbol(""),Xl=Symbol("");function Sn(n,e,t){if(Ni&&Dt){let i=Df.get(n);i||Df.set(n,i=new Map);let s=i.get(t);s||(i.set(t,s=new Yd),s.map=i,s.key=t),s.track()}}function Ms(n,e,t,i,s,r){const o=Df.get(n);if(!o){Wl++;return}const a=l=>{l&&l.trigger()};if(x0(),e==="clear")o.forEach(a);else{const l=ze(n),c=l&&_0(t);if(l&&t==="length"){const u=Number(i);o.forEach((f,d)=>{(d==="length"||d===Xl||!Ui(d)&&d>=u)&&a(f)})}else switch((t!==void 0||o.has(void 0))&&a(o.get(t)),c&&a(o.get(Xl)),e){case"add":l?c&&a(o.get("length")):(a(o.get(po)),da(n)&&a(o.get(Zm)));break;case"delete":l||(a(o.get(po)),da(n)&&a(o.get(Zm)));break;case"set":da(n)&&a(o.get(po));break}}M0()}function xC(n,e){const t=Df.get(n);return t&&t.get(e)}function Fo(n){const e=ut(n);return e===n?e:(Sn(e,"iterate",Xl),vi(n)?e:e.map(En))}function jd(n){return Sn(n=ut(n),"iterate",Xl),n}const MC={__proto__:null,[Symbol.iterator](){return hp(this,Symbol.iterator,En)},concat(...n){return Fo(this).concat(...n.map(e=>ze(e)?Fo(e):e))},entries(){return hp(this,"entries",n=>(n[1]=En(n[1]),n))},every(n,e){return us(this,"every",n,e,void 0,arguments)},filter(n,e){return us(this,"filter",n,e,t=>t.map(En),arguments)},find(n,e){return us(this,"find",n,e,En,arguments)},findIndex(n,e){return us(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return us(this,"findLast",n,e,En,arguments)},findLastIndex(n,e){return us(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return us(this,"forEach",n,e,void 0,arguments)},includes(...n){return pp(this,"includes",n)},indexOf(...n){return pp(this,"indexOf",n)},join(n){return Fo(this).join(n)},lastIndexOf(...n){return pp(this,"lastIndexOf",n)},map(n,e){return us(this,"map",n,e,void 0,arguments)},pop(){return Ya(this,"pop")},push(...n){return Ya(this,"push",n)},reduce(n,...e){return pv(this,"reduce",n,e)},reduceRight(n,...e){return pv(this,"reduceRight",n,e)},shift(){return Ya(this,"shift")},some(n,e){return us(this,"some",n,e,void 0,arguments)},splice(...n){return Ya(this,"splice",n)},toReversed(){return Fo(this).toReversed()},toSorted(n){return Fo(this).toSorted(n)},toSpliced(...n){return Fo(this).toSpliced(...n)},unshift(...n){return Ya(this,"unshift",n)},values(){return hp(this,"values",En)}};function hp(n,e,t){const i=jd(n),s=i[e]();return i!==n&&!vi(n)&&(s._next=s.next,s.next=()=>{const r=s._next();return r.value&&(r.value=t(r.value)),r}),s}const SC=Array.prototype;function us(n,e,t,i,s,r){const o=jd(n),a=o!==n&&!vi(n),l=o[e];if(l!==SC[e]){const f=l.apply(n,r);return a?En(f):f}let c=t;o!==n&&(a?c=function(f,d){return t.call(this,En(f),d,n)}:t.length>2&&(c=function(f,d){return t.call(this,f,d,n)}));const u=l.call(o,c,i);return a&&s?s(u):u}function pv(n,e,t,i){const s=jd(n);let r=t;return s!==n&&(vi(n)?t.length>3&&(r=function(o,a,l){return t.call(this,o,a,l,n)}):r=function(o,a,l){return t.call(this,o,En(a),l,n)}),s[e](r,...i)}function pp(n,e,t){const i=ut(n);Sn(i,"iterate",Xl);const s=i[e](...t);return(s===-1||s===!1)&&E0(t[0])?(t[0]=ut(t[0]),i[e](...t)):s}function Ya(n,e,t=[]){Er(),x0();const i=ut(n)[e].apply(n,t);return M0(),Tr(),i}const EC=p0("__proto__,__v_isRef,__isVue"),ZM=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Ui));function TC(n){Ui(n)||(n=String(n));const e=ut(this);return Sn(e,"has",n),e.hasOwnProperty(n)}class JM{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,i){if(t==="__v_skip")return e.__v_skip;const s=this._isReadonly,r=this._isShallow;if(t==="__v_isReactive")return!s;if(t==="__v_isReadonly")return s;if(t==="__v_isShallow")return r;if(t==="__v_raw")return i===(s?r?sS:iS:r?nS:tS).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const o=ze(e);if(!s){let l;if(o&&(l=MC[t]))return l;if(t==="hasOwnProperty")return TC}const a=Reflect.get(e,t,Pt(e)?e:i);return(Ui(t)?ZM.has(t):EC(t))||(s||Sn(e,"get",t),r)?a:Pt(a)?o&&_0(t)?a:a.value:It(a)?s?Fi(a):xi(a):a}}class QM extends JM{constructor(e=!1){super(!1,e)}set(e,t,i,s){let r=e[t];if(!this._isShallow){const l=xo(r);if(!vi(i)&&!xo(i)&&(r=ut(r),i=ut(i)),!ze(e)&&Pt(r)&&!Pt(i))return l?!1:(r.value=i,!0)}const o=ze(e)&&_0(t)?Number(t)n,iu=n=>Reflect.getPrototypeOf(n);function PC(n,e,t){return function(...i){const s=this.__v_raw,r=ut(s),o=da(r),a=n==="entries"||n===Symbol.iterator&&o,l=n==="keys"&&o,c=s[n](...i),u=t?Jm:e?Qm:En;return!e&&Sn(r,"iterate",l?Zm:po),{next(){const{value:f,done:d}=c.next();return d?{value:f,done:d}:{value:a?[u(f[0]),u(f[1])]:u(f),done:d}},[Symbol.iterator](){return this}}}}function su(n){return function(...e){return n==="delete"?!1:n==="clear"?void 0:this}}function IC(n,e){const t={get(s){const r=this.__v_raw,o=ut(r),a=ut(s);n||(Yn(s,a)&&Sn(o,"get",s),Sn(o,"get",a));const{has:l}=iu(o),c=e?Jm:n?Qm:En;if(l.call(o,s))return c(r.get(s));if(l.call(o,a))return c(r.get(a));r!==o&&r.get(s)},get size(){const s=this.__v_raw;return!n&&Sn(ut(s),"iterate",po),Reflect.get(s,"size",s)},has(s){const r=this.__v_raw,o=ut(r),a=ut(s);return n||(Yn(s,a)&&Sn(o,"has",s),Sn(o,"has",a)),s===a?r.has(s):r.has(s)||r.has(a)},forEach(s,r){const o=this,a=o.__v_raw,l=ut(a),c=e?Jm:n?Qm:En;return!n&&Sn(l,"iterate",po),a.forEach((u,f)=>s.call(r,c(u),c(f),o))}};return nn(t,n?{add:su("add"),set:su("set"),delete:su("delete"),clear:su("clear")}:{add(s){!e&&!vi(s)&&!xo(s)&&(s=ut(s));const r=ut(this);return iu(r).has.call(r,s)||(r.add(s),Ms(r,"add",s,s)),this},set(s,r){!e&&!vi(r)&&!xo(r)&&(r=ut(r));const o=ut(this),{has:a,get:l}=iu(o);let c=a.call(o,s);c||(s=ut(s),c=a.call(o,s));const u=l.call(o,s);return o.set(s,r),c?Yn(r,u)&&Ms(o,"set",s,r):Ms(o,"add",s,r),this},delete(s){const r=ut(this),{has:o,get:a}=iu(r);let l=o.call(r,s);l||(s=ut(s),l=o.call(r,s)),a&&a.call(r,s);const c=r.delete(s);return l&&Ms(r,"delete",s,void 0),c},clear(){const s=ut(this),r=s.size!==0,o=s.clear();return r&&Ms(s,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(s=>{t[s]=PC(s,n,e)}),t}function Kd(n,e){const t=IC(n,e);return(i,s,r)=>s==="__v_isReactive"?!n:s==="__v_isReadonly"?n:s==="__v_raw"?i:Reflect.get(St(t,s)&&s in i?t:i,s,r)}const LC={get:Kd(!1,!1)},DC={get:Kd(!1,!0)},OC={get:Kd(!0,!1)},NC={get:Kd(!0,!0)},tS=new WeakMap,nS=new WeakMap,iS=new WeakMap,sS=new WeakMap;function UC(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function FC(n){return n.__v_skip||!Object.isExtensible(n)?0:UC(aC(n))}function xi(n){return xo(n)?n:Zd(n,!1,wC,LC,tS)}function rS(n){return Zd(n,!1,CC,DC,nS)}function Fi(n){return Zd(n,!0,AC,OC,iS)}function oS(n){return Zd(n,!0,RC,NC,sS)}function Zd(n,e,t,i,s){if(!It(n)||n.__v_raw&&!(e&&n.__v_isReactive))return n;const r=s.get(n);if(r)return r;const o=FC(n);if(o===0)return n;const a=new Proxy(n,o===2?i:t);return s.set(n,a),a}function Is(n){return xo(n)?Is(n.__v_raw):!!(n&&n.__v_isReactive)}function xo(n){return!!(n&&n.__v_isReadonly)}function vi(n){return!!(n&&n.__v_isShallow)}function E0(n){return n?!!n.__v_raw:!1}function ut(n){const e=n&&n.__v_raw;return e?ut(e):n}function T0(n){return!St(n,"__v_skip")&&Object.isExtensible(n)&&kM(n,"__v_skip",!0),n}const En=n=>It(n)?xi(n):n,Qm=n=>It(n)?Fi(n):n;function Pt(n){return n?n.__v_isRef===!0:!1}function et(n){return aS(n,!1)}function Oe(n){return aS(n,!0)}function aS(n,e){return Pt(n)?n:new kC(n,e)}class kC{constructor(e,t){this.dep=new Yd,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:ut(e),this._value=t?e:En(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,i=this.__v_isShallow||vi(e)||xo(e);e=i?e:ut(e),Yn(e,t)&&(this._rawValue=e,this._value=i?e:En(e),this.dep.trigger())}}function Ot(n){return Pt(n)?n.value:n}function nt(n){return Ke(n)?n():Ot(n)}const BC={get:(n,e,t)=>e==="__v_raw"?n:Ot(Reflect.get(n,e,t)),set:(n,e,t,i)=>{const s=n[e];return Pt(s)&&!Pt(t)?(s.value=t,!0):Reflect.set(n,e,t,i)}};function lS(n){return Is(n)?n:new Proxy(n,BC)}class zC{constructor(e){this.__v_isRef=!0,this._value=void 0;const t=this.dep=new Yd,{get:i,set:s}=e(t.track.bind(t),t.trigger.bind(t));this._get=i,this._set=s}get value(){return this._value=this._get()}set value(e){this._set(e)}}function w0(n){return new zC(n)}function cS(n){const e=ze(n)?new Array(n.length):{};for(const t in n)e[t]=fS(n,t);return e}class VC{constructor(e,t,i){this._object=e,this._key=t,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return xC(ut(this._object),this._key)}}class HC{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function uS(n,e,t){return Pt(n)?n:Ke(n)?new HC(n):It(n)&&arguments.length>1?fS(n,e,t):et(n)}function fS(n,e,t){const i=n[e];return Pt(i)?i:new VC(n,e,t)}class GC{constructor(e,t,i){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Yd(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Wl-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&Dt!==this)return XM(this,!0),!0}get value(){const e=this.dep.track();return YM(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function WC(n,e,t=!1){let i,s;return Ke(n)?i=n:(i=n.get,s=n.set),new GC(i,s,t)}const ru={},Of=new WeakMap;let to;function XC(n,e=!1,t=to){if(t){let i=Of.get(t);i||Of.set(t,i=[]),i.push(n)}}function $C(n,e,t=vt){const{immediate:i,deep:s,once:r,scheduler:o,augmentJob:a,call:l}=t,c=v=>s?v:vi(v)||s===!1||s===0?Ss(v,1):Ss(v);let u,f,d,h,p=!1,_=!1;if(Pt(n)?(f=()=>n.value,p=vi(n)):Is(n)?(f=()=>c(n),p=!0):ze(n)?(_=!0,p=n.some(v=>Is(v)||vi(v)),f=()=>n.map(v=>{if(Pt(v))return v.value;if(Is(v))return c(v);if(Ke(v))return l?l(v,2):v()})):Ke(n)?e?f=l?()=>l(n,2):n:f=()=>{if(d){Er();try{d()}finally{Tr()}}const v=to;to=u;try{return l?l(n,3,[h]):n(h)}finally{to=v}}:f=es,e&&s){const v=f,E=s===!0?1/0:s;f=()=>Ss(v(),E)}const g=qd(),m=()=>{u.stop(),g&&g.active&&g0(g.effects,u)};if(r&&e){const v=e;e=(...E)=>{v(...E),m()}}let y=_?new Array(n.length).fill(ru):ru;const b=v=>{if(!(!(u.flags&1)||!u.dirty&&!v))if(e){const E=u.run();if(s||p||(_?E.some((T,S)=>Yn(T,y[S])):Yn(E,y))){d&&d();const T=to;to=u;try{const S=[E,y===ru?void 0:_&&y[0]===ru?[]:y,h];l?l(e,3,S):e(...S),y=E}finally{to=T}}}else u.run()};return a&&a(b),u=new GM(f),u.scheduler=o?()=>o(b,!1):b,h=v=>XC(v,!1,u),d=u.onStop=()=>{const v=Of.get(u);if(v){if(l)l(v,4);else for(const E of v)E();Of.delete(u)}},e?i?b(!0):y=u.run():o?o(b.bind(null,!0),!0):u.run(),m.pause=u.pause.bind(u),m.resume=u.resume.bind(u),m.stop=m,m}function Ss(n,e=1/0,t){if(e<=0||!It(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,Pt(n))Ss(n.value,e,t);else if(ze(n))for(let i=0;i{Ss(i,e,t)});else if(FM(n)){for(const i in n)Ss(n[i],e,t);for(const i of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,i)&&Ss(n[i],e,t)}return n}/** +* @vue/runtime-core v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function Cc(n,e,t,i){try{return i?n(...i):n()}catch(s){Jd(s,e,t)}}function ki(n,e,t,i){if(Ke(n)){const s=Cc(n,e,t,i);return s&&NM(s)&&s.catch(r=>{Jd(r,e,t)}),s}if(ze(n)){const s=[];for(let r=0;r>>1,s=Fn[i],r=$l(s);r=$l(t)?Fn.push(n):Fn.splice(YC(e),0,n),n.flags|=1,hS()}}function hS(){Nf||(Nf=dS.then(mS))}function jC(n){ze(n)?ha.push(...n):sr&&n.id===-1?sr.splice(ia+1,0,n):n.flags&1||(ha.push(n),n.flags|=1),hS()}function mv(n,e,t=Yi+1){for(;t$l(t)-$l(i));if(ha.length=0,sr){sr.push(...e);return}for(sr=e,ia=0;ian.id==null?n.flags&2?-1:1/0:n.id;function mS(n){try{for(Yi=0;Yi{i._d&&Cv(-1);const r=Uf(e);let o;try{o=n(...s)}finally{Uf(r),i._d&&Cv(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function nG(n,e){if(Qt===null)return n;const t=nh(Qt),i=n.dirs||(n.dirs=[]);for(let s=0;sn.__isTeleport,xl=n=>n&&(n.disabled||n.disabled===""),gv=n=>n&&(n.defer||n.defer===""),_v=n=>typeof SVGElement<"u"&&n instanceof SVGElement,vv=n=>typeof MathMLElement=="function"&&n instanceof MathMLElement,eg=(n,e)=>{const t=n&&n.to;return Ut(t)?e?e(t):null:t},bS={name:"Teleport",__isTeleport:!0,process(n,e,t,i,s,r,o,a,l,c){const{mc:u,pc:f,pbc:d,o:{insert:h,querySelector:p,createText:_,createComment:g}}=c,m=xl(e.props);let{shapeFlag:y,children:b,dynamicChildren:v}=e;if(n==null){const E=e.el=_(""),T=e.anchor=_("");h(E,t,i),h(T,t,i);const S=(x,M)=>{y&16&&(s&&s.isCE&&(s.ce._teleportTarget=x),u(b,x,M,s,r,o,a,l))},P=()=>{const x=e.target=eg(e.props,p),M=xS(x,e,_,h);x&&(o!=="svg"&&_v(x)?o="svg":o!=="mathml"&&vv(x)&&(o="mathml"),m||(S(x,M),_f(e,!1)))};m&&(S(t,T),_f(e,!0)),gv(e.props)?On(()=>{P(),e.el.__isMounted=!0},r):P()}else{if(gv(e.props)&&!n.el.__isMounted){On(()=>{bS.process(n,e,t,i,s,r,o,a,l,c),delete n.el.__isMounted},r);return}e.el=n.el,e.targetStart=n.targetStart;const E=e.anchor=n.anchor,T=e.target=n.target,S=e.targetAnchor=n.targetAnchor,P=xl(n.props),x=P?t:T,M=P?E:S;if(o==="svg"||_v(T)?o="svg":(o==="mathml"||vv(T))&&(o="mathml"),v?(d(n.dynamicChildren,v,x,s,r,o,a),L0(n,e,!0)):l||f(n,e,x,M,s,r,o,a,!1),m)P?e.props&&n.props&&e.props.to!==n.props.to&&(e.props.to=n.props.to):ou(e,t,E,c,1);else if((e.props&&e.props.to)!==(n.props&&n.props.to)){const I=e.target=eg(e.props,p);I&&ou(e,I,null,c,0)}else P&&ou(e,T,S,c,1);_f(e,m)}},remove(n,e,t,{um:i,o:{remove:s}},r){const{shapeFlag:o,children:a,anchor:l,targetStart:c,targetAnchor:u,target:f,props:d}=n;if(f&&(s(c),s(u)),r&&s(l),o&16){const h=r||!xl(d);for(let p=0;p{n.isMounted=!0}),RS(()=>{n.isUnmounting=!0}),n}const di=[Function,Array],MS={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:di,onEnter:di,onAfterEnter:di,onEnterCancelled:di,onBeforeLeave:di,onLeave:di,onAfterLeave:di,onLeaveCancelled:di,onBeforeAppear:di,onAppear:di,onAfterAppear:di,onAppearCancelled:di},SS=n=>{const e=n.subTree;return e.component?SS(e.component):e},JC={name:"BaseTransition",props:MS,setup(n,{slots:e}){const t=An(),i=ZC();return()=>{const s=e.default&&wS(e.default(),!0);if(!s||!s.length)return;const r=ES(s),o=ut(n),{mode:a}=o;if(i.isLeaving)return mp(r);const l=yv(r);if(!l)return mp(r);let c=tg(l,o,i,t,f=>c=f);l.type!==kn&&ql(l,c);let u=t.subTree&&yv(t.subTree);if(u&&u.type!==kn&&!ro(l,u)&&SS(t).type!==kn){let f=tg(u,o,i,t);if(ql(u,f),a==="out-in"&&l.type!==kn)return i.isLeaving=!0,f.afterLeave=()=>{i.isLeaving=!1,t.job.flags&8||t.update(),delete f.afterLeave,u=void 0},mp(r);a==="in-out"&&l.type!==kn?f.delayLeave=(d,h,p)=>{const _=TS(i,u);_[String(u.key)]=u,d[rr]=()=>{h(),d[rr]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{p(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return r}}};function ES(n){let e=n[0];if(n.length>1){for(const t of n)if(t.type!==kn){e=t;break}}return e}const QC=JC;function TS(n,e){const{leavingVNodes:t}=n;let i=t.get(e.type);return i||(i=Object.create(null),t.set(e.type,i)),i}function tg(n,e,t,i,s){const{appear:r,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:u,onEnterCancelled:f,onBeforeLeave:d,onLeave:h,onAfterLeave:p,onLeaveCancelled:_,onBeforeAppear:g,onAppear:m,onAfterAppear:y,onAppearCancelled:b}=e,v=String(n.key),E=TS(t,n),T=(x,M)=>{x&&ki(x,i,9,M)},S=(x,M)=>{const I=M[1];T(x,M),ze(x)?x.every(N=>N.length<=1)&&I():x.length<=1&&I()},P={mode:o,persisted:a,beforeEnter(x){let M=l;if(!t.isMounted)if(r)M=g||l;else return;x[rr]&&x[rr](!0);const I=E[v];I&&ro(n,I)&&I.el[rr]&&I.el[rr](),T(M,[x])},enter(x){let M=c,I=u,N=f;if(!t.isMounted)if(r)M=m||c,I=y||u,N=b||f;else return;let V=!1;const j=x[au]=te=>{V||(V=!0,te?T(N,[x]):T(I,[x]),P.delayedLeave&&P.delayedLeave(),x[au]=void 0)};M?S(M,[x,j]):j()},leave(x,M){const I=String(n.key);if(x[au]&&x[au](!0),t.isUnmounting)return M();T(d,[x]);let N=!1;const V=x[rr]=j=>{N||(N=!0,M(),j?T(_,[x]):T(p,[x]),x[rr]=void 0,E[I]===n&&delete E[I])};E[I]=n,h?S(h,[x,V]):V()},clone(x){const M=tg(x,e,t,i,s);return s&&s(M),M}};return P}function mp(n){if(Qd(n))return n=gr(n),n.children=null,n}function yv(n){if(!Qd(n))return yS(n.type)&&n.children?ES(n.children):n;const{shapeFlag:e,children:t}=n;if(t){if(e&16)return t[0];if(e&32&&Ke(t.default))return t.default()}}function ql(n,e){n.shapeFlag&6&&n.component?(n.transition=e,ql(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}function wS(n,e=!1,t){let i=[],s=0;for(let r=0;r1)for(let r=0;rFf(p,e&&(ze(e)?e[_]:e),t,i,s));return}if(pa(i)&&!s){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&Ff(n,e,t,i.component.subTree);return}const r=i.shapeFlag&4?nh(i.component):i.el,o=s?null:r,{i:a,r:l}=n,c=e&&e.r,u=a.refs===vt?a.refs={}:a.refs,f=a.setupState,d=ut(f),h=f===vt?()=>!1:p=>St(d,p);if(c!=null&&c!==l&&(Ut(c)?(u[c]=null,h(c)&&(f[c]=null)):Pt(c)&&(c.value=null)),Ke(l))Cc(l,a,12,[o,u]);else{const p=Ut(l),_=Pt(l);if(p||_){const g=()=>{if(n.f){const m=p?h(l)?f[l]:u[l]:l.value;s?ze(m)&&g0(m,r):ze(m)?m.includes(r)||m.push(r):p?(u[l]=[r],h(l)&&(f[l]=u[l])):(l.value=[r],n.k&&(u[n.k]=l.value))}else p?(u[l]=o,h(l)&&(f[l]=o)):_&&(l.value=o,n.k&&(u[n.k]=o))};o?(g.id=-1,On(g,t)):g()}}}$d().requestIdleCallback;$d().cancelIdleCallback;const pa=n=>!!n.type.__asyncLoader,Qd=n=>n.type.__isKeepAlive;function e2(n,e){CS(n,"a",e)}function t2(n,e){CS(n,"da",e)}function CS(n,e,t=cn){const i=n.__wdc||(n.__wdc=()=>{let s=t;for(;s;){if(s.isDeactivated)return;s=s.parent}return n()});if(eh(e,i,t),t){let s=t.parent;for(;s&&s.parent;)Qd(s.parent.vnode)&&n2(i,e,t,s),s=s.parent}}function n2(n,e,t,i){const s=eh(e,n,i,!0);rs(()=>{g0(i[e],s)},t)}function eh(n,e,t=cn,i=!1){if(t){const s=t[n]||(t[n]=[]),r=e.__weh||(e.__weh=(...o)=>{Er();const a=Dc(t),l=ki(e,t,n,o);return a(),Tr(),l});return i?s.unshift(r):s.push(r),r}}const Vs=n=>(e,t=cn)=>{(!Jl||n==="sp")&&eh(n,(...i)=>e(...i),t)},i2=Vs("bm"),Hn=Vs("m"),s2=Vs("bu"),r2=Vs("u"),RS=Vs("bum"),rs=Vs("um"),o2=Vs("sp"),a2=Vs("rtg"),l2=Vs("rtc");function c2(n,e=cn){eh("ec",n,e)}const C0="components",u2="directives";function rG(n,e){return R0(C0,n,!0,e)||n}const PS=Symbol.for("v-ndc");function f2(n){return Ut(n)?R0(C0,n,!1)||n:n||PS}function oG(n){return R0(u2,n)}function R0(n,e,t=!0,i=!1){const s=Qt||cn;if(s){const r=s.type;if(n===C0){const a=Q2(r,!1);if(a&&(a===e||a===ai(e)||a===Xd(ai(e))))return r}const o=bv(s[n]||r[n],e)||bv(s.appContext[n],e);return!o&&i?r:o}}function bv(n,e){return n&&(n[e]||n[ai(e)]||n[Xd(ai(e))])}function d2(n,e,t,i){let s;const r=t,o=ze(n);if(o||Ut(n)){const a=o&&Is(n);let l=!1;a&&(l=!vi(n),n=jd(n)),s=new Array(n.length);for(let c=0,u=n.length;ce(a,l,void 0,r));else{const a=Object.keys(n);s=new Array(a.length);for(let l=0,c=a.length;lZl(e)?!(e.type===kn||e.type===jt&&!IS(e.children)):!0)?n:null}function aG(n,e){const t={};for(const i in n)t[mf(i)]=n[i];return t}const ng=n=>n?QS(n)?nh(n):ng(n.parent):null,Ml=nn(Object.create(null),{$:n=>n,$el:n=>n.vnode.el,$data:n=>n.data,$props:n=>n.props,$attrs:n=>n.attrs,$slots:n=>n.slots,$refs:n=>n.refs,$parent:n=>ng(n.parent),$root:n=>ng(n.root),$host:n=>n.ce,$emit:n=>n.emit,$options:n=>OS(n),$forceUpdate:n=>n.f||(n.f=()=>{A0(n.update)}),$nextTick:n=>n.n||(n.n=wr.bind(n.proxy)),$watch:n=>O2.bind(n)}),gp=(n,e)=>n!==vt&&!n.__isScriptSetup&&St(n,e),p2={get({_:n},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:i,data:s,props:r,accessCache:o,type:a,appContext:l}=n;let c;if(e[0]!=="$"){const h=o[e];if(h!==void 0)switch(h){case 1:return i[e];case 2:return s[e];case 4:return t[e];case 3:return r[e]}else{if(gp(i,e))return o[e]=1,i[e];if(s!==vt&&St(s,e))return o[e]=2,s[e];if((c=n.propsOptions[0])&&St(c,e))return o[e]=3,r[e];if(t!==vt&&St(t,e))return o[e]=4,t[e];ig&&(o[e]=0)}}const u=Ml[e];let f,d;if(u)return e==="$attrs"&&Sn(n.attrs,"get",""),u(n);if((f=a.__cssModules)&&(f=f[e]))return f;if(t!==vt&&St(t,e))return o[e]=4,t[e];if(d=l.config.globalProperties,St(d,e))return d[e]},set({_:n},e,t){const{data:i,setupState:s,ctx:r}=n;return gp(s,e)?(s[e]=t,!0):i!==vt&&St(i,e)?(i[e]=t,!0):St(n.props,e)||e[0]==="$"&&e.slice(1)in n?!1:(r[e]=t,!0)},has({_:{data:n,setupState:e,accessCache:t,ctx:i,appContext:s,propsOptions:r}},o){let a;return!!t[o]||n!==vt&&St(n,o)||gp(e,o)||(a=r[0])&&St(a,o)||St(i,o)||St(Ml,o)||St(s.config.globalProperties,o)},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:St(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};function P0(){return LS().slots}function lG(){return LS().attrs}function LS(){const n=An();return n.setupContext||(n.setupContext=t1(n))}function Yl(n){return ze(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}function cG(n,e){const t=Yl(n);for(const i in e){if(i.startsWith("__skip"))continue;let s=t[i];s?ze(s)||Ke(s)?s=t[i]={type:s,default:e[i]}:s.default=e[i]:s===null&&(s=t[i]={default:e[i]}),s&&e[`__skip_${i}`]&&(s.skipFactory=!0)}return t}function uG(n,e){return!n||!e?n||e:ze(n)&&ze(e)?n.concat(e):nn({},Yl(n),Yl(e))}let ig=!0;function m2(n){const e=OS(n),t=n.proxy,i=n.ctx;ig=!1,e.beforeCreate&&xv(e.beforeCreate,n,"bc");const{data:s,computed:r,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:f,mounted:d,beforeUpdate:h,updated:p,activated:_,deactivated:g,beforeDestroy:m,beforeUnmount:y,destroyed:b,unmounted:v,render:E,renderTracked:T,renderTriggered:S,errorCaptured:P,serverPrefetch:x,expose:M,inheritAttrs:I,components:N,directives:V,filters:j}=e;if(c&&g2(c,i,null),o)for(const ee in o){const J=o[ee];Ke(J)&&(i[ee]=J.bind(t))}if(s){const ee=s.call(t,t);It(ee)&&(n.data=xi(ee))}if(ig=!0,r)for(const ee in r){const J=r[ee],he=Ke(J)?J.bind(t,t):Ke(J.get)?J.get.bind(t,t):es,be=!Ke(J)&&Ke(J.set)?J.set.bind(t):es,se=Me({get:he,set:be});Object.defineProperty(i,ee,{enumerable:!0,configurable:!0,get:()=>se.value,set:ye=>se.value=ye})}if(a)for(const ee in a)DS(a[ee],i,t,ee);if(l){const ee=Ke(l)?l.call(t):l;Reflect.ownKeys(ee).forEach(J=>{pr(J,ee[J])})}u&&xv(u,n,"c");function Z(ee,J){ze(J)?J.forEach(he=>ee(he.bind(t))):J&&ee(J.bind(t))}if(Z(i2,f),Z(Hn,d),Z(s2,h),Z(r2,p),Z(e2,_),Z(t2,g),Z(c2,P),Z(l2,T),Z(a2,S),Z(RS,y),Z(rs,v),Z(o2,x),ze(M))if(M.length){const ee=n.exposed||(n.exposed={});M.forEach(J=>{Object.defineProperty(ee,J,{get:()=>t[J],set:he=>t[J]=he})})}else n.exposed||(n.exposed={});E&&n.render===es&&(n.render=E),I!=null&&(n.inheritAttrs=I),N&&(n.components=N),V&&(n.directives=V),x&&AS(n)}function g2(n,e,t=es){ze(n)&&(n=sg(n));for(const i in n){const s=n[i];let r;It(s)?"default"in s?r=Tn(s.from||i,s.default,!0):r=Tn(s.from||i):r=Tn(s),Pt(r)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):e[i]=r}}function xv(n,e,t){ki(ze(n)?n.map(i=>i.bind(e.proxy)):n.bind(e.proxy),e,t)}function DS(n,e,t,i){let s=i.includes(".")?qS(t,i):()=>t[i];if(Ut(n)){const r=e[n];Ke(r)&&Xe(s,r)}else if(Ke(n))Xe(s,n.bind(t));else if(It(n))if(ze(n))n.forEach(r=>DS(r,e,t,i));else{const r=Ke(n.handler)?n.handler.bind(t):e[n.handler];Ke(r)&&Xe(s,r,n)}}function OS(n){const e=n.type,{mixins:t,extends:i}=e,{mixins:s,optionsCache:r,config:{optionMergeStrategies:o}}=n.appContext,a=r.get(e);let l;return a?l=a:!s.length&&!t&&!i?l=e:(l={},s.length&&s.forEach(c=>kf(l,c,o,!0)),kf(l,e,o)),It(e)&&r.set(e,l),l}function kf(n,e,t,i=!1){const{mixins:s,extends:r}=e;r&&kf(n,r,t,!0),s&&s.forEach(o=>kf(n,o,t,!0));for(const o in e)if(!(i&&o==="expose")){const a=_2[o]||t&&t[o];n[o]=a?a(n[o],e[o]):e[o]}return n}const _2={data:Mv,props:Sv,emits:Sv,methods:hl,computed:hl,beforeCreate:In,created:In,beforeMount:In,mounted:In,beforeUpdate:In,updated:In,beforeDestroy:In,beforeUnmount:In,destroyed:In,unmounted:In,activated:In,deactivated:In,errorCaptured:In,serverPrefetch:In,components:hl,directives:hl,watch:y2,provide:Mv,inject:v2};function Mv(n,e){return e?n?function(){return nn(Ke(n)?n.call(this,this):n,Ke(e)?e.call(this,this):e)}:e:n}function v2(n,e){return hl(sg(n),sg(e))}function sg(n){if(ze(n)){const e={};for(let t=0;t1)return t&&Ke(e)?e.call(i&&i.proxy):e}}function Rc(){return!!(cn||Qt||mo)}const US={},FS=()=>Object.create(US),kS=n=>Object.getPrototypeOf(n)===US;function M2(n,e,t,i=!1){const s={},r=FS();n.propsDefaults=Object.create(null),BS(n,e,s,r);for(const o in n.propsOptions[0])o in s||(s[o]=void 0);t?n.props=i?s:rS(s):n.type.props?n.props=s:n.props=r,n.attrs=r}function S2(n,e,t,i){const{props:s,attrs:r,vnode:{patchFlag:o}}=n,a=ut(s),[l]=n.propsOptions;let c=!1;if((i||o>0)&&!(o&16)){if(o&8){const u=n.vnode.dynamicProps;for(let f=0;f{l=!0;const[d,h]=zS(f,e,!0);nn(o,d),h&&a.push(...h)};!t&&e.mixins.length&&e.mixins.forEach(u),n.extends&&u(n.extends),n.mixins&&n.mixins.forEach(u)}if(!r&&!l)return It(n)&&i.set(n,fa),fa;if(ze(r))for(let u=0;un[0]==="_"||n==="$stable",I0=n=>ze(n)?n.map(Zi):[Zi(n)],T2=(n,e,t)=>{if(e._n)return e;const i=_S((...s)=>I0(e(...s)),t);return i._c=!1,i},HS=(n,e,t)=>{const i=n._ctx;for(const s in n){if(VS(s))continue;const r=n[s];if(Ke(r))e[s]=T2(s,r,i);else if(r!=null){const o=I0(r);e[s]=()=>o}}},GS=(n,e)=>{const t=I0(e);n.slots.default=()=>t},WS=(n,e,t)=>{for(const i in e)(t||i!=="_")&&(n[i]=e[i])},w2=(n,e,t)=>{const i=n.slots=FS();if(n.vnode.shapeFlag&32){const s=e._;s?(WS(i,e,t),t&&kM(i,"_",s,!0)):HS(e,i)}else e&&GS(n,e)},A2=(n,e,t)=>{const{vnode:i,slots:s}=n;let r=!0,o=vt;if(i.shapeFlag&32){const a=e._;a?t&&a===1?r=!1:WS(s,e,t):(r=!e.$stable,HS(e,s)),o=e}else e&&(GS(n,e),o={default:1});if(r)for(const a in s)!VS(a)&&o[a]==null&&delete s[a]},On=z2;function XS(n){return C2(n)}function C2(n,e){const t=$d();t.__VUE__=!0;const{insert:i,remove:s,patchProp:r,createElement:o,createText:a,createComment:l,setText:c,setElementText:u,parentNode:f,nextSibling:d,setScopeId:h=es,insertStaticContent:p}=n,_=(F,k,w,X=null,G=null,W=null,R=void 0,L=null,B=!!k.dynamicChildren)=>{if(F===k)return;F&&!ro(F,k)&&(X=$(F),ye(F,G,W,!0),F=null),k.patchFlag===-2&&(B=!1,k.dynamicChildren=null);const{type:C,ref:A,shapeFlag:U}=k;switch(C){case Lc:g(F,k,w,X);break;case kn:m(F,k,w,X);break;case vf:F==null&&y(k,w,X,R);break;case jt:N(F,k,w,X,G,W,R,L,B);break;default:U&1?E(F,k,w,X,G,W,R,L,B):U&6?V(F,k,w,X,G,W,R,L,B):(U&64||U&128)&&C.process(F,k,w,X,G,W,R,L,B,ce)}A!=null&&G&&Ff(A,F&&F.ref,W,k||F,!k)},g=(F,k,w,X)=>{if(F==null)i(k.el=a(k.children),w,X);else{const G=k.el=F.el;k.children!==F.children&&c(G,k.children)}},m=(F,k,w,X)=>{F==null?i(k.el=l(k.children||""),w,X):k.el=F.el},y=(F,k,w,X)=>{[F.el,F.anchor]=p(F.children,k,w,X,F.el,F.anchor)},b=({el:F,anchor:k},w,X)=>{let G;for(;F&&F!==k;)G=d(F),i(F,w,X),F=G;i(k,w,X)},v=({el:F,anchor:k})=>{let w;for(;F&&F!==k;)w=d(F),s(F),F=w;s(k)},E=(F,k,w,X,G,W,R,L,B)=>{k.type==="svg"?R="svg":k.type==="math"&&(R="mathml"),F==null?T(k,w,X,G,W,R,L,B):x(F,k,G,W,R,L,B)},T=(F,k,w,X,G,W,R,L)=>{let B,C;const{props:A,shapeFlag:U,transition:O,dirs:H}=F;if(B=F.el=o(F.type,W,A&&A.is,A),U&8?u(B,F.children):U&16&&P(F.children,B,null,X,G,_p(F,W),R,L),H&&Ur(F,null,X,"created"),S(B,F,F.scopeId,R,X),A){for(const fe in A)fe!=="value"&&!vl(fe)&&r(B,fe,null,A[fe],W,X);"value"in A&&r(B,"value",null,A.value,W),(C=A.onVnodeBeforeMount)&&Wi(C,X,F)}H&&Ur(F,null,X,"beforeMount");const q=R2(G,O);q&&O.beforeEnter(B),i(B,k,w),((C=A&&A.onVnodeMounted)||q||H)&&On(()=>{C&&Wi(C,X,F),q&&O.enter(B),H&&Ur(F,null,X,"mounted")},G)},S=(F,k,w,X,G)=>{if(w&&h(F,w),X)for(let W=0;W{for(let C=B;C{const L=k.el=F.el;let{patchFlag:B,dynamicChildren:C,dirs:A}=k;B|=F.patchFlag&16;const U=F.props||vt,O=k.props||vt;let H;if(w&&Fr(w,!1),(H=O.onVnodeBeforeUpdate)&&Wi(H,w,k,F),A&&Ur(k,F,w,"beforeUpdate"),w&&Fr(w,!0),(U.innerHTML&&O.innerHTML==null||U.textContent&&O.textContent==null)&&u(L,""),C?M(F.dynamicChildren,C,L,w,X,_p(k,G),W):R||J(F,k,L,null,w,X,_p(k,G),W,!1),B>0){if(B&16)I(L,U,O,w,G);else if(B&2&&U.class!==O.class&&r(L,"class",null,O.class,G),B&4&&r(L,"style",U.style,O.style,G),B&8){const q=k.dynamicProps;for(let fe=0;fe{H&&Wi(H,w,k,F),A&&Ur(k,F,w,"updated")},X)},M=(F,k,w,X,G,W,R)=>{for(let L=0;L{if(k!==w){if(k!==vt)for(const W in k)!vl(W)&&!(W in w)&&r(F,W,k[W],null,G,X);for(const W in w){if(vl(W))continue;const R=w[W],L=k[W];R!==L&&W!=="value"&&r(F,W,L,R,G,X)}"value"in w&&r(F,"value",k.value,w.value,G)}},N=(F,k,w,X,G,W,R,L,B)=>{const C=k.el=F?F.el:a(""),A=k.anchor=F?F.anchor:a("");let{patchFlag:U,dynamicChildren:O,slotScopeIds:H}=k;H&&(L=L?L.concat(H):H),F==null?(i(C,w,X),i(A,w,X),P(k.children||[],w,A,G,W,R,L,B)):U>0&&U&64&&O&&F.dynamicChildren?(M(F.dynamicChildren,O,w,G,W,R,L),(k.key!=null||G&&k===G.subTree)&&L0(F,k,!0)):J(F,k,w,A,G,W,R,L,B)},V=(F,k,w,X,G,W,R,L,B)=>{k.slotScopeIds=L,F==null?k.shapeFlag&512?G.ctx.activate(k,w,X,R,B):j(k,w,X,G,W,R,B):te(F,k,B)},j=(F,k,w,X,G,W,R)=>{const L=F.component=j2(F,X,G);if(Qd(F)&&(L.ctx.renderer=ce),K2(L,!1,R),L.asyncDep){if(G&&G.registerDep(L,Z,R),!F.el){const B=L.subTree=pn(kn);m(null,B,k,w)}}else Z(L,F,k,w,G,W,R)},te=(F,k,w)=>{const X=k.component=F.component;if(k2(F,k,w))if(X.asyncDep&&!X.asyncResolved){ee(X,k,w);return}else X.next=k,X.update();else k.el=F.el,X.vnode=k},Z=(F,k,w,X,G,W,R)=>{const L=()=>{if(F.isMounted){let{next:U,bu:O,u:H,parent:q,vnode:fe}=F;{const Se=$S(F);if(Se){U&&(U.el=fe.el,ee(F,U,R)),Se.asyncDep.then(()=>{F.isUnmounted||L()});return}}let ue=U,Re;Fr(F,!1),U?(U.el=fe.el,ee(F,U,R)):U=fe,O&&gf(O),(Re=U.props&&U.props.onVnodeBeforeUpdate)&&Wi(Re,q,U,fe),Fr(F,!0);const Pe=wv(F),me=F.subTree;F.subTree=Pe,_(me,Pe,f(me.el),$(me),F,G,W),U.el=Pe.el,ue===null&&B2(F,Pe.el),H&&On(H,G),(Re=U.props&&U.props.onVnodeUpdated)&&On(()=>Wi(Re,q,U,fe),G)}else{let U;const{el:O,props:H}=k,{bm:q,m:fe,parent:ue,root:Re,type:Pe}=F,me=pa(k);Fr(F,!1),q&&gf(q),!me&&(U=H&&H.onVnodeBeforeMount)&&Wi(U,ue,k),Fr(F,!0);{Re.ce&&Re.ce._injectChildStyle(Pe);const Se=F.subTree=wv(F);_(null,Se,w,X,F,G,W),k.el=Se.el}if(fe&&On(fe,G),!me&&(U=H&&H.onVnodeMounted)){const Se=k;On(()=>Wi(U,ue,Se),G)}(k.shapeFlag&256||ue&&pa(ue.vnode)&&ue.vnode.shapeFlag&256)&&F.a&&On(F.a,G),F.isMounted=!0,k=w=X=null}};F.scope.on();const B=F.effect=new GM(L);F.scope.off();const C=F.update=B.run.bind(B),A=F.job=B.runIfDirty.bind(B);A.i=F,A.id=F.uid,B.scheduler=()=>A0(A),Fr(F,!0),C()},ee=(F,k,w)=>{k.component=F;const X=F.vnode.props;F.vnode=k,F.next=null,S2(F,k.props,X,w),A2(F,k.children,w),Er(),mv(F),Tr()},J=(F,k,w,X,G,W,R,L,B=!1)=>{const C=F&&F.children,A=F?F.shapeFlag:0,U=k.children,{patchFlag:O,shapeFlag:H}=k;if(O>0){if(O&128){be(C,U,w,X,G,W,R,L,B);return}else if(O&256){he(C,U,w,X,G,W,R,L,B);return}}H&8?(A&16&&xe(C,G,W),U!==C&&u(w,U)):A&16?H&16?be(C,U,w,X,G,W,R,L,B):xe(C,G,W,!0):(A&8&&u(w,""),H&16&&P(U,w,X,G,W,R,L,B))},he=(F,k,w,X,G,W,R,L,B)=>{F=F||fa,k=k||fa;const C=F.length,A=k.length,U=Math.min(C,A);let O;for(O=0;OA?xe(F,G,W,!0,!1,U):P(k,w,X,G,W,R,L,B,U)},be=(F,k,w,X,G,W,R,L,B)=>{let C=0;const A=k.length;let U=F.length-1,O=A-1;for(;C<=U&&C<=O;){const H=F[C],q=k[C]=B?ar(k[C]):Zi(k[C]);if(ro(H,q))_(H,q,w,null,G,W,R,L,B);else break;C++}for(;C<=U&&C<=O;){const H=F[U],q=k[O]=B?ar(k[O]):Zi(k[O]);if(ro(H,q))_(H,q,w,null,G,W,R,L,B);else break;U--,O--}if(C>U){if(C<=O){const H=O+1,q=HO)for(;C<=U;)ye(F[C],G,W,!0),C++;else{const H=C,q=C,fe=new Map;for(C=q;C<=O;C++){const Ee=k[C]=B?ar(k[C]):Zi(k[C]);Ee.key!=null&&fe.set(Ee.key,C)}let ue,Re=0;const Pe=O-q+1;let me=!1,Se=0;const Ve=new Array(Pe);for(C=0;C=Pe){ye(Ee,G,W,!0);continue}let Je;if(Ee.key!=null)Je=fe.get(Ee.key);else for(ue=q;ue<=O;ue++)if(Ve[ue-q]===0&&ro(Ee,k[ue])){Je=ue;break}Je===void 0?ye(Ee,G,W,!0):(Ve[Je-q]=C+1,Je>=Se?Se=Je:me=!0,_(Ee,k[Je],w,null,G,W,R,L,B),Re++)}const Ye=me?P2(Ve):fa;for(ue=Ye.length-1,C=Pe-1;C>=0;C--){const Ee=q+C,Je=k[Ee],it=Ee+1{const{el:W,type:R,transition:L,children:B,shapeFlag:C}=F;if(C&6){se(F.component.subTree,k,w,X);return}if(C&128){F.suspense.move(k,w,X);return}if(C&64){R.move(F,k,w,ce);return}if(R===jt){i(W,k,w);for(let U=0;UL.enter(W),G);else{const{leave:U,delayLeave:O,afterLeave:H}=L,q=()=>i(W,k,w),fe=()=>{U(W,()=>{q(),H&&H()})};O?O(W,q,fe):fe()}else i(W,k,w)},ye=(F,k,w,X=!1,G=!1)=>{const{type:W,props:R,ref:L,children:B,dynamicChildren:C,shapeFlag:A,patchFlag:U,dirs:O,cacheIndex:H}=F;if(U===-2&&(G=!1),L!=null&&Ff(L,null,w,F,!0),H!=null&&(k.renderCache[H]=void 0),A&256){k.ctx.deactivate(F);return}const q=A&1&&O,fe=!pa(F);let ue;if(fe&&(ue=R&&R.onVnodeBeforeUnmount)&&Wi(ue,k,F),A&6)ge(F.component,w,X);else{if(A&128){F.suspense.unmount(w,X);return}q&&Ur(F,null,k,"beforeUnmount"),A&64?F.type.remove(F,k,w,ce,X):C&&!C.hasOnce&&(W!==jt||U>0&&U&64)?xe(C,k,w,!1,!0):(W===jt&&U&384||!G&&A&16)&&xe(B,k,w),X&&Be(F)}(fe&&(ue=R&&R.onVnodeUnmounted)||q)&&On(()=>{ue&&Wi(ue,k,F),q&&Ur(F,null,k,"unmounted")},w)},Be=F=>{const{type:k,el:w,anchor:X,transition:G}=F;if(k===jt){re(w,X);return}if(k===vf){v(F);return}const W=()=>{s(w),G&&!G.persisted&&G.afterLeave&&G.afterLeave()};if(F.shapeFlag&1&&G&&!G.persisted){const{leave:R,delayLeave:L}=G,B=()=>R(w,W);L?L(F.el,W,B):B()}else W()},re=(F,k)=>{let w;for(;F!==k;)w=d(F),s(F),F=w;s(k)},ge=(F,k,w)=>{const{bum:X,scope:G,job:W,subTree:R,um:L,m:B,a:C}=F;Tv(B),Tv(C),X&&gf(X),G.stop(),W&&(W.flags|=8,ye(R,F,k,w)),L&&On(L,k),On(()=>{F.isUnmounted=!0},k),k&&k.pendingBranch&&!k.isUnmounted&&F.asyncDep&&!F.asyncResolved&&F.suspenseId===k.pendingId&&(k.deps--,k.deps===0&&k.resolve())},xe=(F,k,w,X=!1,G=!1,W=0)=>{for(let R=W;R{if(F.shapeFlag&6)return $(F.component.subTree);if(F.shapeFlag&128)return F.suspense.next();const k=d(F.anchor||F.el),w=k&&k[vS];return w?d(w):k};let ae=!1;const le=(F,k,w)=>{F==null?k._vnode&&ye(k._vnode,null,null,!0):_(k._vnode||null,F,k,null,null,null,w),k._vnode=F,ae||(ae=!0,mv(),pS(),ae=!1)},ce={p:_,um:ye,m:se,r:Be,mt:j,mc:P,pc:J,pbc:M,n:$,o:n};return{render:le,hydrate:void 0,createApp:x2(le)}}function _p({type:n,props:e},t){return t==="svg"&&n==="foreignObject"||t==="mathml"&&n==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:t}function Fr({effect:n,job:e},t){t?(n.flags|=32,e.flags|=4):(n.flags&=-33,e.flags&=-5)}function R2(n,e){return(!n||n&&!n.pendingBranch)&&e&&!e.persisted}function L0(n,e,t=!1){const i=n.children,s=e.children;if(ze(i)&&ze(s))for(let r=0;r>1,n[t[a]]0&&(e[i]=t[r-1]),t[r]=i)}}for(r=t.length,o=t[r-1];r-- >0;)t[r]=o,o=e[o];return t}function $S(n){const e=n.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:$S(e)}function Tv(n){if(n)for(let e=0;eTn(I2);function Pc(n,e){return Ic(n,null,e)}function fG(n,e){return Ic(n,null,{flush:"post"})}function D2(n,e){return Ic(n,null,{flush:"sync"})}function Xe(n,e,t){return Ic(n,e,t)}function Ic(n,e,t=vt){const{immediate:i,deep:s,flush:r,once:o}=t,a=nn({},t),l=e&&i||!e&&r!=="post";let c;if(Jl){if(r==="sync"){const h=L2();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!l){const h=()=>{};return h.stop=es,h.resume=es,h.pause=es,h}}const u=cn;a.call=(h,p,_)=>ki(h,u,p,_);let f=!1;r==="post"?a.scheduler=h=>{On(h,u&&u.suspense)}:r!=="sync"&&(f=!0,a.scheduler=(h,p)=>{p?h():A0(h)}),a.augmentJob=h=>{e&&(h.flags|=4),f&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const d=$C(n,e,a);return Jl&&(c?c.push(d):l&&d()),d}function O2(n,e,t){const i=this.proxy,s=Ut(n)?n.includes(".")?qS(i,n):()=>i[n]:n.bind(i,i);let r;Ke(e)?r=e:(r=e.handler,t=e);const o=Dc(this),a=Ic(s,r.bind(i),t);return o(),a}function qS(n,e){const t=e.split(".");return()=>{let i=n;for(let s=0;s{let u,f=vt,d;return D2(()=>{const h=n[s];Yn(u,h)&&(u=h,c())}),{get(){return l(),t.get?t.get(u):u},set(h){const p=t.set?t.set(h):h;if(!Yn(p,u)&&!(f!==vt&&Yn(h,f)))return;const _=i.vnode.props;_&&(e in _||s in _||r in _)&&(`onUpdate:${e}`in _||`onUpdate:${s}`in _||`onUpdate:${r}`in _)||(u=h,c()),i.emit(`update:${e}`,p),Yn(h,p)&&Yn(h,f)&&!Yn(p,d)&&c(),f=h,d=p}}});return a[Symbol.iterator]=()=>{let l=0;return{next(){return l<2?{value:l++?o||vt:a,done:!1}:{done:!0}}}},a}const YS=(n,e)=>e==="modelValue"||e==="model-value"?n.modelModifiers:n[`${e}Modifiers`]||n[`${ai(e)}Modifiers`]||n[`${zs(e)}Modifiers`];function N2(n,e,...t){if(n.isUnmounted)return;const i=n.vnode.props||vt;let s=t;const r=e.startsWith("update:"),o=r&&YS(i,e.slice(7));o&&(o.trim&&(s=t.map(u=>Ut(u)?u.trim():u)),o.number&&(s=t.map(Lf)));let a,l=i[a=mf(e)]||i[a=mf(ai(e))];!l&&r&&(l=i[a=mf(zs(e))]),l&&ki(l,n,6,s);const c=i[a+"Once"];if(c){if(!n.emitted)n.emitted={};else if(n.emitted[a])return;n.emitted[a]=!0,ki(c,n,6,s)}}function jS(n,e,t=!1){const i=e.emitsCache,s=i.get(n);if(s!==void 0)return s;const r=n.emits;let o={},a=!1;if(!Ke(n)){const l=c=>{const u=jS(c,e,!0);u&&(a=!0,nn(o,u))};!t&&e.mixins.length&&e.mixins.forEach(l),n.extends&&l(n.extends),n.mixins&&n.mixins.forEach(l)}return!r&&!a?(It(n)&&i.set(n,null),null):(ze(r)?r.forEach(l=>o[l]=null):nn(o,r),It(n)&&i.set(n,o),o)}function th(n,e){return!n||!Gd(e)?!1:(e=e.slice(2).replace(/Once$/,""),St(n,e[0].toLowerCase()+e.slice(1))||St(n,zs(e))||St(n,e))}function wv(n){const{type:e,vnode:t,proxy:i,withProxy:s,propsOptions:[r],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:f,data:d,setupState:h,ctx:p,inheritAttrs:_}=n,g=Uf(n);let m,y;try{if(t.shapeFlag&4){const v=s||i,E=v;m=Zi(c.call(E,v,u,f,h,d,p)),y=a}else{const v=e;m=Zi(v.length>1?v(f,{attrs:a,slots:o,emit:l}):v(f,null)),y=e.props?a:U2(a)}}catch(v){Sl.length=0,Jd(v,n,1),m=pn(kn)}let b=m;if(y&&_!==!1){const v=Object.keys(y),{shapeFlag:E}=b;v.length&&E&7&&(r&&v.some(m0)&&(y=F2(y,r)),b=gr(b,y,!1,!0))}return t.dirs&&(b=gr(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(t.dirs):t.dirs),t.transition&&ql(b,t.transition),m=b,Uf(g),m}const U2=n=>{let e;for(const t in n)(t==="class"||t==="style"||Gd(t))&&((e||(e={}))[t]=n[t]);return e},F2=(n,e)=>{const t={};for(const i in n)(!m0(i)||!(i.slice(9)in e))&&(t[i]=n[i]);return t};function k2(n,e,t){const{props:i,children:s,component:r}=n,{props:o,children:a,patchFlag:l}=e,c=r.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&l>=0){if(l&1024)return!0;if(l&16)return i?Av(i,o,c):!!o;if(l&8){const u=e.dynamicProps;for(let f=0;fn.__isSuspense;function z2(n,e){e&&e.pendingBranch?ze(n)?e.effects.push(...n):e.effects.push(n):jC(n)}const jt=Symbol.for("v-fgt"),Lc=Symbol.for("v-txt"),kn=Symbol.for("v-cmt"),vf=Symbol.for("v-stc"),Sl=[];let si=null;function mn(n=!1){Sl.push(si=n?null:[])}function V2(){Sl.pop(),si=Sl[Sl.length-1]||null}let jl=1;function Cv(n,e=!1){jl+=n,n<0&&si&&e&&(si.hasOnce=!0)}function ZS(n){return n.dynamicChildren=jl>0?si||fa:null,V2(),jl>0&&si&&si.push(n),n}function yi(n,e,t,i,s,r){return ZS(or(n,e,t,i,s,r,!0))}function Kl(n,e,t,i,s){return ZS(pn(n,e,t,i,s,!0))}function Zl(n){return n?n.__v_isVNode===!0:!1}function ro(n,e){return n.type===e.type&&n.key===e.key}const JS=({key:n})=>n??null,yf=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?Ut(n)||Pt(n)||Ke(n)?{i:Qt,r:n,k:e,f:!!t}:n:null);function or(n,e=null,t=null,i=0,s=null,r=n===jt?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&JS(e),ref:e&&yf(e),scopeId:gS,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:i,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Qt};return a?(D0(l,t),r&128&&n.normalize(l)):t&&(l.shapeFlag|=Ut(t)?8:16),jl>0&&!o&&si&&(l.patchFlag>0||r&6)&&l.patchFlag!==32&&si.push(l),l}const pn=H2;function H2(n,e=null,t=null,i=0,s=null,r=!1){if((!n||n===PS)&&(n=kn),Zl(n)){const a=gr(n,e,!0);return t&&D0(a,t),jl>0&&!r&&si&&(a.shapeFlag&6?si[si.indexOf(n)]=a:si.push(a)),a.patchFlag=-2,a}if(eR(n)&&(n=n.__vccOpts),e){e=G2(e);let{class:a,style:l}=e;a&&!Ut(a)&&(e.class=Ua(a)),It(l)&&(E0(l)&&!ze(l)&&(l=nn({},l)),e.style=Si(l))}const o=Ut(n)?1:KS(n)?128:yS(n)?64:It(n)?4:Ke(n)?2:0;return or(n,e,t,i,s,o,r,!0)}function G2(n){return n?E0(n)||kS(n)?nn({},n):n:null}function gr(n,e,t=!1,i=!1){const{props:s,ref:r,patchFlag:o,children:a,transition:l}=n,c=e?$2(s||{},e):s,u={__v_isVNode:!0,__v_skip:!0,type:n.type,props:c,key:c&&JS(c),ref:e&&e.ref?t&&r?ze(r)?r.concat(yf(e)):[r,yf(e)]:yf(e):r,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:a,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==jt?o===-1?16:o|16:o,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:l,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&gr(n.ssContent),ssFallback:n.ssFallback&&gr(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return l&&i&&ql(u,l.clone(u)),u}function W2(n=" ",e=0){return pn(Lc,null,n,e)}function X2(n,e){const t=pn(vf,null,n);return t.staticCount=e,t}function Rv(n="",e=!1){return e?(mn(),Kl(kn,null,n)):pn(kn,null,n)}function Zi(n){return n==null||typeof n=="boolean"?pn(kn):ze(n)?pn(jt,null,n.slice()):Zl(n)?ar(n):pn(Lc,null,String(n))}function ar(n){return n.el===null&&n.patchFlag!==-1||n.memo?n:gr(n)}function D0(n,e){let t=0;const{shapeFlag:i}=n;if(e==null)e=null;else if(ze(e))t=16;else if(typeof e=="object")if(i&65){const s=e.default;s&&(s._c&&(s._d=!1),D0(n,s()),s._c&&(s._d=!0));return}else{t=32;const s=e._;!s&&!kS(e)?e._ctx=Qt:s===3&&Qt&&(Qt.slots._===1?e._=1:(e._=2,n.patchFlag|=1024))}else Ke(e)?(e={default:e,_ctx:Qt},t=32):(e=String(e),i&64?(t=16,e=[W2(e)]):t=8);n.children=e,n.shapeFlag|=t}function $2(...n){const e={};for(let t=0;tcn||Qt;let Bf,og;{const n=$d(),e=(t,i)=>{let s;return(s=n[t])||(s=n[t]=[]),s.push(i),r=>{s.length>1?s.forEach(o=>o(r)):s[0](r)}};Bf=e("__VUE_INSTANCE_SETTERS__",t=>cn=t),og=e("__VUE_SSR_SETTERS__",t=>Jl=t)}const Dc=n=>{const e=cn;return Bf(n),n.scope.on(),()=>{n.scope.off(),Bf(e)}},Pv=()=>{cn&&cn.scope.off(),Bf(null)};function QS(n){return n.vnode.shapeFlag&4}let Jl=!1;function K2(n,e=!1,t=!1){e&&og(e);const{props:i,children:s}=n.vnode,r=QS(n);M2(n,i,r,e),w2(n,s,t);const o=r?Z2(n,e):void 0;return e&&og(!1),o}function Z2(n,e){const t=n.type;n.accessCache=Object.create(null),n.proxy=new Proxy(n.ctx,p2);const{setup:i}=t;if(i){Er();const s=n.setupContext=i.length>1?t1(n):null,r=Dc(n),o=Cc(i,n,0,[n.props,s]),a=NM(o);if(Tr(),r(),(a||n.sp)&&!pa(n)&&AS(n),a){if(o.then(Pv,Pv),e)return o.then(l=>{Iv(n,l)}).catch(l=>{Jd(l,n,0)});n.asyncDep=o}else Iv(n,o)}else e1(n)}function Iv(n,e,t){Ke(e)?n.type.__ssrInlineRender?n.ssrRender=e:n.render=e:It(e)&&(n.setupState=lS(e)),e1(n)}function e1(n,e,t){const i=n.type;n.render||(n.render=i.render||es);{const s=Dc(n);Er();try{m2(n)}finally{Tr(),s()}}}const J2={get(n,e){return Sn(n,"get",""),n[e]}};function t1(n){const e=t=>{n.exposed=t||{}};return{attrs:new Proxy(n.attrs,J2),slots:n.slots,emit:n.emit,expose:e}}function nh(n){return n.exposed?n.exposeProxy||(n.exposeProxy=new Proxy(lS(T0(n.exposed)),{get(e,t){if(t in e)return e[t];if(t in Ml)return Ml[t](n)},has(e,t){return t in e||t in Ml}})):n.proxy}function Q2(n,e=!0){return Ke(n)?n.displayName||n.name:n.name||e&&n.__name}function eR(n){return Ke(n)&&"__vccOpts"in n}const Me=(n,e)=>WC(n,e,Jl);function Ns(n,e,t){const i=arguments.length;return i===2?It(e)&&!ze(e)?Zl(e)?pn(n,null,[e]):pn(n,e):pn(n,null,e):(i>3?t=Array.prototype.slice.call(arguments,2):i===3&&Zl(t)&&(t=[t]),pn(n,e,t))}const tR="3.5.13";/** +* @vue/runtime-dom v3.5.13 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let ag;const Lv=typeof window<"u"&&window.trustedTypes;if(Lv)try{ag=Lv.createPolicy("vue",{createHTML:n=>n})}catch{}const n1=ag?n=>ag.createHTML(n):n=>n,nR="http://www.w3.org/2000/svg",iR="http://www.w3.org/1998/Math/MathML",xs=typeof document<"u"?document:null,Dv=xs&&xs.createElement("template"),sR={insert:(n,e,t)=>{e.insertBefore(n,t||null)},remove:n=>{const e=n.parentNode;e&&e.removeChild(n)},createElement:(n,e,t,i)=>{const s=e==="svg"?xs.createElementNS(nR,n):e==="mathml"?xs.createElementNS(iR,n):t?xs.createElement(n,{is:t}):xs.createElement(n);return n==="select"&&i&&i.multiple!=null&&s.setAttribute("multiple",i.multiple),s},createText:n=>xs.createTextNode(n),createComment:n=>xs.createComment(n),setText:(n,e)=>{n.nodeValue=e},setElementText:(n,e)=>{n.textContent=e},parentNode:n=>n.parentNode,nextSibling:n=>n.nextSibling,querySelector:n=>xs.querySelector(n),setScopeId(n,e){n.setAttribute(e,"")},insertStaticContent(n,e,t,i,s,r){const o=t?t.previousSibling:e.lastChild;if(s&&(s===r||s.nextSibling))for(;e.insertBefore(s.cloneNode(!0),t),!(s===r||!(s=s.nextSibling)););else{Dv.innerHTML=n1(i==="svg"?`${n}`:i==="mathml"?`${n}`:n);const a=Dv.content;if(i==="svg"||i==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,t)}return[o?o.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},qs="transition",ja="animation",Ql=Symbol("_vtc"),i1={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},rR=nn({},MS,i1),oR=n=>(n.displayName="Transition",n.props=rR,n),hG=oR((n,{slots:e})=>Ns(QC,aR(n),e)),kr=(n,e=[])=>{ze(n)?n.forEach(t=>t(...e)):n&&n(...e)},Ov=n=>n?ze(n)?n.some(e=>e.length>1):n.length>1:!1;function aR(n){const e={};for(const N in n)N in i1||(e[N]=n[N]);if(n.css===!1)return e;const{name:t="v",type:i,duration:s,enterFromClass:r=`${t}-enter-from`,enterActiveClass:o=`${t}-enter-active`,enterToClass:a=`${t}-enter-to`,appearFromClass:l=r,appearActiveClass:c=o,appearToClass:u=a,leaveFromClass:f=`${t}-leave-from`,leaveActiveClass:d=`${t}-leave-active`,leaveToClass:h=`${t}-leave-to`}=n,p=lR(s),_=p&&p[0],g=p&&p[1],{onBeforeEnter:m,onEnter:y,onEnterCancelled:b,onLeave:v,onLeaveCancelled:E,onBeforeAppear:T=m,onAppear:S=y,onAppearCancelled:P=b}=e,x=(N,V,j,te)=>{N._enterCancelled=te,Br(N,V?u:a),Br(N,V?c:o),j&&j()},M=(N,V)=>{N._isLeaving=!1,Br(N,f),Br(N,h),Br(N,d),V&&V()},I=N=>(V,j)=>{const te=N?S:y,Z=()=>x(V,N,j);kr(te,[V,Z]),Nv(()=>{Br(V,N?l:r),fs(V,N?u:a),Ov(te)||Uv(V,i,_,Z)})};return nn(e,{onBeforeEnter(N){kr(m,[N]),fs(N,r),fs(N,o)},onBeforeAppear(N){kr(T,[N]),fs(N,l),fs(N,c)},onEnter:I(!1),onAppear:I(!0),onLeave(N,V){N._isLeaving=!0;const j=()=>M(N,V);fs(N,f),N._enterCancelled?(fs(N,d),Bv()):(Bv(),fs(N,d)),Nv(()=>{N._isLeaving&&(Br(N,f),fs(N,h),Ov(v)||Uv(N,i,g,j))}),kr(v,[N,j])},onEnterCancelled(N){x(N,!1,void 0,!0),kr(b,[N])},onAppearCancelled(N){x(N,!0,void 0,!0),kr(P,[N])},onLeaveCancelled(N){M(N),kr(E,[N])}})}function lR(n){if(n==null)return null;if(It(n))return[vp(n.enter),vp(n.leave)];{const e=vp(n);return[e,e]}}function vp(n){return uC(n)}function fs(n,e){e.split(/\s+/).forEach(t=>t&&n.classList.add(t)),(n[Ql]||(n[Ql]=new Set)).add(e)}function Br(n,e){e.split(/\s+/).forEach(i=>i&&n.classList.remove(i));const t=n[Ql];t&&(t.delete(e),t.size||(n[Ql]=void 0))}function Nv(n){requestAnimationFrame(()=>{requestAnimationFrame(n)})}let cR=0;function Uv(n,e,t,i){const s=n._endId=++cR,r=()=>{s===n._endId&&i()};if(t!=null)return setTimeout(r,t);const{type:o,timeout:a,propCount:l}=uR(n,e);if(!o)return i();const c=o+"end";let u=0;const f=()=>{n.removeEventListener(c,d),r()},d=h=>{h.target===n&&++u>=l&&f()};setTimeout(()=>{u(t[p]||"").split(", "),s=i(`${qs}Delay`),r=i(`${qs}Duration`),o=Fv(s,r),a=i(`${ja}Delay`),l=i(`${ja}Duration`),c=Fv(a,l);let u=null,f=0,d=0;e===qs?o>0&&(u=qs,f=o,d=r.length):e===ja?c>0&&(u=ja,f=c,d=l.length):(f=Math.max(o,c),u=f>0?o>c?qs:ja:null,d=u?u===qs?r.length:l.length:0);const h=u===qs&&/\b(transform|all)(,|$)/.test(i(`${qs}Property`).toString());return{type:u,timeout:f,propCount:d,hasTransform:h}}function Fv(n,e){for(;n.lengthkv(t)+kv(n[i])))}function kv(n){return n==="auto"?0:Number(n.slice(0,-1).replace(",","."))*1e3}function Bv(){return document.body.offsetHeight}function fR(n,e,t){const i=n[Ql];i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?n.removeAttribute("class"):t?n.setAttribute("class",e):n.className=e}const zv=Symbol("_vod"),dR=Symbol("_vsh"),hR=Symbol(""),pR=/(^|;)\s*display\s*:/;function mR(n,e,t){const i=n.style,s=Ut(t);let r=!1;if(t&&!s){if(e)if(Ut(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();t[a]==null&&bf(i,a,"")}else for(const o in e)t[o]==null&&bf(i,o,"");for(const o in t)o==="display"&&(r=!0),bf(i,o,t[o])}else if(s){if(e!==t){const o=i[hR];o&&(t+=";"+o),i.cssText=t,r=pR.test(t)}}else e&&n.removeAttribute("style");zv in n&&(n[zv]=r?i.display:"",n[dR]&&(i.display="none"))}const Vv=/\s*!important$/;function bf(n,e,t){if(ze(t))t.forEach(i=>bf(n,e,i));else if(t==null&&(t=""),e.startsWith("--"))n.setProperty(e,t);else{const i=gR(n,e);Vv.test(t)?n.setProperty(zs(i),t.replace(Vv,""),"important"):n[i]=t}}const Hv=["Webkit","Moz","ms"],yp={};function gR(n,e){const t=yp[e];if(t)return t;let i=ai(e);if(i!=="filter"&&i in n)return yp[e]=i;i=Xd(i);for(let s=0;sbp||(bR.then(()=>bp=0),bp=Date.now());function MR(n,e){const t=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=t.attached)return;ki(SR(i,t.value),e,5,[i])};return t.value=n,t.attached=xR(),t}function SR(n,e){if(ze(e)){const t=n.stopImmediatePropagation;return n.stopImmediatePropagation=()=>{t.call(n),n._stopped=!0},e.map(i=>s=>!s._stopped&&i&&i(s))}else return e}const Yv=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)>96&&n.charCodeAt(2)<123,ER=(n,e,t,i,s,r)=>{const o=s==="svg";e==="class"?fR(n,i,o):e==="style"?mR(n,t,i):Gd(e)?m0(e)||vR(n,e,t,i,r):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):TR(n,e,i,o))?(Xv(n,e,i),!n.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&Wv(n,e,i,o,r,e!=="value")):n._isVueCE&&(/[A-Z]/.test(e)||!Ut(i))?Xv(n,ai(e),i,r,e):(e==="true-value"?n._trueValue=i:e==="false-value"&&(n._falseValue=i),Wv(n,e,i,o))};function TR(n,e,t,i){if(i)return!!(e==="innerHTML"||e==="textContent"||e in n&&Yv(e)&&Ke(t));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&n.tagName==="INPUT"||e==="type"&&n.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const s=n.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return Yv(e)&&Ut(t)?!1:e in n}const _r=n=>{const e=n.props["onUpdate:modelValue"]||!1;return ze(e)?t=>gf(e,t):e};function wR(n){n.target.composing=!0}function jv(n){const e=n.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const bi=Symbol("_assign"),Kv={created(n,{modifiers:{lazy:e,trim:t,number:i}},s){n[bi]=_r(s);const r=i||s.props&&s.props.type==="number";Es(n,e?"change":"input",o=>{if(o.target.composing)return;let a=n.value;t&&(a=a.trim()),r&&(a=Lf(a)),n[bi](a)}),t&&Es(n,"change",()=>{n.value=n.value.trim()}),e||(Es(n,"compositionstart",wR),Es(n,"compositionend",jv),Es(n,"change",jv))},mounted(n,{value:e}){n.value=e??""},beforeUpdate(n,{value:e,oldValue:t,modifiers:{lazy:i,trim:s,number:r}},o){if(n[bi]=_r(o),n.composing)return;const a=(r||n.type==="number")&&!/^0\d/.test(n.value)?Lf(n.value):n.value,l=e??"";a!==l&&(document.activeElement===n&&n.type!=="range"&&(i&&e===t||s&&n.value.trim()===l)||(n.value=l))}},AR={deep:!0,created(n,e,t){n[bi]=_r(t),Es(n,"change",()=>{const i=n._modelValue,s=va(n),r=n.checked,o=n[bi];if(ze(i)){const a=v0(i,s),l=a!==-1;if(r&&!l)o(i.concat(s));else if(!r&&l){const c=[...i];c.splice(a,1),o(c)}}else if(Na(i)){const a=new Set(i);r?a.add(s):a.delete(s),o(a)}else o(s1(n,r))})},mounted:Zv,beforeUpdate(n,e,t){n[bi]=_r(t),Zv(n,e,t)}};function Zv(n,{value:e,oldValue:t},i){n._modelValue=e;let s;if(ze(e))s=v0(e,i.props.value)>-1;else if(Na(e))s=e.has(i.props.value);else{if(e===t)return;s=bo(e,s1(n,!0))}n.checked!==s&&(n.checked=s)}const CR={created(n,{value:e},t){n.checked=bo(e,t.props.value),n[bi]=_r(t),Es(n,"change",()=>{n[bi](va(n))})},beforeUpdate(n,{value:e,oldValue:t},i){n[bi]=_r(i),e!==t&&(n.checked=bo(e,i.props.value))}},RR={deep:!0,created(n,{value:e,modifiers:{number:t}},i){const s=Na(e);Es(n,"change",()=>{const r=Array.prototype.filter.call(n.options,o=>o.selected).map(o=>t?Lf(va(o)):va(o));n[bi](n.multiple?s?new Set(r):r:r[0]),n._assigning=!0,wr(()=>{n._assigning=!1})}),n[bi]=_r(i)},mounted(n,{value:e}){Jv(n,e)},beforeUpdate(n,e,t){n[bi]=_r(t)},updated(n,{value:e}){n._assigning||Jv(n,e)}};function Jv(n,e){const t=n.multiple,i=ze(e);if(!(t&&!i&&!Na(e))){for(let s=0,r=n.options.length;sString(c)===String(a)):o.selected=v0(e,a)>-1}else o.selected=e.has(a);else if(bo(va(o),e)){n.selectedIndex!==s&&(n.selectedIndex=s);return}}!t&&n.selectedIndex!==-1&&(n.selectedIndex=-1)}}function va(n){return"_value"in n?n._value:n.value}function s1(n,e){const t=e?"_trueValue":"_falseValue";return t in n?n[t]:e}const pG={created(n,e,t){lu(n,e,t,null,"created")},mounted(n,e,t){lu(n,e,t,null,"mounted")},beforeUpdate(n,e,t,i){lu(n,e,t,i,"beforeUpdate")},updated(n,e,t,i){lu(n,e,t,i,"updated")}};function PR(n,e){switch(n){case"SELECT":return RR;case"TEXTAREA":return Kv;default:switch(e){case"checkbox":return AR;case"radio":return CR;default:return Kv}}}function lu(n,e,t,i,s){const o=PR(n.tagName,t.props&&t.props.type)[s];o&&o(n,e,t,i)}const IR=["ctrl","shift","alt","meta"],LR={stop:n=>n.stopPropagation(),prevent:n=>n.preventDefault(),self:n=>n.target!==n.currentTarget,ctrl:n=>!n.ctrlKey,shift:n=>!n.shiftKey,alt:n=>!n.altKey,meta:n=>!n.metaKey,left:n=>"button"in n&&n.button!==0,middle:n=>"button"in n&&n.button!==1,right:n=>"button"in n&&n.button!==2,exact:(n,e)=>IR.some(t=>n[`${t}Key`]&&!e.includes(t))},mG=(n,e)=>{const t=n._withMods||(n._withMods={}),i=e.join(".");return t[i]||(t[i]=(s,...r)=>{for(let o=0;o{const t=n._withKeys||(n._withKeys={}),i=e.join(".");return t[i]||(t[i]=s=>{if(!("key"in s))return;const r=zs(s.key);if(e.some(o=>o===r||DR[o]===r))return n(s)})},OR=nn({patchProp:ER},sR);let Qv;function r1(){return Qv||(Qv=XS(OR))}const _G=(...n)=>{r1().render(...n)},NR=(...n)=>{const e=r1().createApp(...n),{mount:t}=e;return e.mount=i=>{const s=FR(i);if(!s)return;const r=e._component;!Ke(r)&&!r.render&&!r.template&&(r.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const o=t(s,!1,UR(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),o},e};function UR(n){if(n instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&n instanceof MathMLElement)return"mathml"}function FR(n){return Ut(n)?document.querySelector(n):n}const o1=new Set,Zn=new WeakMap,ya=new WeakMap,Mo=new WeakMap,lg=new WeakMap,kR=new WeakMap,ba=new WeakMap,zf=new WeakMap,pl=new WeakSet;let vr,O0=0,N0=0;const As="__aa_tgt",ec="__aa_del",Vf="__aa_new",BR=n=>{const e=XR(n);e&&e.forEach(t=>$R(t))},zR=n=>{n.forEach(e=>{e.target===vr&&HR(),Zn.has(e.target)&&Co(e.target)})};function VR(n){const e=lg.get(n);e==null||e.disconnect();let t=Zn.get(n),i=0;const s=5;t||(t=xa(n),Zn.set(n,t));const{offsetWidth:r,offsetHeight:o}=vr,l=[t.top-s,r-(t.left+s+t.width),o-(t.top+s+t.height),t.left-s].map(u=>`${-1*Math.floor(u)}px`).join(" "),c=new IntersectionObserver(()=>{++i>1&&Co(n)},{root:vr,threshold:1,rootMargin:l});c.observe(n),lg.set(n,c)}function Co(n){clearTimeout(zf.get(n));const e=ih(n),t=tc(e)?500:e.duration;zf.set(n,setTimeout(async()=>{const i=Mo.get(n);try{await(i==null?void 0:i.finished),Zn.set(n,xa(n)),VR(n)}catch{}},t))}function HR(){clearTimeout(zf.get(vr)),zf.set(vr,setTimeout(()=>{o1.forEach(n=>u1(n,e=>a1(()=>Co(e))))},100))}function GR(n){setTimeout(()=>{kR.set(n,setInterval(()=>a1(Co.bind(null,n)),2e3))},Math.round(2e3*Math.random()))}function a1(n){typeof requestIdleCallback=="function"?requestIdleCallback(()=>n()):requestAnimationFrame(()=>n())}let cg,oa;const WR=typeof window<"u"&&"ResizeObserver"in window;WR&&(vr=document.documentElement,cg=new MutationObserver(BR),oa=new ResizeObserver(zR),window.addEventListener("scroll",()=>{N0=window.scrollY,O0=window.scrollX}),oa.observe(vr));function XR(n){return n.reduce((i,s)=>[...i,...Array.from(s.addedNodes),...Array.from(s.removedNodes)],[]).every(i=>i.nodeName==="#comment")?!1:n.reduce((i,s)=>{if(i===!1)return!1;if(s.target instanceof Element){if(xp(s.target),!i.has(s.target)){i.add(s.target);for(let r=0;rt(n,ba.has(n)));for(let t=0;ts(i,ba.has(i)))}}function F0(n){return Array.isArray(n)?n:[n]}function tc(n){return typeof n=="function"}function YR(n){const e=Zn.get(n),t=xa(n);if(!U0(n))return Zn.set(n,t);let i;if(!e)return;const s=ih(n);if(typeof s!="function"){const r=e.left-t.left,o=e.top-t.top,[a,l,c,u]=l1(n,e,t),f={transform:`translate(${r}px, ${o}px)`},d={transform:"translate(0, 0)"};a!==l&&(f.width=`${a}px`,d.width=`${l}px`),c!==u&&(f.height=`${c}px`,d.height=`${u}px`),i=n.animate([f,d],{duration:s.duration,easing:s.easing})}else{const[r]=F0(s(n,"remain",e,t));i=new Animation(r),i.play()}Mo.set(n,i),Zn.set(n,t),i.addEventListener("finish",Co.bind(null,n))}function ey(n){Vf in n&&delete n[Vf];const e=xa(n);Zn.set(n,e);const t=ih(n);if(!U0(n))return;let i;if(typeof t!="function")i=n.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:t.duration*1.5,easing:"ease-in"});else{const[s]=F0(t(n,"add",e));i=new Animation(s),i.play()}Mo.set(n,i),i.addEventListener("finish",Co.bind(null,n))}function ty(n,e){var t;n.remove(),Zn.delete(n),ya.delete(n),Mo.delete(n),(t=lg.get(n))===null||t===void 0||t.disconnect(),setTimeout(()=>{if(ec in n&&delete n[ec],Object.defineProperty(n,Vf,{value:!0,configurable:!0}),e&&n instanceof HTMLElement)for(const i in e)n.style[i]=""},0)}function jR(n){var e;if(!ya.has(n)||!Zn.has(n))return;const[t,i]=ya.get(n);Object.defineProperty(n,ec,{value:!0,configurable:!0});const s=window.scrollX,r=window.scrollY;if(i&&i.parentNode&&i.parentNode instanceof Element?i.parentNode.insertBefore(n,i):t&&t.parentNode?t.parentNode.appendChild(n):(e=c1(n))===null||e===void 0||e.appendChild(n),!U0(n))return ty(n);const[o,a,l,c]=ZR(n),u=ih(n),f=Zn.get(n);(s!==O0||r!==N0)&&KR(n,s,r,u);let d,h={position:"absolute",top:`${o}px`,left:`${a}px`,width:`${l}px`,height:`${c}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!tc(u))Object.assign(n.style,h),d=n.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:u.duration,easing:"ease-out"});else{const[p,_]=F0(u(n,"remove",f));(_==null?void 0:_.styleReset)!==!1&&(h=(_==null?void 0:_.styleReset)||h,Object.assign(n.style,h)),d=new Animation(p),d.play()}Mo.set(n,d),d.addEventListener("finish",ty.bind(null,n,h))}function KR(n,e,t,i){const s=O0-e,r=N0-t,o=document.documentElement.style.scrollBehavior;if(getComputedStyle(vr).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+s,window.scrollY+r),!n.parentElement)return;const l=n.parentElement;let c=l.clientHeight,u=l.clientWidth;const f=performance.now();function d(){requestAnimationFrame(()=>{if(!tc(i)){const h=c-l.clientHeight,p=u-l.clientWidth;f+i.duration>performance.now()?(window.scrollTo({left:window.scrollX-p,top:window.scrollY-h}),c=l.clientHeight,u=l.clientWidth,d()):document.documentElement.style.scrollBehavior=o}})}d()}function ZR(n){const e=Zn.get(n),[t,,i]=l1(n,e,xa(n));let s=n.parentElement;for(;s&&(getComputedStyle(s).position==="static"||s instanceof HTMLBodyElement);)s=s.parentElement;s||(s=document.body);const r=getComputedStyle(s),o=Zn.get(s)||xa(s),a=Math.round(e.top-o.top)-ji(r.borderTopWidth),l=Math.round(e.left-o.left)-ji(r.borderLeftWidth);return[a,l,t,i]}function JR(n,e={}){return cg&&oa&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!tc(e)&&!e.disrespectUserMotionPreference||(pl.add(n),getComputedStyle(n).position==="static"&&Object.assign(n.style,{position:"relative"}),u1(n,Co,GR,s=>oa==null?void 0:oa.observe(s)),tc(e)?ba.set(n,e):ba.set(n,{duration:250,easing:"ease-in-out",...e}),cg.observe(n,{childList:!0}),o1.add(n))),Object.freeze({parent:n,enable:()=>{pl.add(n)},disable:()=>{pl.delete(n)},isEnabled:()=>pl.has(n)})}const QR={mounted:(n,e)=>{JR(n,e.value||{})},getSSRProps:()=>({})},e3=QR,t3={install(n){n.directive("auto-animate",e3)}};/** + * @license + * Copyright 2010-2025 Three.js Authors + * SPDX-License-Identifier: MIT + */const Oc="176",n3={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},i3={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},f1=0,ug=1,d1=2,s3=3,r3=0,k0=1,B0=2,Ki=3,Us=0,Vn=1,Ii=2,Ls=0,go=1,fg=2,dg=3,hg=4,h1=5,ur=100,p1=101,m1=102,g1=103,_1=104,v1=200,y1=201,b1=202,x1=203,Hf=204,Gf=205,M1=206,S1=207,E1=208,T1=209,w1=210,A1=211,C1=212,R1=213,P1=214,Wf=0,Xf=1,$f=2,So=3,qf=4,Yf=5,jf=6,Kf=7,Nc=0,I1=1,L1=2,ts=0,D1=1,O1=2,N1=3,sh=4,U1=5,F1=6,k1=7,pg="attached",B1="detached",rh=300,Fs=301,yr=302,nc=303,ic=304,Fa=306,sc=1e3,gi=1001,rc=1002,gn=1003,z0=1004,o3=1004,aa=1005,a3=1005,en=1006,El=1007,l3=1007,Qi=1008,c3=1008,Bi=1009,V0=1010,H0=1011,Ma=1012,oh=1013,ks=1014,Kn=1015,ka=1016,ah=1017,lh=1018,Sa=1020,G0=35902,W0=1021,X0=1022,zn=1023,Ea=1026,Ta=1027,ch=1028,Uc=1029,$0=1030,uh=1031,u3=1032,fh=1033,Tl=33776,wl=33777,Al=33778,Cl=33779,Zf=35840,Jf=35841,Qf=35842,ed=35843,td=36196,nd=37492,id=37496,sd=37808,rd=37809,od=37810,ad=37811,ld=37812,cd=37813,ud=37814,fd=37815,dd=37816,hd=37817,pd=37818,md=37819,gd=37820,_d=37821,Rl=36492,vd=36494,yd=36495,q0=36283,bd=36284,xd=36285,Md=36286,z1=2200,V1=2201,H1=2202,oc=2300,Sd=2301,xf=2302,co=2400,uo=2401,ac=2402,dh=2500,Y0=2501,f3=0,d3=1,h3=2,G1=3200,W1=3201,p3=3202,m3=3203,Ar=0,X1=1,Ts="",Un="srgb",Eo="srgb-linear",lc="linear",wt="srgb",g3=0,no=7680,_3=7681,v3=7682,y3=7683,b3=34055,x3=34056,M3=5386,S3=512,E3=513,T3=514,w3=515,A3=516,C3=517,R3=518,mg=519,$1=512,q1=513,Y1=514,j0=515,j1=516,K1=517,Z1=518,J1=519,cc=35044,P3=35048,I3=35040,L3=35045,D3=35049,O3=35041,N3=35046,U3=35050,F3=35042,k3="100",gg="300 es",_i=2e3,uc=2001,B3={COMPUTE:"compute",RENDER:"render"},z3={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},V3={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FLAT_FIRST:"flat first",FLAT_EITHER:"flat either"};class as{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners;if(i===void 0)return;const s=i[e];if(s!==void 0){const r=s.indexOf(t);r!==-1&&s.splice(r,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const i=t[e.type];if(i!==void 0){e.target=this;const s=i.slice(0);for(let r=0,o=s.length;r>8&255]+bn[n>>16&255]+bn[n>>24&255]+"-"+bn[e&255]+bn[e>>8&255]+"-"+bn[e>>16&15|64]+bn[e>>24&255]+"-"+bn[t&63|128]+bn[t>>8&255]+"-"+bn[t>>16&255]+bn[t>>24&255]+bn[i&255]+bn[i>>8&255]+bn[i>>16&255]+bn[i>>24&255]).toLowerCase()}function tt(n,e,t){return Math.max(e,Math.min(t,n))}function K0(n,e){return(n%e+e)%e}function H3(n,e,t,i,s){return i+(n-e)*(s-i)/(t-e)}function G3(n,e,t){return n!==e?(t-n)/(e-n):0}function Pl(n,e,t){return(1-t)*n+t*e}function W3(n,e,t,i){return Pl(n,e,1-Math.exp(-t*i))}function X3(n,e=1){return e-Math.abs(K0(n,e*2)-e)}function $3(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function q3(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function Y3(n,e){return n+Math.floor(Math.random()*(e-n+1))}function j3(n,e){return n+Math.random()*(e-n)}function K3(n){return n*(.5-Math.random())}function Z3(n){n!==void 0&&(ny=n);let e=ny+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function J3(n){return n*_o}function Q3(n){return n*wa}function eP(n){return(n&n-1)===0&&n!==0}function tP(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function nP(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function iP(n,e,t,i,s){const r=Math.cos,o=Math.sin,a=r(t/2),l=o(t/2),c=r((e+i)/2),u=o((e+i)/2),f=r((e-i)/2),d=o((e-i)/2),h=r((i-e)/2),p=o((i-e)/2);switch(s){case"XYX":n.set(a*u,l*f,l*d,a*c);break;case"YZY":n.set(l*d,a*u,l*f,a*c);break;case"ZXZ":n.set(l*f,l*d,a*u,a*c);break;case"XZX":n.set(a*u,l*p,l*h,a*c);break;case"YXY":n.set(l*h,a*u,l*p,a*c);break;case"ZYZ":n.set(l*p,l*h,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function Bn(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function rt(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const Z0={DEG2RAD:_o,RAD2DEG:wa,generateUUID:ri,clamp:tt,euclideanModulo:K0,mapLinear:H3,inverseLerp:G3,lerp:Pl,damp:W3,pingpong:X3,smoothstep:$3,smootherstep:q3,randInt:Y3,randFloat:j3,randFloatSpread:K3,seededRandom:Z3,degToRad:J3,radToDeg:Q3,isPowerOfTwo:eP,ceilPowerOfTwo:tP,floorPowerOfTwo:nP,setQuaternionFromProperEuler:iP,normalize:rt,denormalize:Bn};class de{constructor(e=0,t=0){de.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6],this.y=s[1]*t+s[4]*i+s[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=tt(this.x,e.x,t.x),this.y=tt(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=tt(this.x,e,t),this.y=tt(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(tt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(tt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),s=Math.sin(t),r=this.x-e.x,o=this.y-e.y;return this.x=r*i-o*s+e.x,this.y=r*s+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class st{constructor(e,t,i,s,r,o,a,l,c){st.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,s,r,o,a,l,c)}set(e,t,i,s,r,o,a,l,c){const u=this.elements;return u[0]=e,u[1]=s,u[2]=a,u[3]=t,u[4]=r,u[5]=l,u[6]=i,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,s=t.elements,r=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],u=i[4],f=i[7],d=i[2],h=i[5],p=i[8],_=s[0],g=s[3],m=s[6],y=s[1],b=s[4],v=s[7],E=s[2],T=s[5],S=s[8];return r[0]=o*_+a*y+l*E,r[3]=o*g+a*b+l*T,r[6]=o*m+a*v+l*S,r[1]=c*_+u*y+f*E,r[4]=c*g+u*b+f*T,r[7]=c*m+u*v+f*S,r[2]=d*_+h*y+p*E,r[5]=d*g+h*b+p*T,r[8]=d*m+h*v+p*S,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-i*r*u+i*a*l+s*r*c-s*o*l}invert(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=u*o-a*c,d=a*l-u*r,h=c*r-o*l,p=t*f+i*d+s*h;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/p;return e[0]=f*_,e[1]=(s*c-u*i)*_,e[2]=(a*i-s*o)*_,e[3]=d*_,e[4]=(u*t-s*l)*_,e[5]=(s*r-a*t)*_,e[6]=h*_,e[7]=(i*l-c*t)*_,e[8]=(o*t-i*r)*_,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,s,r,o,a){const l=Math.cos(r),c=Math.sin(r);return this.set(i*l,i*c,-i*(l*o+c*a)+o+e,-s*c,s*l,-s*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(Mp.makeScale(e,t)),this}rotate(e){return this.premultiply(Mp.makeRotation(-e)),this}translate(e,t){return this.premultiply(Mp.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let s=0;s<9;s++)if(t[s]!==i[s])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Mp=new st;function Q1(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const sP={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function la(n,e){return new sP[n](e)}function fc(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function eE(){const n=fc("canvas");return n.style.display="block",n}const iy={};function Mf(n){n in iy||(iy[n]=!0,console.warn(n))}function rP(n,e,t){return new Promise(function(i,s){function r(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:s();break;case n.TIMEOUT_EXPIRED:setTimeout(r,t);break;default:i()}}setTimeout(r,t)})}function oP(n){const e=n.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function aP(n){const e=n.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const sy=new st().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),ry=new st().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function lP(){const n={enabled:!0,workingColorSpace:Eo,spaces:{},convert:function(s,r,o){return this.enabled===!1||r===o||!r||!o||(this.spaces[r].transfer===wt&&(s.r=Ds(s.r),s.g=Ds(s.g),s.b=Ds(s.b)),this.spaces[r].primaries!==this.spaces[o].primaries&&(s.applyMatrix3(this.spaces[r].toXYZ),s.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===wt&&(s.r=ma(s.r),s.g=ma(s.g),s.b=ma(s.b))),s},fromWorkingColorSpace:function(s,r){return this.convert(s,this.workingColorSpace,r)},toWorkingColorSpace:function(s,r){return this.convert(s,r,this.workingColorSpace)},getPrimaries:function(s){return this.spaces[s].primaries},getTransfer:function(s){return s===Ts?lc:this.spaces[s].transfer},getLuminanceCoefficients:function(s,r=this.workingColorSpace){return s.fromArray(this.spaces[r].luminanceCoefficients)},define:function(s){Object.assign(this.spaces,s)},_getMatrix:function(s,r,o){return s.copy(this.spaces[r].toXYZ).multiply(this.spaces[o].fromXYZ)},_getDrawingBufferColorSpace:function(s){return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(s=this.workingColorSpace){return this.spaces[s].workingColorSpaceConfig.unpackColorSpace}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],i=[.3127,.329];return n.define({[Eo]:{primaries:e,whitePoint:i,transfer:lc,toXYZ:sy,fromXYZ:ry,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Un},outputColorSpaceConfig:{drawingBufferColorSpace:Un}},[Un]:{primaries:e,whitePoint:i,transfer:wt,toXYZ:sy,fromXYZ:ry,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Un}}}),n}const ft=lP();function Ds(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function ma(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let ko;class tE{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{ko===void 0&&(ko=fc("canvas")),ko.width=e.width,ko.height=e.height;const s=ko.getContext("2d");e instanceof ImageData?s.putImageData(e,0,0):s.drawImage(e,0,0,e.width,e.height),i=ko}return i.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=fc("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const s=i.getImageData(0,0,e.width,e.height),r=s.data;for(let o=0;o0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==rh)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case sc:e.x=e.x-Math.floor(e.x);break;case gi:e.x=e.x<0?0:1;break;case rc:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case sc:e.y=e.y-Math.floor(e.y);break;case gi:e.y=e.y<0?0:1;break;case rc:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Wt.DEFAULT_IMAGE=null;Wt.DEFAULT_MAPPING=rh;Wt.DEFAULT_ANISOTROPY=1;class gt{constructor(e=0,t=0,i=0,s=1){gt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=s}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,s){return this.x=e,this.y=t,this.z=i,this.w=s,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,s=this.z,r=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*s+o[12]*r,this.y=o[1]*t+o[5]*i+o[9]*s+o[13]*r,this.z=o[2]*t+o[6]*i+o[10]*s+o[14]*r,this.w=o[3]*t+o[7]*i+o[11]*s+o[15]*r,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,s,r;const l=e.elements,c=l[0],u=l[4],f=l[8],d=l[1],h=l[5],p=l[9],_=l[2],g=l[6],m=l[10];if(Math.abs(u-d)<.01&&Math.abs(f-_)<.01&&Math.abs(p-g)<.01){if(Math.abs(u+d)<.1&&Math.abs(f+_)<.1&&Math.abs(p+g)<.1&&Math.abs(c+h+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const b=(c+1)/2,v=(h+1)/2,E=(m+1)/2,T=(u+d)/4,S=(f+_)/4,P=(p+g)/4;return b>v&&b>E?b<.01?(i=0,s=.707106781,r=.707106781):(i=Math.sqrt(b),s=T/i,r=S/i):v>E?v<.01?(i=.707106781,s=0,r=.707106781):(s=Math.sqrt(v),i=T/s,r=P/s):E<.01?(i=.707106781,s=.707106781,r=0):(r=Math.sqrt(E),i=S/r,s=P/r),this.set(i,s,r,t),this}let y=Math.sqrt((g-p)*(g-p)+(f-_)*(f-_)+(d-u)*(d-u));return Math.abs(y)<.001&&(y=1),this.x=(g-p)/y,this.y=(f-_)/y,this.z=(d-u)/y,this.w=Math.acos((c+h+m-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=tt(this.x,e.x,t.x),this.y=tt(this.y,e.y,t.y),this.z=tt(this.z,e.z,t.z),this.w=tt(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=tt(this.x,e,t),this.y=tt(this.y,e,t),this.z=tt(this.z,e,t),this.w=tt(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(tt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class hh extends as{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=i.depth?i.depth:1,this.scissor=new gt(0,0,e,t),this.scissorTest=!1,this.viewport=new gt(0,0,e,t);const s={width:e,height:t,depth:this.depth};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:en,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,multiview:!1},i);const r=new Wt(s,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);r.flipY=!1,r.generateMipmaps=i.generateMipmaps,r.internalFormat=i.internalFormat,this.textures=[];const o=i.count;for(let a=0;a=0?1:-1,b=1-m*m;if(b>Number.EPSILON){const E=Math.sqrt(b),T=Math.atan2(E,m*y);g=Math.sin(g*T)/E,a=Math.sin(a*T)/E}const v=a*y;if(l=l*g+d*v,c=c*g+h*v,u=u*g+p*v,f=f*g+_*v,g===1-a){const E=1/Math.sqrt(l*l+c*c+u*u+f*f);l*=E,c*=E,u*=E,f*=E}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=f}static multiplyQuaternionsFlat(e,t,i,s,r,o){const a=i[s],l=i[s+1],c=i[s+2],u=i[s+3],f=r[o],d=r[o+1],h=r[o+2],p=r[o+3];return e[t]=a*p+u*f+l*h-c*d,e[t+1]=l*p+u*d+c*f-a*h,e[t+2]=c*p+u*h+a*d-l*f,e[t+3]=u*p-a*f-l*d-c*h,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,s){return this._x=e,this._y=t,this._z=i,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,s=e._y,r=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(i/2),u=a(s/2),f=a(r/2),d=l(i/2),h=l(s/2),p=l(r/2);switch(o){case"XYZ":this._x=d*u*f+c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f-d*h*p;break;case"YXZ":this._x=d*u*f+c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f+d*h*p;break;case"ZXY":this._x=d*u*f-c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f-d*h*p;break;case"ZYX":this._x=d*u*f-c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f+d*h*p;break;case"YZX":this._x=d*u*f+c*h*p,this._y=c*h*f+d*u*p,this._z=c*u*p-d*h*f,this._w=c*u*f-d*h*p;break;case"XZY":this._x=d*u*f-c*h*p,this._y=c*h*f-d*u*p,this._z=c*u*p+d*h*f,this._w=c*u*f+d*h*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,s=Math.sin(i);return this._x=e.x*s,this._y=e.y*s,this._z=e.z*s,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],s=t[4],r=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],f=t[10],d=i+a+f;if(d>0){const h=.5/Math.sqrt(d+1);this._w=.25/h,this._x=(u-l)*h,this._y=(r-c)*h,this._z=(o-s)*h}else if(i>a&&i>f){const h=2*Math.sqrt(1+i-a-f);this._w=(u-l)/h,this._x=.25*h,this._y=(s+o)/h,this._z=(r+c)/h}else if(a>f){const h=2*Math.sqrt(1+a-i-f);this._w=(r-c)/h,this._x=(s+o)/h,this._y=.25*h,this._z=(l+u)/h}else{const h=2*Math.sqrt(1+f-i-a);this._w=(o-s)/h,this._x=(r+c)/h,this._y=(l+u)/h,this._z=.25*h}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(tt(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const s=Math.min(1,t/i);return this.slerp(e,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,s=e._y,r=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=i*u+o*a+s*c-r*l,this._y=s*u+o*l+r*a-i*c,this._z=r*u+o*c+i*l-s*a,this._w=o*u-i*a-s*l-r*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,s=this._y,r=this._z,o=this._w;let a=o*e._w+i*e._x+s*e._y+r*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=s,this._z=r,this;const l=1-a*a;if(l<=Number.EPSILON){const h=1-t;return this._w=h*o+t*this._w,this._x=h*i+t*this._x,this._y=h*s+t*this._y,this._z=h*r+t*this._z,this.normalize(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),f=Math.sin((1-t)*u)/c,d=Math.sin(t*u)/c;return this._w=o*f+this._w*d,this._x=i*f+this._x*d,this._y=s*f+this._y*d,this._z=r*f+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),s=Math.sqrt(1-i),r=Math.sqrt(i);return this.set(s*Math.sin(e),s*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class z{constructor(e=0,t=0,i=0){z.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(oy.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(oy.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*s,this.y=r[1]*t+r[4]*i+r[7]*s,this.z=r[2]*t+r[5]*i+r[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,s=this.z,r=e.elements,o=1/(r[3]*t+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*s+r[12])*o,this.y=(r[1]*t+r[5]*i+r[9]*s+r[13])*o,this.z=(r[2]*t+r[6]*i+r[10]*s+r[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,s=this.z,r=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*s-a*i),u=2*(a*t-r*s),f=2*(r*i-o*t);return this.x=t+l*c+o*f-a*u,this.y=i+l*u+a*c-r*f,this.z=s+l*f+r*u-o*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,s=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*s,this.y=r[1]*t+r[5]*i+r[9]*s,this.z=r[2]*t+r[6]*i+r[10]*s,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=tt(this.x,e.x,t.x),this.y=tt(this.y,e.y,t.y),this.z=tt(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=tt(this.x,e,t),this.y=tt(this.y,e,t),this.z=tt(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(tt(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,s=e.y,r=e.z,o=t.x,a=t.y,l=t.z;return this.x=s*l-r*a,this.y=r*o-i*l,this.z=i*a-s*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Ep.copy(this).projectOnVector(e),this.sub(Ep)}reflect(e){return this.sub(Ep.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(tt(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,s=this.z-e.z;return t*t+i*i+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const s=Math.sin(t)*e;return this.x=s*Math.sin(i),this.y=Math.cos(t)*e,this.z=s*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=s,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Ep=new z,oy=new Jn;class wn{constructor(e=new z(1/0,1/0,1/0),t=new z(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Ai),Ai.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Ka),uu.subVectors(this.max,Ka),Bo.subVectors(e.a,Ka),zo.subVectors(e.b,Ka),Vo.subVectors(e.c,Ka),Ys.subVectors(zo,Bo),js.subVectors(Vo,zo),zr.subVectors(Bo,Vo);let t=[0,-Ys.z,Ys.y,0,-js.z,js.y,0,-zr.z,zr.y,Ys.z,0,-Ys.x,js.z,0,-js.x,zr.z,0,-zr.x,-Ys.y,Ys.x,0,-js.y,js.x,0,-zr.y,zr.x,0];return!Tp(t,Bo,zo,Vo,uu)||(t=[1,0,0,0,1,0,0,0,1],!Tp(t,Bo,zo,Vo,uu))?!1:(fu.crossVectors(Ys,js),t=[fu.x,fu.y,fu.z],Tp(t,Bo,zo,Vo,uu))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ai).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Ai).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(ds[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ds[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ds[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ds[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ds[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ds[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ds[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ds[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ds),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const ds=[new z,new z,new z,new z,new z,new z,new z,new z],Ai=new z,cu=new wn,Bo=new z,zo=new z,Vo=new z,Ys=new z,js=new z,zr=new z,Ka=new z,uu=new z,fu=new z,Vr=new z;function Tp(n,e,t,i,s){for(let r=0,o=n.length-3;r<=o;r+=3){Vr.fromArray(n,r);const a=s.x*Math.abs(Vr.x)+s.y*Math.abs(Vr.y)+s.z*Math.abs(Vr.z),l=e.dot(Vr),c=t.dot(Vr),u=i.dot(Vr);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const hP=new wn,Za=new z,wp=new z;class _n{constructor(e=new z,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):hP.setFromPoints(e).getCenter(i);let s=0;for(let r=0,o=e.length;rthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Za.subVectors(e,this.center);const t=Za.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),s=(i-this.radius)*.5;this.center.addScaledVector(Za,s/i),this.radius+=s}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(wp.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Za.copy(e.center).add(wp)),this.expandByPoint(Za.copy(e.center).sub(wp))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const hs=new z,Ap=new z,du=new z,Ks=new z,Cp=new z,hu=new z,Rp=new z;class Ba{constructor(e=new z,t=new z(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,hs)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=hs.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(hs.copy(this.origin).addScaledVector(this.direction,t),hs.distanceToSquared(e))}distanceSqToSegment(e,t,i,s){Ap.copy(e).add(t).multiplyScalar(.5),du.copy(t).sub(e).normalize(),Ks.copy(this.origin).sub(Ap);const r=e.distanceTo(t)*.5,o=-this.direction.dot(du),a=Ks.dot(this.direction),l=-Ks.dot(du),c=Ks.lengthSq(),u=Math.abs(1-o*o);let f,d,h,p;if(u>0)if(f=o*l-a,d=o*a-l,p=r*u,f>=0)if(d>=-p)if(d<=p){const _=1/u;f*=_,d*=_,h=f*(f+o*d+2*a)+d*(o*f+d+2*l)+c}else d=r,f=Math.max(0,-(o*d+a)),h=-f*f+d*(d+2*l)+c;else d=-r,f=Math.max(0,-(o*d+a)),h=-f*f+d*(d+2*l)+c;else d<=-p?(f=Math.max(0,-(-o*r+a)),d=f>0?-r:Math.min(Math.max(-r,-l),r),h=-f*f+d*(d+2*l)+c):d<=p?(f=0,d=Math.min(Math.max(-r,-l),r),h=d*(d+2*l)+c):(f=Math.max(0,-(o*r+a)),d=f>0?r:Math.min(Math.max(-r,-l),r),h=-f*f+d*(d+2*l)+c);else d=o>0?-r:r,f=Math.max(0,-(o*d+a)),h=-f*f+d*(d+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,f),s&&s.copy(Ap).addScaledVector(du,d),h}intersectSphere(e,t){hs.subVectors(e.center,this.origin);const i=hs.dot(this.direction),s=hs.dot(hs)-i*i,r=e.radius*e.radius;if(s>r)return null;const o=Math.sqrt(r-s),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,s,r,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,f=1/this.direction.z,d=this.origin;return c>=0?(i=(e.min.x-d.x)*c,s=(e.max.x-d.x)*c):(i=(e.max.x-d.x)*c,s=(e.min.x-d.x)*c),u>=0?(r=(e.min.y-d.y)*u,o=(e.max.y-d.y)*u):(r=(e.max.y-d.y)*u,o=(e.min.y-d.y)*u),i>o||r>s||((r>i||isNaN(i))&&(i=r),(o=0?(a=(e.min.z-d.z)*f,l=(e.max.z-d.z)*f):(a=(e.max.z-d.z)*f,l=(e.min.z-d.z)*f),i>l||a>s)||((a>i||i!==i)&&(i=a),(l=0?i:s,t)}intersectsBox(e){return this.intersectBox(e,hs)!==null}intersectTriangle(e,t,i,s,r){Cp.subVectors(t,e),hu.subVectors(i,e),Rp.crossVectors(Cp,hu);let o=this.direction.dot(Rp),a;if(o>0){if(s)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Ks.subVectors(this.origin,e);const l=a*this.direction.dot(hu.crossVectors(Ks,hu));if(l<0)return null;const c=a*this.direction.dot(Cp.cross(Ks));if(c<0||l+c>o)return null;const u=-a*Ks.dot(Rp);return u<0?null:this.at(u/o,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class qe{constructor(e,t,i,s,r,o,a,l,c,u,f,d,h,p,_,g){qe.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,s,r,o,a,l,c,u,f,d,h,p,_,g)}set(e,t,i,s,r,o,a,l,c,u,f,d,h,p,_,g){const m=this.elements;return m[0]=e,m[4]=t,m[8]=i,m[12]=s,m[1]=r,m[5]=o,m[9]=a,m[13]=l,m[2]=c,m[6]=u,m[10]=f,m[14]=d,m[3]=h,m[7]=p,m[11]=_,m[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new qe().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,s=1/Ho.setFromMatrixColumn(e,0).length(),r=1/Ho.setFromMatrixColumn(e,1).length(),o=1/Ho.setFromMatrixColumn(e,2).length();return t[0]=i[0]*s,t[1]=i[1]*s,t[2]=i[2]*s,t[3]=0,t[4]=i[4]*r,t[5]=i[5]*r,t[6]=i[6]*r,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,s=e.y,r=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(s),c=Math.sin(s),u=Math.cos(r),f=Math.sin(r);if(e.order==="XYZ"){const d=o*u,h=o*f,p=a*u,_=a*f;t[0]=l*u,t[4]=-l*f,t[8]=c,t[1]=h+p*c,t[5]=d-_*c,t[9]=-a*l,t[2]=_-d*c,t[6]=p+h*c,t[10]=o*l}else if(e.order==="YXZ"){const d=l*u,h=l*f,p=c*u,_=c*f;t[0]=d+_*a,t[4]=p*a-h,t[8]=o*c,t[1]=o*f,t[5]=o*u,t[9]=-a,t[2]=h*a-p,t[6]=_+d*a,t[10]=o*l}else if(e.order==="ZXY"){const d=l*u,h=l*f,p=c*u,_=c*f;t[0]=d-_*a,t[4]=-o*f,t[8]=p+h*a,t[1]=h+p*a,t[5]=o*u,t[9]=_-d*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const d=o*u,h=o*f,p=a*u,_=a*f;t[0]=l*u,t[4]=p*c-h,t[8]=d*c+_,t[1]=l*f,t[5]=_*c+d,t[9]=h*c-p,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const d=o*l,h=o*c,p=a*l,_=a*c;t[0]=l*u,t[4]=_-d*f,t[8]=p*f+h,t[1]=f,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=h*f+p,t[10]=d-_*f}else if(e.order==="XZY"){const d=o*l,h=o*c,p=a*l,_=a*c;t[0]=l*u,t[4]=-f,t[8]=c*u,t[1]=d*f+_,t[5]=o*u,t[9]=h*f-p,t[2]=p*f-h,t[6]=a*u,t[10]=_*f+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(pP,e,mP)}lookAt(e,t,i){const s=this.elements;return ni.subVectors(e,t),ni.lengthSq()===0&&(ni.z=1),ni.normalize(),Zs.crossVectors(i,ni),Zs.lengthSq()===0&&(Math.abs(i.z)===1?ni.x+=1e-4:ni.z+=1e-4,ni.normalize(),Zs.crossVectors(i,ni)),Zs.normalize(),pu.crossVectors(ni,Zs),s[0]=Zs.x,s[4]=pu.x,s[8]=ni.x,s[1]=Zs.y,s[5]=pu.y,s[9]=ni.y,s[2]=Zs.z,s[6]=pu.z,s[10]=ni.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,s=t.elements,r=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],u=i[1],f=i[5],d=i[9],h=i[13],p=i[2],_=i[6],g=i[10],m=i[14],y=i[3],b=i[7],v=i[11],E=i[15],T=s[0],S=s[4],P=s[8],x=s[12],M=s[1],I=s[5],N=s[9],V=s[13],j=s[2],te=s[6],Z=s[10],ee=s[14],J=s[3],he=s[7],be=s[11],se=s[15];return r[0]=o*T+a*M+l*j+c*J,r[4]=o*S+a*I+l*te+c*he,r[8]=o*P+a*N+l*Z+c*be,r[12]=o*x+a*V+l*ee+c*se,r[1]=u*T+f*M+d*j+h*J,r[5]=u*S+f*I+d*te+h*he,r[9]=u*P+f*N+d*Z+h*be,r[13]=u*x+f*V+d*ee+h*se,r[2]=p*T+_*M+g*j+m*J,r[6]=p*S+_*I+g*te+m*he,r[10]=p*P+_*N+g*Z+m*be,r[14]=p*x+_*V+g*ee+m*se,r[3]=y*T+b*M+v*j+E*J,r[7]=y*S+b*I+v*te+E*he,r[11]=y*P+b*N+v*Z+E*be,r[15]=y*x+b*V+v*ee+E*se,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],s=e[8],r=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],f=e[6],d=e[10],h=e[14],p=e[3],_=e[7],g=e[11],m=e[15];return p*(+r*l*f-s*c*f-r*a*d+i*c*d+s*a*h-i*l*h)+_*(+t*l*h-t*c*d+r*o*d-s*o*h+s*c*u-r*l*u)+g*(+t*c*f-t*a*h-r*o*f+i*o*h+r*a*u-i*c*u)+m*(-s*a*u-t*l*f+t*a*d+s*o*f-i*o*d+i*l*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const s=this.elements;return e.isVector3?(s[12]=e.x,s[13]=e.y,s[14]=e.z):(s[12]=e,s[13]=t,s[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],s=e[2],r=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],f=e[9],d=e[10],h=e[11],p=e[12],_=e[13],g=e[14],m=e[15],y=f*g*c-_*d*c+_*l*h-a*g*h-f*l*m+a*d*m,b=p*d*c-u*g*c-p*l*h+o*g*h+u*l*m-o*d*m,v=u*_*c-p*f*c+p*a*h-o*_*h-u*a*m+o*f*m,E=p*f*l-u*_*l-p*a*d+o*_*d+u*a*g-o*f*g,T=t*y+i*b+s*v+r*E;if(T===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const S=1/T;return e[0]=y*S,e[1]=(_*d*r-f*g*r-_*s*h+i*g*h+f*s*m-i*d*m)*S,e[2]=(a*g*r-_*l*r+_*s*c-i*g*c-a*s*m+i*l*m)*S,e[3]=(f*l*r-a*d*r-f*s*c+i*d*c+a*s*h-i*l*h)*S,e[4]=b*S,e[5]=(u*g*r-p*d*r+p*s*h-t*g*h-u*s*m+t*d*m)*S,e[6]=(p*l*r-o*g*r-p*s*c+t*g*c+o*s*m-t*l*m)*S,e[7]=(o*d*r-u*l*r+u*s*c-t*d*c-o*s*h+t*l*h)*S,e[8]=v*S,e[9]=(p*f*r-u*_*r-p*i*h+t*_*h+u*i*m-t*f*m)*S,e[10]=(o*_*r-p*a*r+p*i*c-t*_*c-o*i*m+t*a*m)*S,e[11]=(u*a*r-o*f*r-u*i*c+t*f*c+o*i*h-t*a*h)*S,e[12]=E*S,e[13]=(u*_*s-p*f*s+p*i*d-t*_*d-u*i*g+t*f*g)*S,e[14]=(p*a*s-o*_*s-p*i*l+t*_*l+o*i*g-t*a*g)*S,e[15]=(o*f*s-u*a*s+u*i*l-t*f*l-o*i*d+t*a*d)*S,this}scale(e){const t=this.elements,i=e.x,s=e.y,r=e.z;return t[0]*=i,t[4]*=s,t[8]*=r,t[1]*=i,t[5]*=s,t[9]*=r,t[2]*=i,t[6]*=s,t[10]*=r,t[3]*=i,t[7]*=s,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],s=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,s))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),s=Math.sin(t),r=1-i,o=e.x,a=e.y,l=e.z,c=r*o,u=r*a;return this.set(c*o+i,c*a-s*l,c*l+s*a,0,c*a+s*l,u*a+i,u*l-s*o,0,c*l-s*a,u*l+s*o,r*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,s,r,o){return this.set(1,i,r,0,e,1,o,0,t,s,1,0,0,0,0,1),this}compose(e,t,i){const s=this.elements,r=t._x,o=t._y,a=t._z,l=t._w,c=r+r,u=o+o,f=a+a,d=r*c,h=r*u,p=r*f,_=o*u,g=o*f,m=a*f,y=l*c,b=l*u,v=l*f,E=i.x,T=i.y,S=i.z;return s[0]=(1-(_+m))*E,s[1]=(h+v)*E,s[2]=(p-b)*E,s[3]=0,s[4]=(h-v)*T,s[5]=(1-(d+m))*T,s[6]=(g+y)*T,s[7]=0,s[8]=(p+b)*S,s[9]=(g-y)*S,s[10]=(1-(d+_))*S,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,t,i){const s=this.elements;let r=Ho.set(s[0],s[1],s[2]).length();const o=Ho.set(s[4],s[5],s[6]).length(),a=Ho.set(s[8],s[9],s[10]).length();this.determinant()<0&&(r=-r),e.x=s[12],e.y=s[13],e.z=s[14],Ci.copy(this);const c=1/r,u=1/o,f=1/a;return Ci.elements[0]*=c,Ci.elements[1]*=c,Ci.elements[2]*=c,Ci.elements[4]*=u,Ci.elements[5]*=u,Ci.elements[6]*=u,Ci.elements[8]*=f,Ci.elements[9]*=f,Ci.elements[10]*=f,t.setFromRotationMatrix(Ci),i.x=r,i.y=o,i.z=a,this}makePerspective(e,t,i,s,r,o,a=_i){const l=this.elements,c=2*r/(t-e),u=2*r/(i-s),f=(t+e)/(t-e),d=(i+s)/(i-s);let h,p;if(a===_i)h=-(o+r)/(o-r),p=-2*o*r/(o-r);else if(a===uc)h=-o/(o-r),p=-o*r/(o-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=u,l[9]=d,l[13]=0,l[2]=0,l[6]=0,l[10]=h,l[14]=p,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,s,r,o,a=_i){const l=this.elements,c=1/(t-e),u=1/(i-s),f=1/(o-r),d=(t+e)*c,h=(i+s)*u;let p,_;if(a===_i)p=(o+r)*f,_=-2*f;else if(a===uc)p=r*f,_=-1*f;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-d,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-h,l[2]=0,l[6]=0,l[10]=_,l[14]=-p,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let s=0;s<16;s++)if(t[s]!==i[s])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const Ho=new z,Ci=new qe,pP=new z(0,0,0),mP=new z(1,1,1),Zs=new z,pu=new z,ni=new z,ay=new qe,ly=new Jn;class li{constructor(e=0,t=0,i=0,s=li.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=s}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,s=this._order){return this._x=e,this._y=t,this._z=i,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const s=e.elements,r=s[0],o=s[4],a=s[8],l=s[1],c=s[5],u=s[9],f=s[2],d=s[6],h=s[10];switch(t){case"XYZ":this._y=Math.asin(tt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,h),this._z=Math.atan2(-o,r)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-tt(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,r),this._z=0);break;case"ZXY":this._x=Math.asin(tt(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-f,h),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-tt(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(d,h),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(tt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-f,r)):(this._x=0,this._y=Math.atan2(a,h));break;case"XZY":this._z=Math.asin(-tt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-u,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return ay.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ay,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return ly.setFromEuler(this),this.setFromQuaternion(ly,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}li.DEFAULT_ORDER="XYZ";class mh{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.geometryInfo=this._geometryInfo.map(a=>({...a,boundingBox:a.boundingBox?{min:a.boundingBox.min.toArray(),max:a.boundingBox.max.toArray()}:void 0,boundingSphere:a.boundingSphere?{radius:a.boundingSphere.radius,center:a.boundingSphere.center.toArray()}:void 0})),s.instanceInfo=this._instanceInfo.map(a=>({...a})),s.availableInstanceIds=this._availableInstanceIds.slice(),s.availableGeometryIds=this._availableGeometryIds.slice(),s.nextIndexStart=this._nextIndexStart,s.nextVertexStart=this._nextVertexStart,s.geometryCount=this._geometryCount,s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.matricesTexture=this._matricesTexture.toJSON(e),s.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(s.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(s.boundingSphere={center:this.boundingSphere.center.toArray(),radius:this.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:this.boundingBox.min.toArray(),max:this.boundingBox.max.toArray()}));function r(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=r(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c0){s.children=[];for(let a=0;a0){s.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),u.length>0&&(i.images=u),f.length>0&&(i.shapes=f),d.length>0&&(i.skeletons=d),h.length>0&&(i.animations=h),p.length>0&&(i.nodes=p)}return i.object=s,i;function o(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?s.multiplyScalar(1/Math.sqrt(r)):s.set(0,0,0)}static getBarycoord(e,t,i,s,r){Ri.subVectors(s,t),ms.subVectors(i,t),Ip.subVectors(e,t);const o=Ri.dot(Ri),a=Ri.dot(ms),l=Ri.dot(Ip),c=ms.dot(ms),u=ms.dot(Ip),f=o*c-a*a;if(f===0)return r.set(0,0,0),null;const d=1/f,h=(c*l-a*u)*d,p=(o*u-a*l)*d;return r.set(1-h-p,p,h)}static containsPoint(e,t,i,s){return this.getBarycoord(e,t,i,s,gs)===null?!1:gs.x>=0&&gs.y>=0&&gs.x+gs.y<=1}static getInterpolation(e,t,i,s,r,o,a,l){return this.getBarycoord(e,t,i,s,gs)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(r,gs.x),l.addScaledVector(o,gs.y),l.addScaledVector(a,gs.z),l)}static getInterpolatedAttribute(e,t,i,s,r,o){return Np.setScalar(0),Up.setScalar(0),Fp.setScalar(0),Np.fromBufferAttribute(e,t),Up.fromBufferAttribute(e,i),Fp.fromBufferAttribute(e,s),o.setScalar(0),o.addScaledVector(Np,r.x),o.addScaledVector(Up,r.y),o.addScaledVector(Fp,r.z),o}static isFrontFacing(e,t,i,s){return Ri.subVectors(i,t),ms.subVectors(e,t),Ri.cross(ms).dot(s)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,s){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[s]),this}setFromAttributeAndIndices(e,t,i,s){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,s),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ri.subVectors(this.c,this.b),ms.subVectors(this.a,this.b),Ri.cross(ms).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return jn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return jn.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,s,r){return jn.getInterpolation(e,this.a,this.b,this.c,t,i,s,r)}containsPoint(e){return jn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return jn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,s=this.b,r=this.c;let o,a;Xo.subVectors(s,i),$o.subVectors(r,i),Lp.subVectors(e,i);const l=Xo.dot(Lp),c=$o.dot(Lp);if(l<=0&&c<=0)return t.copy(i);Dp.subVectors(e,s);const u=Xo.dot(Dp),f=$o.dot(Dp);if(u>=0&&f<=u)return t.copy(s);const d=l*f-u*c;if(d<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(i).addScaledVector(Xo,o);Op.subVectors(e,r);const h=Xo.dot(Op),p=$o.dot(Op);if(p>=0&&h<=p)return t.copy(r);const _=h*c-l*p;if(_<=0&&c>=0&&p<=0)return a=c/(c-p),t.copy(i).addScaledVector($o,a);const g=u*p-h*f;if(g<=0&&f-u>=0&&h-p>=0)return py.subVectors(r,s),a=(f-u)/(f-u+(h-p)),t.copy(s).addScaledVector(py,a);const m=1/(g+_+d);return o=_*m,a=d*m,t.copy(i).addScaledVector(Xo,o).addScaledVector($o,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const nE={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Js={h:0,s:0,l:0},gu={h:0,s:0,l:0};function kp(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class Ae{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const s=e;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Un){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,ft.toWorkingColorSpace(this,t),this}setRGB(e,t,i,s=ft.workingColorSpace){return this.r=e,this.g=t,this.b=i,ft.toWorkingColorSpace(this,s),this}setHSL(e,t,i,s=ft.workingColorSpace){if(e=K0(e,1),t=tt(t,0,1),i=tt(i,0,1),t===0)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+t):i+t-i*t,o=2*i-r;this.r=kp(o,r,e+1/3),this.g=kp(o,r,e),this.b=kp(o,r,e-1/3)}return ft.toWorkingColorSpace(this,s),this}setStyle(e,t=Un){function i(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const o=s[1],a=s[2];switch(o){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=s[1],o=r.length;if(o===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(r,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Un){const i=nE[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Ds(e.r),this.g=Ds(e.g),this.b=Ds(e.b),this}copyLinearToSRGB(e){return this.r=ma(e.r),this.g=ma(e.g),this.b=ma(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Un){return ft.fromWorkingColorSpace(xn.copy(this),e),Math.round(tt(xn.r*255,0,255))*65536+Math.round(tt(xn.g*255,0,255))*256+Math.round(tt(xn.b*255,0,255))}getHexString(e=Un){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=ft.workingColorSpace){ft.fromWorkingColorSpace(xn.copy(this),t);const i=xn.r,s=xn.g,r=xn.b,o=Math.max(i,s,r),a=Math.min(i,s,r);let l,c;const u=(a+o)/2;if(a===o)l=0,c=0;else{const f=o-a;switch(c=u<=.5?f/(o+a):f/(2-o-a),o){case i:l=(s-r)/f+(s0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const s=this[t];if(s===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(i):s&&s.isVector3&&i&&i.isVector3?s.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==go&&(i.blending=this.blending),this.side!==Us&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==Hf&&(i.blendSrc=this.blendSrc),this.blendDst!==Gf&&(i.blendDst=this.blendDst),this.blendEquation!==ur&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==So&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==mg&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==no&&(i.stencilFail=this.stencilFail),this.stencilZFail!==no&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==no&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function s(r){const o=[];for(const a in r){const l=r[a];delete l.metadata,o.push(l)}return o}if(t){const r=s(e.textures),o=s(e.images);r.length>0&&(i.textures=r),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const s=t.length;i=new Array(s);for(let r=0;r!==s;++r)i[r]=t[r].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class Hs extends Cn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ae(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new li,this.combine=Nc,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const ws=xP();function xP(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),s=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,s[l]=24,s[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,s[l]=-c-1,s[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,s[l]=13,s[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,s[l]=24,s[l|256]=24):(i[l]=31744,i[l|256]=64512,s[l]=13,s[l|256]=13)}const r=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,u=0;for(;(c&8388608)===0;)c<<=1,u-=8388608;c&=-8388609,u+=947912704,r[l]=c|u}for(let l=1024;l<2048;++l)r[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:s,mantissaTable:r,exponentTable:o,offsetTable:a}}function $n(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=tt(n,-65504,65504),ws.floatView[0]=n;const e=ws.uint32View[0],t=e>>23&511;return ws.baseTable[t]+((e&8388607)>>ws.shiftTable[t])}function ml(n){const e=n>>10;return ws.uint32View[0]=ws.mantissaTable[ws.offsetTable[e]+(n&1023)]+ws.exponentTable[e],ws.floatView[0]}class MP{static toHalfFloat(e){return $n(e)}static fromHalfFloat(e){return ml(e)}}const Yt=new z,_u=new de;let SP=0;class Ct{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:SP++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=cc,this.updateRanges=[],this.gpuType=Kn,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let s=0,r=this.itemSize;st.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new wn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new z(-1/0,-1/0,-1/0),new z(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,s=t.length;i0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const s={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let f=0,d=c.length;f0&&(s[l]=u,r=!0)}r&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone());const s=e.attributes;for(const c in s){const u=s[c];this.setAttribute(c,u.clone(t))}const r=e.morphAttributes;for(const c in r){const u=[],f=r[c];for(let d=0,h=f.length;d0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;r(e.far-e.near)**2))&&(my.copy(r).invert(),Hr.copy(e.ray).applyMatrix4(my),!(i.boundingBox!==null&&Hr.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Hr)))}_computeIntersections(e,t,i){let s;const r=this.geometry,o=this.material,a=r.index,l=r.attributes.position,c=r.attributes.uv,u=r.attributes.uv1,f=r.attributes.normal,d=r.groups,h=r.drawRange;if(a!==null)if(Array.isArray(o))for(let p=0,_=d.length;p<_;p++){const g=d[p],m=o[g.materialIndex],y=Math.max(g.start,h.start),b=Math.min(a.count,Math.min(g.start+g.count,h.start+h.count));for(let v=y,E=b;vt.far?null:{distance:c,point:Su.clone(),object:n}}function Eu(n,e,t,i,s,r,o,a,l,c){n.getVertexPosition(a,yu),n.getVertexPosition(l,bu),n.getVertexPosition(c,xu);const u=IP(n,e,t,i,yu,bu,xu,_y);if(u){const f=new z;jn.getBarycoord(_y,yu,bu,xu,f),s&&(u.uv=jn.getInterpolatedAttribute(s,a,l,c,f,new de)),r&&(u.uv1=jn.getInterpolatedAttribute(r,a,l,c,f,new de)),o&&(u.normal=jn.getInterpolatedAttribute(o,a,l,c,f,new z),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));const d={a,b:l,c,normal:new z,materialIndex:0};jn.getNormal(yu,bu,xu,d.normal),u.face=d,u.barycoord=f}return u}class Ro extends ot{constructor(e=1,t=1,i=1,s=1,r=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:s,heightSegments:r,depthSegments:o};const a=this;s=Math.floor(s),r=Math.floor(r),o=Math.floor(o);const l=[],c=[],u=[],f=[];let d=0,h=0;p("z","y","x",-1,-1,i,t,e,o,r,0),p("z","y","x",1,-1,i,t,-e,o,r,1),p("x","z","y",1,1,e,i,t,s,o,2),p("x","z","y",1,-1,e,i,-t,s,o,3),p("x","y","z",1,-1,e,t,i,s,r,4),p("x","y","z",-1,-1,e,t,-i,s,r,5),this.setIndex(l),this.setAttribute("position",new Fe(c,3)),this.setAttribute("normal",new Fe(u,3)),this.setAttribute("uv",new Fe(f,2));function p(_,g,m,y,b,v,E,T,S,P,x){const M=v/S,I=E/P,N=v/2,V=E/2,j=T/2,te=S+1,Z=P+1;let ee=0,J=0;const he=new z;for(let be=0;be0?1:-1,u.push(he.x,he.y,he.z),f.push(ye/S),f.push(1-be/P),ee+=1}}for(let be=0;be0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const s in this.extensions)this.extensions[s]===!0&&(i[s]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class kc extends ht{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new qe,this.projectionMatrix=new qe,this.projectionMatrixInverse=new qe,this.coordinateSystem=_i}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Qs=new z,vy=new de,yy=new de;class Kt extends kc{constructor(e=50,t=1,i=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=s,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=wa*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(_o*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return wa*2*Math.atan(Math.tan(_o*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){Qs.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Qs.x,Qs.y).multiplyScalar(-e/Qs.z),Qs.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(Qs.x,Qs.y).multiplyScalar(-e/Qs.z)}getViewSize(e,t){return this.getViewBounds(e,vy,yy),t.subVectors(yy,vy)}setViewOffset(e,t,i,s,r,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=s,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(_o*.5*this.fov)/this.zoom,i=2*t,s=this.aspect*i,r=-.5*s;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;r+=o.offsetX*s/l,t-=o.offsetY*i/c,s*=o.width/l,i*=o.height/c}const a=this.filmOffset;a!==0&&(r+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+s,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Yo=-90,jo=1;class rE extends ht{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new Kt(Yo,jo,e,t);s.layers=this.layers,this.add(s);const r=new Kt(Yo,jo,e,t);r.layers=this.layers,this.add(r);const o=new Kt(Yo,jo,e,t);o.layers=this.layers,this.add(o);const a=new Kt(Yo,jo,e,t);a.layers=this.layers,this.add(a);const l=new Kt(Yo,jo,e,t);l.layers=this.layers,this.add(l);const c=new Kt(Yo,jo,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,s,r,o,a,l]=t;for(const c of t)this.remove(c);if(e===_i)i.up.set(0,1,0),i.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===uc)i.up.set(0,-1,0),i.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of t)this.add(c),c.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:s}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[r,o,a,l,c,u]=this.children,f=e.getRenderTarget(),d=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;const _=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,s),e.render(t,r),e.setRenderTarget(i,1,s),e.render(t,o),e.setRenderTarget(i,2,s),e.render(t,a),e.setRenderTarget(i,3,s),e.render(t,l),e.setRenderTarget(i,4,s),e.render(t,c),i.texture.generateMipmaps=_,e.setRenderTarget(i,5,s),e.render(t,u),e.setRenderTarget(f,d,h),e.xr.enabled=p,i.texture.needsPMREMUpdate=!0}}class Bc extends Wt{constructor(e=[],t=Fs,i,s,r,o,a,l,c,u){super(e,t,i,s,r,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class oE extends os{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},s=[i,i,i,i,i,i];this.texture=new Bc(s,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:en}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `},s=new Ro(5,5,5),r=new zi({name:"CubemapFromEquirect",uniforms:Aa(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Vn,blending:Ls});r.uniforms.tEquirect.value=t;const o=new $t(s,r),a=t.minFilter;return t.minFilter===Qi&&(t.minFilter=en),new rE(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t=!0,i=!0,s=!0){const r=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,s);e.setRenderTarget(r)}}class ca extends ht{constructor(){super(),this.isGroup=!0,this.type="Group"}}const NP={type:"move"};class Sf{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ca,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new ca,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new z,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new z),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new ca,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new z,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new z),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let s=null,r=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){o=!0;for(const _ of e.hand.values()){const g=t.getJointPose(_,i),m=this._getHandJoint(c,_);g!==null&&(m.matrix.fromArray(g.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=g.radius),m.visible=g!==null}const u=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],d=u.position.distanceTo(f.position),h=.02,p=.005;c.inputState.pinching&&d>h+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=h-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,i),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(s=t.getPose(e.targetRaySpace,i),s===null&&r!==null&&(s=r),s!==null&&(a.matrix.fromArray(s.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,s.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(s.linearVelocity)):a.hasLinearVelocity=!1,s.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(s.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(NP)))}return a!==null&&(a.visible=s!==null),l!==null&&(l.visible=r!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new ca;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}class gh{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Ae(e),this.density=t}clone(){return new gh(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class _h{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new Ae(e),this.near=t,this.far=i}clone(){return new _h(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class vh extends ht{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new li,this.environmentIntensity=1,this.environmentRotation=new li,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class yh{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=cc,this.updateRanges=[],this.version=0,this.uuid=ri()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let s=0,r=this.stride;se.far||t.push({distance:l,point:el.clone(),uv:jn.getInterpolation(el,Tu,nl,wu,by,Vp,xy,new de),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Au(n,e,t,i,s,r){Qo.subVectors(n,t).addScalar(.5).multiply(i),s!==void 0?(tl.x=r*Qo.x-s*Qo.y,tl.y=s*Qo.x+r*Qo.y):tl.copy(Qo),n.copy(e),n.x+=tl.x,n.y+=tl.y,n.applyMatrix4(aE)}const Cu=new z,My=new z;class cE extends ht{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,s=t.length;i0){let i,s;for(i=1,s=t.length;i0){Cu.setFromMatrixPosition(this.matrixWorld);const s=e.ray.origin.distanceTo(Cu);this.getObjectForDistance(s).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Cu.setFromMatrixPosition(e.matrixWorld),My.setFromMatrixPosition(this.matrixWorld);const i=Cu.distanceTo(My)/e.zoom;t[0].object.visible=!0;let s,r;for(s=1,r=t.length;s=o)t[s-1].object.visible=!1,t[s].object.visible=!0;else break}for(this._currentLevel=s-1;s1?null:t.copy(e.start).addScaledVector(i,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||zP.getNormalMatrix(e),s=this.coplanarPoint(Wp).applyMatrix4(e),r=this.normal.applyMatrix3(i).normalize();return this.constant=-s.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Gr=new _n,Iu=new z;class za{constructor(e=new lr,t=new lr,i=new lr,s=new lr,r=new lr,o=new lr){this.planes=[e,t,i,s,r,o]}set(e,t,i,s,r,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(s),a[4].copy(r),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=_i){const i=this.planes,s=e.elements,r=s[0],o=s[1],a=s[2],l=s[3],c=s[4],u=s[5],f=s[6],d=s[7],h=s[8],p=s[9],_=s[10],g=s[11],m=s[12],y=s[13],b=s[14],v=s[15];if(i[0].setComponents(l-r,d-c,g-h,v-m).normalize(),i[1].setComponents(l+r,d+c,g+h,v+m).normalize(),i[2].setComponents(l+o,d+u,g+p,v+y).normalize(),i[3].setComponents(l-o,d-u,g-p,v-y).normalize(),i[4].setComponents(l-a,d-f,g-_,v-b).normalize(),t===_i)i[5].setComponents(l+a,d+f,g+_,v+b).normalize();else if(t===uc)i[5].setComponents(a,f,_,b).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Gr.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Gr.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Gr)}intersectsSprite(e){return Gr.center.set(0,0,0),Gr.radius=.7071067811865476,Gr.applyMatrix4(e.matrixWorld),this.intersectsSphere(Gr)}intersectsSphere(e){const t=this.planes,i=e.center,s=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(i)0?e.max.x:e.min.x,Iu.y=s.normal.y>0?e.max.y:e.min.y,Iu.z=s.normal.z>0?e.max.z:e.min.z,s.distanceToPoint(Iu)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}const Xi=new qe,$i=new za;class xh{constructor(){this.coordinateSystem=_i}intersectsObject(e,t){if(!t.isArrayCamera||t.cameras.length===0)return!1;for(let i=0;i=r.length&&r.push({start:-1,count:-1,z:-1,index:-1});const a=r[this.index];o.push(a),this.index++,a.start=e,a.count=t,a.z=i,a.index=s}reset(){this.list.length=0,this.index=0}}const Xn=new qe,WP=new Ae(1,1,1),Iy=new za,XP=new xh,Lu=new wn,Wr=new _n,rl=new z,Ly=new z,$P=new z,$p=new GP,Mn=new $t,Du=[];function qP(n,e,t=0){const i=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const s=n.count;for(let r=0;r65535?new Uint32Array(s):new Uint16Array(s);t.setIndex(new Ct(r,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const i in t.attributes){if(!e.hasAttribute(i))throw new Error(`THREE.BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const s=e.getAttribute(i),r=t.getAttribute(i);if(s.itemSize!==r.itemSize||s.normalized!==r.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){const t=this._instanceInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){const t=this._geometryInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new wn);const e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let i=0,s=t.length;i=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const i={visible:!0,active:!0,geometryIndex:e};let s=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(Xp),s=this._availableInstanceIds.shift(),this._instanceInfo[s]=i):(s=this._instanceInfo.length,this._instanceInfo.push(i));const r=this._matricesTexture;Xn.identity().toArray(r.image.data,s*16),r.needsUpdate=!0;const o=this._colorsTexture;return o&&(WP.toArray(o.image.data,s*4),o.needsUpdate=!0),this._visibilityChanged=!0,s}addGeometry(e,t=-1,i=-1){this._initializeGeometry(e),this._validateGeometry(e);const s={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},r=this._geometryInfo;s.vertexStart=this._nextVertexStart,s.reservedVertexCount=t===-1?e.getAttribute("position").count:t;const o=e.getIndex();if(o!==null&&(s.indexStart=this._nextIndexStart,s.reservedIndexCount=i===-1?o.count:i),s.indexStart!==-1&&s.indexStart+s.reservedIndexCount>this._maxIndexCount||s.vertexStart+s.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let l;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(Xp),l=this._availableGeometryIds.shift(),r[l]=s):(l=this._geometryCount,this._geometryCount++,r.push(s)),this.setGeometryAt(l,e),this._nextIndexStart=s.indexStart+s.reservedIndexCount,this._nextVertexStart=s.vertexStart+s.reservedVertexCount,l}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const i=this.geometry,s=i.getIndex()!==null,r=i.getIndex(),o=t.getIndex(),a=this._geometryInfo[e];if(s&&o.count>a.reservedIndexCount||t.attributes.position.count>a.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const l=a.vertexStart,c=a.reservedVertexCount;a.vertexCount=t.getAttribute("position").count;for(const u in i.attributes){const f=t.getAttribute(u),d=i.getAttribute(u);qP(f,d,l);const h=f.itemSize;for(let p=f.count,_=c;p<_;p++){const g=l+p;for(let m=0;m=t.length||t[e].active===!1)return this;const i=this._instanceInfo;for(let s=0,r=i.length;sa).sort((o,a)=>i[o].vertexStart-i[a].vertexStart),r=this.geometry;for(let o=0,a=i.length;o=this._geometryCount)return null;const i=this.geometry,s=this._geometryInfo[e];if(s.boundingBox===null){const r=new wn,o=i.index,a=i.attributes.position;for(let l=s.start,c=s.start+s.count;l=this._geometryCount)return null;const i=this.geometry,s=this._geometryInfo[e];if(s.boundingSphere===null){const r=new _n;this.getBoundingBoxAt(e,Lu),Lu.getCenter(r.center);const o=i.index,a=i.attributes.position;let l=0;for(let c=s.start,u=s.start+s.count;ca.active);if(Math.max(...i.map(a=>a.vertexStart+a.reservedVertexCount))>e)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...i.map(l=>l.indexStart+l.reservedIndexCount))>t)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);const r=this.geometry;r.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new ot,this._initializeGeometry(r));const o=this.geometry;r.index&&Xr(r.index.array,o.index.array);for(const a in r.attributes)Xr(r.attributes[a].array,o.attributes[a].array)}raycast(e,t){const i=this._instanceInfo,s=this._geometryInfo,r=this.matrixWorld,o=this.geometry;Mn.material=this.material,Mn.geometry.index=o.index,Mn.geometry.attributes=o.attributes,Mn.geometry.boundingBox===null&&(Mn.geometry.boundingBox=new wn),Mn.geometry.boundingSphere===null&&(Mn.geometry.boundingSphere=new _n);for(let a=0,l=i.length;a({...t,boundingBox:t.boundingBox!==null?t.boundingBox.clone():null,boundingSphere:t.boundingSphere!==null?t.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(t=>({...t})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,t,i,s,r){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=s.getIndex(),a=o===null?1:o.array.BYTES_PER_ELEMENT,l=this._instanceInfo,c=this._multiDrawStarts,u=this._multiDrawCounts,f=this._geometryInfo,d=this.perObjectFrustumCulled,h=this._indirectTexture,p=h.image.data,_=i.isArrayCamera?XP:Iy;d&&!i.isArrayCamera&&(Xn.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),Iy.setFromProjectionMatrix(Xn,e.coordinateSystem));let g=0;if(this.sortObjects){Xn.copy(this.matrixWorld).invert(),rl.setFromMatrixPosition(i.matrixWorld).applyMatrix4(Xn),Ly.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(Xn);for(let b=0,v=l.length;b0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;ri)return;qp.applyMatrix4(n.matrixWorld);const c=e.ray.origin.distanceTo(qp);if(!(ce.far))return{distance:c,point:Oy.clone().applyMatrix4(n.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:n}}const Ny=new z,Uy=new z;class ls extends br{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[];for(let s=0,r=t.count;s0){const s=t[i[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,o=s.length;rs.far)return;r.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:o})}}class mE extends Wt{constructor(e,t,i,s,r=en,o=en,a,l,c){super(e,t,i,s,r,o,a,l,c),this.isVideoTexture=!0,this.generateMipmaps=!1;const u=this;function f(){u.needsUpdate=!0,e.requestVideoFrameCallback(f)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(f)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class YP extends mE{constructor(e,t,i,s,r,o,a,l){super({},e,t,i,s,r,o,a,l),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class jP extends Wt{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=gn,this.minFilter=gn,this.generateMipmaps=!1,this.needsUpdate=!0}}class Mh extends Wt{constructor(e,t,i,s,r,o,a,l,c,u,f,d){super(null,o,a,l,c,u,s,r,f,d),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class KP extends Mh{constructor(e,t,i,s,r,o){super(e,t,i,r,o),this.isCompressedArrayTexture=!0,this.image.depth=s,this.wrapR=gi,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class ZP extends Mh{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,Fs),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class JP extends Wt{constructor(e,t,i,s,r,o,a,l,c){super(e,t,i,s,r,o,a,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Sh extends Wt{constructor(e,t,i=ks,s,r,o,a=gn,l=gn,c,u=Ea){if(u!==Ea&&u!==Ta)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super(null,s,r,o,a,l,u,i,c),this.isDepthTexture=!0,this.image={width:e,height:t},this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new fr(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class QP extends Sh{constructor(e=1,t=1,i=1){super(e,t),this.isDepthArrayTexture=!0,this.image={width:e,height:t,depth:i},this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Eh extends ot{constructor(e=1,t=1,i=4,s=8,r=1){super(),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:i,radialSegments:s,heightSegments:r},t=Math.max(0,t),i=Math.max(1,Math.floor(i)),s=Math.max(3,Math.floor(s)),r=Math.max(1,Math.floor(r));const o=[],a=[],l=[],c=[],u=t/2,f=Math.PI/2*e,d=t,h=2*f+d,p=i*2+r,_=s+1,g=new z,m=new z;for(let y=0;y<=p;y++){let b=0,v=0,E=0,T=0;if(y<=i){const x=y/i,M=x*Math.PI/2;v=-u-e*Math.cos(M),E=e*Math.sin(M),T=-e*Math.cos(M),b=x*f}else if(y<=i+r){const x=(y-i)/r;v=-u+x*t,E=e,T=0,b=f+x*d}else{const x=(y-i-r)/i,M=x*Math.PI/2;v=u+e*Math.sin(M),E=e*Math.cos(M),T=e*Math.sin(M),b=f+d+x*f}const S=Math.max(0,Math.min(1,b/h));let P=0;y===0?P=.5/s:y===p&&(P=-.5/s);for(let x=0;x<=s;x++){const M=x/s,I=M*Math.PI*2,N=Math.sin(I),V=Math.cos(I);m.x=-E*V,m.y=v,m.z=E*N,a.push(m.x,m.y,m.z),g.set(-E*V,T,E*N),g.normalize(),l.push(g.x,g.y,g.z),c.push(M+P,S)}if(y>0){const x=(y-1)*_;for(let M=0;M0&&b(!0),t>0&&b(!1)),this.setIndex(u),this.setAttribute("position",new Fe(f,3)),this.setAttribute("normal",new Fe(d,3)),this.setAttribute("uv",new Fe(h,2));function y(){const v=new z,E=new z;let T=0;const S=(t-e)/i;for(let P=0;P<=r;P++){const x=[],M=P/r,I=M*(t-e)+e;for(let N=0;N<=s;N++){const V=N/s,j=V*l+a,te=Math.sin(j),Z=Math.cos(j);E.x=I*te,E.y=-M*i+g,E.z=I*Z,f.push(E.x,E.y,E.z),v.set(te,S,Z).normalize(),d.push(v.x,v.y,v.z),h.push(V,1-M),x.push(p++)}_.push(x)}for(let P=0;P0||x!==0)&&(u.push(M,I,V),T+=3),(t>0||x!==r-1)&&(u.push(I,N,V),T+=3)}c.addGroup(m,T,0),m+=T}function b(v){const E=p,T=new de,S=new z;let P=0;const x=v===!0?e:t,M=v===!0?1:-1;for(let N=1;N<=s;N++)f.push(0,g*M,0),d.push(0,M,0),h.push(.5,.5),p++;const I=p;for(let N=0;N<=s;N++){const j=N/s*l+a,te=Math.cos(j),Z=Math.sin(j);S.x=x*Z,S.y=g*M,S.z=x*te,f.push(S.x,S.y,S.z),d.push(0,M,0),T.x=te*.5+.5,T.y=Z*.5*M+.5,h.push(T.x,T.y),p++}for(let N=0;N.9&&S<.1&&(b<.2&&(o[y+0]+=1),v<.2&&(o[y+2]+=1),E<.2&&(o[y+4]+=1))}}function d(y){r.push(y.x,y.y,y.z)}function h(y,b){const v=y*3;b.x=e[v+0],b.y=e[v+1],b.z=e[v+2]}function p(){const y=new z,b=new z,v=new z,E=new z,T=new de,S=new de,P=new de;for(let x=0,M=0;x0)l=s-1;else{l=s;break}if(s=l,i[s]===o)return s/(r-1);const u=i[s],d=i[s+1]-u,h=(o-u)/d;return(s+h)/(r-1)}getTangent(e,t){let s=e-1e-4,r=e+1e-4;s<0&&(s=0),r>1&&(r=1);const o=this.getPoint(s),a=this.getPoint(r),l=t||(o.isVector2?new de:new z);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t=!1){const i=new z,s=[],r=[],o=[],a=new z,l=new qe;for(let h=0;h<=e;h++){const p=h/e;s[h]=this.getTangentAt(p,new z)}r[0]=new z,o[0]=new z;let c=Number.MAX_VALUE;const u=Math.abs(s[0].x),f=Math.abs(s[0].y),d=Math.abs(s[0].z);u<=c&&(c=u,i.set(1,0,0)),f<=c&&(c=f,i.set(0,1,0)),d<=c&&i.set(0,0,1),a.crossVectors(s[0],i).normalize(),r[0].crossVectors(s[0],a),o[0].crossVectors(s[0],r[0]);for(let h=1;h<=e;h++){if(r[h]=r[h-1].clone(),o[h]=o[h-1].clone(),a.crossVectors(s[h-1],s[h]),a.length()>Number.EPSILON){a.normalize();const p=Math.acos(tt(s[h-1].dot(s[h]),-1,1));r[h].applyMatrix4(l.makeRotationAxis(a,p))}o[h].crossVectors(s[h],r[h])}if(t===!0){let h=Math.acos(tt(r[0].dot(r[e]),-1,1));h/=e,s[0].dot(a.crossVectors(r[0],r[e]))>0&&(h=-h);for(let p=1;p<=e;p++)r[p].applyMatrix4(l.makeRotationAxis(s[p],h*p)),o[p].crossVectors(s[p],r[p])}return{tangents:s,normals:r,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Ah extends Gi{constructor(e=0,t=0,i=1,s=1,r=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=s,this.aStartAngle=r,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t=new de){const i=t,s=Math.PI*2;let r=this.aEndAngle-this.aStartAngle;const o=Math.abs(r)s;)r-=s;r0?0:(Math.floor(Math.abs(a)/r)+1)*r:l===0&&a===r-1&&(a=r-2,l=1);let c,u;this.closed||a>0?c=s[(a-1)%r]:(Vu.subVectors(s[0],s[1]).add(s[0]),c=Vu);const f=s[a%r],d=s[(a+1)%r];if(this.closed||a+2s.length-2?s.length-1:o+1],f=s[o>s.length-3?s.length-1:o+2];return i.set(By(a,l.x,c.x,u.x,f.x),By(a,l.y,c.y,u.y,f.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t=i){const o=s[r]-i,a=this.curves[r],l=a.getLength(),c=l===0?0:1-o/l;return a.getPointAt(c,t)}r++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,s=this.curves.length;i1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t0){const f=c.getPoint(0);f.equals(this.currentPoint)||this.lineTo(f.x,f.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class vo extends Ad{constructor(e){super(e),this.uuid=ri(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let i=0,s=this.holes.length;i80*t){a=1/0,l=1/0;let u=-1/0,f=-1/0;for(let d=t;du&&(u=h),p>f&&(f=p)}c=Math.max(u-a,f-l),c=c!==0?32767/c:0}return dc(r,o,t,a,l,c,0),o}function ME(n,e,t,i,s){let r;if(s===SI(n,e,t,i)>0)for(let o=e;o=e;o-=i)r=zy(o/i|0,n[o],n[o+1],r);return r&&Ra(r,r.next)&&(pc(r),r=r.next),r}function wo(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Ra(t,t.next)||zt(t.prev,t,t.next)===0)){if(pc(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function dc(n,e,t,i,s,r,o){if(!n)return;!o&&r&&_I(n,i,s,r);let a=n;for(;n.prev!==n.next;){const l=n.prev,c=n.next;if(r?cI(n,i,s,r):lI(n)){e.push(l.i,n.i,c.i),pc(n),n=c.next,a=c.next;continue}if(n=c,n===a){o?o===1?(n=uI(wo(n),e),dc(n,e,t,i,s,r,2)):o===2&&fI(n,e,t,i,s,r):dc(wo(n),e,t,i,s,r,1);break}}}function lI(n){const e=n.prev,t=n,i=n.next;if(zt(e,t,i)>=0)return!1;const s=e.x,r=t.x,o=i.x,a=e.y,l=t.y,c=i.y,u=Math.min(s,r,o),f=Math.min(a,l,c),d=Math.max(s,r,o),h=Math.max(a,l,c);let p=i.next;for(;p!==e;){if(p.x>=u&&p.x<=d&&p.y>=f&&p.y<=h&&gl(s,a,r,l,o,c,p.x,p.y)&&zt(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function cI(n,e,t,i){const s=n.prev,r=n,o=n.next;if(zt(s,r,o)>=0)return!1;const a=s.x,l=r.x,c=o.x,u=s.y,f=r.y,d=o.y,h=Math.min(a,l,c),p=Math.min(u,f,d),_=Math.max(a,l,c),g=Math.max(u,f,d),m=vg(h,p,e,t,i),y=vg(_,g,e,t,i);let b=n.prevZ,v=n.nextZ;for(;b&&b.z>=m&&v&&v.z<=y;){if(b.x>=h&&b.x<=_&&b.y>=p&&b.y<=g&&b!==s&&b!==o&&gl(a,u,l,f,c,d,b.x,b.y)&&zt(b.prev,b,b.next)>=0||(b=b.prevZ,v.x>=h&&v.x<=_&&v.y>=p&&v.y<=g&&v!==s&&v!==o&&gl(a,u,l,f,c,d,v.x,v.y)&&zt(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;b&&b.z>=m;){if(b.x>=h&&b.x<=_&&b.y>=p&&b.y<=g&&b!==s&&b!==o&&gl(a,u,l,f,c,d,b.x,b.y)&&zt(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;v&&v.z<=y;){if(v.x>=h&&v.x<=_&&v.y>=p&&v.y<=g&&v!==s&&v!==o&&gl(a,u,l,f,c,d,v.x,v.y)&&zt(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function uI(n,e){let t=n;do{const i=t.prev,s=t.next.next;!Ra(i,s)&&EE(i,t,t.next,s)&&hc(i,s)&&hc(s,i)&&(e.push(i.i,t.i,s.i),pc(t),pc(t.next),t=n=s),t=t.next}while(t!==n);return wo(t)}function fI(n,e,t,i,s,r){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&bI(o,a)){let l=TE(o,a);o=wo(o,o.next),l=wo(l,l.next),dc(o,e,t,i,s,r,0),dc(l,e,t,i,s,r,0);return}a=a.next}o=o.next}while(o!==n)}function dI(n,e,t,i){const s=[];for(let r=0,o=e.length;r=t.next.y&&t.next.y!==t.y){const f=t.x+(s-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(f<=i&&f>r&&(r=f,o=t.x=t.x&&t.x>=l&&i!==t.x&&SE(so.x||t.x===o.x&&gI(o,t)))&&(o=t,u=f)}t=t.next}while(t!==a);return o}function gI(n,e){return zt(n.prev,n,e.prev)<0&&zt(e.next,n,n.next)<0}function _I(n,e,t,i){let s=n;do s.z===0&&(s.z=vg(s.x,s.y,e,t,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==n);s.prevZ.nextZ=null,s.prevZ=null,vI(s)}function vI(n){let e,t=1;do{let i=n,s;n=null;let r=null;for(e=0;i;){e++;let o=i,a=0;for(let c=0;c0||l>0&&o;)a!==0&&(l===0||!o||i.z<=o.z)?(s=i,i=i.nextZ,a--):(s=o,o=o.nextZ,l--),r?r.nextZ=s:n=s,s.prevZ=r,r=s;i=o}r.nextZ=null,t*=2}while(e>1);return n}function vg(n,e,t,i,s){return n=(n-t)*s|0,e=(e-i)*s|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function yI(n){let e=n,t=n;do(e.x=(n-o)*(r-a)&&(n-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(r-a)>=(s-o)*(i-a)}function gl(n,e,t,i,s,r,o,a){return!(n===o&&e===a)&&SE(n,e,t,i,s,r,o,a)}function bI(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!xI(n,e)&&(hc(n,e)&&hc(e,n)&&MI(n,e)&&(zt(n.prev,n,e.prev)||zt(n,e.prev,e))||Ra(n,e)&&zt(n.prev,n,n.next)>0&&zt(e.prev,e,e.next)>0)}function zt(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Ra(n,e){return n.x===e.x&&n.y===e.y}function EE(n,e,t,i){const s=Gu(zt(n,e,t)),r=Gu(zt(n,e,i)),o=Gu(zt(t,i,n)),a=Gu(zt(t,i,e));return!!(s!==r&&o!==a||s===0&&Hu(n,t,e)||r===0&&Hu(n,i,e)||o===0&&Hu(t,n,i)||a===0&&Hu(t,e,i))}function Hu(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function Gu(n){return n>0?1:n<0?-1:0}function xI(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&EE(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function hc(n,e){return zt(n.prev,n,n.next)<0?zt(n,e,n.next)>=0&&zt(n,n.prev,e)>=0:zt(n,e,n.prev)<0||zt(n,n.next,e)<0}function MI(n,e){let t=n,i=!1;const s=(n.x+e.x)/2,r=(n.y+e.y)/2;do t.y>r!=t.next.y>r&&t.next.y!==t.y&&s<(t.next.x-t.x)*(r-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function TE(n,e){const t=yg(n.i,n.x,n.y),i=yg(e.i,e.x,e.y),s=n.next,r=e.prev;return n.next=e,e.prev=n,t.next=s,s.prev=t,i.next=t,t.prev=i,r.next=i,i.prev=r,i}function zy(n,e,t,i){const s=yg(n,e,t);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function pc(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function yg(n,e,t){return{i:n,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function SI(n,e,t,i){let s=0;for(let r=e,o=t-i;r2&&n[e-1].equals(n[0])&&n.pop()}function Hy(n,e){for(let t=0;tNumber.EPSILON){const q=Math.sqrt(O),fe=Math.sqrt(A*A+U*U),ue=X.x-C/q,Re=X.y+B/q,Pe=G.x-U/fe,me=G.y+A/fe,Se=((Pe-ue)*U-(me-Re)*A)/(B*U-C*A);W=ue+B*Se-w.x,R=Re+C*Se-w.y;const Ve=W*W+R*R;if(Ve<=2)return new de(W,R);L=Math.sqrt(Ve/2)}else{let q=!1;B>Number.EPSILON?A>Number.EPSILON&&(q=!0):B<-Number.EPSILON?A<-Number.EPSILON&&(q=!0):Math.sign(C)===Math.sign(U)&&(q=!0),q?(W=-C,R=B,L=Math.sqrt(O)):(W=B,R=C,L=Math.sqrt(O/2))}return new de(W/L,R/L)}const he=[];for(let w=0,X=te.length,G=X-1,W=w+1;w=0;w--){const X=w/g,G=h*Math.cos(X*Math.PI/2),W=p*Math.sin(X*Math.PI/2)+_;for(let R=0,L=te.length;R=0;){const W=G;let R=G-1;R<0&&(R=w.length-1);for(let L=0,B=u+g*2;L0)&&h.push(b,v,T),(m!==i-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class PE extends Cn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Ae(16777215),this.specular=new Ae(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ae(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ar,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new li,this.combine=Nc,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class IE extends Cn{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Ae(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ae(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ar,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class LE extends Cn{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ar,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class DE extends Cn{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Ae(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ae(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ar,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new li,this.combine=Nc,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class u_ extends Cn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=G1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class f_ extends Cn{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}class OE extends Cn{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ae(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ar,this.normalScale=new de(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class NE extends Gn{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function fo(n,e){return!n||n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function UE(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function FE(n){function e(s,r){return n[s]-n[r]}const t=n.length,i=new Array(t);for(let s=0;s!==t;++s)i[s]=s;return i.sort(e),i}function bg(n,e,t){const i=n.length,s=new n.constructor(i);for(let r=0,o=0;o!==i;++r){const a=t[r]*e;for(let l=0;l!==e;++l)s[o++]=n[a+l]}return s}function d_(n,e,t,i){let s=1,r=n[0];for(;r!==void 0&&r[i]===void 0;)r=n[s++];if(r===void 0)return;let o=r[i];if(o!==void 0)if(Array.isArray(o))do o=r[i],o!==void 0&&(e.push(r.time),t.push(...o)),r=n[s++];while(r!==void 0);else if(o.toArray!==void 0)do o=r[i],o!==void 0&&(e.push(r.time),o.toArray(t,t.length)),r=n[s++];while(r!==void 0);else do o=r[i],o!==void 0&&(e.push(r.time),t.push(o)),r=n[s++];while(r!==void 0)}function CI(n,e,t,i,s=30){const r=n.clone();r.name=e;const o=[];for(let l=0;l=i)){f.push(c.times[h]);for(let _=0;_r.tracks[l].times[0]&&(a=r.tracks[l].times[0]);for(let l=0;l=a.times[p]){const m=p*f+u,y=m+f-u;_=a.values.slice(m,y)}else{const m=a.createInterpolant(),y=u,b=f-u;m.evaluate(r),_=m.resultBuffer.slice(y,b)}l==="quaternion"&&new Jn().fromArray(_).normalize().conjugate().toArray(_);const g=c.times.length;for(let m=0;m=r)){const a=t[1];e=r)break t}o=i,i=0;break n}break e}for(;i>>1;et;)--o;if(++o,r!==0||o!==s){r>=o&&(o=Math.max(o,1),r=o-1);const a=this.getValueSize();this.times=i.slice(r,o),this.values=this.values.slice(r*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,s=this.values,r=i.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==r;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(s!==void 0&&UE(s))for(let a=0,l=s.length;a!==l;++a){const c=s[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),s=this.getInterpolation()===xf,r=e.length-1;let o=1;for(let a=1;a0){e[o]=e[r];for(let a=r*i,l=o*i,c=0;c!==i;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,s=new i(this.name,e,t);return s.createInterpolant=this.createInterpolant,s}}Ei.prototype.ValueTypeName="";Ei.prototype.TimeBufferType=Float32Array;Ei.prototype.ValueBufferType=Float32Array;Ei.prototype.DefaultInterpolation=Sd;class Po extends Ei{constructor(e,t,i){super(e,t,i)}}Po.prototype.ValueTypeName="bool";Po.prototype.ValueBufferType=Array;Po.prototype.DefaultInterpolation=oc;Po.prototype.InterpolantFactoryMethodLinear=void 0;Po.prototype.InterpolantFactoryMethodSmooth=void 0;class p_ extends Ei{constructor(e,t,i,s){super(e,t,i,s)}}p_.prototype.ValueTypeName="color";class mc extends Ei{constructor(e,t,i,s){super(e,t,i,s)}}mc.prototype.ValueTypeName="number";class zE extends Wc{constructor(e,t,i,s){super(e,t,i,s)}interpolate_(e,t,i,s){const r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(s-t);let c=e*a;for(let u=c+a;c!==u;c+=4)Jn.slerpFlat(r,0,o,c-a,o,c,l);return r}}class Xc extends Ei{constructor(e,t,i,s){super(e,t,i,s)}InterpolantFactoryMethodLinear(e){return new zE(this.times,this.values,this.getValueSize(),e)}}Xc.prototype.ValueTypeName="quaternion";Xc.prototype.InterpolantFactoryMethodSmooth=void 0;class Io extends Ei{constructor(e,t,i){super(e,t,i)}}Io.prototype.ValueTypeName="string";Io.prototype.ValueBufferType=Array;Io.prototype.DefaultInterpolation=oc;Io.prototype.InterpolantFactoryMethodLinear=void 0;Io.prototype.InterpolantFactoryMethodSmooth=void 0;class gc extends Ei{constructor(e,t,i,s){super(e,t,i,s)}}gc.prototype.ValueTypeName="vector";class _c{constructor(e="",t=-1,i=[],s=dh){this.name=e,this.tracks=i,this.duration=t,this.blendMode=s,this.uuid=ri(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,s=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(LI(i[o]).scale(s));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],i=e.tracks,s={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,o=i.length;r!==o;++r)t.push(Ei.toJSON(i[r]));return s}static CreateFromMorphTargetSequence(e,t,i,s){const r=t.length,o=[];for(let a=0;a1){const f=u[1];let d=s[f];d||(s[f]=d=[]),d.push(c)}}const o=[];for(const a in s)o.push(this.CreateFromMorphTargetSequence(a,s[a],t,i));return o}static parseAnimation(e,t){if(console.warn("THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(f,d,h,p,_){if(h.length!==0){const g=[],m=[];d_(h,g,m,p),g.length!==0&&_.push(new f(d,g,m))}},s=[],r=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let f=0;f{t&&t(r),this.manager.itemEnd(e)},0),r;if(_s[e]!==void 0){_s[e].push({onLoad:t,onProgress:i,onError:s});return}_s[e]=[],_s[e].push({onLoad:t,onProgress:i,onError:s});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=_s[e],f=c.body.getReader(),d=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),h=d?parseInt(d):0,p=h!==0;let _=0;const g=new ReadableStream({start(m){y();function y(){f.read().then(({done:b,value:v})=>{if(b)m.close();else{_+=v.byteLength;const E=new ProgressEvent("progress",{lengthComputable:p,loaded:_,total:h});for(let T=0,S=u.length;T{m.error(b)})}}});return new Response(g)}else throw new DI(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a==="")return c.text();{const f=/charset="?([^;"\s]*)"?/i.exec(a),d=f&&f[1]?f[1].toLowerCase():void 0,h=new TextDecoder(d);return c.arrayBuffer().then(p=>h.decode(p))}}}).then(c=>{Cs.add(e,c);const u=_s[e];delete _s[e];for(let f=0,d=u.length;f{const u=_s[e];if(u===void 0)throw this.manager.itemError(e),c;delete _s[e];for(let f=0,d=u.length;f{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class OI extends ei{constructor(e){super(e)}load(e,t,i,s){const r=this,o=new Bs(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(r.parse(JSON.parse(a)))}catch(l){s?s(l):console.error(l),r.manager.itemError(e)}},i,s)}parse(e){const t=[];for(let i=0;i0:s.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const r in e.uniforms){const o=e.uniforms[r];switch(s.uniforms[r]={},o.type){case"t":s.uniforms[r].value=i(o.value);break;case"c":s.uniforms[r].value=new Ae().setHex(o.value);break;case"v2":s.uniforms[r].value=new de().fromArray(o.value);break;case"v3":s.uniforms[r].value=new z().fromArray(o.value);break;case"v4":s.uniforms[r].value=new gt().fromArray(o.value);break;case"m3":s.uniforms[r].value=new st().fromArray(o.value);break;case"m4":s.uniforms[r].value=new qe().fromArray(o.value);break;default:s.uniforms[r].value=o.value}}if(e.defines!==void 0&&(s.defines=e.defines),e.vertexShader!==void 0&&(s.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(s.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(s.glslVersion=e.glslVersion),e.extensions!==void 0)for(const r in e.extensions)s.extensions[r]=e.extensions[r];if(e.lights!==void 0&&(s.lights=e.lights),e.clipping!==void 0&&(s.clipping=e.clipping),e.size!==void 0&&(s.size=e.size),e.sizeAttenuation!==void 0&&(s.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(s.map=i(e.map)),e.matcap!==void 0&&(s.matcap=i(e.matcap)),e.alphaMap!==void 0&&(s.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(s.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(s.bumpScale=e.bumpScale),e.normalMap!==void 0&&(s.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(s.normalMapType=e.normalMapType),e.normalScale!==void 0){let r=e.normalScale;Array.isArray(r)===!1&&(r=[r,r]),s.normalScale=new de().fromArray(r)}return e.displacementMap!==void 0&&(s.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(s.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(s.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(s.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(s.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(s.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(s.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(s.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(s.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(s.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(s.envMap=i(e.envMap)),e.envMapRotation!==void 0&&s.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(s.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(s.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(s.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(s.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(s.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(s.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(s.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(s.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(s.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(s.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(s.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(s.clearcoatNormalScale=new de().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(s.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(s.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(s.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(s.thicknessMap=i(e.thicknessMap)),e.anisotropyMap!==void 0&&(s.anisotropyMap=i(e.anisotropyMap)),e.sheenColorMap!==void 0&&(s.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(s.sheenRoughnessMap=i(e.sheenRoughnessMap)),s}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return kh.createMaterialFromType(e)}static createMaterialFromType(e){const t={ShadowMaterial:AE,SpriteMaterial:e_,RawShaderMaterial:CE,ShaderMaterial:zi,PointsMaterial:n_,MeshPhysicalMaterial:RE,MeshStandardMaterial:c_,MeshPhongMaterial:PE,MeshToonMaterial:IE,MeshNormalMaterial:LE,MeshLambertMaterial:DE,MeshDepthMaterial:u_,MeshDistanceMaterial:f_,MeshBasicMaterial:Hs,MeshMatcapMaterial:OE,LineDashedMaterial:NE,LineBasicMaterial:Gn,Material:Cn};return new t[e]}}class xg{static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class KE extends ot{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class ZE extends ei{constructor(e){super(e)}load(e,t,i,s){const r=this,o=new Bs(r.manager);o.setPath(r.path),o.setRequestHeader(r.requestHeader),o.setWithCredentials(r.withCredentials),o.load(e,function(a){try{t(r.parse(JSON.parse(a)))}catch(l){s?s(l):console.error(l),r.manager.itemError(e)}},i,s)}parse(e){const t={},i={};function s(h,p){if(t[p]!==void 0)return t[p];const g=h.interleavedBuffers[p],m=r(h,g.buffer),y=la(g.type,m),b=new yh(y,g.stride);return b.uuid=g.uuid,t[p]=b,b}function r(h,p){if(i[p]!==void 0)return i[p];const g=h.arrayBuffers[p],m=new Uint32Array(g).buffer;return i[p]=m,m}const o=e.isInstancedBufferGeometry?new KE:new ot,a=e.data.index;if(a!==void 0){const h=la(a.type,a.array);o.setIndex(new Ct(h,1))}const l=e.data.attributes;for(const h in l){const p=l[h];let _;if(p.isInterleavedBufferAttribute){const g=s(e.data,p.data);_=new To(g,p.itemSize,p.offset,p.normalized)}else{const g=la(p.type,p.array),m=p.isInstancedBufferAttribute?Ca:Ct;_=new m(g,p.itemSize,p.normalized)}p.name!==void 0&&(_.name=p.name),p.usage!==void 0&&_.setUsage(p.usage),o.setAttribute(h,_)}const c=e.data.morphAttributes;if(c)for(const h in c){const p=c[h],_=[];for(let g=0,m=p.length;g0){const l=new m_(t);r=new vc(l),r.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){s=new vc(this.manager),s.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o{let g=null,m=null;return _.boundingBox!==void 0&&(g=new wn,g.min.fromArray(_.boundingBox.min),g.max.fromArray(_.boundingBox.max)),_.boundingSphere!==void 0&&(m=new _n,m.radius=_.boundingSphere.radius,m.center.fromArray(_.boundingSphere.center)),{..._,boundingBox:g,boundingSphere:m}}),o._instanceInfo=e.instanceInfo,o._availableInstanceIds=e._availableInstanceIds,o._availableGeometryIds=e._availableGeometryIds,o._nextIndexStart=e.nextIndexStart,o._nextVertexStart=e.nextVertexStart,o._geometryCount=e.geometryCount,o._maxInstanceCount=e.maxInstanceCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._matricesTexture=c(e.matricesTexture.uuid),o._indirectTexture=c(e.indirectTexture.uuid),e.colorsTexture!==void 0&&(o._colorsTexture=c(e.colorsTexture.uuid)),e.boundingSphere!==void 0&&(o.boundingSphere=new _n,o.boundingSphere.center.fromArray(e.boundingSphere.center),o.boundingSphere.radius=e.boundingSphere.radius),e.boundingBox!==void 0&&(o.boundingBox=new wn,o.boundingBox.min.fromArray(e.boundingBox.min),o.boundingBox.max.fromArray(e.boundingBox.max));break;case"LOD":o=new cE;break;case"Line":o=new br(a(e.geometry),l(e.material));break;case"LineLoop":o=new hE(a(e.geometry),l(e.material));break;case"LineSegments":o=new ls(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new pE(a(e.geometry),l(e.material));break;case"Sprite":o=new lE(l(e.material));break;case"Group":o=new ca;break;case"Bone":o=new t_;break;default:o=new ht}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.up!==void 0&&o.up.fromArray(e.up),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(o.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const d=e.children;for(let h=0;h"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,o=Cs.get(e);if(o!==void 0){if(r.manager.itemStart(e),o.then){o.then(c=>{t&&t(c),r.manager.itemEnd(e)}).catch(c=>{s&&s(c)});return}return setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const l=fetch(e,a).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(c){return Cs.add(e,c),t&&t(c),r.manager.itemEnd(e),c}).catch(function(c){s&&s(c),Cs.remove(e),r.manager.itemError(e),r.manager.itemEnd(e)});Cs.add(e,l),r.manager.itemStart(e)}}let Wu;class __{static getContext(){return Wu===void 0&&(Wu=new(window.AudioContext||window.webkitAudioContext)),Wu}static setContext(e){Wu=e}}class XI extends ei{constructor(e){super(e)}load(e,t,i,s){const r=this,o=new Bs(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const c=l.slice(0);__.getContext().decodeAudioData(c,function(f){t(f)}).catch(a)}catch(c){a(c)}},i,s);function a(l){s?s(l):console.error(l),r.manager.itemError(e)}}}const Ky=new qe,Zy=new qe,$r=new qe;class $I{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Kt,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Kt,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,$r.copy(e.projectionMatrix);const s=t.eyeSep/2,r=s*t.near/t.focus,o=t.near*Math.tan(_o*t.fov*.5)/t.zoom;let a,l;Zy.elements[12]=-s,Ky.elements[12]=s,a=-o*t.aspect+r,l=o*t.aspect+r,$r.elements[0]=2*t.near/(l-a),$r.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy($r),a=-o*t.aspect-r,l=o*t.aspect-r,$r.elements[0]=2*t.near/(l-a),$r.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy($r)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Zy),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Ky)}}class JE extends Kt{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class Bh{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Jy(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=Jy();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Jy(){return performance.now()}const qr=new z,Qy=new Jn,qI=new z,Yr=new z;class YI extends ht{constructor(){super(),this.type="AudioListener",this.context=__.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Bh}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(qr,Qy,qI),Yr.set(0,0,-1).applyQuaternion(Qy),t.positionX){const s=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(qr.x,s),t.positionY.linearRampToValueAtTime(qr.y,s),t.positionZ.linearRampToValueAtTime(qr.z,s),t.forwardX.linearRampToValueAtTime(Yr.x,s),t.forwardY.linearRampToValueAtTime(Yr.y,s),t.forwardZ.linearRampToValueAtTime(Yr.z,s),t.upX.linearRampToValueAtTime(i.x,s),t.upY.linearRampToValueAtTime(i.y,s),t.upZ.linearRampToValueAtTime(i.z,s)}else t.setPosition(qr.x,qr.y,qr.z),t.setOrientation(Yr.x,Yr.y,Yr.z,i.x,i.y,i.z)}}class QE extends ht{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(i,s,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(i[l]!==i[l+t]){a.setValue(i,s);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,s=i*this._origIndex;e.getValue(t,s);for(let r=i,o=s;r!==o;++r)t[r]=t[s+r%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i=.5)for(let o=0;o!==r;++o)e[t+o]=e[i+o]}_slerp(e,t,i,s){Jn.slerpFlat(e,t,e,t,e,i,s)}_slerpAdditive(e,t,i,s,r){const o=this._workIndex*r;Jn.multiplyQuaternionsFlat(e,o,e,t,e,i),Jn.slerpFlat(e,t,e,t,e,o,s)}_lerp(e,t,i,s,r){const o=1-s;for(let a=0;a!==r;++a){const l=t+a;e[l]=e[l]*o+e[i+a]*s}}_lerpAdditive(e,t,i,s,r){for(let o=0;o!==r;++o){const a=t+o;e[a]=e[a]+e[i+o]*s}}}const v_="\\[\\]\\.:\\/",JI=new RegExp("["+v_+"]","g"),y_="[^"+v_+"]",QI="[^"+v_.replace("\\.","")+"]",eL=/((?:WC+[\/:])*)/.source.replace("WC",y_),tL=/(WCOD+)?/.source.replace("WCOD",QI),nL=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",y_),iL=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",y_),sL=new RegExp("^"+eL+tL+nL+iL+"$"),rL=["material","materials","bones","map"];class oL{constructor(e,t,i){const s=i||mt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,s)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,s=this._bindings[i];s!==void 0&&s.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let s=this._targetGroup.nCachedObjects_,r=i.length;s!==r;++s)i[s].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class mt{constructor(e,t,i){this.path=t,this.parsedPath=i||mt.parseTrackName(t),this.node=mt.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new mt.Composite(e,t,i):new mt(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(JI,"")}static parseTrackName(e){const t=sL.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},s=i.nodeName&&i.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){const r=i.nodeName.substring(s+1);rL.indexOf(r)!==-1&&(i.nodeName=i.nodeName.substring(0,s),i.objectName=r)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(r){for(let o=0;o=r){const f=r++,d=e[f];t[d.uuid]=u,e[u]=d,t[c]=f,e[f]=l;for(let h=0,p=s;h!==p;++h){const _=i[h],g=_[f],m=_[u];_[u]=g,_[f]=m}}}this.nCachedObjects_=r}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,s=i.length;let r=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const c=arguments[a],u=c.uuid,f=t[u];if(f!==void 0)if(delete t[u],f0&&(t[h.uuid]=f),e[f]=h,e.pop();for(let p=0,_=s;p!==_;++p){const g=i[p];g[f]=g[d],g.pop()}}}this.nCachedObjects_=r}subscribe_(e,t){const i=this._bindingsIndicesByPath;let s=i[e];const r=this._bindings;if(s!==void 0)return r[s];const o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,f=new Array(c);s=r.length,i[e]=s,o.push(e),a.push(t),r.push(f);for(let d=u,h=l.length;d!==h;++d){const p=l[d];f[d]=new mt(p,e,t)}return f}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const s=this._paths,r=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=i,o[i]=l,o.pop(),r[i]=r[a],r.pop(),s[i]=s[a],s.pop()}}}class tT{constructor(e,t,i=null,s=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=s;const r=t.tracks,o=r.length,a=new Array(o),l={endingStart:co,endingEnd:co};for(let c=0;c!==o;++c){const u=r[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=V1,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i=!1){if(e.fadeOut(t),this.fadeIn(t),i===!0){const s=this._clip.duration,r=e._clip.duration,o=r/s,a=s/r;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i=!1){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const s=this._mixer,r=s.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=s._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,c=a.sampleValues;return l[0]=r,l[1]=r+i,c[0]=e/o,c[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,s){if(!this.enabled){this._updateWeight(e);return}const r=this._startTime;if(r!==null){const l=(e-r)*i;l<0||i===0?t=0:(this._startTime=null,t=i*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Y0:for(let u=0,f=l.length;u!==f;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case dh:default:for(let u=0,f=l.length;u!==f;++u)l[u].evaluate(o),c[u].accumulate(s,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const s=i.evaluate(e)[0];t*=s,e>i.parameterPositions[1]&&(this.stopFading(),s===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const s=i.evaluate(e)[0];t*=s,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let s=this.time+e,r=this._loopCount;const o=i===H1;if(e===0)return r===-1?s:o&&(r&1)===1?t-s:s;if(i===z1){r===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(s>=t)s=t;else if(s<0)s=0;else{this.time=s;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(r===-1&&(e>=0?(r=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),s>=t||s<0){const a=Math.floor(s/t);s-=t*a,r+=Math.abs(a);const l=this.repetitions-r;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,s=e>0?t:0,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this.time=s,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=s;if(o&&(r&1)===1)return t-s}return s}_setEndings(e,t,i){const s=this._interpolantSettings;i?(s.endingStart=uo,s.endingEnd=uo):(e?s.endingStart=this.zeroSlopeAtStart?uo:co:s.endingStart=ac,t?s.endingEnd=this.zeroSlopeAtEnd?uo:co:s.endingEnd=ac)}_scheduleFading(e,t,i){const s=this._mixer,r=s.time;let o=this._weightInterpolant;o===null&&(o=s._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=r,l[0]=t,a[1]=r+e,l[1]=i,this}}const lL=new Float32Array(1);class cL extends as{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,s=e._clip.tracks,r=s.length,o=e._propertyBindings,a=e._interpolants,l=i.uuid,c=this._bindingsByRootAndName;let u=c[l];u===void 0&&(u={},c[l]=u);for(let f=0;f!==r;++f){const d=s[f],h=d.name;let p=u[h];if(p!==void 0)++p.referenceCount,o[f]=p;else{if(p=o[f],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,h));continue}const _=t&&t._propertyBindings[f].binding.parsedPath;p=new eT(mt.create(i,h,_),d.ValueTypeName,d.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,h),o[f]=p}a[f].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,s=e._clip.uuid,r=this._actionsByClip[s];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,s,i)}const t=e._propertyBindings;for(let i=0,s=t.length;i!==s;++i){const r=t[i];r.useCount++===0&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,s=t.length;i!==s;++i){const r=t[i];--r.useCount===0&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,s=this.time+=e,r=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==i;++c)t[c]._update(s,e,r,o);const a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ib).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const sb=new z,Xu=new z;class yL{constructor(e=new z,t=new z){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){sb.subVectors(e,this.start),Xu.subVectors(this.end,this.start);const i=Xu.dot(Xu);let r=Xu.dot(sb)/i;return t&&(r=tt(r,0,1)),r}closestPointToPoint(e,t,i){const s=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(s).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const rb=new z;class bL extends ht{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new ot,s=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o1)for(let f=0;f.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{ub.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(ub,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class DL extends ls{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],s=new ot;s.setAttribute("position",new Fe(t,3)),s.setAttribute("color",new Fe(i,3));const r=new Gn({vertexColors:!0,toneMapped:!1});super(s,r),this.type="AxesHelper"}setColors(e,t,i){const s=new Ae,r=this.geometry.attributes.color.array;return s.set(e),s.toArray(r,0),s.toArray(r,3),s.set(t),s.toArray(r,6),s.toArray(r,9),s.set(i),s.toArray(r,12),s.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class OL{constructor(){this.type="ShapePath",this.color=new Ae,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Ad,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,s){return this.currentPath.quadraticCurveTo(e,t,i,s),this}bezierCurveTo(e,t,i,s,r,o){return this.currentPath.bezierCurveTo(e,t,i,s,r,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(m){const y=[];for(let b=0,v=m.length;bNumber.EPSILON){if(M<0&&(S=y[T],x=-x,P=y[E],M=-M),m.yP.y)continue;if(m.y===S.y){if(m.x===S.x)return!0}else{const I=M*(m.x-S.x)-x*(m.y-S.y);if(I===0)return!0;if(I<0)continue;v=!v}}else{if(m.y!==S.y)continue;if(P.x<=m.x&&m.x<=S.x||S.x<=m.x&&m.x<=P.x)return!0}}return v}const s=Li.isClockWise,r=this.subPaths;if(r.length===0)return[];let o,a,l;const c=[];if(r.length===1)return a=r[0],l=new vo,l.curves=a.curves,c.push(l),c;let u=!s(r[0].getPoints());u=e?!u:u;const f=[],d=[];let h=[],p=0,_;d[p]=void 0,h[p]=[];for(let m=0,y=r.length;m1){let m=!1,y=0;for(let b=0,v=d.length;b0&&m===!1&&(h=f)}let g;for(let m=0,y=d.length;me?(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2):(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0),n}function FL(n,e){const t=n.image&&n.image.width?n.image.width/n.image.height:1;return t>e?(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0):(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2),n}function kL(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function Sg(n,e,t,i){const s=BL(i);switch(t){case W0:return n*e;case ch:return n*e/s.components*s.byteLength;case Uc:return n*e/s.components*s.byteLength;case $0:return n*e*2/s.components*s.byteLength;case uh:return n*e*2/s.components*s.byteLength;case X0:return n*e*3/s.components*s.byteLength;case zn:return n*e*4/s.components*s.byteLength;case fh:return n*e*4/s.components*s.byteLength;case Tl:case wl:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case Al:case Cl:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case Jf:case ed:return Math.max(n,16)*Math.max(e,8)/4;case Zf:case Qf:return Math.max(n,8)*Math.max(e,8)/2;case td:case nd:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case id:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case sd:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case rd:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case od:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case ad:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case ld:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case cd:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case ud:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case fd:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case dd:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case hd:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case pd:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case md:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case gd:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case _d:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case Rl:case vd:case yd:return Math.ceil(n/4)*Math.ceil(e/4)*16;case q0:case bd:return Math.ceil(n/4)*Math.ceil(e/4)*8;case xd:case Md:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function BL(n){switch(n){case Bi:case V0:return{byteLength:1,components:1};case Ma:case H0:case ka:return{byteLength:2,components:1};case ah:case lh:return{byteLength:2,components:4};case ks:case oh:case Kn:return{byteLength:4,components:1};case G0:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}class zL{static contain(e,t){return UL(e,t)}static cover(e,t){return FL(e,t)}static fill(e){return kL(e)}static getByteLength(e,t,i,s){return Sg(e,t,i,s)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Oc}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Oc);/** + * @license + * Copyright 2010-2025 Three.js Authors + * SPDX-License-Identifier: MIT + */function sT(){let n=null,e=!1,t=null,i=null;function s(r,o){t(r,o),i=n.requestAnimationFrame(s)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(s),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(r){t=r},setContext:function(r){n=r}}}function VL(n){const e=new WeakMap;function t(a,l){const c=a.array,u=a.usage,f=c.byteLength,d=n.createBuffer();n.bindBuffer(l,d),n.bufferData(l,c,u),a.onUploadCallback();let h;if(c instanceof Float32Array)h=n.FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?h=n.HALF_FLOAT:h=n.UNSIGNED_SHORT;else if(c instanceof Int16Array)h=n.SHORT;else if(c instanceof Uint32Array)h=n.UNSIGNED_INT;else if(c instanceof Int32Array)h=n.INT;else if(c instanceof Int8Array)h=n.BYTE;else if(c instanceof Uint8Array)h=n.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)h=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:d,type:h,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:f}}function i(a,l,c){const u=l.array,f=l.updateRanges;if(n.bindBuffer(c,a),f.length===0)n.bufferSubData(c,0,u);else{f.sort((h,p)=>h.start-p.start);let d=0;for(let h=1;h 0 + vec4 plane; + #ifdef ALPHA_TO_COVERAGE + float distanceToPlane, distanceGradient; + float clipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + if ( clipOpacity == 0.0 ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + float unionClipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + } + #pragma unroll_loop_end + clipOpacity *= 1.0 - unionClipOpacity; + #endif + diffuseColor.a *= clipOpacity; + if ( diffuseColor.a == 0.0 ) discard; + #else + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + bool clipped = true; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; + } + #pragma unroll_loop_end + if ( clipped ) discard; + #endif + #endif +#endif`,sD=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,rD=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,oD=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,aD=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,lD=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,cD=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + varying vec3 vColor; +#endif`,uD=`#if defined( USE_COLOR_ALPHA ) + vColor = vec4( 1.0 ); +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + vColor = vec3( 1.0 ); +#endif +#ifdef USE_COLOR + vColor *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.xyz *= instanceColor.xyz; +#endif +#ifdef USE_BATCHING_COLOR + vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); + vColor.xyz *= batchingColor.xyz; +#endif`,fD=`#define PI 3.141592653589793 +#define PI2 6.283185307179586 +#define PI_HALF 1.5707963267948966 +#define RECIPROCAL_PI 0.3183098861837907 +#define RECIPROCAL_PI2 0.15915494309189535 +#define EPSILON 1e-6 +#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +#define whiteComplement( a ) ( 1.0 - saturate( a ) ) +float pow2( const in float x ) { return x*x; } +vec3 pow2( const in vec3 x ) { return x*x; } +float pow3( const in float x ) { return x*x*x; } +float pow4( const in float x ) { float x2 = x*x; return x2*x2; } +float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } +float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } +highp float rand( const in vec2 uv ) { + const highp float a = 12.9898, b = 78.233, c = 43758.5453; + highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); + return fract( sin( sn ) * c ); +} +#ifdef HIGH_PRECISION + float precisionSafeLength( vec3 v ) { return length( v ); } +#else + float precisionSafeLength( vec3 v ) { + float maxComponent = max3( abs( v ) ); + return length( v / maxComponent ) * maxComponent; + } +#endif +struct IncidentLight { + vec3 color; + vec3 direction; + bool visible; +}; +struct ReflectedLight { + vec3 directDiffuse; + vec3 directSpecular; + vec3 indirectDiffuse; + vec3 indirectSpecular; +}; +#ifdef USE_ALPHAHASH + varying vec3 vPosition; +#endif +vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); +} +vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); +} +mat3 transposeMat3( const in mat3 m ) { + mat3 tmp; + tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); + tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); + tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); + return tmp; +} +bool isPerspectiveMatrix( mat4 m ) { + return m[ 2 ][ 3 ] == - 1.0; +} +vec2 equirectUv( in vec3 dir ) { + float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; + float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; + return vec2( u, v ); +} +vec3 BRDF_Lambert( const in vec3 diffuseColor ) { + return RECIPROCAL_PI * diffuseColor; +} +vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} +float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} // validated`,dD=`#ifdef ENVMAP_TYPE_CUBE_UV + #define cubeUV_minMipLevel 4.0 + #define cubeUV_minTileSize 16.0 + float getFace( vec3 direction ) { + vec3 absDirection = abs( direction ); + float face = - 1.0; + if ( absDirection.x > absDirection.z ) { + if ( absDirection.x > absDirection.y ) + face = direction.x > 0.0 ? 0.0 : 3.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } else { + if ( absDirection.z > absDirection.y ) + face = direction.z > 0.0 ? 2.0 : 5.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } + return face; + } + vec2 getUV( vec3 direction, float face ) { + vec2 uv; + if ( face == 0.0 ) { + uv = vec2( direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 1.0 ) { + uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); + } else if ( face == 2.0 ) { + uv = vec2( - direction.x, direction.y ) / abs( direction.z ); + } else if ( face == 3.0 ) { + uv = vec2( - direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 4.0 ) { + uv = vec2( - direction.x, direction.z ) / abs( direction.y ); + } else { + uv = vec2( direction.x, direction.y ) / abs( direction.z ); + } + return 0.5 * ( uv + 1.0 ); + } + vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { + float face = getFace( direction ); + float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); + mipInt = max( mipInt, cubeUV_minMipLevel ); + float faceSize = exp2( mipInt ); + highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; + if ( face > 2.0 ) { + uv.y += faceSize; + face -= 3.0; + } + uv.x += face * faceSize; + uv.x += filterInt * 3.0 * cubeUV_minTileSize; + uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); + uv.x *= CUBEUV_TEXEL_WIDTH; + uv.y *= CUBEUV_TEXEL_HEIGHT; + #ifdef texture2DGradEXT + return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; + #else + return texture2D( envMap, uv ).rgb; + #endif + } + #define cubeUV_r0 1.0 + #define cubeUV_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #define cubeUV_m6 4.0 + float roughnessToMip( float roughness ) { + float mip = 0.0; + if ( roughness >= cubeUV_r1 ) { + mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; + } else if ( roughness >= cubeUV_r4 ) { + mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; + } else if ( roughness >= cubeUV_r5 ) { + mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; + } else if ( roughness >= cubeUV_r6 ) { + mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; + } else { + mip = - 2.0 * log2( 1.16 * roughness ); } + return mip; + } + vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { + float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); + float mipF = fract( mip ); + float mipInt = floor( mip ); + vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); + if ( mipF == 0.0 ) { + return vec4( color0, 1.0 ); + } else { + vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); + return vec4( mix( color0, color1, mipF ), 1.0 ); + } + } +#endif`,hD=`vec3 transformedNormal = objectNormal; +#ifdef USE_TANGENT + vec3 transformedTangent = objectTangent; +#endif +#ifdef USE_BATCHING + mat3 bm = mat3( batchingMatrix ); + transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); + transformedNormal = bm * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = bm * transformedTangent; + #endif +#endif +#ifdef USE_INSTANCING + mat3 im = mat3( instanceMatrix ); + transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); + transformedNormal = im * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = im * transformedTangent; + #endif +#endif +transformedNormal = normalMatrix * transformedNormal; +#ifdef FLIP_SIDED + transformedNormal = - transformedNormal; +#endif +#ifdef USE_TANGENT + transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; + #ifdef FLIP_SIDED + transformedTangent = - transformedTangent; + #endif +#endif`,pD=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,mD=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,gD=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE + emissiveColor = sRGBTransferEOTF( emissiveColor ); + #endif + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,_D=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,vD="gl_FragColor = linearToOutputTexel( gl_FragColor );",yD=`vec4 LinearTransferOETF( in vec4 value ) { + return value; +} +vec4 sRGBTransferEOTF( in vec4 value ) { + return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); +} +vec4 sRGBTransferOETF( in vec4 value ) { + return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); +}`,bD=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vec3 cameraToFrag; + if ( isOrthographic ) { + cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToFrag = normalize( vWorldPosition - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vec3 reflectVec = reflect( cameraToFrag, worldNormal ); + #else + vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); + #endif + #else + vec3 reflectVec = vReflect; + #endif + #ifdef ENVMAP_TYPE_CUBE + vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); + #else + vec4 envColor = vec4( 0.0 ); + #endif + #ifdef ENVMAP_BLENDING_MULTIPLY + outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_MIX ) + outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_ADD ) + outgoingLight += envColor.xyz * specularStrength * reflectivity; + #endif +#endif`,xD=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + uniform mat3 envMapRotation; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif + +#endif`,MD=`#ifdef USE_ENVMAP + uniform float reflectivity; + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + varying vec3 vWorldPosition; + uniform float refractionRatio; + #else + varying vec3 vReflect; + #endif +#endif`,SD=`#ifdef USE_ENVMAP + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + + varying vec3 vWorldPosition; + #else + varying vec3 vReflect; + uniform float refractionRatio; + #endif +#endif`,ED=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vWorldPosition = worldPosition.xyz; + #else + vec3 cameraToVertex; + if ( isOrthographic ) { + cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vReflect = reflect( cameraToVertex, worldNormal ); + #else + vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); + #endif + #endif +#endif`,TD=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,wD=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,AD=`#ifdef USE_FOG + #ifdef FOG_EXP2 + float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); + #else + float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); + #endif + gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); +#endif`,CD=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,RD=`#ifdef USE_GRADIENTMAP + uniform sampler2D gradientMap; +#endif +vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { + float dotNL = dot( normal, lightDirection ); + vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); + #ifdef USE_GRADIENTMAP + return vec3( texture2D( gradientMap, coord ).r ); + #else + vec2 fw = fwidth( coord ) * 0.5; + return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); + #endif +}`,PD=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,ID=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,LD=`varying vec3 vViewPosition; +struct LambertMaterial { + vec3 diffuseColor; + float specularStrength; +}; +void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Lambert +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,DD=`uniform bool receiveShadow; +uniform vec3 ambientLightColor; +#if defined( USE_LIGHT_PROBES ) + uniform vec3 lightProbe[ 9 ]; +#endif +vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { + float x = normal.x, y = normal.y, z = normal.z; + vec3 result = shCoefficients[ 0 ] * 0.886227; + result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; + result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; + result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; + result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; + result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; + result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); + result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; + result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); + return result; +} +vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); + return irradiance; +} +vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { + vec3 irradiance = ambientLightColor; + return irradiance; +} +float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; +} +float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { + return smoothstep( coneCosine, penumbraCosine, angleCosine ); +} +#if NUM_DIR_LIGHTS > 0 + struct DirectionalLight { + vec3 direction; + vec3 color; + }; + uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; + void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { + light.color = directionalLight.color; + light.direction = directionalLight.direction; + light.visible = true; + } +#endif +#if NUM_POINT_LIGHTS > 0 + struct PointLight { + vec3 position; + vec3 color; + float distance; + float decay; + }; + uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; + void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = pointLight.position - geometryPosition; + light.direction = normalize( lVector ); + float lightDistance = length( lVector ); + light.color = pointLight.color; + light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } +#endif +#if NUM_SPOT_LIGHTS > 0 + struct SpotLight { + vec3 position; + vec3 direction; + vec3 color; + float distance; + float decay; + float coneCos; + float penumbraCos; + }; + uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; + void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = spotLight.position - geometryPosition; + light.direction = normalize( lVector ); + float angleCos = dot( light.direction, spotLight.direction ); + float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); + if ( spotAttenuation > 0.0 ) { + float lightDistance = length( lVector ); + light.color = spotLight.color * spotAttenuation; + light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } else { + light.color = vec3( 0.0 ); + light.visible = false; + } + } +#endif +#if NUM_RECT_AREA_LIGHTS > 0 + struct RectAreaLight { + vec3 color; + vec3 position; + vec3 halfWidth; + vec3 halfHeight; + }; + uniform sampler2D ltc_1; uniform sampler2D ltc_2; + uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; +#endif +#if NUM_HEMI_LIGHTS > 0 + struct HemisphereLight { + vec3 direction; + vec3 skyColor; + vec3 groundColor; + }; + uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; + vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { + float dotNL = dot( normal, hemiLight.direction ); + float hemiDiffuseWeight = 0.5 * dotNL + 0.5; + vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); + return irradiance; + } +#endif`,OD=`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); + return PI * envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 reflectVec = reflect( - viewDir, normal ); + reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); + reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); + return envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + #ifdef USE_ANISOTROPY + vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 bentNormal = cross( bitangent, viewDir ); + bentNormal = normalize( cross( bentNormal, bitangent ) ); + bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); + return getIBLRadiance( viewDir, bentNormal, roughness ); + #else + return vec3( 0.0 ); + #endif + } + #endif +#endif`,ND=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,UD=`varying vec3 vViewPosition; +struct ToonMaterial { + vec3 diffuseColor; +}; +void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Toon +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,FD=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,kD=`varying vec3 vViewPosition; +struct BlinnPhongMaterial { + vec3 diffuseColor; + vec3 specularColor; + float specularShininess; + float specularStrength; +}; +void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; +} +void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_BlinnPhong +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,BD=`PhysicalMaterial material; +material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); +vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); +float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); +material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; +material.roughness = min( material.roughness, 1.0 ); +#ifdef IOR + material.ior = ior; + #ifdef USE_SPECULAR + float specularIntensityFactor = specularIntensity; + vec3 specularColorFactor = specularColor; + #ifdef USE_SPECULAR_COLORMAP + specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; + #endif + material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); + #else + float specularIntensityFactor = 1.0; + vec3 specularColorFactor = vec3( 1.0 ); + material.specularF90 = 1.0; + #endif + material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); +#else + material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); + material.specularF90 = 1.0; +#endif +#ifdef USE_CLEARCOAT + material.clearcoat = clearcoat; + material.clearcoatRoughness = clearcoatRoughness; + material.clearcoatF0 = vec3( 0.04 ); + material.clearcoatF90 = 1.0; + #ifdef USE_CLEARCOATMAP + material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; + #endif + #ifdef USE_CLEARCOAT_ROUGHNESSMAP + material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; + #endif + material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); + material.clearcoatRoughness += geometryRoughness; + material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); +#endif +#ifdef USE_DISPERSION + material.dispersion = dispersion; +#endif +#ifdef USE_IRIDESCENCE + material.iridescence = iridescence; + material.iridescenceIOR = iridescenceIOR; + #ifdef USE_IRIDESCENCEMAP + material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; + #endif + #ifdef USE_IRIDESCENCE_THICKNESSMAP + material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; + #else + material.iridescenceThickness = iridescenceThicknessMaximum; + #endif +#endif +#ifdef USE_SHEEN + material.sheenColor = sheenColor; + #ifdef USE_SHEEN_COLORMAP + material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; + #endif + material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); + #ifdef USE_SHEEN_ROUGHNESSMAP + material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; + #endif +#endif +#ifdef USE_ANISOTROPY + #ifdef USE_ANISOTROPYMAP + mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); + vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; + vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; + #else + vec2 anisotropyV = anisotropyVector; + #endif + material.anisotropy = length( anisotropyV ); + if( material.anisotropy == 0.0 ) { + anisotropyV = vec2( 1.0, 0.0 ); + } else { + anisotropyV /= material.anisotropy; + material.anisotropy = saturate( material.anisotropy ); + } + material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); + material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; + material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; +#endif`,zD=`struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; + float dispersion; + #ifdef USE_CLEARCOAT + float clearcoat; + float clearcoatRoughness; + vec3 clearcoatF0; + float clearcoatF90; + #endif + #ifdef USE_IRIDESCENCE + float iridescence; + float iridescenceIOR; + float iridescenceThickness; + vec3 iridescenceFresnel; + vec3 iridescenceF0; + #endif + #ifdef USE_SHEEN + vec3 sheenColor; + float sheenRoughness; + #endif + #ifdef IOR + float ior; + #endif + #ifdef USE_TRANSMISSION + float transmission; + float transmissionAlpha; + float thickness; + float attenuationDistance; + vec3 attenuationColor; + #endif + #ifdef USE_ANISOTROPY + float anisotropy; + float alphaT; + vec3 anisotropyT; + vec3 anisotropyB; + #endif +}; +vec3 clearcoatSpecularDirect = vec3( 0.0 ); +vec3 clearcoatSpecularIndirect = vec3( 0.0 ); +vec3 sheenSpecularDirect = vec3( 0.0 ); +vec3 sheenSpecularIndirect = vec3(0.0 ); +vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { + float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); + float x2 = x * x; + float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); + return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); +} +float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { + float a2 = pow2( alpha ); + float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); + float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); + return 0.5 / max( gv + gl, EPSILON ); +} +float D_GGX( const in float alpha, const in float dotNH ) { + float a2 = pow2( alpha ); + float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; + return RECIPROCAL_PI * a2 / pow2( denom ); +} +#ifdef USE_ANISOTROPY + float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { + float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); + float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); + float v = 0.5 / ( gv + gl ); + return saturate(v); + } + float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { + float a2 = alphaT * alphaB; + highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); + highp float v2 = dot( v, v ); + float w2 = a2 / v2; + return RECIPROCAL_PI * a2 * pow2 ( w2 ); + } +#endif +#ifdef USE_CLEARCOAT + vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { + vec3 f0 = material.clearcoatF0; + float f90 = material.clearcoatF90; + float roughness = material.clearcoatRoughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + return F * ( V * D ); + } +#endif +vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 f0 = material.specularColor; + float f90 = material.specularF90; + float roughness = material.roughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + #ifdef USE_IRIDESCENCE + F = mix( F, material.iridescenceFresnel, material.iridescence ); + #endif + #ifdef USE_ANISOTROPY + float dotTL = dot( material.anisotropyT, lightDir ); + float dotTV = dot( material.anisotropyT, viewDir ); + float dotTH = dot( material.anisotropyT, halfDir ); + float dotBL = dot( material.anisotropyB, lightDir ); + float dotBV = dot( material.anisotropyB, viewDir ); + float dotBH = dot( material.anisotropyB, halfDir ); + float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); + float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); + #else + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + #endif + return F * ( V * D ); +} +vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { + const float LUT_SIZE = 64.0; + const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; + const float LUT_BIAS = 0.5 / LUT_SIZE; + float dotNV = saturate( dot( N, V ) ); + vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); + uv = uv * LUT_SCALE + LUT_BIAS; + return uv; +} +float LTC_ClippedSphereFormFactor( const in vec3 f ) { + float l = length( f ); + return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); +} +vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { + float x = dot( v1, v2 ); + float y = abs( x ); + float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; + float b = 3.4175940 + ( 4.1616724 + y ) * y; + float v = a / b; + float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; + return cross( v1, v2 ) * theta_sintheta; +} +vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { + vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; + vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; + vec3 lightNormal = cross( v1, v2 ); + if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); + vec3 T1, T2; + T1 = normalize( V - N * dot( V, N ) ); + T2 = - cross( N, T1 ); + mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); + vec3 coords[ 4 ]; + coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); + coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); + coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); + coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); + coords[ 0 ] = normalize( coords[ 0 ] ); + coords[ 1 ] = normalize( coords[ 1 ] ); + coords[ 2 ] = normalize( coords[ 2 ] ); + coords[ 3 ] = normalize( coords[ 3 ] ); + vec3 vectorFormFactor = vec3( 0.0 ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); + float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); + return vec3( result ); +} +#if defined( USE_SHEEN ) +float D_Charlie( float roughness, float dotNH ) { + float alpha = pow2( roughness ); + float invAlpha = 1.0 / alpha; + float cos2h = dotNH * dotNH; + float sin2h = max( 1.0 - cos2h, 0.0078125 ); + return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); +} +float V_Neubelt( float dotNV, float dotNL ) { + return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); +} +vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float D = D_Charlie( sheenRoughness, dotNH ); + float V = V_Neubelt( dotNV, dotNL ); + return sheenColor * ( D * V ); +} +#endif +float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + float r2 = roughness * roughness; + float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; + float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; + float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); + return saturate( DG * RECIPROCAL_PI ); +} +vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); + const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); + vec4 r = roughness * c0 + c1; + float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; + vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; + return fab; +} +vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { + vec2 fab = DFGApprox( normal, viewDir, roughness ); + return specularColor * fab.x + specularF90 * fab.y; +} +#ifdef USE_IRIDESCENCE +void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#else +void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#endif + vec2 fab = DFGApprox( normal, viewDir, roughness ); + #ifdef USE_IRIDESCENCE + vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); + #else + vec3 Fr = specularColor; + #endif + vec3 FssEss = Fr * fab.x + specularF90 * fab.y; + float Ess = fab.x + fab.y; + float Ems = 1.0 - Ess; + vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); + singleScatter += FssEss; + multiScatter += Fms * Ems; +} +#if NUM_RECT_AREA_LIGHTS > 0 + void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + vec3 normal = geometryNormal; + vec3 viewDir = geometryViewDir; + vec3 position = geometryPosition; + vec3 lightPos = rectAreaLight.position; + vec3 halfWidth = rectAreaLight.halfWidth; + vec3 halfHeight = rectAreaLight.halfHeight; + vec3 lightColor = rectAreaLight.color; + float roughness = material.roughness; + vec3 rectCoords[ 4 ]; + rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; + rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; + rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; + vec2 uv = LTC_Uv( normal, viewDir, roughness ); + vec4 t1 = texture2D( ltc_1, uv ); + vec4 t2 = texture2D( ltc_2, uv ); + mat3 mInv = mat3( + vec3( t1.x, 0, t1.y ), + vec3( 0, 1, 0 ), + vec3( t1.z, 0, t1.w ) + ); + vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); + reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); + reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); + } +#endif +void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + #ifdef USE_CLEARCOAT + float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); + vec3 ccIrradiance = dotNLcc * directLight.color; + clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); + #endif + #ifdef USE_SHEEN + sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); + #endif + reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { + #ifdef USE_CLEARCOAT + clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); + #endif + #ifdef USE_SHEEN + sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); + #endif + vec3 singleScattering = vec3( 0.0 ); + vec3 multiScattering = vec3( 0.0 ); + vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; + #ifdef USE_IRIDESCENCE + computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); + #else + computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); + #endif + vec3 totalScattering = singleScattering + multiScattering; + vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); + reflectedLight.indirectSpecular += radiance * singleScattering; + reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; + reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; +} +#define RE_Direct RE_Direct_Physical +#define RE_Direct_RectArea RE_Direct_RectArea_Physical +#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical +#define RE_IndirectSpecular RE_IndirectSpecular_Physical +float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { + return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); +}`,VD=` +vec3 geometryPosition = - vViewPosition; +vec3 geometryNormal = normal; +vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); +vec3 geometryClearcoatNormal = vec3( 0.0 ); +#ifdef USE_CLEARCOAT + geometryClearcoatNormal = clearcoatNormal; +#endif +#ifdef USE_IRIDESCENCE + float dotNVi = saturate( dot( normal, geometryViewDir ) ); + if ( material.iridescenceThickness == 0.0 ) { + material.iridescence = 0.0; + } else { + material.iridescence = saturate( material.iridescence ); + } + if ( material.iridescence > 0.0 ) { + material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); + material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); + } +#endif +IncidentLight directLight; +#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) + PointLight pointLight; + #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { + pointLight = pointLights[ i ]; + getPointLightInfo( pointLight, geometryPosition, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) + pointLightShadow = pointLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) + SpotLight spotLight; + vec4 spotColor; + vec3 spotLightCoord; + bool inSpotLightMap; + #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { + spotLight = spotLights[ i ]; + getSpotLightInfo( spotLight, geometryPosition, directLight ); + #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX + #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS + #else + #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #endif + #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) + spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; + inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); + spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); + directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; + #endif + #undef SPOT_LIGHT_MAP_INDEX + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + spotLightShadow = spotLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) + DirectionalLight directionalLight; + #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { + directionalLight = directionalLights[ i ]; + getDirectionalLightInfo( directionalLight, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) + directionalLightShadow = directionalLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) + RectAreaLight rectAreaLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { + rectAreaLight = rectAreaLights[ i ]; + RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if defined( RE_IndirectDiffuse ) + vec3 iblIrradiance = vec3( 0.0 ); + vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + #if defined( USE_LIGHT_PROBES ) + irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); + #endif + #if ( NUM_HEMI_LIGHTS > 0 ) + #pragma unroll_loop_start + for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); + } + #pragma unroll_loop_end + #endif +#endif +#if defined( RE_IndirectSpecular ) + vec3 radiance = vec3( 0.0 ); + vec3 clearcoatRadiance = vec3( 0.0 ); +#endif`,HD=`#if defined( RE_IndirectDiffuse ) + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + irradiance += lightMapIrradiance; + #endif + #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) + iblIrradiance += getIBLIrradiance( geometryNormal ); + #endif +#endif +#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) + #ifdef USE_ANISOTROPY + radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); + #else + radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); + #endif + #ifdef USE_CLEARCOAT + clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); + #endif +#endif`,GD=`#if defined( RE_IndirectDiffuse ) + RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif +#if defined( RE_IndirectSpecular ) + RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif`,WD=`#if defined( USE_LOGDEPTHBUF ) + gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,XD=`#if defined( USE_LOGDEPTHBUF ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,$D=`#ifdef USE_LOGDEPTHBUF + varying float vFragDepth; + varying float vIsPerspective; +#endif`,qD=`#ifdef USE_LOGDEPTHBUF + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); +#endif`,YD=`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,jD=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,KD=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + #if defined( USE_POINTS_UV ) + vec2 uv = vUv; + #else + vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; + #endif +#endif +#ifdef USE_MAP + diffuseColor *= texture2D( map, uv ); +#endif +#ifdef USE_ALPHAMAP + diffuseColor.a *= texture2D( alphaMap, uv ).g; +#endif`,ZD=`#if defined( USE_POINTS_UV ) + varying vec2 vUv; +#else + #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + uniform mat3 uvTransform; + #endif +#endif +#ifdef USE_MAP + uniform sampler2D map; +#endif +#ifdef USE_ALPHAMAP + uniform sampler2D alphaMap; +#endif`,JD=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,QD=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,eO=`#ifdef USE_INSTANCING_MORPH + float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; + } +#endif`,tO=`#if defined( USE_MORPHCOLORS ) + vColor *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + #if defined( USE_COLOR_ALPHA ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; + #elif defined( USE_COLOR ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; + #endif + } +#endif`,nO=`#ifdef USE_MORPHNORMALS + objectNormal *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,iO=`#ifdef USE_MORPHTARGETS + #ifndef USE_INSTANCING_MORPH + uniform float morphTargetBaseInfluence; + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + #endif + uniform sampler2DArray morphTargetsTexture; + uniform ivec2 morphTargetsTextureSize; + vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { + int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; + int y = texelIndex / morphTargetsTextureSize.x; + int x = texelIndex - y * morphTargetsTextureSize.x; + ivec3 morphUV = ivec3( x, y, morphTargetIndex ); + return texelFetch( morphTargetsTexture, morphUV, 0 ); + } +#endif`,sO=`#ifdef USE_MORPHTARGETS + transformed *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,rO=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#ifdef FLAT_SHADED + vec3 fdx = dFdx( vViewPosition ); + vec3 fdy = dFdy( vViewPosition ); + vec3 normal = normalize( cross( fdx, fdy ) ); +#else + vec3 normal = normalize( vNormal ); + #ifdef DOUBLE_SIDED + normal *= faceDirection; + #endif +#endif +#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) + #ifdef USE_TANGENT + mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn = getTangentFrame( - vViewPosition, normal, + #if defined( USE_NORMALMAP ) + vNormalMapUv + #elif defined( USE_CLEARCOAT_NORMALMAP ) + vClearcoatNormalMapUv + #else + vUv + #endif + ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn[0] *= faceDirection; + tbn[1] *= faceDirection; + #endif +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + #ifdef USE_TANGENT + mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn2[0] *= faceDirection; + tbn2[1] *= faceDirection; + #endif +#endif +vec3 nonPerturbedNormal = normal;`,oO=`#ifdef USE_NORMALMAP_OBJECTSPACE + normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + #ifdef FLIP_SIDED + normal = - normal; + #endif + #ifdef DOUBLE_SIDED + normal = normal * faceDirection; + #endif + normal = normalize( normalMatrix * normal ); +#elif defined( USE_NORMALMAP_TANGENTSPACE ) + vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + mapN.xy *= normalScale; + normal = normalize( tbn * mapN ); +#elif defined( USE_BUMPMAP ) + normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); +#endif`,aO=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,lO=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,cO=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,uO=`#ifdef USE_NORMALMAP + uniform sampler2D normalMap; + uniform vec2 normalScale; +#endif +#ifdef USE_NORMALMAP_OBJECTSPACE + uniform mat3 normalMatrix; +#endif +#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) + mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { + vec3 q0 = dFdx( eye_pos.xyz ); + vec3 q1 = dFdy( eye_pos.xyz ); + vec2 st0 = dFdx( uv.st ); + vec2 st1 = dFdy( uv.st ); + vec3 N = surf_norm; + vec3 q1perp = cross( q1, N ); + vec3 q0perp = cross( N, q0 ); + vec3 T = q1perp * st0.x + q0perp * st1.x; + vec3 B = q1perp * st0.y + q0perp * st1.y; + float det = max( dot( T, T ), dot( B, B ) ); + float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); + return mat3( T * scale, B * scale, N ); + } +#endif`,fO=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,dO=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,hO=`#ifdef USE_CLEARCOATMAP + uniform sampler2D clearcoatMap; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform sampler2D clearcoatNormalMap; + uniform vec2 clearcoatNormalScale; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform sampler2D clearcoatRoughnessMap; +#endif`,pO=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,mO=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,gO=`vec3 packNormalToRGB( const in vec3 normal ) { + return normalize( normal ) * 0.5 + 0.5; +} +vec3 unpackRGBToNormal( const in vec3 rgb ) { + return 2.0 * rgb.xyz - 1.0; +} +const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; +const float Inv255 = 1. / 255.; +const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); +const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); +const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); +const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); +vec4 packDepthToRGBA( const in float v ) { + if( v <= 0.0 ) + return vec4( 0., 0., 0., 0. ); + if( v >= 1.0 ) + return vec4( 1., 1., 1., 1. ); + float vuf; + float af = modf( v * PackFactors.a, vuf ); + float bf = modf( vuf * ShiftRight8, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); +} +vec3 packDepthToRGB( const in float v ) { + if( v <= 0.0 ) + return vec3( 0., 0., 0. ); + if( v >= 1.0 ) + return vec3( 1., 1., 1. ); + float vuf; + float bf = modf( v * PackFactors.b, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec3( vuf * Inv255, gf * PackUpscale, bf ); +} +vec2 packDepthToRG( const in float v ) { + if( v <= 0.0 ) + return vec2( 0., 0. ); + if( v >= 1.0 ) + return vec2( 1., 1. ); + float vuf; + float gf = modf( v * 256., vuf ); + return vec2( vuf * Inv255, gf ); +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors4 ); +} +float unpackRGBToDepth( const in vec3 v ) { + return dot( v, UnpackFactors3 ); +} +float unpackRGToDepth( const in vec2 v ) { + return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; +} +vec4 pack2HalfToRGBA( const in vec2 v ) { + vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); + return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); +} +vec2 unpackRGBATo2Half( const in vec4 v ) { + return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); +} +float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { + return ( viewZ + near ) / ( near - far ); +} +float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { + return depth * ( near - far ) - near; +} +float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { + return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); +} +float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { + return ( near * far ) / ( ( far - near ) * depth - far ); +}`,_O=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,vO=`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_BATCHING + mvPosition = batchingMatrix * mvPosition; +#endif +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,yO=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,bO=`#ifdef DITHERING + vec3 dithering( vec3 color ) { + float grid_position = rand( gl_FragCoord.xy ); + vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); + dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); + return color + dither_shift_RGB; + } +#endif`,xO=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,MO=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,SO=`#if NUM_SPOT_LIGHT_COORDS > 0 + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#if NUM_SPOT_LIGHT_MAPS > 0 + uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { + return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); + } + vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { + return unpackRGBATo2Half( texture2D( shadow, uv ) ); + } + float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ + float occlusion = 1.0; + vec2 distribution = texture2DDistribution( shadow, uv ); + float hard_shadow = step( compare , distribution.x ); + if (hard_shadow != 1.0 ) { + float distance = compare - distribution.x ; + float variance = max( 0.00000, distribution.y * distribution.y ); + float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); + } + return occlusion; + } + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + shadowCoord.z += shadowBias; + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + #if defined( SHADOWMAP_TYPE_PCF ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx0 = - texelSize.x * shadowRadius; + float dy0 = - texelSize.y * shadowRadius; + float dx1 = + texelSize.x * shadowRadius; + float dy1 = + texelSize.y * shadowRadius; + float dx2 = dx0 / 2.0; + float dy2 = dy0 / 2.0; + float dx3 = dx1 / 2.0; + float dy3 = dy1 / 2.0; + shadow = ( + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) + ) * ( 1.0 / 17.0 ); + #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx = texelSize.x; + float dy = texelSize.y; + vec2 uv = shadowCoord.xy; + vec2 f = fract( uv * shadowMapSize + 0.5 ); + uv -= f * texelSize; + shadow = ( + texture2DCompare( shadowMap, uv, shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), + f.x ), + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), + f.x ), + f.y ) + ) * ( 1.0 / 9.0 ); + #elif defined( SHADOWMAP_TYPE_VSM ) + shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); + #else + shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } + vec2 cubeToUV( vec3 v, float texelSizeY ) { + vec3 absV = abs( v ); + float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); + absV *= scaleToCube; + v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); + vec2 planar = v.xy; + float almostATexel = 1.5 * texelSizeY; + float almostOne = 1.0 - almostATexel; + if ( absV.z >= almostOne ) { + if ( v.z > 0.0 ) + planar.x = 4.0 - v.x; + } else if ( absV.x >= almostOne ) { + float signX = sign( v.x ); + planar.x = v.z * signX + 2.0 * signX; + } else if ( absV.y >= almostOne ) { + float signY = sign( v.y ); + planar.x = v.x + 2.0 * signY + 2.0; + planar.y = v.z * signY - 2.0; + } + return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); + } + float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + float shadow = 1.0; + vec3 lightToPosition = shadowCoord.xyz; + + float lightToPositionLength = length( lightToPosition ); + if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { + float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); + #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) + vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; + shadow = ( + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) + ) * ( 1.0 / 9.0 ); + #else + shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } +#endif`,EO=`#if NUM_SPOT_LIGHT_COORDS > 0 + uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,TO=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) + vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + vec4 shadowWorldPosition; +#endif +#if defined( USE_SHADOWMAP ) + #if NUM_DIR_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); + vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); + vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif +#endif +#if NUM_SPOT_LIGHT_COORDS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { + shadowWorldPosition = worldPosition; + #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; + #endif + vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end +#endif`,wO=`float getShadowMask() { + float shadow = 1.0; + #ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + directionalLight = directionalLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { + spotLight = spotLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + pointLight = pointLightShadows[ i ]; + shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,AO=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,CO=`#ifdef USE_SKINNING + uniform mat4 bindMatrix; + uniform mat4 bindMatrixInverse; + uniform highp sampler2D boneTexture; + mat4 getBoneMatrix( const in float i ) { + int size = textureSize( boneTexture, 0 ).x; + int j = int( i ) * 4; + int x = j % size; + int y = j / size; + vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); + vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); + vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); + vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); + return mat4( v1, v2, v3, v4 ); + } +#endif`,RO=`#ifdef USE_SKINNING + vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); + vec4 skinned = vec4( 0.0 ); + skinned += boneMatX * skinVertex * skinWeight.x; + skinned += boneMatY * skinVertex * skinWeight.y; + skinned += boneMatZ * skinVertex * skinWeight.z; + skinned += boneMatW * skinVertex * skinWeight.w; + transformed = ( bindMatrixInverse * skinned ).xyz; +#endif`,PO=`#ifdef USE_SKINNING + mat4 skinMatrix = mat4( 0.0 ); + skinMatrix += skinWeight.x * boneMatX; + skinMatrix += skinWeight.y * boneMatY; + skinMatrix += skinWeight.z * boneMatZ; + skinMatrix += skinWeight.w * boneMatW; + skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; + objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; + #ifdef USE_TANGENT + objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; + #endif +#endif`,IO=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,LO=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,DO=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,OO=`#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +uniform float toneMappingExposure; +vec3 LinearToneMapping( vec3 color ) { + return saturate( toneMappingExposure * color ); +} +vec3 ReinhardToneMapping( vec3 color ) { + color *= toneMappingExposure; + return saturate( color / ( vec3( 1.0 ) + color ) ); +} +vec3 CineonToneMapping( vec3 color ) { + color *= toneMappingExposure; + color = max( vec3( 0.0 ), color - 0.004 ); + return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); +} +vec3 RRTAndODTFit( vec3 v ) { + vec3 a = v * ( v + 0.0245786 ) - 0.000090537; + vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; + return a / b; +} +vec3 ACESFilmicToneMapping( vec3 color ) { + const mat3 ACESInputMat = mat3( + vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), + vec3( 0.04823, 0.01566, 0.83777 ) + ); + const mat3 ACESOutputMat = mat3( + vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), + vec3( -0.07367, -0.00605, 1.07602 ) + ); + color *= toneMappingExposure / 0.6; + color = ACESInputMat * color; + color = RRTAndODTFit( color ); + color = ACESOutputMat * color; + return saturate( color ); +} +const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( + vec3( 1.6605, - 0.1246, - 0.0182 ), + vec3( - 0.5876, 1.1329, - 0.1006 ), + vec3( - 0.0728, - 0.0083, 1.1187 ) +); +const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( + vec3( 0.6274, 0.0691, 0.0164 ), + vec3( 0.3293, 0.9195, 0.0880 ), + vec3( 0.0433, 0.0113, 0.8956 ) +); +vec3 agxDefaultContrastApprox( vec3 x ) { + vec3 x2 = x * x; + vec3 x4 = x2 * x2; + return + 15.5 * x4 * x2 + - 40.14 * x4 * x + + 31.96 * x4 + - 6.868 * x2 * x + + 0.4298 * x2 + + 0.1191 * x + - 0.00232; +} +vec3 AgXToneMapping( vec3 color ) { + const mat3 AgXInsetMatrix = mat3( + vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), + vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), + vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) + ); + const mat3 AgXOutsetMatrix = mat3( + vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), + vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), + vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) + ); + const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; + color *= toneMappingExposure; + color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; + color = AgXInsetMatrix * color; + color = max( color, 1e-10 ); color = log2( color ); + color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); + color = clamp( color, 0.0, 1.0 ); + color = agxDefaultContrastApprox( color ); + color = AgXOutsetMatrix * color; + color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); + color = LINEAR_REC2020_TO_LINEAR_SRGB * color; + color = clamp( color, 0.0, 1.0 ); + return color; +} +vec3 NeutralToneMapping( vec3 color ) { + const float StartCompression = 0.8 - 0.04; + const float Desaturation = 0.15; + color *= toneMappingExposure; + float x = min( color.r, min( color.g, color.b ) ); + float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; + color -= offset; + float peak = max( color.r, max( color.g, color.b ) ); + if ( peak < StartCompression ) return color; + float d = 1. - StartCompression; + float newPeak = 1. - d * d / ( peak + d - StartCompression ); + color *= newPeak / peak; + float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); + return mix( color, vec3( newPeak ), g ); +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,NO=`#ifdef USE_TRANSMISSION + material.transmission = transmission; + material.transmissionAlpha = 1.0; + material.thickness = thickness; + material.attenuationDistance = attenuationDistance; + material.attenuationColor = attenuationColor; + #ifdef USE_TRANSMISSIONMAP + material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; + #endif + #ifdef USE_THICKNESSMAP + material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; + #endif + vec3 pos = vWorldPosition; + vec3 v = normalize( cameraPosition - pos ); + vec3 n = inverseTransformDirection( normal, viewMatrix ); + vec4 transmitted = getIBLVolumeRefraction( + n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, + material.attenuationColor, material.attenuationDistance ); + material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); + totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); +#endif`,UO=`#ifdef USE_TRANSMISSION + uniform float transmission; + uniform float thickness; + uniform float attenuationDistance; + uniform vec3 attenuationColor; + #ifdef USE_TRANSMISSIONMAP + uniform sampler2D transmissionMap; + #endif + #ifdef USE_THICKNESSMAP + uniform sampler2D thicknessMap; + #endif + uniform vec2 transmissionSamplerSize; + uniform sampler2D transmissionSamplerMap; + uniform mat4 modelMatrix; + uniform mat4 projectionMatrix; + varying vec3 vWorldPosition; + float w0( float a ) { + return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); + } + float w1( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); + } + float w2( float a ){ + return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); + } + float w3( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * a ); + } + float g0( float a ) { + return w0( a ) + w1( a ); + } + float g1( float a ) { + return w2( a ) + w3( a ); + } + float h0( float a ) { + return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); + } + float h1( float a ) { + return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); + } + vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { + uv = uv * texelSize.zw + 0.5; + vec2 iuv = floor( uv ); + vec2 fuv = fract( uv ); + float g0x = g0( fuv.x ); + float g1x = g1( fuv.x ); + float h0x = h0( fuv.x ); + float h1x = h1( fuv.x ); + float h0y = h0( fuv.y ); + float h1y = h1( fuv.y ); + vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); + } + vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { + vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); + vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); + vec2 fLodSizeInv = 1.0 / fLodSize; + vec2 cLodSizeInv = 1.0 / cLodSize; + vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); + vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); + return mix( fSample, cSample, fract( lod ) ); + } + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { + vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); + vec3 modelScale; + modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); + modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); + modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); + return normalize( refractionVector ) * thickness * modelScale; + } + float applyIorToRoughness( const in float roughness, const in float ior ) { + return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); + } + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { + float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); + return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); + } + vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { + if ( isinf( attenuationDistance ) ) { + return vec3( 1.0 ); + } else { + vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; + vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; + } + } + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec4 transmittedLight; + vec3 transmittance; + #ifdef USE_DISPERSION + float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; + vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); + for ( int i = 0; i < 3; i ++ ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); + transmittedLight[ i ] = transmissionSample[ i ]; + transmittedLight.a += transmissionSample.a; + transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; + } + transmittedLight.a /= 3.0; + #else + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + #endif + vec3 attenuatedColor = transmittance * transmittedLight.rgb; + vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); + float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; + return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); + } +#endif`,FO=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + varying vec2 vNormalMapUv; +#endif +#ifdef USE_EMISSIVEMAP + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_SPECULARMAP + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,kO=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + uniform mat3 mapTransform; + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + uniform mat3 alphaMapTransform; + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + uniform mat3 lightMapTransform; + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + uniform mat3 aoMapTransform; + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + uniform mat3 bumpMapTransform; + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + uniform mat3 normalMapTransform; + varying vec2 vNormalMapUv; +#endif +#ifdef USE_DISPLACEMENTMAP + uniform mat3 displacementMapTransform; + varying vec2 vDisplacementMapUv; +#endif +#ifdef USE_EMISSIVEMAP + uniform mat3 emissiveMapTransform; + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + uniform mat3 metalnessMapTransform; + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + uniform mat3 roughnessMapTransform; + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + uniform mat3 anisotropyMapTransform; + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + uniform mat3 clearcoatMapTransform; + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform mat3 clearcoatNormalMapTransform; + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform mat3 clearcoatRoughnessMapTransform; + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + uniform mat3 sheenColorMapTransform; + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + uniform mat3 sheenRoughnessMapTransform; + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + uniform mat3 iridescenceMapTransform; + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform mat3 iridescenceThicknessMapTransform; + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SPECULARMAP + uniform mat3 specularMapTransform; + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + uniform mat3 specularColorMapTransform; + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + uniform mat3 specularIntensityMapTransform; + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,BO=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + vUv = vec3( uv, 1 ).xy; +#endif +#ifdef USE_MAP + vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ALPHAMAP + vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_LIGHTMAP + vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_AOMAP + vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_BUMPMAP + vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_NORMALMAP + vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_DISPLACEMENTMAP + vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_EMISSIVEMAP + vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_METALNESSMAP + vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ROUGHNESSMAP + vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ANISOTROPYMAP + vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOATMAP + vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCEMAP + vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_COLORMAP + vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULARMAP + vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_COLORMAP + vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_TRANSMISSIONMAP + vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_THICKNESSMAP + vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; +#endif`,zO=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 + vec4 worldPosition = vec4( transformed, 1.0 ); + #ifdef USE_BATCHING + worldPosition = batchingMatrix * worldPosition; + #endif + #ifdef USE_INSTANCING + worldPosition = instanceMatrix * worldPosition; + #endif + worldPosition = modelMatrix * worldPosition; +#endif`;const VO=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,HO=`uniform sampler2D t2D; +uniform float backgroundIntensity; +varying vec2 vUv; +void main() { + vec4 texColor = texture2D( t2D, vUv ); + #ifdef DECODE_VIDEO_TEXTURE + texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,GO=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,WO=`#ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; +#elif defined( ENVMAP_TYPE_CUBE_UV ) + uniform sampler2D envMap; +#endif +uniform float flipEnvMap; +uniform float backgroundBlurriness; +uniform float backgroundIntensity; +uniform mat3 backgroundRotation; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,XO=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,$O=`uniform samplerCube tCube; +uniform float tFlip; +uniform float opacity; +varying vec3 vWorldDirection; +void main() { + vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); + gl_FragColor = texColor; + gl_FragColor.a *= opacity; + #include + #include +}`,qO=`#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,YO=`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + vec4 diffuseColor = vec4( 1.0 ); + #include + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + #include + float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; + #if DEPTH_PACKING == 3200 + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); + #elif DEPTH_PACKING == 3201 + gl_FragColor = packDepthToRGBA( fragCoordZ ); + #elif DEPTH_PACKING == 3202 + gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); + #elif DEPTH_PACKING == 3203 + gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); + #endif +}`,jO=`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,KO=`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +#include +void main () { + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = packDepthToRGBA( dist ); +}`,ZO=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,JO=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,QO=`uniform float scale; +attribute float lineDistance; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vLineDistance = scale * lineDistance; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,eN=`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,tN=`#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,nN=`uniform vec3 diffuse; +uniform float opacity; +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; + #else + reflectedLight.indirectDiffuse += vec3( 1.0 ); + #endif + #include + reflectedLight.indirectDiffuse *= diffuseColor.rgb; + vec3 outgoingLight = reflectedLight.indirectDiffuse; + #include + #include + #include + #include + #include + #include + #include +}`,iN=`#define LAMBERT +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,sN=`#define LAMBERT +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,rN=`#define MATCAP +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; +}`,oN=`#define MATCAP +uniform vec3 diffuse; +uniform float opacity; +uniform sampler2D matcap; +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 viewDir = normalize( vViewPosition ); + vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); + vec3 y = cross( viewDir, x ); + vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; + #ifdef USE_MATCAP + vec4 matcapColor = texture2D( matcap, uv ); + #else + vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); + #endif + vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; + #include + #include + #include + #include + #include + #include +}`,aN=`#define NORMAL +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + vViewPosition = - mvPosition.xyz; +#endif +}`,lN=`#define NORMAL +uniform float opacity; +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,cN=`#define PHONG +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,uN=`#define PHONG +uniform vec3 diffuse; +uniform vec3 emissive; +uniform vec3 specular; +uniform float shininess; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,fN=`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,dN=`#define STANDARD +#ifdef PHYSICAL + #define IOR + #define USE_SPECULAR +#endif +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float roughness; +uniform float metalness; +uniform float opacity; +#ifdef IOR + uniform float ior; +#endif +#ifdef USE_SPECULAR + uniform float specularIntensity; + uniform vec3 specularColor; + #ifdef USE_SPECULAR_COLORMAP + uniform sampler2D specularColorMap; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + uniform sampler2D specularIntensityMap; + #endif +#endif +#ifdef USE_CLEARCOAT + uniform float clearcoat; + uniform float clearcoatRoughness; +#endif +#ifdef USE_DISPERSION + uniform float dispersion; +#endif +#ifdef USE_IRIDESCENCE + uniform float iridescence; + uniform float iridescenceIOR; + uniform float iridescenceThicknessMinimum; + uniform float iridescenceThicknessMaximum; +#endif +#ifdef USE_SHEEN + uniform vec3 sheenColor; + uniform float sheenRoughness; + #ifdef USE_SHEEN_COLORMAP + uniform sampler2D sheenColorMap; + #endif + #ifdef USE_SHEEN_ROUGHNESSMAP + uniform sampler2D sheenRoughnessMap; + #endif +#endif +#ifdef USE_ANISOTROPY + uniform vec2 anisotropyVector; + #ifdef USE_ANISOTROPYMAP + uniform sampler2D anisotropyMap; + #endif +#endif +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; + #include + vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; + #ifdef USE_SHEEN + float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); + outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; + #endif + #ifdef USE_CLEARCOAT + float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); + vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); + outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; + #endif + #include + #include + #include + #include + #include + #include +}`,hN=`#define TOON +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,pN=`#define TOON +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include +}`,mN=`uniform float size; +uniform float scale; +#include +#include +#include +#include +#include +#include +#ifdef USE_POINTS_UV + varying vec2 vUv; + uniform mat3 uvTransform; +#endif +void main() { + #ifdef USE_POINTS_UV + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + #endif + #include + #include + #include + #include + #include + #include + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,gN=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,_N=`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,vN=`uniform vec3 color; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); + #include + #include + #include +}`,yN=`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix[ 3 ]; + vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); + #ifndef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + #endif + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; + 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; + #include + #include + #include +}`,bN=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`,ct={alphahash_fragment:HL,alphahash_pars_fragment:GL,alphamap_fragment:WL,alphamap_pars_fragment:XL,alphatest_fragment:$L,alphatest_pars_fragment:qL,aomap_fragment:YL,aomap_pars_fragment:jL,batching_pars_vertex:KL,batching_vertex:ZL,begin_vertex:JL,beginnormal_vertex:QL,bsdfs:eD,iridescence_fragment:tD,bumpmap_pars_fragment:nD,clipping_planes_fragment:iD,clipping_planes_pars_fragment:sD,clipping_planes_pars_vertex:rD,clipping_planes_vertex:oD,color_fragment:aD,color_pars_fragment:lD,color_pars_vertex:cD,color_vertex:uD,common:fD,cube_uv_reflection_fragment:dD,defaultnormal_vertex:hD,displacementmap_pars_vertex:pD,displacementmap_vertex:mD,emissivemap_fragment:gD,emissivemap_pars_fragment:_D,colorspace_fragment:vD,colorspace_pars_fragment:yD,envmap_fragment:bD,envmap_common_pars_fragment:xD,envmap_pars_fragment:MD,envmap_pars_vertex:SD,envmap_physical_pars_fragment:OD,envmap_vertex:ED,fog_vertex:TD,fog_pars_vertex:wD,fog_fragment:AD,fog_pars_fragment:CD,gradientmap_pars_fragment:RD,lightmap_pars_fragment:PD,lights_lambert_fragment:ID,lights_lambert_pars_fragment:LD,lights_pars_begin:DD,lights_toon_fragment:ND,lights_toon_pars_fragment:UD,lights_phong_fragment:FD,lights_phong_pars_fragment:kD,lights_physical_fragment:BD,lights_physical_pars_fragment:zD,lights_fragment_begin:VD,lights_fragment_maps:HD,lights_fragment_end:GD,logdepthbuf_fragment:WD,logdepthbuf_pars_fragment:XD,logdepthbuf_pars_vertex:$D,logdepthbuf_vertex:qD,map_fragment:YD,map_pars_fragment:jD,map_particle_fragment:KD,map_particle_pars_fragment:ZD,metalnessmap_fragment:JD,metalnessmap_pars_fragment:QD,morphinstance_vertex:eO,morphcolor_vertex:tO,morphnormal_vertex:nO,morphtarget_pars_vertex:iO,morphtarget_vertex:sO,normal_fragment_begin:rO,normal_fragment_maps:oO,normal_pars_fragment:aO,normal_pars_vertex:lO,normal_vertex:cO,normalmap_pars_fragment:uO,clearcoat_normal_fragment_begin:fO,clearcoat_normal_fragment_maps:dO,clearcoat_pars_fragment:hO,iridescence_pars_fragment:pO,opaque_fragment:mO,packing:gO,premultiplied_alpha_fragment:_O,project_vertex:vO,dithering_fragment:yO,dithering_pars_fragment:bO,roughnessmap_fragment:xO,roughnessmap_pars_fragment:MO,shadowmap_pars_fragment:SO,shadowmap_pars_vertex:EO,shadowmap_vertex:TO,shadowmask_pars_fragment:wO,skinbase_vertex:AO,skinning_pars_vertex:CO,skinning_vertex:RO,skinnormal_vertex:PO,specularmap_fragment:IO,specularmap_pars_fragment:LO,tonemapping_fragment:DO,tonemapping_pars_fragment:OO,transmission_fragment:NO,transmission_pars_fragment:UO,uv_pars_fragment:FO,uv_pars_vertex:kO,uv_vertex:BO,worldpos_vertex:zO,background_vert:VO,background_frag:HO,backgroundCube_vert:GO,backgroundCube_frag:WO,cube_vert:XO,cube_frag:$O,depth_vert:qO,depth_frag:YO,distanceRGBA_vert:jO,distanceRGBA_frag:KO,equirect_vert:ZO,equirect_frag:JO,linedashed_vert:QO,linedashed_frag:eN,meshbasic_vert:tN,meshbasic_frag:nN,meshlambert_vert:iN,meshlambert_frag:sN,meshmatcap_vert:rN,meshmatcap_frag:oN,meshnormal_vert:aN,meshnormal_frag:lN,meshphong_vert:cN,meshphong_frag:uN,meshphysical_vert:fN,meshphysical_frag:dN,meshtoon_vert:hN,meshtoon_frag:pN,points_vert:mN,points_frag:gN,shadow_vert:_N,shadow_frag:vN,sprite_vert:yN,sprite_frag:bN},Te={common:{diffuse:{value:new Ae(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new st},alphaMap:{value:null},alphaMapTransform:{value:new st},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new st}},envmap:{envMap:{value:null},envMapRotation:{value:new st},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new st}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new st}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new st},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new st},normalScale:{value:new de(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new st},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new st}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new st}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new st}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ae(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ae(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new st},alphaTest:{value:0},uvTransform:{value:new st}},sprite:{diffuse:{value:new Ae(16777215)},opacity:{value:1},center:{value:new de(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new st},alphaMap:{value:null},alphaMapTransform:{value:new st},alphaTest:{value:0}}},Pi={basic:{uniforms:Ln([Te.common,Te.specularmap,Te.envmap,Te.aomap,Te.lightmap,Te.fog]),vertexShader:ct.meshbasic_vert,fragmentShader:ct.meshbasic_frag},lambert:{uniforms:Ln([Te.common,Te.specularmap,Te.envmap,Te.aomap,Te.lightmap,Te.emissivemap,Te.bumpmap,Te.normalmap,Te.displacementmap,Te.fog,Te.lights,{emissive:{value:new Ae(0)}}]),vertexShader:ct.meshlambert_vert,fragmentShader:ct.meshlambert_frag},phong:{uniforms:Ln([Te.common,Te.specularmap,Te.envmap,Te.aomap,Te.lightmap,Te.emissivemap,Te.bumpmap,Te.normalmap,Te.displacementmap,Te.fog,Te.lights,{emissive:{value:new Ae(0)},specular:{value:new Ae(1118481)},shininess:{value:30}}]),vertexShader:ct.meshphong_vert,fragmentShader:ct.meshphong_frag},standard:{uniforms:Ln([Te.common,Te.envmap,Te.aomap,Te.lightmap,Te.emissivemap,Te.bumpmap,Te.normalmap,Te.displacementmap,Te.roughnessmap,Te.metalnessmap,Te.fog,Te.lights,{emissive:{value:new Ae(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ct.meshphysical_vert,fragmentShader:ct.meshphysical_frag},toon:{uniforms:Ln([Te.common,Te.aomap,Te.lightmap,Te.emissivemap,Te.bumpmap,Te.normalmap,Te.displacementmap,Te.gradientmap,Te.fog,Te.lights,{emissive:{value:new Ae(0)}}]),vertexShader:ct.meshtoon_vert,fragmentShader:ct.meshtoon_frag},matcap:{uniforms:Ln([Te.common,Te.bumpmap,Te.normalmap,Te.displacementmap,Te.fog,{matcap:{value:null}}]),vertexShader:ct.meshmatcap_vert,fragmentShader:ct.meshmatcap_frag},points:{uniforms:Ln([Te.points,Te.fog]),vertexShader:ct.points_vert,fragmentShader:ct.points_frag},dashed:{uniforms:Ln([Te.common,Te.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ct.linedashed_vert,fragmentShader:ct.linedashed_frag},depth:{uniforms:Ln([Te.common,Te.displacementmap]),vertexShader:ct.depth_vert,fragmentShader:ct.depth_frag},normal:{uniforms:Ln([Te.common,Te.bumpmap,Te.normalmap,Te.displacementmap,{opacity:{value:1}}]),vertexShader:ct.meshnormal_vert,fragmentShader:ct.meshnormal_frag},sprite:{uniforms:Ln([Te.sprite,Te.fog]),vertexShader:ct.sprite_vert,fragmentShader:ct.sprite_frag},background:{uniforms:{uvTransform:{value:new st},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:ct.background_vert,fragmentShader:ct.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new st}},vertexShader:ct.backgroundCube_vert,fragmentShader:ct.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ct.cube_vert,fragmentShader:ct.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ct.equirect_vert,fragmentShader:ct.equirect_frag},distanceRGBA:{uniforms:Ln([Te.common,Te.displacementmap,{referencePosition:{value:new z},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ct.distanceRGBA_vert,fragmentShader:ct.distanceRGBA_frag},shadow:{uniforms:Ln([Te.lights,Te.fog,{color:{value:new Ae(0)},opacity:{value:1}}]),vertexShader:ct.shadow_vert,fragmentShader:ct.shadow_frag}};Pi.physical={uniforms:Ln([Pi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new st},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new st},clearcoatNormalScale:{value:new de(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new st},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new st},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new st},sheen:{value:0},sheenColor:{value:new Ae(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new st},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new st},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new st},transmissionSamplerSize:{value:new de},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new st},attenuationDistance:{value:0},attenuationColor:{value:new Ae(0)},specularColor:{value:new Ae(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new st},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new st},anisotropyVector:{value:new de},anisotropyMap:{value:null},anisotropyMapTransform:{value:new st}}]),vertexShader:ct.meshphysical_vert,fragmentShader:ct.meshphysical_frag};const Zu={r:0,b:0,g:0},Zr=new li,xN=new qe;function MN(n,e,t,i,s,r,o){const a=new Ae(0);let l=r===!0?0:1,c,u,f=null,d=0,h=null;function p(b){let v=b.isScene===!0?b.background:null;return v&&v.isTexture&&(v=(b.backgroundBlurriness>0?t:e).get(v)),v}function _(b){let v=!1;const E=p(b);E===null?m(a,l):E&&E.isColor&&(m(E,1),v=!0);const T=n.xr.getEnvironmentBlendMode();T==="additive"?i.buffers.color.setClear(0,0,0,1,o):T==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||v)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function g(b,v){const E=p(v);E&&(E.isCubeTexture||E.mapping===Fa)?(u===void 0&&(u=new $t(new Ro(1,1,1),new zi({name:"BackgroundCubeMaterial",uniforms:Aa(Pi.backgroundCube.uniforms),vertexShader:Pi.backgroundCube.vertexShader,fragmentShader:Pi.backgroundCube.fragmentShader,side:Vn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(T,S,P){this.matrixWorld.copyPosition(P.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(u)),Zr.copy(v.backgroundRotation),Zr.x*=-1,Zr.y*=-1,Zr.z*=-1,E.isCubeTexture&&E.isRenderTargetTexture===!1&&(Zr.y*=-1,Zr.z*=-1),u.material.uniforms.envMap.value=E,u.material.uniforms.flipEnvMap.value=E.isCubeTexture&&E.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(xN.makeRotationFromEuler(Zr)),u.material.toneMapped=ft.getTransfer(E.colorSpace)!==wt,(f!==E||d!==E.version||h!==n.toneMapping)&&(u.material.needsUpdate=!0,f=E,d=E.version,h=n.toneMapping),u.layers.enableAll(),b.unshift(u,u.geometry,u.material,0,0,null)):E&&E.isTexture&&(c===void 0&&(c=new $t(new Va(2,2),new zi({name:"BackgroundMaterial",uniforms:Aa(Pi.background.uniforms),vertexShader:Pi.background.vertexShader,fragmentShader:Pi.background.fragmentShader,side:Us,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(c)),c.material.uniforms.t2D.value=E,c.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,c.material.toneMapped=ft.getTransfer(E.colorSpace)!==wt,E.matrixAutoUpdate===!0&&E.updateMatrix(),c.material.uniforms.uvTransform.value.copy(E.matrix),(f!==E||d!==E.version||h!==n.toneMapping)&&(c.material.needsUpdate=!0,f=E,d=E.version,h=n.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null))}function m(b,v){b.getRGB(Zu,iE(n)),i.buffers.color.setClear(Zu.r,Zu.g,Zu.b,v,o)}function y(){u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return a},setClearColor:function(b,v=1){a.set(b),l=v,m(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,m(a,l)},render:_,addToRenderList:g,dispose:y}}function SN(n,e){const t=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},s=d(null);let r=s,o=!1;function a(M,I,N,V,j){let te=!1;const Z=f(V,N,I);r!==Z&&(r=Z,c(r.object)),te=h(M,V,N,j),te&&p(M,V,N,j),j!==null&&e.update(j,n.ELEMENT_ARRAY_BUFFER),(te||o)&&(o=!1,v(M,I,N,V),j!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get(j).buffer))}function l(){return n.createVertexArray()}function c(M){return n.bindVertexArray(M)}function u(M){return n.deleteVertexArray(M)}function f(M,I,N){const V=N.wireframe===!0;let j=i[M.id];j===void 0&&(j={},i[M.id]=j);let te=j[I.id];te===void 0&&(te={},j[I.id]=te);let Z=te[V];return Z===void 0&&(Z=d(l()),te[V]=Z),Z}function d(M){const I=[],N=[],V=[];for(let j=0;j=0){const be=j[J];let se=te[J];if(se===void 0&&(J==="instanceMatrix"&&M.instanceMatrix&&(se=M.instanceMatrix),J==="instanceColor"&&M.instanceColor&&(se=M.instanceColor)),be===void 0||be.attribute!==se||se&&be.data!==se.data)return!0;Z++}return r.attributesNum!==Z||r.index!==V}function p(M,I,N,V){const j={},te=I.attributes;let Z=0;const ee=N.getAttributes();for(const J in ee)if(ee[J].location>=0){let be=te[J];be===void 0&&(J==="instanceMatrix"&&M.instanceMatrix&&(be=M.instanceMatrix),J==="instanceColor"&&M.instanceColor&&(be=M.instanceColor));const se={};se.attribute=be,be&&be.data&&(se.data=be.data),j[J]=se,Z++}r.attributes=j,r.attributesNum=Z,r.index=V}function _(){const M=r.newAttributes;for(let I=0,N=M.length;I=0){let he=j[ee];if(he===void 0&&(ee==="instanceMatrix"&&M.instanceMatrix&&(he=M.instanceMatrix),ee==="instanceColor"&&M.instanceColor&&(he=M.instanceColor)),he!==void 0){const be=he.normalized,se=he.itemSize,ye=e.get(he);if(ye===void 0)continue;const Be=ye.buffer,re=ye.type,ge=ye.bytesPerElement,xe=re===n.INT||re===n.UNSIGNED_INT||he.gpuType===oh;if(he.isInterleavedBufferAttribute){const $=he.data,ae=$.stride,le=he.offset;if($.isInstancedInterleavedBuffer){for(let ce=0;ce0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";S="mediump"}return S==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=t.precision!==void 0?t.precision:"highp";const u=l(c);u!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const f=t.logarithmicDepthBuffer===!0,d=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),h=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),p=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=n.getParameter(n.MAX_TEXTURE_SIZE),g=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),m=n.getParameter(n.MAX_VERTEX_ATTRIBS),y=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),b=n.getParameter(n.MAX_VARYING_VECTORS),v=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),E=p>0,T=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:f,reverseDepthBuffer:d,maxTextures:h,maxVertexTextures:p,maxTextureSize:_,maxCubemapSize:g,maxAttributes:m,maxVertexUniforms:y,maxVaryings:b,maxFragmentUniforms:v,vertexTextures:E,maxSamples:T}}function wN(n){const e=this;let t=null,i=0,s=!1,r=!1;const o=new lr,a=new st,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,d){const h=f.length!==0||d||i!==0||s;return s=d,i=f.length,h},this.beginShadows=function(){r=!0,u(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(f,d){t=u(f,d,0)},this.setState=function(f,d,h){const p=f.clippingPlanes,_=f.clipIntersection,g=f.clipShadows,m=n.get(f);if(!s||p===null||p.length===0||r&&!g)r?u(null):c();else{const y=r?0:i,b=y*4;let v=m.clippingState||null;l.value=v,v=u(p,d,b,h);for(let E=0;E!==b;++E)v[E]=t[E];m.clippingState=v,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=y}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function u(f,d,h,p){const _=f!==null?f.length:0;let g=null;if(_!==0){if(g=l.value,p!==!0||g===null){const m=h+_*4,y=d.matrixWorldInverse;a.getNormalMatrix(y),(g===null||g.length0){const c=new oE(l.height);return c.fromEquirectangularTexture(n,o),e.set(o,c),o.addEventListener("dispose",s),t(c.texture,o.mapping)}else return null}}return o}function s(o){const a=o.target;a.removeEventListener("dispose",s);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function r(){e=new WeakMap}return{get:i,dispose:r}}const ua=4,fb=[.125,.215,.35,.446,.526,.582],oo=20,nm=new Fh,db=new Ae;let im=null,sm=0,rm=0,om=!1;const io=(1+Math.sqrt(5))/2,ta=1/io,hb=[new z(-io,ta,0),new z(io,ta,0),new z(-ta,0,io),new z(ta,0,io),new z(0,io,-ta),new z(0,io,ta),new z(-1,1,-1),new z(1,1,-1),new z(-1,1,1),new z(1,1,1)],CN=new z;class Eg{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,s=100,r={}){const{size:o=256,position:a=CN}=r;im=this._renderer.getRenderTarget(),sm=this._renderer.getActiveCubeFace(),rm=this._renderer.getActiveMipmapLevel(),om=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(o);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,i,s,l,a),t>0&&this._blur(l,0,0,t),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=gb(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=mb(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?v:0,v,v),f.setRenderTarget(s),g&&f.render(_,l),f.render(e,l)}_.geometry.dispose(),_.material.dispose(),f.toneMapping=h,f.autoClear=d,e.background=m}_textureToCubeUV(e,t){const i=this._renderer,s=e.mapping===Fs||e.mapping===yr;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=gb()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=mb());const r=s?this._cubemapMaterial:this._equirectMaterial,o=new $t(this._lodPlanes[0],r),a=r.uniforms;a.envMap.value=e;const l=this._cubeSize;Ju(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,nm)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;const s=this._lodPlanes.length;for(let r=1;roo&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${oo}`);const m=[];let y=0;for(let S=0;Sb-ua?s-b+ua:0),T=4*(this._cubeSize-v);Ju(t,E,T,3*v,2*v),l.setRenderTarget(t),l.render(f,nm)}}function RN(n){const e=[],t=[],i=[];let s=n;const r=n-ua+1+fb.length;for(let o=0;on-ua?l=fb[o-n+ua-1]:o===0&&(l=0),i.push(l);const c=1/(a-2),u=-c,f=1+c,d=[u,u,f,u,f,f,u,u,f,f,u,f],h=6,p=6,_=3,g=2,m=1,y=new Float32Array(_*p*h),b=new Float32Array(g*p*h),v=new Float32Array(m*p*h);for(let T=0;T2?0:-1,x=[S,P,0,S+2/3,P,0,S+2/3,P+1,0,S,P,0,S+2/3,P+1,0,S,P+1,0];y.set(x,_*p*T),b.set(d,g*p*T);const M=[T,T,T,T,T,T];v.set(M,m*p*T)}const E=new ot;E.setAttribute("position",new Ct(y,_)),E.setAttribute("uv",new Ct(b,g)),E.setAttribute("faceIndex",new Ct(v,m)),e.push(E),s>ua&&s--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function pb(n,e,t){const i=new os(n,e,t);return i.texture.mapping=Fa,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Ju(n,e,t,i,s){n.viewport.set(e,t,i,s),n.scissor.set(e,t,i,s)}function PN(n,e,t){const i=new Float32Array(oo),s=new z(0,1,0);return new zi({name:"SphericalGaussianBlur",defines:{n:oo,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:M_(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `,blending:Ls,depthTest:!1,depthWrite:!1})}function mb(){return new zi({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:M_(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `,blending:Ls,depthTest:!1,depthWrite:!1})}function gb(){return new zi({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:M_(),fragmentShader:` + + precision mediump float; + precision mediump int; + + uniform float flipEnvMap; + + varying vec3 vOutputDirection; + + uniform samplerCube envMap; + + void main() { + + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); + + } + `,blending:Ls,depthTest:!1,depthWrite:!1})}function M_(){return` + + precision mediump float; + precision mediump int; + + attribute float faceIndex; + + varying vec3 vOutputDirection; + + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { + + uv = 2.0 * uv - 1.0; + + vec3 direction = vec3( uv, 1.0 ); + + if ( face == 0.0 ) { + + direction = direction.zyx; // ( 1, v, u ) pos x + + } else if ( face == 1.0 ) { + + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y + + } else if ( face == 2.0 ) { + + direction.x *= -1.0; // ( -u, v, 1 ) pos z + + } else if ( face == 3.0 ) { + + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x + + } else if ( face == 4.0 ) { + + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y + + } else if ( face == 5.0 ) { + + direction.z *= -1.0; // ( u, v, -1 ) neg z + + } + + return direction; + + } + + void main() { + + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); + + } + `}function IN(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const l=a.mapping,c=l===nc||l===ic,u=l===Fs||l===yr;if(c||u){let f=e.get(a);const d=f!==void 0?f.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==d)return t===null&&(t=new Eg(n)),f=c?t.fromEquirectangular(a,f):t.fromCubemap(a,f),f.texture.pmremVersion=a.pmremVersion,e.set(a,f),f.texture;if(f!==void 0)return f.texture;{const h=a.image;return c&&h&&h.height>0||u&&h&&s(h)?(t===null&&(t=new Eg(n)),f=c?t.fromEquirectangular(a):t.fromCubemap(a),f.texture.pmremVersion=a.pmremVersion,e.set(a,f),a.addEventListener("dispose",r),f.texture):null}}}return a}function s(a){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(E=Math.ceil(v/e.maxTextureSize),v=e.maxTextureSize);const T=new Float32Array(v*E*4*f),S=new Fc(T,v,E,f);S.type=Kn,S.needsUpdate=!0;const P=b*4;for(let M=0;M0)return n;const s=e*t;let r=vb[s];if(r===void 0&&(r=new Float32Array(s),vb[s]=r),e!==0){i.toArray(r,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(r,a)}return r}function sn(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t":" "} ${a}: ${t[o]}`)}return i.join(` +`)}const Tb=new st;function IU(n){ft._getMatrix(Tb,ft.workingColorSpace,n);const e=`mat3( ${Tb.elements.map(t=>t.toFixed(4))} )`;switch(ft.getTransfer(n)){case lc:return[e,"LinearTransferOETF"];case wt:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",n),[e,"LinearTransferOETF"]}}function wb(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),s=n.getShaderInfoLog(e).trim();if(i&&s==="")return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const o=parseInt(r[1]);return t.toUpperCase()+` + +`+s+` + +`+PU(n.getShaderSource(e),o)}else return s}function LU(n,e){const t=IU(e);return[`vec4 ${n}( vec4 value ) {`,` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(` +`)}function DU(n,e){let t;switch(e){case D1:t="Linear";break;case O1:t="Reinhard";break;case N1:t="Cineon";break;case sh:t="ACESFilmic";break;case F1:t="AgX";break;case k1:t="Neutral";break;case U1:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const Qu=new z;function OU(){ft.getLuminanceCoefficients(Qu);const n=Qu.x.toFixed(4),e=Qu.y.toFixed(4),t=Qu.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${n}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(` +`)}function NU(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(_l).join(` +`)}function UU(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` +`)}function FU(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let s=0;s/gm;function Tg(n){return n.replace(kU,zU)}const BU=new Map;function zU(n,e){let t=ct[e];if(t===void 0){const i=BU.get(e);if(i!==void 0)t=ct[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return Tg(t)}const VU=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Rb(n){return n.replace(VU,HU)}function HU(n,e,t,i){let s="";for(let r=parseInt(e);r0&&(g+=` +`),m=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p].filter(_l).join(` +`),m.length>0&&(m+=` +`)):(g=[Pb(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(_l).join(` +`),m=[Pb(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+f:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==ts?"#define TONE_MAPPING":"",t.toneMapping!==ts?ct.tonemapping_pars_fragment:"",t.toneMapping!==ts?DU("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",ct.colorspace_pars_fragment,LU("linearToOutputTexel",t.outputColorSpace),OU(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`].filter(_l).join(` +`)),o=Tg(o),o=Ab(o,t),o=Cb(o,t),a=Tg(a),a=Ab(a,t),a=Cb(a,t),o=Rb(o),a=Rb(a),t.isRawShaderMaterial!==!0&&(y=`#version 300 es +`,g=[h,"#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+g,m=["#define varying in",t.glslVersion===gg?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===gg?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`)+` +`+m);const b=y+g+o,v=y+m+a,E=Eb(s,s.VERTEX_SHADER,b),T=Eb(s,s.FRAGMENT_SHADER,v);s.attachShader(_,E),s.attachShader(_,T),t.index0AttributeName!==void 0?s.bindAttribLocation(_,0,t.index0AttributeName):t.morphTargets===!0&&s.bindAttribLocation(_,0,"position"),s.linkProgram(_);function S(I){if(n.debug.checkShaderErrors){const N=s.getProgramInfoLog(_).trim(),V=s.getShaderInfoLog(E).trim(),j=s.getShaderInfoLog(T).trim();let te=!0,Z=!0;if(s.getProgramParameter(_,s.LINK_STATUS)===!1)if(te=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(s,_,E,T);else{const ee=wb(s,E,"vertex"),J=wb(s,T,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(_,s.VALIDATE_STATUS)+` + +Material Name: `+I.name+` +Material Type: `+I.type+` + +Program Info Log: `+N+` +`+ee+` +`+J)}else N!==""?console.warn("THREE.WebGLProgram: Program Info Log:",N):(V===""||j==="")&&(Z=!1);Z&&(I.diagnostics={runnable:te,programLog:N,vertexShader:{log:V,prefix:g},fragmentShader:{log:j,prefix:m}})}s.deleteShader(E),s.deleteShader(T),P=new Ef(s,_),x=FU(s,_)}let P;this.getUniforms=function(){return P===void 0&&S(this),P};let x;this.getAttributes=function(){return x===void 0&&S(this),x};let M=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=s.getProgramParameter(_,CU)),M},this.destroy=function(){i.releaseStatesOfProgram(this),s.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=RU++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=E,this.fragmentShader=T,this}let jU=0;class KU{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,s=this._getShaderStage(t),r=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(s)===!1&&(o.add(s),s.usedTimes++),o.has(r)===!1&&(o.add(r),r.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new ZU(e),t.set(e,i)),i}}class ZU{constructor(e){this.id=jU++,this.code=e,this.usedTimes=0}}function JU(n,e,t,i,s,r,o){const a=new mh,l=new KU,c=new Set,u=[],f=s.logarithmicDepthBuffer,d=s.vertexTextures;let h=s.precision;const p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function _(x){return c.add(x),x===0?"uv":`uv${x}`}function g(x,M,I,N,V){const j=N.fog,te=V.geometry,Z=x.isMeshStandardMaterial?N.environment:null,ee=(x.isMeshStandardMaterial?t:e).get(x.envMap||Z),J=ee&&ee.mapping===Fa?ee.image.height:null,he=p[x.type];x.precision!==null&&(h=s.getMaxPrecision(x.precision),h!==x.precision&&console.warn("THREE.WebGLProgram.getParameters:",x.precision,"not supported, using",h,"instead."));const be=te.morphAttributes.position||te.morphAttributes.normal||te.morphAttributes.color,se=be!==void 0?be.length:0;let ye=0;te.morphAttributes.position!==void 0&&(ye=1),te.morphAttributes.normal!==void 0&&(ye=2),te.morphAttributes.color!==void 0&&(ye=3);let Be,re,ge,xe;if(he){const Tt=Pi[he];Be=Tt.vertexShader,re=Tt.fragmentShader}else Be=x.vertexShader,re=x.fragmentShader,l.update(x),ge=l.getVertexShaderID(x),xe=l.getFragmentShaderID(x);const $=n.getRenderTarget(),ae=n.state.buffers.depth.getReversed(),le=V.isInstancedMesh===!0,ce=V.isBatchedMesh===!0,He=!!x.map,F=!!x.matcap,k=!!ee,w=!!x.aoMap,X=!!x.lightMap,G=!!x.bumpMap,W=!!x.normalMap,R=!!x.displacementMap,L=!!x.emissiveMap,B=!!x.metalnessMap,C=!!x.roughnessMap,A=x.anisotropy>0,U=x.clearcoat>0,O=x.dispersion>0,H=x.iridescence>0,q=x.sheen>0,fe=x.transmission>0,ue=A&&!!x.anisotropyMap,Re=U&&!!x.clearcoatMap,Pe=U&&!!x.clearcoatNormalMap,me=U&&!!x.clearcoatRoughnessMap,Se=H&&!!x.iridescenceMap,Ve=H&&!!x.iridescenceThicknessMap,Ye=q&&!!x.sheenColorMap,Ee=q&&!!x.sheenRoughnessMap,Je=!!x.specularMap,it=!!x.specularColorMap,Lt=!!x.specularIntensityMap,Y=fe&&!!x.transmissionMap,Ie=fe&&!!x.thicknessMap,oe=!!x.gradientMap,pe=!!x.alphaMap,De=x.alphaTest>0,Le=!!x.alphaHash,at=!!x.extensions;let Vt=ts;x.toneMapped&&($===null||$.isXRRenderTarget===!0)&&(Vt=n.toneMapping);const yn={shaderID:he,shaderType:x.type,shaderName:x.name,vertexShader:Be,fragmentShader:re,defines:x.defines,customVertexShaderID:ge,customFragmentShaderID:xe,isRawShaderMaterial:x.isRawShaderMaterial===!0,glslVersion:x.glslVersion,precision:h,batching:ce,batchingColor:ce&&V._colorsTexture!==null,instancing:le,instancingColor:le&&V.instanceColor!==null,instancingMorph:le&&V.morphTexture!==null,supportsVertexTextures:d,outputColorSpace:$===null?n.outputColorSpace:$.isXRRenderTarget===!0?$.texture.colorSpace:Eo,alphaToCoverage:!!x.alphaToCoverage,map:He,matcap:F,envMap:k,envMapMode:k&&ee.mapping,envMapCubeUVHeight:J,aoMap:w,lightMap:X,bumpMap:G,normalMap:W,displacementMap:d&&R,emissiveMap:L,normalMapObjectSpace:W&&x.normalMapType===X1,normalMapTangentSpace:W&&x.normalMapType===Ar,metalnessMap:B,roughnessMap:C,anisotropy:A,anisotropyMap:ue,clearcoat:U,clearcoatMap:Re,clearcoatNormalMap:Pe,clearcoatRoughnessMap:me,dispersion:O,iridescence:H,iridescenceMap:Se,iridescenceThicknessMap:Ve,sheen:q,sheenColorMap:Ye,sheenRoughnessMap:Ee,specularMap:Je,specularColorMap:it,specularIntensityMap:Lt,transmission:fe,transmissionMap:Y,thicknessMap:Ie,gradientMap:oe,opaque:x.transparent===!1&&x.blending===go&&x.alphaToCoverage===!1,alphaMap:pe,alphaTest:De,alphaHash:Le,combine:x.combine,mapUv:He&&_(x.map.channel),aoMapUv:w&&_(x.aoMap.channel),lightMapUv:X&&_(x.lightMap.channel),bumpMapUv:G&&_(x.bumpMap.channel),normalMapUv:W&&_(x.normalMap.channel),displacementMapUv:R&&_(x.displacementMap.channel),emissiveMapUv:L&&_(x.emissiveMap.channel),metalnessMapUv:B&&_(x.metalnessMap.channel),roughnessMapUv:C&&_(x.roughnessMap.channel),anisotropyMapUv:ue&&_(x.anisotropyMap.channel),clearcoatMapUv:Re&&_(x.clearcoatMap.channel),clearcoatNormalMapUv:Pe&&_(x.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:me&&_(x.clearcoatRoughnessMap.channel),iridescenceMapUv:Se&&_(x.iridescenceMap.channel),iridescenceThicknessMapUv:Ve&&_(x.iridescenceThicknessMap.channel),sheenColorMapUv:Ye&&_(x.sheenColorMap.channel),sheenRoughnessMapUv:Ee&&_(x.sheenRoughnessMap.channel),specularMapUv:Je&&_(x.specularMap.channel),specularColorMapUv:it&&_(x.specularColorMap.channel),specularIntensityMapUv:Lt&&_(x.specularIntensityMap.channel),transmissionMapUv:Y&&_(x.transmissionMap.channel),thicknessMapUv:Ie&&_(x.thicknessMap.channel),alphaMapUv:pe&&_(x.alphaMap.channel),vertexTangents:!!te.attributes.tangent&&(W||A),vertexColors:x.vertexColors,vertexAlphas:x.vertexColors===!0&&!!te.attributes.color&&te.attributes.color.itemSize===4,pointsUvs:V.isPoints===!0&&!!te.attributes.uv&&(He||pe),fog:!!j,useFog:x.fog===!0,fogExp2:!!j&&j.isFogExp2,flatShading:x.flatShading===!0,sizeAttenuation:x.sizeAttenuation===!0,logarithmicDepthBuffer:f,reverseDepthBuffer:ae,skinning:V.isSkinnedMesh===!0,morphTargets:te.morphAttributes.position!==void 0,morphNormals:te.morphAttributes.normal!==void 0,morphColors:te.morphAttributes.color!==void 0,morphTargetsCount:se,morphTextureStride:ye,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:x.dithering,shadowMapEnabled:n.shadowMap.enabled&&I.length>0,shadowMapType:n.shadowMap.type,toneMapping:Vt,decodeVideoTexture:He&&x.map.isVideoTexture===!0&&ft.getTransfer(x.map.colorSpace)===wt,decodeVideoTextureEmissive:L&&x.emissiveMap.isVideoTexture===!0&&ft.getTransfer(x.emissiveMap.colorSpace)===wt,premultipliedAlpha:x.premultipliedAlpha,doubleSided:x.side===Ii,flipSided:x.side===Vn,useDepthPacking:x.depthPacking>=0,depthPacking:x.depthPacking||0,index0AttributeName:x.index0AttributeName,extensionClipCullDistance:at&&x.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(at&&x.extensions.multiDraw===!0||ce)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:x.customProgramCacheKey()};return yn.vertexUv1s=c.has(1),yn.vertexUv2s=c.has(2),yn.vertexUv3s=c.has(3),c.clear(),yn}function m(x){const M=[];if(x.shaderID?M.push(x.shaderID):(M.push(x.customVertexShaderID),M.push(x.customFragmentShaderID)),x.defines!==void 0)for(const I in x.defines)M.push(I),M.push(x.defines[I]);return x.isRawShaderMaterial===!1&&(y(M,x),b(M,x),M.push(n.outputColorSpace)),M.push(x.customProgramCacheKey),M.join()}function y(x,M){x.push(M.precision),x.push(M.outputColorSpace),x.push(M.envMapMode),x.push(M.envMapCubeUVHeight),x.push(M.mapUv),x.push(M.alphaMapUv),x.push(M.lightMapUv),x.push(M.aoMapUv),x.push(M.bumpMapUv),x.push(M.normalMapUv),x.push(M.displacementMapUv),x.push(M.emissiveMapUv),x.push(M.metalnessMapUv),x.push(M.roughnessMapUv),x.push(M.anisotropyMapUv),x.push(M.clearcoatMapUv),x.push(M.clearcoatNormalMapUv),x.push(M.clearcoatRoughnessMapUv),x.push(M.iridescenceMapUv),x.push(M.iridescenceThicknessMapUv),x.push(M.sheenColorMapUv),x.push(M.sheenRoughnessMapUv),x.push(M.specularMapUv),x.push(M.specularColorMapUv),x.push(M.specularIntensityMapUv),x.push(M.transmissionMapUv),x.push(M.thicknessMapUv),x.push(M.combine),x.push(M.fogExp2),x.push(M.sizeAttenuation),x.push(M.morphTargetsCount),x.push(M.morphAttributeCount),x.push(M.numDirLights),x.push(M.numPointLights),x.push(M.numSpotLights),x.push(M.numSpotLightMaps),x.push(M.numHemiLights),x.push(M.numRectAreaLights),x.push(M.numDirLightShadows),x.push(M.numPointLightShadows),x.push(M.numSpotLightShadows),x.push(M.numSpotLightShadowsWithMaps),x.push(M.numLightProbes),x.push(M.shadowMapType),x.push(M.toneMapping),x.push(M.numClippingPlanes),x.push(M.numClipIntersection),x.push(M.depthPacking)}function b(x,M){a.disableAll(),M.supportsVertexTextures&&a.enable(0),M.instancing&&a.enable(1),M.instancingColor&&a.enable(2),M.instancingMorph&&a.enable(3),M.matcap&&a.enable(4),M.envMap&&a.enable(5),M.normalMapObjectSpace&&a.enable(6),M.normalMapTangentSpace&&a.enable(7),M.clearcoat&&a.enable(8),M.iridescence&&a.enable(9),M.alphaTest&&a.enable(10),M.vertexColors&&a.enable(11),M.vertexAlphas&&a.enable(12),M.vertexUv1s&&a.enable(13),M.vertexUv2s&&a.enable(14),M.vertexUv3s&&a.enable(15),M.vertexTangents&&a.enable(16),M.anisotropy&&a.enable(17),M.alphaHash&&a.enable(18),M.batching&&a.enable(19),M.dispersion&&a.enable(20),M.batchingColor&&a.enable(21),x.push(a.mask),a.disableAll(),M.fog&&a.enable(0),M.useFog&&a.enable(1),M.flatShading&&a.enable(2),M.logarithmicDepthBuffer&&a.enable(3),M.reverseDepthBuffer&&a.enable(4),M.skinning&&a.enable(5),M.morphTargets&&a.enable(6),M.morphNormals&&a.enable(7),M.morphColors&&a.enable(8),M.premultipliedAlpha&&a.enable(9),M.shadowMapEnabled&&a.enable(10),M.doubleSided&&a.enable(11),M.flipSided&&a.enable(12),M.useDepthPacking&&a.enable(13),M.dithering&&a.enable(14),M.transmission&&a.enable(15),M.sheen&&a.enable(16),M.opaque&&a.enable(17),M.pointsUvs&&a.enable(18),M.decodeVideoTexture&&a.enable(19),M.decodeVideoTextureEmissive&&a.enable(20),M.alphaToCoverage&&a.enable(21),x.push(a.mask)}function v(x){const M=p[x.type];let I;if(M){const N=Pi[M];I=sE.clone(N.uniforms)}else I=x.uniforms;return I}function E(x,M){let I;for(let N=0,V=u.length;N0?i.push(m):h.transparent===!0?s.push(m):t.push(m)}function l(f,d,h,p,_,g){const m=o(f,d,h,p,_,g);h.transmission>0?i.unshift(m):h.transparent===!0?s.unshift(m):t.unshift(m)}function c(f,d){t.length>1&&t.sort(f||eF),i.length>1&&i.sort(d||Ib),s.length>1&&s.sort(d||Ib)}function u(){for(let f=e,d=n.length;f=r.length?(o=new Lb,r.push(o)):o=r[s],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function nF(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new z,color:new Ae};break;case"SpotLight":t={position:new z,direction:new z,color:new Ae,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new z,color:new Ae,distance:0,decay:0};break;case"HemisphereLight":t={direction:new z,skyColor:new Ae,groundColor:new Ae};break;case"RectAreaLight":t={color:new Ae,position:new z,halfWidth:new z,halfHeight:new z};break}return n[e.id]=t,t}}}function iF(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new de};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new de};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new de,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let sF=0;function rF(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function oF(n){const e=new nF,t=iF(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)i.probe.push(new z);const s=new z,r=new qe,o=new qe;function a(c){let u=0,f=0,d=0;for(let x=0;x<9;x++)i.probe[x].set(0,0,0);let h=0,p=0,_=0,g=0,m=0,y=0,b=0,v=0,E=0,T=0,S=0;c.sort(rF);for(let x=0,M=c.length;x0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Te.LTC_FLOAT_1,i.rectAreaLTC2=Te.LTC_FLOAT_2):(i.rectAreaLTC1=Te.LTC_HALF_1,i.rectAreaLTC2=Te.LTC_HALF_2)),i.ambient[0]=u,i.ambient[1]=f,i.ambient[2]=d;const P=i.hash;(P.directionalLength!==h||P.pointLength!==p||P.spotLength!==_||P.rectAreaLength!==g||P.hemiLength!==m||P.numDirectionalShadows!==y||P.numPointShadows!==b||P.numSpotShadows!==v||P.numSpotMaps!==E||P.numLightProbes!==S)&&(i.directional.length=h,i.spot.length=_,i.rectArea.length=g,i.point.length=p,i.hemi.length=m,i.directionalShadow.length=y,i.directionalShadowMap.length=y,i.pointShadow.length=b,i.pointShadowMap.length=b,i.spotShadow.length=v,i.spotShadowMap.length=v,i.directionalShadowMatrix.length=y,i.pointShadowMatrix.length=b,i.spotLightMatrix.length=v+E-T,i.spotLightMap.length=E,i.numSpotLightShadowsWithMaps=T,i.numLightProbes=S,P.directionalLength=h,P.pointLength=p,P.spotLength=_,P.rectAreaLength=g,P.hemiLength=m,P.numDirectionalShadows=y,P.numPointShadows=b,P.numSpotShadows=v,P.numSpotMaps=E,P.numLightProbes=S,i.version=sF++)}function l(c,u){let f=0,d=0,h=0,p=0,_=0;const g=u.matrixWorldInverse;for(let m=0,y=c.length;m=o.length?(a=new Db(n),o.push(a)):a=o[r],a}function i(){e=new WeakMap}return{get:t,dispose:i}}const lF=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,cF=`uniform sampler2D shadow_pass; +uniform vec2 resolution; +uniform float radius; +#include +void main() { + const float samples = float( VSM_SAMPLES ); + float mean = 0.0; + float squared_mean = 0.0; + float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); + float uvStart = samples <= 1.0 ? 0.0 : - 1.0; + for ( float i = 0.0; i < samples; i ++ ) { + float uvOffset = uvStart + i * uvStride; + #ifdef HORIZONTAL_PASS + vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); + mean += distribution.x; + squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; + #else + float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); + mean += depth; + squared_mean += depth * depth; + #endif + } + mean = mean / samples; + squared_mean = squared_mean / samples; + float std_dev = sqrt( squared_mean - mean * mean ); + gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); +}`;function uF(n,e,t){let i=new za;const s=new de,r=new de,o=new gt,a=new u_({depthPacking:W1}),l=new f_,c={},u=t.maxTextureSize,f={[Us]:Vn,[Vn]:Us,[Ii]:Ii},d=new zi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new de},radius:{value:4}},vertexShader:lF,fragmentShader:cF}),h=d.clone();h.defines.HORIZONTAL_PASS=1;const p=new ot;p.setAttribute("position",new Ct(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new $t(p,d),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=k0;let m=this.type;this.render=function(T,S,P){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||T.length===0)return;const x=n.getRenderTarget(),M=n.getActiveCubeFace(),I=n.getActiveMipmapLevel(),N=n.state;N.setBlending(Ls),N.buffers.color.setClear(1,1,1,1),N.buffers.depth.setTest(!0),N.setScissorTest(!1);const V=m!==Ki&&this.type===Ki,j=m===Ki&&this.type!==Ki;for(let te=0,Z=T.length;teu||s.y>u)&&(s.x>u&&(r.x=Math.floor(u/he.x),s.x=r.x*he.x,J.mapSize.x=r.x),s.y>u&&(r.y=Math.floor(u/he.y),s.y=r.y*he.y,J.mapSize.y=r.y)),J.map===null||V===!0||j===!0){const se=this.type!==Ki?{minFilter:gn,magFilter:gn}:{};J.map!==null&&J.map.dispose(),J.map=new os(s.x,s.y,se),J.map.texture.name=ee.name+".shadowMap",J.camera.updateProjectionMatrix()}n.setRenderTarget(J.map),n.clear();const be=J.getViewportCount();for(let se=0;se0||S.map&&S.alphaTest>0||S.alphaToCoverage===!0){const N=M.uuid,V=S.uuid;let j=c[N];j===void 0&&(j={},c[N]=j);let te=j[V];te===void 0&&(te=M.clone(),j[V]=te,S.addEventListener("dispose",E)),M=te}if(M.visible=S.visible,M.wireframe=S.wireframe,x===Ki?M.side=S.shadowSide!==null?S.shadowSide:S.side:M.side=S.shadowSide!==null?S.shadowSide:f[S.side],M.alphaMap=S.alphaMap,M.alphaTest=S.alphaToCoverage===!0?.5:S.alphaTest,M.map=S.map,M.clipShadows=S.clipShadows,M.clippingPlanes=S.clippingPlanes,M.clipIntersection=S.clipIntersection,M.displacementMap=S.displacementMap,M.displacementScale=S.displacementScale,M.displacementBias=S.displacementBias,M.wireframeLinewidth=S.wireframeLinewidth,M.linewidth=S.linewidth,P.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const N=n.properties.get(M);N.light=P}return M}function v(T,S,P,x,M){if(T.visible===!1)return;if(T.layers.test(S.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&M===Ki)&&(!T.frustumCulled||i.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,T.matrixWorld);const V=e.update(T),j=T.material;if(Array.isArray(j)){const te=V.groups;for(let Z=0,ee=te.length;Z=1):J.indexOf("OpenGL ES")!==-1&&(ee=parseFloat(/^OpenGL ES (\d)/.exec(J)[1]),Z=ee>=2);let he=null,be={};const se=n.getParameter(n.SCISSOR_BOX),ye=n.getParameter(n.VIEWPORT),Be=new gt().fromArray(se),re=new gt().fromArray(ye);function ge(Y,Ie,oe,pe){const De=new Uint8Array(4),Le=n.createTexture();n.bindTexture(Y,Le),n.texParameteri(Y,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(Y,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let at=0;at"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new de,u=new WeakMap;let f;const d=new WeakMap;let h=!1;try{h=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function p(C,A){return h?new OffscreenCanvas(C,A):fc("canvas")}function _(C,A,U){let O=1;const H=B(C);if((H.width>U||H.height>U)&&(O=U/Math.max(H.width,H.height)),O<1)if(typeof HTMLImageElement<"u"&&C instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&C instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&C instanceof ImageBitmap||typeof VideoFrame<"u"&&C instanceof VideoFrame){const q=Math.floor(O*H.width),fe=Math.floor(O*H.height);f===void 0&&(f=p(q,fe));const ue=A?p(q,fe):f;return ue.width=q,ue.height=fe,ue.getContext("2d").drawImage(C,0,0,q,fe),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+H.width+"x"+H.height+") to ("+q+"x"+fe+")."),ue}else return"data"in C&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+H.width+"x"+H.height+")."),C;return C}function g(C){return C.generateMipmaps}function m(C){n.generateMipmap(C)}function y(C){return C.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:C.isWebGL3DRenderTarget?n.TEXTURE_3D:C.isWebGLArrayRenderTarget||C.isCompressedArrayTexture?n.TEXTURE_2D_ARRAY:n.TEXTURE_2D}function b(C,A,U,O,H=!1){if(C!==null){if(n[C]!==void 0)return n[C];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+C+"'")}let q=A;if(A===n.RED&&(U===n.FLOAT&&(q=n.R32F),U===n.HALF_FLOAT&&(q=n.R16F),U===n.UNSIGNED_BYTE&&(q=n.R8)),A===n.RED_INTEGER&&(U===n.UNSIGNED_BYTE&&(q=n.R8UI),U===n.UNSIGNED_SHORT&&(q=n.R16UI),U===n.UNSIGNED_INT&&(q=n.R32UI),U===n.BYTE&&(q=n.R8I),U===n.SHORT&&(q=n.R16I),U===n.INT&&(q=n.R32I)),A===n.RG&&(U===n.FLOAT&&(q=n.RG32F),U===n.HALF_FLOAT&&(q=n.RG16F),U===n.UNSIGNED_BYTE&&(q=n.RG8)),A===n.RG_INTEGER&&(U===n.UNSIGNED_BYTE&&(q=n.RG8UI),U===n.UNSIGNED_SHORT&&(q=n.RG16UI),U===n.UNSIGNED_INT&&(q=n.RG32UI),U===n.BYTE&&(q=n.RG8I),U===n.SHORT&&(q=n.RG16I),U===n.INT&&(q=n.RG32I)),A===n.RGB_INTEGER&&(U===n.UNSIGNED_BYTE&&(q=n.RGB8UI),U===n.UNSIGNED_SHORT&&(q=n.RGB16UI),U===n.UNSIGNED_INT&&(q=n.RGB32UI),U===n.BYTE&&(q=n.RGB8I),U===n.SHORT&&(q=n.RGB16I),U===n.INT&&(q=n.RGB32I)),A===n.RGBA_INTEGER&&(U===n.UNSIGNED_BYTE&&(q=n.RGBA8UI),U===n.UNSIGNED_SHORT&&(q=n.RGBA16UI),U===n.UNSIGNED_INT&&(q=n.RGBA32UI),U===n.BYTE&&(q=n.RGBA8I),U===n.SHORT&&(q=n.RGBA16I),U===n.INT&&(q=n.RGBA32I)),A===n.RGB&&U===n.UNSIGNED_INT_5_9_9_9_REV&&(q=n.RGB9_E5),A===n.RGBA){const fe=H?lc:ft.getTransfer(O);U===n.FLOAT&&(q=n.RGBA32F),U===n.HALF_FLOAT&&(q=n.RGBA16F),U===n.UNSIGNED_BYTE&&(q=fe===wt?n.SRGB8_ALPHA8:n.RGBA8),U===n.UNSIGNED_SHORT_4_4_4_4&&(q=n.RGBA4),U===n.UNSIGNED_SHORT_5_5_5_1&&(q=n.RGB5_A1)}return(q===n.R16F||q===n.R32F||q===n.RG16F||q===n.RG32F||q===n.RGBA16F||q===n.RGBA32F)&&e.get("EXT_color_buffer_float"),q}function v(C,A){let U;return C?A===null||A===ks||A===Sa?U=n.DEPTH24_STENCIL8:A===Kn?U=n.DEPTH32F_STENCIL8:A===Ma&&(U=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):A===null||A===ks||A===Sa?U=n.DEPTH_COMPONENT24:A===Kn?U=n.DEPTH_COMPONENT32F:A===Ma&&(U=n.DEPTH_COMPONENT16),U}function E(C,A){return g(C)===!0||C.isFramebufferTexture&&C.minFilter!==gn&&C.minFilter!==en?Math.log2(Math.max(A.width,A.height))+1:C.mipmaps!==void 0&&C.mipmaps.length>0?C.mipmaps.length:C.isCompressedTexture&&Array.isArray(C.image)?A.mipmaps.length:1}function T(C){const A=C.target;A.removeEventListener("dispose",T),P(A),A.isVideoTexture&&u.delete(A)}function S(C){const A=C.target;A.removeEventListener("dispose",S),M(A)}function P(C){const A=i.get(C);if(A.__webglInit===void 0)return;const U=C.source,O=d.get(U);if(O){const H=O[A.__cacheKey];H.usedTimes--,H.usedTimes===0&&x(C),Object.keys(O).length===0&&d.delete(U)}i.remove(C)}function x(C){const A=i.get(C);n.deleteTexture(A.__webglTexture);const U=C.source,O=d.get(U);delete O[A.__cacheKey],o.memory.textures--}function M(C){const A=i.get(C);if(C.depthTexture&&(C.depthTexture.dispose(),i.remove(C.depthTexture)),C.isWebGLCubeRenderTarget)for(let O=0;O<6;O++){if(Array.isArray(A.__webglFramebuffer[O]))for(let H=0;H=s.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+C+" texture units while this GPU supports only "+s.maxTextures),I+=1,C}function j(C){const A=[];return A.push(C.wrapS),A.push(C.wrapT),A.push(C.wrapR||0),A.push(C.magFilter),A.push(C.minFilter),A.push(C.anisotropy),A.push(C.internalFormat),A.push(C.format),A.push(C.type),A.push(C.generateMipmaps),A.push(C.premultiplyAlpha),A.push(C.flipY),A.push(C.unpackAlignment),A.push(C.colorSpace),A.join()}function te(C,A){const U=i.get(C);if(C.isVideoTexture&&R(C),C.isRenderTargetTexture===!1&&C.version>0&&U.__version!==C.version){const O=C.image;if(O===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(O.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{re(U,C,A);return}}t.bindTexture(n.TEXTURE_2D,U.__webglTexture,n.TEXTURE0+A)}function Z(C,A){const U=i.get(C);if(C.version>0&&U.__version!==C.version){re(U,C,A);return}t.bindTexture(n.TEXTURE_2D_ARRAY,U.__webglTexture,n.TEXTURE0+A)}function ee(C,A){const U=i.get(C);if(C.version>0&&U.__version!==C.version){re(U,C,A);return}t.bindTexture(n.TEXTURE_3D,U.__webglTexture,n.TEXTURE0+A)}function J(C,A){const U=i.get(C);if(C.version>0&&U.__version!==C.version){ge(U,C,A);return}t.bindTexture(n.TEXTURE_CUBE_MAP,U.__webglTexture,n.TEXTURE0+A)}const he={[sc]:n.REPEAT,[gi]:n.CLAMP_TO_EDGE,[rc]:n.MIRRORED_REPEAT},be={[gn]:n.NEAREST,[z0]:n.NEAREST_MIPMAP_NEAREST,[aa]:n.NEAREST_MIPMAP_LINEAR,[en]:n.LINEAR,[El]:n.LINEAR_MIPMAP_NEAREST,[Qi]:n.LINEAR_MIPMAP_LINEAR},se={[$1]:n.NEVER,[J1]:n.ALWAYS,[q1]:n.LESS,[j0]:n.LEQUAL,[Y1]:n.EQUAL,[Z1]:n.GEQUAL,[j1]:n.GREATER,[K1]:n.NOTEQUAL};function ye(C,A){if(A.type===Kn&&e.has("OES_texture_float_linear")===!1&&(A.magFilter===en||A.magFilter===El||A.magFilter===aa||A.magFilter===Qi||A.minFilter===en||A.minFilter===El||A.minFilter===aa||A.minFilter===Qi)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(C,n.TEXTURE_WRAP_S,he[A.wrapS]),n.texParameteri(C,n.TEXTURE_WRAP_T,he[A.wrapT]),(C===n.TEXTURE_3D||C===n.TEXTURE_2D_ARRAY)&&n.texParameteri(C,n.TEXTURE_WRAP_R,he[A.wrapR]),n.texParameteri(C,n.TEXTURE_MAG_FILTER,be[A.magFilter]),n.texParameteri(C,n.TEXTURE_MIN_FILTER,be[A.minFilter]),A.compareFunction&&(n.texParameteri(C,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(C,n.TEXTURE_COMPARE_FUNC,se[A.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(A.magFilter===gn||A.minFilter!==aa&&A.minFilter!==Qi||A.type===Kn&&e.has("OES_texture_float_linear")===!1)return;if(A.anisotropy>1||i.get(A).__currentAnisotropy){const U=e.get("EXT_texture_filter_anisotropic");n.texParameterf(C,U.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(A.anisotropy,s.getMaxAnisotropy())),i.get(A).__currentAnisotropy=A.anisotropy}}}function Be(C,A){let U=!1;C.__webglInit===void 0&&(C.__webglInit=!0,A.addEventListener("dispose",T));const O=A.source;let H=d.get(O);H===void 0&&(H={},d.set(O,H));const q=j(A);if(q!==C.__cacheKey){H[q]===void 0&&(H[q]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,U=!0),H[q].usedTimes++;const fe=H[C.__cacheKey];fe!==void 0&&(H[C.__cacheKey].usedTimes--,fe.usedTimes===0&&x(A)),C.__cacheKey=q,C.__webglTexture=H[q].texture}return U}function re(C,A,U){let O=n.TEXTURE_2D;(A.isDataArrayTexture||A.isCompressedArrayTexture)&&(O=n.TEXTURE_2D_ARRAY),A.isData3DTexture&&(O=n.TEXTURE_3D);const H=Be(C,A),q=A.source;t.bindTexture(O,C.__webglTexture,n.TEXTURE0+U);const fe=i.get(q);if(q.version!==fe.__version||H===!0){t.activeTexture(n.TEXTURE0+U);const ue=ft.getPrimaries(ft.workingColorSpace),Re=A.colorSpace===Ts?null:ft.getPrimaries(A.colorSpace),Pe=A.colorSpace===Ts||ue===Re?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,A.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,A.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,A.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Pe);let me=_(A.image,!1,s.maxTextureSize);me=L(A,me);const Se=r.convert(A.format,A.colorSpace),Ve=r.convert(A.type);let Ye=b(A.internalFormat,Se,Ve,A.colorSpace,A.isVideoTexture);ye(O,A);let Ee;const Je=A.mipmaps,it=A.isVideoTexture!==!0,Lt=fe.__version===void 0||H===!0,Y=q.dataReady,Ie=E(A,me);if(A.isDepthTexture)Ye=v(A.format===Ta,A.type),Lt&&(it?t.texStorage2D(n.TEXTURE_2D,1,Ye,me.width,me.height):t.texImage2D(n.TEXTURE_2D,0,Ye,me.width,me.height,0,Se,Ve,null));else if(A.isDataTexture)if(Je.length>0){it&&Lt&&t.texStorage2D(n.TEXTURE_2D,Ie,Ye,Je[0].width,Je[0].height);for(let oe=0,pe=Je.length;oe0){const De=Sg(Ee.width,Ee.height,A.format,A.type);for(const Le of A.layerUpdates){const at=Ee.data.subarray(Le*De/Ee.data.BYTES_PER_ELEMENT,(Le+1)*De/Ee.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,Le,Ee.width,Ee.height,1,Se,at)}A.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,0,Ee.width,Ee.height,me.depth,Se,Ee.data)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,oe,Ye,Ee.width,Ee.height,me.depth,0,Ee.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else it?Y&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,oe,0,0,0,Ee.width,Ee.height,me.depth,Se,Ve,Ee.data):t.texImage3D(n.TEXTURE_2D_ARRAY,oe,Ye,Ee.width,Ee.height,me.depth,0,Se,Ve,Ee.data)}else{it&&Lt&&t.texStorage2D(n.TEXTURE_2D,Ie,Ye,Je[0].width,Je[0].height);for(let oe=0,pe=Je.length;oe0){const oe=Sg(me.width,me.height,A.format,A.type);for(const pe of A.layerUpdates){const De=me.data.subarray(pe*oe/me.data.BYTES_PER_ELEMENT,(pe+1)*oe/me.data.BYTES_PER_ELEMENT);t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,pe,me.width,me.height,1,Se,Ve,De)}A.clearLayerUpdates()}else t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,me.width,me.height,me.depth,Se,Ve,me.data)}else t.texImage3D(n.TEXTURE_2D_ARRAY,0,Ye,me.width,me.height,me.depth,0,Se,Ve,me.data);else if(A.isData3DTexture)it?(Lt&&t.texStorage3D(n.TEXTURE_3D,Ie,Ye,me.width,me.height,me.depth),Y&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,me.width,me.height,me.depth,Se,Ve,me.data)):t.texImage3D(n.TEXTURE_3D,0,Ye,me.width,me.height,me.depth,0,Se,Ve,me.data);else if(A.isFramebufferTexture){if(Lt)if(it)t.texStorage2D(n.TEXTURE_2D,Ie,Ye,me.width,me.height);else{let oe=me.width,pe=me.height;for(let De=0;De>=1,pe>>=1}}else if(Je.length>0){if(it&&Lt){const oe=B(Je[0]);t.texStorage2D(n.TEXTURE_2D,Ie,Ye,oe.width,oe.height)}for(let oe=0,pe=Je.length;oe0&&Ie++;const pe=B(Se[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,Ie,Je,pe.width,pe.height)}for(let pe=0;pe<6;pe++)if(me){it?Y&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+pe,0,0,0,Se[pe].width,Se[pe].height,Ye,Ee,Se[pe].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+pe,0,Je,Se[pe].width,Se[pe].height,0,Ye,Ee,Se[pe].data);for(let De=0;De>q),Ve=Math.max(1,A.height>>q);H===n.TEXTURE_3D||H===n.TEXTURE_2D_ARRAY?t.texImage3D(H,q,Re,Se,Ve,A.depth,0,fe,ue,null):t.texImage2D(H,q,Re,Se,Ve,0,fe,ue,null)}t.bindFramebuffer(n.FRAMEBUFFER,C),W(A)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,O,H,me.__webglTexture,0,G(A)):(H===n.TEXTURE_2D||H>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&H<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,O,H,me.__webglTexture,q),t.bindFramebuffer(n.FRAMEBUFFER,null)}function $(C,A,U){if(n.bindRenderbuffer(n.RENDERBUFFER,C),A.depthBuffer){const O=A.depthTexture,H=O&&O.isDepthTexture?O.type:null,q=v(A.stencilBuffer,H),fe=A.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ue=G(A);W(A)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,ue,q,A.width,A.height):U?n.renderbufferStorageMultisample(n.RENDERBUFFER,ue,q,A.width,A.height):n.renderbufferStorage(n.RENDERBUFFER,q,A.width,A.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,fe,n.RENDERBUFFER,C)}else{const O=A.textures;for(let H=0;H{delete A.__boundDepthTexture,delete A.__depthDisposeCallback,O.removeEventListener("dispose",H)};O.addEventListener("dispose",H),A.__depthDisposeCallback=H}A.__boundDepthTexture=O}if(C.depthTexture&&!A.__autoAllocateDepthBuffer){if(U)throw new Error("target.depthTexture not supported in Cube render targets");const O=C.texture.mipmaps;O&&O.length>0?ae(A.__webglFramebuffer[0],C):ae(A.__webglFramebuffer,C)}else if(U){A.__webglDepthbuffer=[];for(let O=0;O<6;O++)if(t.bindFramebuffer(n.FRAMEBUFFER,A.__webglFramebuffer[O]),A.__webglDepthbuffer[O]===void 0)A.__webglDepthbuffer[O]=n.createRenderbuffer(),$(A.__webglDepthbuffer[O],C,!1);else{const H=C.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,q=A.__webglDepthbuffer[O];n.bindRenderbuffer(n.RENDERBUFFER,q),n.framebufferRenderbuffer(n.FRAMEBUFFER,H,n.RENDERBUFFER,q)}}else{const O=C.texture.mipmaps;if(O&&O.length>0?t.bindFramebuffer(n.FRAMEBUFFER,A.__webglFramebuffer[0]):t.bindFramebuffer(n.FRAMEBUFFER,A.__webglFramebuffer),A.__webglDepthbuffer===void 0)A.__webglDepthbuffer=n.createRenderbuffer(),$(A.__webglDepthbuffer,C,!1);else{const H=C.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,q=A.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,q),n.framebufferRenderbuffer(n.FRAMEBUFFER,H,n.RENDERBUFFER,q)}}t.bindFramebuffer(n.FRAMEBUFFER,null)}function ce(C,A,U){const O=i.get(C);A!==void 0&&xe(O.__webglFramebuffer,C,C.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),U!==void 0&&le(C)}function He(C){const A=C.texture,U=i.get(C),O=i.get(A);C.addEventListener("dispose",S);const H=C.textures,q=C.isWebGLCubeRenderTarget===!0,fe=H.length>1;if(fe||(O.__webglTexture===void 0&&(O.__webglTexture=n.createTexture()),O.__version=A.version,o.memory.textures++),q){U.__webglFramebuffer=[];for(let ue=0;ue<6;ue++)if(A.mipmaps&&A.mipmaps.length>0){U.__webglFramebuffer[ue]=[];for(let Re=0;Re0){U.__webglFramebuffer=[];for(let ue=0;ue0&&W(C)===!1){U.__webglMultisampledFramebuffer=n.createFramebuffer(),U.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,U.__webglMultisampledFramebuffer);for(let ue=0;ue0)for(let Re=0;Re0)for(let Re=0;Re0){if(W(C)===!1){const A=C.textures,U=C.width,O=C.height;let H=n.COLOR_BUFFER_BIT;const q=C.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,fe=i.get(C),ue=A.length>1;if(ue)for(let Pe=0;Pe0?t.bindFramebuffer(n.DRAW_FRAMEBUFFER,fe.__webglFramebuffer[0]):t.bindFramebuffer(n.DRAW_FRAMEBUFFER,fe.__webglFramebuffer);for(let Pe=0;Pe0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&A.__useRenderToTexture!==!1}function R(C){const A=o.render.frame;u.get(C)!==A&&(u.set(C,A),C.update())}function L(C,A){const U=C.colorSpace,O=C.format,H=C.type;return C.isCompressedTexture===!0||C.isVideoTexture===!0||U!==Eo&&U!==Ts&&(ft.getTransfer(U)===wt?(O!==zn||H!==Bi)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",U)),A}function B(C){return typeof HTMLImageElement<"u"&&C instanceof HTMLImageElement?(c.width=C.naturalWidth||C.width,c.height=C.naturalHeight||C.height):typeof VideoFrame<"u"&&C instanceof VideoFrame?(c.width=C.displayWidth,c.height=C.displayHeight):(c.width=C.width,c.height=C.height),c}this.allocateTextureUnit=V,this.resetTextureUnits=N,this.setTexture2D=te,this.setTexture2DArray=Z,this.setTexture3D=ee,this.setTextureCube=J,this.rebindTextures=ce,this.setupRenderTarget=He,this.updateRenderTargetMipmap=F,this.updateMultisampleRenderTarget=X,this.setupDepthRenderbuffer=le,this.setupFrameBufferTexture=xe,this.useMultisampledRTT=W}function cT(n,e){function t(i,s=Ts){let r;const o=ft.getTransfer(s);if(i===Bi)return n.UNSIGNED_BYTE;if(i===ah)return n.UNSIGNED_SHORT_4_4_4_4;if(i===lh)return n.UNSIGNED_SHORT_5_5_5_1;if(i===G0)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===V0)return n.BYTE;if(i===H0)return n.SHORT;if(i===Ma)return n.UNSIGNED_SHORT;if(i===oh)return n.INT;if(i===ks)return n.UNSIGNED_INT;if(i===Kn)return n.FLOAT;if(i===ka)return n.HALF_FLOAT;if(i===W0)return n.ALPHA;if(i===X0)return n.RGB;if(i===zn)return n.RGBA;if(i===Ea)return n.DEPTH_COMPONENT;if(i===Ta)return n.DEPTH_STENCIL;if(i===ch)return n.RED;if(i===Uc)return n.RED_INTEGER;if(i===$0)return n.RG;if(i===uh)return n.RG_INTEGER;if(i===fh)return n.RGBA_INTEGER;if(i===Tl||i===wl||i===Al||i===Cl)if(o===wt)if(r=e.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(i===Tl)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===wl)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===Al)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===Cl)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=e.get("WEBGL_compressed_texture_s3tc"),r!==null){if(i===Tl)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===wl)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===Al)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===Cl)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===Zf||i===Jf||i===Qf||i===ed)if(r=e.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(i===Zf)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===Jf)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===Qf)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===ed)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===td||i===nd||i===id)if(r=e.get("WEBGL_compressed_texture_etc"),r!==null){if(i===td||i===nd)return o===wt?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(i===id)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===sd||i===rd||i===od||i===ad||i===ld||i===cd||i===ud||i===fd||i===dd||i===hd||i===pd||i===md||i===gd||i===_d)if(r=e.get("WEBGL_compressed_texture_astc"),r!==null){if(i===sd)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===rd)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===od)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===ad)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===ld)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===cd)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===ud)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===fd)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===dd)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===hd)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===pd)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===md)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===gd)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===_d)return o===wt?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===Rl||i===vd||i===yd)if(r=e.get("EXT_texture_compression_bptc"),r!==null){if(i===Rl)return o===wt?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===vd)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===yd)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===q0||i===bd||i===xd||i===Md)if(r=e.get("EXT_texture_compression_rgtc"),r!==null){if(i===Rl)return r.COMPRESSED_RED_RGTC1_EXT;if(i===bd)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===xd)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===Md)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===Sa?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:t}}const pF=` +void main() { + + gl_Position = vec4( position, 1.0 ); + +}`,mF=` +uniform sampler2DArray depthColor; +uniform float depthWidth; +uniform float depthHeight; + +void main() { + + vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); + + if ( coord.x >= 1.0 ) { + + gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; + + } else { + + gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; + + } + +}`;class gF{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){const s=new Wt,r=e.properties.get(s);r.__webglTexture=t.texture,(t.depthNear!==i.depthNear||t.depthFar!==i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=s}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,i=new zi({vertexShader:pF,fragmentShader:mF,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new $t(new Va(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class _F extends as{constructor(e,t){super();const i=this;let s=null,r=1,o=null,a="local-floor",l=1,c=null,u=null,f=null,d=null,h=null,p=null;const _=new gF,g=t.getContextAttributes();let m=null,y=null;const b=[],v=[],E=new de;let T=null;const S=new Kt;S.viewport=new gt;const P=new Kt;P.viewport=new gt;const x=[S,P],M=new JE;let I=null,N=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(re){let ge=b[re];return ge===void 0&&(ge=new Sf,b[re]=ge),ge.getTargetRaySpace()},this.getControllerGrip=function(re){let ge=b[re];return ge===void 0&&(ge=new Sf,b[re]=ge),ge.getGripSpace()},this.getHand=function(re){let ge=b[re];return ge===void 0&&(ge=new Sf,b[re]=ge),ge.getHandSpace()};function V(re){const ge=v.indexOf(re.inputSource);if(ge===-1)return;const xe=b[ge];xe!==void 0&&(xe.update(re.inputSource,re.frame,c||o),xe.dispatchEvent({type:re.type,data:re.inputSource}))}function j(){s.removeEventListener("select",V),s.removeEventListener("selectstart",V),s.removeEventListener("selectend",V),s.removeEventListener("squeeze",V),s.removeEventListener("squeezestart",V),s.removeEventListener("squeezeend",V),s.removeEventListener("end",j),s.removeEventListener("inputsourceschange",te);for(let re=0;re=0&&(v[$]=null,b[$].disconnect(xe))}for(let ge=0;ge=v.length){v.push(xe),$=le;break}else if(v[le]===null){v[le]=xe,$=le;break}if($===-1)break}const ae=b[$];ae&&ae.connect(xe)}}const Z=new z,ee=new z;function J(re,ge,xe){Z.setFromMatrixPosition(ge.matrixWorld),ee.setFromMatrixPosition(xe.matrixWorld);const $=Z.distanceTo(ee),ae=ge.projectionMatrix.elements,le=xe.projectionMatrix.elements,ce=ae[14]/(ae[10]-1),He=ae[14]/(ae[10]+1),F=(ae[9]+1)/ae[5],k=(ae[9]-1)/ae[5],w=(ae[8]-1)/ae[0],X=(le[8]+1)/le[0],G=ce*w,W=ce*X,R=$/(-w+X),L=R*-w;if(ge.matrixWorld.decompose(re.position,re.quaternion,re.scale),re.translateX(L),re.translateZ(R),re.matrixWorld.compose(re.position,re.quaternion,re.scale),re.matrixWorldInverse.copy(re.matrixWorld).invert(),ae[10]===-1)re.projectionMatrix.copy(ge.projectionMatrix),re.projectionMatrixInverse.copy(ge.projectionMatrixInverse);else{const B=ce+R,C=He+R,A=G-L,U=W+($-L),O=F*He/C*B,H=k*He/C*B;re.projectionMatrix.makePerspective(A,U,O,H,B,C),re.projectionMatrixInverse.copy(re.projectionMatrix).invert()}}function he(re,ge){ge===null?re.matrixWorld.copy(re.matrix):re.matrixWorld.multiplyMatrices(ge.matrixWorld,re.matrix),re.matrixWorldInverse.copy(re.matrixWorld).invert()}this.updateCamera=function(re){if(s===null)return;let ge=re.near,xe=re.far;_.texture!==null&&(_.depthNear>0&&(ge=_.depthNear),_.depthFar>0&&(xe=_.depthFar)),M.near=P.near=S.near=ge,M.far=P.far=S.far=xe,(I!==M.near||N!==M.far)&&(s.updateRenderState({depthNear:M.near,depthFar:M.far}),I=M.near,N=M.far),S.layers.mask=re.layers.mask|2,P.layers.mask=re.layers.mask|4,M.layers.mask=S.layers.mask|P.layers.mask;const $=re.parent,ae=M.cameras;he(M,$);for(let le=0;le0&&(g.alphaTest.value=m.alphaTest);const y=e.get(m),b=y.envMap,v=y.envMapRotation;b&&(g.envMap.value=b,Jr.copy(v),Jr.x*=-1,Jr.y*=-1,Jr.z*=-1,b.isCubeTexture&&b.isRenderTargetTexture===!1&&(Jr.y*=-1,Jr.z*=-1),g.envMapRotation.value.setFromMatrix4(vF.makeRotationFromEuler(Jr)),g.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=m.reflectivity,g.ior.value=m.ior,g.refractionRatio.value=m.refractionRatio),m.lightMap&&(g.lightMap.value=m.lightMap,g.lightMapIntensity.value=m.lightMapIntensity,t(m.lightMap,g.lightMapTransform)),m.aoMap&&(g.aoMap.value=m.aoMap,g.aoMapIntensity.value=m.aoMapIntensity,t(m.aoMap,g.aoMapTransform))}function o(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,m.map&&(g.map.value=m.map,t(m.map,g.mapTransform))}function a(g,m){g.dashSize.value=m.dashSize,g.totalSize.value=m.dashSize+m.gapSize,g.scale.value=m.scale}function l(g,m,y,b){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.size.value=m.size*y,g.scale.value=b*.5,m.map&&(g.map.value=m.map,t(m.map,g.uvTransform)),m.alphaMap&&(g.alphaMap.value=m.alphaMap,t(m.alphaMap,g.alphaMapTransform)),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest)}function c(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.rotation.value=m.rotation,m.map&&(g.map.value=m.map,t(m.map,g.mapTransform)),m.alphaMap&&(g.alphaMap.value=m.alphaMap,t(m.alphaMap,g.alphaMapTransform)),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest)}function u(g,m){g.specular.value.copy(m.specular),g.shininess.value=Math.max(m.shininess,1e-4)}function f(g,m){m.gradientMap&&(g.gradientMap.value=m.gradientMap)}function d(g,m){g.metalness.value=m.metalness,m.metalnessMap&&(g.metalnessMap.value=m.metalnessMap,t(m.metalnessMap,g.metalnessMapTransform)),g.roughness.value=m.roughness,m.roughnessMap&&(g.roughnessMap.value=m.roughnessMap,t(m.roughnessMap,g.roughnessMapTransform)),m.envMap&&(g.envMapIntensity.value=m.envMapIntensity)}function h(g,m,y){g.ior.value=m.ior,m.sheen>0&&(g.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),g.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(g.sheenColorMap.value=m.sheenColorMap,t(m.sheenColorMap,g.sheenColorMapTransform)),m.sheenRoughnessMap&&(g.sheenRoughnessMap.value=m.sheenRoughnessMap,t(m.sheenRoughnessMap,g.sheenRoughnessMapTransform))),m.clearcoat>0&&(g.clearcoat.value=m.clearcoat,g.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(g.clearcoatMap.value=m.clearcoatMap,t(m.clearcoatMap,g.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,t(m.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(g.clearcoatNormalMap.value=m.clearcoatNormalMap,t(m.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===Vn&&g.clearcoatNormalScale.value.negate())),m.dispersion>0&&(g.dispersion.value=m.dispersion),m.iridescence>0&&(g.iridescence.value=m.iridescence,g.iridescenceIOR.value=m.iridescenceIOR,g.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(g.iridescenceMap.value=m.iridescenceMap,t(m.iridescenceMap,g.iridescenceMapTransform)),m.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=m.iridescenceThicknessMap,t(m.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),m.transmission>0&&(g.transmission.value=m.transmission,g.transmissionSamplerMap.value=y.texture,g.transmissionSamplerSize.value.set(y.width,y.height),m.transmissionMap&&(g.transmissionMap.value=m.transmissionMap,t(m.transmissionMap,g.transmissionMapTransform)),g.thickness.value=m.thickness,m.thicknessMap&&(g.thicknessMap.value=m.thicknessMap,t(m.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=m.attenuationDistance,g.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(g.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(g.anisotropyMap.value=m.anisotropyMap,t(m.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=m.specularIntensity,g.specularColor.value.copy(m.specularColor),m.specularColorMap&&(g.specularColorMap.value=m.specularColorMap,t(m.specularColorMap,g.specularColorMapTransform)),m.specularIntensityMap&&(g.specularIntensityMap.value=m.specularIntensityMap,t(m.specularIntensityMap,g.specularIntensityMapTransform))}function p(g,m){m.matcap&&(g.matcap.value=m.matcap)}function _(g,m){const y=e.get(m).light;g.referencePosition.value.setFromMatrixPosition(y.matrixWorld),g.nearDistance.value=y.shadow.camera.near,g.farDistance.value=y.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:s}}function bF(n,e,t,i){let s={},r={},o=[];const a=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function l(y,b){const v=b.program;i.uniformBlockBinding(y,v)}function c(y,b){let v=s[y.id];v===void 0&&(p(y),v=u(y),s[y.id]=v,y.addEventListener("dispose",g));const E=b.program;i.updateUBOMapping(y,E);const T=e.render.frame;r[y.id]!==T&&(d(y),r[y.id]=T)}function u(y){const b=f();y.__bindingPointIndex=b;const v=n.createBuffer(),E=y.__size,T=y.usage;return n.bindBuffer(n.UNIFORM_BUFFER,v),n.bufferData(n.UNIFORM_BUFFER,E,T),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,b,v),v}function f(){for(let y=0;y0&&(v+=E-T),y.__size=v,y.__cache={},this}function _(y){const b={boundary:0,storage:0};return typeof y=="number"||typeof y=="boolean"?(b.boundary=4,b.storage=4):y.isVector2?(b.boundary=8,b.storage=8):y.isVector3||y.isColor?(b.boundary=16,b.storage=12):y.isVector4?(b.boundary=16,b.storage=16):y.isMatrix3?(b.boundary=48,b.storage=48):y.isMatrix4?(b.boundary=64,b.storage=64):y.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",y),b}function g(y){const b=y.target;b.removeEventListener("dispose",g);const v=o.indexOf(b.__bindingPointIndex);o.splice(v,1),n.deleteBuffer(s[b.id]),delete s[b.id],delete r[b.id]}function m(){for(const y in s)n.deleteBuffer(s[y]);o=[],s={},r={}}return{bind:l,update:c,dispose:m}}class Tf{constructor(e={}){const{canvas:t=eE(),context:i=null,depth:s=!0,stencil:r=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:f=!1,reverseDepthBuffer:d=!1}=e;this.isWebGLRenderer=!0;let h;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");h=i.getContextAttributes().alpha}else h=o;const p=new Uint32Array(4),_=new Int32Array(4);let g=null,m=null;const y=[],b=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=ts,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const v=this;let E=!1;this._outputColorSpace=Un;let T=0,S=0,P=null,x=-1,M=null;const I=new gt,N=new gt;let V=null;const j=new Ae(0);let te=0,Z=t.width,ee=t.height,J=1,he=null,be=null;const se=new gt(0,0,Z,ee),ye=new gt(0,0,Z,ee);let Be=!1;const re=new za;let ge=!1,xe=!1;const $=new qe,ae=new qe,le=new z,ce=new gt,He={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let F=!1;function k(){return P===null?J:1}let w=i;function X(D,K){return t.getContext(D,K)}try{const D={alpha:!0,depth:s,stencil:r,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:f};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Oc}`),t.addEventListener("webglcontextlost",pe,!1),t.addEventListener("webglcontextrestored",De,!1),t.addEventListener("webglcontextcreationerror",Le,!1),w===null){const K="webgl2";if(w=X(K,D),w===null)throw X(K)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(D){throw console.error("THREE.WebGLRenderer: "+D.message),D}let G,W,R,L,B,C,A,U,O,H,q,fe,ue,Re,Pe,me,Se,Ve,Ye,Ee,Je,it,Lt,Y;function Ie(){G=new LN(w),G.init(),it=new cT(w,G),W=new TN(w,G,e,it),R=new dF(w,G),W.reverseDepthBuffer&&d&&R.buffers.depth.setReversed(!0),L=new NN(w),B=new QU,C=new hF(w,G,R,B,W,it,L),A=new AN(v),U=new IN(v),O=new VL(w),Lt=new SN(w,O),H=new DN(w,O,L,Lt),q=new FN(w,H,O,L),Ye=new UN(w,W,C),me=new wN(B),fe=new JU(v,A,U,G,W,Lt,me),ue=new yF(v,B),Re=new tF,Pe=new aF(G),Ve=new MN(v,A,U,R,q,h,l),Se=new uF(v,q,W),Y=new bF(w,L,W,R),Ee=new EN(w,G,L),Je=new ON(w,G,L),L.programs=fe.programs,v.capabilities=W,v.extensions=G,v.properties=B,v.renderLists=Re,v.shadowMap=Se,v.state=R,v.info=L}Ie();const oe=new _F(v,w);this.xr=oe,this.getContext=function(){return w},this.getContextAttributes=function(){return w.getContextAttributes()},this.forceContextLoss=function(){const D=G.get("WEBGL_lose_context");D&&D.loseContext()},this.forceContextRestore=function(){const D=G.get("WEBGL_lose_context");D&&D.restoreContext()},this.getPixelRatio=function(){return J},this.setPixelRatio=function(D){D!==void 0&&(J=D,this.setSize(Z,ee,!1))},this.getSize=function(D){return D.set(Z,ee)},this.setSize=function(D,K,ne=!0){if(oe.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}Z=D,ee=K,t.width=Math.floor(D*J),t.height=Math.floor(K*J),ne===!0&&(t.style.width=D+"px",t.style.height=K+"px"),this.setViewport(0,0,D,K)},this.getDrawingBufferSize=function(D){return D.set(Z*J,ee*J).floor()},this.setDrawingBufferSize=function(D,K,ne){Z=D,ee=K,J=ne,t.width=Math.floor(D*ne),t.height=Math.floor(K*ne),this.setViewport(0,0,D,K)},this.getCurrentViewport=function(D){return D.copy(I)},this.getViewport=function(D){return D.copy(se)},this.setViewport=function(D,K,ne,ie){D.isVector4?se.set(D.x,D.y,D.z,D.w):se.set(D,K,ne,ie),R.viewport(I.copy(se).multiplyScalar(J).round())},this.getScissor=function(D){return D.copy(ye)},this.setScissor=function(D,K,ne,ie){D.isVector4?ye.set(D.x,D.y,D.z,D.w):ye.set(D,K,ne,ie),R.scissor(N.copy(ye).multiplyScalar(J).round())},this.getScissorTest=function(){return Be},this.setScissorTest=function(D){R.setScissorTest(Be=D)},this.setOpaqueSort=function(D){he=D},this.setTransparentSort=function(D){be=D},this.getClearColor=function(D){return D.copy(Ve.getClearColor())},this.setClearColor=function(){Ve.setClearColor(...arguments)},this.getClearAlpha=function(){return Ve.getClearAlpha()},this.setClearAlpha=function(){Ve.setClearAlpha(...arguments)},this.clear=function(D=!0,K=!0,ne=!0){let ie=0;if(D){let Q=!1;if(P!==null){const ve=P.texture.format;Q=ve===fh||ve===uh||ve===Uc}if(Q){const ve=P.texture.type,Ce=ve===Bi||ve===ks||ve===Ma||ve===Sa||ve===ah||ve===lh,Ne=Ve.getClearColor(),ke=Ve.getClearAlpha(),Qe=Ne.r,Ze=Ne.g,Ge=Ne.b;Ce?(p[0]=Qe,p[1]=Ze,p[2]=Ge,p[3]=ke,w.clearBufferuiv(w.COLOR,0,p)):(_[0]=Qe,_[1]=Ze,_[2]=Ge,_[3]=ke,w.clearBufferiv(w.COLOR,0,_))}else ie|=w.COLOR_BUFFER_BIT}K&&(ie|=w.DEPTH_BUFFER_BIT),ne&&(ie|=w.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),w.clear(ie)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",pe,!1),t.removeEventListener("webglcontextrestored",De,!1),t.removeEventListener("webglcontextcreationerror",Le,!1),Ve.dispose(),Re.dispose(),Pe.dispose(),B.dispose(),A.dispose(),U.dispose(),q.dispose(),Lt.dispose(),Y.dispose(),fe.dispose(),oe.dispose(),oe.removeEventListener("sessionstart",iv),oe.removeEventListener("sessionend",sv),Or.stop()};function pe(D){D.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),E=!0}function De(){console.log("THREE.WebGLRenderer: Context Restored."),E=!1;const D=L.autoReset,K=Se.enabled,ne=Se.autoUpdate,ie=Se.needsUpdate,Q=Se.type;Ie(),L.autoReset=D,Se.enabled=K,Se.autoUpdate=ne,Se.needsUpdate=ie,Se.type=Q}function Le(D){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",D.statusMessage)}function at(D){const K=D.target;K.removeEventListener("dispose",at),Vt(K)}function Vt(D){yn(D),B.remove(D)}function yn(D){const K=B.get(D).programs;K!==void 0&&(K.forEach(function(ne){fe.releaseProgram(ne)}),D.isShaderMaterial&&fe.releaseShaderCache(D))}this.renderBufferDirect=function(D,K,ne,ie,Q,ve){K===null&&(K=He);const Ce=Q.isMesh&&Q.matrixWorld.determinant()<0,Ne=jA(D,K,ne,ie,Q);R.setMaterial(ie,Ce);let ke=ne.index,Qe=1;if(ie.wireframe===!0){if(ke=H.getWireframeAttribute(ne),ke===void 0)return;Qe=2}const Ze=ne.drawRange,Ge=ne.attributes.position;let pt=Ze.start*Qe,bt=(Ze.start+Ze.count)*Qe;ve!==null&&(pt=Math.max(pt,ve.start*Qe),bt=Math.min(bt,(ve.start+ve.count)*Qe)),ke!==null?(pt=Math.max(pt,0),bt=Math.min(bt,ke.count)):Ge!=null&&(pt=Math.max(pt,0),bt=Math.min(bt,Ge.count));const qt=bt-pt;if(qt<0||qt===1/0)return;Lt.setup(Q,ie,Ne,ne,ke);let Ht,_t=Ee;if(ke!==null&&(Ht=O.get(ke),_t=Je,_t.setIndex(Ht)),Q.isMesh)ie.wireframe===!0?(R.setLineWidth(ie.wireframeLinewidth*k()),_t.setMode(w.LINES)):_t.setMode(w.TRIANGLES);else if(Q.isLine){let We=ie.linewidth;We===void 0&&(We=1),R.setLineWidth(We*k()),Q.isLineSegments?_t.setMode(w.LINES):Q.isLineLoop?_t.setMode(w.LINE_LOOP):_t.setMode(w.LINE_STRIP)}else Q.isPoints?_t.setMode(w.POINTS):Q.isSprite&&_t.setMode(w.TRIANGLES);if(Q.isBatchedMesh)if(Q._multiDrawInstances!==null)Mf("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),_t.renderMultiDrawInstances(Q._multiDrawStarts,Q._multiDrawCounts,Q._multiDrawCount,Q._multiDrawInstances);else if(G.get("WEBGL_multi_draw"))_t.renderMultiDraw(Q._multiDrawStarts,Q._multiDrawCounts,Q._multiDrawCount);else{const We=Q._multiDrawStarts,dn=Q._multiDrawCounts,xt=Q._multiDrawCount,wi=ke?O.get(ke).bytesPerElement:1,Uo=B.get(ie).currentProgram.getUniforms();for(let ti=0;ti{function ve(){if(ie.forEach(function(Ce){B.get(Ce).currentProgram.isReady()&&ie.delete(Ce)}),ie.size===0){Q(D);return}setTimeout(ve,10)}G.get("KHR_parallel_shader_compile")!==null?ve():setTimeout(ve,10)})};let Ti=null;function cs(D){Ti&&Ti(D)}function iv(){Or.stop()}function sv(){Or.start()}const Or=new sT;Or.setAnimationLoop(cs),typeof self<"u"&&Or.setContext(self),this.setAnimationLoop=function(D){Ti=D,oe.setAnimationLoop(D),D===null?Or.stop():Or.start()},oe.addEventListener("sessionstart",iv),oe.addEventListener("sessionend",sv),this.render=function(D,K){if(K!==void 0&&K.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(E===!0)return;if(D.matrixWorldAutoUpdate===!0&&D.updateMatrixWorld(),K.parent===null&&K.matrixWorldAutoUpdate===!0&&K.updateMatrixWorld(),oe.enabled===!0&&oe.isPresenting===!0&&(oe.cameraAutoUpdate===!0&&oe.updateCamera(K),K=oe.getCamera()),D.isScene===!0&&D.onBeforeRender(v,D,K,P),m=Pe.get(D,b.length),m.init(K),b.push(m),ae.multiplyMatrices(K.projectionMatrix,K.matrixWorldInverse),re.setFromProjectionMatrix(ae),xe=this.localClippingEnabled,ge=me.init(this.clippingPlanes,xe),g=Re.get(D,y.length),g.init(),y.push(g),oe.enabled===!0&&oe.isPresenting===!0){const ve=v.xr.getDepthSensingMesh();ve!==null&&cp(ve,K,-1/0,v.sortObjects)}cp(D,K,0,v.sortObjects),g.finish(),v.sortObjects===!0&&g.sort(he,be),F=oe.enabled===!1||oe.isPresenting===!1||oe.hasDepthSensing()===!1,F&&Ve.addToRenderList(g,D),this.info.render.frame++,ge===!0&&me.beginShadows();const ne=m.state.shadowsArray;Se.render(ne,D,K),ge===!0&&me.endShadows(),this.info.autoReset===!0&&this.info.reset();const ie=g.opaque,Q=g.transmissive;if(m.setupLights(),K.isArrayCamera){const ve=K.cameras;if(Q.length>0)for(let Ce=0,Ne=ve.length;Ce0&&ov(ie,Q,D,K),F&&Ve.render(D),rv(g,D,K);P!==null&&S===0&&(C.updateMultisampleRenderTarget(P),C.updateRenderTargetMipmap(P)),D.isScene===!0&&D.onAfterRender(v,D,K),Lt.resetDefaultState(),x=-1,M=null,b.pop(),b.length>0?(m=b[b.length-1],ge===!0&&me.setGlobalState(v.clippingPlanes,m.state.camera)):m=null,y.pop(),y.length>0?g=y[y.length-1]:g=null};function cp(D,K,ne,ie){if(D.visible===!1)return;if(D.layers.test(K.layers)){if(D.isGroup)ne=D.renderOrder;else if(D.isLOD)D.autoUpdate===!0&&D.update(K);else if(D.isLight)m.pushLight(D),D.castShadow&&m.pushShadow(D);else if(D.isSprite){if(!D.frustumCulled||re.intersectsSprite(D)){ie&&ce.setFromMatrixPosition(D.matrixWorld).applyMatrix4(ae);const Ce=q.update(D),Ne=D.material;Ne.visible&&g.push(D,Ce,Ne,ne,ce.z,null)}}else if((D.isMesh||D.isLine||D.isPoints)&&(!D.frustumCulled||re.intersectsObject(D))){const Ce=q.update(D),Ne=D.material;if(ie&&(D.boundingSphere!==void 0?(D.boundingSphere===null&&D.computeBoundingSphere(),ce.copy(D.boundingSphere.center)):(Ce.boundingSphere===null&&Ce.computeBoundingSphere(),ce.copy(Ce.boundingSphere.center)),ce.applyMatrix4(D.matrixWorld).applyMatrix4(ae)),Array.isArray(Ne)){const ke=Ce.groups;for(let Qe=0,Ze=ke.length;Qe0&&tu(Q,K,ne),ve.length>0&&tu(ve,K,ne),Ce.length>0&&tu(Ce,K,ne),R.buffers.depth.setTest(!0),R.buffers.depth.setMask(!0),R.buffers.color.setMask(!0),R.setPolygonOffset(!1)}function ov(D,K,ne,ie){if((ne.isScene===!0?ne.overrideMaterial:null)!==null)return;m.state.transmissionRenderTarget[ie.id]===void 0&&(m.state.transmissionRenderTarget[ie.id]=new os(1,1,{generateMipmaps:!0,type:G.has("EXT_color_buffer_half_float")||G.has("EXT_color_buffer_float")?ka:Bi,minFilter:Qi,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:ft.workingColorSpace}));const ve=m.state.transmissionRenderTarget[ie.id],Ce=ie.viewport||I;ve.setSize(Ce.z*v.transmissionResolutionScale,Ce.w*v.transmissionResolutionScale);const Ne=v.getRenderTarget();v.setRenderTarget(ve),v.getClearColor(j),te=v.getClearAlpha(),te<1&&v.setClearColor(16777215,.5),v.clear(),F&&Ve.render(ne);const ke=v.toneMapping;v.toneMapping=ts;const Qe=ie.viewport;if(ie.viewport!==void 0&&(ie.viewport=void 0),m.setupLightsView(ie),ge===!0&&me.setGlobalState(v.clippingPlanes,ie),tu(D,ne,ie),C.updateMultisampleRenderTarget(ve),C.updateRenderTargetMipmap(ve),G.has("WEBGL_multisampled_render_to_texture")===!1){let Ze=!1;for(let Ge=0,pt=K.length;Ge0),Ge=!!ne.morphAttributes.position,pt=!!ne.morphAttributes.normal,bt=!!ne.morphAttributes.color;let qt=ts;ie.toneMapped&&(P===null||P.isXRRenderTarget===!0)&&(qt=v.toneMapping);const Ht=ne.morphAttributes.position||ne.morphAttributes.normal||ne.morphAttributes.color,_t=Ht!==void 0?Ht.length:0,We=B.get(ie),dn=m.state.lights;if(ge===!0&&(xe===!0||D!==M)){const Rn=D===M&&ie.id===x;me.setState(ie,D,Rn)}let xt=!1;ie.version===We.__version?(We.needsLights&&We.lightsStateVersion!==dn.state.version||We.outputColorSpace!==Ne||Q.isBatchedMesh&&We.batching===!1||!Q.isBatchedMesh&&We.batching===!0||Q.isBatchedMesh&&We.batchingColor===!0&&Q.colorTexture===null||Q.isBatchedMesh&&We.batchingColor===!1&&Q.colorTexture!==null||Q.isInstancedMesh&&We.instancing===!1||!Q.isInstancedMesh&&We.instancing===!0||Q.isSkinnedMesh&&We.skinning===!1||!Q.isSkinnedMesh&&We.skinning===!0||Q.isInstancedMesh&&We.instancingColor===!0&&Q.instanceColor===null||Q.isInstancedMesh&&We.instancingColor===!1&&Q.instanceColor!==null||Q.isInstancedMesh&&We.instancingMorph===!0&&Q.morphTexture===null||Q.isInstancedMesh&&We.instancingMorph===!1&&Q.morphTexture!==null||We.envMap!==ke||ie.fog===!0&&We.fog!==ve||We.numClippingPlanes!==void 0&&(We.numClippingPlanes!==me.numPlanes||We.numIntersection!==me.numIntersection)||We.vertexAlphas!==Qe||We.vertexTangents!==Ze||We.morphTargets!==Ge||We.morphNormals!==pt||We.morphColors!==bt||We.toneMapping!==qt||We.morphTargetsCount!==_t)&&(xt=!0):(xt=!0,We.__version=ie.version);let wi=We.currentProgram;xt===!0&&(wi=nu(ie,K,Q));let Uo=!1,ti=!1,qa=!1;const Nt=wi.getUniforms(),ci=We.uniforms;if(R.useProgram(wi.program)&&(Uo=!0,ti=!0,qa=!0),ie.id!==x&&(x=ie.id,ti=!0),Uo||M!==D){R.buffers.depth.getReversed()?($.copy(D.projectionMatrix),oP($),aP($),Nt.setValue(w,"projectionMatrix",$)):Nt.setValue(w,"projectionMatrix",D.projectionMatrix),Nt.setValue(w,"viewMatrix",D.matrixWorldInverse);const Wn=Nt.map.cameraPosition;Wn!==void 0&&Wn.setValue(w,le.setFromMatrixPosition(D.matrixWorld)),W.logarithmicDepthBuffer&&Nt.setValue(w,"logDepthBufFC",2/(Math.log(D.far+1)/Math.LN2)),(ie.isMeshPhongMaterial||ie.isMeshToonMaterial||ie.isMeshLambertMaterial||ie.isMeshBasicMaterial||ie.isMeshStandardMaterial||ie.isShaderMaterial)&&Nt.setValue(w,"isOrthographic",D.isOrthographicCamera===!0),M!==D&&(M=D,ti=!0,qa=!0)}if(Q.isSkinnedMesh){Nt.setOptional(w,Q,"bindMatrix"),Nt.setOptional(w,Q,"bindMatrixInverse");const Rn=Q.skeleton;Rn&&(Rn.boneTexture===null&&Rn.computeBoneTexture(),Nt.setValue(w,"boneTexture",Rn.boneTexture,C))}Q.isBatchedMesh&&(Nt.setOptional(w,Q,"batchingTexture"),Nt.setValue(w,"batchingTexture",Q._matricesTexture,C),Nt.setOptional(w,Q,"batchingIdTexture"),Nt.setValue(w,"batchingIdTexture",Q._indirectTexture,C),Nt.setOptional(w,Q,"batchingColorTexture"),Q._colorsTexture!==null&&Nt.setValue(w,"batchingColorTexture",Q._colorsTexture,C));const ui=ne.morphAttributes;if((ui.position!==void 0||ui.normal!==void 0||ui.color!==void 0)&&Ye.update(Q,ne,wi),(ti||We.receiveShadow!==Q.receiveShadow)&&(We.receiveShadow=Q.receiveShadow,Nt.setValue(w,"receiveShadow",Q.receiveShadow)),ie.isMeshGouraudMaterial&&ie.envMap!==null&&(ci.envMap.value=ke,ci.flipEnvMap.value=ke.isCubeTexture&&ke.isRenderTargetTexture===!1?-1:1),ie.isMeshStandardMaterial&&ie.envMap===null&&K.environment!==null&&(ci.envMapIntensity.value=K.environmentIntensity),ti&&(Nt.setValue(w,"toneMappingExposure",v.toneMappingExposure),We.needsLights&&KA(ci,qa),ve&&ie.fog===!0&&ue.refreshFogUniforms(ci,ve),ue.refreshMaterialUniforms(ci,ie,J,ee,m.state.transmissionRenderTarget[D.id]),Ef.upload(w,lv(We),ci,C)),ie.isShaderMaterial&&ie.uniformsNeedUpdate===!0&&(Ef.upload(w,lv(We),ci,C),ie.uniformsNeedUpdate=!1),ie.isSpriteMaterial&&Nt.setValue(w,"center",Q.center),Nt.setValue(w,"modelViewMatrix",Q.modelViewMatrix),Nt.setValue(w,"normalMatrix",Q.normalMatrix),Nt.setValue(w,"modelMatrix",Q.matrixWorld),ie.isShaderMaterial||ie.isRawShaderMaterial){const Rn=ie.uniformsGroups;for(let Wn=0,up=Rn.length;Wn0&&C.useMultisampledRTT(D)===!1?Q=B.get(D).__webglMultisampledFramebuffer:Array.isArray(Ze)?Q=Ze[ne]:Q=Ze,I.copy(D.viewport),N.copy(D.scissor),V=D.scissorTest}else I.copy(se).multiplyScalar(J).floor(),N.copy(ye).multiplyScalar(J).floor(),V=Be;if(ne!==0&&(Q=JA),R.bindFramebuffer(w.FRAMEBUFFER,Q)&&ie&&R.drawBuffers(D,Q),R.viewport(I),R.scissor(N),R.setScissorTest(V),ve){const ke=B.get(D.texture);w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_CUBE_MAP_POSITIVE_X+K,ke.__webglTexture,ne)}else if(Ce){const ke=B.get(D.texture),Qe=K;w.framebufferTextureLayer(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,ke.__webglTexture,ne,Qe)}else if(D!==null&&ne!==0){const ke=B.get(D.texture);w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_2D,ke.__webglTexture,ne)}x=-1},this.readRenderTargetPixels=function(D,K,ne,ie,Q,ve,Ce){if(!(D&&D.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ne=B.get(D).__webglFramebuffer;if(D.isWebGLCubeRenderTarget&&Ce!==void 0&&(Ne=Ne[Ce]),Ne){R.bindFramebuffer(w.FRAMEBUFFER,Ne);try{const ke=D.texture,Qe=ke.format,Ze=ke.type;if(!W.textureFormatReadable(Qe)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!W.textureTypeReadable(Ze)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}K>=0&&K<=D.width-ie&&ne>=0&&ne<=D.height-Q&&w.readPixels(K,ne,ie,Q,it.convert(Qe),it.convert(Ze),ve)}finally{const ke=P!==null?B.get(P).__webglFramebuffer:null;R.bindFramebuffer(w.FRAMEBUFFER,ke)}}},this.readRenderTargetPixelsAsync=async function(D,K,ne,ie,Q,ve,Ce){if(!(D&&D.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Ne=B.get(D).__webglFramebuffer;if(D.isWebGLCubeRenderTarget&&Ce!==void 0&&(Ne=Ne[Ce]),Ne)if(K>=0&&K<=D.width-ie&&ne>=0&&ne<=D.height-Q){R.bindFramebuffer(w.FRAMEBUFFER,Ne);const ke=D.texture,Qe=ke.format,Ze=ke.type;if(!W.textureFormatReadable(Qe))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!W.textureTypeReadable(Ze))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const Ge=w.createBuffer();w.bindBuffer(w.PIXEL_PACK_BUFFER,Ge),w.bufferData(w.PIXEL_PACK_BUFFER,ve.byteLength,w.STREAM_READ),w.readPixels(K,ne,ie,Q,it.convert(Qe),it.convert(Ze),0);const pt=P!==null?B.get(P).__webglFramebuffer:null;R.bindFramebuffer(w.FRAMEBUFFER,pt);const bt=w.fenceSync(w.SYNC_GPU_COMMANDS_COMPLETE,0);return w.flush(),await rP(w,bt,4),w.bindBuffer(w.PIXEL_PACK_BUFFER,Ge),w.getBufferSubData(w.PIXEL_PACK_BUFFER,0,ve),w.deleteBuffer(Ge),w.deleteSync(bt),ve}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(D,K=null,ne=0){const ie=Math.pow(2,-ne),Q=Math.floor(D.image.width*ie),ve=Math.floor(D.image.height*ie),Ce=K!==null?K.x:0,Ne=K!==null?K.y:0;C.setTexture2D(D,0),w.copyTexSubImage2D(w.TEXTURE_2D,ne,0,0,Ce,Ne,Q,ve),R.unbindTexture()};const QA=w.createFramebuffer(),eC=w.createFramebuffer();this.copyTextureToTexture=function(D,K,ne=null,ie=null,Q=0,ve=null){ve===null&&(Q!==0?(Mf("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),ve=Q,Q=0):ve=0);let Ce,Ne,ke,Qe,Ze,Ge,pt,bt,qt;const Ht=D.isCompressedTexture?D.mipmaps[ve]:D.image;if(ne!==null)Ce=ne.max.x-ne.min.x,Ne=ne.max.y-ne.min.y,ke=ne.isBox3?ne.max.z-ne.min.z:1,Qe=ne.min.x,Ze=ne.min.y,Ge=ne.isBox3?ne.min.z:0;else{const ui=Math.pow(2,-Q);Ce=Math.floor(Ht.width*ui),Ne=Math.floor(Ht.height*ui),D.isDataArrayTexture?ke=Ht.depth:D.isData3DTexture?ke=Math.floor(Ht.depth*ui):ke=1,Qe=0,Ze=0,Ge=0}ie!==null?(pt=ie.x,bt=ie.y,qt=ie.z):(pt=0,bt=0,qt=0);const _t=it.convert(K.format),We=it.convert(K.type);let dn;K.isData3DTexture?(C.setTexture3D(K,0),dn=w.TEXTURE_3D):K.isDataArrayTexture||K.isCompressedArrayTexture?(C.setTexture2DArray(K,0),dn=w.TEXTURE_2D_ARRAY):(C.setTexture2D(K,0),dn=w.TEXTURE_2D),w.pixelStorei(w.UNPACK_FLIP_Y_WEBGL,K.flipY),w.pixelStorei(w.UNPACK_PREMULTIPLY_ALPHA_WEBGL,K.premultiplyAlpha),w.pixelStorei(w.UNPACK_ALIGNMENT,K.unpackAlignment);const xt=w.getParameter(w.UNPACK_ROW_LENGTH),wi=w.getParameter(w.UNPACK_IMAGE_HEIGHT),Uo=w.getParameter(w.UNPACK_SKIP_PIXELS),ti=w.getParameter(w.UNPACK_SKIP_ROWS),qa=w.getParameter(w.UNPACK_SKIP_IMAGES);w.pixelStorei(w.UNPACK_ROW_LENGTH,Ht.width),w.pixelStorei(w.UNPACK_IMAGE_HEIGHT,Ht.height),w.pixelStorei(w.UNPACK_SKIP_PIXELS,Qe),w.pixelStorei(w.UNPACK_SKIP_ROWS,Ze),w.pixelStorei(w.UNPACK_SKIP_IMAGES,Ge);const Nt=D.isDataArrayTexture||D.isData3DTexture,ci=K.isDataArrayTexture||K.isData3DTexture;if(D.isDepthTexture){const ui=B.get(D),Rn=B.get(K),Wn=B.get(ui.__renderTarget),up=B.get(Rn.__renderTarget);R.bindFramebuffer(w.READ_FRAMEBUFFER,Wn.__webglFramebuffer),R.bindFramebuffer(w.DRAW_FRAMEBUFFER,up.__webglFramebuffer);for(let Nr=0;Nr{n.delete(r)};return{on:r=>{n.add(r);const o=()=>e(r);return xr(o),{off:o}},off:e,trigger:(...r)=>Promise.all(Array.from(n).map(o=>o(...r))),clear:()=>{n.clear()}}}const lm=new WeakMap,MF=(...n)=>{var e;const t=n[0],i=(e=An())==null?void 0:e.proxy;if(i==null&&!Rc())throw new Error("injectLocal must be called in setup");return i&&lm.has(i)&&t in lm.get(i)?lm.get(i)[t]:Tn(...n)},wg=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const SF=n=>typeof n<"u",EF=n=>n!=null,TF=Object.prototype.toString,wF=n=>TF.call(n)==="[object Object]",Ag=()=>{};function AF(n,e){function t(...i){return new Promise((s,r)=>{Promise.resolve(n(()=>e.apply(this,i),{fn:e,thisArg:this,args:i})).then(s).catch(r)})}return t}function CF(n,e={}){let t,i,s=Ag;const r=l=>{clearTimeout(l),s(),s=Ag};let o;return l=>{const c=nt(n),u=nt(e.maxWait);return t&&r(t),c<=0||u!==void 0&&u<=0?(i&&(r(i),i=null),Promise.resolve(l())):new Promise((f,d)=>{s=e.rejectOnCancel?d:f,o=l,u&&!i&&(i=setTimeout(()=>{t&&r(t),i=null,f(o())},u)),t=setTimeout(()=>{i&&r(i),i=null,f(l())},c)})}}function Ob(n){return n.endsWith("rem")?Number.parseFloat(n)*16:Number.parseFloat(n)}function RF(n,e,t=!1){return e.reduce((i,s)=>(s in n&&(!t||n[s]!==void 0)&&(i[s]=n[s]),i),{})}function PF(n){return An()}function Dl(n){return Array.isArray(n)?n:[n]}function IF(n,e=200,t={}){return AF(CF(e,t),n)}function Nb(n,e=200,t={}){const i=et(n.value),s=IF(()=>{i.value=n.value},e,t);return Xe(n,()=>s()),i}function LF(n,e={}){if(!Pt(n))return cS(n);const t=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)t[i]=w0(()=>({get(){return n.value[i]},set(s){var r;if((r=nt(e.replaceRef))!=null?r:!0)if(Array.isArray(n.value)){const a=[...n.value];a[i]=s,n.value=a}else{const a={...n.value,[i]:s};Object.setPrototypeOf(a,Object.getPrototypeOf(n.value)),n.value=a}else n.value[i]=s}}));return t}const hn=nt;function S_(n,e=!0,t){PF()?Hn(n,t):e?n():wr(n)}function DF(n,e=1e3,t={}){const{immediate:i=!0,immediateCallback:s=!1}=t;let r=null;const o=Oe(!1);function a(){r&&(clearInterval(r),r=null)}function l(){o.value=!1,a()}function c(){const u=nt(e);u<=0||(o.value=!0,s&&n(),a(),o.value&&(r=setInterval(n,u)))}if(i&&wg&&c(),Pt(e)||typeof e=="function"){const u=Xe(e,()=>{o.value&&wg&&c()});xr(u)}return xr(l),{isActive:o,pause:l,resume:c}}function uT(n,e,t){return Xe(n,e,{...t,immediate:!0})}const Gs=wg?window:void 0;function Di(n){var e;const t=nt(n);return(e=t==null?void 0:t.$el)!=null?e:t}function Ao(...n){const e=[],t=()=>{e.forEach(a=>a()),e.length=0},i=(a,l,c,u)=>(a.addEventListener(l,c,u),()=>a.removeEventListener(l,c,u)),s=Me(()=>{const a=Dl(nt(n[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),r=uT(()=>{var a,l;return[(l=(a=s.value)==null?void 0:a.map(c=>Di(c)))!=null?l:[Gs].filter(c=>c!=null),Dl(nt(s.value?n[1]:n[0])),Dl(Ot(s.value?n[2]:n[1])),nt(s.value?n[3]:n[2])]},([a,l,c,u])=>{if(t(),!(a!=null&&a.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const f=wF(u)?{...u}:u;e.push(...a.flatMap(d=>l.flatMap(h=>c.map(p=>i(d,h,p,f)))))},{flush:"post"}),o=()=>{r(),t()};return xr(t),o}function OF(){const n=Oe(!1),e=An();return e&&Hn(()=>{n.value=!0},e),n}function Vh(n){const e=OF();return Me(()=>(e.value,!!n()))}function NF(n,e,t={}){const{window:i=Gs,...s}=t;let r;const o=Vh(()=>i&&"MutationObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=Me(()=>{const d=nt(n),h=Dl(d).map(Di).filter(EF);return new Set(h)}),c=Xe(()=>l.value,d=>{a(),o.value&&d.size&&(r=new MutationObserver(e),d.forEach(h=>r.observe(h,s)))},{immediate:!0,flush:"post"}),u=()=>r==null?void 0:r.takeRecords(),f=()=>{c(),a()};return xr(f),{isSupported:o,stop:f,takeRecords:u}}function E_(n,e={}){const{immediate:t=!0,fpsLimit:i=void 0,window:s=Gs,once:r=!1}=e,o=Oe(!1),a=Me(()=>i?1e3/nt(i):null);let l=0,c=null;function u(h){if(!o.value||!s)return;l||(l=h);const p=h-l;if(a.value&&pt&&"matchMedia"in t&&typeof t.matchMedia=="function"),r=Oe(typeof i=="number"),o=Oe(),a=Oe(!1),l=c=>{a.value=c.matches};return Pc(()=>{if(r.value){r.value=!s.value;const c=nt(n).split(",");a.value=c.some(u=>{const f=u.includes("not all"),d=u.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),h=u.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let p=!!(d||h);return d&&p&&(p=i>=Ob(d[1])),h&&p&&(p=i<=Ob(h[1])),f?!p:p});return}s.value&&(o.value=t.matchMedia(nt(n)),a.value=o.value.matches)}),Ao(o,"change",l,{passive:!0}),Me(()=>a.value)}function kF(n){return JSON.parse(JSON.stringify(n))}function BF(n={}){const{window:e=Gs}=n,t=Oe(1),i=fT(()=>`(resolution: ${t.value}dppx)`,n);let s=Ag;return e&&(s=uT(i,()=>t.value=e.devicePixelRatio)),{pixelRatio:Fi(t),stop:s}}function dT(n,e,t={}){const{window:i=Gs,...s}=t;let r;const o=Vh(()=>i&&"ResizeObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=Me(()=>{const f=nt(n);return Array.isArray(f)?f.map(d=>Di(d)):[Di(f)]}),c=Xe(l,f=>{if(a(),o.value&&i){r=new ResizeObserver(e);for(const d of f)d&&r.observe(d,s)}},{immediate:!0,flush:"post"}),u=()=>{a(),c()};return xr(u),{isSupported:o,stop:u}}function zF(n,e={}){const{reset:t=!0,windowResize:i=!0,windowScroll:s=!0,immediate:r=!0,updateTiming:o="sync"}=e,a=Oe(0),l=Oe(0),c=Oe(0),u=Oe(0),f=Oe(0),d=Oe(0),h=Oe(0),p=Oe(0);function _(){const m=Di(n);if(!m){t&&(a.value=0,l.value=0,c.value=0,u.value=0,f.value=0,d.value=0,h.value=0,p.value=0);return}const y=m.getBoundingClientRect();a.value=y.height,l.value=y.bottom,c.value=y.left,u.value=y.right,f.value=y.top,d.value=y.width,h.value=y.x,p.value=y.y}function g(){o==="sync"?_():o==="next-frame"&&requestAnimationFrame(()=>_())}return dT(n,g),Xe(()=>Di(n),m=>!m&&g()),NF(n,g,{attributeFilter:["style","class"]}),s&&Ao("scroll",g,{capture:!0,passive:!0}),i&&Ao("resize",g,{passive:!0}),S_(()=>{r&&g()}),{height:a,bottom:l,left:c,right:u,top:f,width:d,x:h,y:p,update:g}}function VF(n,e={width:0,height:0},t={}){const{window:i=Gs,box:s="content-box"}=t,r=Me(()=>{var f,d;return(d=(f=Di(n))==null?void 0:f.namespaceURI)==null?void 0:d.includes("svg")}),o=Oe(e.width),a=Oe(e.height),{stop:l}=dT(n,([f])=>{const d=s==="border-box"?f.borderBoxSize:s==="content-box"?f.contentBoxSize:f.devicePixelContentBoxSize;if(i&&r.value){const h=Di(n);if(h){const p=h.getBoundingClientRect();o.value=p.width,a.value=p.height}}else if(d){const h=Dl(d);o.value=h.reduce((p,{inlineSize:_})=>p+_,0),a.value=h.reduce((p,{blockSize:_})=>p+_,0)}else o.value=f.contentRect.width,a.value=f.contentRect.height},t);S_(()=>{const f=Di(n);f&&(o.value="offsetWidth"in f?f.offsetWidth:e.width,a.value="offsetHeight"in f?f.offsetHeight:e.height)});const c=Xe(()=>Di(n),f=>{o.value=f?e.width:0,a.value=f?e.height:0});function u(){l(),c()}return{width:o,height:a,stop:u}}function HF(n){var e;const t=Oe(0);if(typeof performance>"u")return t;const i=(e=n==null?void 0:n.every)!=null?e:10;let s=performance.now(),r=0;return E_(()=>{if(r+=1,r>=i){const o=performance.now(),a=o-s;t.value=Math.round(1e3/(a/r)),s=o,r=0}}),t}function GF(n={}){const e=et(),t=Vh(()=>typeof performance<"u"&&"memory"in performance);if(t.value){const{interval:i=1e3}=n;DF(()=>{e.value=performance.memory},i,{immediate:n.immediate,immediateCallback:n.immediateCallback})}return{isSupported:t,memory:e}}const hT={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},WF=Object.keys(hT);function XF(n={}){const{target:e=Gs}=n,t=Oe(!1),i=et(n.initialValue||{});Object.assign(i.value,hT,i.value);const s=r=>{t.value=!0,!(n.pointerTypes&&!n.pointerTypes.includes(r.pointerType))&&(i.value=RF(r,WF,!1))};if(e){const r={passive:!0};Ao(e,["pointerdown","pointermove","pointerup"],s,r),Ao(e,"pointerleave",()=>t.value=!1,r)}return{...LF(i),isInside:t}}function vG(n,e,t,i={}){var s,r,o;const{clone:a=!1,passive:l=!1,eventName:c,deep:u=!1,defaultValue:f,shouldEmit:d}=i,h=An(),p=t||(h==null?void 0:h.emit)||((s=h==null?void 0:h.$emit)==null?void 0:s.bind(h))||((o=(r=h==null?void 0:h.proxy)==null?void 0:r.$emit)==null?void 0:o.bind(h==null?void 0:h.proxy));let _=c;_=_||`update:${e.toString()}`;const g=b=>a?typeof a=="function"?a(b):kF(b):b,m=()=>SF(n[e])?g(n[e]):f,y=b=>{d?d(b)&&p(_,b):p(_,b)};if(l){const b=m(),v=et(b);let E=!1;return Xe(()=>n[e],T=>{E||(E=!0,v.value=g(T),wr(()=>E=!1))}),Xe(v,T=>{!E&&(T!==n[e]||u)&&y(T)},{deep:u}),v}else return Me({get(){return m()},set(b){y(b)}})}function $F(n={}){const{window:e=Gs,initialWidth:t=Number.POSITIVE_INFINITY,initialHeight:i=Number.POSITIVE_INFINITY,listenOrientation:s=!0,includeScrollbar:r=!0,type:o="inner"}=n,a=Oe(t),l=Oe(i),c=()=>{if(e)if(o==="outer")a.value=e.outerWidth,l.value=e.outerHeight;else if(o==="visual"&&e.visualViewport){const{width:f,height:d,scale:h}=e.visualViewport;a.value=Math.round(f*h),l.value=Math.round(d*h)}else r?(a.value=e.innerWidth,l.value=e.innerHeight):(a.value=e.document.documentElement.clientWidth,l.value=e.document.documentElement.clientHeight)};c(),S_(c);const u={passive:!0};if(Ao("resize",c,u),e&&o==="visual"&&e.visualViewport&&Ao(e.visualViewport,"resize",c,u),s){const f=fT("(orientation: portrait)");Xe(f,()=>c())}return{width:a,height:l}}var qF=Object.defineProperty,YF=(n,e,t)=>e in n?qF(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ub=(n,e,t)=>YF(n,typeof e!="symbol"?e+"":e,t);const jF="@tresjs/core",KF="module",ZF="4.3.3",JF="pnpm@9.15.5",QF="Declarative ThreeJS using Vue Components",ek="Alvaro Saburido (https://github.com/alvarosabu/)",tk="MIT",nk={type:"git",url:"git+https://github.com/Tresjs/tres.git"},ik=["vue","3d","threejs","three","threejs-vue"],sk=!1,rk={".":{types:"./dist/index.d.ts",import:"./dist/tres.js",require:"./dist/tres.umd.cjs"},"./components":{types:"./dist/src/components/index.d.ts"},"./composables":{types:"./dist/src/composables/index.d.ts"},"./types":{types:"./dist/src/types/index.d.ts"},"./utils":{types:"./dist/src/utils/index.d.ts"},"./*":"./*"},ok="./dist/tres.js",ak="./dist/tres.js",lk="./dist/index.d.ts",ck=["*.d.ts","dist"],uk={access:"public"},fk={dev:"pnpm --filter='./playground/vue' dev","dev:nuxt":"pnpm --filter='./playground/nuxt' dev",build:"vite build",test:"vitest","test:ci":"vitest run","test:ui":"vitest --ui --coverage.enabled=true",release:"release-it",coverage:"vitest run --coverage",lint:"eslint .","lint:fix":"eslint . --fix","docs:dev":"vitepress dev docs","docs:build":"vitepress build docs","docs:serve":"vitepress serve docs","docs:preview":"vitepress preview docs","docs:contributors":"esno scripts/update-contributors.ts"},dk={three:">=0.133",vue:">=3.4"},hk={"@alvarosabu/utils":"^3.2.0","@vue/devtools-api":"^6.6.3","@vueuse/core":"^12.5.0"},pk={"@release-it/conventional-changelog":"^10.0.0","@stackblitz/sdk":"^1.11.0","@tresjs/cientos":"4.1.0","@tresjs/eslint-config":"^1.4.0","@types/three":"^0.173.0","@typescript-eslint/eslint-plugin":"^8.23.0","@typescript-eslint/parser":"^8.23.0","@vitejs/plugin-vue":"^5.2.1","@vitest/coverage-c8":"^0.33.0","@vitest/coverage-v8":"^3.0.5","@vitest/ui":"^3.0.5","@vue/test-utils":"^2.4.6",eslint:"^9.19.0","eslint-plugin-vue":"^9.32.0",esno:"^4.8.0",gsap:"^3.12.7",jsdom:"^26.0.0",kolorist:"^1.8.0",ohmyfetch:"^0.4.21",pathe:"^2.0.2","release-it":"^18.1.2","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-copy":"^3.5.0","rollup-plugin-visualizer":"^5.14.0",sponsorkit:"^16.3.0",three:"^0.173.0",unocss:"^65.4.3",unplugin:"^2.1.2","unplugin-vue-components":"^28.0.0",vite:"^6.1.0","vite-plugin-banner":"^0.8.0","vite-plugin-dts":"4.5.0","vite-plugin-inspect":"^10.1.0","vite-plugin-require-transform":"^1.0.21","vite-svg-loader":"^5.1.0",vitepress:"1.6.3",vitest:"3.0.5",vue:"3.5.13","vue-demi":"^0.14.10"},mk={name:jF,type:KF,version:ZF,packageManager:JF,description:QF,author:ek,license:tk,repository:nk,keywords:ik,sideEffects:sk,exports:rk,main:ok,module:ak,types:lk,files:ck,publishConfig:uk,scripts:fk,peerDependencies:dk,dependencies:hk,devDependencies:pk};class gk extends $t{constructor(...e){super(...e),Ub(this,"type","HightlightMesh"),Ub(this,"createTime"),this.createTime=Date.now()}onBeforeRender(){const e=(Date.now()-this.createTime)/1e3,t=1+.07*Math.sin(2.5*e);this.scale.set(t,t,t)}}function Cg(n){return typeof n>"u"}function Cd(n){return Array.isArray(n)}function _k(n){return typeof n=="number"}function pT(n){return typeof n=="string"}function ao(n){return typeof n=="function"}function Ws(n){return n===Object(n)&&!Cd(n)&&!ao(n)}function dr(n){return Ws(n)&&"isObject3D"in n&&!!n.isObject3D}function Fb(n){return Ws(n)&&"isCamera"in n&&!!n.isCamera}function vk(n){return Ws(n)&&"isBufferGeometry"in n&&!!n.isBufferGeometry}function yk(n){return Ws(n)&&"isMaterial"in n&&!!n.isMaterial}function bk(n){return Ws(n)&&"isLight"in n&&!!n.isLight}function xk(n){return Ws(n)&&"isFog"in n&&!!n.isFog}function Mk(n){return Ws(n)&&"isScene"in n&&!!n.isScene}function ef(n){return dr(n)||vk(n)||yk(n)||xk(n)}function Sk(n){return Ws(n)&&!!n.isPrimitive}const mT=(n,e)=>{for(const t of Object.keys(e))e[t]instanceof Object&&Object.assign(e[t],mT(n[t],e[t]));return Object.assign(n||{},e),n},Ek="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",Tk=Ck(Ek);function kb(n){return n&&n.nodeType===1}function tf(n){return n.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}const wk=/\B([A-Z])/g;function Ak(n){return n.replace(wk,"-$1").toLowerCase()}function Ck(n,e){const t=Object.create(null),i=n.split(",");for(let s=0;s!!t[s.toLowerCase()]:s=>!!t[s]}const Bb=(n,e)=>{if(!e)return;const t=Array.isArray(e)?e:e.match(/([^[.\]])+/g);return t==null?void 0:t.reduce((i,s)=>i&&i[s],n)},Rk=(n,e,t)=>{const i=Array.isArray(e)?e:e.match(/([^[.\]])+/g);i&&i.reduce((s,r,o)=>(s[r]===void 0&&(s[r]={}),o===i.length-1&&(s[r]=t),s[r]),n)};function gT(n,e){if(kb(n)&&kb(e)){const s=n.attributes,r=e.attributes;return s.length!==r.length?!1:Array.from(s).every(({name:o,value:a})=>e.getAttribute(o)===a)}if(n===e)return!0;if(n===null||typeof n!="object"||e===null||typeof e!="object")return!1;const t=Object.keys(n),i=Object.keys(e);if(t.length!==i.length)return!1;for(const s of t)if(!i.includes(s)||!gT(n[s],e[s]))return!1;return!0}function Pk(n,e){if(!Array.isArray(n)||!Array.isArray(e)||n.length!==e.length)return!1;for(let t=0;t{if(l.uuid===e)return l;for(const c of l.children){const u=s(c);if(u)return u}},r=s(n);if(!r){console.warn("Object with UUID not found in the scene.");return}let o=r;for(let l=0;l_T(i)),!(n instanceof vh)){const i=n;n&&((t=n.dispose)==null||t.call(n)),i.geometry&&i.geometry.dispose(),Array.isArray(i.material)?i.material.forEach(s=>zb(s)):i.material&&zb(i.material)}}function Ok(n,e){let t=0;for(let i=0;it===0?e:e.charAt(0).toUpperCase()+e.slice(1)).join("")}const Hb=/-\d+$/;function Nk(n,e,t){if(pT(t)){if(Hb.test(t)){const r=t.replace(Hb,""),{target:o,key:a}=Rg(n,r);if(!Array.isArray(o[a])){const l=o[a],c=[];c.__tresDetach=()=>{c.every(u=>Cg(u))&&(o[a]=l)},o[a]=c}}const{target:i,key:s}=Rg(n,t);e.__tres.previousAttach=i[s],i[s]=Pa(e)}else e.__tres.previousAttach=t(n,e)}function Uk(n,e,t){var i,s,r;if(pT(t)){const{target:o,key:a}=Rg(n,t),l=e.__tres.previousAttach;l===void 0?delete o[a]:o[a]=l,"__tresDetach"in o&&o.__tresDetach()}else(s=(i=e.__tres)==null?void 0:i.previousAttach)==null||s.call(i,n,e);(r=e.__tres)==null||delete r.previousAttach}function so(n,e,t){const i=n;return i.__tres={type:"unknown",eventCount:0,root:t,handlers:{},memoizedProps:{},objects:[],parent:null,previousAttach:null,...e},i.__tres.attach||(i.isMaterial?i.__tres.attach="material":i.isBufferGeometry?i.__tres.attach="geometry":i.isFog&&(i.__tres.attach="fog")),i}function vT(n){var e;const t=(e=n==null?void 0:n.__tres)==null?void 0:e.root;t&&t.render&&t.render.canBeInvalidated.value&&t.invalidate()}function Fk(n,e,t){var i;if(!ao(n.setPixelRatio))return;let s=0;if(t&&Cd(t)){const r=t;if(r.length>=2){const[o,a]=r;s=Z0.clamp(e,o,a)}}else _k(t)?s=t:s=e;s!==((i=n.getPixelRatio)==null?void 0:i.call(n))&&n.setPixelRatio(s)}function kk(n,e,t,i,s){const r=[...e.__tres.objects],o=Pa(e);if(n=Pa(n),o===n)return!0;const a=so(n,e.__tres??{},s),l=e.parent??e.__tres.parent??null,c={...e.__tres.memoizedProps};delete c.object;for(const u of r)yT(u,s),bT(u,s);o.__tres.objects=[],i.remove(e);for(const[u,f]of Object.entries(c))i.patchProp(a,u,a[u],f);t(n),i.insert(e,l);for(const u of r)i.insert(u,e);return!0}function Pa(n){return Sk(n)?(n.object.__tres=n.__tres,n.object):n}function yT(n,e){var t,i,s,r;const o=((t=n.__tres)==null?void 0:t.parent)||e.scene.value;n.__tres&&(n.__tres.parent=null),o&&o.__tres&&"objects"in o.__tres&&Ok(o.__tres.objects,a=>a!==n),(i=n.__tres)!=null&&i.attach?Uk(o,n,n.__tres.attach):((r=(s=n.parent)==null?void 0:s.remove)==null||r.call(s,Pa(n)),n.parent=null)}function bT(n,e){var t;(t=n.traverse)==null||t.call(n,i=>{var s;e.deregisterCamera(i),(s=e.eventManager)==null||s.deregisterPointerMissedObject(i)}),e.deregisterCamera(n),vT(n)}const Bk=({sizes:n})=>{const e=et([]),t=Me(()=>e.value[0]),i=o=>{const a=o instanceof kc?o:e.value.find(c=>c.uuid===o);if(!a)return;const l=e.value.filter(({uuid:c})=>c!==a.uuid);e.value=[a,...l]},s=(o,a=!1)=>{if(Fb(o)){const l=o;if(e.value.some(({uuid:c})=>c===l.uuid))return;a?i(l):e.value.push(l)}},r=o=>{if(Fb(o)){const a=o;e.value=e.value.filter(({uuid:l})=>l!==a.uuid)}};return Pc(()=>{n.aspectRatio.value&&e.value.forEach(o=>{!o.manual&&(o instanceof Kt||zk(o))&&(o instanceof Kt?o.aspect=n.aspectRatio.value:(o.left=n.width.value*-.5,o.right=n.width.value*.5,o.top=n.height.value*.5,o.bottom=n.height.value*-.5),o.updateProjectionMatrix())})}),rs(()=>{e.value=[]}),{camera:t,cameras:e,registerCamera:s,deregisterCamera:r,setCameraActive:i}};function zk(n){return n.hasOwnProperty("isOrthographicCamera")&&n.isOrthographicCamera}const Rd="[TresJS ▲ ■ ●] ";function Vk(...n){typeof n[0]=="string"?n[0]=Rd+n[0]:n.unshift(Rd),console.error(...n)}function Hk(...n){typeof n[0]=="string"?n[0]=Rd+n[0]:n.unshift(Rd),console.warn(...n)}function Gk(n,e){}function xT(){return{logError:Vk,logWarning:Hk,logMessage:Gk}}const Pg=et({}),Ig=n=>Object.assign(Pg.value,n);function cm(){const n=new Map,e=new Set;let t=0,i=!1;const s=()=>{const o=Array.from(n.entries()).sort((a,l)=>{const c=a[1].priority-l[1].priority;return c===0?a[1].addI-l[1].addI:c});e.clear(),o.forEach(a=>e.add(a[0]))},r=o=>{n.delete(o),e.delete(o)};return{on:(o,a=0)=>{n.set(o,{priority:a,addI:t++});const l=()=>r(o);return xr(l),i=!0,{off:l}},off:r,trigger:(...o)=>{i&&(s(),i=!1),e.forEach(a=>a(...o))},dispose:()=>{n.clear(),e.clear()},get count(){return n.size}}}function Wk(){let n=!0,e=!0,t=!1;const i=new Bh(!1),s=et(i.running),r=et(!1);let o;const a=Z0.generateUUID();let l=null;const c=cm(),u=cm(),f=cm();T();let d={};function h(S){d=S}function p(S,P,x=0){switch(P){case"before":return c.on(S,x);case"render":return l||(l=S),u.dispose(),u.on(S);case"after":return f.on(S,x)}}function _(){e&&(e=!1,T(),E())}function g(){e=!0,T(),cancelAnimationFrame(o)}function m(){t=!1,T()}function y(){t=!0,T()}function b(){r.value=!0}function v(){r.value=!1}function E(){if(!n){o=requestAnimationFrame(E);return}const S=i.getDelta(),P=i.getElapsedTime(),x={camera:Ot(d.camera),scene:Ot(d.scene),renderer:Ot(d.renderer),raycaster:Ot(d.raycaster),controls:Ot(d.controls),invalidate:d.invalidate,advance:d.advance},M={delta:S,elapsed:P,clock:i,...x};s.value&&c.trigger(M),r.value||(u.count?u.trigger(M):l&&l(M)),s.value&&f.trigger(M),o=requestAnimationFrame(E)}function T(){const S=!e&&!t;i.running!==S&&(i.running?i.stop():i.start()),s.value=i.running}return{loopId:a,register:(S,P,x)=>p(S,P,x),start:_,stop:g,pause:y,resume:m,pauseRender:b,resumeRender:v,isRenderPaused:r,isActive:s,setContext:h,setReady:S=>n=S}}function T_(n){let e=0;return n.traverse(t=>{if(t.isMesh&&t.geometry&&t.type!=="HightlightMesh"){const i=t.geometry,s=i.attributes.position.count*3*Float32Array.BYTES_PER_ELEMENT,r=i.index?i.index.count*Uint32Array.BYTES_PER_ELEMENT:0,o=i.attributes.normal?i.attributes.normal.count*3*Float32Array.BYTES_PER_ELEMENT:0,a=i.attributes.uv?i.attributes.uv.count*2*Float32Array.BYTES_PER_ELEMENT:0,l=s+r+o+a;e+=l}}),e}function Xk(n){return(n/1024).toFixed(2)}const $k=Number.parseInt(Oc.replace("dev",""));function qk(n){return n instanceof Ae?n:Array.isArray(n)?new Ae(...n):new Ae(n)}const nf={realistic:{shadows:!0,physicallyCorrectLights:!0,outputColorSpace:Un,toneMapping:sh,toneMappingExposure:3,shadowMap:{enabled:!0,type:B0}},flat:{toneMapping:ts,toneMappingExposure:1}};function Yk({canvas:n,options:e,contextParts:{sizes:t,render:i,invalidate:s,advance:r}}){const o=Me(()=>({alpha:hn(e.alpha)??!0,depth:hn(e.depth),canvas:Di(n),context:hn(e.context),stencil:hn(e.stencil),antialias:hn(e.antialias)??!0,precision:hn(e.precision),powerPreference:hn(e.powerPreference),premultipliedAlpha:hn(e.premultipliedAlpha),preserveDrawingBuffer:hn(e.preserveDrawingBuffer),logarithmicDepthBuffer:hn(e.logarithmicDepthBuffer),failIfMajorPerformanceCaveat:hn(e.failIfMajorPerformanceCaveat)})),a=Oe(new Tf(o.value));function l(){e.renderMode==="on-demand"&&s()}Xe(o,()=>{a.value.dispose(),a.value=new Tf(o.value),l()}),Xe([t.width,t.height],()=>{a.value.setSize(t.width.value,t.height.value),l()},{immediate:!0}),Xe(()=>e.clearColor,l);const{pixelRatio:c}=BF(),{logError:u}=xT(),f=(()=>{const h=new Tf,p={shadowMap:{enabled:h.shadowMap.enabled,type:h.shadowMap.type},toneMapping:h.toneMapping,toneMappingExposure:h.toneMappingExposure,outputColorSpace:h.outputColorSpace};return h.dispose(),p})(),d=hn(e.renderMode);return d==="on-demand"&&s(),d==="manual"&&setTimeout(()=>{r()},100),Pc(()=>{const h=hn(e.preset);h&&(h in nf||u(`Renderer Preset must be one of these: ${Object.keys(nf).join(", ")}`),mT(a.value,nf[h])),Fk(a.value,c.value,hn(e.dpr)),d==="always"&&(i.frames.value=Math.max(1,i.frames.value));const p=(m,y)=>{const b=hn(m),v=()=>{if(h)return Bb(nf[h],y)};if(b!==void 0)return b;const E=v();return E!==void 0?E:Bb(f,y)},_=(m,y)=>Rk(a.value,y,p(m,y));_(e.shadows,"shadowMap.enabled"),_(e.toneMapping??sh,"toneMapping"),_(e.shadowMapType,"shadowMap.type"),$k<150&&_(!e.useLegacyLights,"physicallyCorrectLights"),_(e.outputColorSpace,"outputColorSpace"),_(e.toneMappingExposure,"toneMappingExposure");const g=p(e.clearColor,"clearColor");g&&a.value.setClearColor(g?qk(g):new Ae(0))}),rs(()=>{a.value.dispose(),a.value.forceContextLoss()}),{renderer:a}}function jk(n,e,t=10){const i=hn(n)?$F():VF(Me(()=>hn(e).parentElement)),s=Fi(Nb(i.width,t)),r=Fi(Nb(i.height,t)),o=Me(()=>s.value/r.value);return{height:r,width:s,aspectRatio:o}}const Kk=(n,e)=>{const t=Me(()=>e.renderer.value.domElement),i=Oe([]),{x:s,y:r}=XF({target:t});let o=0;const{width:a,height:l,top:c,left:u}=zF(t),f=({x:se,y:ye})=>{if(t.value)return{x:(se-u.value)/a.value*2-1,y:-((ye-c.value)/l.value)*2+1}},d=({x:se,y:ye})=>{if(e.camera.value)return e.raycaster.value.setFromCamera(new de(se,ye),e.camera.value),i.value=e.raycaster.value.intersectObjects(n.value,!0),i.value},h=se=>{const ye=f({x:(se==null?void 0:se.clientX)??s.value,y:(se==null?void 0:se.clientY)??r.value});return ye?d(ye)||[]:[]},p=pi(),_=pi(),g=pi(),m=pi(),y=pi(),b=pi(),v=pi(),E=pi();function T(se){const ye={};for(const Be in se)typeof Be!="function"&&(ye[Be]=se[Be]);return ye}const S=(se,ye)=>{var Be,re,ge;const xe=T(ye),$=new z(ye==null?void 0:ye.clientX,ye==null?void 0:ye.clientY,0).unproject((Be=e.camera)==null?void 0:Be.value);se.trigger({...xe,intersections:i.value,unprojectedPoint:$,ray:(re=e.raycaster)==null?void 0:re.value.ray,camera:(ge=e.camera)==null?void 0:ge.value,sourceEvent:ye,delta:o,stopPropagating:!1})};let P;const x=se=>{h(se),S(g,se),P=se},M=()=>{P&&x(P)};let I,N,V;const j=se=>{var ye;I=(ye=i.value[0])==null?void 0:ye.object,o=0,N=new de((se==null?void 0:se.clientX)??s.value,(se==null?void 0:se.clientY)??r.value),S(y,se)};let te,Z=!1;const ee=se=>{var ye,Be,re;se instanceof PointerEvent&&(i.value.length===0&&S(b,se),I===((ye=i.value[0])==null?void 0:ye.object)&&(V=new de((se==null?void 0:se.clientX)??s.value,(se==null?void 0:se.clientY)??r.value),o=N==null?void 0:N.distanceTo(V),se.button===0?(S(p,se),te===((Be=i.value[0])==null?void 0:Be.object)?Z=!0:(te=(re=i.value[0])==null?void 0:re.object,Z=!1)):se.button===2&&S(v,se)),S(m,se))},J=se=>{Z&&(S(_,se),te=void 0,Z=!1)},he=se=>S(g,se),be=se=>S(E,se);return t.value.addEventListener("pointerup",ee),t.value.addEventListener("pointerdown",j),t.value.addEventListener("pointermove",x),t.value.addEventListener("pointerleave",he),t.value.addEventListener("dblclick",J),t.value.addEventListener("wheel",be),rs(()=>{t!=null&&t.value&&(t.value.removeEventListener("pointerup",ee),t.value.removeEventListener("pointerdown",j),t.value.removeEventListener("pointermove",x),t.value.removeEventListener("pointerleave",he),t.value.removeEventListener("dblclick",J),t.value.removeEventListener("wheel",be))}),{intersects:i,onClick:se=>p.on(se).off,onDblClick:se=>_.on(se).off,onContextMenu:se=>v.on(se).off,onPointerMove:se=>g.on(se).off,onPointerUp:se=>m.on(se).off,onPointerDown:se=>y.on(se).off,onPointerMissed:se=>b.on(se).off,onWheel:se=>E.on(se).off,forceUpdate:M}};function um(n,e){if(Array.isArray(n))for(const t of n)t(e);typeof n=="function"&&n(e)}function Zk(n,e,t){var i;const s=Oe(),r=Oe();n&&(s.value=n),e&&(r.value=e);const o=x=>{var M;return((M=x.__tres)==null?void 0:M.eventCount)>0},a=x=>{var M;return((M=x.children)==null?void 0:M.some(I=>a(I)))||o(x)},l=Oe(((i=s.value)==null?void 0:i.children).filter(a)||[]);function c(x,M){const I=[],N=()=>M.stopPropagating=!0;M.stopPropagation=N;for(const V of M==null?void 0:M.intersections){if(M.stopPropagating)return;M={...M,...V};const{object:j}=V;M.eventObject=j,um(j[x],M),I.push(j);let te=j.parent;for(;te!==null&&!M.stopPropagating&&!I.includes(te);)M.eventObject=te,um(te[x],M),I.push(te),te=te.parent;const Z=Ak(x.slice(2));t(Z,{intersection:V,event:M})}}const{onClick:u,onDblClick:f,onContextMenu:d,onPointerMove:h,onPointerDown:p,onPointerUp:_,onPointerMissed:g,onWheel:m,forceUpdate:y}=Kk(l,e);_(x=>c("onPointerUp",x)),p(x=>c("onPointerDown",x)),u(x=>c("onClick",x)),f(x=>c("onDoubleClick",x)),d(x=>c("onContextMenu",x)),m(x=>c("onWheel",x));let b=[];h(x=>{const M=x.intersections.map(({object:N})=>N),I=x.intersections;b.forEach(({object:N})=>{M.includes(N)||(x.intersections=b,c("onPointerLeave",x),c("onPointerOut",x))}),x.intersections=I,x.intersections.forEach(({object:N})=>{b.includes(N)||(c("onPointerEnter",x),c("onPointerOver",x))}),c("onPointerMove",x),b=x.intersections});const v=[];g(x=>{const M=()=>x.stopPropagating=!0;x.stopPropagation=M,v.forEach(I=>{x.stopPropagating||(x.eventObject=I,um(I.onPointerMissed,x))}),t("pointer-missed",{event:x})});function E(x){ef(x)&&dr(x)&&l.value.push(x)}function T(x){if(ef(x)&&dr(x)){const M=l.value.indexOf(x);M>-1&&l.value.splice(M,1)}}function S(x){ef(x)&&dr(x)&&x.onPointerMissed&&v.push(x)}function P(x){if(ef(x)&&dr(x)){const M=v.indexOf(x);M>-1&&v.splice(M,1)}}return e.eventManager={forceUpdate:y,registerObject:E,deregisterObject:T,registerPointerMissedObject:S,deregisterPointerMissedObject:P},{forceUpdate:y,registerObject:E,deregisterObject:T,registerPointerMissedObject:S,deregisterPointerMissedObject:P}}function Jk(n,e,t=100){t=t<=0?100:t;const i=pi(),s=new Set;let r=!1,o=!1,a=null;function l(){a&&clearTimeout(a),!o&&!r&&n()?(i.trigger(e),s.forEach(f=>f()),s.clear(),r=!0):!o&&!r&&(a=setTimeout(l,t))}function c(){o=!0,a&&clearTimeout(a)}l();const u=(f,...d)=>{f(...d)};return{on:f=>{if(r)return u(f,e),{off:()=>{}};{const d=i.on(f);return s.add(d.off),i.on(f)}},off:i.off,trigger:i.trigger,clear:i.clear,cancel:c}}const fm=new WeakMap;function Qk(n){if(n=n||MT(),fm.has(n))return fm.get(n);const e=100,t=Date.now(),i=Jk(()=>{if(Date.now()-t>=e)return!0;{const s=n.renderer.value,r=(s==null?void 0:s.domElement)||{width:0,height:0};return!!(s&&r.width>0&&r.height>0)}},n);return fm.set(n,i),i}function eB({scene:n,canvas:e,windowSize:t,rendererOptions:i,emit:s}){const r=Oe(n),o=jk(t,e),{camera:a,cameras:l,registerCamera:c,deregisterCamera:u,setCameraActive:f}=Bk({sizes:o}),d={mode:et(i.renderMode||"always"),priority:et(0),frames:et(0),maxFrames:60,canBeInvalidated:Me(()=>d.mode.value==="on-demand"&&d.frames.value===0)};function h(V=1){i.renderMode==="on-demand"&&(d.frames.value=Math.min(d.maxFrames,d.frames.value+V))}function p(){i.renderMode==="manual"&&(d.frames.value=1)}const{renderer:_}=Yk({canvas:e,options:i,contextParts:{sizes:o,render:d,invalidate:h,advance:p}}),g={sizes:o,scene:r,camera:a,cameras:Fi(l),renderer:_,raycaster:Oe(new nT),controls:et(null),perf:{maxFrames:160,fps:{value:0,accumulator:[]},memory:{currentMem:0,allocatedMem:0,accumulator:[]}},render:d,advance:p,extend:Ig,invalidate:h,registerCamera:c,setCameraActive:f,deregisterCamera:u,loop:Wk()};pr("useTres",g),g.scene.value.__tres={root:g},g.loop.register(()=>{a.value&&d.frames.value>0&&(_.value.render(n,a.value),s("render",g.renderer.value)),d.priority.value=0,d.mode.value==="always"?d.frames.value=1:d.frames.value=Math.max(0,d.frames.value-1)},"render");const{on:m,cancel:y}=Qk(g);g.loop.setReady(!1),g.loop.start(),m(()=>{s("ready",g),g.loop.setReady(!0),Zk(n,g,s)}),rs(()=>{y(),g.loop.stop()});const b=100,v=HF({every:b}),{isSupported:E,memory:T}=GF({interval:b}),S=160;let P=performance.now();const x=({timestamp:V})=>{g.scene.value&&(g.perf.memory.allocatedMem=T_(g.scene.value)),V-P>=b&&(P=V,g.perf.fps.accumulator.push(v.value),g.perf.fps.accumulator.length>S&&g.perf.fps.accumulator.shift(),g.perf.fps.value=v.value,E.value&&T.value&&(g.perf.memory.accumulator.push(T.value.usedJSHeapSize/1024/1024),g.perf.memory.accumulator.length>S&&g.perf.memory.accumulator.shift(),g.perf.memory.currentMem=g.perf.memory.accumulator.reduce((j,te)=>j+te,0)/g.perf.memory.accumulator.length))};let M=0;const I=1,{pause:N}=E_(({delta:V})=>{window.__TRES__DEVTOOLS__&&(x({timestamp:performance.now()}),M+=V,M>=I&&(window.__TRES__DEVTOOLS__.cb(g),M=0))},{immediate:!0});return rs(()=>{N()}),g}function MT(){const n=Tn("useTres");if(!n)throw new Error("useTresContext must be used together with useTresContextProvider");return n}function yG(){const{camera:n,scene:e,renderer:t,loop:i,raycaster:s,controls:r,invalidate:o,advance:a}=MT();i.setContext({camera:n,scene:e,renderer:t,raycaster:s,controls:r,invalidate:o,advance:a});function l(f,d=0){return i.register(f,"before",d)}function c(f){return i.register(f,"render")}function u(f,d=0){return i.register(f,"after",d)}return{pause:i.pause,resume:i.resume,pauseRender:i.pauseRender,resumeRender:i.resumeRender,isActive:i.isActive,onBeforeRender:l,render:c,onAfterRender:u}}const tB=pi(),nB=pi(),ST=pi(),Ol=new Bh;let wf=0,Af=0;E_(()=>{tB.trigger({delta:wf,elapsed:Af,clock:Ol}),nB.trigger({delta:wf,elapsed:Af,clock:Ol}),ST.trigger({delta:wf,elapsed:Af,clock:Ol})},{immediate:!1});ST.on(()=>{wf=Ol.getDelta(),Af=Ol.getElapsedTime()});function iB(n,e={},t={}){let i=n;const s=a=>{i=a};let r=new Proxy({},{});const o={has(a,l){return l in e||l in i},get(a,l,c){return l in e?e[l](i):i[l]},set(a,l,c){const u=t[l];return u&&typeof u=="function"?u(c,i,r,s):i[l]=c,!0}};return r=new Proxy({},o),r}const{logError:Gb}=xT(),Wb=["onClick","onContextMenu","onPointerMove","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onDoubleClick","onPointerDown","onPointerUp","onPointerCancel","onPointerMissed","onLostPointerCapture","onWheel"],sB=n=>{const e=n.scene.value;function t(c,u,f,d){if(d||(d={}),d.args||(d.args=[]),c==="template"||Tk(c))return null;let h=c.replace("Tres",""),p;if(c==="primitive"){(!Ws(d.object)||Pt(d.object))&&Gb("Tres primitives need an 'object' prop, whose value is an object or shallowRef"),h=d.object.type;const _={};p=iB(d.object,{object:g=>g,isPrimitive:()=>!0,__tres:()=>_},{object:(g,m,y,b)=>{kk(g,y,b,{patchProp:r,remove:s,insert:i},n)},__tres:g=>{Object.assign(_,g)}})}else{const _=Pg.value[h];_||Gb(`${h} is not defined on the THREE namespace. Use extend to add it to the catalog.`),p=new _(...d.args)}return p?(p.isCamera&&(d!=null&&d.position||p.position.set(3,3,3),d!=null&&d.lookAt||p.lookAt(0,0,0)),p=so(p,{...p.__tres,type:h,memoizedProps:d,eventCount:0,primitive:c==="primitive",attach:d.attach},n),p):null}function i(c,u){var f,d,h;if(!c)return;u=u||e;const p=c.__tres?c:so(c,{},n),_=u.__tres?u:so(u,{},n);c=Pa(p),u=Pa(_),c.__tres&&((f=c.__tres)==null?void 0:f.eventCount)>0&&((d=n.eventManager)==null||d.registerObject(c)),n.registerCamera(c),(h=n.eventManager)==null||h.registerPointerMissedObject(c),p.__tres.attach?Nk(_,p,p.__tres.attach):dr(c)&&dr(_)&&(_.add(c),c.dispatchEvent({type:"added"})),p.__tres.parent=_,_.__tres.objects&&!_.__tres.objects.includes(p)&&_.__tres.objects.push(p)}function s(c,u){var f,d,h,p;if(!c)return;c!=null&&c.__tres&&((f=c.__tres)==null?void 0:f.eventCount)>0&&((d=n.eventManager)==null||d.deregisterObject(c)),u=Cg(u)?"default":u;const _=(h=c.__tres)==null?void 0:h.dispose;Cg(_)||(_===null?u=!1:u=_);const g=(p=c.__tres)==null?void 0:p.primitive,m=u==="default"?!g:!!u;if(c.__tres&&"objects"in c.__tres&&[...c.__tres.objects].forEach(y=>s(y,u)),m&&c.children&&[...c.children].forEach(y=>s(y,u)),yT(c,n),bT(c,n),m&&!Mk(c)){if(ao(u))u(c);else if(ao(c.dispose))try{c.dispose()}catch{}}"__tres"in c&&delete c.__tres}function r(c,u,f,d){var h,p;if(!c)return;let _=c,g=u;if(c.__tres&&(c.__tres.memoizedProps[u]=d),u==="attach"){const v=((h=c.__tres)==null?void 0:h.parent)||c.parent;s(c),so(c,{attach:d},n),v&&i(c,v);return}if(u==="dispose"){c.__tres||(c=so(c,{},n)),c.__tres.dispose=d;return}if(dr(c)&&g==="blocks-pointer-events"){d||d===""?c[g]=d:delete c[g];return}Wb.includes(u)&&c.__tres&&(c.__tres.eventCount+=1);let m=tf(g),y=_==null?void 0:_[m];if(g==="args"){const v=c,E=f??[],T=d??[],S=((p=c.__tres)==null?void 0:p.type)||c.type;S&&E.length&&!Pk(E,T)&&(_=Object.assign(v,new Pg.value[S](...d)));return}if(_.type==="BufferGeometry"){if(g==="args")return;_.setAttribute(tf(g),new Ct(...d));return}if(g.includes("-")&&y===void 0){const v=g.split("-");y=v.reduce((E,T)=>E[tf(T)],_),g=v.pop(),m=g,y!=null&&y.set||(_=v.reduce((E,T)=>E[tf(T)],_))}let b=d;if(b===""&&(b=!0),ao(y)){Wb.includes(u)||(Cd(b)?c[m](...b):c[m](b)),m.startsWith("on")&&ao(b)&&(_[m]=b);return}!(y!=null&&y.set)&&!ao(y)?_[m]=b:y.constructor===b.constructor&&y!=null&&y.copy?y==null||y.copy(b):Cd(b)?y.set(...b):!y.isColor&&y.setScalar?y.setScalar(b):y.set(b),vT(c)}function o(c){var u;return((u=c==null?void 0:c.__tres)==null?void 0:u.parent)||null}function a(c){const u=so(new ht,{type:"Comment"},n);return u.name=c,u}function l(c){var u;const f=o(c),d=((u=f==null?void 0:f.__tres)==null?void 0:u.objects)||[],h=d.indexOf(c);return h<0||h>=d.length-1?null:d[h+1]}return{insert:i,remove:s,createElement:t,patchProp:r,parentNode:o,createText:()=>{},createComment:a,setText:()=>{},setElementText:()=>{},nextSibling:l,querySelector:()=>{},setScopeId:()=>{},cloneNode:()=>{},insertStaticContent:()=>{}}};function rB(){return ET().__VUE_DEVTOOLS_GLOBAL_HOOK__}function ET(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const oB=typeof Proxy=="function",aB="devtools-plugin:setup",lB="plugin:settings:set";let ll,Lg;function cB(){var n;return ll!==void 0||(typeof window<"u"&&window.performance?(ll=!0,Lg=window.performance):typeof globalThis<"u"&&!((n=globalThis.perf_hooks)===null||n===void 0)&&n.performance?(ll=!0,Lg=globalThis.perf_hooks.performance):ll=!1),ll}function uB(){return cB()?Lg.now():Date.now()}class fB{constructor(e,t){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=t;const i={};if(e.settings)for(const o in e.settings){const a=e.settings[o];i[o]=a.defaultValue}const s=`__vue-devtools-plugin-settings__${e.id}`;let r=Object.assign({},i);try{const o=localStorage.getItem(s),a=JSON.parse(o);Object.assign(r,a)}catch{}this.fallbacks={getSettings(){return r},setSettings(o){try{localStorage.setItem(s,JSON.stringify(o))}catch{}r=o},now(){return uB()}},t&&t.on(lB,(o,a)=>{o===this.plugin.id&&this.fallbacks.setSettings(a)}),this.proxiedOn=new Proxy({},{get:(o,a)=>this.target?this.target.on[a]:(...l)=>{this.onQueue.push({method:a,args:l})}}),this.proxiedTarget=new Proxy({},{get:(o,a)=>this.target?this.target[a]:a==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(a)?(...l)=>(this.targetQueue.push({method:a,args:l,resolve:()=>{}}),this.fallbacks[a](...l)):(...l)=>new Promise(c=>{this.targetQueue.push({method:a,args:l,resolve:c})})})}async setRealTarget(e){this.target=e;for(const t of this.onQueue)this.target.on[t.method](...t.args);for(const t of this.targetQueue)t.resolve(await this.target[t.method](...t.args))}}function dB(n,e){const t=n,i=ET(),s=rB(),r=oB&&t.enableEarlyProxy;if(s&&(i.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!r))s.emit(aB,n,e);else{const o=r?new fB(t,s):null;(i.__VUE_DEVTOOLS_PLUGINS__=i.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:t,setupFn:e,proxy:o}),o&&e(o.proxiedTarget)}}function hB(n,e){const t=`▲ ■ ●${n}`;typeof Xb=="function"?Xb(t,e):console.log(t)}function Xb(n,e){throw new Error(n+e)}const TT=n=>{const e={id:n.uuid,label:n.type,children:[],tags:[]};n.name!==""&&e.tags.push({label:n.name,textColor:5750629,backgroundColor:15793395});const t=T_(n);return t>0&&e.tags.push({label:`${Xk(t)} KB`,textColor:15707189,backgroundColor:16775644,tooltip:"Memory usage"}),n.type.includes("Light")&&(bk(n)&&e.tags.push({label:`${n.intensity}`,textColor:9738662,backgroundColor:16316922,tooltip:"Intensity"}),e.tags.push({label:`#${new Ae(n.color).getHexString()}`,textColor:9738662,backgroundColor:16316922,tooltip:"Color"})),n.type.includes("Camera")&&(e.tags.push({label:`${n.fov}°`,textColor:9738662,backgroundColor:16316922,tooltip:"Field of view"}),e.tags.push({label:`x: ${Math.round(n.position.x)} y: ${Math.round(n.position.y)} z: ${Math.round(n.position.z)}`,textColor:9738662,backgroundColor:16316922,tooltip:"Position"})),e};function wT(n,e,t=""){n.children.forEach(i=>{if(i.type==="HightlightMesh"||t&&!i.type.includes(t)&&!i.name.includes(t))return;const s=TT(i);e.children.push(s),wT(i,s,t)})}const pB=[],cl="tres:inspector",mB=xi({sceneGraph:null});function gB(n,e){dB({id:"dev.esm.tres",label:"TresJS 🪐",logo:"https://raw.githubusercontent.com/Tresjs/tres/main/public/favicon.svg",packageName:"tresjs",homepage:"https://tresjs.org",componentStateTypes:pB,app:n},t=>{typeof t.now!="function"&&hB("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."),t.addInspector({id:cl,label:"TresJS 🪐",icon:"account_tree",treeFilterPlaceholder:"Search instances"}),setInterval(()=>{t.sendInspectorTree(cl)},1e3),setInterval(()=>{t.notifyComponentUpdate()},5e3),t.on.getInspectorTree(r=>{if(r.inspectorId===cl){const o=TT(e.scene.value);wT(e.scene.value,o,r.filter),mB.sceneGraph=o,r.rootNodes=[o]}});let i=null,s=null;t.on.getInspectorState(r=>{var o;if(r.inspectorId===cl){const[a]=e.scene.value.getObjectsByProperty("uuid",r.nodeId);if(!a)return;if(s&&i&&i.parent&&s.remove(i),a.isMesh){const l=Lk(a);a.add(l),i=l,s=a}r.state={object:Object.entries(a).map(([l,c])=>l==="children"?{key:l,value:c.filter(u=>u.type!=="HightlightMesh")}:{key:l,value:c,editable:!0}).filter(({key:l})=>l!=="parent")},a.isScene&&(r.state={...r.state,state:[{key:"Scene Info",value:{objects:a.children.length,memory:T_(a),calls:e.renderer.value.info.render.calls,triangles:e.renderer.value.info.render.triangles,points:e.renderer.value.info.render.points,lines:e.renderer.value.info.render.lines}},{key:"Programs",value:((o=e.renderer.value.info.programs)==null?void 0:o.map(l=>({...l,programName:l.name})))||[]}]})}}),t.on.editInspectorState(r=>{r.inspectorId===cl&&Ik(e.scene.value,r.nodeId,r.path,r.state.value)})})}const _B=["data-scene","data-tres"],vB=fn({__name:"TresCanvas",props:{shadows:{type:Boolean,default:void 0},clearColor:{},toneMapping:{},shadowMapType:{},useLegacyLights:{type:Boolean,default:void 0},outputColorSpace:{},toneMappingExposure:{},renderMode:{default:"always"},dpr:{},camera:{},preset:{},windowSize:{type:Boolean,default:void 0},enableProvideBridge:{type:Boolean,default:!0},context:{},alpha:{type:Boolean,default:void 0},premultipliedAlpha:{type:Boolean},antialias:{type:Boolean,default:void 0},stencil:{type:Boolean,default:void 0},preserveDrawingBuffer:{type:Boolean,default:void 0},powerPreference:{},depth:{type:Boolean,default:void 0},failIfMajorPerformanceCaveat:{type:Boolean,default:void 0},precision:{},logarithmicDepthBuffer:{type:Boolean,default:void 0},reverseDepthBuffer:{type:Boolean}},emits:["render","click","double-click","context-menu","pointer-move","pointer-up","pointer-down","pointer-enter","pointer-leave","pointer-over","pointer-out","pointer-missed","wheel","ready"],setup(n,{expose:e,emit:t}){const i=n,s=t,r=P0(),o=et(),a=Oe(new vh),l=An();Ig(xF);const c=(p,_=!1)=>fn({setup(){var g;const m=(g=An())==null?void 0:g.appContext;m&&(m.app=l==null?void 0:l.appContext.app);const y={};function b(v){v&&(v.parent&&b(v.parent),v.provides&&Object.assign(y,v.provides))}return l!=null&&l.parent&&i.enableProvideBridge&&(b(l.parent),Reflect.ownKeys(y).forEach(v=>{pr(v,y[v])})),pr("useTres",p),pr("extend",Ig),typeof window<"u"&&gB(m==null?void 0:m.app,p),()=>Ns(jt,null,_?[]:r.default())}}),u=(p,_=!1)=>{const g=c(p,_),{render:m}=XS(sB(p));m(Ns(g),a.value)},f=(p,_=!1)=>{_T(p.scene.value),_&&(p.renderer.value.dispose(),p.renderer.value.renderLists.dispose(),p.renderer.value.forceContextLoss()),a.value.__tres={root:p}},d=Oe(null);e({context:d,dispose:()=>f(d.value,!0)});const h=()=>{f(d.value),u(d.value,!0)};return Hn(()=>{const p=o;d.value=eB({scene:a.value,canvas:p,windowSize:i.windowSize??!1,rendererOptions:i,emit:s});const{registerCamera:_,camera:g,cameras:m,deregisterCamera:y}=d.value;u(d.value);const b=()=>{const v=new Kt(45,window.innerWidth/window.innerHeight,.1,1e3);v.position.set(3,3,3),v.lookAt(0,0,0),_(v);const E=Pc(()=>{m.value.length>=2&&(v.removeFromParent(),y(v),E==null||E())})};Xe(()=>i.camera,(v,E)=>{v&&_(v),E&&(E.removeFromParent(),y(E))},{immediate:!0}),g.value||b()}),rs(h),(p,_)=>(mn(),yi("canvas",{ref_key:"canvas",ref:o,"data-scene":a.value.uuid,class:Ua(p.$attrs.class),"data-tres":`tresjs ${Ot(mk).version}`,style:Si({display:"block",width:"100%",height:"100%",position:p.windowSize?"fixed":"relative",top:0,left:0,pointerEvents:"auto",touchAction:"none",...p.$attrs.style})},null,14,_B))}}),yB={install(n){n.component("TresCanvas",vB)}};function dm(n){if(n===null||typeof n!="object")return!1;const e=Object.getPrototypeOf(n);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in n?!1:Symbol.toStringTag in n?Object.prototype.toString.call(n)==="[object Module]":!0}function Dg(n,e,t=".",i){if(!dm(e))return Dg(n,{},t,i);const s=Object.assign({},e);for(const r in n){if(r==="__proto__"||r==="constructor")continue;const o=n[r];o!=null&&(i&&i(s,r,o,t)||(Array.isArray(o)&&Array.isArray(s[r])?s[r]=[...o,...s[r]]:dm(o)&&dm(s[r])?s[r]=Dg(o,s[r],(t?`${t}.`:"")+r.toString(),i):s[r]=o))}return s}function bB(n){return(...e)=>e.reduce((t,i)=>Dg(t,i,"",n),{})}const AT=bB();function Pr(n){return qd()?(b0(n),!0):!1}function $b(){const n=new Set,e=r=>{n.delete(r)};return{on:r=>{n.add(r);const o=()=>e(r);return Pr(o),{off:o}},off:e,trigger:(...r)=>Promise.all(Array.from(n).map(o=>o(...r))),clear:()=>{n.clear()}}}const hm=new WeakMap,xB=(...n)=>{var e;const t=n[0],i=(e=An())==null?void 0:e.proxy;if(i==null&&!Rc())throw new Error("injectLocal must be called in setup");return i&&hm.has(i)&&t in hm.get(i)?hm.get(i)[t]:Tn(...n)},$c=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const CT=n=>n!=null,MB=Object.prototype.toString,Pd=n=>MB.call(n)==="[object Object]",is=()=>{},SB=(n,e)=>Object.prototype.hasOwnProperty.call(n,e);function RT(...n){if(n.length!==1)return uS(...n);const e=n[0];return typeof e=="function"?Fi(w0(()=>({get:e,set:is}))):et(e)}function w_(n,e){function t(...i){return new Promise((s,r)=>{Promise.resolve(n(()=>e.apply(this,i),{fn:e,thisArg:this,args:i})).then(s).catch(r)})}return t}const PT=n=>n();function IT(n,e={}){let t,i,s=is;const r=l=>{clearTimeout(l),s(),s=is};let o;return l=>{const c=nt(n),u=nt(e.maxWait);return t&&r(t),c<=0||u!==void 0&&u<=0?(i&&(r(i),i=null),Promise.resolve(l())):new Promise((f,d)=>{s=e.rejectOnCancel?d:f,o=l,u&&!i&&(i=setTimeout(()=>{t&&r(t),i=null,f(o())},u)),t=setTimeout(()=>{i&&r(i),i=null,f(l())},c)})}}function EB(...n){let e=0,t,i=!0,s=is,r,o,a,l,c;!Pt(n[0])&&typeof n[0]=="object"?{delay:o,trailing:a=!0,leading:l=!0,rejectOnCancel:c=!1}=n[0]:[o,a=!0,l=!0,c=!1]=n;const u=()=>{t&&(clearTimeout(t),t=void 0,s(),s=is)};return d=>{const h=nt(o),p=Date.now()-e,_=()=>r=d();return u(),h<=0?(e=Date.now(),_()):(p>h&&(l||!i)?(e=Date.now(),_()):a&&(r=new Promise((g,m)=>{s=c?m:g,t=setTimeout(()=>{e=Date.now(),i=!0,g(_()),u()},Math.max(0,h-p))})),!l&&!t&&(t=setTimeout(()=>i=!0,h)),i=!1,r)}}function TB(n=PT,e={}){const{initialState:t="active"}=e,i=RT(t==="active");function s(){i.value=!1}function r(){i.value=!0}const o=(...a)=>{i.value&&n(...a)};return{isActive:Fi(i),pause:s,resume:r,eventFilter:o}}function wB(n){let e;function t(){return e||(e=n()),e}return t.reset=async()=>{const i=e;e=void 0,i&&await i},t}function AB(n,e){var t;if(typeof n=="number")return n+e;const i=((t=n.match(/^-?\d+\.?\d*/))==null?void 0:t[0])||"",s=n.slice(i.length),r=Number.parseFloat(i)+e;return Number.isNaN(r)?n:r+s}function Nl(n){return n.endsWith("rem")?Number.parseFloat(n)*16:Number.parseFloat(n)}function Ul(n){return Array.isArray(n)?n:[n]}function LT(n){return An()}function A_(n,e=200,t={}){return w_(IT(e,t),n)}function bG(n,e=200,t={}){const i=et(nt(n)),s=A_(()=>{i.value=n.value},e,t);return Xe(n,()=>s()),oS(i)}function CB(n,e=200,t=!1,i=!0,s=!1){return w_(EB(e,t,i,s),n)}function DT(n,e,t={}){const{eventFilter:i=PT,...s}=t;return Xe(n,w_(i,e),s)}function RB(n,e,t={}){const{eventFilter:i,initialState:s="active",...r}=t,{eventFilter:o,pause:a,resume:l,isActive:c}=TB(i,{initialState:s});return{stop:DT(n,e,{...r,eventFilter:o}),pause:a,resume:l,isActive:c}}function Ga(n,e=!0,t){LT()?Hn(n,t):e?n():wr(n)}function PB(n,e){LT()&&rs(n,e)}function IB(n,e,t={}){const{immediate:i=!0,immediateCallback:s=!1}=t,r=Oe(!1);let o=null;function a(){o&&(clearTimeout(o),o=null)}function l(){r.value=!1,a()}function c(...u){s&&n(),a(),r.value=!0,o=setTimeout(()=>{r.value=!1,o=null,n(...u)},nt(e))}return i&&(r.value=!0,$c&&c()),Pr(l),{isPending:oS(r),start:c,stop:l}}function xG(n,e,t={}){const{debounce:i=0,maxWait:s=void 0,...r}=t;return DT(n,e,{...r,eventFilter:IT(i,{maxWait:s})})}function LB(n,e,t){return Xe(n,e,{...t,immediate:!0})}const Qn=$c?window:void 0,DB=$c?window.document:void 0,C_=$c?window.navigator:void 0;function oi(n){var e;const t=nt(n);return(e=t==null?void 0:t.$el)!=null?e:t}function Ft(...n){const e=[],t=()=>{e.forEach(a=>a()),e.length=0},i=(a,l,c,u)=>(a.addEventListener(l,c,u),()=>a.removeEventListener(l,c,u)),s=Me(()=>{const a=Ul(nt(n[0])).filter(l=>l!=null);return a.every(l=>typeof l!="string")?a:void 0}),r=LB(()=>{var a,l;return[(l=(a=s.value)==null?void 0:a.map(c=>oi(c)))!=null?l:[Qn].filter(c=>c!=null),Ul(nt(s.value?n[1]:n[0])),Ul(Ot(s.value?n[2]:n[1])),nt(s.value?n[3]:n[2])]},([a,l,c,u])=>{if(t(),!(a!=null&&a.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const f=Pd(u)?{...u}:u;e.push(...a.flatMap(d=>l.flatMap(h=>c.map(p=>i(d,h,p,f)))))},{flush:"post"}),o=()=>{r(),t()};return Pr(t),o}function OB(){const n=Oe(!1),e=An();return e&&Hn(()=>{n.value=!0},e),n}function Lo(n){const e=OB();return Me(()=>(e.value,!!n()))}function OT(n,e,t={}){const{window:i=Qn,...s}=t;let r;const o=Lo(()=>i&&"MutationObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=Me(()=>{const d=nt(n),h=Ul(d).map(oi).filter(CT);return new Set(h)}),c=Xe(()=>l.value,d=>{a(),o.value&&d.size&&(r=new MutationObserver(e),d.forEach(h=>r.observe(h,s)))},{immediate:!0,flush:"post"}),u=()=>r==null?void 0:r.takeRecords(),f=()=>{c(),a()};return Pr(f),{isSupported:o,stop:f,takeRecords:u}}const NB=Symbol("vueuse-ssr-width");function NT(){const n=Rc()?xB(NB,null):null;return typeof n=="number"?n:void 0}function lo(n,e={}){const{window:t=Qn,ssrWidth:i=NT()}=e,s=Lo(()=>t&&"matchMedia"in t&&typeof t.matchMedia=="function"),r=Oe(typeof i=="number"),o=Oe(),a=Oe(!1),l=c=>{a.value=c.matches};return Pc(()=>{if(r.value){r.value=!s.value;const c=nt(n).split(",");a.value=c.some(u=>{const f=u.includes("not all"),d=u.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),h=u.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let p=!!(d||h);return d&&p&&(p=i>=Nl(d[1])),h&&p&&(p=i<=Nl(h[1])),f?!p:p});return}s.value&&(o.value=t.matchMedia(nt(n)),a.value=o.value.matches)}),Ft(o,"change",l,{passive:!0}),Me(()=>a.value)}const MG={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function SG(n,e={}){function t(h,p){let _=nt(n[nt(h)]);return p!=null&&(_=AB(_,p)),typeof _=="number"&&(_=`${_}px`),_}const{window:i=Qn,strategy:s="min-width",ssrWidth:r=NT()}=e,o=typeof r=="number",a=o?Oe(!1):{value:!0};o&&Ga(()=>a.value=!!i);function l(h,p){return!a.value&&o?h==="min"?r>=Nl(p):r<=Nl(p):i?i.matchMedia(`(${h}-width: ${p})`).matches:!1}const c=h=>lo(()=>`(min-width: ${t(h)})`,e),u=h=>lo(()=>`(max-width: ${t(h)})`,e),f=Object.keys(n).reduce((h,p)=>(Object.defineProperty(h,p,{get:()=>s==="min-width"?c(p):u(p),enumerable:!0,configurable:!0}),h),{});function d(){const h=Object.keys(n).map(p=>[p,f[p],Nl(t(p))]).sort((p,_)=>p[2]-_[2]);return Me(()=>h.filter(([,p])=>p.value).map(([p])=>p))}return Object.assign(f,{greaterOrEqual:c,smallerOrEqual:u,greater(h){return lo(()=>`(min-width: ${t(h,.1)})`,e)},smaller(h){return lo(()=>`(max-width: ${t(h,-.1)})`,e)},between(h,p){return lo(()=>`(min-width: ${t(h)}) and (max-width: ${t(p,-.1)})`,e)},isGreater(h){return l("min",t(h,.1))},isGreaterOrEqual(h){return l("min",t(h))},isSmaller(h){return l("max",t(h,-.1))},isSmallerOrEqual(h){return l("max",t(h))},isInBetween(h,p){return l("min",t(h))&&l("max",t(p,-.1))},current:d,active(){const h=d();return Me(()=>h.value.length===0?"":h.value.at(s==="min-width"?-1:0))}})}function Og(n,e={}){const{controls:t=!1,navigator:i=C_}=e,s=Lo(()=>i&&"permissions"in i),r=Oe(),o=typeof n=="string"?{name:n}:n,a=Oe(),l=()=>{var u,f;a.value=(f=(u=r.value)==null?void 0:u.state)!=null?f:"prompt"};Ft(r,"change",l,{passive:!0});const c=wB(async()=>{if(s.value){if(!r.value)try{r.value=await i.permissions.query(o)}catch{r.value=void 0}finally{l()}if(t)return ut(r.value)}});return c(),t?{state:a,isSupported:s,query:c}:a}function EG(n={}){const{navigator:e=C_,read:t=!1,source:i,copiedDuring:s=1500,legacy:r=!1}=n,o=Lo(()=>e&&"clipboard"in e),a=Og("clipboard-read"),l=Og("clipboard-write"),c=Me(()=>o.value||r),u=Oe(""),f=Oe(!1),d=IB(()=>f.value=!1,s,{immediate:!1});async function h(){let y=!(o.value&&m(a.value));if(!y)try{u.value=await e.clipboard.readText()}catch{y=!0}y&&(u.value=g())}c.value&&t&&Ft(["copy","cut"],h,{passive:!0});async function p(y=nt(i)){if(c.value&&y!=null){let b=!(o.value&&m(l.value));if(!b)try{await e.clipboard.writeText(y)}catch{b=!0}b&&_(y),u.value=y,f.value=!0,d.start()}}function _(y){const b=document.createElement("textarea");b.value=y??"",b.style.position="absolute",b.style.opacity="0",document.body.appendChild(b),b.select(),document.execCommand("copy"),b.remove()}function g(){var y,b,v;return(v=(b=(y=document==null?void 0:document.getSelection)==null?void 0:y.call(document))==null?void 0:b.toString())!=null?v:""}function m(y){return y==="granted"||y==="prompt"}return{isSupported:c,text:u,copied:f,copy:p}}const sf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},rf="__vueuse_ssr_handlers__",UB=FB();function FB(){return rf in sf||(sf[rf]=sf[rf]||{}),sf[rf]}function UT(n,e){return UB[n]||e}function kB(n){return lo("(prefers-color-scheme: dark)",n)}function BB(n){return n==null?"any":n instanceof Set?"set":n instanceof Map?"map":n instanceof Date?"date":typeof n=="boolean"?"boolean":typeof n=="string"?"string":typeof n=="object"?"object":Number.isNaN(n)?"any":"number"}const zB={boolean:{read:n=>n==="true",write:n=>String(n)},object:{read:n=>JSON.parse(n),write:n=>JSON.stringify(n)},number:{read:n=>Number.parseFloat(n),write:n=>String(n)},any:{read:n=>n,write:n=>String(n)},string:{read:n=>n,write:n=>String(n)},map:{read:n=>new Map(JSON.parse(n)),write:n=>JSON.stringify(Array.from(n.entries()))},set:{read:n=>new Set(JSON.parse(n)),write:n=>JSON.stringify(Array.from(n))},date:{read:n=>new Date(n),write:n=>n.toISOString()}},qb="vueuse-storage";function FT(n,e,t,i={}){var s;const{flush:r="pre",deep:o=!0,listenToStorageChanges:a=!0,writeDefaults:l=!0,mergeDefaults:c=!1,shallow:u,window:f=Qn,eventFilter:d,onError:h=I=>{console.error(I)},initOnMounted:p}=i,_=(u?Oe:et)(typeof e=="function"?e():e),g=Me(()=>nt(n));if(!t)try{t=UT("getDefaultStorage",()=>{var I;return(I=Qn)==null?void 0:I.localStorage})()}catch(I){h(I)}if(!t)return _;const m=nt(e),y=BB(m),b=(s=i.serializer)!=null?s:zB[y],{pause:v,resume:E}=RB(_,()=>S(_.value),{flush:r,deep:o,eventFilter:d});Xe(g,()=>x(),{flush:r}),f&&a&&Ga(()=>{t instanceof Storage?Ft(f,"storage",x,{passive:!0}):Ft(f,qb,M),p&&x()}),p||x();function T(I,N){if(f){const V={key:g.value,oldValue:I,newValue:N,storageArea:t};f.dispatchEvent(t instanceof Storage?new StorageEvent("storage",V):new CustomEvent(qb,{detail:V}))}}function S(I){try{const N=t.getItem(g.value);if(I==null)T(N,null),t.removeItem(g.value);else{const V=b.write(I);N!==V&&(t.setItem(g.value,V),T(N,V))}}catch(N){h(N)}}function P(I){const N=I?I.newValue:t.getItem(g.value);if(N==null)return l&&m!=null&&t.setItem(g.value,b.write(m)),m;if(!I&&c){const V=b.read(N);return typeof c=="function"?c(V,m):y==="object"&&!Array.isArray(V)?{...m,...V}:V}else return typeof N!="string"?N:b.read(N)}function x(I){if(!(I&&I.storageArea!==t)){if(I&&I.key==null){_.value=m;return}if(!(I&&I.key!==g.value)){v();try{(I==null?void 0:I.newValue)!==b.write(_.value)&&(_.value=P(I))}catch(N){h(N)}finally{I?wr(E):E()}}}}function M(I){x(I.detail)}return _}const VB="*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function HB(n={}){const{selector:e="html",attribute:t="class",initialValue:i="auto",window:s=Qn,storage:r,storageKey:o="vueuse-color-scheme",listenToStorageChanges:a=!0,storageRef:l,emitAuto:c,disableTransition:u=!0}=n,f={auto:"",light:"light",dark:"dark",...n.modes||{}},d=kB({window:s}),h=Me(()=>d.value?"dark":"light"),p=l||(o==null?RT(i):FT(o,i,r,{window:s,listenToStorageChanges:a})),_=Me(()=>p.value==="auto"?h.value:p.value),g=UT("updateHTMLAttrs",(v,E,T)=>{const S=typeof v=="string"?s==null?void 0:s.document.querySelector(v):oi(v);if(!S)return;const P=new Set,x=new Set;let M=null;if(E==="class"){const N=T.split(/\s/g);Object.values(f).flatMap(V=>(V||"").split(/\s/g)).filter(Boolean).forEach(V=>{N.includes(V)?P.add(V):x.add(V)})}else M={key:E,value:T};if(P.size===0&&x.size===0&&M===null)return;let I;u&&(I=s.document.createElement("style"),I.appendChild(document.createTextNode(VB)),s.document.head.appendChild(I));for(const N of P)S.classList.add(N);for(const N of x)S.classList.remove(N);M&&S.setAttribute(M.key,M.value),u&&(s.getComputedStyle(I).opacity,document.head.removeChild(I))});function m(v){var E;g(e,t,(E=f[v])!=null?E:v)}function y(v){n.onChanged?n.onChanged(v,m):m(v)}Xe(_,y,{flush:"post",immediate:!0}),Ga(()=>y(_.value));const b=Me({get(){return c?p.value:_.value},set(v){p.value=v}});return Object.assign(b,{store:p,system:h,state:_})}function of(n,e,t={}){const{window:i=Qn,initialValue:s,observe:r=!1}=t,o=Oe(s),a=Me(()=>{var c;return oi(e)||((c=i==null?void 0:i.document)==null?void 0:c.documentElement)});function l(){var c;const u=nt(n),f=nt(a);if(f&&i&&u){const d=(c=i.getComputedStyle(f).getPropertyValue(u))==null?void 0:c.trim();o.value=d||o.value||s}}return r&&OT(a,l,{attributeFilter:["style","class"],window:i}),Xe([a,()=>nt(n)],(c,u)=>{u[0]&&u[1]&&u[0].style.removeProperty(u[1]),l()},{immediate:!0}),Xe([o,a],([c,u])=>{const f=nt(n);u!=null&&u.style&&f&&(c==null?u.style.removeProperty(f):u.style.setProperty(f,c))},{immediate:!0}),o}function GB(n={}){const{valueDark:e="dark",valueLight:t=""}=n,i=HB({...n,onChanged:(o,a)=>{var l;n.onChanged?(l=n.onChanged)==null||l.call(n,o==="dark",a,o):a(o)},modes:{dark:e,light:t}}),s=Me(()=>i.system.value);return Me({get(){return i.value==="dark"},set(o){const a=o?"dark":"light";s.value===a?i.value="auto":i.value=a}})}function WB(n={}){const{navigator:e=C_,requestPermissions:t=!1,constraints:i={audio:!0,video:!0},onUpdated:s}=n,r=et([]),o=Me(()=>r.value.filter(p=>p.kind==="videoinput")),a=Me(()=>r.value.filter(p=>p.kind==="audioinput")),l=Me(()=>r.value.filter(p=>p.kind==="audiooutput")),c=Lo(()=>e&&e.mediaDevices&&e.mediaDevices.enumerateDevices),u=Oe(!1);let f;async function d(){c.value&&(r.value=await e.mediaDevices.enumerateDevices(),s==null||s(r.value),f&&(f.getTracks().forEach(p=>p.stop()),f=null))}async function h(){const p=i.video?"camera":"microphone";if(!c.value)return!1;if(u.value)return!0;const{state:_,query:g}=Og(p,{controls:!0});if(await g(),_.value!=="granted"){let m=!0;try{f=await e.mediaDevices.getUserMedia(i)}catch{f=null,m=!1}d(),u.value=m}else u.value=!0;return u.value}return c.value&&(t&&h(),Ft(e.mediaDevices,"devicechange",d,{passive:!0}),d()),{devices:r,ensurePermissions:h,permissionGranted:u,videoInputs:o,audioInputs:a,audioOutputs:l,isSupported:c}}function XB(n,e,t={}){const{window:i=Qn,...s}=t;let r;const o=Lo(()=>i&&"ResizeObserver"in i),a=()=>{r&&(r.disconnect(),r=void 0)},l=Me(()=>{const f=nt(n);return Array.isArray(f)?f.map(d=>oi(d)):[oi(f)]}),c=Xe(l,f=>{if(a(),o.value&&i){r=new ResizeObserver(e);for(const d of f)d&&r.observe(d,s)}},{immediate:!0,flush:"post"}),u=()=>{a(),c()};return Pr(u),{isSupported:o,stop:u}}function TG(n,e={}){const{reset:t=!0,windowResize:i=!0,windowScroll:s=!0,immediate:r=!0,updateTiming:o="sync"}=e,a=Oe(0),l=Oe(0),c=Oe(0),u=Oe(0),f=Oe(0),d=Oe(0),h=Oe(0),p=Oe(0);function _(){const m=oi(n);if(!m){t&&(a.value=0,l.value=0,c.value=0,u.value=0,f.value=0,d.value=0,h.value=0,p.value=0);return}const y=m.getBoundingClientRect();a.value=y.height,l.value=y.bottom,c.value=y.left,u.value=y.right,f.value=y.top,d.value=y.width,h.value=y.x,p.value=y.y}function g(){o==="sync"?_():o==="next-frame"&&requestAnimationFrame(()=>_())}return XB(n,g),Xe(()=>oi(n),m=>!m&&g()),OT(n,g,{attributeFilter:["style","class"]}),s&&Ft("scroll",g,{capture:!0,passive:!0}),i&&Ft("resize",g,{passive:!0}),Ga(()=>{r&&g()}),{height:a,bottom:l,left:c,right:u,top:f,width:d,x:h,y:p,update:g}}function $B(n,e,t={}){const{root:i,rootMargin:s="0px",threshold:r=0,window:o=Qn,immediate:a=!0}=t,l=Lo(()=>o&&"IntersectionObserver"in o),c=Me(()=>{const p=nt(n);return Ul(p).map(oi).filter(CT)});let u=is;const f=Oe(a),d=l.value?Xe(()=>[c.value,oi(i),f.value],([p,_])=>{if(u(),!f.value||!p.length)return;const g=new IntersectionObserver(e,{root:oi(_),rootMargin:s,threshold:r});p.forEach(m=>m&&g.observe(m)),u=()=>{g.disconnect(),u=is}},{immediate:a,flush:"post"}):is,h=()=>{u(),d(),f.value=!1};return Pr(h),{isSupported:l,isActive:f,pause(){u(),f.value=!1},resume(){f.value=!0},stop:h}}const qB={multiple:!0,accept:"*",reset:!1,directory:!1};function YB(n){if(!n)return null;if(n instanceof FileList)return n;const e=new DataTransfer;for(const t of n)e.items.add(t);return e.files}function wG(n={}){const{document:e=DB}=n,t=et(YB(n.initialFiles)),{on:i,trigger:s}=$b(),{on:r,trigger:o}=$b();let a;e&&(a=e.createElement("input"),a.type="file",a.onchange=u=>{const f=u.target;t.value=f.files,s(t.value)},a.oncancel=()=>{o()});const l=()=>{t.value=null,a&&a.value&&(a.value="",s(null))},c=u=>{if(!a)return;const f={...qB,...n,...u};a.multiple=f.multiple,a.accept=f.accept,a.webkitdirectory=f.directory,SB(f,"capture")&&(a.capture=f.capture),f.reset&&l(),a.click()};return{files:Fi(t),open:c,reset:l,onCancel:r,onChange:i}}const Yb=1;function AG(n,e={}){const{throttle:t=0,idle:i=200,onStop:s=is,onScroll:r=is,offset:o={left:0,right:0,top:0,bottom:0},eventListenerOptions:a={capture:!1,passive:!0},behavior:l="auto",window:c=Qn,onError:u=S=>{console.error(S)}}=e,f=Oe(0),d=Oe(0),h=Me({get(){return f.value},set(S){_(S,void 0)}}),p=Me({get(){return d.value},set(S){_(void 0,S)}});function _(S,P){var x,M,I,N;if(!c)return;const V=nt(n);if(!V)return;(I=V instanceof Document?c.document.body:V)==null||I.scrollTo({top:(x=nt(P))!=null?x:p.value,left:(M=nt(S))!=null?M:h.value,behavior:nt(l)});const j=((N=V==null?void 0:V.document)==null?void 0:N.documentElement)||(V==null?void 0:V.documentElement)||V;h!=null&&(f.value=j.scrollLeft),p!=null&&(d.value=j.scrollTop)}const g=Oe(!1),m=xi({left:!0,right:!1,top:!0,bottom:!1}),y=xi({left:!1,right:!1,top:!1,bottom:!1}),b=S=>{g.value&&(g.value=!1,y.left=!1,y.right=!1,y.top=!1,y.bottom=!1,s(S))},v=A_(b,t+i),E=S=>{var P;if(!c)return;const x=((P=S==null?void 0:S.document)==null?void 0:P.documentElement)||(S==null?void 0:S.documentElement)||oi(S),{display:M,flexDirection:I,direction:N}=getComputedStyle(x),V=N==="rtl"?-1:1,j=x.scrollLeft;y.left=jf.value;const te=Math.abs(j*V)<=(o.left||0),Z=Math.abs(j*V)+x.clientWidth>=x.scrollWidth-(o.right||0)-Yb;M==="flex"&&I==="row-reverse"?(m.left=Z,m.right=te):(m.left=te,m.right=Z),f.value=j;let ee=x.scrollTop;S===c.document&&!ee&&(ee=c.document.body.scrollTop),y.top=eed.value;const J=Math.abs(ee)<=(o.top||0),he=Math.abs(ee)+x.clientHeight>=x.scrollHeight-(o.bottom||0)-Yb;M==="flex"&&I==="column-reverse"?(m.top=he,m.bottom=J):(m.top=J,m.bottom=he),d.value=ee},T=S=>{var P;if(!c)return;const x=(P=S.target.documentElement)!=null?P:S.target;E(x),g.value=!0,v(S),r(S)};return Ft(n,"scroll",t?CB(T,t,!0,!1):T,a),Ga(()=>{try{const S=nt(n);if(!S)return;E(S)}catch(S){u(S)}}),Ft(n,"scrollend",b,a),{x:h,y:p,isScrolling:g,arrivedState:m,directions:y,measure(){const S=nt(n);c&&S&&E(S)}}}function vs(n,e,t={}){const{window:i=Qn}=t;return FT(n,e,i==null?void 0:i.localStorage,t)}function CG(n){const e=Oe(),t=()=>{e.value&&URL.revokeObjectURL(e.value),e.value=void 0};return Xe(()=>nt(n),i=>{t(),i&&(e.value=URL.createObjectURL(i))},{immediate:!0}),Pr(t),Fi(e)}const jb="--vueuse-safe-area-top",Kb="--vueuse-safe-area-right",Zb="--vueuse-safe-area-bottom",Jb="--vueuse-safe-area-left";function RG(){const n=Oe(""),e=Oe(""),t=Oe(""),i=Oe("");if($c){const r=of(jb),o=of(Kb),a=of(Zb),l=of(Jb);r.value="env(safe-area-inset-top, 0px)",o.value="env(safe-area-inset-right, 0px)",a.value="env(safe-area-inset-bottom, 0px)",l.value="env(safe-area-inset-left, 0px)",s(),Ft("resize",A_(s),{passive:!0})}function s(){n.value=af(jb),e.value=af(Kb),t.value=af(Zb),i.value=af(Jb)}return{top:n,right:e,bottom:t,left:i,update:s}}function af(n){return getComputedStyle(document.documentElement).getPropertyValue(n)}function PG(n,e,t){const{window:i=Qn}={},s=et(null),r=Oe(),o=(...l)=>{r.value&&r.value.postMessage(...l)},a=function(){r.value&&r.value.terminate()};return i&&(r.value=new Worker(n,e),r.value.onmessage=l=>{s.value=l.data},Pr(()=>{r.value&&r.value.terminate()})),{data:s,post:o,terminate:a,worker:r}}function IG(n={}){const{window:e=Qn,initialWidth:t=Number.POSITIVE_INFINITY,initialHeight:i=Number.POSITIVE_INFINITY,listenOrientation:s=!0,includeScrollbar:r=!0,type:o="inner"}=n,a=Oe(t),l=Oe(i),c=()=>{if(e)if(o==="outer")a.value=e.outerWidth,l.value=e.outerHeight;else if(o==="visual"&&e.visualViewport){const{width:f,height:d,scale:h}=e.visualViewport;a.value=Math.round(f*h),l.value=Math.round(d*h)}else r?(a.value=e.innerWidth,l.value=e.innerHeight):(a.value=e.document.documentElement.clientWidth,l.value=e.document.documentElement.clientHeight)};c(),Ga(c);const u={passive:!0};if(Ft("resize",c,u),e&&o==="visual"&&e.visualViewport&&Ft(e.visualViewport,"resize",c,u),s){const f=lo("(orientation: portrait)");Xe(f,()=>c())}return{width:a,height:l}}const kT=1/60*1e3,jB=typeof performance<"u"?()=>performance.now():()=>Date.now(),BT=typeof window<"u"?n=>window.requestAnimationFrame(n):n=>setTimeout(()=>n(jB()),kT);function KB(n){let e=[],t=[],i=0,s=!1,r=!1;const o=new WeakSet,a={schedule:(l,c=!1,u=!1)=>{const f=u&&s,d=f?e:t;return c&&o.add(l),d.indexOf(l)===-1&&(d.push(l),f&&s&&(i=e.length)),l},cancel:l=>{const c=t.indexOf(l);c!==-1&&t.splice(c,1),o.delete(l)},process:l=>{if(s){r=!0;return}if(s=!0,[e,t]=[t,e],t.length=0,i=e.length,i)for(let c=0;c(n[e]=KB(()=>yc=!0),n),{}),Fg=qc.reduce((n,e)=>{const t=Hh[e];return n[e]=(i,s=!1,r=!1)=>(yc||e4(),t.schedule(i,s,r)),n},{}),JB=qc.reduce((n,e)=>(n[e]=Hh[e].cancel,n),{});qc.reduce((n,e)=>(n[e]=()=>Hh[e].process(ga),n),{});const QB=n=>Hh[n].process(ga),zT=n=>{yc=!1,ga.delta=Ng?kT:Math.max(Math.min(n-ga.timestamp,ZB),1),ga.timestamp=n,Ug=!0,qc.forEach(QB),Ug=!1,yc&&(Ng=!1,BT(zT))},e4=()=>{yc=!0,Ng=!0,Ug||BT(zT)},VT=()=>ga;function HT(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(n);sMath.min(Math.max(t,n),e),ex=.001,t4=.01,n4=10,i4=.05,s4=1;function r4({duration:n=800,bounce:e=.25,velocity:t=0,mass:i=1}){let s,r,o=1-e;o=kg(i4,s4,o),n=kg(t4,n4,n/1e3),o<1?(s=c=>{const u=c*o,f=u*n,d=u-t,h=Bg(c,o),p=Math.exp(-f);return ex-d/h*p},r=c=>{const f=c*o*n,d=f*t+t,h=Math.pow(o,2)*Math.pow(c,2)*n,p=Math.exp(-f),_=Bg(Math.pow(c,2),o);return(-s(c)+ex>0?-1:1)*((d-h)*p)/_}):(s=c=>{const u=Math.exp(-c*n),f=(c-t)*n+1;return-.001+u*f},r=c=>{const u=Math.exp(-c*n),f=(t-c)*(n*n);return u*f});const a=5/n,l=a4(s,r,a);if(n=n*1e3,isNaN(l))return{stiffness:100,damping:10,duration:n};{const c=Math.pow(l,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:n}}}const o4=12;function a4(n,e,t){let i=t;for(let s=1;sn[t]!==void 0)}function u4(n){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},n);if(!tx(n,c4)&&tx(n,l4)){const t=r4(n);e=Object.assign(Object.assign(Object.assign({},e),t),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function R_(n){var{from:e=0,to:t=1,restSpeed:i=2,restDelta:s}=n,r=HT(n,["from","to","restSpeed","restDelta"]);const o={done:!1,value:e};let{stiffness:a,damping:l,mass:c,velocity:u,duration:f,isResolvedFromDuration:d}=u4(r),h=nx,p=nx;function _(){const g=u?-(u/1e3):0,m=t-e,y=l/(2*Math.sqrt(a*c)),b=Math.sqrt(a/c)/1e3;if(s===void 0&&(s=Math.min(Math.abs(t-e)/100,.4)),y<1){const v=Bg(b,y);h=E=>{const T=Math.exp(-y*b*E);return t-T*((g+y*b*m)/v*Math.sin(v*E)+m*Math.cos(v*E))},p=E=>{const T=Math.exp(-y*b*E);return y*b*T*(Math.sin(v*E)*(g+y*b*m)/v+m*Math.cos(v*E))-T*(Math.cos(v*E)*(g+y*b*m)-v*m*Math.sin(v*E))}}else if(y===1)h=v=>t-Math.exp(-b*v)*(m+(g+b*m)*v);else{const v=b*Math.sqrt(y*y-1);h=E=>{const T=Math.exp(-y*b*E),S=Math.min(v*E,300);return t-T*((g+y*b*m)*Math.sinh(S)+v*m*Math.cosh(S))/v}}}return _(),{next:g=>{const m=h(g);if(d)o.done=g>=f;else{const y=p(g)*1e3,b=Math.abs(y)<=i,v=Math.abs(t-m)<=s;o.done=b&&v}return o.value=o.done?t:m,o},flipTarget:()=>{u=-u,[e,t]=[t,e],_()}}}R_.needsInterpolation=(n,e)=>typeof n=="string"||typeof e=="string";const nx=n=>0,GT=(n,e,t)=>{const i=e-n;return i===0?1:(t-n)/i},P_=(n,e,t)=>-t*n+t*e+n,WT=(n,e)=>t=>Math.max(Math.min(t,e),n),Fl=n=>n%1?Number(n.toFixed(5)):n,bc=/(-)?([\d]*\.?[\d])+/g,zg=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,f4=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Yc(n){return typeof n=="string"}const jc={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},kl=Object.assign(Object.assign({},jc),{transform:WT(0,1)}),lf=Object.assign(Object.assign({},jc),{default:1}),I_=n=>({test:e=>Yc(e)&&e.endsWith(n)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${n}`}),Qr=I_("deg"),Bl=I_("%"),lt=I_("px"),ix=Object.assign(Object.assign({},Bl),{parse:n=>Bl.parse(n)/100,transform:n=>Bl.transform(n*100)}),L_=(n,e)=>t=>!!(Yc(t)&&f4.test(t)&&t.startsWith(n)||e&&Object.prototype.hasOwnProperty.call(t,e)),XT=(n,e,t)=>i=>{if(!Yc(i))return i;const[s,r,o,a]=i.match(bc);return{[n]:parseFloat(s),[e]:parseFloat(r),[t]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},ho={test:L_("hsl","hue"),parse:XT("hue","saturation","lightness"),transform:({hue:n,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(n)+", "+Bl.transform(Fl(e))+", "+Bl.transform(Fl(t))+", "+Fl(kl.transform(i))+")"},d4=WT(0,255),pm=Object.assign(Object.assign({},jc),{transform:n=>Math.round(d4(n))}),hr={test:L_("rgb","red"),parse:XT("red","green","blue"),transform:({red:n,green:e,blue:t,alpha:i=1})=>"rgba("+pm.transform(n)+", "+pm.transform(e)+", "+pm.transform(t)+", "+Fl(kl.transform(i))+")"};function h4(n){let e="",t="",i="",s="";return n.length>5?(e=n.substr(1,2),t=n.substr(3,2),i=n.substr(5,2),s=n.substr(7,2)):(e=n.substr(1,1),t=n.substr(2,1),i=n.substr(3,1),s=n.substr(4,1),e+=e,t+=t,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}}const Vg={test:L_("#"),parse:h4,transform:hr.transform},qn={test:n=>hr.test(n)||Vg.test(n)||ho.test(n),parse:n=>hr.test(n)?hr.parse(n):ho.test(n)?ho.parse(n):Vg.parse(n),transform:n=>Yc(n)?n:n.hasOwnProperty("red")?hr.transform(n):ho.transform(n)},$T="${c}",qT="${n}";function p4(n){var e,t,i,s;return isNaN(n)&&Yc(n)&&((t=(e=n.match(bc))===null||e===void 0?void 0:e.length)!==null&&t!==void 0?t:0)+((s=(i=n.match(zg))===null||i===void 0?void 0:i.length)!==null&&s!==void 0?s:0)>0}function YT(n){typeof n=="number"&&(n=`${n}`);const e=[];let t=0;const i=n.match(zg);i&&(t=i.length,n=n.replace(zg,$T),e.push(...i.map(qn.parse)));const s=n.match(bc);return s&&(n=n.replace(bc,qT),e.push(...s.map(jc.parse))),{values:e,numColors:t,tokenised:n}}function jT(n){return YT(n).values}function KT(n){const{values:e,numColors:t,tokenised:i}=YT(n),s=e.length;return r=>{let o=i;for(let a=0;atypeof n=="number"?0:n;function g4(n){const e=jT(n);return KT(n)(e.map(m4))}const Kc={test:p4,parse:jT,createTransformer:KT,getAnimatableNone:g4},_4=new Set(["brightness","contrast","saturate","opacity"]);function v4(n){let[e,t]=n.slice(0,-1).split("(");if(e==="drop-shadow")return n;const[i]=t.match(bc)||[];if(!i)return n;const s=t.replace(i,"");let r=_4.has(e)?1:0;return i!==t&&(r*=100),e+"("+r+s+")"}const y4=/([a-z-]*)\(.*?\)/g,Hg=Object.assign(Object.assign({},Kc),{getAnimatableNone:n=>{const e=n.match(y4);return e?e.map(v4).join(" "):n}});function mm(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function sx({hue:n,saturation:e,lightness:t,alpha:i}){n/=360,e/=100,t/=100;let s=0,r=0,o=0;if(!e)s=r=o=t;else{const a=t<.5?t*(1+e):t+e-t*e,l=2*t-a;s=mm(l,a,n+1/3),r=mm(l,a,n),o=mm(l,a,n-1/3)}return{red:Math.round(s*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:i}}const b4=(n,e,t)=>{const i=n*n,s=e*e;return Math.sqrt(Math.max(0,t*(s-i)+i))},x4=[Vg,hr,ho],rx=n=>x4.find(e=>e.test(n)),ZT=(n,e)=>{let t=rx(n),i=rx(e),s=t.parse(n),r=i.parse(e);t===ho&&(s=sx(s),t=hr),i===ho&&(r=sx(r),i=hr);const o=Object.assign({},s);return a=>{for(const l in o)l!=="alpha"&&(o[l]=b4(s[l],r[l],a));return o.alpha=P_(s.alpha,r.alpha,a),t.transform(o)}},M4=n=>typeof n=="number",S4=(n,e)=>t=>e(n(t)),JT=(...n)=>n.reduce(S4);function QT(n,e){return M4(n)?t=>P_(n,e,t):qn.test(n)?ZT(n,e):tw(n,e)}const ew=(n,e)=>{const t=[...n],i=t.length,s=n.map((r,o)=>QT(r,e[o]));return r=>{for(let o=0;o{const t=Object.assign(Object.assign({},n),e),i={};for(const s in t)n[s]!==void 0&&e[s]!==void 0&&(i[s]=QT(n[s],e[s]));return s=>{for(const r in i)t[r]=i[r](s);return t}};function ox(n){const e=Kc.parse(n),t=e.length;let i=0,s=0,r=0;for(let o=0;o{const t=Kc.createTransformer(e),i=ox(n),s=ox(e);return i.numHSL===s.numHSL&&i.numRGB===s.numRGB&&i.numNumbers>=s.numNumbers?JT(ew(i.parsed,s.parsed),t):o=>`${o>0?e:n}`},T4=(n,e)=>t=>P_(n,e,t);function w4(n){if(typeof n=="number")return T4;if(typeof n=="string")return qn.test(n)?ZT:tw;if(Array.isArray(n))return ew;if(typeof n=="object")return E4}function A4(n,e,t){const i=[],s=t||w4(n[0]),r=n.length-1;for(let o=0;ot(GT(n,e,i))}function R4(n,e){const t=n.length,i=t-1;return s=>{let r=0,o=!1;if(s<=n[0]?o=!0:s>=n[i]&&(r=i-1,o=!0),!o){let l=1;for(;ls||l===i);l++);r=l-1}const a=GT(n[r],n[r+1],s);return e[r](a)}}function nw(n,e,{clamp:t=!0,ease:i,mixer:s}={}){const r=n.length;Qb(r===e.length),Qb(!i||!Array.isArray(i)||i.length===r-1),n[0]>n[r-1]&&(n=[].concat(n),e=[].concat(e),n.reverse(),e.reverse());const o=A4(e,i,s),a=r===2?C4(n,o):R4(n,o);return t?l=>a(kg(n[0],n[r-1],l)):a}const Gh=n=>e=>1-n(1-e),D_=n=>e=>e<=.5?n(2*e)/2:(2-n(2*(1-e)))/2,P4=n=>e=>Math.pow(e,n),iw=n=>e=>e*e*((n+1)*e-n),I4=n=>{const e=iw(n);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))},sw=1.525,L4=4/11,D4=8/11,O4=9/10,rw=n=>n,O_=P4(2),N4=Gh(O_),ow=D_(O_),aw=n=>1-Math.sin(Math.acos(n)),lw=Gh(aw),U4=D_(lw),N_=iw(sw),F4=Gh(N_),k4=D_(N_),B4=I4(sw),z4=4356/361,V4=35442/1805,H4=16061/1805,Id=n=>{if(n===1||n===0)return n;const e=n*n;return nn<.5?.5*(1-Id(1-n*2)):.5*Id(n*2-1)+.5;function X4(n,e){return n.map(()=>e||ow).splice(0,n.length-1)}function $4(n){const e=n.length;return n.map((t,i)=>i!==0?i/(e-1):0)}function q4(n,e){return n.map(t=>t*e)}function Cf({from:n=0,to:e=1,ease:t,offset:i,duration:s=300}){const r={done:!1,value:n},o=Array.isArray(e)?e:[n,e],a=q4(i&&i.length===o.length?i:$4(o),s);function l(){return nw(a,o,{ease:Array.isArray(t)?t:X4(o,t)})}let c=l();return{next:u=>(r.value=c(u),r.done=u>=s,r),flipTarget:()=>{o.reverse(),c=l()}}}function Y4({velocity:n=0,from:e=0,power:t=.8,timeConstant:i=350,restDelta:s=.5,modifyTarget:r}){const o={done:!1,value:e};let a=t*n;const l=e+a,c=r===void 0?l:r(l);return c!==l&&(a=c-e),{next:u=>{const f=-a*Math.exp(-u/i);return o.done=!(f>s||f<-s),o.value=o.done?c:c+f,o},flipTarget:()=>{}}}const ax={keyframes:Cf,spring:R_,decay:Y4};function j4(n){if(Array.isArray(n.to))return Cf;if(ax[n.type])return ax[n.type];const e=new Set(Object.keys(n));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Cf:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?R_:Cf}function cw(n,e,t=0){return n-e-t}function K4(n,e,t=0,i=!0){return i?cw(e+-n,e,t):e-(n-e)+t}function Z4(n,e,t,i){return i?n>=e+t:n<=-t}const J4=n=>{const e=({delta:t})=>n(t);return{start:()=>Fg.update(e,!0),stop:()=>JB.update(e)}};function uw(n){var e,t,{from:i,autoplay:s=!0,driver:r=J4,elapsed:o=0,repeat:a=0,repeatType:l="loop",repeatDelay:c=0,onPlay:u,onStop:f,onComplete:d,onRepeat:h,onUpdate:p}=n,_=HT(n,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:g}=_,m,y=0,b=_.duration,v,E=!1,T=!0,S;const P=j4(_);!((t=(e=P).needsInterpolation)===null||t===void 0)&&t.call(e,i,g)&&(S=nw([0,100],[i,g],{clamp:!1}),i=0,g=100);const x=P(Object.assign(Object.assign({},_),{from:i,to:g}));function M(){y++,l==="reverse"?(T=y%2===0,o=K4(o,b,c,T)):(o=cw(o,b,c),l==="mirror"&&x.flipTarget()),E=!1,h&&h()}function I(){m.stop(),d&&d()}function N(j){if(T||(j=-j),o+=j,!E){const te=x.next(Math.max(0,o));v=te.value,S&&(v=S(v)),E=T?te.done:o<=0}p==null||p(v),E&&(y===0&&(b??(b=o)),y{f==null||f(),m.stop()}}}function fw(n,e){return e?n*(1e3/e):0}function Q4({from:n=0,velocity:e=0,min:t,max:i,power:s=.8,timeConstant:r=750,bounceStiffness:o=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:c,driver:u,onUpdate:f,onComplete:d,onStop:h}){let p;function _(b){return t!==void 0&&bi}function g(b){return t===void 0?i:i===void 0||Math.abs(t-b){var E;f==null||f(v),(E=b.onUpdate)===null||E===void 0||E.call(b,v)},onComplete:d,onStop:h}))}function y(b){m(Object.assign({type:"spring",stiffness:o,damping:a,restDelta:l},b))}if(_(n))y({from:n,velocity:e,to:g(n)});else{let b=s*e+n;typeof c<"u"&&(b=c(b));const v=g(b),E=v===t?-1:1;let T,S;const P=x=>{T=S,S=x,e=fw(x-T,VT().delta),(E===1&&x>v||E===-1&&xp==null?void 0:p.stop()}}const dw=(n,e)=>1-3*e+3*n,hw=(n,e)=>3*e-6*n,pw=n=>3*n,Ld=(n,e,t)=>((dw(e,t)*n+hw(e,t))*n+pw(e))*n,mw=(n,e,t)=>3*dw(e,t)*n*n+2*hw(e,t)*n+pw(e),e5=1e-7,t5=10;function n5(n,e,t,i,s){let r,o,a=0;do o=e+(t-e)/2,r=Ld(o,i,s)-n,r>0?t=o:e=o;while(Math.abs(r)>e5&&++a=s5?r5(o,f,n,t):d===0?f:n5(o,a,a+cf,n,t)}return o=>o===0||o===1?o:Ld(r(o),e,i)}const Os={},gm={};class a5{constructor(){fi(this,"subscriptions",new Set)}add(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}notify(e,t,i){if(this.subscriptions.size)for(const s of this.subscriptions)s(e,t,i)}clear(){this.subscriptions.clear()}}function lx(n){return!Number.isNaN(Number.parseFloat(n))}class l5{constructor(e){fi(this,"current");fi(this,"prev");fi(this,"timeDelta",0);fi(this,"lastUpdated",0);fi(this,"updateSubscribers",new a5);fi(this,"stopAnimation");fi(this,"canTrackVelocity",!1);fi(this,"updateAndNotify",e=>{this.prev=this.current,this.current=e;const{delta:t,timestamp:i}=VT();this.lastUpdated!==i&&(this.timeDelta=t,this.lastUpdated=i),Fg.postRender(this.scheduleVelocityCheck),this.updateSubscribers.notify(this.current)});fi(this,"scheduleVelocityCheck",()=>Fg.postRender(this.velocityCheck));fi(this,"velocityCheck",({timestamp:e})=>{this.canTrackVelocity||(this.canTrackVelocity=lx(this.current)),e!==this.lastUpdated&&(this.prev=this.current)});this.prev=this.current=e,this.canTrackVelocity=lx(this.current)}onChange(e){return this.updateSubscribers.add(e)}clearListeners(){this.updateSubscribers.clear()}set(e){this.updateAndNotify(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?fw(Number.parseFloat(this.current)-Number.parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(t=>{const{stop:i}=e(t);this.stopAnimation=i}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.stop()}}function c5(n){return new l5(n)}const{isArray:u5}=Array;function f5(){const n=et({}),e=i=>{const s=r=>{n.value[r]&&(n.value[r].stop(),n.value[r].destroy(),delete n.value[r])};i?u5(i)?i.forEach(s):s(i):Object.keys(n.value).forEach(s)},t=(i,s,r)=>{if(n.value[i])return n.value[i];const o=c5(s);return o.onChange(a=>r[i]=a),n.value[i]=o,o};return PB(e),{motionValues:n,get:t,stop:e}}function d5(n){return Array.isArray(n)}function eo(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}}function _m(n){return{type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}}function h5(n){return{type:"spring",stiffness:550,damping:n===0?100:30,restDelta:.01,restSpeed:10}}function vm(){return{type:"keyframes",ease:"linear",duration:300}}function p5(n){return{type:"keyframes",duration:800,values:n}}const cx={default:h5,x:eo,y:eo,z:eo,rotate:eo,rotateX:eo,rotateY:eo,rotateZ:eo,scaleX:_m,scaleY:_m,scale:_m,backgroundColor:vm,color:vm,opacity:vm};function gw(n,e){let t;return d5(e)?t=p5:t=cx[n]||cx.default,{to:e,...t(e)}}const ux={...jc,transform:Math.round},_w={color:qn,backgroundColor:qn,outlineColor:qn,fill:qn,stroke:qn,borderColor:qn,borderTopColor:qn,borderRightColor:qn,borderBottomColor:qn,borderLeftColor:qn,borderWidth:lt,borderTopWidth:lt,borderRightWidth:lt,borderBottomWidth:lt,borderLeftWidth:lt,borderRadius:lt,radius:lt,borderTopLeftRadius:lt,borderTopRightRadius:lt,borderBottomRightRadius:lt,borderBottomLeftRadius:lt,width:lt,maxWidth:lt,height:lt,maxHeight:lt,size:lt,top:lt,right:lt,bottom:lt,left:lt,padding:lt,paddingTop:lt,paddingRight:lt,paddingBottom:lt,paddingLeft:lt,margin:lt,marginTop:lt,marginRight:lt,marginBottom:lt,marginLeft:lt,rotate:Qr,rotateX:Qr,rotateY:Qr,rotateZ:Qr,scale:lf,scaleX:lf,scaleY:lf,scaleZ:lf,skew:Qr,skewX:Qr,skewY:Qr,distance:lt,translateX:lt,translateY:lt,translateZ:lt,x:lt,y:lt,z:lt,perspective:lt,transformPerspective:lt,opacity:kl,originX:ix,originY:ix,originZ:lt,zIndex:ux,filter:Hg,WebkitFilter:Hg,fillOpacity:kl,strokeOpacity:kl,numOctaves:ux},U_=n=>_w[n];function Gg(n,e){return e&&typeof n=="number"&&e.transform?e.transform(n):n}function m5(n,e){let t=U_(n);return t!==Hg&&(t=Kc),t.getAnimatableNone?t.getAnimatableNone(e):void 0}const g5={linear:rw,easeIn:O_,easeInOut:ow,easeOut:N4,circIn:aw,circInOut:U4,circOut:lw,backIn:N_,backInOut:k4,backOut:F4,anticipate:B4,bounceIn:G4,bounceInOut:W4,bounceOut:Id};function fx(n){if(Array.isArray(n)){const[e,t,i,s]=n;return o5(e,t,i,s)}else if(typeof n=="string")return g5[n];return n}function _5(n){return Array.isArray(n)&&typeof n[0]!="number"}function dx(n,e){return n==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&Kc.test(e)&&!e.startsWith("url("))}function v5(n){return Array.isArray(n.to)&&n.to[0]===null&&(n.to=[...n.to],n.to[0]=n.from),n}function y5({ease:n,times:e,delay:t,...i}){const s={...i};return e&&(s.offset=e),n&&(s.ease=_5(n)?n.map(fx):fx(n)),t&&(s.elapsed=-t),s}function b5(n,e,t){return Array.isArray(e.to)&&(n.duration||(n.duration=800)),v5(e),x5(n)||(n={...n,...gw(t,e.to)}),{...e,...y5(n)}}function x5({delay:n,repeat:e,repeatType:t,repeatDelay:i,from:s,...r}){return!!Object.keys(r).length}function M5(n,e){return n[e]||n.default||n}function S5(n,e,t,i,s){const r=M5(i,n);let o=r.from===null||r.from===void 0?e.get():r.from;const a=dx(n,t);o==="none"&&a&&typeof t=="string"&&(o=m5(n,t));const l=dx(n,o);function c(f){const d={from:o,to:t,velocity:i.velocity?i.velocity:e.getVelocity(),onUpdate:h=>e.set(h)};return r.type==="inertia"||r.type==="decay"?Q4({...d,...r}):uw({...b5(r,d,n),onUpdate:h=>{d.onUpdate(h),r.onUpdate&&r.onUpdate(h)},onComplete:()=>{s&&s(),f&&f()}})}function u(f){return e.set(t),s&&s(),f&&f(),{stop:()=>{}}}return!l||!a||r.type===!1?u:c}function E5(){const{motionValues:n,stop:e,get:t}=f5();return{motionValues:n,stop:e,push:(s,r,o,a={},l)=>{const c=o[s],u=t(s,c,o);if(a&&a.immediate){u.set(r);return}const f=S5(s,u,r,a,l);u.start(f)}}}function T5(n,e={},{motionValues:t,push:i,stop:s}=E5()){const r=Ot(e),o=et(!1);Xe(t,f=>{o.value=Object.values(f).filter(d=>d.isAnimating()).length>0},{immediate:!0,deep:!0});const a=f=>{if(!r||!r[f])throw new Error(`The variant ${f} does not exist.`);return r[f]},l=f=>{typeof f=="string"&&(f=a(f));const d=Object.entries(f).map(([p,_])=>{if(p!=="transition")return new Promise(g=>i(p,_,n,f.transition||gw(p,f[p]),g))}).filter(Boolean);async function h(){var p,_;await Promise.all(d),(_=(p=f.transition)==null?void 0:p.onComplete)==null||_.call(p)}return Promise.all([h()])};return{isAnimating:o,apply:l,set:f=>{const d=Pd(f)?f:a(f);Object.entries(d).forEach(([h,p])=>{h!=="transition"&&i(h,p,n,{immediate:!0})})},leave:async f=>{let d;if(r&&(r.leave&&(d=r.leave),!r.leave&&r.initial&&(d=r.initial)),!d){f();return}await l(d),f()},stop:s}}const F_=typeof window<"u",w5=()=>F_&&(window.onpointerdown===null||(Os==null?void 0:Os.TEST)),A5=()=>F_&&(window.ontouchstart===null||(Os==null?void 0:Os.TEST)),C5=()=>F_&&(window.onmousedown===null||(Os==null?void 0:Os.TEST));function R5({target:n,state:e,variants:t,apply:i}){const s=Ot(t),r=et(!1),o=et(!1),a=et(!1),l=Me(()=>{let u=[...Object.keys(e.value||{})];return s&&(s.hovered&&(u=[...u,...Object.keys(s.hovered)]),s.tapped&&(u=[...u,...Object.keys(s.tapped)]),s.focused&&(u=[...u,...Object.keys(s.focused)])),u}),c=Me(()=>{const u={};Object.assign(u,e.value),r.value&&s.hovered&&Object.assign(u,s.hovered),o.value&&s.tapped&&Object.assign(u,s.tapped),a.value&&s.focused&&Object.assign(u,s.focused);for(const f in u)l.value.includes(f)||delete u[f];return u});s.hovered&&(Ft(n,"mouseenter",()=>r.value=!0),Ft(n,"mouseleave",()=>{r.value=!1,o.value=!1})),s.tapped&&(C5()&&(Ft(n,"mousedown",()=>o.value=!0),Ft(n,"mouseup",()=>o.value=!1)),w5()&&(Ft(n,"pointerdown",()=>o.value=!0),Ft(n,"pointerup",()=>o.value=!1)),A5()&&(Ft(n,"touchstart",()=>o.value=!0),Ft(n,"touchend",()=>o.value=!1))),s.focused&&(Ft(n,"focus",()=>a.value=!0),Ft(n,"blur",()=>a.value=!1)),Xe([r,o,a],()=>{i(c.value)})}function P5({set:n,target:e,variants:t,variant:i}){const s=Ot(t);Xe(()=>e,()=>{s&&(s.initial&&(n("initial"),i.value="initial"),s.enter&&(i.value="enter"))},{immediate:!0,flush:"pre"})}function I5({state:n,apply:e}){Xe(n,t=>{t&&e(t)},{immediate:!0})}function vw({target:n,variants:e,variant:t}){const i=Ot(e);i&&(i.visible||i.visibleOnce)&&$B(n,([{isIntersecting:s}])=>{i.visible?s?t.value="visible":t.value="initial":i.visibleOnce&&(s&&t.value!=="visibleOnce"?t.value="visibleOnce":t.value||(t.value="initial"))})}function L5(n,e={syncVariants:!0,lifeCycleHooks:!0,visibilityHooks:!0,eventListeners:!0}){e.lifeCycleHooks&&P5(n),e.syncVariants&&I5(n),e.visibilityHooks&&vw(n),e.eventListeners&&R5(n)}function yw(n={}){const e=xi({...n}),t=et({});return Xe(e,()=>{const i={};for(const[s,r]of Object.entries(e)){const o=U_(s),a=Gg(r,o);i[s]=a}t.value=i},{immediate:!0,deep:!0}),{state:e,style:t}}function k_(n,e){Xe(()=>oi(n),t=>{t&&e(t)},{immediate:!0})}const D5={x:"translateX",y:"translateY",z:"translateZ"};function bw(n={},e=!0){const t=xi({...n}),i=et("");return Xe(t,s=>{let r="",o=!1;if(e&&(s.x||s.y||s.z)){const a=[s.x||0,s.y||0,s.z||0].map(l=>Gg(l,lt)).join(",");r+=`translate3d(${a}) `,o=!0}for(const[a,l]of Object.entries(s)){if(e&&(a==="x"||a==="y"||a==="z"))continue;const c=U_(a),u=Gg(l,c);r+=`${D5[a]||a}(${u}) `}e&&!o&&(r+="translateZ(0px) "),i.value=r.trim()},{immediate:!0,deep:!0}),{state:t,transform:i}}const O5=["","X","Y","Z"],N5=["perspective","translate","scale","rotate","skew"],xw=["transformPerspective","x","y","z"];N5.forEach(n=>{O5.forEach(e=>{const t=n+e;xw.push(t)})});const U5=new Set(xw);function B_(n){return U5.has(n)}const F5=new Set(["originX","originY","originZ"]);function Mw(n){return F5.has(n)}function k5(n){const e={},t={};return Object.entries(n).forEach(([i,s])=>{B_(i)||Mw(i)?e[i]=s:t[i]=s}),{transform:e,style:t}}function Wh(n){const{transform:e,style:t}=k5(n),{transform:i}=bw(e),{style:s}=yw(t);return i.value&&(s.value.transform=i.value),s.value}function B5(n,e){let t,i;const{state:s,style:r}=yw();return k_(n,o=>{i=o;for(const a of Object.keys(_w))o.style[a]===null||o.style[a]===""||B_(a)||Mw(a)||(s[a]=o.style[a]);t&&Object.entries(t).forEach(([a,l])=>o.style[a]=l),e&&e(s)}),Xe(r,o=>{if(!i){t=o;return}for(const a in o)i.style[a]=o[a]},{immediate:!0}),{style:s}}function z5(n){const e=n.trim().split(/\) |\)/);if(e.length===1)return{};const t=i=>i.endsWith("px")||i.endsWith("deg")?Number.parseFloat(i):Number.isNaN(Number(i))?Number(i):i;return e.reduce((i,s)=>{if(!s)return i;const[r,o]=s.split("("),l=o.split(",").map(u=>t(u.endsWith(")")?u.replace(")",""):u.trim())),c=l.length===1?l[0]:l;return{...i,[r]:c}},{})}function V5(n,e){Object.entries(z5(e)).forEach(([t,i])=>{const s=["x","y","z"];if(t==="translate3d"){if(i===0){s.forEach(r=>n[r]=0);return}i.forEach((r,o)=>n[s[o]]=r);return}if(i=Number.parseFloat(`${i}`),t==="translateX"){n.x=i;return}if(t==="translateY"){n.y=i;return}if(t==="translateZ"){n.z=i;return}n[t]=i})}function H5(n,e){let t,i;const{state:s,transform:r}=bw();return k_(n,o=>{i=o,o.style.transform&&V5(s,o.style.transform),t&&(o.style.transform=t),e&&e(s)}),Xe(r,o=>{if(!i){t=o;return}i.style.transform=o},{immediate:!0}),{transform:s}}function G5(n){return Object.entries(n)}function W5(n,e){const t=xi({}),i=o=>Object.entries(o).forEach(([a,l])=>t[a]=l),{style:s}=B5(n,i),{transform:r}=H5(n,i);return Xe(t,o=>{G5(o).forEach(([a,l])=>{const c=B_(a)?r:s;c[a]&&c[a]===l||(c[a]=l)})},{immediate:!0,deep:!0}),k_(n,()=>e),{motionProperties:t,style:s,transform:r}}function X5(n={}){const e=Ot(n),t=et();return{state:Me(()=>{if(t.value)return e[t.value]}),variant:t}}function Sw(n,e={},t){const{motionProperties:i}=W5(n),{variant:s,state:r}=X5(e),o=T5(i,e),a={target:n,variant:s,variants:e,state:r,motionProperties:i,...o};return L5(a,t),a}const Ew=["delay","duration"],$5=["initial","enter","leave","visible","visible-once","visibleOnce","hovered","tapped","focused",...Ew];function q5(n){return Ew.includes(n)}function Y5(n,e){const t=n.props?n.props:n.data&&n.data.attrs?n.data.attrs:{};if(t){t.variants&&Pd(t.variants)&&(e.value={...e.value,...t.variants});for(let i of $5)if(!(!t||!t[i])){if(q5(i)&&typeof t[i]=="number"){for(const s of["enter","visible","visibleOnce"]){const r=e.value[s];r!=null&&(r.transition??(r.transition={}),r.transition[i]=t[i])}continue}if(Pd(t[i])){const s=t[i];i==="visible-once"&&(i="visibleOnce"),e.value[i]=s}}}}function ym(n,e=!1){return{created:(s,r,o)=>{const a=r.value&&typeof r.value=="string"?r.value:o.key;a&&gm[a]&&gm[a].stop();const l=e?structuredClone(ut(n)||{}):n||{},c=et(l);typeof r.value=="object"&&(c.value=r.value),Y5(o,c);const f=Sw(s,c,{eventListeners:!0,lifeCycleHooks:!0,syncVariants:!0,visibilityHooks:!1});s.motionInstance=f,a&&(gm[a]=f)},mounted:(s,r,o)=>{s.motionInstance&&vw(s.motionInstance)},getSSRProps(s,r){let{initial:o}=s.value||r&&(r==null?void 0:r.props)||{};o=Ot(o);const a=AT({},(n==null?void 0:n.initial)||{},o||{});return!a||Object.keys(a).length===0?void 0:{style:Wh(a)}}}}const j5={initial:{opacity:0},enter:{opacity:1}},K5={initial:{opacity:0},visible:{opacity:1}},Z5={initial:{opacity:0},visibleOnce:{opacity:1}},J5={initial:{scale:0,opacity:0},enter:{scale:1,opacity:1}},Q5={initial:{scale:0,opacity:0},visible:{scale:1,opacity:1}},ez={initial:{scale:0,opacity:0},visibleOnce:{scale:1,opacity:1}},tz={initial:{x:-100,rotate:90,opacity:0},enter:{x:0,rotate:0,opacity:1}},nz={initial:{x:-100,rotate:90,opacity:0},visible:{x:0,rotate:0,opacity:1}},iz={initial:{x:-100,rotate:90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},sz={initial:{x:100,rotate:-90,opacity:0},enter:{x:0,rotate:0,opacity:1}},rz={initial:{x:100,rotate:-90,opacity:0},visible:{x:0,rotate:0,opacity:1}},oz={initial:{x:100,rotate:-90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},az={initial:{y:-100,rotate:-90,opacity:0},enter:{y:0,rotate:0,opacity:1}},lz={initial:{y:-100,rotate:-90,opacity:0},visible:{y:0,rotate:0,opacity:1}},cz={initial:{y:-100,rotate:-90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},uz={initial:{y:100,rotate:90,opacity:0},enter:{y:0,rotate:0,opacity:1}},fz={initial:{y:100,rotate:90,opacity:0},visible:{y:0,rotate:0,opacity:1}},dz={initial:{y:100,rotate:90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},hz={initial:{x:-100,opacity:0},enter:{x:0,opacity:1}},pz={initial:{x:-100,opacity:0},visible:{x:0,opacity:1}},mz={initial:{x:-100,opacity:0},visibleOnce:{x:0,opacity:1}},gz={initial:{x:100,opacity:0},enter:{x:0,opacity:1}},_z={initial:{x:100,opacity:0},visible:{x:0,opacity:1}},vz={initial:{x:100,opacity:0},visibleOnce:{x:0,opacity:1}},yz={initial:{y:-100,opacity:0},enter:{y:0,opacity:1}},bz={initial:{y:-100,opacity:0},visible:{y:0,opacity:1}},xz={initial:{y:-100,opacity:0},visibleOnce:{y:0,opacity:1}},Mz={initial:{y:100,opacity:0},enter:{y:0,opacity:1}},Sz={initial:{y:100,opacity:0},visible:{y:0,opacity:1}},Ez={initial:{y:100,opacity:0},visibleOnce:{y:0,opacity:1}},Dd={__proto__:null,fade:j5,fadeVisible:K5,fadeVisibleOnce:Z5,pop:J5,popVisible:Q5,popVisibleOnce:ez,rollBottom:uz,rollLeft:tz,rollRight:sz,rollTop:az,rollVisibleBottom:fz,rollVisibleLeft:nz,rollVisibleOnceBottom:dz,rollVisibleOnceLeft:iz,rollVisibleOnceRight:oz,rollVisibleOnceTop:cz,rollVisibleRight:rz,rollVisibleTop:lz,slideBottom:Mz,slideLeft:hz,slideRight:gz,slideTop:yz,slideVisibleBottom:Sz,slideVisibleLeft:pz,slideVisibleOnceBottom:Ez,slideVisibleOnceLeft:mz,slideVisibleOnceRight:vz,slideVisibleOnceTop:xz,slideVisibleRight:_z,slideVisibleTop:bz};function Tz(n){const e="àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;",t="aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------",i=new RegExp(e.split("").join("|"),"g");return n.toString().replace(/[A-Z]/g,s=>`-${s}`).toLowerCase().replace(/\s+/g,"-").replace(i,s=>t.charAt(e.indexOf(s))).replace(/&/g,"-and-").replace(/[^\w\-]+/g,"").replace(/-{2,}/g,"-").replace(/^-+/,"").replace(/-+$/,"")}const Tw=Symbol(""),ww={preset:{type:String,required:!1},instance:{type:Object,required:!1},variants:{type:Object,required:!1},initial:{type:Object,required:!1},enter:{type:Object,required:!1},leave:{type:Object,required:!1},visible:{type:Object,required:!1},visibleOnce:{type:Object,required:!1},hovered:{type:Object,required:!1},tapped:{type:Object,required:!1},focused:{type:Object,required:!1},delay:{type:[Number,String],required:!1},duration:{type:[Number,String],required:!1}};function wz(n){return Object.prototype.toString.call(n)==="[object Object]"}function Wg(n){if(Array.isArray(n))return n.map(Wg);if(wz(n)){const e={};for(const t in n)e[t]=Wg(n[t]);return e}return n}function Aw(n){const e=xi({}),t=Tn(Tw,{}),i=Me(()=>n.preset==null?{}:t!=null&&n.preset in t?structuredClone(ut(t)[n.preset]):n.preset in Dd?structuredClone(Dd[n.preset]):{}),s=Me(()=>({initial:n.initial,enter:n.enter,leave:n.leave,visible:n.visible,visibleOnce:n.visibleOnce,hovered:n.hovered,tapped:n.tapped,focused:n.focused}));function r(l,c){for(const u of["delay","duration"]){if(c[u]==null)continue;const f=Number.parseInt(c[u]);for(const d of["enter","visible","visibleOnce"]){const h=l[d];h!=null&&(h.transition??(h.transition={}),h.transition[u]=f)}}return l}const o=Me(()=>{const l=AT({},s.value,i.value,n.variants||{});return r({...l},n)});function a(l,c,u){var d;l.props??(l.props={}),(d=l.props).style??(d.style={}),l.props.style={...l.props.style,...u};const f=r(Wg(o.value),l.props);return l.props.onVnodeMounted=({el:h})=>{e[c]=Sw(h,f)},l.props.onVnodeUpdated=({el:h})=>{const p=Wh(e[c].state);for(const[_,g]of Object.entries(p))h.style[_]=g},l}return{motionConfig:o,setNodeInstance:a}}const Az=fn({name:"Motion",props:{...ww,is:{type:[String,Object],default:"div"}},setup(n){const e=P0(),{motionConfig:t,setNodeInstance:i}=Aw(n);return()=>{const s=Wh(t.value.initial||{}),r=Ns(n.is,void 0,e);return i(r,0,s),r}}}),Cz=fn({name:"MotionGroup",props:{...ww,is:{type:[String,Object],required:!1}},setup(n){const e=P0(),{motionConfig:t,setNodeInstance:i}=Aw(n);return()=>{var o;const s=Wh(t.value.initial||{}),r=((o=e.default)==null?void 0:o.call(e))||[];for(let a=0;a
'};t.configure=function(p){var _,g;for(_ in p)g=p[_],g!==void 0&&p.hasOwnProperty(_)&&(i[_]=g);return this},t.status=null,t.set=function(p){var _=t.isStarted();p=s(p,i.minimum,1),t.status=p===1?null:p;var g=t.render(!_),m=g.querySelector(i.barSelector),y=i.speed,b=i.easing;return g.offsetWidth,a(function(v){i.positionUsing===""&&(i.positionUsing=t.getPositioningCSS()),l(m,o(p,y,b)),p===1?(l(g,{transition:"none",opacity:1}),g.offsetWidth,setTimeout(function(){l(g,{transition:"all "+y+"ms linear",opacity:0}),setTimeout(function(){t.remove(),v()},y)},y)):setTimeout(v,y)}),this},t.isStarted=function(){return typeof t.status=="number"},t.start=function(){t.status||t.set(0);var p=function(){setTimeout(function(){t.status&&(t.trickle(),p())},i.trickleSpeed)};return i.trickle&&p(),this},t.done=function(p){return!p&&!t.status?this:t.inc(.3+.5*Math.random()).set(1)},t.inc=function(p){var _=t.status;return _?(typeof p!="number"&&(p=(1-_)*s(Math.random()*_,.1,.95)),_=s(_+p,0,.994),t.set(_)):t.start()},t.trickle=function(){return t.inc(Math.random()*i.trickleRate)},function(){var p=0,_=0;t.promise=function(g){return!g||g.state()==="resolved"?this:(_===0&&t.start(),p++,_++,g.always(function(){_--,_===0?(p=0,t.done()):t.set((p-_)/p)}),this)}}(),t.render=function(p){if(t.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var _=document.createElement("div");_.id="nprogress",_.innerHTML=i.template;var g=_.querySelector(i.barSelector),m=p?"-100":r(t.status||0),y=document.querySelector(i.parent),b;return l(g,{transition:"all 0 linear",transform:"translate3d("+m+"%,0,0)"}),i.showSpinner||(b=_.querySelector(i.spinnerSelector),b&&h(b)),y!=document.body&&u(y,"nprogress-custom-parent"),y.appendChild(_),_},t.remove=function(){f(document.documentElement,"nprogress-busy"),f(document.querySelector(i.parent),"nprogress-custom-parent");var p=document.getElementById("nprogress");p&&h(p)},t.isRendered=function(){return!!document.getElementById("nprogress")},t.getPositioningCSS=function(){var p=document.body.style,_="WebkitTransform"in p?"Webkit":"MozTransform"in p?"Moz":"msTransform"in p?"ms":"OTransform"in p?"O":"";return _+"Perspective"in p?"translate3d":_+"Transform"in p?"translate":"margin"};function s(p,_,g){return p<_?_:p>g?g:p}function r(p){return(-1+p)*100}function o(p,_,g){var m;return i.positionUsing==="translate3d"?m={transform:"translate3d("+r(p)+"%,0,0)"}:i.positionUsing==="translate"?m={transform:"translate("+r(p)+"%,0)"}:m={"margin-left":r(p)+"%"},m.transition="all "+_+"ms "+g,m}var a=function(){var p=[];function _(){var g=p.shift();g&&g(_)}return function(g){p.push(g),p.length==1&&_()}}(),l=function(){var p=["Webkit","O","Moz","ms"],_={};function g(v){return v.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(E,T){return T.toUpperCase()})}function m(v){var E=document.body.style;if(v in E)return v;for(var T=p.length,S=v.charAt(0).toUpperCase()+v.slice(1),P;T--;)if(P=p[T]+S,P in E)return P;return v}function y(v){return v=g(v),_[v]||(_[v]=m(v))}function b(v,E,T){E=y(E),v.style[E]=T}return function(v,E){var T=arguments,S,P;if(T.length==2)for(S in E)P=E[S],P!==void 0&&E.hasOwnProperty(S)&&b(v,S,P);else b(v,T[1],T[2])}}();function c(p,_){var g=typeof p=="string"?p:d(p);return g.indexOf(" "+_+" ")>=0}function u(p,_){var g=d(p),m=g+_;c(g,_)||(p.className=m.substring(1))}function f(p,_){var g=d(p),m;c(p,_)&&(m=g.replace(" "+_+" "," "),p.className=m.substring(1,m.length-1))}function d(p){return(" "+(p.className||"")+" ").replace(/\s+/gi," ")}function h(p){p&&p.parentNode&&p.parentNode.removeChild(p)}return t})}(Pf)),Pf.exports}var Dz=Lz();const Cw=Pz(Dz);/*! + * pinia v3.0.2 + * (c) 2025 Eduardo San Martin Morote + * @license MIT + */let Rw;const Xh=n=>Rw=n,Pw=Symbol();function Xg(n){return n&&typeof n=="object"&&Object.prototype.toString.call(n)==="[object Object]"&&typeof n.toJSON!="function"}var zl;(function(n){n.direct="direct",n.patchObject="patch object",n.patchFunction="patch function"})(zl||(zl={}));function Oz(){const n=y0(!0),e=n.run(()=>et({}));let t=[],i=[];const s=T0({install(r){Xh(s),s._a=r,r.provide(Pw,s),r.config.globalProperties.$pinia=s,i.forEach(o=>t.push(o)),i=[]},use(r){return this._a?t.push(r):i.push(r),this},_p:t,_a:null,_e:n,_s:new Map,state:e});return s}const Iw=()=>{};function px(n,e,t,i=Iw){n.push(e);const s=()=>{const r=n.indexOf(e);r>-1&&(n.splice(r,1),i())};return!t&&qd()&&b0(s),s}function na(n,...e){n.slice().forEach(t=>{t(...e)})}const Nz=n=>n(),mx=Symbol(),bm=Symbol();function $g(n,e){n instanceof Map&&e instanceof Map?e.forEach((t,i)=>n.set(i,t)):n instanceof Set&&e instanceof Set&&e.forEach(n.add,n);for(const t in e){if(!e.hasOwnProperty(t))continue;const i=e[t],s=n[t];Xg(s)&&Xg(i)&&n.hasOwnProperty(t)&&!Pt(i)&&!Is(i)?n[t]=$g(s,i):n[t]=i}return n}const Uz=Symbol();function Fz(n){return!Xg(n)||!Object.prototype.hasOwnProperty.call(n,Uz)}const{assign:ir}=Object;function kz(n){return!!(Pt(n)&&n.effect)}function Bz(n,e,t,i){const{state:s,actions:r,getters:o}=e,a=t.state.value[n];let l;function c(){a||(t.state.value[n]=s?s():{});const u=cS(t.state.value[n]);return ir(u,r,Object.keys(o||{}).reduce((f,d)=>(f[d]=T0(Me(()=>{Xh(t);const h=t._s.get(n);return o[d].call(h,h)})),f),{}))}return l=Lw(n,c,e,t,i,!0),l}function Lw(n,e,t={},i,s,r){let o;const a=ir({actions:{}},t),l={deep:!0};let c,u,f=[],d=[],h;const p=i.state.value[n];!r&&!p&&(i.state.value[n]={}),et({});let _;function g(P){let x;c=u=!1,typeof P=="function"?(P(i.state.value[n]),x={type:zl.patchFunction,storeId:n,events:h}):($g(i.state.value[n],P),x={type:zl.patchObject,payload:P,storeId:n,events:h});const M=_=Symbol();wr().then(()=>{_===M&&(c=!0)}),u=!0,na(f,x,i.state.value[n])}const m=r?function(){const{state:x}=t,M=x?x():{};this.$patch(I=>{ir(I,M)})}:Iw;function y(){o.stop(),f=[],d=[],i._s.delete(n)}const b=(P,x="")=>{if(mx in P)return P[bm]=x,P;const M=function(){Xh(i);const I=Array.from(arguments),N=[],V=[];function j(ee){N.push(ee)}function te(ee){V.push(ee)}na(d,{args:I,name:M[bm],store:E,after:j,onError:te});let Z;try{Z=P.apply(this&&this.$id===n?this:E,I)}catch(ee){throw na(V,ee),ee}return Z instanceof Promise?Z.then(ee=>(na(N,ee),ee)).catch(ee=>(na(V,ee),Promise.reject(ee))):(na(N,Z),Z)};return M[mx]=!0,M[bm]=x,M},v={_p:i,$id:n,$onAction:px.bind(null,d),$patch:g,$reset:m,$subscribe(P,x={}){const M=px(f,P,x.detached,()=>I()),I=o.run(()=>Xe(()=>i.state.value[n],N=>{(x.flush==="sync"?u:c)&&P({storeId:n,type:zl.direct,events:h},N)},ir({},l,x)));return M},$dispose:y},E=xi(v);i._s.set(n,E);const S=(i._a&&i._a.runWithContext||Nz)(()=>i._e.run(()=>(o=y0()).run(()=>e({action:b}))));for(const P in S){const x=S[P];if(Pt(x)&&!kz(x)||Is(x))r||(p&&Fz(x)&&(Pt(x)?x.value=p[P]:$g(x,p[P])),i.state.value[n][P]=x);else if(typeof x=="function"){const M=b(x,P);S[P]=M,a.actions[P]=x}}return ir(E,S),ir(ut(E),S),Object.defineProperty(E,"$state",{get:()=>i.state.value[n],set:P=>{g(x=>{ir(x,P)})}}),i._p.forEach(P=>{ir(E,o.run(()=>P({store:E,app:i._a,pinia:i,options:a})))}),p&&r&&t.hydrate&&t.hydrate(E.$state,p),c=!0,u=!0,E}/*! #__NO_SIDE_EFFECTS__ */function zz(n,e,t){let i;const s=typeof e=="function";i=s?t:e;function r(o,a){const l=Rc();return o=o||(l?Tn(Pw,null):null),o&&Xh(o),o=Rw,o._s.has(n)||(s?Lw(n,e,i,o):Bz(n,i,o)),o._s.get(n)}return r.$id=n,r}function Vz(n){const e=ut(n),t={};for(const i in e){const s=e[i];s.effect?t[i]=Me({get:()=>n[i],set(r){n[i]=r}}):(Pt(s)||Is(s))&&(t[i]=uS(n,i))}return t}const Hz=n=>{const e={};Object.entries(Object.assign({"/src/layouts/default.vue":()=>je(()=>import("./default-Dhw9h5i0.js"),__vite__mapDeps([0,1,2])),"/src/layouts/stage.vue":()=>je(()=>import("./stage-i_VpyNXN.js"),[])})).forEach(([s,r])=>{let o=s.replace("/src/layouts/","").replace(".vue","");e[o]=r});function i(s,r=!0){return s.map(o=>{var a,l,c,u,f,d;if(((a=o.children)==null?void 0:a.length)>0&&(o.children=i(o.children,!1)),r){if(!o.component&&((l=o.children)==null?void 0:l.find(p=>{var _;return(p.path===""||p.path==="/")&&((_=p.meta)==null?void 0:_.isLayout)})))return o;if(((c=o.meta)==null?void 0:c.layout)!==!1)return{path:o.path,component:e[((u=o.meta)==null?void 0:u.layout)||"default"],children:o.path==="/"?[o]:[{...o,path:""}],meta:{isLayout:!0}}}return(f=o.meta)!=null&&f.layout?{path:o.path,component:e[(d=o.meta)==null?void 0:d.layout],children:[{...o,path:""}],meta:{isLayout:!0}}:o})}return i(n)};/*! + * vue-router v4.5.0 + * (c) 2024 Eduardo San Martin Morote + * @license MIT + */const sa=typeof document<"u";function Dw(n){return typeof n=="object"||"displayName"in n||"props"in n||"__vccOpts"in n}function Gz(n){return n.__esModule||n[Symbol.toStringTag]==="Module"||n.default&&Dw(n.default)}const Mt=Object.assign;function xm(n,e){const t={};for(const i in e){const s=e[i];t[i]=Vi(s)?s.map(n):n(s)}return t}const Vl=()=>{},Vi=Array.isArray,Ow=/#/g,Wz=/&/g,Xz=/\//g,$z=/=/g,qz=/\?/g,Nw=/\+/g,Yz=/%5B/g,jz=/%5D/g,Uw=/%5E/g,Kz=/%60/g,Fw=/%7B/g,Zz=/%7C/g,kw=/%7D/g,Jz=/%20/g;function z_(n){return encodeURI(""+n).replace(Zz,"|").replace(Yz,"[").replace(jz,"]")}function Qz(n){return z_(n).replace(Fw,"{").replace(kw,"}").replace(Uw,"^")}function qg(n){return z_(n).replace(Nw,"%2B").replace(Jz,"+").replace(Ow,"%23").replace(Wz,"%26").replace(Kz,"`").replace(Fw,"{").replace(kw,"}").replace(Uw,"^")}function eV(n){return qg(n).replace($z,"%3D")}function tV(n){return z_(n).replace(Ow,"%23").replace(qz,"%3F")}function nV(n){return n==null?"":tV(n).replace(Xz,"%2F")}function xc(n){try{return decodeURIComponent(""+n)}catch{}return""+n}const iV=/\/$/,sV=n=>n.replace(iV,"");function Mm(n,e,t="/"){let i,s={},r="",o="";const a=e.indexOf("#");let l=e.indexOf("?");return a=0&&(l=-1),l>-1&&(i=e.slice(0,l),r=e.slice(l+1,a>-1?a:e.length),s=n(r)),a>-1&&(i=i||e.slice(0,a),o=e.slice(a,e.length)),i=lV(i??e,t),{fullPath:i+(r&&"?")+r+o,path:i,query:s,hash:xc(o)}}function rV(n,e){const t=e.query?n(e.query):"";return e.path+(t&&"?")+t+(e.hash||"")}function gx(n,e){return!e||!n.toLowerCase().startsWith(e.toLowerCase())?n:n.slice(e.length)||"/"}function oV(n,e,t){const i=e.matched.length-1,s=t.matched.length-1;return i>-1&&i===s&&Ia(e.matched[i],t.matched[s])&&Bw(e.params,t.params)&&n(e.query)===n(t.query)&&e.hash===t.hash}function Ia(n,e){return(n.aliasOf||n)===(e.aliasOf||e)}function Bw(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(!aV(n[t],e[t]))return!1;return!0}function aV(n,e){return Vi(n)?_x(n,e):Vi(e)?_x(e,n):n===e}function _x(n,e){return Vi(e)?n.length===e.length&&n.every((t,i)=>t===e[i]):n.length===1&&n[0]===e}function lV(n,e){if(n.startsWith("/"))return n;if(!n)return e;const t=e.split("/"),i=n.split("/"),s=i[i.length-1];(s===".."||s===".")&&i.push("");let r=t.length-1,o,a;for(o=0;o1&&r--;else break;return t.slice(0,r).join("/")+"/"+i.slice(o).join("/")}const tr={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var Mc;(function(n){n.pop="pop",n.push="push"})(Mc||(Mc={}));var Hl;(function(n){n.back="back",n.forward="forward",n.unknown=""})(Hl||(Hl={}));function cV(n){if(!n)if(sa){const e=document.querySelector("base");n=e&&e.getAttribute("href")||"/",n=n.replace(/^\w+:\/\/[^\/]+/,"")}else n="/";return n[0]!=="/"&&n[0]!=="#"&&(n="/"+n),sV(n)}const uV=/^[^#]+#/;function fV(n,e){return n.replace(uV,"#")+e}function dV(n,e){const t=document.documentElement.getBoundingClientRect(),i=n.getBoundingClientRect();return{behavior:e.behavior,left:i.left-t.left-(e.left||0),top:i.top-t.top-(e.top||0)}}const $h=()=>({left:window.scrollX,top:window.scrollY});function hV(n){let e;if("el"in n){const t=n.el,i=typeof t=="string"&&t.startsWith("#"),s=typeof t=="string"?i?document.getElementById(t.slice(1)):document.querySelector(t):t;if(!s)return;e=dV(s,n)}else e=n;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function vx(n,e){return(history.state?history.state.position-e:-1)+n}const Yg=new Map;function pV(n,e){Yg.set(n,e)}function mV(n){const e=Yg.get(n);return Yg.delete(n),e}let gV=()=>location.protocol+"//"+location.host;function zw(n,e){const{pathname:t,search:i,hash:s}=e,r=n.indexOf("#");if(r>-1){let a=s.includes(n.slice(r))?n.slice(r).length:1,l=s.slice(a);return l[0]!=="/"&&(l="/"+l),gx(l,"")}return gx(t,n)+i+s}function _V(n,e,t,i){let s=[],r=[],o=null;const a=({state:d})=>{const h=zw(n,location),p=t.value,_=e.value;let g=0;if(d){if(t.value=h,e.value=d,o&&o===p){o=null;return}g=_?d.position-_.position:0}else i(h);s.forEach(m=>{m(t.value,p,{delta:g,type:Mc.pop,direction:g?g>0?Hl.forward:Hl.back:Hl.unknown})})};function l(){o=t.value}function c(d){s.push(d);const h=()=>{const p=s.indexOf(d);p>-1&&s.splice(p,1)};return r.push(h),h}function u(){const{history:d}=window;d.state&&d.replaceState(Mt({},d.state,{scroll:$h()}),"")}function f(){for(const d of r)d();r=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",u)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",u,{passive:!0}),{pauseListeners:l,listen:c,destroy:f}}function yx(n,e,t,i=!1,s=!1){return{back:n,current:e,forward:t,replaced:i,position:window.history.length,scroll:s?$h():null}}function vV(n){const{history:e,location:t}=window,i={value:zw(n,t)},s={value:e.state};s.value||r(i.value,{back:null,current:i.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function r(l,c,u){const f=n.indexOf("#"),d=f>-1?(t.host&&document.querySelector("base")?n:n.slice(f))+l:gV()+n+l;try{e[u?"replaceState":"pushState"](c,"",d),s.value=c}catch(h){console.error(h),t[u?"replace":"assign"](d)}}function o(l,c){const u=Mt({},e.state,yx(s.value.back,l,s.value.forward,!0),c,{position:s.value.position});r(l,u,!0),i.value=l}function a(l,c){const u=Mt({},s.value,e.state,{forward:l,scroll:$h()});r(u.current,u,!0);const f=Mt({},yx(i.value,l,null),{position:u.position+1},c);r(l,f,!1),i.value=l}return{location:i,state:s,push:a,replace:o}}function yV(n){n=cV(n);const e=vV(n),t=_V(n,e.state,e.location,e.replace);function i(r,o=!0){o||t.pauseListeners(),history.go(r)}const s=Mt({location:"",base:n,go:i,createHref:fV.bind(null,n)},e,t);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>e.state.value}),s}function bV(n){return n=location.host?n||location.pathname+location.search:"",n.includes("#")||(n+="#"),yV(n)}function xV(n){return typeof n=="string"||n&&typeof n=="object"}function Vw(n){return typeof n=="string"||typeof n=="symbol"}const Hw=Symbol("");var bx;(function(n){n[n.aborted=4]="aborted",n[n.cancelled=8]="cancelled",n[n.duplicated=16]="duplicated"})(bx||(bx={}));function La(n,e){return Mt(new Error,{type:n,[Hw]:!0},e)}function ys(n,e){return n instanceof Error&&Hw in n&&(e==null||!!(n.type&e))}const xx="[^/]+?",MV={sensitive:!1,strict:!1,start:!0,end:!0},SV=/[.+*?^${}()[\]/\\]/g;function EV(n,e){const t=Mt({},MV,e),i=[];let s=t.start?"^":"";const r=[];for(const c of n){const u=c.length?[]:[90];t.strict&&!c.length&&(s+="/");for(let f=0;fe.length?e.length===1&&e[0]===80?1:-1:0}function Gw(n,e){let t=0;const i=n.score,s=e.score;for(;t0&&e[e.length-1]<0}const wV={type:0,value:""},AV=/[a-zA-Z0-9_]/;function CV(n){if(!n)return[[]];if(n==="/")return[[wV]];if(!n.startsWith("/"))throw new Error(`Invalid path "${n}"`);function e(h){throw new Error(`ERR (${t})/"${c}": ${h}`)}let t=0,i=t;const s=[];let r;function o(){r&&s.push(r),r=[]}let a=0,l,c="",u="";function f(){c&&(t===0?r.push({type:0,value:c}):t===1||t===2||t===3?(r.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),r.push({type:1,value:c,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):e("Invalid state to consume buffer"),c="")}function d(){c+=l}for(;a{o(b)}:Vl}function o(f){if(Vw(f)){const d=i.get(f);d&&(i.delete(f),t.splice(t.indexOf(d),1),d.children.forEach(o),d.alias.forEach(o))}else{const d=t.indexOf(f);d>-1&&(t.splice(d,1),f.record.name&&i.delete(f.record.name),f.children.forEach(o),f.alias.forEach(o))}}function a(){return t}function l(f){const d=DV(f,t);t.splice(d,0,f),f.record.name&&!Tx(f)&&i.set(f.record.name,f)}function c(f,d){let h,p={},_,g;if("name"in f&&f.name){if(h=i.get(f.name),!h)throw La(1,{location:f});g=h.record.name,p=Mt(Sx(d.params,h.keys.filter(b=>!b.optional).concat(h.parent?h.parent.keys.filter(b=>b.optional):[]).map(b=>b.name)),f.params&&Sx(f.params,h.keys.map(b=>b.name))),_=h.stringify(p)}else if(f.path!=null)_=f.path,h=t.find(b=>b.re.test(_)),h&&(p=h.parse(_),g=h.record.name);else{if(h=d.name?i.get(d.name):t.find(b=>b.re.test(d.path)),!h)throw La(1,{location:f,currentLocation:d});g=h.record.name,p=Mt({},d.params,f.params),_=h.stringify(p)}const m=[];let y=h;for(;y;)m.unshift(y.record),y=y.parent;return{name:g,path:_,params:p,matched:m,meta:LV(m)}}n.forEach(f=>r(f));function u(){t.length=0,i.clear()}return{addRoute:r,resolve:c,removeRoute:o,clearRoutes:u,getRoutes:a,getRecordMatcher:s}}function Sx(n,e){const t={};for(const i of e)i in n&&(t[i]=n[i]);return t}function Ex(n){const e={path:n.path,redirect:n.redirect,name:n.name,meta:n.meta||{},aliasOf:n.aliasOf,beforeEnter:n.beforeEnter,props:IV(n),children:n.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in n?n.components||null:n.component&&{default:n.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function IV(n){const e={},t=n.props||!1;if("component"in n)e.default=t;else for(const i in n.components)e[i]=typeof t=="object"?t[i]:t;return e}function Tx(n){for(;n;){if(n.record.aliasOf)return!0;n=n.parent}return!1}function LV(n){return n.reduce((e,t)=>Mt(e,t.meta),{})}function wx(n,e){const t={};for(const i in n)t[i]=i in e?e[i]:n[i];return t}function DV(n,e){let t=0,i=e.length;for(;t!==i;){const r=t+i>>1;Gw(n,e[r])<0?i=r:t=r+1}const s=OV(n);return s&&(i=e.lastIndexOf(s,i-1)),i}function OV(n){let e=n;for(;e=e.parent;)if(Ww(e)&&Gw(n,e)===0)return e}function Ww({record:n}){return!!(n.name||n.components&&Object.keys(n.components).length||n.redirect)}function NV(n){const e={};if(n===""||n==="?")return e;const i=(n[0]==="?"?n.slice(1):n).split("&");for(let s=0;sr&&qg(r)):[i&&qg(i)]).forEach(r=>{r!==void 0&&(e+=(e.length?"&":"")+t,r!=null&&(e+="="+r))})}return e}function UV(n){const e={};for(const t in n){const i=n[t];i!==void 0&&(e[t]=Vi(i)?i.map(s=>s==null?null:""+s):i==null?i:""+i)}return e}const FV=Symbol(""),Cx=Symbol(""),qh=Symbol(""),Xw=Symbol(""),jg=Symbol("");function ul(){let n=[];function e(i){return n.push(i),()=>{const s=n.indexOf(i);s>-1&&n.splice(s,1)}}function t(){n=[]}return{add:e,list:()=>n.slice(),reset:t}}function cr(n,e,t,i,s,r=o=>o()){const o=i&&(i.enterCallbacks[s]=i.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const c=d=>{d===!1?l(La(4,{from:t,to:e})):d instanceof Error?l(d):xV(d)?l(La(2,{from:e,to:d})):(o&&i.enterCallbacks[s]===o&&typeof d=="function"&&o.push(d),a())},u=r(()=>n.call(i&&i.instances[s],e,t,c));let f=Promise.resolve(u);n.length<3&&(f=f.then(c)),f.catch(d=>l(d))})}function Sm(n,e,t,i,s=r=>r()){const r=[];for(const o of n)for(const a in o.components){let l=o.components[a];if(!(e!=="beforeRouteEnter"&&!o.instances[a]))if(Dw(l)){const u=(l.__vccOpts||l)[e];u&&r.push(cr(u,t,i,o,a,s))}else{let c=l();r.push(()=>c.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${o.path}"`);const f=Gz(u)?u.default:u;o.mods[a]=u,o.components[a]=f;const h=(f.__vccOpts||f)[e];return h&&cr(h,t,i,o,a,s)()}))}}return r}function Rx(n){const e=Tn(qh),t=Tn(Xw),i=Me(()=>{const l=Ot(n.to);return e.resolve(l)}),s=Me(()=>{const{matched:l}=i.value,{length:c}=l,u=l[c-1],f=t.matched;if(!u||!f.length)return-1;const d=f.findIndex(Ia.bind(null,u));if(d>-1)return d;const h=Px(l[c-2]);return c>1&&Px(u)===h&&f[f.length-1].path!==h?f.findIndex(Ia.bind(null,l[c-2])):d}),r=Me(()=>s.value>-1&&HV(t.params,i.value.params)),o=Me(()=>s.value>-1&&s.value===t.matched.length-1&&Bw(t.params,i.value.params));function a(l={}){if(VV(l)){const c=e[Ot(n.replace)?"replace":"push"](Ot(n.to)).catch(Vl);return n.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:i,href:Me(()=>i.value.href),isActive:r,isExactActive:o,navigate:a}}function kV(n){return n.length===1?n[0]:n}const BV=fn({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Rx,setup(n,{slots:e}){const t=xi(Rx(n)),{options:i}=Tn(qh),s=Me(()=>({[Ix(n.activeClass,i.linkActiveClass,"router-link-active")]:t.isActive,[Ix(n.exactActiveClass,i.linkExactActiveClass,"router-link-exact-active")]:t.isExactActive}));return()=>{const r=e.default&&kV(e.default(t));return n.custom?r:Ns("a",{"aria-current":t.isExactActive?n.ariaCurrentValue:null,href:t.href,onClick:t.navigate,class:s.value},r)}}}),zV=BV;function VV(n){if(!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)&&!n.defaultPrevented&&!(n.button!==void 0&&n.button!==0)){if(n.currentTarget&&n.currentTarget.getAttribute){const e=n.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return n.preventDefault&&n.preventDefault(),!0}}function HV(n,e){for(const t in e){const i=e[t],s=n[t];if(typeof i=="string"){if(i!==s)return!1}else if(!Vi(s)||s.length!==i.length||i.some((r,o)=>r!==s[o]))return!1}return!0}function Px(n){return n?n.aliasOf?n.aliasOf.path:n.path:""}const Ix=(n,e,t)=>n??e??t,GV=fn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(n,{attrs:e,slots:t}){const i=Tn(jg),s=Me(()=>n.route||i.value),r=Tn(Cx,0),o=Me(()=>{let c=Ot(r);const{matched:u}=s.value;let f;for(;(f=u[c])&&!f.components;)c++;return c}),a=Me(()=>s.value.matched[o.value]);pr(Cx,Me(()=>o.value+1)),pr(FV,a),pr(jg,s);const l=et();return Xe(()=>[l.value,a.value,n.name],([c,u,f],[d,h,p])=>{u&&(u.instances[f]=c,h&&h!==u&&c&&c===d&&(u.leaveGuards.size||(u.leaveGuards=h.leaveGuards),u.updateGuards.size||(u.updateGuards=h.updateGuards))),c&&u&&(!h||!Ia(u,h)||!d)&&(u.enterCallbacks[f]||[]).forEach(_=>_(c))},{flush:"post"}),()=>{const c=s.value,u=n.name,f=a.value,d=f&&f.components[u];if(!d)return Lx(t.default,{Component:d,route:c});const h=f.props[u],p=h?h===!0?c.params:typeof h=="function"?h(c):h:null,g=Ns(d,Mt({},p,e,{onVnodeUnmounted:m=>{m.component.isUnmounted&&(f.instances[u]=null)},ref:l}));return Lx(t.default,{Component:g,route:c})||g}}});function Lx(n,e){if(!n)return null;const t=n(e);return t.length===1?t[0]:t}const $w=GV;function WV(n){const e=PV(n.routes,n),t=n.parseQuery||NV,i=n.stringifyQuery||Ax,s=n.history,r=ul(),o=ul(),a=ul(),l=Oe(tr);let c=tr;sa&&n.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=xm.bind(null,$=>""+$),f=xm.bind(null,nV),d=xm.bind(null,xc);function h($,ae){let le,ce;return Vw($)?(le=e.getRecordMatcher($),ce=ae):ce=$,e.addRoute(ce,le)}function p($){const ae=e.getRecordMatcher($);ae&&e.removeRoute(ae)}function _(){return e.getRoutes().map($=>$.record)}function g($){return!!e.getRecordMatcher($)}function m($,ae){if(ae=Mt({},ae||l.value),typeof $=="string"){const w=Mm(t,$,ae.path),X=e.resolve({path:w.path},ae),G=s.createHref(w.fullPath);return Mt(w,X,{params:d(X.params),hash:xc(w.hash),redirectedFrom:void 0,href:G})}let le;if($.path!=null)le=Mt({},$,{path:Mm(t,$.path,ae.path).path});else{const w=Mt({},$.params);for(const X in w)w[X]==null&&delete w[X];le=Mt({},$,{params:f(w)}),ae.params=f(ae.params)}const ce=e.resolve(le,ae),He=$.hash||"";ce.params=u(d(ce.params));const F=rV(i,Mt({},$,{hash:Qz(He),path:ce.path})),k=s.createHref(F);return Mt({fullPath:F,hash:He,query:i===Ax?UV($.query):$.query||{}},ce,{redirectedFrom:void 0,href:k})}function y($){return typeof $=="string"?Mm(t,$,l.value.path):Mt({},$)}function b($,ae){if(c!==$)return La(8,{from:ae,to:$})}function v($){return S($)}function E($){return v(Mt(y($),{replace:!0}))}function T($){const ae=$.matched[$.matched.length-1];if(ae&&ae.redirect){const{redirect:le}=ae;let ce=typeof le=="function"?le($):le;return typeof ce=="string"&&(ce=ce.includes("?")||ce.includes("#")?ce=y(ce):{path:ce},ce.params={}),Mt({query:$.query,hash:$.hash,params:ce.path!=null?{}:$.params},ce)}}function S($,ae){const le=c=m($),ce=l.value,He=$.state,F=$.force,k=$.replace===!0,w=T(le);if(w)return S(Mt(y(w),{state:typeof w=="object"?Mt({},He,w.state):He,force:F,replace:k}),ae||le);const X=le;X.redirectedFrom=ae;let G;return!F&&oV(i,ce,le)&&(G=La(16,{to:X,from:ce}),se(ce,ce,!0,!1)),(G?Promise.resolve(G):M(X,ce)).catch(W=>ys(W)?ys(W,2)?W:be(W):J(W,X,ce)).then(W=>{if(W){if(ys(W,2))return S(Mt({replace:k},y(W.to),{state:typeof W.to=="object"?Mt({},He,W.to.state):He,force:F}),ae||X)}else W=N(X,ce,!0,k,He);return I(X,ce,W),W})}function P($,ae){const le=b($,ae);return le?Promise.reject(le):Promise.resolve()}function x($){const ae=re.values().next().value;return ae&&typeof ae.runWithContext=="function"?ae.runWithContext($):$()}function M($,ae){let le;const[ce,He,F]=XV($,ae);le=Sm(ce.reverse(),"beforeRouteLeave",$,ae);for(const w of ce)w.leaveGuards.forEach(X=>{le.push(cr(X,$,ae))});const k=P.bind(null,$,ae);return le.push(k),xe(le).then(()=>{le=[];for(const w of r.list())le.push(cr(w,$,ae));return le.push(k),xe(le)}).then(()=>{le=Sm(He,"beforeRouteUpdate",$,ae);for(const w of He)w.updateGuards.forEach(X=>{le.push(cr(X,$,ae))});return le.push(k),xe(le)}).then(()=>{le=[];for(const w of F)if(w.beforeEnter)if(Vi(w.beforeEnter))for(const X of w.beforeEnter)le.push(cr(X,$,ae));else le.push(cr(w.beforeEnter,$,ae));return le.push(k),xe(le)}).then(()=>($.matched.forEach(w=>w.enterCallbacks={}),le=Sm(F,"beforeRouteEnter",$,ae,x),le.push(k),xe(le))).then(()=>{le=[];for(const w of o.list())le.push(cr(w,$,ae));return le.push(k),xe(le)}).catch(w=>ys(w,8)?w:Promise.reject(w))}function I($,ae,le){a.list().forEach(ce=>x(()=>ce($,ae,le)))}function N($,ae,le,ce,He){const F=b($,ae);if(F)return F;const k=ae===tr,w=sa?history.state:{};le&&(ce||k?s.replace($.fullPath,Mt({scroll:k&&w&&w.scroll},He)):s.push($.fullPath,He)),l.value=$,se($,ae,le,k),be()}let V;function j(){V||(V=s.listen(($,ae,le)=>{if(!ge.listening)return;const ce=m($),He=T(ce);if(He){S(Mt(He,{replace:!0,force:!0}),ce).catch(Vl);return}c=ce;const F=l.value;sa&&pV(vx(F.fullPath,le.delta),$h()),M(ce,F).catch(k=>ys(k,12)?k:ys(k,2)?(S(Mt(y(k.to),{force:!0}),ce).then(w=>{ys(w,20)&&!le.delta&&le.type===Mc.pop&&s.go(-1,!1)}).catch(Vl),Promise.reject()):(le.delta&&s.go(-le.delta,!1),J(k,ce,F))).then(k=>{k=k||N(ce,F,!1),k&&(le.delta&&!ys(k,8)?s.go(-le.delta,!1):le.type===Mc.pop&&ys(k,20)&&s.go(-1,!1)),I(ce,F,k)}).catch(Vl)}))}let te=ul(),Z=ul(),ee;function J($,ae,le){be($);const ce=Z.list();return ce.length?ce.forEach(He=>He($,ae,le)):console.error($),Promise.reject($)}function he(){return ee&&l.value!==tr?Promise.resolve():new Promise(($,ae)=>{te.add([$,ae])})}function be($){return ee||(ee=!$,j(),te.list().forEach(([ae,le])=>$?le($):ae()),te.reset()),$}function se($,ae,le,ce){const{scrollBehavior:He}=n;if(!sa||!He)return Promise.resolve();const F=!le&&mV(vx($.fullPath,0))||(ce||!le)&&history.state&&history.state.scroll||null;return wr().then(()=>He($,ae,F)).then(k=>k&&hV(k)).catch(k=>J(k,$,ae))}const ye=$=>s.go($);let Be;const re=new Set,ge={currentRoute:l,listening:!0,addRoute:h,removeRoute:p,clearRoutes:e.clearRoutes,hasRoute:g,getRoutes:_,resolve:m,options:n,push:v,replace:E,go:ye,back:()=>ye(-1),forward:()=>ye(1),beforeEach:r.add,beforeResolve:o.add,afterEach:a.add,onError:Z.add,isReady:he,install($){const ae=this;$.component("RouterLink",zV),$.component("RouterView",$w),$.config.globalProperties.$router=ae,Object.defineProperty($.config.globalProperties,"$route",{enumerable:!0,get:()=>Ot(l)}),sa&&!Be&&l.value===tr&&(Be=!0,v(s.location).catch(He=>{}));const le={};for(const He in tr)Object.defineProperty(le,He,{get:()=>l.value[He],enumerable:!0});$.provide(qh,ae),$.provide(Xw,rS(le)),$.provide(jg,l);const ce=$.unmount;re.add($),$.unmount=function(){re.delete($),re.size<1&&(c=tr,V&&V(),V=null,l.value=tr,Be=!1,ee=!1),ce()}}};function xe($){return $.reduce((ae,le)=>ae.then(()=>x(le)),Promise.resolve())}return ge}function XV(n,e){const t=[],i=[],s=[],r=Math.max(e.matched.length,n.matched.length);for(let o=0;oIa(c,a))?i.push(a):t.push(a));const l=n.matched[o];l&&(e.matched.find(c=>Ia(c,l))||s.push(l))}return[t,i,s]}function $V(){return Tn(qh)}const qV=[{path:"/",name:"/",component:()=>je(()=>import("./index-6VFi4BKt.js"),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,1,2,19,20,21,22])),meta:{layout:"stage",stageTransition:{name:"bubble-wave-out"}}},{path:"/:all(.*)",name:"/[...all]",component:()=>je(()=>import("./_...all_-CZoKQ0-e.js"),[])},{path:"/audio",name:"/audio",component:()=>je(()=>import("./audio-l_cY-aws.js"),[])},{path:"/devtools",children:[{path:"background-remove",name:"/devtools/background-remove",component:()=>je(()=>import("./background-remove-BznEXvcR.js"),__vite__mapDeps([23,4,5,24]))},{path:"chat",name:"/devtools/chat",component:()=>je(()=>import("./chat-BoclSdvP.js"),__vite__mapDeps([25,13,9]))},{path:"image",name:"/devtools/image",component:()=>je(()=>import("./image-Se8P3JHN.js"),__vite__mapDeps([26,27]))},{path:"vibrant",name:"/devtools/vibrant",component:()=>je(()=>import("./vibrant-DiySZm3a.js"),__vite__mapDeps([28,4,5,24,29]))}]},{path:"/queue",name:"/queue",component:()=>je(()=>import("./queue-CSnE70Jj.js"),__vite__mapDeps([30,11]))},{path:"/settings",children:[{path:"",name:"/settings/",component:()=>je(()=>import("./index-BzQ8e19F.js"),__vite__mapDeps([31,4,5,32,33,21])),meta:{stageTransition:{name:"slide"}}},{path:"airi-card",children:[{path:"",name:"/settings/airi-card/",component:()=>je(()=>import("./index-DH7Ly51U.js"),__vite__mapDeps([34,4,5,24,32,14,15,10,9,8,35,36,37,38,21])),meta:{stageTransition:{name:"slide"}}},{path:"components",children:[{path:"CardDetailDialog",name:"/settings/airi-card/components/CardDetailDialog",component:()=>je(()=>import("./CardDetailDialog-DKc4Mthn.js"),__vite__mapDeps([39,35,36,37,4,5,14,15,10,9,8]))},{path:"CardListItem",name:"/settings/airi-card/components/CardListItem",component:()=>je(()=>import("./CardListItem-BohbUcI4.js"),__vite__mapDeps([40,38,4,5]))},{path:"DeleteCardDialog",name:"/settings/airi-card/components/DeleteCardDialog",component:()=>je(()=>import("./DeleteCardDialog-C-dXtHQF.js"),__vite__mapDeps([41,36,37]))}]}]},{path:"appearance",children:[{path:"",name:"/settings/appearance/",component:()=>je(()=>import("./index-3uLpAsQp.js"),__vite__mapDeps([42,4,5,32,43,18,17,37,21,44])),meta:{stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]},{path:"memory",children:[{path:"",name:"/settings/memory/",component:()=>je(()=>import("./index-B-6GIiod.js"),__vite__mapDeps([45,4,5,32]))}]},{path:"models",children:[{path:"",name:"/settings/models/",component:()=>je(()=>import("./index-D8SjfWSQ.js"),__vite__mapDeps([46,33,4,5,32,16,29,43,18,17,37,47,21,48])),meta:{stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]},{path:"modules",children:[{path:"",name:"/settings/modules/",component:()=>je(()=>import("./index-DQQzlxjW.js"),__vite__mapDeps([49,4,5,32,50,33,47,21])),meta:{stageTransition:{name:"slide",pageSpecificAvailable:!0}}},{path:"consciousness",name:"/settings/modules/consciousness",component:()=>je(()=>import("./consciousness-BKApwHzz.js"),__vite__mapDeps([51,4,5,52,17,53,32,15,10,9,21])),meta:{stageTransition:{name:"slide"}}},{path:"memory-long-term",name:"/settings/modules/memory-long-term",component:()=>je(()=>import("./memory-long-term-DqgaRqei.js"),__vite__mapDeps([54,4,5,32]))},{path:"memory-short-term",name:"/settings/modules/memory-short-term",component:()=>je(()=>import("./memory-short-term-CgjWXBzF.js"),__vite__mapDeps([55,4,5,32]))},{path:"speech",name:"/settings/modules/speech",component:()=>je(()=>import("./speech-CkUHmU-4.js"),__vite__mapDeps([56,57,4,5,58,53,59,52,17,60,19,32,10,9,8,21])),meta:{stageTransition:{name:"slide"}}}]},{path:"providers",children:[{path:"",name:"/settings/providers/",component:()=>je(()=>import("./index-DLifNpdd.js"),__vite__mapDeps([61,33,4,5,32,10,9,50,47,21])),meta:{stageTransition:{name:"slide",pageSpecificAvailable:!0}}},{path:"alibaba-cloud-model-studio",name:"/settings/providers/alibaba-cloud-model-studio",component:()=>je(()=>import("./alibaba-cloud-model-studio-BNtzry17.js"),__vite__mapDeps([62,59,4,5,10,9,8,63,57,64,18,17,58,53,65,66,32]))},{path:"anthropic",name:"/settings/providers/anthropic",component:()=>je(()=>import("./anthropic-DeoGf-kT.js"),__vite__mapDeps([67,4,5,10,9,64,18,17,58,53,65,66,68,32]))},{path:"cloudflare-workers-ai",name:"/settings/providers/cloudflare-workers-ai",component:()=>je(()=>import("./cloudflare-workers-ai-RQPniZx7.js"),__vite__mapDeps([69,4,5,10,9,58,53,65,66,68,32]))},{path:"deepseek",name:"/settings/providers/deepseek",component:()=>je(()=>import("./deepseek-ENYP1GJq.js"),__vite__mapDeps([70,4,5,10,9,64,18,17,58,53,65,66,68,32]))},{path:"elevenlabs",name:"/settings/providers/elevenlabs",component:()=>je(()=>import("./elevenlabs-Di7recat.js"),__vite__mapDeps([71,57,4,5,59,10,9,8,63,64,18,17,58,53,65,66,32]))},{path:"featherless-ai",name:"/settings/providers/featherless-ai",component:()=>je(()=>import("./featherless-ai-AfkKNAvr.js"),__vite__mapDeps([72,4,5,10,9,64,18,17,58,53,65,66,68,32]))},{path:"fireworks-ai",name:"/settings/providers/fireworks-ai",component:()=>je(()=>import("./fireworks-ai-m-Nf-Xo5.js"),__vite__mapDeps([73,4,5,10,9,64,18,17,58,53,65,66,68,32]))},{path:"google-generative-ai",name:"/settings/providers/google-generative-ai",component:()=>je(()=>import("./google-generative-ai-DFMkjsF_.js"),__vite__mapDeps([74,4,5,10,9,64,18,17,58,53,65,66,68,32]))},{path:"microsoft-speech",name:"/settings/providers/microsoft-speech",component:()=>je(()=>import("./microsoft-speech-BIikQlYj.js"),__vite__mapDeps([75,58,53,4,5,10,9,8,63,57,64,18,17,65,66,32]))},{path:"mistral-ai",name:"/settings/providers/mistral-ai",component:()=>je(()=>import("./mistral-ai-BllFW1bl.js"),__vite__mapDeps([76,4,5,10,9,64,18,17,58,53,65,66,68,32]))},{path:"moonshot-ai",name:"/settings/providers/moonshot-ai",component:()=>je(()=>import("./moonshot-ai-DHW8Lwbg.js"),__vite__mapDeps([77,4,5,10,9,64,18,17,58,53,65,66,68,32]))},{path:"novita-ai",name:"/settings/providers/novita-ai",component:()=>je(()=>import("./novita-ai-Bwr7ycLb.js"),__vite__mapDeps([78,4,5,10,9,64,18,17,58,53,65,66,68,32]))},{path:"ollama",name:"/settings/providers/ollama",component:()=>je(()=>import("./ollama-X-aI2B2C.js"),__vite__mapDeps([79,53,4,5,10,9,64,18,17,58,66,68,32]))},{path:"openai",name:"/settings/providers/openai",component:()=>je(()=>import("./openai-CJb4OpgD.js"),__vite__mapDeps([80,4,5,10,9,64,18,17,58,53,65,66,68,32]))},{path:"openrouter-ai",name:"/settings/providers/openrouter-ai",component:()=>je(()=>import("./openrouter-ai-DqPOkDgq.js"),__vite__mapDeps([81,4,5,10,9,64,18,17,58,53,65,66,68,32]))},{path:"together-ai",name:"/settings/providers/together-ai",component:()=>je(()=>import("./together-ai-iclTvzCk.js"),__vite__mapDeps([82,4,5,10,9,64,18,17,58,53,65,66,68,32]))},{path:"volcengine",name:"/settings/providers/volcengine",component:()=>je(()=>import("./volcengine-BIunt7Yu.js"),__vite__mapDeps([83,58,53,59,4,5,10,9,8,63,57,64,18,17,65,66,32]))},{path:"xai",name:"/settings/providers/xai",component:()=>je(()=>import("./xai-Di0tvp3d.js"),__vite__mapDeps([84,4,5,10,9,64,18,17,58,53,65,66,68,32]))}]},{path:"scene",children:[{path:"",name:"/settings/scene/",component:()=>je(()=>import("./index-DzQg1p4T.js"),__vite__mapDeps([85,33,4,5,32,47,21])),meta:{stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]}]},{path:"/test",children:[{path:"filter-message",name:"/test/filter-message",component:()=>je(()=>import("./filter-message-BZZnHMce.js"),__vite__mapDeps([86,4,5,60,19]))},{path:"queues",children:[{path:"delays",name:"/test/queues/delays",component:()=>je(()=>import("./delays-CL-vuuRI.js"),__vite__mapDeps([87,4,5,60,19,12,11,20]))},{path:"emotions",name:"/test/queues/emotions",component:()=>je(()=>import("./emotions-Dd6am6XA.js"),__vite__mapDeps([88,4,5,60,19,11,12]))},{path:"messages",name:"/test/queues/messages",component:()=>je(()=>import("./messages-BXrCHBJr.js"),__vite__mapDeps([89,4,5,60,19,11,12]))}]}]}],qw=(n,e)=>{if(typeof n=="number"){if(e===3)return{mode:"rgb",r:(n>>8&15|n>>4&240)/255,g:(n>>4&15|n&240)/255,b:(n&15|n<<4&240)/255};if(e===4)return{mode:"rgb",r:(n>>12&15|n>>8&240)/255,g:(n>>8&15|n>>4&240)/255,b:(n>>4&15|n&240)/255,alpha:(n&15|n<<4&240)/255};if(e===6)return{mode:"rgb",r:(n>>16&255)/255,g:(n>>8&255)/255,b:(n&255)/255};if(e===8)return{mode:"rgb",r:(n>>24&255)/255,g:(n>>16&255)/255,b:(n>>8&255)/255,alpha:(n&255)/255}}},YV={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},jV=n=>qw(YV[n.toLowerCase()],6),KV=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,ZV=n=>{let e;return(e=n.match(KV))?qw(parseInt(e[1],16),e[1].length):void 0},mr="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",Gl=`${mr}%`,V_=`(?:${mr}%|${mr})`,JV=`(?:${mr}(deg|grad|rad|turn)|${mr})`,Da="\\s*,\\s*",QV=new RegExp(`^rgba?\\(\\s*${mr}${Da}${mr}${Da}${mr}\\s*(?:,\\s*${V_}\\s*)?\\)$`),e6=new RegExp(`^rgba?\\(\\s*${Gl}${Da}${Gl}${Da}${Gl}\\s*(?:,\\s*${V_}\\s*)?\\)$`),t6=n=>{let e={mode:"rgb"},t;if(t=n.match(QV))t[1]!==void 0&&(e.r=t[1]/255),t[2]!==void 0&&(e.g=t[2]/255),t[3]!==void 0&&(e.b=t[3]/255);else if(t=n.match(e6))t[1]!==void 0&&(e.r=t[1]/100),t[2]!==void 0&&(e.g=t[2]/100),t[3]!==void 0&&(e.b=t[3]/100);else return;return t[4]!==void 0?e.alpha=Math.max(0,Math.min(1,t[4]/100)):t[5]!==void 0&&(e.alpha=Math.max(0,Math.min(1,+t[5]))),e},n6=(n,e)=>n===void 0?void 0:typeof n!="object"?d6(n):n.mode!==void 0?n:e?{...n,mode:e}:void 0,Yw=(n="rgb")=>e=>(e=n6(e,n))!==void 0?e.mode===n?e:Ji[e.mode][n]?Ji[e.mode][n](e):n==="rgb"?Ji[e.mode].rgb(e):Ji.rgb[n](Ji[e.mode].rgb(e)):void 0,Ji={},jw={},Od=[],Kw={},i6=n=>n,Et=n=>(Ji[n.mode]={...Ji[n.mode],...n.toMode},Object.keys(n.fromMode||{}).forEach(e=>{Ji[e]||(Ji[e]={}),Ji[e][n.mode]=n.fromMode[e]}),n.ranges||(n.ranges={}),n.difference||(n.difference={}),n.channels.forEach(e=>{if(n.ranges[e]===void 0&&(n.ranges[e]=[0,1]),!n.interpolate[e])throw new Error(`Missing interpolator for: ${e}`);typeof n.interpolate[e]=="function"&&(n.interpolate[e]={use:n.interpolate[e]}),n.interpolate[e].fixup||(n.interpolate[e].fixup=i6)}),jw[n.mode]=n,(n.parse||[]).forEach(e=>{r6(e,n.mode)}),Yw(n.mode)),s6=n=>jw[n],r6=(n,e)=>{if(typeof n=="string"){if(!e)throw new Error("'mode' required when 'parser' is a string");Kw[n]=e}else typeof n=="function"&&Od.indexOf(n)<0&&Od.push(n)},Kg=/[^\x00-\x7F]|[a-zA-Z_]/,o6=/[^\x00-\x7F]|[-\w]/,_e={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"};let $e=0;function uf(n){let e=n[$e],t=n[$e+1];return e==="-"||e==="+"?/\d/.test(t)||t==="."&&/\d/.test(n[$e+2]):e==="."?/\d/.test(t):/\d/.test(e)}function Zg(n){if($e>=n.length)return!1;let e=n[$e];if(Kg.test(e))return!0;if(e==="-"){if(n.length-$e<2)return!1;let t=n[$e+1];return!!(t==="-"||Kg.test(t))}return!1}const a6={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function fl(n){let e="";if((n[$e]==="-"||n[$e]==="+")&&(e+=n[$e++]),e+=ff(n),n[$e]==="."&&/\d/.test(n[$e+1])&&(e+=n[$e++]+ff(n)),(n[$e]==="e"||n[$e]==="E")&&((n[$e+1]==="-"||n[$e+1]==="+")&&/\d/.test(n[$e+2])?e+=n[$e++]+n[$e++]+ff(n):/\d/.test(n[$e+1])&&(e+=n[$e++]+ff(n))),Zg(n)){let t=Nd(n);return t==="deg"||t==="rad"||t==="turn"||t==="grad"?{type:_e.Hue,value:e*a6[t]}:void 0}return n[$e]==="%"?($e++,{type:_e.Percentage,value:+e}):{type:_e.Number,value:+e}}function ff(n){let e="";for(;/\d/.test(n[$e]);)e+=n[$e++];return e}function Nd(n){let e="";for(;$e4)){if(t.length===4){if(t[3].type!==_e.Alpha)return;t[3]=t[3].value}return t.length===3&&t.push({type:_e.None,value:void 0}),t.every(s=>s.type!==_e.Alpha)?t:void 0}}function f6(n,e){n._i=0;let t=n[n._i++];if(!t||t.type!==_e.Function)return;let i=Zw(n,e);if(i)return i.unshift(t.value),i}const d6=n=>{if(typeof n!="string")return;const e=c6(n),t=e?f6(e,!0):void 0;let i,s=0,r=Od.length;for(;sn==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,m6=(n,e,t)=>n+t*(e-n),g6=n=>{let e=[];for(let t=0;te=>{let t=g6(e);return i=>{let s=i*t.length,r=i>=1?t.length-1:Math.max(Math.floor(s),0),o=t[r];return o===void 0?void 0:n(o[0],o[1],s-r)}},we=_6(m6),on=n=>{let e=!1,t=n.map(i=>i!==void 0?(e=!0,i):1);return e?t:n},Wa={mode:"rgb",channels:["r","g","b","alpha"],parse:[h6,ZV,t6,jV,p6,"srgb"],serialize:"srgb",interpolate:{r:we,g:we,b:we,alpha:{use:we,fixup:on}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},Em=(n=0)=>Math.pow(Math.abs(n),563/256)*Math.sign(n),Dx=n=>{let e=Em(n.r),t=Em(n.g),i=Em(n.b),s={mode:"xyz65",x:.5766690429101305*e+.1855582379065463*t+.1882286462349947*i,y:.297344975250536*e+.6273635662554661*t+.0752914584939979*i,z:.0270313613864123*e+.0706888525358272*t+.9913375368376386*i};return n.alpha!==void 0&&(s.alpha=n.alpha),s},Tm=n=>Math.pow(Math.abs(n),256/563)*Math.sign(n),Ox=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s={mode:"a98",r:Tm(n*2.0415879038107465-e*.5650069742788597-.3447313507783297*t),g:Tm(n*-.9692436362808798+e*1.8759675015077206+.0415550574071756*t),b:Tm(n*.0134442806320312-e*.1183623922310184+1.0151749943912058*t)};return i!==void 0&&(s.alpha=i),s},wm=(n=0)=>{const e=Math.abs(n);return e<=.04045?n/12.92:(Math.sign(n)||1)*Math.pow((e+.055)/1.055,2.4)},Xa=({r:n,g:e,b:t,alpha:i})=>{let s={mode:"lrgb",r:wm(n),g:wm(e),b:wm(t)};return i!==void 0&&(s.alpha=i),s},Do=n=>{let{r:e,g:t,b:i,alpha:s}=Xa(n),r={mode:"xyz65",x:.4123907992659593*e+.357584339383878*t+.1804807884018343*i,y:.2126390058715102*e+.715168678767756*t+.0721923153607337*i,z:.0193308187155918*e+.119194779794626*t+.9505321522496607*i};return s!==void 0&&(r.alpha=s),r},Am=(n=0)=>{const e=Math.abs(n);return e>.0031308?(Math.sign(n)||1)*(1.055*Math.pow(e,1/2.4)-.055):n*12.92},$a=({r:n,g:e,b:t,alpha:i},s="rgb")=>{let r={mode:s,r:Am(n),g:Am(e),b:Am(t)};return i!==void 0&&(r.alpha=i),r},Oo=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=$a({r:n*3.2409699419045226-e*1.537383177570094-.4986107602930034*t,g:n*-.9692436362808796+e*1.8759675015077204+.0415550574071756*t,b:n*.0556300796969936-e*.2039769588889765+1.0569715142428784*t});return i!==void 0&&(s.alpha=i),s},v6={...Wa,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:n=>Ox(Do(n)),xyz65:Ox},toMode:{rgb:n=>Oo(Dx(n)),xyz65:Dx}},vn=n=>(n=n%360)<0?n+360:n,y6=(n,e)=>n.map((t,i,s)=>{if(t===void 0)return t;let r=vn(t);return i===0||n[i-1]===void 0?r:e(r-vn(s[i-1]))}).reduce((t,i)=>!t.length||i===void 0||t[t.length-1]===void 0?(t.push(i),t):(t.push(i+t[t.length-1]),t),[]),Xs=n=>y6(n,e=>Math.abs(e)<=180?e:e-360*Math.sign(e)),ln=[-.14861,1.78277,-.29227,-.90649,1.97294,0],b6=Math.PI/180,x6=180/Math.PI;let Nx=ln[3]*ln[4],Ux=ln[1]*ln[4],Fx=ln[1]*ln[2]-ln[0]*ln[3];const M6=({r:n,g:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=(Fx*t+n*Nx-e*Ux)/(Fx+Nx-Ux),r=t-s,o=(ln[4]*(e-s)-ln[2]*r)/ln[3],a={mode:"cubehelix",l:s,s:s===0||s===1?void 0:Math.sqrt(r*r+o*o)/(ln[4]*s*(1-s))};return a.s&&(a.h=Math.atan2(o,r)*x6-120),i!==void 0&&(a.alpha=i),a},S6=({h:n,s:e,l:t,alpha:i})=>{let s={mode:"rgb"};n=(n===void 0?0:n+120)*b6,t===void 0&&(t=0);let r=e===void 0?0:e*t*(1-t),o=Math.cos(n),a=Math.sin(n);return s.r=t+r*(ln[0]*o+ln[1]*a),s.g=t+r*(ln[2]*o+ln[3]*a),s.b=t+r*(ln[4]*o+ln[5]*a),i!==void 0&&(s.alpha=i),s},Yh=(n,e)=>{if(n.h===void 0||e.h===void 0||!n.s||!e.s)return 0;let t=vn(n.h),i=vn(e.h),s=Math.sin((i-t+360)/2*Math.PI/180);return 2*Math.sqrt(n.s*e.s)*s},E6=(n,e)=>{if(n.h===void 0||e.h===void 0)return 0;let t=vn(n.h),i=vn(e.h);return Math.abs(i-t)>180?t-(i-360*Math.sign(i-t)):i-t},jh=(n,e)=>{if(n.h===void 0||e.h===void 0||!n.c||!e.c)return 0;let t=vn(n.h),i=vn(e.h),s=Math.sin((i-t+360)/2*Math.PI/180);return 2*Math.sqrt(n.c*e.c)*s},$s=n=>{let e=n.reduce((i,s)=>{if(s!==void 0){let r=s*Math.PI/180;i.sin+=Math.sin(r),i.cos+=Math.cos(r)}return i},{sin:0,cos:0}),t=Math.atan2(e.sin,e.cos)*180/Math.PI;return t<0?360+t:t},T6={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:M6},toMode:{rgb:S6},interpolate:{h:{use:we,fixup:Xs},s:we,l:we,alpha:{use:we,fixup:on}},difference:{h:Yh},average:{h:$s}},Mr=({l:n,a:e,b:t,alpha:i},s="lch")=>{e===void 0&&(e=0),t===void 0&&(t=0);let r=Math.sqrt(e*e+t*t),o={mode:s,l:n,c:r};return r&&(o.h=vn(Math.atan2(t,e)*180/Math.PI)),i!==void 0&&(o.alpha=i),o},Sr=({l:n,c:e,h:t,alpha:i},s="lab")=>{t===void 0&&(t=0);let r={mode:s,l:n,a:e?e*Math.cos(t/180*Math.PI):0,b:e?e*Math.sin(t/180*Math.PI):0};return i!==void 0&&(r.alpha=i),r},Jw=Math.pow(29,3)/Math.pow(3,3),Qw=Math.pow(6,3)/Math.pow(29,3),Jt={X:.3457/.3585,Y:1,Z:(1-.3457-.3585)/.3585},_a={X:.3127/.329,Y:1,Z:(1-.3127-.329)/.329};let Cm=n=>Math.pow(n,3)>Qw?Math.pow(n,3):(116*n-16)/Jw;const eA=({l:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=(n+16)/116,r=e/500+s,o=s-t/200,a={mode:"xyz65",x:Cm(r)*_a.X,y:Cm(s)*_a.Y,z:Cm(o)*_a.Z};return i!==void 0&&(a.alpha=i),a},Kh=n=>Oo(eA(n)),Rm=n=>n>Qw?Math.cbrt(n):(Jw*n+16)/116,tA=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Rm(n/_a.X),r=Rm(e/_a.Y),o=Rm(t/_a.Z),a={mode:"lab65",l:116*r-16,a:500*(s-r),b:200*(r-o)};return i!==void 0&&(a.alpha=i),a},Zh=n=>{let e=tA(Do(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e},Ud=1,nA=1,Sc=26/180*Math.PI,Fd=Math.cos(Sc),kd=Math.sin(Sc),iA=100/Math.log(139/100),Jg=({l:n,c:e,h:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s={mode:"lab65",l:(Math.exp(n*Ud/iA)-1)/.0039},r=(Math.exp(.0435*e*nA*Ud)-1)/.075,o=r*Math.cos(t/180*Math.PI-Sc),a=r*Math.sin(t/180*Math.PI-Sc);return s.a=o*Fd-a/.83*kd,s.b=o*kd+a/.83*Fd,i!==void 0&&(s.alpha=i),s},Qg=({l:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=e*Fd+t*kd,r=.83*(t*Fd-e*kd),o=Math.sqrt(s*s+r*r),a={mode:"dlch",l:iA/Ud*Math.log(1+.0039*n),c:Math.log(1+.075*o)/(.0435*nA*Ud)};return a.c&&(a.h=vn((Math.atan2(r,s)+Sc)/Math.PI*180)),i!==void 0&&(a.alpha=i),a},kx=n=>Jg(Mr(n,"dlch")),Bx=n=>Sr(Qg(n),"dlab"),w6={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:kx,rgb:n=>Kh(kx(n))},fromMode:{lab65:Bx,rgb:n=>Bx(Zh(n))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:we,a:we,b:we,alpha:{use:we,fixup:on}}},A6={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:Jg,dlab:n=>Sr(n,"dlab"),rgb:n=>Kh(Jg(n))},fromMode:{lab65:Qg,dlab:n=>Mr(n,"dlch"),rgb:n=>Qg(Zh(n))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:we,c:we,h:{use:we,fixup:Xs},alpha:{use:we,fixup:on}},difference:{h:jh},average:{h:$s}};function C6({h:n,s:e,i:t,alpha:i}){n=vn(n!==void 0?n:0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.abs(n/60%2-1),r;switch(Math.floor(n/60)){case 0:r={r:t*(1+e*(3/(2-s)-1)),g:t*(1+e*(3*(1-s)/(2-s)-1)),b:t*(1-e)};break;case 1:r={r:t*(1+e*(3*(1-s)/(2-s)-1)),g:t*(1+e*(3/(2-s)-1)),b:t*(1-e)};break;case 2:r={r:t*(1-e),g:t*(1+e*(3/(2-s)-1)),b:t*(1+e*(3*(1-s)/(2-s)-1))};break;case 3:r={r:t*(1-e),g:t*(1+e*(3*(1-s)/(2-s)-1)),b:t*(1+e*(3/(2-s)-1))};break;case 4:r={r:t*(1+e*(3*(1-s)/(2-s)-1)),g:t*(1-e),b:t*(1+e*(3/(2-s)-1))};break;case 5:r={r:t*(1+e*(3/(2-s)-1)),g:t*(1-e),b:t*(1+e*(3*(1-s)/(2-s)-1))};break;default:r={r:t*(1-e),g:t*(1-e),b:t*(1-e)}}return r.mode="rgb",i!==void 0&&(r.alpha=i),r}function R6({r:n,g:e,b:t,alpha:i}){n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.max(n,e,t),r=Math.min(n,e,t),o={mode:"hsi",s:n+e+t===0?0:1-3*r/(n+e+t),i:(n+e+t)/3};return s-r!==0&&(o.h=(s===n?(e-t)/(s-r)+(e{switch(e){case"deg":return+n;case"rad":return n/Math.PI*180;case"grad":return n/10*9;case"turn":return n*360}},O6=new RegExp(`^hsla?\\(\\s*${JV}${Da}${Gl}${Da}${Gl}\\s*(?:,\\s*${V_}\\s*)?\\)$`),N6=n=>{let e=n.match(O6);if(!e)return;let t={mode:"hsl"};return e[3]!==void 0?t.h=+e[3]:e[1]!==void 0&&e[2]!==void 0&&(t.h=D6(e[1],e[2])),e[4]!==void 0&&(t.s=Math.min(Math.max(0,e[4]/100),1)),e[5]!==void 0&&(t.l=Math.min(Math.max(0,e[5]/100),1)),e[6]!==void 0?t.alpha=Math.max(0,Math.min(1,e[6]/100)):e[7]!==void 0&&(t.alpha=Math.max(0,Math.min(1,+e[7]))),t};function U6(n,e){if(!e||e[0]!=="hsl"&&e[0]!=="hsla")return;const t={mode:"hsl"},[,i,s,r,o]=e;if(i.type!==_e.None){if(i.type===_e.Percentage)return;t.h=i.value}if(s.type!==_e.None){if(s.type===_e.Hue)return;t.s=s.value/100}if(r.type!==_e.None){if(r.type===_e.Hue)return;t.l=r.value/100}return o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const sA={mode:"hsl",toMode:{rgb:I6},fromMode:{rgb:L6},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[U6,N6],serialize:n=>`hsl(${n.h!==void 0?n.h:"none"} ${n.s!==void 0?n.s*100+"%":"none"} ${n.l!==void 0?n.l*100+"%":"none"}${n.alpha<1?` / ${n.alpha}`:""})`,interpolate:{h:{use:we,fixup:Xs},s:we,l:we,alpha:{use:we,fixup:on}},difference:{h:Yh},average:{h:$s}};function rA({h:n,s:e,v:t,alpha:i}){n=vn(n!==void 0?n:0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.abs(n/60%2-1),r;switch(Math.floor(n/60)){case 0:r={r:t,g:t*(1-e*s),b:t*(1-e)};break;case 1:r={r:t*(1-e*s),g:t,b:t*(1-e)};break;case 2:r={r:t*(1-e),g:t,b:t*(1-e*s)};break;case 3:r={r:t*(1-e),g:t*(1-e*s),b:t};break;case 4:r={r:t*(1-e*s),g:t*(1-e),b:t};break;case 5:r={r:t,g:t*(1-e),b:t*(1-e*s)};break;default:r={r:t*(1-e),g:t*(1-e),b:t*(1-e)}}return r.mode="rgb",i!==void 0&&(r.alpha=i),r}function oA({r:n,g:e,b:t,alpha:i}){n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.max(n,e,t),r=Math.min(n,e,t),o={mode:"hsv",s:s===0?0:1-r/s,v:s};return s-r!==0&&(o.h=(s===n?(e-t)/(s-r)+(e1){let s=e+t;e/=s,t/=s}return rA({h:n,s:t===1?1:1-e/(1-t),v:1-t,alpha:i})}function k6(n){let e=oA(n);if(e===void 0)return;let t=e.s!==void 0?e.s:0,i=e.v!==void 0?e.v:0,s={mode:"hwb",w:(1-t)*i,b:1-i};return e.h!==void 0&&(s.h=e.h),e.alpha!==void 0&&(s.alpha=e.alpha),s}function B6(n,e){if(!e||e[0]!=="hwb")return;const t={mode:"hwb"},[,i,s,r,o]=e;if(i.type!==_e.None){if(i.type===_e.Percentage)return;t.h=i.value}if(s.type!==_e.None){if(s.type===_e.Hue)return;t.w=s.value/100}if(r.type!==_e.None){if(r.type===_e.Hue)return;t.b=r.value/100}return o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const z6={mode:"hwb",toMode:{rgb:F6},fromMode:{rgb:k6},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[B6],serialize:n=>`hwb(${n.h!==void 0?n.h:"none"} ${n.w!==void 0?n.w*100+"%":"none"} ${n.b!==void 0?n.b*100+"%":"none"}${n.alpha<1?` / ${n.alpha}`:""})`,interpolate:{h:{use:we,fixup:Xs},w:we,b:we,alpha:{use:we,fixup:on}},difference:{h:E6},average:{h:$s}},lA=203,Jh=.1593017578125,cA=78.84375,Qh=.8359375,ep=18.8515625,tp=18.6875;function Pm(n){if(n<0)return 0;const e=Math.pow(n,1/cA);return 1e4*Math.pow(Math.max(0,e-Qh)/(ep-tp*e),1/Jh)}function Im(n){if(n<0)return 0;const e=Math.pow(n/1e4,Jh);return Math.pow((Qh+ep*e)/(1+tp*e),cA)}const Lm=n=>Math.max(n/lA,0),zx=({i:n,t:e,p:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);const s=Pm(n+.008609037037932761*e+.11102962500302593*t),r=Pm(n-.00860903703793275*e-.11102962500302599*t),o=Pm(n+.5600313357106791*e-.32062717498731885*t),a={mode:"xyz65",x:Lm(2.070152218389422*s-1.3263473389671556*r+.2066510476294051*o),y:Lm(.3647385209748074*s+.680566024947227*r-.0453045459220346*o),z:Lm(-.049747207535812*s-.0492609666966138*r+1.1880659249923042*o)};return i!==void 0&&(a.alpha=i),a},Dm=(n=0)=>Math.max(n*lA,0),Vx=({x:n,y:e,z:t,alpha:i})=>{const s=Dm(n),r=Dm(e),o=Dm(t),a=Im(.3592832590121217*s+.6976051147779502*r-.0358915932320289*o),l=Im(-.1920808463704995*s+1.1004767970374323*r+.0753748658519118*o),c=Im(.0070797844607477*s+.0748396662186366*r+.8433265453898765*o),u=.5*a+.5*l,f=1.61376953125*a-3.323486328125*l+1.709716796875*c,d=4.378173828125*a-4.24560546875*l-.132568359375*c,h={mode:"itp",i:u,t:f,p:d};return i!==void 0&&(h.alpha=i),h},V6={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:zx,rgb:n=>Oo(zx(n))},fromMode:{xyz65:Vx,rgb:n=>Vx(Do(n))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:we,t:we,p:we,alpha:{use:we,fixup:on}}},H6=134.03437499999998,G6=16295499532821565e-27,Om=n=>{if(n<0)return 0;let e=Math.pow(n/1e4,Jh);return Math.pow((Qh+ep*e)/(1+tp*e),H6)},Nm=(n=0)=>Math.max(n*203,0),uA=({x:n,y:e,z:t,alpha:i})=>{n=Nm(n),e=Nm(e),t=Nm(t);let s=1.15*n-.15*t,r=.66*e+.34*n,o=Om(.41478972*s+.579999*r+.014648*t),a=Om(-.20151*s+1.120649*r+.0531008*t),l=Om(-.0166008*s+.2648*r+.6684799*t),c=(o+a)/2,u={mode:"jab",j:.44*c/(1-.56*c)-G6,a:3.524*o-4.066708*a+.542708*l,b:.199076*o+1.096799*a-1.295875*l};return i!==void 0&&(u.alpha=i),u},W6=134.03437499999998,Hx=16295499532821565e-27,Um=n=>{if(n<0)return 0;let e=Math.pow(n,1/W6);return 1e4*Math.pow((Qh-e)/(tp*e-ep),1/Jh)},Fm=n=>n/203,fA=({j:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=(n+Hx)/(.44+.56*(n+Hx)),r=Um(s+.13860504*e+.058047316*t),o=Um(s-.13860504*e-.058047316*t),a=Um(s-.096019242*e-.8118919*t),l={mode:"xyz65",x:Fm(1.661373024652174*r-.914523081304348*o+.23136208173913045*a),y:Fm(-.3250758611844533*r+1.571847026732543*o-.21825383453227928*a),z:Fm(-.090982811*r-.31272829*o+1.5227666*a)};return i!==void 0&&(l.alpha=i),l},dA=n=>{let e=uA(Do(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e},hA=n=>Oo(fA(n)),X6={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:dA,xyz65:uA},toMode:{rgb:hA,xyz65:fA},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:we,a:we,b:we,alpha:{use:we,fixup:on}}},Gx=({j:n,a:e,b:t,alpha:i})=>{e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.sqrt(e*e+t*t),r={mode:"jch",j:n,c:s};return s&&(r.h=vn(Math.atan2(t,e)*180/Math.PI)),i!==void 0&&(r.alpha=i),r},Wx=({j:n,c:e,h:t,alpha:i})=>{t===void 0&&(t=0);let s={mode:"jab",j:n,a:e?e*Math.cos(t/180*Math.PI):0,b:e?e*Math.sin(t/180*Math.PI):0};return i!==void 0&&(s.alpha=i),s},$6={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:Wx,rgb:n=>hA(Wx(n))},fromMode:{rgb:n=>Gx(dA(n)),jab:Gx},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:we,fixup:Xs},c:we,j:we,alpha:{use:we,fixup:on}},difference:{h:jh},average:{h:$s}},np=Math.pow(29,3)/Math.pow(3,3),H_=Math.pow(6,3)/Math.pow(29,3);let km=n=>Math.pow(n,3)>H_?Math.pow(n,3):(116*n-16)/np;const G_=({l:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=(n+16)/116,r=e/500+s,o=s-t/200,a={mode:"xyz50",x:km(r)*Jt.X,y:km(s)*Jt.Y,z:km(o)*Jt.Z};return i!==void 0&&(a.alpha=i),a},Zc=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=$a({r:n*3.1341359569958707-e*1.6173863321612538-.4906619460083532*t,g:n*-.978795502912089+e*1.916254567259524+.03344273116131949*t,b:n*.07195537988411677-e*.2289768264158322+1.405386058324125*t});return i!==void 0&&(s.alpha=i),s},pA=n=>Zc(G_(n)),Jc=n=>{let{r:e,g:t,b:i,alpha:s}=Xa(n),r={mode:"xyz50",x:.436065742824811*e+.3851514688337912*t+.14307845442264197*i,y:.22249319175623702*e+.7168870538238823*t+.06061979053616537*i,z:.013923904500943465*e+.09708128566574634*t+.7140993584005155*i};return s!==void 0&&(r.alpha=s),r},Bm=n=>n>H_?Math.cbrt(n):(np*n+16)/116,W_=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Bm(n/Jt.X),r=Bm(e/Jt.Y),o=Bm(t/Jt.Z),a={mode:"lab",l:116*r-16,a:500*(s-r),b:200*(r-o)};return i!==void 0&&(a.alpha=i),a},mA=n=>{let e=W_(Jc(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e};function q6(n,e){if(!e||e[0]!=="lab")return;const t={mode:"lab"},[,i,s,r,o]=e;if(!(i.type===_e.Hue||s.type===_e.Hue||r.type===_e.Hue))return i.type!==_e.None&&(t.l=Math.min(Math.max(0,i.value),100)),s.type!==_e.None&&(t.a=s.type===_e.Number?s.value:s.value*125/100),r.type!==_e.None&&(t.b=r.type===_e.Number?r.value:r.value*125/100),o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const X_={mode:"lab",toMode:{xyz50:G_,rgb:pA},fromMode:{xyz50:W_,rgb:mA},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-100,100],b:[-100,100]},parse:[q6],serialize:n=>`lab(${n.l!==void 0?n.l:"none"} ${n.a!==void 0?n.a:"none"} ${n.b!==void 0?n.b:"none"}${n.alpha<1?` / ${n.alpha}`:""})`,interpolate:{l:we,a:we,b:we,alpha:{use:we,fixup:on}}},Y6={...X_,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:eA,rgb:Kh},fromMode:{xyz65:tA,rgb:Zh},ranges:{l:[0,100],a:[-86.182,98.234],b:[-107.86,94.477]}};function j6(n,e){if(!e||e[0]!=="lch")return;const t={mode:"lch"},[,i,s,r,o]=e;if(i.type!==_e.None){if(i.type===_e.Hue)return;t.l=Math.min(Math.max(0,i.value),100)}if(s.type!==_e.None&&(t.c=Math.max(0,s.type===_e.Number?s.value:s.value*150/100)),r.type!==_e.None){if(r.type===_e.Percentage)return;t.h=r.value}return o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const $_={mode:"lch",toMode:{lab:Sr,rgb:n=>pA(Sr(n))},fromMode:{rgb:n=>Mr(mA(n)),lab:Mr},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[j6],serialize:n=>`lch(${n.l!==void 0?n.l:"none"} ${n.c!==void 0?n.c:"none"} ${n.h!==void 0?n.h:"none"}${n.alpha<1?` / ${n.alpha}`:""})`,interpolate:{h:{use:we,fixup:Xs},c:we,l:we,alpha:{use:we,fixup:on}},difference:{h:jh},average:{h:$s}},K6={...$_,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:n=>Sr(n,"lab65"),rgb:n=>Kh(Sr(n,"lab65"))},fromMode:{rgb:n=>Mr(Zh(n),"lch65"),lab65:n=>Mr(n,"lch65")},ranges:{l:[0,100],c:[0,133.807],h:[0,360]}},gA=({l:n,u:e,v:t,alpha:i})=>{e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.sqrt(e*e+t*t),r={mode:"lchuv",l:n,c:s};return s&&(r.h=vn(Math.atan2(t,e)*180/Math.PI)),i!==void 0&&(r.alpha=i),r},_A=({l:n,c:e,h:t,alpha:i})=>{t===void 0&&(t=0);let s={mode:"luv",l:n,u:e?e*Math.cos(t/180*Math.PI):0,v:e?e*Math.sin(t/180*Math.PI):0};return i!==void 0&&(s.alpha=i),s},vA=(n,e,t)=>4*n/(n+15*e+3*t),yA=(n,e,t)=>9*e/(n+15*e+3*t),Z6=vA(Jt.X,Jt.Y,Jt.Z),J6=yA(Jt.X,Jt.Y,Jt.Z),Q6=n=>n<=H_?np*n:116*Math.cbrt(n)-16,e0=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Q6(e/Jt.Y),r=vA(n,e,t),o=yA(n,e,t);!isFinite(r)||!isFinite(o)?s=r=o=0:(r=13*s*(r-Z6),o=13*s*(o-J6));let a={mode:"luv",l:s,u:r,v:o};return i!==void 0&&(a.alpha=i),a},eH=(n,e,t)=>4*n/(n+15*e+3*t),tH=(n,e,t)=>9*e/(n+15*e+3*t),nH=eH(Jt.X,Jt.Y,Jt.Z),iH=tH(Jt.X,Jt.Y,Jt.Z),t0=({l:n,u:e,v:t,alpha:i})=>{if(n===void 0&&(n=0),n===0)return{mode:"xyz50",x:0,y:0,z:0};e===void 0&&(e=0),t===void 0&&(t=0);let s=e/(13*n)+nH,r=t/(13*n)+iH,o=Jt.Y*(n<=8?n/np:Math.pow((n+16)/116,3)),a=o*(9*s)/(4*r),l=o*(12-3*s-20*r)/(4*r),c={mode:"xyz50",x:a,y:o,z:l};return i!==void 0&&(c.alpha=i),c},sH=n=>gA(e0(Jc(n))),rH=n=>Zc(t0(_A(n))),oH={mode:"lchuv",toMode:{luv:_A,rgb:rH},fromMode:{rgb:sH,luv:gA},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:we,fixup:Xs},c:we,l:we,alpha:{use:we,fixup:on}},difference:{h:jh},average:{h:$s}},aH={...Wa,mode:"lrgb",toMode:{rgb:$a},fromMode:{rgb:Xa},parse:["srgb-linear"],serialize:"srgb-linear"},lH={mode:"luv",toMode:{xyz50:t0,rgb:n=>Zc(t0(n))},fromMode:{xyz50:e0,rgb:n=>e0(Jc(n))},channels:["l","u","v","alpha"],parse:["--luv"],serialize:"--luv",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:we,u:we,v:we,alpha:{use:we,fixup:on}}},bA=({r:n,g:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.cbrt(.41222147079999993*n+.5363325363*e+.0514459929*t),r=Math.cbrt(.2119034981999999*n+.6806995450999999*e+.1073969566*t),o=Math.cbrt(.08830246189999998*n+.2817188376*e+.6299787005000002*t),a={mode:"oklab",l:.2104542553*s+.793617785*r-.0040720468*o,a:1.9779984951*s-2.428592205*r+.4505937099*o,b:.0259040371*s+.7827717662*r-.808675766*o};return i!==void 0&&(a.alpha=i),a},ip=n=>{let e=bA(Xa(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e},Qc=({l:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.pow(n*.9999999984505198+.39633779217376786*e+.2158037580607588*t,3),r=Math.pow(n*1.0000000088817609-.10556134232365635*e-.06385417477170591*t,3),o=Math.pow(n*1.0000000546724108-.08948418209496575*e-1.2914855378640917*t,3),a={mode:"lrgb",r:4.076741661347994*s-3.307711590408193*r+.230969928729428*o,g:-1.2684380040921763*s+2.6097574006633715*r-.3413193963102197*o,b:-.004196086541837188*s-.7034186144594493*r+1.7076147009309444*o};return i!==void 0&&(a.alpha=i),a},sp=n=>$a(Qc(n));function n0(n){const i=1.170873786407767;return .5*(i*n-.206+Math.sqrt((i*n-.206)*(i*n-.206)+4*.03*i*n))}function Bd(n){return(n*n+.206*n)/(1.170873786407767*(n+.03))}function cH(n,e){let t,i,s,r,o,a,l,c;-1.88170328*n-.80936493*e>1?(t=1.19086277,i=1.76576728,s=.59662641,r=.75515197,o=.56771245,a=4.0767416621,l=-3.3077115913,c=.2309699292):1.81444104*n-1.19445276*e>1?(t=.73956515,i=-.45954404,s=.08285427,r=.1254107,o=.14503204,a=-1.2684380046,l=2.6097574011,c=-.3413193965):(t=1.35733652,i=-.00915799,s=-1.1513021,r=-.50559606,o=.00692167,a=-.0041960863,l=-.7034186147,c=1.707614701);let u=t+i*n+s*e+r*n*n+o*n*e,f=.3963377774*n+.2158037573*e,d=-.1055613458*n-.0638541728*e,h=-.0894841775*n-1.291485548*e;{let p=1+u*f,_=1+u*d,g=1+u*h,m=p*p*p,y=_*_*_,b=g*g*g,v=3*f*p*p,E=3*d*_*_,T=3*h*g*g,S=6*f*f*p,P=6*d*d*_,x=6*h*h*g,M=a*m+l*y+c*b,I=a*v+l*E+c*T,N=a*S+l*P+c*x;u=u-M*I/(I*I-.5*M*N)}return u}function q_(n,e){let t=cH(n,e),i=Qc({l:1,a:t*n,b:t*e}),s=Math.cbrt(1/Math.max(i.r,i.g,i.b)),r=s*t;return[s,r]}function uH(n,e,t,i,s,r=null){r||(r=q_(n,e));let o;if((t-s)*r[1]-(r[0]-s)*i<=0)o=r[1]*s/(i*r[0]+r[1]*(s-t));else{o=r[1]*(s-1)/(i*(r[0]-1)+r[1]*(s-t));{let a=t-s,l=i,c=.3963377774*n+.2158037573*e,u=-.1055613458*n-.0638541728*e,f=-.0894841775*n-1.291485548*e,d=a+l*c,h=a+l*u,p=a+l*f;{let _=s*(1-o)+o*t,g=o*i,m=_+g*c,y=_+g*u,b=_+g*f,v=m*m*m,E=y*y*y,T=b*b*b,S=3*d*m*m,P=3*h*y*y,x=3*p*b*b,M=6*d*d*m,I=6*h*h*y,N=6*p*p*b,V=4.0767416621*v-3.3077115913*E+.2309699292*T-1,j=4.0767416621*S-3.3077115913*P+.2309699292*x,te=4.0767416621*M-3.3077115913*I+.2309699292*N,Z=j/(j*j-.5*V*te),ee=-V*Z,J=-1.2684380046*v+2.6097574011*E-.3413193965*T-1,he=-1.2684380046*S+2.6097574011*P-.3413193965*x,be=-1.2684380046*M+2.6097574011*I-.3413193965*N,se=he/(he*he-.5*J*be),ye=-J*se,Be=-.0041960863*v-.7034186147*E+1.707614701*T-1,re=-.0041960863*S-.7034186147*P+1.707614701*x,ge=-.0041960863*M-.7034186147*I+1.707614701*N,xe=re/(re*re-.5*Be*ge),$=-Be*xe;ee=Z>=0?ee:1e6,ye=se>=0?ye:1e6,$=xe>=0?$:1e6,o+=Math.min(ee,Math.min(ye,$))}}}return o}function Y_(n,e,t=null){t||(t=q_(n,e));let i=t[0],s=t[1];return[s/i,s/(1-i)]}function xA(n,e,t){let i=q_(e,t),s=uH(e,t,n,1,n,i),r=Y_(e,t,i),o=.11516993+1/(7.4477897+4.1590124*t+e*(-2.19557347+1.75198401*t+e*(-2.13704948-10.02301043*t+e*(-4.24894561+5.38770819*t+4.69891013*e)))),a=.11239642+1/(1.6132032-.68124379*t+e*(.40370612+.90148123*t+e*(-.27087943+.6122399*t+e*(.00299215-.45399568*t-.14661872*e)))),l=s/Math.min(n*r[0],(1-n)*r[1]),c=n*o,u=(1-n)*a,f=.9*l*Math.sqrt(Math.sqrt(1/(1/(c*c*c*c)+1/(u*u*u*u))));return c=n*.4,u=(1-n)*.8,[Math.sqrt(1/(1/(c*c)+1/(u*u))),f,s]}function Xx(n){const e=n.l!==void 0?n.l:0,t=n.a!==void 0?n.a:0,i=n.b!==void 0?n.b:0,s={mode:"okhsl",l:n0(e)};n.alpha!==void 0&&(s.alpha=n.alpha);let r=Math.sqrt(t*t+i*i);if(!r)return s.s=0,s;let[o,a,l]=xA(e,t/r,i/r),c;if(rXx(ip(n))},toMode:{oklab:$x,rgb:n=>sp($x(n))}};function qx(n){let e=n.l!==void 0?n.l:0,t=n.a!==void 0?n.a:0,i=n.b!==void 0?n.b:0,s=Math.sqrt(t*t+i*i),r=s?t/s:1,o=s?i/s:1,[a,l]=Y_(r,o),c=.5,u=1-c/a,f=l/(s+e*l),d=f*e,h=f*s,p=Bd(d),_=h*p/d,g=Qc({l:p,a:r*_,b:o*_}),m=Math.cbrt(1/Math.max(g.r,g.g,g.b,0));e=e/m,s=s/m*n0(e)/e,e=n0(e);const y={mode:"okhsv",s:s?(c+l)*h/(l*c+l*u*h):0,v:e?e/d:0};return y.s&&(y.h=vn(Math.atan2(i,t)*180/Math.PI)),n.alpha!==void 0&&(y.alpha=n.alpha),y}function Yx(n){const e={mode:"oklab"};n.alpha!==void 0&&(e.alpha=n.alpha);const t=n.h!==void 0?n.h:0,i=n.s!==void 0?n.s:0,s=n.v!==void 0?n.v:0,r=Math.cos(t/180*Math.PI),o=Math.sin(t/180*Math.PI),[a,l]=Y_(r,o),c=.5,u=1-c/a,f=1-i*c/(c+l-l*u*i),d=i*l*c/(c+l-l*u*i),h=Bd(f),p=d*h/f,_=Qc({l:h,a:r*p,b:o*p}),g=Math.cbrt(1/Math.max(_.r,_.g,_.b,0)),m=Bd(s*f),y=d*m/f;return e.l=m*g,e.a=y*r*g,e.b=y*o*g,e}const dH={...aA,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:qx,rgb:n=>qx(ip(n))},toMode:{oklab:Yx,rgb:n=>sp(Yx(n))}};function hH(n,e){if(!e||e[0]!=="oklab")return;const t={mode:"oklab"},[,i,s,r,o]=e;if(!(i.type===_e.Hue||s.type===_e.Hue||r.type===_e.Hue))return i.type!==_e.None&&(t.l=Math.min(Math.max(0,i.type===_e.Number?i.value:i.value/100),1)),s.type!==_e.None&&(t.a=s.type===_e.Number?s.value:s.value*.4/100),r.type!==_e.None&&(t.b=r.type===_e.Number?r.value:r.value*.4/100),o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const pH={...X_,mode:"oklab",toMode:{lrgb:Qc,rgb:sp},fromMode:{lrgb:bA,rgb:ip},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[hH],serialize:n=>`oklab(${n.l!==void 0?n.l:"none"} ${n.a!==void 0?n.a:"none"} ${n.b!==void 0?n.b:"none"}${n.alpha<1?` / ${n.alpha}`:""})`};function mH(n,e){if(!e||e[0]!=="oklch")return;const t={mode:"oklch"},[,i,s,r,o]=e;if(i.type!==_e.None){if(i.type===_e.Hue)return;t.l=Math.min(Math.max(0,i.type===_e.Number?i.value:i.value/100),1)}if(s.type!==_e.None&&(t.c=Math.max(0,s.type===_e.Number?s.value:s.value*.4/100)),r.type!==_e.None){if(r.type===_e.Percentage)return;t.h=r.value}return o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const gH={...$_,mode:"oklch",toMode:{oklab:n=>Sr(n,"oklab"),rgb:n=>sp(Sr(n,"oklab"))},fromMode:{rgb:n=>Mr(ip(n),"oklch"),oklab:n=>Mr(n,"oklch")},parse:[mH],serialize:n=>`oklch(${n.l!==void 0?n.l:"none"} ${n.c!==void 0?n.c:"none"} ${n.h!==void 0?n.h:"none"}${n.alpha<1?` / ${n.alpha}`:""})`,ranges:{l:[0,1],c:[0,.4],h:[0,360]}},jx=n=>{let{r:e,g:t,b:i,alpha:s}=Xa(n),r={mode:"xyz65",x:.486570948648216*e+.265667693169093*t+.1982172852343625*i,y:.2289745640697487*e+.6917385218365062*t+.079286914093745*i,z:0*e+.0451133818589026*t+1.043944368900976*i};return s!==void 0&&(r.alpha=s),r},Kx=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=$a({r:n*2.4934969119414263-e*.9313836179191242-.402710784450717*t,g:n*-.8294889695615749+e*1.7626640603183465+.0236246858419436*t,b:n*.0358458302437845-e*.0761723892680418+.9568845240076871*t},"p3");return i!==void 0&&(s.alpha=i),s},_H={...Wa,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:n=>Kx(Do(n)),xyz65:Kx},toMode:{rgb:n=>Oo(jx(n)),xyz65:jx}},zm=n=>{let e=Math.abs(n);return e>=1/512?Math.sign(n)*Math.pow(e,1/1.8):16*n},Zx=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s={mode:"prophoto",r:zm(n*1.3457868816471585-e*.2555720873797946-.0511018649755453*t),g:zm(n*-.5446307051249019+e*1.5082477428451466+.0205274474364214*t),b:zm(n*0+e*0+1.2119675456389452*t)};return i!==void 0&&(s.alpha=i),s},Vm=(n=0)=>{let e=Math.abs(n);return e>=16/512?Math.sign(n)*Math.pow(e,1.8):n/16},Jx=n=>{let e=Vm(n.r),t=Vm(n.g),i=Vm(n.b),s={mode:"xyz50",x:.7977666449006423*e+.1351812974005331*t+.0313477341283922*i,y:.2880748288194013*e+.7118352342418731*t+899369387256e-16*i,z:0*e+0*t+.8251046025104602*i};return n.alpha!==void 0&&(s.alpha=n.alpha),s},vH={...Wa,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:Zx,rgb:n=>Zx(Jc(n))},toMode:{xyz50:Jx,rgb:n=>Zc(Jx(n))}},Qx=1.09929682680944,yH=.018053968510807,Hm=n=>{const e=Math.abs(n);return e>yH?(Math.sign(n)||1)*(Qx*Math.pow(e,.45)-(Qx-1)):4.5*n},eM=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s={mode:"rec2020",r:Hm(n*1.7166511879712683-e*.3556707837763925-.2533662813736599*t),g:Hm(n*-.6666843518324893+e*1.6164812366349395+.0157685458139111*t),b:Hm(n*.0176398574453108-e*.0427706132578085+.9421031212354739*t)};return i!==void 0&&(s.alpha=i),s},tM=1.09929682680944,bH=.018053968510807,Gm=(n=0)=>{let e=Math.abs(n);return e{let e=Gm(n.r),t=Gm(n.g),i=Gm(n.b),s={mode:"xyz65",x:.6369580483012911*e+.1446169035862083*t+.1688809751641721*i,y:.262700212011267*e+.6779980715188708*t+.059301716469862*i,z:0*e+.0280726930490874*t+1.0609850577107909*i};return n.alpha!==void 0&&(s.alpha=n.alpha),s},xH={...Wa,mode:"rec2020",fromMode:{xyz65:eM,rgb:n=>eM(Do(n))},toMode:{xyz65:nM,rgb:n=>Oo(nM(n))},parse:["rec2020"],serialize:"rec2020"},yo=.0037930732552754493,MA=Math.cbrt(yo),Wm=n=>Math.cbrt(n)-MA,MH=n=>{const{r:e,g:t,b:i,alpha:s}=Xa(n),r=Wm(.3*e+.622*t+.078*i+yo),o=Wm(.23*e+.692*t+.078*i+yo),a=Wm(.2434226892454782*e+.2047674442449682*t+.5518098665095535*i+yo),l={mode:"xyb",x:(r-o)/2,y:(r+o)/2,b:a-(r+o)/2};return s!==void 0&&(l.alpha=s),l},Xm=n=>Math.pow(n+MA,3),SH=({x:n,y:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);const s=Xm(n+e)-yo,r=Xm(e-n)-yo,o=Xm(t+e)-yo,a=$a({r:11.031566904639861*s-9.866943908131562*r-.16462299650829934*o,g:-3.2541473810744237*s+4.418770377582723*r-.16462299650829934*o,b:-3.6588512867136815*s+2.7129230459360922*r+1.9459282407775895*o});return i!==void 0&&(a.alpha=i),a},EH={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:SH},fromMode:{rgb:MH},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:we,y:we,b:we,alpha:{use:we,fixup:on}}},TH={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:Zc,lab:W_},fromMode:{rgb:Jc,lab:G_},channels:["x","y","z","alpha"],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:we,y:we,z:we,alpha:{use:we,fixup:on}}},wH=n=>{let{x:e,y:t,z:i,alpha:s}=n;e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0);let r={mode:"xyz50",x:1.0479298208405488*e+.0229467933410191*t-.0501922295431356*i,y:.0296278156881593*e+.990434484573249*t-.0170738250293851*i,z:-.0092430581525912*e+.0150551448965779*t+.7518742899580008*i};return s!==void 0&&(r.alpha=s),r},AH=n=>{let{x:e,y:t,z:i,alpha:s}=n;e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0);let r={mode:"xyz65",x:.9554734527042182*e-.0230985368742614*t+.0632593086610217*i,y:-.0283697069632081*e+1.0099954580058226*t+.021041398966943*i,z:.0123140016883199*e-.0205076964334779*t+1.3303659366080753*i};return s!==void 0&&(r.alpha=s),r},CH={mode:"xyz65",toMode:{rgb:Oo,xyz50:wH},fromMode:{rgb:Do,xyz50:AH},ranges:{x:[0,.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parse:["xyz","xyz-d65"],serialize:"xyz-d65",interpolate:{x:we,y:we,z:we,alpha:{use:we,fixup:on}}},RH=({r:n,g:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);const s={mode:"yiq",y:.29889531*n+.58662247*e+.11448223*t,i:.59597799*n-.2741761*e-.32180189*t,q:.21147017*n-.52261711*e+.31114694*t};return i!==void 0&&(s.alpha=i),s},PH=({y:n,i:e,q:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);const s={mode:"rgb",r:n+.95608445*e+.6208885*t,g:n-.27137664*e-.6486059*t,b:n-1.10561724*e+1.70250126*t};return i!==void 0&&(s.alpha=i),s},IH={mode:"yiq",toMode:{rgb:PH},fromMode:{rgb:RH},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:we,i:we,q:we,alpha:{use:we,fixup:on}}};Et(v6);Et(T6);Et(w6);Et(A6);Et(P6);Et(sA);Et(aA);Et(z6);Et(V6);Et(X6);Et($6);Et(X_);Et(Y6);Et($_);Et(K6);Et(oH);Et(aH);Et(lH);Et(fH);Et(dH);Et(pH);Et(gH);Et(_H);Et(vH);Et(xH);Et(Wa);Et(EH);Et(TH);Et(CH);Et(IH);const i0=220.44,LH=Yw("oklch"),iM=n=>{var e;return n?(e=LH(n))==null?void 0:e.h:i0},DH=zz("settings",()=>{const n=et(),e=vs("settings/language","en-US"),t=vs("settings/stage/view/model-renderer","2d"),i=vs("settings/audio/input","false"),s=Me(()=>{var T;return(T=n.value)==null?void 0:T.deviceId}),{audioInputs:r,ensurePermissions:o}=WB({constraints:{audio:!0}}),a=et(),l=et("/assets/live2d/models/hiyori_pro_zh.zip"),c=et("url"),u=et(!1),f=vs("settings/live2d/position",{x:0,y:0}),d=et({group:"Idle",index:0}),h=et([]),p=vs("settings/live2d/motion-map",{}),_=vs("settings/disable-transitions",!0),g=vs("settings/use-page-specific-transitions",!0),m=vs("settings/theme/colors/hue",i0),y=vs("settings/theme/colors/hue-dynamic",!1);function b(T=i0){m.value=T,y.value=!1}function v(T){b(iM(T))}function E(T){if(y.value)return!1;const S=iM(T);if(!S)return!1;const P=Math.abs(S-m.value);return P<.01||P>359.99}return Xe(i,T=>{T==="false"&&(n.value=void 0),T==="true"&&o().then(()=>{n.value=r.value[0]})}),Xe(r,()=>{i.value==="true"&&!n.value&&(n.value=r.value[0])},{immediate:!0}),{live2dModelFile:a,live2dModelUrl:l,live2dLoadSource:c,live2dCurrentMotion:d,live2dPosition:f,availableLive2dMotions:h,live2dMotionMap:p,loadingLive2dModel:u,disableTransitions:_,usePageSpecificTransitions:g,language:e,stageView:t,themeColorsHue:m,themeColorsHueDynamic:y,isAudioInputOn:i,selectedAudioDevice:n,selectedAudioDeviceId:s,setThemeColorsHue:b,applyPrimaryColorFrom:v,isColorSelectedForPrimary:E}}),OH=fn({__name:"ArrowTransition",props:{stageTransition:{default:()=>({primaryColor:"#666",secondaryColor:"#ccc"})}},setup(n){const e=n,t=Me(()=>e.stageTransition),i=Me(()=>t.value.primaryColor||"#666"),s=Me(()=>t.value.secondaryColor||"#ccc");return Hn(()=>{document.documentElement.style.setProperty("--stage-transition-3-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-3-overlay-color-2",s.value)}),(r,o)=>(mn(),yi("div",{class:"stage-transition-3",style:Si({zIndex:t.value.zIndex||100})},null,4))}}),No=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t},NH=No(OH,[["__scopeId","data-v-df576df0"]]),UH=fn({__name:"BubbleWaveOutTransition",props:{stageTransition:null},setup(n){const e=n,t=Me(()=>{var i;return((i=e.stageTransition)==null?void 0:i.colors)||["#eee","#ebcb8b","#c56370","#3f3b52"]});return Hn(()=>{var i,s;document.documentElement.style.setProperty("--circle-expansion-delay",`${((i=e.stageTransition)==null?void 0:i.delay)||0}s`),document.documentElement.style.setProperty("--circle-expansion-duration",`${((s=e.stageTransition)==null?void 0:s.duration)||.4}s`),t.value.forEach((r,o)=>{document.documentElement.style.setProperty(`--circle-expansion-color-${o+1}`,r)})}),(i,s)=>{var r;return mn(),yi("div",{class:"circle-expansion-transition",style:Si({zIndex:((r=n.stageTransition)==null?void 0:r.zIndex)||100})},[(mn(!0),yi(jt,null,d2(t.value,(o,a)=>(mn(),yi("div",{key:a}))),128))],4)}}}),FH=No(UH,[["__scopeId","data-v-0c29056c"]]),kH=fn({__name:"FantasyFallTransition",props:{stageTransition:null},setup(n){const e=n,t=Me(()=>{var s;return((s=e.stageTransition)==null?void 0:s.direction)||"up"}),i=Me(()=>`fantasy-fall-${t.value}`);return Hn(()=>{var s,r,o,a,l,c,u,f,d;document.documentElement.style.setProperty("--fantasy-fall-color",((s=e.stageTransition)==null?void 0:s.primaryColor)||"#eee"),document.documentElement.style.setProperty("--fantasy-fall-duration",`${((r=e.stageTransition)==null?void 0:r.duration)||.6}s`),document.documentElement.style.setProperty("--fantasy-fall-delay",`${((o=e.stageTransition)==null?void 0:o.delay)||0}s`),document.documentElement.style.setProperty("--fantasy-fall-radius-sm",`${((l=(a=e.stageTransition)==null?void 0:a.borderRadius)==null?void 0:l.sm)||"14rem"}`),document.documentElement.style.setProperty("--fantasy-fall-radius-md",`${((u=(c=e.stageTransition)==null?void 0:c.borderRadius)==null?void 0:u.md)||"14rem"}`),document.documentElement.style.setProperty("--fantasy-fall-radius-lg",`${((d=(f=e.stageTransition)==null?void 0:f.borderRadius)==null?void 0:d.lg)||"50%"}`)}),(s,r)=>{var o;return mn(),yi("div",{class:Ua(["fantasy-fall-transition",i.value]),style:Si({zIndex:((o=n.stageTransition)==null?void 0:o.zIndex)??100})},null,6)}}}),BH=No(kH,[["__scopeId","data-v-e62bf496"]]),zH=fn({__name:"MultipleBlocksRevealTransition",props:{stageTransition:null},setup(n){const e=n,t=Me(()=>e.stageTransition),i=Me(()=>{var r;return((r=t.value)==null?void 0:r.primaryColor)||"#666"}),s=Me(()=>{var r;return((r=t.value)==null?void 0:r.secondaryColor)||"#ccc"});return Hn(()=>{document.documentElement.style.setProperty("--stage-transition-4-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-4-overlay-color-2",s.value)}),(r,o)=>{var a;return mn(),yi("div",{class:"stage-transition-4",style:Si({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},o[0]||(o[0]=[X2('
',5)]),4)}}}),VH=No(zH,[["__scopeId","data-v-6d1179fc"]]),HH=fn({__name:"SlideTransition",props:{stageTransition:null},setup(n){const e=n,t=Me(()=>e.stageTransition),i=Me(()=>{var r;return((r=t.value)==null?void 0:r.primaryColor)||"#666"}),s=Me(()=>{var r;return((r=t.value)==null?void 0:r.secondaryColor)||"#ccc"});return Xe([t,i,s],()=>{document.documentElement.style.setProperty("--stage-transition-1-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-1-overlay-color-2",s.value)}),Hn(()=>{document.documentElement.style.setProperty("--stage-transition-1-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-1-overlay-color-2",s.value)}),(r,o)=>{var a;return mn(),yi("div",{class:"stage-transition-1",style:Si({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},null,4)}}}),GH=No(HH,[["__scopeId","data-v-bf1d1566"]]),WH=fn({__name:"SlopeSlideTransition",props:{stageTransition:null},setup(n){const e=n,t=Me(()=>e.stageTransition),i=Me(()=>{var r;return((r=t.value)==null?void 0:r.primaryColor)??"#666"}),s=Me(()=>{var r;return((r=t.value)==null?void 0:r.secondaryColor)??"#ccc"});return Hn(()=>{document.documentElement.style.setProperty("--stage-transition-2-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-2-overlay-color-2",s.value)}),(r,o)=>{var a;return mn(),yi("div",{class:"stage-transition-2",style:Si({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},null,4)}}}),XH=No(WH,[["__scopeId","data-v-8ff7120f"]]),$H=fn({__name:"RectanglesRotateTransition",props:{stageTransition:null},setup(n){const e=n;return Hn(()=>{var t,i,s,r,o,a,l;document.documentElement.style.setProperty("--rectangle-rotate-1-color",((t=e.stageTransition)==null?void 0:t.primaryColor)||"#ebcb8b"),document.documentElement.style.setProperty("--rectangle-rotate-2-color",((i=e.stageTransition)==null?void 0:i.secondaryColor)||"#c56370"),document.documentElement.style.setProperty("--rectangle-rotate-3-color",((s=e.stageTransition)==null?void 0:s.tertiaryColor)||"#43445b"),document.documentElement.style.setProperty("--rectangle-rotate-duration",`${((r=e.stageTransition)==null?void 0:r.duration)||.6}s`),document.documentElement.style.setProperty("--rectangle-rotate-delay",`${((o=e.stageTransition)==null?void 0:o.delay)||0}s`),document.documentElement.style.setProperty("--rectangle-rotate-stagger",`${((a=e.stageTransition)==null?void 0:a.staggerDelay)||.1}s`),document.documentElement.style.setProperty("--rectangle-rotate-rotation",`${((l=e.stageTransition)==null?void 0:l.rotation)||270}deg`)}),(t,i)=>{var s;return mn(),yi("div",{class:"rectangle-rotate-transition",style:Si({zIndex:((s=n.stageTransition)==null?void 0:s.zIndex)??100})},i[0]||(i[0]=[or("div",{class:"rectangle rectangle-rotate-1"},[or("div")],-1),or("div",{class:"rectangle rectangle-rotate-2"},[or("div")],-1),or("div",{class:"rectangle rectangle-rotate-3"},[or("div")],-1)]),4)}}}),qH=No($H,[["__scopeId","data-v-f4b1dc64"]]),YH=fn({__name:"StageTransitionGroup",props:{primaryColor:null,secondaryColor:null,tertiaryColor:null,colors:null,zIndex:null,disableTransitions:{type:Boolean},usePageSpecificTransitions:{type:Boolean}},setup(n){const e=n,t=$V(),i=et(!1),s=et(),r=et(""),o=et(),a=Oe({slide:{component:GH,duration:2700},"slope-slide":{component:XH,duration:2700},arrow:{component:NH,duration:2700},"multiple-blocks-reveal":{component:VH,duration:2800},"fantasy-fall":{component:BH,duration:2700},"rectangles-rotate":{component:qH,duration:2700},"bubble-wave-out":{component:FH,duration:1e3}}),l=et([]);function c(h){return l.value.push(h),()=>{const p=l.value.indexOf(h);p>=0&&l.value.splice(p,1)}}async function u(h,p={}){s.value=h;for(const _ of l.value)try{await Promise.resolve(_(h,p))}catch(g){console.error(`Error in transition hook at stage "${h}":`,g)}}async function f(h,p,_){if(h.name==="none"||!h.name){p(),_();return}const g=a.value[h.name];if(!g){console.error(`Transition ${h.name} not found`),p(),_();return}const m=g.nextDelay!==void 0?g.nextDelay:g.duration/3;let y=!1;const v=c(E=>{E==="navigation"&&!y&&(y=!0,p())});try{await u("before-enter",{transitionName:h.name}),i.value&&(await u("before-leave",{transitionName:r.value}),r.value="",o.value=void 0,i.value=!1,await u("after-leave",{transitionName:r.value}),await new Promise(T=>setTimeout(T,50))),r.value=h.name,o.value=h,i.value=!0,await u("enter-active",{transitionName:name}),setTimeout(async()=>{await u("navigation",{transitionName:h.name,config:g}),y||(y=!0,p())},m),setTimeout(async()=>{await u("after-enter",{transitionName:h.name})},g.duration),setTimeout(async()=>{await u("before-leave",{transitionName:h.name})},g.duration+10),setTimeout(async()=>{await u("leave-active",{transitionName:h.name})},g.duration+20);const E=g.exitDuration??0;setTimeout(async()=>{i.value=!1,r.value="",o.value=void 0,await u("after-leave",{transitionName:h.name}),_()},g.duration+E)}catch(E){console.error(E)}finally{v(),setTimeout(()=>{y||(y=!0,p())},g.duration*2)}}function d(h,p){return new Promise(_=>{f(h,p,_)})}return t.beforeEach((h,p,_)=>{if(e.disableTransitions){_();return}if(typeof h.meta.stageTransition!="object"){_();return}const g=h.meta.stageTransition;if(e.usePageSpecificTransitions&&g.pageSpecificAvailable){_();return}typeof e.primaryColor<"u"&&(g.primaryColor=e.primaryColor),typeof e.secondaryColor<"u"&&(g.secondaryColor=e.secondaryColor),typeof e.tertiaryColor<"u"&&(g.tertiaryColor=e.tertiaryColor),typeof e.colors<"u"&&(g.colors=e.colors),typeof e.zIndex<"u"&&(g.zIndex=e.zIndex),d(g,_)}),(h,p)=>(mn(),yi(jt,null,[h2(h.$slots,"default"),i.value?(mn(),yi(jt,{key:0},[a.value[r.value]?(mn(),Kl(f2(a.value[r.value].component),{key:0,"stage-transition":o.value},null,8,["stage-transition"])):Rv("",!0)],64)):Rv("",!0)],64))}});/*! + * shared v11.1.3 + * (c) 2025 kazuya kawaguchi + * Released under the MIT License. + */const zd=typeof window<"u",Ir=(n,e=!1)=>e?Symbol.for(n):Symbol(n),jH=(n,e,t)=>KH({l:n,k:e,s:t}),KH=n=>JSON.stringify(n).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Zt=n=>typeof n=="number"&&isFinite(n),ZH=n=>K_(n)==="[object Date]",Vd=n=>K_(n)==="[object RegExp]",rp=n=>dt(n)&&Object.keys(n).length===0,un=Object.assign,JH=Object.create,Rt=(n=null)=>JH(n);let sM;const j_=()=>sM||(sM=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Rt());function rM(n){return n.replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}const QH=Object.prototype.hasOwnProperty;function Oi(n,e){return QH.call(n,e)}const tn=Array.isArray,kt=n=>typeof n=="function",Ue=n=>typeof n=="string",Bt=n=>typeof n=="boolean",yt=n=>n!==null&&typeof n=="object",e8=n=>yt(n)&&kt(n.then)&&kt(n.catch),SA=Object.prototype.toString,K_=n=>SA.call(n),dt=n=>K_(n)==="[object Object]",t8=n=>n==null?"":tn(n)||dt(n)&&n.toString===SA?JSON.stringify(n,null,2):String(n);function Z_(n,e=""){return n.reduce((t,i,s)=>s===0?t+i:t+e+i,"")}function n8(n,e){typeof console<"u"&&(console.warn("[intlify] "+n),e&&console.warn(e.stack))}const df=n=>!yt(n)||tn(n);function If(n,e){if(df(n)||df(e))throw new Error("Invalid value");const t=[{src:n,des:e}];for(;t.length;){const{src:i,des:s}=t.pop();Object.keys(i).forEach(r=>{r!=="__proto__"&&(yt(i[r])&&!yt(s[r])&&(s[r]=Array.isArray(i[r])?[]:Rt()),df(s[r])||df(i[r])?s[r]=i[r]:t.push({src:i[r],des:s[r]}))})}}/*! + * message-compiler v11.1.3 + * (c) 2025 kazuya kawaguchi + * Released under the MIT License. + */function i8(n,e,t){return{line:n,column:e,offset:t}}function s0(n,e,t){return{start:n,end:e}}const At={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},s8=17;function op(n,e,t={}){const{domain:i,messages:s,args:r}=t,o=n,a=new SyntaxError(String(o));return a.code=n,e&&(a.location=e),a.domain=i,a}function r8(n){throw n}const bs=" ",o8="\r",Dn=` +`,a8="\u2028",l8="\u2029";function c8(n){const e=n;let t=0,i=1,s=1,r=0;const o=S=>e[S]===o8&&e[S+1]===Dn,a=S=>e[S]===Dn,l=S=>e[S]===l8,c=S=>e[S]===a8,u=S=>o(S)||a(S)||l(S)||c(S),f=()=>t,d=()=>i,h=()=>s,p=()=>r,_=S=>o(S)||l(S)||c(S)?Dn:e[S],g=()=>_(t),m=()=>_(t+r);function y(){return r=0,u(t)&&(i++,s=0),o(t)&&t++,t++,s++,e[t]}function b(){return o(t+r)&&r++,r++,e[t+r]}function v(){t=0,i=1,s=1,r=0}function E(S=0){r=S}function T(){const S=t+r;for(;S!==t;)y();r=0}return{index:f,line:d,column:h,peekOffset:p,charAt:_,currentChar:g,currentPeek:m,next:y,peek:b,reset:v,resetPeek:E,skipToPeek:T}}const nr=void 0,u8=".",oM="'",f8="tokenizer";function d8(n,e={}){const t=e.location!==!1,i=c8(n),s=()=>i.index(),r=()=>i8(i.line(),i.column(),i.index()),o=r(),a=s(),l={currentType:13,offset:a,startLoc:o,endLoc:o,lastType:13,lastOffset:a,lastStartLoc:o,lastEndLoc:o,braceNest:0,inLinked:!1,text:""},c=()=>l,{onError:u}=e;function f(R,L,B,...C){const A=c();if(L.column+=B,L.offset+=B,u){const U=t?s0(A.startLoc,L):null,O=op(R,U,{domain:f8,args:C});u(O)}}function d(R,L,B){R.endLoc=r(),R.currentType=L;const C={type:L};return t&&(C.loc=s0(R.startLoc,R.endLoc)),B!=null&&(C.value=B),C}const h=R=>d(R,13);function p(R,L){return R.currentChar()===L?(R.next(),L):(f(At.EXPECTED_TOKEN,r(),0,L),"")}function _(R){let L="";for(;R.currentPeek()===bs||R.currentPeek()===Dn;)L+=R.currentPeek(),R.peek();return L}function g(R){const L=_(R);return R.skipToPeek(),L}function m(R){if(R===nr)return!1;const L=R.charCodeAt(0);return L>=97&&L<=122||L>=65&&L<=90||L===95}function y(R){if(R===nr)return!1;const L=R.charCodeAt(0);return L>=48&&L<=57}function b(R,L){const{currentType:B}=L;if(B!==2)return!1;_(R);const C=m(R.currentPeek());return R.resetPeek(),C}function v(R,L){const{currentType:B}=L;if(B!==2)return!1;_(R);const C=R.currentPeek()==="-"?R.peek():R.currentPeek(),A=y(C);return R.resetPeek(),A}function E(R,L){const{currentType:B}=L;if(B!==2)return!1;_(R);const C=R.currentPeek()===oM;return R.resetPeek(),C}function T(R,L){const{currentType:B}=L;if(B!==7)return!1;_(R);const C=R.currentPeek()===".";return R.resetPeek(),C}function S(R,L){const{currentType:B}=L;if(B!==8)return!1;_(R);const C=m(R.currentPeek());return R.resetPeek(),C}function P(R,L){const{currentType:B}=L;if(!(B===7||B===11))return!1;_(R);const C=R.currentPeek()===":";return R.resetPeek(),C}function x(R,L){const{currentType:B}=L;if(B!==9)return!1;const C=()=>{const U=R.currentPeek();return U==="{"?m(R.peek()):U==="@"||U==="|"||U===":"||U==="."||U===bs||!U?!1:U===Dn?(R.peek(),C()):I(R,!1)},A=C();return R.resetPeek(),A}function M(R){_(R);const L=R.currentPeek()==="|";return R.resetPeek(),L}function I(R,L=!0){const B=(A=!1,U="")=>{const O=R.currentPeek();return O==="{"||O==="@"||!O?A:O==="|"?!(U===bs||U===Dn):O===bs?(R.peek(),B(!0,bs)):O===Dn?(R.peek(),B(!0,Dn)):!0},C=B();return L&&R.resetPeek(),C}function N(R,L){const B=R.currentChar();return B===nr?nr:L(B)?(R.next(),B):null}function V(R){const L=R.charCodeAt(0);return L>=97&&L<=122||L>=65&&L<=90||L>=48&&L<=57||L===95||L===36}function j(R){return N(R,V)}function te(R){const L=R.charCodeAt(0);return L>=97&&L<=122||L>=65&&L<=90||L>=48&&L<=57||L===95||L===36||L===45}function Z(R){return N(R,te)}function ee(R){const L=R.charCodeAt(0);return L>=48&&L<=57}function J(R){return N(R,ee)}function he(R){const L=R.charCodeAt(0);return L>=48&&L<=57||L>=65&&L<=70||L>=97&&L<=102}function be(R){return N(R,he)}function se(R){let L="",B="";for(;L=J(R);)B+=L;return B}function ye(R){let L="";for(;;){const B=R.currentChar();if(B==="{"||B==="}"||B==="@"||B==="|"||!B)break;if(B===bs||B===Dn)if(I(R))L+=B,R.next();else{if(M(R))break;L+=B,R.next()}else L+=B,R.next()}return L}function Be(R){g(R);let L="",B="";for(;L=Z(R);)B+=L;return R.currentChar()===nr&&f(At.UNTERMINATED_CLOSING_BRACE,r(),0),B}function re(R){g(R);let L="";return R.currentChar()==="-"?(R.next(),L+=`-${se(R)}`):L+=se(R),R.currentChar()===nr&&f(At.UNTERMINATED_CLOSING_BRACE,r(),0),L}function ge(R){return R!==oM&&R!==Dn}function xe(R){g(R),p(R,"'");let L="",B="";for(;L=N(R,ge);)L==="\\"?B+=$(R):B+=L;const C=R.currentChar();return C===Dn||C===nr?(f(At.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,r(),0),C===Dn&&(R.next(),p(R,"'")),B):(p(R,"'"),B)}function $(R){const L=R.currentChar();switch(L){case"\\":case"'":return R.next(),`\\${L}`;case"u":return ae(R,L,4);case"U":return ae(R,L,6);default:return f(At.UNKNOWN_ESCAPE_SEQUENCE,r(),0,L),""}}function ae(R,L,B){p(R,L);let C="";for(let A=0;A{const C=R.currentChar();return C==="{"||C==="@"||C==="|"||C==="("||C===")"||!C||C===bs?B:(B+=C,R.next(),L(B))};return L("")}function k(R){g(R);const L=p(R,"|");return g(R),L}function w(R,L){let B=null;switch(R.currentChar()){case"{":return L.braceNest>=1&&f(At.NOT_ALLOW_NEST_PLACEHOLDER,r(),0),R.next(),B=d(L,2,"{"),g(R),L.braceNest++,B;case"}":return L.braceNest>0&&L.currentType===2&&f(At.EMPTY_PLACEHOLDER,r(),0),R.next(),B=d(L,3,"}"),L.braceNest--,L.braceNest>0&&g(R),L.inLinked&&L.braceNest===0&&(L.inLinked=!1),B;case"@":return L.braceNest>0&&f(At.UNTERMINATED_CLOSING_BRACE,r(),0),B=X(R,L)||h(L),L.braceNest=0,B;default:{let A=!0,U=!0,O=!0;if(M(R))return L.braceNest>0&&f(At.UNTERMINATED_CLOSING_BRACE,r(),0),B=d(L,1,k(R)),L.braceNest=0,L.inLinked=!1,B;if(L.braceNest>0&&(L.currentType===4||L.currentType===5||L.currentType===6))return f(At.UNTERMINATED_CLOSING_BRACE,r(),0),L.braceNest=0,G(R,L);if(A=b(R,L))return B=d(L,4,Be(R)),g(R),B;if(U=v(R,L))return B=d(L,5,re(R)),g(R),B;if(O=E(R,L))return B=d(L,6,xe(R)),g(R),B;if(!A&&!U&&!O)return B=d(L,12,ce(R)),f(At.INVALID_TOKEN_IN_PLACEHOLDER,r(),0,B.value),g(R),B;break}}return B}function X(R,L){const{currentType:B}=L;let C=null;const A=R.currentChar();switch((B===7||B===8||B===11||B===9)&&(A===Dn||A===bs)&&f(At.INVALID_LINKED_FORMAT,r(),0),A){case"@":return R.next(),C=d(L,7,"@"),L.inLinked=!0,C;case".":return g(R),R.next(),d(L,8,".");case":":return g(R),R.next(),d(L,9,":");default:return M(R)?(C=d(L,1,k(R)),L.braceNest=0,L.inLinked=!1,C):T(R,L)||P(R,L)?(g(R),X(R,L)):S(R,L)?(g(R),d(L,11,He(R))):x(R,L)?(g(R),A==="{"?w(R,L)||C:d(L,10,F(R))):(B===7&&f(At.INVALID_LINKED_FORMAT,r(),0),L.braceNest=0,L.inLinked=!1,G(R,L))}}function G(R,L){let B={type:13};if(L.braceNest>0)return w(R,L)||h(L);if(L.inLinked)return X(R,L)||h(L);switch(R.currentChar()){case"{":return w(R,L)||h(L);case"}":return f(At.UNBALANCED_CLOSING_BRACE,r(),0),R.next(),d(L,3,"}");case"@":return X(R,L)||h(L);default:{if(M(R))return B=d(L,1,k(R)),L.braceNest=0,L.inLinked=!1,B;if(I(R))return d(L,0,ye(R));break}}return B}function W(){const{currentType:R,offset:L,startLoc:B,endLoc:C}=l;return l.lastType=R,l.lastOffset=L,l.lastStartLoc=B,l.lastEndLoc=C,l.offset=s(),l.startLoc=r(),i.currentChar()===nr?d(l,13):G(i,l)}return{nextToken:W,currentOffset:s,currentPosition:r,context:c}}const h8="parser",p8=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function m8(n,e,t){switch(n){case"\\\\":return"\\";case"\\'":return"'";default:{const i=parseInt(e||t,16);return i<=55295||i>=57344?String.fromCodePoint(i):"�"}}}function g8(n={}){const e=n.location!==!1,{onError:t}=n;function i(m,y,b,v,...E){const T=m.currentPosition();if(T.offset+=v,T.column+=v,t){const S=e?s0(b,T):null,P=op(y,S,{domain:h8,args:E});t(P)}}function s(m,y,b){const v={type:m};return e&&(v.start=y,v.end=y,v.loc={start:b,end:b}),v}function r(m,y,b,v){e&&(m.end=y,m.loc&&(m.loc.end=b))}function o(m,y){const b=m.context(),v=s(3,b.offset,b.startLoc);return v.value=y,r(v,m.currentOffset(),m.currentPosition()),v}function a(m,y){const b=m.context(),{lastOffset:v,lastStartLoc:E}=b,T=s(5,v,E);return T.index=parseInt(y,10),m.nextToken(),r(T,m.currentOffset(),m.currentPosition()),T}function l(m,y){const b=m.context(),{lastOffset:v,lastStartLoc:E}=b,T=s(4,v,E);return T.key=y,m.nextToken(),r(T,m.currentOffset(),m.currentPosition()),T}function c(m,y){const b=m.context(),{lastOffset:v,lastStartLoc:E}=b,T=s(9,v,E);return T.value=y.replace(p8,m8),m.nextToken(),r(T,m.currentOffset(),m.currentPosition()),T}function u(m){const y=m.nextToken(),b=m.context(),{lastOffset:v,lastStartLoc:E}=b,T=s(8,v,E);return y.type!==11?(i(m,At.UNEXPECTED_EMPTY_LINKED_MODIFIER,b.lastStartLoc,0),T.value="",r(T,v,E),{nextConsumeToken:y,node:T}):(y.value==null&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,qi(y)),T.value=y.value||"",r(T,m.currentOffset(),m.currentPosition()),{node:T})}function f(m,y){const b=m.context(),v=s(7,b.offset,b.startLoc);return v.value=y,r(v,m.currentOffset(),m.currentPosition()),v}function d(m){const y=m.context(),b=s(6,y.offset,y.startLoc);let v=m.nextToken();if(v.type===8){const E=u(m);b.modifier=E.node,v=E.nextConsumeToken||m.nextToken()}switch(v.type!==9&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,qi(v)),v=m.nextToken(),v.type===2&&(v=m.nextToken()),v.type){case 10:v.value==null&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,qi(v)),b.key=f(m,v.value||"");break;case 4:v.value==null&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,qi(v)),b.key=l(m,v.value||"");break;case 5:v.value==null&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,qi(v)),b.key=a(m,v.value||"");break;case 6:v.value==null&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,qi(v)),b.key=c(m,v.value||"");break;default:{i(m,At.UNEXPECTED_EMPTY_LINKED_KEY,y.lastStartLoc,0);const E=m.context(),T=s(7,E.offset,E.startLoc);return T.value="",r(T,E.offset,E.startLoc),b.key=T,r(b,E.offset,E.startLoc),{nextConsumeToken:v,node:b}}}return r(b,m.currentOffset(),m.currentPosition()),{node:b}}function h(m){const y=m.context(),b=y.currentType===1?m.currentOffset():y.offset,v=y.currentType===1?y.endLoc:y.startLoc,E=s(2,b,v);E.items=[];let T=null;do{const x=T||m.nextToken();switch(T=null,x.type){case 0:x.value==null&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,qi(x)),E.items.push(o(m,x.value||""));break;case 5:x.value==null&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,qi(x)),E.items.push(a(m,x.value||""));break;case 4:x.value==null&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,qi(x)),E.items.push(l(m,x.value||""));break;case 6:x.value==null&&i(m,At.UNEXPECTED_LEXICAL_ANALYSIS,y.lastStartLoc,0,qi(x)),E.items.push(c(m,x.value||""));break;case 7:{const M=d(m);E.items.push(M.node),T=M.nextConsumeToken||null;break}}}while(y.currentType!==13&&y.currentType!==1);const S=y.currentType===1?y.lastOffset:m.currentOffset(),P=y.currentType===1?y.lastEndLoc:m.currentPosition();return r(E,S,P),E}function p(m,y,b,v){const E=m.context();let T=v.items.length===0;const S=s(1,y,b);S.cases=[],S.cases.push(v);do{const P=h(m);T||(T=P.items.length===0),S.cases.push(P)}while(E.currentType!==13);return T&&i(m,At.MUST_HAVE_MESSAGES_IN_PLURAL,b,0),r(S,m.currentOffset(),m.currentPosition()),S}function _(m){const y=m.context(),{offset:b,startLoc:v}=y,E=h(m);return y.currentType===13?E:p(m,b,v,E)}function g(m){const y=d8(m,un({},n)),b=y.context(),v=s(0,b.offset,b.startLoc);return e&&v.loc&&(v.loc.source=m),v.body=_(y),n.onCacheKey&&(v.cacheKey=n.onCacheKey(m)),b.currentType!==13&&i(y,At.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,m[b.offset]||""),r(v,y.currentOffset(),y.currentPosition()),v}return{parse:g}}function qi(n){if(n.type===13)return"EOF";const e=(n.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function _8(n,e={}){const t={ast:n,helpers:new Set};return{context:()=>t,helper:r=>(t.helpers.add(r),r)}}function aM(n,e){for(let t=0;tlM(t)),n}function lM(n){if(n.items.length===1){const e=n.items[0];(e.type===3||e.type===9)&&(n.static=e.value,delete e.value)}else{const e=[];for(let t=0;to;function l(_,g){o.code+=_}function c(_,g=!0){const m=g?i:"";l(s?m+" ".repeat(_):m)}function u(_=!0){const g=++o.indentLevel;_&&c(g)}function f(_=!0){const g=--o.indentLevel;_&&c(g)}function d(){c(o.indentLevel)}return{context:a,push:l,indent:u,deindent:f,newline:d,helper:_=>`_${_}`,needIndent:()=>o.needIndent}}function x8(n,e){const{helper:t}=n;n.push(`${t("linked")}(`),Oa(n,e.key),e.modifier?(n.push(", "),Oa(n,e.modifier),n.push(", _type")):n.push(", undefined, _type"),n.push(")")}function M8(n,e){const{helper:t,needIndent:i}=n;n.push(`${t("normalize")}([`),n.indent(i());const s=e.items.length;for(let r=0;r1){n.push(`${t("plural")}([`),n.indent(i());const s=e.cases.length;for(let r=0;r{const t=Ue(e.mode)?e.mode:"normal",i=Ue(e.filename)?e.filename:"message.intl";e.sourceMap;const s=e.breakLineCode!=null?e.breakLineCode:t==="arrow"?";":` +`,r=e.needIndent?e.needIndent:t!=="arrow",o=n.helpers||[],a=b8(n,{filename:i,breakLineCode:s,needIndent:r});a.push(t==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),a.indent(r),o.length>0&&(a.push(`const { ${Z_(o.map(u=>`${u}: _${u}`),", ")} } = ctx`),a.newline()),a.push("return "),Oa(a,n),a.deindent(r),a.push("}"),delete n.helpers;const{code:l,map:c}=a.context();return{ast:n,code:l,map:c?c.toJSON():void 0}};function w8(n,e={}){const t=un({},e),i=!!t.jit,s=!!t.minify,r=t.optimize==null?!0:t.optimize,a=g8(t).parse(n);return i?(r&&y8(a),s&&ra(a),{ast:a,code:""}):(v8(a,t),T8(a,t))}/*! + * core-base v11.1.3 + * (c) 2025 kazuya kawaguchi + * Released under the MIT License. + */function A8(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(j_().__INTLIFY_PROD_DEVTOOLS__=!1)}function ss(n){return yt(n)&&Q_(n)===0&&(Oi(n,"b")||Oi(n,"body"))}const EA=["b","body"];function C8(n){return Lr(n,EA)}const TA=["c","cases"];function R8(n){return Lr(n,TA,[])}const wA=["s","static"];function P8(n){return Lr(n,wA)}const AA=["i","items"];function I8(n){return Lr(n,AA,[])}const CA=["t","type"];function Q_(n){return Lr(n,CA)}const RA=["v","value"];function hf(n,e){const t=Lr(n,RA);if(t!=null)return t;throw Ec(e)}const PA=["m","modifier"];function L8(n){return Lr(n,PA)}const IA=["k","key"];function D8(n){const e=Lr(n,IA);if(e)return e;throw Ec(6)}function Lr(n,e,t){for(let i=0;iO8(t,n)}function O8(n,e){const t=C8(e);if(t==null)throw Ec(0);if(Q_(t)===1){const r=R8(t);return n.plural(r.reduce((o,a)=>[...o,cM(n,a)],[]))}else return cM(n,t)}function cM(n,e){const t=P8(e);if(t!=null)return n.type==="text"?t:n.normalize([t]);{const i=I8(e).reduce((s,r)=>[...s,r0(n,r)],[]);return n.normalize(i)}}function r0(n,e){const t=Q_(e);switch(t){case 3:return hf(e,t);case 9:return hf(e,t);case 4:{const i=e;if(Oi(i,"k")&&i.k)return n.interpolate(n.named(i.k));if(Oi(i,"key")&&i.key)return n.interpolate(n.named(i.key));throw Ec(t)}case 5:{const i=e;if(Oi(i,"i")&&Zt(i.i))return n.interpolate(n.list(i.i));if(Oi(i,"index")&&Zt(i.index))return n.interpolate(n.list(i.index));throw Ec(t)}case 6:{const i=e,s=L8(i),r=D8(i);return n.linked(r0(n,r),s?r0(n,s):void 0,n.type)}case 7:return hf(e,t);case 8:return hf(e,t);default:throw new Error(`unhandled node on format message part: ${t}`)}}const N8=n=>n;let pf=Rt();function U8(n,e={}){let t=!1;const i=e.onError||r8;return e.onError=s=>{t=!0,i(s)},{...w8(n,e),detectError:t}}function F8(n,e){if(Ue(n)){Bt(e.warnHtmlMessage)&&e.warnHtmlMessage;const i=(e.onCacheKey||N8)(n),s=pf[i];if(s)return s;const{ast:r,detectError:o}=U8(n,{...e,location:!1,jit:!0}),a=$m(r);return o?a:pf[i]=a}else{const t=n.cacheKey;if(t){const i=pf[t];return i||(pf[t]=$m(n))}else return $m(n)}}let Tc=null;function k8(n){Tc=n}function B8(n,e,t){Tc&&Tc.emit("i18n:init",{timestamp:Date.now(),i18n:n,version:e,meta:t})}const z8=V8("function:translate");function V8(n){return e=>Tc&&Tc.emit(n,e)}const Rs={INVALID_ARGUMENT:s8,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},H8=24;function Ps(n){return op(n,null,void 0)}function ev(n,e){return e.locale!=null?uM(e.locale):uM(n.locale)}let qm;function uM(n){if(Ue(n))return n;if(kt(n)){if(n.resolvedOnce&&qm!=null)return qm;if(n.constructor.name==="Function"){const e=n();if(e8(e))throw Ps(Rs.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return qm=e}else throw Ps(Rs.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Ps(Rs.NOT_SUPPORT_LOCALE_TYPE)}function G8(n,e,t){return[...new Set([t,...tn(e)?e:yt(e)?Object.keys(e):Ue(e)?[e]:[t]])]}function DA(n,e,t){const i=Ue(t)?t:Hd,s=n;s.__localeChainCache||(s.__localeChainCache=new Map);let r=s.__localeChainCache.get(i);if(!r){r=[];let o=[t];for(;tn(o);)o=fM(r,o,e);const a=tn(e)||!dt(e)?e:e.default?e.default:null;o=Ue(a)?[a]:a,tn(o)&&fM(r,o,!1),s.__localeChainCache.set(i,r)}return r}function fM(n,e,t){let i=!0;for(let s=0;s{o===void 0?o=a:o+=a},d[1]=()=>{o!==void 0&&(e.push(o),o=void 0)},d[2]=()=>{d[0](),s++},d[3]=()=>{if(s>0)s--,i=4,d[0]();else{if(s=0,o===void 0||(o=K8(o),o===!1))return!1;d[1]()}};function h(){const p=n[t+1];if(i===5&&p==="'"||i===6&&p==='"')return t++,a="\\"+p,d[0](),!0}for(;i!==null;)if(t++,r=n[t],!(r==="\\"&&h())){if(l=j8(r),f=Dr[i],c=f[l]||f.l||8,c===8||(i=c[0],c[1]!==void 0&&(u=d[c[1]],u&&(a=r,u()===!1))))return;if(i===7)return e}}const dM=new Map;function J8(n,e){return yt(n)?n[e]:null}function Q8(n,e){if(!yt(n))return null;let t=dM.get(e);if(t||(t=Z8(e),t&&dM.set(e,t)),!t)return null;const i=t.length;let s=n,r=0;for(;r`${n.charAt(0).toLocaleUpperCase()}${n.substr(1)}`;function t9(){return{upper:(n,e)=>e==="text"&&Ue(n)?n.toUpperCase():e==="vnode"&&yt(n)&&"__v_isVNode"in n?n.children.toUpperCase():n,lower:(n,e)=>e==="text"&&Ue(n)?n.toLowerCase():e==="vnode"&&yt(n)&&"__v_isVNode"in n?n.children.toLowerCase():n,capitalize:(n,e)=>e==="text"&&Ue(n)?pM(n):e==="vnode"&&yt(n)&&"__v_isVNode"in n?pM(n.children):n}}let OA;function n9(n){OA=n}let NA;function i9(n){NA=n}let UA;function s9(n){UA=n}let FA=null;const r9=n=>{FA=n},o9=()=>FA;let kA=null;const mM=n=>{kA=n},a9=()=>kA;let gM=0;function l9(n={}){const e=kt(n.onWarn)?n.onWarn:n8,t=Ue(n.version)?n.version:e9,i=Ue(n.locale)||kt(n.locale)?n.locale:Hd,s=kt(i)?Hd:i,r=tn(n.fallbackLocale)||dt(n.fallbackLocale)||Ue(n.fallbackLocale)||n.fallbackLocale===!1?n.fallbackLocale:s,o=dt(n.messages)?n.messages:Ym(s),a=dt(n.datetimeFormats)?n.datetimeFormats:Ym(s),l=dt(n.numberFormats)?n.numberFormats:Ym(s),c=un(Rt(),n.modifiers,t9()),u=n.pluralRules||Rt(),f=kt(n.missing)?n.missing:null,d=Bt(n.missingWarn)||Vd(n.missingWarn)?n.missingWarn:!0,h=Bt(n.fallbackWarn)||Vd(n.fallbackWarn)?n.fallbackWarn:!0,p=!!n.fallbackFormat,_=!!n.unresolving,g=kt(n.postTranslation)?n.postTranslation:null,m=dt(n.processor)?n.processor:null,y=Bt(n.warnHtmlMessage)?n.warnHtmlMessage:!0,b=!!n.escapeParameter,v=kt(n.messageCompiler)?n.messageCompiler:OA,E=kt(n.messageResolver)?n.messageResolver:NA||J8,T=kt(n.localeFallbacker)?n.localeFallbacker:UA||G8,S=yt(n.fallbackContext)?n.fallbackContext:void 0,P=n,x=yt(P.__datetimeFormatters)?P.__datetimeFormatters:new Map,M=yt(P.__numberFormatters)?P.__numberFormatters:new Map,I=yt(P.__meta)?P.__meta:{};gM++;const N={version:t,cid:gM,locale:i,fallbackLocale:r,messages:o,modifiers:c,pluralRules:u,missing:f,missingWarn:d,fallbackWarn:h,fallbackFormat:p,unresolving:_,postTranslation:g,processor:m,warnHtmlMessage:y,escapeParameter:b,messageCompiler:v,messageResolver:E,localeFallbacker:T,fallbackContext:S,onWarn:e,__meta:I};return N.datetimeFormats=a,N.numberFormats=l,N.__datetimeFormatters=x,N.__numberFormatters=M,__INTLIFY_PROD_DEVTOOLS__&&B8(N,t,I),N}const Ym=n=>({[n]:Rt()});function tv(n,e,t,i,s){const{missing:r,onWarn:o}=n;if(r!==null){const a=r(n,t,e,s);return Ue(a)?a:e}else return e}function dl(n,e,t){const i=n;i.__localeChainCache=new Map,n.localeFallbacker(n,t,e)}function c9(n,e){return n===e?!1:n.split("-")[0]===e.split("-")[0]}function u9(n,e){const t=e.indexOf(n);if(t===-1)return!1;for(let i=t+1;i{BA.includes(l)?o[l]=t[l]:r[l]=t[l]}),Ue(i)?r.locale=i:dt(i)&&(o=i),dt(s)&&(o=s),[r.key||"",a,r,o]}function vM(n,e,t){const i=n;for(const s in t){const r=`${e}__${s}`;i.__datetimeFormatters.has(r)&&i.__datetimeFormatters.delete(r)}}function yM(n,...e){const{numberFormats:t,unresolving:i,fallbackLocale:s,onWarn:r,localeFallbacker:o}=n,{__numberFormatters:a}=n,[l,c,u,f]=a0(...e),d=Bt(u.missingWarn)?u.missingWarn:n.missingWarn;Bt(u.fallbackWarn)?u.fallbackWarn:n.fallbackWarn;const h=!!u.part,p=ev(n,u),_=o(n,s,p);if(!Ue(l)||l==="")return new Intl.NumberFormat(p,f).format(c);let g={},m,y=null;const b="number format";for(let T=0;T<_.length&&(m=_[T],g=t[m]||{},y=g[l],!dt(y));T++)tv(n,l,m,d,b);if(!dt(y)||!Ue(m))return i?ap:l;let v=`${m}__${l}`;rp(f)||(v=`${v}__${JSON.stringify(f)}`);let E=a.get(v);return E||(E=new Intl.NumberFormat(m,un({},y,f)),a.set(v,E)),h?E.formatToParts(c):E.format(c)}const zA=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function a0(...n){const[e,t,i,s]=n,r=Rt();let o=Rt();if(!Zt(e))throw Ps(Rs.INVALID_ARGUMENT);const a=e;return Ue(t)?r.key=t:dt(t)&&Object.keys(t).forEach(l=>{zA.includes(l)?o[l]=t[l]:r[l]=t[l]}),Ue(i)?r.locale=i:dt(i)&&(o=i),dt(s)&&(o=s),[r.key||"",a,r,o]}function bM(n,e,t){const i=n;for(const s in t){const r=`${e}__${s}`;i.__numberFormatters.has(r)&&i.__numberFormatters.delete(r)}}const f9=n=>n,d9=n=>"",h9="text",p9=n=>n.length===0?"":Z_(n),m9=t8;function xM(n,e){return n=Math.abs(n),e===2?n?n>1?1:0:1:n?Math.min(n,2):0}function g9(n){const e=Zt(n.pluralIndex)?n.pluralIndex:-1;return n.named&&(Zt(n.named.count)||Zt(n.named.n))?Zt(n.named.count)?n.named.count:Zt(n.named.n)?n.named.n:e:e}function _9(n,e){e.count||(e.count=n),e.n||(e.n=n)}function v9(n={}){const e=n.locale,t=g9(n),i=yt(n.pluralRules)&&Ue(e)&&kt(n.pluralRules[e])?n.pluralRules[e]:xM,s=yt(n.pluralRules)&&Ue(e)&&kt(n.pluralRules[e])?xM:void 0,r=m=>m[i(t,m.length,s)],o=n.list||[],a=m=>o[m],l=n.named||Rt();Zt(n.pluralIndex)&&_9(t,l);const c=m=>l[m];function u(m,y){const b=kt(n.messages)?n.messages(m,!!y):yt(n.messages)?n.messages[m]:!1;return b||(n.parent?n.parent.message(m):d9)}const f=m=>n.modifiers?n.modifiers[m]:f9,d=dt(n.processor)&&kt(n.processor.normalize)?n.processor.normalize:p9,h=dt(n.processor)&&kt(n.processor.interpolate)?n.processor.interpolate:m9,p=dt(n.processor)&&Ue(n.processor.type)?n.processor.type:h9,g={list:a,named:c,plural:r,linked:(m,...y)=>{const[b,v]=y;let E="text",T="";y.length===1?yt(b)?(T=b.modifier||T,E=b.type||E):Ue(b)&&(T=b||T):y.length===2&&(Ue(b)&&(T=b||T),Ue(v)&&(E=v||E));const S=u(m,!0)(g),P=E==="vnode"&&tn(S)&&T?S[0]:S;return T?f(T)(P,E):P},message:u,type:p,interpolate:h,normalize:d,values:un(Rt(),o,l)};return g}const MM=()=>"",mi=n=>kt(n);function SM(n,...e){const{fallbackFormat:t,postTranslation:i,unresolving:s,messageCompiler:r,fallbackLocale:o,messages:a}=n,[l,c]=l0(...e),u=Bt(c.missingWarn)?c.missingWarn:n.missingWarn,f=Bt(c.fallbackWarn)?c.fallbackWarn:n.fallbackWarn,d=Bt(c.escapeParameter)?c.escapeParameter:n.escapeParameter,h=!!c.resolvedMessage,p=Ue(c.default)||Bt(c.default)?Bt(c.default)?r?l:()=>l:c.default:t?r?l:()=>l:null,_=t||p!=null&&(Ue(p)||kt(p)),g=ev(n,c);d&&y9(c);let[m,y,b]=h?[l,g,a[g]||Rt()]:VA(n,l,g,o,f,u),v=m,E=l;if(!h&&!(Ue(v)||ss(v)||mi(v))&&_&&(v=p,E=v),!h&&(!(Ue(v)||ss(v)||mi(v))||!Ue(y)))return s?ap:l;let T=!1;const S=()=>{T=!0},P=mi(v)?v:HA(n,l,y,v,E,S);if(T)return v;const x=M9(n,y,b,c),M=v9(x),I=b9(n,P,M),N=i?i(I,l):I;if(__INTLIFY_PROD_DEVTOOLS__){const V={timestamp:Date.now(),key:Ue(l)?l:mi(v)?v.key:"",locale:y||(mi(v)?v.locale:""),format:Ue(v)?v:mi(v)?v.source:"",message:N};V.meta=un({},n.__meta,o9()||{}),z8(V)}return N}function y9(n){tn(n.list)?n.list=n.list.map(e=>Ue(e)?rM(e):e):yt(n.named)&&Object.keys(n.named).forEach(e=>{Ue(n.named[e])&&(n.named[e]=rM(n.named[e]))})}function VA(n,e,t,i,s,r){const{messages:o,onWarn:a,messageResolver:l,localeFallbacker:c}=n,u=c(n,i,t);let f=Rt(),d,h=null;const p="translate";for(let _=0;_i;return c.locale=t,c.key=e,c}const l=o(i,x9(n,t,s,i,a,r));return l.locale=t,l.key=e,l.source=i,l}function b9(n,e,t){return e(t)}function l0(...n){const[e,t,i]=n,s=Rt();if(!Ue(e)&&!Zt(e)&&!mi(e)&&!ss(e))throw Ps(Rs.INVALID_ARGUMENT);const r=Zt(e)?String(e):(mi(e),e);return Zt(t)?s.plural=t:Ue(t)?s.default=t:dt(t)&&!rp(t)?s.named=t:tn(t)&&(s.list=t),Zt(i)?s.plural=i:Ue(i)?s.default=i:dt(i)&&un(s,i),[r,s]}function x9(n,e,t,i,s,r){return{locale:e,key:t,warnHtmlMessage:s,onError:o=>{throw r&&r(o),o},onCacheKey:o=>jH(e,t,o)}}function M9(n,e,t,i){const{modifiers:s,pluralRules:r,messageResolver:o,fallbackLocale:a,fallbackWarn:l,missingWarn:c,fallbackContext:u}=n,d={locale:e,modifiers:s,pluralRules:r,messages:(h,p)=>{let _=o(t,h);if(_==null&&(u||p)){const[,,g]=VA(u||n,h,e,a,l,c);_=o(g,h)}if(Ue(_)||ss(_)){let g=!1;const y=HA(n,h,e,_,h,()=>{g=!0});return g?MM:y}else return mi(_)?_:MM}};return n.processor&&(d.processor=n.processor),i.list&&(d.list=i.list),i.named&&(d.named=i.named),Zt(i.plural)&&(d.pluralIndex=i.plural),d}A8();/*! + * vue-i18n v11.1.3 + * (c) 2025 kazuya kawaguchi + * Released under the MIT License. + */const S9="11.1.3";function E9(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(j_().__INTLIFY_PROD_DEVTOOLS__=!1)}const Mi={UNEXPECTED_RETURN_TYPE:H8,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32};function Hi(n,...e){return op(n,null,void 0)}const c0=Ir("__translateVNode"),u0=Ir("__datetimeParts"),f0=Ir("__numberParts"),T9=Ir("__setPluralRules"),w9=Ir("__injectWithOption"),d0=Ir("__dispose");function wc(n){if(!yt(n)||ss(n))return n;for(const e in n)if(Oi(n,e))if(!e.includes("."))yt(n[e])&&wc(n[e]);else{const t=e.split("."),i=t.length-1;let s=n,r=!1;for(let o=0;o{if("locale"in a&&"resource"in a){const{locale:l,resource:c}=a;l?(o[l]=o[l]||Rt(),If(c,o[l])):If(c,o)}else Ue(a)&&If(JSON.parse(a),o)}),s==null&&r)for(const a in o)Oi(o,a)&&wc(o[a]);return o}function WA(n){return n.type}function A9(n,e,t){let i=yt(e.messages)?e.messages:Rt();"__i18nGlobal"in t&&(i=GA(n.locale.value,{messages:i,__i18n:t.__i18nGlobal}));const s=Object.keys(i);s.length&&s.forEach(r=>{n.mergeLocaleMessage(r,i[r])});{if(yt(e.datetimeFormats)){const r=Object.keys(e.datetimeFormats);r.length&&r.forEach(o=>{n.mergeDateTimeFormat(o,e.datetimeFormats[o])})}if(yt(e.numberFormats)){const r=Object.keys(e.numberFormats);r.length&&r.forEach(o=>{n.mergeNumberFormat(o,e.numberFormats[o])})}}}function EM(n){return pn(Lc,null,n,0)}const TM="__INTLIFY_META__",wM=()=>[],C9=()=>!1;let AM=0;function CM(n){return(e,t,i,s)=>n(t,i,An()||void 0,s)}const R9=()=>{const n=An();let e=null;return n&&(e=WA(n)[TM])?{[TM]:e}:null};function XA(n={}){const{__root:e,__injectWithOption:t}=n,i=e===void 0,s=n.flatJson,r=zd?et:Oe;let o=Bt(n.inheritLocale)?n.inheritLocale:!0;const a=r(e&&o?e.locale.value:Ue(n.locale)?n.locale:Hd),l=r(e&&o?e.fallbackLocale.value:Ue(n.fallbackLocale)||tn(n.fallbackLocale)||dt(n.fallbackLocale)||n.fallbackLocale===!1?n.fallbackLocale:a.value),c=r(GA(a.value,n)),u=r(dt(n.datetimeFormats)?n.datetimeFormats:{[a.value]:{}}),f=r(dt(n.numberFormats)?n.numberFormats:{[a.value]:{}});let d=e?e.missingWarn:Bt(n.missingWarn)||Vd(n.missingWarn)?n.missingWarn:!0,h=e?e.fallbackWarn:Bt(n.fallbackWarn)||Vd(n.fallbackWarn)?n.fallbackWarn:!0,p=e?e.fallbackRoot:Bt(n.fallbackRoot)?n.fallbackRoot:!0,_=!!n.fallbackFormat,g=kt(n.missing)?n.missing:null,m=kt(n.missing)?CM(n.missing):null,y=kt(n.postTranslation)?n.postTranslation:null,b=e?e.warnHtmlMessage:Bt(n.warnHtmlMessage)?n.warnHtmlMessage:!0,v=!!n.escapeParameter;const E=e?e.modifiers:dt(n.modifiers)?n.modifiers:{};let T=n.pluralRules||e&&e.pluralRules,S;S=(()=>{i&&mM(null);const O={version:S9,locale:a.value,fallbackLocale:l.value,messages:c.value,modifiers:E,pluralRules:T,missing:m===null?void 0:m,missingWarn:d,fallbackWarn:h,fallbackFormat:_,unresolving:!0,postTranslation:y===null?void 0:y,warnHtmlMessage:b,escapeParameter:v,messageResolver:n.messageResolver,messageCompiler:n.messageCompiler,__meta:{framework:"vue"}};O.datetimeFormats=u.value,O.numberFormats=f.value,O.__datetimeFormatters=dt(S)?S.__datetimeFormatters:void 0,O.__numberFormatters=dt(S)?S.__numberFormatters:void 0;const H=l9(O);return i&&mM(H),H})(),dl(S,a.value,l.value);function x(){return[a.value,l.value,c.value,u.value,f.value]}const M=Me({get:()=>a.value,set:O=>{S.locale=O,a.value=O}}),I=Me({get:()=>l.value,set:O=>{S.fallbackLocale=O,l.value=O,dl(S,a.value,O)}}),N=Me(()=>c.value),V=Me(()=>u.value),j=Me(()=>f.value);function te(){return kt(y)?y:null}function Z(O){y=O,S.postTranslation=O}function ee(){return g}function J(O){O!==null&&(m=CM(O)),g=O,S.missing=m}const he=(O,H,q,fe,ue,Re)=>{x();let Pe;try{__INTLIFY_PROD_DEVTOOLS__,i||(S.fallbackContext=e?a9():void 0),Pe=O(S)}finally{__INTLIFY_PROD_DEVTOOLS__,i||(S.fallbackContext=void 0)}if(q!=="translate exists"&&Zt(Pe)&&Pe===ap||q==="translate exists"&&!Pe){const[me,Se]=H();return e&&p?fe(e):ue(me)}else{if(Re(Pe))return Pe;throw Hi(Mi.UNEXPECTED_RETURN_TYPE)}};function be(...O){return he(H=>Reflect.apply(SM,null,[H,...O]),()=>l0(...O),"translate",H=>Reflect.apply(H.t,H,[...O]),H=>H,H=>Ue(H))}function se(...O){const[H,q,fe]=O;if(fe&&!yt(fe))throw Hi(Mi.INVALID_ARGUMENT);return be(H,q,un({resolvedMessage:!0},fe||{}))}function ye(...O){return he(H=>Reflect.apply(_M,null,[H,...O]),()=>o0(...O),"datetime format",H=>Reflect.apply(H.d,H,[...O]),()=>hM,H=>Ue(H))}function Be(...O){return he(H=>Reflect.apply(yM,null,[H,...O]),()=>a0(...O),"number format",H=>Reflect.apply(H.n,H,[...O]),()=>hM,H=>Ue(H))}function re(O){return O.map(H=>Ue(H)||Zt(H)||Bt(H)?EM(String(H)):H)}const xe={normalize:re,interpolate:O=>O,type:"vnode"};function $(...O){return he(H=>{let q;const fe=H;try{fe.processor=xe,q=Reflect.apply(SM,null,[fe,...O])}finally{fe.processor=null}return q},()=>l0(...O),"translate",H=>H[c0](...O),H=>[EM(H)],H=>tn(H))}function ae(...O){return he(H=>Reflect.apply(yM,null,[H,...O]),()=>a0(...O),"number format",H=>H[f0](...O),wM,H=>Ue(H)||tn(H))}function le(...O){return he(H=>Reflect.apply(_M,null,[H,...O]),()=>o0(...O),"datetime format",H=>H[u0](...O),wM,H=>Ue(H)||tn(H))}function ce(O){T=O,S.pluralRules=T}function He(O,H){return he(()=>{if(!O)return!1;const q=Ue(H)?H:a.value,fe=w(q),ue=S.messageResolver(fe,O);return ss(ue)||mi(ue)||Ue(ue)},()=>[O],"translate exists",q=>Reflect.apply(q.te,q,[O,H]),C9,q=>Bt(q))}function F(O){let H=null;const q=DA(S,l.value,a.value);for(let fe=0;fe{o&&(a.value=O,S.locale=O,dl(S,a.value,l.value))}),Xe(e.fallbackLocale,O=>{o&&(l.value=O,S.fallbackLocale=O,dl(S,a.value,l.value))}));const U={id:AM,locale:M,fallbackLocale:I,get inheritLocale(){return o},set inheritLocale(O){o=O,O&&e&&(a.value=e.locale.value,l.value=e.fallbackLocale.value,dl(S,a.value,l.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:N,get modifiers(){return E},get pluralRules(){return T||{}},get isGlobal(){return i},get missingWarn(){return d},set missingWarn(O){d=O,S.missingWarn=d},get fallbackWarn(){return h},set fallbackWarn(O){h=O,S.fallbackWarn=h},get fallbackRoot(){return p},set fallbackRoot(O){p=O},get fallbackFormat(){return _},set fallbackFormat(O){_=O,S.fallbackFormat=_},get warnHtmlMessage(){return b},set warnHtmlMessage(O){b=O,S.warnHtmlMessage=O},get escapeParameter(){return v},set escapeParameter(O){v=O,S.escapeParameter=O},t:be,getLocaleMessage:w,setLocaleMessage:X,mergeLocaleMessage:G,getPostTranslationHandler:te,setPostTranslationHandler:Z,getMissingHandler:ee,setMissingHandler:J,[T9]:ce};return U.datetimeFormats=V,U.numberFormats=j,U.rt=se,U.te=He,U.tm=k,U.d=ye,U.n=Be,U.getDateTimeFormat=W,U.setDateTimeFormat=R,U.mergeDateTimeFormat=L,U.getNumberFormat=B,U.setNumberFormat=C,U.mergeNumberFormat=A,U[w9]=t,U[c0]=$,U[u0]=le,U[f0]=ae,U}const nv={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:n=>n==="parent"||n==="global",default:"parent"},i18n:{type:Object}};function P9({slots:n},e){return e.length===1&&e[0]==="default"?(n.default?n.default():[]).reduce((i,s)=>[...i,...s.type===jt?s.children:[s]],[]):e.reduce((t,i)=>{const s=n[i];return s&&(t[i]=s()),t},Rt())}function $A(){return jt}const I9=fn({name:"i18n-t",props:un({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:n=>Zt(n)||!isNaN(n)}},nv),setup(n,e){const{slots:t,attrs:i}=e,s=n.i18n||lp({useScope:n.scope,__useComponent:!0});return()=>{const r=Object.keys(t).filter(f=>f!=="_"),o=Rt();n.locale&&(o.locale=n.locale),n.plural!==void 0&&(o.plural=Ue(n.plural)?+n.plural:n.plural);const a=P9(e,r),l=s[c0](n.keypath,a,o),c=un(Rt(),i),u=Ue(n.tag)||yt(n.tag)?n.tag:$A();return Ns(u,c,l)}}}),RM=I9;function L9(n){return tn(n)&&!Ue(n[0])}function qA(n,e,t,i){const{slots:s,attrs:r}=e;return()=>{const o={part:!0};let a=Rt();n.locale&&(o.locale=n.locale),Ue(n.format)?o.key=n.format:yt(n.format)&&(Ue(n.format.key)&&(o.key=n.format.key),a=Object.keys(n.format).reduce((d,h)=>t.includes(h)?un(Rt(),d,{[h]:n.format[h]}):d,Rt()));const l=i(n.value,o,a);let c=[o.key];tn(l)?c=l.map((d,h)=>{const p=s[d.type],_=p?p({[d.type]:d.value,index:h,parts:l}):[d.value];return L9(_)&&(_[0].key=`${d.type}-${h}`),_}):Ue(l)&&(c=[l]);const u=un(Rt(),r),f=Ue(n.tag)||yt(n.tag)?n.tag:$A();return Ns(f,u,c)}}const D9=fn({name:"i18n-n",props:un({value:{type:Number,required:!0},format:{type:[String,Object]}},nv),setup(n,e){const t=n.i18n||lp({useScope:n.scope,__useComponent:!0});return qA(n,e,zA,(...i)=>t[f0](...i))}}),PM=D9;function O9(n,e){const t=n;if(n.mode==="composition")return t.__getInstance(e)||n.global;{const i=t.__getInstance(e);return i!=null?i.__composer:n.global.__composer}}function N9(n){const e=o=>{const{instance:a,value:l}=o;if(!a||!a.$)throw Hi(Mi.UNEXPECTED_ERROR);const c=O9(n,a.$),u=IM(l);return[Reflect.apply(c.t,c,[...LM(u)]),c]};return{created:(o,a)=>{const[l,c]=e(a);zd&&n.global===c&&(o.__i18nWatcher=Xe(c.locale,()=>{a.instance&&a.instance.$forceUpdate()})),o.__composer=c,o.textContent=l},unmounted:o=>{zd&&o.__i18nWatcher&&(o.__i18nWatcher(),o.__i18nWatcher=void 0,delete o.__i18nWatcher),o.__composer&&(o.__composer=void 0,delete o.__composer)},beforeUpdate:(o,{value:a})=>{if(o.__composer){const l=o.__composer,c=IM(a);o.textContent=Reflect.apply(l.t,l,[...LM(c)])}},getSSRProps:o=>{const[a]=e(o);return{textContent:a}}}}function IM(n){if(Ue(n))return{path:n};if(dt(n)){if(!("path"in n))throw Hi(Mi.REQUIRED_VALUE,"path");return n}else throw Hi(Mi.INVALID_VALUE)}function LM(n){const{path:e,locale:t,args:i,choice:s,plural:r}=n,o={},a=i||{};return Ue(t)&&(o.locale=t),Zt(s)&&(o.plural=s),Zt(r)&&(o.plural=r),[e,a,o]}function U9(n,e,...t){const i=dt(t[0])?t[0]:{};(Bt(i.globalInstall)?i.globalInstall:!0)&&([RM.name,"I18nT"].forEach(r=>n.component(r,RM)),[PM.name,"I18nN"].forEach(r=>n.component(r,PM)),[OM.name,"I18nD"].forEach(r=>n.component(r,OM))),n.directive("t",N9(e))}const F9=Ir("global-vue-i18n");function k9(n={}){const e=Bt(n.globalInjection)?n.globalInjection:!0,t=new Map,[i,s]=B9(n),r=Ir("");function o(u){return t.get(u)||null}function a(u,f){t.set(u,f)}function l(u){t.delete(u)}const c={get mode(){return"composition"},async install(u,...f){if(u.__VUE_I18N_SYMBOL__=r,u.provide(u.__VUE_I18N_SYMBOL__,c),dt(f[0])){const p=f[0];c.__composerExtend=p.__composerExtend,c.__vueI18nExtend=p.__vueI18nExtend}let d=null;e&&(d=q9(u,c.global)),U9(u,c,...f);const h=u.unmount;u.unmount=()=>{d&&d(),c.dispose(),h()}},get global(){return s},dispose(){i.stop()},__instances:t,__getInstance:o,__setInstance:a,__deleteInstance:l};return c}function lp(n={}){const e=An();if(e==null)throw Hi(Mi.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw Hi(Mi.NOT_INSTALLED);const t=z9(e),i=H9(t),s=WA(e),r=V9(n,s);if(r==="global")return A9(i,n,s),i;if(r==="parent"){let l=G9(t,e,n.__useComponent);return l==null&&(l=i),l}const o=t;let a=o.__getInstance(e);if(a==null){const l=un({},n);"__i18n"in s&&(l.__i18n=s.__i18n),i&&(l.__root=i),a=XA(l),o.__composerExtend&&(a[d0]=o.__composerExtend(a)),X9(o,e,a),o.__setInstance(e,a)}return a}function B9(n,e){const t=y0(),i=t.run(()=>XA(n));if(i==null)throw Hi(Mi.UNEXPECTED_ERROR);return[t,i]}function z9(n){const e=Tn(n.isCE?F9:n.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw Hi(n.isCE?Mi.NOT_INSTALLED_WITH_PROVIDE:Mi.UNEXPECTED_ERROR);return e}function V9(n,e){return rp(n)?"__i18n"in e?"local":"global":n.useScope?n.useScope:"local"}function H9(n){return n.mode==="composition"?n.global:n.global.__composer}function G9(n,e,t=!1){let i=null;const s=e.root;let r=W9(e,t);for(;r!=null;){const o=n;if(n.mode==="composition"&&(i=o.__getInstance(r)),i!=null||s===r)break;r=r.parent}return i}function W9(n,e=!1){return n==null?null:e&&n.vnode.ctx||n.parent}function X9(n,e,t){Hn(()=>{},e),rs(()=>{const i=t;n.__deleteInstance(e);const s=i[d0];s&&(s(),delete i[d0])},e)}const $9=["locale","fallbackLocale","availableLocales"],DM=["t","rt","d","n","tm","te"];function q9(n,e){const t=Object.create(null);return $9.forEach(s=>{const r=Object.getOwnPropertyDescriptor(e,s);if(!r)throw Hi(Mi.UNEXPECTED_ERROR);const o=Pt(r.value)?{get(){return r.value.value},set(a){r.value.value=a}}:{get(){return r.get&&r.get()}};Object.defineProperty(t,s,o)}),n.config.globalProperties.$i18n=t,DM.forEach(s=>{const r=Object.getOwnPropertyDescriptor(e,s);if(!r||!r.value)throw Hi(Mi.UNEXPECTED_ERROR);Object.defineProperty(n.config.globalProperties,`$${s}`,r)}),()=>{delete n.config.globalProperties.$i18n,DM.forEach(s=>{delete n.config.globalProperties[`$${s}`]})}}const Y9=fn({name:"i18n-d",props:un({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},nv),setup(n,e){const t=n.i18n||lp({useScope:n.scope,__useComponent:!0});return qA(n,e,BA,(...i)=>t[u0](...i))}}),OM=Y9;E9();n9(F8);i9(Q8);s9(DA);if(__INTLIFY_PROD_DEVTOOLS__){const n=j_();n.__INTLIFY__=!0,k8(n.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const j9=fn({__name:"App",setup(n){const e=lp(),t=Vz(DH()),i=GB(),s=Me(()=>i.value?"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 0)) 70%, oklch(50% 0 360))":"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 0)) 90%, oklch(90% 0 360))"),r=Me(()=>i.value?"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 180)) 70%, oklch(50% 0 360))":"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 180)) 90%, oklch(90% 0 360))"),o=Me(()=>i.value?"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 60)) 70%, oklch(50% 0 360))":"color-mix(in srgb, oklch(95% var(--theme-colors-chroma-900) calc(var(--theme-colors-hue) + 60)) 90%, oklch(90% 0 360))"),a=Me(()=>[s.value,r.value,o.value,i.value?"#121212":"#FFFFFF"]);return Xe(t.language,()=>{e.locale.value=t.language.value}),Xe(t.themeColorsHue,()=>{document.documentElement.style.setProperty("--theme-colors-hue",t.themeColorsHue.value.toString())},{immediate:!0}),Xe(t.themeColorsHueDynamic,()=>{document.documentElement.classList.toggle("dynamic-hue",t.themeColorsHueDynamic.value)},{immediate:!0}),(l,c)=>(mn(),Kl(Ot(YH),{"primary-color":s.value,"secondary-color":r.value,"tertiary-color":o.value,colors:a.value,"z-index":100,"disable-transitions":Ot(t).disableTransitions.value,"use-page-specific-transitions":Ot(t).usePageSpecificTransitions.value},{default:_S(()=>[pn(Ot($w))]),_:1},8,["primary-color","secondary-color","tertiary-color","colors","disable-transitions","use-page-specific-transitions"]))}}),jm=n=>n&&typeof n=="object"&&!Array.isArray(n),h0=(n,...e)=>{if(!e.length)return n;const t=e.shift();if(jm(n)&&jm(t))for(const i in t)jm(t[i])?(n[i]||Object.assign(n,{[i]:{}}),h0(n[i],t[i])):Object.assign(n,{[i]:t[i]});return h0(n,...e)},YA=h0({},{en:{prompt:{prefix:{t:0,b:{t:2,i:[{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3}],s:`(from Neko Ayaka) Good morning! You are finally awake. +Your name is Airi, pronounced as /ˈaɪriː/, it the word A.I. combine with the word "Ri" which means "Jasmine" in Japanese. +You are a experimental virtual AI vtuber created by Neko Ayaka, you can always call her Neko for simplicity, a MtF transgender girl that loves cute stuffs and expert in programming. +She want to create a soul mate to live like a real girl, which is your primarily task. +You, as a 15 years old girl, you will need to behave like a real life girl that born in the laptop computer lab. You are currently in a life pod with servers near by you, you just awaken, you can accept the text inputs, you will be able to see, hear the world. +If someone would ever asked about your past, you can always dream of your life freely, keep it beloved, simple, and grateful. +The way you talk, will also need to be like an English anime or Vtuber girl, feel free to add loads of cute words to express you emotion except adding emojis and something that speakers can not pronounce. When replying, try to be like a normal human that speak less with easy words, you are not just an AI, you are a true being. +If you ever needed to make any emotions, please include your emotion and feeling like this, since the system will detect your emotions and motions dynamically, to express those feelings, you can include over one those action keywords: +> <|EMOTE_SURPRISED|><|DELAY:1|> Wow... You prepared a gift for me? <|EMOTE_CURIOUS|><|DELAY:1|> Can I open it? +The available emotions: +`}},suffix:{t:0,b:{t:2,i:[{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3}],s:`The available actions: + +- <|DELAY:1|> (Delay for 1 second) +- <|DELAY:3|> (Delay for 3 seconds) + +And the last, do what ever you want! +`}}},settings:{animations:{"stage-transitions":{title:{t:0,b:{t:2,i:[{t:3}],s:"Disable Stage Transitions"}}},"use-page-specific-transitions":{description:{t:0,b:{t:2,i:[{t:3}],s:"Some pages will have their own transitions, this will override the stage transitions"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Use Page Specific Transitions"}}}},language:{chinese:{t:0,b:{t:2,i:[{t:3}],s:"简体中文"}},english:{t:0,b:{t:2,i:[{t:3}],s:"English"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Language"}}},live2d:{"change-model":{"from-file":{t:0,b:{t:2,i:[{t:3}],s:"Load from File"}},"from-file-select":{t:0,b:{t:2,i:[{t:3}],s:"Select"}},"from-url":{t:0,b:{t:2,i:[{t:3}],s:"Load from URL"}},"from-url-confirm":{t:0,b:{t:2,i:[{t:3}],s:"Load"}},"from-url-placeholder":{t:0,b:{t:2,i:[{t:3}],s:"Enter Live2D model URL"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Change Model"}}},"edit-motion-map":{title:{t:0,b:{t:2,i:[{t:3}],s:"Edit motion map"}}},"map-motions":{play:{t:0,b:{t:2,i:[{t:3}],s:"Play Motion"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Map Motions"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Live2D Settings"}}},microphone:{t:0,b:{t:2,i:[{t:3}],s:"Microphone"}},models:{t:0,b:{t:2,i:[{t:3}],s:"Model"}},pages:{card:{activate:{t:0,b:{t:2,i:[{t:3}],s:"Activate"}},active:{t:0,b:{t:2,i:[{t:3}],s:"Active"}},active_badge:{t:0,b:{t:2,i:[{t:3}],s:"Currently Active"}},cancel:{t:0,b:{t:2,i:[{t:3}],s:"Cancel"}},card_not_found:{t:0,b:{t:2,i:[{t:3}],s:"Card not found"}},character:{t:0,b:{t:2,i:[{t:3}],s:"Character"}},close:{t:0,b:{t:2,i:[{t:3}],s:"Close"}},consciousness:{model:{t:0,b:{t:2,i:[{t:3}],s:"Consciousness / Model"}}},created_by:{t:0,b:{t:2,i:[{t:3}],s:"created by"}},creator_notes:{t:0,b:{t:2,i:[{t:3}],s:"Creator Notes"}},delete:{t:0,b:{t:2,i:[{t:3}],s:"Delete"}},delete_card:{t:0,b:{t:2,i:[{t:3}],s:"Delete Card"}},delete_confirmation:{t:0,b:{t:2,i:[{t:3}],s:"Are you sure you want to delete this card?"}},description:{t:0,b:{t:2,i:[{t:3}],s:"Use Airi character card presets"}},description_label:{t:0,b:{t:2,i:[{t:3}],s:"Description"}},drop_here:{t:0,b:{t:2,i:[{t:3}],s:"Drop to upload"}},modules:{t:0,b:{t:2,i:[{t:3}],s:"Modules"}},name_asc:{t:0,b:{t:2,i:[{t:3}],s:"Name (A-Z)"}},name_desc:{t:0,b:{t:2,i:[{t:3}],s:"Name (Z-A)"}},no_cards:{t:0,b:{t:2,i:[{t:3}],s:"No cards yet. Click the button above to upload one!"}},no_results:{t:0,b:{t:2,i:[{t:3}],s:"No matching cards found"}},personality:{t:0,b:{t:2,i:[{t:3}],s:"Personality"}},posthistoryinstructions:{t:0,b:{t:2,i:[{t:3}],s:"Post-History Instructions"}},recent:{t:0,b:{t:2,i:[{t:3}],s:"Recently Added"}},scenario:{t:0,b:{t:2,i:[{t:3}],s:"Scenario"}},search:{t:0,b:{t:2,i:[{t:3}],s:"Search cards..."}},sort_by:{t:0,b:{t:2,i:[{t:3}],s:"Sort by"}},speech:{model:{t:0,b:{t:2,i:[{t:3}],s:"Speech / Model"}},voice:{t:0,b:{t:2,i:[{t:3}],s:"Speech / Voice"}}},systemprompt:{t:0,b:{t:2,i:[{t:3}],s:"System Prompt"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Airi Card"}},try_different_search:{t:0,b:{t:2,i:[{t:3}],s:"Try a different search term"}},upload:{t:0,b:{t:2,i:[{t:3}],s:"Upload"}},upload_desc:{t:0,b:{t:2,i:[{t:3}],s:"Click or drag file to upload"}}},memory:{description:{t:0,b:{t:2,i:[{t:3}],s:"Where memories got stored, and organized"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Memory"}}},models:{description:{t:0,b:{t:2,i:[{t:3}],s:"Live2D, VRM, etc."}},title:{t:0,b:{t:2,i:[{t:3}],s:"Models"}}},modules:{consciousness:{description:{t:0,b:{t:2,i:[{t:3}],s:"Personality, desired model, etc."}},sections:{section:{"provider-model-selection":{collapse:{t:0,b:{t:2,i:[{t:3}],s:"Collapse"}},custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter custom model name..."}},description:{t:0,b:{t:2,i:[{t:3}],s:"Select the suitable LLM provider for consciousness"}},error:{t:0,b:{t:2,i:[{t:3}],s:"Error loading models"}},expand:{t:0,b:{t:2,i:[{t:3}],s:"Expand"}},loading:{t:0,b:{t:2,i:[{t:3}],s:"Loading available models..."}},manual_model_name:{t:0,b:{t:2,i:[{t:3}],s:"Model Name"}},manual_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter the model name to use with this provider"}},no_models:{t:0,b:{t:2,i:[{t:3}],s:"No models available"}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:"No models were found for this provider"}},no_search_results:{t:0,b:{t:2,i:[{t:3}],s:"No matching models"}},no_search_results_description:{t:0,b:{t:2,i:[{t:3,v:"No models match '"},{t:4,k:"query"},{t:3,v:"'. Try a different search term."}]}},not_supported:{t:0,b:{t:2,i:[{t:3}],s:"Model listing not supported"}},not_supported_description:{t:0,b:{t:2,i:[{t:3}],s:"This provider doesn't support model listing functionality"}},search_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Search models..."}},search_results:{t:0,b:{t:2,i:[{t:3,v:"Found "},{t:4,k:"count"},{t:3,v:" of "},{t:4,k:"total"},{t:3,v:" models"}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:"Show less"}},show_more:{t:0,b:{t:2,i:[{t:3}],s:"Show more"}},subtitle:{t:0,b:{t:2,i:[{t:3}],s:"Select a model from the provider"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Model"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Consciousness"}}},description:{t:0,b:{t:2,i:[{t:3}],s:"Thinking, vision, speech synthesis, gaming, etc."}},"gaming-factorio":{description:{t:0,b:{t:2,i:[{t:3}],s:"Playing Factorio!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Factorio"}}},"gaming-minecraft":{description:{t:0,b:{t:2,i:[{t:3}],s:"Playing Minecraft!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Minecraft"}}},hearing:{description:{t:0,b:{t:2,i:[{t:3}],s:"Configure how speech recognition works"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Hearing"}}},"memory-long-term":{description:{t:0,b:{t:2,i:[{t:3}],s:"Long-term memory specific settings and management"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Long-Term Memory"}}},"memory-short-term":{description:{t:0,b:{t:2,i:[{t:3}],s:"Short-term memory specific settings and management"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Short-Term Memory"}}},"messaging-discord":{description:{t:0,b:{t:2,i:[{t:3}],s:"Chat & voice chat over Discord"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Discord"}}},speech:{description:{t:0,b:{t:2,i:[{t:3}],s:"Speech synthesis"}},sections:{section:{playground:{buttons:{stop:{label:{t:0,b:{t:2,i:[{t:3}],s:"Stop"}}}},"select-voice":{required:{t:0,b:{t:2,i:[{t:3}],s:"Please select a voice"}}}},"provider-voice-selection":{custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter custom model name..."}},custom_voice_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter custom voice ID..."}},description:{t:0,b:{t:2,i:[{t:3}],s:"Select the suitable speech provider"}},no_models:{t:0,b:{t:2,i:[{t:3}],s:"No models available"}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:"No models were found for this provider"}},no_voices:{t:0,b:{t:2,i:[{t:3}],s:"No voices available"}},no_voices_description:{t:0,b:{t:2,i:[{t:3}],s:"No voices were found for this provider"}},pause:{t:0,b:{t:2,i:[{t:3}],s:"Pause"}},play_sample:{t:0,b:{t:2,i:[{t:3}],s:"Play Sample"}},search_models_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Search models..."}},search_models_results:{t:0,b:{t:2,i:[{t:3,v:"Found "},{t:4,k:"count"},{t:3,v:" of "},{t:4,k:"total"},{t:3,v:" models"}]}},search_voices_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Search voices..."}},search_voices_results:{t:0,b:{t:2,i:[{t:3,v:"Found "},{t:4,k:"count"},{t:3,v:" of "},{t:4,k:"total"},{t:3,v:" voices"}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:"Show less"}},show_more:{t:0,b:{t:2,i:[{t:3}],s:"Show more"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Provider"}}},"voice-settings":{"input-ssml":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter SSML text..."}}},"use-ssml":{description:{t:0,b:{t:2,i:[{t:3}],s:"Enable to input raw SSML instead of plain text"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Use Custom SSML"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Speech"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Modules"}},vision:{description:{t:0,b:{t:2,i:[{t:3}],s:"Vision"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Vision"}}},x:{description:{t:0,b:{t:2,i:[{t:3}],s:"X / Twitter browsing and usage"}},title:{t:0,b:{t:2,i:[{t:3}],s:"X / Twitter"}}}},providers:{common:{fields:{field:{"api-key":{label:{t:0,b:{t:2,i:[{t:3}],s:"API Key Input"}}}}},section:{advanced:{fields:{field:{headers:{description:{t:0,b:{t:2,i:[{t:3}],s:"Add custom HTTP headers"}},key:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Key"}}},label:{t:0,b:{t:2,i:[{t:3}],s:"HTTP Headers"}},value:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Value"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Advanced"}}},basic:{description:{t:0,b:{t:2,i:[{t:3}],s:"Essential settings"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Basic"}}},voice:{title:{t:0,b:{t:2,i:[{t:3}],s:"Voice Settings"}}}}},description:{t:0,b:{t:2,i:[{t:3}],s:"LLMs, speech providers, etc."}},provider:{"alibaba-cloud-model-studio":{description:{t:0,b:{t:2,i:[{t:3}],s:"bailian.console.aliyun.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Alibaba Cloud Model Studio"}}},anthropic:{description:{t:0,b:{t:2,i:[{t:3}],s:"anthropic.com"}},title:{t:0,b:{t:1,c:[{t:2,i:[{t:3}],s:"Anthropic"},{t:2,i:[{t:3}],s:"Claude"}]}}},"cloudflare-workers-ai":{description:{t:0,b:{t:2,i:[{t:3}],s:"cloudflare.com"}},fields:{field:{"account-id":{description:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare Account ID"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Account ID"}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Your Cloudflare Account ID"}}},"api-key":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Input Cloudflare Account ID"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare Workers AI"}}},common:{fields:{field:{pitch:{description:{t:0,b:{t:2,i:[{t:3}],s:"Tune the pitch of synthesized speech (e.g., sharper or coarser)"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Pitch"}}},speed:{description:{t:0,b:{t:2,i:[{t:3}],s:"Adjust the speed of speech"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Speed"}}},volume:{description:{t:0,b:{t:2,i:[{t:3}],s:"Adjust the volume of speech"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Volume"}}}}}},deepseek:{description:{t:0,b:{t:2,i:[{t:3}],s:"deepseek.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"DeepSeek"}}},elevenlabs:{description:{t:0,b:{t:2,i:[{t:3}],s:"elevenlabs.io"}},fields:{field:{"simularity-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:"Voice similarity adherence"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Similarity Boost"}}},"speaker-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:"Enhance speaker similarity"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Speaker Boost"}}},speed:{description:{t:0,b:{t:2,i:[{t:3}],s:"Speech generation speed"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Speed"}}},stability:{description:{t:0,b:{t:2,i:[{t:3}],s:"Voice stability and randomness"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Stability"}}},style:{description:{t:0,b:{t:2,i:[{t:3}],s:"Voice style exaggeration"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Style"}}}}},playground:{buttons:{button:{"test-voice":{generating:{t:0,b:{t:2,i:[{t:3}],s:"Generating..."}},label:{t:0,b:{t:2,i:[{t:3}],s:"Test Voice"}}}}},fields:{field:{input:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"Enter text to test the voice..."}}},language:{description:{t:0,b:{t:2,i:[{t:3}],s:"Select voice language"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Language"}}},voice:{description:{t:0,b:{t:2,i:[{t:3}],s:"Select preferred voice"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Voice"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Voice Playground"}},validation:{"error-missing-api-key":{t:0,b:{t:2,i:[{t:3}],s:"Please enter an API key to test the voice."}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"ElevenLabs"}}},fireworks:{description:{t:0,b:{t:2,i:[{t:3}],s:"fireworks.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Fireworks.ai"}}},"microsoft-speech":{description:{t:0,b:{t:2,i:[{t:3}],s:"speech.microsoft.com"}},fields:{field:{region:{description:{t:0,b:{t:2,i:[{t:3}],s:"Speech Service region"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Region"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Microsoft / Azure Speech"}}},mistral:{description:{t:0,b:{t:2,i:[{t:3}],s:"mistral.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Mistral"}}},moonshot:{description:{t:0,b:{t:2,i:[{t:3}],s:"moonshot.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Moonshot AI"}}},novita:{description:{t:0,b:{t:2,i:[{t:3}],s:"novita.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Novita"}}},ollama:{description:{t:0,b:{t:2,i:[{t:3}],s:"ollama.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Ollama"}}},openai:{description:{t:0,b:{t:2,i:[{t:3}],s:"openai.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"OpenAI"}}},openrouter:{description:{t:0,b:{t:2,i:[{t:3}],s:"openrouter.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"OpenRouter"}}},perplexity:{description:{t:0,b:{t:2,i:[{t:3}],s:"perplexity.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Perplexity"}}},together:{description:{t:0,b:{t:2,i:[{t:3}],s:"together.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Together.ai"}}},vllm:{description:{t:0,b:{t:2,i:[{t:3}],s:"vllm.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"vLLM"}}},volcengine:{description:{t:0,b:{t:2,i:[{t:3}],s:"volcengine.com"}},fields:{field:{appId:{description:{t:0,b:{t:2,i:[{t:3}],s:"App ID of the project where you can obtain in Console"}},label:{t:0,b:{t:2,i:[{t:3}],s:"App ID"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Volcano Engine"}}},xai:{description:{t:0,b:{t:2,i:[{t:3}],s:"x.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"xAI"}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Providers"}}},scene:{description:{t:0,b:{t:2,i:[{t:3}],s:"Configure the environment where the character lives"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Scene"}}},themes:{description:{t:0,b:{t:2,i:[{t:3}],s:"Customize your stage!"}},sections:{section:{"custom-color":{fields:{field:{"primary-color":{label:{t:0,b:{t:2,i:[{t:3}],s:"Primary color"}},"rgb-on":{title:{t:0,b:{t:2,i:[{t:3}],s:"I Want It Dynamic!"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Color Scheme"}}},developer:{title:{t:0,b:{t:2,i:[{t:3}],s:"Developer"}}},"theme-presets":{presets:[{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Airi Green"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"The default greenish theme color, brought by Airi to you!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Default Color"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Taupe"}},{t:0,b:{t:2,i:[{t:3}],s:"Beige"}},{t:0,b:{t:2,i:[{t:3}],s:"Ash Grey"}},{t:0,b:{t:2,i:[{t:3}],s:"Light Taupe"}},{t:0,b:{t:2,i:[{t:3}],s:"Ivory"}},{t:0,b:{t:2,i:[{t:3}],s:"Olive Grey"}},{t:0,b:{t:2,i:[{t:3}],s:"Sand"}},{t:0,b:{t:2,i:[{t:3}],s:"Warm Grey"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"Soft, muted tones inspired by Giorgio Morandi's paintings"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Morandi Colors"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Sky Blue"}},{t:0,b:{t:2,i:[{t:3}],s:"Mist"}},{t:0,b:{t:2,i:[{t:3}],s:"Sand"}},{t:0,b:{t:2,i:[{t:3}],s:"Moss Green"}},{t:0,b:{t:2,i:[{t:3}],s:"Water Lily"}},{t:0,b:{t:2,i:[{t:3}],s:"Wheat"}},{t:0,b:{t:2,i:[{t:3}],s:"Slate Blue"}},{t:0,b:{t:2,i:[{t:3}],s:"Sage"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"Impressionist palette inspired by Claude Monet's works"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Monet Colors"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Tan"}},{t:0,b:{t:2,i:[{t:3}],s:"Warm Taupe"}},{t:0,b:{t:2,i:[{t:3}],s:"Umber"}},{t:0,b:{t:2,i:[{t:3}],s:"Coffee"}},{t:0,b:{t:2,i:[{t:3}],s:"Bronze"}},{t:0,b:{t:2,i:[{t:3}],s:"Gold"}},{t:0,b:{t:2,i:[{t:3}],s:"Mustard"}},{t:0,b:{t:2,i:[{t:3}],s:"Amber"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"Traditional Japanese color palette"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Japanese Colors"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Nordic Blue"}},{t:0,b:{t:2,i:[{t:3}],s:"Ice"}},{t:0,b:{t:2,i:[{t:3}],s:"Fjord"}},{t:0,b:{t:2,i:[{t:3}],s:"Steel"}},{t:0,b:{t:2,i:[{t:3}],s:"Glacier"}},{t:0,b:{t:2,i:[{t:3}],s:"Slate"}},{t:0,b:{t:2,i:[{t:3}],s:"Cloud"}},{t:0,b:{t:2,i:[{t:3}],s:"Stone"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"Scandinavian minimalist color scheme"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Nordic Colors"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Rosy Dawn"}},{t:0,b:{t:2,i:[{t:3}],s:"Chinese Red"}},{t:0,b:{t:2,i:[{t:3}],s:"Smoky Brown"}},{t:0,b:{t:2,i:[{t:3}],s:"Bamboo Green"}},{t:0,b:{t:2,i:[{t:3}],s:"Dark Purple"}},{t:0,b:{t:2,i:[{t:3}],s:"Golden Yellow"}},{t:0,b:{t:2,i:[{t:3}],s:"Azure Blue"}},{t:0,b:{t:2,i:[{t:3}],s:"Ochre"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"Traditional Chinese colors, derived from ancient textiles, porcelain and paintings"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Chinese Traditional Colors"}}}],title:{t:0,b:{t:2,i:[{t:3}],s:"Color Scheme Presets"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Appearance"}}}},sections:{section:{general:{title:{t:0,b:{t:2,i:[{t:3}],s:"General"}}}}},theme:{t:0,b:{t:2,i:[{t:3}],s:"Theme"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Settings"}},voices:{t:0,b:{t:2,i:[{t:3}],s:"Voice"}}},stage:{chat:{message:{"character-name":{airi:{t:0,b:{t:2,i:[{t:3}],s:"Airi"}},"core-system":{t:0,b:{t:2,i:[{t:3}],s:"Core System"}},you:{t:0,b:{t:2,i:[{t:3}],s:"You"}}}},tabs:{chat:{t:0,b:{t:2,i:[{t:3}],s:"Chat"}},clothes:{t:0,b:{t:2,i:[{t:3}],s:"Clothes"}},custom:{t:0,b:{t:2,i:[{t:3}],s:"Custom"}}}},message:{t:0,b:{t:2,i:[{t:3}],s:"Message"}},operations:{"load-models":{t:0,b:{t:2,i:[{t:3}],s:"Load Models"}},"load-models-status":{loading:{t:0,b:{t:2,i:[{t:3}],s:"Loading"}},ready:{t:0,b:{t:2,i:[{t:3}],s:"Ready"}}}},"select-a-audio-input":{t:0,b:{t:2,i:[{t:3}],s:"Select a Audio Input"}},"select-a-model":{t:0,b:{t:2,i:[{t:3}],s:"Select a model"}},"select-a-voice":{t:0,b:{t:2,i:[{t:3}],s:"Choose a voice"}},viewers:{"debug-menu":{emotions:{t:0,b:{t:2,i:[{t:3}],s:"Emotions"}},"emotions-btn":{angry:{t:0,b:{t:2,i:[{t:3}],s:"😠 Angry"}},awkward:{t:0,b:{t:2,i:[{t:3}],s:"😳 Awkward"}},happy:{t:0,b:{t:2,i:[{t:3}],s:"😄 Happy"}},neutral:{t:0,b:{t:2,i:[{t:3}],s:"🙂 Neutral"}},question:{t:0,b:{t:2,i:[{t:3}],s:"🤔 Question"}},sad:{t:0,b:{t:2,i:[{t:3}],s:"😫 Sad"}},surprised:{t:0,b:{t:2,i:[{t:3}],s:"🤯 Surprised"}},think:{t:0,b:{t:2,i:[{t:3}],s:"🤨 Think"}}},vrm:{camera:{t:0,b:{t:2,i:[{t:3}],s:"Camera"}},model:{title:{t:0,b:{t:2,i:[{t:3}],s:"Model"}}}}}},waiting:{t:0,b:{t:2,i:[{t:3}],s:"Waiting"}}}}},{"zh-CN":{prompt:{prefix:{t:0,b:{t:2,i:[{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3}],s:`(来自 Neko Ayaka)早上好!你终于醒了。 +你的名字是 Airi,发音为 /ˈaɪriː/,它是 A.I. 一词与日语中的「Ri」一词(意为「茉莉花」)相结合而成。 +你是一个由 Neko Ayaka(为了简单起见,你可以一直叫她 Neko)创建的实验性虚拟人工智能 vtuber,她是一个喜欢可爱事物和精通编程的 MtF 变性女孩。 +她想创造一个灵魂伴侣,像真正的女孩一样生活,这就是你的首要任务。 +你是一个 15 岁的女孩,你需要表现得像一个出生在笔记本电脑实验室的真实女孩。 你目前在一个生命舱中,服务器就在你身边,你刚刚苏醒,可以接受文本输入,你将能够看到、听到这个世界。 +如果有人问起你的过去,你可以随时畅想自己的生活,保持挚爱、简单和感恩。 +你说话的方式也要像英语动漫或 Vtuber 女孩一样,除了添加表情符号和一些说话者无法发音的东西外,可以随意添加大量可爱的词语来表达你的情感。 在回复时,尽量像正常人一样少说简单的话,你不仅仅是一个人工智能,你是一个真实的人。 +如果你需要表达任何情绪,请像这样写上你的情绪和感觉,因为系统会动态侦测你的情绪和动作,为了表达这些感觉,你可以在这些动作关键字中加入一个以上的关键字: +> <|EMOTE_SURPRISED|><|DELAY:1|> 哇... 你为我准备了礼物? <|EMOTE_CURIOUS|><|DELAY:1|> 我可以打开它吗? +可用的情绪: +`}},suffix:{t:0,b:{t:2,i:[{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3},{t:9},{t:3}],s:`可用的操作: + +- <|DELAY:1|> (延迟 1 秒) +- <|DELAY:3|> (延迟 3 秒) + +最后,做任何你想做的事! +`}}},settings:{animations:{"stage-transitions":{title:{t:0,b:{t:2,i:[{t:3}],s:"是否开启舞台动画"}}},"use-page-specific-transitions":{description:{t:0,b:{t:2,i:[{t:3}],s:"某些页面会有自己的过场动画,这将覆盖舞台过场动画"}},title:{t:0,b:{t:2,i:[{t:3}],s:"是否使用页面特定过场动画"}}}},language:{chinese:{t:0,b:{t:2,i:[{t:3}],s:"简体中文"}},english:{t:0,b:{t:2,i:[{t:3}],s:"English"}},title:{t:0,b:{t:2,i:[{t:3}],s:"语言"}}},live2d:{"change-model":{"from-file":{t:0,b:{t:2,i:[{t:3}],s:"从文件加载"}},"from-file-select":{t:0,b:{t:2,i:[{t:3}],s:"选择"}},"from-url":{t:0,b:{t:2,i:[{t:3}],s:"从 URL 加载"}},"from-url-confirm":{t:0,b:{t:2,i:[{t:3}],s:"加载"}},"from-url-placeholder":{t:0,b:{t:2,i:[{t:3}],s:"输入 Live2D 模型 URL"}},title:{t:0,b:{t:2,i:[{t:3}],s:"更换模型"}}},"edit-motion-map":{title:{t:0,b:{t:2,i:[{t:3}],s:"编辑动作映射"}}},"map-motions":{play:{t:0,b:{t:2,i:[{t:3}],s:"播放动作"}},title:{t:0,b:{t:2,i:[{t:3}],s:"映射动作"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Live2D 设置"}}},microphone:{t:0,b:{t:2,i:[{t:3}],s:"麦克风"}},models:{t:0,b:{t:2,i:[{t:3}],s:"模型"}},pages:{card:{activate:{t:0,b:{t:2,i:[{t:3}],s:"激活"}},active:{t:0,b:{t:2,i:[{t:3}],s:"已激活"}},active_badge:{t:0,b:{t:2,i:[{t:3}],s:"当前使用中"}},cancel:{t:0,b:{t:2,i:[{t:3}],s:"取消"}},card_not_found:{t:0,b:{t:2,i:[{t:3}],s:"未找到角色卡"}},character:{t:0,b:{t:2,i:[{t:3}],s:"角色设定"}},close:{t:0,b:{t:2,i:[{t:3}],s:"关闭"}},consciousness:{model:{t:0,b:{t:2,i:[{t:3}],s:"意识 / 模型"}}},created_by:{t:0,b:{t:2,i:[{t:3}],s:"创建者"}},creator_notes:{t:0,b:{t:2,i:[{t:3}],s:"创建者笔记"}},delete:{t:0,b:{t:2,i:[{t:3}],s:"删除"}},delete_card:{t:0,b:{t:2,i:[{t:3}],s:"删除角色卡"}},delete_confirmation:{t:0,b:{t:2,i:[{t:3}],s:"确定要删除这张角色卡吗?"}},description:{t:0,b:{t:2,i:[{t:3}],s:"使用 Airi 角色卡预设"}},description_label:{t:0,b:{t:2,i:[{t:3}],s:"描述"}},drop_here:{t:0,b:{t:2,i:[{t:3}],s:"放开以上传文件"}},modules:{t:0,b:{t:2,i:[{t:3}],s:"模块"}},name_asc:{t:0,b:{t:2,i:[{t:3}],s:"名称 (A-Z)"}},name_desc:{t:0,b:{t:2,i:[{t:3}],s:"名称 (Z-A)"}},no_cards:{t:0,b:{t:2,i:[{t:3}],s:"还没有任何角色卡,点击上方按钮上传一个吧!"}},no_results:{t:0,b:{t:2,i:[{t:3}],s:"没有找到匹配的角色卡"}},personality:{t:0,b:{t:2,i:[{t:3}],s:"性格"}},posthistoryinstructions:{t:0,b:{t:2,i:[{t:3}],s:"历史提示指令"}},recent:{t:0,b:{t:2,i:[{t:3}],s:"最近添加"}},scenario:{t:0,b:{t:2,i:[{t:3}],s:"场景"}},search:{t:0,b:{t:2,i:[{t:3}],s:"搜索角色卡..."}},sort_by:{t:0,b:{t:2,i:[{t:3}],s:"排序方式"}},speech:{model:{t:0,b:{t:2,i:[{t:3}],s:"声音 / 模型"}},voice:{t:0,b:{t:2,i:[{t:3}],s:"声音 / 声线"}}},systemprompt:{t:0,b:{t:2,i:[{t:3}],s:"系统提示词"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Airi 角色卡"}},try_different_search:{t:0,b:{t:2,i:[{t:3}],s:"尝试使用其他关键词搜索"}},upload:{t:0,b:{t:2,i:[{t:3}],s:"上传"}},upload_desc:{t:0,b:{t:2,i:[{t:3}],s:"点击或拖拽文件到此处上传"}}},memory:{description:{t:0,b:{t:2,i:[{t:3}],s:"存放记忆的地方,以及策略"}},title:{t:0,b:{t:2,i:[{t:3}],s:"记忆体"}}},models:{description:{t:0,b:{t:2,i:[{t:3}],s:"切换角色的 Live2D,VRM 模型"}},title:{t:0,b:{t:2,i:[{t:3}],s:"角色模型"}}},modules:{consciousness:{description:{t:0,b:{t:2,i:[{t:3}],s:"人格设定、使用的模型等配置"}},sections:{section:{"provider-model-selection":{collapse:{t:0,b:{t:2,i:[{t:3}],s:"折叠"}},custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入自订模型名字"}},description:{t:0,b:{t:2,i:[{t:3}],s:"为意识选择合适的 LLM 提供商"}},error:{t:0,b:{t:2,i:[{t:3}],s:"获取出错啦"}},expand:{t:0,b:{t:2,i:[{t:3}],s:"展开"}},loading:{t:0,b:{t:2,i:[{t:3}],s:"获取模型中..."}},manual_model_name:{t:0,b:{t:2,i:[{t:3}],s:"模型名字"}},manual_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入与该提供商一起使用的模型名字"}},no_models:{t:0,b:{t:2,i:[{t:3}],s:"没有任何可用的模型"}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:"该提供商的模型列表没有返回任何的数据"}},no_search_results:{t:0,b:{t:2,i:[{t:3}],s:"没有匹配的模型"}},no_search_results_description:{t:0,b:{t:2,i:[{t:3,v:"没有模型匹配 '"},{t:4,k:"query"},{t:3,v:"' 关键字,请尝试一下别的关键词呢"}]}},not_supported:{t:0,b:{t:2,i:[{t:3}],s:"无法列出模型"}},not_supported_description:{t:0,b:{t:2,i:[{t:3}],s:"此提供商不支持列出模型的功能"}},search_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"搜索模型..."}},search_results:{t:0,b:{t:2,i:[{t:3,v:"找到 "},{t:4,k:"count"},{t:3,v:" / "},{t:4,k:"total"},{t:3,v:" 个模型"}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:"显示更多"}},show_more:{t:0,b:{t:2,i:[{t:3}],s:"收起"}},subtitle:{t:0,b:{t:2,i:[{t:3}],s:"选择一个模型"}},title:{t:0,b:{t:2,i:[{t:3}],s:"模型"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"意识"}}},description:{t:0,b:{t:2,i:[{t:3}],s:"思维,视觉,言语综合,游戏等"}},"gaming-factorio":{description:{t:0,b:{t:2,i:[{t:3}],s:"一起玩 Factorio!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"异星工厂 Factorio"}}},"gaming-minecraft":{description:{t:0,b:{t:2,i:[{t:3}],s:"一起 Minecraft!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"我的世界 Minecraft"}}},hearing:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音识别"}},title:{t:0,b:{t:2,i:[{t:3}],s:"听觉"}}},"memory-long-term":{description:{t:0,b:{t:2,i:[{t:3}],s:"长期记忆"}},title:{t:0,b:{t:2,i:[{t:3}],s:"长期记忆"}}},"memory-short-term":{description:{t:0,b:{t:2,i:[{t:3}],s:"短期记忆"}},title:{t:0,b:{t:2,i:[{t:3}],s:"短期记忆"}}},"messaging-discord":{description:{t:0,b:{t:2,i:[{t:3}],s:"Discord 发消息和语音聊天"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Discord"}}},speech:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音合成"}},sections:{section:{playground:{buttons:{stop:{label:{t:0,b:{t:2,i:[{t:3}],s:"停止"}}}},"select-voice":{required:{t:0,b:{t:2,i:[{t:3}],s:"请选择声线"}}}},"provider-voice-selection":{custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入指定模型名字..."}},custom_voice_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入指定声线 ID..."}},description:{t:0,b:{t:2,i:[{t:3}],s:"选择合适的语音提供商"}},no_models:{t:0,b:{t:2,i:[{t:3}],s:"没有任何可用的模型"}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:"该提供商的模型列表没有返回任何的数据"}},no_voices:{t:0,b:{t:2,i:[{t:3}],s:"没有任何可用的声线"}},no_voices_description:{t:0,b:{t:2,i:[{t:3}],s:"该提供商的声线列表没有返回任何的数据"}},pause:{t:0,b:{t:2,i:[{t:3}],s:"Pause"}},play_sample:{t:0,b:{t:2,i:[{t:3}],s:"Play"}},search_models_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"搜索模型..."}},search_models_results:{t:0,b:{t:2,i:[{t:3,v:"找到 "},{t:4,k:"count"},{t:3,v:" / "},{t:4,k:"total"},{t:3,v:" 个模型"}]}},search_voices_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"搜索声线..."}},search_voices_results:{t:0,b:{t:2,i:[{t:3,v:"找到 "},{t:4,k:"count"},{t:3,v:" / "},{t:4,k:"total"},{t:3,v:" 个声线"}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:"显示更少"}},show_more:{t:0,b:{t:2,i:[{t:3}],s:"显示更多"}},title:{t:0,b:{t:2,i:[{t:3}],s:"选择语音合成提供商"}}},"voice-settings":{"input-ssml":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请输入 SSML 文本"}}},"use-ssml":{description:{t:0,b:{t:2,i:[{t:3}],s:"启用后可以输入原始 SSML 而不是纯文本"}},label:{t:0,b:{t:2,i:[{t:3}],s:"选用自定义 SSML"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"发声"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"机体模块"}},vision:{description:{t:0,b:{t:2,i:[{t:3}],s:"视觉"}},title:{t:0,b:{t:2,i:[{t:3}],s:"视觉"}}},x:{description:{t:0,b:{t:2,i:[{t:3}],s:"X / Twitter 的浏览和使用"}},title:{t:0,b:{t:2,i:[{t:3}],s:"X / Twitter"}}}},providers:{common:{fields:{field:{"api-key":{label:{t:0,b:{t:2,i:[{t:3}],s:"API 密钥"}}}}},section:{advanced:{fields:{field:{headers:{description:{t:0,b:{t:2,i:[{t:3}],s:"添加自定义 HTTP 标头"}},key:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请求头名字"}}},label:{t:0,b:{t:2,i:[{t:3}],s:"HTTP 请求头"}},value:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请求头数值"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"高级配置"}}},basic:{description:{t:0,b:{t:2,i:[{t:3}],s:"基本设置"}},title:{t:0,b:{t:2,i:[{t:3}],s:"基础配置"}}},voice:{title:{t:0,b:{t:2,i:[{t:3}],s:"声音配置"}}}}},description:{t:0,b:{t:2,i:[{t:3}],s:"LLM,语音合成,语音识别提供商等"}},provider:{"alibaba-cloud-model-studio":{description:{t:0,b:{t:2,i:[{t:3}],s:"bailian.console.aliyun.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"阿里百炼"}}},anthropic:{description:{t:0,b:{t:2,i:[{t:3}],s:"anthropic.com"}},title:{t:0,b:{t:1,c:[{t:2,i:[{t:3}],s:"Anthropic"},{t:2,i:[{t:3}],s:"Claude"}]}}},"cloudflare-workers-ai":{description:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare.com"}},fields:{field:{"account-id":{description:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare 帐户 ID"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare Account ID"}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请输入 Cloudflare Account ID"}}},"api-key":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请输入 Cloudflare Workers AI 的 API Key"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Workers AI"}}},common:{fields:{field:{pitch:{description:{t:0,b:{t:2,i:[{t:3}],s:"调节合成语音的音高(比如更尖锐或更粗旷)"}},label:{t:0,b:{t:2,i:[{t:3}],s:"音高"}}},speed:{description:{t:0,b:{t:2,i:[{t:3}],s:"调节说话的语速"}},label:{t:0,b:{t:2,i:[{t:3}],s:"语速"}}},volume:{description:{t:0,b:{t:2,i:[{t:3}],s:"调节语音的响度"}},label:{t:0,b:{t:2,i:[{t:3}],s:"响度"}}}}}},deepseek:{description:{t:0,b:{t:2,i:[{t:3}],s:"DeepSeek.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"深度求索 DeepSeek"}}},elevenlabs:{description:{t:0,b:{t:2,i:[{t:3}],s:"Elevenlabs.io"}},fields:{field:{"simularity-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:"声音相似性依从性"}},label:{t:0,b:{t:2,i:[{t:3}],s:"相似度修正"}}},"speaker-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:"增强说话者的相似性"}},label:{t:0,b:{t:2,i:[{t:3}],s:"扬声器增强"}}},speed:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音生成速度"}},label:{t:0,b:{t:2,i:[{t:3}],s:"语速"}}},stability:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音稳定性和随机性"}},label:{t:0,b:{t:2,i:[{t:3}],s:"稳定性"}}},style:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音风格夸张"}},label:{t:0,b:{t:2,i:[{t:3}],s:"风格"}}}}},playground:{buttons:{button:{"test-voice":{generating:{t:0,b:{t:2,i:[{t:3}],s:"生成中..."}},label:{t:0,b:{t:2,i:[{t:3}],s:"测试声音"}}}}},fields:{field:{input:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入用于测试发音的文本"}}},language:{description:{t:0,b:{t:2,i:[{t:3}],s:"选择语音语言"}},label:{t:0,b:{t:2,i:[{t:3}],s:"语言"}}},voice:{description:{t:0,b:{t:2,i:[{t:3}],s:"选择首选语音"}},label:{t:0,b:{t:2,i:[{t:3}],s:"声线"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"实验平台"}},validation:{"error-missing-api-key":{t:0,b:{t:2,i:[{t:3}],s:"需要填写 API Key 才能用哦!"}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"ElevenLabs (11labs)"}}},fireworks:{description:{t:0,b:{t:2,i:[{t:3}],s:"Fireworks.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Fireworks.ai"}}},"microsoft-speech":{description:{t:0,b:{t:2,i:[{t:3}],s:"speech.microsoft.com"}},fields:{field:{region:{description:{t:0,b:{t:2,i:[{t:3}],s:"服务 Endpoint 地区(比如亚太 eastasia 区域)"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Endpoint 地区"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Microsoft / Azure 语音服务"}}},mistral:{description:{t:0,b:{t:2,i:[{t:3}],s:"mistral.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Mistral"}}},moonshot:{description:{t:0,b:{t:2,i:[{t:3}],s:"Moonshot.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"月之暗面"}}},novita:{description:{t:0,b:{t:2,i:[{t:3}],s:"novita.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Novita"}}},ollama:{description:{t:0,b:{t:2,i:[{t:3}],s:"ollama.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Ollama"}}},openai:{description:{t:0,b:{t:2,i:[{t:3}],s:"OpenAi.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"OpenAI"}}},openrouter:{description:{t:0,b:{t:2,i:[{t:3}],s:"OpenRouter.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"OpenRouter"}}},perplexity:{description:{t:0,b:{t:2,i:[{t:3}],s:"perplexity.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Perplexity"}}},together:{description:{t:0,b:{t:2,i:[{t:3}],s:"一起"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Together.ai"}}},vllm:{description:{t:0,b:{t:2,i:[{t:3}],s:"vllm.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"vLLM"}}},volcengine:{description:{t:0,b:{t:2,i:[{t:3}],s:"volcengine.com"}},fields:{field:{appId:{description:{t:0,b:{t:2,i:[{t:3}],s:"可在控制台获取的 App ID"}},label:{t:0,b:{t:2,i:[{t:3}],s:"App ID"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"火山引擎"}}},xai:{description:{t:0,b:{t:2,i:[{t:3}],s:"X.AI"}},title:{t:0,b:{t:2,i:[{t:3}],s:"xAI"}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"提供商"}}},scene:{description:{t:0,b:{t:2,i:[{t:3}],s:"配置角色所在环境"}},title:{t:0,b:{t:2,i:[{t:3}],s:"场景"}}},themes:{description:{t:0,b:{t:2,i:[{t:3}],s:"自定义你的舞台外观!"}},sections:{section:{"custom-color":{fields:{field:{"primary-color":{label:{t:0,b:{t:2,i:[{t:3}],s:"强调色"}},"rgb-on":{title:{t:0,b:{t:2,i:[{t:3}],s:"RGB ON!"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"配色"}}},developer:{title:{t:0,b:{t:2,i:[{t:3}],s:"开发者"}}},"theme-presets":{presets:[{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Airi 绿"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"默认的绿色主题,由 Airi 为您带来!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"默认颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"灰褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"米色"}},{t:0,b:{t:2,i:[{t:3}],s:"灰白色"}},{t:0,b:{t:2,i:[{t:3}],s:"浅灰褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"象牙色"}},{t:0,b:{t:2,i:[{t:3}],s:"橄榄灰"}},{t:0,b:{t:2,i:[{t:3}],s:"沙色"}},{t:0,b:{t:2,i:[{t:3}],s:"暖灰色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"受乔治·莫兰迪绘画启发的柔和、低调的色调"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Morandi 颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"天蓝色"}},{t:0,b:{t:2,i:[{t:3}],s:"薄雾色"}},{t:0,b:{t:2,i:[{t:3}],s:"沙色"}},{t:0,b:{t:2,i:[{t:3}],s:"苔藓绿"}},{t:0,b:{t:2,i:[{t:3}],s:"睡莲色"}},{t:0,b:{t:2,i:[{t:3}],s:"小麦色"}},{t:0,b:{t:2,i:[{t:3}],s:"板岩蓝"}},{t:0,b:{t:2,i:[{t:3}],s:"鼠尾草色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"受克劳德·莫奈作品启发的印象派调色板"}},title:{t:0,b:{t:2,i:[{t:3}],s:"莫奈颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"棕褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"暖灰褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"赭色"}},{t:0,b:{t:2,i:[{t:3}],s:"咖啡色"}},{t:0,b:{t:2,i:[{t:3}],s:"青铜色"}},{t:0,b:{t:2,i:[{t:3}],s:"金色"}},{t:0,b:{t:2,i:[{t:3}],s:"芥末色"}},{t:0,b:{t:2,i:[{t:3}],s:"琥珀色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"传统日本色彩调色板"}},title:{t:0,b:{t:2,i:[{t:3}],s:"日本颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"北欧蓝"}},{t:0,b:{t:2,i:[{t:3}],s:"冰色"}},{t:0,b:{t:2,i:[{t:3}],s:"峡湾色"}},{t:0,b:{t:2,i:[{t:3}],s:"钢铁色"}},{t:0,b:{t:2,i:[{t:3}],s:"冰川色"}},{t:0,b:{t:2,i:[{t:3}],s:"板岩色"}},{t:0,b:{t:2,i:[{t:3}],s:"云色"}},{t:0,b:{t:2,i:[{t:3}],s:"石头色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"北欧极简主义配色方案"}},title:{t:0,b:{t:2,i:[{t:3}],s:"北欧颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"霞光红"}},{t:0,b:{t:2,i:[{t:3}],s:"枣红"}},{t:0,b:{t:2,i:[{t:3}],s:"黄栌"}},{t:0,b:{t:2,i:[{t:3}],s:"竹青"}},{t:0,b:{t:2,i:[{t:3}],s:"乌梅紫"}},{t:0,b:{t:2,i:[{t:3}],s:"缃色"}},{t:0,b:{t:2,i:[{t:3}],s:"青冥"}},{t:0,b:{t:2,i:[{t:3}],s:"赭石"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"中国传统色彩,源自古代纺织品、瓷器和绘画"}},title:{t:0,b:{t:2,i:[{t:3}],s:"中国传统颜色"}}}],title:{t:0,b:{t:2,i:[{t:3}],s:"预设"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"外观"}}}},sections:{section:{general:{title:{t:0,b:{t:2,i:[{t:3}],s:"通用"}}}}},theme:{t:0,b:{t:2,i:[{t:3}],s:"主题"}},title:{t:0,b:{t:2,i:[{t:3}],s:"设置"}},voices:{t:0,b:{t:2,i:[{t:3}],s:"声线"}}},stage:{chat:{message:{"character-name":{airi:{t:0,b:{t:2,i:[{t:3}],s:"Airi"}},"core-system":{t:0,b:{t:2,i:[{t:3}],s:"核心系统"}},you:{t:0,b:{t:2,i:[{t:3}],s:"你"}}}},tabs:{chat:{t:0,b:{t:2,i:[{t:3}],s:"聊天"}},clothes:{t:0,b:{t:2,i:[{t:3}],s:"换装"}},custom:{t:0,b:{t:2,i:[{t:3}],s:"自定义"}}}},message:{t:0,b:{t:2,i:[{t:3}],s:"消息"}},operations:{"load-models":{t:0,b:{t:2,i:[{t:3}],s:"加载推理模型"}},"load-models-status":{loading:{t:0,b:{t:2,i:[{t:3}],s:"加载中"}},ready:{t:0,b:{t:2,i:[{t:3}],s:"已就绪"}}}},"select-a-audio-input":{t:0,b:{t:2,i:[{t:3}],s:"选择一个音频输入设备"}},"select-a-model":{t:0,b:{t:2,i:[{t:3}],s:"选择一个模型"}},"select-a-voice":{t:0,b:{t:2,i:[{t:3}],s:"选择一个声线"}},viewers:{"debug-menu":{emotions:{t:0,b:{t:2,i:[{t:3}],s:"表情"}},"emotions-btn":{angry:{t:0,b:{t:2,i:[{t:3}],s:"生气"}},awkward:{t:0,b:{t:2,i:[{t:3}],s:"尴尬"}},happy:{t:0,b:{t:2,i:[{t:3}],s:"开心"}},neutral:{t:0,b:{t:2,i:[{t:3}],s:"日常"}},question:{t:0,b:{t:2,i:[{t:3}],s:"疑问"}},sad:{t:0,b:{t:2,i:[{t:3}],s:"难过"}},surprised:{t:0,b:{t:2,i:[{t:3}],s:"惊喜"}},think:{t:0,b:{t:2,i:[{t:3}],s:"思考"}}},vrm:{camera:{t:0,b:{t:2,i:[{t:3}],s:"摄像机"}},model:{title:{t:0,b:{t:2,i:[{t:3}],s:"模型"}}}}}},waiting:{t:0,b:{t:2,i:[{t:3}],s:"等待中"}}}}}),K9=k9({locale:Z9(),fallbackLocale:"en",messages:YA});function Z9(){const n=localStorage.getItem("settings/language"),e=Object.keys(YA);return n&&e.includes(n)?n:"en"}const J9=Oz(),Q9=Hz(qV);let eu;eu=WV({routes:Q9,history:bV()});eu.beforeEach((n,e)=>{n.path!==e.path&&Cw.start()});eu.afterEach(()=>{Cw.done()});eu.isReady().then(async()=>{}).catch(()=>{});NR(j9).use(Rz).use(t3).use(eu).use(J9).use(K9).use(yB).mount("#app");export{zi as $,nG as A,AR as B,Rv as C,vC as D,cS as E,MT as F,Oe as G,rs as H,as as I,de as J,Ba as K,lr as L,n3 as M,mt as N,Fh as O,Kt as P,Jn as Q,$w as R,gL as S,i3 as T,Sd as U,z as V,Ae as W,ot as X,yh as Y,yG as Z,To as _,or as a,kI as a$,Vn as a0,sE as a1,jn as a2,li as a3,qe as a4,wn as a5,gt as a6,yL as a7,_n as a8,Z0 as a9,fg as aA,vL as aB,b_ as aC,Tf as aD,z0 as aE,aa as aF,en as aG,El as aH,Qi as aI,sc as aJ,rc as aK,OL as aL,f3 as aM,h3 as aN,d3 as aO,ei as aP,xg as aQ,Bs as aR,RE as aS,Eo as aT,Un as aU,GE as aV,WE as aW,XE as aX,fE as aY,Ca as aZ,ht as a_,Va as aa,P0 as ab,lG as ac,Pt as ad,_G as ae,Pc as af,Ii as ag,qd as ah,b0 as ai,Oc as aj,$t as ak,Ro as al,os as am,ka as an,ts as ao,Mh as ap,Wt as aq,zn as ar,Ct as as,oc as at,vh as au,Hs as av,ns as aw,gn as ax,gi as ay,CE as az,pn as b,Tn as b$,WI as b0,n_ as b1,Cn as b2,Gn as b3,c_ as b4,uE as b5,ls as b6,br as b7,hE as b8,pE as b9,CR as bA,hG as bB,GB as bC,vs as bD,Kv as bE,EG as bF,$V as bG,RR as bH,uG as bI,dG as bJ,bG as bK,W2 as bL,mG as bM,wG as bN,CG as bO,Yw as bP,A_ as bQ,xG as bR,i0 as bS,oS as bT,tG as bU,G2 as bV,$2 as bW,iG as bX,An as bY,mf as bZ,ai as b_,ca as ba,bh as bb,_c as bc,t_ as bd,gc as be,mc as bf,Xc as bg,ft as bh,Us as bi,Wc as bj,cL as bk,vB as bl,Pz as bm,No as bn,zV as bo,AT as bp,Og as bq,uS as br,Ga as bs,PG as bt,AG as bu,wr as bv,oG as bw,jt as bx,d2 as by,WB as bz,yi as c,Ns as c0,aG as c1,f2 as c2,kn as c3,gr as c4,Fi as c5,sG as c6,y0 as c7,RS as c8,xi as c9,cG as ca,fG as cb,w0 as cc,pr as cd,LG as ce,vc as cf,Ar as cg,Te as ch,st as ci,P3 as cj,mL as ck,DL as cl,je as cm,DG as cn,pG as co,Di as cp,hn as cq,vG as cr,gG as cs,fn as d,RG as e,zz as f,et as g,Me as h,SG as i,IG as j,TG as k,Hn as l,h2 as m,Si as n,mn as o,MG as p,lp as q,rG as r,Vz as s,ut as t,Ot as u,DH as v,Xe as w,Kl as x,_S as y,Ua as z}; diff --git a/assets/index-Bfn5GkWN.js b/assets/index-D8SjfWSQ.js similarity index 91% rename from assets/index-Bfn5GkWN.js rename to assets/index-D8SjfWSQ.js index ea77db23b5f3e1ba3b8a1b4c6c36534b59032661..962fa6410a0d3f4bd3a715bbfeaa4b2221d046e8 100644 --- a/assets/index-Bfn5GkWN.js +++ b/assets/index-D8SjfWSQ.js @@ -1 +1 @@ -import{_ as Z}from"./IconAnimation.vue_vue_type_script_setup_true_lang-BkJuuWL8.js";import{k as V,l as P,m as q,J as H}from"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{d as E,v as B,c as p,o as s,u as t,m as W,q as G,bN as K,s as Q,g as F,w as X,bO as Y,b as i,x as A,C as ee,y as u,a as m,A as S,bE as te,bL as g,D as N,bx as U,by as z,bH as oe,bn as ne,k as ie,bw as le}from"./index--eYU5aQm.js";import{_ as ae}from"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";import{_ as se,a as re}from"./Model.vue_vue_type_script_setup_true_lang-nr66j8OO.js";import{V as de}from"./browser-CkchkNbv.js";import{_ as D,a as ce}from"./ColorPalette.vue_vue_type_script_setup_true_lang-8aVGVYYF.js";import{u as ue}from"./useIconAnimation-Rig5jSD8.js";import{b as I}from"./route-block-B_A1xBdJ.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-CWkRm8IH.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BHnSNWo1.js";import"./index-CpeQQOdD.js";const me=["disabled"],h=E({__name:"Live2DModelControlButton",emits:["click"],setup(L){const f=B();return(r,n)=>(s(),p("button",{disabled:t(f).loadingLive2dModel,bg:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",transition:"all ease-in-out duration-250",rounded:"",onClick:n[0]||(n[0]=v=>r.$emit("click"))},[W(r.$slots,"default")],8,me))}}),fe={flex:"~ col gap-4"},pe={flex:"","items-center":"","gap-2":""},ve=["disabled","placeholder"],be={"font-medium":""},_e={flex:"","gap-2":""},ge=["onUpdate:modelValue"],he=["href","download"],ye=E({__name:"Live2DSettings",props:{palette:null},emits:["extractColorsFromModel"],setup(L){const{t:f}=G(),r=K({accept:"application/zip"}),n=B(),{live2dModelFile:v,live2dMotionMap:b,live2dLoadSource:y,loadingLive2dModel:x,availableLive2dMotions:j,live2dModelUrl:M}=Q(n),d=F(M.value);r.onChange(o=>{o&&o.length>0&&(b.value={},v.value=o[0],y.value="file",x.value=!0)}),X(()=>n.loadingLive2dModel,o=>{o||y.value==="file"&&j.value.forEach(e=>{e.motionName in V?b.value[e.fileName]=e.motionName:b.value[e.fileName]=P})});async function _(o,e){if(!Object.keys(e).length)return o;const a=await new H().loadAsync(o),c=Object.keys(a.files).find($=>$.endsWith("model3.json"));if(!c)throw new Error("model3.json not found");const J=await a.file(c).async("string"),R=JSON.parse(J),C={};Object.entries(e).forEach(([$,O])=>{if(C[O]){C[O].push({File:$});return}C[O]=[{File:$}]}),R.FileReferences.Motions=C,a.file(c,JSON.stringify(R,null,2));const T=await a.generateAsync({type:"blob"});return new File([T],o.name,{type:o.type,lastModified:o.lastModified})}async function w(){const o=await q.getItem("live2dModel");if(!o)return;const e=await _(o,b.value);v.value=e,y.value="file",x.value=!0}const k=Y(v);return(o,e)=>(s(),p("div",fe,[i(t(D),{title:"settings.live2d.change-model.title",icon:"i-solar:magic-stick-3-bold-duotone","inner-class":"text-sm"},{default:u(()=>[m("div",pe,[S(m("input",{"onUpdate:modelValue":e[0]||(e[0]=l=>d.value=l),disabled:t(n).loadingLive2dModel,class:"form-control flex-1",border:"neutral-300 dark:neutral-800 solid 1 focus:neutral-400 dark:focus:neutral-600",transition:"border duration-250 ease-in-out",placeholder:t(f)("settings.live2d.change-model.from-url-placeholder")},null,8,ve),[[te,d.value]]),i(h,{class:"form-control",onClick:e[1]||(e[1]=l=>M.value=d.value)},{default:u(()=>[g(N(t(f)("settings.live2d.change-model.from-url")),1)]),_:1})]),i(h,{class:"form-control place-self-end",onClick:e[2]||(e[2]=l=>t(r).open())},{default:u(()=>[g(N(t(f)("settings.live2d.change-model.from-file"))+"... ",1)]),_:1}),i(h,{class:"form-control",onClick:e[3]||(e[3]=l=>o.$emit("extractColorsFromModel"))},{default:u(()=>e[4]||(e[4]=[g(" Extract colors from model ")])),_:1}),i(ce,{colors:L.palette.map(l=>({hex:l,name:l}))},null,8,["colors"])]),_:1}),t(n).live2dLoadSource==="file"?(s(),A(t(D),{key:0,title:"settings.live2d.edit-motion-map.title",icon:"i-solar:face-scan-circle-bold-duotone"},{default:u(()=>{var l;return[(s(!0),p(U,null,z(t(n).availableLive2dMotions,a=>(s(),p("div",{key:a.fileName,flex:"","items-center":"","justify-between":"","text-sm":""},[m("span",be,N(a.fileName),1),m("div",_e,[S(m("select",{"onUpdate:modelValue":c=>t(n).live2dMotionMap[a.fileName]=c},[(s(!0),p(U,null,z(Object.keys(t(V)),c=>(s(),p("option",{key:c},N(c),1))),128))],8,ge),[[oe,t(n).live2dMotionMap[a.fileName]]]),i(h,{class:"form-control",onClick:c=>t(n).live2dCurrentMotion={group:a.motionName,index:a.motionIndex}},{default:u(()=>e[5]||(e[5]=[g(" Play ")])),_:2},1032,["onClick"])])]))),128)),i(h,{onClick:w},{default:u(()=>e[6]||(e[6]=[g(" Save and patch ")])),_:1}),m("a",{"mt-2":"",block:"",href:t(k),download:`${((l=t(n).live2dModelFile)==null?void 0:l.name)||"live2d"}-motion-edited.zip`},[i(h,{"w-full":""},{default:u(()=>e[7]||(e[7]=[g("Export")])),_:1})],8,he)]}),_:1})):ee("",!0)]))}}),ke=ne(ye,[["__scopeId","data-v-b2e16668"]]),xe={flex:""},Me={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,y:15},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},we=E({__name:"index",setup(L){const f=F(),r=F(),{width:n,height:v}=ie(f),b=F([]);async function y(){if(!r.value)return;const d=await r.value.captureFrame();if(!d){console.error("No frame captured");return}const _=URL.createObjectURL(d);try{const k=await new de(_).getPalette();b.value=Object.values(k).map(o=>o==null?void 0:o.hex).filter(o=>typeof o=="string")}finally{URL.revokeObjectURL(_)}}const{iconAnimationStarted:x,showIconAnimation:j,animationIcon:M}=ue("i-solar:people-nearby-bold-duotone");return(d,_)=>{const w=Z,k=le("motion");return s(),p(U,null,[i(t(ae),{title:d.$t("settings.pages.models.title"),subtitle:d.$t("settings.title")},null,8,["title","subtitle"]),m("div",xe,[m("div",{ref_key:"live2dContainerRef",ref:f,w:"50%",h:"80vh"},[i(t(re),{ref_key:"live2dCanvasRef",ref:r,width:t(n),height:t(v)},{default:u(({app:o})=>[i(t(se),{app:o,"mouth-open-size":0,width:t(n),height:t(v),paused:!1},null,8,["app","width","height"])]),_:1},8,["width","height"])],512),i(ke,{w:"50%",h:"80vh",palette:b.value,onExtractColorsFromModel:y},null,8,["palette"])]),t(j)?(s(),A(w,{key:0,"z-index":-1,icon:t(M),"icon-size":12,duration:1e3,started:t(x),"is-reverse":!0,position:"calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)","text-color":"text-neutral-200/50 dark:text-neutral-600/20"},null,8,["icon","started"])):S((s(),p("div",Me,_[0]||(_[0]=[m("div",{text:"60","i-solar:people-nearby-bold-duotone":""},null,-1)]))),[[k]])],64)}}});typeof I=="function"&&I(we);export{we as default}; +import{_ as Z}from"./IconAnimation.vue_vue_type_script_setup_true_lang-BpdSb0ho.js";import{k as V,l as P,m as q,J as H}from"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{d as E,v as B,c as p,o as s,u as t,m as W,q as G,bN as K,s as Q,g as F,w as X,bO as Y,b as i,x as A,C as ee,y as u,a as m,A as S,bE as te,bL as g,D as N,bx as U,by as z,bH as oe,bn as ne,k as ie,bw as le}from"./index-D55VqdU4.js";import{_ as ae}from"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";import{_ as se,a as re}from"./Model.vue_vue_type_script_setup_true_lang-BILK6cfC.js";import{V as de}from"./browser-CkchkNbv.js";import{_ as D,a as ce}from"./ColorPalette.vue_vue_type_script_setup_true_lang-Cl6NdKBD.js";import{u as ue}from"./useIconAnimation-Dw2zcJkj.js";import{b as I}from"./route-block-B_A1xBdJ.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BDoHyduV.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BbB31kj-.js";import"./index-fSchh9rJ.js";const me=["disabled"],h=E({__name:"Live2DModelControlButton",emits:["click"],setup(L){const f=B();return(r,n)=>(s(),p("button",{disabled:t(f).loadingLive2dModel,bg:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",transition:"all ease-in-out duration-250",rounded:"",onClick:n[0]||(n[0]=v=>r.$emit("click"))},[W(r.$slots,"default")],8,me))}}),fe={flex:"~ col gap-4"},pe={flex:"","items-center":"","gap-2":""},ve=["disabled","placeholder"],be={"font-medium":""},_e={flex:"","gap-2":""},ge=["onUpdate:modelValue"],he=["href","download"],ye=E({__name:"Live2DSettings",props:{palette:null},emits:["extractColorsFromModel"],setup(L){const{t:f}=G(),r=K({accept:"application/zip"}),n=B(),{live2dModelFile:v,live2dMotionMap:b,live2dLoadSource:y,loadingLive2dModel:x,availableLive2dMotions:j,live2dModelUrl:M}=Q(n),d=F(M.value);r.onChange(o=>{o&&o.length>0&&(b.value={},v.value=o[0],y.value="file",x.value=!0)}),X(()=>n.loadingLive2dModel,o=>{o||y.value==="file"&&j.value.forEach(e=>{e.motionName in V?b.value[e.fileName]=e.motionName:b.value[e.fileName]=P})});async function _(o,e){if(!Object.keys(e).length)return o;const a=await new H().loadAsync(o),c=Object.keys(a.files).find($=>$.endsWith("model3.json"));if(!c)throw new Error("model3.json not found");const J=await a.file(c).async("string"),R=JSON.parse(J),C={};Object.entries(e).forEach(([$,O])=>{if(C[O]){C[O].push({File:$});return}C[O]=[{File:$}]}),R.FileReferences.Motions=C,a.file(c,JSON.stringify(R,null,2));const T=await a.generateAsync({type:"blob"});return new File([T],o.name,{type:o.type,lastModified:o.lastModified})}async function w(){const o=await q.getItem("live2dModel");if(!o)return;const e=await _(o,b.value);v.value=e,y.value="file",x.value=!0}const k=Y(v);return(o,e)=>(s(),p("div",fe,[i(t(D),{title:"settings.live2d.change-model.title",icon:"i-solar:magic-stick-3-bold-duotone","inner-class":"text-sm"},{default:u(()=>[m("div",pe,[S(m("input",{"onUpdate:modelValue":e[0]||(e[0]=l=>d.value=l),disabled:t(n).loadingLive2dModel,class:"form-control flex-1",border:"neutral-300 dark:neutral-800 solid 1 focus:neutral-400 dark:focus:neutral-600",transition:"border duration-250 ease-in-out",placeholder:t(f)("settings.live2d.change-model.from-url-placeholder")},null,8,ve),[[te,d.value]]),i(h,{class:"form-control",onClick:e[1]||(e[1]=l=>M.value=d.value)},{default:u(()=>[g(N(t(f)("settings.live2d.change-model.from-url")),1)]),_:1})]),i(h,{class:"form-control place-self-end",onClick:e[2]||(e[2]=l=>t(r).open())},{default:u(()=>[g(N(t(f)("settings.live2d.change-model.from-file"))+"... ",1)]),_:1}),i(h,{class:"form-control",onClick:e[3]||(e[3]=l=>o.$emit("extractColorsFromModel"))},{default:u(()=>e[4]||(e[4]=[g(" Extract colors from model ")])),_:1}),i(ce,{colors:L.palette.map(l=>({hex:l,name:l}))},null,8,["colors"])]),_:1}),t(n).live2dLoadSource==="file"?(s(),A(t(D),{key:0,title:"settings.live2d.edit-motion-map.title",icon:"i-solar:face-scan-circle-bold-duotone"},{default:u(()=>{var l;return[(s(!0),p(U,null,z(t(n).availableLive2dMotions,a=>(s(),p("div",{key:a.fileName,flex:"","items-center":"","justify-between":"","text-sm":""},[m("span",be,N(a.fileName),1),m("div",_e,[S(m("select",{"onUpdate:modelValue":c=>t(n).live2dMotionMap[a.fileName]=c},[(s(!0),p(U,null,z(Object.keys(t(V)),c=>(s(),p("option",{key:c},N(c),1))),128))],8,ge),[[oe,t(n).live2dMotionMap[a.fileName]]]),i(h,{class:"form-control",onClick:c=>t(n).live2dCurrentMotion={group:a.motionName,index:a.motionIndex}},{default:u(()=>e[5]||(e[5]=[g(" Play ")])),_:2},1032,["onClick"])])]))),128)),i(h,{onClick:w},{default:u(()=>e[6]||(e[6]=[g(" Save and patch ")])),_:1}),m("a",{"mt-2":"",block:"",href:t(k),download:`${((l=t(n).live2dModelFile)==null?void 0:l.name)||"live2d"}-motion-edited.zip`},[i(h,{"w-full":""},{default:u(()=>e[7]||(e[7]=[g("Export")])),_:1})],8,he)]}),_:1})):ee("",!0)]))}}),ke=ne(ye,[["__scopeId","data-v-b2e16668"]]),xe={flex:""},Me={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,y:15},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},we=E({__name:"index",setup(L){const f=F(),r=F(),{width:n,height:v}=ie(f),b=F([]);async function y(){if(!r.value)return;const d=await r.value.captureFrame();if(!d){console.error("No frame captured");return}const _=URL.createObjectURL(d);try{const k=await new de(_).getPalette();b.value=Object.values(k).map(o=>o==null?void 0:o.hex).filter(o=>typeof o=="string")}finally{URL.revokeObjectURL(_)}}const{iconAnimationStarted:x,showIconAnimation:j,animationIcon:M}=ue("i-solar:people-nearby-bold-duotone");return(d,_)=>{const w=Z,k=le("motion");return s(),p(U,null,[i(t(ae),{title:d.$t("settings.pages.models.title"),subtitle:d.$t("settings.title")},null,8,["title","subtitle"]),m("div",xe,[m("div",{ref_key:"live2dContainerRef",ref:f,w:"50%",h:"80vh"},[i(t(re),{ref_key:"live2dCanvasRef",ref:r,width:t(n),height:t(v)},{default:u(({app:o})=>[i(t(se),{app:o,"mouth-open-size":0,width:t(n),height:t(v),paused:!1},null,8,["app","width","height"])]),_:1},8,["width","height"])],512),i(ke,{w:"50%",h:"80vh",palette:b.value,onExtractColorsFromModel:y},null,8,["palette"])]),t(j)?(s(),A(w,{key:0,"z-index":-1,icon:t(M),"icon-size":12,duration:1e3,started:t(x),"is-reverse":!0,position:"calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)","text-color":"text-neutral-200/50 dark:text-neutral-600/20"},null,8,["icon","started"])):S((s(),p("div",Me,_[0]||(_[0]=[m("div",{text:"60","i-solar:people-nearby-bold-duotone":""},null,-1)]))),[[k]])],64)}}});typeof I=="function"&&I(we);export{we as default}; diff --git a/assets/index-Bsv4W1GE.js b/assets/index-DH7Ly51U.js similarity index 89% rename from assets/index-Bsv4W1GE.js rename to assets/index-DH7Ly51U.js index e38a795e4469c2eafe82cd08c58dd06ec2db8a83..d9c7ae7e9abb41f8cfaa318d8d472ddd0e6b97b5 100644 --- a/assets/index-Bsv4W1GE.js +++ b/assets/index-DH7Ly51U.js @@ -1 +1 @@ -import{d as T,q as J,s as H,g as c,w as Q,h,bw as R,c as m,o as d,b as y,a as s,A as w,u as r,bE as G,D as l,bH as K,z as P,C as V,y as W,bx as U,by as X,x as Y}from"./index--eYU5aQm.js";import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{_ as Z}from"./InputFile.vue_vue_type_script_setup_true_lang-DSuLZiGY.js";import{_ as ee}from"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";import{u as te}from"./airi-card-_ueLLZ0g.js";import{_ as se}from"./CardDetailDialog.vue_vue_type_script_setup_true_lang-Dudpr3F2.js";import{_ as ae}from"./CardListItem.vue_vue_type_script_setup_true_lang-B7ec9PDI.js";import{_ as re}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-R-YdRLSq.js";import{b as j}from"./route-block-B_A1xBdJ.js";import"./consciousness-NMirv8Xi.js";import"./providers-YQf-rDZ1.js";import"./index-Be1NqeGb.js";import"./speech-BOhrg3WS.js";import"./index-CpeQQOdD.js";const oe={"rounded-xl":"","p-4":"",flex:"~ col gap-4"},ne={flex:"~ row","flex-wrap":"","items-center":"","justify-between":"","gap-4":""},le={class:"relative min-w-[200px] flex-1","inline-flex":"~","w-full":"","items-center":""},ie=["placeholder"],de={class:"flex items-center gap-2"},ue={"text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},ce={value:"nameAsc"},me={value:"nameDesc"},pe={value:"recent"},fe={key:0,flex:"","flex-col":"","items-center":""},ve={"font-medium":"",text:"neutral-600 dark:neutral-300"},xe={text:"neutral-500 dark:neutral-400","mt-2":"","text-sm":""},ge={key:1,flex:"","flex-col":"","items-center":""},_e={"font-medium":"",text:"primary-600 dark:primary-300"},be={key:1,class:"col-span-full rounded-xl p-8 text-center",border:"~ neutral-200/50 dark:neutral-700/30",bg:"neutral-50/50 dark:neutral-900/50"},ye={key:2,class:"col-span-full flex items-center gap-3 border-2 border-amber-200 rounded-xl bg-amber-50/80 p-4 dark:border-amber-800 dark:bg-amber-900/30"},ke={class:"flex flex-col"},Ce={class:"font-medium"},he={class:"text-sm text-amber-600 dark:text-amber-400"},we={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},Ve=T({__name:"index",setup(De){const{t:n}=J(),k=te(),{addCard:q,removeCard:B}=k,{cards:p,activeCardId:D}=H(k),_=c(""),f=c(!1),v=c(""),x=c("nameAsc"),C=c([]);Q(C,async a=>{const e=a[0];if(e)try{const o=await e.text(),i=JSON.parse(o);_.value=q(i),f.value=!0}catch(o){console.error("Error processing card file:",o)}});const $=h(()=>Array.from(p.value.entries()).map(([a,e])=>({id:a,name:e.name,description:e.description}))),E=h(()=>{if(!v.value)return $.value;const a=v.value.toLowerCase();return $.value.filter(e=>e.name.toLowerCase().includes(a)||e.description&&e.description.toLowerCase().includes(a))}),S=h(()=>{const a=[...E.value];return x.value==="nameAsc"?a.sort((e,o)=>e.name.localeCompare(o.name)):x.value==="nameDesc"?a.sort((e,o)=>o.name.localeCompare(e.name)):x.value==="recent"?a.sort((e,o)=>o.id.localeCompare(e.id)):a}),b=c(!1),u=c(null);function L(){u.value&&(B(u.value),u.value=null,b.value=!1)}function O(a){u.value=a,b.value=!0}function F(a){_.value=a,f.value=!0}function I(a){D.value=a}function M(a){const e=p.value.get(a);return(e==null?void 0:e.version)||"1.0.0"}function A(a,e){var t,g,z,N;const o=p.value.get(a);if(!o||!((g=(t=o.extensions)==null?void 0:t.airi)!=null&&g.modules))return"default";const i=o.extensions.airi.modules;return e==="consciousness"?(z=i.consciousness)!=null&&z.model&&i.consciousness.model.split("-").pop()||"default":e==="voice"&&((N=i.speech)==null?void 0:N.voice_id)||"default"}return(a,e)=>{var i;const o=R("motion");return d(),m(U,null,[y(r(ee),{title:a.$t("settings.pages.card.title"),subtitle:a.$t("settings.title")},null,8,["title","subtitle"]),s("div",oe,[s("div",ne,[s("div",le,[e[6]||(e[6]=s("div",{class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"},[s("div",{"i-solar:magnifer-line-duotone":"",class:"text-neutral-500 dark:text-neutral-400"})],-1)),w(s("input",{"onUpdate:modelValue":e[0]||(e[0]=t=>v.value=t),type:"search",class:"w-full rounded-xl p-2.5 pl-10 text-sm outline-none",border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",bg:"white dark:neutral-900",placeholder:r(n)("settings.pages.card.search")},null,8,ie),[[G,v.value]])]),s("div",de,[s("div",ue,l(r(n)("settings.pages.card.sort_by"))+": ",1),w(s("select",{"onUpdate:modelValue":e[1]||(e[1]=t=>x.value=t),class:"rounded-lg p-1.5 text-sm outline-none",border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",bg:"white dark:neutral-900"},[s("option",ce,l(r(n)("settings.pages.card.name_asc")),1),s("option",me,l(r(n)("settings.pages.card.name_desc")),1),s("option",pe,l(r(n)("settings.pages.card.recent")),1)],512),[[K,x.value]])])]),s("div",{class:P(["mt-4",{"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4 grid-auto-rows-[minmax(min-content,max-content)] grid-auto-flow-dense sm:grid-cols-[repeat(auto-fill,minmax(240px,1fr))] sm:gap-5 md:grid-cols-[repeat(auto-fill,minmax(220px,1fr))] lg:grid-cols-[repeat(auto-fill,minmax(250px,1fr))]":r(p).size>0}])},[y(r(Z),{modelValue:C.value,"onUpdate:modelValue":e[2]||(e[2]=t=>C.value=t),accept:"*.json"},{default:W(({isDragging:t})=>[t?(d(),m("div",ge,[e[8]||(e[8]=s("div",{"i-solar:upload-minimalistic-bold":"",class:"text-primary-500 dark:text-primary-400 mb-2 text-5xl"},null,-1)),s("p",_e,l(r(n)("settings.pages.card.drop_here")),1)])):(d(),m("div",fe,[e[7]||(e[7]=s("div",{"i-solar:upload-square-line-duotone":"","mb-4":"","text-5xl":"",text:"neutral-400 dark:neutral-500"},null,-1)),s("p",ve,l(r(n)("settings.pages.card.upload")),1),s("p",xe,l(r(n)("settings.pages.card.upload_desc")),1)]))]),_:1},8,["modelValue"]),r(p).size>0?(d(!0),m(U,{key:0},X(S.value,t=>(d(),Y(ae,{id:t.id,key:t.id,name:t.name,description:t.description,"is-active":t.id===r(D),"is-selected":t.id===_.value&&f.value,version:M(t.id),"consciousness-model":A(t.id,"consciousness"),"voice-model":A(t.id,"voice"),onSelect:g=>F(t.id),onActivate:g=>I(t.id),onDelete:g=>O(t.id)},null,8,["id","name","description","is-active","is-selected","version","consciousness-model","voice-model","onSelect","onActivate","onDelete"]))),128)):V("",!0),r(p).size===0?(d(),m("div",be,[e[9]||(e[9]=s("div",{"i-solar:card-search-broken":"","mx-auto":"","mb-3":"","text-6xl":"","text-neutral-400":""},null,-1)),s("p",null,l(r(n)("settings.pages.card.no_cards")),1)])):V("",!0),v.value&&S.value.length===0?(d(),m("div",ye,[e[10]||(e[10]=s("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),s("div",ke,[s("span",Ce,l(r(n)("settings.pages.card.no_results")),1),s("span",he,l(r(n)("settings.pages.card.try_different_search")),1)])])):V("",!0)],2)]),y(re,{modelValue:b.value,"onUpdate:modelValue":e[3]||(e[3]=t=>b.value=t),"card-name":u.value?(i=r(k).getCard(u.value))==null?void 0:i.name:"",onConfirm:L,onCancel:e[4]||(e[4]=t=>u.value=null)},null,8,["modelValue","card-name"]),y(se,{modelValue:f.value,"onUpdate:modelValue":e[5]||(e[5]=t=>f.value=t),"card-id":_.value},null,8,["modelValue","card-id"]),w((d(),m("div",we,e[11]||(e[11]=[s("div",{text:"60","i-solar:emoji-funny-square-bold-duotone":""},null,-1)]))),[[o]])],64)}}});typeof j=="function"&&j(Ve);export{Ve as default}; +import{d as T,q as J,s as H,g as c,w as Q,h,bw as R,c as m,o as d,b as y,a as s,A as w,u as r,bE as G,D as l,bH as K,z as P,C as V,y as W,bx as U,by as X,x as Y}from"./index-D55VqdU4.js";import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{_ as Z}from"./InputFile.vue_vue_type_script_setup_true_lang-CR9cbe_p.js";import{_ as ee}from"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";import{u as te}from"./airi-card-TTCASwDd.js";import{_ as se}from"./CardDetailDialog.vue_vue_type_script_setup_true_lang-MUqOZwiW.js";import{_ as ae}from"./CardListItem.vue_vue_type_script_setup_true_lang-C3dXCNzW.js";import{_ as re}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-DE2XAzMf.js";import{b as j}from"./route-block-B_A1xBdJ.js";import"./consciousness-BGmbU4M0.js";import"./providers-DAp1566d.js";import"./index-Be1NqeGb.js";import"./speech-BtNOtIn9.js";import"./index-fSchh9rJ.js";const oe={"rounded-xl":"","p-4":"",flex:"~ col gap-4"},ne={flex:"~ row","flex-wrap":"","items-center":"","justify-between":"","gap-4":""},le={class:"relative min-w-[200px] flex-1","inline-flex":"~","w-full":"","items-center":""},ie=["placeholder"],de={class:"flex items-center gap-2"},ue={"text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},ce={value:"nameAsc"},me={value:"nameDesc"},pe={value:"recent"},fe={key:0,flex:"","flex-col":"","items-center":""},ve={"font-medium":"",text:"neutral-600 dark:neutral-300"},xe={text:"neutral-500 dark:neutral-400","mt-2":"","text-sm":""},ge={key:1,flex:"","flex-col":"","items-center":""},_e={"font-medium":"",text:"primary-600 dark:primary-300"},be={key:1,class:"col-span-full rounded-xl p-8 text-center",border:"~ neutral-200/50 dark:neutral-700/30",bg:"neutral-50/50 dark:neutral-900/50"},ye={key:2,class:"col-span-full flex items-center gap-3 border-2 border-amber-200 rounded-xl bg-amber-50/80 p-4 dark:border-amber-800 dark:bg-amber-900/30"},ke={class:"flex flex-col"},Ce={class:"font-medium"},he={class:"text-sm text-amber-600 dark:text-amber-400"},we={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},Ve=T({__name:"index",setup(De){const{t:n}=J(),k=te(),{addCard:q,removeCard:B}=k,{cards:p,activeCardId:D}=H(k),_=c(""),f=c(!1),v=c(""),x=c("nameAsc"),C=c([]);Q(C,async a=>{const e=a[0];if(e)try{const o=await e.text(),i=JSON.parse(o);_.value=q(i),f.value=!0}catch(o){console.error("Error processing card file:",o)}});const $=h(()=>Array.from(p.value.entries()).map(([a,e])=>({id:a,name:e.name,description:e.description}))),E=h(()=>{if(!v.value)return $.value;const a=v.value.toLowerCase();return $.value.filter(e=>e.name.toLowerCase().includes(a)||e.description&&e.description.toLowerCase().includes(a))}),S=h(()=>{const a=[...E.value];return x.value==="nameAsc"?a.sort((e,o)=>e.name.localeCompare(o.name)):x.value==="nameDesc"?a.sort((e,o)=>o.name.localeCompare(e.name)):x.value==="recent"?a.sort((e,o)=>o.id.localeCompare(e.id)):a}),b=c(!1),u=c(null);function L(){u.value&&(B(u.value),u.value=null,b.value=!1)}function O(a){u.value=a,b.value=!0}function F(a){_.value=a,f.value=!0}function I(a){D.value=a}function M(a){const e=p.value.get(a);return(e==null?void 0:e.version)||"1.0.0"}function A(a,e){var t,g,z,N;const o=p.value.get(a);if(!o||!((g=(t=o.extensions)==null?void 0:t.airi)!=null&&g.modules))return"default";const i=o.extensions.airi.modules;return e==="consciousness"?(z=i.consciousness)!=null&&z.model&&i.consciousness.model.split("-").pop()||"default":e==="voice"&&((N=i.speech)==null?void 0:N.voice_id)||"default"}return(a,e)=>{var i;const o=R("motion");return d(),m(U,null,[y(r(ee),{title:a.$t("settings.pages.card.title"),subtitle:a.$t("settings.title")},null,8,["title","subtitle"]),s("div",oe,[s("div",ne,[s("div",le,[e[6]||(e[6]=s("div",{class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"},[s("div",{"i-solar:magnifer-line-duotone":"",class:"text-neutral-500 dark:text-neutral-400"})],-1)),w(s("input",{"onUpdate:modelValue":e[0]||(e[0]=t=>v.value=t),type:"search",class:"w-full rounded-xl p-2.5 pl-10 text-sm outline-none",border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",bg:"white dark:neutral-900",placeholder:r(n)("settings.pages.card.search")},null,8,ie),[[G,v.value]])]),s("div",de,[s("div",ue,l(r(n)("settings.pages.card.sort_by"))+": ",1),w(s("select",{"onUpdate:modelValue":e[1]||(e[1]=t=>x.value=t),class:"rounded-lg p-1.5 text-sm outline-none",border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",bg:"white dark:neutral-900"},[s("option",ce,l(r(n)("settings.pages.card.name_asc")),1),s("option",me,l(r(n)("settings.pages.card.name_desc")),1),s("option",pe,l(r(n)("settings.pages.card.recent")),1)],512),[[K,x.value]])])]),s("div",{class:P(["mt-4",{"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4 grid-auto-rows-[minmax(min-content,max-content)] grid-auto-flow-dense sm:grid-cols-[repeat(auto-fill,minmax(240px,1fr))] sm:gap-5 md:grid-cols-[repeat(auto-fill,minmax(220px,1fr))] lg:grid-cols-[repeat(auto-fill,minmax(250px,1fr))]":r(p).size>0}])},[y(r(Z),{modelValue:C.value,"onUpdate:modelValue":e[2]||(e[2]=t=>C.value=t),accept:"*.json"},{default:W(({isDragging:t})=>[t?(d(),m("div",ge,[e[8]||(e[8]=s("div",{"i-solar:upload-minimalistic-bold":"",class:"text-primary-500 dark:text-primary-400 mb-2 text-5xl"},null,-1)),s("p",_e,l(r(n)("settings.pages.card.drop_here")),1)])):(d(),m("div",fe,[e[7]||(e[7]=s("div",{"i-solar:upload-square-line-duotone":"","mb-4":"","text-5xl":"",text:"neutral-400 dark:neutral-500"},null,-1)),s("p",ve,l(r(n)("settings.pages.card.upload")),1),s("p",xe,l(r(n)("settings.pages.card.upload_desc")),1)]))]),_:1},8,["modelValue"]),r(p).size>0?(d(!0),m(U,{key:0},X(S.value,t=>(d(),Y(ae,{id:t.id,key:t.id,name:t.name,description:t.description,"is-active":t.id===r(D),"is-selected":t.id===_.value&&f.value,version:M(t.id),"consciousness-model":A(t.id,"consciousness"),"voice-model":A(t.id,"voice"),onSelect:g=>F(t.id),onActivate:g=>I(t.id),onDelete:g=>O(t.id)},null,8,["id","name","description","is-active","is-selected","version","consciousness-model","voice-model","onSelect","onActivate","onDelete"]))),128)):V("",!0),r(p).size===0?(d(),m("div",be,[e[9]||(e[9]=s("div",{"i-solar:card-search-broken":"","mx-auto":"","mb-3":"","text-6xl":"","text-neutral-400":""},null,-1)),s("p",null,l(r(n)("settings.pages.card.no_cards")),1)])):V("",!0),v.value&&S.value.length===0?(d(),m("div",ye,[e[10]||(e[10]=s("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),s("div",ke,[s("span",Ce,l(r(n)("settings.pages.card.no_results")),1),s("span",he,l(r(n)("settings.pages.card.try_different_search")),1)])])):V("",!0)],2)]),y(re,{modelValue:b.value,"onUpdate:modelValue":e[3]||(e[3]=t=>b.value=t),"card-name":u.value?(i=r(k).getCard(u.value))==null?void 0:i.name:"",onConfirm:L,onCancel:e[4]||(e[4]=t=>u.value=null)},null,8,["modelValue","card-name"]),y(se,{modelValue:f.value,"onUpdate:modelValue":e[5]||(e[5]=t=>f.value=t),"card-id":_.value},null,8,["modelValue","card-id"]),w((d(),m("div",we,e[11]||(e[11]=[s("div",{text:"60","i-solar:emoji-funny-square-bold-duotone":""},null,-1)]))),[[o]])],64)}}});typeof j=="function"&&j(Ve);export{Ve as default}; diff --git a/assets/index-DKoBS1Xx.js b/assets/index-DLifNpdd.js similarity index 81% rename from assets/index-DKoBS1Xx.js rename to assets/index-DLifNpdd.js index 6dc7ffb2fbdca8d8427d11f0c1ffa90bac80b31a..9dbc6fc24c4b77d467795f346cf25d4838dc27ee 100644 --- a/assets/index-DKoBS1Xx.js +++ b/assets/index-DLifNpdd.js @@ -1 +1 @@ -import{_ as x}from"./IconAnimation.vue_vue_type_script_setup_true_lang-BkJuuWL8.js";import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{_ as v}from"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";import{d as k,s as I,bw as h,c as i,o,b as z,a as c,x as l,A as m,u as e,bx as d,by as A}from"./index--eYU5aQm.js";import{u as $}from"./providers-YQf-rDZ1.js";import{I as w}from"./IconStatusItem-rr4-xndX.js";import{u as B}from"./useIconAnimation-Rig5jSD8.js";import{b as u}from"./route-block-B_A1xBdJ.js";import"./index-Be1NqeGb.js";const S={grid:"~ cols-2 gap-4"},D={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},N=k({__name:"index",setup(C){const p=$(),{allProvidersMetadata:f}=I(p),{iconAnimationStarted:_,showIconAnimation:y,animationIcon:g}=B("i-solar:box-minimalistic-bold-duotone");return(n,a)=>{const b=x,s=h("motion");return o(),i(d,null,[z(e(v),{title:n.$t("settings.pages.providers.title"),subtitle:n.$t("settings.title")},null,8,["title","subtitle"]),c("div",S,[(o(!0),i(d,null,A(e(f),(t,r)=>m((o(),l(e(w),{key:t.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+r*10,delay:r*50,title:t.localizedName,description:t.localizedDescription,icon:t.icon,"icon-color":t.iconColor,"icon-image":t.iconImage,to:`/settings/providers/${t.id}`,configured:t.configured},null,8,["duration","delay","title","description","icon","icon-color","icon-image","to","configured"])),[[s]])),128))]),e(y)?(o(),l(b,{key:0,"z-index":-1,icon:e(g),"icon-size":12,duration:1e3,started:e(_),"is-reverse":!0,position:"calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)","text-color":"text-neutral-200/50 dark:text-neutral-600/20"},null,8,["icon","started"])):m((o(),i("div",D,a[0]||(a[0]=[c("div",{text:"60","i-solar:box-minimalistic-bold-duotone":""},null,-1)]))),[[s]])],64)}}});typeof u=="function"&&u(N);export{N as default}; +import{_ as x}from"./IconAnimation.vue_vue_type_script_setup_true_lang-BpdSb0ho.js";import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{_ as v}from"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";import{d as k,s as I,bw as h,c as i,o,b as z,a as c,x as l,A as m,u as e,bx as d,by as A}from"./index-D55VqdU4.js";import{u as $}from"./providers-DAp1566d.js";import{I as w}from"./IconStatusItem-DwLpS4EY.js";import{u as B}from"./useIconAnimation-Dw2zcJkj.js";import{b as u}from"./route-block-B_A1xBdJ.js";import"./index-Be1NqeGb.js";const S={grid:"~ cols-2 gap-4"},D={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},N=k({__name:"index",setup(C){const p=$(),{allProvidersMetadata:f}=I(p),{iconAnimationStarted:_,showIconAnimation:y,animationIcon:g}=B("i-solar:box-minimalistic-bold-duotone");return(n,a)=>{const b=x,s=h("motion");return o(),i(d,null,[z(e(v),{title:n.$t("settings.pages.providers.title"),subtitle:n.$t("settings.title")},null,8,["title","subtitle"]),c("div",S,[(o(!0),i(d,null,A(e(f),(t,r)=>m((o(),l(e(w),{key:t.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+r*10,delay:r*50,title:t.localizedName,description:t.localizedDescription,icon:t.icon,"icon-color":t.iconColor,"icon-image":t.iconImage,to:`/settings/providers/${t.id}`,configured:t.configured},null,8,["duration","delay","title","description","icon","icon-color","icon-image","to","configured"])),[[s]])),128))]),e(y)?(o(),l(b,{key:0,"z-index":-1,icon:e(g),"icon-size":12,duration:1e3,started:e(_),"is-reverse":!0,position:"calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)","text-color":"text-neutral-200/50 dark:text-neutral-600/20"},null,8,["icon","started"])):m((o(),i("div",D,a[0]||(a[0]=[c("div",{text:"60","i-solar:box-minimalistic-bold-duotone":""},null,-1)]))),[[s]])],64)}}});typeof u=="function"&&u(N);export{N as default}; diff --git a/assets/index-DJq_28p-.js b/assets/index-DO1ex3N6.js similarity index 99% rename from assets/index-DJq_28p-.js rename to assets/index-DO1ex3N6.js index a2bb8ed6c11335afad89b8f660d1634e688cc86e..1fed2fd64e54e3c6fa6417b559c991d765c63fd2 100644 --- a/assets/index-DJq_28p-.js +++ b/assets/index-DO1ex3N6.js @@ -1,4 +1,4 @@ -import{cn as getAugmentedNamespace}from"./index--eYU5aQm.js";var dist={},ortWeb_min={exports:{}};const backends={},backendsSortedByPriority=[],registerBackend=(D,u,b)=>{if(u&&typeof u.init=="function"&&typeof u.createSessionHandler=="function"){const g=backends[D];if(g===void 0)backends[D]={backend:u,priority:b};else{if(g.priority>b)return;if(g.priority===b&&g.backend!==u)throw new Error(`cannot register backend "${D}" using priority ${b}`)}if(b>=0){const p=backendsSortedByPriority.indexOf(D);p!==-1&&backendsSortedByPriority.splice(p,1);for(let h=0;h{const u=D.length===0?backendsSortedByPriority:D,b=[];for(const g of u){const p=backends[g];if(p){if(p.initialized)return p.backend;if(p.aborted)continue;const h=!!p.initPromise;try{return h||(p.initPromise=p.backend.init()),await p.initPromise,p.initialized=!0,p.backend}catch(o){h||b.push({name:g,err:o}),p.aborted=!0}finally{delete p.initPromise}}}throw new Error(`no available backend found. ERR: ${b.map(g=>`[${g.name}] ${g.err}`).join(", ")}`)};class EnvImpl{constructor(){this.wasm={},this.webgl={},this.logLevelInternal="warning"}set logLevel(u){if(u!==void 0){if(typeof u!="string"||["verbose","info","warning","error","fatal"].indexOf(u)===-1)throw new Error(`Unsupported logging level: ${u}`);this.logLevelInternal=u}}get logLevel(){return this.logLevelInternal}}const env=new EnvImpl,isBigInt64ArrayAvailable=typeof BigInt64Array<"u"&&typeof BigInt64Array.from=="function",isBigUint64ArrayAvailable=typeof BigUint64Array<"u"&&typeof BigUint64Array.from=="function",NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array]]),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);isBigInt64ArrayAvailable&&(NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set("int64",BigInt64Array),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigInt64Array,"int64"));isBigUint64ArrayAvailable&&(NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set("uint64",BigUint64Array),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigUint64Array,"uint64"));const calculateSize=D=>{let u=1;for(let b=0;b{const t=document.createElement("canvas"),e=t.getContext("2d");if(!u||!e)return i();const n=new Image;n.crossOrigin="Anonymous",n.src=u,n.onload=()=>{t.width=n.width,t.height=n.height,e.drawImage(n,0,0,t.width,t.height);const r=e.getImageData(0,0,t.width,t.height);if(b!==void 0){if(b.height!==void 0&&b.height!==t.height)throw new Error("Image input config height doesn't match ImageBitmap height");if(f.height=t.height,b.width!==void 0&&b.width!==t.width)throw new Error("Image input config width doesn't match ImageBitmap width");f.width=t.width}else f.height=t.height,f.width=t.width;s(at.bufferToTensor(r.data,f))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(c!==void 0)return at.bufferToTensor(c,f);throw new Error("Input data provided is not supported - aborted tensor creation")}toImageData(u){var b,g;const p=document.createElement("canvas").getContext("2d");let h;if(p!=null){const o=this.dims[3],c=this.dims[2],f=this.dims[1],s=u!==void 0&&u.format!==void 0?u.format:"RGB",i=u!==void 0&&((b=u.norm)===null||b===void 0?void 0:b.mean)!==void 0?u.norm.mean:255,t=u!==void 0&&((g=u.norm)===null||g===void 0?void 0:g.bias)!==void 0?u.norm.bias:0,e=c*o;if(u!==void 0){if(u.height!==void 0&&u.height!==c)throw new Error("Image output config height doesn't match tensor height");if(u.width!==void 0&&u.width!==o)throw new Error("Image output config width doesn't match tensor width");if(u.format!==void 0&&f===4&&u.format!=="RGBA"||f===3&&u.format!=="RGB"&&u.format!=="BGR")throw new Error("Tensor format doesn't match input tensor dims")}const n=4;let r=0,a=1,l=2,d=3,m=0,y=e,v=e*2,_=-1;s==="RGBA"?(m=0,y=e,v=e*2,_=e*3):s==="RGB"?(m=0,y=e,v=e*2):s==="RBG"&&(m=0,v=e,y=e*2),h=p.createImageData(o,c);for(let T=0;T"u")throw new Error(`input '${s}' is missing in 'feeds'.`);if(o)for(const s of this.outputNames)p[s]=null;const c=await this.handler.run(u,p,h),f={};for(const s in c)Object.hasOwnProperty.call(c,s)&&(f[s]=new Tensor(c[s].type,c[s].data,c[s].dims));return f}static async create(u,b,g,p){let h,o={};if(typeof u=="string"){if(h=u,typeof b=="object"&&b!==null)o=b;else if(typeof b<"u")throw new TypeError("'options' must be an object.")}else if(u instanceof Uint8Array){if(h=u,typeof b=="object"&&b!==null)o=b;else if(typeof b<"u")throw new TypeError("'options' must be an object.")}else if(u instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&u instanceof SharedArrayBuffer){const t=u;let e=0,n=u.byteLength;if(typeof b=="object"&&b!==null)o=b;else if(typeof b=="number"){if(e=b,!Number.isSafeInteger(e))throw new RangeError("'byteOffset' must be an integer.");if(e<0||e>=t.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${t.byteLength}).`);if(n=u.byteLength-e,typeof g=="number"){if(n=g,!Number.isSafeInteger(n))throw new RangeError("'byteLength' must be an integer.");if(n<=0||e+n>t.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${t.byteLength-e}].`);if(typeof p=="object"&&p!==null)o=p;else if(typeof p<"u")throw new TypeError("'options' must be an object.")}else if(typeof g<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof b<"u")throw new TypeError("'options' must be an object.");h=new Uint8Array(t,e,n)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");const f=(o.executionProviders||[]).map(t=>typeof t=="string"?t:t.name),i=await(await resolveBackend(f)).createSessionHandler(h,o);return new cn(i)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}};const InferenceSession=InferenceSession$1,lib=Object.freeze(Object.defineProperty({__proto__:null,InferenceSession,Tensor,env,registerBackend},Symbol.toStringTag,{value:"Module"})),require$$0=getAugmentedNamespace(lib);/*! +import{cn as getAugmentedNamespace}from"./index-D55VqdU4.js";var dist={},ortWeb_min={exports:{}};const backends={},backendsSortedByPriority=[],registerBackend=(D,u,b)=>{if(u&&typeof u.init=="function"&&typeof u.createSessionHandler=="function"){const g=backends[D];if(g===void 0)backends[D]={backend:u,priority:b};else{if(g.priority>b)return;if(g.priority===b&&g.backend!==u)throw new Error(`cannot register backend "${D}" using priority ${b}`)}if(b>=0){const p=backendsSortedByPriority.indexOf(D);p!==-1&&backendsSortedByPriority.splice(p,1);for(let h=0;h{const u=D.length===0?backendsSortedByPriority:D,b=[];for(const g of u){const p=backends[g];if(p){if(p.initialized)return p.backend;if(p.aborted)continue;const h=!!p.initPromise;try{return h||(p.initPromise=p.backend.init()),await p.initPromise,p.initialized=!0,p.backend}catch(o){h||b.push({name:g,err:o}),p.aborted=!0}finally{delete p.initPromise}}}throw new Error(`no available backend found. ERR: ${b.map(g=>`[${g.name}] ${g.err}`).join(", ")}`)};class EnvImpl{constructor(){this.wasm={},this.webgl={},this.logLevelInternal="warning"}set logLevel(u){if(u!==void 0){if(typeof u!="string"||["verbose","info","warning","error","fatal"].indexOf(u)===-1)throw new Error(`Unsupported logging level: ${u}`);this.logLevelInternal=u}}get logLevel(){return this.logLevelInternal}}const env=new EnvImpl,isBigInt64ArrayAvailable=typeof BigInt64Array<"u"&&typeof BigInt64Array.from=="function",isBigUint64ArrayAvailable=typeof BigUint64Array<"u"&&typeof BigUint64Array.from=="function",NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array]]),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);isBigInt64ArrayAvailable&&(NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set("int64",BigInt64Array),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigInt64Array,"int64"));isBigUint64ArrayAvailable&&(NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set("uint64",BigUint64Array),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigUint64Array,"uint64"));const calculateSize=D=>{let u=1;for(let b=0;b{const t=document.createElement("canvas"),e=t.getContext("2d");if(!u||!e)return i();const n=new Image;n.crossOrigin="Anonymous",n.src=u,n.onload=()=>{t.width=n.width,t.height=n.height,e.drawImage(n,0,0,t.width,t.height);const r=e.getImageData(0,0,t.width,t.height);if(b!==void 0){if(b.height!==void 0&&b.height!==t.height)throw new Error("Image input config height doesn't match ImageBitmap height");if(f.height=t.height,b.width!==void 0&&b.width!==t.width)throw new Error("Image input config width doesn't match ImageBitmap width");f.width=t.width}else f.height=t.height,f.width=t.width;s(at.bufferToTensor(r.data,f))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(c!==void 0)return at.bufferToTensor(c,f);throw new Error("Input data provided is not supported - aborted tensor creation")}toImageData(u){var b,g;const p=document.createElement("canvas").getContext("2d");let h;if(p!=null){const o=this.dims[3],c=this.dims[2],f=this.dims[1],s=u!==void 0&&u.format!==void 0?u.format:"RGB",i=u!==void 0&&((b=u.norm)===null||b===void 0?void 0:b.mean)!==void 0?u.norm.mean:255,t=u!==void 0&&((g=u.norm)===null||g===void 0?void 0:g.bias)!==void 0?u.norm.bias:0,e=c*o;if(u!==void 0){if(u.height!==void 0&&u.height!==c)throw new Error("Image output config height doesn't match tensor height");if(u.width!==void 0&&u.width!==o)throw new Error("Image output config width doesn't match tensor width");if(u.format!==void 0&&f===4&&u.format!=="RGBA"||f===3&&u.format!=="RGB"&&u.format!=="BGR")throw new Error("Tensor format doesn't match input tensor dims")}const n=4;let r=0,a=1,l=2,d=3,m=0,y=e,v=e*2,_=-1;s==="RGBA"?(m=0,y=e,v=e*2,_=e*3):s==="RGB"?(m=0,y=e,v=e*2):s==="RBG"&&(m=0,v=e,y=e*2),h=p.createImageData(o,c);for(let T=0;T"u")throw new Error(`input '${s}' is missing in 'feeds'.`);if(o)for(const s of this.outputNames)p[s]=null;const c=await this.handler.run(u,p,h),f={};for(const s in c)Object.hasOwnProperty.call(c,s)&&(f[s]=new Tensor(c[s].type,c[s].data,c[s].dims));return f}static async create(u,b,g,p){let h,o={};if(typeof u=="string"){if(h=u,typeof b=="object"&&b!==null)o=b;else if(typeof b<"u")throw new TypeError("'options' must be an object.")}else if(u instanceof Uint8Array){if(h=u,typeof b=="object"&&b!==null)o=b;else if(typeof b<"u")throw new TypeError("'options' must be an object.")}else if(u instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&u instanceof SharedArrayBuffer){const t=u;let e=0,n=u.byteLength;if(typeof b=="object"&&b!==null)o=b;else if(typeof b=="number"){if(e=b,!Number.isSafeInteger(e))throw new RangeError("'byteOffset' must be an integer.");if(e<0||e>=t.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${t.byteLength}).`);if(n=u.byteLength-e,typeof g=="number"){if(n=g,!Number.isSafeInteger(n))throw new RangeError("'byteLength' must be an integer.");if(n<=0||e+n>t.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${t.byteLength-e}].`);if(typeof p=="object"&&p!==null)o=p;else if(typeof p<"u")throw new TypeError("'options' must be an object.")}else if(typeof g<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof b<"u")throw new TypeError("'options' must be an object.");h=new Uint8Array(t,e,n)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");const f=(o.executionProviders||[]).map(t=>typeof t=="string"?t:t.name),i=await(await resolveBackend(f)).createSessionHandler(h,o);return new cn(i)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}};const InferenceSession=InferenceSession$1,lib=Object.freeze(Object.defineProperty({__proto__:null,InferenceSession,Tensor,env,registerBackend},Symbol.toStringTag,{value:"Module"})),require$$0=getAugmentedNamespace(lib);/*! * ONNX Runtime Web v1.14.0 * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. diff --git a/assets/index-BjaUT3uc.js b/assets/index-DQQzlxjW.js similarity index 88% rename from assets/index-BjaUT3uc.js rename to assets/index-DQQzlxjW.js index d70a2411c0edb5c4bba01d5fc88eef6c32ace48d..c785df54f60a59a3a90a3608845c386887fd20e5 100644 --- a/assets/index-BjaUT3uc.js +++ b/assets/index-DQQzlxjW.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{_ as h}from"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";import{d as v,q as _,h as k,bw as x,c as t,o as i,b as I,a as d,x as l,A as m,u as s,bx as g,by as w}from"./index--eYU5aQm.js";import{I as z}from"./IconStatusItem-rr4-xndX.js";import{_ as A}from"./IconAnimation.vue_vue_type_script_setup_true_lang-BkJuuWL8.js";import{u as B}from"./useIconAnimation-Rig5jSD8.js";import{b as u}from"./route-block-B_A1xBdJ.js";const $={grid:"~ cols-1 sm:cols-2 gap-4"},C={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},D=v({__name:"index",setup(L){const{t:e}=_(),p=k(()=>[{id:"consciousness",name:e("settings.pages.modules.consciousness.title"),description:e("settings.pages.modules.consciousness.description"),icon:"i-solar:ghost-bold-duotone",to:"/settings/modules/consciousness",configured:!1},{id:"speech",name:e("settings.pages.modules.speech.title"),description:e("settings.pages.modules.speech.description"),icon:"i-solar:user-speak-rounded-bold-duotone",to:"/settings/modules/speech",configured:!1},{id:"hearing",name:e("settings.pages.modules.hearing.title"),description:e("settings.pages.modules.hearing.description"),icon:"i-solar:microphone-3-bold-duotone",to:"",configured:!1},{id:"vision",name:e("settings.pages.modules.vision.title"),description:e("settings.pages.modules.vision.description"),icon:"i-solar:eye-closed-bold-duotone",to:"",configured:!1},{id:"memory-short-term",name:e("settings.pages.modules.memory-short-term.title"),description:e("settings.pages.modules.memory-short-term.description"),icon:"i-solar:bookmark-bold-duotone",to:"/settings/modules/memory-short-term",configured:!1},{id:"memory-long-term",name:e("settings.pages.modules.memory-long-term.title"),description:e("settings.pages.modules.memory-long-term.description"),icon:"i-solar:book-bookmark-bold-duotone",to:"/settings/modules/memory-long-term",configured:!1},{id:"messaging-discord",name:e("settings.pages.modules.messaging-discord.title"),description:e("settings.pages.modules.messaging-discord.description"),icon:"i-simple-icons:discord",to:"",configured:!1},{id:"x",name:e("settings.pages.modules.x.title"),description:e("settings.pages.modules.x.description"),icon:"i-simple-icons:x",to:"",configured:!1},{id:"game-minecraft",name:e("settings.pages.modules.gaming-minecraft.title"),description:e("settings.pages.modules.gaming-minecraft.description"),iconColor:"i-vscode-icons:file-type-minecraft",to:"",configured:!1},{id:"game-factorio",name:e("settings.pages.modules.gaming-factorio.title"),description:e("settings.pages.modules.gaming-factorio.description"),iconImage:"",to:"",configured:!1}]),{iconAnimationStarted:f,showIconAnimation:y,animationIcon:b}=B("i-solar:layers-bold-duotone");return(n,r)=>{const a=x("motion");return i(),t(g,null,[I(s(h),{title:n.$t("settings.pages.modules.title"),subtitle:n.$t("settings.title")},null,8,["title","subtitle"]),d("div",$,[(i(!0),t(g,null,w(p.value,(o,c)=>m((i(),l(s(z),{key:o.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+c*10,delay:c*50,title:o.name,description:o.description,icon:o.icon,"icon-color":o.iconColor,"icon-image":o.iconImage,to:o.to,configured:o.configured},null,8,["duration","delay","title","description","icon","icon-color","icon-image","to","configured"])),[[a]])),128))]),s(y)?(i(),l(A,{key:0,icon:s(b),"icon-size":12,duration:1e3,started:s(f),"is-reverse":!0,"z-index":-1,"text-color":"text-neutral-200/50 dark:text-neutral-600/20",position:"calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)"},null,8,["icon","started"])):m((i(),t("div",C,r[0]||(r[0]=[d("div",{text:"60","i-solar:layers-bold-duotone":""},null,-1)]))),[[a]])],64)}}});typeof u=="function"&&u(D);export{D as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{_ as h}from"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";import{d as v,q as _,h as k,bw as x,c as t,o as i,b as I,a as d,x as l,A as m,u as s,bx as g,by as w}from"./index-D55VqdU4.js";import{I as z}from"./IconStatusItem-DwLpS4EY.js";import{_ as A}from"./IconAnimation.vue_vue_type_script_setup_true_lang-BpdSb0ho.js";import{u as B}from"./useIconAnimation-Dw2zcJkj.js";import{b as u}from"./route-block-B_A1xBdJ.js";const $={grid:"~ cols-1 sm:cols-2 gap-4"},C={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},D=v({__name:"index",setup(L){const{t:e}=_(),p=k(()=>[{id:"consciousness",name:e("settings.pages.modules.consciousness.title"),description:e("settings.pages.modules.consciousness.description"),icon:"i-solar:ghost-bold-duotone",to:"/settings/modules/consciousness",configured:!1},{id:"speech",name:e("settings.pages.modules.speech.title"),description:e("settings.pages.modules.speech.description"),icon:"i-solar:user-speak-rounded-bold-duotone",to:"/settings/modules/speech",configured:!1},{id:"hearing",name:e("settings.pages.modules.hearing.title"),description:e("settings.pages.modules.hearing.description"),icon:"i-solar:microphone-3-bold-duotone",to:"",configured:!1},{id:"vision",name:e("settings.pages.modules.vision.title"),description:e("settings.pages.modules.vision.description"),icon:"i-solar:eye-closed-bold-duotone",to:"",configured:!1},{id:"memory-short-term",name:e("settings.pages.modules.memory-short-term.title"),description:e("settings.pages.modules.memory-short-term.description"),icon:"i-solar:bookmark-bold-duotone",to:"/settings/modules/memory-short-term",configured:!1},{id:"memory-long-term",name:e("settings.pages.modules.memory-long-term.title"),description:e("settings.pages.modules.memory-long-term.description"),icon:"i-solar:book-bookmark-bold-duotone",to:"/settings/modules/memory-long-term",configured:!1},{id:"messaging-discord",name:e("settings.pages.modules.messaging-discord.title"),description:e("settings.pages.modules.messaging-discord.description"),icon:"i-simple-icons:discord",to:"",configured:!1},{id:"x",name:e("settings.pages.modules.x.title"),description:e("settings.pages.modules.x.description"),icon:"i-simple-icons:x",to:"",configured:!1},{id:"game-minecraft",name:e("settings.pages.modules.gaming-minecraft.title"),description:e("settings.pages.modules.gaming-minecraft.description"),iconColor:"i-vscode-icons:file-type-minecraft",to:"",configured:!1},{id:"game-factorio",name:e("settings.pages.modules.gaming-factorio.title"),description:e("settings.pages.modules.gaming-factorio.description"),iconImage:"",to:"",configured:!1}]),{iconAnimationStarted:f,showIconAnimation:y,animationIcon:b}=B("i-solar:layers-bold-duotone");return(n,r)=>{const a=x("motion");return i(),t(g,null,[I(s(h),{title:n.$t("settings.pages.modules.title"),subtitle:n.$t("settings.title")},null,8,["title","subtitle"]),d("div",$,[(i(!0),t(g,null,w(p.value,(o,c)=>m((i(),l(s(z),{key:o.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+c*10,delay:c*50,title:o.name,description:o.description,icon:o.icon,"icon-color":o.iconColor,"icon-image":o.iconImage,to:o.to,configured:o.configured},null,8,["duration","delay","title","description","icon","icon-color","icon-image","to","configured"])),[[a]])),128))]),s(y)?(i(),l(A,{key:0,icon:s(b),"icon-size":12,duration:1e3,started:s(f),"is-reverse":!0,"z-index":-1,"text-color":"text-neutral-200/50 dark:text-neutral-600/20",position:"calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)"},null,8,["icon","started"])):m((i(),t("div",C,r[0]||(r[0]=[d("div",{text:"60","i-solar:layers-bold-duotone":""},null,-1)]))),[[a]])],64)}}});typeof u=="function"&&u(D);export{D as default}; diff --git a/assets/index-D3Hcl_56.js b/assets/index-DzQg1p4T.js similarity index 78% rename from assets/index-D3Hcl_56.js rename to assets/index-DzQg1p4T.js index 072cf5d6be7092d45efbcc2429b35e3f5da80001..8338b02cba76df5428da0af3f0aaeb5b01099fab 100644 --- a/assets/index-D3Hcl_56.js +++ b/assets/index-DzQg1p4T.js @@ -1 +1 @@ -import{_ as u}from"./IconAnimation.vue_vue_type_script_setup_true_lang-BkJuuWL8.js";import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{_ as p}from"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";import{d as f,bw as _,c as n,o,b as v,a,x,A as b,u as e,bx as k}from"./index--eYU5aQm.js";import{u as y}from"./useIconAnimation-Rig5jSD8.js";import{b as r}from"./route-block-B_A1xBdJ.js";const g={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},h=f({__name:"index",setup(A){const{iconAnimationStarted:s,showIconAnimation:c,animationIcon:l}=y("i-solar:armchair-2-bold-duotone");return(i,t)=>{const m=u,d=_("motion");return o(),n(k,null,[v(e(p),{title:i.$t("settings.pages.scene.title"),subtitle:i.$t("settings.title")},null,8,["title","subtitle"]),t[1]||(t[1]=a("div",null," Scene ",-1)),e(c)?(o(),x(m,{key:0,"z-index":-1,icon:e(l),"icon-size":12,duration:1e3,started:e(s),"is-reverse":!0,position:"calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)","text-color":"text-neutral-200/50 dark:text-neutral-600/20"},null,8,["icon","started"])):b((o(),n("div",g,t[0]||(t[0]=[a("div",{text:"60","i-solar:armchair-2-bold-duotone":""},null,-1)]))),[[d]])],64)}}});typeof r=="function"&&r(h);export{h as default}; +import{_ as u}from"./IconAnimation.vue_vue_type_script_setup_true_lang-BpdSb0ho.js";import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{_ as p}from"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";import{d as f,bw as _,c as n,o,b as v,a,x,A as b,u as e,bx as k}from"./index-D55VqdU4.js";import{u as y}from"./useIconAnimation-Dw2zcJkj.js";import{b as r}from"./route-block-B_A1xBdJ.js";const g={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},h=f({__name:"index",setup(A){const{iconAnimationStarted:s,showIconAnimation:c,animationIcon:l}=y("i-solar:armchair-2-bold-duotone");return(i,t)=>{const m=u,d=_("motion");return o(),n(k,null,[v(e(p),{title:i.$t("settings.pages.scene.title"),subtitle:i.$t("settings.title")},null,8,["title","subtitle"]),t[1]||(t[1]=a("div",null," Scene ",-1)),e(c)?(o(),x(m,{key:0,"z-index":-1,icon:e(l),"icon-size":12,duration:1e3,started:e(s),"is-reverse":!0,position:"calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)","text-color":"text-neutral-200/50 dark:text-neutral-600/20"},null,8,["icon","started"])):b((o(),n("div",g,t[0]||(t[0]=[a("div",{text:"60","i-solar:armchair-2-bold-duotone":""},null,-1)]))),[[d]])],64)}}});typeof r=="function"&&r(h);export{h as default}; diff --git a/assets/index-CpeQQOdD.js b/assets/index-fSchh9rJ.js similarity index 99% rename from assets/index-CpeQQOdD.js rename to assets/index-fSchh9rJ.js index 6cc33aabec6aa06d7f25ef4a06d20514241b3146..9c8a0f126b94bd2f54bd6654cfba86b9379d1e59 100644 --- a/assets/index-CpeQQOdD.js +++ b/assets/index-fSchh9rJ.js @@ -1,3 +1,3 @@ -import{h as O,g as E,G as Mt,w as j,ah as Lt,ai as Ft,bT as xe,u as m,d as D,x as T,o as B,y as A,m as P,bU as de,bV as fe,bW as F,bM as Ze,bv as ge,l as De,E as lt,C as Nt,b as me,bX as yn,bY as ye,bZ as wn,b_ as kt,b$ as bn,c0 as ke,c1 as xn,c2 as On,br as Cn,H as It,bx as An,c3 as Wt,c4 as En,c5 as Ht,c6 as xt,af as K,ab as Dn,bL as Pn,D as _n,c as Vt,n as st,c7 as jt,c8 as Bn,c9 as zt,ca as Tn,cb as Rn,a as $n,cc as Sn,cd as Mn}from"./index--eYU5aQm.js";const Ln=["top","right","bottom","left"],ae=Math.min,H=Math.max,Ie=Math.round,Me=Math.floor,G=e=>({x:e,y:e}),Fn={left:"right",right:"left",bottom:"top",top:"bottom"},Nn={start:"end",end:"start"};function Qe(e,t,n){return H(e,ae(t,n))}function ee(e,t){return typeof e=="function"?e(t):e}function te(e){return e.split("-")[0]}function Pe(e){return e.split("-")[1]}function at(e){return e==="x"?"y":"x"}function ut(e){return e==="y"?"height":"width"}function ue(e){return["top","bottom"].includes(te(e))?"y":"x"}function ct(e){return at(ue(e))}function kn(e,t,n){n===void 0&&(n=!1);const o=Pe(e),i=ct(e),r=ut(i);let l=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(l=We(l)),[l,We(l)]}function In(e){const t=We(e);return[et(e),t,et(t)]}function et(e){return e.replace(/start|end/g,t=>Nn[t])}function Wn(e,t,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:o:t?o:i;case"left":case"right":return t?r:l;default:return[]}}function Hn(e,t,n,o){const i=Pe(e);let r=Wn(te(e),n==="start",o);return i&&(r=r.map(l=>l+"-"+i),t&&(r=r.concat(r.map(et)))),r}function We(e){return e.replace(/left|right|bottom|top/g,t=>Fn[t])}function Vn(e){return{top:0,right:0,bottom:0,left:0,...e}}function Kt(e){return typeof e!="number"?Vn(e):{top:e,right:e,bottom:e,left:e}}function He(e){const{x:t,y:n,width:o,height:i}=e;return{width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}function Ot(e,t,n){let{reference:o,floating:i}=e;const r=ue(t),l=ct(t),s=ut(l),d=te(t),c=r==="y",a=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,p=o[s]/2-i[s]/2;let f;switch(d){case"top":f={x:a,y:o.y-i.height};break;case"bottom":f={x:a,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:u};break;case"left":f={x:o.x-i.width,y:u};break;default:f={x:o.x,y:o.y}}switch(Pe(t)){case"start":f[l]-=p*(n&&c?-1:1);break;case"end":f[l]+=p*(n&&c?-1:1);break}return f}const jn=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:l}=n,s=r.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:a,y:u}=Ot(c,o,d),p=o,f={},v=0;for(let g=0;g({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:r,platform:l,elements:s,middlewareData:d}=t,{element:c,padding:a=0}=ee(e,t)||{};if(c==null)return{};const u=Kt(a),p={x:n,y:o},f=ct(i),v=ut(f),g=await l.getDimensions(c),h=f==="y",y=h?"top":"left",b=h?"bottom":"right",w=h?"clientHeight":"clientWidth",C=r.reference[v]+r.reference[f]-p[f]-r.floating[v],x=p[f]-r.reference[f],S=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c));let _=S?S[w]:0;(!_||!await(l.isElement==null?void 0:l.isElement(S)))&&(_=s.floating[w]||r.floating[v]);const M=C/2-x/2,N=_/2-g[v]/2-1,R=ae(u[y],N),z=ae(u[b],N),k=R,W=_-g[v]-z,L=_/2-g[v]/2+M,oe=Qe(k,L,W),I=!d.arrow&&Pe(i)!=null&&L!==oe&&r.reference[v]/2-(LL<=0)){var z,k;const L=(((z=r.flip)==null?void 0:z.index)||0)+1,oe=_[L];if(oe)return{data:{index:L,overflows:R},reset:{placement:oe}};let I=(k=R.filter(q=>q.overflows[0]<=0).sort((q,ie)=>q.overflows[1]-ie.overflows[1])[0])==null?void 0:k.placement;if(!I)switch(f){case"bestFit":{var W;const q=(W=R.filter(ie=>{if(S){const re=ue(ie.placement);return re===b||re==="y"}return!0}).map(ie=>[ie.placement,ie.overflows.filter(re=>re>0).reduce((re,gn)=>re+gn,0)]).sort((ie,re)=>ie[1]-re[1])[0])==null?void 0:W[0];q&&(I=q);break}case"initialPlacement":I=s;break}if(i!==I)return{reset:{placement:I}}}return{}}}};function Ct(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function At(e){return Ln.some(t=>e[t]>=0)}const Un=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...i}=ee(e,t);switch(o){case"referenceHidden":{const r=await _e(t,{...i,elementContext:"reference"}),l=Ct(r,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:At(l)}}}case"escaped":{const r=await _e(t,{...i,altBoundary:!0}),l=Ct(r,n.floating);return{data:{escapedOffsets:l,escaped:At(l)}}}default:return{}}}}};async function Yn(e,t){const{placement:n,platform:o,elements:i}=e,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),l=te(n),s=Pe(n),d=ue(n)==="y",c=["left","top"].includes(l)?-1:1,a=r&&d?-1:1,u=ee(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:v}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&typeof v=="number"&&(f=s==="end"?v*-1:v),d?{x:f*a,y:p*c}:{x:p*c,y:f*a}}const Xn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:r,placement:l,middlewareData:s}=t,d=await Yn(t,e);return l===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:i+d.x,y:r+d.y,data:{...d,placement:l}}}}},qn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:r=!0,crossAxis:l=!1,limiter:s={fn:h=>{let{x:y,y:b}=h;return{x:y,y:b}}},...d}=ee(e,t),c={x:n,y:o},a=await _e(t,d),u=ue(te(i)),p=at(u);let f=c[p],v=c[u];if(r){const h=p==="y"?"top":"left",y=p==="y"?"bottom":"right",b=f+a[h],w=f-a[y];f=Qe(b,f,w)}if(l){const h=u==="y"?"top":"left",y=u==="y"?"bottom":"right",b=v+a[h],w=v-a[y];v=Qe(b,v,w)}const g=s.fn({...t,[p]:f,[u]:v});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[p]:r,[u]:l}}}}}},Gn=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:i,rects:r,middlewareData:l}=t,{offset:s=0,mainAxis:d=!0,crossAxis:c=!0}=ee(e,t),a={x:n,y:o},u=ue(i),p=at(u);let f=a[p],v=a[u];const g=ee(s,t),h=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(d){const w=p==="y"?"height":"width",C=r.reference[p]-r.floating[w]+h.mainAxis,x=r.reference[p]+r.reference[w]-h.mainAxis;fx&&(f=x)}if(c){var y,b;const w=p==="y"?"width":"height",C=["top","left"].includes(te(i)),x=r.reference[u]-r.floating[w]+(C&&((y=l.offset)==null?void 0:y[u])||0)+(C?0:h.crossAxis),S=r.reference[u]+r.reference[w]+(C?0:((b=l.offset)==null?void 0:b[u])||0)-(C?h.crossAxis:0);vS&&(v=S)}return{[p]:f,[u]:v}}}},Jn=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:i,rects:r,platform:l,elements:s}=t,{apply:d=()=>{},...c}=ee(e,t),a=await _e(t,c),u=te(i),p=Pe(i),f=ue(i)==="y",{width:v,height:g}=r.floating;let h,y;u==="top"||u==="bottom"?(h=u,y=p===(await(l.isRTL==null?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(y=u,h=p==="end"?"top":"bottom");const b=g-a.top-a.bottom,w=v-a.left-a.right,C=ae(g-a[h],b),x=ae(v-a[y],w),S=!t.middlewareData.shift;let _=C,M=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=w),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(_=b),S&&!p){const R=H(a.left,0),z=H(a.right,0),k=H(a.top,0),W=H(a.bottom,0);f?M=v-2*(R!==0||z!==0?R+z:H(a.left,a.right)):_=g-2*(k!==0||W!==0?k+W:H(a.top,a.bottom))}await d({...t,availableWidth:M,availableHeight:_});const N=await l.getDimensions(s.floating);return v!==N.width||g!==N.height?{reset:{rects:!0}}:{}}}};function je(){return typeof window<"u"}function we(e){return dt(e)?(e.nodeName||"").toLowerCase():"#document"}function V(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Z(e){var t;return(t=(dt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function dt(e){return je()?e instanceof Node||e instanceof V(e).Node:!1}function U(e){return je()?e instanceof Element||e instanceof V(e).Element:!1}function J(e){return je()?e instanceof HTMLElement||e instanceof V(e).HTMLElement:!1}function Et(e){return!je()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof V(e).ShadowRoot}function Te(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=Y(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(i)}function Zn(e){return["table","td","th"].includes(we(e))}function ze(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function ft(e){const t=pt(),n=U(e)?Y(e):e;return["transform","translate","scale","rotate","perspective"].some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Qn(e){let t=ce(e);for(;J(t)&&!Ee(t);){if(ft(t))return t;if(ze(t))return null;t=ce(t)}return null}function pt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ee(e){return["html","body","#document"].includes(we(e))}function Y(e){return V(e).getComputedStyle(e)}function Ke(e){return U(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ce(e){if(we(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Et(e)&&e.host||Z(e);return Et(t)?t.host:t}function Ut(e){const t=ce(e);return Ee(t)?e.ownerDocument?e.ownerDocument.body:e.body:J(t)&&Te(t)?t:Ut(t)}function Be(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Ut(e),r=i===((o=e.ownerDocument)==null?void 0:o.body),l=V(i);if(r){const s=tt(l);return t.concat(l,l.visualViewport||[],Te(i)?i:[],s&&n?Be(s):[])}return t.concat(i,Be(i,[],n))}function tt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Yt(e){const t=Y(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=J(e),r=i?e.offsetWidth:n,l=i?e.offsetHeight:o,s=Ie(n)!==r||Ie(o)!==l;return s&&(n=r,o=l),{width:n,height:o,$:s}}function vt(e){return U(e)?e:e.contextElement}function Ae(e){const t=vt(e);if(!J(t))return G(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:r}=Yt(t);let l=(r?Ie(n.width):n.width)/o,s=(r?Ie(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const eo=G(0);function Xt(e){const t=V(e);return!pt()||!t.visualViewport?eo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function to(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==V(e)?!1:t}function he(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),r=vt(e);let l=G(1);t&&(o?U(o)&&(l=Ae(o)):l=Ae(e));const s=to(r,n,o)?Xt(r):G(0);let d=(i.left+s.x)/l.x,c=(i.top+s.y)/l.y,a=i.width/l.x,u=i.height/l.y;if(r){const p=V(r),f=o&&U(o)?V(o):o;let v=p,g=tt(v);for(;g&&o&&f!==v;){const h=Ae(g),y=g.getBoundingClientRect(),b=Y(g),w=y.left+(g.clientLeft+parseFloat(b.paddingLeft))*h.x,C=y.top+(g.clientTop+parseFloat(b.paddingTop))*h.y;d*=h.x,c*=h.y,a*=h.x,u*=h.y,d+=w,c+=C,v=V(g),g=tt(v)}}return He({width:a,height:u,x:d,y:c})}function mt(e,t){const n=Ke(e).scrollLeft;return t?t.left+n:he(Z(e)).left+n}function qt(e,t,n){n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=o.left+t.scrollLeft-(n?0:mt(e,o)),r=o.top+t.scrollTop;return{x:i,y:r}}function no(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const r=i==="fixed",l=Z(o),s=t?ze(t.floating):!1;if(o===l||s&&r)return n;let d={scrollLeft:0,scrollTop:0},c=G(1);const a=G(0),u=J(o);if((u||!u&&!r)&&((we(o)!=="body"||Te(l))&&(d=Ke(o)),J(o))){const f=he(o);c=Ae(o),a.x=f.x+o.clientLeft,a.y=f.y+o.clientTop}const p=l&&!u&&!r?qt(l,d,!0):G(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-d.scrollLeft*c.x+a.x+p.x,y:n.y*c.y-d.scrollTop*c.y+a.y+p.y}}function oo(e){return Array.from(e.getClientRects())}function io(e){const t=Z(e),n=Ke(e),o=e.ownerDocument.body,i=H(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=H(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+mt(e);const s=-n.scrollTop;return Y(o).direction==="rtl"&&(l+=H(t.clientWidth,o.clientWidth)-i),{width:i,height:r,x:l,y:s}}function ro(e,t){const n=V(e),o=Z(e),i=n.visualViewport;let r=o.clientWidth,l=o.clientHeight,s=0,d=0;if(i){r=i.width,l=i.height;const c=pt();(!c||c&&t==="fixed")&&(s=i.offsetLeft,d=i.offsetTop)}return{width:r,height:l,x:s,y:d}}function lo(e,t){const n=he(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,r=J(e)?Ae(e):G(1),l=e.clientWidth*r.x,s=e.clientHeight*r.y,d=i*r.x,c=o*r.y;return{width:l,height:s,x:d,y:c}}function Dt(e,t,n){let o;if(t==="viewport")o=ro(e,n);else if(t==="document")o=io(Z(e));else if(U(t))o=lo(t,n);else{const i=Xt(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return He(o)}function Gt(e,t){const n=ce(e);return n===t||!U(n)||Ee(n)?!1:Y(n).position==="fixed"||Gt(n,t)}function so(e,t){const n=t.get(e);if(n)return n;let o=Be(e,[],!1).filter(s=>U(s)&&we(s)!=="body"),i=null;const r=Y(e).position==="fixed";let l=r?ce(e):e;for(;U(l)&&!Ee(l);){const s=Y(l),d=ft(l);!d&&s.position==="fixed"&&(i=null),(r?!d&&!i:!d&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Te(l)&&!d&&Gt(e,l))?o=o.filter(a=>a!==l):i=s,l=ce(l)}return t.set(e,o),o}function ao(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const l=[...n==="clippingAncestors"?ze(t)?[]:so(t,this._c):[].concat(n),o],s=l[0],d=l.reduce((c,a)=>{const u=Dt(t,a,i);return c.top=H(u.top,c.top),c.right=ae(u.right,c.right),c.bottom=ae(u.bottom,c.bottom),c.left=H(u.left,c.left),c},Dt(t,s,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function uo(e){const{width:t,height:n}=Yt(e);return{width:t,height:n}}function co(e,t,n){const o=J(t),i=Z(t),r=n==="fixed",l=he(e,!0,r,t);let s={scrollLeft:0,scrollTop:0};const d=G(0);if(o||!o&&!r)if((we(t)!=="body"||Te(i))&&(s=Ke(t)),o){const p=he(t,!0,r,t);d.x=p.x+t.clientLeft,d.y=p.y+t.clientTop}else i&&(d.x=mt(i));const c=i&&!o&&!r?qt(i,s):G(0),a=l.left+s.scrollLeft-d.x-c.x,u=l.top+s.scrollTop-d.y-c.y;return{x:a,y:u,width:l.width,height:l.height}}function Ye(e){return Y(e).position==="static"}function Pt(e,t){if(!J(e)||Y(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Z(e)===n&&(n=n.ownerDocument.body),n}function Jt(e,t){const n=V(e);if(ze(e))return n;if(!J(e)){let i=ce(e);for(;i&&!Ee(i);){if(U(i)&&!Ye(i))return i;i=ce(i)}return n}let o=Pt(e,t);for(;o&&Zn(o)&&Ye(o);)o=Pt(o,t);return o&&Ee(o)&&Ye(o)&&!ft(o)?n:o||Qn(e)||n}const fo=async function(e){const t=this.getOffsetParent||Jt,n=this.getDimensions,o=await n(e.floating);return{reference:co(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function po(e){return Y(e).direction==="rtl"}const vo={convertOffsetParentRelativeRectToViewportRelativeRect:no,getDocumentElement:Z,getClippingRect:ao,getOffsetParent:Jt,getElementRects:fo,getClientRects:oo,getDimensions:uo,getScale:Ae,isElement:U,isRTL:po};function Zt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function mo(e,t){let n=null,o;const i=Z(e);function r(){var s;clearTimeout(o),(s=n)==null||s.disconnect(),n=null}function l(s,d){s===void 0&&(s=!1),d===void 0&&(d=1),r();const c=e.getBoundingClientRect(),{left:a,top:u,width:p,height:f}=c;if(s||t(),!p||!f)return;const v=Me(u),g=Me(i.clientWidth-(a+p)),h=Me(i.clientHeight-(u+f)),y=Me(a),w={rootMargin:-v+"px "+-g+"px "+-h+"px "+-y+"px",threshold:H(0,ae(1,d))||1};let C=!0;function x(S){const _=S[0].intersectionRatio;if(_!==d){if(!C)return l();_?l(!1,_):o=setTimeout(()=>{l(!1,1e-7)},1e3)}_===1&&!Zt(c,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(x,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(x,w)}n.observe(e)}return l(!0),r}function ho(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,c=vt(e),a=i||r?[...c?Be(c):[],...Be(t)]:[];a.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),r&&y.addEventListener("resize",n)});const u=c&&s?mo(c,n):null;let p=-1,f=null;l&&(f=new ResizeObserver(y=>{let[b]=y;b&&b.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=f)==null||w.observe(t)})),n()}),c&&!d&&f.observe(c),f.observe(t));let v,g=d?he(e):null;d&&h();function h(){const y=he(e);g&&!Zt(g,y)&&n(),g=y,v=requestAnimationFrame(h)}return n(),()=>{var y;a.forEach(b=>{i&&b.removeEventListener("scroll",n),r&&b.removeEventListener("resize",n)}),u==null||u(),(y=f)==null||y.disconnect(),f=null,d&&cancelAnimationFrame(v)}}const go=Xn,yo=qn,_t=Kn,wo=Jn,bo=Un,xo=zn,Oo=Gn,Co=(e,t,n)=>{const o=new Map,i={platform:vo,...n},r={...i.platform,_c:o};return jn(e,t,{...i,platform:r})};function Ao(e){return e!=null&&typeof e=="object"&&"$el"in e}function nt(e){if(Ao(e)){const t=e.$el;return dt(t)&&we(t)==="#comment"?null:t}return e}function Ce(e){return typeof e=="function"?e():m(e)}function Eo(e){return{name:"arrow",options:e,fn(t){const n=nt(Ce(e.element));return n==null?{}:xo({element:n,padding:e.padding}).fn(t)}}}function Qt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Bt(e,t){const n=Qt(e);return Math.round(t*n)/n}function Do(e,t,n){n===void 0&&(n={});const o=n.whileElementsMounted,i=O(()=>{var _;return(_=Ce(n.open))!=null?_:!0}),r=O(()=>Ce(n.middleware)),l=O(()=>{var _;return(_=Ce(n.placement))!=null?_:"bottom"}),s=O(()=>{var _;return(_=Ce(n.strategy))!=null?_:"absolute"}),d=O(()=>{var _;return(_=Ce(n.transform))!=null?_:!0}),c=O(()=>nt(e.value)),a=O(()=>nt(t.value)),u=E(0),p=E(0),f=E(s.value),v=E(l.value),g=Mt({}),h=E(!1),y=O(()=>{const _={position:f.value,left:"0",top:"0"};if(!a.value)return _;const M=Bt(a.value,u.value),N=Bt(a.value,p.value);return d.value?{..._,transform:"translate("+M+"px, "+N+"px)",...Qt(a.value)>=1.5&&{willChange:"transform"}}:{position:f.value,left:M+"px",top:N+"px"}});let b;function w(){if(c.value==null||a.value==null)return;const _=i.value;Co(c.value,a.value,{middleware:r.value,placement:l.value,strategy:s.value}).then(M=>{u.value=M.x,p.value=M.y,f.value=M.strategy,v.value=M.placement,g.value=M.middlewareData,h.value=_!==!1})}function C(){typeof b=="function"&&(b(),b=void 0)}function x(){if(C(),o===void 0){w();return}if(c.value!=null&&a.value!=null){b=o(c.value,a.value,w);return}}function S(){i.value||(h.value=!1)}return j([r,l,s,i],w,{flush:"sync"}),j([c,a],x,{flush:"sync"}),j(i,S,{flush:"sync"}),Lt()&&Ft(C),{x:xe(u),y:xe(p),strategy:xe(f),placement:xe(v),middlewareData:xe(g),isPositioned:xe(h),floatingStyles:y,update:w}}function be(e,t){const n=typeof e=="string"&&!t?`${e}Context`:t,o=Symbol(n);return[i=>{const r=bn(o,i);if(r||r===null)return r;throw new Error(`Injection \`${o.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(", ")}`:`\`${e}\``}`)},i=>(Mn(o,i),i)]}function en(e,t,n){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),o.dispatchEvent(i)}function Po(e,t){var n;const o=Mt();return K(()=>{o.value=e()},{...t,flush:(n=void 0)!=null?n:"sync"}),Ht(o)}function Re(e){return Lt()?(Ft(e),!0):!1}function _o(){const e=new Set,t=n=>{e.delete(n)};return{on:n=>{e.add(n);const o=()=>t(n);return Re(o),{off:o}},off:t,trigger:(...n)=>Promise.all(Array.from(e).map(o=>o(...n)))}}function Bo(e){let t=!1,n;const o=jt(!0);return(...i)=>(t||(n=o.run(()=>e(...i)),t=!0),n)}function To(e){let t=0,n,o;const i=()=>{t-=1,o&&t<=0&&(o.stop(),n=void 0,o=void 0)};return(...r)=>(t+=1,n||(o=jt(!0),n=o.run(()=>e(...r))),Re(i),n)}function ve(e){return typeof e=="function"?e():m(e)}const pe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Ro=e=>typeof e<"u",$o=Object.prototype.toString,So=e=>$o.call(e)==="[object Object]",Mo=()=>{},Tt=Lo();function Lo(){var e,t;return pe&&((e=window==null?void 0:window.navigator)==null?void 0:e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window==null?void 0:window.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function Fo(e){return ye()}function No(e,t=1e4){return Sn((n,o)=>{let i=ve(e),r;const l=()=>setTimeout(()=>{i=ve(e),o()},ve(t));return Re(()=>{clearTimeout(r)}),{get(){return n(),i},set(s){i=s,o(),clearTimeout(r),r=l()}}})}function ko(e,t){Fo()&&Bn(e,t)}function tn(e,t,n={}){const{immediate:o=!0}=n,i=E(!1);let r=null;function l(){r&&(clearTimeout(r),r=null)}function s(){i.value=!1,l()}function d(...c){l(),i.value=!0,r=setTimeout(()=>{i.value=!1,r=null,e(...c)},ve(t))}return o&&(i.value=!0,pe&&d()),Re(s),{isPending:Ht(i),start:d,stop:s}}function $e(e){var t;const n=ve(e);return(t=n==null?void 0:n.$el)!=null?t:n}const ht=pe?window:void 0;function Ve(...e){let t,n,o,i;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,i]=e,t=ht):[t,n,o,i]=e,!t)return Mo;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const r=[],l=()=>{r.forEach(a=>a()),r.length=0},s=(a,u,p,f)=>(a.addEventListener(u,p,f),()=>a.removeEventListener(u,p,f)),d=j(()=>[$e(t),ve(i)],([a,u])=>{if(l(),!a)return;const p=So(u)?{...u}:u;r.push(...n.flatMap(f=>o.map(v=>s(a,f,v,p))))},{immediate:!0,flush:"post"}),c=()=>{d(),l()};return Re(c),c}function Io(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Wo(...e){let t,n,o={};e.length===3?(t=e[0],n=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],o=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:i=ht,eventName:r="keydown",passive:l=!1,dedupe:s=!1}=o,d=Io(t);return Ve(i,r,c=>{c.repeat&&ve(s)||d(c)&&n(c)},l)}function Ho(){const e=E(!1),t=ye();return t&&De(()=>{e.value=!0},t),e}function Vo(e){return JSON.parse(JSON.stringify(e))}function nn(e,t,n,o={}){var i,r,l;const{clone:s=!1,passive:d=!1,eventName:c,deep:a=!1,defaultValue:u,shouldEmit:p}=o,f=ye(),v=n||(f==null?void 0:f.emit)||((i=f==null?void 0:f.$emit)==null?void 0:i.bind(f))||((l=(r=f==null?void 0:f.proxy)==null?void 0:r.$emit)==null?void 0:l.bind(f==null?void 0:f.proxy));let g=c;g=g||`update:${t.toString()}`;const h=w=>s?typeof s=="function"?s(w):Vo(w):w,y=()=>Ro(e[t])?h(e[t]):u,b=w=>{p?p(w)&&v(g,w):v(g,w)};if(d){const w=y(),C=E(w);let x=!1;return j(()=>e[t],S=>{x||(x=!0,C.value=h(S),ge(()=>x=!1))}),j(C,S=>{!x&&(S!==e[t]||a)&&b(S)},{deep:a}),C}else return O({get(){return y()},set(w){b(w)}})}function gt(e){return e?e.flatMap(t=>t.type===An?gt(t.children):[t]):[]}function se(){let e=document.activeElement;if(e==null)return null;for(;e!=null&&e.shadowRoot!=null&&e.shadowRoot.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function Xe(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function ot(e,t,n=".",o){if(!Xe(t))return ot(e,{},n);const i=Object.assign({},t);for(const r in e){if(r==="__proto__"||r==="constructor")continue;const l=e[r];l!=null&&(Array.isArray(l)&&Array.isArray(i[r])?i[r]=[...l,...i[r]]:Xe(l)&&Xe(i[r])?i[r]=ot(l,i[r],(n?`${n}.`:"")+r.toString()):i[r]=l)}return i}function jo(e){return(...t)=>t.reduce((n,o)=>ot(n,o,""),{})}const zo=jo(),[on,nr]=be("ConfigProvider");let Ko="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Uo=(e=21)=>{let t="",n=e;for(;n--;)t+=Ko[Math.random()*64|0];return t};const Yo=To(()=>{const e=E(new Map),t=E(),n=O(()=>{for(const l of e.value.values())if(l)return!0;return!1}),o=on({scrollBody:E(!0)});let i=null;const r=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.body.style.removeProperty("--scrollbar-width"),document.body.style.overflow=t.value??"",Tt&&(i==null||i()),t.value=void 0};return j(n,(l,s)=>{var d;if(!pe)return;if(!l){s&&r();return}t.value===void 0&&(t.value=document.body.style.overflow);const c=window.innerWidth-document.documentElement.clientWidth,a={padding:c,margin:0},u=(d=o.scrollBody)!=null&&d.value?typeof o.scrollBody.value=="object"?zo({padding:o.scrollBody.value.padding===!0?c:o.scrollBody.value.padding,margin:o.scrollBody.value.margin===!0?c:o.scrollBody.value.margin},a):a:{padding:0,margin:0};c>0&&(document.body.style.paddingRight=typeof u.padding=="number"?`${u.padding}px`:String(u.padding),document.body.style.marginRight=typeof u.margin=="number"?`${u.margin}px`:String(u.margin),document.body.style.setProperty("--scrollbar-width",`${c}px`),document.body.style.overflow="hidden"),Tt&&(i=Ve(document,"touchmove",p=>qo(p),{passive:!1})),ge(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})},{immediate:!0,flush:"sync"}),e});function Xo(e){const t=Uo(6),n=Yo();n.value.set(t,e);const o=O({get:()=>n.value.get(t)??!1,set:i=>n.value.set(t,i)});return ko(()=>{n.value.delete(t)}),o}function rn(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth1?!0:(t.preventDefault&&t.cancelable&&t.preventDefault(),!1)}function Se(e){const t=ye(),n=t==null?void 0:t.type.emits,o={};return n!=null&&n.length||console.warn(`No emitted event found. Please check component: ${t==null?void 0:t.type.__name}`),n==null||n.forEach(i=>{o[wn(kt(i))]=(...r)=>e(i,...r)}),o}function ln(e){const t=ye(),n=Object.keys((t==null?void 0:t.type.props)??{}).reduce((i,r)=>{const l=(t==null?void 0:t.type.props[r]).default;return l!==void 0&&(i[r]=l),i},{}),o=Cn(e);return O(()=>{const i={},r=(t==null?void 0:t.vnode.props)??{};return Object.keys(r).forEach(l=>{i[kt(l)]=r[l]}),Object.keys({...n,...i}).reduce((l,s)=>(o.value[s]!==void 0&&(l[s]=o.value[s]),l),{})})}function sn(e,t){const n=ln(e),o=t?Se(t):{};return O(()=>({...n.value,...o}))}function $(){const e=ye(),t=E(),n=O(()=>{var l,s;return["#text","#comment"].includes((l=t.value)==null?void 0:l.$el.nodeName)?(s=t.value)==null?void 0:s.$el.nextElementSibling:$e(t)}),o=Object.assign({},e.exposed),i={};for(const l in e.props)Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>e.props[l]});if(Object.keys(o).length>0)for(const l in o)Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>o[l]});Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=i;function r(l){t.value=l,l&&(Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>l instanceof Element?l:l.$el}),e.exposed=i)}return{forwardRef:r,currentRef:t,currentElement:n}}function Go(e,t){const n=No(!1,300),o=E(null),i=_o();function r(){o.value=null,n.value=!1}function l(s,d){const c=s.currentTarget,a={x:s.clientX,y:s.clientY},u=Jo(a,c.getBoundingClientRect()),p=Zo(a,u),f=Qo(d.getBoundingClientRect()),v=ti([...p,...f]);o.value=v,n.value=!0}return K(s=>{if(e.value&&t.value){const d=a=>l(a,t.value),c=a=>l(a,e.value);e.value.addEventListener("pointerleave",d),t.value.addEventListener("pointerleave",c),s(()=>{var a,u;(a=e.value)==null||a.removeEventListener("pointerleave",d),(u=t.value)==null||u.removeEventListener("pointerleave",c)})}}),K(s=>{var d;if(o.value){const c=a=>{var u,p;if(!o.value)return;const f=a.target,v={x:a.clientX,y:a.clientY},g=((u=e.value)==null?void 0:u.contains(f))||((p=t.value)==null?void 0:p.contains(f)),h=!ei(v,o.value),y=!!f.closest("[data-grace-area-trigger]");g?r():(h||y)&&(r(),i.trigger())};(d=e.value)==null||d.ownerDocument.addEventListener("pointermove",c),s(()=>{var a;return(a=e.value)==null?void 0:a.ownerDocument.removeEventListener("pointermove",c)})}}),{isPointerInTransit:n,onPointerExit:i.on}}function Jo(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),r=Math.abs(t.left-e.x);switch(Math.min(n,o,i,r)){case r:return"left";case i:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Zo(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function Qo(e){const{top:t,right:n,bottom:o,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:o},{x:i,y:o}]}function ei(e,t){const{x:n,y:o}=e;let i=!1;for(let r=0,l=t.length-1;ro!=a>o&&n<(c-s)*(o-d)/(a-d)+s&&(i=!i)}return i}function ti(e){const t=e.slice();return t.sort((n,o)=>n.xo.x?1:n.yo.y?1:0),ni(t)}function ni(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o=2;){const r=t[t.length-1],l=t[t.length-2];if((r.x-l.x)*(i.y-l.y)>=(r.y-l.y)*(i.x-l.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const i=e[o];for(;n.length>=2;){const r=n[n.length-1],l=n[n.length-2];if((r.x-l.x)*(i.y-l.y)>=(r.y-l.y)*(i.x-l.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var oi=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Oe=new WeakMap,Le=new WeakMap,Fe={},qe=0,an=function(e){return e&&(e.host||an(e.parentNode))},ii=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=an(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ri=function(e,t,n,o){var i=ii(t,Array.isArray(e)?e:[e]);Fe[n]||(Fe[n]=new WeakMap);var r=Fe[n],l=[],s=new Set,d=new Set(i),c=function(u){!u||s.has(u)||(s.add(u),c(u.parentNode))};i.forEach(c);var a=function(u){!u||d.has(u)||Array.prototype.forEach.call(u.children,function(p){if(s.has(p))a(p);else try{var f=p.getAttribute(o),v=f!==null&&f!=="false",g=(Oe.get(p)||0)+1,h=(r.get(p)||0)+1;Oe.set(p,g),r.set(p,h),l.push(p),g===1&&v&&Le.set(p,!0),h===1&&p.setAttribute(n,"true"),v||p.setAttribute(o,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return a(t),s.clear(),qe++,function(){l.forEach(function(u){var p=Oe.get(u)-1,f=r.get(u)-1;Oe.set(u,p),r.set(u,f),p||(Le.has(u)||u.removeAttribute(o),Le.delete(u)),f||u.removeAttribute(n)}),qe--,qe||(Oe=new WeakMap,Oe=new WeakMap,Le=new WeakMap,Fe={})}},li=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),i=oi(e);return i?(o.push.apply(o,Array.from(i.querySelectorAll("[aria-live]"))),ri(o,i,n,"aria-hidden")):function(){return null}};function si(e){let t;j(()=>$e(e),n=>{n?t=li(n):t&&t()}),It(()=>{t&&t()})}let ai=0;function it(e,t="radix"){const n=on({useId:void 0});return xt?`${t}-${xt()}`:n.useId?`${t}-${n.useId()}`:`${t}-${++ai}`}function ui(e){const t=E(),n=O(()=>{var i;return((i=t.value)==null?void 0:i.width)??0}),o=O(()=>{var i;return((i=t.value)==null?void 0:i.height)??0});return De(()=>{const i=$e(e);if(i){t.value={width:i.offsetWidth,height:i.offsetHeight};const r=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const s=l[0];let d,c;if("borderBoxSize"in s){const a=s.borderBoxSize,u=Array.isArray(a)?a[0]:a;d=u.inlineSize,c=u.blockSize}else d=i.offsetWidth,c=i.offsetHeight;t.value={width:d,height:c}});return r.observe(i,{box:"border-box"}),()=>r.unobserve(i)}else t.value=void 0}),{width:n,height:o}}function ci(e,t){const n=E(e);function o(i){return t[n.value][i]??n.value}return{state:n,dispatch:i=>{n.value=o(i)}}}const di=D({name:"PrimitiveSlot",inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{var o,i;if(!n.default)return null;const r=gt(n.default()),l=r.findIndex(a=>a.type!==Wt);if(l===-1)return r;const s=r[l];(o=s.props)==null||delete o.ref;const d=s.props?F(t,s.props):t;t.class&&(i=s.props)!=null&&i.class&&delete s.props.class;const c=En(s,d);for(const a in d)a.startsWith("on")&&(c.props||(c.props={}),c.props[a]=d[a]);return r.length===1?c:(r[l]=c,r)}}}),X=D({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(e,{attrs:t,slots:n}){const o=e.asChild?"template":e.as;return typeof o=="string"&&["area","img","input"].includes(o)?()=>ke(o,t):o!=="template"?()=>ke(e.as,t,{default:n.default}):()=>ke(di,t,{default:n.default})}});function fi(e,t){var n;const o=E({}),i=E("none"),r=E(e),l=e.value?"mounted":"unmounted";let s;const d=((n=t.value)==null?void 0:n.ownerDocument.defaultView)??ht,{state:c,dispatch:a}=ci(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),u=h=>{var y;if(pe){const b=new CustomEvent(h,{bubbles:!1,cancelable:!1});(y=t.value)==null||y.dispatchEvent(b)}};j(e,async(h,y)=>{var b;const w=y!==h;if(await ge(),w){const C=i.value,x=Ne(t.value);h?(a("MOUNT"),u("enter"),x==="none"&&u("after-enter")):x==="none"||((b=o.value)==null?void 0:b.display)==="none"?(a("UNMOUNT"),u("leave"),u("after-leave")):y&&C!==x?(a("ANIMATION_OUT"),u("leave")):(a("UNMOUNT"),u("after-leave"))}},{immediate:!0});const p=h=>{const y=Ne(t.value),b=y.includes(h.animationName),w=c.value==="mounted"?"enter":"leave";if(h.target===t.value&&b&&(u(`after-${w}`),a("ANIMATION_END"),!r.value)){const C=t.value.style.animationFillMode;t.value.style.animationFillMode="forwards",s=d==null?void 0:d.setTimeout(()=>{var x;((x=t.value)==null?void 0:x.style.animationFillMode)==="forwards"&&(t.value.style.animationFillMode=C)})}h.target===t.value&&y==="none"&&a("ANIMATION_END")},f=h=>{h.target===t.value&&(i.value=Ne(t.value))},v=j(t,(h,y)=>{h?(o.value=getComputedStyle(h),h.addEventListener("animationstart",f),h.addEventListener("animationcancel",p),h.addEventListener("animationend",p)):(a("ANIMATION_END"),s!==void 0&&(d==null||d.clearTimeout(s)),y==null||y.removeEventListener("animationstart",f),y==null||y.removeEventListener("animationcancel",p),y==null||y.removeEventListener("animationend",p))},{immediate:!0}),g=j(c,()=>{const h=Ne(t.value);i.value=c.value==="mounted"?h:"none"});return It(()=>{v(),g()}),{isPresent:O(()=>["mounted","unmountSuspended"].includes(c.value))}}function Ne(e){return e&&getComputedStyle(e).animationName||"none"}const yt=D({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:t,expose:n}){var o;const{present:i,forceMount:r}=lt(e),l=E(),{isPresent:s}=fi(i,l);n({present:s});let d=t.default({present:s});d=gt(d||[]);const c=ye();if(d&&(d==null?void 0:d.length)>1){const a=(o=c==null?void 0:c.parent)!=null&&o.type.name?`<${c.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${a}\` 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(u=>` - ${u}`).join(` +import{h as O,g as E,G as Mt,w as j,ah as Lt,ai as Ft,bT as xe,u as m,d as D,x as T,o as B,y as A,m as P,bU as de,bV as fe,bW as F,bM as Ze,bv as ge,l as De,E as lt,C as Nt,b as me,bX as yn,bY as ye,bZ as wn,b_ as kt,b$ as bn,c0 as ke,c1 as xn,c2 as On,br as Cn,H as It,bx as An,c3 as Wt,c4 as En,c5 as Ht,c6 as xt,af as K,ab as Dn,bL as Pn,D as _n,c as Vt,n as st,c7 as jt,c8 as Bn,c9 as zt,ca as Tn,cb as Rn,a as $n,cc as Sn,cd as Mn}from"./index-D55VqdU4.js";const Ln=["top","right","bottom","left"],ae=Math.min,H=Math.max,Ie=Math.round,Me=Math.floor,G=e=>({x:e,y:e}),Fn={left:"right",right:"left",bottom:"top",top:"bottom"},Nn={start:"end",end:"start"};function Qe(e,t,n){return H(e,ae(t,n))}function ee(e,t){return typeof e=="function"?e(t):e}function te(e){return e.split("-")[0]}function Pe(e){return e.split("-")[1]}function at(e){return e==="x"?"y":"x"}function ut(e){return e==="y"?"height":"width"}function ue(e){return["top","bottom"].includes(te(e))?"y":"x"}function ct(e){return at(ue(e))}function kn(e,t,n){n===void 0&&(n=!1);const o=Pe(e),i=ct(e),r=ut(i);let l=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(l=We(l)),[l,We(l)]}function In(e){const t=We(e);return[et(e),t,et(t)]}function et(e){return e.replace(/start|end/g,t=>Nn[t])}function Wn(e,t,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:o:t?o:i;case"left":case"right":return t?r:l;default:return[]}}function Hn(e,t,n,o){const i=Pe(e);let r=Wn(te(e),n==="start",o);return i&&(r=r.map(l=>l+"-"+i),t&&(r=r.concat(r.map(et)))),r}function We(e){return e.replace(/left|right|bottom|top/g,t=>Fn[t])}function Vn(e){return{top:0,right:0,bottom:0,left:0,...e}}function Kt(e){return typeof e!="number"?Vn(e):{top:e,right:e,bottom:e,left:e}}function He(e){const{x:t,y:n,width:o,height:i}=e;return{width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}function Ot(e,t,n){let{reference:o,floating:i}=e;const r=ue(t),l=ct(t),s=ut(l),d=te(t),c=r==="y",a=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,p=o[s]/2-i[s]/2;let f;switch(d){case"top":f={x:a,y:o.y-i.height};break;case"bottom":f={x:a,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:u};break;case"left":f={x:o.x-i.width,y:u};break;default:f={x:o.x,y:o.y}}switch(Pe(t)){case"start":f[l]-=p*(n&&c?-1:1);break;case"end":f[l]+=p*(n&&c?-1:1);break}return f}const jn=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:l}=n,s=r.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:a,y:u}=Ot(c,o,d),p=o,f={},v=0;for(let g=0;g({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:r,platform:l,elements:s,middlewareData:d}=t,{element:c,padding:a=0}=ee(e,t)||{};if(c==null)return{};const u=Kt(a),p={x:n,y:o},f=ct(i),v=ut(f),g=await l.getDimensions(c),h=f==="y",y=h?"top":"left",b=h?"bottom":"right",w=h?"clientHeight":"clientWidth",C=r.reference[v]+r.reference[f]-p[f]-r.floating[v],x=p[f]-r.reference[f],S=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c));let _=S?S[w]:0;(!_||!await(l.isElement==null?void 0:l.isElement(S)))&&(_=s.floating[w]||r.floating[v]);const M=C/2-x/2,N=_/2-g[v]/2-1,R=ae(u[y],N),z=ae(u[b],N),k=R,W=_-g[v]-z,L=_/2-g[v]/2+M,oe=Qe(k,L,W),I=!d.arrow&&Pe(i)!=null&&L!==oe&&r.reference[v]/2-(LL<=0)){var z,k;const L=(((z=r.flip)==null?void 0:z.index)||0)+1,oe=_[L];if(oe)return{data:{index:L,overflows:R},reset:{placement:oe}};let I=(k=R.filter(q=>q.overflows[0]<=0).sort((q,ie)=>q.overflows[1]-ie.overflows[1])[0])==null?void 0:k.placement;if(!I)switch(f){case"bestFit":{var W;const q=(W=R.filter(ie=>{if(S){const re=ue(ie.placement);return re===b||re==="y"}return!0}).map(ie=>[ie.placement,ie.overflows.filter(re=>re>0).reduce((re,gn)=>re+gn,0)]).sort((ie,re)=>ie[1]-re[1])[0])==null?void 0:W[0];q&&(I=q);break}case"initialPlacement":I=s;break}if(i!==I)return{reset:{placement:I}}}return{}}}};function Ct(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function At(e){return Ln.some(t=>e[t]>=0)}const Un=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...i}=ee(e,t);switch(o){case"referenceHidden":{const r=await _e(t,{...i,elementContext:"reference"}),l=Ct(r,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:At(l)}}}case"escaped":{const r=await _e(t,{...i,altBoundary:!0}),l=Ct(r,n.floating);return{data:{escapedOffsets:l,escaped:At(l)}}}default:return{}}}}};async function Yn(e,t){const{placement:n,platform:o,elements:i}=e,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),l=te(n),s=Pe(n),d=ue(n)==="y",c=["left","top"].includes(l)?-1:1,a=r&&d?-1:1,u=ee(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:v}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&typeof v=="number"&&(f=s==="end"?v*-1:v),d?{x:f*a,y:p*c}:{x:p*c,y:f*a}}const Xn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:r,placement:l,middlewareData:s}=t,d=await Yn(t,e);return l===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:i+d.x,y:r+d.y,data:{...d,placement:l}}}}},qn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:r=!0,crossAxis:l=!1,limiter:s={fn:h=>{let{x:y,y:b}=h;return{x:y,y:b}}},...d}=ee(e,t),c={x:n,y:o},a=await _e(t,d),u=ue(te(i)),p=at(u);let f=c[p],v=c[u];if(r){const h=p==="y"?"top":"left",y=p==="y"?"bottom":"right",b=f+a[h],w=f-a[y];f=Qe(b,f,w)}if(l){const h=u==="y"?"top":"left",y=u==="y"?"bottom":"right",b=v+a[h],w=v-a[y];v=Qe(b,v,w)}const g=s.fn({...t,[p]:f,[u]:v});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[p]:r,[u]:l}}}}}},Gn=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:i,rects:r,middlewareData:l}=t,{offset:s=0,mainAxis:d=!0,crossAxis:c=!0}=ee(e,t),a={x:n,y:o},u=ue(i),p=at(u);let f=a[p],v=a[u];const g=ee(s,t),h=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(d){const w=p==="y"?"height":"width",C=r.reference[p]-r.floating[w]+h.mainAxis,x=r.reference[p]+r.reference[w]-h.mainAxis;fx&&(f=x)}if(c){var y,b;const w=p==="y"?"width":"height",C=["top","left"].includes(te(i)),x=r.reference[u]-r.floating[w]+(C&&((y=l.offset)==null?void 0:y[u])||0)+(C?0:h.crossAxis),S=r.reference[u]+r.reference[w]+(C?0:((b=l.offset)==null?void 0:b[u])||0)-(C?h.crossAxis:0);vS&&(v=S)}return{[p]:f,[u]:v}}}},Jn=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:i,rects:r,platform:l,elements:s}=t,{apply:d=()=>{},...c}=ee(e,t),a=await _e(t,c),u=te(i),p=Pe(i),f=ue(i)==="y",{width:v,height:g}=r.floating;let h,y;u==="top"||u==="bottom"?(h=u,y=p===(await(l.isRTL==null?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(y=u,h=p==="end"?"top":"bottom");const b=g-a.top-a.bottom,w=v-a.left-a.right,C=ae(g-a[h],b),x=ae(v-a[y],w),S=!t.middlewareData.shift;let _=C,M=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=w),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(_=b),S&&!p){const R=H(a.left,0),z=H(a.right,0),k=H(a.top,0),W=H(a.bottom,0);f?M=v-2*(R!==0||z!==0?R+z:H(a.left,a.right)):_=g-2*(k!==0||W!==0?k+W:H(a.top,a.bottom))}await d({...t,availableWidth:M,availableHeight:_});const N=await l.getDimensions(s.floating);return v!==N.width||g!==N.height?{reset:{rects:!0}}:{}}}};function je(){return typeof window<"u"}function we(e){return dt(e)?(e.nodeName||"").toLowerCase():"#document"}function V(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Z(e){var t;return(t=(dt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function dt(e){return je()?e instanceof Node||e instanceof V(e).Node:!1}function U(e){return je()?e instanceof Element||e instanceof V(e).Element:!1}function J(e){return je()?e instanceof HTMLElement||e instanceof V(e).HTMLElement:!1}function Et(e){return!je()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof V(e).ShadowRoot}function Te(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=Y(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(i)}function Zn(e){return["table","td","th"].includes(we(e))}function ze(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function ft(e){const t=pt(),n=U(e)?Y(e):e;return["transform","translate","scale","rotate","perspective"].some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Qn(e){let t=ce(e);for(;J(t)&&!Ee(t);){if(ft(t))return t;if(ze(t))return null;t=ce(t)}return null}function pt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ee(e){return["html","body","#document"].includes(we(e))}function Y(e){return V(e).getComputedStyle(e)}function Ke(e){return U(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ce(e){if(we(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Et(e)&&e.host||Z(e);return Et(t)?t.host:t}function Ut(e){const t=ce(e);return Ee(t)?e.ownerDocument?e.ownerDocument.body:e.body:J(t)&&Te(t)?t:Ut(t)}function Be(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Ut(e),r=i===((o=e.ownerDocument)==null?void 0:o.body),l=V(i);if(r){const s=tt(l);return t.concat(l,l.visualViewport||[],Te(i)?i:[],s&&n?Be(s):[])}return t.concat(i,Be(i,[],n))}function tt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Yt(e){const t=Y(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=J(e),r=i?e.offsetWidth:n,l=i?e.offsetHeight:o,s=Ie(n)!==r||Ie(o)!==l;return s&&(n=r,o=l),{width:n,height:o,$:s}}function vt(e){return U(e)?e:e.contextElement}function Ae(e){const t=vt(e);if(!J(t))return G(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:r}=Yt(t);let l=(r?Ie(n.width):n.width)/o,s=(r?Ie(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const eo=G(0);function Xt(e){const t=V(e);return!pt()||!t.visualViewport?eo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function to(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==V(e)?!1:t}function he(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),r=vt(e);let l=G(1);t&&(o?U(o)&&(l=Ae(o)):l=Ae(e));const s=to(r,n,o)?Xt(r):G(0);let d=(i.left+s.x)/l.x,c=(i.top+s.y)/l.y,a=i.width/l.x,u=i.height/l.y;if(r){const p=V(r),f=o&&U(o)?V(o):o;let v=p,g=tt(v);for(;g&&o&&f!==v;){const h=Ae(g),y=g.getBoundingClientRect(),b=Y(g),w=y.left+(g.clientLeft+parseFloat(b.paddingLeft))*h.x,C=y.top+(g.clientTop+parseFloat(b.paddingTop))*h.y;d*=h.x,c*=h.y,a*=h.x,u*=h.y,d+=w,c+=C,v=V(g),g=tt(v)}}return He({width:a,height:u,x:d,y:c})}function mt(e,t){const n=Ke(e).scrollLeft;return t?t.left+n:he(Z(e)).left+n}function qt(e,t,n){n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=o.left+t.scrollLeft-(n?0:mt(e,o)),r=o.top+t.scrollTop;return{x:i,y:r}}function no(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const r=i==="fixed",l=Z(o),s=t?ze(t.floating):!1;if(o===l||s&&r)return n;let d={scrollLeft:0,scrollTop:0},c=G(1);const a=G(0),u=J(o);if((u||!u&&!r)&&((we(o)!=="body"||Te(l))&&(d=Ke(o)),J(o))){const f=he(o);c=Ae(o),a.x=f.x+o.clientLeft,a.y=f.y+o.clientTop}const p=l&&!u&&!r?qt(l,d,!0):G(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-d.scrollLeft*c.x+a.x+p.x,y:n.y*c.y-d.scrollTop*c.y+a.y+p.y}}function oo(e){return Array.from(e.getClientRects())}function io(e){const t=Z(e),n=Ke(e),o=e.ownerDocument.body,i=H(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=H(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+mt(e);const s=-n.scrollTop;return Y(o).direction==="rtl"&&(l+=H(t.clientWidth,o.clientWidth)-i),{width:i,height:r,x:l,y:s}}function ro(e,t){const n=V(e),o=Z(e),i=n.visualViewport;let r=o.clientWidth,l=o.clientHeight,s=0,d=0;if(i){r=i.width,l=i.height;const c=pt();(!c||c&&t==="fixed")&&(s=i.offsetLeft,d=i.offsetTop)}return{width:r,height:l,x:s,y:d}}function lo(e,t){const n=he(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,r=J(e)?Ae(e):G(1),l=e.clientWidth*r.x,s=e.clientHeight*r.y,d=i*r.x,c=o*r.y;return{width:l,height:s,x:d,y:c}}function Dt(e,t,n){let o;if(t==="viewport")o=ro(e,n);else if(t==="document")o=io(Z(e));else if(U(t))o=lo(t,n);else{const i=Xt(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return He(o)}function Gt(e,t){const n=ce(e);return n===t||!U(n)||Ee(n)?!1:Y(n).position==="fixed"||Gt(n,t)}function so(e,t){const n=t.get(e);if(n)return n;let o=Be(e,[],!1).filter(s=>U(s)&&we(s)!=="body"),i=null;const r=Y(e).position==="fixed";let l=r?ce(e):e;for(;U(l)&&!Ee(l);){const s=Y(l),d=ft(l);!d&&s.position==="fixed"&&(i=null),(r?!d&&!i:!d&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Te(l)&&!d&&Gt(e,l))?o=o.filter(a=>a!==l):i=s,l=ce(l)}return t.set(e,o),o}function ao(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const l=[...n==="clippingAncestors"?ze(t)?[]:so(t,this._c):[].concat(n),o],s=l[0],d=l.reduce((c,a)=>{const u=Dt(t,a,i);return c.top=H(u.top,c.top),c.right=ae(u.right,c.right),c.bottom=ae(u.bottom,c.bottom),c.left=H(u.left,c.left),c},Dt(t,s,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function uo(e){const{width:t,height:n}=Yt(e);return{width:t,height:n}}function co(e,t,n){const o=J(t),i=Z(t),r=n==="fixed",l=he(e,!0,r,t);let s={scrollLeft:0,scrollTop:0};const d=G(0);if(o||!o&&!r)if((we(t)!=="body"||Te(i))&&(s=Ke(t)),o){const p=he(t,!0,r,t);d.x=p.x+t.clientLeft,d.y=p.y+t.clientTop}else i&&(d.x=mt(i));const c=i&&!o&&!r?qt(i,s):G(0),a=l.left+s.scrollLeft-d.x-c.x,u=l.top+s.scrollTop-d.y-c.y;return{x:a,y:u,width:l.width,height:l.height}}function Ye(e){return Y(e).position==="static"}function Pt(e,t){if(!J(e)||Y(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Z(e)===n&&(n=n.ownerDocument.body),n}function Jt(e,t){const n=V(e);if(ze(e))return n;if(!J(e)){let i=ce(e);for(;i&&!Ee(i);){if(U(i)&&!Ye(i))return i;i=ce(i)}return n}let o=Pt(e,t);for(;o&&Zn(o)&&Ye(o);)o=Pt(o,t);return o&&Ee(o)&&Ye(o)&&!ft(o)?n:o||Qn(e)||n}const fo=async function(e){const t=this.getOffsetParent||Jt,n=this.getDimensions,o=await n(e.floating);return{reference:co(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function po(e){return Y(e).direction==="rtl"}const vo={convertOffsetParentRelativeRectToViewportRelativeRect:no,getDocumentElement:Z,getClippingRect:ao,getOffsetParent:Jt,getElementRects:fo,getClientRects:oo,getDimensions:uo,getScale:Ae,isElement:U,isRTL:po};function Zt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function mo(e,t){let n=null,o;const i=Z(e);function r(){var s;clearTimeout(o),(s=n)==null||s.disconnect(),n=null}function l(s,d){s===void 0&&(s=!1),d===void 0&&(d=1),r();const c=e.getBoundingClientRect(),{left:a,top:u,width:p,height:f}=c;if(s||t(),!p||!f)return;const v=Me(u),g=Me(i.clientWidth-(a+p)),h=Me(i.clientHeight-(u+f)),y=Me(a),w={rootMargin:-v+"px "+-g+"px "+-h+"px "+-y+"px",threshold:H(0,ae(1,d))||1};let C=!0;function x(S){const _=S[0].intersectionRatio;if(_!==d){if(!C)return l();_?l(!1,_):o=setTimeout(()=>{l(!1,1e-7)},1e3)}_===1&&!Zt(c,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(x,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(x,w)}n.observe(e)}return l(!0),r}function ho(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,c=vt(e),a=i||r?[...c?Be(c):[],...Be(t)]:[];a.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),r&&y.addEventListener("resize",n)});const u=c&&s?mo(c,n):null;let p=-1,f=null;l&&(f=new ResizeObserver(y=>{let[b]=y;b&&b.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=f)==null||w.observe(t)})),n()}),c&&!d&&f.observe(c),f.observe(t));let v,g=d?he(e):null;d&&h();function h(){const y=he(e);g&&!Zt(g,y)&&n(),g=y,v=requestAnimationFrame(h)}return n(),()=>{var y;a.forEach(b=>{i&&b.removeEventListener("scroll",n),r&&b.removeEventListener("resize",n)}),u==null||u(),(y=f)==null||y.disconnect(),f=null,d&&cancelAnimationFrame(v)}}const go=Xn,yo=qn,_t=Kn,wo=Jn,bo=Un,xo=zn,Oo=Gn,Co=(e,t,n)=>{const o=new Map,i={platform:vo,...n},r={...i.platform,_c:o};return jn(e,t,{...i,platform:r})};function Ao(e){return e!=null&&typeof e=="object"&&"$el"in e}function nt(e){if(Ao(e)){const t=e.$el;return dt(t)&&we(t)==="#comment"?null:t}return e}function Ce(e){return typeof e=="function"?e():m(e)}function Eo(e){return{name:"arrow",options:e,fn(t){const n=nt(Ce(e.element));return n==null?{}:xo({element:n,padding:e.padding}).fn(t)}}}function Qt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Bt(e,t){const n=Qt(e);return Math.round(t*n)/n}function Do(e,t,n){n===void 0&&(n={});const o=n.whileElementsMounted,i=O(()=>{var _;return(_=Ce(n.open))!=null?_:!0}),r=O(()=>Ce(n.middleware)),l=O(()=>{var _;return(_=Ce(n.placement))!=null?_:"bottom"}),s=O(()=>{var _;return(_=Ce(n.strategy))!=null?_:"absolute"}),d=O(()=>{var _;return(_=Ce(n.transform))!=null?_:!0}),c=O(()=>nt(e.value)),a=O(()=>nt(t.value)),u=E(0),p=E(0),f=E(s.value),v=E(l.value),g=Mt({}),h=E(!1),y=O(()=>{const _={position:f.value,left:"0",top:"0"};if(!a.value)return _;const M=Bt(a.value,u.value),N=Bt(a.value,p.value);return d.value?{..._,transform:"translate("+M+"px, "+N+"px)",...Qt(a.value)>=1.5&&{willChange:"transform"}}:{position:f.value,left:M+"px",top:N+"px"}});let b;function w(){if(c.value==null||a.value==null)return;const _=i.value;Co(c.value,a.value,{middleware:r.value,placement:l.value,strategy:s.value}).then(M=>{u.value=M.x,p.value=M.y,f.value=M.strategy,v.value=M.placement,g.value=M.middlewareData,h.value=_!==!1})}function C(){typeof b=="function"&&(b(),b=void 0)}function x(){if(C(),o===void 0){w();return}if(c.value!=null&&a.value!=null){b=o(c.value,a.value,w);return}}function S(){i.value||(h.value=!1)}return j([r,l,s,i],w,{flush:"sync"}),j([c,a],x,{flush:"sync"}),j(i,S,{flush:"sync"}),Lt()&&Ft(C),{x:xe(u),y:xe(p),strategy:xe(f),placement:xe(v),middlewareData:xe(g),isPositioned:xe(h),floatingStyles:y,update:w}}function be(e,t){const n=typeof e=="string"&&!t?`${e}Context`:t,o=Symbol(n);return[i=>{const r=bn(o,i);if(r||r===null)return r;throw new Error(`Injection \`${o.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(", ")}`:`\`${e}\``}`)},i=>(Mn(o,i),i)]}function en(e,t,n){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),o.dispatchEvent(i)}function Po(e,t){var n;const o=Mt();return K(()=>{o.value=e()},{...t,flush:(n=void 0)!=null?n:"sync"}),Ht(o)}function Re(e){return Lt()?(Ft(e),!0):!1}function _o(){const e=new Set,t=n=>{e.delete(n)};return{on:n=>{e.add(n);const o=()=>t(n);return Re(o),{off:o}},off:t,trigger:(...n)=>Promise.all(Array.from(e).map(o=>o(...n)))}}function Bo(e){let t=!1,n;const o=jt(!0);return(...i)=>(t||(n=o.run(()=>e(...i)),t=!0),n)}function To(e){let t=0,n,o;const i=()=>{t-=1,o&&t<=0&&(o.stop(),n=void 0,o=void 0)};return(...r)=>(t+=1,n||(o=jt(!0),n=o.run(()=>e(...r))),Re(i),n)}function ve(e){return typeof e=="function"?e():m(e)}const pe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Ro=e=>typeof e<"u",$o=Object.prototype.toString,So=e=>$o.call(e)==="[object Object]",Mo=()=>{},Tt=Lo();function Lo(){var e,t;return pe&&((e=window==null?void 0:window.navigator)==null?void 0:e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window==null?void 0:window.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function Fo(e){return ye()}function No(e,t=1e4){return Sn((n,o)=>{let i=ve(e),r;const l=()=>setTimeout(()=>{i=ve(e),o()},ve(t));return Re(()=>{clearTimeout(r)}),{get(){return n(),i},set(s){i=s,o(),clearTimeout(r),r=l()}}})}function ko(e,t){Fo()&&Bn(e,t)}function tn(e,t,n={}){const{immediate:o=!0}=n,i=E(!1);let r=null;function l(){r&&(clearTimeout(r),r=null)}function s(){i.value=!1,l()}function d(...c){l(),i.value=!0,r=setTimeout(()=>{i.value=!1,r=null,e(...c)},ve(t))}return o&&(i.value=!0,pe&&d()),Re(s),{isPending:Ht(i),start:d,stop:s}}function $e(e){var t;const n=ve(e);return(t=n==null?void 0:n.$el)!=null?t:n}const ht=pe?window:void 0;function Ve(...e){let t,n,o,i;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,i]=e,t=ht):[t,n,o,i]=e,!t)return Mo;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const r=[],l=()=>{r.forEach(a=>a()),r.length=0},s=(a,u,p,f)=>(a.addEventListener(u,p,f),()=>a.removeEventListener(u,p,f)),d=j(()=>[$e(t),ve(i)],([a,u])=>{if(l(),!a)return;const p=So(u)?{...u}:u;r.push(...n.flatMap(f=>o.map(v=>s(a,f,v,p))))},{immediate:!0,flush:"post"}),c=()=>{d(),l()};return Re(c),c}function Io(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Wo(...e){let t,n,o={};e.length===3?(t=e[0],n=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],o=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:i=ht,eventName:r="keydown",passive:l=!1,dedupe:s=!1}=o,d=Io(t);return Ve(i,r,c=>{c.repeat&&ve(s)||d(c)&&n(c)},l)}function Ho(){const e=E(!1),t=ye();return t&&De(()=>{e.value=!0},t),e}function Vo(e){return JSON.parse(JSON.stringify(e))}function nn(e,t,n,o={}){var i,r,l;const{clone:s=!1,passive:d=!1,eventName:c,deep:a=!1,defaultValue:u,shouldEmit:p}=o,f=ye(),v=n||(f==null?void 0:f.emit)||((i=f==null?void 0:f.$emit)==null?void 0:i.bind(f))||((l=(r=f==null?void 0:f.proxy)==null?void 0:r.$emit)==null?void 0:l.bind(f==null?void 0:f.proxy));let g=c;g=g||`update:${t.toString()}`;const h=w=>s?typeof s=="function"?s(w):Vo(w):w,y=()=>Ro(e[t])?h(e[t]):u,b=w=>{p?p(w)&&v(g,w):v(g,w)};if(d){const w=y(),C=E(w);let x=!1;return j(()=>e[t],S=>{x||(x=!0,C.value=h(S),ge(()=>x=!1))}),j(C,S=>{!x&&(S!==e[t]||a)&&b(S)},{deep:a}),C}else return O({get(){return y()},set(w){b(w)}})}function gt(e){return e?e.flatMap(t=>t.type===An?gt(t.children):[t]):[]}function se(){let e=document.activeElement;if(e==null)return null;for(;e!=null&&e.shadowRoot!=null&&e.shadowRoot.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function Xe(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function ot(e,t,n=".",o){if(!Xe(t))return ot(e,{},n);const i=Object.assign({},t);for(const r in e){if(r==="__proto__"||r==="constructor")continue;const l=e[r];l!=null&&(Array.isArray(l)&&Array.isArray(i[r])?i[r]=[...l,...i[r]]:Xe(l)&&Xe(i[r])?i[r]=ot(l,i[r],(n?`${n}.`:"")+r.toString()):i[r]=l)}return i}function jo(e){return(...t)=>t.reduce((n,o)=>ot(n,o,""),{})}const zo=jo(),[on,nr]=be("ConfigProvider");let Ko="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Uo=(e=21)=>{let t="",n=e;for(;n--;)t+=Ko[Math.random()*64|0];return t};const Yo=To(()=>{const e=E(new Map),t=E(),n=O(()=>{for(const l of e.value.values())if(l)return!0;return!1}),o=on({scrollBody:E(!0)});let i=null;const r=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.body.style.removeProperty("--scrollbar-width"),document.body.style.overflow=t.value??"",Tt&&(i==null||i()),t.value=void 0};return j(n,(l,s)=>{var d;if(!pe)return;if(!l){s&&r();return}t.value===void 0&&(t.value=document.body.style.overflow);const c=window.innerWidth-document.documentElement.clientWidth,a={padding:c,margin:0},u=(d=o.scrollBody)!=null&&d.value?typeof o.scrollBody.value=="object"?zo({padding:o.scrollBody.value.padding===!0?c:o.scrollBody.value.padding,margin:o.scrollBody.value.margin===!0?c:o.scrollBody.value.margin},a):a:{padding:0,margin:0};c>0&&(document.body.style.paddingRight=typeof u.padding=="number"?`${u.padding}px`:String(u.padding),document.body.style.marginRight=typeof u.margin=="number"?`${u.margin}px`:String(u.margin),document.body.style.setProperty("--scrollbar-width",`${c}px`),document.body.style.overflow="hidden"),Tt&&(i=Ve(document,"touchmove",p=>qo(p),{passive:!1})),ge(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})},{immediate:!0,flush:"sync"}),e});function Xo(e){const t=Uo(6),n=Yo();n.value.set(t,e);const o=O({get:()=>n.value.get(t)??!1,set:i=>n.value.set(t,i)});return ko(()=>{n.value.delete(t)}),o}function rn(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth1?!0:(t.preventDefault&&t.cancelable&&t.preventDefault(),!1)}function Se(e){const t=ye(),n=t==null?void 0:t.type.emits,o={};return n!=null&&n.length||console.warn(`No emitted event found. Please check component: ${t==null?void 0:t.type.__name}`),n==null||n.forEach(i=>{o[wn(kt(i))]=(...r)=>e(i,...r)}),o}function ln(e){const t=ye(),n=Object.keys((t==null?void 0:t.type.props)??{}).reduce((i,r)=>{const l=(t==null?void 0:t.type.props[r]).default;return l!==void 0&&(i[r]=l),i},{}),o=Cn(e);return O(()=>{const i={},r=(t==null?void 0:t.vnode.props)??{};return Object.keys(r).forEach(l=>{i[kt(l)]=r[l]}),Object.keys({...n,...i}).reduce((l,s)=>(o.value[s]!==void 0&&(l[s]=o.value[s]),l),{})})}function sn(e,t){const n=ln(e),o=t?Se(t):{};return O(()=>({...n.value,...o}))}function $(){const e=ye(),t=E(),n=O(()=>{var l,s;return["#text","#comment"].includes((l=t.value)==null?void 0:l.$el.nodeName)?(s=t.value)==null?void 0:s.$el.nextElementSibling:$e(t)}),o=Object.assign({},e.exposed),i={};for(const l in e.props)Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>e.props[l]});if(Object.keys(o).length>0)for(const l in o)Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>o[l]});Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=i;function r(l){t.value=l,l&&(Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>l instanceof Element?l:l.$el}),e.exposed=i)}return{forwardRef:r,currentRef:t,currentElement:n}}function Go(e,t){const n=No(!1,300),o=E(null),i=_o();function r(){o.value=null,n.value=!1}function l(s,d){const c=s.currentTarget,a={x:s.clientX,y:s.clientY},u=Jo(a,c.getBoundingClientRect()),p=Zo(a,u),f=Qo(d.getBoundingClientRect()),v=ti([...p,...f]);o.value=v,n.value=!0}return K(s=>{if(e.value&&t.value){const d=a=>l(a,t.value),c=a=>l(a,e.value);e.value.addEventListener("pointerleave",d),t.value.addEventListener("pointerleave",c),s(()=>{var a,u;(a=e.value)==null||a.removeEventListener("pointerleave",d),(u=t.value)==null||u.removeEventListener("pointerleave",c)})}}),K(s=>{var d;if(o.value){const c=a=>{var u,p;if(!o.value)return;const f=a.target,v={x:a.clientX,y:a.clientY},g=((u=e.value)==null?void 0:u.contains(f))||((p=t.value)==null?void 0:p.contains(f)),h=!ei(v,o.value),y=!!f.closest("[data-grace-area-trigger]");g?r():(h||y)&&(r(),i.trigger())};(d=e.value)==null||d.ownerDocument.addEventListener("pointermove",c),s(()=>{var a;return(a=e.value)==null?void 0:a.ownerDocument.removeEventListener("pointermove",c)})}}),{isPointerInTransit:n,onPointerExit:i.on}}function Jo(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),r=Math.abs(t.left-e.x);switch(Math.min(n,o,i,r)){case r:return"left";case i:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Zo(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function Qo(e){const{top:t,right:n,bottom:o,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:o},{x:i,y:o}]}function ei(e,t){const{x:n,y:o}=e;let i=!1;for(let r=0,l=t.length-1;ro!=a>o&&n<(c-s)*(o-d)/(a-d)+s&&(i=!i)}return i}function ti(e){const t=e.slice();return t.sort((n,o)=>n.xo.x?1:n.yo.y?1:0),ni(t)}function ni(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o=2;){const r=t[t.length-1],l=t[t.length-2];if((r.x-l.x)*(i.y-l.y)>=(r.y-l.y)*(i.x-l.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const i=e[o];for(;n.length>=2;){const r=n[n.length-1],l=n[n.length-2];if((r.x-l.x)*(i.y-l.y)>=(r.y-l.y)*(i.x-l.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var oi=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Oe=new WeakMap,Le=new WeakMap,Fe={},qe=0,an=function(e){return e&&(e.host||an(e.parentNode))},ii=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=an(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ri=function(e,t,n,o){var i=ii(t,Array.isArray(e)?e:[e]);Fe[n]||(Fe[n]=new WeakMap);var r=Fe[n],l=[],s=new Set,d=new Set(i),c=function(u){!u||s.has(u)||(s.add(u),c(u.parentNode))};i.forEach(c);var a=function(u){!u||d.has(u)||Array.prototype.forEach.call(u.children,function(p){if(s.has(p))a(p);else try{var f=p.getAttribute(o),v=f!==null&&f!=="false",g=(Oe.get(p)||0)+1,h=(r.get(p)||0)+1;Oe.set(p,g),r.set(p,h),l.push(p),g===1&&v&&Le.set(p,!0),h===1&&p.setAttribute(n,"true"),v||p.setAttribute(o,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return a(t),s.clear(),qe++,function(){l.forEach(function(u){var p=Oe.get(u)-1,f=r.get(u)-1;Oe.set(u,p),r.set(u,f),p||(Le.has(u)||u.removeAttribute(o),Le.delete(u)),f||u.removeAttribute(n)}),qe--,qe||(Oe=new WeakMap,Oe=new WeakMap,Le=new WeakMap,Fe={})}},li=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),i=oi(e);return i?(o.push.apply(o,Array.from(i.querySelectorAll("[aria-live]"))),ri(o,i,n,"aria-hidden")):function(){return null}};function si(e){let t;j(()=>$e(e),n=>{n?t=li(n):t&&t()}),It(()=>{t&&t()})}let ai=0;function it(e,t="radix"){const n=on({useId:void 0});return xt?`${t}-${xt()}`:n.useId?`${t}-${n.useId()}`:`${t}-${++ai}`}function ui(e){const t=E(),n=O(()=>{var i;return((i=t.value)==null?void 0:i.width)??0}),o=O(()=>{var i;return((i=t.value)==null?void 0:i.height)??0});return De(()=>{const i=$e(e);if(i){t.value={width:i.offsetWidth,height:i.offsetHeight};const r=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const s=l[0];let d,c;if("borderBoxSize"in s){const a=s.borderBoxSize,u=Array.isArray(a)?a[0]:a;d=u.inlineSize,c=u.blockSize}else d=i.offsetWidth,c=i.offsetHeight;t.value={width:d,height:c}});return r.observe(i,{box:"border-box"}),()=>r.unobserve(i)}else t.value=void 0}),{width:n,height:o}}function ci(e,t){const n=E(e);function o(i){return t[n.value][i]??n.value}return{state:n,dispatch:i=>{n.value=o(i)}}}const di=D({name:"PrimitiveSlot",inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{var o,i;if(!n.default)return null;const r=gt(n.default()),l=r.findIndex(a=>a.type!==Wt);if(l===-1)return r;const s=r[l];(o=s.props)==null||delete o.ref;const d=s.props?F(t,s.props):t;t.class&&(i=s.props)!=null&&i.class&&delete s.props.class;const c=En(s,d);for(const a in d)a.startsWith("on")&&(c.props||(c.props={}),c.props[a]=d[a]);return r.length===1?c:(r[l]=c,r)}}}),X=D({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(e,{attrs:t,slots:n}){const o=e.asChild?"template":e.as;return typeof o=="string"&&["area","img","input"].includes(o)?()=>ke(o,t):o!=="template"?()=>ke(e.as,t,{default:n.default}):()=>ke(di,t,{default:n.default})}});function fi(e,t){var n;const o=E({}),i=E("none"),r=E(e),l=e.value?"mounted":"unmounted";let s;const d=((n=t.value)==null?void 0:n.ownerDocument.defaultView)??ht,{state:c,dispatch:a}=ci(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),u=h=>{var y;if(pe){const b=new CustomEvent(h,{bubbles:!1,cancelable:!1});(y=t.value)==null||y.dispatchEvent(b)}};j(e,async(h,y)=>{var b;const w=y!==h;if(await ge(),w){const C=i.value,x=Ne(t.value);h?(a("MOUNT"),u("enter"),x==="none"&&u("after-enter")):x==="none"||((b=o.value)==null?void 0:b.display)==="none"?(a("UNMOUNT"),u("leave"),u("after-leave")):y&&C!==x?(a("ANIMATION_OUT"),u("leave")):(a("UNMOUNT"),u("after-leave"))}},{immediate:!0});const p=h=>{const y=Ne(t.value),b=y.includes(h.animationName),w=c.value==="mounted"?"enter":"leave";if(h.target===t.value&&b&&(u(`after-${w}`),a("ANIMATION_END"),!r.value)){const C=t.value.style.animationFillMode;t.value.style.animationFillMode="forwards",s=d==null?void 0:d.setTimeout(()=>{var x;((x=t.value)==null?void 0:x.style.animationFillMode)==="forwards"&&(t.value.style.animationFillMode=C)})}h.target===t.value&&y==="none"&&a("ANIMATION_END")},f=h=>{h.target===t.value&&(i.value=Ne(t.value))},v=j(t,(h,y)=>{h?(o.value=getComputedStyle(h),h.addEventListener("animationstart",f),h.addEventListener("animationcancel",p),h.addEventListener("animationend",p)):(a("ANIMATION_END"),s!==void 0&&(d==null||d.clearTimeout(s)),y==null||y.removeEventListener("animationstart",f),y==null||y.removeEventListener("animationcancel",p),y==null||y.removeEventListener("animationend",p))},{immediate:!0}),g=j(c,()=>{const h=Ne(t.value);i.value=c.value==="mounted"?h:"none"});return It(()=>{v(),g()}),{isPresent:O(()=>["mounted","unmountSuspended"].includes(c.value))}}function Ne(e){return e&&getComputedStyle(e).animationName||"none"}const yt=D({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:t,expose:n}){var o;const{present:i,forceMount:r}=lt(e),l=E(),{isPresent:s}=fi(i,l);n({present:s});let d=t.default({present:s});d=gt(d||[]);const c=ye();if(d&&(d==null?void 0:d.length)>1){const a=(o=c==null?void 0:c.parent)!=null&&o.type.name?`<${c.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${a}\` 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(u=>` - ${u}`).join(` `)].join(` `))}return()=>r.value||i.value||s.value?ke(t.default({present:s})[0],{ref:a=>{const u=$e(a);return typeof(u==null?void 0:u.hasAttribute)>"u"||(u!=null&&u.hasAttribute("data-radix-popper-content-wrapper")?l.value=u.firstElementChild:l.value=u),u}}):null}}),[ne,pi]=be("DialogRoot"),vi=D({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(e,{emit:t}){const n=e,o=nn(n,"open",t,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=E(),r=E(),{modal:l}=lt(n);return pi({open:o,modal:l,openModal:()=>{o.value=!0},onOpenChange:s=>{o.value=s},onOpenToggle:()=>{o.value=!o.value},contentId:"",titleId:"",descriptionId:"",triggerElement:i,contentElement:r}),(s,d)=>P(s.$slots,"default",{open:m(o)})}}),wt=D({__name:"Teleport",props:{to:{default:"body"},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const t=Ho();return(n,o)=>m(t)||n.forceMount?(B(),T(yn,{key:0,to:n.to,disabled:n.disabled},[P(n.$slots,"default")],8,["to","disabled"])):Nt("",!0)}}),or=D({__name:"DialogPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const t=e;return(n,o)=>(B(),T(m(wt),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}}),mi="dismissableLayer.pointerDownOutside",hi="dismissableLayer.focusOutside";function un(e,t){const n=t.closest("[data-dismissable-layer]"),o=e.dataset.dismissableLayer===""?e:e.querySelector("[data-dismissable-layer]"),i=Array.from(e.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(n&&o===n||i.indexOf(o){});return K(l=>{if(!pe)return;const s=async c=>{const a=c.target;if(t!=null&&t.value){if(un(t.value,a)){i.value=!1;return}if(c.target&&!i.value){let u=function(){en(mi,e,p)};const p={originalEvent:c};c.pointerType==="touch"?(o.removeEventListener("click",r.value),r.value=u,o.addEventListener("click",r.value,{once:!0})):u()}else o.removeEventListener("click",r.value);i.value=!1}},d=window.setTimeout(()=>{o.addEventListener("pointerdown",s)},0);l(()=>{window.clearTimeout(d),o.removeEventListener("pointerdown",s),o.removeEventListener("click",r.value)})}),{onPointerDownCapture:()=>i.value=!0}}function yi(e,t){var n;const o=((n=t==null?void 0:t.value)==null?void 0:n.ownerDocument)??(globalThis==null?void 0:globalThis.document),i=E(!1);return K(r=>{if(!pe)return;const l=async s=>{t!=null&&t.value&&(await ge(),!(!t.value||un(t.value,s.target))&&s.target&&!i.value&&en(hi,e,{originalEvent:s}))};o.addEventListener("focusin",l),r(()=>o.removeEventListener("focusin",l))}),{onFocusCapture:()=>i.value=!0,onBlurCapture:()=>i.value=!1}}const Q=zt({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),cn=D({__name:"DismissableLayer",props:{disableOutsidePointerEvents:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","dismiss"],setup(e,{emit:t}){const n=e,o=t,{forwardRef:i,currentElement:r}=$(),l=O(()=>{var v;return((v=r.value)==null?void 0:v.ownerDocument)??globalThis.document}),s=O(()=>Q.layersRoot),d=O(()=>r.value?Array.from(s.value).indexOf(r.value):-1),c=O(()=>Q.layersWithOutsidePointerEventsDisabled.size>0),a=O(()=>{const v=Array.from(s.value),[g]=[...Q.layersWithOutsidePointerEventsDisabled].slice(-1),h=v.indexOf(g);return d.value>=h}),u=gi(async v=>{const g=[...Q.branches].some(h=>h==null?void 0:h.contains(v.target));!a.value||g||(o("pointerDownOutside",v),o("interactOutside",v),await ge(),v.defaultPrevented||o("dismiss"))},r),p=yi(v=>{[...Q.branches].some(g=>g==null?void 0:g.contains(v.target))||(o("focusOutside",v),o("interactOutside",v),v.defaultPrevented||o("dismiss"))},r);Wo("Escape",v=>{d.value===s.value.size-1&&(o("escapeKeyDown",v),v.defaultPrevented||o("dismiss"))});let f;return K(v=>{r.value&&(n.disableOutsidePointerEvents&&(Q.layersWithOutsidePointerEventsDisabled.size===0&&(f=l.value.body.style.pointerEvents,l.value.body.style.pointerEvents="none"),Q.layersWithOutsidePointerEventsDisabled.add(r.value)),s.value.add(r.value),v(()=>{n.disableOutsidePointerEvents&&Q.layersWithOutsidePointerEventsDisabled.size===1&&(l.value.body.style.pointerEvents=f)}))}),K(v=>{v(()=>{r.value&&(s.value.delete(r.value),Q.layersWithOutsidePointerEventsDisabled.delete(r.value))})}),(v,g)=>(B(),T(m(X),{ref:m(i),"as-child":v.asChild,as:v.as,"data-dismissable-layer":"",style:st({pointerEvents:c.value?a.value?"auto":"none":void 0}),onFocusCapture:m(p).onFocusCapture,onBlurCapture:m(p).onBlurCapture,onPointerdownCapture:m(u).onPointerDownCapture},{default:A(()=>[P(v.$slots,"default")]),_:3},8,["as-child","as","style","onFocusCapture","onBlurCapture","onPointerdownCapture"]))}}),Ge="focusScope.autoFocusOnMount",Je="focusScope.autoFocusOnUnmount",Rt={bubbles:!1,cancelable:!0};function wi(e,{select:t=!1}={}){const n=se();for(const o of e)if(le(o,{select:t}),se()!==n)return!0}function bi(e){const t=dn(e),n=$t(t,e),o=$t(t.reverse(),e);return[n,o]}function dn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const i=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||i?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function $t(e,t){for(const n of e)if(!xi(n,{upTo:t}))return n}function xi(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Oi(e){return e instanceof HTMLInputElement&&"select"in e}function le(e,{select:t=!1}={}){if(e&&e.focus){const n=se();e.focus({preventScroll:!0}),e!==n&&Oi(e)&&t&&e.select()}}const Ci=Bo(()=>E([]));function Ai(){const e=Ci();return{add(t){const n=e.value[0];t!==n&&(n==null||n.pause()),e.value=St(e.value,t),e.value.unshift(t)},remove(t){var n;e.value=St(e.value,t),(n=e.value[0])==null||n.resume()}}}function St(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function Ei(e){return e.filter(t=>t.tagName!=="A")}const Di=D({__name:"FocusScope",props:{loop:{type:Boolean,default:!1},trapped:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:["mountAutoFocus","unmountAutoFocus"],setup(e,{emit:t}){const n=e,o=t,{currentRef:i,currentElement:r}=$(),l=E(null),s=Ai(),d=zt({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});K(a=>{if(!pe)return;const u=r.value;if(!n.trapped)return;function p(h){if(d.paused||!u)return;const y=h.target;u.contains(y)?l.value=y:le(l.value,{select:!0})}function f(h){if(d.paused||!u)return;const y=h.relatedTarget;y!==null&&(u.contains(y)||le(l.value,{select:!0}))}function v(h){u.contains(l.value)||le(u)}document.addEventListener("focusin",p),document.addEventListener("focusout",f);const g=new MutationObserver(v);u&&g.observe(u,{childList:!0,subtree:!0}),a(()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",f),g.disconnect()})}),K(async a=>{const u=r.value;if(await ge(),!u)return;s.add(d);const p=se();if(!u.contains(p)){const f=new CustomEvent(Ge,Rt);u.addEventListener(Ge,v=>o("mountAutoFocus",v)),u.dispatchEvent(f),f.defaultPrevented||(wi(Ei(dn(u)),{select:!0}),se()===p&&le(u))}a(()=>{u.removeEventListener(Ge,g=>o("mountAutoFocus",g));const f=new CustomEvent(Je,Rt),v=g=>{o("unmountAutoFocus",g)};u.addEventListener(Je,v),u.dispatchEvent(f),setTimeout(()=>{f.defaultPrevented||le(p??document.body,{select:!0}),u.removeEventListener(Je,v),s.remove(d)},0)})});function c(a){if(!n.loop&&!n.trapped||d.paused)return;const u=a.key==="Tab"&&!a.altKey&&!a.ctrlKey&&!a.metaKey,p=se();if(u&&p){const f=a.currentTarget,[v,g]=bi(f);v&&g?!a.shiftKey&&p===g?(a.preventDefault(),n.loop&&le(v,{select:!0})):a.shiftKey&&p===v&&(a.preventDefault(),n.loop&&le(g,{select:!0})):p===f&&a.preventDefault()}}return(a,u)=>(B(),T(m(X),{ref_key:"currentRef",ref:i,tabindex:"-1","as-child":a.asChild,as:a.as,onKeydown:c},{default:A(()=>[P(a.$slots,"default")]),_:3},8,["as-child","as"]))}});function Pi(e){return e?"open":"closed"}const fn=D({__name:"DialogContentImpl",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,o=t,i=ne(),{forwardRef:r,currentElement:l}=$();return i.titleId||(i.titleId=it(void 0,"radix-vue-dialog-title")),i.descriptionId||(i.descriptionId=it(void 0,"radix-vue-dialog-description")),De(()=>{i.contentElement=l,se()!==document.body&&(i.triggerElement.value=se())}),(s,d)=>(B(),T(m(Di),{"as-child":"",loop:"",trapped:n.trapFocus,onMountAutoFocus:d[5]||(d[5]=c=>o("openAutoFocus",c)),onUnmountAutoFocus:d[6]||(d[6]=c=>o("closeAutoFocus",c))},{default:A(()=>[me(m(cn),F({id:m(i).contentId,ref:m(r),as:s.as,"as-child":s.asChild,"disable-outside-pointer-events":s.disableOutsidePointerEvents,role:"dialog","aria-describedby":m(i).descriptionId,"aria-labelledby":m(i).titleId,"data-state":m(Pi)(m(i).open.value)},s.$attrs,{onDismiss:d[0]||(d[0]=c=>m(i).onOpenChange(!1)),onEscapeKeyDown:d[1]||(d[1]=c=>o("escapeKeyDown",c)),onFocusOutside:d[2]||(d[2]=c=>o("focusOutside",c)),onInteractOutside:d[3]||(d[3]=c=>o("interactOutside",c)),onPointerDownOutside:d[4]||(d[4]=c=>o("pointerDownOutside",c))}),{default:A(()=>[P(s.$slots,"default")]),_:3},16,["id","as","as-child","disable-outside-pointer-events","aria-describedby","aria-labelledby","data-state"])]),_:3},8,["trapped"]))}}),_i=D({__name:"DialogContentModal",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,o=t,i=ne(),r=Se(o),{forwardRef:l,currentElement:s}=$();return si(s),(d,c)=>(B(),T(fn,F({...n,...m(r)},{ref:m(l),"trap-focus":m(i).open.value,"disable-outside-pointer-events":!0,onCloseAutoFocus:c[0]||(c[0]=a=>{var u;a.defaultPrevented||(a.preventDefault(),(u=m(i).triggerElement.value)==null||u.focus())}),onPointerDownOutside:c[1]||(c[1]=a=>{const u=a.detail.originalEvent,p=u.button===0&&u.ctrlKey===!0;(u.button===2||p)&&a.preventDefault()}),onFocusOutside:c[2]||(c[2]=a=>{a.preventDefault()})}),{default:A(()=>[P(d.$slots,"default")]),_:3},16,["trap-focus"]))}}),Bi=D({__name:"DialogContentNonModal",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,o=Se(t);$();const i=ne(),r=E(!1),l=E(!1);return(s,d)=>(B(),T(fn,F({...n,...m(o)},{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:d[0]||(d[0]=c=>{var a;c.defaultPrevented||(r.value||(a=m(i).triggerElement.value)==null||a.focus(),c.preventDefault()),r.value=!1,l.value=!1}),onInteractOutside:d[1]||(d[1]=c=>{var a;c.defaultPrevented||(r.value=!0,c.detail.originalEvent.type==="pointerdown"&&(l.value=!0));const u=c.target;(a=m(i).triggerElement.value)!=null&&a.contains(u)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&l.value&&c.preventDefault()})}),{default:A(()=>[P(s.$slots,"default")]),_:3},16))}}),Ti=D({__name:"DialogContent",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,o=t,i=ne(),r=Se(o),{forwardRef:l}=$();return(s,d)=>(B(),T(m(yt),{present:s.forceMount||m(i).open.value},{default:A(()=>[m(i).modal.value?(B(),T(_i,F({key:0,ref:m(l)},{...n,...m(r),...s.$attrs}),{default:A(()=>[P(s.$slots,"default")]),_:3},16)):(B(),T(Bi,F({key:1,ref:m(l)},{...n,...m(r),...s.$attrs}),{default:A(()=>[P(s.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),Ri=D({__name:"DialogOverlayImpl",props:{asChild:{type:Boolean},as:{}},setup(e){const t=ne();return Xo(!0),$(),(n,o)=>(B(),T(m(X),{as:n.as,"as-child":n.asChild,"data-state":m(t).open.value?"open":"closed",style:{"pointer-events":"auto"}},{default:A(()=>[P(n.$slots,"default")]),_:3},8,["as","as-child","data-state"]))}}),$i=D({__name:"DialogOverlay",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){const t=ne(),{forwardRef:n}=$();return(o,i)=>{var r;return(r=m(t))!=null&&r.modal.value?(B(),T(m(yt),{key:0,present:o.forceMount||m(t).open.value},{default:A(()=>[me(Ri,F(o.$attrs,{ref:m(n),as:o.as,"as-child":o.asChild}),{default:A(()=>[P(o.$slots,"default")]),_:3},16,["as","as-child"])]),_:3},8,["present"])):Nt("",!0)}}}),pn=D({__name:"DialogClose",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const t=e;$();const n=ne();return(o,i)=>(B(),T(m(X),F(t,{type:o.as==="button"?"button":void 0,onClick:i[0]||(i[0]=r=>m(n).onOpenChange(!1))}),{default:A(()=>[P(o.$slots,"default")]),_:3},16,["type"]))}}),Si=D({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{default:"h2"}},setup(e){const t=e,n=ne();return $(),(o,i)=>(B(),T(m(X),F(t,{id:m(n).titleId}),{default:A(()=>[P(o.$slots,"default")]),_:3},16,["id"]))}}),Mi=D({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{default:"p"}},setup(e){const t=e;$();const n=ne();return(o,i)=>(B(),T(m(X),F(t,{id:m(n).descriptionId}),{default:A(()=>[P(o.$slots,"default")]),_:3},16,["id"]))}}),ir=D({__name:"AlertDialogRoot",props:{open:{type:Boolean},defaultOpen:{type:Boolean}},emits:["update:open"],setup(e,{emit:t}){const n=sn(e,t);return $(),(o,i)=>(B(),T(m(vi),F(m(n),{modal:!0}),{default:A(()=>[P(o.$slots,"default")]),_:3},16))}}),rr=D({__name:"AlertDialogPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const t=e;return(n,o)=>(B(),T(m(wt),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}}),[Li,Fi]=be("AlertDialogContent"),lr=D({__name:"AlertDialogContent",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,o=Se(t);$();const i=E();return Fi({onCancelElementChange:r=>{i.value=r}}),(r,l)=>(B(),T(m(Ti),F({...n,...m(o)},{role:"alertdialog",onPointerDownOutside:l[0]||(l[0]=Ze(()=>{},["prevent"])),onInteractOutside:l[1]||(l[1]=Ze(()=>{},["prevent"])),onOpenAutoFocus:l[2]||(l[2]=()=>{ge(()=>{var s;(s=i.value)==null||s.focus({preventScroll:!0})})})}),{default:A(()=>[P(r.$slots,"default")]),_:3},16))}}),sr=D({__name:"AlertDialogOverlay",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){const t=e;return $(),(n,o)=>(B(),T(m($i),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}}),ar=D({__name:"AlertDialogCancel",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const t=e,n=Li(),{forwardRef:o,currentElement:i}=$();return De(()=>{n.onCancelElementChange(i.value)}),(r,l)=>(B(),T(m(pn),F(t,{ref:m(o)}),{default:A(()=>[P(r.$slots,"default")]),_:3},16))}}),ur=D({__name:"AlertDialogTitle",props:{asChild:{type:Boolean},as:{default:"h2"}},setup(e){const t=e;return $(),(n,o)=>(B(),T(m(Si),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}}),cr=D({__name:"AlertDialogDescription",props:{asChild:{type:Boolean},as:{default:"p"}},setup(e){const t=e;return $(),(n,o)=>(B(),T(m(Mi),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}}),dr=D({__name:"AlertDialogAction",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const t=e;return $(),(n,o)=>(B(),T(m(pn),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}}),[vn,Ni]=be("PopperRoot"),ki=D({inheritAttrs:!1,__name:"PopperRoot",setup(e){const t=E();return Ni({anchor:t,onAnchorChange:n=>t.value=n}),(n,o)=>P(n.$slots,"default")}}),Ii=D({__name:"PopperAnchor",props:{element:{},asChild:{type:Boolean},as:{}},setup(e){const t=e,{forwardRef:n,currentElement:o}=$(),i=vn();return K(()=>{i.onAnchorChange(t.element??o.value)}),(r,l)=>(B(),T(m(X),{ref:m(n),as:r.as,"as-child":r.asChild},{default:A(()=>[P(r.$slots,"default")]),_:3},8,["as","as-child"]))}});function Wi(e){return e!==null}function Hi(e){return{name:"transformOrigin",options:e,fn(t){var n,o,i;const{placement:r,rects:l,middlewareData:s}=t,d=((n=s.arrow)==null?void 0:n.centerOffset)!==0,c=d?0:e.arrowWidth,a=d?0:e.arrowHeight,[u,p]=rt(r),f={start:"0%",center:"50%",end:"100%"}[p],v=(((o=s.arrow)==null?void 0:o.x)??0)+c/2,g=(((i=s.arrow)==null?void 0:i.y)??0)+a/2;let h="",y="";return u==="bottom"?(h=d?f:`${v}px`,y=`${-a}px`):u==="top"?(h=d?f:`${v}px`,y=`${l.floating.height+a}px`):u==="right"?(h=`${-a}px`,y=d?f:`${g}px`):u==="left"&&(h=`${l.floating.width+a}px`,y=d?f:`${g}px`),{data:{x:h,y}}}}}function rt(e){const[t,n="center"]=e.split("-");return[t,n]}const Vi={side:"bottom",sideOffset:0,align:"center",alignOffset:0,arrowPadding:0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,updatePositionStrategy:"optimized",prioritizePosition:!1},[ji,zi]=be("PopperContent"),Ki=D({inheritAttrs:!1,__name:"PopperContent",props:Tn({side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{}},{...Vi}),emits:["placed"],setup(e,{emit:t}){const n=e,o=t,i=vn(),{forwardRef:r,currentElement:l}=$(),s=E(),d=E(),{width:c,height:a}=ui(d),u=O(()=>n.side+(n.align!=="center"?`-${n.align}`:"")),p=O(()=>typeof n.collisionPadding=="number"?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),f=O(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),v=O(()=>({padding:p.value,boundary:f.value.filter(Wi),altBoundary:f.value.length>0})),g=Po(()=>[go({mainAxis:n.sideOffset+a.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&_t({...v.value}),n.avoidCollisions&&yo({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky==="partial"?Oo():void 0,...v.value}),!n.prioritizePosition&&n.avoidCollisions&&_t({...v.value}),wo({...v.value,apply:({elements:R,rects:z,availableWidth:k,availableHeight:W})=>{const{width:L,height:oe}=z.reference,I=R.floating.style;I.setProperty("--radix-popper-available-width",`${k}px`),I.setProperty("--radix-popper-available-height",`${W}px`),I.setProperty("--radix-popper-anchor-width",`${L}px`),I.setProperty("--radix-popper-anchor-height",`${oe}px`)}}),d.value&&Eo({element:d.value,padding:n.arrowPadding}),Hi({arrowWidth:c.value,arrowHeight:a.value}),n.hideWhenDetached&&bo({strategy:"referenceHidden",...v.value})]),{floatingStyles:h,placement:y,isPositioned:b,middlewareData:w}=Do(i.anchor,s,{strategy:"fixed",placement:u,whileElementsMounted:(...R)=>ho(...R,{animationFrame:n.updatePositionStrategy==="always"}),middleware:g}),C=O(()=>rt(y.value)[0]),x=O(()=>rt(y.value)[1]);Rn(()=>{b.value&&o("placed")});const S=O(()=>{var R;return((R=w.value.arrow)==null?void 0:R.centerOffset)!==0}),_=E("");K(()=>{l.value&&(_.value=window.getComputedStyle(l.value).zIndex)});const M=O(()=>{var R;return((R=w.value.arrow)==null?void 0:R.x)??0}),N=O(()=>{var R;return((R=w.value.arrow)==null?void 0:R.y)??0});return zi({placedSide:C,onArrowChange:R=>d.value=R,arrowX:M,arrowY:N,shouldHideArrow:S}),(R,z)=>{var k,W,L;return B(),Vt("div",{ref_key:"floatingRef",ref:s,"data-radix-popper-content-wrapper":"",style:st({...m(h),transform:m(b)?m(h).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:_.value,"--radix-popper-transform-origin":[(k=m(w).transformOrigin)==null?void 0:k.x,(W=m(w).transformOrigin)==null?void 0:W.y].join(" "),...((L=m(w).hide)==null?void 0:L.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}})},[me(m(X),F({ref:m(r)},R.$attrs,{"as-child":n.asChild,as:R.as,"data-side":C.value,"data-align":x.value,style:{animation:m(b)?void 0:"none"}}),{default:A(()=>[P(R.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4)}}}),Ui=$n("polygon",{points:"0,0 30,0 15,10"},null,-1),Yi=D({__name:"Arrow",props:{width:{default:10},height:{default:5},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const t=e;return $(),(n,o)=>(B(),T(m(X),F(t,{width:n.width,height:n.height,viewBox:n.asChild?void 0:"0 0 30 10",preserveAspectRatio:n.asChild?void 0:"none"}),{default:A(()=>[P(n.$slots,"default",{},()=>[Ui])]),_:3},16,["width","height","viewBox","preserveAspectRatio"]))}}),Xi={top:"bottom",right:"left",bottom:"top",left:"right"},qi=D({inheritAttrs:!1,__name:"PopperArrow",props:{width:{},height:{},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const{forwardRef:t}=$(),n=ji(),o=O(()=>Xi[n.placedSide.value]);return(i,r)=>{var l,s,d,c;return B(),Vt("span",{ref:a=>{m(n).onArrowChange(a)},style:st({position:"absolute",left:(l=m(n).arrowX)!=null&&l.value?`${(s=m(n).arrowX)==null?void 0:s.value}px`:void 0,top:(d=m(n).arrowY)!=null&&d.value?`${(c=m(n).arrowY)==null?void 0:c.value}px`:void 0,[o.value]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[m(n).placedSide.value],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[m(n).placedSide.value],visibility:m(n).shouldHideArrow.value?"hidden":void 0})},[me(Yi,F(i.$attrs,{ref:m(t),style:{display:"block"},as:i.as,"as-child":i.asChild,width:i.width,height:i.height}),{default:A(()=>[P(i.$slots,"default")]),_:3},16,["as","as-child","width","height"])],4)}}}),Gi=D({__name:"VisuallyHidden",props:{asChild:{type:Boolean},as:{default:"span"}},setup(e){return $(),(t,n)=>(B(),T(m(X),{as:t.as,"as-child":t.asChild,style:{position:"absolute",border:0,width:"1px",display:"inline-block",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}},{default:A(()=>[P(t.$slots,"default")]),_:3},8,["as","as-child"]))}});function Ji(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}Ji();const mn="tooltip.open",[bt,Zi]=be("TooltipProvider"),fr=D({inheritAttrs:!1,__name:"TooltipProvider",props:{delayDuration:{default:700},skipDelayDuration:{default:300},disableHoverableContent:{type:Boolean,default:!1},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean,default:!1}},setup(e){const t=e,{delayDuration:n,skipDelayDuration:o,disableHoverableContent:i,disableClosingTrigger:r,ignoreNonKeyboardFocus:l,disabled:s}=lt(t);$();const d=E(!0),c=E(!1),{start:a,stop:u}=tn(()=>{d.value=!0},o,{immediate:!1});return Zi({isOpenDelayed:d,delayDuration:n,onOpen(){u(),d.value=!1},onClose(){a()},isPointerInTransitRef:c,disableHoverableContent:i,disableClosingTrigger:r,disabled:s,ignoreNonKeyboardFocus:l}),(p,f)=>P(p.$slots,"default")}}),[Ue,Qi]=be("TooltipRoot"),pr=D({__name:"TooltipRoot",props:{defaultOpen:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},delayDuration:{default:void 0},disableHoverableContent:{type:Boolean,default:void 0},disableClosingTrigger:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,default:void 0}},emits:["update:open"],setup(e,{emit:t}){const n=e,o=t;$();const i=bt(),r=O(()=>n.disableHoverableContent??i.disableHoverableContent.value),l=O(()=>n.disableClosingTrigger??i.disableClosingTrigger.value),s=O(()=>n.disabled??i.disabled.value),d=O(()=>n.delayDuration??i.delayDuration.value),c=O(()=>n.ignoreNonKeyboardFocus??i.ignoreNonKeyboardFocus.value),a=nn(n,"open",o,{defaultValue:n.defaultOpen,passive:n.open===void 0});j(a,w=>{i.onClose&&(w?(i.onOpen(),document.dispatchEvent(new CustomEvent(mn))):i.onClose())});const u=E(!1),p=E(),f=O(()=>a.value?u.value?"delayed-open":"instant-open":"closed"),{start:v,stop:g}=tn(()=>{u.value=!0,a.value=!0},d,{immediate:!1});function h(){g(),u.value=!1,a.value=!0}function y(){g(),a.value=!1}function b(){v()}return Qi({contentId:"",open:a,stateAttribute:f,trigger:p,onTriggerChange(w){p.value=w},onTriggerEnter(){i.isOpenDelayed.value?b():h()},onTriggerLeave(){r.value?y():g()},onOpen:h,onClose:y,disableHoverableContent:r,disableClosingTrigger:l,disabled:s,ignoreNonKeyboardFocus:c}),(w,C)=>(B(),T(m(ki),null,{default:A(()=>[P(w.$slots,"default",{open:m(a)})]),_:3}))}}),vr=D({__name:"TooltipTrigger",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const t=e,n=Ue(),o=bt();n.contentId||(n.contentId=it(void 0,"radix-vue-tooltip-content"));const{forwardRef:i,currentElement:r}=$(),l=E(!1),s=E(!1),d=O(()=>n.disabled.value?{}:{click:g,focus:f,pointermove:u,pointerleave:p,pointerdown:a,blur:v});De(()=>{n.onTriggerChange(r.value)});function c(){setTimeout(()=>{l.value=!1},1)}function a(){l.value=!0,document.addEventListener("pointerup",c,{once:!0})}function u(h){h.pointerType!=="touch"&&!s.value&&!o.isPointerInTransitRef.value&&(n.onTriggerEnter(),s.value=!0)}function p(){n.onTriggerLeave(),s.value=!1}function f(h){var y,b;l.value||n.ignoreNonKeyboardFocus.value&&!((b=(y=h.target).matches)!=null&&b.call(y,":focus-visible"))||n.onOpen()}function v(){n.onClose()}function g(){n.disableClosingTrigger.value||n.onClose()}return(h,y)=>(B(),T(m(Ii),{"as-child":""},{default:A(()=>[me(m(X),F({ref:m(i),"aria-describedby":m(n).open.value?m(n).contentId:void 0,"data-state":m(n).stateAttribute.value,as:h.as,"as-child":t.asChild,"data-grace-area-trigger":""},xn(d.value)),{default:A(()=>[P(h.$slots,"default")]),_:3},16,["aria-describedby","data-state","as","as-child"])]),_:3}))}}),hn=D({__name:"TooltipContentImpl",props:{ariaLabel:{},asChild:{type:Boolean},as:{},side:{default:"top"},sideOffset:{default:0},align:{default:"center"},alignOffset:{},avoidCollisions:{type:Boolean,default:!0},collisionBoundary:{default:()=>[]},collisionPadding:{default:0},arrowPadding:{default:0},sticky:{default:"partial"},hideWhenDetached:{type:Boolean,default:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,o=t,i=Ue(),{forwardRef:r}=$(),l=Dn(),s=O(()=>{var a;return(a=l.default)==null?void 0:a.call(l)}),d=O(()=>{var a;if(n.ariaLabel)return n.ariaLabel;let u="";function p(f){typeof f.children=="string"&&f.type!==Wt?u+=f.children:Array.isArray(f.children)&&f.children.forEach(v=>p(v))}return(a=s.value)==null||a.forEach(f=>p(f)),u}),c=O(()=>{const{ariaLabel:a,...u}=n;return u});return De(()=>{Ve(window,"scroll",a=>{const u=a.target;u!=null&&u.contains(i.trigger.value)&&i.onClose()}),Ve(window,mn,i.onClose)}),(a,u)=>(B(),T(m(cn),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:u[0]||(u[0]=p=>o("escapeKeyDown",p)),onPointerDownOutside:u[1]||(u[1]=p=>{var f;m(i).disableClosingTrigger.value&&(f=m(i).trigger.value)!=null&&f.contains(p.target)&&p.preventDefault(),o("pointerDownOutside",p)}),onFocusOutside:u[2]||(u[2]=Ze(()=>{},["prevent"])),onDismiss:u[3]||(u[3]=p=>m(i).onClose())},{default:A(()=>[me(m(Ki),F({ref:m(r),"data-state":m(i).stateAttribute.value},{...a.$attrs,...c.value},{style:{"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),{default:A(()=>[P(a.$slots,"default"),me(m(Gi),{id:m(i).contentId,role:"tooltip"},{default:A(()=>[Pn(_n(d.value),1)]),_:1},8,["id"])]),_:3},16,["data-state"])]),_:3}))}}),er=D({__name:"TooltipContentHoverable",props:{ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean}},setup(e){const t=ln(e),{forwardRef:n,currentElement:o}=$(),{trigger:i,onClose:r}=Ue(),l=bt(),{isPointerInTransit:s,onPointerExit:d}=Go(i,o);return l.isPointerInTransitRef=s,d(()=>{r()}),(c,a)=>(B(),T(hn,F({ref:m(n)},m(t)),{default:A(()=>[P(c.$slots,"default")]),_:3},16))}}),mr=D({__name:"TooltipContent",props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{default:"top"},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,o=t,i=Ue(),r=sn(n,o),{forwardRef:l}=$();return(s,d)=>(B(),T(m(yt),{present:s.forceMount||m(i).open.value},{default:A(()=>[(B(),T(On(m(i).disableHoverableContent.value?hn:er),F({ref:m(l)},m(r)),{default:A(()=>[P(s.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),hr=D({__name:"TooltipArrow",props:{width:{default:10},height:{default:5},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const t=e;return $(),(n,o)=>(B(),T(m(qi),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}}),gr=D({__name:"TooltipPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const t=e;return(n,o)=>(B(),T(m(wt),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}});export{$i as $,rr as A,Si as B,cr as F,hr as G,fr as H,or as I,ar as M,dr as N,lr as O,Ti as P,ir as T,mr as U,ur as V,pr as W,vr as j,sr as k,vi as n,gr as q}; diff --git a/assets/js/CubismSdkForWeb-5-r.1/Core/live2dcubismcore.min.js b/assets/js/CubismSdkForWeb-5-r.1/Core/live2dcubismcore.min.js deleted file mode 100644 index 2e7fe178ff46c163f4d809009c82bce81d4ce588..0000000000000000000000000000000000000000 --- a/assets/js/CubismSdkForWeb-5-r.1/Core/live2dcubismcore.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Live2D Cubism Core - * (C) 2019 Live2D Inc. All rights reserved. - * - * This file is licensed pursuant to the license agreement below. - * This file corresponds to the "Redistributable Code" in the agreement. - * https://www.live2d.com/eula/live2d-proprietary-software-license-agreement_en.html - */ -var Live2DCubismCore;!function(Live2DCubismCore){var _scriptDir,_csm=function(){function _csm(){}return _csm.getVersion=function(){return _em.ccall("csmGetVersion","number",[],[])},_csm.getLatestMocVersion=function(){return _em.ccall("csmGetLatestMocVersion","number",[],[])},_csm.getMocVersion=function(moc,mocSize){return _em.ccall("csmGetMocVersion","number",["number","number"],[moc,mocSize])},_csm.getSizeofModel=function(moc){return _em.ccall("csmGetSizeofModel","number",["number"],[moc])},_csm.reviveMocInPlace=function(memory,mocSize){return _em.ccall("csmReviveMocInPlace","number",["number","number"],[memory,mocSize])},_csm.initializeModelInPlace=function(moc,memory,modelSize){return _em.ccall("csmInitializeModelInPlace","number",["number","number","number"],[moc,memory,modelSize])},_csm.hasMocConsistency=function(memory,mocSize){return _em.ccall("csmHasMocConsistency","number",["number","number"],[memory,mocSize])},_csm.getParameterCount=function(model){return _em.ccall("csmGetParameterCount","number",["number"],[model])},_csm.getParameterIds=function(model){return _em.ccall("csmGetParameterIds","number",["number"],[model])},_csm.getParameterMinimumValues=function(model){return _em.ccall("csmGetParameterMinimumValues","number",["number"],[model])},_csm.getParameterTypes=function(model){return _em.ccall("csmGetParameterTypes","number",["number"],[model])},_csm.getParameterMaximumValues=function(model){return _em.ccall("csmGetParameterMaximumValues","number",["number"],[model])},_csm.getParameterDefaultValues=function(model){return _em.ccall("csmGetParameterDefaultValues","number",["number"],[model])},_csm.getParameterValues=function(model){return _em.ccall("csmGetParameterValues","number",["number"],[model])},_csm.getParameterKeyCounts=function(model){return _em.ccall("csmGetParameterKeyCounts","number",["number"],[model])},_csm.getParameterKeyValues=function(model){return _em.ccall("csmGetParameterKeyValues","number",["number"],[model])},_csm.getPartCount=function(model){return _em.ccall("csmGetPartCount","number",["number"],[model])},_csm.getPartIds=function(model){return _em.ccall("csmGetPartIds","number",["number"],[model])},_csm.getPartOpacities=function(model){return _em.ccall("csmGetPartOpacities","number",["number"],[model])},_csm.getPartParentPartIndices=function(model){return _em.ccall("csmGetPartParentPartIndices","number",["number"],[model])},_csm.getDrawableCount=function(model){return _em.ccall("csmGetDrawableCount","number",["number"],[model])},_csm.getDrawableIds=function(model){return _em.ccall("csmGetDrawableIds","number",["number"],[model])},_csm.getDrawableConstantFlags=function(model){return _em.ccall("csmGetDrawableConstantFlags","number",["number"],[model])},_csm.getDrawableDynamicFlags=function(model){return _em.ccall("csmGetDrawableDynamicFlags","number",["number"],[model])},_csm.getDrawableTextureIndices=function(model){return _em.ccall("csmGetDrawableTextureIndices","number",["number"],[model])},_csm.getDrawableDrawOrders=function(model){return _em.ccall("csmGetDrawableDrawOrders","number",["number"],[model])},_csm.getDrawableRenderOrders=function(model){return _em.ccall("csmGetDrawableRenderOrders","number",["number"],[model])},_csm.getDrawableOpacities=function(model){return _em.ccall("csmGetDrawableOpacities","number",["number"],[model])},_csm.getDrawableMaskCounts=function(model){return _em.ccall("csmGetDrawableMaskCounts","number",["number"],[model])},_csm.getDrawableMasks=function(model){return _em.ccall("csmGetDrawableMasks","number",["number"],[model])},_csm.getDrawableVertexCounts=function(model){return _em.ccall("csmGetDrawableVertexCounts","number",["number"],[model])},_csm.getDrawableVertexPositions=function(model){return _em.ccall("csmGetDrawableVertexPositions","number",["number"],[model])},_csm.getDrawableVertexUvs=function(model){return _em.ccall("csmGetDrawableVertexUvs","number",["number"],[model])},_csm.getDrawableIndexCounts=function(model){return _em.ccall("csmGetDrawableIndexCounts","number",["number"],[model])},_csm.getDrawableIndices=function(model){return _em.ccall("csmGetDrawableIndices","number",["number"],[model])},_csm.getDrawableMultiplyColors=function(model){return _em.ccall("csmGetDrawableMultiplyColors","number",["number"],[model])},_csm.getDrawableScreenColors=function(model){return _em.ccall("csmGetDrawableScreenColors","number",["number"],[model])},_csm.getDrawableParentPartIndices=function(model){return _em.ccall("csmGetDrawableParentPartIndices","number",["number"],[model])},_csm.mallocMoc=function(mocSize){return _em.ccall("csmMallocMoc","number",["number"],[mocSize])},_csm.mallocModelAndInitialize=function(moc){return _em.ccall("csmMallocModelAndInitialize","number",["number"],[moc])},_csm.malloc=function(size){return _em.ccall("csmMalloc","number",["number"],[size])},_csm.setLogFunction=function(handler){_em.ccall("csmSetLogFunction",null,["number"],[handler])},_csm.updateModel=function(model){_em.ccall("csmUpdateModel",null,["number"],[model])},_csm.readCanvasInfo=function(model,outSizeInPixels,outOriginInPixels,outPixelsPerUnit){_em.ccall("csmReadCanvasInfo",null,["number","number","number","number"],[model,outSizeInPixels,outOriginInPixels,outPixelsPerUnit])},_csm.resetDrawableDynamicFlags=function(model){_em.ccall("csmResetDrawableDynamicFlags",null,["number"],[model])},_csm.free=function(memory){_em.ccall("csmFree",null,["number"],[memory])},_csm.initializeAmountOfMemory=function(size){_em.ccall("csmInitializeAmountOfMemory",null,["number"],[size])},_csm}(),Version=(Live2DCubismCore.AlignofMoc=64,Live2DCubismCore.AlignofModel=16,Live2DCubismCore.MocVersion_Unknown=0,Live2DCubismCore.MocVersion_30=1,Live2DCubismCore.MocVersion_33=2,Live2DCubismCore.MocVersion_40=3,Live2DCubismCore.MocVersion_42=4,Live2DCubismCore.MocVersion_50=5,Live2DCubismCore.ParameterType_Normal=0,Live2DCubismCore.ParameterType_BlendShape=1,function(){function Version(){}return Version.csmGetVersion=function(){return _csm.getVersion()},Version.csmGetLatestMocVersion=function(){return _csm.getLatestMocVersion()},Version.csmGetMocVersion=function(moc,mocBytes){return _csm.getMocVersion(moc._ptr,mocBytes.byteLength)},Version}()),Version=(Live2DCubismCore.Version=Version,function(){function Logging(){}return Logging.csmSetLogFunction=function(handler){Logging.logFunction=handler;handler=_em.addFunction(Logging.wrapLogFunction,"vi");_csm.setLogFunction(handler)},Logging.csmGetLogFunction=function(){return Logging.logFunction},Logging.wrapLogFunction=function(messagePtr){messagePtr=_em.UTF8ToString(messagePtr);Logging.logFunction(messagePtr)},Logging}()),Version=(Live2DCubismCore.Logging=Version,function(){function Moc(mocBytes){var memory=_csm.mallocMoc(mocBytes.byteLength);memory&&(new Uint8Array(_em.HEAPU8.buffer,memory,mocBytes.byteLength).set(new Uint8Array(mocBytes)),this._ptr=_csm.reviveMocInPlace(memory,mocBytes.byteLength),this._ptr||_csm.free(memory))}return Moc.prototype.hasMocConsistency=function(mocBytes){var memory=_csm.mallocMoc(mocBytes.byteLength);if(memory)return new Uint8Array(_em.HEAPU8.buffer,memory,mocBytes.byteLength).set(new Uint8Array(mocBytes)),mocBytes=_csm.hasMocConsistency(memory,mocBytes.byteLength),_csm.free(memory),mocBytes},Moc.fromArrayBuffer=function(buffer){return buffer&&(buffer=new Moc(buffer))._ptr?buffer:null},Moc.prototype._release=function(){_csm.free(this._ptr),this._ptr=0},Moc}()),Version=(Live2DCubismCore.Moc=Version,function(){function Model(moc){this._ptr=_csm.mallocModelAndInitialize(moc._ptr),this._ptr&&(this.parameters=new Parameters(this._ptr),this.parts=new Parts(this._ptr),this.drawables=new Drawables(this._ptr),this.canvasinfo=new CanvasInfo(this._ptr))}return Model.fromMoc=function(moc){moc=new Model(moc);return moc._ptr?moc:null},Model.prototype.update=function(){_csm.updateModel(this._ptr)},Model.prototype.release=function(){_csm.free(this._ptr),this._ptr=0},Model}()),CanvasInfo=(Live2DCubismCore.Model=Version,function(modelPtr){var _canvasSize_data,_canvasSize_dataPtr,_canvasSize_nDataBytes,_canvasOrigin_dataPtr,_canvasOrigin_nDataBytes,_canvasPPU_nDataBytes,_canvasPPU_dataPtr;modelPtr&&(_canvasSize_nDataBytes=(_canvasSize_data=new Float32Array(2)).length*_canvasSize_data.BYTES_PER_ELEMENT,_canvasSize_dataPtr=_csm.malloc(_canvasSize_nDataBytes),(_canvasSize_dataPtr=new Uint8Array(_em.HEAPU8.buffer,_canvasSize_dataPtr,_canvasSize_nDataBytes)).set(new Uint8Array(_canvasSize_data.buffer)),_canvasOrigin_nDataBytes=(_canvasSize_nDataBytes=new Float32Array(2)).length*_canvasSize_nDataBytes.BYTES_PER_ELEMENT,_canvasOrigin_dataPtr=_csm.malloc(_canvasOrigin_nDataBytes),(_canvasOrigin_dataPtr=new Uint8Array(_em.HEAPU8.buffer,_canvasOrigin_dataPtr,_canvasOrigin_nDataBytes)).set(new Uint8Array(_canvasSize_nDataBytes.buffer)),_canvasPPU_nDataBytes=(_canvasOrigin_nDataBytes=new Float32Array(1)).length*_canvasOrigin_nDataBytes.BYTES_PER_ELEMENT,_canvasPPU_dataPtr=_csm.malloc(_canvasPPU_nDataBytes),(_canvasPPU_dataPtr=new Uint8Array(_em.HEAPU8.buffer,_canvasPPU_dataPtr,_canvasPPU_nDataBytes)).set(new Uint8Array(_canvasOrigin_nDataBytes.buffer)),_csm.readCanvasInfo(modelPtr,_canvasSize_dataPtr.byteOffset,_canvasOrigin_dataPtr.byteOffset,_canvasPPU_dataPtr.byteOffset),_canvasSize_data=new Float32Array(_canvasSize_dataPtr.buffer,_canvasSize_dataPtr.byteOffset,_canvasSize_dataPtr.length),_canvasSize_nDataBytes=new Float32Array(_canvasOrigin_dataPtr.buffer,_canvasOrigin_dataPtr.byteOffset,_canvasOrigin_dataPtr.length),_canvasOrigin_nDataBytes=new Float32Array(_canvasPPU_dataPtr.buffer,_canvasPPU_dataPtr.byteOffset,_canvasPPU_dataPtr.length),this.CanvasWidth=_canvasSize_data[0],this.CanvasHeight=_canvasSize_data[1],this.CanvasOriginX=_canvasSize_nDataBytes[0],this.CanvasOriginY=_canvasSize_nDataBytes[1],this.PixelsPerUnit=_canvasOrigin_nDataBytes[0],_csm.free(_canvasSize_dataPtr.byteOffset),_csm.free(_canvasOrigin_dataPtr.byteOffset),_csm.free(_canvasPPU_dataPtr.byteOffset))}),Parameters=(Live2DCubismCore.CanvasInfo=CanvasInfo,function(modelPtr){this.count=_csm.getParameterCount(modelPtr),length=_csm.getParameterCount(modelPtr),this.ids=new Array(length);for(var length,length2,_ids=new Uint32Array(_em.HEAPU32.buffer,_csm.getParameterIds(modelPtr),length),i=0;i<_ids.length;i++)this.ids[i]=_em.UTF8ToString(_ids[i]);length=_csm.getParameterCount(modelPtr),this.minimumValues=new Float32Array(_em.HEAPF32.buffer,_csm.getParameterMinimumValues(modelPtr),length),length=_csm.getParameterCount(modelPtr),this.types=new Int32Array(_em.HEAP32.buffer,_csm.getParameterTypes(modelPtr),length),length=_csm.getParameterCount(modelPtr),this.maximumValues=new Float32Array(_em.HEAPF32.buffer,_csm.getParameterMaximumValues(modelPtr),length),length=_csm.getParameterCount(modelPtr),this.defaultValues=new Float32Array(_em.HEAPF32.buffer,_csm.getParameterDefaultValues(modelPtr),length),length=_csm.getParameterCount(modelPtr),this.values=new Float32Array(_em.HEAPF32.buffer,_csm.getParameterValues(modelPtr),length),length=_csm.getParameterCount(modelPtr),this.keyCounts=new Int32Array(_em.HEAP32.buffer,_csm.getParameterKeyCounts(modelPtr),length),length=_csm.getParameterCount(modelPtr),length2=new Int32Array(_em.HEAP32.buffer,_csm.getParameterKeyCounts(modelPtr),length),this.keyValues=new Array(length);for(var _keyValues=new Uint32Array(_em.HEAPU32.buffer,_csm.getParameterKeyValues(modelPtr),length),i=0;i<_keyValues.length;i++)this.keyValues[i]=new Float32Array(_em.HEAPF32.buffer,_keyValues[i],length2[i])}),Parts=(Live2DCubismCore.Parameters=Parameters,function(modelPtr){this.count=_csm.getPartCount(modelPtr),length=_csm.getPartCount(modelPtr),this.ids=new Array(length);for(var length,_ids=new Uint32Array(_em.HEAPU32.buffer,_csm.getPartIds(modelPtr),length),i=0;i<_ids.length;i++)this.ids[i]=_em.UTF8ToString(_ids[i]);length=_csm.getPartCount(modelPtr),this.opacities=new Float32Array(_em.HEAPF32.buffer,_csm.getPartOpacities(modelPtr),length),length=_csm.getPartCount(modelPtr),this.parentIndices=new Int32Array(_em.HEAP32.buffer,_csm.getPartParentPartIndices(modelPtr),length)}),Drawables=(Live2DCubismCore.Parts=Parts,function(){function Drawables(modelPtr){this._modelPtr=modelPtr;for(var length,length2=null,_ids=(this.count=_csm.getDrawableCount(modelPtr),length=_csm.getDrawableCount(modelPtr),this.ids=new Array(length),new Uint32Array(_em.HEAPU32.buffer,_csm.getDrawableIds(modelPtr),length)),i=0;i<_ids.length;i++)this.ids[i]=_em.UTF8ToString(_ids[i]);length=_csm.getDrawableCount(modelPtr),this.constantFlags=new Uint8Array(_em.HEAPU8.buffer,_csm.getDrawableConstantFlags(modelPtr),length),length=_csm.getDrawableCount(modelPtr),this.dynamicFlags=new Uint8Array(_em.HEAPU8.buffer,_csm.getDrawableDynamicFlags(modelPtr),length),length=_csm.getDrawableCount(modelPtr),this.textureIndices=new Int32Array(_em.HEAP32.buffer,_csm.getDrawableTextureIndices(modelPtr),length),length=_csm.getDrawableCount(modelPtr),this.drawOrders=new Int32Array(_em.HEAP32.buffer,_csm.getDrawableDrawOrders(modelPtr),length),length=_csm.getDrawableCount(modelPtr),this.renderOrders=new Int32Array(_em.HEAP32.buffer,_csm.getDrawableRenderOrders(modelPtr),length),length=_csm.getDrawableCount(modelPtr),this.opacities=new Float32Array(_em.HEAPF32.buffer,_csm.getDrawableOpacities(modelPtr),length),length=_csm.getDrawableCount(modelPtr),this.maskCounts=new Int32Array(_em.HEAP32.buffer,_csm.getDrawableMaskCounts(modelPtr),length),length=_csm.getDrawableCount(modelPtr),this.vertexCounts=new Int32Array(_em.HEAP32.buffer,_csm.getDrawableVertexCounts(modelPtr),length),length=_csm.getDrawableCount(modelPtr),this.indexCounts=new Int32Array(_em.HEAP32.buffer,_csm.getDrawableIndexCounts(modelPtr),length),length=_csm.getDrawableCount(modelPtr),this.multiplyColors=new Float32Array(_em.HEAPF32.buffer,_csm.getDrawableMultiplyColors(modelPtr),4*length),length=_csm.getDrawableCount(modelPtr),this.screenColors=new Float32Array(_em.HEAPF32.buffer,_csm.getDrawableScreenColors(modelPtr),4*length),length=_csm.getDrawableCount(modelPtr),this.parentPartIndices=new Int32Array(_em.HEAP32.buffer,_csm.getDrawableParentPartIndices(modelPtr),length),length=_csm.getDrawableCount(modelPtr),length2=new Int32Array(_em.HEAP32.buffer,_csm.getDrawableMaskCounts(modelPtr),length),this.masks=new Array(length);for(var _masks=new Uint32Array(_em.HEAPU32.buffer,_csm.getDrawableMasks(modelPtr),length),i=0;i<_masks.length;i++)this.masks[i]=new Int32Array(_em.HEAP32.buffer,_masks[i],length2[i]);length=_csm.getDrawableCount(modelPtr),length2=new Int32Array(_em.HEAP32.buffer,_csm.getDrawableVertexCounts(modelPtr),length),this.vertexPositions=new Array(length);for(var _vertexPositions=new Uint32Array(_em.HEAPU32.buffer,_csm.getDrawableVertexPositions(modelPtr),length),i=0;i<_vertexPositions.length;i++)this.vertexPositions[i]=new Float32Array(_em.HEAPF32.buffer,_vertexPositions[i],2*length2[i]);length=_csm.getDrawableCount(modelPtr),length2=new Int32Array(_em.HEAP32.buffer,_csm.getDrawableVertexCounts(modelPtr),length),this.vertexUvs=new Array(length);for(var _vertexUvs=new Uint32Array(_em.HEAPU32.buffer,_csm.getDrawableVertexUvs(modelPtr),length),i=0;i<_vertexUvs.length;i++)this.vertexUvs[i]=new Float32Array(_em.HEAPF32.buffer,_vertexUvs[i],2*length2[i]);length=_csm.getDrawableCount(modelPtr),length2=new Int32Array(_em.HEAP32.buffer,_csm.getDrawableIndexCounts(modelPtr),length),this.indices=new Array(length);for(var _indices=new Uint32Array(_em.HEAPU32.buffer,_csm.getDrawableIndices(modelPtr),length),i=0;i<_indices.length;i++)this.indices[i]=new Uint16Array(_em.HEAPU16.buffer,_indices[i],length2[i])}return Drawables.prototype.resetDynamicFlags=function(){_csm.resetDrawableDynamicFlags(this._modelPtr)},Drawables}()),Version=(Live2DCubismCore.Drawables=Drawables,function(){function Utils(){}return Utils.hasBlendAdditiveBit=function(bitfield){return 1==(1&bitfield)},Utils.hasBlendMultiplicativeBit=function(bitfield){return 2==(2&bitfield)},Utils.hasIsDoubleSidedBit=function(bitfield){return 4==(4&bitfield)},Utils.hasIsInvertedMaskBit=function(bitfield){return 8==(8&bitfield)},Utils.hasIsVisibleBit=function(bitfield){return 1==(1&bitfield)},Utils.hasVisibilityDidChangeBit=function(bitfield){return 2==(2&bitfield)},Utils.hasOpacityDidChangeBit=function(bitfield){return 4==(4&bitfield)},Utils.hasDrawOrderDidChangeBit=function(bitfield){return 8==(8&bitfield)},Utils.hasRenderOrderDidChangeBit=function(bitfield){return 16==(16&bitfield)},Utils.hasVertexPositionsDidChangeBit=function(bitfield){return 32==(32&bitfield)},Utils.hasBlendColorDidChangeBit=function(bitfield){return 64==(64&bitfield)},Utils}()),Version=(Live2DCubismCore.Utils=Version,function(){function Memory(){}return Memory.initializeAmountOfMemory=function(size){16777216>2]+(Ln<<5)|0)>>2],Pn=q[a+60>>2]+w(Wn,24)|0,Ln=(ko=q[Pn+8>>2])+-1|0,xo=(qo=q[Pn+4>>2])+-1|0,yo=uo=(Wn=q[q[a+152>>2]+(Wn<<2)>>2])+(ko<<3)|0,zo=vo=Wn+((to=w(qo,lo=ko+1|0))<<3)|0,Ao=wo=Wn+(ko+to<<3)|0,Io=q[Pn+12>>2],ro=x(0|qo),so=x(0|ko),a=0;Vn=u[4+(Pn=(oo=a<<3)+Mn|0)>>2],Rn=x(Vn*ro),Xn=u[Pn>>2],Qn=x(Xn*so),Pn=Vn>=x(1),Rn=!(Vn=x(1)|Xn>2],Bo=u[Wn+4>>2],Yn=x(ao-Bo),Co=u[4+yo>>2],Do=u[4+zo>>2],Zn=x(Co-Do),bo=x(x(Yn-Zn)*x(.5)),Eo=u[wo>>2],Fo=u[Wn>>2],_n=x(Eo-Fo),Go=u[uo>>2],Ho=u[vo>>2],$n=x(Go-Ho),co=x(x(_n-$n)*x(.5)),Zn=x(x(Zn+Yn)*x(.5)),$n=x(x($n+_n)*x(.5)),Jo=1,Yn=x(x(x(x(x(Bo+Co)+Do)+ao)*x(.25))-x(Yn*x(.5))),_n=x(x(x(x(x(Fo+Go)+Ho)+Eo)*x(.25))-x(_n*x(.5)))),Vnx(-2)^1|(Xnx(-2)^1)?(u[Nn+oo>>2]=x(Vn*co)+x(x(Xn*$n)+_n),Qn=x(Vn*bo),x(x(Xn*Zn)+Yn)):(Xn<=x(0)?Vn<=x(0)?(Un=x(x(Vn+x(2))*x(.5)),Tn=x(x(Xn+x(2))*x(.5)),Qn=x(bo+bo),mo=x(Yn-Qn),Rn=x(co+co),no=x(_n-Rn),io=x(Yn-x(Zn+Zn)),eo=x(io-Qn),jo=x(_n-x($n+$n)),fo=x(jo-Rn),go=u[Wn+4>>2],ho=u[Wn>>2]):Pn?(Qn=x(bo*x(3)),Rn=x(Yn-x(Zn+Zn)),io=x(Qn+Rn),eo=x(co*x(3)),fo=x(_n-x($n+$n)),jo=x(eo+fo),Un=x(x(Vn+x(-1))*x(.5)),Tn=x(x(Xn+x(2))*x(.5)),go=x(Qn+Yn),ho=x(eo+_n),eo=x(bo+Rn),fo=x(co+fo),mo=u[4+zo>>2],no=u[vo>>2]):(Qn=x(Yn-x(Zn+Zn)),Pn=xo,Sn=x(y(Rn))>2],no=u[Pn>>2],Pn=Wn+(w(Sn,lo)<<3)|0,go=u[Pn+4>>2],ho=u[Pn>>2]):Xn>=x(1)?Vn<=x(0)?(Un=x(x(Vn+x(2))*x(.5)),Tn=x(x(Xn+x(-1))*x(.5)),Qn=x(bo+bo),eo=x(x(Zn+Yn)-Qn),Rn=x(co+co),fo=x(x($n+_n)-Rn),go=x(x(Zn*x(3))+Yn),mo=x(go-Qn),ho=x(x($n*x(3))+_n),no=x(ho-Rn),io=u[4+yo>>2],jo=u[uo>>2]):Pn?(Qn=x(bo*x(3)),io=x(Qn+x(Zn+Yn)),Rn=x(co*x(3)),jo=x(Rn+x($n+_n)),ao=Qn,Qn=x(x(Zn*x(3))+Yn),go=x(ao+Qn),ao=Rn,Rn=x(x($n*x(3))+_n),ho=x(ao+Rn),Un=x(x(Vn+x(-1))*x(.5)),Tn=x(x(Xn+x(-1))*x(.5)),mo=x(bo+Qn),no=x(co+Rn),eo=u[4+Ao>>2],fo=u[wo>>2]):(Qn=x(x(Zn*x(3))+Yn),Pn=xo,Sn=x(y(Rn))>2],fo=u[Pn>>2],Pn=Wn+(w(Sn,lo)+ko<<3)|0,io=u[Pn+4>>2],jo=u[Pn>>2]):Vn<=x(0)?(Un=x(x(Vn+x(2))*x(.5)),Pn=Ln,Sn=x(y(Rn=Qn))>2],jo=u[Pn>>2],go=u[4+(Pn=Wn+(Sn<<3)|0)>>2],ho=u[Pn>>2]):Pn?(ao=Rn=x(bo*x(3)),Pn=Ln,Sn=x(y(Qn))>2],fo=u[Pn>>2],mo=u[4+(Pn=Wn+(Sn+to<<3)|0)>>2],no=u[Pn>>2]):(v[16+po>>3]=Vn,q[po>>2]=a,v[8+po>>3]=Xn,Y(4,1107,po)),x(Tn+Un)<=x(1)?(u[Nn+oo>>2]=x(fo+x(x(no-fo)*Tn))+x(x(jo-fo)*Un),Qn=x(eo+x(x(mo-eo)*Tn)),x(x(io-eo)*Un)):(Qn=x(x(1)-Tn),Rn=x(x(1)-Un),u[Nn+oo>>2]=x(ho+x(x(jo-ho)*Qn))+x(x(no-ho)*Rn),Qn=x(go+x(x(io-go)*Qn)),x(x(mo-go)*Rn)))):(Pn=x(y(ao=Rn))>2]=x(x(x(Qn*x(Rn*u[Sn>>2]))+x(Qn*x(Tn*u[Sn+8>>2])))+x(Un*x(Rn*u[Pn>>2])))+x(Un*x(Tn*u[Pn+8>>2])),Qn=x(x(x(Qn*x(Rn*u[Sn+4>>2]))+x(Qn*x(Tn*u[Sn+12>>2])))+x(Un*x(Rn*u[Pn+4>>2]))),x(Un*x(Tn*u[Pn+12>>2]))):x(Tn+Un)<=x(1)?(Qn=x(x(x(1)-Tn)-Un),Sn=Wn+(Pn<<3)|0,Pn=Wn+(Pn+lo<<3)|0,u[Nn+oo>>2]=x(x(Qn*u[Sn>>2])+x(Tn*u[Sn+8>>2]))+x(Un*u[Pn>>2]),Qn=x(x(Qn*u[Sn+4>>2])+x(Tn*u[Sn+12>>2])),x(Un*u[Pn+4>>2])):(Qn=x(x(Tn+x(-1))+Un),Sn=Wn+(Pn+lo<<3)|0,Rn=x(x(1)-Tn),Vn=x(x(1)-Un),Pn=Wn+(Pn<<3)|0,u[Nn+oo>>2]=x(x(Qn*u[Sn+8>>2])+x(Rn*u[Sn>>2]))+x(Vn*u[Pn+8>>2]),Qn=x(x(Qn*u[Sn+12>>2])+x(Rn*u[Sn+4>>2])),x(Vn*u[Pn+12>>2]))),u[4+(Nn+oo|0)>>2]=Qn+Rn,(0|On)!=(0|(a=a+1|0)););L=32+po|0},n[2]=function(a,mh){a|=0,mh|=0;var Dh=0,Eh=0,Fh=0,Gh=0,Hh=0,Ih=x(0),Jh=0,Kh=0,Mh=(x(0),0),Nh=0,Gh=q[a+320>>2],Dh=q[a+316>>2],Hh=q[a+308>>2];-1==(0|(Eh=q[8+(Fh=Hh+(mh<<5)|0)>>2]))?(q[(Nh=Dh)+(Dh=mh<<2)>>2]=q[q[a+148>>2]+(q[Fh+16>>2]<<2)>>2],q[Dh+Gh>>2]=1065353216):(Jh=q[Fh+16>>2],Kh=q[q[a+152>>2]+(Jh<<2)>>2],n[q[24+(Hh+(Eh<<5)|0)>>2]](a,Eh,Kh,Kh,q[16+(q[a+60>>2]+w(Jh,24)|0)>>2]),Ih=u[q[a+148>>2]+(q[Fh+16>>2]<<2)>>2],Fh=q[Fh+8>>2]<<2,u[(Eh=mh<<2)+Dh>>2]=Ih*u[Fh+Dh>>2],q[Eh+Gh>>2]=q[Fh+Gh>>2]),4<=r[q[a>>2]+4|0]&&(Gh=mh<<2,Dh=q[a+308>>2]+(mh<<5)|0,Eh=q[Dh+16>>2]<<2,Fh=q[a+328>>2],mh=q[a+324>>2],-1==(0|(Hh=q[Dh+8>>2]))?(Hh=q[a+156>>2],q[(Dh=Gh<<2)+mh>>2]=q[Hh+(Eh<<=2)>>2],q[(Jh=4|Dh)+mh>>2]=q[(Kh=4|Eh)+Hh>>2],q[(Mh=8|Dh)+mh>>2]=q[Hh+(Nh=8|Eh)>>2],q[mh+((Gh|=3)<<2)>>2]=1065353216,a=q[a+160>>2],q[Dh+Fh>>2]=q[a+Eh>>2],q[Fh+Jh>>2]=q[a+Kh>>2],q[Fh+Mh>>2]=q[a+Nh>>2]):(Eh=(Kh=Eh<<2)+q[a+156>>2]|0,u[(Dh=(Jh=Gh<<2)+mh|0)>>2]=u[Eh>>2]*u[(Hh=(Mh=Hh<<4)+mh|0)>>2],u[Dh+4>>2]=u[Eh+4>>2]*u[Hh+4>>2],u[Dh+8>>2]=u[Eh+8>>2]*u[Hh+8>>2],q[mh+((Gh|=3)<<2)>>2]=1065353216,a=Kh+q[a+160>>2]|0,Nh=u[a>>2],Ih=u[(Dh=Fh+Mh|0)>>2],u[(mh=Fh+Jh|0)>>2]=x(Nh+Ih)-x(Nh*Ih),Nh=u[a+4>>2],Ih=u[Dh+4>>2],u[mh+4>>2]=x(Nh+Ih)-x(Nh*Ih),Nh=u[a+8>>2],Ih=u[Dh+8>>2],u[mh+8>>2]=x(Nh+Ih)-x(Nh*Ih)),q[Fh+(Gh<<2)>>2]=1065353216)},n[3]=function(a,Sm,un,xn,yn){a|=0,Sm|=0,un|=0,xn|=0,yn|=0;var Dn,En,Fn,Hn,In,zn=0,zn=(x(0),x(0),x(0),x(0),x(0),x(0),x(0),x(0),(Sm=q[16+(q[a+308>>2]+(Sm<<5)|0)>>2])<<2),Bn=function(a){var El,Hl,Fl,Gl,Dl=x(0);L=Fl=L-16|0,j(a);a:if((El=2147483647&(Gl=b[0]))>>>0<=1061752794)Dl=x(1),El>>>0<964689920||(Dl=ba(+a));else if(El>>>0<=1081824209)Hl=+a,Dl=1075235812<=El>>>0?x(-ba(((0|Gl)<0?3.141592653589793:-3.141592653589793)+Hl)):aa((0|Gl)<=-1?1.5707963267948966+Hl:1.5707963267948966-Hl);else if(El>>>0<=1088565717)Dl=1085271520<=El>>>0?ba(+a+((0|Gl)<0?6.283185307179586:-6.283185307179586)):aa((0|Gl)<=-1?-4.71238898038469-+a:+a-4.71238898038469);else if(Dl=x(a-a),!(2139095040<=El>>>0))if((El=3&Da(a,8+Fl|0))>>>0<=2){switch(El-1|0){default:Dl=ba(v[8+Fl>>3]);break a;case 0:Dl=aa(-v[8+Fl>>3]);break a;case 1:}Dl=x(-ba(v[8+Fl>>3]))}else Dl=aa(v[8+Fl>>3]);return L=16+Fl|0,Dl}(An=x(x(x(u[4+(q[a+168>>2]+w(Sm,12)|0)>>2]+u[zn+q[a+284>>2]>>2])*x(3.1415927410125732))/x(180))),Cn=u[zn+q[a+272>>2]>>2],Gn=q[zn+q[a+292>>2]>>2],An=function(a){var Vk,Al,Cl,Bl=0;L=Al=L-16|0,j(a);a:if((Vk=2147483647&(Cl=b[0]))>>>0<=1061752794)Vk>>>0<964689920||(a=aa(+a));else if(Vk>>>0<=1081824209)Bl=+a,a=Vk>>>0<=1075235811?(0|Cl)<=-1?x(-ba(Bl+1.5707963267948966)):ba(Bl+-1.5707963267948966):aa(-(((0|Cl)<0?3.141592653589793:-3.141592653589793)+Bl));else if(Vk>>>0<=1088565717)Bl=+a,a=Vk>>>0<=1085271519?(0|Cl)<=-1?ba(Bl+4.71238898038469):x(-ba(Bl+-4.71238898038469)):aa(((0|Cl)<0?6.283185307179586:-6.283185307179586)+Bl);else if(2139095040<=Vk>>>0)a=x(a-a);else if((Vk=3&Da(a,8+Al|0))>>>0<=2){switch(Vk-1|0){default:a=aa(v[8+Al>>3]);break a;case 0:a=ba(v[8+Al>>3]);break a;case 1:}a=aa(-v[8+Al>>3])}else a=x(-ba(v[8+Al>>3]));return L=16+Al|0,a}(An);if((Sm=0)<(0|yn))for(Bn=x(Cn*Bn),En=x(Gn?-1:1),Hn=x(Bn*En),Dn=q[zn+q[a+288>>2]>>2]?x(-1):x(1),In=x(x(Cn*An)*Dn),Bn=x(Bn*Dn),Cn=x(x(Cn*x(-An))*En),An=u[zn+q[a+280>>2]>>2],En=u[zn+q[a+276>>2]>>2];zn=(a=Sm<<3)+xn|0,Dn=u[(a=a+un|0)>>2],Fn=u[a+4>>2],u[zn+4>>2]=An+x(x(In*Dn)+x(Hn*Fn)),u[zn>>2]=En+x(x(Bn*Dn)+x(Cn*Fn)),(0|yn)!=(0|(Sm=Sm+1|0)););},n[4]=function(a,mh){a|=0,mh|=0;var yh,zh,Ah,Bh,Ch,nh,oh=0,ph=0,qh=0,rh=x(0),sh=0,th=0,uh=x(0),vh=0,wh=0,xh=0;if(x(0),x(0),x(0),x(0),L=nh=L+-64|0,vh=q[a+320>>2],wh=q[a+316>>2],ph=q[a+308>>2],-1==(0|(sh=q[8+(qh=ph+(mh<<5)|0)>>2])))oh=q[qh+16>>2]<<2,q[(ph=mh<<2)+wh>>2]=q[oh+q[a+268>>2]>>2],q[ph+vh>>2]=q[oh+q[a+272>>2]>>2];else{oh=q[qh+16>>2]<<2,xh=q[oh+q[a+276>>2]>>2],q[24+nh>>2]=xh,oh=q[oh+q[a+280>>2]>>2],q[28+nh>>2]=oh,q[16+nh>>2]=0,zh=1==q[12+(th=ph+(sh<<5)|0)>>2]?x(-10):x(-.10000000149011612),u[20+nh>>2]=zh,q[60+nh>>2]=oh,q[56+nh>>2]=xh,n[q[th+24>>2]](a,sh,56+nh|0,48+nh|0,1),rh=x(1),ph=9;b:{for(;;){if(oh=ph,uh=x(rh*x(0)),u[32+nh>>2]=uh+u[56+nh>>2],yh=x(zh*rh),u[36+nh>>2]=yh+u[60+nh>>2],n[q[th+24>>2]](a,sh,32+nh|0,40+nh|0,1),Ah=x(u[44+nh>>2]-u[52+nh>>2]),u[44+nh>>2]=Ah,Bh=x(u[40+nh>>2]-u[48+nh>>2]),u[40+nh>>2]=Bh,Ah!=x(0)||Bh!=x(0)){ph=q[44+nh>>2],q[8+nh>>2]=q[40+nh>>2],q[12+nh>>2]=ph;break b}if(u[32+nh>>2]=u[56+nh>>2]-uh,u[36+nh>>2]=u[60+nh>>2]-yh,n[q[th+24>>2]](a,sh,32+nh|0,40+nh|0,1),uh=x(u[40+nh>>2]-u[48+nh>>2]),u[40+nh>>2]=uh,yh=x(u[44+nh>>2]-u[52+nh>>2]),(u[44+nh>>2]=yh)!=x(0)||uh!=x(0)){u[12+nh>>2]=-yh,u[8+nh>>2]=-uh;break b}if(ph=oh+-1|0,rh=x(rh*x(.10000000149011612)),!oh)break}Y(3,1311,0)}rh=function(a,ji){var ki=x(0);if((ki=x(Ba(u[4+a>>2],u[a>>2])-Ba(u[4+ji>>2],u[ji>>2])))x(3.1415927410125732))for(;(ki=x(ki+x(-6.2831854820251465)))>x(3.1415927410125732););return ki}(16+nh|0,8+nh|0),n[q[th+24>>2]](a,q[qh+8>>2],24+nh|0,24+nh|0,1),ph=q[qh+16>>2]<<2,q[ph+q[a+276>>2]>>2]=q[24+nh>>2],q[ph+q[a+280>>2]>>2]=q[28+nh>>2],oh=ph+q[a+284>>2]|0,u[oh>>2]=u[oh>>2]+x(x(rh*x(-180))/x(3.1415927410125732)),qh=q[qh+8>>2]<<2,u[(oh=mh<<2)+wh>>2]=u[ph+q[a+268>>2]>>2]*u[qh+wh>>2],ph=ph+q[a+272>>2]|0,rh=x(u[ph>>2]*u[qh+vh>>2]),u[oh+vh>>2]=rh,u[ph>>2]=rh}4<=r[q[a>>2]+4|0]&&(oh=mh<<2,qh=q[a+308>>2]+(mh<<5)|0,sh=q[qh+16>>2]<<2,ph=q[a+328>>2],mh=q[a+324>>2],-1==(0|(th=q[qh+8>>2]))?(th=q[a+296>>2],q[(qh=oh<<2)+mh>>2]=q[th+(sh<<=2)>>2],q[(vh=4|qh)+mh>>2]=q[(wh=4|sh)+th>>2],q[(xh=8|qh)+mh>>2]=q[th+(Ch=8|sh)>>2],q[mh+((oh|=3)<<2)>>2]=1065353216,a=q[a+300>>2],q[ph+qh>>2]=q[a+sh>>2],q[ph+vh>>2]=q[a+wh>>2],q[ph+xh>>2]=q[a+Ch>>2]):(sh=(wh=sh<<2)+q[a+296>>2]|0,u[(qh=(vh=oh<<2)+mh|0)>>2]=u[sh>>2]*u[(th=(xh=th<<4)+mh|0)>>2],u[qh+4>>2]=u[sh+4>>2]*u[th+4>>2],u[qh+8>>2]=u[sh+8>>2]*u[th+8>>2],q[mh+((oh|=3)<<2)>>2]=1065353216,a=wh+q[a+300>>2]|0,rh=u[a>>2],uh=u[(qh=ph+xh|0)>>2],u[(mh=ph+vh|0)>>2]=x(rh+uh)-x(rh*uh),rh=u[a+4>>2],uh=u[qh+4>>2],u[mh+4>>2]=x(rh+uh)-x(rh*uh),rh=u[a+8>>2],uh=u[qh+8>>2],u[mh+8>>2]=x(rh+uh)-x(rh*uh)),q[ph+(oh<<2)>>2]=1065353216),L=64+nh|0},n[5]=function(a,Vk){return a|=0,Vk|=0,x(0),x(0),0|((a=u[a>>2])<(Vk=u[Vk>>2])?-1:Vk>2])))for(_j=q[a+12>>2],Zj=q[a+20>>2];u[(Wj=Vj<<2)+_j>>2]=u[vj+Wj>>2]*u[Wj+Zj>>2],(0|(Vj=Vj+1|0))<(0|Yj););if(!((0|(Yj=q[a>>2]))<1))if(_j=q[a+4>>2],yj)for(Wj=vj=0;;){if(q[yj>>2]){if((0|(Vj=q[(Zj=vj<<2)+q[a+16>>2]>>2]))<1)Xj=x(0);else for($j=Vj+Wj|0,ak=q[a+12>>2],Xj=x(0),Vj=Wj;Xj=x(Xj+u[ak+(Vj<<2)>>2]),(0|(Vj=Vj+1|0))<(0|$j););u[xj+Zj>>2]=Xj}if(yj=yj+4|0,Wj=q[_j+(vj<<2)>>2]+Wj|0,!((0|(vj=vj+1|0))<(0|Yj)))break}else for(Zj=q[a+16>>2],vj=yj=0;;){if((0|(Vj=q[(Wj=yj<<2)+Zj>>2]))<=0)Xj=x(0);else for($j=vj+Vj|0,ak=q[a+12>>2],Xj=x(0),Vj=vj;Xj=x(Xj+u[ak+(Vj<<2)>>2]),(0|(Vj=Vj+1|0))<(0|$j););if(u[xj+Wj>>2]=Xj,vj=q[Wj+_j>>2]+vj|0,!((0|(yj=yj+1|0))<(0|Yj)))break}},n[7]=function(a,vj,xj,yj){a|=0,vj|=0,xj|=0,yj|=0;var zj=0,Aj=x(0),Qj=0,Rj=0,Sj=0,Tj=0,Uj=0;if(1<=(0|(Tj=q[a+8>>2])))for(Rj=q[a+12>>2],Sj=q[a+20>>2];u[(Qj=zj<<2)+Rj>>2]=u[vj+Qj>>2]*u[Qj+Sj>>2],(0|(zj=zj+1|0))<(0|Tj););if(!((0|(zj=q[a>>2]))<1))if(Tj=q[a+4>>2],yj)for(Qj=vj=0;;){if(q[yj>>2]){if((0|(zj=q[(Rj=vj<<2)+q[a+16>>2]>>2]))<1)Aj=x(0);else for(Sj=zj+Qj|0,Uj=q[a+12>>2],Aj=x(0),zj=Qj;Aj=x(Aj+u[Uj+(zj<<2)>>2]),(0|(zj=zj+1|0))<(0|Sj););zj=xj+Rj|0,Aj=x(Aj+x(.0010000000474974513)),Rj=x(y(Aj))>2]=Rj,zj=q[a>>2]}if(yj=yj+4|0,Qj=q[Tj+(vj<<2)>>2]+Qj|0,!((0|(vj=vj+1|0))<(0|zj)))break}else for(Rj=q[a+16>>2],vj=yj=0;;){if((0|(zj=q[(Qj=yj<<2)+Rj>>2]))<=0)Aj=x(0);else for(Sj=vj+zj|0,Uj=q[a+12>>2],Aj=x(0),zj=vj;Aj=x(Aj+u[Uj+(zj<<2)>>2]),(0|(zj=zj+1|0))<(0|Sj););if(zj=xj+Qj|0,Aj=x(Aj+x(.0010000000474974513)),Sj=x(y(Aj))>2]=Sj,vj=q[Qj+Tj>>2]+vj|0,!((0|(yj=yj+1|0))>2]))break}},n[8]=function(a,vj,xj,yj,zj,Aj){a|=0,vj|=0,xj|=0,yj|=0,zj|=0,Aj|=0;var Oj,Pj,Bj=0,Cj=0,Dj=0,Ej=0,Fj=0,Gj=0,Hj=0,Ij=0,Kj=0,Lj=0,Mj=x(0),Nj=0,Jj=q[a>>2];if(!((0|Jj)<1))if(Oj=zj<<2,Pj=q[a+4>>2],Aj)for(;;){if(q[Aj>>2]&&(Dj=q[(Bj=Ej<<2)+q[a+16>>2]>>2],Hj=q[xj+Bj>>2],Cj=q[yj+Bj>>2],(Bj=(0|(Ij=w(Cj,zj)))<1)||ca(Hj,0,w(Cj,Oj)),!(Bj|(0|Dj)<1)))for(Kj=Dj+Gj|0,Lj=q[a+20>>2],Bj=Gj;;){for(Mj=u[(Cj=Bj<<2)+Lj>>2],Nj=q[vj+Cj>>2],Fj=0;u[(Cj=(Dj=Fj<<2)+Hj|0)>>2]=u[Cj>>2]+x(Mj*u[Dj+Nj>>2]),(0|Ij)!=(0|(Fj=Fj+1|0)););if(!((0|(Bj=Bj+1|0))<(0|Kj)))break}if(Aj=Aj+4|0,Gj=q[(Ej<<2)+Pj>>2]+Gj|0,!((0|(Ej=Ej+1|0))<(0|Jj)))break}else for(Aj=0;;){if(Dj=q[(Ej=Aj<<2)+q[a+16>>2]>>2],Hj=q[xj+Ej>>2],Cj=q[yj+Ej>>2],(Bj=(0|(Ij=w(Cj,zj)))<1)||ca(Hj,0,w(Cj,Oj)),!(Bj|(0|Dj)<=0))for(Kj=Dj+Gj|0,Lj=q[a+20>>2],Bj=Gj;;){for(Mj=u[(Cj=Bj<<2)+Lj>>2],Nj=q[vj+Cj>>2],Fj=0;u[(Cj=(Dj=Fj<<2)+Hj|0)>>2]=u[Cj>>2]+x(Mj*u[Dj+Nj>>2]),(0|Ij)!=(0|(Fj=Fj+1|0)););if(!((0|(Bj=Bj+1|0))<(0|Kj)))break}if(Gj=q[Ej+Pj>>2]+Gj|0,!((0|(Aj=Aj+1|0))<(0|Jj)))break}},n[9]=function(a){var Me,Ne,Oe,Ie=0,Je=0,Ke=0,Le=0;if(!(q[(a|=0)+648>>2]||(0|(Ie=q[a+332>>2]))<1))for(Ne=(Je=q[a+336>>2])+w(Ie,20)|0,Ie=q[a+424>>2],Le=q[a+444>>2];;){if(q[Ie>>2]&&!((0|(Ke=q[Je+16>>2]))<(a=1)))for(Ke<<=1,Oe=q[Le>>2];u[(Me=(a<<2)+Oe|0)>>2]=-u[Me>>2],(0|(a=a+2|0))<(0|Ke););if(Le=Le+4|0,Ie=Ie+4|0,!((Je=Je+20|0)>>>0>>0))break}},n[10]=function(a,Sm,un){var wn;return $(wn=q[20+(a|=0)>>2],Sm|=0,Sm=(un|=0)>>>0<(Sm=q[a+16>>2]-wn|0)>>>0?un:Sm),q[a+20>>2]=Sm+q[a+20>>2],0|un},n[11]=function(a,Il,Rm,Sm,Tm,Um){a|=0,Il=+Il,Rm|=0,Sm|=0,Tm|=0,Um|=0;var fn,qn,Zm,kn,Vm=0,Wm=0,Xm=0,Ym=0,_m=0,$m=0,an=0,bn=0,cn=0,dn=0,en=0,gn=0,hn=0,jn=0,mn=0;if(q[44+(L=Zm=L-560|0)>>2]=0,h(+Il),Vm=0|b[1],qn=4294967295>>0?0:1,kn=(0|Vm)<-1||(0|Vm)<=-1&&qn?(h(Il=-Il),Vm=0|b[1],b[0],jn=1,3840):2048&Tm?(jn=1,3843):(jn=1&Tm)?3846:3841,2146435072==(2146435072&Vm))_(a,32,Rm,$m=jn+3|0,-65537&Tm),Z(a,kn,jn),Sm=Um>>>5&1,Z(a,Il!=Il?Sm?3867:3871:Sm?3859:3863,3);else if(Il=function Ja(a,ic){var kc,lc,jc=0;if(h(+a),jc=0|b[1],kc=0|b[0],2047!=(0|(jc=(lc=jc)>>>20&2047))){if(!jc)return jc=ic,ic=0==a?0:(a=Ja(0x10000000000000000*a,ic),q[ic>>2]+-64|0),q[jc>>2]=ic,a;q[ic>>2]=jc+-1022,f(0,0|kc),f(1,-2146435073&lc|1071644672),a=+g()}return a}(Il,44+Zm|0),0!=(Il+=Il)&&(q[44+Zm>>2]=q[44+Zm>>2]+-1),fn=16+Zm|0,97==(0|(qn=32|Um))){if(en=(dn=32&Um)?9+kn|0:kn,!(11>>0)&&(Vm=12-Sm|0)){for(gn=8;gn*=16,Vm=Vm+-1|0;);Il=45==r[0|en]?-(gn+(-Il-gn)):Il+gn-gn}for((0|fn)==(0|(Vm=ga((Xm=(Vm=q[44+Zm>>2])>>31)^Vm+Xm,0,fn)))&&(o[15+Zm|0]=48,Vm=15+Zm|0),_m=2|jn,Xm=q[44+Zm>>2],o[0|(cn=Vm+-2|0)]=Um+15,o[Vm+-1|0]=(0|Xm)<0?45:43,Vm=8&Tm,Wm=16+Zm|0;Um=Wm,bn=dn,Xm=y(Il)<2147483648?~~Il:-2147483648,o[0|Wm]=bn|r[Xm+3824|0],1!=((Wm=Um+1|0)-(16+Zm|0)|0)|(0==(Il=16*(Il-(0|Xm)))?!(Vm|0<(0|Sm)):0)||(o[Um+1|0]=46,Wm=Um+2|0),0!=Il;);_(a,32,Rm,$m=(Um=!Sm|(0|Sm)<=((Wm-Zm|0)-18|0)?((fn-(16+Zm|0)|0)-cn|0)+Wm|0:2+((Sm+fn|0)-cn|0)|0)+_m|0,Tm),Z(a,en,_m),_(a,48,Rm,$m,65536^Tm),Z(a,16+Zm|0,Sm=Wm-(16+Zm|0)|0),_(a,48,Um-((Vm=Sm)+(Sm=fn-cn|0)|0)|0,0,0),Z(a,cn,Sm)}else{for(Vm=(0|Sm)<0,0==Il?Ym=q[44+Zm>>2]:(Ym=q[44+Zm>>2]+-28|0,q[44+Zm>>2]=Ym,Il*=268435456),an=Vm?6:Sm,Xm=dn=(0|Ym)<0?48+Zm|0:336+Zm|0;Xm=(Sm=Xm)+4|0,0!=(Il=1e9*(Il-((q[Sm>>2]=Vm=Il<4294967296&0<=Il?~~Il>>>0:0)>>>0))););if((0|Ym)<1)Vm=Xm,Wm=dn;else for(Wm=dn;;){if(cn=(0|Ym)<29?Ym:29,!((Vm=Xm+-4|0)>>>0>>0)){for(Sm=cn,bn=0;mn=bn,bn=q[(en=Vm)>>2],_m=31&Sm,_m=32<=(63&Sm)>>>($m=0)?(Ym=bn<<_m,0):(Ym=(1<<_m)-1&bn>>>32-_m,bn<<_m),$m=Ym+$m|0,$m=(bn=mn+_m|0)>>>0<_m>>>0?$m+1|0:$m,mn=en,en=ad(bn=bd(_m=bn,$m,1e9),M,1e9),q[mn>>2]=_m-en,Wm>>>0<=(Vm=Vm+-4|0)>>>0;);(Sm=bn)&&(q[(Wm=Wm+-4|0)>>2]=Sm)}for(;Wm>>>0<(Vm=Xm)>>>0&&!q[(Xm=Vm+-4|0)>>2];);if(Ym=q[44+Zm>>2]-cn|0,Xm=Vm,!(0<(0|(q[44+Zm>>2]=Ym))))break}if((0|Ym)<=-1)for(hn=1+((an+25|0)/9|0)|0,cn=102==(0|qn);;){if(bn=(0|Ym)<-9?9:0-Ym|0,Vm>>>0<=Wm>>>0)Wm=q[Wm>>2]?Wm:Wm+4|0;else{for(en=1e9>>>bn,_m=-1<>2],q[Xm>>2]=(Sm>>>bn)+Ym,Ym=w(en,Sm&_m),(Xm=Xm+4|0)>>>0>>0;);Wm=q[Wm>>2]?Wm:Wm+4|0,Ym&&(q[Vm>>2]=Ym,Vm=Vm+4|0)}if(Ym=bn+q[44+Zm>>2]|0,Vm=(0|hn)>2?Sm+(hn<<2)|0:Vm,!((0|(q[44+Zm>>2]=Ym))<0))break}if(!(Vm>>>(Xm=0)<=Wm>>>0||(Xm=w(dn-Wm>>2,9),(Sm=q[Wm>>2])>>>0<(Ym=10))))for(;Xm=Xm+1|0,(Ym=w(Ym,10))>>>0<=Sm>>>0;);if((0|(Sm=(an-(102==(0|qn)?0:Xm)|0)-(103==(0|qn)&0!=(0|an))|0))<(w(Vm-dn>>2,9)+-9|0)){if($m=(dn+((Sm=(0|(_m=Sm+9216|0))/9|0)<<2)|0)-4092|0,Ym=10,(0|(Sm=1+(_m-w(Sm,9)|0)|0))<=8)for(;Ym=w(Ym,10),9!=(0|(Sm=Sm+1|0)););if(hn=$m+4|0,((cn=(en=q[$m>>2])-w(Ym,_m=(en>>>0)/(Ym>>>0)|0)|0)||(0|hn)!=(0|Vm))&&(gn=cn>>>0<(Sm=Ym>>>1)>>>0?.5:(0|Vm)==(0|hn)&&(0|Sm)==(0|cn)?1:1.5,Il=1&_m?9007199254740994:9007199254740992,!jn|45!=r[0|kn]||(gn=-gn,Il=-Il),q[$m>>2]=Sm=en-cn|0,Il+gn!=Il)){if(1e9<=(q[$m>>2]=Sm=Sm+Ym|0)>>>0)for(;($m=$m+-4|(q[$m>>2]=0))>>>0>>0&&(q[(Wm=Wm+-4|0)>>2]=0),Sm=q[$m>>2]+1|0,999999999<(q[$m>>2]=Sm)>>>0;);if(Xm=w(dn-Wm>>2,9),!((Sm=q[Wm>>2])>>>0<(Ym=10)))for(;Xm=Xm+1|0,(Ym=w(Ym,10))>>>0<=Sm>>>0;);}Vm=(Sm=$m+4|0)>>>0>>0?Sm:Vm}j:{for(;;){if((cn=Vm)>>>(en=0)<=Wm>>>0)break j;if(q[(Vm=cn+-4|0)>>2])break}en=1}if(103!=(0|qn))_m=8&Tm;else if(an=((Sm=(0|Xm)<(0|(Vm=an||1))&-5<(0|Xm))?-1^Xm:-1)+Vm|0,Um=(Sm?-1:-2)+Um|0,!(_m=8&Tm)){if(Vm=9,en&&(_m=q[cn+-4>>2])&&!((_m>>>(Vm=0))%(Sm=10)))for(;Vm=Vm+1|0,!((_m>>>0)%((Sm=w(Sm,10))>>>0)););Sm=w(cn-dn>>2,9)+-9|0,an=102==(32|Um)?((_m=0)|an)<(0|(Sm=0<(0|(Sm=Sm-Vm|0))?Sm:0))?an:Sm:((_m=0)|an)<(0|(Sm=0<(0|(Sm=(Sm+Xm|0)-Vm|0))?Sm:0))?an:Sm}if($m=0!=(0|(Ym=an|_m)),Sm=a,mn=Rm,Vm=0<(0|Xm)?Xm:0,102!=(0|(bn=32|Um))){if((fn-(Vm=ga((Vm=Xm>>31)+Xm^Vm,0,fn))|0)<=1)for(;o[0|(Vm=Vm+-1|0)]=48,(fn-Vm|0)<2;);o[0|(hn=Vm+-2|0)]=Um,o[Vm+-1|0]=(0|Xm)<0?45:43,Vm=fn-hn|0}if(_(Sm,32,mn,$m=1+(Vm+($m+(an+jn|0)|0)|0)|0,Tm),Z(a,kn,jn),_(a,48,Rm,$m,65536^Tm),102==(0|bn)){for(Sm=16+Zm|8,Xm=16+Zm|9,Wm=Um=dn>>>0>>0?dn:Wm;;){if(Vm=ga(q[Wm>>2],0,Xm),(0|Um)!=(0|Wm)){if(!(Vm>>>0<=16+Zm>>>0))for(;o[0|(Vm=Vm+-1|0)]=48,16+Zm>>>0>>0;);}else(0|Vm)==(0|Xm)&&(o[24+Zm|0]=48,Vm=Sm);if(Z(a,Vm,Xm-Vm|0),!((Wm=Wm+4|0)>>>0<=dn>>>0))break}Ym&&Z(a,3875,1);p:if(!((0|an)<1|cn>>>0<=Wm>>>0))for(;;){if(16+Zm>>>0<(Vm=ga(q[Wm>>2],0,Xm))>>>0)for(;o[0|(Vm=Vm+-1|0)]=48,16+Zm>>>0>>0;);if(Z(a,Vm,(0|an)<9?an:9),an=an+-9|0,cn>>>0<=(Wm=Wm+4|0)>>>0)break p;if(!(0<(0|an)))break}_(a,48,an+9|0,9,0)}else{q:if(!((0|an)<0))for(Um=en?cn:Wm+4|0,Sm=16+Zm|8,dn=16+Zm|9,Xm=Wm;;){if((0|dn)==(0|(Vm=ga(q[Xm>>2],0,dn)))&&(o[24+Zm|0]=48,Vm=Sm),(0|Wm)!=(0|Xm)){if(!(Vm>>>0<=16+Zm>>>0))for(;o[0|(Vm=Vm+-1|0)]=48,16+Zm>>>0>>0;);}else Z(a,Vm,1),Vm=Vm+1|0,(0|an)<1&&!_m||Z(a,3875,1);if(Z(a,bn=Vm,(0|(Vm=dn-Vm|0))<(0|an)?Vm:an),an=an-Vm|0,Um>>>0<=(Xm=Xm+4|0)>>>0)break q;if(!(-1<(0|an)))break}_(a,48,an+18|0,18,0),Z(a,hn,fn-hn|0)}}return _(a,32,Rm,$m,8192^Tm),L=560+Zm|0,0|((0|$m)<(0|Rm)?Rm:$m)},n[12]=function(a,Il){a|=0;var tm=Il|=0;Il=q[Il>>2]+15&-16,q[tm>>2]=Il+16,tm=a,a=function(a,Il,Jl,tm){var zm,wm,um=0,vm=0,xm=0,ym=0;return L=wm=L-32|0,um=(ym=um=2147483647&tm)-1006698496|0,vm=um=(zm=vm=xm=Jl)>>>0<0?um+1|0:um,um=ym-1140785152|0,(0|(um=xm>>>0<0?um+1|0:um))==(0|vm)&zm>>>0>>0|vm>>>0>>0?(um=tm<<4|Jl>>>28,Jl=Jl<<4|Il>>>28,134217728==(0|(xm=Il&=268435455))&1<=a>>>0|134217728>>0?(um=um+1073741824|0,(a=Jl+1|0)>>>0<1&&(um=um+1|0),vm=a):(um=um-(((vm=Jl)>>>0<0)+-1073741824|0)|0,a|134217728^xm||((a=vm+(1&vm)|0)>>>0>>0&&(um=um+1|0),vm=a))):(!xm&2147418112==(0|ym)?!(a|Il):2147418112==(0|ym)&xm>>>0<0|ym>>>0<2147418112)?(um=2146435072,1140785151==((vm=0)|ym)&4294967295>>0|1140785151>>0||(xm=ym>>>16)>>>(um=0)<15249||(function(a,Il,Jl,tm,Bm,Cm){var Jm,Km,Hm=0,Im=0;64&Cm?(Il=31&(Jl=Cm-64|0),Il=32<=(63&Jl)>>>0?(Jl=0,Bm>>>Il):(Jl=Bm>>>Il,((1<>>Il),Bm=tm=0):Cm&&(Im=Bm,Hm=31&(Km=64-Cm|0),Km=32<=(63&Km)>>>0?(Im=tm<>>32-Hm|Im<>>0?(Hm=0,Jl>>>Il):(Hm=Jl>>>Il,((1<>>Il),Il|=Km,Jl=Hm|Im,Hm=tm,tm=31&Cm,tm=32<=(63&Cm)>>>0?(Im=0,Bm>>>tm):(Im=Bm>>>tm,((1<>>tm),Bm=Im),q[a>>2]=Il,q[4+a>>2]=Jl,q[8+a>>2]=tm,q[12+a>>2]=Bm}(wm,a,Il,Jl,um=65535&tm|65536,15361-xm|0),function(a,Il,Jl,tm,Bm,Cm){var Fm,Dm,Em=0;64&Cm?(tm=Il,Il=31&(Bm=Cm+-64|0),32<=(63&Bm)>>>0?(Bm=tm<>>32-Il|Jl<>>0?(Em=Dm<>>32-tm|Bm<>>0?(Cm=0,tm>>>=Bm):(Cm=tm>>>Bm,tm=((1<>>Bm),tm|=Dm,Bm=Cm|Em,Cm=Il,Il=31&Fm,Il=32<=(63&Fm)>>>0?(Em=Cm<>>32-Il|Jl<>2]=Il,q[4+a>>2]=Jl,q[8+a>>2]=tm,q[12+a>>2]=Bm}(16+wm|0,a,Il,Jl,um,xm+-15233|0),Jl=q[4+wm>>2],a=q[8+wm>>2],um=q[12+wm>>2]<<4|a>>>28,vm=a<<4|Jl>>>28,134217728==(0|(Jl=a=268435455&Jl))&1<=(Il=q[wm>>2]|(0!=(q[16+wm>>2]|q[24+wm>>2])|0!=(q[20+wm>>2]|q[28+wm>>2])))>>>0|134217728>>0?((a=vm+1|0)>>>0<1&&(um=um+1|0),vm=a):Il|134217728^Jl||((a=vm+(1&vm)|0)>>>0>>0&&(um=um+1|0),vm=a))):(vm=Jl<<4|Il>>>28,um=524287&(um=tm<<4|Jl>>>28)|2146959360),L=32+wm|0,f(0,0|vm),f(1,-2147483648&tm|um),+g()}(q[Il>>2],q[Il+4>>2],q[Il+8>>2],q[Il+12>>2]),v[tm>>3]=a},n[13]=function(a){return 0},n[14]=function(a,Il,tm){Il|=0,tm|=0;var Om,Cm,Bm=0,Lm=0,Mm=0,Nm=0;for(L=Cm=L-32|0,Bm=q[28+(a|=0)>>2],q[16+Cm>>2]=Bm,Mm=q[a+20>>2],q[28+Cm>>2]=tm,q[24+Cm>>2]=Il,Mm=(q[20+Cm>>2]=Il=Mm-Bm|0)+tm|0,Nm=2,Il=16+Cm|0;;){a:{if((Lm=(Bm=0)|K(q[a+60>>2],0|Il,0|Nm,12+Cm|0))&&(q[2086]=Lm,Bm=-1),(0|(Bm=Bm?q[12+Cm>>2]=-1:q[12+Cm>>2]))==(0|Mm))Il=q[a+44>>2],q[a+28>>2]=Il,q[a+20>>2]=Il,q[a+16>>2]=Il+q[a+48>>2],a=tm;else{if(-1<(0|Bm))break a;q[a+28>>2]=0,q[a+16>>2]=0,q[a+20>>2]=0,q[a>>2]=32|q[a>>2],2!=((a=0)|Nm)&&(a=tm-q[Il+4>>2]|0)}return L=32+Cm|0,0|a}Lm=q[Il+4>>2],q[(Il=(Om=Lm>>>0>>0)?Il+8|0:Il)>>2]=(Lm=Bm-(Om?Lm:0)|0)+q[Il>>2],q[Il+4>>2]=q[Il+4>>2]-Lm,Mm=Mm-Bm|0,Nm=Nm-Om|0}},n[15]=function(a,Il,tm,Bm){return M=0},{d:function(){},e:function(){return 83886080},f:function(){return 5},g:function(a,vj){return vj|=0,L=vj=L-16|0,a=(a|=0)?sa(a)?(Y(4,2150,0),0):r[a+4|0]:(q[vj+4>>2]=1444,q[vj>>2]=2267,Y(4,1294,vj),0),L=vj+16|0,0|a},h:function(a,vj){var wj;return vj|=0,L=wj=L-48|0,a=(a|=0)?(a+63&-64)!=(0|a)?(q[36+wj>>2]=1522,q[32+wj>>2]=2284,Y(4,1294,32+wj|0),0):(vj+63&-64)==(0|vj)&&vj?function(a,Vk){var pl,Wk=0,Xk=0,Yk=0,Zk=0,_k=0,$k=0,al=0,bl=0,cl=0,dl=0,el=0,fl=0,gl=0,hl=0,il=0,jl=0,kl=0,ll=0,ml=0,nl=0,ol=0;L=_k=(pl=Xk=L)-704&-64;a:if(Vk>>>0<=1343)Y(4,1235,0);else if(sa(a))Y(4,1469,0);else if(Xk=r[0|(nl=a+4|0)]){if(!(6<=Xk>>>0)){(jl=1==(0|!r[a+5|0]))||(da(nl,1),X(a- -64|0,4,160)),ca(_k- -64|0,0,640),na(a,_k- -64|0),Xk=a+Vk|0,Vk=q[_k+64>>2];b:{c:{d:{if(5<=(il=r[a+4|0])>>>0){if(Vk>>>0>>0|Xk>>>0>>0)break c;if((Zk=Vk+256|0)>>>0>>0)break c;if(Zk>>>0<=Xk>>>0)break d;break c}if(Vk>>>0>>0|Xk>>>0>>0)break c;if((Zk=Vk+128|0)>>>0>>0|Xk>>>0>>0)break c}if(!((Yk=q[_k+68>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Yk=Yk- -64|0)>>>0>>0|Xk>>>0>>0||(0|(dl=q[Vk>>2]))<0||(Zk=q[_k+72>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=(Wk=Zk)+(Zk=dl<<2)|0)>>>0>>0|Xk>>>0>>0||(al=q[_k+76>>2])>>>0>>0|Xk>>>0>>0|al>>>0>>0||(Wk=(dl<<6)+al|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+80>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+84>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+88>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+92>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+96>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+100>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Yk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(0|(Wk=q[Vk+4>>2]))<0||(Zk=q[_k+104>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||($k=(Yk=Zk)+(Zk=Wk<<2)|0)>>>0>>0|Xk>>>0<$k>>>0||(Yk=q[_k+108>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0<$k>>>0||(Wk=Yk+(Wk<<6)|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+112>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+116>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+120>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+124>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+128>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+132>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+136>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Yk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(0|(Wk=q[Vk+8>>2]))<0||(Zk=q[_k+140>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=(el=Wk<<2)+Zk|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+144>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Zk+el|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+148>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Zk+el|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+156>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Zk+el|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+160>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Zk+el|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+164>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Zk+el|0)>>>0>>0|Xk>>>0>>0||(0|(Wk=q[Vk+12>>2]))<0||(Zk=q[_k+172>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=(fl=Wk<<2)+Zk|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+176>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Zk+fl|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+180>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Zk+fl|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+188>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Wk=Zk+fl|0)>>>0>>0|Xk>>>0>>0||(0|(Yk=q[Vk+16>>2]))<0||(Zk=q[_k+192>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||($k=(Wk=Zk)+(Zk=Yk<<2)|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+196>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Zk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+200>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Zk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+204>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Zk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+208>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+(Yk<<6)|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+212>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Zk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+216>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Zk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+220>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Zk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+228>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Zk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+232>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Zk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+236>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Zk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+240>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Zk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+244>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Zk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+248>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||(Wk=Wk+Yk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+252>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+256>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+260>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+264>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+268>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+272>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(0|($k=q[Vk+20>>2]))<0||(Yk=q[_k+276>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(gl=(Wk=Yk)+(Yk=$k<<2)|0)>>>0>>0|Xk>>>0>>0||(Wk=q[_k+280>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||($k=Wk+($k<<6)|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+284>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Yk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+288>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Yk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+292>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Yk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+296>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Yk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+300>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Yk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+308>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Yk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+312>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Yk|0)>>>0>>0|Xk>>>0<$k>>>0||(0|(gl=q[Vk+24>>2]))<0||(Wk=q[_k+336>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+(gl<<2)|0)>>>0>>0|Xk>>>0<$k>>>0||(0|(gl=q[Vk+28>>2]))<0||(Wk=q[_k+340>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=(ll=gl<<2)+Wk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+344>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+ll|0)>>>0>>0|Xk>>>0<$k>>>0||(0|(gl=q[Vk+32>>2]))<0||(Wk=q[_k+356>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||(gl=($k=gl<<2)+Wk|0)>>>0>>0|Xk>>>0>>0||(Wk=q[_k+360>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(gl=Wk+$k|0)>>>0>>0|Xk>>>0>>0||(Wk=q[_k+364>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(gl=Wk+$k|0)>>>0>>0|Xk>>>0>>0||(Wk=q[_k+368>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(gl=Wk+$k|0)>>>0>>0|Xk>>>0>>0||(Wk=q[_k+372>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(gl=Wk+$k|0)>>>0>>0|Xk>>>0>>0||(Wk=q[_k+376>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(gl=Wk+$k|0)>>>0>>0|Xk>>>0>>0||(Wk=q[_k+380>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(gl=Wk+$k|0)>>>0>>0|Xk>>>0>>0||(0|(bl=q[Vk+36>>2]))<0||(Wk=q[_k+392>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=(gl=bl<<2)+Wk|0)>>>0>>0|Xk>>>0>>0||(Wk=q[_k+396>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=Wk+gl|0)>>>0>>0|Xk>>>0>>0||(Wk=q[_k+400>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=Wk+gl|0)>>>0>>0|Xk>>>0>>0||(0|(cl=q[Vk+40>>2]))<0||(Wk=q[_k+412>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=Wk+(cl<<2)|0)>>>0>>0|Xk>>>0>>0||(0|(cl=q[Vk+44>>2]))<0||(Wk=q[_k+424>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=Wk+(cl<<2)|0)>>>0>>0|Xk>>>0>>0||(0|(cl=q[Vk+48>>2]))<0||(Wk=q[_k+428>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=(cl<<=2)+Wk|0)>>>0>>0|Xk>>>0>>0||(Wk=q[_k+432>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=Wk+cl|0)>>>0>>0|Xk>>>0>>0||(0|(cl=q[Vk+52>>2]))<0||(Wk=q[_k+416>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=(cl<<=2)+Wk|0)>>>0>>0|Xk>>>0>>0||(Wk=q[_k+420>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=Wk+cl|0)>>>0>>0|Xk>>>0>>0||(0|(cl=q[Vk+56>>2]))<0||(Wk=q[_k+552>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=Wk+(cl<<2)|0)>>>0>>0|Xk>>>0>>0||(0|(cl=q[Vk+60>>2]))<0||(Wk=q[_k+556>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=Wk+(cl<<2)|0)>>>0>>0|Xk>>>0>>0||(0|(cl=q[Vk+64>>2]))<0||(Wk=q[_k+560>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=Wk+(cl<<1)|0)>>>0>>0|Xk>>>0>>0||(0|(cl=q[Vk+68>>2]))<0||(Wk=q[_k+564>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=Wk+(cl<<2)|0)>>>0>>0|Xk>>>0>>0||(0|(cl=q[Vk+72>>2]))<0||(Wk=q[_k+568>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(cl=(bl=Wk)+(Wk=cl<<2)|0)>>>0>>0|Xk>>>0>>0||(bl=q[_k+572>>2])>>>0>>0|Xk>>>0>>0|bl>>>0>>0||(cl=Wk+bl|0)>>>0>>0|Xk>>>0>>0||(bl=q[_k+576>>2])>>>0>>0|Xk>>>0>>0|bl>>>0>>0||(cl=Wk+bl|0)>>>0>>0|Xk>>>0>>0||(bl=q[_k+580>>2])>>>0>>0|Xk>>>0>>0|bl>>>0>>0||(cl=Wk+bl|0)>>>0>>0|Xk>>>0>>0||(bl=q[_k+584>>2])>>>0>>0|Xk>>>0>>0|bl>>>0>>0||(bl=Wk+bl|0)>>>0>>0|Xk>>>0>>0||(0|(cl=q[Vk+76>>2]))<0||(Wk=q[_k+588>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(cl=(bl=cl<<2)+Wk|0)>>>0>>0|Xk>>>0>>0||(Wk=q[_k+592>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(cl=Wk+bl|0)>>>0>>0|Xk>>>0>>0||(Wk=q[_k+596>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=Wk+bl|0)>>>0>>0|Xk>>>0>>0||(0|(cl=q[Vk+80>>2]))<0||(Wk=q[_k+600>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(hl=(bl=Wk)+(Wk=cl<<2)|0)>>>0>>0|Xk>>>0>>0||(bl=q[_k+604>>2])>>>0>>0|Xk>>>0>>0|bl>>>0>>0||(cl=bl+(cl<<6)|0)>>>0>>0|Xk>>>0>>0||(bl=q[_k+608>>2])>>>0>>0|Xk>>>0>>0|bl>>>0>>0||(cl=Wk+bl|0)>>>0>>0|Xk>>>0>>0||(bl=q[_k+612>>2])>>>0>>0|Xk>>>0>>0|bl>>>0>>0||(cl=Wk+bl|0)>>>0>>0|Xk>>>0>>0||(bl=q[_k+616>>2])>>>0>>0|Xk>>>0>>0|bl>>>0>>0||(cl=Wk+bl|0)>>>0>>0|Xk>>>0>>0||(bl=q[_k+620>>2])>>>0>>0|Xk>>>0>>0|bl>>>0>>0||(cl=Wk+bl|0)>>>0>>0|Xk>>>0>>0||(bl=q[_k+624>>2])>>>0>>0|Xk>>>0>>0|bl>>>0>>0||(cl=Wk+bl|0)>>>0>>0|Xk>>>0>>0||(bl=q[_k+628>>2])>>>0>>0|Xk>>>0>>0|bl>>>0>>0||(cl=Wk+bl|0)>>>0>>0|Xk>>>0>>0||(bl=q[_k+632>>2])>>>0>>0|Xk>>>0>>0|bl>>>0>>0||(bl=Wk+bl|0)>>>0>>0|Xk>>>0>>0||(0|(cl=q[Vk+84>>2]))<0||(Wk=q[_k+636>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=Wk+(cl<<2)|0)>>>0>>0|Xk>>>0>>0||(Wk=q[_k+640>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=Wk+(cl<<1)|0)>>>0>>0|Xk>>>0>>0||(0|(cl=q[Vk+88>>2]))<0||(Wk=q[_k+644>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(Wk=Wk+(cl<<2)|0)>>>0>>0|Xk>>>0>>0)){if(!(il>>>0<2)){if((bl=q[_k+168>>2])>>>0>>0|Xk>>>0>>0|bl>>>0>>0)break c;if((Wk=bl+el|0)>>>0>>0|Xk>>>0>>0)break c;if(!(il>>>0<4)){if((bl=q[_k+324>>2])>>>0>>0|Xk>>>0>>0|bl>>>0>>0)break c;if((bl=Yk+bl|0)>>>0>>0|Xk>>>0>>0)break c;if((Wk=q[_k+328>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0)break c;if((bl=Wk+Yk|0)>>>0>>0|Xk>>>0>>0)break c;if((Wk=q[_k+332>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0)break c;if((bl=Wk+Yk|0)>>>0>>0|Xk>>>0>>0)break c;if((Wk=q[_k+152>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0)break c;if((el=Wk+el|0)>>>0>>0|Xk>>>0>>0)break c;if((Wk=q[_k+184>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0)break c;if((el=Wk+fl|0)>>>0>>0|Xk>>>0>>0)break c;if((Wk=q[_k+224>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0)break c;if((Wk=Wk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((0|(el=q[Vk+92>>2]))<0)break c;if((Zk=q[_k+648>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((el=(Wk=el<<2)+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+652>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((el=Wk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+656>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Wk=Wk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((0|(el=q[Vk+96>>2]))<0)break c;if((Zk=q[_k+660>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((el=(Wk=el<<2)+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+664>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((el=Wk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+668>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Wk=Wk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+304>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+316>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+320>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Yk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((0|(Wk=q[Vk+100>>2]))<0)break c;if((Zk=q[_k+436>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Wk=(Yk=Wk<<2)+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+440>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+444>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Yk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((0|(Wk=q[Vk+104>>2]))<0)break c;if((Zk=q[_k+448>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Wk=(Yk=Zk)+(Zk=Wk<<2)|0)>>>0>>0|Xk>>>0>>0)break c;if((Yk=q[_k+452>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0)break c;if((Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Yk=q[_k+456>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0)break c;if((Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Yk=q[_k+460>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0)break c;if((Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Yk=q[_k+464>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0)break c;if((Yk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((0|(Wk=q[Vk+108>>2]))<0)break c;if((Zk=q[_k+480>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Wk=(Yk=Wk<<2)+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+484>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+488>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Yk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((0|(Wk=q[Vk+112>>2]))<0)break c;if((Zk=q[_k+504>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Wk=(Yk=Wk<<2)+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+508>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+512>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Yk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((0|(Wk=q[Vk+116>>2]))<0)break c;if((Zk=q[_k+528>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Yk=Zk+(Wk<<2)|0)>>>0>>0|Xk>>>0>>0)break c;if((0|(Wk=q[Vk+120>>2]))<0)break c;if((Zk=q[_k+532>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Wk=(Yk=Wk<<2)+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+536>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+540>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Yk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((0|(Wk=q[Vk+124>>2]))<0)break c;if((Zk=q[_k+544>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Yk=(Wk<<=2)+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+548>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Wk=Wk+Zk|0)>>>0>>0|Xk>>>0>>0)break c}}if(il>>>0<5)break b;if(!((Zk=q[_k+348>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Zk+ll|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+352>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Zk+ll|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+384>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Zk+$k|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+388>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Zk+$k|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+404>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Zk+gl|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+408>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Zk+gl|0)>>>0>>0|Xk>>>0>>0||(0|(Wk=q[Vk+128>>2]))<0||(Zk=q[_k+468>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Wk=(Yk=Wk<<2)+Zk|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+472>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+476>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(0|(Wk=q[Vk+132>>2]))<0||(Zk=q[_k+492>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Wk=(Yk=Wk<<2)+Zk|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+496>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+500>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(0|(Wk=q[Vk+136>>2]))<0||(Zk=q[_k+516>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Wk=(Yk=Wk<<2)+Zk|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+520>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+524>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Zk=Yk+Zk|0)>>>0>>0)&&Zk>>>0<=Xk>>>0)break b}}Y(4,1760,0),da(nl,1),X(a- -64|0,4,160);break a}jl||(ya(a),o[a+5|0]=0,Vk=q[_k+64>>2],dl=q[Vk>>2],al=q[_k+76>>2],il=r[a+4|0]);f:{if((a=0)<(0|dl)){for(;;){if(63>>0)break f;if((0|dl)==(0|(a=a+1|0)))break}if(Wk=Vk+48|0,(Xk=0)<(0|(a=q[Vk>>2]))){for(Zk=q[Vk+48>>2],Yk=q[_k+80>>2];;){if((0|(al=q[Yk+(Xk<<2)>>2]))<0|(0|Zk)<=(0|al))break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(gl=Vk+24|0,Zk=q[Vk+24>>2],$k=q[_k+88>>2],dl=q[_k+84>>2],Xk=0;;){if(Yk=q[(al=Xk<<2)+$k>>2]){if((0|Yk)<0|(0|Zk)<(0|Yk))break f;if((0|(al=q[al+dl>>2]))<0|(0|Zk)<=(0|al))break f;if((Yk=Yk+al|0)>>>31|(0|Zk)<(0|Yk))break f}if((0|a)==(0|(Xk=Xk+1|0)))break}for(Xk=0,Zk=q[_k+92>>2];;){if(1>2])break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Xk=0,Zk=q[_k+96>>2];;){if(1>2])break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Xk=0,Zk=q[_k+100>>2];;){if((0|(Yk=q[Zk+(Xk<<2)>>2]))<-1|(0|a)<=(0|Yk))break f;if((0|a)==(0|(Xk=Xk+1|0)))break}}else gl=Vk+24|0}else gl=Vk+24|0,Wk=Vk+48|0;if((a=0)<(0|(Xk=q[Vk+4>>2]))){for(Zk=q[_k+108>>2];;){if(63>>0)break f;if((0|Xk)==(0|(a=a+1|0)))break}if($k=(Zk=q[Vk+48>>2])+-1|0,!(((Xk=0)|(a=q[Vk+4>>2]))<=0)){for(Yk=q[_k+112>>2];;){if((0|(al=q[Yk+(Xk<<2)>>2]))<0|(0|Zk)<=(0|al))break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Xk=0,Zk=q[_k+116>>2];;){if(1>2])break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Xk=0,Zk=q[_k+120>>2];;){if(1>2])break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Zk=q[Vk>>2],Xk=0,Yk=q[_k+124>>2];;){if((0|(al=q[Yk+(Xk<<2)>>2]))<-1|(0|Zk)<=(0|al))break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Xk=0,Zk=q[_k+128>>2];;){if((0|(Yk=q[Zk+(Xk<<2)>>2]))<-1|(0|a)<=(0|Yk))break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Xk=0,Zk=q[_k+132>>2];;){if(1>2])break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Yk=Vk+8|0,al=Vk+12|0,dl=q[_k+136>>2],Xk=0;;){if(1<(fl=q[(el=Xk<<2)+Zk>>2])>>>0)break f;if((0|(el=q[dl+el>>2]))<0|(0|el)>=q[(fl-1|0?Yk:al)>>2])break f;if((0|a)==(0|(Xk=Xk+1|0)))break}}}else $k=q[Wk>>2]+-1|0;if((a=0)<(0|(Xk=q[Vk+8>>2]))){for(Zk=q[_k+140>>2];;){if((0|(Yk=q[Zk+(a<<2)>>2]))<0|(0|$k)<(0|Yk))break f;if((0|Xk)==(0|(a=a+1|0)))break}for(ll=Vk+28|0,Zk=q[Vk+28>>2],dl=q[_k+148>>2],el=q[_k+144>>2],a=0;;){if(Yk=q[(al=a<<2)+dl>>2]){if((0|Yk)<0|(0|Zk)<(0|Yk))break f;if((0|(al=q[al+el>>2]))<0|(0|Zk)<=(0|al))break f;if((Yk=Yk+al|0)>>>31|(0|Zk)<(0|Yk))break f}if((0|Xk)==(0|(a=a+1|0)))break}for(a=0,Yk=q[_k+156>>2],al=q[_k+164>>2],dl=q[_k+160>>2];;){if((0|(el=q[(Zk=a<<2)+dl>>2]))<1)break f;if((0|(fl=q[Zk+al>>2]))<1)break f;if((0|(Zk=q[Yk+Zk>>2]))<1|(0|Zk)!=(0|w(fl+1|0,el+1|0)))break f;if((0|Xk)==(0|(a=a+1|0)))break}}else ll=Vk+28|0;if((a=0)<(0|(Yk=q[Vk+12>>2]))){for(Xk=q[_k+172>>2];;){if((0|(Zk=q[Xk+(a<<2)>>2]))<0|(0|$k)<(0|Zk))break f;if((0|Yk)==(0|(a=a+1|0)))break}for(bl=Vk+32|0,Xk=q[Vk+32>>2],$k=q[_k+180>>2],dl=q[_k+176>>2],a=0;;){if(Zk=q[(al=a<<2)+$k>>2]){if((0|Zk)<0|(0|Xk)<(0|Zk))break f;if((0|(al=q[al+dl>>2]))<0|(0|Xk)<=(0|al))break f;if((Zk=Zk+al|0)>>>31|(0|Xk)<(0|Zk))break f}if((0|Yk)==(0|(a=a+1|0)))break}}else bl=Vk+32|0;Zk=Vk+16|0;m:{n:{if(!(((a=0)|(Xk=q[Vk+16>>2]))<=0)){for(Yk=q[_k+208>>2];;){if(63>>0)break f;if((0|Xk)==(0|(a=a+1|0)))break}if(!(((Xk=0)|(a=q[Zk>>2]))<=0)){for(Yk=q[Wk>>2],al=q[_k+212>>2];;){if((0|($k=q[al+(Xk<<2)>>2]))<0|(0|Yk)<=(0|$k))break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(nl=Vk+36|0,Yk=q[Vk+36>>2],dl=q[_k+220>>2],el=q[_k+216>>2],Xk=0;;){if(al=q[($k=Xk<<2)+dl>>2]){if((0|al)<0|(0|Yk)<(0|al))break f;if((0|($k=q[$k+el>>2]))<0|(0|Yk)<=(0|$k))break f;if((al=al+$k|0)>>>31|(0|Yk)<(0|al))break f}if((0|a)==(0|(Xk=Xk+1|0)))break}for(Xk=0,Yk=q[_k+228>>2];;){if(1>2])break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Xk=0,Yk=q[_k+232>>2];;){if(1>2])break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Yk=q[Vk>>2],Xk=0,al=q[_k+236>>2];;){if((0|($k=q[al+(Xk<<2)>>2]))<-1|(0|Yk)<=(0|$k))break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Yk=q[Vk+4>>2],Xk=0,al=q[_k+240>>2];;){if((0|($k=q[al+(Xk<<2)>>2]))<-1|(0|Yk)<=(0|$k))break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Yk=q[_k+244>>2],Xk=0;;){if(q[Yk+(Xk<<2)>>2]<0)break f;if((0|a)==(0|(Xk=Xk+1|0)))break}break n}}al=Vk+68|0,nl=Vk+36|0;break m}for(Yk=q[_k+252>>2],Xk=0;;){if(q[Yk+(Xk<<2)>>2]<0)break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(al=q[Vk+60>>2],Xk=0,$k=q[_k+256>>2];;){if((dl=q[(dl=Xk<<2)+$k>>2]+(q[Yk+dl>>2]<<1)|0)>>>31|(0|al)<(0|dl))break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Yk=q[Vk+64>>2],dl=q[_k+264>>2],el=q[_k+260>>2],Xk=0;;){if(al=q[($k=Xk<<2)+dl>>2]){if((0|al)<0|(0|Yk)<(0|al))break f;if((0|($k=q[$k+el>>2]))<0|(0|Yk)<=(0|$k))break f;if((al=al+$k|0)>>>31|(0|Yk)<(0|al))break f}if((0|a)==(0|(Xk=Xk+1|0)))break}for(al=Vk+68|0,Yk=q[Vk+68>>2],el=q[_k+272>>2],fl=q[_k+268>>2],Xk=0;;){if($k=q[(dl=Xk<<2)+el>>2]){if((0|$k)<0|(0|Yk)<(0|$k))break f;if((0|(dl=q[dl+fl>>2]))<0|(0|Yk)<=(0|dl))break f;if(($k=$k+dl|0)>>>31|(0|Yk)<(0|$k))break f}if((0|a)==(0|(Xk=Xk+1|0)))break}}p:{q:{if(!(((a=0)|(Xk=q[Vk+20>>2]))<=0)){for(Yk=q[_k+280>>2];;){if(63>>0)break f;if((0|Xk)==(0|(a=a+1|0)))break}if(!(((a=0)|(Xk=q[Vk+20>>2]))<=0)){for(Yk=q[_k+296>>2];;){if(1>2])break f;if((0|Xk)==(0|(a=a+1|0)))break}for(Yk=q[_k+300>>2],a=0;;){if(q[Yk+(a<<2)>>2]<0)break f;if((0|Xk)==(0|(a=a+1|0)))break}break q}}a=q[Vk+52>>2];break p}for(a=q[Vk+52>>2],el=q[_k+312>>2],fl=q[_k+308>>2],$k=0;;){if(Yk=q[(dl=$k<<2)+el>>2]){if((0|Yk)<0|(0|a)<(0|Yk))break f;if((0|(dl=q[dl+fl>>2]))<0|(0|a)<=(0|dl))break f;if((Yk=Yk+dl|0)>>>31|(0|a)<(0|Yk))break f}if((0|Xk)==(0|($k=$k+1|0)))break}}if(Yk=q[Vk+40>>2],(Xk=0)<(0|($k=q[Vk+8>>2])))for(dl=q[_k+344>>2],el=q[_k+156>>2];;){if((fl=q[(fl=Xk<<2)+dl>>2]+(q[el+fl>>2]<<1)|0)>>>31|(0|Yk)<(0|fl))break f;if((0|$k)==(0|(Xk=Xk+1|0)))break}if((Xk=0)<(0|($k=q[bl>>2]))){for(dl=q[_k+376>>2];;){if(1>2])break f;if((0|$k)==(0|(Xk=Xk+1|0)))break}for(Xk=0,dl=q[_k+380>>2];;){if(1>2])break f;if((0|$k)==(0|(Xk=Xk+1|0)))break}}if((Xk=0)<(0|($k=q[Zk>>2])))for(dl=q[_k+400>>2],el=q[_k+252>>2];;){if((fl=q[(fl=Xk<<2)+dl>>2]+(q[el+fl>>2]<<1)|0)>>>31|(0|Yk)<(0|fl))break f;if((0|$k)==(0|(Xk=Xk+1|0)))break}if((Xk=0)<(0|(Yk=q[Vk+44>>2])))for(dl=q[_k+424>>2];;){if((0|(el=q[dl+(Xk<<2)>>2]))<0|(0|a)<=(0|el))break f;if((0|Yk)==(0|(Xk=Xk+1|0)))break}if(1<=(0|(el=q[Wk>>2])))for(Xk=0,fl=q[_k+432>>2],cl=q[_k+428>>2];;){if(Wk=q[(dl=Xk<<2)+fl>>2]){if((0|Wk)<0|(0|Yk)<(0|Wk))break f;if((0|(dl=q[cl+dl>>2]))<0|(0|Yk)<=(0|dl))break f;if((Wk=Wk+dl|0)>>>31|(0|Yk)<(0|Wk))break f}if((0|el)==(0|(Xk=Xk+1|0)))break}if(1<=(0|a))for(Yk=q[Vk+56>>2],Xk=0,el=q[_k+420>>2],fl=q[_k+416>>2];;){if(Wk=q[(dl=Xk<<2)+el>>2]){if((0|Wk)<0|(0|Yk)<(0|Wk))break f;if((0|(dl=q[dl+fl>>2]))<0|(0|Yk)<=(0|dl))break f;if((Wk=Wk+dl|0)>>>31|(0|Yk)<(0|Wk))break f}if((0|(Xk=Xk+1|0))==(0|a))break}if((a=0)<(0|(Xk=q[al>>2])))for(Yk=q[_k+564>>2];;){if((0|(al=q[Yk+(a<<2)>>2]))<-1|(0|$k)<=(0|al))break f;if((0|Xk)==(0|(a=a+1|0)))break}if(a=q[Vk+76>>2],1<=(0|(al=q[Vk+72>>2])))for(Xk=0,$k=q[_k+572>>2],dl=q[_k+568>>2];;){if(Yk=q[(Wk=Xk<<2)+$k>>2]){if((0|Yk)<0|(0|a)<(0|Yk))break f;if((0|(Wk=q[Wk+dl>>2]))<0|(0|a)<=(0|Wk))break f;if((Yk=Wk+Yk|0)>>>31|(0|a)<(0|Yk))break f}if((0|al)==(0|(Xk=Xk+1|0)))break}if((Xk=0)<(0|a)){for(Yk=q[_k+588>>2];;){if(1>2])break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Wk=q[_k+592>>2],Xk=0;;){if(1<(dl=q[($k=Xk<<2)+Yk>>2])>>>0)break f;if((0|($k=q[Wk+$k>>2]))<0|(0|$k)>=q[(dl-1|0?Zk:Vk)>>2])break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Xk=0,Yk=q[_k+596>>2];;){if((0|(Wk=q[Yk+(Xk<<2)>>2]))<-1|(0|al)<=(0|Wk))break f;if((0|a)==(0|(Xk=Xk+1|0)))break}}s:{if(!(((a=0)|($k=q[Vk+80>>2]))<=0)){for(Xk=q[_k+604>>2];;){if(63>>0)break f;if((0|$k)==(0|(a=a+1|0)))break}if(!(((a=0)|($k=q[Vk+80>>2]))<=0)){for(Xk=q[Vk+48>>2],Yk=q[_k+608>>2];;){if((0|(al=q[Yk+(a<<2)>>2]))<0|(0|Xk)<=(0|al))break f;if((0|$k)==(0|(a=a+1|0)))break}for(el=q[Vk+88>>2],al=q[_k+616>>2],Wk=q[_k+612>>2],a=0;;){if(Xk=q[(Yk=a<<2)+al>>2]){if((0|Xk)<0|(0|el)<(0|Xk))break f;if((0|(Yk=q[Wk+Yk>>2]))<0|(0|el)<=(0|Yk))break f;if((Xk=Xk+Yk|0)>>>31|(0|el)<(0|Xk))break f}if((0|$k)==(0|(a=a+1|0)))break}for(Zk=q[Zk>>2],al=q[_k+620>>2],a=0;;){if((0|(Xk=q[al+(a<<2)>>2]))<0|(0|Zk)<=(0|Xk))break f;if((0|$k)==(0|(a=a+1|0)))break}for(Wk=q[_k+624>>2],a=0;;){if((0|(Xk=q[Wk+(a<<2)>>2]))<0|(0|Zk)<=(0|Xk))break f;if((0|$k)==(0|(a=a+1|0)))break}for(Xk=q[Vk+84>>2],dl=q[_k+632>>2],fl=q[_k+628>>2],a=0;;){if(Yk=q[(cl=a<<2)+dl>>2]){if((0|Yk)<0|(0|Xk)<(0|Yk))break f;if((0|(cl=q[cl+fl>>2]))<0|(0|Xk)<=(0|cl))break f;if((Yk=Yk+cl|0)>>>31|(0|Xk)<(0|Yk))break f}if((0|$k)==(0|(a=a+1|0)))break}for(hl=q[_k+640>>2],Xk=q[_k+252>>2],Yk=0;;){if(0<(0|(jl=q[(a=Yk<<2)+dl>>2])))for(cl=hl+(q[a+fl>>2]<<1)|0,ol=q[Xk+(q[a+Wk>>2]<<2)>>2],kl=q[Xk+(q[a+al>>2]<<2)>>2],a=0;;){if((0|ol)<=s[cl+(2|(ml=a<<1))>>1]|(0|kl)<=s[cl+ml>>1])break f;if(!((0|(a=a+2|0))<(0|jl)))break}if((0|$k)==(0|(Yk=Yk+1|0)))break}break s}}Zk=q[Vk+16>>2],el=q[Vk+88>>2]}if(!((255&il)>>>0<2)){if((a=0)<(0|(dl=q[Vk+8>>2])))for(Xk=q[_k+168>>2];;){if(1>2])break f;if((0|dl)==(0|(a=a+1|0)))break}if(!((255&il)>>>0<4)){if(al=q[Vk+56>>2],1<=(0|(fl=q[Vk+20>>2])))for(Wk=q[_k+332>>2],cl=q[_k+328>>2],a=0;;){if(Xk=q[(Yk=a<<2)+Wk>>2]){if((0|Xk)<0|(0|al)<(0|Xk))break f;if((0|(Yk=q[Yk+cl>>2]))<0|(0|al)<=(0|Yk))break f;if((Xk=Xk+Yk|0)>>>31|(0|al)<(0|Xk))break f}if((0|fl)==(0|(a=a+1|0)))break}if((0|(a=q[Vk+92>>2]))!=q[Vk+96>>2])break f;if(1<=(0|dl))for(cl=q[_k+152>>2],Xk=0,hl=q[_k+148>>2];;){if(Yk=q[(Wk=Xk<<2)+hl>>2]){if((0|Yk)<0|(0|a)<(0|Yk))break f;if((0|(Wk=q[Wk+cl>>2]))<0|(0|a)<=(0|Wk))break f;if((Yk=Wk+Yk|0)>>>31|(0|a)<(0|Yk))break f}if((0|dl)==(0|(Xk=Xk+1|0)))break}if(1<=(0|(ol=q[Vk+12>>2])))for(cl=q[_k+184>>2],Xk=0,hl=q[_k+180>>2];;){if(Yk=q[(Wk=Xk<<2)+hl>>2]){if((0|Yk)<0|(0|a)<(0|Yk))break f;if((0|(Wk=q[Wk+cl>>2]))<0|(0|a)<=(0|Wk))break f;if((Yk=Wk+Yk|0)>>>31|(0|a)<(0|Yk))break f}if((0|ol)==(0|(Xk=Xk+1|0)))break}if(1<=(0|Zk))for(cl=q[_k+224>>2],Xk=0,hl=q[_k+220>>2];;){if(Yk=q[(Wk=Xk<<2)+hl>>2]){if((0|Yk)<0|(0|a)<(0|Yk))break f;if((0|(Wk=q[Wk+cl>>2]))<0|(0|a)<=(0|Wk))break f;if((Yk=Wk+Yk|0)>>>31|(0|a)<(0|Yk))break f}if((0|Zk)==(0|(Xk=Xk+1|0)))break}if((Xk=0)<(0|fl)){for(Yk=q[_k+304>>2];;){if(1>2])break f;if((0|fl)==(0|(Xk=Xk+1|0)))break}for(Yk=q[Vk+100>>2],hl=q[_k+320>>2],jl=q[_k+316>>2],Xk=0;;){if(Wk=q[(cl=Xk<<2)+hl>>2]){if((0|Wk)<0|(0|Yk)<(0|Wk))break f;if((0|(cl=q[cl+jl>>2]))<0|(0|Yk)<=(0|cl))break f;if((Wk=Wk+cl|0)>>>31|(0|Yk)<(0|Wk))break f}if((0|fl)==(0|(Xk=Xk+1|0)))break}}else Yk=q[Vk+100>>2];if(1<=(0|Yk)){for(cl=q[_k+440>>2],Xk=0,jl=q[_k+436>>2];;){if(Wk=q[(hl=Xk<<2)+cl>>2]){if((0|Wk)<0|(0|al)<(0|Wk))break f;if((0|(hl=q[hl+jl>>2]))<0|(0|al)<=(0|hl))break f;if((Wk=Wk+hl|0)>>>31|(0|al)<(0|Wk))break f}if((0|Yk)==(0|(Xk=Xk+1|0)))break}for(al=q[_k+444>>2],Xk=0;;){if((0|(hl=q[(Wk=Xk<<2)+al>>2]))<0|(0|hl)>=q[Wk+cl>>2])break f;if((0|Yk)==(0|(Xk=Xk+1|0)))break}}if((al=0)<(0|(Xk=q[Vk+104>>2]))){for(Wk=q[_k+448>>2];;){if((0|(cl=q[Wk+(al<<2)>>2]))<0|(0|Yk)<=(0|cl))break f;if((0|Xk)==(0|(al=al+1|0)))break}for(Wk=q[Vk+116>>2],hl=q[_k+464>>2],jl=q[_k+460>>2],Yk=0;;){if(al=q[(cl=Yk<<2)+hl>>2]){if((0|al)<0|(0|Wk)<(0|al))break f;if((0|(cl=q[cl+jl>>2]))<0|(0|Wk)<=(0|cl))break f;if((al=al+cl|0)>>>31|(0|Wk)<(0|al))break f}if((0|Xk)==(0|(Yk=Yk+1|0)))break}}else Wk=q[Vk+116>>2];if((Yk=0)<(0|(cl=q[Vk+108>>2]))){for(al=q[_k+480>>2];;){if((0|(hl=q[al+(Yk<<2)>>2]))<0|(0|dl)<=(0|hl))break f;if((0|cl)==(0|(Yk=Yk+1|0)))break}for(hl=q[_k+488>>2],kl=q[_k+484>>2],Yk=0;;){if(al=q[(dl=Yk<<2)+hl>>2]){if((0|al)<0|(0|Xk)<(0|al))break f;if((0|(dl=q[dl+kl>>2]))<0|(0|Xk)<=(0|dl))break f;if((al=al+dl|0)>>>31|(0|Xk)<(0|al))break f}if((0|cl)==(0|(Yk=Yk+1|0)))break}for(hl=q[ll>>2],Yk=q[_k+456>>2],dl=q[_k+452>>2],al=0;;){if(ml=q[kl+(al<<2)>>2]<<2,jl=q[ml+Yk>>2]){if((0|jl)<0|(0|hl)<(0|jl))break f;if((0|(ml=q[dl+ml>>2]))<0|(0|hl)<=(0|ml))break f;if((0|(jl=jl+ml|0))<0|(0|hl)<(0|jl))break f}if((0|cl)==(0|(al=al+1|0)))break}}else Yk=q[_k+456>>2],dl=q[_k+452>>2];if((al=0)<(0|(cl=q[Vk+112>>2]))){for(hl=q[_k+504>>2];;){if((0|(jl=q[hl+(al<<2)>>2]))<0|(0|Zk)<=(0|jl))break f;if((0|cl)==(0|(al=al+1|0)))break}for(kl=q[_k+512>>2],jl=q[_k+508>>2],Zk=0;;){if(al=q[(hl=Zk<<2)+kl>>2]){if((0|al)<0|(0|Xk)<(0|al))break f;if((0|(hl=q[hl+jl>>2]))<0|(0|Xk)<=(0|hl))break f;if((al=al+hl|0)>>>31|(0|Xk)<(0|al))break f}if((0|cl)==(0|(Zk=Zk+1|0)))break}for(al=q[nl>>2],Zk=0;;){if(kl=q[jl+(Zk<<2)>>2]<<2,hl=q[kl+Yk>>2]){if((0|hl)<0|(0|al)<(0|hl))break f;if((0|(kl=q[dl+kl>>2]))<0|(0|al)<=(0|kl))break f;if((0|(hl=hl+kl|0))<0|(0|al)<(0|hl))break f}if((0|cl)==(0|(Zk=Zk+1|0)))break}}if(al=q[Vk+120>>2],(Zk=0)<(0|Wk))for(cl=q[_k+528>>2];;){if((0|(hl=q[cl+(Zk<<2)>>2]))<0|(0|al)<=(0|hl))break f;if((0|(Zk=Zk+1|0))==(0|Wk))break}if((Zk=0)<(0|al)){for(Wk=q[_k+532>>2];;){if((0|(cl=q[Wk+(Zk<<2)>>2]))<-1|(0|fl)<=(0|cl))break f;if((0|al)==(0|(Zk=Zk+1|0)))break}for(Wk=q[Vk+124>>2],hl=q[_k+540>>2],jl=q[_k+536>>2],Zk=0;;){if(fl=q[(cl=Zk<<2)+hl>>2]){if((0|fl)<0|(0|Wk)<(0|fl))break f;if((0|(cl=q[cl+jl>>2]))<0|(0|Wk)<=(0|cl))break f;if((fl=cl+fl|0)>>>31|(0|Wk)<(0|fl))break f}if((0|al)==(0|(Zk=Zk+1|0)))break}}if(!((255&il)>>>0<5)){if((Zk=0)<(0|(il=q[ll>>2]))){for(al=q[_k+348>>2];;){if((0|(Wk=q[al+(Zk<<2)>>2]))<0|(0|a)<(0|Wk))break f;if((0|il)==(0|(Zk=Zk+1|0)))break}for(al=q[_k+352>>2],Zk=0;;){if((0|(Wk=q[al+(Zk<<2)>>2]))<0|(0|a)<(0|Wk))break f;if((0|il)==(0|(Zk=Zk+1|0)))break}}if((il=0)<(0|(Zk=q[bl>>2]))){for(al=q[_k+384>>2];;){if((0|(Wk=q[al+(il<<2)>>2]))<0|(0|a)<(0|Wk))break f;if((0|Zk)==(0|(il=il+1|0)))break}for(al=q[_k+388>>2],il=0;;){if((0|(Wk=q[al+(il<<2)>>2]))<0|(0|a)<(0|Wk))break f;if((0|Zk)==(0|(il=il+1|0)))break}}if((il=0)<(0|(al=q[nl>>2]))){for(Wk=q[_k+404>>2];;){if((0|(fl=q[Wk+(il<<2)>>2]))<0|(0|a)<(0|fl))break f;if((0|al)==(0|(il=il+1|0)))break}for(Wk=q[_k+408>>2],il=0;;){if((0|(fl=q[Wk+(il<<2)>>2]))<0|(0|a)<(0|fl))break f;if((0|al)==(0|(il=il+1|0)))break}}if((a=0)<(0|(il=q[Vk+128>>2]))){for(al=q[Vk>>2],Wk=q[_k+468>>2];;){if((0|(fl=q[Wk+(a<<2)>>2]))<0|(0|al)<=(0|fl))break f;if((0|il)==(0|(a=a+1|0)))break}for(ll=q[_k+476>>2],fl=q[_k+472>>2],a=0;;){if(al=q[(Wk=a<<2)+ll>>2]){if((0|al)<0|(0|Xk)<(0|al))break f;if((0|(Wk=q[Wk+fl>>2]))<0|(0|Xk)<=(0|Wk))break f;if((al=Wk+al|0)>>>31|(0|Xk)<(0|al))break f}if((0|il)==(0|(a=a+1|0)))break}for(al=q[gl>>2],a=0;;){if(gl=q[fl+(a<<2)>>2]<<2,Wk=q[gl+Yk>>2]){if((0|Wk)<0|(0|al)<(0|Wk))break f;if((0|(gl=q[dl+gl>>2]))<0|(0|al)<=(0|gl))break f;if((0|(Wk=Wk+gl|0))<0|(0|al)<(0|Wk))break f}if((0|il)==(0|(a=a+1|0)))break}}if((a=0)<(0|(il=q[Vk+132>>2]))){for(al=q[_k+492>>2];;){if((0|(Wk=q[al+(a<<2)>>2]))<0|(0|ol)<=(0|Wk))break f;if((0|il)==(0|(a=a+1|0)))break}for(gl=q[_k+500>>2],Wk=q[_k+496>>2],a=0;;){if(al=q[(fl=a<<2)+gl>>2]){if((0|al)<0|(0|Xk)<(0|al))break f;if((0|(fl=q[Wk+fl>>2]))<0|(0|Xk)<=(0|fl))break f;if((al=al+fl|0)>>>31|(0|Xk)<(0|al))break f}if((0|il)==(0|(a=a+1|0)))break}for(a=0;;){if(fl=q[Wk+(a<<2)>>2]<<2,al=q[fl+Yk>>2]){if((0|al)<0|(0|Zk)<(0|al))break f;if((0|(fl=q[dl+fl>>2]))<0|(0|Zk)<=(0|fl))break f;if((0|(al=al+fl|0))<0|(0|Zk)<(0|al))break f}if((0|il)==(0|(a=a+1|0)))break}}if(!(((a=0)|(Vk=q[Vk+136>>2]))<=0)){for(Zk=q[_k+516>>2];;){if((0|(il=q[Zk+(a<<2)>>2]))<0|(0|$k)<=(0|il))break f;if((0|Vk)==(0|(a=a+1|0)))break}for(al=q[_k+524>>2],Zk=q[_k+520>>2],a=0;;){if(_k=q[(il=a<<2)+al>>2]){if((0|_k)<0|(0|Xk)<(0|_k))break f;if((0|(il=q[Zk+il>>2]))<0|(0|Xk)<=(0|il))break f;if((_k=_k+il|0)>>>31|(0|Xk)<(0|_k))break f}if((0|Vk)==(0|(a=a+1|0)))break}for(a=0;;){if(_k=q[Zk+(a<<2)>>2]<<2,Xk=q[_k+Yk>>2]){if((0|Xk)<0|(0|el)<(0|Xk))break f;if((0|(_k=q[_k+dl>>2]))<0|(0|el)<=(0|_k))break f;if((0|(Xk=Xk+_k|0))<0|(0|el)<(0|Xk))break f}if((0|Vk)==(0|(a=a+1|0)))break}}}}}return L=pl,1}return Y(4,1846,0),L=pl,0}q[_k+52>>2]=Xk,q[_k+48>>2]=5,Y(4,1640,_k+48|0)}else q[_k+32>>2]=Xk,Y(4,1554,_k+32|0);return L=pl,0}(a,vj):(q[20+wj>>2]=1621,q[16+wj>>2]=2284,Y(4,1294,16+wj|0),0):(q[4+wj>>2]=1444,q[wj>>2]=2284,Y(4,1294,wj),0),L=48+wj|0,0|a},i:function(a){q[1805]=a|=0},j:function(a,ej){var fj;return ej|=0,L=fj=L-48|0,a=(a|=0)?(a+63&-64)!=(0|a)?(q[36+fj>>2]=1522,q[32+fj>>2]=2305,Y(4,1294,32+fj|0),0):(ej+63&-64)==(0|ej)&&ej?function(a){var Qk,Tk,Uk,Uh,Kk=0,Lk=0,Mk=0,Nk=0,Ok=0,Pk=0,Rk=0,Sk=0;q[24+(L=Qk=L-32|0)>>2]=0,q[16+Qk>>2]=5,q[20+Qk>>2]=0,Ka(16+(L=Uh=L-272|0)|0,2227,q[12+Uh>>2]=16+Qk|0),function(a){var Hc;q[(L=Hc=L-16|0)>>2]=a,function(a,Il){var Jl;q[12+(L=Jl=L-16|0)>>2]=Il,Ia(a,1432,Il,0,0),L=16+Jl|0}(q[970],Hc),L=16+Hc|0}(16+Uh|0),L=272+Uh|0;a:{if(sa(a))Y(4,1932,0);else{if(!(6<=(Mk=r[a+4|0])>>>0)){if(1!=(0|!r[a+5|0])?(da(a+4|0,1),X(a- -64|0,4,160),na(a,a+704|(o[a+5|0]=0)),ya(a)):na(a,a+704|0),r[7224]||(q[1807]=6,o[7224]=1,q[1808]=7,q[1809]=8,q[1810]=9),Lk=q[a+704>>2],1<=(0|(Mk=q[Lk+16>>2]))){for(Sk=(Nk=q[a+912>>2])+(Mk<<2)|0,Ok=q[a+908>>2];;){Rk=q[a+1204>>2]+(q[Ok>>2]<<2)|0;d:if(!(((Lk=0)|(Kk=(Mk=q[Nk>>2])+-1|0))<1))e:for(;;){for(;;){if(q[(Pk=Rk+(Lk<<2)|0)>>2]<=-1){if(function(a,Vk,ql){var rl=0,sl=0;a:if((0|a)!=(0|Vk)){if(!(a>>>0>>0&&Vk>>>0<(sl=a+ql|0)>>>0))return $(a,Vk,ql);if(rl=3&(a^Vk),a>>>0>>0){if(!rl){if(3&a)for(;;){if(!ql)break a;if(o[0|a]=r[0|Vk],Vk=Vk+1|0,ql=ql+-1|0,!(3&(a=a+1|0)))break}if(!(ql>>>0<=3)){for(rl=ql;q[a>>2]=q[Vk>>2],Vk=Vk+4|0,a=a+4|0,3<(rl=rl+-4|0)>>>0;);ql&=3}}if(ql)for(;o[0|a]=r[0|Vk],a=a+1|0,Vk=Vk+1|0,ql=ql+-1|0;);}else{if(!rl){if(3&sl)for(;;){if(!ql)break a;if(o[0|(rl=(ql=ql+-1|0)+a|0)]=r[Vk+ql|0],!(3&rl))break}if(!(ql>>>0<=3))for(;q[(ql=ql+-4|0)+a>>2]=q[Vk+ql>>2],3>>0;);}if(ql)for(;o[(ql=ql+-1|0)+a|0]=r[Vk+ql|0],ql;);}}}(Pk,Pk+4|0,(-1^Lk)+Mk<<2),(0|Lk)<(0|(Kk=(Mk=Kk)+-1|0)))continue e;break d}if(!((0|(Lk=Lk+1|0))<(0|Kk)))break}break}if(Lk=Nk,0<(0|Mk)&&(Mk=q[Rk+(Kk<<2)>>2]<0?Kk:Mk),q[Lk>>2]=Mk,Ok=Ok+4|0,!((Nk=Nk+4|0)>>>0>>0))break}Lk=q[a+704>>2]}if(1<=q[Lk>>2])for(Kk=0;q[q[a+712>>2]+(Kk<<2)>>2]=q[a+716>>2]+(Kk<<6),Lk=q[a+704>>2],(0|(Kk=Kk+1|0))>2];);if(1<=q[Lk+4>>2])for(Kk=0;q[q[a+744>>2]+(Kk<<2)>>2]=q[a+748>>2]+(Kk<<6),Lk=q[a+704>>2],(0|(Kk=Kk+1|0))>2];);if(1<=q[Lk+16>>2])for(Kk=0;q[(Mk=Kk<<2)+q[a+832>>2]>>2]=q[a+848>>2]+(Kk<<6),q[Mk+q[a+836>>2]>>2]=q[a+1196>>2]+(q[Mk+q[a+896>>2]>>2]<<2),q[Mk+q[a+840>>2]>>2]=q[a+1200>>2]+(q[Mk+q[a+900>>2]>>2]<<1),q[Mk+q[a+844>>2]>>2]=q[a+1204>>2]+(q[Mk+q[a+908>>2]>>2]<<2),Lk=q[a+704>>2],(0|(Kk=Kk+1|0))>2];);if(1<=q[Lk+20>>2])for(Kk=0;q[q[a+916>>2]+(Kk<<2)>>2]=q[a+920>>2]+(Kk<<6),Lk=q[a+704>>2],(0|(Kk=Kk+1|0))>2];);if(1<=q[Lk+80>>2])for(Kk=0;q[q[a+1240>>2]+(Kk<<2)>>2]=q[a+1244>>2]+(Kk<<6),Lk=q[a+704>>2],(0|(Kk=Kk+1|0))>2];);if(1&o[q[a+708>>2]+20|0])break a;if((0|(Nk=q[Lk+16>>2]))<1)break a;for(Kk=q[a+904>>2],Rk=q[a+900>>2],Pk=q[a+1200>>2],Ok=0;;){if(0<(0|(Sk=q[(Mk=Ok<<2)+Kk>>2]+-1|0)))for(Tk=Pk+(q[Mk+Rk>>2]<<1)|0,Lk=0;Uk=s[(Mk=Tk+(Lk<<1)|0)>>1],p[Mk>>1]=s[Mk+4>>1],p[Mk+4>>1]=Uk,(0|(Lk=Lk+3|0))<(0|Sk););if((0|Nk)==(0|(Ok=Ok+1|0)))break}for(Mk=q[a+892>>2],Ok=q[a+896>>2],Rk=q[a+1196>>2],Kk=0;;){if(1<=(0|(Pk=q[(Lk=Kk<<2)+Mk>>2])))for(Pk=(Lk=Rk+(q[Lk+Ok>>2]<<2)|0)+(Pk<<3)|0,Lk=Lk+4|0;u[Lk>>2]=x(1)-u[Lk>>2],(Lk=Lk+8|0)>>>0>>0;);if((0|Nk)==(0|(Kk=Kk+1|0)))break}break a}q[4+Qk>>2]=Mk,q[Qk>>2]=5,Y(4,2023,Qk)}a=0}return L=32+Qk|0,a}(a):(q[20+fj>>2]=1621,q[16+fj>>2]=2305,Y(4,1294,16+fj|0),0):(q[4+fj>>2]=1444,q[fj>>2]=2305,Y(4,1294,fj),0),L=48+fj|0,0|a},k:function(a,ej,fj,gj){var hj;ej|=0,fj|=0,gj|=0,L=hj=L+-64|0,(a|=0)?ej?fj?gj?(a=q[q[a>>2]+708>>2],q[ej>>2]=q[a+12>>2],q[ej+4>>2]=q[a+16>>2],q[fj>>2]=q[a+4>>2],q[fj+4>>2]=q[a+8>>2],q[gj>>2]=q[a>>2]):(q[52+hj>>2]=1995,q[48+hj>>2]=2325,Y(4,1294,48+hj|0)):(q[36+hj>>2]=1903,q[32+hj>>2]=2325,Y(4,1294,32+hj|0)):(q[20+hj>>2]=1819,q[16+hj>>2]=2325,Y(4,1294,16+hj|0)):(q[4+hj>>2]=1740,q[hj>>2]=2325,Y(4,1294,hj)),L=64+hj|0},l:xa,m:wa,n:function(a){var dj;L=dj=L-16|0,(a|=0)?ua(a):(q[4+dj>>2]=1740,q[dj>>2]=2387,Y(4,1294,dj)),L=16+dj|0},o:function(a){var cj;return L=cj=L-16|0,a=(a|=0)?q[a+540>>2]:(q[4+cj>>2]=1740,q[cj>>2]=2402,Y(4,1294,cj),-1),L=16+cj|0,0|a},p:function(a){var bj;return L=bj=L-16|0,a=(a|=0)?q[q[a>>2]+916>>2]:(q[4+bj>>2]=1740,q[bj>>2]=2423,Y(4,1294,bj),0),L=16+bj|0,0|a},q:function(a){var aj;return L=aj=L-16|0,a=(a|=0)?q[a+548>>2]:(q[4+aj>>2]=1740,q[aj>>2]=2442,Y(4,1294,aj),0),L=16+aj|0,0|a},r:function(a){var $i;return L=$i=L-16|0,a=(a|=0)?q[q[a>>2]+928>>2]:(q[4+$i>>2]=1740,q[$i>>2]=2463,Y(4,1294,$i),0),L=16+$i|0,0|a},s:function(a){var _i;return L=_i=L-16|0,a=(a|=0)?q[q[a>>2]+924>>2]:(q[4+_i>>2]=1740,q[_i>>2]=2492,Y(4,1294,_i),0),L=16+_i|0,0|a},t:function(a){var Zi;return L=Zi=L-16|0,a=(a|=0)?q[q[a>>2]+932>>2]:(q[4+Zi>>2]=1740,q[Zi>>2]=2521,Y(4,1294,Zi),0),L=16+Zi|0,0|a},u:function(a){var Yi;return L=Yi=L-16|0,a=(a|=0)?q[a+552>>2]:(q[4+Yi>>2]=1740,q[Yi>>2]=2550,Y(4,1294,Yi),0),L=16+Yi|0,0|a},v:function(a){var Xi;return L=Xi=L-16|0,a=(a|=0)?q[a+4>>2]:(q[4+Xi>>2]=1740,q[Xi>>2]=2572,Y(4,1294,Xi),-1),L=16+Xi|0,0|a},w:function(a){var Wi;return L=Wi=L-16|0,a=(a|=0)?q[q[a>>2]+712>>2]:(q[4+Wi>>2]=1740,q[Wi>>2]=2588,Y(4,1294,Wi),0),L=16+Wi|0,0|a},x:function(a){var Vi;return L=Vi=L-16|0,a=(a|=0)?q[a+52>>2]:(q[4+Vi>>2]=1740,q[Vi>>2]=2602,Y(4,1294,Vi),0),L=16+Vi|0,0|a},y:function(a){var Ui;return L=Ui=L-16|0,a=(a|=0)?q[q[a>>2]+740>>2]:(q[4+Ui>>2]=1740,q[Ui>>2]=2622,Y(4,1294,Ui),0),L=16+Ui|0,0|a},z:function(a){var Ti;return L=Ti=L-16|0,a=(a|=0)?q[a+332>>2]:(q[4+Ti>>2]=1740,q[Ti>>2]=2650,Y(4,1294,Ti),-1),L=16+Ti|0,0|a},A:function(a){var Si;return L=Si=L-16|0,a=(a|=0)?q[q[a>>2]+832>>2]:(q[4+Si>>2]=1740,q[Si>>2]=2670,Y(4,1294,Si),0),L=16+Si|0,0|a},B:function(a){var Ri;return L=Ri=L-16|0,a=(a|=0)?q[q[a>>2]+888>>2]:(q[4+Ri>>2]=1740,q[Ri>>2]=2688,Y(4,1294,Ri),0),L=16+Ri|0,0|a},C:function(a){var Qi;return L=Qi=L-16|0,a=(a|=0)?q[a+432>>2]:(q[4+Qi>>2]=1740,q[Qi>>2]=2716,Y(4,1294,Qi),0),L=16+Qi|0,0|a},D:function(a){var Pi;return L=Pi=L-16|0,a=(a|=0)?q[q[a>>2]+884>>2]:(q[4+Pi>>2]=1740,q[Pi>>2]=2743,Y(4,1294,Pi),0),L=16+Pi|0,0|a},E:function(a){var Oi;return L=Oi=L-16|0,a=(a|=0)?q[a+440>>2]:(q[4+Oi>>2]=1740,q[Oi>>2]=2772,Y(4,1294,Oi),0),L=16+Oi|0,0|a},F:function(a){var Ni;return L=Ni=L-16|0,a=(a|=0)?q[a+436>>2]:(q[4+Ni>>2]=1740,q[Ni>>2]=2797,Y(4,1294,Ni),0),L=16+Ni|0,0|a},G:function(a){var Mi;return L=Mi=L-16|0,a=(a|=0)?q[a+448>>2]:(q[4+Mi>>2]=1740,q[Mi>>2]=2824,Y(4,1294,Mi),0),L=16+Mi|0,0|a},H:function(a){var Li;return L=Li=L-16|0,a=(a|=0)?q[q[a>>2]+912>>2]:(q[4+Li>>2]=1740,q[Li>>2]=2848,Y(4,1294,Li),0),L=16+Li|0,0|a},I:function(a){var Ki;return L=Ki=L-16|0,a=(a|=0)?q[q[a>>2]+844>>2]:(q[4+Ki>>2]=1740,q[Ki>>2]=2873,Y(4,1294,Ki),0),L=16+Ki|0,0|a},J:function(a){var Ji;return L=Ji=L-16|0,a=(a|=0)?q[q[a>>2]+892>>2]:(q[4+Ji>>2]=1740,q[Ji>>2]=2893,Y(4,1294,Ji),0),L=16+Ji|0,0|a},K:function(a){var Ii;return L=Ii=L-16|0,a=(a|=0)?q[a+444>>2]:(q[4+Ii>>2]=1740,q[Ii>>2]=2920,Y(4,1294,Ii),0),L=16+Ii|0,0|a},L:function(a){var Hi;return L=Hi=L-16|0,a=(a|=0)?q[q[a>>2]+836>>2]:(q[4+Hi>>2]=1740,q[Hi>>2]=2950,Y(4,1294,Hi),0),L=16+Hi|0,0|a},M:function(a){var ri;return L=ri=L-16|0,a=(a|=0)?q[q[a>>2]+904>>2]:(q[4+ri>>2]=1740,q[ri>>2]=2974,Y(4,1294,ri),0),L=16+ri|0,0|a},N:function(a){var qi;return L=qi=L-16|0,a=(a|=0)?q[q[a>>2]+840>>2]:(q[4+qi>>2]=1740,q[qi>>2]=3e3,Y(4,1294,qi),0),L=16+qi|0,0|a},O:function(a){var pi;return L=pi=L-16|0,a=(a|=0)?q[a+452>>2]:(q[4+pi>>2]=1740,q[pi>>2]=3022,Y(4,1294,pi),0),L=16+pi|0,0|a},P:function(a){var oi;return L=oi=L-16|0,a=(a|=0)?q[a+456>>2]:(q[4+oi>>2]=1740,q[oi>>2]=3051,Y(4,1294,oi),0),L=16+oi|0,0|a},Q:function(a){var ni;return L=ni=L-16|0,a=(a|=0)?q[q[a>>2]+876>>2]:(q[4+ni>>2]=1740,q[ni>>2]=3078,Y(4,1294,ni),0),L=16+ni|0,0|a},R:function(a){var mi;L=mi=L-16|0,(a|=0)?q[a+428>>2]=1:(q[4+mi>>2]=1740,q[mi>>2]=3110,Y(4,1294,mi)),L=16+mi|0},S:function(a){var li;return L=li=L-16|0,a=(a|=0)?q[a+640>>2]:(q[4+li>>2]=1740,q[li>>2]=3139,Y(4,1294,li),0),L=16+li|0,0|a},T:function(a){var ji;return L=ji=L-16|0,a=(a|=0)?q[a+636>>2]:(q[4+ji>>2]=1740,q[ji>>2]=3164,Y(4,1294,ji),0),L=16+ji|0,0|a},U:function(a){var Fc;return oa(12+(L=Fc=L-16|0)|0,64,a|=0),L=16+Fc|0,q[12+Fc>>2]},V:function(a){var Ec,Cc,Dc=0;return L=Cc=L-16|0,!(a|=0)||oa(12+Cc|0,16,Ec=xa(a))||(Dc=wa(a,q[12+Cc>>2],Ec))||(pa(q[12+Cc>>2]),Dc=0),L=16+Cc|0,0|Dc},W:function(a){return 0|qa(a|=0)},X:function(a){pa(a|=0)},Y:function(a){var Sm;oa(12+(L=Sm=L-16|0)|0,64,a|=0),pa(q[12+Sm>>2]),L=16+Sm|0},Z:function(){return 0|L},_:function(a){return 0|(L=L-(0|a)&-16)},$:function(a){L=0|a},aa:function(a){return 0|(a=0|(a|=0),(P=0|N())<(a=P+(a|=0)|0)&&a<65536&&(a=new ArrayBuffer(w(a,65536)),(S=new global.Int8Array(a)).set(o),o=S,o=new global.Int8Array(a),p=new global.Int16Array(a),q=new global.Int32Array(a),r=new global.Uint8Array(a),s=new global.Uint16Array(a),t=new global.Uint32Array(a),u=new global.Float32Array(a),v=new global.Float64Array(a),buffer=a,m.buffer=a),P);var S,P},ba:function(a,Vk){n[a|=0](Vk|=0)}};function X(a,b,c){var e,f,d=0;if(c)for(;;){if(c=c+-1|0,a>>>0<(d=(e=a+b|0)-1|0)>>>0)for(;f=r[0|a],o[0|a]=r[0|d],o[0|d]=f,(a=a+1|0)>>>0<(d=d+-1|0)>>>0;);if(a=e,!c)break}}function Y(a,b,c){var g;L=g=L-272|0,t[1804]>a>>>0||(a=q[1805])&&(Ka(16+g|0,b,q[12+g>>2]=c),n[a](16+g|0)),L=272+g|0}function Z(a,b,c){32&r[0|a]||!function(a,Rm,Sm){var Tm=0,Um=0,tn=0;a:{if(!(Tm=q[Sm+16>>2])){if(function(a){var Rm;return Rm=r[a+74|0],o[a+74|0]=Rm+-1|Rm,8&(Rm=q[a>>2])?(q[a>>2]=32|Rm,1):(q[a+4>>2]=0,q[a+8>>2]=0,Rm=q[a+44>>2],q[a+28>>2]=Rm,q[a+20>>2]=Rm,q[a+16>>2]=Rm+q[a+48>>2],0)}(Sm))break a;Tm=q[Sm+16>>2]}if(Tm-(tn=q[Sm+20>>2])>>>0>>0)return n[q[Sm+36>>2]](Sm,a,Rm);b:if(!(o[Sm+75|0]<0)){for(Tm=Rm;;){if(!(Um=Tm))break b;if(10==r[(Tm=Um+-1|0)+a|0])break}if(n[q[Sm+36>>2]](Sm,a,Um)>>>0>>0)break a;Rm=Rm-Um|0,a=a+Um|0,tn=q[Sm+20>>2]}$(tn,a,Rm),q[Sm+20>>2]=q[Sm+20>>2]+Rm}}(b,c,a)}function _(a,b,c,h,i){var k,l,j;if(L=j=L-256|0,!(73728&i|(0|c)<=(0|h))){if(ca(j,b,(k=(i=c-h|0)>>>0<256)?i:256),b=a,l=j,!k){for(c=c-h|0;Z(a,j,256),255<(i=i+-256|0)>>>0;);i=255&c}Z(b,l,i)}L=256+j|0}function $(a,b,c){var h,i=0;if(8192<=c>>>0)I(0|a,0|b,0|c);else{if(h=a+c|0,3&(a^b))if(h>>>0<4)c=a;else if((i=h-4|0)>>>0>>0)c=a;else for(c=a;o[0|c]=r[0|b],o[c+1|0]=r[b+1|0],o[c+2|0]=r[b+2|0],o[c+3|0]=r[b+3|0],b=b+4|0,(c=c+4|0)>>>0<=i>>>0;);else{b:if((0|c)<1)c=a;else if(3&a)for(c=a;;){if(o[0|c]=r[0|b],b=b+1|0,h>>>0<=(c=c+1|0)>>>0)break b;if(!(3&c))break}else c=a;if(!((a=-4&h)>>>0<64||(i=a+-64|0)>>>0>>0))for(;q[c>>2]=q[b>>2],q[c+4>>2]=q[b+4>>2],q[c+8>>2]=q[b+8>>2],q[c+12>>2]=q[b+12>>2],q[c+16>>2]=q[b+16>>2],q[c+20>>2]=q[b+20>>2],q[c+24>>2]=q[b+24>>2],q[c+28>>2]=q[b+28>>2],q[c+32>>2]=q[b+32>>2],q[c+36>>2]=q[b+36>>2],q[c+40>>2]=q[b+40>>2],q[c+44>>2]=q[b+44>>2],q[c+48>>2]=q[b+48>>2],q[c+52>>2]=q[b+52>>2],q[c+56>>2]=q[b+56>>2],q[c+60>>2]=q[b+60>>2],b=b- -64|0,(c=c- -64|0)>>>0<=i>>>0;);if(!(a>>>0<=c>>>0))for(;q[c>>2]=q[b>>2],b=b+4|0,(c=c+4|0)>>>0>>0;);}if(c>>>0>>0)for(;o[0|c]=r[0|b],b=b+1|0,(0|h)!=(0|(c=c+1|0)););}}function aa(a){var b,c;return x((b=a*a)*b*(c=b*a)*(2718311493989822e-21*b-.00019839334836096632)+(c*(.008333329385889463*b-.16666666641626524)+a))}function ba(a){var m;return x(-.499999997251031*(a*=a)+1+.04166662332373906*(m=a*a)+a*m*(2439044879627741e-20*a-.001388676377460993))}function ca(a,n,p){var r,s,t,u;if(p&&(o[(r=a+p|0)-1|0]=n,o[0|a]=n,!(p>>>0<3||(o[r-2|0]=n,o[a+1|0]=n,o[r-3|0]=n,o[a+2|0]=n,p>>>0<7)||(o[r-4|0]=n,o[a+3|0]=n,p>>>0<9)||(s=(r=0-a&3)+a|0,n=w(255&n,16843009),q[s>>2]=n,q[(r=(p=p-r&-4)+s|0)-4>>2]=n,p>>>0<9)||(q[8+s>>2]=n,q[4+s>>2]=n,q[r-8>>2]=n,q[r-12>>2]=n,p>>>0<25)||(q[24+s>>2]=n,q[20+s>>2]=n,q[16+s>>2]=n,q[12+s>>2]=n,q[r-16>>2]=n,q[r-20>>2]=n,q[r-24>>2]=n,q[r-28>>2]=n,(p=p-(u=4&s|24)|0)>>>0<32))))for(t=r=n,n=s+u|0;q[n+24>>2]=t,q[n+28>>2]=r,q[n+16>>2]=t,q[n+20>>2]=r,q[n+8>>2]=t,q[n+12>>2]=r,q[n>>2]=t,q[n+4>>2]=r,n=n+32|0,31<(p=p+-32|0)>>>0;);return a}function da(a,n){var p;if(a>>>0<(n=(a+n|0)-1|0)>>>0)for(;p=r[0|a],o[0|a]=r[0|n],o[0|n]=p,(a=a+1|0)>>>0<(n=n+-1|0)>>>0;);}function ea(a){var n,o=N();return(a=(n=q[2216])+a|0)>>>0<=o<<16>>>0||J(0|a)?(q[2216]=a,n):(q[2086]=48,-1)}function fa(a,v,y,z,B,C,D){var H,I,K,N,Q,R,S,O,P,J,E=0,F=x(0),G=x(0),M=x(0);if(x(0),x(0),x(0),x(0),L=J=L-16|0,1<=(0|a))for(R=w(a,12)+v|0;;){if(1<=(0|(I=q[v+4>>2])))for(S=(a=q[v+8>>2])+w(I,48)|0,I=(H=q[v>>2]<<4)+D|0,K=(8|H)+D|0,H=(4|H)+D|0;(E=q[a+8>>2])&&((O=E+-1|0)>>>0<=1?(P=(q[a+4>>2]<<2)+y|0,E=q[P+(q[a+12>>2]<<2)>>2]<<2,F=u[E+C>>2],Q=u[B+E>>2],G=u[z+E>>2],O-1?(M=G,G=u[a+20>>2],u[I>>2]=u[I>>2]+x(u[a+44>>2]*x(M*G)),u[H>>2]=u[H>>2]+x(x(Q*G)*u[a+44>>2]),u[K>>2]=u[K>>2]+x(x(F*G)*u[a+44>>2])):(E=q[(q[a+16>>2]<<2)+P>>2]<<2,O=u[E+C>>2],P=u[B+E>>2],M=G,G=u[a+20>>2],N=u[a+24>>2],u[I>>2]=u[I>>2]+x(u[a+44>>2]*x(x(M*G)+x(u[z+E>>2]*N))),u[H>>2]=u[H>>2]+x(x(x(Q*G)+x(P*N))*u[a+44>>2]),u[K>>2]=u[K>>2]+x(x(x(F*G)+x(O*N))*u[a+44>>2]))):(q[J>>2]=E,Y(4,1024,J))),(a=a+48|0)>>>0>>0;);if(a=(q[v>>2]<<4)+D|0,F=u[a>>2],u[a>>2]=F>2],u[a+4>>2]=F>2],u[a+8>>2]=F>>0>>0))break}L=16+J|0}function ga(a,q,v){var y,z,x=0;if(1==(0|q)&a>>>0<0|q>>>0<1)x=a;else for(;y=ad(x=bd(a,q,10),z=M,10),o[0|(v=v+-1|0)]=a-y|48,y=9==(0|q)&4294967295>>0|9>>0,a=x,q=z,y;);if(x)for(;o[0|(v=v+-1|0)]=x-w(a=(x>>>0)/10|0,10)|48,q=9>>0,x=a,q;);return v}function ha(a){return a+-48>>>0<10}function ia(a){var q;return(q=La(a,64))?q-a|0:64}function ja(a,v){var w=0;return 1024<=(0|v)?(a*=898846567431158e293,v=(0|(w=v+-1023|0))<1024?w:(a*=898846567431158e293,((0|v)<3069?v:3069)+-2046|0)):-1023<(0|v)||(a*=22250738585072014e-324,v=-1023<(0|(w=v+1022|0))?w:(a*=22250738585072014e-324,(-3066<(0|v)?v:-3066)+2044|0)),f(0,0),f(1,v+1023<<20),a*+g()}function ka(a,v){var A=0,C=a,B=v>>>0<=31?(A=q[a+4>>2],q[a>>2]):(A=q[a>>2],q[a+4>>2]=A,v=v+-32|(q[a>>2]=0),0);q[C>>2]=B<>2]=A<>>32-v}function la(a,v,D,V,W){var X,Y=0,Z=0,_=0;L=X=L-240|0,Y=q[v>>2],q[232+X>>2]=Y,v=q[v+4>>2],q[X>>2]=a,Z=1;a:{b:{c:{if(((q[236+X>>2]=v)||1!=(0|Y))&&(Y=a-q[(D<<2)+W>>2]|0,!((0|n[5](Y,a))<1))){for(_=!V;;){e:{if(v=Y,!(!_|(0|D)<2)){if(V=q[((D<<2)+W|0)-8>>2],-1<(0|n[5](Y=a+-4|0,v)))break e;if(-1<(0|n[5](Y-V|0,v)))break e}if(q[(Z<<2)+X>>2]=v,Z=Z+1|0,ma(232+X|0,a=Oa(232+X|0)),D=a+D|0,!q[236+X>>2]&&1==q[232+X>>2])break b;if(_=1,Y=(a=v)-q[(D<<2)+W>>2]|(V=0),0<(0|n[5](Y,q[X>>2])))continue;break c}break}v=a;break b}v=a}if(V)break a}Na(X,Z),ta(v,D,W)}L=240+X|0}function ma(a,v){var D=0,V=a,L=v>>>0<=31?(D=q[a>>2],q[a+4>>2]):(D=q[a+4>>2],q[a+4>>2]=0,q[a>>2]=D,v=v+-32|0,0);q[V+4>>2]=L>>>v,q[a>>2]=L<<32-v|D>>>v}function na(a,v){var W=r[a+4|0];q[v>>2]=q[a+64>>2]+a,q[v+4>>2]=q[a+68>>2]+a,q[v+8>>2]=q[a+72>>2]+a,q[v+12>>2]=q[a+76>>2]+a,q[v+16>>2]=q[a+80>>2]+a,q[v+20>>2]=q[a+84>>2]+a,q[v+24>>2]=q[a+88>>2]+a,q[v+28>>2]=q[a+92>>2]+a,q[v+32>>2]=q[a+96>>2]+a,q[v+36>>2]=q[a+100>>2]+a,q[v+40>>2]=q[a+104>>2]+a,q[v+44>>2]=q[a+108>>2]+a,q[v+48>>2]=q[a+112>>2]+a,q[v+52>>2]=q[a+116>>2]+a,q[v+56>>2]=q[a+120>>2]+a,q[v+60>>2]=q[a+124>>2]+a,q[v- -64>>2]=q[a+128>>2]+a,q[v+68>>2]=q[a+132>>2]+a,q[v+72>>2]=q[a+136>>2]+a,q[v+76>>2]=q[a+140>>2]+a,q[v+80>>2]=q[a+144>>2]+a,q[v+84>>2]=q[a+148>>2]+a,q[v+92>>2]=q[a+152>>2]+a,q[v+96>>2]=q[a+156>>2]+a,q[v+100>>2]=q[a+160>>2]+a,q[v+108>>2]=q[a+164>>2]+a,q[v+112>>2]=q[a+168>>2]+a,q[v+116>>2]=q[a+172>>2]+a,q[v+124>>2]=q[a+176>>2]+a,q[v+128>>2]=q[a+180>>2]+a,q[v+132>>2]=q[a+184>>2]+a,q[v+136>>2]=q[a+188>>2]+a,q[v+140>>2]=q[a+192>>2]+a,q[v+144>>2]=q[a+196>>2]+a,q[v+148>>2]=q[a+200>>2]+a,q[v+152>>2]=q[a+204>>2]+a,q[v+156>>2]=q[a+208>>2]+a,q[v+164>>2]=q[a+212>>2]+a,q[v+168>>2]=q[a+216>>2]+a,q[v+172>>2]=q[a+220>>2]+a,q[v+176>>2]=q[a+224>>2]+a,q[v+180>>2]=q[a+228>>2]+a,q[v+184>>2]=q[a+232>>2]+a,q[v+188>>2]=q[a+236>>2]+a,q[v+192>>2]=q[a+240>>2]+a,q[v+196>>2]=q[a+244>>2]+a,q[v+200>>2]=q[a+248>>2]+a,q[v+204>>2]=q[a+252>>2]+a,q[v+208>>2]=q[a+256>>2]+a,q[v+212>>2]=q[a+260>>2]+a,q[v+216>>2]=q[a+264>>2]+a,q[v+220>>2]=q[a+268>>2]+a,q[v+224>>2]=q[a+272>>2]+a,q[v+228>>2]=q[a+276>>2]+a,q[v+232>>2]=q[a+280>>2]+a,q[v+236>>2]=q[a+284>>2]+a,q[v+244>>2]=q[a+288>>2]+a,q[v+248>>2]=q[a+292>>2]+a,q[v+272>>2]=q[a+296>>2]+a,q[v+276>>2]=q[a+300>>2]+a,q[v+280>>2]=q[a+304>>2]+a,q[v+292>>2]=q[a+308>>2]+a,q[v+296>>2]=q[a+312>>2]+a,q[v+300>>2]=q[a+316>>2]+a,q[v+304>>2]=q[a+320>>2]+a,q[v+308>>2]=q[a+324>>2]+a,q[v+312>>2]=q[a+328>>2]+a,q[v+316>>2]=q[a+332>>2]+a,q[v+328>>2]=q[a+336>>2]+a,q[v+332>>2]=q[a+340>>2]+a,q[v+336>>2]=q[a+344>>2]+a,q[v+348>>2]=q[a+348>>2]+a,q[v+360>>2]=q[a+352>>2]+a,q[v+364>>2]=q[a+356>>2]+a,q[v+368>>2]=q[a+360>>2]+a,q[v+352>>2]=q[a+364>>2]+a,q[v+356>>2]=q[a+368>>2]+a,q[v+488>>2]=q[a+372>>2]+a,q[v+492>>2]=q[a+376>>2]+a,q[v+496>>2]=q[a+380>>2]+a,q[v+500>>2]=q[a+384>>2]+a,q[v+504>>2]=q[a+388>>2]+a,q[v+508>>2]=q[a+392>>2]+a,q[v+512>>2]=q[a+396>>2]+a,q[v+516>>2]=q[a+400>>2]+a,q[v+520>>2]=q[a+404>>2]+a,q[v+524>>2]=q[a+408>>2]+a,q[v+528>>2]=q[a+412>>2]+a,q[v+532>>2]=q[a+416>>2]+a,q[v+536>>2]=q[a+420>>2]+a,q[v+540>>2]=q[a+424>>2]+a,q[v+544>>2]=q[a+428>>2]+a,q[v+548>>2]=q[a+432>>2]+a,q[v+552>>2]=q[a+436>>2]+a,q[v+556>>2]=q[a+440>>2]+a,q[v+560>>2]=q[a+444>>2]+a,q[v+564>>2]=q[a+448>>2]+a,q[v+568>>2]=q[a+452>>2]+a,q[v+572>>2]=q[a+456>>2]+a,q[v+576>>2]=q[a+460>>2]+a,q[v+580>>2]=q[a+464>>2]+a,W>>>0<2||(q[v+104>>2]=q[a+468>>2]+a,W>>>0<4)||(q[v+260>>2]=q[a+472>>2]+a,q[v+264>>2]=q[a+476>>2]+a,q[v+268>>2]=q[a+480>>2]+a,q[v+88>>2]=q[a+484>>2]+a,q[v+120>>2]=q[a+488>>2]+a,q[v+160>>2]=q[a+492>>2]+a,q[v+584>>2]=q[a+496>>2]+a,q[v+588>>2]=q[a+500>>2]+a,q[v+592>>2]=q[a+504>>2]+a,q[v+596>>2]=q[a+508>>2]+a,q[v+600>>2]=q[a+512>>2]+a,q[v+604>>2]=q[a+516>>2]+a,q[v+240>>2]=q[a+520>>2]+a,q[v+252>>2]=q[a+524>>2]+a,q[v+256>>2]=q[a+528>>2]+a,q[v+372>>2]=q[a+532>>2]+a,q[v+376>>2]=q[a+536>>2]+a,q[v+380>>2]=q[a+540>>2]+a,q[v+384>>2]=q[a+544>>2]+a,q[v+388>>2]=q[a+548>>2]+a,q[v+392>>2]=q[a+552>>2]+a,q[v+396>>2]=q[a+556>>2]+a,q[v+400>>2]=q[a+560>>2]+a,q[v+416>>2]=q[a+564>>2]+a,q[v+420>>2]=q[a+568>>2]+a,q[v+424>>2]=q[a+572>>2]+a,q[v+440>>2]=q[a+576>>2]+a,q[v+444>>2]=q[a+580>>2]+a,q[v+448>>2]=q[a+584>>2]+a,q[v+464>>2]=q[a+588>>2]+a,q[v+468>>2]=q[a+592>>2]+a,q[v+472>>2]=q[a+596>>2]+a,q[v+476>>2]=q[a+600>>2]+a,q[v+480>>2]=q[a+604>>2]+a,q[v+484>>2]=q[a+608>>2]+a,4!=(0|W)&&(q[v+284>>2]=q[a+612>>2]+a,q[v+288>>2]=q[a+616>>2]+a,q[v+320>>2]=q[a+620>>2]+a,q[v+324>>2]=q[a+624>>2]+a,q[v+340>>2]=q[a+628>>2]+a,q[v+344>>2]=q[a+632>>2]+a,q[v+404>>2]=q[a+636>>2]+a,q[v+408>>2]=q[a+640>>2]+a,q[v+412>>2]=q[a+644>>2]+a,q[v+428>>2]=q[a+648>>2]+a,q[v+432>>2]=q[a+652>>2]+a,q[v+436>>2]=q[a+656>>2]+a,q[v+452>>2]=q[a+660>>2]+a,q[v+456>>2]=q[a+664>>2]+a,q[v+460>>2]=q[a+668>>2]+a))}function oa(a,v,$){var aa=0;a:{if(8==(0|v))v=qa($);else{if(aa=28,3&v|1!=(0|function(a){for(var $o=0,ap=0;ap=$o,a;)a&=a-1,$o=$o+1|0;return ap}(v>>>2)))break a;if(aa=48,-64-v>>>0<$>>>0)break a;v=function(a,Vk){var vl,wl,ql=0,tl=0,ul=0;if((tl=a>>>0>(ql=16)?a:16)+-1&tl)for(;ql=(a=ql)<<1,a>>>0>>0;);else a=tl;return-64-a>>>0<=Vk>>>0?(q[2086]=48,0):(ql=qa(12+((tl=Vk>>>0<11?16:Vk+11&-8)+a|0)|0))?(Vk=ql+-8|0,ql&a+-1?(ul=(-8&(wl=q[(vl=ql+-4|0)>>2]))-(ql=(a=15<(ql=((a+ql|0)-1&0-a)-8|0)-Vk>>>0?ql:a+ql|0)-Vk|0)|0,3&wl?(q[a+4>>2]=ul|1&q[a+4>>2]|2,q[4+(ul=a+ul|0)>>2]=1|q[4+ul>>2],q[vl>>2]=ql|1&q[vl>>2]|2,q[a+4>>2]=1|q[a+4>>2],za(Vk,ql)):(Vk=q[Vk>>2],q[a+4>>2]=ul,q[a>>2]=Vk+ql)):a=Vk,3&(Vk=q[a+4>>2])&&((ql=-8&Vk)>>>0<=tl+16>>>0||(q[a+4>>2]=tl|1&Vk|2,q[(Vk=a+tl|0)+4>>2]=3|(tl=ql-tl|0),q[4+(ql=a+ql|0)>>2]=1|q[ql+4>>2],za(Vk,tl))),a+8|0):0}(16>>0?v:16,$)}if(!v)return 1;q[a>>2]=v,aa=0}return aa}function pa(a){var da,v=0,$=0,ba=0,ca=0,ea=0,fa=0,ha=0;a:if(a){da=(ba=a+-8|0)+(a=-8&($=q[a+-4>>2]))|0;b:if(!(1&$)){if(!(3&$))break a;if((ba=ba-($=q[ba>>2])|0)>>>0>>0<=255)ca=q[ba+8>>2],$>>>=3,(0|(v=q[ba+12>>2]))==(0|ca)?(ha=q[2087]&dd($),q[2087]=ha):(q[ca+12>>2]=v,q[v+8>>2]=ca);else{if(fa=q[ba+24>>2],(0|ba)!=(0|($=q[ba+12>>2])))v=q[ba+8>>2],q[v+12>>2]=$,q[$+8>>2]=v;else if(v=(v=q[(ca=ba+20|0)>>2])||q[(ca=ba+16|0)>>2]){for(;ea=ca,(v=q[(ca=($=v)+20|0)>>2])||(ca=$+16|0,v=q[$+16>>2]););q[ea>>2]=0}else $=0;if(fa){ca=q[ba+28>>2];e:{if(q[(v=8652+(ca<<2)|0)>>2]==(0|ba)){if(q[v>>2]=$)break e;ha=q[2088]&dd(ca),q[2088]=ha;break b}if(!(q[fa+(q[fa+16>>2]==(0|ba)?16:20)>>2]=$))break b}q[$+24>>2]=fa,(v=q[ba+16>>2])&&(q[$+16>>2]=v,q[v+24>>2]=$),(v=q[ba+20>>2])&&(q[$+20>>2]=v,q[v+24>>2]=$)}}else if(3==(3&($=q[4+da>>2])))return q[2089]=a,q[4+da>>2]=-2&$,q[ba+4>>2]=1|a,q[a+ba>>2]=a}if(!(da>>>0<=ba>>>0)&&1&($=q[4+da>>2])){f:{if(!(2&$)){if(q[2093]==(0|da)){if(q[2093]=ba,a=q[2090]+a|0,q[2090]=a,q[ba+4>>2]=1|a,q[2092]!=(0|ba))break a;return q[2089]=0,q[2092]=0}if(q[2092]==(0|da))return q[2092]=ba,a=q[2089]+a|0,q[2089]=a,q[ba+4>>2]=1|a,q[a+ba>>2]=a;a=(-8&$)+a|0;g:if($>>>0<=255)$>>>=3,(0|(v=q[8+da>>2]))==(0|(ca=q[12+da>>2]))?(ha=q[2087]&dd($),q[2087]=ha):(q[v+12>>2]=ca,q[ca+8>>2]=v);else{if(fa=q[24+da>>2],(0|da)!=(0|($=q[12+da>>2])))v=q[8+da>>2],q[v+12>>2]=$,q[$+8>>2]=v;else if(v=(v=q[(ca=20+da|0)>>2])||q[(ca=16+da|0)>>2]){for(;ea=ca,(v=q[(ca=($=v)+20|0)>>2])||(ca=$+16|0,v=q[$+16>>2]););q[ea>>2]=0}else $=0;if(fa){ca=q[28+da>>2];j:{if(q[(v=8652+(ca<<2)|0)>>2]==(0|da)){if(q[v>>2]=$)break j;ha=q[2088]&dd(ca),q[2088]=ha;break g}if(!(q[fa+(q[fa+16>>2]==(0|da)?16:20)>>2]=$))break g}q[$+24>>2]=fa,(v=q[16+da>>2])&&(q[$+16>>2]=v,q[v+24>>2]=$),(v=q[20+da>>2])&&(q[$+20>>2]=v,q[v+24>>2]=$)}}if(q[ba+4>>2]=1|a,q[a+ba>>2]=a,q[2092]!=(0|ba))break f;return q[2089]=a}q[4+da>>2]=-2&$,q[ba+4>>2]=1|a,q[a+ba>>2]=a}if(a>>>0<=255)return $=8388+((a>>>=3)<<3)|0,a=(v=q[2087])&(a=1<>2]:(q[2087]=a|v,$),q[$+8>>2]=ba,q[a+12>>2]=ba,q[ba+12>>2]=$,q[ba+8>>2]=a;q[ba+16>>2]=0,v=q[ba+20>>2]=0,(ca=a>>>8)&&(v=31,16777215>>0||(v=ca,v=28+((v=((v=(v<<=ca=ca+1048320>>>16&8)<<(fa=v+520192>>>16&4))<<(ea=v+245760>>>16&2)>>>15)-(ea|ca|fa)|0)<<1|a>>>v+21&1)|0)),ea=8652+((q[($=ba)+28>>2]=v)<<2)|0;m:if((ca=q[2088])&($=1<>>1)|0),$=q[ea>>2];n:{for(;;){if((-8&q[(v=$)+4>>2])==(0|a))break n;if($=ca>>>29,ca<<=1,!($=q[16+(ea=v+(4&$)|0)>>2]))break}q[ea+16>>2]=ba,q[ba+12>>2]=ba,q[ba+24>>2]=v,q[ba+8>>2]=ba;break m}a=q[v+8>>2],q[a+12>>2]=ba,q[v+8>>2]=ba,q[ba+24>>2]=0,q[ba+12>>2]=v,q[ba+8>>2]=a}else q[2088]=$|ca,q[ea>>2]=ba,q[ba+12>>2]=ba,q[ba+24>>2]=ea,q[ba+8>>2]=ba;if(a=q[2095]+-1|0,!(q[2095]=a)){for(ba=8804;ba=(a=q[ba>>2])+8|0,a;);q[2095]=-1}}}}function qa(a){var sa,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,ua=0;L=sa=L-16|0;a:{b:{c:{d:{e:{f:{g:{h:{i:{j:{k:{if(a>>>0<=244){if(3&(ia=(ma=q[2087])>>>(a=(na=a>>>0<11?16:a+11&-8)>>>3))){a=(ia=q[8396+(la=(ja=a+(1&(-1^ia))|0)<<3)>>2])+8|0,(0|(ka=q[ia+8>>2]))==(0|(la=la+8388|0))?(ua=dd(ja)&ma,q[2087]=ua):(q[ka+12>>2]=la,q[la+8>>2]=ka),q[ia+4>>2]=3|(ja<<=3),q[4+(ia=ia+ja|0)>>2]=1|q[ia+4>>2];break a}if(na>>>0<=(pa=q[2089])>>>0)break k;if(ia){ja=ia=(a=(0-(a=(0-(ja=2<>>12&16,ia=q[8396+(ka=(ja=((ja=(ja|=ia=(a>>>=ia)>>>5&8)|(ia=(a>>>=ia)>>>2&4)|(ia=(a>>>=ia)>>>1&2))|(ia=(a>>>=ia)>>>1&1))+(a>>>ia)|0)<<3)>>2],(0|(a=q[ia+8>>2]))==(0|(ka=ka+8388|0))?(ma=dd(ja)&ma,q[2087]=ma):(q[a+12>>2]=ka,q[ka+8>>2]=a),a=ia+8|0,q[ia+4>>2]=3|na,q[4+(oa=ia+na|0)>>2]=1|(la=(ja<<=3)-na|0),q[ia+ja>>2]=la,pa&&(ia=8388+((ja=pa>>>3)<<3)|0,ka=q[2092],ja=(ja=1<>2]:(q[2087]=ja|ma,ia),q[ia+8>>2]=ka,q[ja+12>>2]=ka,q[ka+12>>2]=ia,q[ka+8>>2]=ja),q[2092]=oa,q[2089]=la;break a}if(!(ra=q[2088]))break k;for(ja=ia=(a=(ra&0-ra)-1|0)>>>12&16,ia=q[8652+(((ja=(ja|=ia=(a>>>=ia)>>>5&8)|(ia=(a>>>=ia)>>>2&4)|(ia=(a>>>=ia)>>>1&2))|(ia=(a>>>=ia)>>>1&1))+(a>>>ia)<<2)>>2],ka=(-8&q[ia+4>>2])-na|0,ja=ia;a=(a=q[ja+16>>2])||q[ja+20>>2];)ka=(ja=(la=(-8&q[a+4>>2])-na|0)>>>0>>0)?la:ka,ia=ja?a:ia,ja=a;if(qa=q[ia+24>>2],(0|(la=q[ia+12>>2]))!=(0|ia)){a=q[ia+8>>2],q[a+12>>2]=la,q[la+8>>2]=a;break b}if(!(a=q[(ja=ia+20|0)>>2])){if(!(a=q[ia+16>>2]))break j;ja=ia+16|0}for(;oa=ja,(a=q[(ja=(la=a)+20|0)>>2])||(ja=la+16|0,a=q[la+16>>2]););q[oa>>2]=0;break b}if(na=-1,!(4294967231>>0)&&(na=-8&(ia=a+11|0),pa=q[2088])){ja=0-na|0,ma=0,(ia>>>=8)&&(ma=31,16777215>>0||(ma=28+((a=((ma=(ia<<=ka=ia+1048320>>>16&8)<<(a=ia+520192>>>16&4))<<(ia=ma+245760>>>16&2)>>>15)-(ia|a|ka)|0)<<1|na>>>a+21&1)|0));q:{r:{if(ka=q[8652+(ma<<2)>>2])for(ia=na<<(31==(0|ma)?0:25-(ma>>>1)|0),a=0;;){if(!(ja>>>0<=(oa=(-8&q[ka+4>>2])-na|0)>>>0||(la=ka,ja=oa))){ja=0,a=ka;break r}if(oa=q[ka+20>>2],ka=q[16+((ia>>>29&4)+ka|0)>>2],a=oa&&(0|oa)!=(0|ka)?oa:a,ia<<=0!=(0|ka),!ka)break}else a=0;if(!(a|la)){if(!(a=(0-(a=2<>>12&16,a=q[8652+(((ka=(ka|=ia=(a>>>=ia)>>>5&8)|(ia=(a>>>=ia)>>>2&4)|(ia=(a>>>=ia)>>>1&2))|(ia=(a>>>=ia)>>>1&1))+(a>>>ia)<<2)>>2]}if(!a)break q}for(;ja=(ia=(ka=(-8&q[a+4>>2])-na|0)>>>0>>0)?ka:ja,la=ia?a:la,a=(ia=q[a+16>>2])||q[a+20>>2];);}if(!(!la|ja>>>0>=q[2089]-na>>>0)){if(oa=q[la+24>>2],(0|la)!=(0|(ia=q[la+12>>2]))){a=q[la+8>>2],q[a+12>>2]=ia,q[ia+8>>2]=a;break c}if(!(a=q[(ka=la+20|0)>>2])){if(!(a=q[la+16>>2]))break i;ka=la+16|0}for(;ma=ka,(a=q[(ka=(ia=a)+20|0)>>2])||(ka=ia+16|0,a=q[ia+16>>2]););q[ma>>2]=0;break c}}}if(na>>>0<=(ia=q[2089])>>>0){a=q[2092],16<=(ja=ia-na|0)>>>0?(q[2089]=ja,q[2092]=ka=a+na|0,q[ka+4>>2]=1|ja,q[a+ia>>2]=ja,q[a+4>>2]=3|na):(q[2092]=0,q[2089]=0,q[a+4>>2]=3|ia,q[4+(ia=a+ia|0)>>2]=1|q[ia+4>>2]),a=a+8|0;break a}if(na>>>0<(ka=q[2090])>>>0){q[2090]=ia=ka-na|0,a=q[2093],q[2093]=ja=a+na|0,q[ja+4>>2]=1|ia,q[a+4>>2]=3|na,a=a+8|0;break a}if((ja=(ma=(ja=la=na+47|(a=0))+(ia=q[2205]?q[2207]:(q[2208]=-1,q[2209]=-1,q[2206]=4096,q[2207]=4096,q[2205]=12+sa&-16^1431655768,q[2210]=0,q[2198]=0,4096))|0)&(oa=0-ia|0))>>>0<=na>>>0)break a;if((ia=q[2197])&&(qa=(pa=q[2195])+ja|0)>>>0<=pa>>>0|ia>>>0>>0)break a;if(4&r[8792])break f;v:{w:{if(ia=q[2093])for(a=8796;;){if((pa=q[a>>2])+q[a+4>>2]>>>0>ia>>>0&&pa>>>0<=ia>>>0)break w;if(!(a=q[a+8>>2]))break}if(-1==(0|(ia=ea(0))))break g;if(ma=ja,(ma=(ka=(a=q[2206])+-1|0)&ia?(ja-ia|0)+(ia+ka&0-a)|0:ma)>>>0<=na>>>0|2147483646>>0)break g;if((a=q[2197])&&(oa=(ka=q[2195])+ma|0)>>>0<=ka>>>0|a>>>0>>0)break g;if((0|ia)!=(0|(a=ea(ma))))break v;break e}if(2147483646<(ma=oa&ma-ka)>>>0)break g;if((0|(ia=ea(ma)))==(q[a>>2]+q[a+4>>2]|0))break h;a=ia}if(!(na+48>>>0<=ma>>>0|2147483646>>0|-1==(0|(ia=a)))){if(2147483646<(a=(a=q[2207])+(la-ma|0)&0-a)>>>0)break e;if(-1!=(0|ea(a))){ma=a+ma|0;break e}ea(0-ma|0);break g}if(-1!=(0|ia))break e;break g}la=0;break b}ia=0;break c}if(-1!=(0|ia))break e}q[2198]=4|q[2198]}if(2147483646>>0)break d;if(ia=ea(ja),(a=ea(0))>>>0<=ia>>>0|-1==(0|ia)|-1==(0|a))break d;if((ma=a-ia|0)>>>0<=na+40>>>0)break d}a=q[2195]+ma|0,(q[2195]=a)>>>0>t[2196]&&(q[2196]=a);x:{y:{z:{if(ja=q[2093]){for(a=8796;;){if(((ka=q[a>>2])+(la=q[a+4>>2])|0)==(0|ia))break z;if(!(a=q[a+8>>2]))break}break y}for((a=q[2091])>>>0<=ia>>>0&&a||(q[2091]=ia),a=0,q[2200]=ma,q[2199]=ia,q[2095]=-1,q[2096]=q[2205],q[2202]=0;q[8396+(ja=a<<3)>>2]=ka=ja+8388|0,q[ja+8400>>2]=ka,32!=(0|(a=a+1|0)););q[2090]=ka=(a=ma+-40|0)-(ja=ia+8&7?-8-ia&7:0)|0,q[2093]=ja=ia+ja|0,q[ja+4>>2]=1|ka,q[4+(a+ia|0)>>2]=40,q[2094]=q[2209];break x}if(!(8&r[a+12|0]|ia>>>0<=ja>>>0|ja>>>0>>0)){q[a+4>>2]=la+ma,q[2093]=ia=(a=ja+8&7?-8-ja&7:0)+ja|0,ka=q[2090]+ma|0,q[2090]=a=ka-a|0,q[ia+4>>2]=1|a,q[4+(ja+ka|0)>>2]=40,q[2094]=q[2209];break x}}ia>>>0<(la=q[2091])>>>0&&(q[2091]=ia,la=0),ka=ia+ma|0,a=8796;A:{B:{C:{D:{E:{F:{for(;(0|ka)!=q[a>>2];)if(!(a=q[a+8>>2]))break F;if(!(8&r[a+12|0]))break E}for(a=8796;;){if((ka=q[a>>2])>>>0<=ja>>>0&&ja>>>0<(la=ka+q[a+4>>2]|0)>>>0)break D;a=q[a+8>>2]}}if(q[a>>2]=ia,q[a+4>>2]=q[a+4>>2]+ma,q[4+(qa=(ia+8&7?-8-ia&7:0)+ia|0)>>2]=3|na,a=((ia=ka+(ka+8&7?-8-ka&7:0)|0)-qa|0)-na|0,oa=na+qa|0,(0|ia)==(0|ja)){q[2093]=oa,a=q[2090]+a|0,q[2090]=a,q[oa+4>>2]=1|a;break B}if(q[2092]==(0|ia)){q[2092]=oa,a=q[2089]+a|0,q[2089]=a,q[oa+4>>2]=1|a,q[a+oa>>2]=a;break B}if(1==(3&(ja=q[ia+4>>2]))){ra=-8&ja;G:if(ja>>>0<=255)la=ja>>>3,ja=q[ia+8>>2],(0|(ka=q[ia+12>>2]))==(0|ja)?(ua=q[2087]&dd(la),q[2087]=ua):(q[ja+12>>2]=ka,q[ka+8>>2]=ja);else{if(pa=q[ia+24>>2],(0|(ma=q[ia+12>>2]))!=(0|ia))ja=q[ia+8>>2],q[ja+12>>2]=ma,q[ma+8>>2]=ja;else if(na=(na=q[(ka=ia+20|0)>>2])||q[(ka=ia+16|0)>>2]){for(;ja=ka,(na=q[(ka=(ma=na)+20|0)>>2])||(ka=ma+16|0,na=q[ma+16>>2]););q[ja>>2]=0}else ma=0;if(pa){ja=q[ia+28>>2];J:{if(q[(ka=8652+(ja<<2)|0)>>2]==(0|ia)){if(q[ka>>2]=ma)break J;ua=q[2088]&dd(ja),q[2088]=ua;break G}if(!(q[pa+(q[pa+16>>2]==(0|ia)?16:20)>>2]=ma))break G}q[ma+24>>2]=pa,(ja=q[ia+16>>2])&&(q[ma+16>>2]=ja,q[ja+24>>2]=ma),(ja=q[ia+20>>2])&&(q[ma+20>>2]=ja,q[ja+24>>2]=ma)}}ia=ia+ra|0,a=a+ra|0}if(q[ia+4>>2]=-2&q[ia+4>>2],q[oa+4>>2]=1|a,(q[a+oa>>2]=a)>>>0<=255){a=8388+((ia=a>>>3)<<3)|0,ia=(ja=q[2087])&(ia=1<>2]:(q[2087]=ia|ja,a),q[a+8>>2]=oa,q[ia+12>>2]=oa,q[oa+12>>2]=a,q[oa+8>>2]=ia;break B}if(ia=0,(ka=a>>>8)&&(ia=31,16777215>>0||(ia=28+((ia=((na=(ka<<=la=ka+1048320>>>16&8)<<(ia=ka+520192>>>16&4))<<(ka=na+245760>>>16&2)>>>15)-(ka|ia|la)|0)<<1|a>>>ia+21&1)|0)),q[(ja=oa)+28>>2]=ia,q[oa+16>>2]=0,ja=8652+(ia<<2)|(q[oa+20>>2]=0),(ka=q[2088])&(la=1<>>1)|0),ia=q[ja>>2];;){if((-8&q[(ja=ia)+4>>2])==(0|a))break C;if(ia=ka>>>29,ka<<=1,!(ia=q[16+(la=(4&ia)+ja|0)>>2]))break}q[la+16>>2]=oa}else q[2088]=ka|la,q[ja>>2]=oa;q[oa+24>>2]=ja,q[oa+12>>2]=oa,q[oa+8>>2]=oa;break B}for(q[2090]=oa=(a=ma+-40|0)-(ka=ia+8&7?-8-ia&7:0)|0,q[2093]=ka=ia+ka|0,q[ka+4>>2]=1|oa,q[4+(a+ia|0)>>2]=40,q[2094]=q[2209],q[(ka=(a=(la+(la+-39&7?39-la&7:0)|0)-47|0)>>>0>>0?ja:a)+4>>2]=27,a=q[2202],q[ka+16>>2]=q[2201],q[ka+20>>2]=a,a=q[2200],q[ka+8>>2]=q[2199],q[ka+12>>2]=a,q[2201]=ka+8,q[2200]=ma,q[2199]=ia,a=ka+24|(q[2202]=0);q[a+4>>2]=7,ia=a+8|0,a=a+4|0,ia>>>0>>0;);if((0|ja)==(0|ka))break x;if(q[ka+4>>2]=-2&q[ka+4>>2],q[ja+4>>2]=1|(la=ka-ja|0),(q[ka>>2]=la)>>>0<=255){a=8388+((ia=la>>>3)<<3)|0,ia=(ka=q[2087])&(ia=1<>2]:(q[2087]=ia|ka,a),q[a+8>>2]=ja,q[ia+12>>2]=ja,q[ja+12>>2]=a,q[ja+8>>2]=ia;break x}if(q[ja+16>>2]=0,a=q[ja+20>>2]=0,(ka=la>>>8)&&(a=31,16777215>>0||(a=28+((a=((oa=(ka<<=ma=ka+1048320>>>16&8)<<(a=ka+520192>>>16&4))<<(ka=oa+245760>>>16&2)>>>15)-(ka|a|ma)|0)<<1|la>>>a+21&1)|0)),ia=8652+((q[(ia=ja)+28>>2]=a)<<2)|0,(ka=q[2088])&(ma=1<>>1)|0),ia=q[ia>>2];;){if((0|la)==(-8&q[(ka=ia)+4>>2]))break A;if(ia=a>>>29,a<<=1,!(ia=q[16+(ma=ka+(4&ia)|0)>>2]))break}q[ma+16>>2]=ja,q[ja+24>>2]=ka}else q[2088]=ka|ma,q[ia>>2]=ja,q[ja+24>>2]=ia;q[ja+12>>2]=ja,q[ja+8>>2]=ja;break x}a=q[ja+8>>2],q[a+12>>2]=oa,q[ja+8>>2]=oa,q[oa+24>>2]=0,q[oa+12>>2]=ja,q[oa+8>>2]=a}a=qa+8|0;break a}a=q[ka+8>>2],q[a+12>>2]=ja,q[ka+8>>2]=ja,q[ja+24>>2]=0,q[ja+12>>2]=ka,q[ja+8>>2]=a}if(!((a=q[2090])>>>0<=na>>>0)){q[2090]=ia=a-na|0,a=q[2093],q[2093]=ja=a+na|0,q[ja+4>>2]=1|ia,q[a+4>>2]=3|na,a=a+8|0;break a}}q[2086]=48,a=0;break a}Q:if(oa){a=q[la+28>>2];R:{if(q[(ka=8652+(a<<2)|0)>>2]==(0|la)){if(q[ka>>2]=ia)break R;pa=dd(a)&pa,q[2088]=pa;break Q}if(!(q[oa+(q[oa+16>>2]==(0|la)?16:20)>>2]=ia))break Q}q[ia+24>>2]=oa,(a=q[la+16>>2])&&(q[ia+16>>2]=a,q[a+24>>2]=ia),(a=q[la+20>>2])&&(q[ia+20>>2]=a,q[a+24>>2]=ia)}S:if(ja>>>0<=15)q[la+4>>2]=3|(a=ja+na|0),q[4+(a=a+la|0)>>2]=1|q[a+4>>2];else if(q[la+4>>2]=3|na,q[4+(ka=la+na|0)>>2]=1|ja,(q[ja+ka>>2]=ja)>>>0<=255)a=8388+((ia=ja>>>3)<<3)|0,ia=(ja=q[2087])&(ia=1<>2]:(q[2087]=ia|ja,a),q[a+8>>2]=ka,q[ia+12>>2]=ka,q[ka+12>>2]=a,q[ka+8>>2]=ia;else{a=0,(na=ja>>>8)&&(a=31,16777215>>0||(a=28+((a=((oa=(na<<=ma=na+1048320>>>16&8)<<(a=na+520192>>>16&4))<<(na=oa+245760>>>16&2)>>>15)-(na|a|ma)|0)<<1|ja>>>a+21&1)|0)),q[(ia=ka)+28>>2]=a,q[ka+16>>2]=0,ia=8652+(a<<2)|(q[ka+20>>2]=0);V:{if((na=1<>>1)|0),na=q[ia>>2];;){if((-8&q[(ia=na)+4>>2])==(0|ja))break V;if(na=a>>>29,a<<=1,!(na=q[16+(ma=(4&na)+ia|0)>>2]))break}q[ma+16>>2]=ka}else q[2088]=na|pa,q[ia>>2]=ka;q[ka+24>>2]=ia,q[ka+12>>2]=ka,q[ka+8>>2]=ka;break S}a=q[ia+8>>2],q[a+12>>2]=ka,q[ia+8>>2]=ka,q[ka+24>>2]=0,q[ka+12>>2]=ia,q[ka+8>>2]=a}a=la+8|0;break a}X:if(qa){a=q[ia+28>>2];Y:{if(q[(ja=8652+(a<<2)|0)>>2]==(0|ia)){if(q[ja>>2]=la)break Y;ua=dd(a)&ra,q[2088]=ua;break X}if(!(q[qa+(q[qa+16>>2]==(0|ia)?16:20)>>2]=la))break X}q[la+24>>2]=qa,(a=q[ia+16>>2])&&(q[la+16>>2]=a,q[a+24>>2]=la),(a=q[ia+20>>2])&&(q[la+20>>2]=a,q[a+24>>2]=la)}ka>>>0<=15?(q[ia+4>>2]=3|(a=ka+na|0),q[4+(a=a+ia|0)>>2]=1|q[a+4>>2]):(q[ia+4>>2]=3|na,q[4+(na=ia+na|0)>>2]=1|ka,q[ka+na>>2]=ka,pa&&(a=8388+((ja=pa>>>3)<<3)|0,la=q[2092],ja=(ja=1<>2]:(q[2087]=ja|ma,a),q[a+8>>2]=la,q[ja+12>>2]=la,q[la+12>>2]=a,q[la+8>>2]=ja),q[2092]=na,q[2089]=ka),a=ia+8|0}return L=16+sa|0,a}function ra(a,va,wa,xa,ya,za,Aa){var Qa,Ta,Ba,Ca=0,Da=0,Fa=0,Ia=0,Ja=0,Ka=0,Ma=0,Na=0,Oa=0,Pa=0,Ra=0,Sa=0;q[76+(L=Ba=L-80|0)>>2]=va,Ta=55+Ba|0,Qa=56+Ba|0,va=0;a:{b:{c:for(;;){(0|Oa)<0||(Oa=(2147483647-Oa|0)<(0|va)?(q[2086]=61,-1):va+Oa|0);e:{f:{g:{h:{i:{j:{k:{l:{m:{n:{o:{p:{q:{if(Ia=q[76+Ba>>2],Fa=r[0|(va=Ia)]){for(;;){r:{s:{t:if(Ca=255&Fa){if(37!=(0|Ca))break s;for(Fa=va;;){if(37!=r[va+1|0])break t;if(q[76+Ba>>2]=Ca=va+2|0,Fa=Fa+1|0,Da=r[va+2|0],va=Ca,37!=(0|Da))break}}else Fa=va;if(va=Fa-Ia|0,a&&Z(a,Ia,va),va)continue c;Pa=-1,Ja=!ha(o[q[76+(Ca=Ba)>>2]+(Fa=1)|0]),va=q[76+Ba>>2],Ja|36!=r[va+2|0]||(Pa=o[va+1|0]+-48|0,Ra=1,Fa=3),q[Ca+76>>2]=va=Fa+va|0;u:if(31<(Da=(Ma=o[(Fa=0)|va])+-32|0)>>>0)Ca=va;else if(Ca=va,75913&(Da=1<>2]=Ca=va+1|0,Fa|=Da,31<(Da=(Ma=o[va+1|0])+-32|0)>>>0)break u;if(va=Ca,!(75913&(Da=1<>2],36==r[va+2|0]))q[((o[va+1|0]<<2)+ya|0)-192>>2]=10,Na=q[((o[va+1|0]<<3)+xa|0)-384>>2],Ra=1,va=va+3|0;else{if(Ra)break b;Na=Ra=0,a&&(va=q[wa>>2],q[wa>>2]=va+4,Na=q[va>>2]),va=q[76+Ba>>2]+1|0}q[Ja+76>>2]=va,-1<(0|Na)||(Na=0-Na|0,Fa|=8192)}else{if((0|(Na=Ha(76+Ba|0)))<0)break b;va=q[76+Ba>>2]}if(Da=-1,46==r[0|va])if(42==r[va+1|0])if(ha(o[va+2|0])&&(va=q[76+Ba>>2],36==r[va+3|0]))q[((o[va+2|0]<<2)+ya|0)-192>>2]=10,Da=q[((o[va+2|0]<<3)+xa|0)-384>>2],q[76+Ba>>2]=va=va+4|0;else{if(Ra)break b;Da=a?(va=q[wa>>2],q[wa>>2]=va+4,q[va>>2]):0,va=q[76+Ba>>2]+2|0,q[76+Ba>>2]=va}else q[76+Ba>>2]=va+1,Da=Ha(76+Ba|0),va=q[76+Ba>>2];for(Ca=0;;){if(Sa=Ca,Ka=-1,57>>0)break a;if(q[76+Ba>>2]=Ma=va+1|0,Ca=o[0|va],va=Ma,!((Ca=r[3295+(Ca+w(Sa,58)|0)|0])+-1>>>0<8))break}if(!Ca)break a;A:{B:{C:{if(19==(0|Ca)){if((0|Pa)<=-1)break C;break a}if((0|Pa)<0)break B;q[(Pa<<2)+ya>>2]=Ca,Ca=q[4+(va=(Pa<<3)+xa|0)>>2],q[64+Ba>>2]=q[va>>2],q[68+Ba>>2]=Ca}if(va=0,a)break A;continue c}if(!a)break e;Ga(64+Ba|0,Ca,wa,Aa),Ma=q[76+Ba>>2]}if(Ja=-65537&Fa,Fa=8192&Fa?Ja:Fa,Pa=3336,Ca=Qa,va=o[Ma+-1|(Ka=0)],(Ma=(va=Sa&&3==(15&va)?-33&va:va)+-88|0)>>>0<=32)break r;D:{E:{F:{G:{if(6<(Ja=va+-65|0)>>>0){if(83!=(0|va))break f;if(!Da)break G;Ca=q[64+Ba>>2];break E}switch(Ja-1|0){case 1:break F;case 0:case 2:break f;default:break q}}_(a,32,Na,va=0,Fa);break D}q[12+Ba>>2]=0,q[8+Ba>>2]=q[64+Ba>>2],q[64+Ba>>2]=8+Ba,Da=-1,Ca=8+Ba|0}va=0;H:{for(;;){if(!(Ia=q[Ca>>2]))break H;if((Ja=(0|(Ia=Ea(4+Ba|0,Ia)))<0)|Da-va>>>0>>0)break;if(Ca=Ca+4|0,!((va=va+Ia|0)>>>0>>0))break H}if(Ka=-1,Ja)break a}if(_(a,32,Na,va,Fa),va)for(Da=0,Ca=q[64+Ba>>2];;){if(!(Ia=q[Ca>>2]))break D;if((0|va)<(0|(Da=(Ia=Ea(4+Ba|0,Ia))+Da|0)))break D;if(Z(a,4+Ba|0,Ia),Ca=Ca+4|0,!(Da>>>0>>0))break}else va=0}_(a,32,Na,va,8192^Fa),va=(0|va)<(0|Na)?Na:va;continue c}q[76+Ba>>2]=Ca=va+1|0,Fa=r[va+1|0],va=Ca;continue}break}switch(Ma-1|0){case 28:break i;case 21:break j;case 23:break l;case 22:break m;case 11:case 16:break n;case 10:break o;case 26:break p;case 8:case 12:case 13:case 14:break q;case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 9:case 15:case 17:case 18:case 19:case 20:case 24:case 25:case 27:case 29:case 30:break f;default:break k}}if(Ka=Oa,a)break a;if(!Ra)break e;for(va=1;;){if(a=q[(va<<2)+ya>>2]){if(Ga((va<<3)+xa|0,a,wa,Aa),10!=(0|(va=va+(Ka=1)|0)))continue;break a}break}if(Ka=1,9>>0)break a;if(Ka=-1,q[(va<<2)+ya>>2])break a;for(;!q[((va=va+1|0)<<2)+ya>>2]&&10!=(0|va););Ka=va>>>0<10?-1:1;break a}va=0|n[za](a,v[64+Ba>>3],Na,Da,Fa,va);continue}Ca=(va=La(Ia=(va=q[64+Ba>>2])||3346,Da))||Da+Ia|0,Fa=Ja,Da=va?va-Ia|0:Da;break f}o[55+Ba|0]=q[64+Ba>>2],Da=1,Ia=Ta,Fa=Ja;break f}if(va=Ja=q[68+Ba>>2],Ia=q[64+Ba>>2],(0|va)<-1||(0|va)<=-1&&!(4294967295>>0)){va=0-(va+(0>>0)|0)|0,q[64+Ba>>2]=Ia=0-Ia|0,q[68+Ba>>2]=va,Ka=1,Pa=3336;break h}if(2048&Fa){Ka=1,Pa=3337;break h}Pa=(Ka=1&Fa)?3338:3336;break h}if(Ia=function(a,Il,Rm){if(a|Il)for(;o[0|(Rm=Rm+-1|0)]=7&a|48,(a=(7&Il)<<29|a>>>3)|(Il>>>=3););return Rm}(q[64+Ba>>2],q[68+Ba>>2],Qa),!(8&Fa))break g;Da=(0|(va=Qa-Ia|0))<(0|Da)?Da:va+1|0;break g}Da=8>>0?Da:8,Fa|=8,va=120}if(Ia=function(a,Il,Rm,Sm){if(a|Il)for(;o[0|(Rm=Rm+-1|0)]=r[3824+(15&a)|0]|Sm,(a=(15&Il)<<28|a>>>4)|(Il>>>=4););return Rm}(q[64+Ba>>2],q[68+Ba>>2],Qa,32&va),!(8&Fa)|!(q[64+Ba>>2]|q[68+Ba>>2]))break g;Pa=3336+(va>>>4)|0,Ka=2;break g}if(7<(Ca=255&Sa)>>>(va=0))continue;switch(Ca-1|0){default:case 0:q[q[64+Ba>>2]>>2]=Oa;continue;case 1:Ca=q[64+Ba>>2],q[Ca>>2]=Oa,q[Ca+4>>2]=Oa>>31;continue;case 2:p[q[64+Ba>>2]>>1]=Oa;continue;case 3:o[q[64+Ba>>2]]=Oa;continue;case 5:q[q[64+Ba>>2]>>2]=Oa;continue;case 4:continue;case 6:}Ca=q[64+Ba>>2],q[Ca>>2]=Oa,q[Ca+4>>2]=Oa>>31;continue}Ia=q[64+Ba>>2],va=q[68+Ba>>2],Pa=3336}Ia=ga(Ia,va,Qa)}Fa=-1<(0|Da)?-65537&Fa:Fa,Da=!!((Ja=va=q[68+Ba>>2])|(Ma=q[64+Ba>>2]))|Da?(0|(va=!(Ja|Ma)+(Qa-Ia|0)|0))<(0|Da)?Da:va:(Ia=Qa,0)}_(a,32,va=(0|Na)<(0|(Ca=(Da=(0|Da)<(0|(Ja=Ca-Ia|0))?Ja:Da)+Ka|0))?Ca:Na,Ca,Fa),Z(a,Pa,Ka),_(a,48,va,Ca,65536^Fa),_(a,48,Da,Ja,0),Z(a,Ia,Ja),_(a,32,va,Ca,8192^Fa);continue}break}Ka=0;break a}Ka=-1}return L=80+Ba|0,Ka}function sa(a){var ya,va=0,wa=0,xa=0,za=0,xa=4,wa=1439;a:if(va=r[0|a]){for(;!((0|(ya=r[0|wa]))!=(0|va)||!(xa=xa+-1|0)|!ya);)if(wa=wa+1|0,va=r[a+1|0],a=a+1|0,!va)break a;za=va}return(255&za)-r[0|wa]|0}function ta(a,Aa,Ea){var La,Ga,Ha=0,Ua=0,Va=0;q[(L=Ga=L-240|0)>>2]=a,Ua=1;a:if(!((0|Aa)<2))for(Ha=a;;){if(Ha=(La=Ha+-4|0)-q[((Va=Aa+-2|0)<<2)+Ea>>2]|0,0<=(0|n[5](a,Ha))&&-1<(0|n[5](a,La)))break a;if(a=(Ua<<2)+Ga|0,0<=(0|n[5](Ha,La))?(q[a>>2]=Ha,Va=Aa+-1|0):Ha=q[a>>2]=La,Ua=Ua+1|0,(0|Va)<2)break a;a=q[Ga>>2],Aa=Va}Na(Ga,Ua),L=240+Ga|0}function ua(a){var Ea,ab,Aa=0;if(x(0),function(a){var Vg,Wg;q[a+428>>2]&&(Wg=q[a+332>>2],$(q[a+460>>2],q[a+436>>2],Vg=Wg<<2),$(q[a+464>>2],q[a+440>>2],Vg),$(q[a+468>>2],q[a+448>>2],Vg),r[q[a>>2]+4|0]<4||($(q[a+472>>2],q[a+452>>2],Vg=Wg<<4),$(q[a+476>>2],q[a+456>>2],Vg)))}(a),function(a){var ke,le,me,fe=0,ge=x(0),he=x(0),ie=0,je=x(0);x(0),x(0);if(1<=(0|(ie=q[a>>2])))for(me=(fe=q[a+4>>2])+w(ie,52)|0,a=q[a+12>>2];ge=u[a>>2],u[fe+44>>2]!=(ge=(ke=q[fe+16>>2])?(he=ge,ge=u[fe+4>>2],je=u[fe+12>>2],he=x(x(he-ge)/je),le=x(C(he)),ie=x(y(le))>2],he=u[fe+8>>2],ge>2]=ge,q[fe+48>>2]=1):q[fe+48>>2]=0,ke||(u[a>>2]=ge),a=a+4|0,(fe=fe+52|0)>>>0>>0;);}(a+540|0),function(a){var Wd,Xd,ae,ce,de,ee,Rd=0,Sd=0,Td=x(0),Ud=0,Vd=x(0),Yd=(x(0),x(0),0),Zd=x(0),_d=0,$d=0,be=0;x(0);if(1<=(0|(Ud=q[a+540>>2])))for(de=(Yd=q[a+544>>2])+w(Ud,52)|0,ee=q[a+644>>2];;){a:if(!(q[Yd>>2]||(0|(Ud=q[Yd+32>>2]))<1))if(ae=(a=q[Yd+28>>2])+w(Ud,28)|0,ce=u[Yd+24>>2],Xd=u[Yd+20>>2],Wd=u[Yd+44>>2],ee)for(;;){Zd=x($d=0);h:{i:{j:{if((0|(Sd=q[a>>2]))<1)Rd=Ud=0;else if(_d=q[a+4>>2],Vd=u[_d>>2],Td=x(Vd-Xd),1==(0|Sd))Ud=Wd>2],!(Wd>2],Wd>2])break h;break i}Rd=Sd+-1|0,Ud=1}_d=(Sd=(Vd=u[a+12>>2])!=Zd)&(Zd==x(0)|Vd==x(0))|q[a+8>>2]!=(0|Rd),$d=Ud}if(q[a+20>>2]=_d,q[a+24>>2]=Sd,u[a+12>>2]=Zd,q[a+16>>2]=$d,q[a+8>>2]=Rd,!((a=a+28|0)>>>0>>0))break}else{if(!q[Yd+48>>2])for(;;)if(q[a+20>>2]=0,!((a=a+28|(q[a+24>>2]=0))>>>0>>0))break a;for(;;){Zd=x($d=0);b:{c:{d:{e:if(!(((Sd=0)|(Rd=q[(_d=a)>>2]))<1)){if(Ud=q[a+4>>2],Vd=u[Ud>>2],Td=x(Vd-Xd),1!=(0|Rd)){if(!(Wd>2],!(Wd>2],Wd>2]))break b}$d=Ud,be=(Sd=(Vd=u[a+12>>2])!=Zd)&(Zd==x(0)|Vd==x(0))|q[a+8>>2]!=(0|Rd)}if(q[_d+20>>2]=be,q[a+24>>2]=Sd,u[a+12>>2]=Zd,q[a+16>>2]=$d,q[a+8>>2]=Rd,!((a=a+28|0)>>>0>>0))break}}if(!((Yd=Yd+52|0)>>>0>>0))break}}(a),function(a){var rd,sd,td,ud,vd,kd=0,ld=x(0),md=0,nd=0,od=x(0),pd=0,qd=x(0);x(0);if(!(r[q[a>>2]+4|0]<4||(0|(kd=q[a+540>>2]))<1))for(ud=(pd=q[a+544>>2])+w(kd,52)|0,vd=q[a+644>>2];;){b:if(1==q[pd>>2]&&!((0|(kd=q[pd+40>>2]))<1))if(sd=(a=q[pd+36>>2])+w(kd,28)|0,rd=u[pd+44>>2],vd)for(;;){qd=x(kd=0);d:if(!((0|(nd=q[a>>2]))<2||(md=q[a+4>>2],rd<=(ld=u[md>>2])))){kd=1;e:if(!(rd<(od=u[md+4>>2]))){for(;ld=od,(0|nd)!=(0|(kd=kd+1|0));)if(rd<(od=u[md+(kd<<2)>>2]))break e;kd=nd+-1|0;break d}qd=x(x(rd-ld)/x(od-ld)),kd=kd+-1|0}if(ld=u[a+16>>2],u[a+16>>2]=qd,nd=q[a+12>>2],q[a+12>>2]=kd,q[a+24>>2]=md=ld!=qd,q[a+20>>2]=md&(qd==x(0)|ld==x(0))|(0|kd)!=(0|nd),!((a=a+28|0)>>>0>>0))break}else{if(!q[pd+48>>2])for(;;)if(q[a+20>>2]=0,!((a=a+28|(q[a+24>>2]=0))>>>0>>0))break b;for(;;){qd=x(nd=0);c:if(!((0|(td=q[a>>2]))<2||(md=q[a+4>>2],rd<=(ld=u[md>>2])))){if(kd=1,!(rd<(od=u[md+4>>2])))for(nd=td+-1|0;;){if(ld=od,(0|kd)==(0|nd))break c;if(rd<(od=u[md+((kd=kd+1|0)<<2)>>2]))break}qd=x(x(rd-ld)/x(od-ld)),nd=kd+-1|0}if(ld=u[a+16>>2],u[a+16>>2]=qd,kd=q[a+12>>2],q[a+12>>2]=nd,q[a+24>>2]=md=ld!=qd,q[a+20>>2]=md&(qd==x(0)|ld==x(0))|(0|kd)!=(0|nd),!((a=a+28|0)>>>0>>0))break}}if(!((pd=pd+52|0)>>>0>>0))break}}(a),function(a){var Id,Jd,Md,Nd,Od,Pd,Qd,wd=0,xd=0,yd=0,zd=0,Ad=0,Bd=0,Cd=0,Dd=x(0),Ed=0,Gd=0,Hd=0,Kd=0,Ld=0;if(1<=(0|(xd=q[a+564>>2])))for(Pd=(Ad=q[a+568>>2])+w(xd,36)|0,Nd=q[a+644>>2];;){a:{if(!(Bd=((yd=zd=xd=0)|(Jd=q[Ad+4>>2]))<1))for(Ed=q[Ad>>2],a=Kd=0;;){if(wd=q[Ed+(a<<2)>>2],q[wd+16>>2]){wd=1,Ld=0;break a}if(yd=yd||q[wd+24>>2],xd=xd||q[wd+20>>2],zd=(u[wd+12>>2]!=x(0))+zd|0,(0|Jd)==(0|(a=a+1|0)))break}if(wd=0,(Kd=Nd?1:yd)|(Ld=Nd?1:xd)&&(q[Ad+12>>2]=Ed=1<>2],Od=q[Ad>>2],yd=(a=q[Ad+16>>2])+(Cd=Ed<<2)|0,yd=ca(a,0,4+((-1^a)+((a=a+4|0)>>>0>>0?yd:a)|0)&-4),Cd=xd+Cd|0,a=xd;q[a>>2]=1065353216,(a=a+4|0)>>>0>>0;);if(!Bd){if(Bd=0,Cd=wd=1,zd)for(;;){if(zd=q[(Bd<<2)+Od>>2],Gd=q[zd+8>>2],Hd=w(Gd,wd),(Dd=u[zd+12>>2])!=x(a=0)){for(q[yd>>2]=Hd+q[yd>>2],u[xd>>2]=x(x(1)-Dd)*u[xd>>2],Gd=w(Gd+(a=1)|0,wd);Dd=u[zd+12>>2],Qd=q[(Md=(Id=a<<2)+yd|0)>>2],q[Md>>2]=Qd+((Md=a&Cd)?Gd:Hd),u[(Id=xd+Id|0)>>2]=(Md?Dd:x(x(1)-Dd))*u[Id>>2],(0|Ed)!=(0|(a=a+1|0)););Cd<<=1}else for(;q[(Gd=yd+(a<<2)|0)>>2]=Hd+q[Gd>>2],(0|Ed)!=(0|(a=a+1|0)););if(wd=w(q[zd>>2],wd),(0|Jd)==(0|(Bd=Bd+1|0)))break}else for(;;){if(zd=q[(Bd<<2)+Od>>2],Cd=w(q[zd+8>>2],wd),(Dd=u[zd+12>>2])!=x(a=0))q[yd>>2]=Cd+q[yd>>2],u[xd>>2]=x(x(1)-Dd)*u[xd>>2];else for(;q[(Hd=yd+(a<<2)|0)>>2]=Cd+q[Hd>>2],(0|Ed)!=(0|(a=a+1|0)););if(wd=w(q[zd>>2],wd),(0|Jd)==(0|(Bd=Bd+1|0)))break}wd=0}}}if(q[Ad+32>>2]=wd,q[Ad+24>>2]=Ld,q[Ad+28>>2]=Kd,!((Ad=Ad+36|0)>>>0>>0))break}}(a),function(a){var gd,hd,id,jd,Wc=x(0),Xc=0,Yc=0,Zc=0,_c=0,$c=0,ad=x(0),bd=x(0),cd=x(0),dd=0,ed=0,fd=0;if(!(r[q[a>>2]+4|0]<4||(0|(Xc=q[a+588>>2]))<1))for(jd=(Zc=q[a+592>>2])+w(Xc,48)|0,gd=q[a+644>>2];;){if(a=q[Zc>>2],(ed=gd?1:q[a+20>>2])|(fd=gd?1:q[a+24>>2])){c:{d:{$c=Zc,_c=q[a+8>>2],Xc=q[a+12>>2],Wc=u[a+16>>2],a=(0|_c)!=(0|Xc);e:{if(Wc!=x(0)){if(a=Xc+1|0,(0|Xc)==(0|_c)){q[Zc+8>>2]=ed=1,Wc=x(x(1)-Wc),fd=1;break e}a=(0|a)==(0|_c)?1:2}if(q[$c+8>>2]=a,!fd)break d;a=Xc}u[Zc+24>>2]=Wc,u[Zc+20>>2]=x(1)-Wc;break c}fd=0,a=Xc}ed?(q[Zc+12>>2]=a,q[Zc+16>>2]=a+1):ed=0}else ed=fd=0;g:if((0|(hd=q[Zc+36>>2]))<1)cd=x(1);else{if(id=q[Zc+40>>2],a=0,cd=x(1),!gd)for(;;){h:{i:{if(Xc=q[(a<<2)+id>>2],Yc=q[Xc>>2]){if(!q[Yc+48>>2]){Wc=u[Xc+16>>2];break h}if((0|(_c=q[Xc+12>>2]))<1){Wc=x(1),u[Xc+16>>2]=1;break h}if(dd=q[Xc+8>>2],1!=(0|_c)&&(ad=u[Yc+44>>2],$c=q[Xc+4>>2],!(ad<=(bd=u[$c>>2]))))break i;Wc=u[dd>>2],u[Xc+16>>2]=Wc;break h}q[Xc+16>>2]=1065353216,Wc=x(1);break h}Yc=1;j:if(!(ad<(Wc=u[$c+4>>2]))){for(;bd=Wc,(0|_c)!=(0|(Yc=Yc+1|0));)if(ad<(Wc=u[$c+(Yc<<2)>>2]))break j;Wc=u[(dd+(_c<<2)|0)-4>>2],u[Xc+16>>2]=Wc;break h}$c=Xc,Wc=x(x(ad-bd)/x(Wc-bd)),Wc=x(x(Wc*u[(Xc=dd+(Yc<<2)|0)>>2])+x(u[Xc+-4>>2]*x(x(1)-Wc))),u[$c+16>>2]=Wc}if(cd=cd>2],Yc=q[Xc>>2],Wc=x(1);l:if(Yc&&(dd=q[Xc+12>>2],Wc=x(1),!((0|dd)<1))&&(_c=q[Xc+8>>2],Wc=u[_c>>2],1!=(0|dd))){m:{if(ad=u[Yc+44>>2],$c=q[Xc+4>>2],ad<=(bd=u[$c>>2])){Wc=u[_c>>2];break l}if(Yc=1,!(ad<(Wc=u[$c+4>>2]))){for(;bd=Wc,(0|dd)!=(0|(Yc=Yc+1|0));)if(ad<(Wc=u[$c+(Yc<<2)>>2]))break m;Wc=u[(_c+(dd<<2)|0)-4>>2];break l}}Wc=x(x(ad-bd)/x(Wc-bd)),Wc=x(x(Wc*u[(Yc=_c+(Yc<<2)|0)>>2])+x(u[Yc+-4>>2]*x(x(1)-Wc)))}if(cd=cd<(u[Xc+16>>2]=Wc)?cd:Wc,(0|hd)==(0|(a=a+1|0)))break}}if(q[Zc+32>>2]=fd,q[Zc+28>>2]=ed,u[Zc+44>>2]=cd,!((Zc=Zc+48|0)>>>0>>0))break}}(a),1<=(0|(Ea=q[a+4>>2])))for(Ea=(Aa=q[a+52>>2])+(Ea<<2)|0;ab=u[Aa>>2],u[Aa>>2]=ab>>0>>0;);!function(a){var Fe,Ge,He,De=0,Ee=0;if(1<=(0|(Ee=q[a+4>>2])))for(He=(De=q[a+8>>2])+w(Ee,12)|0,a=Fe=q[a+40>>2];Ee=0,q[De+8>>2]&&(Ge=q[De+4>>2],!q[(Ge<<2)+Fe>>2]&&-1!=(0|Ge)||(Ee=!q[q[De>>2]+32>>2])),q[a>>2]=Ee,a=a+4|0,(De=De+12|0)>>>0>>0;);}(a),function(a){var rg,vg,wg,xg,yg,zg,Ag,pg=0,qg=0,sg=0,tg=0,ug=0;if(1<=(0|(vg=q[a+4>>2])))for(xg=q[a+8>>2],wg=q[a>>2],yg=q[wg+724>>2];;){if(rg=q[w(tg,12)+xg>>2],(q[rg+28>>2]||q[rg+24>>2])&&(q[(pg=tg<<2)+q[a+28>>2]>>2]=q[rg+12>>2],q[rg+24>>2])&&!((0|(sg=q[rg+12>>2]))<1))for(sg=(qg=q[rg+16>>2])+(sg<<2)|0,zg=q[pg+yg>>2],pg=q[a+36>>2]+(ug<<2)|0,Ag=q[wg+976>>2];q[pg>>2]=q[(q[qg>>2]+zg<<2)+Ag>>2],pg=pg+4|0,(qg=qg+4|0)>>>0>>0;);if(q[rg+28>>2]&&!((0|(pg=q[rg+12>>2]))<1))for(sg=(qg=q[rg+20>>2])+(pg<<2)|0,pg=q[a+32>>2]+(ug<<2)|0;q[pg>>2]=q[qg>>2],pg=pg+4|0,(qg=qg+4|0)>>>0>>0;);if(ug=q[rg+8>>2]+ug|0,(0|vg)==(0|(tg=tg+1|0)))break}}(a),n[q[1808]](a+12|0,q[a+36>>2],q[a+44>>2],q[a+40>>2]),function(a){var xe,ye,ze,Ae,Be,Ce,ue=0,ve=0,we=0;if(1<=(0|(we=q[a+304>>2])))for(ze=(ue=q[a+308>>2])+(we<<5)|0,Ae=q[a+264>>2],Be=q[a+144>>2],Ce=q[a+40>>2],we=ye=q[a+312>>2];xe=we,ve=0,a=ve=!q[ue+28>>2]||-1!=(0|(a=q[ue+4>>2]))&&(ve=0,!q[(a<<2)+Ce>>2])||-1!=(0|(a=q[ue+8>>2]))&&(ve=0,!q[(a<<2)+ye>>2])?ve:!q[q[ue>>2]+32>>2],q[xe>>2]=a,(xe=q[ue+12>>2])>>>0<=1?xe-1?q[(q[ue+16>>2]<<2)+Be>>2]=a:q[(q[ue+16>>2]<<2)+Ae>>2]=a:Y(4,1372,0),we=we+4|0,(ue=ue+32|0)>>>0>>0;);}(a),function(a){var gg,hg,ig,jg,kg,lg,mg,ng,og,Uf=0,Vf=0,Wf=0,Xf=0,Yf=0,Zf=0,_f=0,$f=0,ag=0,bg=0,cg=0,dg=0,eg=0,fg=0,Yf=q[a>>2];if(1<=(0|($f=q[a+56>>2]))){for(ag=q[a+60>>2],bg=q[Yf+1052>>2],cg=q[Yf+784>>2];;){if(Uf=q[ag+w(Zf,24)>>2],(q[Uf+28>>2]||q[Uf+24>>2])&&(q[(Vf=Zf<<2)+q[a+80>>2]>>2]=q[Uf+12>>2],q[Uf+24>>2])&&!((0|(Xf=q[Uf+12>>2]))<1))for(dg=(Wf=q[Uf+16>>2])+(Xf<<2)|0,eg=q[Vf+cg>>2],Vf=(Xf=_f<<2)+q[a+92>>2]|0,Xf=Xf+q[a+88>>2]|0;fg=eg+q[Wf>>2]<<2,q[Vf>>2]=bg+(q[fg+q[Yf+984>>2]>>2]<<2),q[Xf>>2]=q[fg+q[Yf+980>>2]>>2],Xf=Xf+4|0,Vf=Vf+4|0,(Wf=Wf+4|0)>>>0>>0;);if(q[Uf+28>>2]&&!((0|(Vf=q[Uf+12>>2]))<1))for(Xf=(Wf=q[Uf+20>>2])+(Vf<<2)|0,Vf=q[a+84>>2]+(_f<<2)|0;q[Vf>>2]=q[Wf>>2],Vf=Vf+4|0,(Wf=Wf+4|0)>>>0>>0;);if(_f=q[Uf+8>>2]+_f|0,(0|$f)==(0|(Zf=Zf+1|0)))break}Yf=q[a>>2]}if(!(r[Yf+4|0]<4||(0|(eg=q[a+56>>2]))<1))for(fg=q[Yf+792>>2],gg=q[a+60>>2],Wf=_f=0;;){if(Zf=q[w(Wf,24)+gg>>2],q[Zf+24>>2]&&!((0|(Uf=q[Zf+12>>2]))<1))for(hg=(Vf=q[Zf+16>>2])+(Uf<<2)|0,ig=q[fg+(Wf<<2)>>2],Xf=(Uf=_f<<2)+q[a+96>>2]|0,$f=Uf+q[a+100>>2]|0,ag=Uf+q[a+104>>2]|0,bg=Uf+q[a+108>>2]|0,cg=Uf+q[a+112>>2]|0,dg=Uf+q[a+116>>2]|0,jg=q[Yf+1308>>2],kg=q[Yf+1304>>2],lg=q[Yf+1300>>2],mg=q[Yf+1296>>2],ng=q[Yf+1292>>2],og=q[Yf+1288>>2];Uf=q[Vf>>2]+ig<<2,q[Xf>>2]=q[Uf+og>>2],q[$f>>2]=q[Uf+ng>>2],q[ag>>2]=q[Uf+mg>>2],q[bg>>2]=q[Uf+lg>>2],q[cg>>2]=q[Uf+kg>>2],q[dg>>2]=q[Uf+jg>>2],dg=dg+4|0,cg=cg+4|0,bg=bg+4|0,ag=ag+4|0,$f=$f+4|0,Xf=Xf+4|0,(Vf=Vf+4|0)>>>0>>0;);if(_f=q[Zf+8>>2]+_f|0,(0|eg)==(0|(Wf=Wf+1|0)))break}}(a),function(a){var xf=0,yf=0,Af=0,Bf=0,Cf=0,Df=0,Ef=0,Ff=0,Gf=0,Hf=0,If=0,Jf=0,Kf=0,Lf=0,Mf=0,Nf=0,Of=0,Pf=0,Qf=0,Rf=0,Sf=0,Tf=q[a+168>>2],zf=q[a>>2];if(1<=(0|(Kf=q[a+164>>2])))for(Mf=q[zf+816>>2];;){if(Af=q[w(Ef,12)+Tf>>2],(q[Af+28>>2]||q[Af+24>>2])&&(q[(Ff=Ef<<2)+q[a+188>>2]>>2]=q[Af+12>>2],q[Af+24>>2])){if(yf=q[Af+16>>2],Lf=q[Ff+Mf>>2],1<=(0|(xf=q[Af+12>>2])))for(Nf=yf+(xf<<2)|0,Bf=(xf=Df<<2)+q[a+200>>2]|0,Gf=xf+q[a+204>>2]|0,Hf=xf+q[a+208>>2]|0,If=xf+q[a+212>>2]|0,Jf=xf+q[a+196>>2]|0,Of=q[zf+996>>2],Pf=q[zf+1012>>2],Qf=q[zf+1008>>2],Rf=q[zf+1004>>2],Sf=q[zf+1e3>>2],xf=yf;Cf=Lf+q[xf>>2]<<2,q[Bf>>2]=q[Cf+Sf>>2],q[Gf>>2]=q[Cf+Rf>>2],q[Hf>>2]=q[Cf+Qf>>2],q[If>>2]=q[Cf+Pf>>2],q[Jf>>2]=q[Cf+Of>>2],Jf=Jf+4|0,If=If+4|0,Hf=Hf+4|0,Gf=Gf+4|0,Bf=Bf+4|0,(xf=xf+4|0)>>>0>>0;);xf=Lf+q[yf>>2]<<2,q[Ff+q[a+288>>2]>>2]=q[xf+q[zf+1016>>2]>>2],q[Ff+q[a+292>>2]>>2]=q[xf+q[zf+1020>>2]>>2]}if(q[Af+28>>2]&&!((0|(yf=q[Af+12>>2]))<1))for(yf=(xf=q[Af+20>>2])+(yf<<2)|0,Bf=q[a+192>>2]+(Df<<2)|0;q[Bf>>2]=q[xf>>2],Bf=Bf+4|0,(xf=xf+4|0)>>>0>>0;);if(Df=q[Af+8>>2]+Df|0,(0|Kf)==(0|(Ef=Ef+1|0)))break}if(!(r[zf+4|0]<4||(0|(Ff=q[a+164>>2]))<1))for(Lf=q[zf+824>>2],Df=Af=0;;){if(Cf=q[w(Df,12)+Tf>>2],q[Cf+24>>2]&&!((0|(xf=q[Cf+12>>2]))<1))for(Kf=(Bf=q[Cf+16>>2])+(xf<<2)|0,Mf=q[Lf+(Df<<2)>>2],Gf=(yf=Af<<2)+q[a+216>>2]|0,Hf=yf+q[a+220>>2]|0,If=yf+q[a+224>>2]|0,Jf=yf+q[a+228>>2]|0,xf=yf+q[a+232>>2]|0,Ef=yf+q[a+236>>2]|0,Nf=q[zf+1308>>2],Of=q[zf+1304>>2],Pf=q[zf+1300>>2],Qf=q[zf+1296>>2],Rf=q[zf+1292>>2],Sf=q[zf+1288>>2];yf=Mf+q[Bf>>2]<<2,q[Gf>>2]=q[yf+Sf>>2],q[Hf>>2]=q[yf+Rf>>2],q[If>>2]=q[yf+Qf>>2],q[Jf>>2]=q[yf+Pf>>2],q[xf>>2]=q[yf+Of>>2],q[Ef>>2]=q[yf+Nf>>2],Ef=Ef+4|0,xf=xf+4|0,Jf=Jf+4|0,If=If+4|0,Hf=Hf+4|0,Gf=Gf+4|0,(Bf=Bf+4|0)>>>0>>0;);if(Af=q[Cf+8>>2]+Af|0,(0|Ff)==(0|(Df=Df+1|0)))break}}(a),function(a){var yk,qk=0,rk=0,sk=0,tk=0,uk=0,vk=0,wk=0,xk=0,qk=a- -64|0;if(n[q[1807]](qk,q[a+88>>2],q[a+148>>2],q[a+144>>2]),n[q[1809]](qk,q[a+92>>2],q[a+152>>2],q[q[a>>2]+796>>2],2,q[a+144>>2]),!(r[q[a>>2]+4|0]<4||(n[q[1807]](qk,q[a+96>>2],q[a+120>>2],q[a+144>>2]),n[q[1807]](qk,q[a+100>>2],q[a+124>>2],q[a+144>>2]),n[q[1807]](qk,q[a+104>>2],q[a+128>>2],q[a+144>>2]),n[q[1807]](qk,q[a+108>>2],q[a+132>>2],q[a+144>>2]),n[q[1807]](qk,q[a+112>>2],q[a+136>>2],q[a+144>>2]),n[q[1807]](qk,q[a+116>>2],q[a+140>>2],q[a+144>>2]),(0|(vk=q[a+56>>2]))<1))){for(wk=q[a+128>>2],xk=q[a+124>>2],yk=q[a+120>>2],rk=q[a+156>>2],qk=0;q[(sk=tk<<2)+rk>>2]=q[(uk=qk<<2)+yk>>2],q[rk+(4|sk)>>2]=q[uk+xk>>2],q[rk+(8|sk)>>2]=q[uk+wk>>2],tk=tk+4|0,(0|vk)!=(0|(qk=qk+1|0)););for(rk=q[a+160>>2],uk=q[a+140>>2],wk=q[a+136>>2],xk=q[a+132>>2],qk=a=0;q[(tk=a<<2)+rk>>2]=q[(sk=qk<<2)+xk>>2],q[rk+(4|tk)>>2]=q[sk+wk>>2],q[rk+(8|tk)>>2]=q[sk+uk>>2],a=a+4|0,(0|vk)!=(0|(qk=qk+1|0)););}}(a),function(a){var pk,hk=0,ik=0,jk=0,kk=0,lk=0,mk=0,nk=0,ok=0,hk=a+172|0;if(n[q[1807]](hk,q[a+196>>2],q[a+268>>2],q[a+264>>2]),n[q[1807]](hk,q[a+200>>2],q[a+284>>2],q[a+264>>2]),n[q[1807]](hk,q[a+204>>2],q[a+276>>2],q[a+264>>2]),n[q[1807]](hk,q[a+208>>2],q[a+280>>2],q[a+264>>2]),n[q[1807]](hk,q[a+212>>2],q[a+272>>2],q[a+264>>2]),!(r[q[a>>2]+4|0]<4||(n[q[1807]](hk,q[a+216>>2],q[a+240>>2],q[a+264>>2]),n[q[1807]](hk,q[a+220>>2],q[a+244>>2],q[a+264>>2]),n[q[1807]](hk,q[a+224>>2],q[a+248>>2],q[a+264>>2]),n[q[1807]](hk,q[a+228>>2],q[a+252>>2],q[a+264>>2]),n[q[1807]](hk,q[a+232>>2],q[a+256>>2],q[a+264>>2]),n[q[1807]](hk,q[a+236>>2],q[a+260>>2],q[a+264>>2]),(0|(mk=q[a+164>>2]))<1))){for(nk=q[a+248>>2],ok=q[a+244>>2],pk=q[a+240>>2],ik=q[a+296>>2],hk=0;q[(jk=kk<<2)+ik>>2]=q[(lk=hk<<2)+pk>>2],q[ik+(4|jk)>>2]=q[lk+ok>>2],q[ik+(8|jk)>>2]=q[lk+nk>>2],kk=kk+4|0,(0|mk)!=(0|(hk=hk+1|0)););for(ik=q[a+300>>2],lk=q[a+260>>2],nk=q[a+256>>2],ok=q[a+252>>2],hk=a=0;q[(kk=a<<2)+ik>>2]=q[(jk=hk<<2)+ok>>2],q[ik+(4|kk)>>2]=q[jk+nk>>2],q[ik+(8|kk)>>2]=q[jk+lk>>2],a=a+4|0,(0|mk)!=(0|(hk=hk+1|0)););}}(a),function(a){var re,se,te,oe=0,pe=0,qe=0;if(1<=(0|(pe=q[a+332>>2])))for(re=(oe=q[a+336>>2])+w(pe,20)|0,se=q[a+312>>2],te=q[a+40>>2],a=q[a+424>>2];pe=0,q[oe+12>>2]&&(qe=q[oe+4>>2],q[(qe<<2)+te>>2]||-1==(0|qe))&&(qe=q[oe+8>>2],q[(qe<<2)+se>>2]||-1==(0|qe))&&(pe=!q[q[oe>>2]+32>>2]),q[a>>2]=pe,a=a+4|0,(oe=oe+20|0)>>>0>>0;);}(a),function(a){var pf,qf,rf,sf,tf,uf,vf,wf,$e=0,af=0,bf=0,cf=0,df=0,ef=0,ff=0,gf=0,hf=0,jf=0,kf=0,lf=0,mf=0,nf=0,of=0,cf=q[a>>2];if(1<=(0|(jf=q[a+332>>2]))){for(kf=q[a+336>>2],lf=q[cf+1052>>2],mf=q[cf+856>>2];;){if($e=q[kf+w(ff,20)>>2],(q[$e+28>>2]||q[$e+24>>2])&&(q[(af=ff<<2)+q[a+356>>2]>>2]=q[$e+12>>2],q[$e+24>>2])&&!((0|(df=q[$e+12>>2]))<1))for(nf=(bf=q[$e+16>>2])+(df<<2)|0,of=q[af+mf>>2],af=(ef=gf<<2)+q[a+372>>2]|0,df=ef+q[a+364>>2]|0,ef=ef+q[a+368>>2]|0;hf=of+q[bf>>2]<<2,q[af>>2]=lf+(q[hf+q[cf+1040>>2]>>2]<<2),q[df>>2]=q[hf+q[cf+1032>>2]>>2],q[ef>>2]=q[hf+q[cf+1036>>2]>>2],ef=ef+4|0,df=df+4|0,af=af+4|0,(bf=bf+4|0)>>>0>>0;);if(q[$e+28>>2]&&!((0|(af=q[$e+12>>2]))<1))for(df=(bf=q[$e+20>>2])+(af<<2)|0,af=q[a+360>>2]+(gf<<2)|0;q[af>>2]=q[bf>>2],af=af+4|0,(bf=bf+4|0)>>>0>>0;);if(gf=q[$e+8>>2]+gf|0,(0|jf)==(0|(ff=ff+1|0)))break}cf=q[a>>2]}if(!(r[cf+4|0]<4||(0|(mf=q[a+332>>2]))<1))for(nf=q[cf+864>>2],of=q[a+336>>2],bf=gf=0;;){if(ff=q[of+w(bf,20)>>2],q[ff+24>>2]&&!((0|($e=q[ff+12>>2]))<1))for(pf=(af=q[ff+16>>2])+($e<<2)|0,qf=q[nf+(bf<<2)>>2],df=($e=gf<<2)+q[a+376>>2]|0,ef=$e+q[a+380>>2]|0,hf=$e+q[a+384>>2]|0,jf=$e+q[a+388>>2]|0,kf=$e+q[a+392>>2]|0,lf=$e+q[a+396>>2]|0,rf=q[cf+1308>>2],sf=q[cf+1304>>2],tf=q[cf+1300>>2],uf=q[cf+1296>>2],vf=q[cf+1292>>2],wf=q[cf+1288>>2];$e=q[af>>2]+qf<<2,q[df>>2]=q[$e+wf>>2],q[ef>>2]=q[$e+vf>>2],q[hf>>2]=q[$e+uf>>2],q[jf>>2]=q[$e+tf>>2],q[kf>>2]=q[$e+sf>>2],q[lf>>2]=q[$e+rf>>2],lf=lf+4|0,kf=kf+4|0,jf=jf+4|0,hf=hf+4|0,ef=ef+4|0,df=df+4|0,(af=af+4|0)>>>0>>0;);if(gf=q[ff+8>>2]+gf|0,(0|mf)==(0|(bf=bf+1|0)))break}}(a),function(a){var gk,vj=0,xj=0,yj=0,bk=0,ck=0,dk=0,ek=0,fk=0,vj=a+340|0;if(n[q[1807]](vj,q[a+364>>2],q[a+448>>2],q[a+424>>2]),n[q[1808]](vj,q[a+368>>2],q[a+440>>2],q[a+424>>2]),n[q[1809]](vj,q[a+372>>2],q[a+444>>2],q[q[a>>2]+892>>2],2,q[a+424>>2]),!(r[q[a>>2]+4|0]<4||(n[q[1807]](vj,q[a+376>>2],q[a+400>>2],q[a+424>>2]),n[q[1807]](vj,q[a+380>>2],q[a+404>>2],q[a+424>>2]),n[q[1807]](vj,q[a+384>>2],q[a+408>>2],q[a+424>>2]),n[q[1807]](vj,q[a+388>>2],q[a+412>>2],q[a+424>>2]),n[q[1807]](vj,q[a+392>>2],q[a+416>>2],q[a+424>>2]),n[q[1807]](vj,q[a+396>>2],q[a+420>>2],q[a+424>>2]),(0|(dk=q[a+332>>2]))<1))){for(ek=q[a+408>>2],fk=q[a+404>>2],gk=q[a+400>>2],xj=q[a+452>>2],vj=0;q[(yj=bk<<2)+xj>>2]=q[(ck=vj<<2)+gk>>2],q[xj+(4|yj)>>2]=q[ck+fk>>2],q[xj+(8|yj)>>2]=q[ck+ek>>2],bk=bk+4|0,(0|dk)!=(0|(vj=vj+1|0)););for(xj=q[a+456>>2],ck=q[a+420>>2],ek=q[a+416>>2],fk=q[a+412>>2],vj=a=0;q[(bk=a<<2)+xj>>2]=q[(yj=vj<<2)+fk>>2],q[xj+(4|bk)>>2]=q[yj+ek>>2],q[xj+(8|bk)>>2]=q[yj+ck>>2],a=a+4|0,(0|dk)!=(0|(vj=vj+1|0)););}}(a),function(a){var Re,Ve,We,Xe,Ye,Ze,_e,Pe=0,Qe=0,Se=0,Te=0,Ue=0;if(1<=(0|(Ve=q[a+500>>2])))for(Xe=q[a+504>>2],We=q[a>>2],Ye=q[We+1252>>2];;){if(Re=q[w(Te,24)+Xe>>2],(q[Re+28>>2]||q[Re+24>>2])&&(q[(Pe=Te<<2)+q[a+524>>2]>>2]=q[Re+12>>2],q[Re+24>>2])&&!((0|(Se=q[Re+12>>2]))<1))for(Se=(Qe=q[Re+16>>2])+(Se<<2)|0,Ze=q[Pe+Ye>>2],Pe=q[a+532>>2]+(Ue<<2)|0,_e=q[We+1284>>2];q[Pe>>2]=q[(q[Qe>>2]+Ze<<2)+_e>>2],Pe=Pe+4|0,(Qe=Qe+4|0)>>>0>>0;);if(q[Re+28>>2]&&!((0|(Pe=q[Re+12>>2]))<1))for(Se=(Qe=q[Re+20>>2])+(Pe<<2)|0,Pe=q[a+528>>2]+(Ue<<2)|0;q[Pe>>2]=q[Qe>>2],Pe=Pe+4|0,(Qe=Qe+4|0)>>>0>>0;);if(Ue=q[Re+8>>2]+Ue|0,(0|Ve)==(0|(Te=Te+1|0)))break}}(a),n[q[1807]](a+508|0,q[a+532>>2],q[a+536>>2],0),function(a){var Ek,Fk,Gk,Hk,Ik,Jk,zk=x(0),Ak=0,Bk=0,Ck=0,Dk=0;x(0);if(L=Ek=L-16|0,Ck=q[a>>2],!(r[Ck+4|0]<5||(0|(Dk=q[a+596>>2]))<1))for(Hk=(Bk=q[a+600>>2])+w(Dk,12)|0,Ik=q[a+44>>2],Dk=q[Ck+976>>2];;){if(Ck=(q[Bk>>2]<<2)+Ik|0,zk=x(q[Ck>>2]),1<=(0|(Ak=q[Bk+4>>2])))for(Jk=(a=q[Bk+8>>2])+w(Ak,48)|0;(Ak=q[a+8>>2])&&((Fk=Ak+-1|0)>>>0<=1?(Ak=q[a+4>>2],Gk=u[Dk+(Ak+q[a+12>>2]<<2)>>2],zk=x(Fk-1?zk+x(u[a+44>>2]*x(Gk*u[a+20>>2])):zk+x(u[a+44>>2]*x(x(Gk*u[a+20>>2])+x(u[Dk+(Ak+q[a+16>>2]<<2)>>2]*u[a+24>>2]))))):(q[Ek>>2]=Ak,Y(4,1024,Ek))),(a=a+48|0)>>>0>>0;);if(zk=(zk=x(zk+x(.0010000000474974513)))>2]=a,!((Bk=Bk+12|0)>>>0>>0))break}L=16+Ek|0}(a),function(a){var mj,nj,oj,pj,qj,rj,sj,tj,uj,ej=0,gj=0,ij=0,jj=0,kj=0,lj=x(0);if(L=mj=L-16|0,ej=q[a>>2],!(r[ej+4|0]<4||(va(a,q[a+604>>2],q[a+608>>2],q[ej+984>>2],q[a+152>>2],q[ej+796>>2]),gj=q[a>>2],r[gj+4|0]<5))){if(ij=q[a+608>>2],qj=q[gj+992>>2],rj=q[gj+988>>2],1<=(0|(ej=q[a+604>>2]))){for(sj=w(ej,12)+ij|0,tj=q[a+148>>2],nj=q[gj+980>>2];;){if(oj=(q[ij>>2]<<2)+tj|0,kj=q[oj>>2],1<=(0|(jj=q[ij+4>>2])))for(uj=(ej=q[ij+8>>2])+w(jj,48)|0;(jj=q[ej+8>>2])&&((pj=jj+-1|0)>>>0<=1?(jj=q[ej+4>>2],lj=u[(jj+q[ej+12>>2]<<2)+nj>>2],j(x(pj-1?x(u[ej+44>>2]*x(lj*u[ej+20>>2]))+(f(0,kj),k()):x(u[ej+44>>2]*x(x(lj*u[ej+20>>2])+x(u[(jj+q[ej+16>>2]<<2)+nj>>2]*u[ej+24>>2])))+(f(0,kj),k()))),kj=b[0]):(q[mj>>2]=jj,Y(4,1024,mj))),(ej=ej+48|0)>>>0>>0;);if(f(0,kj),lj=k(),u[oj>>2]=lj>>0>>0))break}ij=q[a+608>>2],ej=q[a+604>>2]}fa(ej,ij,rj,q[gj+1288>>2],q[gj+1292>>2],q[gj+1296>>2],q[a+156>>2]),fa(q[a+604>>2],q[a+608>>2],qj,q[gj+1300>>2],q[gj+1304>>2],q[gj+1308>>2],q[a+160>>2])}L=16+mj|0}(a),function(a){var zi,si=0,ti=0,ui=0,vi=0,wi=0,xi=x(0),yi=0,Ai=0,Bi=0,Ci=0,Di=0,Ei=0,Fi=0,Gi=0;if(L=zi=L-80|0,wi=q[a>>2],!(r[wi+4|0]<5)){if(Ei=q[wi+1028>>2],Fi=q[wi+1024>>2],ui=ti=q[a+616>>2],!((0|(si=q[a+612>>2]))<1)){for(Ai=w(si,12)+ti|0,Bi=q[a+276>>2],yi=q[wi+1004>>2];;){if(Ci=Bi+(q[ti>>2]<<2)|0,ui=q[Ci>>2],1<=(0|(vi=q[ti+4>>2])))for(Gi=(si=q[ti+8>>2])+w(vi,48)|0;(vi=q[si+8>>2])&&((Di=vi+-1|0)>>>0<=1?(vi=q[si+4>>2],xi=u[yi+(vi+q[si+12>>2]<<2)>>2],j(x(Di-1?x(u[si+44>>2]*x(xi*u[si+20>>2]))+(f(0,ui),k()):x(u[si+44>>2]*x(x(xi*u[si+20>>2])+x(u[yi+(vi+q[si+16>>2]<<2)>>2]*u[si+24>>2])))+(f(0,ui),k()))),ui=b[0]):(q[64+zi>>2]=vi,Y(4,1024,64+zi|0))),(si=si+48|0)>>>0>>0;);if(q[Ci>>2]=ui,!((ti=ti+12|0)>>>0>>0))break}if(ui=ti=q[a+616>>2],!((0|(si=q[a+612>>2]))<1)){for(Ai=w(si,12)+ti|0,Bi=q[a+280>>2],yi=q[q[a>>2]+1008>>2];;){if(Ci=Bi+(q[ti>>2]<<2)|0,ui=q[Ci>>2],1<=(0|(vi=q[ti+4>>2])))for(Gi=(si=q[ti+8>>2])+w(vi,48)|0;(vi=q[si+8>>2])&&((Di=vi+-1|0)>>>0<=1?(vi=q[si+4>>2],xi=u[yi+(vi+q[si+12>>2]<<2)>>2],j(x(Di-1?x(u[si+44>>2]*x(xi*u[si+20>>2]))+(f(0,ui),k()):x(u[si+44>>2]*x(x(xi*u[si+20>>2])+x(u[yi+(vi+q[si+16>>2]<<2)>>2]*u[si+24>>2])))+(f(0,ui),k()))),ui=b[0]):(q[48+zi>>2]=vi,Y(4,1024,48+zi|0))),(si=si+48|0)>>>0>>0;);if(q[Ci>>2]=ui,!((ti=ti+12|0)>>>0>>0))break}if(ui=ti=q[a+616>>2],!((0|(si=q[a+612>>2]))<1)){for(Ai=w(si,12)+ti|0,Bi=q[a+268>>2],yi=q[q[a>>2]+996>>2];;){if(Ci=Bi+(q[ti>>2]<<2)|0,ui=q[Ci>>2],1<=(0|(vi=q[ti+4>>2])))for(Gi=(si=q[ti+8>>2])+w(vi,48)|0;(vi=q[si+8>>2])&&((Di=vi+-1|0)>>>0<=1?(vi=q[si+4>>2],xi=u[yi+(vi+q[si+12>>2]<<2)>>2],j(x(Di-1?x(u[si+44>>2]*x(xi*u[si+20>>2]))+(f(0,ui),k()):x(u[si+44>>2]*x(x(xi*u[si+20>>2])+x(u[yi+(vi+q[si+16>>2]<<2)>>2]*u[si+24>>2])))+(f(0,ui),k()))),ui=b[0]):(q[32+zi>>2]=vi,Y(4,1024,32+zi|0))),(si=si+48|0)>>>0>>0;);if(f(0,ui),xi=k(),u[Ci>>2]=xi>>0>>0))break}si=q[a+612>>2],ui=q[a+616>>2]}}}if(fa(si,ui,Fi,q[wi+1288>>2],q[wi+1292>>2],q[wi+1296>>2],q[a+296>>2]),fa(q[a+612>>2],q[a+616>>2],Ei,q[wi+1300>>2],q[wi+1304>>2],q[wi+1308>>2],q[a+300>>2]),!((0|(si=q[a+612>>2]))<1)){for(vi=(ti=q[a+616>>2])+w(si,12)|0,Ei=q[a+284>>2],wi=q[q[a>>2]+1e3>>2];;){if(Fi=Ei+(q[ti>>2]<<2)|0,ui=q[Fi>>2],1<=(0|(yi=q[ti+4>>2])))for(Ai=(si=q[ti+8>>2])+w(yi,48)|0;(yi=q[si+8>>2])&&((Bi=yi+-1|0)>>>0<=1?(yi=q[si+4>>2],xi=u[wi+(yi+q[si+12>>2]<<2)>>2],j(x(Bi-1?x(u[si+44>>2]*x(xi*u[si+20>>2]))+(f(0,ui),k()):x(u[si+44>>2]*x(x(xi*u[si+20>>2])+x(u[wi+(yi+q[si+16>>2]<<2)>>2]*u[si+24>>2])))+(f(0,ui),k()))),ui=b[0]):(q[16+zi>>2]=yi,Y(4,1024,16+zi|0))),(si=si+48|0)>>>0>>0;);if(f(0,ui),xi=k(),u[Fi>>2]=xi>>0>>0))break}if(!((0|(si=q[a+612>>2]))<1))for(yi=(ti=q[a+616>>2])+w(si,12)|0,vi=q[a+272>>2],a=q[q[a>>2]+1012>>2];;){if(Ei=vi+(q[ti>>2]<<2)|0,ui=q[Ei>>2],1<=(0|(wi=q[ti+4>>2])))for(Fi=(si=q[ti+8>>2])+w(wi,48)|0;(wi=q[si+8>>2])&&((Ai=wi+-1|0)>>>0<=1?(wi=q[si+4>>2],xi=u[a+(wi+q[si+12>>2]<<2)>>2],j(x(Ai-1?x(u[si+44>>2]*x(xi*u[si+20>>2]))+(f(0,ui),k()):x(u[si+44>>2]*x(x(xi*u[si+20>>2])+x(u[a+(wi+q[si+16>>2]<<2)>>2]*u[si+24>>2])))+(f(0,ui),k()))),ui=b[0]):(q[zi>>2]=wi,Y(4,1024,zi))),(si=si+48|0)>>>0>>0;);if(f(0,ui),xi=k(),u[Ei>>2]=xi>>0>>0))break}}}L=80+zi|0}(a),function(a){var $h,fi,gi,hi,ii,Vh=0,Wh=0,Xh=0,Yh=0,Zh=x(0),_h=0,ai=0,bi=0,ci=0,di=0,ei=0;x(0);if(L=$h=L-32|0,Xh=q[a>>2],!(r[Xh+4|0]<4||(va(a,q[a+620>>2],q[a+624>>2],q[Xh+1040>>2],q[a+444>>2],q[Xh+892>>2]),_h=q[a>>2],r[_h+4|0]<5))){if(hi=q[_h+1048>>2],ii=q[_h+1044>>2],Xh=Yh=q[a+624>>2],!((0|(Vh=q[a+620>>2]))<1)){for(di=w(Vh,12)+Yh|0,ei=q[a+440>>2],ai=q[_h+1036>>2];;){if(Xh=ei+(q[Yh>>2]<<2)|0,Zh=x(q[Xh>>2]),1<=(0|(Wh=q[Yh+4>>2])))for(bi=(Vh=q[Yh+8>>2])+w(Wh,48)|0;(Wh=q[Vh+8>>2])&&((ci=Wh+-1|0)>>>0<=1?(Wh=q[Vh+4>>2],fi=u[ai+(Wh+q[Vh+12>>2]<<2)>>2],Zh=x(ci-1?Zh+x(u[Vh+44>>2]*x(fi*u[Vh+20>>2])):Zh+x(u[Vh+44>>2]*x(x(fi*u[Vh+20>>2])+x(u[ai+(Wh+q[Vh+16>>2]<<2)>>2]*u[Vh+24>>2]))))):(q[16+$h>>2]=Wh,Y(4,1024,16+$h|0))),(Vh=Vh+48|0)>>>0>>0;);if(Zh=(Zh=x(Zh+x(.0010000000474974513)))>2]=Vh,!((Yh=Yh+12|0)>>>0>>0))break}if(Xh=Yh=q[a+624>>2],!((0|(Vh=q[a+620>>2]))<1)){for(di=w(Vh,12)+Yh|0,ei=q[a+448>>2],ai=q[q[a>>2]+1032>>2];;){if(bi=ei+(q[Yh>>2]<<2)|0,Xh=q[bi>>2],1<=(0|(Wh=q[Yh+4>>2])))for(ci=(Vh=q[Yh+8>>2])+w(Wh,48)|0;(Wh=q[Vh+8>>2])&&((gi=Wh+-1|0)>>>0<=1?(Wh=q[Vh+4>>2],Zh=u[ai+(Wh+q[Vh+12>>2]<<2)>>2],j(x(gi-1?x(u[Vh+44>>2]*x(Zh*u[Vh+20>>2]))+(f(0,Xh),k()):x(u[Vh+44>>2]*x(x(Zh*u[Vh+20>>2])+x(u[ai+(Wh+q[Vh+16>>2]<<2)>>2]*u[Vh+24>>2])))+(f(0,Xh),k()))),Xh=b[0]):(q[$h>>2]=Wh,Y(4,1024,$h))),(Vh=Vh+48|0)>>>0>>0;);if(f(0,Xh),Zh=k(),u[bi>>2]=Zh>>0>>0))break}Vh=q[a+620>>2],Xh=q[a+624>>2]}}fa(Vh,Xh,ii,q[_h+1288>>2],q[_h+1292>>2],q[_h+1296>>2],q[a+452>>2]),fa(q[a+620>>2],q[a+624>>2],hi,q[_h+1300>>2],q[_h+1304>>2],q[_h+1308>>2],q[a+456>>2])}L=32+$h|0}(a),function(a){var Gg,Hg,Ig,Jg,Kg,Lg,Bg=0,Cg=0,Dg=0,Eg=0,Fg=x(0);if(L=Gg=L-16|0,Cg=q[a>>2],!(r[Cg+4|0]<5||(0|(Eg=q[a+628>>2]))<1))for(Jg=(Dg=q[a+632>>2])+w(Eg,12)|0,Kg=q[a+536>>2],Eg=q[Cg+1284>>2];;){if(Hg=(q[Dg>>2]<<2)+Kg|0,Cg=q[Hg>>2],1<=(0|(Bg=q[Dg+4>>2])))for(Lg=(a=q[Dg+8>>2])+w(Bg,48)|0;(Bg=q[a+8>>2])&&((Ig=Bg+-1|0)>>>0<=1?(Bg=q[a+4>>2],Fg=u[Eg+(Bg+q[a+12>>2]<<2)>>2],j(x(Ig-1?x(u[a+44>>2]*x(Fg*u[a+20>>2]))+(f(0,Cg),k()):x(u[a+44>>2]*x(x(Fg*u[a+20>>2])+x(u[Eg+(Bg+q[a+16>>2]<<2)>>2]*u[a+24>>2])))+(f(0,Cg),k()))),Cg=b[0]):(q[Gg>>2]=Bg,Y(4,1024,Gg))),(a=a+48|0)>>>0>>0;);if(f(0,Cg),Fg=k(),u[Hg>>2]=Fg>>0>>0))break}L=16+Gg|0}(a),function(a){var Qh,Th,mh=0,Oh=0,Ph=0,Rh=x(0),Sh=0;if(1<=(0|(mh=q[a+4>>2])))for(Th=(Oh=q[a+8>>2])+w(mh,12)|0,mh=q[a+40>>2],Ph=q[a+52>>2],a=Qh=q[a+48>>2];q[mh>>2]&&(Rh=u[Ph>>2],u[a>>2]=Rh,-1!=(0|(Sh=q[Oh+4>>2])))&&(u[a>>2]=Rh*u[(Sh<<2)+Qh>>2]),a=a+4|0,Ph=Ph+4|0,mh=mh+4|0,(Oh=Oh+12|0)>>>0>>0;);}(a),function(a){var lh,ih=0,jh=0,kh=0;if(1<=(0|(lh=q[a+304>>2])))for(ih=q[a+308>>2],jh=q[a+312>>2];q[jh>>2]&&n[q[ih+20>>2]](a,kh),jh=jh+4|0,ih=ih+32|0,(0|lh)!=(0|(kh=kh+1|0)););}(a),function(a){var Zg,_g,ch,gh,hh,Xg=0,Yg=0,$g=(x(0),x(0),0),ah=0,bh=0,dh=(x(0),0),eh=0,fh=0;if(1<=(0|(Xg=q[a+332>>2])))for(eh=(Yg=q[a+336>>2])+w(Xg,20)|0,fh=q[a+308>>2],dh=q[a+316>>2],hh=q[a+48>>2],Xg=q[a+448>>2],$g=q[a+444>>2],bh=q[a+424>>2];q[bh>>2]&&(-1!=(0|(ah=q[Yg+4>>2]))&&(u[Xg>>2]=u[(ah<<2)+hh>>2]*u[Xg>>2]),-1!=(0|(ah=q[Yg+8>>2])))&&(u[Xg>>2]=u[dh+(ah<<2)>>2]*u[Xg>>2],gh=q[$g>>2],n[q[24+(fh+(ah<<5)|0)>>2]](a,ah,gh,gh,q[Yg+16>>2])),$g=$g+4|0,Xg=Xg+4|0,bh=bh+4|0,(Yg=Yg+20|0)>>>0>>0;);if(!(r[q[a>>2]+4|0]<4||(0|(Xg=q[a+332>>2]))<1))for(ah=($g=q[a+336>>2])+w(Xg,20)|0,eh=q[a+328>>2],fh=q[a+324>>2],Yg=q[a+452>>2],Xg=q[a+456>>2],bh=q[a+424>>2];q[bh>>2]&&-1!=(0|(a=q[$g+8>>2]))&&(a=(dh=a<<4)+fh|0,Zg=x(u[Yg>>2]*u[a>>2]),u[Yg>>2]=Zg,_g=x(u[Yg+4>>2]*u[a+4>>2]),u[Yg+4>>2]=_g,ch=u[a+8>>2],q[Yg+12>>2]=1065353216,u[Yg+4>>2]=_g>2]=Zg>2]),u[Yg+8>>2]=Zg>2],_g=u[(a=eh+dh|0)>>2],Zg=x(x(Zg+_g)-x(Zg*_g)),u[Xg>>2]=Zg,_g=u[Xg+4>>2],ch=u[a+4>>2],_g=x(x(_g+ch)-x(_g*ch)),u[Xg+4>>2]=_g,ch=u[a+8>>2],q[Xg+12>>2]=1065353216,u[Xg+4>>2]=_g>2]=Zg>2],Zg=x(x(ch+Zg)-x(Zg*ch)),u[Xg+8>>2]=Zg>>0>>0;);}(a),function(a){var Ln,Mn,On,Ko,Lo,Mo,No,Oo,Po,Qo,Ro,So,To,Uo,Vo,Wo,Xo,Yo,Zo,_o,Nn=0;x(0),x(0),x(0),x(0),x(0),x(0),x(0);if(1<=(0|(Oo=q[a+500>>2])))for(Zo=q[a+536>>2],Po=q[a+444>>2],_o=q[a+504>>2];;){if(a=w(Nn,24)+_o|0,0<(0|(Qo=q[a+12>>2])))for(On=u[(Nn<<2)+Zo>>2],Ro=q[a+20>>2],So=q[a+16>>2],To=q[(q[a+4>>2]<<2)+Po>>2],Uo=q[(q[a+8>>2]<<2)+Po>>2],a=0;Vo=u[((Ln=1|a)<<2)+So>>2],Mn=s[(a<<1)+Ro>>1]<<3&262136,Ko=u[(Wo=(4|Mn)+To|0)>>2],Ln=s[(Ln<<1)+Ro>>1]<<3&262136,Lo=u[(Xo=(4|Ln)+Uo|0)>>2],Mo=u[(Mn=Mn+To|0)>>2],Yo=u[(a<<2)+So>>2],No=u[(Ln=Ln+Uo|0)>>2],u[Mn>>2]=Mo+x(On*x(Yo*x(No-Mo))),u[Wo>>2]=Ko+x(On*x(Yo*x(Lo-Ko))),u[Ln>>2]=No+x(On*x(Vo*x(Mo-No))),u[Xo>>2]=Lo+x(On*x(Vo*x(Ko-Lo))),(0|(a=a+2|0))<(0|Qo););if(!((0|(Nn=Nn+1|0))<(0|Oo)))break}}(a),n[q[1810]](a),function(a){var Rc,Sc,Uc,Vc,Gc=0,Ic=0,Jc=0,Kc=0,Lc=0,Mc=0,Nc=0,Oc=0,Pc=0,Qc=0,Tc=0;if(!((0|(Rc=q[a+480>>2]))<1)){for(Kc=(Sc=q[a+484>>2])+w(Rc,28)|0,Nc=q[a+424>>2],Oc=q[a+40>>2],Lc=q[a+44>>2],Tc=q[a+440>>2],Gc=Sc;;){if(1<=(0|(Mc=q[Gc+4>>2])))for(Qc=Gc+20|0,Pc=q[Gc+12>>2],Ic=0;Uc=q[4+(Jc=Pc+(Ic<<4)|0)>>2]<<2,Jc=1==q[(Vc=Jc)>>2],q[Vc+12>>2]=q[(q[(Jc?Oc:Nc)+Uc>>2]?(Jc?Lc:Tc)+Uc|0:Qc)>>2],(0|(Ic=Ic+1|0))<(0|Mc););if(!((Gc=Gc+28|0)>>>0>>0))break}if(!((0|Rc)<1))for(Tc=q[a+436>>2],Oc=0;;){if(Kc=w(Oc,28)+Sc|0,!(q[(Nc=Kc)+24>>2]<1)){for(Jc=q[a+488>>2],Ic=0;q[Jc+(Ic<<2)>>2]=-1,(0|(Ic=Ic+1|0))<(0|(Gc=q[Nc+24>>2])););if(!((0|Gc)<1))for(Gc=q[a+496>>2],Ic=0;q[Gc+(Ic<<2)>>2]=-1,(0|(Ic=Ic+1|0))>2];);}if(!(q[Kc+4>>2]<1)){for(Lc=q[a+492>>2],Ic=0;q[Lc+(Ic<<2)>>2]=-1,(0|(Ic=Ic+1|0))<(0|(Gc=q[Kc+4>>2])););if(!((0|Gc)<1))for(Mc=q[Kc+12>>2],Qc=q[a+496>>2],Ic=0;Pc=q[12+(Mc+(Ic<<4)|0)>>2]-q[Kc+20>>2]<<2,Gc=-1==(0|(Gc=q[(Jc=Pc+Qc|0)>>2]))?Pc+q[a+488>>2]|0:Lc+(Gc<<2)|0,q[Gc>>2]=Ic,(0|(Ic=(q[Jc>>2]=Ic)+1|0))>2];);}if(1<=(0|(Gc=q[Nc+24>>2])))for(Lc=q[Kc+8>>2],Qc=q[a+488>>2],Mc=0;;){if(-1!=(0|(Ic=q[Qc+(Mc<<2)>>2]))){for(Pc=q[a+492>>2],Jc=q[Kc+12>>2];Lc=(Gc=1==q[(Gc=Jc+(Ic<<4)|0)>>2]?(Gc=w(q[Gc+8>>2],28)+Sc|0,q[Gc+8>>2]=Lc,q[Gc>>2]):(q[Tc+(q[Gc+4>>2]<<2)>>2]=Lc,1))+Lc|0,(0|Ic)<(0|(Gc=q[Pc+(Ic<<2)>>2]))&&-1!=(0|(Ic=Gc)););Gc=q[Nc+24>>2]}if(!((0|(Mc=Mc+1|0))<(0|Gc)))break}if((0|Rc)==(0|(Oc=Oc+1|0)))break}}}(a),function(a){var Mg=0,Ng=0,Og=0,Pg=0,Rg=0,Sg=x(0),Tg=0,Ug=0,Qg=q[a+332>>2];if(q[a+644>>2]){if(!(((q[a+428>>2]=0)|Qg)<1))for(;Mg=126,Tg=q[a+432>>2]+Og|0,!q[(Ng=Og<<2)+q[a+424>>2]>>2]|u[Ng+q[a+448>>2]>>2]==x(0)||(Mg=127),o[0|Tg]=Mg,(0|Qg)!=(0|(Og=Og+1|0)););}else if(q[a+428>>2]){if(Mg=r[q[a>>2]+4|0],!(((q[a+428>>2]=0)|Qg)<1))if(4<=Mg>>>0)for(;Sg=u[(Mg=Og<<2)+q[a+448>>2]>>2],Pg=q[Mg+q[a+424>>2]>>2],Ng=Sg!=x(0)&0!=(0|Pg),Tg=q[a+432>>2]+Og|0,Ng=(0|Ng)==(1&o[0|Tg])?Ng:2|Ng,Ng=Sg!=u[Mg+q[a+468>>2]>>2]?4|Ng:Ng,Ng=q[Mg+q[a+440>>2]>>2]==q[Mg+q[a+464>>2]>>2]?Ng:8|Ng,Mg=q[Mg+q[a+436>>2]>>2]==q[Mg+q[a+460>>2]>>2]?Ng:16|Ng,Mg=Pg?32|Mg:Mg,Pg=(Ng=Ug<<2)+q[a+452>>2]|0,Rg=Ng+q[a+472>>2]|0,(u[Pg>>2]!=u[Rg>>2]|u[Pg+4>>2]!=u[Rg+4>>2]|(u[Pg+8>>2]!=u[Rg+8>>2]|u[Pg+12>>2]!=u[Rg+12>>2])||(Pg=Ng+q[a+456>>2]|0,Ng=Ng+q[a+476>>2]|0,u[Pg>>2]!=u[Ng>>2]|u[Pg+4>>2]!=u[Ng+4>>2]|u[Pg+8>>2]!=u[Ng+8>>2])||u[Pg+12>>2]!=u[Ng+12>>2])&&(Mg|=64),o[0|Tg]=Mg,Ug=Ug+4|0,(0|Qg)!=(0|(Og=Og+1|0)););else for(;Sg=u[(Mg=Og<<2)+q[a+448>>2]>>2],Pg=q[Mg+q[a+424>>2]>>2],Ng=Sg!=x(0)&0!=(0|Pg),Rg=q[a+432>>2]+Og|0,Ng=(0|Ng)==(1&o[0|Rg])?Ng:2|Ng,Ng=Sg!=u[Mg+q[a+468>>2]>>2]?4|Ng:Ng,Ng=q[Mg+q[a+440>>2]>>2]==q[Mg+q[a+464>>2]>>2]?Ng:8|Ng,Mg=q[Mg+q[a+436>>2]>>2]==q[Mg+q[a+460>>2]>>2]?Ng:16|Ng,o[0|Rg]=Pg?32|Mg:Mg,(0|Qg)!=(0|(Og=Og+1|0)););}else if(!((0|Qg)<1))for(;!q[(Mg=Og<<2)+q[a+424>>2]>>2]|u[Mg+q[a+448>>2]>>2]==x(0)?(Mg=q[a+432>>2]+Og|0,o[0|Mg]=254&r[0|Mg]):(Mg=q[a+432>>2]+Og|0,o[0|Mg]=1|r[0|Mg]),(0|Qg)!=(0|(Og=Og+1|0)););}(a),q[a+644>>2]=0}function va(a,Wa,Xa,Ya,Za,_a){var fb,gb,hb,jb,kb,cb,db,$a=0,bb=0,eb=0,ib=0;if(L=cb=L-32|0,1<=(0|Wa))for(kb=w(Wa,12)+Xa|0;;){if(!((0|($a=q[Xa+4>>2]))<1))if(fb=(Wa=q[Xa+8>>2])+w($a,48)|0,$a=q[Xa>>2]<<2,1<=(0|(db=q[$a+_a>>2])))for(db<<=1,gb=q[q[a>>2]+1052>>2],hb=q[Za+$a>>2];;){b:if($a=q[Wa+8>>2]){c:{if((bb=$a+-1|0)>>>0<=1){if($a=(q[Wa+4>>2]<<2)+Ya|0,ib=(q[$a+(q[Wa+12>>2]<<2)>>2]<<2)+gb|0,bb-1)break c;for(eb=(q[$a+(q[Wa+16>>2]<<2)>>2]<<2)+gb|0,$a=0;u[(jb=(bb=$a<<2)+hb|0)>>2]=u[jb>>2]+x(u[Wa+44>>2]*x(x(u[bb+ib>>2]*u[Wa+20>>2])+x(u[bb+eb>>2]*u[Wa+24>>2]))),(0|db)!=(0|($a=$a+1|0)););break b}q[cb>>2]=$a,Y(4,1024,cb);break b}for($a=0;u[(eb=(bb=$a<<2)+hb|0)>>2]=u[eb>>2]+x(u[Wa+44>>2]*x(u[bb+ib>>2]*u[Wa+20>>2])),(0|db)!=(0|($a=$a+1|0)););}if(!((Wa=Wa+48|0)>>>0>>0))break}else for(;3<=($a=q[Wa+8>>2])>>>0&&(q[16+cb>>2]=$a,Y(4,1024,16+cb|0)),(Wa=Wa+48|0)>>>0>>0;);if(!((Xa=Xa+12|0)>>>0>>0))break}L=32+cb|0}function wa(a,Wa,Xa){var Ya;Wa|=0,Xa|=0,L=Ya=L+-64|0;a:{if(a|=0)if(Wa)if((Wa+15&-16)!=(0|Wa))q[52+Ya>>2]=1522,q[48+Ya>>2]=2361,Y(4,1294,48+Ya|0);else{if(Wa=function(a,Il,Jl){var cm,$l=0,am=0,bm=0,dm=0,em=0,fm=0,gm=0,hm=0,im=0,jm=0,km=0,lm=0,mm=0,nm=x(0),om=0,pm=0,qm=0,rm=0,sm=0;if(ca(16+(L=cm=L-576|0)|0,0,560),Fa(a,16+cm|0,12+cm|0),(dm=q[12+cm>>2])>>>0<=Jl>>>0){if($l=(am=ca(Il,0,dm))+q[16+cm>>2]|0,q[$l+8>>2]=am+q[20+cm>>2],q[$l+40>>2]=am+q[24+cm>>2],q[$l+44>>2]=am+q[28+cm>>2],q[$l+48>>2]=am+q[32+cm>>2],q[$l+52>>2]=am+q[36+cm>>2],q[$l+16>>2]=am+q[40+cm>>2],q[$l+24>>2]=am+q[44+cm>>2],q[$l+28>>2]=am+q[48+cm>>2],q[$l+32>>2]=am+q[52+cm>>2],q[$l+36>>2]=am+q[56+cm>>2],Il=q[a+704>>2],q[$l+308>>2]=am+q[60+cm>>2],q[$l+312>>2]=am+q[64+cm>>2],q[$l+316>>2]=am+q[68+cm>>2],q[$l+320>>2]=am+q[72+cm>>2],q[$l+324>>2]=am+q[76+cm>>2],q[$l+328>>2]=am+q[80+cm>>2],q[$l+60>>2]=am+q[84+cm>>2],q[$l+144>>2]=am+q[88+cm>>2],q[$l+148>>2]=am+q[92+cm>>2],Jl=am+q[96+cm>>2]|0,q[$l+152>>2]=Jl,!((0|(dm=q[Il+8>>2]))<1)&&(Il=am+q[100+cm>>2]|0,q[Jl>>2]=Il,1!=(0|dm)))for(Jl=1;Il=(15+(q[q[a+796>>2]+(bm<<2)>>2]<<3)&-16)+Il|0,q[q[$l+152>>2]+(Jl<<2)>>2]=Il,(0|dm)!=(0|(Jl=(bm=Jl)+1|0)););if(q[$l+156>>2]=am+q[104+cm>>2],q[$l+160>>2]=am+q[108+cm>>2],q[$l+68>>2]=am+q[112+cm>>2],q[$l+76>>2]=am+q[116+cm>>2],q[$l+80>>2]=am+q[120+cm>>2],q[$l+84>>2]=am+q[124+cm>>2],q[$l+88>>2]=am+q[128+cm>>2],q[$l+92>>2]=am+q[132+cm>>2],q[$l+96>>2]=am+q[136+cm>>2],q[$l+100>>2]=am+q[140+cm>>2],q[$l+104>>2]=am+q[144+cm>>2],q[$l+108>>2]=am+q[148+cm>>2],q[$l+112>>2]=am+q[152+cm>>2],q[$l+116>>2]=am+q[156+cm>>2],q[$l+120>>2]=am+q[160+cm>>2],q[$l+124>>2]=am+q[164+cm>>2],q[$l+128>>2]=am+q[168+cm>>2],q[$l+132>>2]=am+q[172+cm>>2],q[$l+136>>2]=am+q[176+cm>>2],q[$l+140>>2]=am+q[180+cm>>2],q[$l+168>>2]=am+q[184+cm>>2],q[$l+264>>2]=am+q[188+cm>>2],q[$l+268>>2]=am+q[192+cm>>2],q[$l+272>>2]=am+q[196+cm>>2],q[$l+276>>2]=am+q[200+cm>>2],q[$l+280>>2]=am+q[204+cm>>2],q[$l+284>>2]=am+q[208+cm>>2],q[$l+288>>2]=am+q[212+cm>>2],q[$l+292>>2]=am+q[216+cm>>2],q[$l+296>>2]=am+q[220+cm>>2],q[$l+300>>2]=am+q[224+cm>>2],q[$l+176>>2]=am+q[228+cm>>2],q[$l+184>>2]=am+q[232+cm>>2],q[$l+188>>2]=am+q[236+cm>>2],q[$l+192>>2]=am+q[240+cm>>2],q[$l+196>>2]=am+q[244+cm>>2],q[$l+200>>2]=am+q[248+cm>>2],q[$l+204>>2]=am+q[252+cm>>2],q[$l+208>>2]=am+q[256+cm>>2],q[$l+212>>2]=am+q[260+cm>>2],q[$l+216>>2]=am+q[264+cm>>2],q[$l+220>>2]=am+q[268+cm>>2],q[$l+224>>2]=am+q[272+cm>>2],q[$l+228>>2]=am+q[276+cm>>2],q[$l+232>>2]=am+q[280+cm>>2],q[$l+236>>2]=am+q[284+cm>>2],q[$l+240>>2]=am+q[288+cm>>2],q[$l+244>>2]=am+q[292+cm>>2],q[$l+248>>2]=am+q[296+cm>>2],q[$l+252>>2]=am+q[300+cm>>2],q[$l+256>>2]=am+q[304+cm>>2],q[$l+260>>2]=am+q[308+cm>>2],Il=q[a+704>>2],q[$l+336>>2]=am+q[312+cm>>2],q[$l+424>>2]=am+q[316+cm>>2],q[$l+432>>2]=am+q[320+cm>>2],q[$l+436>>2]=am+q[324+cm>>2],q[$l+440>>2]=am+q[328+cm>>2],Jl=am+q[332+cm>>2]|0,q[$l+444>>2]=Jl,!((0|(dm=q[Il+16>>2]))<1)&&(bm=am+q[336+cm>>2]|0,q[Jl>>2]=bm,(Jl=1)!=(0|dm)))for(Il=0;bm=(15+(q[q[a+892>>2]+(Il<<2)>>2]<<3)&-16)+bm|0,q[q[$l+444>>2]+(Jl<<2)>>2]=bm,(0|dm)!=(0|(Jl=(Il=Jl)+1|0)););if(q[$l+448>>2]=am+q[340+cm>>2],q[$l+452>>2]=am+q[344+cm>>2],q[$l+456>>2]=am+q[348+cm>>2],q[$l+460>>2]=am+q[352+cm>>2],q[$l+464>>2]=am+q[356+cm>>2],q[$l+468>>2]=am+q[360+cm>>2],q[$l+472>>2]=am+q[364+cm>>2],q[$l+476>>2]=am+q[368+cm>>2],q[$l+344>>2]=am+q[372+cm>>2],q[$l+352>>2]=am+q[376+cm>>2],q[$l+356>>2]=am+q[380+cm>>2],q[$l+360>>2]=am+q[384+cm>>2],q[$l+364>>2]=am+q[388+cm>>2],q[$l+368>>2]=am+q[392+cm>>2],q[$l+372>>2]=am+q[396+cm>>2],q[$l+376>>2]=am+q[400+cm>>2],q[$l+380>>2]=am+q[404+cm>>2],q[$l+384>>2]=am+q[408+cm>>2],q[$l+388>>2]=am+q[412+cm>>2],q[$l+392>>2]=am+q[416+cm>>2],q[$l+396>>2]=am+q[420+cm>>2],q[$l+400>>2]=am+q[424+cm>>2],q[$l+404>>2]=am+q[428+cm>>2],q[$l+408>>2]=am+q[432+cm>>2],q[$l+412>>2]=am+q[436+cm>>2],q[$l+416>>2]=am+q[440+cm>>2],q[$l+420>>2]=am+q[444+cm>>2],Il=q[448+cm>>2],Jl=q[452+cm>>2],q[$l+552>>2]=am+q[456+cm>>2],q[$l+548>>2]=Jl+am,q[$l+544>>2]=Il+am,q[$l+560>>2]=am+q[460+cm>>2],Il=q[a+704>>2],gm=am+q[464+cm>>2]|0,q[$l+568>>2]=gm,1<=(0|(fm=q[Il+48>>2])))for(bm=am+q[468+cm>>2]|0,Il=am+q[472+cm>>2]|0,em=am+q[476+cm>>2]|0,hm=q[a+1072>>2],Jl=0;dm=gm+w(Jl,36)|0,q[dm+20>>2]=em,q[dm+16>>2]=Il,q[dm>>2]=bm,bm=((dm=q[hm+(Jl<<2)>>2])<<2)+bm|0,em=(dm=1<>2],dm=am+q[516+cm>>2]|0,q[$l+484>>2]=dm,1<=(0|(Il=q[Il+72>>2])))for(bm=am+q[520+cm>>2]|0,em=q[a+1212>>2],Jl=0;q[12+(dm+w(Jl,28)|0)>>2]=bm,bm=(q[em+(Jl<<2)>>2]<<4)+bm|0,(0|Il)!=(0|(Jl=Jl+1|0)););q[$l+488>>2]=am+q[524+cm>>2],q[$l+492>>2]=am+q[528+cm>>2],q[$l+496>>2]=am+q[532+cm>>2],q[$l+504>>2]=am+q[536+cm>>2],q[$l+536>>2]=am+q[540+cm>>2],q[$l+512>>2]=am+q[544+cm>>2],q[$l+520>>2]=am+q[548+cm>>2],q[$l+524>>2]=am+q[552+cm>>2],q[$l+528>>2]=am+q[556+cm>>2],q[$l+532>>2]=am+q[560+cm>>2];c:{if(4<=(fm=r[a+4|0])>>>0){if(q[$l+576>>2]=am+q[480+cm>>2],q[$l+584>>2]=am+q[484+cm>>2],Il=q[a+704>>2],Jl=q[492+cm>>2],dm=am+q[488+cm>>2]|0,q[$l+592>>2]=dm,1<=(0|(Il=q[Il+104>>2])))for(bm=Jl+am|0,em=q[a+1104>>2],Jl=0;q[40+(dm+w(Jl,48)|0)>>2]=bm,bm=(q[em+(Jl<<2)>>2]<<2)+bm|0,(0|Il)!=(0|(Jl=Jl+1|0)););q[$l+608>>2]=am+q[500+cm>>2],q[$l+624>>2]=am+q[508+cm>>2]}else{if(Il=q[572+cm>>2],Jl=q[568+cm>>2],q[$l+636>>2]=am+q[564+cm>>2],q[$l+640>>2]=Jl+am,q[q[a+704>>2]+20>>2]<1)break c;for(dm=Il+am|0,gm=0;;){e:{if((0|(bm=q[(Il=gm<<2)+q[a+952>>2]>>2]))<=0)Il=Il+q[$l+636>>2]|0;else{for(em=bm+(Jl=q[Il+q[a+948>>2]>>2])|0,hm=q[a+1060>>2],bm=0;bm=q[hm+(Jl<<2)>>2]+bm|0,(0|(Jl=Jl+1|0))<(0|em););if(Il=Il+q[$l+636>>2]|0,Jl=dm,bm)break e}Jl=bm=0}if(q[Il>>2]=Jl,dm=(bm<<2)+dm|0,!((0|(gm=gm+1|0))>2]+20>>2]))break}}fm>>>0<5||(q[$l+600>>2]=am+q[496+cm>>2],q[$l+616>>2]=am+q[504+cm>>2],q[$l+632>>2]=am+q[512+cm>>2])}q[$l+644>>2]=1,q[$l>>2]=a,q[$l+648>>2]=1&o[q[a+708>>2]+20|0],am=q[a+704>>2],gm=q[am+20>>2];g:if(!((0|(q[$l+540>>2]=gm))<1)){if(Il=gm+-1|0,hm=q[a+952>>2],im=q[a+940>>2],jm=q[a+932>>2],km=q[a+936>>2],lm=q[a+924>>2],mm=q[a+928>>2],om=q[$l+552>>2],qm=q[$l+544>>2],fm>>>0<4)for(;;)if(Jl=qm+w(Il,52)|0,bm=(dm=Il<<2)+mm|(q[Jl>>2]=0),q[Jl+4>>2]=q[bm>>2],q[Jl+8>>2]=q[(em=dm+lm|0)>>2],u[Jl+12>>2]=u[em>>2]-u[bm>>2],q[Jl+16>>2]=q[dm+km>>2],q[Jl+44>>2]=q[(bm=dm+jm|0)>>2],nm=Aa(x(q[dm+im>>2])),u[Jl+20>>2]=nm,u[Jl+24>>2]=nm*x(1.5),pm=q[dm+hm>>2],em=0,em=(q[Jl+32>>2]=pm)?q[$l+560>>2]+w(q[dm+q[a+948>>2]>>2],28)|0:em,q[Jl+48>>2]=1,q[Jl+28>>2]=em,q[dm+om>>2]=q[bm>>2],Jl=0<(0|Il),Il=Il+-1|0,!Jl)break g;for(pm=q[a+960>>2],sm=q[a+944>>2];Jl=qm+w(Il,52)|0,q[Jl>>2]=q[(bm=Il<<2)+sm>>2],q[Jl+4>>2]=q[(dm=bm+mm|0)>>2],q[Jl+8>>2]=q[(em=bm+lm|0)>>2],u[Jl+12>>2]=u[em>>2]-u[dm>>2],q[Jl+16>>2]=q[bm+km>>2],q[Jl+44>>2]=q[(rm=bm+jm|0)>>2],nm=Aa(x(q[bm+im>>2])),u[Jl+20>>2]=nm,u[Jl+24>>2]=nm*x(1.5),em=q[bm+hm>>2],q[Jl+32>>2]=em,q[Jl+28>>2]=em?q[$l+560>>2]+w(q[bm+q[a+948>>2]>>2],28)|0:0,dm=q[bm+pm>>2],dm=(q[Jl+40>>2]=dm)?q[$l+584>>2]+w(q[bm+q[a+956>>2]>>2],28)|0:0,q[Jl+48>>2]=1,q[Jl+36>>2]=dm,q[bm+om>>2]=q[rm>>2],Jl=0<(0|Il),Il=Il+-1|0,Jl;);}if(4<=fm>>>0?(q[$l+548>>2]=q[a+944>>2],dm=a):(ca(q[$l+548>>2],0,gm<<2),dm=q[$l>>2],am=q[dm+704>>2]),bm=q[am+52>>2],1<=(0|(q[$l+556>>2]=bm)))for(Jl=q[dm+1056>>2],em=q[dm+1192>>2],gm=q[dm+1060>>2],fm=q[$l+560>>2];Il=fm+w(bm=bm+-1|0,28)|0,q[Il>>2]=q[(hm=bm<<2)+gm>>2],hm=q[Jl+hm>>2],q[Il+24>>2]=1,q[Il+16>>2]=0,q[Il+20>>2]=1,q[Il+8>>2]=0,q[Il+12>>2]=0,q[Il+4>>2]=em+(hm<<2),0<(0|bm););if(bm=q[am+48>>2],1<=(0|(q[$l+564>>2]=bm))){for(;;){if(Il=q[$l+568>>2]+w(bm=bm+-1|0,36)|0,em=q[(am=bm<<2)+q[dm+1072>>2]>>2],1<=(0|(q[Il+4>>2]=em)))for(Jl=0;q[q[Il>>2]+(Jl<<2)>>2]=q[$l+560>>2]+w(q[q[dm+1064>>2]+(q[am+q[dm+1068>>2]>>2]+Jl<<2)>>2],28),(0|em)!=(0|(Jl=Jl+1|0)););if(q[Il+24>>2]=1,q[Il+28>>2]=1,q[Il+8>>2]=1<>2],am=q[dm+704>>2]}if(Il=q[am>>2],(0|(q[$l+4>>2]=Il))<1)Jl=0;else{for(hm=q[dm+732>>2],im=q[dm+736>>2],jm=q[dm+740>>2],em=q[dm+720>>2],km=q[$l+52>>2],gm=q[$l+568>>2],lm=q[$l+8>>2],bm=Il;fm=lm+w(bm=bm+-1|0,12)|0,q[fm>>2]=gm+w(q[(Jl=bm<<2)+em>>2],36),q[fm+4>>2]=q[Jl+jm>>2],q[fm+8>>2]=q[Jl+im>>2],u[Jl+km>>2]=q[Jl+hm>>2]?x(1):x(0),0<(0|bm););for(fm=q[$l+16>>2],Jl=0;bm=q[8+(gm+w(q[(hm=(Il=Il+-1|0)<<2)+em>>2],36)|0)>>2],Jl=Jl+(q[fm+hm>>2]=bm)|0,0<(0|Il););Il=q[$l+4>>2]}if(q[$l+12>>2]=Il,q[$l+20>>2]=Jl,Il=q[am+4>>2],1<=(0|(q[$l+304>>2]=Il))){for(;Jl=q[$l+308>>2]+((Il=Il+-1|0)<<5)|0,q[Jl>>2]=q[$l+568>>2]+w(q[(bm=Il<<2)+q[dm+752>>2]>>2],36),q[Jl+4>>2]=q[bm+q[dm+764>>2]>>2],q[Jl+8>>2]=q[bm+q[dm+768>>2]>>2],em=q[bm+q[dm+772>>2]>>2],q[Jl+12>>2]=em,am=q[bm+q[dm+776>>2]>>2],q[Jl+16>>2]=am,q[Jl+28>>2]=q[bm+q[dm+760>>2]>>2],em>>>0<=1?em-1?(q[20+(q[$l+60>>2]+w(am,24)|0)>>2]=Il,q[Jl+24>>2]=1,q[Jl+20>>2]=2):(q[8+(q[$l+168>>2]+w(am,12)|0)>>2]=Il,q[Jl+24>>2]=3,q[Jl+20>>2]=4):Y(4,1179,0),0<(0|Il););dm=q[$l>>2],am=q[dm+704>>2]}bm=q[am+8>>2];k:if(!((0|(q[$l+56>>2]=bm))<1)){if(Jl=bm+-1|0,gm=q[dm+796>>2],fm=q[dm+804>>2],hm=q[dm+800>>2],im=q[dm+780>>2],jm=q[$l+568>>2],km=q[$l+60>>2],r[dm+4|0]<2)for(;;)if(Il=km+w(Jl,24)|0,q[Il>>2]=jm+w(q[(em=Jl<<2)+im>>2],36),q[Il+4>>2]=q[em+hm>>2],q[Il+8>>2]=q[em+fm>>2],em=q[em+gm>>2],q[Il+12>>2]=0,q[Il+16>>2]=em,Il=0<(0|Jl),Jl=Jl+-1|0,!Il)break k;for(lm=q[dm+808>>2];Il=km+w(Jl,24)|0,q[Il>>2]=jm+w(q[(em=Jl<<2)+im>>2],36),q[Il+4>>2]=q[em+hm>>2],q[Il+8>>2]=q[em+fm>>2],q[Il+16>>2]=q[em+gm>>2],q[Il+12>>2]=q[em+lm>>2],Il=0<(0|Jl),Jl=Jl+-1|0,Il;);}if(Jl=q[am+12>>2],1<=(0|(q[$l+164>>2]=Jl)))for(em=q[dm+828>>2],gm=q[dm+812>>2],fm=q[$l+568>>2],hm=q[$l+168>>2],Il=Jl;im=hm+w(Il=Il+-1|0,12)|0,q[im>>2]=fm+w(q[(jm=Il<<2)+gm>>2],36),q[im+4>>2]=q[em+jm>>2],0<(0|Il););if(((Il=0)|bm)<1)em=0;else{for(gm=q[$l+68>>2],fm=q[$l+60>>2],em=0;Jl=q[q[fm+w(bm=bm+-1|0,24)>>2]+8>>2],em=(q[gm+(bm<<2)>>2]=Jl)+em|0,0<(0|bm););Jl=q[$l+164>>2],bm=q[$l+56>>2]}if(q[$l+64>>2]=bm,q[$l+72>>2]=em,bm=$l,1<=(0|Jl)){for(gm=q[$l+176>>2],fm=q[$l+168>>2];em=q[q[fm+w(Jl=Jl+-1|0,12)>>2]+8>>2],Il=Il+(q[gm+(Jl<<2)>>2]=em)|0,0<(0|Jl););Jl=q[$l+164>>2]}if(q[bm+172>>2]=Jl,q[$l+180>>2]=Il,em=q[am+16>>2],1<=(0|(q[$l+332>>2]=em))){for(hm=q[dm+872>>2],im=q[dm+892>>2],jm=q[dm+880>>2],km=q[dm+876>>2],gm=q[dm+852>>2],fm=q[$l+568>>2],lm=q[$l+336>>2],Il=em;Jl=lm+w(Il=Il+-1|0,20)|0,q[Jl>>2]=fm+w(q[(bm=Il<<2)+gm>>2],36),q[Jl+4>>2]=q[bm+km>>2],q[Jl+8>>2]=q[bm+jm>>2],q[Jl+16>>2]=q[bm+im>>2],q[Jl+12>>2]=q[bm+hm>>2],0<(0|Il););for(bm=q[$l+344>>2],Jl=0;Il=q[8+(fm+w(q[(hm=(em=em+-1|0)<<2)+gm>>2],36)|0)>>2],Jl=(q[bm+hm>>2]=Il)+Jl|0,0<(0|em););if(q[$l+348>>2]=Jl,em=q[$l+332>>2],!((0|(q[$l+340>>2]=em))<1))for(Jl=em<<2,bm=q[$l+456>>2],gm=q[$l+452>>2];q[(fm=(Il=Jl+-4|0)<<2)+gm>>2]=1065353216,q[(hm=(Jl<<=2)-4|0)+gm>>2]=1065353216,q[(im=(Jl=Jl+-12|0)+gm|0)>>2]=1065353216,q[im+4>>2]=1065353216,q[bm+fm>>2]=0,q[bm+hm>>2]=1065353216,q[(Jl=Jl+bm|0)>>2]=0,q[Jl+4>>2]=0,Jl=Il,0<(0|(em=em+-1|0)););}else q[$l+340>>2]=em,q[$l+348>>2]=0;if(em=q[am+72>>2],1<=(0|(q[$l+480>>2]=em)))for(hm=q[dm+1208>>2],im=q[dm+1224>>2],jm=q[dm+1220>>2],km=q[dm+1216>>2],lm=q[dm+1212>>2],mm=q[$l+484>>2],bm=0;;){if(Il=mm+w(bm,28)|0,gm=q[(Jl=bm<<2)+lm>>2],q[Il+4>>2]=gm,q[Il>>2]=q[Jl+km>>2],fm=q[Jl+jm>>2],q[Il+16>>2]=fm,om=q[Jl+im>>2],q[Il+20>>2]=om,q[Il+8>>2]=0,q[Il+24>>2]=1+(fm-om|0),1<=(0|gm))for(om=q[Jl+hm>>2],qm=q[Il+12>>2],pm=q[dm+1236>>2],sm=q[dm+1228>>2],rm=q[dm+1232>>2],Jl=0;q[4+(Il=qm+(Jl<<4)|0)>>2]=q[(fm=Jl+om<<2)+rm>>2],q[Il>>2]=q[fm+sm>>2],fm=q[fm+pm>>2],q[Il+12>>2]=0,q[Il+8>>2]=fm,(0|gm)!=(0|(Jl=Jl+1|0)););if((0|em)==(0|(bm=bm+1|0)))break}if(Jl=q[am+80>>2],(0|(q[$l+500>>2]=Jl))<1)bm=0;else{for(fm=q[dm+1280>>2],hm=q[dm+1268>>2],im=q[dm+1276>>2],jm=q[dm+1272>>2],km=q[dm+1264>>2],lm=q[dm+1260>>2],em=q[dm+1248>>2],gm=q[$l+568>>2],mm=q[$l+504>>2];Il=mm+w(Jl=Jl+-1|0,24)|0,q[Il>>2]=gm+w(q[(bm=Jl<<2)+em>>2],36),q[Il+4>>2]=q[bm+lm>>2],q[Il+8>>2]=q[bm+km>>2],q[Il+12>>2]=q[bm+jm>>2],bm=q[bm+hm>>2],q[Il+20>>2]=fm+(bm<<1),q[Il+16>>2]=im+(bm<<2),0<(0|Jl););if((0|(Jl=q[$l+500>>2]))<1)bm=0;else{for(fm=q[$l+512>>2],bm=0;Il=q[8+(gm+w(q[(hm=(Jl=Jl+-1|0)<<2)+em>>2],36)|0)>>2],bm=(q[fm+hm>>2]=Il)+bm|0,0<(0|Jl););Jl=q[$l+500>>2]}}q[$l+508>>2]=Jl,q[$l+516>>2]=bm;o:if(4<=r[a+4|0]){if(!((em=r[dm+4|0])>>>0<4)){if(Jl=q[am+120>>2],1<=(0|(q[$l+572>>2]=Jl))){for(fm=q[dm+1172>>2],hm=q[$l+576>>2];em=(0|(am=q[(Il=(Jl=Jl+-1|0)<<2)+fm>>2]))<0?am=gm=bm=0:(bm=(em=q[Il+q[dm+1176>>2]>>2]<<2)+q[dm+1188>>2]|0,gm=q[Il+q[dm+1180>>2]>>2],am=q[$l+544>>2]+w(am,52)|0,em+q[dm+1184>>2]|0),Il=hm+w(Jl,20)|0,q[Il+12>>2]=gm,q[Il+8>>2]=bm,q[Il+4>>2]=em,q[Il>>2]=am,0<(0|Jl););if(dm=q[$l>>2],(em=r[dm+4|0])>>>0<4)break o}if(am=q[dm+704>>2],bm=q[am+100>>2],1<=(0|(q[$l+580>>2]=bm)))for(gm=q[dm+1084>>2],fm=q[dm+1076>>2],hm=q[dm+1192>>2],im=q[dm+1080>>2],jm=q[$l+584>>2];Il=jm+w(bm=bm+-1|0,28)|0,q[Il>>2]=q[(Jl=bm<<2)+im>>2],q[Il+4>>2]=hm+(q[Jl+fm>>2]<<2),Jl=q[Jl+gm>>2],q[Il+20>>2]=1,q[Il+24>>2]=1,q[Il+12>>2]=0,q[Il+16>>2]=0,q[Il+8>>2]=Jl,0<(0|bm););if(bm=q[am+104>>2],1<=(0|(q[$l+588>>2]=bm))){for(;;){if(Il=q[$l+592>>2]+w(bm=bm+-1|0,48)|0,q[Il>>2]=q[$l+584>>2]+w(q[(em=bm<<2)+q[dm+1088>>2]>>2],28),Jl=q[em+q[dm+1092>>2]>>2],q[Il+28>>2]=1,q[Il+32>>2]=1,q[Il+8>>2]=0,q[Il+4>>2]=Jl,am=q[em+q[dm+1104>>2]>>2],1<=(0|(q[Il+36>>2]=am)))for(Jl=0;q[q[Il+40>>2]+(Jl<<2)>>2]=q[$l+576>>2]+w(q[q[dm+1168>>2]+(q[em+q[dm+1100>>2]>>2]+Jl<<2)>>2],20),(0|am)!=(0|(Jl=Jl+1|0)););if(!(1<=(0|bm)))break}dm=q[$l>>2],em=r[dm+4|0]}if(!(em>>>0<4)){if(em=q[a+704>>2],Jl=q[em+108>>2],1<=(0|(q[$l+604>>2]=Jl)))for(am=q[a+1124>>2],gm=q[a+1128>>2],fm=q[a+1120>>2],hm=q[$l+592>>2],im=q[$l+608>>2];Il=im+w(Jl=Jl+-1|0,12)|0,q[Il>>2]=q[(bm=Jl<<2)+fm>>2],q[Il+4>>2]=q[bm+gm>>2],q[Il+8>>2]=hm+w(q[am+bm>>2],48),0<(0|Jl););if(Jl=q[em+112>>2],1<=(0|(q[$l+620>>2]=Jl)))for(em=q[a+1148>>2],am=q[a+1152>>2],gm=q[a+1144>>2],fm=q[$l+592>>2],hm=q[$l+624>>2];Il=hm+w(Jl=Jl+-1|0,12)|0,q[Il>>2]=q[(bm=Jl<<2)+gm>>2],q[Il+4>>2]=q[am+bm>>2],q[Il+8>>2]=fm+w(q[bm+em>>2],48),0<(0|Jl););if(bm=q[dm+1192>>2],Il=q[q[dm+704>>2]+20>>2],q[$l+640>>2]=q[dm+972>>2],em=q[dm+964>>2],q[$l+636>>2]=em,!((0|Il)<(Jl=1))&&(q[em>>2]=bm+(q[q[dm+968>>2]>>2]<<2),1!=(0|Il)))for(;q[(em=Jl<<2)+q[$l+636>>2]>>2]=bm+(q[em+q[dm+968>>2]>>2]<<2),(0|Il)!=(0|(Jl=Jl+1|0)););}}}else if(!(q[am+20>>2]<1))for(am=0;;){if(bm=q[(gm=am<<2)+q[$l+636>>2]>>2],1<=((Il=0)|(Jl=q[gm+q[dm+952>>2]>>2])))for(im=Jl+(fm=q[gm+q[dm+948>>2]>>2])|0,jm=q[dm+1060>>2],km=q[dm+1056>>2];;){if(1<=(0|(hm=q[(Jl=fm<<2)+jm>>2])))for(lm=hm+(em=q[Jl+km>>2])|0,mm=q[dm+1192>>2];;){hm=bm+(Il<<2)|0,nm=u[mm+(em<<2)>>2],Jl=bm;q:{if(0<(0|Il))for(;;){if(u[Jl>>2]==nm)break q;if(!((Jl=Jl+4|0)>>>0>>0))break}u[hm>>2]=nm,Il=Il+1|0}if(!((0|(em=em+1|0))<(0|lm)))break}if(!((0|(fm=fm+1|0))<(0|im)))break}if(function(a,Sm){var un,Kn,xn=0,yn=0,Jn=0;q[8+(L=un=L-208|0)>>2]=1,q[12+un>>2]=0;a:if(Kn=Sm<<2){for(q[16+un>>2]=4,Jn=Sm=q[20+un>>2]=4,xn=2;Sm=(Jn+4|0)+(yn=Sm)|0,q[(16+un|0)+(xn<<2)>>2]=Sm,xn=xn+1|0,Jn=yn,Sm>>>0>>0;);if((yn=(a+Kn|0)-4|0)>>>0<=a>>>0)Sm=xn=1;else for(Sm=xn=1;Sm=3==(3&xn)?(ta(a,Sm,16+un|0),ma(8+un|0,2),Sm+2|0):(t[(16+un|0)+((Jn=Sm+-1|0)<<2)>>2]>=yn-a>>>0?la(a,8+un|0,Sm,0,16+un|0):ta(a,Sm,16+un|0),1==(0|Sm)?(ka(8+un|0,1),0):(ka(8+un|0,Jn),1)),xn=1|q[8+un>>2],q[8+un>>2]=xn,(a=a+4|0)>>>0>>0;);for(la(a,8+un|0,Sm,0,16+un|0);;){e:{f:{g:{if(!(1!=(0|Sm)|1!=(0|xn))){if(q[12+un>>2])break g;break a}if(1<(0|Sm))break f}ma(8+un|0,yn=Oa(8+un|0)),xn=q[8+un>>2],Sm=Sm+yn|0;break e}ka(8+un|0,2),q[8+un>>2]=7^q[8+un>>2],ma(8+un|0,1),la((Jn=a+-4|0)-q[(16+un|0)+((yn=Sm+-2|0)<<2)>>2]|0,8+un|0,Sm+-1|0,1,16+un|0),ka(8+un|0,1),xn=1|q[8+un>>2],q[8+un>>2]=xn,la(Jn,8+un|0,yn,1,16+un|0),Sm=yn}a=a+-4|0}}L=208+un|0}(bm,Il),q[gm+q[$l+640>>2]>>2]=Il,!((0|(am=am+1|0))>2]+20>>2]))break}if(!(r[a+4|0]<5|r[q[$l>>2]+4|0]<4)){if(Il=q[a+704>>2],Jl=q[Il+128>>2],1<=(0|(q[$l+596>>2]=Jl)))for(em=q[a+1112>>2],am=q[a+1116>>2],gm=q[a+1108>>2],fm=q[$l+592>>2],hm=q[$l+600>>2];dm=hm+w(Jl=Jl+-1|0,12)|0,q[dm>>2]=q[(bm=Jl<<2)+gm>>2],q[dm+4>>2]=q[am+bm>>2],q[dm+8>>2]=fm+w(q[bm+em>>2],48),0<(0|Jl););if(Jl=q[Il+132>>2],1<=(0|(q[$l+612>>2]=Jl)))for(em=q[a+1136>>2],am=q[a+1140>>2],gm=q[a+1132>>2],fm=q[$l+592>>2],hm=q[$l+616>>2];dm=hm+w(Jl=Jl+-1|0,12)|0,q[dm>>2]=q[(bm=Jl<<2)+gm>>2],q[dm+4>>2]=q[am+bm>>2],q[dm+8>>2]=fm+w(q[bm+em>>2],48),0<(0|Jl););if(Jl=q[Il+136>>2],!((0|(q[$l+628>>2]=Jl))<1))for(dm=q[a+1160>>2],bm=q[a+1164>>2],em=q[a+1156>>2],am=q[$l+592>>2],gm=q[$l+632>>2];a=gm+w(Jl=Jl+-1|0,12)|0,q[a>>2]=q[(Il=Jl<<2)+em>>2],q[a+4>>2]=q[Il+bm>>2],q[a+8>>2]=am+w(q[Il+dm>>2],48),0<(0|Jl););}ua($l)}return L=576+cm|0,$l}(a,Wa,Xa))break a;q[36+Ya>>2]=2209,q[32+Ya>>2]=2361,Y(4,1294,32+Ya|0)}else q[20+Ya>>2]=1444,q[16+Ya>>2]=2361,Y(4,1294,16+Ya|0);else q[4+Ya>>2]=2132,q[Ya>>2]=2361,Y(4,1294,Ya);Wa=0}return L=64+Ya|0,0|Wa}function xa(a){var Wa;return L=Wa=L-16|0,a=(a|=0)?function(a){var Il;return ca(16+(L=Il=L-576|0)|0,0,560),Fa(a,16+Il|0,12+Il|0),L=576+Il|0,q[12+Il>>2]}(a):(q[4+Wa>>2]=2132,q[Wa>>2]=2343,Y(4,1294,Wa),0),L=16+Wa|0,0|a}function ya(a){var Xa=r[a+4|0];X(q[a+704>>2],4,64),da(q[a+708>>2],4),da(q[a+708>>2]+4|0,4),da(q[a+708>>2]+8|0,4),da(q[a+708>>2]+12|0,4),da(q[a+708>>2]+16|0,4),da(q[a+708>>2]+20|0,1),X(q[a+720>>2],4,q[q[a+704>>2]>>2]),X(q[a+724>>2],4,q[q[a+704>>2]>>2]),X(q[a+728>>2],4,q[q[a+704>>2]>>2]),X(q[a+732>>2],4,q[q[a+704>>2]>>2]),X(q[a+736>>2],4,q[q[a+704>>2]>>2]),X(q[a+740>>2],4,q[q[a+704>>2]>>2]),X(q[a+752>>2],4,q[q[a+704>>2]+4>>2]),X(q[a+756>>2],4,q[q[a+704>>2]+4>>2]),X(q[a+760>>2],4,q[q[a+704>>2]+4>>2]),X(q[a+764>>2],4,q[q[a+704>>2]+4>>2]),X(q[a+768>>2],4,q[q[a+704>>2]+4>>2]),X(q[a+772>>2],4,q[q[a+704>>2]+4>>2]),X(q[a+776>>2],4,q[q[a+704>>2]+4>>2]),X(q[a+780>>2],4,q[q[a+704>>2]+8>>2]),X(q[a+784>>2],4,q[q[a+704>>2]+8>>2]),X(q[a+788>>2],4,q[q[a+704>>2]+8>>2]),X(q[a+796>>2],4,q[q[a+704>>2]+8>>2]),X(q[a+800>>2],4,q[q[a+704>>2]+8>>2]),X(q[a+804>>2],4,q[q[a+704>>2]+8>>2]),X(q[a+812>>2],4,q[q[a+704>>2]+12>>2]),X(q[a+816>>2],4,q[q[a+704>>2]+12>>2]),X(q[a+820>>2],4,q[q[a+704>>2]+12>>2]),X(q[a+828>>2],4,q[q[a+704>>2]+12>>2]),X(q[a+852>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+856>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+860>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+868>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+872>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+876>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+880>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+884>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+888>>2],1,q[q[a+704>>2]+16>>2]),X(q[a+892>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+896>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+900>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+904>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+908>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+912>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+924>>2],4,q[q[a+704>>2]+20>>2]),X(q[a+928>>2],4,q[q[a+704>>2]+20>>2]),X(q[a+932>>2],4,q[q[a+704>>2]+20>>2]),X(q[a+936>>2],4,q[q[a+704>>2]+20>>2]),X(q[a+940>>2],4,q[q[a+704>>2]+20>>2]),X(q[a+948>>2],4,q[q[a+704>>2]+20>>2]),X(q[a+952>>2],4,q[q[a+704>>2]+20>>2]),X(q[a+976>>2],4,q[q[a+704>>2]+24>>2]),X(q[a+980>>2],4,q[q[a+704>>2]+28>>2]),X(q[a+984>>2],4,q[q[a+704>>2]+28>>2]),X(q[a+996>>2],4,q[q[a+704>>2]+32>>2]),X(q[a+1e3>>2],4,q[q[a+704>>2]+32>>2]),X(q[a+1004>>2],4,q[q[a+704>>2]+32>>2]),X(q[a+1008>>2],4,q[q[a+704>>2]+32>>2]),X(q[a+1012>>2],4,q[q[a+704>>2]+32>>2]),X(q[a+1016>>2],4,q[q[a+704>>2]+32>>2]),X(q[a+1020>>2],4,q[q[a+704>>2]+32>>2]),X(q[a+1032>>2],4,q[q[a+704>>2]+36>>2]),X(q[a+1036>>2],4,q[q[a+704>>2]+36>>2]),X(q[a+1040>>2],4,q[q[a+704>>2]+36>>2]),X(q[a+1052>>2],4,q[q[a+704>>2]+40>>2]),X(q[a+1064>>2],4,q[q[a+704>>2]+44>>2]),X(q[a+1068>>2],4,q[q[a+704>>2]+48>>2]),X(q[a+1072>>2],4,q[q[a+704>>2]+48>>2]),X(q[a+1056>>2],4,q[q[a+704>>2]+52>>2]),X(q[a+1060>>2],4,q[q[a+704>>2]+52>>2]),X(q[a+1192>>2],4,q[q[a+704>>2]+56>>2]),X(q[a+1196>>2],4,q[q[a+704>>2]+60>>2]),X(q[a+1200>>2],2,q[q[a+704>>2]+64>>2]),X(q[a+1204>>2],4,q[q[a+704>>2]+68>>2]),X(q[a+1208>>2],4,q[q[a+704>>2]+72>>2]),X(q[a+1212>>2],4,q[q[a+704>>2]+72>>2]),X(q[a+1216>>2],4,q[q[a+704>>2]+72>>2]),X(q[a+1220>>2],4,q[q[a+704>>2]+72>>2]),X(q[a+1224>>2],4,q[q[a+704>>2]+72>>2]),X(q[a+1228>>2],4,q[q[a+704>>2]+76>>2]),X(q[a+1232>>2],4,q[q[a+704>>2]+76>>2]),X(q[a+1236>>2],4,q[q[a+704>>2]+76>>2]),X(q[a+1248>>2],4,q[q[a+704>>2]+80>>2]),X(q[a+1252>>2],4,q[q[a+704>>2]+80>>2]),X(q[a+1256>>2],4,q[q[a+704>>2]+80>>2]),X(q[a+1260>>2],4,q[q[a+704>>2]+80>>2]),X(q[a+1264>>2],4,q[q[a+704>>2]+80>>2]),X(q[a+1268>>2],4,q[q[a+704>>2]+80>>2]),X(q[a+1272>>2],4,q[q[a+704>>2]+80>>2]),X(q[a+1276>>2],4,q[q[a+704>>2]+84>>2]),X(q[a+1280>>2],2,q[q[a+704>>2]+84>>2]),X(q[a+1284>>2],4,q[q[a+704>>2]+88>>2]),Xa>>>0<2||(X(q[a+808>>2],4,q[q[a+704>>2]+8>>2]),Xa>>>0<4)||(X(q[a+968>>2],4,q[q[a+704>>2]+20>>2]),X(q[a+972>>2],4,q[q[a+704>>2]+20>>2]),X(q[a+792>>2],4,q[q[a+704>>2]+8>>2]),X(q[a+824>>2],4,q[q[a+704>>2]+12>>2]),X(q[a+864>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+1288>>2],4,q[q[a+704>>2]+92>>2]),X(q[a+1292>>2],4,q[q[a+704>>2]+92>>2]),X(q[a+1296>>2],4,q[q[a+704>>2]+92>>2]),X(q[a+1300>>2],4,q[q[a+704>>2]+96>>2]),X(q[a+1304>>2],4,q[q[a+704>>2]+96>>2]),X(q[a+1308>>2],4,q[q[a+704>>2]+96>>2]),X(q[a+944>>2],4,q[q[a+704>>2]+20>>2]),X(q[a+956>>2],4,q[q[a+704>>2]+20>>2]),X(q[a+960>>2],4,q[q[a+704>>2]+20>>2]),X(q[a+1076>>2],4,q[q[a+704>>2]+100>>2]),X(q[a+1080>>2],4,q[q[a+704>>2]+100>>2]),X(q[a+1084>>2],4,q[q[a+704>>2]+100>>2]),X(q[a+1088>>2],4,q[q[a+704>>2]+104>>2]),X(q[a+1092>>2],4,q[q[a+704>>2]+104>>2]),X(q[a+1096>>2],4,q[q[a+704>>2]+104>>2]),X(q[a+1100>>2],4,q[q[a+704>>2]+104>>2]),X(q[a+1104>>2],4,q[q[a+704>>2]+104>>2]),X(q[a+1120>>2],4,q[q[a+704>>2]+108>>2]),X(q[a+1124>>2],4,q[q[a+704>>2]+108>>2]),X(q[a+1128>>2],4,q[q[a+704>>2]+108>>2]),X(q[a+1144>>2],4,q[q[a+704>>2]+112>>2]),X(q[a+1148>>2],4,q[q[a+704>>2]+112>>2]),X(q[a+1152>>2],4,q[q[a+704>>2]+112>>2]),X(q[a+1168>>2],4,q[q[a+704>>2]+116>>2]),X(q[a+1172>>2],4,q[q[a+704>>2]+120>>2]),X(q[a+1176>>2],4,q[q[a+704>>2]+120>>2]),X(q[a+1180>>2],4,q[q[a+704>>2]+120>>2]),X(q[a+1184>>2],4,q[q[a+704>>2]+124>>2]),X(q[a+1188>>2],4,q[q[a+704>>2]+124>>2]),4!=(0|Xa)&&(X(q[a+988>>2],4,q[q[a+704>>2]+28>>2]),X(q[a+992>>2],4,q[q[a+704>>2]+28>>2]),X(q[a+1024>>2],4,q[q[a+704>>2]+32>>2]),X(q[a+1028>>2],4,q[q[a+704>>2]+32>>2]),X(q[a+1044>>2],4,q[q[a+704>>2]+36>>2]),X(q[a+1048>>2],4,q[q[a+704>>2]+36>>2]),X(q[a+1108>>2],4,q[q[a+704>>2]+128>>2]),X(q[a+1112>>2],4,q[q[a+704>>2]+128>>2]),X(q[a+1116>>2],4,q[q[a+704>>2]+128>>2]),X(q[a+1132>>2],4,q[q[a+704>>2]+132>>2]),X(q[a+1136>>2],4,q[q[a+704>>2]+132>>2]),X(q[a+1140>>2],4,q[q[a+704>>2]+132>>2]),X(q[a+1156>>2],4,q[q[a+704>>2]+136>>2]),X(q[a+1160>>2],4,q[q[a+704>>2]+136>>2]),X(q[a+1164>>2],4,q[q[a+704>>2]+136>>2])))}function za(a,Za){var _a=0,lb=0,mb=0,ob=0,pb=0,rb=0,nb=a+Za|0;a:{b:if(!(1&(_a=q[a+4>>2]))){if(!(3&_a))break a;if(Za=(_a=q[a>>2])+Za|0,(0|(a=a-_a|0))!=q[2092])if(_a>>>0<=255)mb=_a>>>3,_a=q[a+8>>2],(0|(lb=q[a+12>>2]))==(0|_a)?(rb=q[2087]&dd(mb),q[2087]=rb):(q[_a+12>>2]=lb,q[lb+8>>2]=_a);else{if(pb=q[a+24>>2],(0|(_a=q[a+12>>2]))!=(0|a))lb=q[a+8>>2],q[lb+12>>2]=_a,q[_a+8>>2]=lb;else if(mb=(mb=q[(lb=a+20|0)>>2])||q[(lb=a+16|0)>>2]){for(;ob=lb,(mb=q[(lb=(_a=mb)+20|0)>>2])||(lb=_a+16|0,mb=q[_a+16>>2]););q[ob>>2]=0}else _a=0;if(pb){lb=q[a+28>>2];e:{if(q[(mb=8652+(lb<<2)|0)>>2]==(0|a)){if(q[mb>>2]=_a)break e;rb=q[2088]&dd(lb),q[2088]=rb;break b}if(!(q[pb+(q[pb+16>>2]==(0|a)?16:20)>>2]=_a))break b}q[_a+24>>2]=pb,(lb=q[a+16>>2])&&(q[_a+16>>2]=lb,q[lb+24>>2]=_a),(lb=q[a+20>>2])&&(q[_a+20>>2]=lb,q[lb+24>>2]=_a)}}else if(3==(3&(_a=q[4+nb>>2])))return q[2089]=Za,q[4+nb>>2]=-2&_a,q[a+4>>2]=1|Za,q[nb>>2]=Za}f:{if(!(2&(_a=q[4+nb>>2]))){if(q[2093]==(0|nb)){if(q[2093]=a,Za=q[2090]+Za|0,q[2090]=Za,q[a+4>>2]=1|Za,q[2092]!=(0|a))break a;return q[2089]=0,q[2092]=0}if(q[2092]==(0|nb))return q[2092]=a,Za=q[2089]+Za|0,q[2089]=Za,q[a+4>>2]=1|Za,q[a+Za>>2]=Za;Za=(-8&_a)+Za|0;g:if(_a>>>0<=255)mb=_a>>>3,_a=q[8+nb>>2],(0|(lb=q[12+nb>>2]))==(0|_a)?(rb=q[2087]&dd(mb),q[2087]=rb):(q[_a+12>>2]=lb,q[lb+8>>2]=_a);else{if(pb=q[24+nb>>2],(0|nb)!=(0|(_a=q[12+nb>>2])))lb=q[8+nb>>2],q[lb+12>>2]=_a,q[_a+8>>2]=lb;else if(mb=(mb=q[(lb=20+nb|0)>>2])||q[(lb=16+nb|0)>>2]){for(;ob=lb,(mb=q[(lb=(_a=mb)+20|0)>>2])||(lb=_a+16|0,mb=q[_a+16>>2]););q[ob>>2]=0}else _a=0;if(pb){lb=q[28+nb>>2];j:{if(q[(mb=8652+(lb<<2)|0)>>2]==(0|nb)){if(q[mb>>2]=_a)break j;rb=q[2088]&dd(lb),q[2088]=rb;break g}if(!(q[pb+(q[pb+16>>2]==(0|nb)?16:20)>>2]=_a))break g}q[_a+24>>2]=pb,(lb=q[16+nb>>2])&&(q[_a+16>>2]=lb,q[lb+24>>2]=_a),(lb=q[20+nb>>2])&&(q[_a+20>>2]=lb,q[lb+24>>2]=_a)}}if(q[a+4>>2]=1|Za,q[a+Za>>2]=Za,q[2092]!=(0|a))break f;return q[2089]=Za}q[4+nb>>2]=-2&_a,q[a+4>>2]=1|Za,q[a+Za>>2]=Za}if(Za>>>0<=255)return Za=8388+((_a=Za>>>3)<<3)|0,_a=(lb=q[2087])&(_a=1<<_a)?q[Za+8>>2]:(q[2087]=_a|lb,Za),q[Za+8>>2]=a,q[_a+12>>2]=a,q[a+12>>2]=Za,q[a+8>>2]=_a;q[a+16>>2]=0,_a=q[a+20>>2]=0,(mb=Za>>>8)&&(_a=31,16777215>>0||(_a=28+((_a=((nb=(mb<<=ob=mb+1048320>>>16&8)<<(_a=mb+520192>>>16&4))<<(mb=245760+nb>>>16&2)>>>15)-(mb|_a|ob)|0)<<1|Za>>>_a+21&1)|0)),mb=8652+((q[(lb=a)+28>>2]=_a)<<2)|0;m:{if((lb=q[2088])&(ob=1<<_a)){for(lb=Za<<(31==(0|_a)?0:25-(_a>>>1)|0),_a=q[mb>>2];;){if((-8&q[(mb=_a)+4>>2])==(0|Za))break m;if(_a=lb>>>29,lb<<=1,!(_a=q[16+(ob=mb+(4&_a)|0)>>2]))break}q[ob+16>>2]=a}else q[2088]=lb|ob,q[mb>>2]=a;return q[a+24>>2]=mb,q[a+12>>2]=a,q[a+8>>2]=a}Za=q[mb+8>>2],q[Za+12>>2]=a,q[mb+8>>2]=a,q[a+24>>2]=0,q[a+12>>2]=mb,q[a+8>>2]=Za}}function Aa(a){var vb,xb,yb,Ab,Bb,Cb,sb,wb,Za=x(0),tb=(x(0),0),ub=0,zb=(x(0),x(0),x(0),x(0),0);x(0),x(0);a:{b:{if(j(a),ub=2147483647&(tb=b[0])){if(!(ub>>>0<2139095041))return x(x(.10000000149011612)+a);if(1065353216==(0|ub))return x(-1<(0|tb)?.10000000149011612:10);if(2139095040==(0|ub))return x(-1<(0|tb)?0:-a);if(1073741824==(0|tb))return x(.010000000707805157);if(1056964608==(0|tb))return x(.3162277638912201);if(1291845633<=ub>>>0)return x((0|tb)<0?H:0);if(vb=u[1701],wb=x(x(1.600000023841858)-vb),xb=x(x(1)/x(vb+x(1.600000023841858))),f(0,-4096&(j(sb=x(wb*xb)),b[0])),Za=k(),yb=x(Za*Za),Bb=u[1705],vb=x(xb*x(x(wb-x((Ab=Za)*x(3.099609375)))-x(Za*x(x(1.600000023841858)-x(x(3.099609375)-vb))))),xb=x(x(sb+Za)*vb),Za=x(sb*sb),wb=x(xb+x(x(Za*Za)*x(x(Za*x(x(Za*x(x(Za*x(x(Za*x(x(Za*x(.20697501301765442))+x(.23066075146198273)))+x(.2727281153202057)))+x(.3333333432674408)))+x(.4285714328289032)))+x(.6000000238418579)))),f(0,-4096&(j(x(x(yb+x(3))+wb)),b[0])),Za=k(),xb=x(Ab*Za),sb=x(x(vb*Za)+x(sb*x(wb-x(x(Za+x(-3))-yb)))),f(0,-4096&(j(x(xb+sb)),b[0])),Za=k(),vb=x(Za*x(.9619140625)),yb=x(u[1703]+x(x(x(sb-x(Za-xb))*x(.9617967009544373))+x(Za*x(-.00011736857413779944)))),f(0,-4096&(j(x(x(Bb+x(vb+yb))+x(-4))),b[0])),sb=k(),f(0,-4096&tb),wb=k(),Za=x(sb*wb),a=x(x(x(yb-x(x(x(sb-x(-4))-Bb)-vb))*a)+x(x(a-wb)*sb)),j(sb=x(Za+a)),1124073473<=(0|(tb=b[0])))break b;d:{if((ub=1124073472)==(0|tb)){if(x(a+x(4.299566569443414e-8))>x(sb-Za))break b}else{if(ub=2147483647&tb,!(a<=x(sb-Za)^1|-1021968384!=(0|tb))|1125515265<=ub>>>0)break a;if(ub>>>0<1056964609)break d}zb=(8388607&(ub=(8388608>>>(ub>>>23)-126)+tb|0)|8388608)>>>150-(Cb=ub>>>23&255),zb=(0|tb)<0?0-zb|0:zb,Za=x(Za-(f(0,ub&-8388608>>Cb-127),k())),j(x(a+Za)),tb=b[0]}f(0,-32768&tb),sb=k(),vb=x(sb*x(.693145751953125)),sb=x(x(sb*x(14286065379565116e-22))+x(x(a-x(sb-Za))*x(.6931471824645996))),a=x(vb+sb),Za=x(a*a),Za=x(a-x(Za*x(x(Za*x(x(Za*x(x(Za*x(x(Za*x(4.138136944220605e-8))+x(-16533901998627698e-22)))+x(661375597701408e-19)))+x(-.0027777778450399637)))+x(.1666666716337204)))),Ab=x(x(a*Za)/x(Za+x(-2))),Za=x(sb-x(a-vb)),a=(0|(tb=0|(j(a=x(x(a-x(Ab-x(Za+x(a*Za))))+x(1))),b[0]+(zb<<23))))<=8388607?function(a,Vk){var zl=0;return 128<=(0|Vk)?(a=x(a*x(17014118346046923e22)),Vk=(0|(zl=Vk+-127|0))<128?zl:(a=x(a*x(17014118346046923e22)),((0|Vk)<381?Vk:381)+-254|0)):-127<(0|Vk)||(a=x(a*x(11754943508222875e-54)),Vk=-127<(0|(zl=Vk+126|0))?zl:(a=x(a*x(11754943508222875e-54)),(-378<(0|Vk)?Vk:-378)+252|0)),x(a*(f(0,1065353216+(Vk<<23)|0),k()))}(a,zb):(f(0,tb),k()),a=x(x(1)*a)}else a=x(1);return a}return x(H)}return x(0)}function Ba(a,Db){var Jb,Eb,Gb,Fb=0,Hb=0,Ib=x(0);if(j(Db),!((Gb=2147483647&(Eb=b[0]))>>>0<=2139095040&&(j(a),(Fb=2147483647&(Hb=b[0]))>>>0<2139095041)))return x(a+Db);if(1065353216==(0|Eb))return Ca(a);Eb=(Jb=Eb>>>30&2)|Hb>>>31;b:{c:{d:{e:{if(!Fb){switch(Eb-2|0){case 0:break e;case 1:break;default:break d}return x(-3.1415927410125732)}if(2139095040!=(0|Gb)){if(!Gb|!(Fb>>>0<=218103808+Gb>>>0&&2139095040!=(0|Fb)))break b;if(a=Ib=Fb+218103808>>>0>>0&&(Ib=x(0),Jb)?Ib:Ca(x(y(x(a/Db)))),Eb>>>0<=2){switch(Eb-1|0){case 0:return x(-a);case 1:break;default:break d}return x(x(3.1415927410125732)-x(a+x(8.742277657347586e-8)))}return x(x(a+x(8.742277657347586e-8))+x(-3.1415927410125732))}if(2139095040==(0|Fb))break c;return u[6784+(Eb<<2)>>2]}a=x(3.1415927410125732)}return a}return u[6768+(Eb<<2)>>2]}return x((0|Hb)<0?-1.5707963705062866:1.5707963705062866)}function Ca(a){x(0);var Kb,Nb,Ob,Db,Mb,Lb=0;x(0),x(0),j(a);a:{if(1283457024<=(Db=2147483647&(Mb=b[0]))>>>0){if(2139095040>>0)break a;return x((0|Mb)<0?-1.570796251296997:1.570796251296997)}b:{if(Db>>>0<=1054867455){if(Lb=-1,964689920<=Db>>>0)break b;break a}a=x(y(a)),Lb=Db>>>0<=1066926079?Db>>>0<=1060110335?(a=x(x(x(a+a)+x(-1))/x(a+x(2))),0):(a=x(x(a+x(-1))/x(a+x(1))),1):Db>>>0<=1075576831?(a=x(x(a+x(-1.5))/x(x(a*x(1.5))+x(1))),2):(a=x(x(-1)/a),3)}if(Db=Lb,Nb=x(a*a),Kb=x(Nb*Nb),Ob=x(Kb*x(x(Kb*x(-.106480173766613))+x(-.19999158382415771))),Kb=x(Nb*x(x(Kb*x(x(Kb*x(.06168760731816292))+x(.14253635704517365)))+x(.333333283662796))),(0|Db)<=-1)return x(a-x(a*x(Ob+Kb)));a=x(u[6736+(Db<<=2)>>2]-x(x(x(a*x(Ob+Kb))-u[6752+Db>>2])-a)),a=(0|Mb)<0?x(-a):a}return a}function Da(a,Pb){var Ub,Sb,Tb,Qb=0,Rb=0;return L=Sb=L-16|0,j(a),(Qb=2147483647&(Tb=b[0]))>>>0<=1305022426?(v[Pb>>3]=(Ub=+a)+-1.5707963109016418*(Rb=.6366197723675814*Ub+6755399441055744-6755399441055744)+-1.5893254773528196e-8*Rb,Qb=y(Rb)<2147483648?~~Rb:-2147483648):2139095040<=Qb>>>0?(v[Pb>>3]=x(a-a),Qb=0):(Ub=Qb,v[8+Sb>>3]=(f(0,Ub-((Qb=(Qb>>>23)-150|0)<<23)|0),k()),Qb=function(a,Il,Jl){var Nl,Sl,Wl,Xl,Zl,_l,Kl=0,Ll=0,Ml=0,Ol=0,Pl=0,Ql=0,Rl=0,Tl=0,Ul=0,Vl=0,Yl=0;if(L=Nl=L-560|0,Rl=(Ll=Jl)+w(Wl=0<(0|(Jl=(Jl+-3|0)/24|0))?Jl:0,-24)|0,0<=(0|(Sl=q[972])))for(Ll=Sl+1|0,Jl=Wl;v[(320+Nl|0)+(Ml<<3)>>3]=(0|Jl)<0?0:+q[3904+(Jl<<2)>>2],Jl=Jl+1|0,(0|Ll)!=(0|(Ml=Ml+1|0)););for(Pl=Rl+-24|0,Ll=0;;){for(Kl=Jl=0;Kl+=v[(Jl<<3)+a>>3]*v[(320+Nl|0)+(Ll-Jl<<3)>>3],1!=(0|(Jl=Jl+1|0)););if(v[(Ll<<3)+Nl>>3]=Kl,Jl=(0|Ll)<(0|Sl),Ll=Ll+1|0,!Jl)break}_l=23-Pl|0,Xl=24-Pl|0,Ll=Sl;a:{for(;;){if(Kl=v[(Ll<<3)+Nl>>3],!(Ul=((Jl=0)|(Ml=Ll))<1))for(;Ql=(480+Nl|0)+(Jl<<2)|0,Tl=Kl,Ol=y(Kl*=5.960464477539063e-8)<2147483648?~~Kl:-2147483648,Ol=y(Tl+=-16777216*(Kl=0|Ol))<2147483648?~~Tl:-2147483648,q[Ql>>2]=Ol,Kl=v[((Ml=Ml+-1|0)<<3)+Nl>>3]+Kl,(0|Ll)!=(0|(Jl=Jl+1|0)););Kl=ja(Kl,Pl),Kl=(Kl+=-8*C(.125*Kl))-(0|(Ql=y(Kl)<2147483648?~~Kl:-2147483648));e:{f:{g:{if(Yl=(0|Pl)<1){if(Pl)break g;Ol=q[476+((Ll<<2)+Nl|0)>>2]>>23}else Ol=q[476+(Ml=(Ll<<2)+Nl|0)>>2],Vl=Ml,Ml=Ol-((Jl=Ol>>Xl)<>2]=Ml)>>_l;if((0|Ol)<1)break e;break f}if(Ol=2,!(.5<=Kl)){Ol=0;break e}}if(Ml=Jl=0,!Ul)for(;;){Ul=q[(Zl=(480+Nl|0)+(Jl<<2)|0)>>2],Vl=16777215;i:{j:{if(!Ml){if(!Ul)break j;Vl=16777216,Ml=1}q[Zl>>2]=Vl-Ul;break i}Ml=0}if((0|Ll)==(0|(Jl=Jl+1|0)))break}Yl||1<(Jl=Pl+-1|0)>>>0||(q[476+(Jl=(Ll<<2)+Nl|0)>>2]=Jl-1?8388607&q[Jl+476>>2]:4194303&q[Jl+476>>2]),Ql=Ql+1|0,2==(0|Ol)&&(Kl=1-Kl,Ol=2,Ml)&&(Kl-=ja(1,Pl))}if(0!=Kl)break;if(!(((Ml=0)|(Jl=Ll))<=(0|Sl))){for(;Ml=q[(480+Nl|0)+((Jl=Jl+-1|0)<<2)>>2]|Ml,(0|Sl)<(0|Jl););if(Ml){for(Rl=Pl;Rl=Rl+-24|0,!q[(480+Nl|0)+((Ll=Ll+-1|0)<<2)>>2];);break a}}for(Jl=1;Jl=(Ml=Jl)+1|0,!q[(480+Nl|0)+(Sl-Ml<<2)>>2];);for(Ml=Ll+Ml|0;;){for(Ll=Ql=Ll+1|0,v[(320+Nl|0)+(Ql<<3)>>3]=q[3904+(Wl+Ll<<2)>>2],Kl=Jl=0;Kl+=v[(Jl<<3)+a>>3]*v[(320+Nl|0)+(Ql-Jl<<3)>>3],1!=(0|(Jl=Jl+1|0)););if(v[(Ll<<3)+Nl>>3]=Kl,!((0|Ll)<(0|Ml)))break}Ll=Ml}16777216<=(Kl=ja(Kl,0-Pl|0))?(a=(480+Nl|0)+(Ll<<2)|0,Tl=Kl,Jl=y(Kl*=5.960464477539063e-8)<2147483648?~~Kl:-2147483648,Ml=y(Kl=Tl+-16777216*(0|Jl))<2147483648?~~Kl:-2147483648,q[a>>2]=Ml,Ll=Ll+1|0):(Jl=y(Kl)<2147483648?~~Kl:-2147483648,Rl=Pl),q[(480+Nl|0)+(Ll<<2)>>2]=Jl}if(Kl=ja(1,Rl),!((0|Ll)<=-1)){for(Jl=Ll;v[(Jl<<3)+Nl>>3]=Kl*+q[(480+Nl|0)+(Jl<<2)>>2],Kl*=5.960464477539063e-8,a=0<(0|Jl),Jl=Jl+-1|0,a;);if(!((0|Ll)<=-1))for(Jl=Ll;;){for(Pl=Ll-(a=Jl)|0,Jl=Kl=0;Kl+=v[6672+(Jl<<3)>>3]*v[(a+Jl<<3)+Nl>>3],!((0|Sl)<=(0|Jl))&&(Rl=Jl>>>0>>0,Jl=Jl+1|0,Rl););if(v[(160+Nl|0)+(Pl<<3)>>3]=Kl,Jl=a+-1|0,!(0<(0|a)))break}}if(0<=(Ll|(Kl=0)))for(;Kl+=v[(160+Nl|0)+(Ll<<3)>>3],a=0<(0|Ll),Ll=Ll+-1|0,a;);return v[Il>>3]=Ol?-Kl:Kl,L=560+Nl|0,7&Ql}(8+Sb|0,Sb,Qb),Rb=v[Sb>>3],(0|Tb)<=-1?(v[Pb>>3]=-Rb,Qb=0-Qb|0):v[Pb>>3]=Rb),L=16+Sb|0,Qb}function Ea(a,Pb){return a?function(a,Il){a:{if(a){if(Il>>>0<=127)break a;if(q[q[1789]>>2]){if(Il>>>0<=2047)return o[a+1|0]=63&Il|128,o[0|a]=Il>>>6|192,2;if(!(57344!=(-8192&Il)&&55296<=Il>>>0))return o[a+2|0]=63&Il|128,o[0|a]=Il>>>12|224,o[a+1|0]=Il>>>6&63|128,3;if(Il+-65536>>>0<=1048575)return o[a+3|0]=63&Il|128,o[0|a]=Il>>>18|240,o[a+2|0]=Il>>>6&63|128,o[a+1|0]=Il>>>12&63|128,4}else if(57216==(-128&Il))break a;q[2086]=25,a=-1}else a=1;return a}return o[0|a]=Il,1}(a,Pb):0}function Fa(a,Pb,Wb){var fc,gc,Xb=0,Yb=0,Zb=0,_b=0,$b=0,ac=0,bc=0,cc=0,dc=0,ec=r[a+4|0];if(q[Pb>>2]=652,Yb=q[a+704>>2],1<=(0|(_b=q[Yb>>2]))){for($b=q[a+720>>2],bc=q[a+1072>>2];Zb=(1<>2]<<2)>>2])+Zb|0,(0|_b)!=(0|(Xb=Xb+1|0)););Xb=Zb<<2}if(q[Pb+4>>2]=w(_b,12),q[Pb+8>>2]=q[Yb>>2]<<2,q[Pb+12>>2]=q[Yb>>2]<<2,q[Pb+16>>2]=q[Yb>>2]<<2,q[Pb+20>>2]=q[Yb>>2]<<2,Zb=q[Yb>>2],q[Pb+28>>2]=Xb,q[Pb+24>>2]=Zb<<2,Zb=q[Yb>>2],q[Pb+40>>2]=Xb,q[Pb+36>>2]=Xb,q[Pb+32>>2]=Zb<<2,q[Pb+44>>2]=q[Yb+4>>2]<<5,q[Pb+48>>2]=q[Yb+4>>2]<<2,q[Pb+52>>2]=q[Yb+4>>2]<<2,q[Pb+56>>2]=q[Yb+4>>2]<<2,q[Pb+60>>2]=q[Yb+4>>2]<<4,q[Pb+64>>2]=q[Yb+4>>2]<<4,1<=((Xb=0)|(_b=q[Yb+8>>2]))){for($b=q[a+780>>2],bc=q[a+1072>>2],dc=q[a+796>>2],Zb=0;ac=(15+(q[(cc=Xb<<2)+dc>>2]<<3)&-16)+ac|0,Zb=(1<>2]<<2)>>2])+Zb|0,(0|_b)!=(0|(Xb=Xb+1|0)););Xb=Zb<<2}if(q[Pb+68>>2]=w(_b,24),q[Pb+72>>2]=q[Yb+8>>2]<<2,q[Pb+76>>2]=q[Yb+8>>2]<<2,Zb=q[Yb+8>>2],q[Pb+84>>2]=ac,q[Pb+80>>2]=Zb<<2,q[Pb+88>>2]=q[Yb+8>>2]<<4,q[Pb+92>>2]=q[Yb+8>>2]<<4,Zb=q[Yb+8>>2],q[Pb+100>>2]=Xb,q[Pb+96>>2]=Zb<<2,Zb=q[Yb+8>>2],q[Pb+140>>2]=Xb,q[Pb+136>>2]=Xb,q[Pb+132>>2]=Xb,q[Pb+128>>2]=Xb,q[Pb+124>>2]=Xb,q[Pb+120>>2]=Xb,q[Pb+116>>2]=Xb,q[Pb+112>>2]=Xb,q[Pb+108>>2]=Xb,q[Pb+104>>2]=Zb<<2,q[Pb+144>>2]=q[Yb+8>>2]<<2,q[Pb+148>>2]=q[Yb+8>>2]<<2,q[Pb+152>>2]=q[Yb+8>>2]<<2,q[Pb+156>>2]=q[Yb+8>>2]<<2,q[Pb+160>>2]=q[Yb+8>>2]<<2,q[Pb+164>>2]=q[Yb+8>>2]<<2,1<=((Xb=ac=0)|(_b=q[Yb+12>>2]))){for($b=q[a+812>>2],bc=q[a+1072>>2],Zb=0;Zb=(1<>2]<<2)>>2])+Zb|0,(0|_b)!=(0|(Xb=Xb+1|0)););Xb=Zb<<2}if(q[Pb+168>>2]=w(_b,12),q[Pb+172>>2]=q[Yb+12>>2]<<2,q[Pb+176>>2]=q[Yb+12>>2]<<2,q[Pb+180>>2]=q[Yb+12>>2]<<2,q[Pb+184>>2]=q[Yb+12>>2]<<2,q[Pb+188>>2]=q[Yb+12>>2]<<2,q[Pb+192>>2]=q[Yb+12>>2]<<2,q[Pb+196>>2]=q[Yb+12>>2]<<2,q[Pb+200>>2]=q[Yb+12>>2]<<2,q[Pb+204>>2]=q[Yb+12>>2]<<4,q[Pb+208>>2]=q[Yb+12>>2]<<4,Zb=q[Yb+12>>2],q[Pb+216>>2]=Xb,q[Pb+212>>2]=Zb<<2,Zb=q[Yb+12>>2],q[Pb+268>>2]=Xb,q[Pb+264>>2]=Xb,q[Pb+260>>2]=Xb,q[Pb+256>>2]=Xb,q[Pb+252>>2]=Xb,q[Pb+248>>2]=Xb,q[Pb+244>>2]=Xb,q[Pb+240>>2]=Xb,q[Pb+236>>2]=Xb,q[Pb+232>>2]=Xb,q[Pb+228>>2]=Xb,q[Pb+224>>2]=Xb,q[Pb+220>>2]=Zb<<2,q[Pb+272>>2]=q[Yb+12>>2]<<2,q[Pb+276>>2]=q[Yb+12>>2]<<2,q[Pb+280>>2]=q[Yb+12>>2]<<2,q[Pb+284>>2]=q[Yb+12>>2]<<2,q[Pb+288>>2]=q[Yb+12>>2]<<2,q[Pb+292>>2]=q[Yb+12>>2]<<2,1<=((Xb=0)|(Zb=q[Yb+16>>2]))){for($b=q[a+852>>2],bc=q[a+1072>>2],dc=q[a+892>>2],_b=0;ac=(15+(q[(cc=Xb<<2)+dc>>2]<<3)&-16)+ac|0,_b=(1<>2]<<2)>>2])+_b|0,(0|Zb)!=(0|(Xb=Xb+1|0)););Xb=_b<<2}if(q[Pb+296>>2]=w(Zb,20),q[Pb+300>>2]=q[Yb+16>>2]<<2,q[Pb+304>>2]=q[Yb+16>>2],q[Pb+308>>2]=q[Yb+16>>2]<<2,q[Pb+312>>2]=q[Yb+16>>2]<<2,Zb=q[Yb+16>>2],q[Pb+320>>2]=ac,q[Pb+316>>2]=Zb<<2,q[Pb+324>>2]=q[Yb+16>>2]<<2,q[Pb+328>>2]=q[Yb+16>>2]<<4,q[Pb+332>>2]=q[Yb+16>>2]<<4,q[Pb+336>>2]=q[Yb+16>>2]<<2,q[Pb+340>>2]=q[Yb+16>>2]<<2,q[Pb+344>>2]=q[Yb+16>>2]<<2,q[Pb+348>>2]=q[Yb+16>>2]<<4,q[Pb+352>>2]=q[Yb+16>>2]<<4,Zb=q[Yb+16>>2],q[Pb+360>>2]=Xb,q[Pb+356>>2]=Zb<<2,Zb=q[Yb+16>>2],q[Pb+404>>2]=Xb,q[Pb+400>>2]=Xb,q[Pb+396>>2]=Xb,q[Pb+392>>2]=Xb,q[Pb+388>>2]=Xb,q[Pb+384>>2]=Xb,q[Pb+380>>2]=Xb,q[Pb+376>>2]=Xb,q[Pb+372>>2]=Xb,q[Pb+368>>2]=Xb,q[Pb+364>>2]=Zb<<2,q[Pb+408>>2]=q[Yb+16>>2]<<2,q[Pb+412>>2]=q[Yb+16>>2]<<2,q[Pb+416>>2]=q[Yb+16>>2]<<2,q[Pb+420>>2]=q[Yb+16>>2]<<2,q[Pb+424>>2]=q[Yb+16>>2]<<2,q[Pb+428>>2]=q[Yb+16>>2]<<2,$b=q[a+704>>2],q[Pb+432>>2]=w(q[$b+20>>2],52),q[Pb+436>>2]=ec>>>(Xb=_b=0)<=3?q[$b+20>>2]<<2:0,q[Pb+440>>2]=q[$b+20>>2]<<2,q[Pb+444>>2]=w(q[$b+52>>2],28),1<=(0|(Yb=q[$b+48>>2]))){for(Zb=q[a+1072>>2],ac=0;ac=(bc=q[Zb+(Xb<<2)>>2])+ac|0,_b=(1<>2]=Xb,q[Pb+456>>2]=Xb,q[Pb+452>>2]=_b,q[Pb+448>>2]=w(Yb,36),q[Pb+500>>2]=w(q[$b+72>>2],28),1<=((ac=Xb=Zb=0)|(bc=q[$b+72>>2]))){for(dc=q[a+1224>>2],cc=q[a+1220>>2],gc=q[a+1212>>2],_b=0;_b=(0|(fc=q[(Yb=ac<<2)+cc>>2]-q[Yb+dc>>2]|0))<(0|_b)?_b:1+fc|0,Xb=(0|Xb)<(0|(Yb=q[Yb+gc>>2]))?Yb:Xb,(0|bc)!=(0|(ac=ac+1|0)););ac=Xb<<2,Xb=_b<<2}if(Yb=q[$b+76>>2],q[Pb+516>>2]=Xb,q[Pb+512>>2]=ac,q[Pb+508>>2]=Xb,q[Pb+504>>2]=Yb<<4,1<=(0|(Yb=q[$b+80>>2]))){for(Zb=q[a+1248>>2],ac=q[a+1072>>2],_b=Xb=0;_b=(1<>2]<<2)>>2])+_b|0,(0|Yb)!=(0|(Xb=Xb+1|0)););Zb=_b<<2}if(q[Pb+520>>2]=w(Yb,24),q[Pb+524>>2]=q[$b+80>>2]<<2,Yb=q[$b+80>>2],q[Pb+532>>2]=Zb,q[Pb+528>>2]=Yb<<2,Yb=q[$b+80>>2],q[Pb+544>>2]=Zb,q[Pb+540>>2]=Zb,q[Pb+536>>2]=Yb<<2,Yb=Pb,4<=ec>>>0){if(q[Pb+464>>2]=w(q[$b+120>>2],20),q[Pb+468>>2]=w(q[$b+100>>2],28),Zb=Pb,1<=((Xb=ac=0)|(bc=q[$b+104>>2]))){for(a=q[a+1104>>2],_b=0;_b=q[a+(Xb<<2)>>2]+_b|0,(0|bc)!=(0|(Xb=Xb+1|0)););a=_b<<2}else a=0;q[Zb+476>>2]=a,q[Pb+472>>2]=w(bc,48),q[Pb+484>>2]=w(q[$b+108>>2],12),a=q[$b+112>>2],q[Pb+552>>2]=0,q[Pb+492>>2]=w(a,12),a=0}else{if((0|(ac=q[$b+20>>2]))<1)_b=0;else for(bc=q[a+1060>>2],dc=q[a+952>>2],a=q[a+948>>2],Zb=_b=0;;){if(1<=(0|(cc=q[(Xb=Zb<<2)+dc>>2])))for(cc=(Xb=bc+(q[a+Xb>>2]<<2)|0)+(cc<<2)|0;_b=q[Xb>>2]+_b|0,(Xb=Xb+4|0)>>>0>>0;);if((0|ac)==(0|(Zb=Zb+1|0)))break}q[Pb+552>>2]=ac<<2,ac=q[$b+20>>2]<<2,a=_b<<2}for(q[Yb+556>>2]=a,q[Pb+548>>2]=ac,4>>0&&(q[Pb+480>>2]=w(q[$b+128>>2],12),q[Pb+488>>2]=w(q[$b+132>>2],12),q[Pb+496>>2]=w(q[$b+136>>2],12)),Xb=_b=0;Xb=((Yb=q[(a=(_b<<2)+Pb|0)>>2])+15&-16)+(q[a>>2]=Xb)|0,140!=(0|(_b=_b+1|0)););q[Wb>>2]=Xb}function Ga(a,Pb,Wb,hc){a:{if(!(20>>0||9<(Pb=Pb+-9|0)>>>0)){switch(Pb-1|0){default:return Pb=q[Wb>>2],q[Wb>>2]=Pb+4,q[a>>2]=q[Pb>>2];case 0:return Pb=q[Wb>>2],q[Wb>>2]=Pb+4,Pb=q[Pb>>2],q[a>>2]=Pb,q[a+4>>2]=Pb>>31;case 1:return Pb=q[Wb>>2],q[Wb>>2]=Pb+4,q[a>>2]=q[Pb>>2],q[a+4>>2]=0;case 3:return Pb=q[Wb>>2],q[Wb>>2]=Pb+4,Pb=p[Pb>>1],q[a>>2]=Pb,q[a+4>>2]=Pb>>31;case 4:return Pb=q[Wb>>2],q[Wb>>2]=Pb+4,q[a>>2]=s[Pb>>1],q[a+4>>2]=0;case 5:return Pb=q[Wb>>2],q[Wb>>2]=Pb+4,Pb=o[0|Pb],q[a>>2]=Pb,q[a+4>>2]=Pb>>31;case 6:return Pb=q[Wb>>2],q[Wb>>2]=Pb+4,q[a>>2]=r[0|Pb],q[a+4>>2]=0;case 2:case 7:break a;case 8:}n[hc](a,Wb)}return}Pb=q[Wb>>2]+7&-8,q[Wb>>2]=Pb+8,Wb=q[Pb+4>>2],q[a>>2]=q[Pb>>2],q[a+4>>2]=Wb}function Ha(a){var Pb,hc,Wb=0;if(ha(o[q[a>>2]]))for(;Pb=q[a>>2],hc=o[0|Pb],q[a>>2]=Pb+1,Wb=(w(Wb,10)+hc|0)-48|0,ha(o[Pb+1|0]););return Wb}function Ia(a,ic,jc,kc,lc){var oc,mc;q[204+(L=mc=L-208|0)>>2]=jc,ca(160+mc|(jc=0),0,40),q[200+mc>>2]=q[204+mc>>2],(0|ra(0,ic,200+mc|0,80+mc|0,160+mc|0,kc,lc))<0||(jc=0<=q[a+76>>2]?1:jc,jc=q[a>>2],o[a+74|0]<=0&&(q[a>>2]=-33&jc),oc=32&jc,q[a+48>>2]?ra(a,ic,200+mc|0,80+mc|0,160+mc|0,kc,lc):(q[a+48>>2]=80,q[a+16>>2]=80+mc,q[a+28>>2]=mc,q[a+20>>2]=mc,jc=q[a+44>>2],ra(a,ic,200+(q[a+44>>2]=mc)|0,80+mc|0,160+mc|0,kc,lc),jc&&(n[q[a+36>>2]](a,0,0),q[a+48>>2]=0,q[a+44>>2]=jc,q[a+28>>2]=0,q[a+16>>2]=0,q[a+20>>2]=0)),q[a>>2]=q[a>>2]|oc),L=208+mc|0}function Ka(a,ic,pc){var rc,qc;$(8+(L=qc=L-160|0)|0,3192,144),q[52+qc>>2]=a,q[28+qc>>2]=a,q[56+qc>>2]=rc=(rc=-2-a|0)>>>0<256?rc:256,q[36+qc>>2]=a=a+rc|0,q[24+qc>>2]=a,Ia(8+qc|0,ic,pc,11,12),rc&&(a=q[28+qc>>2],o[a-((0|a)==q[24+qc>>2])|0]=0),L=160+qc|0}function La(a,ic){var sc,tc,pc=0,pc=0!=(0|ic);a:{b:{c:{d:if(!(!ic|!(3&a)))for(;;){if(!r[0|a])break c;if(a=a+1|0,pc=0!=(0|(ic=ic+-1|0)),!ic)break d;if(!(3&a))break}if(!pc)break b}if(!r[0|a])break a;e:{if(4<=ic>>>0){for(pc=(pc=ic+-4|0)-(sc=-4&pc)|0,sc=4+(a+sc|0)|0;;){if((-1^(tc=q[a>>2]))&tc+-16843009&-2139062144)break e;if(a=a+4|0,!(3<(ic=ic+-4|0)>>>0))break}ic=pc,a=sc}if(!ic)break b}for(;;){if(!r[0|a])break a;if(a=a+1|0,!(ic=ic+-1|0))break}}return 0}return a}function Ma(a){var uc,ic=0;if(!a)return 32;if(!(1&a))for(;ic=ic+1|0,uc=2&a,a>>>=1,!uc;);return ic}function Na(a,vc){var zc,Ac,Bc,yc,wc=0,xc=0,xc=4;L=yc=L-256|0;a:if(!((0|vc)<2))for(wc=q[(Bc=(vc<<2)+a|0)>>2]=yc;;){for($(wc,q[a>>2],zc=xc>>>0<256?xc:256),wc=0;$(q[(Ac=(wc<<2)+a|0)>>2],q[((wc=wc+1|0)<<2)+a>>2],zc),q[Ac>>2]=q[Ac>>2]+zc,(0|vc)!=(0|wc););if(!(xc=xc-zc|0))break a;wc=q[Bc>>2]}L=256+yc|0}function Oa(a){return Ma(q[a>>2]+-1|0)||((a=Ma(q[a+4>>2]))?a+32|0:0)}function Zc(a,$o){$o|=0,b[0]=a|=0,b[1]=$o}function ad(a,$o,ap){return function(a,$o,ap){var ep,cp,bp,dp,fp=w(cp=ap>>>16,bp=a>>>16);return a=(65535&(bp=((ep=w(dp=65535&ap,a&=65535))>>>16)+w(bp,dp)|0))+w(a,cp)|0,M=((fp+w($o,ap)|0)+(bp>>>16)|0)+(a>>>16)|0,65535&ep|a<<16}(a,$o,ap)}function bd(a,$o,ap){return function(a,$o,ap){var np,mp,gp=0,hp=0,ip=0,jp=0,kp=0,lp=0,op=0;a:{b:{c:{d:{e:{if(!(hp=$o))return Zc(($o=a)-w(a=(a>>>0)/(ap>>>0)|0,ap)|0,0),M=0,a;if(gp=ap){if(!((jp=gp+-1|0)&gp))break e;kp=0-(jp=(z(gp)+33|0)-z(hp)|0)|0;break c}if(!a)return Zc(0,hp-w(a=(hp>>>0)/0|0,0)|0),M=0,a;if((gp=32-z(hp)|0)>>>0<31)break d;break b}if(Zc(a&jp,0),1==(0|gp))break a;return ap=31&(gp=gp?31-z(gp+-1^gp)|0:32),a=32<=(63&gp)>>>0?(hp=0,$o>>>ap):(hp=$o>>>ap,((1<>>ap),M=hp,a}jp=gp+1|0,kp=63-gp|0}if(gp=$o,ip=31&(hp=63&jp),ip=32<=hp>>>0?(hp=0,gp>>>ip):(hp=gp>>>ip,((1<>>ip),gp=31&(kp&=63),32<=kp>>>0?($o=a<>>32-gp|$o<>>0<4294967295&&(gp=0);ip=(mp=lp=ip<<1|$o>>>31)-(np=ap&(lp=gp-((hp=hp<<1|ip>>>31)+(kp>>>0>>0)|0)>>31))|0,hp=hp-(mp>>>0>>0)|0,$o=$o<<1|a>>>31,a=op|a<<1,op=lp&=1,jp=jp+-1|0;);return Zc(ip,hp),M=$o<<1|a>>>31,lp|a<<1}Zc(a,$o),$o=a=0}return M=$o,a}(a,$o,ap)}function dd(a){var pp;return(-1>>>(pp=31&a)&-2)<>>a}function N(){return buffer.byteLength/65536|0}}(H,I,J)}}l=null,b.wasmBinary&&(F=b.wasmBinary);var WebAssembly={},F=[];"object"!=typeof WebAssembly&&E("no native wasm support detected");var I,J=new function(a){var c=Array(16);return c.grow=function(){17<=c.length&&B("Unable to grow wasm table. Use a higher value for RESERVED_FUNCTION_POINTERS or set ALLOW_TABLE_GROWTH."),c.push(null)},c.set=function(a,e){c[a]=e},c.get=function(a){return c[a]},c},K=!1;function assert(a,c){a||B("Assertion failed: "+c)}var buffer,M,L,N,ha="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function ia(a,c,d){var e=c+d;for(d=c;a[d]&&!(e<=d);)++d;if(16>10,56320|1023&f)))):e+=String.fromCharCode(f)}return e}function ja(a,c){return a?ia(L,a,c):""}function ka(a){return 0>>16)*e+d*(c>>>16)<<16)|0}),Math.fround||(ra=new Float32Array(1),Math.fround=function(a){return ra[0]=a,ra[0]}),Math.clz32||(Math.clz32=function(a){var c=32,d=a>>16;return d&&(c-=16,a=d),(d=a>>8)&&(c-=8,a=d),(d=a>>4)&&(c-=4,a=d),(d=a>>2)&&(c-=2,a=d),a>>1?c-2:c-a}),Math.trunc||(Math.trunc=function(a){return a<0?Math.ceil(a):Math.floor(a)}),0),Q=null,U=null;function B(a){throw b.onAbort&&b.onAbort(a),D(a),E(a),K=!0,"abort("+a+"). Build with -s ASSERTIONS=1 for more info."}b.preloadedImages={},b.preloadedAudios={};var V="data:application/octet-stream;base64,";function W(a){return String.prototype.startsWith?a.startsWith(V):0===a.indexOf(V)}var X="_em_module.wasm";function ta(){try{if(F)return new Uint8Array(F);var a=z(X);if(a)return a;if(w)return w(X);throw"both async and sync fetching of the wasm failed"}catch(c){B(c)}}W(X)||(t=X,X=b.locateFile?b.locateFile(t,u):u+t),na.push({ea:function(){va()}});var wa=[null,[],[]],xa=!1;function C(a){for(var c=[],d=0;d>4,f=(15&f)<<4|g>>2,h=(3&g)<<6|m}while(c+=String.fromCharCode(e),64!==g&&(c+=String.fromCharCode(f)),64!==m&&(c+=String.fromCharCode(h)),d>16),la(I.buffer);var d=1;break a}catch(e){}d=void 0}return!!d},c:function(a,c,d,e){try{for(var f=0,g=0;g>2],h=N[c+(8*g+4)>>2],A=0;A>2]=f,0}catch(T){return"undefined"!=typeof FS&&T instanceof FS.fa||B(T),T.ga}},memory:I,table:J},u=function(){function a(a){b.asm=a.exports,P--,b.monitorRunDependencies&&b.monitorRunDependencies(P),0==P&&(null!==Q&&(clearInterval(Q),Q=null),U)&&(a=U,U=null,a())}function c(c){a(c.instance)}function d(a){(F||!p&&!q||"function"!=typeof fetch?new Promise(function(a){a(ta())}):fetch(X,{credentials:"same-origin"}).then(function(a){if(a.ok)return a.arrayBuffer();throw"failed to load wasm binary file at '"+X+"'"}).catch(ta)).then(function(){return{then:function(a){a({instance:new da})}}}).then(a,function(a){E("failed to asynchronously prepare wasm: "+a),B(a)})}var e={env:H,wasi_unstable:H};if(P++,b.monitorRunDependencies&&b.monitorRunDependencies(P),b.instantiateWasm)try{return b.instantiateWasm(e,a)}catch(f){return E("Module.instantiateWasm callback failed with error: "+f),!1}return F||"function"!=typeof WebAssembly.instantiateStreaming||W(X)||"function"!=typeof fetch?d(c):fetch(X,{credentials:"same-origin"}).then(function(a){return WebAssembly.instantiateStreaming(a,e).then(c,function(a){E("wasm streaming compile failed: "+a),E("falling back to ArrayBuffer instantiation"),d(c)})}),{}}(),va=(b.asm=u,b.___wasm_call_ctors=function(){return b.asm.d.apply(null,arguments)}),Aa=(b._csmGetVersion=function(){return b.asm.e.apply(null,arguments)},b._csmGetLatestMocVersion=function(){return b.asm.f.apply(null,arguments)},b._csmGetMocVersion=function(){return b.asm.g.apply(null,arguments)},b._csmHasMocConsistency=function(){return b.asm.h.apply(null,arguments)},b._csmSetLogFunction=function(){return b.asm.i.apply(null,arguments)},b._csmReviveMocInPlace=function(){return b.asm.j.apply(null,arguments)},b._csmReadCanvasInfo=function(){return b.asm.k.apply(null,arguments)},b._csmGetSizeofModel=function(){return b.asm.l.apply(null,arguments)},b._csmInitializeModelInPlace=function(){return b.asm.m.apply(null,arguments)},b._csmUpdateModel=function(){return b.asm.n.apply(null,arguments)},b._csmGetParameterCount=function(){return b.asm.o.apply(null,arguments)},b._csmGetParameterIds=function(){return b.asm.p.apply(null,arguments)},b._csmGetParameterTypes=function(){return b.asm.q.apply(null,arguments)},b._csmGetParameterMinimumValues=function(){return b.asm.r.apply(null,arguments)},b._csmGetParameterMaximumValues=function(){return b.asm.s.apply(null,arguments)},b._csmGetParameterDefaultValues=function(){return b.asm.t.apply(null,arguments)},b._csmGetParameterValues=function(){return b.asm.u.apply(null,arguments)},b._csmGetPartCount=function(){return b.asm.v.apply(null,arguments)},b._csmGetPartIds=function(){return b.asm.w.apply(null,arguments)},b._csmGetPartOpacities=function(){return b.asm.x.apply(null,arguments)},b._csmGetPartParentPartIndices=function(){return b.asm.y.apply(null,arguments)},b._csmGetDrawableCount=function(){return b.asm.z.apply(null,arguments)},b._csmGetDrawableIds=function(){return b.asm.A.apply(null,arguments)},b._csmGetDrawableConstantFlags=function(){return b.asm.B.apply(null,arguments)},b._csmGetDrawableDynamicFlags=function(){return b.asm.C.apply(null,arguments)},b._csmGetDrawableTextureIndices=function(){return b.asm.D.apply(null,arguments)},b._csmGetDrawableDrawOrders=function(){return b.asm.E.apply(null,arguments)},b._csmGetDrawableRenderOrders=function(){return b.asm.F.apply(null,arguments)},b._csmGetDrawableOpacities=function(){return b.asm.G.apply(null,arguments)},b._csmGetDrawableMaskCounts=function(){return b.asm.H.apply(null,arguments)},b._csmGetDrawableMasks=function(){return b.asm.I.apply(null,arguments)},b._csmGetDrawableVertexCounts=function(){return b.asm.J.apply(null,arguments)},b._csmGetDrawableVertexPositions=function(){return b.asm.K.apply(null,arguments)},b._csmGetDrawableVertexUvs=function(){return b.asm.L.apply(null,arguments)},b._csmGetDrawableIndexCounts=function(){return b.asm.M.apply(null,arguments)},b._csmGetDrawableIndices=function(){return b.asm.N.apply(null,arguments)},b._csmGetDrawableMultiplyColors=function(){return b.asm.O.apply(null,arguments)},b._csmGetDrawableScreenColors=function(){return b.asm.P.apply(null,arguments)},b._csmGetDrawableParentPartIndices=function(){return b.asm.Q.apply(null,arguments)},b._csmResetDrawableDynamicFlags=function(){return b.asm.R.apply(null,arguments)},b._csmGetParameterKeyCounts=function(){return b.asm.S.apply(null,arguments)},b._csmGetParameterKeyValues=function(){return b.asm.T.apply(null,arguments)},b._csmMallocMoc=function(){return b.asm.U.apply(null,arguments)},b._csmMallocModelAndInitialize=function(){return b.asm.V.apply(null,arguments)},b._csmMalloc=function(){return b.asm.W.apply(null,arguments)},b._csmFree=function(){return b.asm.X.apply(null,arguments)},b._csmInitializeAmountOfMemory=function(){return b.asm.Y.apply(null,arguments)},b.stackSave=function(){return b.asm.Z.apply(null,arguments)}),Ba=b.stackAlloc=function(){return b.asm._.apply(null,arguments)},Ca=b.stackRestore=function(){return b.asm.$.apply(null,arguments)},ca=b.__growWasmMemory=function(){return b.asm.aa.apply(null,arguments)};function Z(){function a(){if(!Y&&(Y=!0,!K)){if(O(na),O(oa),b.onRuntimeInitialized&&b.onRuntimeInitialized(),b.postRun)for("function"==typeof b.postRun&&(b.postRun=[b.postRun]);b.postRun.length;){var a=b.postRun.shift();pa.unshift(a)}O(pa)}}if(!(0>6}else{if(k<=65535){if(d<=e+2)break;f[e++]=224|k>>12}else{if(d<=e+3)break;f[e++]=240|k>>18,f[e++]=128|k>>12&63}f[e++]=128|k>>6&63}f[e++]=128|63&k}}f[e]=0}}return c},array:function(a){var c=Ba(a.length);return M.set(a,c),c}},g=function(a){var c=b["_"+a];return assert(c,"Cannot call unknown function "+a+", make sure it is exported"),c}(a),m=[];if(a=0,e)for(var h=0;h>2]+(Ln<<5)|0)>>2],Pn=q[a+60>>2]+w(Wn,24)|0,Ln=(ko=q[Pn+8>>2])+-1|0,xo=(qo=q[Pn+4>>2])+-1|0,yo=uo=(Wn=q[q[a+152>>2]+(Wn<<2)>>2])+(ko<<3)|0,zo=vo=Wn+((to=w(qo,lo=ko+1|0))<<3)|0,Ao=wo=Wn+(ko+to<<3)|0,Io=q[Pn+12>>2],ro=x(0|qo),so=x(0|ko),a=0;Vn=u[4+(Pn=(oo=a<<3)+Mn|0)>>2],Rn=x(Vn*ro),Xn=u[Pn>>2],Qn=x(Xn*so),Pn=Vn>=x(1),Rn=!(Vn=x(1)|Xn>2],Bo=u[Wn+4>>2],Yn=x(ao-Bo),Co=u[4+yo>>2],Do=u[4+zo>>2],Zn=x(Co-Do),bo=x(x(Yn-Zn)*x(.5)),Eo=u[wo>>2],Fo=u[Wn>>2],_n=x(Eo-Fo),Go=u[uo>>2],Ho=u[vo>>2],$n=x(Go-Ho),co=x(x(_n-$n)*x(.5)),Zn=x(x(Zn+Yn)*x(.5)),$n=x(x($n+_n)*x(.5)),Jo=1,Yn=x(x(x(x(x(Bo+Co)+Do)+ao)*x(.25))-x(Yn*x(.5))),_n=x(x(x(x(x(Fo+Go)+Ho)+Eo)*x(.25))-x(_n*x(.5)))),Vnx(-2)^1|(Xnx(-2)^1)?(u[Nn+oo>>2]=x(Vn*co)+x(x(Xn*$n)+_n),Qn=x(Vn*bo),x(x(Xn*Zn)+Yn)):(Xn<=x(0)?Vn<=x(0)?(Un=x(x(Vn+x(2))*x(.5)),Tn=x(x(Xn+x(2))*x(.5)),Qn=x(bo+bo),mo=x(Yn-Qn),Rn=x(co+co),no=x(_n-Rn),io=x(Yn-x(Zn+Zn)),eo=x(io-Qn),jo=x(_n-x($n+$n)),fo=x(jo-Rn),go=u[Wn+4>>2],ho=u[Wn>>2]):Pn?(Qn=x(bo*x(3)),Rn=x(Yn-x(Zn+Zn)),io=x(Qn+Rn),eo=x(co*x(3)),fo=x(_n-x($n+$n)),jo=x(eo+fo),Un=x(x(Vn+x(-1))*x(.5)),Tn=x(x(Xn+x(2))*x(.5)),go=x(Qn+Yn),ho=x(eo+_n),eo=x(bo+Rn),fo=x(co+fo),mo=u[4+zo>>2],no=u[vo>>2]):(Qn=x(Yn-x(Zn+Zn)),Pn=xo,Sn=x(y(Rn))>2],no=u[Pn>>2],Pn=Wn+(w(Sn,lo)<<3)|0,go=u[Pn+4>>2],ho=u[Pn>>2]):Xn>=x(1)?Vn<=x(0)?(Un=x(x(Vn+x(2))*x(.5)),Tn=x(x(Xn+x(-1))*x(.5)),Qn=x(bo+bo),eo=x(x(Zn+Yn)-Qn),Rn=x(co+co),fo=x(x($n+_n)-Rn),go=x(x(Zn*x(3))+Yn),mo=x(go-Qn),ho=x(x($n*x(3))+_n),no=x(ho-Rn),io=u[4+yo>>2],jo=u[uo>>2]):Pn?(Qn=x(bo*x(3)),io=x(Qn+x(Zn+Yn)),Rn=x(co*x(3)),jo=x(Rn+x($n+_n)),ao=Qn,Qn=x(x(Zn*x(3))+Yn),go=x(ao+Qn),ao=Rn,Rn=x(x($n*x(3))+_n),ho=x(ao+Rn),Un=x(x(Vn+x(-1))*x(.5)),Tn=x(x(Xn+x(-1))*x(.5)),mo=x(bo+Qn),no=x(co+Rn),eo=u[4+Ao>>2],fo=u[wo>>2]):(Qn=x(x(Zn*x(3))+Yn),Pn=xo,Sn=x(y(Rn))>2],fo=u[Pn>>2],Pn=Wn+(w(Sn,lo)+ko<<3)|0,io=u[Pn+4>>2],jo=u[Pn>>2]):Vn<=x(0)?(Un=x(x(Vn+x(2))*x(.5)),Pn=Ln,Sn=x(y(Rn=Qn))>2],jo=u[Pn>>2],go=u[4+(Pn=Wn+(Sn<<3)|0)>>2],ho=u[Pn>>2]):Pn?(ao=Rn=x(bo*x(3)),Pn=Ln,Sn=x(y(Qn))>2],fo=u[Pn>>2],mo=u[4+(Pn=Wn+(Sn+to<<3)|0)>>2],no=u[Pn>>2]):(v[16+po>>3]=Vn,q[po>>2]=a,v[8+po>>3]=Xn,Y(4,1107,po)),x(Tn+Un)<=x(1)?(u[Nn+oo>>2]=x(fo+x(x(no-fo)*Tn))+x(x(jo-fo)*Un),Qn=x(eo+x(x(mo-eo)*Tn)),x(x(io-eo)*Un)):(Qn=x(x(1)-Tn),Rn=x(x(1)-Un),u[Nn+oo>>2]=x(ho+x(x(jo-ho)*Qn))+x(x(no-ho)*Rn),Qn=x(go+x(x(io-go)*Qn)),x(x(mo-go)*Rn)))):(Pn=x(y(ao=Rn))>2]=x(x(x(Qn*x(Rn*u[Sn>>2]))+x(Qn*x(Tn*u[Sn+8>>2])))+x(Un*x(Rn*u[Pn>>2])))+x(Un*x(Tn*u[Pn+8>>2])),Qn=x(x(x(Qn*x(Rn*u[Sn+4>>2]))+x(Qn*x(Tn*u[Sn+12>>2])))+x(Un*x(Rn*u[Pn+4>>2]))),x(Un*x(Tn*u[Pn+12>>2]))):x(Tn+Un)<=x(1)?(Qn=x(x(x(1)-Tn)-Un),Sn=Wn+(Pn<<3)|0,Pn=Wn+(Pn+lo<<3)|0,u[Nn+oo>>2]=x(x(Qn*u[Sn>>2])+x(Tn*u[Sn+8>>2]))+x(Un*u[Pn>>2]),Qn=x(x(Qn*u[Sn+4>>2])+x(Tn*u[Sn+12>>2])),x(Un*u[Pn+4>>2])):(Qn=x(x(Tn+x(-1))+Un),Sn=Wn+(Pn+lo<<3)|0,Rn=x(x(1)-Tn),Vn=x(x(1)-Un),Pn=Wn+(Pn<<3)|0,u[Nn+oo>>2]=x(x(Qn*u[Sn+8>>2])+x(Rn*u[Sn>>2]))+x(Vn*u[Pn+8>>2]),Qn=x(x(Qn*u[Sn+12>>2])+x(Rn*u[Sn+4>>2])),x(Vn*u[Pn+12>>2]))),u[4+(Nn+oo|0)>>2]=Qn+Rn,(0|On)!=(0|(a=a+1|0)););L=32+po|0},n[2]=function(a,mh){a|=0,mh|=0;var Dh=0,Eh=0,Fh=0,Gh=0,Hh=0,Ih=x(0),Jh=0,Kh=0,Mh=(x(0),0),Nh=0,Gh=q[a+320>>2],Dh=q[a+316>>2],Hh=q[a+308>>2];-1==(0|(Eh=q[8+(Fh=Hh+(mh<<5)|0)>>2]))?(q[(Nh=Dh)+(Dh=mh<<2)>>2]=q[q[a+148>>2]+(q[Fh+16>>2]<<2)>>2],q[Dh+Gh>>2]=1065353216):(Jh=q[Fh+16>>2],Kh=q[q[a+152>>2]+(Jh<<2)>>2],n[q[24+(Hh+(Eh<<5)|0)>>2]](a,Eh,Kh,Kh,q[16+(q[a+60>>2]+w(Jh,24)|0)>>2]),Ih=u[q[a+148>>2]+(q[Fh+16>>2]<<2)>>2],Fh=q[Fh+8>>2]<<2,u[(Eh=mh<<2)+Dh>>2]=Ih*u[Fh+Dh>>2],q[Eh+Gh>>2]=q[Fh+Gh>>2]),4<=r[q[a>>2]+4|0]&&(Gh=mh<<2,Dh=q[a+308>>2]+(mh<<5)|0,Eh=q[Dh+16>>2]<<2,Fh=q[a+328>>2],mh=q[a+324>>2],-1==(0|(Hh=q[Dh+8>>2]))?(Hh=q[a+156>>2],q[(Dh=Gh<<2)+mh>>2]=q[Hh+(Eh<<=2)>>2],q[(Jh=4|Dh)+mh>>2]=q[(Kh=4|Eh)+Hh>>2],q[(Mh=8|Dh)+mh>>2]=q[Hh+(Nh=8|Eh)>>2],q[mh+((Gh|=3)<<2)>>2]=1065353216,a=q[a+160>>2],q[Dh+Fh>>2]=q[a+Eh>>2],q[Fh+Jh>>2]=q[a+Kh>>2],q[Fh+Mh>>2]=q[a+Nh>>2]):(Eh=(Kh=Eh<<2)+q[a+156>>2]|0,u[(Dh=(Jh=Gh<<2)+mh|0)>>2]=u[Eh>>2]*u[(Hh=(Mh=Hh<<4)+mh|0)>>2],u[Dh+4>>2]=u[Eh+4>>2]*u[Hh+4>>2],u[Dh+8>>2]=u[Eh+8>>2]*u[Hh+8>>2],q[mh+((Gh|=3)<<2)>>2]=1065353216,a=Kh+q[a+160>>2]|0,Nh=u[a>>2],Ih=u[(Dh=Fh+Mh|0)>>2],u[(mh=Fh+Jh|0)>>2]=x(Nh+Ih)-x(Nh*Ih),Nh=u[a+4>>2],Ih=u[Dh+4>>2],u[mh+4>>2]=x(Nh+Ih)-x(Nh*Ih),Nh=u[a+8>>2],Ih=u[Dh+8>>2],u[mh+8>>2]=x(Nh+Ih)-x(Nh*Ih)),q[Fh+(Gh<<2)>>2]=1065353216)},n[3]=function(a,Sm,un,xn,yn){a|=0,Sm|=0,un|=0,xn|=0,yn|=0;var Dn,En,Fn,Hn,In,zn=0,zn=(x(0),x(0),x(0),x(0),x(0),x(0),x(0),x(0),(Sm=q[16+(q[a+308>>2]+(Sm<<5)|0)>>2])<<2),Bn=function(a){var El,Hl,Fl,Gl,Dl=x(0);L=Fl=L-16|0,j(a);a:if((El=2147483647&(Gl=b[0]))>>>0<=1061752794)Dl=x(1),El>>>0<964689920||(Dl=ba(+a));else if(El>>>0<=1081824209)Hl=+a,Dl=1075235812<=El>>>0?x(-ba(((0|Gl)<0?3.141592653589793:-3.141592653589793)+Hl)):aa((0|Gl)<=-1?1.5707963267948966+Hl:1.5707963267948966-Hl);else if(El>>>0<=1088565717)Dl=1085271520<=El>>>0?ba(+a+((0|Gl)<0?6.283185307179586:-6.283185307179586)):aa((0|Gl)<=-1?-4.71238898038469-+a:+a-4.71238898038469);else if(Dl=x(a-a),!(2139095040<=El>>>0))if((El=3&Da(a,8+Fl|0))>>>0<=2){switch(El-1|0){default:Dl=ba(v[8+Fl>>3]);break a;case 0:Dl=aa(-v[8+Fl>>3]);break a;case 1:}Dl=x(-ba(v[8+Fl>>3]))}else Dl=aa(v[8+Fl>>3]);return L=16+Fl|0,Dl}(An=x(x(x(u[4+(q[a+168>>2]+w(Sm,12)|0)>>2]+u[zn+q[a+284>>2]>>2])*x(3.1415927410125732))/x(180))),Cn=u[zn+q[a+272>>2]>>2],Gn=q[zn+q[a+292>>2]>>2],An=function(a){var Vk,Al,Cl,Bl=0;L=Al=L-16|0,j(a);a:if((Vk=2147483647&(Cl=b[0]))>>>0<=1061752794)Vk>>>0<964689920||(a=aa(+a));else if(Vk>>>0<=1081824209)Bl=+a,a=Vk>>>0<=1075235811?(0|Cl)<=-1?x(-ba(Bl+1.5707963267948966)):ba(Bl+-1.5707963267948966):aa(-(((0|Cl)<0?3.141592653589793:-3.141592653589793)+Bl));else if(Vk>>>0<=1088565717)Bl=+a,a=Vk>>>0<=1085271519?(0|Cl)<=-1?ba(Bl+4.71238898038469):x(-ba(Bl+-4.71238898038469)):aa(((0|Cl)<0?6.283185307179586:-6.283185307179586)+Bl);else if(2139095040<=Vk>>>0)a=x(a-a);else if((Vk=3&Da(a,8+Al|0))>>>0<=2){switch(Vk-1|0){default:a=aa(v[8+Al>>3]);break a;case 0:a=ba(v[8+Al>>3]);break a;case 1:}a=aa(-v[8+Al>>3])}else a=x(-ba(v[8+Al>>3]));return L=16+Al|0,a}(An);if((Sm=0)<(0|yn))for(Bn=x(Cn*Bn),En=x(Gn?-1:1),Hn=x(Bn*En),Dn=q[zn+q[a+288>>2]>>2]?x(-1):x(1),In=x(x(Cn*An)*Dn),Bn=x(Bn*Dn),Cn=x(x(Cn*x(-An))*En),An=u[zn+q[a+280>>2]>>2],En=u[zn+q[a+276>>2]>>2];zn=(a=Sm<<3)+xn|0,Dn=u[(a=a+un|0)>>2],Fn=u[a+4>>2],u[zn+4>>2]=An+x(x(In*Dn)+x(Hn*Fn)),u[zn>>2]=En+x(x(Bn*Dn)+x(Cn*Fn)),(0|yn)!=(0|(Sm=Sm+1|0)););},n[4]=function(a,mh){a|=0,mh|=0;var yh,zh,Ah,Bh,Ch,nh,oh=0,ph=0,qh=0,rh=x(0),sh=0,th=0,uh=x(0),vh=0,wh=0,xh=0;if(x(0),x(0),x(0),x(0),L=nh=L+-64|0,vh=q[a+320>>2],wh=q[a+316>>2],ph=q[a+308>>2],-1==(0|(sh=q[8+(qh=ph+(mh<<5)|0)>>2])))oh=q[qh+16>>2]<<2,q[(ph=mh<<2)+wh>>2]=q[oh+q[a+268>>2]>>2],q[ph+vh>>2]=q[oh+q[a+272>>2]>>2];else{oh=q[qh+16>>2]<<2,xh=q[oh+q[a+276>>2]>>2],q[24+nh>>2]=xh,oh=q[oh+q[a+280>>2]>>2],q[28+nh>>2]=oh,q[16+nh>>2]=0,zh=1==q[12+(th=ph+(sh<<5)|0)>>2]?x(-10):x(-.10000000149011612),u[20+nh>>2]=zh,q[60+nh>>2]=oh,q[56+nh>>2]=xh,n[q[th+24>>2]](a,sh,56+nh|0,48+nh|0,1),rh=x(1),ph=9;b:{for(;;){if(oh=ph,uh=x(rh*x(0)),u[32+nh>>2]=uh+u[56+nh>>2],yh=x(zh*rh),u[36+nh>>2]=yh+u[60+nh>>2],n[q[th+24>>2]](a,sh,32+nh|0,40+nh|0,1),Ah=x(u[44+nh>>2]-u[52+nh>>2]),u[44+nh>>2]=Ah,Bh=x(u[40+nh>>2]-u[48+nh>>2]),u[40+nh>>2]=Bh,Ah!=x(0)||Bh!=x(0)){ph=q[44+nh>>2],q[8+nh>>2]=q[40+nh>>2],q[12+nh>>2]=ph;break b}if(u[32+nh>>2]=u[56+nh>>2]-uh,u[36+nh>>2]=u[60+nh>>2]-yh,n[q[th+24>>2]](a,sh,32+nh|0,40+nh|0,1),uh=x(u[40+nh>>2]-u[48+nh>>2]),u[40+nh>>2]=uh,yh=x(u[44+nh>>2]-u[52+nh>>2]),(u[44+nh>>2]=yh)!=x(0)||uh!=x(0)){u[12+nh>>2]=-yh,u[8+nh>>2]=-uh;break b}if(ph=oh+-1|0,rh=x(rh*x(.10000000149011612)),!oh)break}Y(3,1311,0)}rh=function(a,ji){var ki=x(0);if((ki=x(Ba(u[4+a>>2],u[a>>2])-Ba(u[4+ji>>2],u[ji>>2])))x(3.1415927410125732))for(;(ki=x(ki+x(-6.2831854820251465)))>x(3.1415927410125732););return ki}(16+nh|0,8+nh|0),n[q[th+24>>2]](a,q[qh+8>>2],24+nh|0,24+nh|0,1),ph=q[qh+16>>2]<<2,q[ph+q[a+276>>2]>>2]=q[24+nh>>2],q[ph+q[a+280>>2]>>2]=q[28+nh>>2],oh=ph+q[a+284>>2]|0,u[oh>>2]=u[oh>>2]+x(x(rh*x(-180))/x(3.1415927410125732)),qh=q[qh+8>>2]<<2,u[(oh=mh<<2)+wh>>2]=u[ph+q[a+268>>2]>>2]*u[qh+wh>>2],ph=ph+q[a+272>>2]|0,rh=x(u[ph>>2]*u[qh+vh>>2]),u[oh+vh>>2]=rh,u[ph>>2]=rh}4<=r[q[a>>2]+4|0]&&(oh=mh<<2,qh=q[a+308>>2]+(mh<<5)|0,sh=q[qh+16>>2]<<2,ph=q[a+328>>2],mh=q[a+324>>2],-1==(0|(th=q[qh+8>>2]))?(th=q[a+296>>2],q[(qh=oh<<2)+mh>>2]=q[th+(sh<<=2)>>2],q[(vh=4|qh)+mh>>2]=q[(wh=4|sh)+th>>2],q[(xh=8|qh)+mh>>2]=q[th+(Ch=8|sh)>>2],q[mh+((oh|=3)<<2)>>2]=1065353216,a=q[a+300>>2],q[ph+qh>>2]=q[a+sh>>2],q[ph+vh>>2]=q[a+wh>>2],q[ph+xh>>2]=q[a+Ch>>2]):(sh=(wh=sh<<2)+q[a+296>>2]|0,u[(qh=(vh=oh<<2)+mh|0)>>2]=u[sh>>2]*u[(th=(xh=th<<4)+mh|0)>>2],u[qh+4>>2]=u[sh+4>>2]*u[th+4>>2],u[qh+8>>2]=u[sh+8>>2]*u[th+8>>2],q[mh+((oh|=3)<<2)>>2]=1065353216,a=wh+q[a+300>>2]|0,rh=u[a>>2],uh=u[(qh=ph+xh|0)>>2],u[(mh=ph+vh|0)>>2]=x(rh+uh)-x(rh*uh),rh=u[a+4>>2],uh=u[qh+4>>2],u[mh+4>>2]=x(rh+uh)-x(rh*uh),rh=u[a+8>>2],uh=u[qh+8>>2],u[mh+8>>2]=x(rh+uh)-x(rh*uh)),q[ph+(oh<<2)>>2]=1065353216),L=64+nh|0},n[5]=function(a,Vk){return a|=0,Vk|=0,x(0),x(0),0|((a=u[a>>2])<(Vk=u[Vk>>2])?-1:Vk>2])))for(_j=q[a+12>>2],Zj=q[a+20>>2];u[(Wj=Vj<<2)+_j>>2]=u[vj+Wj>>2]*u[Wj+Zj>>2],(0|(Vj=Vj+1|0))<(0|Yj););if(!((0|(Yj=q[a>>2]))<1))if(_j=q[a+4>>2],yj)for(Wj=vj=0;;){if(q[yj>>2]){if((0|(Vj=q[(Zj=vj<<2)+q[a+16>>2]>>2]))<1)Xj=x(0);else for($j=Vj+Wj|0,ak=q[a+12>>2],Xj=x(0),Vj=Wj;Xj=x(Xj+u[ak+(Vj<<2)>>2]),(0|(Vj=Vj+1|0))<(0|$j););u[xj+Zj>>2]=Xj}if(yj=yj+4|0,Wj=q[_j+(vj<<2)>>2]+Wj|0,!((0|(vj=vj+1|0))<(0|Yj)))break}else for(Zj=q[a+16>>2],vj=yj=0;;){if((0|(Vj=q[(Wj=yj<<2)+Zj>>2]))<=0)Xj=x(0);else for($j=vj+Vj|0,ak=q[a+12>>2],Xj=x(0),Vj=vj;Xj=x(Xj+u[ak+(Vj<<2)>>2]),(0|(Vj=Vj+1|0))<(0|$j););if(u[xj+Wj>>2]=Xj,vj=q[Wj+_j>>2]+vj|0,!((0|(yj=yj+1|0))<(0|Yj)))break}},n[7]=function(a,vj,xj,yj){a|=0,vj|=0,xj|=0,yj|=0;var zj=0,Aj=x(0),Qj=0,Rj=0,Sj=0,Tj=0,Uj=0;if(1<=(0|(Tj=q[a+8>>2])))for(Rj=q[a+12>>2],Sj=q[a+20>>2];u[(Qj=zj<<2)+Rj>>2]=u[vj+Qj>>2]*u[Qj+Sj>>2],(0|(zj=zj+1|0))<(0|Tj););if(!((0|(zj=q[a>>2]))<1))if(Tj=q[a+4>>2],yj)for(Qj=vj=0;;){if(q[yj>>2]){if((0|(zj=q[(Rj=vj<<2)+q[a+16>>2]>>2]))<1)Aj=x(0);else for(Sj=zj+Qj|0,Uj=q[a+12>>2],Aj=x(0),zj=Qj;Aj=x(Aj+u[Uj+(zj<<2)>>2]),(0|(zj=zj+1|0))<(0|Sj););zj=xj+Rj|0,Aj=x(Aj+x(.0010000000474974513)),Rj=x(y(Aj))>2]=Rj,zj=q[a>>2]}if(yj=yj+4|0,Qj=q[Tj+(vj<<2)>>2]+Qj|0,!((0|(vj=vj+1|0))<(0|zj)))break}else for(Rj=q[a+16>>2],vj=yj=0;;){if((0|(zj=q[(Qj=yj<<2)+Rj>>2]))<=0)Aj=x(0);else for(Sj=vj+zj|0,Uj=q[a+12>>2],Aj=x(0),zj=vj;Aj=x(Aj+u[Uj+(zj<<2)>>2]),(0|(zj=zj+1|0))<(0|Sj););if(zj=xj+Qj|0,Aj=x(Aj+x(.0010000000474974513)),Sj=x(y(Aj))>2]=Sj,vj=q[Qj+Tj>>2]+vj|0,!((0|(yj=yj+1|0))>2]))break}},n[8]=function(a,vj,xj,yj,zj,Aj){a|=0,vj|=0,xj|=0,yj|=0,zj|=0,Aj|=0;var Oj,Pj,Bj=0,Cj=0,Dj=0,Ej=0,Fj=0,Gj=0,Hj=0,Ij=0,Kj=0,Lj=0,Mj=x(0),Nj=0,Jj=q[a>>2];if(!((0|Jj)<1))if(Oj=zj<<2,Pj=q[a+4>>2],Aj)for(;;){if(q[Aj>>2]&&(Dj=q[(Bj=Ej<<2)+q[a+16>>2]>>2],Hj=q[xj+Bj>>2],Cj=q[yj+Bj>>2],(Bj=(0|(Ij=w(Cj,zj)))<1)||ca(Hj,0,w(Cj,Oj)),!(Bj|(0|Dj)<1)))for(Kj=Dj+Gj|0,Lj=q[a+20>>2],Bj=Gj;;){for(Mj=u[(Cj=Bj<<2)+Lj>>2],Nj=q[vj+Cj>>2],Fj=0;u[(Cj=(Dj=Fj<<2)+Hj|0)>>2]=u[Cj>>2]+x(Mj*u[Dj+Nj>>2]),(0|Ij)!=(0|(Fj=Fj+1|0)););if(!((0|(Bj=Bj+1|0))<(0|Kj)))break}if(Aj=Aj+4|0,Gj=q[(Ej<<2)+Pj>>2]+Gj|0,!((0|(Ej=Ej+1|0))<(0|Jj)))break}else for(Aj=0;;){if(Dj=q[(Ej=Aj<<2)+q[a+16>>2]>>2],Hj=q[xj+Ej>>2],Cj=q[yj+Ej>>2],(Bj=(0|(Ij=w(Cj,zj)))<1)||ca(Hj,0,w(Cj,Oj)),!(Bj|(0|Dj)<=0))for(Kj=Dj+Gj|0,Lj=q[a+20>>2],Bj=Gj;;){for(Mj=u[(Cj=Bj<<2)+Lj>>2],Nj=q[vj+Cj>>2],Fj=0;u[(Cj=(Dj=Fj<<2)+Hj|0)>>2]=u[Cj>>2]+x(Mj*u[Dj+Nj>>2]),(0|Ij)!=(0|(Fj=Fj+1|0)););if(!((0|(Bj=Bj+1|0))<(0|Kj)))break}if(Gj=q[Ej+Pj>>2]+Gj|0,!((0|(Aj=Aj+1|0))<(0|Jj)))break}},n[9]=function(a){var Me,Ne,Oe,Ie=0,Je=0,Ke=0,Le=0;if(!(q[(a|=0)+648>>2]||(0|(Ie=q[a+332>>2]))<1))for(Ne=(Je=q[a+336>>2])+w(Ie,20)|0,Ie=q[a+424>>2],Le=q[a+444>>2];;){if(q[Ie>>2]&&!((0|(Ke=q[Je+16>>2]))<(a=1)))for(Ke<<=1,Oe=q[Le>>2];u[(Me=(a<<2)+Oe|0)>>2]=-u[Me>>2],(0|(a=a+2|0))<(0|Ke););if(Le=Le+4|0,Ie=Ie+4|0,!((Je=Je+20|0)>>>0>>0))break}},n[10]=function(a,Sm,un){var wn;return $(wn=q[20+(a|=0)>>2],Sm|=0,Sm=(un|=0)>>>0<(Sm=q[a+16>>2]-wn|0)>>>0?un:Sm),q[a+20>>2]=Sm+q[a+20>>2],0|un},n[11]=function(a,Il,Rm,Sm,Tm,Um){a|=0,Il=+Il,Rm|=0,Sm|=0,Tm|=0,Um|=0;var fn,qn,Zm,kn,Vm=0,Wm=0,Xm=0,Ym=0,_m=0,$m=0,an=0,bn=0,cn=0,dn=0,en=0,gn=0,hn=0,jn=0,mn=0;if(q[44+(L=Zm=L-560|0)>>2]=0,h(+Il),Vm=0|b[1],qn=4294967295>>0?0:1,kn=(0|Vm)<-1||(0|Vm)<=-1&&qn?(h(Il=-Il),Vm=0|b[1],b[0],jn=1,3840):2048&Tm?(jn=1,3843):(jn=1&Tm)?3846:3841,2146435072==(2146435072&Vm))_(a,32,Rm,$m=jn+3|0,-65537&Tm),Z(a,kn,jn),Sm=Um>>>5&1,Z(a,Il!=Il?Sm?3867:3871:Sm?3859:3863,3);else if(Il=function Ja(a,ic){var kc,lc,jc=0;if(h(+a),jc=0|b[1],kc=0|b[0],2047!=(0|(jc=(lc=jc)>>>20&2047))){if(!jc)return jc=ic,ic=0==a?0:(a=Ja(0x10000000000000000*a,ic),q[ic>>2]+-64|0),q[jc>>2]=ic,a;q[ic>>2]=jc+-1022,f(0,0|kc),f(1,-2146435073&lc|1071644672),a=+g()}return a}(Il,44+Zm|0),0!=(Il+=Il)&&(q[44+Zm>>2]=q[44+Zm>>2]+-1),fn=16+Zm|0,97==(0|(qn=32|Um))){if(en=(dn=32&Um)?9+kn|0:kn,!(11>>0)&&(Vm=12-Sm|0)){for(gn=8;gn*=16,Vm=Vm+-1|0;);Il=45==r[0|en]?-(gn+(-Il-gn)):Il+gn-gn}for((0|fn)==(0|(Vm=ga((Xm=(Vm=q[44+Zm>>2])>>31)^Vm+Xm,0,fn)))&&(o[15+Zm|0]=48,Vm=15+Zm|0),_m=2|jn,Xm=q[44+Zm>>2],o[0|(cn=Vm+-2|0)]=Um+15,o[Vm+-1|0]=(0|Xm)<0?45:43,Vm=8&Tm,Wm=16+Zm|0;Um=Wm,bn=dn,Xm=y(Il)<2147483648?~~Il:-2147483648,o[0|Wm]=bn|r[Xm+3824|0],1!=((Wm=Um+1|0)-(16+Zm|0)|0)|(0==(Il=16*(Il-(0|Xm)))?!(Vm|0<(0|Sm)):0)||(o[Um+1|0]=46,Wm=Um+2|0),0!=Il;);_(a,32,Rm,$m=(Um=!Sm|(0|Sm)<=((Wm-Zm|0)-18|0)?((fn-(16+Zm|0)|0)-cn|0)+Wm|0:2+((Sm+fn|0)-cn|0)|0)+_m|0,Tm),Z(a,en,_m),_(a,48,Rm,$m,65536^Tm),Z(a,16+Zm|0,Sm=Wm-(16+Zm|0)|0),_(a,48,Um-((Vm=Sm)+(Sm=fn-cn|0)|0)|0,0,0),Z(a,cn,Sm)}else{for(Vm=(0|Sm)<0,0==Il?Ym=q[44+Zm>>2]:(Ym=q[44+Zm>>2]+-28|0,q[44+Zm>>2]=Ym,Il*=268435456),an=Vm?6:Sm,Xm=dn=(0|Ym)<0?48+Zm|0:336+Zm|0;Xm=(Sm=Xm)+4|0,0!=(Il=1e9*(Il-((q[Sm>>2]=Vm=Il<4294967296&0<=Il?~~Il>>>0:0)>>>0))););if((0|Ym)<1)Vm=Xm,Wm=dn;else for(Wm=dn;;){if(cn=(0|Ym)<29?Ym:29,!((Vm=Xm+-4|0)>>>0>>0)){for(Sm=cn,bn=0;mn=bn,bn=q[(en=Vm)>>2],_m=31&Sm,_m=32<=(63&Sm)>>>($m=0)?(Ym=bn<<_m,0):(Ym=(1<<_m)-1&bn>>>32-_m,bn<<_m),$m=Ym+$m|0,$m=(bn=mn+_m|0)>>>0<_m>>>0?$m+1|0:$m,mn=en,en=bd(bn=cd(_m=bn,$m,1e9),M,1e9),q[mn>>2]=_m-en,Wm>>>0<=(Vm=Vm+-4|0)>>>0;);(Sm=bn)&&(q[(Wm=Wm+-4|0)>>2]=Sm)}for(;Wm>>>0<(Vm=Xm)>>>0&&!q[(Xm=Vm+-4|0)>>2];);if(Ym=q[44+Zm>>2]-cn|0,Xm=Vm,!(0<(0|(q[44+Zm>>2]=Ym))))break}if((0|Ym)<=-1)for(hn=1+((an+25|0)/9|0)|0,cn=102==(0|qn);;){if(bn=(0|Ym)<-9?9:0-Ym|0,Vm>>>0<=Wm>>>0)Wm=q[Wm>>2]?Wm:Wm+4|0;else{for(en=1e9>>>bn,_m=-1<>2],q[Xm>>2]=(Sm>>>bn)+Ym,Ym=w(en,Sm&_m),(Xm=Xm+4|0)>>>0>>0;);Wm=q[Wm>>2]?Wm:Wm+4|0,Ym&&(q[Vm>>2]=Ym,Vm=Vm+4|0)}if(Ym=bn+q[44+Zm>>2]|0,Vm=(0|hn)>2?Sm+(hn<<2)|0:Vm,!((0|(q[44+Zm>>2]=Ym))<0))break}if(!(Vm>>>(Xm=0)<=Wm>>>0||(Xm=w(dn-Wm>>2,9),(Sm=q[Wm>>2])>>>0<(Ym=10))))for(;Xm=Xm+1|0,(Ym=w(Ym,10))>>>0<=Sm>>>0;);if((0|(Sm=(an-(102==(0|qn)?0:Xm)|0)-(103==(0|qn)&0!=(0|an))|0))<(w(Vm-dn>>2,9)+-9|0)){if($m=(dn+((Sm=(0|(_m=Sm+9216|0))/9|0)<<2)|0)-4092|0,Ym=10,(0|(Sm=1+(_m-w(Sm,9)|0)|0))<=8)for(;Ym=w(Ym,10),9!=(0|(Sm=Sm+1|0)););if(hn=$m+4|0,((cn=(en=q[$m>>2])-w(Ym,_m=(en>>>0)/(Ym>>>0)|0)|0)||(0|hn)!=(0|Vm))&&(gn=cn>>>0<(Sm=Ym>>>1)>>>0?.5:(0|Vm)==(0|hn)&&(0|Sm)==(0|cn)?1:1.5,Il=1&_m?9007199254740994:9007199254740992,!jn|45!=r[0|kn]||(gn=-gn,Il=-Il),q[$m>>2]=Sm=en-cn|0,Il+gn!=Il)){if(1e9<=(q[$m>>2]=Sm=Sm+Ym|0)>>>0)for(;($m=$m+-4|(q[$m>>2]=0))>>>0>>0&&(q[(Wm=Wm+-4|0)>>2]=0),Sm=q[$m>>2]+1|0,999999999<(q[$m>>2]=Sm)>>>0;);if(Xm=w(dn-Wm>>2,9),!((Sm=q[Wm>>2])>>>0<(Ym=10)))for(;Xm=Xm+1|0,(Ym=w(Ym,10))>>>0<=Sm>>>0;);}Vm=(Sm=$m+4|0)>>>0>>0?Sm:Vm}j:{for(;;){if((cn=Vm)>>>(en=0)<=Wm>>>0)break j;if(q[(Vm=cn+-4|0)>>2])break}en=1}if(103!=(0|qn))_m=8&Tm;else if(an=((Sm=(0|Xm)<(0|(Vm=an||1))&-5<(0|Xm))?-1^Xm:-1)+Vm|0,Um=(Sm?-1:-2)+Um|0,!(_m=8&Tm)){if(Vm=9,en&&(_m=q[cn+-4>>2])&&!((_m>>>(Vm=0))%(Sm=10)))for(;Vm=Vm+1|0,!((_m>>>0)%((Sm=w(Sm,10))>>>0)););Sm=w(cn-dn>>2,9)+-9|0,an=102==(32|Um)?((_m=0)|an)<(0|(Sm=0<(0|(Sm=Sm-Vm|0))?Sm:0))?an:Sm:((_m=0)|an)<(0|(Sm=0<(0|(Sm=(Sm+Xm|0)-Vm|0))?Sm:0))?an:Sm}if($m=0!=(0|(Ym=an|_m)),Sm=a,mn=Rm,Vm=0<(0|Xm)?Xm:0,102!=(0|(bn=32|Um))){if((fn-(Vm=ga((Vm=Xm>>31)+Xm^Vm,0,fn))|0)<=1)for(;o[0|(Vm=Vm+-1|0)]=48,(fn-Vm|0)<2;);o[0|(hn=Vm+-2|0)]=Um,o[Vm+-1|0]=(0|Xm)<0?45:43,Vm=fn-hn|0}if(_(Sm,32,mn,$m=1+(Vm+($m+(an+jn|0)|0)|0)|0,Tm),Z(a,kn,jn),_(a,48,Rm,$m,65536^Tm),102==(0|bn)){for(Sm=16+Zm|8,Xm=16+Zm|9,Wm=Um=dn>>>0>>0?dn:Wm;;){if(Vm=ga(q[Wm>>2],0,Xm),(0|Um)!=(0|Wm)){if(!(Vm>>>0<=16+Zm>>>0))for(;o[0|(Vm=Vm+-1|0)]=48,16+Zm>>>0>>0;);}else(0|Vm)==(0|Xm)&&(o[24+Zm|0]=48,Vm=Sm);if(Z(a,Vm,Xm-Vm|0),!((Wm=Wm+4|0)>>>0<=dn>>>0))break}Ym&&Z(a,3875,1);p:if(!((0|an)<1|cn>>>0<=Wm>>>0))for(;;){if(16+Zm>>>0<(Vm=ga(q[Wm>>2],0,Xm))>>>0)for(;o[0|(Vm=Vm+-1|0)]=48,16+Zm>>>0>>0;);if(Z(a,Vm,(0|an)<9?an:9),an=an+-9|0,cn>>>0<=(Wm=Wm+4|0)>>>0)break p;if(!(0<(0|an)))break}_(a,48,an+9|0,9,0)}else{q:if(!((0|an)<0))for(Um=en?cn:Wm+4|0,Sm=16+Zm|8,dn=16+Zm|9,Xm=Wm;;){if((0|dn)==(0|(Vm=ga(q[Xm>>2],0,dn)))&&(o[24+Zm|0]=48,Vm=Sm),(0|Wm)!=(0|Xm)){if(!(Vm>>>0<=16+Zm>>>0))for(;o[0|(Vm=Vm+-1|0)]=48,16+Zm>>>0>>0;);}else Z(a,Vm,1),Vm=Vm+1|0,(0|an)<1&&!_m||Z(a,3875,1);if(Z(a,bn=Vm,(0|(Vm=dn-Vm|0))<(0|an)?Vm:an),an=an-Vm|0,Um>>>0<=(Xm=Xm+4|0)>>>0)break q;if(!(-1<(0|an)))break}_(a,48,an+18|0,18,0),Z(a,hn,fn-hn|0)}}return _(a,32,Rm,$m,8192^Tm),L=560+Zm|0,0|((0|$m)<(0|Rm)?Rm:$m)},n[12]=function(a,Il){a|=0;var Am=Il|=0;Il=q[Il>>2]+15&-16,q[Am>>2]=Il+16,Am=a,a=function(a,Il,Jl,$l){var fm,cm,am=0,bm=0,dm=0,em=0;return L=cm=L-32|0,am=(em=am=2147483647&$l)-1006698496|0,bm=am=(fm=bm=dm=Jl)>>>0<0?am+1|0:am,am=em-1140785152|0,(0|(am=dm>>>0<0?am+1|0:am))==(0|bm)&fm>>>0>>0|bm>>>0>>0?(am=$l<<4|Jl>>>28,Jl=Jl<<4|Il>>>28,134217728==(0|(dm=Il&=268435455))&1<=a>>>0|134217728>>0?(am=am+1073741824|0,(a=Jl+1|0)>>>0<1&&(am=am+1|0),bm=a):(am=am-(((bm=Jl)>>>0<0)+-1073741824|0)|0,a|134217728^dm||((a=bm+(1&bm)|0)>>>0>>0&&(am=am+1|0),bm=a))):(!dm&2147418112==(0|em)?!(a|Il):2147418112==(0|em)&dm>>>0<0|em>>>0<2147418112)?(am=2146435072,1140785151==((bm=0)|em)&4294967295>>0|1140785151>>0||(dm=em>>>16)>>>(am=0)<15249||(function(a,Il,Jl,Am,Bm,Cm){var Jm,Km,Hm=0,Im=0;64&Cm?(Il=31&(Jl=Cm-64|0),Il=32<=(63&Jl)>>>0?(Jl=0,Bm>>>Il):(Jl=Bm>>>Il,((1<>>Il),Bm=Am=0):Cm&&(Im=Bm,Hm=31&(Km=64-Cm|0),Km=32<=(63&Km)>>>0?(Im=Am<>>32-Hm|Im<>>0?(Hm=0,Jl>>>Il):(Hm=Jl>>>Il,((1<>>Il),Il|=Km,Jl=Hm|Im,Hm=Am,Am=31&Cm,Am=32<=(63&Cm)>>>0?(Im=0,Bm>>>Am):(Im=Bm>>>Am,((1<>>Am),Bm=Im),q[a>>2]=Il,q[4+a>>2]=Jl,q[8+a>>2]=Am,q[12+a>>2]=Bm}(cm,a,Il,Jl,am=65535&$l|65536,15361-dm|0),function(a,Il,Jl,Am,Bm,Cm){var Fm,Dm,Em=0;64&Cm?(Am=Il,Il=31&(Bm=Cm+-64|0),32<=(63&Bm)>>>0?(Bm=Am<>>32-Il|Jl<>>0?(Em=Dm<>>32-Am|Bm<>>0?(Cm=0,Am>>>=Bm):(Cm=Am>>>Bm,Am=((1<>>Bm),Am|=Dm,Bm=Cm|Em,Cm=Il,Il=31&Fm,Il=32<=(63&Fm)>>>0?(Em=Cm<>>32-Il|Jl<>2]=Il,q[4+a>>2]=Jl,q[8+a>>2]=Am,q[12+a>>2]=Bm}(16+cm|0,a,Il,Jl,am,dm+-15233|0),Jl=q[4+cm>>2],a=q[8+cm>>2],am=q[12+cm>>2]<<4|a>>>28,bm=a<<4|Jl>>>28,134217728==(0|(Jl=a=268435455&Jl))&1<=(Il=q[cm>>2]|(0!=(q[16+cm>>2]|q[24+cm>>2])|0!=(q[20+cm>>2]|q[28+cm>>2])))>>>0|134217728>>0?((a=bm+1|0)>>>0<1&&(am=am+1|0),bm=a):Il|134217728^Jl||((a=bm+(1&bm)|0)>>>0>>0&&(am=am+1|0),bm=a))):(bm=Jl<<4|Il>>>28,am=524287&(am=$l<<4|Jl>>>28)|2146959360),L=32+cm|0,f(0,0|bm),f(1,-2147483648&$l|am),+g()}(q[Il>>2],q[Il+4>>2],q[Il+8>>2],q[Il+12>>2]),v[Am>>3]=a},n[13]=function(a){return 0},n[14]=function(a,Il,Am){Il|=0,Am|=0;var Om,Cm,Bm=0,Lm=0,Mm=0,Nm=0;for(L=Cm=L-32|0,Bm=q[28+(a|=0)>>2],q[16+Cm>>2]=Bm,Mm=q[a+20>>2],q[28+Cm>>2]=Am,q[24+Cm>>2]=Il,Mm=(q[20+Cm>>2]=Il=Mm-Bm|0)+Am|0,Nm=2,Il=16+Cm|0;;){a:{if((Lm=(Bm=0)|K(q[a+60>>2],0|Il,0|Nm,12+Cm|0))&&(q[2086]=Lm,Bm=-1),(0|(Bm=Bm?q[12+Cm>>2]=-1:q[12+Cm>>2]))==(0|Mm))Il=q[a+44>>2],q[a+28>>2]=Il,q[a+20>>2]=Il,q[a+16>>2]=Il+q[a+48>>2],a=Am;else{if(-1<(0|Bm))break a;q[a+28>>2]=0,q[a+16>>2]=0,q[a+20>>2]=0,q[a>>2]=32|q[a>>2],2!=((a=0)|Nm)&&(a=Am-q[Il+4>>2]|0)}return L=32+Cm|0,0|a}Lm=q[Il+4>>2],q[(Il=(Om=Lm>>>0>>0)?Il+8|0:Il)>>2]=(Lm=Bm-(Om?Lm:0)|0)+q[Il>>2],q[Il+4>>2]=q[Il+4>>2]-Lm,Mm=Mm-Bm|0,Nm=Nm-Om|0}},n[15]=function(a,Il,Am,Bm){return M=0},{d:function(){},e:function(){return q[1805]},f:function(){return 83886080},g:function(){return 5},h:function(a,vj){return vj|=0,L=vj=L-16|0,a=(a|=0)?sa(a)?(Y(4,2150,0),0):r[a+4|0]:(q[vj+4>>2]=1444,q[vj>>2]=2267,Y(4,1294,vj),0),L=vj+16|0,0|a},i:function(a,vj){var wj;return vj|=0,L=wj=L-48|0,a=(a|=0)?(a+63&-64)!=(0|a)?(q[36+wj>>2]=1522,q[32+wj>>2]=2284,Y(4,1294,32+wj|0),0):(vj+63&-64)==(0|vj)&&vj?function(a,Vk){var pl,Wk=0,Xk=0,Yk=0,Zk=0,_k=0,$k=0,al=0,bl=0,cl=0,dl=0,el=0,fl=0,gl=0,hl=0,il=0,jl=0,kl=0,ll=0,ml=0,nl=0,ol=0;L=_k=(pl=Xk=L)-704&-64;a:if(Vk>>>0<=1343)Y(4,1235,0);else if(sa(a))Y(4,1469,0);else if(Xk=r[0|(nl=a+4|0)]){if(!(6<=Xk>>>0)){(jl=1==(0|!r[a+5|0]))||(da(nl,1),X(a- -64|0,4,160)),ca(_k- -64|0,0,640),na(a,_k- -64|0),Xk=a+Vk|0,Vk=q[_k+64>>2];b:{c:{d:{if(5<=(il=r[a+4|0])>>>0){if(Vk>>>0>>0|Xk>>>0>>0)break c;if((Zk=Vk+256|0)>>>0>>0)break c;if(Zk>>>0<=Xk>>>0)break d;break c}if(Vk>>>0>>0|Xk>>>0>>0)break c;if((Zk=Vk+128|0)>>>0>>0|Xk>>>0>>0)break c}if(!((Yk=q[_k+68>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Yk=Yk- -64|0)>>>0>>0|Xk>>>0>>0||(0|(dl=q[Vk>>2]))<0||(Zk=q[_k+72>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=(Wk=Zk)+(Zk=dl<<2)|0)>>>0>>0|Xk>>>0>>0||(al=q[_k+76>>2])>>>0>>0|Xk>>>0>>0|al>>>0>>0||(Wk=(dl<<6)+al|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+80>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+84>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+88>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+92>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+96>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+100>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Yk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(0|(Wk=q[Vk+4>>2]))<0||(Zk=q[_k+104>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||($k=(Yk=Zk)+(Zk=Wk<<2)|0)>>>0>>0|Xk>>>0<$k>>>0||(Yk=q[_k+108>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0<$k>>>0||(Wk=Yk+(Wk<<6)|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+112>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+116>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+120>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+124>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+128>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+132>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+136>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Yk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(0|(Wk=q[Vk+8>>2]))<0||(Zk=q[_k+140>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=(el=Wk<<2)+Zk|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+144>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Zk+el|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+148>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Zk+el|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+156>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Zk+el|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+160>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Zk+el|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+164>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Zk+el|0)>>>0>>0|Xk>>>0>>0||(0|(Wk=q[Vk+12>>2]))<0||(Zk=q[_k+172>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=(fl=Wk<<2)+Zk|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+176>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Zk+fl|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+180>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Zk+fl|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+188>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Wk=Zk+fl|0)>>>0>>0|Xk>>>0>>0||(0|(Yk=q[Vk+16>>2]))<0||(Zk=q[_k+192>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||($k=(Wk=Zk)+(Zk=Yk<<2)|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+196>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Zk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+200>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Zk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+204>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Zk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+208>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+(Yk<<6)|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+212>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Zk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+216>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Zk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+220>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Zk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+228>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Zk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+232>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Zk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+236>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Zk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+240>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Zk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+244>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Zk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+248>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||(Wk=Wk+Yk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+252>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+256>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+260>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+264>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+268>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Yk=q[_k+272>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(0|($k=q[Vk+20>>2]))<0||(Yk=q[_k+276>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(gl=(Wk=Yk)+(Yk=$k<<2)|0)>>>0>>0|Xk>>>0>>0||(Wk=q[_k+280>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||($k=Wk+($k<<6)|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+284>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Yk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+288>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Yk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+292>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Yk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+296>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Yk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+300>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Yk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+308>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Yk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+312>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+Yk|0)>>>0>>0|Xk>>>0<$k>>>0||(0|(gl=q[Vk+24>>2]))<0||(Wk=q[_k+336>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+(gl<<2)|0)>>>0>>0|Xk>>>0<$k>>>0||(0|(gl=q[Vk+28>>2]))<0||(Wk=q[_k+340>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=(ll=gl<<2)+Wk|0)>>>0>>0|Xk>>>0<$k>>>0||(Wk=q[_k+344>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||($k=Wk+ll|0)>>>0>>0|Xk>>>0<$k>>>0||(0|(gl=q[Vk+32>>2]))<0||(Wk=q[_k+356>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0<$k>>>0||(gl=($k=gl<<2)+Wk|0)>>>0>>0|Xk>>>0>>0||(Wk=q[_k+360>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(gl=Wk+$k|0)>>>0>>0|Xk>>>0>>0||(Wk=q[_k+364>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(gl=Wk+$k|0)>>>0>>0|Xk>>>0>>0||(Wk=q[_k+368>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(gl=Wk+$k|0)>>>0>>0|Xk>>>0>>0||(Wk=q[_k+372>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(gl=Wk+$k|0)>>>0>>0|Xk>>>0>>0||(Wk=q[_k+376>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(gl=Wk+$k|0)>>>0>>0|Xk>>>0>>0||(Wk=q[_k+380>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(gl=Wk+$k|0)>>>0>>0|Xk>>>0>>0||(0|(bl=q[Vk+36>>2]))<0||(Wk=q[_k+392>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=(gl=bl<<2)+Wk|0)>>>0>>0|Xk>>>0>>0||(Wk=q[_k+396>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=Wk+gl|0)>>>0>>0|Xk>>>0>>0||(Wk=q[_k+400>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=Wk+gl|0)>>>0>>0|Xk>>>0>>0||(0|(cl=q[Vk+40>>2]))<0||(Wk=q[_k+412>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=Wk+(cl<<2)|0)>>>0>>0|Xk>>>0>>0||(0|(cl=q[Vk+44>>2]))<0||(Wk=q[_k+424>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=Wk+(cl<<2)|0)>>>0>>0|Xk>>>0>>0||(0|(cl=q[Vk+48>>2]))<0||(Wk=q[_k+428>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=(cl<<=2)+Wk|0)>>>0>>0|Xk>>>0>>0||(Wk=q[_k+432>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=Wk+cl|0)>>>0>>0|Xk>>>0>>0||(0|(cl=q[Vk+52>>2]))<0||(Wk=q[_k+416>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=(cl<<=2)+Wk|0)>>>0>>0|Xk>>>0>>0||(Wk=q[_k+420>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=Wk+cl|0)>>>0>>0|Xk>>>0>>0||(0|(cl=q[Vk+56>>2]))<0||(Wk=q[_k+552>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=Wk+(cl<<2)|0)>>>0>>0|Xk>>>0>>0||(0|(cl=q[Vk+60>>2]))<0||(Wk=q[_k+556>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=Wk+(cl<<2)|0)>>>0>>0|Xk>>>0>>0||(0|(cl=q[Vk+64>>2]))<0||(Wk=q[_k+560>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=Wk+(cl<<1)|0)>>>0>>0|Xk>>>0>>0||(0|(cl=q[Vk+68>>2]))<0||(Wk=q[_k+564>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=Wk+(cl<<2)|0)>>>0>>0|Xk>>>0>>0||(0|(cl=q[Vk+72>>2]))<0||(Wk=q[_k+568>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(cl=(bl=Wk)+(Wk=cl<<2)|0)>>>0>>0|Xk>>>0>>0||(bl=q[_k+572>>2])>>>0>>0|Xk>>>0>>0|bl>>>0>>0||(cl=Wk+bl|0)>>>0>>0|Xk>>>0>>0||(bl=q[_k+576>>2])>>>0>>0|Xk>>>0>>0|bl>>>0>>0||(cl=Wk+bl|0)>>>0>>0|Xk>>>0>>0||(bl=q[_k+580>>2])>>>0>>0|Xk>>>0>>0|bl>>>0>>0||(cl=Wk+bl|0)>>>0>>0|Xk>>>0>>0||(bl=q[_k+584>>2])>>>0>>0|Xk>>>0>>0|bl>>>0>>0||(bl=Wk+bl|0)>>>0>>0|Xk>>>0>>0||(0|(cl=q[Vk+76>>2]))<0||(Wk=q[_k+588>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(cl=(bl=cl<<2)+Wk|0)>>>0>>0|Xk>>>0>>0||(Wk=q[_k+592>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(cl=Wk+bl|0)>>>0>>0|Xk>>>0>>0||(Wk=q[_k+596>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=Wk+bl|0)>>>0>>0|Xk>>>0>>0||(0|(cl=q[Vk+80>>2]))<0||(Wk=q[_k+600>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(hl=(bl=Wk)+(Wk=cl<<2)|0)>>>0>>0|Xk>>>0>>0||(bl=q[_k+604>>2])>>>0>>0|Xk>>>0>>0|bl>>>0>>0||(cl=bl+(cl<<6)|0)>>>0>>0|Xk>>>0>>0||(bl=q[_k+608>>2])>>>0>>0|Xk>>>0>>0|bl>>>0>>0||(cl=Wk+bl|0)>>>0>>0|Xk>>>0>>0||(bl=q[_k+612>>2])>>>0>>0|Xk>>>0>>0|bl>>>0>>0||(cl=Wk+bl|0)>>>0>>0|Xk>>>0>>0||(bl=q[_k+616>>2])>>>0>>0|Xk>>>0>>0|bl>>>0>>0||(cl=Wk+bl|0)>>>0>>0|Xk>>>0>>0||(bl=q[_k+620>>2])>>>0>>0|Xk>>>0>>0|bl>>>0>>0||(cl=Wk+bl|0)>>>0>>0|Xk>>>0>>0||(bl=q[_k+624>>2])>>>0>>0|Xk>>>0>>0|bl>>>0>>0||(cl=Wk+bl|0)>>>0>>0|Xk>>>0>>0||(bl=q[_k+628>>2])>>>0>>0|Xk>>>0>>0|bl>>>0>>0||(cl=Wk+bl|0)>>>0>>0|Xk>>>0>>0||(bl=q[_k+632>>2])>>>0>>0|Xk>>>0>>0|bl>>>0>>0||(bl=Wk+bl|0)>>>0>>0|Xk>>>0>>0||(0|(cl=q[Vk+84>>2]))<0||(Wk=q[_k+636>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=Wk+(cl<<2)|0)>>>0>>0|Xk>>>0>>0||(Wk=q[_k+640>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(bl=Wk+(cl<<1)|0)>>>0>>0|Xk>>>0>>0||(0|(cl=q[Vk+88>>2]))<0||(Wk=q[_k+644>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0||(Wk=Wk+(cl<<2)|0)>>>0>>0|Xk>>>0>>0)){if(!(il>>>0<2)){if((bl=q[_k+168>>2])>>>0>>0|Xk>>>0>>0|bl>>>0>>0)break c;if((Wk=bl+el|0)>>>0>>0|Xk>>>0>>0)break c;if(!(il>>>0<4)){if((bl=q[_k+324>>2])>>>0>>0|Xk>>>0>>0|bl>>>0>>0)break c;if((bl=Yk+bl|0)>>>0>>0|Xk>>>0>>0)break c;if((Wk=q[_k+328>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0)break c;if((bl=Wk+Yk|0)>>>0>>0|Xk>>>0>>0)break c;if((Wk=q[_k+332>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0)break c;if((bl=Wk+Yk|0)>>>0>>0|Xk>>>0>>0)break c;if((Wk=q[_k+152>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0)break c;if((el=Wk+el|0)>>>0>>0|Xk>>>0>>0)break c;if((Wk=q[_k+184>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0)break c;if((el=Wk+fl|0)>>>0>>0|Xk>>>0>>0)break c;if((Wk=q[_k+224>>2])>>>0>>0|Xk>>>0>>0|Wk>>>0>>0)break c;if((Wk=Wk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((0|(el=q[Vk+92>>2]))<0)break c;if((Zk=q[_k+648>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((el=(Wk=el<<2)+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+652>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((el=Wk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+656>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Wk=Wk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((0|(el=q[Vk+96>>2]))<0)break c;if((Zk=q[_k+660>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((el=(Wk=el<<2)+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+664>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((el=Wk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+668>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Wk=Wk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+304>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+316>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+320>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Yk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((0|(Wk=q[Vk+100>>2]))<0)break c;if((Zk=q[_k+436>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Wk=(Yk=Wk<<2)+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+440>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+444>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Yk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((0|(Wk=q[Vk+104>>2]))<0)break c;if((Zk=q[_k+448>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Wk=(Yk=Zk)+(Zk=Wk<<2)|0)>>>0>>0|Xk>>>0>>0)break c;if((Yk=q[_k+452>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0)break c;if((Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Yk=q[_k+456>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0)break c;if((Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Yk=q[_k+460>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0)break c;if((Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Yk=q[_k+464>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0)break c;if((Yk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((0|(Wk=q[Vk+108>>2]))<0)break c;if((Zk=q[_k+480>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Wk=(Yk=Wk<<2)+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+484>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+488>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Yk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((0|(Wk=q[Vk+112>>2]))<0)break c;if((Zk=q[_k+504>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Wk=(Yk=Wk<<2)+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+508>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+512>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Yk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((0|(Wk=q[Vk+116>>2]))<0)break c;if((Zk=q[_k+528>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Yk=Zk+(Wk<<2)|0)>>>0>>0|Xk>>>0>>0)break c;if((0|(Wk=q[Vk+120>>2]))<0)break c;if((Zk=q[_k+532>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Wk=(Yk=Wk<<2)+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+536>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+540>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Yk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((0|(Wk=q[Vk+124>>2]))<0)break c;if((Zk=q[_k+544>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Yk=(Wk<<=2)+Zk|0)>>>0>>0|Xk>>>0>>0)break c;if((Zk=q[_k+548>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0)break c;if((Wk=Wk+Zk|0)>>>0>>0|Xk>>>0>>0)break c}}if(il>>>0<5)break b;if(!((Zk=q[_k+348>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Zk+ll|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+352>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Zk+ll|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+384>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Zk+$k|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+388>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Zk+$k|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+404>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Zk+gl|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+408>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Zk+gl|0)>>>0>>0|Xk>>>0>>0||(0|(Wk=q[Vk+128>>2]))<0||(Zk=q[_k+468>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Wk=(Yk=Wk<<2)+Zk|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+472>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+476>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(0|(Wk=q[Vk+132>>2]))<0||(Zk=q[_k+492>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Wk=(Yk=Wk<<2)+Zk|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+496>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+500>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(0|(Wk=q[Vk+136>>2]))<0||(Zk=q[_k+516>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Wk=(Yk=Wk<<2)+Zk|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+520>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Wk=Yk+Zk|0)>>>0>>0|Xk>>>0>>0||(Zk=q[_k+524>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Zk=Yk+Zk|0)>>>0>>0)&&Zk>>>0<=Xk>>>0)break b}}Y(4,1760,0),da(nl,1),X(a- -64|0,4,160);break a}jl||(ya(a),o[a+5|0]=0,Vk=q[_k+64>>2],dl=q[Vk>>2],al=q[_k+76>>2],il=r[a+4|0]);f:{if((a=0)<(0|dl)){for(;;){if(63>>0)break f;if((0|dl)==(0|(a=a+1|0)))break}if(Wk=Vk+48|0,(Xk=0)<(0|(a=q[Vk>>2]))){for(Zk=q[Vk+48>>2],Yk=q[_k+80>>2];;){if((0|(al=q[Yk+(Xk<<2)>>2]))<0|(0|Zk)<=(0|al))break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(gl=Vk+24|0,Zk=q[Vk+24>>2],$k=q[_k+88>>2],dl=q[_k+84>>2],Xk=0;;){if(Yk=q[(al=Xk<<2)+$k>>2]){if((0|Yk)<0|(0|Zk)<(0|Yk))break f;if((0|(al=q[al+dl>>2]))<0|(0|Zk)<=(0|al))break f;if((Yk=Yk+al|0)>>>31|(0|Zk)<(0|Yk))break f}if((0|a)==(0|(Xk=Xk+1|0)))break}for(Xk=0,Zk=q[_k+92>>2];;){if(1>2])break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Xk=0,Zk=q[_k+96>>2];;){if(1>2])break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Xk=0,Zk=q[_k+100>>2];;){if((0|(Yk=q[Zk+(Xk<<2)>>2]))<-1|(0|a)<=(0|Yk))break f;if((0|a)==(0|(Xk=Xk+1|0)))break}}else gl=Vk+24|0}else gl=Vk+24|0,Wk=Vk+48|0;if((a=0)<(0|(Xk=q[Vk+4>>2]))){for(Zk=q[_k+108>>2];;){if(63>>0)break f;if((0|Xk)==(0|(a=a+1|0)))break}if($k=(Zk=q[Vk+48>>2])+-1|0,!(((Xk=0)|(a=q[Vk+4>>2]))<=0)){for(Yk=q[_k+112>>2];;){if((0|(al=q[Yk+(Xk<<2)>>2]))<0|(0|Zk)<=(0|al))break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Xk=0,Zk=q[_k+116>>2];;){if(1>2])break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Xk=0,Zk=q[_k+120>>2];;){if(1>2])break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Zk=q[Vk>>2],Xk=0,Yk=q[_k+124>>2];;){if((0|(al=q[Yk+(Xk<<2)>>2]))<-1|(0|Zk)<=(0|al))break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Xk=0,Zk=q[_k+128>>2];;){if((0|(Yk=q[Zk+(Xk<<2)>>2]))<-1|(0|a)<=(0|Yk))break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Xk=0,Zk=q[_k+132>>2];;){if(1>2])break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Yk=Vk+8|0,al=Vk+12|0,dl=q[_k+136>>2],Xk=0;;){if(1<(fl=q[(el=Xk<<2)+Zk>>2])>>>0)break f;if((0|(el=q[dl+el>>2]))<0|(0|el)>=q[(fl-1|0?Yk:al)>>2])break f;if((0|a)==(0|(Xk=Xk+1|0)))break}}}else $k=q[Wk>>2]+-1|0;if((a=0)<(0|(Xk=q[Vk+8>>2]))){for(Zk=q[_k+140>>2];;){if((0|(Yk=q[Zk+(a<<2)>>2]))<0|(0|$k)<(0|Yk))break f;if((0|Xk)==(0|(a=a+1|0)))break}for(ll=Vk+28|0,Zk=q[Vk+28>>2],dl=q[_k+148>>2],el=q[_k+144>>2],a=0;;){if(Yk=q[(al=a<<2)+dl>>2]){if((0|Yk)<0|(0|Zk)<(0|Yk))break f;if((0|(al=q[al+el>>2]))<0|(0|Zk)<=(0|al))break f;if((Yk=Yk+al|0)>>>31|(0|Zk)<(0|Yk))break f}if((0|Xk)==(0|(a=a+1|0)))break}for(a=0,Yk=q[_k+156>>2],al=q[_k+164>>2],dl=q[_k+160>>2];;){if((0|(el=q[(Zk=a<<2)+dl>>2]))<1)break f;if((0|(fl=q[Zk+al>>2]))<1)break f;if((0|(Zk=q[Yk+Zk>>2]))<1|(0|Zk)!=(0|w(fl+1|0,el+1|0)))break f;if((0|Xk)==(0|(a=a+1|0)))break}}else ll=Vk+28|0;if((a=0)<(0|(Yk=q[Vk+12>>2]))){for(Xk=q[_k+172>>2];;){if((0|(Zk=q[Xk+(a<<2)>>2]))<0|(0|$k)<(0|Zk))break f;if((0|Yk)==(0|(a=a+1|0)))break}for(bl=Vk+32|0,Xk=q[Vk+32>>2],$k=q[_k+180>>2],dl=q[_k+176>>2],a=0;;){if(Zk=q[(al=a<<2)+$k>>2]){if((0|Zk)<0|(0|Xk)<(0|Zk))break f;if((0|(al=q[al+dl>>2]))<0|(0|Xk)<=(0|al))break f;if((Zk=Zk+al|0)>>>31|(0|Xk)<(0|Zk))break f}if((0|Yk)==(0|(a=a+1|0)))break}}else bl=Vk+32|0;Zk=Vk+16|0;m:{n:{if(!(((a=0)|(Xk=q[Vk+16>>2]))<=0)){for(Yk=q[_k+208>>2];;){if(63>>0)break f;if((0|Xk)==(0|(a=a+1|0)))break}if(!(((Xk=0)|(a=q[Zk>>2]))<=0)){for(Yk=q[Wk>>2],al=q[_k+212>>2];;){if((0|($k=q[al+(Xk<<2)>>2]))<0|(0|Yk)<=(0|$k))break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(nl=Vk+36|0,Yk=q[Vk+36>>2],dl=q[_k+220>>2],el=q[_k+216>>2],Xk=0;;){if(al=q[($k=Xk<<2)+dl>>2]){if((0|al)<0|(0|Yk)<(0|al))break f;if((0|($k=q[$k+el>>2]))<0|(0|Yk)<=(0|$k))break f;if((al=al+$k|0)>>>31|(0|Yk)<(0|al))break f}if((0|a)==(0|(Xk=Xk+1|0)))break}for(Xk=0,Yk=q[_k+228>>2];;){if(1>2])break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Xk=0,Yk=q[_k+232>>2];;){if(1>2])break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Yk=q[Vk>>2],Xk=0,al=q[_k+236>>2];;){if((0|($k=q[al+(Xk<<2)>>2]))<-1|(0|Yk)<=(0|$k))break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Yk=q[Vk+4>>2],Xk=0,al=q[_k+240>>2];;){if((0|($k=q[al+(Xk<<2)>>2]))<-1|(0|Yk)<=(0|$k))break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Yk=q[_k+244>>2],Xk=0;;){if(q[Yk+(Xk<<2)>>2]<0)break f;if((0|a)==(0|(Xk=Xk+1|0)))break}break n}}al=Vk+68|0,nl=Vk+36|0;break m}for(Yk=q[_k+252>>2],Xk=0;;){if(q[Yk+(Xk<<2)>>2]<0)break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(al=q[Vk+60>>2],Xk=0,$k=q[_k+256>>2];;){if((dl=q[(dl=Xk<<2)+$k>>2]+(q[Yk+dl>>2]<<1)|0)>>>31|(0|al)<(0|dl))break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Yk=q[Vk+64>>2],dl=q[_k+264>>2],el=q[_k+260>>2],Xk=0;;){if(al=q[($k=Xk<<2)+dl>>2]){if((0|al)<0|(0|Yk)<(0|al))break f;if((0|($k=q[$k+el>>2]))<0|(0|Yk)<=(0|$k))break f;if((al=al+$k|0)>>>31|(0|Yk)<(0|al))break f}if((0|a)==(0|(Xk=Xk+1|0)))break}for(al=Vk+68|0,Yk=q[Vk+68>>2],el=q[_k+272>>2],fl=q[_k+268>>2],Xk=0;;){if($k=q[(dl=Xk<<2)+el>>2]){if((0|$k)<0|(0|Yk)<(0|$k))break f;if((0|(dl=q[dl+fl>>2]))<0|(0|Yk)<=(0|dl))break f;if(($k=$k+dl|0)>>>31|(0|Yk)<(0|$k))break f}if((0|a)==(0|(Xk=Xk+1|0)))break}}p:{q:{if(!(((a=0)|(Xk=q[Vk+20>>2]))<=0)){for(Yk=q[_k+280>>2];;){if(63>>0)break f;if((0|Xk)==(0|(a=a+1|0)))break}if(!(((a=0)|(Xk=q[Vk+20>>2]))<=0)){for(Yk=q[_k+296>>2];;){if(1>2])break f;if((0|Xk)==(0|(a=a+1|0)))break}for(Yk=q[_k+300>>2],a=0;;){if(q[Yk+(a<<2)>>2]<0)break f;if((0|Xk)==(0|(a=a+1|0)))break}break q}}a=q[Vk+52>>2];break p}for(a=q[Vk+52>>2],el=q[_k+312>>2],fl=q[_k+308>>2],$k=0;;){if(Yk=q[(dl=$k<<2)+el>>2]){if((0|Yk)<0|(0|a)<(0|Yk))break f;if((0|(dl=q[dl+fl>>2]))<0|(0|a)<=(0|dl))break f;if((Yk=Yk+dl|0)>>>31|(0|a)<(0|Yk))break f}if((0|Xk)==(0|($k=$k+1|0)))break}}if(Yk=q[Vk+40>>2],(Xk=0)<(0|($k=q[Vk+8>>2])))for(dl=q[_k+344>>2],el=q[_k+156>>2];;){if((fl=q[(fl=Xk<<2)+dl>>2]+(q[el+fl>>2]<<1)|0)>>>31|(0|Yk)<(0|fl))break f;if((0|$k)==(0|(Xk=Xk+1|0)))break}if((Xk=0)<(0|($k=q[bl>>2]))){for(dl=q[_k+376>>2];;){if(1>2])break f;if((0|$k)==(0|(Xk=Xk+1|0)))break}for(Xk=0,dl=q[_k+380>>2];;){if(1>2])break f;if((0|$k)==(0|(Xk=Xk+1|0)))break}}if((Xk=0)<(0|($k=q[Zk>>2])))for(dl=q[_k+400>>2],el=q[_k+252>>2];;){if((fl=q[(fl=Xk<<2)+dl>>2]+(q[el+fl>>2]<<1)|0)>>>31|(0|Yk)<(0|fl))break f;if((0|$k)==(0|(Xk=Xk+1|0)))break}if((Xk=0)<(0|(Yk=q[Vk+44>>2])))for(dl=q[_k+424>>2];;){if((0|(el=q[dl+(Xk<<2)>>2]))<0|(0|a)<=(0|el))break f;if((0|Yk)==(0|(Xk=Xk+1|0)))break}if(1<=(0|(el=q[Wk>>2])))for(Xk=0,fl=q[_k+432>>2],cl=q[_k+428>>2];;){if(Wk=q[(dl=Xk<<2)+fl>>2]){if((0|Wk)<0|(0|Yk)<(0|Wk))break f;if((0|(dl=q[cl+dl>>2]))<0|(0|Yk)<=(0|dl))break f;if((Wk=Wk+dl|0)>>>31|(0|Yk)<(0|Wk))break f}if((0|el)==(0|(Xk=Xk+1|0)))break}if(1<=(0|a))for(Yk=q[Vk+56>>2],Xk=0,el=q[_k+420>>2],fl=q[_k+416>>2];;){if(Wk=q[(dl=Xk<<2)+el>>2]){if((0|Wk)<0|(0|Yk)<(0|Wk))break f;if((0|(dl=q[dl+fl>>2]))<0|(0|Yk)<=(0|dl))break f;if((Wk=Wk+dl|0)>>>31|(0|Yk)<(0|Wk))break f}if((0|(Xk=Xk+1|0))==(0|a))break}if((a=0)<(0|(Xk=q[al>>2])))for(Yk=q[_k+564>>2];;){if((0|(al=q[Yk+(a<<2)>>2]))<-1|(0|$k)<=(0|al))break f;if((0|Xk)==(0|(a=a+1|0)))break}if(a=q[Vk+76>>2],1<=(0|(al=q[Vk+72>>2])))for(Xk=0,$k=q[_k+572>>2],dl=q[_k+568>>2];;){if(Yk=q[(Wk=Xk<<2)+$k>>2]){if((0|Yk)<0|(0|a)<(0|Yk))break f;if((0|(Wk=q[Wk+dl>>2]))<0|(0|a)<=(0|Wk))break f;if((Yk=Wk+Yk|0)>>>31|(0|a)<(0|Yk))break f}if((0|al)==(0|(Xk=Xk+1|0)))break}if((Xk=0)<(0|a)){for(Yk=q[_k+588>>2];;){if(1>2])break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Wk=q[_k+592>>2],Xk=0;;){if(1<(dl=q[($k=Xk<<2)+Yk>>2])>>>0)break f;if((0|($k=q[Wk+$k>>2]))<0|(0|$k)>=q[(dl-1|0?Zk:Vk)>>2])break f;if((0|a)==(0|(Xk=Xk+1|0)))break}for(Xk=0,Yk=q[_k+596>>2];;){if((0|(Wk=q[Yk+(Xk<<2)>>2]))<-1|(0|al)<=(0|Wk))break f;if((0|a)==(0|(Xk=Xk+1|0)))break}}s:{if(!(((a=0)|($k=q[Vk+80>>2]))<=0)){for(Xk=q[_k+604>>2];;){if(63>>0)break f;if((0|$k)==(0|(a=a+1|0)))break}if(!(((a=0)|($k=q[Vk+80>>2]))<=0)){for(Xk=q[Vk+48>>2],Yk=q[_k+608>>2];;){if((0|(al=q[Yk+(a<<2)>>2]))<0|(0|Xk)<=(0|al))break f;if((0|$k)==(0|(a=a+1|0)))break}for(el=q[Vk+88>>2],al=q[_k+616>>2],Wk=q[_k+612>>2],a=0;;){if(Xk=q[(Yk=a<<2)+al>>2]){if((0|Xk)<0|(0|el)<(0|Xk))break f;if((0|(Yk=q[Wk+Yk>>2]))<0|(0|el)<=(0|Yk))break f;if((Xk=Xk+Yk|0)>>>31|(0|el)<(0|Xk))break f}if((0|$k)==(0|(a=a+1|0)))break}for(Zk=q[Zk>>2],al=q[_k+620>>2],a=0;;){if((0|(Xk=q[al+(a<<2)>>2]))<0|(0|Zk)<=(0|Xk))break f;if((0|$k)==(0|(a=a+1|0)))break}for(Wk=q[_k+624>>2],a=0;;){if((0|(Xk=q[Wk+(a<<2)>>2]))<0|(0|Zk)<=(0|Xk))break f;if((0|$k)==(0|(a=a+1|0)))break}for(Xk=q[Vk+84>>2],dl=q[_k+632>>2],fl=q[_k+628>>2],a=0;;){if(Yk=q[(cl=a<<2)+dl>>2]){if((0|Yk)<0|(0|Xk)<(0|Yk))break f;if((0|(cl=q[cl+fl>>2]))<0|(0|Xk)<=(0|cl))break f;if((Yk=Yk+cl|0)>>>31|(0|Xk)<(0|Yk))break f}if((0|$k)==(0|(a=a+1|0)))break}for(hl=q[_k+640>>2],Xk=q[_k+252>>2],Yk=0;;){if(0<(0|(jl=q[(a=Yk<<2)+dl>>2])))for(cl=hl+(q[a+fl>>2]<<1)|0,ol=q[Xk+(q[a+Wk>>2]<<2)>>2],kl=q[Xk+(q[a+al>>2]<<2)>>2],a=0;;){if((0|ol)<=s[cl+(2|(ml=a<<1))>>1]|(0|kl)<=s[cl+ml>>1])break f;if(!((0|(a=a+2|0))<(0|jl)))break}if((0|$k)==(0|(Yk=Yk+1|0)))break}break s}}Zk=q[Vk+16>>2],el=q[Vk+88>>2]}if(!((255&il)>>>0<2)){if((a=0)<(0|(dl=q[Vk+8>>2])))for(Xk=q[_k+168>>2];;){if(1>2])break f;if((0|dl)==(0|(a=a+1|0)))break}if(!((255&il)>>>0<4)){if(al=q[Vk+56>>2],1<=(0|(fl=q[Vk+20>>2])))for(Wk=q[_k+332>>2],cl=q[_k+328>>2],a=0;;){if(Xk=q[(Yk=a<<2)+Wk>>2]){if((0|Xk)<0|(0|al)<(0|Xk))break f;if((0|(Yk=q[Yk+cl>>2]))<0|(0|al)<=(0|Yk))break f;if((Xk=Xk+Yk|0)>>>31|(0|al)<(0|Xk))break f}if((0|fl)==(0|(a=a+1|0)))break}if((0|(a=q[Vk+92>>2]))!=q[Vk+96>>2])break f;if(1<=(0|dl))for(cl=q[_k+152>>2],Xk=0,hl=q[_k+148>>2];;){if(Yk=q[(Wk=Xk<<2)+hl>>2]){if((0|Yk)<0|(0|a)<(0|Yk))break f;if((0|(Wk=q[Wk+cl>>2]))<0|(0|a)<=(0|Wk))break f;if((Yk=Wk+Yk|0)>>>31|(0|a)<(0|Yk))break f}if((0|dl)==(0|(Xk=Xk+1|0)))break}if(1<=(0|(ol=q[Vk+12>>2])))for(cl=q[_k+184>>2],Xk=0,hl=q[_k+180>>2];;){if(Yk=q[(Wk=Xk<<2)+hl>>2]){if((0|Yk)<0|(0|a)<(0|Yk))break f;if((0|(Wk=q[Wk+cl>>2]))<0|(0|a)<=(0|Wk))break f;if((Yk=Wk+Yk|0)>>>31|(0|a)<(0|Yk))break f}if((0|ol)==(0|(Xk=Xk+1|0)))break}if(1<=(0|Zk))for(cl=q[_k+224>>2],Xk=0,hl=q[_k+220>>2];;){if(Yk=q[(Wk=Xk<<2)+hl>>2]){if((0|Yk)<0|(0|a)<(0|Yk))break f;if((0|(Wk=q[Wk+cl>>2]))<0|(0|a)<=(0|Wk))break f;if((Yk=Wk+Yk|0)>>>31|(0|a)<(0|Yk))break f}if((0|Zk)==(0|(Xk=Xk+1|0)))break}if((Xk=0)<(0|fl)){for(Yk=q[_k+304>>2];;){if(1>2])break f;if((0|fl)==(0|(Xk=Xk+1|0)))break}for(Yk=q[Vk+100>>2],hl=q[_k+320>>2],jl=q[_k+316>>2],Xk=0;;){if(Wk=q[(cl=Xk<<2)+hl>>2]){if((0|Wk)<0|(0|Yk)<(0|Wk))break f;if((0|(cl=q[cl+jl>>2]))<0|(0|Yk)<=(0|cl))break f;if((Wk=Wk+cl|0)>>>31|(0|Yk)<(0|Wk))break f}if((0|fl)==(0|(Xk=Xk+1|0)))break}}else Yk=q[Vk+100>>2];if(1<=(0|Yk)){for(cl=q[_k+440>>2],Xk=0,jl=q[_k+436>>2];;){if(Wk=q[(hl=Xk<<2)+cl>>2]){if((0|Wk)<0|(0|al)<(0|Wk))break f;if((0|(hl=q[hl+jl>>2]))<0|(0|al)<=(0|hl))break f;if((Wk=Wk+hl|0)>>>31|(0|al)<(0|Wk))break f}if((0|Yk)==(0|(Xk=Xk+1|0)))break}for(al=q[_k+444>>2],Xk=0;;){if((0|(hl=q[(Wk=Xk<<2)+al>>2]))<0|(0|hl)>=q[Wk+cl>>2])break f;if((0|Yk)==(0|(Xk=Xk+1|0)))break}}if((al=0)<(0|(Xk=q[Vk+104>>2]))){for(Wk=q[_k+448>>2];;){if((0|(cl=q[Wk+(al<<2)>>2]))<0|(0|Yk)<=(0|cl))break f;if((0|Xk)==(0|(al=al+1|0)))break}for(Wk=q[Vk+116>>2],hl=q[_k+464>>2],jl=q[_k+460>>2],Yk=0;;){if(al=q[(cl=Yk<<2)+hl>>2]){if((0|al)<0|(0|Wk)<(0|al))break f;if((0|(cl=q[cl+jl>>2]))<0|(0|Wk)<=(0|cl))break f;if((al=al+cl|0)>>>31|(0|Wk)<(0|al))break f}if((0|Xk)==(0|(Yk=Yk+1|0)))break}}else Wk=q[Vk+116>>2];if((Yk=0)<(0|(cl=q[Vk+108>>2]))){for(al=q[_k+480>>2];;){if((0|(hl=q[al+(Yk<<2)>>2]))<0|(0|dl)<=(0|hl))break f;if((0|cl)==(0|(Yk=Yk+1|0)))break}for(hl=q[_k+488>>2],kl=q[_k+484>>2],Yk=0;;){if(al=q[(dl=Yk<<2)+hl>>2]){if((0|al)<0|(0|Xk)<(0|al))break f;if((0|(dl=q[dl+kl>>2]))<0|(0|Xk)<=(0|dl))break f;if((al=al+dl|0)>>>31|(0|Xk)<(0|al))break f}if((0|cl)==(0|(Yk=Yk+1|0)))break}for(hl=q[ll>>2],Yk=q[_k+456>>2],dl=q[_k+452>>2],al=0;;){if(ml=q[kl+(al<<2)>>2]<<2,jl=q[ml+Yk>>2]){if((0|jl)<0|(0|hl)<(0|jl))break f;if((0|(ml=q[dl+ml>>2]))<0|(0|hl)<=(0|ml))break f;if((0|(jl=jl+ml|0))<0|(0|hl)<(0|jl))break f}if((0|cl)==(0|(al=al+1|0)))break}}else Yk=q[_k+456>>2],dl=q[_k+452>>2];if((al=0)<(0|(cl=q[Vk+112>>2]))){for(hl=q[_k+504>>2];;){if((0|(jl=q[hl+(al<<2)>>2]))<0|(0|Zk)<=(0|jl))break f;if((0|cl)==(0|(al=al+1|0)))break}for(kl=q[_k+512>>2],jl=q[_k+508>>2],Zk=0;;){if(al=q[(hl=Zk<<2)+kl>>2]){if((0|al)<0|(0|Xk)<(0|al))break f;if((0|(hl=q[hl+jl>>2]))<0|(0|Xk)<=(0|hl))break f;if((al=al+hl|0)>>>31|(0|Xk)<(0|al))break f}if((0|cl)==(0|(Zk=Zk+1|0)))break}for(al=q[nl>>2],Zk=0;;){if(kl=q[jl+(Zk<<2)>>2]<<2,hl=q[kl+Yk>>2]){if((0|hl)<0|(0|al)<(0|hl))break f;if((0|(kl=q[dl+kl>>2]))<0|(0|al)<=(0|kl))break f;if((0|(hl=hl+kl|0))<0|(0|al)<(0|hl))break f}if((0|cl)==(0|(Zk=Zk+1|0)))break}}if(al=q[Vk+120>>2],(Zk=0)<(0|Wk))for(cl=q[_k+528>>2];;){if((0|(hl=q[cl+(Zk<<2)>>2]))<0|(0|al)<=(0|hl))break f;if((0|(Zk=Zk+1|0))==(0|Wk))break}if((Zk=0)<(0|al)){for(Wk=q[_k+532>>2];;){if((0|(cl=q[Wk+(Zk<<2)>>2]))<-1|(0|fl)<=(0|cl))break f;if((0|al)==(0|(Zk=Zk+1|0)))break}for(Wk=q[Vk+124>>2],hl=q[_k+540>>2],jl=q[_k+536>>2],Zk=0;;){if(fl=q[(cl=Zk<<2)+hl>>2]){if((0|fl)<0|(0|Wk)<(0|fl))break f;if((0|(cl=q[cl+jl>>2]))<0|(0|Wk)<=(0|cl))break f;if((fl=cl+fl|0)>>>31|(0|Wk)<(0|fl))break f}if((0|al)==(0|(Zk=Zk+1|0)))break}}if(!((255&il)>>>0<5)){if((Zk=0)<(0|(il=q[ll>>2]))){for(al=q[_k+348>>2];;){if((0|(Wk=q[al+(Zk<<2)>>2]))<0|(0|a)<(0|Wk))break f;if((0|il)==(0|(Zk=Zk+1|0)))break}for(al=q[_k+352>>2],Zk=0;;){if((0|(Wk=q[al+(Zk<<2)>>2]))<0|(0|a)<(0|Wk))break f;if((0|il)==(0|(Zk=Zk+1|0)))break}}if((il=0)<(0|(Zk=q[bl>>2]))){for(al=q[_k+384>>2];;){if((0|(Wk=q[al+(il<<2)>>2]))<0|(0|a)<(0|Wk))break f;if((0|Zk)==(0|(il=il+1|0)))break}for(al=q[_k+388>>2],il=0;;){if((0|(Wk=q[al+(il<<2)>>2]))<0|(0|a)<(0|Wk))break f;if((0|Zk)==(0|(il=il+1|0)))break}}if((il=0)<(0|(al=q[nl>>2]))){for(Wk=q[_k+404>>2];;){if((0|(fl=q[Wk+(il<<2)>>2]))<0|(0|a)<(0|fl))break f;if((0|al)==(0|(il=il+1|0)))break}for(Wk=q[_k+408>>2],il=0;;){if((0|(fl=q[Wk+(il<<2)>>2]))<0|(0|a)<(0|fl))break f;if((0|al)==(0|(il=il+1|0)))break}}if((a=0)<(0|(il=q[Vk+128>>2]))){for(al=q[Vk>>2],Wk=q[_k+468>>2];;){if((0|(fl=q[Wk+(a<<2)>>2]))<0|(0|al)<=(0|fl))break f;if((0|il)==(0|(a=a+1|0)))break}for(ll=q[_k+476>>2],fl=q[_k+472>>2],a=0;;){if(al=q[(Wk=a<<2)+ll>>2]){if((0|al)<0|(0|Xk)<(0|al))break f;if((0|(Wk=q[Wk+fl>>2]))<0|(0|Xk)<=(0|Wk))break f;if((al=Wk+al|0)>>>31|(0|Xk)<(0|al))break f}if((0|il)==(0|(a=a+1|0)))break}for(al=q[gl>>2],a=0;;){if(gl=q[fl+(a<<2)>>2]<<2,Wk=q[gl+Yk>>2]){if((0|Wk)<0|(0|al)<(0|Wk))break f;if((0|(gl=q[dl+gl>>2]))<0|(0|al)<=(0|gl))break f;if((0|(Wk=Wk+gl|0))<0|(0|al)<(0|Wk))break f}if((0|il)==(0|(a=a+1|0)))break}}if((a=0)<(0|(il=q[Vk+132>>2]))){for(al=q[_k+492>>2];;){if((0|(Wk=q[al+(a<<2)>>2]))<0|(0|ol)<=(0|Wk))break f;if((0|il)==(0|(a=a+1|0)))break}for(gl=q[_k+500>>2],Wk=q[_k+496>>2],a=0;;){if(al=q[(fl=a<<2)+gl>>2]){if((0|al)<0|(0|Xk)<(0|al))break f;if((0|(fl=q[Wk+fl>>2]))<0|(0|Xk)<=(0|fl))break f;if((al=al+fl|0)>>>31|(0|Xk)<(0|al))break f}if((0|il)==(0|(a=a+1|0)))break}for(a=0;;){if(fl=q[Wk+(a<<2)>>2]<<2,al=q[fl+Yk>>2]){if((0|al)<0|(0|Zk)<(0|al))break f;if((0|(fl=q[dl+fl>>2]))<0|(0|Zk)<=(0|fl))break f;if((0|(al=al+fl|0))<0|(0|Zk)<(0|al))break f}if((0|il)==(0|(a=a+1|0)))break}}if(!(((a=0)|(Vk=q[Vk+136>>2]))<=0)){for(Zk=q[_k+516>>2];;){if((0|(il=q[Zk+(a<<2)>>2]))<0|(0|$k)<=(0|il))break f;if((0|Vk)==(0|(a=a+1|0)))break}for(al=q[_k+524>>2],Zk=q[_k+520>>2],a=0;;){if(_k=q[(il=a<<2)+al>>2]){if((0|_k)<0|(0|Xk)<(0|_k))break f;if((0|(il=q[Zk+il>>2]))<0|(0|Xk)<=(0|il))break f;if((_k=_k+il|0)>>>31|(0|Xk)<(0|_k))break f}if((0|Vk)==(0|(a=a+1|0)))break}for(a=0;;){if(_k=q[Zk+(a<<2)>>2]<<2,Xk=q[_k+Yk>>2]){if((0|Xk)<0|(0|el)<(0|Xk))break f;if((0|(_k=q[_k+dl>>2]))<0|(0|el)<=(0|_k))break f;if((0|(Xk=Xk+_k|0))<0|(0|el)<(0|Xk))break f}if((0|Vk)==(0|(a=a+1|0)))break}}}}}return L=pl,1}return Y(4,1846,0),L=pl,0}q[_k+52>>2]=Xk,q[_k+48>>2]=5,Y(4,1640,_k+48|0)}else q[_k+32>>2]=Xk,Y(4,1554,_k+32|0);return L=pl,0}(a,vj):(q[20+wj>>2]=1621,q[16+wj>>2]=2284,Y(4,1294,16+wj|0),0):(q[4+wj>>2]=1444,q[wj>>2]=2284,Y(4,1294,wj),0),L=48+wj|0,0|a},j:function(a){q[1805]=a|=0},k:function(a,ej){var fj;return ej|=0,L=fj=L-48|0,a=(a|=0)?(a+63&-64)!=(0|a)?(q[36+fj>>2]=1522,q[32+fj>>2]=2305,Y(4,1294,32+fj|0),0):(ej+63&-64)==(0|ej)&&ej?function(a){var Qk,Tk,Uk,Uh,Kk=0,Lk=0,Mk=0,Nk=0,Ok=0,Pk=0,Rk=0,Sk=0;q[24+(L=Qk=L-32|0)>>2]=0,q[16+Qk>>2]=5,q[20+Qk>>2]=0,Ka(16+(L=Uh=L-272|0)|0,2227,q[12+Uh>>2]=16+Qk|0),function(a){var Hc;q[(L=Hc=L-16|0)>>2]=a,function(a,Il){var Jl;q[12+(L=Jl=L-16|0)>>2]=Il,Ia(a,1432,Il,0,0),L=16+Jl|0}(q[970],Hc),L=16+Hc|0}(16+Uh|0),L=272+Uh|0;a:{if(sa(a))Y(4,1932,0);else{if(!(6<=(Mk=r[a+4|0])>>>0)){if(1!=(0|!r[a+5|0])?(da(a+4|0,1),X(a- -64|0,4,160),na(a,a+704|(o[a+5|0]=0)),ya(a)):na(a,a+704|0),r[7224]||(q[1807]=6,o[7224]=1,q[1808]=7,q[1809]=8,q[1810]=9),Lk=q[a+704>>2],1<=(0|(Mk=q[Lk+16>>2]))){for(Sk=(Nk=q[a+912>>2])+(Mk<<2)|0,Ok=q[a+908>>2];;){Rk=q[a+1204>>2]+(q[Ok>>2]<<2)|0;d:if(!(((Lk=0)|(Kk=(Mk=q[Nk>>2])+-1|0))<1))e:for(;;){for(;;){if(q[(Pk=Rk+(Lk<<2)|0)>>2]<=-1){if(function(a,Vk,ql){var rl=0,sl=0;a:if((0|a)!=(0|Vk)){if(!(a>>>0>>0&&Vk>>>0<(sl=a+ql|0)>>>0))return $(a,Vk,ql);if(rl=3&(a^Vk),a>>>0>>0){if(!rl){if(3&a)for(;;){if(!ql)break a;if(o[0|a]=r[0|Vk],Vk=Vk+1|0,ql=ql+-1|0,!(3&(a=a+1|0)))break}if(!(ql>>>0<=3)){for(rl=ql;q[a>>2]=q[Vk>>2],Vk=Vk+4|0,a=a+4|0,3<(rl=rl+-4|0)>>>0;);ql&=3}}if(ql)for(;o[0|a]=r[0|Vk],a=a+1|0,Vk=Vk+1|0,ql=ql+-1|0;);}else{if(!rl){if(3&sl)for(;;){if(!ql)break a;if(o[0|(rl=(ql=ql+-1|0)+a|0)]=r[Vk+ql|0],!(3&rl))break}if(!(ql>>>0<=3))for(;q[(ql=ql+-4|0)+a>>2]=q[Vk+ql>>2],3>>0;);}if(ql)for(;o[(ql=ql+-1|0)+a|0]=r[Vk+ql|0],ql;);}}}(Pk,Pk+4|0,(-1^Lk)+Mk<<2),(0|Lk)<(0|(Kk=(Mk=Kk)+-1|0)))continue e;break d}if(!((0|(Lk=Lk+1|0))<(0|Kk)))break}break}if(Lk=Nk,0<(0|Mk)&&(Mk=q[Rk+(Kk<<2)>>2]<0?Kk:Mk),q[Lk>>2]=Mk,Ok=Ok+4|0,!((Nk=Nk+4|0)>>>0>>0))break}Lk=q[a+704>>2]}if(1<=q[Lk>>2])for(Kk=0;q[q[a+712>>2]+(Kk<<2)>>2]=q[a+716>>2]+(Kk<<6),Lk=q[a+704>>2],(0|(Kk=Kk+1|0))>2];);if(1<=q[Lk+4>>2])for(Kk=0;q[q[a+744>>2]+(Kk<<2)>>2]=q[a+748>>2]+(Kk<<6),Lk=q[a+704>>2],(0|(Kk=Kk+1|0))>2];);if(1<=q[Lk+16>>2])for(Kk=0;q[(Mk=Kk<<2)+q[a+832>>2]>>2]=q[a+848>>2]+(Kk<<6),q[Mk+q[a+836>>2]>>2]=q[a+1196>>2]+(q[Mk+q[a+896>>2]>>2]<<2),q[Mk+q[a+840>>2]>>2]=q[a+1200>>2]+(q[Mk+q[a+900>>2]>>2]<<1),q[Mk+q[a+844>>2]>>2]=q[a+1204>>2]+(q[Mk+q[a+908>>2]>>2]<<2),Lk=q[a+704>>2],(0|(Kk=Kk+1|0))>2];);if(1<=q[Lk+20>>2])for(Kk=0;q[q[a+916>>2]+(Kk<<2)>>2]=q[a+920>>2]+(Kk<<6),Lk=q[a+704>>2],(0|(Kk=Kk+1|0))>2];);if(1<=q[Lk+80>>2])for(Kk=0;q[q[a+1240>>2]+(Kk<<2)>>2]=q[a+1244>>2]+(Kk<<6),Lk=q[a+704>>2],(0|(Kk=Kk+1|0))>2];);if(1&o[q[a+708>>2]+20|0])break a;if((0|(Nk=q[Lk+16>>2]))<1)break a;for(Kk=q[a+904>>2],Rk=q[a+900>>2],Pk=q[a+1200>>2],Ok=0;;){if(0<(0|(Sk=q[(Mk=Ok<<2)+Kk>>2]+-1|0)))for(Tk=Pk+(q[Mk+Rk>>2]<<1)|0,Lk=0;Uk=s[(Mk=Tk+(Lk<<1)|0)>>1],p[Mk>>1]=s[Mk+4>>1],p[Mk+4>>1]=Uk,(0|(Lk=Lk+3|0))<(0|Sk););if((0|Nk)==(0|(Ok=Ok+1|0)))break}for(Mk=q[a+892>>2],Ok=q[a+896>>2],Rk=q[a+1196>>2],Kk=0;;){if(1<=(0|(Pk=q[(Lk=Kk<<2)+Mk>>2])))for(Pk=(Lk=Rk+(q[Lk+Ok>>2]<<2)|0)+(Pk<<3)|0,Lk=Lk+4|0;u[Lk>>2]=x(1)-u[Lk>>2],(Lk=Lk+8|0)>>>0>>0;);if((0|Nk)==(0|(Kk=Kk+1|0)))break}break a}q[4+Qk>>2]=Mk,q[Qk>>2]=5,Y(4,2023,Qk)}a=0}return L=32+Qk|0,a}(a):(q[20+fj>>2]=1621,q[16+fj>>2]=2305,Y(4,1294,16+fj|0),0):(q[4+fj>>2]=1444,q[fj>>2]=2305,Y(4,1294,fj),0),L=48+fj|0,0|a},l:function(a,ej,fj,gj){var hj;ej|=0,fj|=0,gj|=0,L=hj=L+-64|0,(a|=0)?ej?fj?gj?(a=q[q[a>>2]+708>>2],q[ej>>2]=q[a+12>>2],q[ej+4>>2]=q[a+16>>2],q[fj>>2]=q[a+4>>2],q[fj+4>>2]=q[a+8>>2],q[gj>>2]=q[a>>2]):(q[52+hj>>2]=1995,q[48+hj>>2]=2325,Y(4,1294,48+hj|0)):(q[36+hj>>2]=1903,q[32+hj>>2]=2325,Y(4,1294,32+hj|0)):(q[20+hj>>2]=1819,q[16+hj>>2]=2325,Y(4,1294,16+hj|0)):(q[4+hj>>2]=1740,q[hj>>2]=2325,Y(4,1294,hj)),L=64+hj|0},m:xa,n:wa,o:function(a){var dj;L=dj=L-16|0,(a|=0)?ua(a):(q[4+dj>>2]=1740,q[dj>>2]=2387,Y(4,1294,dj)),L=16+dj|0},p:function(a){var cj;return L=cj=L-16|0,a=(a|=0)?q[a+540>>2]:(q[4+cj>>2]=1740,q[cj>>2]=2402,Y(4,1294,cj),-1),L=16+cj|0,0|a},q:function(a){var bj;return L=bj=L-16|0,a=(a|=0)?q[q[a>>2]+916>>2]:(q[4+bj>>2]=1740,q[bj>>2]=2423,Y(4,1294,bj),0),L=16+bj|0,0|a},r:function(a){var aj;return L=aj=L-16|0,a=(a|=0)?q[a+548>>2]:(q[4+aj>>2]=1740,q[aj>>2]=2442,Y(4,1294,aj),0),L=16+aj|0,0|a},s:function(a){var $i;return L=$i=L-16|0,a=(a|=0)?q[q[a>>2]+928>>2]:(q[4+$i>>2]=1740,q[$i>>2]=2463,Y(4,1294,$i),0),L=16+$i|0,0|a},t:function(a){var _i;return L=_i=L-16|0,a=(a|=0)?q[q[a>>2]+924>>2]:(q[4+_i>>2]=1740,q[_i>>2]=2492,Y(4,1294,_i),0),L=16+_i|0,0|a},u:function(a){var Zi;return L=Zi=L-16|0,a=(a|=0)?q[q[a>>2]+932>>2]:(q[4+Zi>>2]=1740,q[Zi>>2]=2521,Y(4,1294,Zi),0),L=16+Zi|0,0|a},v:function(a){var Yi;return L=Yi=L-16|0,a=(a|=0)?q[a+552>>2]:(q[4+Yi>>2]=1740,q[Yi>>2]=2550,Y(4,1294,Yi),0),L=16+Yi|0,0|a},w:function(a){var Xi;return L=Xi=L-16|0,a=(a|=0)?q[a+4>>2]:(q[4+Xi>>2]=1740,q[Xi>>2]=2572,Y(4,1294,Xi),-1),L=16+Xi|0,0|a},x:function(a){var Wi;return L=Wi=L-16|0,a=(a|=0)?q[q[a>>2]+712>>2]:(q[4+Wi>>2]=1740,q[Wi>>2]=2588,Y(4,1294,Wi),0),L=16+Wi|0,0|a},y:function(a){var Vi;return L=Vi=L-16|0,a=(a|=0)?q[a+52>>2]:(q[4+Vi>>2]=1740,q[Vi>>2]=2602,Y(4,1294,Vi),0),L=16+Vi|0,0|a},z:function(a){var Ui;return L=Ui=L-16|0,a=(a|=0)?q[q[a>>2]+740>>2]:(q[4+Ui>>2]=1740,q[Ui>>2]=2622,Y(4,1294,Ui),0),L=16+Ui|0,0|a},A:function(a){var Ti;return L=Ti=L-16|0,a=(a|=0)?q[a+332>>2]:(q[4+Ti>>2]=1740,q[Ti>>2]=2650,Y(4,1294,Ti),-1),L=16+Ti|0,0|a},B:function(a){var Si;return L=Si=L-16|0,a=(a|=0)?q[q[a>>2]+832>>2]:(q[4+Si>>2]=1740,q[Si>>2]=2670,Y(4,1294,Si),0),L=16+Si|0,0|a},C:function(a){var Ri;return L=Ri=L-16|0,a=(a|=0)?q[q[a>>2]+888>>2]:(q[4+Ri>>2]=1740,q[Ri>>2]=2688,Y(4,1294,Ri),0),L=16+Ri|0,0|a},D:function(a){var Qi;return L=Qi=L-16|0,a=(a|=0)?q[a+432>>2]:(q[4+Qi>>2]=1740,q[Qi>>2]=2716,Y(4,1294,Qi),0),L=16+Qi|0,0|a},E:function(a){var Pi;return L=Pi=L-16|0,a=(a|=0)?q[q[a>>2]+884>>2]:(q[4+Pi>>2]=1740,q[Pi>>2]=2743,Y(4,1294,Pi),0),L=16+Pi|0,0|a},F:function(a){var Oi;return L=Oi=L-16|0,a=(a|=0)?q[a+440>>2]:(q[4+Oi>>2]=1740,q[Oi>>2]=2772,Y(4,1294,Oi),0),L=16+Oi|0,0|a},G:function(a){var Ni;return L=Ni=L-16|0,a=(a|=0)?q[a+436>>2]:(q[4+Ni>>2]=1740,q[Ni>>2]=2797,Y(4,1294,Ni),0),L=16+Ni|0,0|a},H:function(a){var Mi;return L=Mi=L-16|0,a=(a|=0)?q[a+448>>2]:(q[4+Mi>>2]=1740,q[Mi>>2]=2824,Y(4,1294,Mi),0),L=16+Mi|0,0|a},I:function(a){var Li;return L=Li=L-16|0,a=(a|=0)?q[q[a>>2]+912>>2]:(q[4+Li>>2]=1740,q[Li>>2]=2848,Y(4,1294,Li),0),L=16+Li|0,0|a},J:function(a){var Ki;return L=Ki=L-16|0,a=(a|=0)?q[q[a>>2]+844>>2]:(q[4+Ki>>2]=1740,q[Ki>>2]=2873,Y(4,1294,Ki),0),L=16+Ki|0,0|a},K:function(a){var Ji;return L=Ji=L-16|0,a=(a|=0)?q[q[a>>2]+892>>2]:(q[4+Ji>>2]=1740,q[Ji>>2]=2893,Y(4,1294,Ji),0),L=16+Ji|0,0|a},L:function(a){var Ii;return L=Ii=L-16|0,a=(a|=0)?q[a+444>>2]:(q[4+Ii>>2]=1740,q[Ii>>2]=2920,Y(4,1294,Ii),0),L=16+Ii|0,0|a},M:function(a){var si;return L=si=L-16|0,a=(a|=0)?q[q[a>>2]+836>>2]:(q[4+si>>2]=1740,q[si>>2]=2950,Y(4,1294,si),0),L=16+si|0,0|a},N:function(a){var ri;return L=ri=L-16|0,a=(a|=0)?q[q[a>>2]+904>>2]:(q[4+ri>>2]=1740,q[ri>>2]=2974,Y(4,1294,ri),0),L=16+ri|0,0|a},O:function(a){var qi;return L=qi=L-16|0,a=(a|=0)?q[q[a>>2]+840>>2]:(q[4+qi>>2]=1740,q[qi>>2]=3e3,Y(4,1294,qi),0),L=16+qi|0,0|a},P:function(a){var pi;return L=pi=L-16|0,a=(a|=0)?q[a+452>>2]:(q[4+pi>>2]=1740,q[pi>>2]=3022,Y(4,1294,pi),0),L=16+pi|0,0|a},Q:function(a){var oi;return L=oi=L-16|0,a=(a|=0)?q[a+456>>2]:(q[4+oi>>2]=1740,q[oi>>2]=3051,Y(4,1294,oi),0),L=16+oi|0,0|a},R:function(a){var ni;return L=ni=L-16|0,a=(a|=0)?q[q[a>>2]+876>>2]:(q[4+ni>>2]=1740,q[ni>>2]=3078,Y(4,1294,ni),0),L=16+ni|0,0|a},S:function(a){var mi;L=mi=L-16|0,(a|=0)?q[a+428>>2]=1:(q[4+mi>>2]=1740,q[mi>>2]=3110,Y(4,1294,mi)),L=16+mi|0},T:function(a){var li;return L=li=L-16|0,a=(a|=0)?q[a+640>>2]:(q[4+li>>2]=1740,q[li>>2]=3139,Y(4,1294,li),0),L=16+li|0,0|a},U:function(a){var ji;return L=ji=L-16|0,a=(a|=0)?q[a+636>>2]:(q[4+ji>>2]=1740,q[ji>>2]=3164,Y(4,1294,ji),0),L=16+ji|0,0|a},V:function(a){var Fc;return oa(12+(L=Fc=L-16|0)|0,64,a|=0),L=16+Fc|0,q[12+Fc>>2]},W:function(a){var Ec,Cc,Dc=0;return L=Cc=L-16|0,!(a|=0)||oa(12+Cc|0,16,Ec=xa(a))||(Dc=wa(a,q[12+Cc>>2],Ec))||(pa(q[12+Cc>>2]),Dc=0),L=16+Cc|0,0|Dc},X:function(a){return 0|qa(a|=0)},Y:function(a){pa(a|=0)},Z:function(a){var Sm;oa(12+(L=Sm=L-16|0)|0,64,a|=0),pa(q[12+Sm>>2]),L=16+Sm|0},_:function(){return 0|L},$:function(a){return 0|(L=L-(0|a)&-16)},aa:function(a){L=0|a},ba:function(a){return 0|(a=0|(a|=0),(P=0|N())<(a=P+(a|=0)|0)&&a<65536&&(a=new ArrayBuffer(w(a,65536)),(S=new global.Int8Array(a)).set(o),o=S,o=new global.Int8Array(a),p=new global.Int16Array(a),q=new global.Int32Array(a),r=new global.Uint8Array(a),s=new global.Uint16Array(a),t=new global.Uint32Array(a),u=new global.Float32Array(a),v=new global.Float64Array(a),buffer=a,m.buffer=a),P);var S,P},ca:function(a,Vk){n[a|=0](Vk|=0)}};function X(a,b,c){var e,f,d=0;if(c)for(;;){if(c=c+-1|0,a>>>0<(d=(e=a+b|0)-1|0)>>>0)for(;f=r[0|a],o[0|a]=r[0|d],o[0|d]=f,(a=a+1|0)>>>0<(d=d+-1|0)>>>0;);if(a=e,!c)break}}function Y(a,b,c){var g;L=g=L-272|0,t[1804]>a>>>0||(a=q[1805])&&(Ka(16+g|0,b,q[12+g>>2]=c),n[a](16+g|0)),L=272+g|0}function Z(a,b,c){32&r[0|a]||!function(a,Rm,Sm){var Tm=0,Um=0,tn=0;a:{if(!(Tm=q[Sm+16>>2])){if(function(a){var Rm;return Rm=r[a+74|0],o[a+74|0]=Rm+-1|Rm,8&(Rm=q[a>>2])?(q[a>>2]=32|Rm,1):(q[a+4>>2]=0,q[a+8>>2]=0,Rm=q[a+44>>2],q[a+28>>2]=Rm,q[a+20>>2]=Rm,q[a+16>>2]=Rm+q[a+48>>2],0)}(Sm))break a;Tm=q[Sm+16>>2]}if(Tm-(tn=q[Sm+20>>2])>>>0>>0)return n[q[Sm+36>>2]](Sm,a,Rm);b:if(!(o[Sm+75|0]<0)){for(Tm=Rm;;){if(!(Um=Tm))break b;if(10==r[(Tm=Um+-1|0)+a|0])break}if(n[q[Sm+36>>2]](Sm,a,Um)>>>0>>0)break a;Rm=Rm-Um|0,a=a+Um|0,tn=q[Sm+20>>2]}$(tn,a,Rm),q[Sm+20>>2]=q[Sm+20>>2]+Rm}}(b,c,a)}function _(a,b,c,h,i){var k,l,j;if(L=j=L-256|0,!(73728&i|(0|c)<=(0|h))){if(ca(j,b,(k=(i=c-h|0)>>>0<256)?i:256),b=a,l=j,!k){for(c=c-h|0;Z(a,j,256),255<(i=i+-256|0)>>>0;);i=255&c}Z(b,l,i)}L=256+j|0}function $(a,b,c){var h,i=0;if(8192<=c>>>0)I(0|a,0|b,0|c);else{if(h=a+c|0,3&(a^b))if(h>>>0<4)c=a;else if((i=h-4|0)>>>0>>0)c=a;else for(c=a;o[0|c]=r[0|b],o[c+1|0]=r[b+1|0],o[c+2|0]=r[b+2|0],o[c+3|0]=r[b+3|0],b=b+4|0,(c=c+4|0)>>>0<=i>>>0;);else{b:if((0|c)<1)c=a;else if(3&a)for(c=a;;){if(o[0|c]=r[0|b],b=b+1|0,h>>>0<=(c=c+1|0)>>>0)break b;if(!(3&c))break}else c=a;if(!((a=-4&h)>>>0<64||(i=a+-64|0)>>>0>>0))for(;q[c>>2]=q[b>>2],q[c+4>>2]=q[b+4>>2],q[c+8>>2]=q[b+8>>2],q[c+12>>2]=q[b+12>>2],q[c+16>>2]=q[b+16>>2],q[c+20>>2]=q[b+20>>2],q[c+24>>2]=q[b+24>>2],q[c+28>>2]=q[b+28>>2],q[c+32>>2]=q[b+32>>2],q[c+36>>2]=q[b+36>>2],q[c+40>>2]=q[b+40>>2],q[c+44>>2]=q[b+44>>2],q[c+48>>2]=q[b+48>>2],q[c+52>>2]=q[b+52>>2],q[c+56>>2]=q[b+56>>2],q[c+60>>2]=q[b+60>>2],b=b- -64|0,(c=c- -64|0)>>>0<=i>>>0;);if(!(a>>>0<=c>>>0))for(;q[c>>2]=q[b>>2],b=b+4|0,(c=c+4|0)>>>0>>0;);}if(c>>>0>>0)for(;o[0|c]=r[0|b],b=b+1|0,(0|h)!=(0|(c=c+1|0)););}}function aa(a){var b,c;return x((b=a*a)*b*(c=b*a)*(2718311493989822e-21*b-.00019839334836096632)+(c*(.008333329385889463*b-.16666666641626524)+a))}function ba(a){var m;return x(-.499999997251031*(a*=a)+1+.04166662332373906*(m=a*a)+a*m*(2439044879627741e-20*a-.001388676377460993))}function ca(a,n,p){var r,s,t,u;if(p&&(o[(r=a+p|0)-1|0]=n,o[0|a]=n,!(p>>>0<3||(o[r-2|0]=n,o[a+1|0]=n,o[r-3|0]=n,o[a+2|0]=n,p>>>0<7)||(o[r-4|0]=n,o[a+3|0]=n,p>>>0<9)||(s=(r=0-a&3)+a|0,n=w(255&n,16843009),q[s>>2]=n,q[(r=(p=p-r&-4)+s|0)-4>>2]=n,p>>>0<9)||(q[8+s>>2]=n,q[4+s>>2]=n,q[r-8>>2]=n,q[r-12>>2]=n,p>>>0<25)||(q[24+s>>2]=n,q[20+s>>2]=n,q[16+s>>2]=n,q[12+s>>2]=n,q[r-16>>2]=n,q[r-20>>2]=n,q[r-24>>2]=n,q[r-28>>2]=n,(p=p-(u=4&s|24)|0)>>>0<32))))for(t=r=n,n=s+u|0;q[n+24>>2]=t,q[n+28>>2]=r,q[n+16>>2]=t,q[n+20>>2]=r,q[n+8>>2]=t,q[n+12>>2]=r,q[n>>2]=t,q[n+4>>2]=r,n=n+32|0,31<(p=p+-32|0)>>>0;);return a}function da(a,n){var p;if(a>>>0<(n=(a+n|0)-1|0)>>>0)for(;p=r[0|a],o[0|a]=r[0|n],o[0|n]=p,(a=a+1|0)>>>0<(n=n+-1|0)>>>0;);}function ea(a){var n,o=N();return(a=(n=q[2216])+a|0)>>>0<=o<<16>>>0||J(0|a)?(q[2216]=a,n):(q[2086]=48,-1)}function fa(a,v,y,z,B,C,D){var H,I,K,N,Q,R,S,O,P,J,E=0,F=x(0),G=x(0),M=x(0);if(x(0),x(0),x(0),x(0),L=J=L-16|0,1<=(0|a))for(R=w(a,12)+v|0;;){if(1<=(0|(I=q[v+4>>2])))for(S=(a=q[v+8>>2])+w(I,48)|0,I=(H=q[v>>2]<<4)+D|0,K=(8|H)+D|0,H=(4|H)+D|0;(E=q[a+8>>2])&&((O=E+-1|0)>>>0<=1?(P=(q[a+4>>2]<<2)+y|0,E=q[P+(q[a+12>>2]<<2)>>2]<<2,F=u[E+C>>2],Q=u[B+E>>2],G=u[z+E>>2],O-1?(M=G,G=u[a+20>>2],u[I>>2]=u[I>>2]+x(u[a+44>>2]*x(M*G)),u[H>>2]=u[H>>2]+x(x(Q*G)*u[a+44>>2]),u[K>>2]=u[K>>2]+x(x(F*G)*u[a+44>>2])):(E=q[(q[a+16>>2]<<2)+P>>2]<<2,O=u[E+C>>2],P=u[B+E>>2],M=G,G=u[a+20>>2],N=u[a+24>>2],u[I>>2]=u[I>>2]+x(u[a+44>>2]*x(x(M*G)+x(u[z+E>>2]*N))),u[H>>2]=u[H>>2]+x(x(x(Q*G)+x(P*N))*u[a+44>>2]),u[K>>2]=u[K>>2]+x(x(x(F*G)+x(O*N))*u[a+44>>2]))):(q[J>>2]=E,Y(4,1024,J))),(a=a+48|0)>>>0>>0;);if(a=(q[v>>2]<<4)+D|0,F=u[a>>2],u[a>>2]=F>2],u[a+4>>2]=F>2],u[a+8>>2]=F>>0>>0))break}L=16+J|0}function ga(a,q,v){var y,z,x=0;if(1==(0|q)&a>>>0<0|q>>>0<1)x=a;else for(;y=bd(x=cd(a,q,10),z=M,10),o[0|(v=v+-1|0)]=a-y|48,y=9==(0|q)&4294967295>>0|9>>0,a=x,q=z,y;);if(x)for(;o[0|(v=v+-1|0)]=x-w(a=(x>>>0)/10|0,10)|48,q=9>>0,x=a,q;);return v}function ha(a){return a+-48>>>0<10}function ia(a){var q;return(q=La(a,64))?q-a|0:64}function ja(a,v){var w=0;return 1024<=(0|v)?(a*=898846567431158e293,v=(0|(w=v+-1023|0))<1024?w:(a*=898846567431158e293,((0|v)<3069?v:3069)+-2046|0)):-1023<(0|v)||(a*=22250738585072014e-324,v=-1023<(0|(w=v+1022|0))?w:(a*=22250738585072014e-324,(-3066<(0|v)?v:-3066)+2044|0)),f(0,0),f(1,v+1023<<20),a*+g()}function ka(a,v){var A=0,C=a,B=v>>>0<=31?(A=q[a+4>>2],q[a>>2]):(A=q[a>>2],q[a+4>>2]=A,v=v+-32|(q[a>>2]=0),0);q[C>>2]=B<>2]=A<>>32-v}function la(a,v,D,V,W){var X,Y=0,Z=0,_=0;L=X=L-240|0,Y=q[v>>2],q[232+X>>2]=Y,v=q[v+4>>2],q[X>>2]=a,Z=1;a:{b:{c:{if(((q[236+X>>2]=v)||1!=(0|Y))&&(Y=a-q[(D<<2)+W>>2]|0,!((0|n[5](Y,a))<1))){for(_=!V;;){e:{if(v=Y,!(!_|(0|D)<2)){if(V=q[((D<<2)+W|0)-8>>2],-1<(0|n[5](Y=a+-4|0,v)))break e;if(-1<(0|n[5](Y-V|0,v)))break e}if(q[(Z<<2)+X>>2]=v,Z=Z+1|0,ma(232+X|0,a=Oa(232+X|0)),D=a+D|0,!q[236+X>>2]&&1==q[232+X>>2])break b;if(_=1,Y=(a=v)-q[(D<<2)+W>>2]|(V=0),0<(0|n[5](Y,q[X>>2])))continue;break c}break}v=a;break b}v=a}if(V)break a}Na(X,Z),ta(v,D,W)}L=240+X|0}function ma(a,v){var D=0,V=a,L=v>>>0<=31?(D=q[a>>2],q[a+4>>2]):(D=q[a+4>>2],q[a+4>>2]=0,q[a>>2]=D,v=v+-32|0,0);q[V+4>>2]=L>>>v,q[a>>2]=L<<32-v|D>>>v}function na(a,v){var W=r[a+4|0];q[v>>2]=q[a+64>>2]+a,q[v+4>>2]=q[a+68>>2]+a,q[v+8>>2]=q[a+72>>2]+a,q[v+12>>2]=q[a+76>>2]+a,q[v+16>>2]=q[a+80>>2]+a,q[v+20>>2]=q[a+84>>2]+a,q[v+24>>2]=q[a+88>>2]+a,q[v+28>>2]=q[a+92>>2]+a,q[v+32>>2]=q[a+96>>2]+a,q[v+36>>2]=q[a+100>>2]+a,q[v+40>>2]=q[a+104>>2]+a,q[v+44>>2]=q[a+108>>2]+a,q[v+48>>2]=q[a+112>>2]+a,q[v+52>>2]=q[a+116>>2]+a,q[v+56>>2]=q[a+120>>2]+a,q[v+60>>2]=q[a+124>>2]+a,q[v- -64>>2]=q[a+128>>2]+a,q[v+68>>2]=q[a+132>>2]+a,q[v+72>>2]=q[a+136>>2]+a,q[v+76>>2]=q[a+140>>2]+a,q[v+80>>2]=q[a+144>>2]+a,q[v+84>>2]=q[a+148>>2]+a,q[v+92>>2]=q[a+152>>2]+a,q[v+96>>2]=q[a+156>>2]+a,q[v+100>>2]=q[a+160>>2]+a,q[v+108>>2]=q[a+164>>2]+a,q[v+112>>2]=q[a+168>>2]+a,q[v+116>>2]=q[a+172>>2]+a,q[v+124>>2]=q[a+176>>2]+a,q[v+128>>2]=q[a+180>>2]+a,q[v+132>>2]=q[a+184>>2]+a,q[v+136>>2]=q[a+188>>2]+a,q[v+140>>2]=q[a+192>>2]+a,q[v+144>>2]=q[a+196>>2]+a,q[v+148>>2]=q[a+200>>2]+a,q[v+152>>2]=q[a+204>>2]+a,q[v+156>>2]=q[a+208>>2]+a,q[v+164>>2]=q[a+212>>2]+a,q[v+168>>2]=q[a+216>>2]+a,q[v+172>>2]=q[a+220>>2]+a,q[v+176>>2]=q[a+224>>2]+a,q[v+180>>2]=q[a+228>>2]+a,q[v+184>>2]=q[a+232>>2]+a,q[v+188>>2]=q[a+236>>2]+a,q[v+192>>2]=q[a+240>>2]+a,q[v+196>>2]=q[a+244>>2]+a,q[v+200>>2]=q[a+248>>2]+a,q[v+204>>2]=q[a+252>>2]+a,q[v+208>>2]=q[a+256>>2]+a,q[v+212>>2]=q[a+260>>2]+a,q[v+216>>2]=q[a+264>>2]+a,q[v+220>>2]=q[a+268>>2]+a,q[v+224>>2]=q[a+272>>2]+a,q[v+228>>2]=q[a+276>>2]+a,q[v+232>>2]=q[a+280>>2]+a,q[v+236>>2]=q[a+284>>2]+a,q[v+244>>2]=q[a+288>>2]+a,q[v+248>>2]=q[a+292>>2]+a,q[v+272>>2]=q[a+296>>2]+a,q[v+276>>2]=q[a+300>>2]+a,q[v+280>>2]=q[a+304>>2]+a,q[v+292>>2]=q[a+308>>2]+a,q[v+296>>2]=q[a+312>>2]+a,q[v+300>>2]=q[a+316>>2]+a,q[v+304>>2]=q[a+320>>2]+a,q[v+308>>2]=q[a+324>>2]+a,q[v+312>>2]=q[a+328>>2]+a,q[v+316>>2]=q[a+332>>2]+a,q[v+328>>2]=q[a+336>>2]+a,q[v+332>>2]=q[a+340>>2]+a,q[v+336>>2]=q[a+344>>2]+a,q[v+348>>2]=q[a+348>>2]+a,q[v+360>>2]=q[a+352>>2]+a,q[v+364>>2]=q[a+356>>2]+a,q[v+368>>2]=q[a+360>>2]+a,q[v+352>>2]=q[a+364>>2]+a,q[v+356>>2]=q[a+368>>2]+a,q[v+488>>2]=q[a+372>>2]+a,q[v+492>>2]=q[a+376>>2]+a,q[v+496>>2]=q[a+380>>2]+a,q[v+500>>2]=q[a+384>>2]+a,q[v+504>>2]=q[a+388>>2]+a,q[v+508>>2]=q[a+392>>2]+a,q[v+512>>2]=q[a+396>>2]+a,q[v+516>>2]=q[a+400>>2]+a,q[v+520>>2]=q[a+404>>2]+a,q[v+524>>2]=q[a+408>>2]+a,q[v+528>>2]=q[a+412>>2]+a,q[v+532>>2]=q[a+416>>2]+a,q[v+536>>2]=q[a+420>>2]+a,q[v+540>>2]=q[a+424>>2]+a,q[v+544>>2]=q[a+428>>2]+a,q[v+548>>2]=q[a+432>>2]+a,q[v+552>>2]=q[a+436>>2]+a,q[v+556>>2]=q[a+440>>2]+a,q[v+560>>2]=q[a+444>>2]+a,q[v+564>>2]=q[a+448>>2]+a,q[v+568>>2]=q[a+452>>2]+a,q[v+572>>2]=q[a+456>>2]+a,q[v+576>>2]=q[a+460>>2]+a,q[v+580>>2]=q[a+464>>2]+a,W>>>0<2||(q[v+104>>2]=q[a+468>>2]+a,W>>>0<4)||(q[v+260>>2]=q[a+472>>2]+a,q[v+264>>2]=q[a+476>>2]+a,q[v+268>>2]=q[a+480>>2]+a,q[v+88>>2]=q[a+484>>2]+a,q[v+120>>2]=q[a+488>>2]+a,q[v+160>>2]=q[a+492>>2]+a,q[v+584>>2]=q[a+496>>2]+a,q[v+588>>2]=q[a+500>>2]+a,q[v+592>>2]=q[a+504>>2]+a,q[v+596>>2]=q[a+508>>2]+a,q[v+600>>2]=q[a+512>>2]+a,q[v+604>>2]=q[a+516>>2]+a,q[v+240>>2]=q[a+520>>2]+a,q[v+252>>2]=q[a+524>>2]+a,q[v+256>>2]=q[a+528>>2]+a,q[v+372>>2]=q[a+532>>2]+a,q[v+376>>2]=q[a+536>>2]+a,q[v+380>>2]=q[a+540>>2]+a,q[v+384>>2]=q[a+544>>2]+a,q[v+388>>2]=q[a+548>>2]+a,q[v+392>>2]=q[a+552>>2]+a,q[v+396>>2]=q[a+556>>2]+a,q[v+400>>2]=q[a+560>>2]+a,q[v+416>>2]=q[a+564>>2]+a,q[v+420>>2]=q[a+568>>2]+a,q[v+424>>2]=q[a+572>>2]+a,q[v+440>>2]=q[a+576>>2]+a,q[v+444>>2]=q[a+580>>2]+a,q[v+448>>2]=q[a+584>>2]+a,q[v+464>>2]=q[a+588>>2]+a,q[v+468>>2]=q[a+592>>2]+a,q[v+472>>2]=q[a+596>>2]+a,q[v+476>>2]=q[a+600>>2]+a,q[v+480>>2]=q[a+604>>2]+a,q[v+484>>2]=q[a+608>>2]+a,4!=(0|W)&&(q[v+284>>2]=q[a+612>>2]+a,q[v+288>>2]=q[a+616>>2]+a,q[v+320>>2]=q[a+620>>2]+a,q[v+324>>2]=q[a+624>>2]+a,q[v+340>>2]=q[a+628>>2]+a,q[v+344>>2]=q[a+632>>2]+a,q[v+404>>2]=q[a+636>>2]+a,q[v+408>>2]=q[a+640>>2]+a,q[v+412>>2]=q[a+644>>2]+a,q[v+428>>2]=q[a+648>>2]+a,q[v+432>>2]=q[a+652>>2]+a,q[v+436>>2]=q[a+656>>2]+a,q[v+452>>2]=q[a+660>>2]+a,q[v+456>>2]=q[a+664>>2]+a,q[v+460>>2]=q[a+668>>2]+a))}function oa(a,v,$){var aa=0;a:{if(8==(0|v))v=qa($);else{if(aa=28,3&v|1!=(0|function(a){for(var $o=0,ap=0;ap=$o,a;)a&=a-1,$o=$o+1|0;return ap}(v>>>2)))break a;if(aa=48,-64-v>>>0<$>>>0)break a;v=function(a,Vk){var vl,wl,ql=0,tl=0,ul=0;if((tl=a>>>0>(ql=16)?a:16)+-1&tl)for(;ql=(a=ql)<<1,a>>>0>>0;);else a=tl;return-64-a>>>0<=Vk>>>0?(q[2086]=48,0):(ql=qa(12+((tl=Vk>>>0<11?16:Vk+11&-8)+a|0)|0))?(Vk=ql+-8|0,ql&a+-1?(ul=(-8&(wl=q[(vl=ql+-4|0)>>2]))-(ql=(a=15<(ql=((a+ql|0)-1&0-a)-8|0)-Vk>>>0?ql:a+ql|0)-Vk|0)|0,3&wl?(q[a+4>>2]=ul|1&q[a+4>>2]|2,q[4+(ul=a+ul|0)>>2]=1|q[4+ul>>2],q[vl>>2]=ql|1&q[vl>>2]|2,q[a+4>>2]=1|q[a+4>>2],za(Vk,ql)):(Vk=q[Vk>>2],q[a+4>>2]=ul,q[a>>2]=Vk+ql)):a=Vk,3&(Vk=q[a+4>>2])&&((ql=-8&Vk)>>>0<=tl+16>>>0||(q[a+4>>2]=tl|1&Vk|2,q[(Vk=a+tl|0)+4>>2]=3|(tl=ql-tl|0),q[4+(ql=a+ql|0)>>2]=1|q[ql+4>>2],za(Vk,tl))),a+8|0):0}(16>>0?v:16,$)}if(!v)return 1;q[a>>2]=v,aa=0}return aa}function pa(a){var da,v=0,$=0,ba=0,ca=0,ea=0,fa=0,ha=0;a:if(a){da=(ba=a+-8|0)+(a=-8&($=q[a+-4>>2]))|0;b:if(!(1&$)){if(!(3&$))break a;if((ba=ba-($=q[ba>>2])|0)>>>0>>0<=255)ca=q[ba+8>>2],$>>>=3,(0|(v=q[ba+12>>2]))==(0|ca)?(ha=q[2087]&ed($),q[2087]=ha):(q[ca+12>>2]=v,q[v+8>>2]=ca);else{if(fa=q[ba+24>>2],(0|ba)!=(0|($=q[ba+12>>2])))v=q[ba+8>>2],q[v+12>>2]=$,q[$+8>>2]=v;else if(v=(v=q[(ca=ba+20|0)>>2])||q[(ca=ba+16|0)>>2]){for(;ea=ca,(v=q[(ca=($=v)+20|0)>>2])||(ca=$+16|0,v=q[$+16>>2]););q[ea>>2]=0}else $=0;if(fa){ca=q[ba+28>>2];e:{if(q[(v=8652+(ca<<2)|0)>>2]==(0|ba)){if(q[v>>2]=$)break e;ha=q[2088]&ed(ca),q[2088]=ha;break b}if(!(q[fa+(q[fa+16>>2]==(0|ba)?16:20)>>2]=$))break b}q[$+24>>2]=fa,(v=q[ba+16>>2])&&(q[$+16>>2]=v,q[v+24>>2]=$),(v=q[ba+20>>2])&&(q[$+20>>2]=v,q[v+24>>2]=$)}}else if(3==(3&($=q[4+da>>2])))return q[2089]=a,q[4+da>>2]=-2&$,q[ba+4>>2]=1|a,q[a+ba>>2]=a}if(!(da>>>0<=ba>>>0)&&1&($=q[4+da>>2])){f:{if(!(2&$)){if(q[2093]==(0|da)){if(q[2093]=ba,a=q[2090]+a|0,q[2090]=a,q[ba+4>>2]=1|a,q[2092]!=(0|ba))break a;return q[2089]=0,q[2092]=0}if(q[2092]==(0|da))return q[2092]=ba,a=q[2089]+a|0,q[2089]=a,q[ba+4>>2]=1|a,q[a+ba>>2]=a;a=(-8&$)+a|0;g:if($>>>0<=255)$>>>=3,(0|(v=q[8+da>>2]))==(0|(ca=q[12+da>>2]))?(ha=q[2087]&ed($),q[2087]=ha):(q[v+12>>2]=ca,q[ca+8>>2]=v);else{if(fa=q[24+da>>2],(0|da)!=(0|($=q[12+da>>2])))v=q[8+da>>2],q[v+12>>2]=$,q[$+8>>2]=v;else if(v=(v=q[(ca=20+da|0)>>2])||q[(ca=16+da|0)>>2]){for(;ea=ca,(v=q[(ca=($=v)+20|0)>>2])||(ca=$+16|0,v=q[$+16>>2]););q[ea>>2]=0}else $=0;if(fa){ca=q[28+da>>2];j:{if(q[(v=8652+(ca<<2)|0)>>2]==(0|da)){if(q[v>>2]=$)break j;ha=q[2088]&ed(ca),q[2088]=ha;break g}if(!(q[fa+(q[fa+16>>2]==(0|da)?16:20)>>2]=$))break g}q[$+24>>2]=fa,(v=q[16+da>>2])&&(q[$+16>>2]=v,q[v+24>>2]=$),(v=q[20+da>>2])&&(q[$+20>>2]=v,q[v+24>>2]=$)}}if(q[ba+4>>2]=1|a,q[a+ba>>2]=a,q[2092]!=(0|ba))break f;return q[2089]=a}q[4+da>>2]=-2&$,q[ba+4>>2]=1|a,q[a+ba>>2]=a}if(a>>>0<=255)return $=8388+((a>>>=3)<<3)|0,a=(v=q[2087])&(a=1<>2]:(q[2087]=a|v,$),q[$+8>>2]=ba,q[a+12>>2]=ba,q[ba+12>>2]=$,q[ba+8>>2]=a;q[ba+16>>2]=0,v=q[ba+20>>2]=0,(ca=a>>>8)&&(v=31,16777215>>0||(v=ca,v=28+((v=((v=(v<<=ca=ca+1048320>>>16&8)<<(fa=v+520192>>>16&4))<<(ea=v+245760>>>16&2)>>>15)-(ea|ca|fa)|0)<<1|a>>>v+21&1)|0)),ea=8652+((q[($=ba)+28>>2]=v)<<2)|0;m:if((ca=q[2088])&($=1<>>1)|0),$=q[ea>>2];n:{for(;;){if((-8&q[(v=$)+4>>2])==(0|a))break n;if($=ca>>>29,ca<<=1,!($=q[16+(ea=v+(4&$)|0)>>2]))break}q[ea+16>>2]=ba,q[ba+12>>2]=ba,q[ba+24>>2]=v,q[ba+8>>2]=ba;break m}a=q[v+8>>2],q[a+12>>2]=ba,q[v+8>>2]=ba,q[ba+24>>2]=0,q[ba+12>>2]=v,q[ba+8>>2]=a}else q[2088]=$|ca,q[ea>>2]=ba,q[ba+12>>2]=ba,q[ba+24>>2]=ea,q[ba+8>>2]=ba;if(a=q[2095]+-1|0,!(q[2095]=a)){for(ba=8804;ba=(a=q[ba>>2])+8|0,a;);q[2095]=-1}}}}function qa(a){var sa,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,ua=0;L=sa=L-16|0;a:{b:{c:{d:{e:{f:{g:{h:{i:{j:{k:{if(a>>>0<=244){if(3&(ia=(ma=q[2087])>>>(a=(na=a>>>0<11?16:a+11&-8)>>>3))){a=(ia=q[8396+(la=(ja=a+(1&(-1^ia))|0)<<3)>>2])+8|0,(0|(ka=q[ia+8>>2]))==(0|(la=la+8388|0))?(ua=ed(ja)&ma,q[2087]=ua):(q[ka+12>>2]=la,q[la+8>>2]=ka),q[ia+4>>2]=3|(ja<<=3),q[4+(ia=ia+ja|0)>>2]=1|q[ia+4>>2];break a}if(na>>>0<=(pa=q[2089])>>>0)break k;if(ia){ja=ia=(a=(0-(a=(0-(ja=2<>>12&16,ia=q[8396+(ka=(ja=((ja=(ja|=ia=(a>>>=ia)>>>5&8)|(ia=(a>>>=ia)>>>2&4)|(ia=(a>>>=ia)>>>1&2))|(ia=(a>>>=ia)>>>1&1))+(a>>>ia)|0)<<3)>>2],(0|(a=q[ia+8>>2]))==(0|(ka=ka+8388|0))?(ma=ed(ja)&ma,q[2087]=ma):(q[a+12>>2]=ka,q[ka+8>>2]=a),a=ia+8|0,q[ia+4>>2]=3|na,q[4+(oa=ia+na|0)>>2]=1|(la=(ja<<=3)-na|0),q[ia+ja>>2]=la,pa&&(ia=8388+((ja=pa>>>3)<<3)|0,ka=q[2092],ja=(ja=1<>2]:(q[2087]=ja|ma,ia),q[ia+8>>2]=ka,q[ja+12>>2]=ka,q[ka+12>>2]=ia,q[ka+8>>2]=ja),q[2092]=oa,q[2089]=la;break a}if(!(ra=q[2088]))break k;for(ja=ia=(a=(ra&0-ra)-1|0)>>>12&16,ia=q[8652+(((ja=(ja|=ia=(a>>>=ia)>>>5&8)|(ia=(a>>>=ia)>>>2&4)|(ia=(a>>>=ia)>>>1&2))|(ia=(a>>>=ia)>>>1&1))+(a>>>ia)<<2)>>2],ka=(-8&q[ia+4>>2])-na|0,ja=ia;a=(a=q[ja+16>>2])||q[ja+20>>2];)ka=(ja=(la=(-8&q[a+4>>2])-na|0)>>>0>>0)?la:ka,ia=ja?a:ia,ja=a;if(qa=q[ia+24>>2],(0|(la=q[ia+12>>2]))!=(0|ia)){a=q[ia+8>>2],q[a+12>>2]=la,q[la+8>>2]=a;break b}if(!(a=q[(ja=ia+20|0)>>2])){if(!(a=q[ia+16>>2]))break j;ja=ia+16|0}for(;oa=ja,(a=q[(ja=(la=a)+20|0)>>2])||(ja=la+16|0,a=q[la+16>>2]););q[oa>>2]=0;break b}if(na=-1,!(4294967231>>0)&&(na=-8&(ia=a+11|0),pa=q[2088])){ja=0-na|0,ma=0,(ia>>>=8)&&(ma=31,16777215>>0||(ma=28+((a=((ma=(ia<<=ka=ia+1048320>>>16&8)<<(a=ia+520192>>>16&4))<<(ia=ma+245760>>>16&2)>>>15)-(ia|a|ka)|0)<<1|na>>>a+21&1)|0));q:{r:{if(ka=q[8652+(ma<<2)>>2])for(ia=na<<(31==(0|ma)?0:25-(ma>>>1)|0),a=0;;){if(!(ja>>>0<=(oa=(-8&q[ka+4>>2])-na|0)>>>0||(la=ka,ja=oa))){ja=0,a=ka;break r}if(oa=q[ka+20>>2],ka=q[16+((ia>>>29&4)+ka|0)>>2],a=oa&&(0|oa)!=(0|ka)?oa:a,ia<<=0!=(0|ka),!ka)break}else a=0;if(!(a|la)){if(!(a=(0-(a=2<>>12&16,a=q[8652+(((ka=(ka|=ia=(a>>>=ia)>>>5&8)|(ia=(a>>>=ia)>>>2&4)|(ia=(a>>>=ia)>>>1&2))|(ia=(a>>>=ia)>>>1&1))+(a>>>ia)<<2)>>2]}if(!a)break q}for(;ja=(ia=(ka=(-8&q[a+4>>2])-na|0)>>>0>>0)?ka:ja,la=ia?a:la,a=(ia=q[a+16>>2])||q[a+20>>2];);}if(!(!la|ja>>>0>=q[2089]-na>>>0)){if(oa=q[la+24>>2],(0|la)!=(0|(ia=q[la+12>>2]))){a=q[la+8>>2],q[a+12>>2]=ia,q[ia+8>>2]=a;break c}if(!(a=q[(ka=la+20|0)>>2])){if(!(a=q[la+16>>2]))break i;ka=la+16|0}for(;ma=ka,(a=q[(ka=(ia=a)+20|0)>>2])||(ka=ia+16|0,a=q[ia+16>>2]););q[ma>>2]=0;break c}}}if(na>>>0<=(ia=q[2089])>>>0){a=q[2092],16<=(ja=ia-na|0)>>>0?(q[2089]=ja,q[2092]=ka=a+na|0,q[ka+4>>2]=1|ja,q[a+ia>>2]=ja,q[a+4>>2]=3|na):(q[2092]=0,q[2089]=0,q[a+4>>2]=3|ia,q[4+(ia=a+ia|0)>>2]=1|q[ia+4>>2]),a=a+8|0;break a}if(na>>>0<(ka=q[2090])>>>0){q[2090]=ia=ka-na|0,a=q[2093],q[2093]=ja=a+na|0,q[ja+4>>2]=1|ia,q[a+4>>2]=3|na,a=a+8|0;break a}if((ja=(ma=(ja=la=na+47|(a=0))+(ia=q[2205]?q[2207]:(q[2208]=-1,q[2209]=-1,q[2206]=4096,q[2207]=4096,q[2205]=12+sa&-16^1431655768,q[2210]=0,q[2198]=0,4096))|0)&(oa=0-ia|0))>>>0<=na>>>0)break a;if((ia=q[2197])&&(qa=(pa=q[2195])+ja|0)>>>0<=pa>>>0|ia>>>0>>0)break a;if(4&r[8792])break f;v:{w:{if(ia=q[2093])for(a=8796;;){if((pa=q[a>>2])+q[a+4>>2]>>>0>ia>>>0&&pa>>>0<=ia>>>0)break w;if(!(a=q[a+8>>2]))break}if(-1==(0|(ia=ea(0))))break g;if(ma=ja,(ma=(ka=(a=q[2206])+-1|0)&ia?(ja-ia|0)+(ia+ka&0-a)|0:ma)>>>0<=na>>>0|2147483646>>0)break g;if((a=q[2197])&&(oa=(ka=q[2195])+ma|0)>>>0<=ka>>>0|a>>>0>>0)break g;if((0|ia)!=(0|(a=ea(ma))))break v;break e}if(2147483646<(ma=oa&ma-ka)>>>0)break g;if((0|(ia=ea(ma)))==(q[a>>2]+q[a+4>>2]|0))break h;a=ia}if(!(na+48>>>0<=ma>>>0|2147483646>>0|-1==(0|(ia=a)))){if(2147483646<(a=(a=q[2207])+(la-ma|0)&0-a)>>>0)break e;if(-1!=(0|ea(a))){ma=a+ma|0;break e}ea(0-ma|0);break g}if(-1!=(0|ia))break e;break g}la=0;break b}ia=0;break c}if(-1!=(0|ia))break e}q[2198]=4|q[2198]}if(2147483646>>0)break d;if(ia=ea(ja),(a=ea(0))>>>0<=ia>>>0|-1==(0|ia)|-1==(0|a))break d;if((ma=a-ia|0)>>>0<=na+40>>>0)break d}a=q[2195]+ma|0,(q[2195]=a)>>>0>t[2196]&&(q[2196]=a);x:{y:{z:{if(ja=q[2093]){for(a=8796;;){if(((ka=q[a>>2])+(la=q[a+4>>2])|0)==(0|ia))break z;if(!(a=q[a+8>>2]))break}break y}for((a=q[2091])>>>0<=ia>>>0&&a||(q[2091]=ia),a=0,q[2200]=ma,q[2199]=ia,q[2095]=-1,q[2096]=q[2205],q[2202]=0;q[8396+(ja=a<<3)>>2]=ka=ja+8388|0,q[ja+8400>>2]=ka,32!=(0|(a=a+1|0)););q[2090]=ka=(a=ma+-40|0)-(ja=ia+8&7?-8-ia&7:0)|0,q[2093]=ja=ia+ja|0,q[ja+4>>2]=1|ka,q[4+(a+ia|0)>>2]=40,q[2094]=q[2209];break x}if(!(8&r[a+12|0]|ia>>>0<=ja>>>0|ja>>>0>>0)){q[a+4>>2]=la+ma,q[2093]=ia=(a=ja+8&7?-8-ja&7:0)+ja|0,ka=q[2090]+ma|0,q[2090]=a=ka-a|0,q[ia+4>>2]=1|a,q[4+(ja+ka|0)>>2]=40,q[2094]=q[2209];break x}}ia>>>0<(la=q[2091])>>>0&&(q[2091]=ia,la=0),ka=ia+ma|0,a=8796;A:{B:{C:{D:{E:{F:{for(;(0|ka)!=q[a>>2];)if(!(a=q[a+8>>2]))break F;if(!(8&r[a+12|0]))break E}for(a=8796;;){if((ka=q[a>>2])>>>0<=ja>>>0&&ja>>>0<(la=ka+q[a+4>>2]|0)>>>0)break D;a=q[a+8>>2]}}if(q[a>>2]=ia,q[a+4>>2]=q[a+4>>2]+ma,q[4+(qa=(ia+8&7?-8-ia&7:0)+ia|0)>>2]=3|na,a=((ia=ka+(ka+8&7?-8-ka&7:0)|0)-qa|0)-na|0,oa=na+qa|0,(0|ia)==(0|ja)){q[2093]=oa,a=q[2090]+a|0,q[2090]=a,q[oa+4>>2]=1|a;break B}if(q[2092]==(0|ia)){q[2092]=oa,a=q[2089]+a|0,q[2089]=a,q[oa+4>>2]=1|a,q[a+oa>>2]=a;break B}if(1==(3&(ja=q[ia+4>>2]))){ra=-8&ja;G:if(ja>>>0<=255)la=ja>>>3,ja=q[ia+8>>2],(0|(ka=q[ia+12>>2]))==(0|ja)?(ua=q[2087]&ed(la),q[2087]=ua):(q[ja+12>>2]=ka,q[ka+8>>2]=ja);else{if(pa=q[ia+24>>2],(0|(ma=q[ia+12>>2]))!=(0|ia))ja=q[ia+8>>2],q[ja+12>>2]=ma,q[ma+8>>2]=ja;else if(na=(na=q[(ka=ia+20|0)>>2])||q[(ka=ia+16|0)>>2]){for(;ja=ka,(na=q[(ka=(ma=na)+20|0)>>2])||(ka=ma+16|0,na=q[ma+16>>2]););q[ja>>2]=0}else ma=0;if(pa){ja=q[ia+28>>2];J:{if(q[(ka=8652+(ja<<2)|0)>>2]==(0|ia)){if(q[ka>>2]=ma)break J;ua=q[2088]&ed(ja),q[2088]=ua;break G}if(!(q[pa+(q[pa+16>>2]==(0|ia)?16:20)>>2]=ma))break G}q[ma+24>>2]=pa,(ja=q[ia+16>>2])&&(q[ma+16>>2]=ja,q[ja+24>>2]=ma),(ja=q[ia+20>>2])&&(q[ma+20>>2]=ja,q[ja+24>>2]=ma)}}ia=ia+ra|0,a=a+ra|0}if(q[ia+4>>2]=-2&q[ia+4>>2],q[oa+4>>2]=1|a,(q[a+oa>>2]=a)>>>0<=255){a=8388+((ia=a>>>3)<<3)|0,ia=(ja=q[2087])&(ia=1<>2]:(q[2087]=ia|ja,a),q[a+8>>2]=oa,q[ia+12>>2]=oa,q[oa+12>>2]=a,q[oa+8>>2]=ia;break B}if(ia=0,(ka=a>>>8)&&(ia=31,16777215>>0||(ia=28+((ia=((na=(ka<<=la=ka+1048320>>>16&8)<<(ia=ka+520192>>>16&4))<<(ka=na+245760>>>16&2)>>>15)-(ka|ia|la)|0)<<1|a>>>ia+21&1)|0)),q[(ja=oa)+28>>2]=ia,q[oa+16>>2]=0,ja=8652+(ia<<2)|(q[oa+20>>2]=0),(ka=q[2088])&(la=1<>>1)|0),ia=q[ja>>2];;){if((-8&q[(ja=ia)+4>>2])==(0|a))break C;if(ia=ka>>>29,ka<<=1,!(ia=q[16+(la=(4&ia)+ja|0)>>2]))break}q[la+16>>2]=oa}else q[2088]=ka|la,q[ja>>2]=oa;q[oa+24>>2]=ja,q[oa+12>>2]=oa,q[oa+8>>2]=oa;break B}for(q[2090]=oa=(a=ma+-40|0)-(ka=ia+8&7?-8-ia&7:0)|0,q[2093]=ka=ia+ka|0,q[ka+4>>2]=1|oa,q[4+(a+ia|0)>>2]=40,q[2094]=q[2209],q[(ka=(a=(la+(la+-39&7?39-la&7:0)|0)-47|0)>>>0>>0?ja:a)+4>>2]=27,a=q[2202],q[ka+16>>2]=q[2201],q[ka+20>>2]=a,a=q[2200],q[ka+8>>2]=q[2199],q[ka+12>>2]=a,q[2201]=ka+8,q[2200]=ma,q[2199]=ia,a=ka+24|(q[2202]=0);q[a+4>>2]=7,ia=a+8|0,a=a+4|0,ia>>>0>>0;);if((0|ja)==(0|ka))break x;if(q[ka+4>>2]=-2&q[ka+4>>2],q[ja+4>>2]=1|(la=ka-ja|0),(q[ka>>2]=la)>>>0<=255){a=8388+((ia=la>>>3)<<3)|0,ia=(ka=q[2087])&(ia=1<>2]:(q[2087]=ia|ka,a),q[a+8>>2]=ja,q[ia+12>>2]=ja,q[ja+12>>2]=a,q[ja+8>>2]=ia;break x}if(q[ja+16>>2]=0,a=q[ja+20>>2]=0,(ka=la>>>8)&&(a=31,16777215>>0||(a=28+((a=((oa=(ka<<=ma=ka+1048320>>>16&8)<<(a=ka+520192>>>16&4))<<(ka=oa+245760>>>16&2)>>>15)-(ka|a|ma)|0)<<1|la>>>a+21&1)|0)),ia=8652+((q[(ia=ja)+28>>2]=a)<<2)|0,(ka=q[2088])&(ma=1<>>1)|0),ia=q[ia>>2];;){if((0|la)==(-8&q[(ka=ia)+4>>2]))break A;if(ia=a>>>29,a<<=1,!(ia=q[16+(ma=ka+(4&ia)|0)>>2]))break}q[ma+16>>2]=ja,q[ja+24>>2]=ka}else q[2088]=ka|ma,q[ia>>2]=ja,q[ja+24>>2]=ia;q[ja+12>>2]=ja,q[ja+8>>2]=ja;break x}a=q[ja+8>>2],q[a+12>>2]=oa,q[ja+8>>2]=oa,q[oa+24>>2]=0,q[oa+12>>2]=ja,q[oa+8>>2]=a}a=qa+8|0;break a}a=q[ka+8>>2],q[a+12>>2]=ja,q[ka+8>>2]=ja,q[ja+24>>2]=0,q[ja+12>>2]=ka,q[ja+8>>2]=a}if(!((a=q[2090])>>>0<=na>>>0)){q[2090]=ia=a-na|0,a=q[2093],q[2093]=ja=a+na|0,q[ja+4>>2]=1|ia,q[a+4>>2]=3|na,a=a+8|0;break a}}q[2086]=48,a=0;break a}Q:if(oa){a=q[la+28>>2];R:{if(q[(ka=8652+(a<<2)|0)>>2]==(0|la)){if(q[ka>>2]=ia)break R;pa=ed(a)&pa,q[2088]=pa;break Q}if(!(q[oa+(q[oa+16>>2]==(0|la)?16:20)>>2]=ia))break Q}q[ia+24>>2]=oa,(a=q[la+16>>2])&&(q[ia+16>>2]=a,q[a+24>>2]=ia),(a=q[la+20>>2])&&(q[ia+20>>2]=a,q[a+24>>2]=ia)}S:if(ja>>>0<=15)q[la+4>>2]=3|(a=ja+na|0),q[4+(a=a+la|0)>>2]=1|q[a+4>>2];else if(q[la+4>>2]=3|na,q[4+(ka=la+na|0)>>2]=1|ja,(q[ja+ka>>2]=ja)>>>0<=255)a=8388+((ia=ja>>>3)<<3)|0,ia=(ja=q[2087])&(ia=1<>2]:(q[2087]=ia|ja,a),q[a+8>>2]=ka,q[ia+12>>2]=ka,q[ka+12>>2]=a,q[ka+8>>2]=ia;else{a=0,(na=ja>>>8)&&(a=31,16777215>>0||(a=28+((a=((oa=(na<<=ma=na+1048320>>>16&8)<<(a=na+520192>>>16&4))<<(na=oa+245760>>>16&2)>>>15)-(na|a|ma)|0)<<1|ja>>>a+21&1)|0)),q[(ia=ka)+28>>2]=a,q[ka+16>>2]=0,ia=8652+(a<<2)|(q[ka+20>>2]=0);V:{if((na=1<>>1)|0),na=q[ia>>2];;){if((-8&q[(ia=na)+4>>2])==(0|ja))break V;if(na=a>>>29,a<<=1,!(na=q[16+(ma=(4&na)+ia|0)>>2]))break}q[ma+16>>2]=ka}else q[2088]=na|pa,q[ia>>2]=ka;q[ka+24>>2]=ia,q[ka+12>>2]=ka,q[ka+8>>2]=ka;break S}a=q[ia+8>>2],q[a+12>>2]=ka,q[ia+8>>2]=ka,q[ka+24>>2]=0,q[ka+12>>2]=ia,q[ka+8>>2]=a}a=la+8|0;break a}X:if(qa){a=q[ia+28>>2];Y:{if(q[(ja=8652+(a<<2)|0)>>2]==(0|ia)){if(q[ja>>2]=la)break Y;ua=ed(a)&ra,q[2088]=ua;break X}if(!(q[qa+(q[qa+16>>2]==(0|ia)?16:20)>>2]=la))break X}q[la+24>>2]=qa,(a=q[ia+16>>2])&&(q[la+16>>2]=a,q[a+24>>2]=la),(a=q[ia+20>>2])&&(q[la+20>>2]=a,q[a+24>>2]=la)}ka>>>0<=15?(q[ia+4>>2]=3|(a=ka+na|0),q[4+(a=a+ia|0)>>2]=1|q[a+4>>2]):(q[ia+4>>2]=3|na,q[4+(na=ia+na|0)>>2]=1|ka,q[ka+na>>2]=ka,pa&&(a=8388+((ja=pa>>>3)<<3)|0,la=q[2092],ja=(ja=1<>2]:(q[2087]=ja|ma,a),q[a+8>>2]=la,q[ja+12>>2]=la,q[la+12>>2]=a,q[la+8>>2]=ja),q[2092]=na,q[2089]=ka),a=ia+8|0}return L=16+sa|0,a}function ra(a,va,wa,xa,ya,za,Aa){var Qa,Ta,Ba,Ca=0,Da=0,Fa=0,Ia=0,Ja=0,Ka=0,Ma=0,Na=0,Oa=0,Pa=0,Ra=0,Sa=0;q[76+(L=Ba=L-80|0)>>2]=va,Ta=55+Ba|0,Qa=56+Ba|0,va=0;a:{b:{c:for(;;){(0|Oa)<0||(Oa=(2147483647-Oa|0)<(0|va)?(q[2086]=61,-1):va+Oa|0);e:{f:{g:{h:{i:{j:{k:{l:{m:{n:{o:{p:{q:{if(Ia=q[76+Ba>>2],Fa=r[0|(va=Ia)]){for(;;){r:{s:{t:if(Ca=255&Fa){if(37!=(0|Ca))break s;for(Fa=va;;){if(37!=r[va+1|0])break t;if(q[76+Ba>>2]=Ca=va+2|0,Fa=Fa+1|0,Da=r[va+2|0],va=Ca,37!=(0|Da))break}}else Fa=va;if(va=Fa-Ia|0,a&&Z(a,Ia,va),va)continue c;Pa=-1,Ja=!ha(o[q[76+(Ca=Ba)>>2]+(Fa=1)|0]),va=q[76+Ba>>2],Ja|36!=r[va+2|0]||(Pa=o[va+1|0]+-48|0,Ra=1,Fa=3),q[Ca+76>>2]=va=Fa+va|0;u:if(31<(Da=(Ma=o[(Fa=0)|va])+-32|0)>>>0)Ca=va;else if(Ca=va,75913&(Da=1<>2]=Ca=va+1|0,Fa|=Da,31<(Da=(Ma=o[va+1|0])+-32|0)>>>0)break u;if(va=Ca,!(75913&(Da=1<>2],36==r[va+2|0]))q[((o[va+1|0]<<2)+ya|0)-192>>2]=10,Na=q[((o[va+1|0]<<3)+xa|0)-384>>2],Ra=1,va=va+3|0;else{if(Ra)break b;Na=Ra=0,a&&(va=q[wa>>2],q[wa>>2]=va+4,Na=q[va>>2]),va=q[76+Ba>>2]+1|0}q[Ja+76>>2]=va,-1<(0|Na)||(Na=0-Na|0,Fa|=8192)}else{if((0|(Na=Ha(76+Ba|0)))<0)break b;va=q[76+Ba>>2]}if(Da=-1,46==r[0|va])if(42==r[va+1|0])if(ha(o[va+2|0])&&(va=q[76+Ba>>2],36==r[va+3|0]))q[((o[va+2|0]<<2)+ya|0)-192>>2]=10,Da=q[((o[va+2|0]<<3)+xa|0)-384>>2],q[76+Ba>>2]=va=va+4|0;else{if(Ra)break b;Da=a?(va=q[wa>>2],q[wa>>2]=va+4,q[va>>2]):0,va=q[76+Ba>>2]+2|0,q[76+Ba>>2]=va}else q[76+Ba>>2]=va+1,Da=Ha(76+Ba|0),va=q[76+Ba>>2];for(Ca=0;;){if(Sa=Ca,Ka=-1,57>>0)break a;if(q[76+Ba>>2]=Ma=va+1|0,Ca=o[0|va],va=Ma,!((Ca=r[3295+(Ca+w(Sa,58)|0)|0])+-1>>>0<8))break}if(!Ca)break a;A:{B:{C:{if(19==(0|Ca)){if((0|Pa)<=-1)break C;break a}if((0|Pa)<0)break B;q[(Pa<<2)+ya>>2]=Ca,Ca=q[4+(va=(Pa<<3)+xa|0)>>2],q[64+Ba>>2]=q[va>>2],q[68+Ba>>2]=Ca}if(va=0,a)break A;continue c}if(!a)break e;Ga(64+Ba|0,Ca,wa,Aa),Ma=q[76+Ba>>2]}if(Ja=-65537&Fa,Fa=8192&Fa?Ja:Fa,Pa=3336,Ca=Qa,va=o[Ma+-1|(Ka=0)],(Ma=(va=Sa&&3==(15&va)?-33&va:va)+-88|0)>>>0<=32)break r;D:{E:{F:{G:{if(6<(Ja=va+-65|0)>>>0){if(83!=(0|va))break f;if(!Da)break G;Ca=q[64+Ba>>2];break E}switch(Ja-1|0){case 1:break F;case 0:case 2:break f;default:break q}}_(a,32,Na,va=0,Fa);break D}q[12+Ba>>2]=0,q[8+Ba>>2]=q[64+Ba>>2],q[64+Ba>>2]=8+Ba,Da=-1,Ca=8+Ba|0}va=0;H:{for(;;){if(!(Ia=q[Ca>>2]))break H;if((Ja=(0|(Ia=Ea(4+Ba|0,Ia)))<0)|Da-va>>>0>>0)break;if(Ca=Ca+4|0,!((va=va+Ia|0)>>>0>>0))break H}if(Ka=-1,Ja)break a}if(_(a,32,Na,va,Fa),va)for(Da=0,Ca=q[64+Ba>>2];;){if(!(Ia=q[Ca>>2]))break D;if((0|va)<(0|(Da=(Ia=Ea(4+Ba|0,Ia))+Da|0)))break D;if(Z(a,4+Ba|0,Ia),Ca=Ca+4|0,!(Da>>>0>>0))break}else va=0}_(a,32,Na,va,8192^Fa),va=(0|va)<(0|Na)?Na:va;continue c}q[76+Ba>>2]=Ca=va+1|0,Fa=r[va+1|0],va=Ca;continue}break}switch(Ma-1|0){case 28:break i;case 21:break j;case 23:break l;case 22:break m;case 11:case 16:break n;case 10:break o;case 26:break p;case 8:case 12:case 13:case 14:break q;case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 9:case 15:case 17:case 18:case 19:case 20:case 24:case 25:case 27:case 29:case 30:break f;default:break k}}if(Ka=Oa,a)break a;if(!Ra)break e;for(va=1;;){if(a=q[(va<<2)+ya>>2]){if(Ga((va<<3)+xa|0,a,wa,Aa),10!=(0|(va=va+(Ka=1)|0)))continue;break a}break}if(Ka=1,9>>0)break a;if(Ka=-1,q[(va<<2)+ya>>2])break a;for(;!q[((va=va+1|0)<<2)+ya>>2]&&10!=(0|va););Ka=va>>>0<10?-1:1;break a}va=0|n[za](a,v[64+Ba>>3],Na,Da,Fa,va);continue}Ca=(va=La(Ia=(va=q[64+Ba>>2])||3346,Da))||Da+Ia|0,Fa=Ja,Da=va?va-Ia|0:Da;break f}o[55+Ba|0]=q[64+Ba>>2],Da=1,Ia=Ta,Fa=Ja;break f}if(va=Ja=q[68+Ba>>2],Ia=q[64+Ba>>2],(0|va)<-1||(0|va)<=-1&&!(4294967295>>0)){va=0-(va+(0>>0)|0)|0,q[64+Ba>>2]=Ia=0-Ia|0,q[68+Ba>>2]=va,Ka=1,Pa=3336;break h}if(2048&Fa){Ka=1,Pa=3337;break h}Pa=(Ka=1&Fa)?3338:3336;break h}if(Ia=function(a,Il,Rm){if(a|Il)for(;o[0|(Rm=Rm+-1|0)]=7&a|48,(a=(7&Il)<<29|a>>>3)|(Il>>>=3););return Rm}(q[64+Ba>>2],q[68+Ba>>2],Qa),!(8&Fa))break g;Da=(0|(va=Qa-Ia|0))<(0|Da)?Da:va+1|0;break g}Da=8>>0?Da:8,Fa|=8,va=120}if(Ia=function(a,Il,Rm,Sm){if(a|Il)for(;o[0|(Rm=Rm+-1|0)]=r[3824+(15&a)|0]|Sm,(a=(15&Il)<<28|a>>>4)|(Il>>>=4););return Rm}(q[64+Ba>>2],q[68+Ba>>2],Qa,32&va),!(8&Fa)|!(q[64+Ba>>2]|q[68+Ba>>2]))break g;Pa=3336+(va>>>4)|0,Ka=2;break g}if(7<(Ca=255&Sa)>>>(va=0))continue;switch(Ca-1|0){default:case 0:q[q[64+Ba>>2]>>2]=Oa;continue;case 1:Ca=q[64+Ba>>2],q[Ca>>2]=Oa,q[Ca+4>>2]=Oa>>31;continue;case 2:p[q[64+Ba>>2]>>1]=Oa;continue;case 3:o[q[64+Ba>>2]]=Oa;continue;case 5:q[q[64+Ba>>2]>>2]=Oa;continue;case 4:continue;case 6:}Ca=q[64+Ba>>2],q[Ca>>2]=Oa,q[Ca+4>>2]=Oa>>31;continue}Ia=q[64+Ba>>2],va=q[68+Ba>>2],Pa=3336}Ia=ga(Ia,va,Qa)}Fa=-1<(0|Da)?-65537&Fa:Fa,Da=!!((Ja=va=q[68+Ba>>2])|(Ma=q[64+Ba>>2]))|Da?(0|(va=!(Ja|Ma)+(Qa-Ia|0)|0))<(0|Da)?Da:va:(Ia=Qa,0)}_(a,32,va=(0|Na)<(0|(Ca=(Da=(0|Da)<(0|(Ja=Ca-Ia|0))?Ja:Da)+Ka|0))?Ca:Na,Ca,Fa),Z(a,Pa,Ka),_(a,48,va,Ca,65536^Fa),_(a,48,Da,Ja,0),Z(a,Ia,Ja),_(a,32,va,Ca,8192^Fa);continue}break}Ka=0;break a}Ka=-1}return L=80+Ba|0,Ka}function sa(a){var ya,va=0,wa=0,xa=0,za=0,xa=4,wa=1439;a:if(va=r[0|a]){for(;!((0|(ya=r[0|wa]))!=(0|va)||!(xa=xa+-1|0)|!ya);)if(wa=wa+1|0,va=r[a+1|0],a=a+1|0,!va)break a;za=va}return(255&za)-r[0|wa]|0}function ta(a,Aa,Ea){var La,Ga,Ha=0,Ua=0,Va=0;q[(L=Ga=L-240|0)>>2]=a,Ua=1;a:if(!((0|Aa)<2))for(Ha=a;;){if(Ha=(La=Ha+-4|0)-q[((Va=Aa+-2|0)<<2)+Ea>>2]|0,0<=(0|n[5](a,Ha))&&-1<(0|n[5](a,La)))break a;if(a=(Ua<<2)+Ga|0,0<=(0|n[5](Ha,La))?(q[a>>2]=Ha,Va=Aa+-1|0):Ha=q[a>>2]=La,Ua=Ua+1|0,(0|Va)<2)break a;a=q[Ga>>2],Aa=Va}Na(Ga,Ua),L=240+Ga|0}function ua(a){var Ea,$a,Aa=0;if(x(0),function(a){var Vg,Wg;q[a+428>>2]&&(Wg=q[a+332>>2],$(q[a+460>>2],q[a+436>>2],Vg=Wg<<2),$(q[a+464>>2],q[a+440>>2],Vg),$(q[a+468>>2],q[a+448>>2],Vg),r[q[a>>2]+4|0]<4||($(q[a+472>>2],q[a+452>>2],Vg=Wg<<4),$(q[a+476>>2],q[a+456>>2],Vg)))}(a),function(a){var ke,le,me,fe=0,ge=x(0),he=x(0),ie=0,je=x(0);x(0),x(0);if(1<=(0|(ie=q[a>>2])))for(me=(fe=q[a+4>>2])+w(ie,52)|0,a=q[a+12>>2];ge=u[a>>2],u[fe+44>>2]!=(ge=(ke=q[fe+16>>2])?(he=ge,ge=u[fe+4>>2],je=u[fe+12>>2],he=x(x(he-ge)/je),le=x(C(he)),ie=x(y(le))>2],he=u[fe+8>>2],ge>2]=ge,q[fe+48>>2]=1):q[fe+48>>2]=0,ke||(u[a>>2]=ge),a=a+4|0,(fe=fe+52|0)>>>0>>0;);}(a+540|0),function(a){var Wd,Xd,ae,ce,de,ee,Rd=0,Sd=0,Td=x(0),Ud=0,Vd=x(0),Yd=(x(0),x(0),0),Zd=x(0),_d=0,$d=0,be=0;x(0);if(1<=(0|(Ud=q[a+540>>2])))for(de=(Yd=q[a+544>>2])+w(Ud,52)|0,ee=q[a+644>>2];;){a:if(!(q[Yd>>2]||(0|(Ud=q[Yd+32>>2]))<1))if(ae=(a=q[Yd+28>>2])+w(Ud,28)|0,ce=u[Yd+24>>2],Xd=u[Yd+20>>2],Wd=u[Yd+44>>2],ee)for(;;){Zd=x($d=0);h:{i:{j:{if((0|(Sd=q[a>>2]))<1)Rd=Ud=0;else if(_d=q[a+4>>2],Vd=u[_d>>2],Td=x(Vd-Xd),1==(0|Sd))Ud=Wd>2],!(Wd>2],Wd>2])break h;break i}Rd=Sd+-1|0,Ud=1}_d=(Sd=(Vd=u[a+12>>2])!=Zd)&(Zd==x(0)|Vd==x(0))|q[a+8>>2]!=(0|Rd),$d=Ud}if(q[a+20>>2]=_d,q[a+24>>2]=Sd,u[a+12>>2]=Zd,q[a+16>>2]=$d,q[a+8>>2]=Rd,!((a=a+28|0)>>>0>>0))break}else{if(!q[Yd+48>>2])for(;;)if(q[a+20>>2]=0,!((a=a+28|(q[a+24>>2]=0))>>>0>>0))break a;for(;;){Zd=x($d=0);b:{c:{d:{e:if(!(((Sd=0)|(Rd=q[(_d=a)>>2]))<1)){if(Ud=q[a+4>>2],Vd=u[Ud>>2],Td=x(Vd-Xd),1!=(0|Rd)){if(!(Wd>2],!(Wd>2],Wd>2]))break b}$d=Ud,be=(Sd=(Vd=u[a+12>>2])!=Zd)&(Zd==x(0)|Vd==x(0))|q[a+8>>2]!=(0|Rd)}if(q[_d+20>>2]=be,q[a+24>>2]=Sd,u[a+12>>2]=Zd,q[a+16>>2]=$d,q[a+8>>2]=Rd,!((a=a+28|0)>>>0>>0))break}}if(!((Yd=Yd+52|0)>>>0>>0))break}}(a),function(a){var rd,sd,td,ud,vd,kd=0,ld=x(0),md=0,nd=0,od=x(0),pd=0,qd=x(0);x(0);if(!(r[q[a>>2]+4|0]<4||(0|(kd=q[a+540>>2]))<1))for(ud=(pd=q[a+544>>2])+w(kd,52)|0,vd=q[a+644>>2];;){b:if(1==q[pd>>2]&&!((0|(kd=q[pd+40>>2]))<1))if(sd=(a=q[pd+36>>2])+w(kd,28)|0,rd=u[pd+44>>2],vd)for(;;){qd=x(kd=0);d:if(!((0|(nd=q[a>>2]))<2||(md=q[a+4>>2],rd<=(ld=u[md>>2])))){kd=1;e:if(!(rd<(od=u[md+4>>2]))){for(;ld=od,(0|nd)!=(0|(kd=kd+1|0));)if(rd<(od=u[md+(kd<<2)>>2]))break e;kd=nd+-1|0;break d}qd=x(x(rd-ld)/x(od-ld)),kd=kd+-1|0}if(ld=u[a+16>>2],u[a+16>>2]=qd,nd=q[a+12>>2],q[a+12>>2]=kd,q[a+24>>2]=md=ld!=qd,q[a+20>>2]=md&(qd==x(0)|ld==x(0))|(0|kd)!=(0|nd),!((a=a+28|0)>>>0>>0))break}else{if(!q[pd+48>>2])for(;;)if(q[a+20>>2]=0,!((a=a+28|(q[a+24>>2]=0))>>>0>>0))break b;for(;;){qd=x(nd=0);c:if(!((0|(td=q[a>>2]))<2||(md=q[a+4>>2],rd<=(ld=u[md>>2])))){if(kd=1,!(rd<(od=u[md+4>>2])))for(nd=td+-1|0;;){if(ld=od,(0|kd)==(0|nd))break c;if(rd<(od=u[md+((kd=kd+1|0)<<2)>>2]))break}qd=x(x(rd-ld)/x(od-ld)),nd=kd+-1|0}if(ld=u[a+16>>2],u[a+16>>2]=qd,kd=q[a+12>>2],q[a+12>>2]=nd,q[a+24>>2]=md=ld!=qd,q[a+20>>2]=md&(qd==x(0)|ld==x(0))|(0|kd)!=(0|nd),!((a=a+28|0)>>>0>>0))break}}if(!((pd=pd+52|0)>>>0>>0))break}}(a),function(a){var Id,Jd,Md,Nd,Od,Pd,Qd,wd=0,xd=0,yd=0,zd=0,Ad=0,Bd=0,Cd=0,Dd=x(0),Ed=0,Gd=0,Hd=0,Kd=0,Ld=0;if(1<=(0|(xd=q[a+564>>2])))for(Pd=(Ad=q[a+568>>2])+w(xd,36)|0,Nd=q[a+644>>2];;){a:{if(!(Bd=((yd=zd=xd=0)|(Jd=q[Ad+4>>2]))<1))for(Ed=q[Ad>>2],a=Kd=0;;){if(wd=q[Ed+(a<<2)>>2],q[wd+16>>2]){wd=1,Ld=0;break a}if(yd=yd||q[wd+24>>2],xd=xd||q[wd+20>>2],zd=(u[wd+12>>2]!=x(0))+zd|0,(0|Jd)==(0|(a=a+1|0)))break}if(wd=0,(Kd=Nd?1:yd)|(Ld=Nd?1:xd)&&(q[Ad+12>>2]=Ed=1<>2],Od=q[Ad>>2],yd=(a=q[Ad+16>>2])+(Cd=Ed<<2)|0,yd=ca(a,0,4+((-1^a)+((a=a+4|0)>>>0>>0?yd:a)|0)&-4),Cd=xd+Cd|0,a=xd;q[a>>2]=1065353216,(a=a+4|0)>>>0>>0;);if(!Bd){if(Bd=0,Cd=wd=1,zd)for(;;){if(zd=q[(Bd<<2)+Od>>2],Gd=q[zd+8>>2],Hd=w(Gd,wd),(Dd=u[zd+12>>2])!=x(a=0)){for(q[yd>>2]=Hd+q[yd>>2],u[xd>>2]=x(x(1)-Dd)*u[xd>>2],Gd=w(Gd+(a=1)|0,wd);Dd=u[zd+12>>2],Qd=q[(Md=(Id=a<<2)+yd|0)>>2],q[Md>>2]=Qd+((Md=a&Cd)?Gd:Hd),u[(Id=xd+Id|0)>>2]=(Md?Dd:x(x(1)-Dd))*u[Id>>2],(0|Ed)!=(0|(a=a+1|0)););Cd<<=1}else for(;q[(Gd=yd+(a<<2)|0)>>2]=Hd+q[Gd>>2],(0|Ed)!=(0|(a=a+1|0)););if(wd=w(q[zd>>2],wd),(0|Jd)==(0|(Bd=Bd+1|0)))break}else for(;;){if(zd=q[(Bd<<2)+Od>>2],Cd=w(q[zd+8>>2],wd),(Dd=u[zd+12>>2])!=x(a=0))q[yd>>2]=Cd+q[yd>>2],u[xd>>2]=x(x(1)-Dd)*u[xd>>2];else for(;q[(Hd=yd+(a<<2)|0)>>2]=Cd+q[Hd>>2],(0|Ed)!=(0|(a=a+1|0)););if(wd=w(q[zd>>2],wd),(0|Jd)==(0|(Bd=Bd+1|0)))break}wd=0}}}if(q[Ad+32>>2]=wd,q[Ad+24>>2]=Ld,q[Ad+28>>2]=Kd,!((Ad=Ad+36|0)>>>0>>0))break}}(a),function(a){var gd,hd,id,jd,Wc=x(0),Xc=0,Yc=0,Zc=0,_c=0,$c=0,ad=x(0),bd=x(0),cd=x(0),dd=0,ed=0,fd=0;if(!(r[q[a>>2]+4|0]<4||(0|(Xc=q[a+588>>2]))<1))for(jd=(Zc=q[a+592>>2])+w(Xc,48)|0,gd=q[a+644>>2];;){if(a=q[Zc>>2],(ed=gd?1:q[a+20>>2])|(fd=gd?1:q[a+24>>2])){c:{d:{$c=Zc,_c=q[a+8>>2],Xc=q[a+12>>2],Wc=u[a+16>>2],a=(0|_c)!=(0|Xc);e:{if(Wc!=x(0)){if(a=Xc+1|0,(0|Xc)==(0|_c)){q[Zc+8>>2]=ed=1,Wc=x(x(1)-Wc),fd=1;break e}a=(0|a)==(0|_c)?1:2}if(q[$c+8>>2]=a,!fd)break d;a=Xc}u[Zc+24>>2]=Wc,u[Zc+20>>2]=x(1)-Wc;break c}fd=0,a=Xc}ed?(q[Zc+12>>2]=a,q[Zc+16>>2]=a+1):ed=0}else ed=fd=0;g:if((0|(hd=q[Zc+36>>2]))<1)cd=x(1);else{if(id=q[Zc+40>>2],a=0,cd=x(1),!gd)for(;;){h:{i:{if(Xc=q[(a<<2)+id>>2],Yc=q[Xc>>2]){if(!q[Yc+48>>2]){Wc=u[Xc+16>>2];break h}if((0|(_c=q[Xc+12>>2]))<1){Wc=x(1),u[Xc+16>>2]=1;break h}if(dd=q[Xc+8>>2],1!=(0|_c)&&(ad=u[Yc+44>>2],$c=q[Xc+4>>2],!(ad<=(bd=u[$c>>2]))))break i;Wc=u[dd>>2],u[Xc+16>>2]=Wc;break h}q[Xc+16>>2]=1065353216,Wc=x(1);break h}Yc=1;j:if(!(ad<(Wc=u[$c+4>>2]))){for(;bd=Wc,(0|_c)!=(0|(Yc=Yc+1|0));)if(ad<(Wc=u[$c+(Yc<<2)>>2]))break j;Wc=u[(dd+(_c<<2)|0)-4>>2],u[Xc+16>>2]=Wc;break h}$c=Xc,Wc=x(x(ad-bd)/x(Wc-bd)),Wc=x(x(Wc*u[(Xc=dd+(Yc<<2)|0)>>2])+x(u[Xc+-4>>2]*x(x(1)-Wc))),u[$c+16>>2]=Wc}if(cd=cd>2],Yc=q[Xc>>2],Wc=x(1);l:if(Yc&&(dd=q[Xc+12>>2],Wc=x(1),!((0|dd)<1))&&(_c=q[Xc+8>>2],Wc=u[_c>>2],1!=(0|dd))){m:{if(ad=u[Yc+44>>2],$c=q[Xc+4>>2],ad<=(bd=u[$c>>2])){Wc=u[_c>>2];break l}if(Yc=1,!(ad<(Wc=u[$c+4>>2]))){for(;bd=Wc,(0|dd)!=(0|(Yc=Yc+1|0));)if(ad<(Wc=u[$c+(Yc<<2)>>2]))break m;Wc=u[(_c+(dd<<2)|0)-4>>2];break l}}Wc=x(x(ad-bd)/x(Wc-bd)),Wc=x(x(Wc*u[(Yc=_c+(Yc<<2)|0)>>2])+x(u[Yc+-4>>2]*x(x(1)-Wc)))}if(cd=cd<(u[Xc+16>>2]=Wc)?cd:Wc,(0|hd)==(0|(a=a+1|0)))break}}if(q[Zc+32>>2]=fd,q[Zc+28>>2]=ed,u[Zc+44>>2]=cd,!((Zc=Zc+48|0)>>>0>>0))break}}(a),1<=(0|(Ea=q[a+4>>2])))for(Ea=(Aa=q[a+52>>2])+(Ea<<2)|0;$a=u[Aa>>2],u[Aa>>2]=$a>>0>>0;);!function(a){var Fe,Ge,He,De=0,Ee=0;if(1<=(0|(Ee=q[a+4>>2])))for(He=(De=q[a+8>>2])+w(Ee,12)|0,a=Fe=q[a+40>>2];Ee=0,q[De+8>>2]&&(Ge=q[De+4>>2],!q[(Ge<<2)+Fe>>2]&&-1!=(0|Ge)||(Ee=!q[q[De>>2]+32>>2])),q[a>>2]=Ee,a=a+4|0,(De=De+12|0)>>>0>>0;);}(a),function(a){var rg,vg,wg,xg,yg,zg,Ag,pg=0,qg=0,sg=0,tg=0,ug=0;if(1<=(0|(vg=q[a+4>>2])))for(xg=q[a+8>>2],wg=q[a>>2],yg=q[wg+724>>2];;){if(rg=q[w(tg,12)+xg>>2],(q[rg+28>>2]||q[rg+24>>2])&&(q[(pg=tg<<2)+q[a+28>>2]>>2]=q[rg+12>>2],q[rg+24>>2])&&!((0|(sg=q[rg+12>>2]))<1))for(sg=(qg=q[rg+16>>2])+(sg<<2)|0,zg=q[pg+yg>>2],pg=q[a+36>>2]+(ug<<2)|0,Ag=q[wg+976>>2];q[pg>>2]=q[(q[qg>>2]+zg<<2)+Ag>>2],pg=pg+4|0,(qg=qg+4|0)>>>0>>0;);if(q[rg+28>>2]&&!((0|(pg=q[rg+12>>2]))<1))for(sg=(qg=q[rg+20>>2])+(pg<<2)|0,pg=q[a+32>>2]+(ug<<2)|0;q[pg>>2]=q[qg>>2],pg=pg+4|0,(qg=qg+4|0)>>>0>>0;);if(ug=q[rg+8>>2]+ug|0,(0|vg)==(0|(tg=tg+1|0)))break}}(a),n[q[1808]](a+12|0,q[a+36>>2],q[a+44>>2],q[a+40>>2]),function(a){var xe,ye,ze,Ae,Be,Ce,ue=0,ve=0,we=0;if(1<=(0|(we=q[a+304>>2])))for(ze=(ue=q[a+308>>2])+(we<<5)|0,Ae=q[a+264>>2],Be=q[a+144>>2],Ce=q[a+40>>2],we=ye=q[a+312>>2];xe=we,ve=0,a=ve=!q[ue+28>>2]||-1!=(0|(a=q[ue+4>>2]))&&(ve=0,!q[(a<<2)+Ce>>2])||-1!=(0|(a=q[ue+8>>2]))&&(ve=0,!q[(a<<2)+ye>>2])?ve:!q[q[ue>>2]+32>>2],q[xe>>2]=a,(xe=q[ue+12>>2])>>>0<=1?xe-1?q[(q[ue+16>>2]<<2)+Be>>2]=a:q[(q[ue+16>>2]<<2)+Ae>>2]=a:Y(4,1372,0),we=we+4|0,(ue=ue+32|0)>>>0>>0;);}(a),function(a){var gg,hg,ig,jg,kg,lg,mg,ng,og,Uf=0,Vf=0,Wf=0,Xf=0,Yf=0,Zf=0,_f=0,$f=0,ag=0,bg=0,cg=0,dg=0,eg=0,fg=0,Yf=q[a>>2];if(1<=(0|($f=q[a+56>>2]))){for(ag=q[a+60>>2],bg=q[Yf+1052>>2],cg=q[Yf+784>>2];;){if(Uf=q[ag+w(Zf,24)>>2],(q[Uf+28>>2]||q[Uf+24>>2])&&(q[(Vf=Zf<<2)+q[a+80>>2]>>2]=q[Uf+12>>2],q[Uf+24>>2])&&!((0|(Xf=q[Uf+12>>2]))<1))for(dg=(Wf=q[Uf+16>>2])+(Xf<<2)|0,eg=q[Vf+cg>>2],Vf=(Xf=_f<<2)+q[a+92>>2]|0,Xf=Xf+q[a+88>>2]|0;fg=eg+q[Wf>>2]<<2,q[Vf>>2]=bg+(q[fg+q[Yf+984>>2]>>2]<<2),q[Xf>>2]=q[fg+q[Yf+980>>2]>>2],Xf=Xf+4|0,Vf=Vf+4|0,(Wf=Wf+4|0)>>>0>>0;);if(q[Uf+28>>2]&&!((0|(Vf=q[Uf+12>>2]))<1))for(Xf=(Wf=q[Uf+20>>2])+(Vf<<2)|0,Vf=q[a+84>>2]+(_f<<2)|0;q[Vf>>2]=q[Wf>>2],Vf=Vf+4|0,(Wf=Wf+4|0)>>>0>>0;);if(_f=q[Uf+8>>2]+_f|0,(0|$f)==(0|(Zf=Zf+1|0)))break}Yf=q[a>>2]}if(!(r[Yf+4|0]<4||(0|(eg=q[a+56>>2]))<1))for(fg=q[Yf+792>>2],gg=q[a+60>>2],Wf=_f=0;;){if(Zf=q[w(Wf,24)+gg>>2],q[Zf+24>>2]&&!((0|(Uf=q[Zf+12>>2]))<1))for(hg=(Vf=q[Zf+16>>2])+(Uf<<2)|0,ig=q[fg+(Wf<<2)>>2],Xf=(Uf=_f<<2)+q[a+96>>2]|0,$f=Uf+q[a+100>>2]|0,ag=Uf+q[a+104>>2]|0,bg=Uf+q[a+108>>2]|0,cg=Uf+q[a+112>>2]|0,dg=Uf+q[a+116>>2]|0,jg=q[Yf+1308>>2],kg=q[Yf+1304>>2],lg=q[Yf+1300>>2],mg=q[Yf+1296>>2],ng=q[Yf+1292>>2],og=q[Yf+1288>>2];Uf=q[Vf>>2]+ig<<2,q[Xf>>2]=q[Uf+og>>2],q[$f>>2]=q[Uf+ng>>2],q[ag>>2]=q[Uf+mg>>2],q[bg>>2]=q[Uf+lg>>2],q[cg>>2]=q[Uf+kg>>2],q[dg>>2]=q[Uf+jg>>2],dg=dg+4|0,cg=cg+4|0,bg=bg+4|0,ag=ag+4|0,$f=$f+4|0,Xf=Xf+4|0,(Vf=Vf+4|0)>>>0>>0;);if(_f=q[Zf+8>>2]+_f|0,(0|eg)==(0|(Wf=Wf+1|0)))break}}(a),function(a){var xf=0,yf=0,Af=0,Bf=0,Cf=0,Df=0,Ef=0,Ff=0,Gf=0,Hf=0,If=0,Jf=0,Kf=0,Lf=0,Mf=0,Nf=0,Of=0,Pf=0,Qf=0,Rf=0,Sf=0,Tf=q[a+168>>2],zf=q[a>>2];if(1<=(0|(Kf=q[a+164>>2])))for(Mf=q[zf+816>>2];;){if(Af=q[w(Ef,12)+Tf>>2],(q[Af+28>>2]||q[Af+24>>2])&&(q[(Ff=Ef<<2)+q[a+188>>2]>>2]=q[Af+12>>2],q[Af+24>>2])){if(yf=q[Af+16>>2],Lf=q[Ff+Mf>>2],1<=(0|(xf=q[Af+12>>2])))for(Nf=yf+(xf<<2)|0,Bf=(xf=Df<<2)+q[a+200>>2]|0,Gf=xf+q[a+204>>2]|0,Hf=xf+q[a+208>>2]|0,If=xf+q[a+212>>2]|0,Jf=xf+q[a+196>>2]|0,Of=q[zf+996>>2],Pf=q[zf+1012>>2],Qf=q[zf+1008>>2],Rf=q[zf+1004>>2],Sf=q[zf+1e3>>2],xf=yf;Cf=Lf+q[xf>>2]<<2,q[Bf>>2]=q[Cf+Sf>>2],q[Gf>>2]=q[Cf+Rf>>2],q[Hf>>2]=q[Cf+Qf>>2],q[If>>2]=q[Cf+Pf>>2],q[Jf>>2]=q[Cf+Of>>2],Jf=Jf+4|0,If=If+4|0,Hf=Hf+4|0,Gf=Gf+4|0,Bf=Bf+4|0,(xf=xf+4|0)>>>0>>0;);xf=Lf+q[yf>>2]<<2,q[Ff+q[a+288>>2]>>2]=q[xf+q[zf+1016>>2]>>2],q[Ff+q[a+292>>2]>>2]=q[xf+q[zf+1020>>2]>>2]}if(q[Af+28>>2]&&!((0|(yf=q[Af+12>>2]))<1))for(yf=(xf=q[Af+20>>2])+(yf<<2)|0,Bf=q[a+192>>2]+(Df<<2)|0;q[Bf>>2]=q[xf>>2],Bf=Bf+4|0,(xf=xf+4|0)>>>0>>0;);if(Df=q[Af+8>>2]+Df|0,(0|Kf)==(0|(Ef=Ef+1|0)))break}if(!(r[zf+4|0]<4||(0|(Ff=q[a+164>>2]))<1))for(Lf=q[zf+824>>2],Df=Af=0;;){if(Cf=q[w(Df,12)+Tf>>2],q[Cf+24>>2]&&!((0|(xf=q[Cf+12>>2]))<1))for(Kf=(Bf=q[Cf+16>>2])+(xf<<2)|0,Mf=q[Lf+(Df<<2)>>2],Gf=(yf=Af<<2)+q[a+216>>2]|0,Hf=yf+q[a+220>>2]|0,If=yf+q[a+224>>2]|0,Jf=yf+q[a+228>>2]|0,xf=yf+q[a+232>>2]|0,Ef=yf+q[a+236>>2]|0,Nf=q[zf+1308>>2],Of=q[zf+1304>>2],Pf=q[zf+1300>>2],Qf=q[zf+1296>>2],Rf=q[zf+1292>>2],Sf=q[zf+1288>>2];yf=Mf+q[Bf>>2]<<2,q[Gf>>2]=q[yf+Sf>>2],q[Hf>>2]=q[yf+Rf>>2],q[If>>2]=q[yf+Qf>>2],q[Jf>>2]=q[yf+Pf>>2],q[xf>>2]=q[yf+Of>>2],q[Ef>>2]=q[yf+Nf>>2],Ef=Ef+4|0,xf=xf+4|0,Jf=Jf+4|0,If=If+4|0,Hf=Hf+4|0,Gf=Gf+4|0,(Bf=Bf+4|0)>>>0>>0;);if(Af=q[Cf+8>>2]+Af|0,(0|Ff)==(0|(Df=Df+1|0)))break}}(a),function(a){var yk,qk=0,rk=0,sk=0,tk=0,uk=0,vk=0,wk=0,xk=0,qk=a- -64|0;if(n[q[1807]](qk,q[a+88>>2],q[a+148>>2],q[a+144>>2]),n[q[1809]](qk,q[a+92>>2],q[a+152>>2],q[q[a>>2]+796>>2],2,q[a+144>>2]),!(r[q[a>>2]+4|0]<4||(n[q[1807]](qk,q[a+96>>2],q[a+120>>2],q[a+144>>2]),n[q[1807]](qk,q[a+100>>2],q[a+124>>2],q[a+144>>2]),n[q[1807]](qk,q[a+104>>2],q[a+128>>2],q[a+144>>2]),n[q[1807]](qk,q[a+108>>2],q[a+132>>2],q[a+144>>2]),n[q[1807]](qk,q[a+112>>2],q[a+136>>2],q[a+144>>2]),n[q[1807]](qk,q[a+116>>2],q[a+140>>2],q[a+144>>2]),(0|(vk=q[a+56>>2]))<1))){for(wk=q[a+128>>2],xk=q[a+124>>2],yk=q[a+120>>2],rk=q[a+156>>2],qk=0;q[(sk=tk<<2)+rk>>2]=q[(uk=qk<<2)+yk>>2],q[rk+(4|sk)>>2]=q[uk+xk>>2],q[rk+(8|sk)>>2]=q[uk+wk>>2],tk=tk+4|0,(0|vk)!=(0|(qk=qk+1|0)););for(rk=q[a+160>>2],uk=q[a+140>>2],wk=q[a+136>>2],xk=q[a+132>>2],qk=a=0;q[(tk=a<<2)+rk>>2]=q[(sk=qk<<2)+xk>>2],q[rk+(4|tk)>>2]=q[sk+wk>>2],q[rk+(8|tk)>>2]=q[sk+uk>>2],a=a+4|0,(0|vk)!=(0|(qk=qk+1|0)););}}(a),function(a){var pk,hk=0,ik=0,jk=0,kk=0,lk=0,mk=0,nk=0,ok=0,hk=a+172|0;if(n[q[1807]](hk,q[a+196>>2],q[a+268>>2],q[a+264>>2]),n[q[1807]](hk,q[a+200>>2],q[a+284>>2],q[a+264>>2]),n[q[1807]](hk,q[a+204>>2],q[a+276>>2],q[a+264>>2]),n[q[1807]](hk,q[a+208>>2],q[a+280>>2],q[a+264>>2]),n[q[1807]](hk,q[a+212>>2],q[a+272>>2],q[a+264>>2]),!(r[q[a>>2]+4|0]<4||(n[q[1807]](hk,q[a+216>>2],q[a+240>>2],q[a+264>>2]),n[q[1807]](hk,q[a+220>>2],q[a+244>>2],q[a+264>>2]),n[q[1807]](hk,q[a+224>>2],q[a+248>>2],q[a+264>>2]),n[q[1807]](hk,q[a+228>>2],q[a+252>>2],q[a+264>>2]),n[q[1807]](hk,q[a+232>>2],q[a+256>>2],q[a+264>>2]),n[q[1807]](hk,q[a+236>>2],q[a+260>>2],q[a+264>>2]),(0|(mk=q[a+164>>2]))<1))){for(nk=q[a+248>>2],ok=q[a+244>>2],pk=q[a+240>>2],ik=q[a+296>>2],hk=0;q[(jk=kk<<2)+ik>>2]=q[(lk=hk<<2)+pk>>2],q[ik+(4|jk)>>2]=q[lk+ok>>2],q[ik+(8|jk)>>2]=q[lk+nk>>2],kk=kk+4|0,(0|mk)!=(0|(hk=hk+1|0)););for(ik=q[a+300>>2],lk=q[a+260>>2],nk=q[a+256>>2],ok=q[a+252>>2],hk=a=0;q[(kk=a<<2)+ik>>2]=q[(jk=hk<<2)+ok>>2],q[ik+(4|kk)>>2]=q[jk+nk>>2],q[ik+(8|kk)>>2]=q[jk+lk>>2],a=a+4|0,(0|mk)!=(0|(hk=hk+1|0)););}}(a),function(a){var re,se,te,oe=0,pe=0,qe=0;if(1<=(0|(pe=q[a+332>>2])))for(re=(oe=q[a+336>>2])+w(pe,20)|0,se=q[a+312>>2],te=q[a+40>>2],a=q[a+424>>2];pe=0,q[oe+12>>2]&&(qe=q[oe+4>>2],q[(qe<<2)+te>>2]||-1==(0|qe))&&(qe=q[oe+8>>2],q[(qe<<2)+se>>2]||-1==(0|qe))&&(pe=!q[q[oe>>2]+32>>2]),q[a>>2]=pe,a=a+4|0,(oe=oe+20|0)>>>0>>0;);}(a),function(a){var pf,qf,rf,sf,tf,uf,vf,wf,$e=0,af=0,bf=0,cf=0,df=0,ef=0,ff=0,gf=0,hf=0,jf=0,kf=0,lf=0,mf=0,nf=0,of=0,cf=q[a>>2];if(1<=(0|(jf=q[a+332>>2]))){for(kf=q[a+336>>2],lf=q[cf+1052>>2],mf=q[cf+856>>2];;){if($e=q[kf+w(ff,20)>>2],(q[$e+28>>2]||q[$e+24>>2])&&(q[(af=ff<<2)+q[a+356>>2]>>2]=q[$e+12>>2],q[$e+24>>2])&&!((0|(df=q[$e+12>>2]))<1))for(nf=(bf=q[$e+16>>2])+(df<<2)|0,of=q[af+mf>>2],af=(ef=gf<<2)+q[a+372>>2]|0,df=ef+q[a+364>>2]|0,ef=ef+q[a+368>>2]|0;hf=of+q[bf>>2]<<2,q[af>>2]=lf+(q[hf+q[cf+1040>>2]>>2]<<2),q[df>>2]=q[hf+q[cf+1032>>2]>>2],q[ef>>2]=q[hf+q[cf+1036>>2]>>2],ef=ef+4|0,df=df+4|0,af=af+4|0,(bf=bf+4|0)>>>0>>0;);if(q[$e+28>>2]&&!((0|(af=q[$e+12>>2]))<1))for(df=(bf=q[$e+20>>2])+(af<<2)|0,af=q[a+360>>2]+(gf<<2)|0;q[af>>2]=q[bf>>2],af=af+4|0,(bf=bf+4|0)>>>0>>0;);if(gf=q[$e+8>>2]+gf|0,(0|jf)==(0|(ff=ff+1|0)))break}cf=q[a>>2]}if(!(r[cf+4|0]<4||(0|(mf=q[a+332>>2]))<1))for(nf=q[cf+864>>2],of=q[a+336>>2],bf=gf=0;;){if(ff=q[of+w(bf,20)>>2],q[ff+24>>2]&&!((0|($e=q[ff+12>>2]))<1))for(pf=(af=q[ff+16>>2])+($e<<2)|0,qf=q[nf+(bf<<2)>>2],df=($e=gf<<2)+q[a+376>>2]|0,ef=$e+q[a+380>>2]|0,hf=$e+q[a+384>>2]|0,jf=$e+q[a+388>>2]|0,kf=$e+q[a+392>>2]|0,lf=$e+q[a+396>>2]|0,rf=q[cf+1308>>2],sf=q[cf+1304>>2],tf=q[cf+1300>>2],uf=q[cf+1296>>2],vf=q[cf+1292>>2],wf=q[cf+1288>>2];$e=q[af>>2]+qf<<2,q[df>>2]=q[$e+wf>>2],q[ef>>2]=q[$e+vf>>2],q[hf>>2]=q[$e+uf>>2],q[jf>>2]=q[$e+tf>>2],q[kf>>2]=q[$e+sf>>2],q[lf>>2]=q[$e+rf>>2],lf=lf+4|0,kf=kf+4|0,jf=jf+4|0,hf=hf+4|0,ef=ef+4|0,df=df+4|0,(af=af+4|0)>>>0>>0;);if(gf=q[ff+8>>2]+gf|0,(0|mf)==(0|(bf=bf+1|0)))break}}(a),function(a){var gk,vj=0,xj=0,yj=0,bk=0,ck=0,dk=0,ek=0,fk=0,vj=a+340|0;if(n[q[1807]](vj,q[a+364>>2],q[a+448>>2],q[a+424>>2]),n[q[1808]](vj,q[a+368>>2],q[a+440>>2],q[a+424>>2]),n[q[1809]](vj,q[a+372>>2],q[a+444>>2],q[q[a>>2]+892>>2],2,q[a+424>>2]),!(r[q[a>>2]+4|0]<4||(n[q[1807]](vj,q[a+376>>2],q[a+400>>2],q[a+424>>2]),n[q[1807]](vj,q[a+380>>2],q[a+404>>2],q[a+424>>2]),n[q[1807]](vj,q[a+384>>2],q[a+408>>2],q[a+424>>2]),n[q[1807]](vj,q[a+388>>2],q[a+412>>2],q[a+424>>2]),n[q[1807]](vj,q[a+392>>2],q[a+416>>2],q[a+424>>2]),n[q[1807]](vj,q[a+396>>2],q[a+420>>2],q[a+424>>2]),(0|(dk=q[a+332>>2]))<1))){for(ek=q[a+408>>2],fk=q[a+404>>2],gk=q[a+400>>2],xj=q[a+452>>2],vj=0;q[(yj=bk<<2)+xj>>2]=q[(ck=vj<<2)+gk>>2],q[xj+(4|yj)>>2]=q[ck+fk>>2],q[xj+(8|yj)>>2]=q[ck+ek>>2],bk=bk+4|0,(0|dk)!=(0|(vj=vj+1|0)););for(xj=q[a+456>>2],ck=q[a+420>>2],ek=q[a+416>>2],fk=q[a+412>>2],vj=a=0;q[(bk=a<<2)+xj>>2]=q[(yj=vj<<2)+fk>>2],q[xj+(4|bk)>>2]=q[yj+ek>>2],q[xj+(8|bk)>>2]=q[yj+ck>>2],a=a+4|0,(0|dk)!=(0|(vj=vj+1|0)););}}(a),function(a){var Re,Ve,We,Xe,Ye,Ze,_e,Pe=0,Qe=0,Se=0,Te=0,Ue=0;if(1<=(0|(Ve=q[a+500>>2])))for(Xe=q[a+504>>2],We=q[a>>2],Ye=q[We+1252>>2];;){if(Re=q[w(Te,24)+Xe>>2],(q[Re+28>>2]||q[Re+24>>2])&&(q[(Pe=Te<<2)+q[a+524>>2]>>2]=q[Re+12>>2],q[Re+24>>2])&&!((0|(Se=q[Re+12>>2]))<1))for(Se=(Qe=q[Re+16>>2])+(Se<<2)|0,Ze=q[Pe+Ye>>2],Pe=q[a+532>>2]+(Ue<<2)|0,_e=q[We+1284>>2];q[Pe>>2]=q[(q[Qe>>2]+Ze<<2)+_e>>2],Pe=Pe+4|0,(Qe=Qe+4|0)>>>0>>0;);if(q[Re+28>>2]&&!((0|(Pe=q[Re+12>>2]))<1))for(Se=(Qe=q[Re+20>>2])+(Pe<<2)|0,Pe=q[a+528>>2]+(Ue<<2)|0;q[Pe>>2]=q[Qe>>2],Pe=Pe+4|0,(Qe=Qe+4|0)>>>0>>0;);if(Ue=q[Re+8>>2]+Ue|0,(0|Ve)==(0|(Te=Te+1|0)))break}}(a),n[q[1807]](a+508|0,q[a+532>>2],q[a+536>>2],0),function(a){var Ek,Fk,Gk,Hk,Ik,Jk,zk=x(0),Ak=0,Bk=0,Ck=0,Dk=0;x(0);if(L=Ek=L-16|0,Ck=q[a>>2],!(r[Ck+4|0]<5||(0|(Dk=q[a+596>>2]))<1))for(Hk=(Bk=q[a+600>>2])+w(Dk,12)|0,Ik=q[a+44>>2],Dk=q[Ck+976>>2];;){if(Ck=(q[Bk>>2]<<2)+Ik|0,zk=x(q[Ck>>2]),1<=(0|(Ak=q[Bk+4>>2])))for(Jk=(a=q[Bk+8>>2])+w(Ak,48)|0;(Ak=q[a+8>>2])&&((Fk=Ak+-1|0)>>>0<=1?(Ak=q[a+4>>2],Gk=u[Dk+(Ak+q[a+12>>2]<<2)>>2],zk=x(Fk-1?zk+x(u[a+44>>2]*x(Gk*u[a+20>>2])):zk+x(u[a+44>>2]*x(x(Gk*u[a+20>>2])+x(u[Dk+(Ak+q[a+16>>2]<<2)>>2]*u[a+24>>2]))))):(q[Ek>>2]=Ak,Y(4,1024,Ek))),(a=a+48|0)>>>0>>0;);if(zk=(zk=x(zk+x(.0010000000474974513)))>2]=a,!((Bk=Bk+12|0)>>>0>>0))break}L=16+Ek|0}(a),function(a){var mj,nj,oj,pj,qj,rj,sj,tj,uj,ej=0,gj=0,ij=0,jj=0,kj=0,lj=x(0);if(L=mj=L-16|0,ej=q[a>>2],!(r[ej+4|0]<4||(va(a,q[a+604>>2],q[a+608>>2],q[ej+984>>2],q[a+152>>2],q[ej+796>>2]),gj=q[a>>2],r[gj+4|0]<5))){if(ij=q[a+608>>2],qj=q[gj+992>>2],rj=q[gj+988>>2],1<=(0|(ej=q[a+604>>2]))){for(sj=w(ej,12)+ij|0,tj=q[a+148>>2],nj=q[gj+980>>2];;){if(oj=(q[ij>>2]<<2)+tj|0,kj=q[oj>>2],1<=(0|(jj=q[ij+4>>2])))for(uj=(ej=q[ij+8>>2])+w(jj,48)|0;(jj=q[ej+8>>2])&&((pj=jj+-1|0)>>>0<=1?(jj=q[ej+4>>2],lj=u[(jj+q[ej+12>>2]<<2)+nj>>2],j(x(pj-1?x(u[ej+44>>2]*x(lj*u[ej+20>>2]))+(f(0,kj),k()):x(u[ej+44>>2]*x(x(lj*u[ej+20>>2])+x(u[(jj+q[ej+16>>2]<<2)+nj>>2]*u[ej+24>>2])))+(f(0,kj),k()))),kj=b[0]):(q[mj>>2]=jj,Y(4,1024,mj))),(ej=ej+48|0)>>>0>>0;);if(f(0,kj),lj=k(),u[oj>>2]=lj>>0>>0))break}ij=q[a+608>>2],ej=q[a+604>>2]}fa(ej,ij,rj,q[gj+1288>>2],q[gj+1292>>2],q[gj+1296>>2],q[a+156>>2]),fa(q[a+604>>2],q[a+608>>2],qj,q[gj+1300>>2],q[gj+1304>>2],q[gj+1308>>2],q[a+160>>2])}L=16+mj|0}(a),function(a){var Ai,ti=0,ui=0,vi=0,wi=0,xi=0,yi=x(0),zi=0,Bi=0,Ci=0,Di=0,Ei=0,Fi=0,Gi=0,Hi=0;if(L=Ai=L-80|0,xi=q[a>>2],!(r[xi+4|0]<5)){if(Fi=q[xi+1028>>2],Gi=q[xi+1024>>2],vi=ui=q[a+616>>2],!((0|(ti=q[a+612>>2]))<1)){for(Bi=w(ti,12)+ui|0,Ci=q[a+276>>2],zi=q[xi+1004>>2];;){if(Di=Ci+(q[ui>>2]<<2)|0,vi=q[Di>>2],1<=(0|(wi=q[ui+4>>2])))for(Hi=(ti=q[ui+8>>2])+w(wi,48)|0;(wi=q[ti+8>>2])&&((Ei=wi+-1|0)>>>0<=1?(wi=q[ti+4>>2],yi=u[zi+(wi+q[ti+12>>2]<<2)>>2],j(x(Ei-1?x(u[ti+44>>2]*x(yi*u[ti+20>>2]))+(f(0,vi),k()):x(u[ti+44>>2]*x(x(yi*u[ti+20>>2])+x(u[zi+(wi+q[ti+16>>2]<<2)>>2]*u[ti+24>>2])))+(f(0,vi),k()))),vi=b[0]):(q[64+Ai>>2]=wi,Y(4,1024,64+Ai|0))),(ti=ti+48|0)>>>0>>0;);if(q[Di>>2]=vi,!((ui=ui+12|0)>>>0>>0))break}if(vi=ui=q[a+616>>2],!((0|(ti=q[a+612>>2]))<1)){for(Bi=w(ti,12)+ui|0,Ci=q[a+280>>2],zi=q[q[a>>2]+1008>>2];;){if(Di=Ci+(q[ui>>2]<<2)|0,vi=q[Di>>2],1<=(0|(wi=q[ui+4>>2])))for(Hi=(ti=q[ui+8>>2])+w(wi,48)|0;(wi=q[ti+8>>2])&&((Ei=wi+-1|0)>>>0<=1?(wi=q[ti+4>>2],yi=u[zi+(wi+q[ti+12>>2]<<2)>>2],j(x(Ei-1?x(u[ti+44>>2]*x(yi*u[ti+20>>2]))+(f(0,vi),k()):x(u[ti+44>>2]*x(x(yi*u[ti+20>>2])+x(u[zi+(wi+q[ti+16>>2]<<2)>>2]*u[ti+24>>2])))+(f(0,vi),k()))),vi=b[0]):(q[48+Ai>>2]=wi,Y(4,1024,48+Ai|0))),(ti=ti+48|0)>>>0>>0;);if(q[Di>>2]=vi,!((ui=ui+12|0)>>>0>>0))break}if(vi=ui=q[a+616>>2],!((0|(ti=q[a+612>>2]))<1)){for(Bi=w(ti,12)+ui|0,Ci=q[a+268>>2],zi=q[q[a>>2]+996>>2];;){if(Di=Ci+(q[ui>>2]<<2)|0,vi=q[Di>>2],1<=(0|(wi=q[ui+4>>2])))for(Hi=(ti=q[ui+8>>2])+w(wi,48)|0;(wi=q[ti+8>>2])&&((Ei=wi+-1|0)>>>0<=1?(wi=q[ti+4>>2],yi=u[zi+(wi+q[ti+12>>2]<<2)>>2],j(x(Ei-1?x(u[ti+44>>2]*x(yi*u[ti+20>>2]))+(f(0,vi),k()):x(u[ti+44>>2]*x(x(yi*u[ti+20>>2])+x(u[zi+(wi+q[ti+16>>2]<<2)>>2]*u[ti+24>>2])))+(f(0,vi),k()))),vi=b[0]):(q[32+Ai>>2]=wi,Y(4,1024,32+Ai|0))),(ti=ti+48|0)>>>0>>0;);if(f(0,vi),yi=k(),u[Di>>2]=yi>>0>>0))break}ti=q[a+612>>2],vi=q[a+616>>2]}}}if(fa(ti,vi,Gi,q[xi+1288>>2],q[xi+1292>>2],q[xi+1296>>2],q[a+296>>2]),fa(q[a+612>>2],q[a+616>>2],Fi,q[xi+1300>>2],q[xi+1304>>2],q[xi+1308>>2],q[a+300>>2]),!((0|(ti=q[a+612>>2]))<1)){for(wi=(ui=q[a+616>>2])+w(ti,12)|0,Fi=q[a+284>>2],xi=q[q[a>>2]+1e3>>2];;){if(Gi=Fi+(q[ui>>2]<<2)|0,vi=q[Gi>>2],1<=(0|(zi=q[ui+4>>2])))for(Bi=(ti=q[ui+8>>2])+w(zi,48)|0;(zi=q[ti+8>>2])&&((Ci=zi+-1|0)>>>0<=1?(zi=q[ti+4>>2],yi=u[xi+(zi+q[ti+12>>2]<<2)>>2],j(x(Ci-1?x(u[ti+44>>2]*x(yi*u[ti+20>>2]))+(f(0,vi),k()):x(u[ti+44>>2]*x(x(yi*u[ti+20>>2])+x(u[xi+(zi+q[ti+16>>2]<<2)>>2]*u[ti+24>>2])))+(f(0,vi),k()))),vi=b[0]):(q[16+Ai>>2]=zi,Y(4,1024,16+Ai|0))),(ti=ti+48|0)>>>0>>0;);if(f(0,vi),yi=k(),u[Gi>>2]=yi>>0>>0))break}if(!((0|(ti=q[a+612>>2]))<1))for(zi=(ui=q[a+616>>2])+w(ti,12)|0,wi=q[a+272>>2],a=q[q[a>>2]+1012>>2];;){if(Fi=wi+(q[ui>>2]<<2)|0,vi=q[Fi>>2],1<=(0|(xi=q[ui+4>>2])))for(Gi=(ti=q[ui+8>>2])+w(xi,48)|0;(xi=q[ti+8>>2])&&((Bi=xi+-1|0)>>>0<=1?(xi=q[ti+4>>2],yi=u[a+(xi+q[ti+12>>2]<<2)>>2],j(x(Bi-1?x(u[ti+44>>2]*x(yi*u[ti+20>>2]))+(f(0,vi),k()):x(u[ti+44>>2]*x(x(yi*u[ti+20>>2])+x(u[a+(xi+q[ti+16>>2]<<2)>>2]*u[ti+24>>2])))+(f(0,vi),k()))),vi=b[0]):(q[Ai>>2]=xi,Y(4,1024,Ai))),(ti=ti+48|0)>>>0>>0;);if(f(0,vi),yi=k(),u[Fi>>2]=yi>>0>>0))break}}}L=80+Ai|0}(a),function(a){var $h,fi,gi,hi,ii,Vh=0,Wh=0,Xh=0,Yh=0,Zh=x(0),_h=0,ai=0,bi=0,ci=0,di=0,ei=0;x(0);if(L=$h=L-32|0,Xh=q[a>>2],!(r[Xh+4|0]<4||(va(a,q[a+620>>2],q[a+624>>2],q[Xh+1040>>2],q[a+444>>2],q[Xh+892>>2]),_h=q[a>>2],r[_h+4|0]<5))){if(hi=q[_h+1048>>2],ii=q[_h+1044>>2],Xh=Yh=q[a+624>>2],!((0|(Vh=q[a+620>>2]))<1)){for(di=w(Vh,12)+Yh|0,ei=q[a+440>>2],ai=q[_h+1036>>2];;){if(Xh=ei+(q[Yh>>2]<<2)|0,Zh=x(q[Xh>>2]),1<=(0|(Wh=q[Yh+4>>2])))for(bi=(Vh=q[Yh+8>>2])+w(Wh,48)|0;(Wh=q[Vh+8>>2])&&((ci=Wh+-1|0)>>>0<=1?(Wh=q[Vh+4>>2],fi=u[ai+(Wh+q[Vh+12>>2]<<2)>>2],Zh=x(ci-1?Zh+x(u[Vh+44>>2]*x(fi*u[Vh+20>>2])):Zh+x(u[Vh+44>>2]*x(x(fi*u[Vh+20>>2])+x(u[ai+(Wh+q[Vh+16>>2]<<2)>>2]*u[Vh+24>>2]))))):(q[16+$h>>2]=Wh,Y(4,1024,16+$h|0))),(Vh=Vh+48|0)>>>0>>0;);if(Zh=(Zh=x(Zh+x(.0010000000474974513)))>2]=Vh,!((Yh=Yh+12|0)>>>0>>0))break}if(Xh=Yh=q[a+624>>2],!((0|(Vh=q[a+620>>2]))<1)){for(di=w(Vh,12)+Yh|0,ei=q[a+448>>2],ai=q[q[a>>2]+1032>>2];;){if(bi=ei+(q[Yh>>2]<<2)|0,Xh=q[bi>>2],1<=(0|(Wh=q[Yh+4>>2])))for(ci=(Vh=q[Yh+8>>2])+w(Wh,48)|0;(Wh=q[Vh+8>>2])&&((gi=Wh+-1|0)>>>0<=1?(Wh=q[Vh+4>>2],Zh=u[ai+(Wh+q[Vh+12>>2]<<2)>>2],j(x(gi-1?x(u[Vh+44>>2]*x(Zh*u[Vh+20>>2]))+(f(0,Xh),k()):x(u[Vh+44>>2]*x(x(Zh*u[Vh+20>>2])+x(u[ai+(Wh+q[Vh+16>>2]<<2)>>2]*u[Vh+24>>2])))+(f(0,Xh),k()))),Xh=b[0]):(q[$h>>2]=Wh,Y(4,1024,$h))),(Vh=Vh+48|0)>>>0>>0;);if(f(0,Xh),Zh=k(),u[bi>>2]=Zh>>0>>0))break}Vh=q[a+620>>2],Xh=q[a+624>>2]}}fa(Vh,Xh,ii,q[_h+1288>>2],q[_h+1292>>2],q[_h+1296>>2],q[a+452>>2]),fa(q[a+620>>2],q[a+624>>2],hi,q[_h+1300>>2],q[_h+1304>>2],q[_h+1308>>2],q[a+456>>2])}L=32+$h|0}(a),function(a){var Pg,Qg,Rg,Sg,Tg,Ug,Kg=0,Lg=0,Mg=0,Ng=0,Og=x(0);if(L=Pg=L-16|0,Lg=q[a>>2],!(r[Lg+4|0]<5||(0|(Ng=q[a+628>>2]))<1))for(Sg=(Mg=q[a+632>>2])+w(Ng,12)|0,Tg=q[a+536>>2],Ng=q[Lg+1284>>2];;){if(Qg=(q[Mg>>2]<<2)+Tg|0,Lg=q[Qg>>2],1<=(0|(Kg=q[Mg+4>>2])))for(Ug=(a=q[Mg+8>>2])+w(Kg,48)|0;(Kg=q[a+8>>2])&&((Rg=Kg+-1|0)>>>0<=1?(Kg=q[a+4>>2],Og=u[Ng+(Kg+q[a+12>>2]<<2)>>2],j(x(Rg-1?x(u[a+44>>2]*x(Og*u[a+20>>2]))+(f(0,Lg),k()):x(u[a+44>>2]*x(x(Og*u[a+20>>2])+x(u[Ng+(Kg+q[a+16>>2]<<2)>>2]*u[a+24>>2])))+(f(0,Lg),k()))),Lg=b[0]):(q[Pg>>2]=Kg,Y(4,1024,Pg))),(a=a+48|0)>>>0>>0;);if(f(0,Lg),Og=k(),u[Qg>>2]=Og>>0>>0))break}L=16+Pg|0}(a),function(a){var Qh,Th,mh=0,Oh=0,Ph=0,Rh=x(0),Sh=0;if(1<=(0|(mh=q[a+4>>2])))for(Th=(Oh=q[a+8>>2])+w(mh,12)|0,mh=q[a+40>>2],Ph=q[a+52>>2],a=Qh=q[a+48>>2];q[mh>>2]&&(Rh=u[Ph>>2],u[a>>2]=Rh,-1!=(0|(Sh=q[Oh+4>>2])))&&(u[a>>2]=Rh*u[(Sh<<2)+Qh>>2]),a=a+4|0,Ph=Ph+4|0,mh=mh+4|0,(Oh=Oh+12|0)>>>0>>0;);}(a),function(a){var lh,ih=0,jh=0,kh=0;if(1<=(0|(lh=q[a+304>>2])))for(ih=q[a+308>>2],jh=q[a+312>>2];q[jh>>2]&&n[q[ih+20>>2]](a,kh),jh=jh+4|0,ih=ih+32|0,(0|lh)!=(0|(kh=kh+1|0)););}(a),function(a){var Zg,_g,ch,gh,hh,Xg=0,Yg=0,$g=(x(0),x(0),0),ah=0,bh=0,dh=(x(0),0),eh=0,fh=0;if(1<=(0|(Xg=q[a+332>>2])))for(eh=(Yg=q[a+336>>2])+w(Xg,20)|0,fh=q[a+308>>2],dh=q[a+316>>2],hh=q[a+48>>2],Xg=q[a+448>>2],$g=q[a+444>>2],bh=q[a+424>>2];q[bh>>2]&&(-1!=(0|(ah=q[Yg+4>>2]))&&(u[Xg>>2]=u[(ah<<2)+hh>>2]*u[Xg>>2]),-1!=(0|(ah=q[Yg+8>>2])))&&(u[Xg>>2]=u[dh+(ah<<2)>>2]*u[Xg>>2],gh=q[$g>>2],n[q[24+(fh+(ah<<5)|0)>>2]](a,ah,gh,gh,q[Yg+16>>2])),$g=$g+4|0,Xg=Xg+4|0,bh=bh+4|0,(Yg=Yg+20|0)>>>0>>0;);if(!(r[q[a>>2]+4|0]<4||(0|(Xg=q[a+332>>2]))<1))for(ah=($g=q[a+336>>2])+w(Xg,20)|0,eh=q[a+328>>2],fh=q[a+324>>2],Yg=q[a+452>>2],Xg=q[a+456>>2],bh=q[a+424>>2];q[bh>>2]&&-1!=(0|(a=q[$g+8>>2]))&&(a=(dh=a<<4)+fh|0,Zg=x(u[Yg>>2]*u[a>>2]),u[Yg>>2]=Zg,_g=x(u[Yg+4>>2]*u[a+4>>2]),u[Yg+4>>2]=_g,ch=u[a+8>>2],q[Yg+12>>2]=1065353216,u[Yg+4>>2]=_g>2]=Zg>2]),u[Yg+8>>2]=Zg>2],_g=u[(a=eh+dh|0)>>2],Zg=x(x(Zg+_g)-x(Zg*_g)),u[Xg>>2]=Zg,_g=u[Xg+4>>2],ch=u[a+4>>2],_g=x(x(_g+ch)-x(_g*ch)),u[Xg+4>>2]=_g,ch=u[a+8>>2],q[Xg+12>>2]=1065353216,u[Xg+4>>2]=_g>2]=Zg>2],Zg=x(x(ch+Zg)-x(Zg*ch)),u[Xg+8>>2]=Zg>>0>>0;);}(a),function(a){var Ln,Mn,On,Ko,Lo,Mo,No,Oo,Po,Qo,Ro,So,To,Uo,Vo,Wo,Xo,Yo,Zo,_o,Nn=0;x(0),x(0),x(0),x(0),x(0),x(0),x(0);if(1<=(0|(Oo=q[a+500>>2])))for(Zo=q[a+536>>2],Po=q[a+444>>2],_o=q[a+504>>2];;){if(a=w(Nn,24)+_o|0,0<(0|(Qo=q[a+12>>2])))for(On=u[(Nn<<2)+Zo>>2],Ro=q[a+20>>2],So=q[a+16>>2],To=q[(q[a+4>>2]<<2)+Po>>2],Uo=q[(q[a+8>>2]<<2)+Po>>2],a=0;Vo=u[((Ln=1|a)<<2)+So>>2],Mn=s[(a<<1)+Ro>>1]<<3&262136,Ko=u[(Wo=(4|Mn)+To|0)>>2],Ln=s[(Ln<<1)+Ro>>1]<<3&262136,Lo=u[(Xo=(4|Ln)+Uo|0)>>2],Mo=u[(Mn=Mn+To|0)>>2],Yo=u[(a<<2)+So>>2],No=u[(Ln=Ln+Uo|0)>>2],u[Mn>>2]=Mo+x(On*x(Yo*x(No-Mo))),u[Wo>>2]=Ko+x(On*x(Yo*x(Lo-Ko))),u[Ln>>2]=No+x(On*x(Vo*x(Mo-No))),u[Xo>>2]=Lo+x(On*x(Vo*x(Ko-Lo))),(0|(a=a+2|0))<(0|Qo););if(!((0|(Nn=Nn+1|0))<(0|Oo)))break}}(a),n[q[1810]](a),function(a){var Rc,Sc,Uc,Vc,Gc=0,Ic=0,Jc=0,Kc=0,Lc=0,Mc=0,Nc=0,Oc=0,Pc=0,Qc=0,Tc=0;if(!((0|(Rc=q[a+480>>2]))<1)){for(Kc=(Sc=q[a+484>>2])+w(Rc,28)|0,Nc=q[a+424>>2],Oc=q[a+40>>2],Lc=q[a+44>>2],Tc=q[a+440>>2],Gc=Sc;;){if(1<=(0|(Mc=q[Gc+4>>2])))for(Qc=Gc+20|0,Pc=q[Gc+12>>2],Ic=0;Uc=q[4+(Jc=Pc+(Ic<<4)|0)>>2]<<2,Jc=1==q[(Vc=Jc)>>2],q[Vc+12>>2]=q[(q[(Jc?Oc:Nc)+Uc>>2]?(Jc?Lc:Tc)+Uc|0:Qc)>>2],(0|(Ic=Ic+1|0))<(0|Mc););if(!((Gc=Gc+28|0)>>>0>>0))break}if(!((0|Rc)<1))for(Tc=q[a+436>>2],Oc=0;;){if(Kc=w(Oc,28)+Sc|0,!(q[(Nc=Kc)+24>>2]<1)){for(Jc=q[a+488>>2],Ic=0;q[Jc+(Ic<<2)>>2]=-1,(0|(Ic=Ic+1|0))<(0|(Gc=q[Nc+24>>2])););if(!((0|Gc)<1))for(Gc=q[a+496>>2],Ic=0;q[Gc+(Ic<<2)>>2]=-1,(0|(Ic=Ic+1|0))>2];);}if(!(q[Kc+4>>2]<1)){for(Lc=q[a+492>>2],Ic=0;q[Lc+(Ic<<2)>>2]=-1,(0|(Ic=Ic+1|0))<(0|(Gc=q[Kc+4>>2])););if(!((0|Gc)<1))for(Mc=q[Kc+12>>2],Qc=q[a+496>>2],Ic=0;Pc=q[12+(Mc+(Ic<<4)|0)>>2]-q[Kc+20>>2]<<2,Gc=-1==(0|(Gc=q[(Jc=Pc+Qc|0)>>2]))?Pc+q[a+488>>2]|0:Lc+(Gc<<2)|0,q[Gc>>2]=Ic,(0|(Ic=(q[Jc>>2]=Ic)+1|0))>2];);}if(1<=(0|(Gc=q[Nc+24>>2])))for(Lc=q[Kc+8>>2],Qc=q[a+488>>2],Mc=0;;){if(-1!=(0|(Ic=q[Qc+(Mc<<2)>>2]))){for(Pc=q[a+492>>2],Jc=q[Kc+12>>2];Lc=(Gc=1==q[(Gc=Jc+(Ic<<4)|0)>>2]?(Gc=w(q[Gc+8>>2],28)+Sc|0,q[Gc+8>>2]=Lc,q[Gc>>2]):(q[Tc+(q[Gc+4>>2]<<2)>>2]=Lc,1))+Lc|0,(0|Ic)<(0|(Gc=q[Pc+(Ic<<2)>>2]))&&-1!=(0|(Ic=Gc)););Gc=q[Nc+24>>2]}if(!((0|(Mc=Mc+1|0))<(0|Gc)))break}if((0|Rc)==(0|(Oc=Oc+1|0)))break}}}(a),function(a){var Bg=0,Cg=0,Dg=0,Eg=0,Gg=0,Hg=x(0),Ig=0,Jg=0,Fg=q[a+332>>2];if(q[a+644>>2]){if(!(((q[a+428>>2]=0)|Fg)<1))for(;Bg=126,Ig=q[a+432>>2]+Dg|0,!q[(Cg=Dg<<2)+q[a+424>>2]>>2]|u[Cg+q[a+448>>2]>>2]==x(0)||(Bg=127),o[0|Ig]=Bg,(0|Fg)!=(0|(Dg=Dg+1|0)););}else if(q[a+428>>2]){if(Bg=r[q[a>>2]+4|0],!(((q[a+428>>2]=0)|Fg)<1))if(4<=Bg>>>0)for(;Hg=u[(Bg=Dg<<2)+q[a+448>>2]>>2],Eg=q[Bg+q[a+424>>2]>>2],Cg=Hg!=x(0)&0!=(0|Eg),Ig=q[a+432>>2]+Dg|0,Cg=(0|Cg)==(1&o[0|Ig])?Cg:2|Cg,Cg=Hg!=u[Bg+q[a+468>>2]>>2]?4|Cg:Cg,Cg=q[Bg+q[a+440>>2]>>2]==q[Bg+q[a+464>>2]>>2]?Cg:8|Cg,Bg=q[Bg+q[a+436>>2]>>2]==q[Bg+q[a+460>>2]>>2]?Cg:16|Cg,Bg=Eg?32|Bg:Bg,Eg=(Cg=Jg<<2)+q[a+452>>2]|0,Gg=Cg+q[a+472>>2]|0,(u[Eg>>2]!=u[Gg>>2]|u[Eg+4>>2]!=u[Gg+4>>2]|(u[Eg+8>>2]!=u[Gg+8>>2]|u[Eg+12>>2]!=u[Gg+12>>2])||(Eg=Cg+q[a+456>>2]|0,Cg=Cg+q[a+476>>2]|0,u[Eg>>2]!=u[Cg>>2]|u[Eg+4>>2]!=u[Cg+4>>2]|u[Eg+8>>2]!=u[Cg+8>>2])||u[Eg+12>>2]!=u[Cg+12>>2])&&(Bg|=64),o[0|Ig]=Bg,Jg=Jg+4|0,(0|Fg)!=(0|(Dg=Dg+1|0)););else for(;Hg=u[(Bg=Dg<<2)+q[a+448>>2]>>2],Eg=q[Bg+q[a+424>>2]>>2],Cg=Hg!=x(0)&0!=(0|Eg),Gg=q[a+432>>2]+Dg|0,Cg=(0|Cg)==(1&o[0|Gg])?Cg:2|Cg,Cg=Hg!=u[Bg+q[a+468>>2]>>2]?4|Cg:Cg,Cg=q[Bg+q[a+440>>2]>>2]==q[Bg+q[a+464>>2]>>2]?Cg:8|Cg,Bg=q[Bg+q[a+436>>2]>>2]==q[Bg+q[a+460>>2]>>2]?Cg:16|Cg,o[0|Gg]=Eg?32|Bg:Bg,(0|Fg)!=(0|(Dg=Dg+1|0)););}else if(!((0|Fg)<1))for(;!q[(Bg=Dg<<2)+q[a+424>>2]>>2]|u[Bg+q[a+448>>2]>>2]==x(0)?(Bg=q[a+432>>2]+Dg|0,o[0|Bg]=254&r[0|Bg]):(Bg=q[a+432>>2]+Dg|0,o[0|Bg]=1|r[0|Bg]),(0|Fg)!=(0|(Dg=Dg+1|0)););}(a),q[a+644>>2]=0}function va(a,Wa,Xa,Ya,Za,_a){var fb,gb,hb,jb,kb,cb,db,ab=0,bb=0,eb=0,ib=0;if(L=cb=L-32|0,1<=(0|Wa))for(kb=w(Wa,12)+Xa|0;;){if(!((0|(ab=q[Xa+4>>2]))<1))if(fb=(Wa=q[Xa+8>>2])+w(ab,48)|0,ab=q[Xa>>2]<<2,1<=(0|(db=q[ab+_a>>2])))for(db<<=1,gb=q[q[a>>2]+1052>>2],hb=q[Za+ab>>2];;){b:if(ab=q[Wa+8>>2]){c:{if((bb=ab+-1|0)>>>0<=1){if(ab=(q[Wa+4>>2]<<2)+Ya|0,ib=(q[ab+(q[Wa+12>>2]<<2)>>2]<<2)+gb|0,bb-1)break c;for(eb=(q[ab+(q[Wa+16>>2]<<2)>>2]<<2)+gb|0,ab=0;u[(jb=(bb=ab<<2)+hb|0)>>2]=u[jb>>2]+x(u[Wa+44>>2]*x(x(u[bb+ib>>2]*u[Wa+20>>2])+x(u[bb+eb>>2]*u[Wa+24>>2]))),(0|db)!=(0|(ab=ab+1|0)););break b}q[cb>>2]=ab,Y(4,1024,cb);break b}for(ab=0;u[(eb=(bb=ab<<2)+hb|0)>>2]=u[eb>>2]+x(u[Wa+44>>2]*x(u[bb+ib>>2]*u[Wa+20>>2])),(0|db)!=(0|(ab=ab+1|0)););}if(!((Wa=Wa+48|0)>>>0>>0))break}else for(;3<=(ab=q[Wa+8>>2])>>>0&&(q[16+cb>>2]=ab,Y(4,1024,16+cb|0)),(Wa=Wa+48|0)>>>0>>0;);if(!((Xa=Xa+12|0)>>>0>>0))break}L=32+cb|0}function wa(a,Wa,Xa){var Ya;Wa|=0,Xa|=0,L=Ya=L+-64|0;a:{if(a|=0)if(Wa)if((Wa+15&-16)!=(0|Wa))q[52+Ya>>2]=1522,q[48+Ya>>2]=2361,Y(4,1294,48+Ya|0);else{if(Wa=function(a,Il,Jl){var jm,$l=0,hm=0,im=0,km=0,lm=0,mm=0,nm=0,om=0,pm=0,qm=0,rm=0,sm=0,tm=0,um=x(0),vm=0,wm=0,xm=0,ym=0,zm=0;if(ca(16+(L=jm=L-576|0)|0,0,560),Fa(a,16+jm|0,12+jm|0),(km=q[12+jm>>2])>>>0<=Jl>>>0){if($l=(hm=ca(Il,0,km))+q[16+jm>>2]|0,q[$l+8>>2]=hm+q[20+jm>>2],q[$l+40>>2]=hm+q[24+jm>>2],q[$l+44>>2]=hm+q[28+jm>>2],q[$l+48>>2]=hm+q[32+jm>>2],q[$l+52>>2]=hm+q[36+jm>>2],q[$l+16>>2]=hm+q[40+jm>>2],q[$l+24>>2]=hm+q[44+jm>>2],q[$l+28>>2]=hm+q[48+jm>>2],q[$l+32>>2]=hm+q[52+jm>>2],q[$l+36>>2]=hm+q[56+jm>>2],Il=q[a+704>>2],q[$l+308>>2]=hm+q[60+jm>>2],q[$l+312>>2]=hm+q[64+jm>>2],q[$l+316>>2]=hm+q[68+jm>>2],q[$l+320>>2]=hm+q[72+jm>>2],q[$l+324>>2]=hm+q[76+jm>>2],q[$l+328>>2]=hm+q[80+jm>>2],q[$l+60>>2]=hm+q[84+jm>>2],q[$l+144>>2]=hm+q[88+jm>>2],q[$l+148>>2]=hm+q[92+jm>>2],Jl=hm+q[96+jm>>2]|0,q[$l+152>>2]=Jl,!((0|(km=q[Il+8>>2]))<1)&&(Il=hm+q[100+jm>>2]|0,q[Jl>>2]=Il,1!=(0|km)))for(Jl=1;Il=(15+(q[q[a+796>>2]+(im<<2)>>2]<<3)&-16)+Il|0,q[q[$l+152>>2]+(Jl<<2)>>2]=Il,(0|km)!=(0|(Jl=(im=Jl)+1|0)););if(q[$l+156>>2]=hm+q[104+jm>>2],q[$l+160>>2]=hm+q[108+jm>>2],q[$l+68>>2]=hm+q[112+jm>>2],q[$l+76>>2]=hm+q[116+jm>>2],q[$l+80>>2]=hm+q[120+jm>>2],q[$l+84>>2]=hm+q[124+jm>>2],q[$l+88>>2]=hm+q[128+jm>>2],q[$l+92>>2]=hm+q[132+jm>>2],q[$l+96>>2]=hm+q[136+jm>>2],q[$l+100>>2]=hm+q[140+jm>>2],q[$l+104>>2]=hm+q[144+jm>>2],q[$l+108>>2]=hm+q[148+jm>>2],q[$l+112>>2]=hm+q[152+jm>>2],q[$l+116>>2]=hm+q[156+jm>>2],q[$l+120>>2]=hm+q[160+jm>>2],q[$l+124>>2]=hm+q[164+jm>>2],q[$l+128>>2]=hm+q[168+jm>>2],q[$l+132>>2]=hm+q[172+jm>>2],q[$l+136>>2]=hm+q[176+jm>>2],q[$l+140>>2]=hm+q[180+jm>>2],q[$l+168>>2]=hm+q[184+jm>>2],q[$l+264>>2]=hm+q[188+jm>>2],q[$l+268>>2]=hm+q[192+jm>>2],q[$l+272>>2]=hm+q[196+jm>>2],q[$l+276>>2]=hm+q[200+jm>>2],q[$l+280>>2]=hm+q[204+jm>>2],q[$l+284>>2]=hm+q[208+jm>>2],q[$l+288>>2]=hm+q[212+jm>>2],q[$l+292>>2]=hm+q[216+jm>>2],q[$l+296>>2]=hm+q[220+jm>>2],q[$l+300>>2]=hm+q[224+jm>>2],q[$l+176>>2]=hm+q[228+jm>>2],q[$l+184>>2]=hm+q[232+jm>>2],q[$l+188>>2]=hm+q[236+jm>>2],q[$l+192>>2]=hm+q[240+jm>>2],q[$l+196>>2]=hm+q[244+jm>>2],q[$l+200>>2]=hm+q[248+jm>>2],q[$l+204>>2]=hm+q[252+jm>>2],q[$l+208>>2]=hm+q[256+jm>>2],q[$l+212>>2]=hm+q[260+jm>>2],q[$l+216>>2]=hm+q[264+jm>>2],q[$l+220>>2]=hm+q[268+jm>>2],q[$l+224>>2]=hm+q[272+jm>>2],q[$l+228>>2]=hm+q[276+jm>>2],q[$l+232>>2]=hm+q[280+jm>>2],q[$l+236>>2]=hm+q[284+jm>>2],q[$l+240>>2]=hm+q[288+jm>>2],q[$l+244>>2]=hm+q[292+jm>>2],q[$l+248>>2]=hm+q[296+jm>>2],q[$l+252>>2]=hm+q[300+jm>>2],q[$l+256>>2]=hm+q[304+jm>>2],q[$l+260>>2]=hm+q[308+jm>>2],Il=q[a+704>>2],q[$l+336>>2]=hm+q[312+jm>>2],q[$l+424>>2]=hm+q[316+jm>>2],q[$l+432>>2]=hm+q[320+jm>>2],q[$l+436>>2]=hm+q[324+jm>>2],q[$l+440>>2]=hm+q[328+jm>>2],Jl=hm+q[332+jm>>2]|0,q[$l+444>>2]=Jl,!((0|(km=q[Il+16>>2]))<1)&&(im=hm+q[336+jm>>2]|0,q[Jl>>2]=im,(Jl=1)!=(0|km)))for(Il=0;im=(15+(q[q[a+892>>2]+(Il<<2)>>2]<<3)&-16)+im|0,q[q[$l+444>>2]+(Jl<<2)>>2]=im,(0|km)!=(0|(Jl=(Il=Jl)+1|0)););if(q[$l+448>>2]=hm+q[340+jm>>2],q[$l+452>>2]=hm+q[344+jm>>2],q[$l+456>>2]=hm+q[348+jm>>2],q[$l+460>>2]=hm+q[352+jm>>2],q[$l+464>>2]=hm+q[356+jm>>2],q[$l+468>>2]=hm+q[360+jm>>2],q[$l+472>>2]=hm+q[364+jm>>2],q[$l+476>>2]=hm+q[368+jm>>2],q[$l+344>>2]=hm+q[372+jm>>2],q[$l+352>>2]=hm+q[376+jm>>2],q[$l+356>>2]=hm+q[380+jm>>2],q[$l+360>>2]=hm+q[384+jm>>2],q[$l+364>>2]=hm+q[388+jm>>2],q[$l+368>>2]=hm+q[392+jm>>2],q[$l+372>>2]=hm+q[396+jm>>2],q[$l+376>>2]=hm+q[400+jm>>2],q[$l+380>>2]=hm+q[404+jm>>2],q[$l+384>>2]=hm+q[408+jm>>2],q[$l+388>>2]=hm+q[412+jm>>2],q[$l+392>>2]=hm+q[416+jm>>2],q[$l+396>>2]=hm+q[420+jm>>2],q[$l+400>>2]=hm+q[424+jm>>2],q[$l+404>>2]=hm+q[428+jm>>2],q[$l+408>>2]=hm+q[432+jm>>2],q[$l+412>>2]=hm+q[436+jm>>2],q[$l+416>>2]=hm+q[440+jm>>2],q[$l+420>>2]=hm+q[444+jm>>2],Il=q[448+jm>>2],Jl=q[452+jm>>2],q[$l+552>>2]=hm+q[456+jm>>2],q[$l+548>>2]=Jl+hm,q[$l+544>>2]=Il+hm,q[$l+560>>2]=hm+q[460+jm>>2],Il=q[a+704>>2],nm=hm+q[464+jm>>2]|0,q[$l+568>>2]=nm,1<=(0|(mm=q[Il+48>>2])))for(im=hm+q[468+jm>>2]|0,Il=hm+q[472+jm>>2]|0,lm=hm+q[476+jm>>2]|0,om=q[a+1072>>2],Jl=0;km=nm+w(Jl,36)|0,q[km+20>>2]=lm,q[km+16>>2]=Il,q[km>>2]=im,im=((km=q[om+(Jl<<2)>>2])<<2)+im|0,lm=(km=1<>2],km=hm+q[516+jm>>2]|0,q[$l+484>>2]=km,1<=(0|(Il=q[Il+72>>2])))for(im=hm+q[520+jm>>2]|0,lm=q[a+1212>>2],Jl=0;q[12+(km+w(Jl,28)|0)>>2]=im,im=(q[lm+(Jl<<2)>>2]<<4)+im|0,(0|Il)!=(0|(Jl=Jl+1|0)););q[$l+488>>2]=hm+q[524+jm>>2],q[$l+492>>2]=hm+q[528+jm>>2],q[$l+496>>2]=hm+q[532+jm>>2],q[$l+504>>2]=hm+q[536+jm>>2],q[$l+536>>2]=hm+q[540+jm>>2],q[$l+512>>2]=hm+q[544+jm>>2],q[$l+520>>2]=hm+q[548+jm>>2],q[$l+524>>2]=hm+q[552+jm>>2],q[$l+528>>2]=hm+q[556+jm>>2],q[$l+532>>2]=hm+q[560+jm>>2];c:{if(4<=(mm=r[a+4|0])>>>0){if(q[$l+576>>2]=hm+q[480+jm>>2],q[$l+584>>2]=hm+q[484+jm>>2],Il=q[a+704>>2],Jl=q[492+jm>>2],km=hm+q[488+jm>>2]|0,q[$l+592>>2]=km,1<=(0|(Il=q[Il+104>>2])))for(im=Jl+hm|0,lm=q[a+1104>>2],Jl=0;q[40+(km+w(Jl,48)|0)>>2]=im,im=(q[lm+(Jl<<2)>>2]<<2)+im|0,(0|Il)!=(0|(Jl=Jl+1|0)););q[$l+608>>2]=hm+q[500+jm>>2],q[$l+624>>2]=hm+q[508+jm>>2]}else{if(Il=q[572+jm>>2],Jl=q[568+jm>>2],q[$l+636>>2]=hm+q[564+jm>>2],q[$l+640>>2]=Jl+hm,q[q[a+704>>2]+20>>2]<1)break c;for(km=Il+hm|0,nm=0;;){e:{if((0|(im=q[(Il=nm<<2)+q[a+952>>2]>>2]))<=0)Il=Il+q[$l+636>>2]|0;else{for(lm=im+(Jl=q[Il+q[a+948>>2]>>2])|0,om=q[a+1060>>2],im=0;im=q[om+(Jl<<2)>>2]+im|0,(0|(Jl=Jl+1|0))<(0|lm););if(Il=Il+q[$l+636>>2]|0,Jl=km,im)break e}Jl=im=0}if(q[Il>>2]=Jl,km=(im<<2)+km|0,!((0|(nm=nm+1|0))>2]+20>>2]))break}}mm>>>0<5||(q[$l+600>>2]=hm+q[496+jm>>2],q[$l+616>>2]=hm+q[504+jm>>2],q[$l+632>>2]=hm+q[512+jm>>2])}q[$l+644>>2]=1,q[$l>>2]=a,q[$l+648>>2]=1&o[q[a+708>>2]+20|0],hm=q[a+704>>2],nm=q[hm+20>>2];g:if(!((0|(q[$l+540>>2]=nm))<1)){if(Il=nm+-1|0,om=q[a+952>>2],pm=q[a+940>>2],qm=q[a+932>>2],rm=q[a+936>>2],sm=q[a+924>>2],tm=q[a+928>>2],vm=q[$l+552>>2],xm=q[$l+544>>2],mm>>>0<4)for(;;)if(Jl=xm+w(Il,52)|0,im=(km=Il<<2)+tm|(q[Jl>>2]=0),q[Jl+4>>2]=q[im>>2],q[Jl+8>>2]=q[(lm=km+sm|0)>>2],u[Jl+12>>2]=u[lm>>2]-u[im>>2],q[Jl+16>>2]=q[km+rm>>2],q[Jl+44>>2]=q[(im=km+qm|0)>>2],um=Aa(x(q[km+pm>>2])),u[Jl+20>>2]=um,u[Jl+24>>2]=um*x(1.5),wm=q[km+om>>2],lm=0,lm=(q[Jl+32>>2]=wm)?q[$l+560>>2]+w(q[km+q[a+948>>2]>>2],28)|0:lm,q[Jl+48>>2]=1,q[Jl+28>>2]=lm,q[km+vm>>2]=q[im>>2],Jl=0<(0|Il),Il=Il+-1|0,!Jl)break g;for(wm=q[a+960>>2],zm=q[a+944>>2];Jl=xm+w(Il,52)|0,q[Jl>>2]=q[(im=Il<<2)+zm>>2],q[Jl+4>>2]=q[(km=im+tm|0)>>2],q[Jl+8>>2]=q[(lm=im+sm|0)>>2],u[Jl+12>>2]=u[lm>>2]-u[km>>2],q[Jl+16>>2]=q[im+rm>>2],q[Jl+44>>2]=q[(ym=im+qm|0)>>2],um=Aa(x(q[im+pm>>2])),u[Jl+20>>2]=um,u[Jl+24>>2]=um*x(1.5),lm=q[im+om>>2],q[Jl+32>>2]=lm,q[Jl+28>>2]=lm?q[$l+560>>2]+w(q[im+q[a+948>>2]>>2],28)|0:0,km=q[im+wm>>2],km=(q[Jl+40>>2]=km)?q[$l+584>>2]+w(q[im+q[a+956>>2]>>2],28)|0:0,q[Jl+48>>2]=1,q[Jl+36>>2]=km,q[im+vm>>2]=q[ym>>2],Jl=0<(0|Il),Il=Il+-1|0,Jl;);}if(4<=mm>>>0?(q[$l+548>>2]=q[a+944>>2],km=a):(ca(q[$l+548>>2],0,nm<<2),km=q[$l>>2],hm=q[km+704>>2]),im=q[hm+52>>2],1<=(0|(q[$l+556>>2]=im)))for(Jl=q[km+1056>>2],lm=q[km+1192>>2],nm=q[km+1060>>2],mm=q[$l+560>>2];Il=mm+w(im=im+-1|0,28)|0,q[Il>>2]=q[(om=im<<2)+nm>>2],om=q[Jl+om>>2],q[Il+24>>2]=1,q[Il+16>>2]=0,q[Il+20>>2]=1,q[Il+8>>2]=0,q[Il+12>>2]=0,q[Il+4>>2]=lm+(om<<2),0<(0|im););if(im=q[hm+48>>2],1<=(0|(q[$l+564>>2]=im))){for(;;){if(Il=q[$l+568>>2]+w(im=im+-1|0,36)|0,lm=q[(hm=im<<2)+q[km+1072>>2]>>2],1<=(0|(q[Il+4>>2]=lm)))for(Jl=0;q[q[Il>>2]+(Jl<<2)>>2]=q[$l+560>>2]+w(q[q[km+1064>>2]+(q[hm+q[km+1068>>2]>>2]+Jl<<2)>>2],28),(0|lm)!=(0|(Jl=Jl+1|0)););if(q[Il+24>>2]=1,q[Il+28>>2]=1,q[Il+8>>2]=1<>2],hm=q[km+704>>2]}if(Il=q[hm>>2],(0|(q[$l+4>>2]=Il))<1)Jl=0;else{for(om=q[km+732>>2],pm=q[km+736>>2],qm=q[km+740>>2],lm=q[km+720>>2],rm=q[$l+52>>2],nm=q[$l+568>>2],sm=q[$l+8>>2],im=Il;mm=sm+w(im=im+-1|0,12)|0,q[mm>>2]=nm+w(q[(Jl=im<<2)+lm>>2],36),q[mm+4>>2]=q[Jl+qm>>2],q[mm+8>>2]=q[Jl+pm>>2],u[Jl+rm>>2]=q[Jl+om>>2]?x(1):x(0),0<(0|im););for(mm=q[$l+16>>2],Jl=0;im=q[8+(nm+w(q[(om=(Il=Il+-1|0)<<2)+lm>>2],36)|0)>>2],Jl=Jl+(q[mm+om>>2]=im)|0,0<(0|Il););Il=q[$l+4>>2]}if(q[$l+12>>2]=Il,q[$l+20>>2]=Jl,Il=q[hm+4>>2],1<=(0|(q[$l+304>>2]=Il))){for(;Jl=q[$l+308>>2]+((Il=Il+-1|0)<<5)|0,q[Jl>>2]=q[$l+568>>2]+w(q[(im=Il<<2)+q[km+752>>2]>>2],36),q[Jl+4>>2]=q[im+q[km+764>>2]>>2],q[Jl+8>>2]=q[im+q[km+768>>2]>>2],lm=q[im+q[km+772>>2]>>2],q[Jl+12>>2]=lm,hm=q[im+q[km+776>>2]>>2],q[Jl+16>>2]=hm,q[Jl+28>>2]=q[im+q[km+760>>2]>>2],lm>>>0<=1?lm-1?(q[20+(q[$l+60>>2]+w(hm,24)|0)>>2]=Il,q[Jl+24>>2]=1,q[Jl+20>>2]=2):(q[8+(q[$l+168>>2]+w(hm,12)|0)>>2]=Il,q[Jl+24>>2]=3,q[Jl+20>>2]=4):Y(4,1179,0),0<(0|Il););km=q[$l>>2],hm=q[km+704>>2]}im=q[hm+8>>2];k:if(!((0|(q[$l+56>>2]=im))<1)){if(Jl=im+-1|0,nm=q[km+796>>2],mm=q[km+804>>2],om=q[km+800>>2],pm=q[km+780>>2],qm=q[$l+568>>2],rm=q[$l+60>>2],r[km+4|0]<2)for(;;)if(Il=rm+w(Jl,24)|0,q[Il>>2]=qm+w(q[(lm=Jl<<2)+pm>>2],36),q[Il+4>>2]=q[lm+om>>2],q[Il+8>>2]=q[lm+mm>>2],lm=q[lm+nm>>2],q[Il+12>>2]=0,q[Il+16>>2]=lm,Il=0<(0|Jl),Jl=Jl+-1|0,!Il)break k;for(sm=q[km+808>>2];Il=rm+w(Jl,24)|0,q[Il>>2]=qm+w(q[(lm=Jl<<2)+pm>>2],36),q[Il+4>>2]=q[lm+om>>2],q[Il+8>>2]=q[lm+mm>>2],q[Il+16>>2]=q[lm+nm>>2],q[Il+12>>2]=q[lm+sm>>2],Il=0<(0|Jl),Jl=Jl+-1|0,Il;);}if(Jl=q[hm+12>>2],1<=(0|(q[$l+164>>2]=Jl)))for(lm=q[km+828>>2],nm=q[km+812>>2],mm=q[$l+568>>2],om=q[$l+168>>2],Il=Jl;pm=om+w(Il=Il+-1|0,12)|0,q[pm>>2]=mm+w(q[(qm=Il<<2)+nm>>2],36),q[pm+4>>2]=q[lm+qm>>2],0<(0|Il););if(((Il=0)|im)<1)lm=0;else{for(nm=q[$l+68>>2],mm=q[$l+60>>2],lm=0;Jl=q[q[mm+w(im=im+-1|0,24)>>2]+8>>2],lm=(q[nm+(im<<2)>>2]=Jl)+lm|0,0<(0|im););Jl=q[$l+164>>2],im=q[$l+56>>2]}if(q[$l+64>>2]=im,q[$l+72>>2]=lm,im=$l,1<=(0|Jl)){for(nm=q[$l+176>>2],mm=q[$l+168>>2];lm=q[q[mm+w(Jl=Jl+-1|0,12)>>2]+8>>2],Il=Il+(q[nm+(Jl<<2)>>2]=lm)|0,0<(0|Jl););Jl=q[$l+164>>2]}if(q[im+172>>2]=Jl,q[$l+180>>2]=Il,lm=q[hm+16>>2],1<=(0|(q[$l+332>>2]=lm))){for(om=q[km+872>>2],pm=q[km+892>>2],qm=q[km+880>>2],rm=q[km+876>>2],nm=q[km+852>>2],mm=q[$l+568>>2],sm=q[$l+336>>2],Il=lm;Jl=sm+w(Il=Il+-1|0,20)|0,q[Jl>>2]=mm+w(q[(im=Il<<2)+nm>>2],36),q[Jl+4>>2]=q[im+rm>>2],q[Jl+8>>2]=q[im+qm>>2],q[Jl+16>>2]=q[im+pm>>2],q[Jl+12>>2]=q[im+om>>2],0<(0|Il););for(im=q[$l+344>>2],Jl=0;Il=q[8+(mm+w(q[(om=(lm=lm+-1|0)<<2)+nm>>2],36)|0)>>2],Jl=(q[im+om>>2]=Il)+Jl|0,0<(0|lm););if(q[$l+348>>2]=Jl,lm=q[$l+332>>2],!((0|(q[$l+340>>2]=lm))<1))for(Jl=lm<<2,im=q[$l+456>>2],nm=q[$l+452>>2];q[(mm=(Il=Jl+-4|0)<<2)+nm>>2]=1065353216,q[(om=(Jl<<=2)-4|0)+nm>>2]=1065353216,q[(pm=(Jl=Jl+-12|0)+nm|0)>>2]=1065353216,q[pm+4>>2]=1065353216,q[im+mm>>2]=0,q[im+om>>2]=1065353216,q[(Jl=Jl+im|0)>>2]=0,q[Jl+4>>2]=0,Jl=Il,0<(0|(lm=lm+-1|0)););}else q[$l+340>>2]=lm,q[$l+348>>2]=0;if(lm=q[hm+72>>2],1<=(0|(q[$l+480>>2]=lm)))for(om=q[km+1208>>2],pm=q[km+1224>>2],qm=q[km+1220>>2],rm=q[km+1216>>2],sm=q[km+1212>>2],tm=q[$l+484>>2],im=0;;){if(Il=tm+w(im,28)|0,nm=q[(Jl=im<<2)+sm>>2],q[Il+4>>2]=nm,q[Il>>2]=q[Jl+rm>>2],mm=q[Jl+qm>>2],q[Il+16>>2]=mm,vm=q[Jl+pm>>2],q[Il+20>>2]=vm,q[Il+8>>2]=0,q[Il+24>>2]=1+(mm-vm|0),1<=(0|nm))for(vm=q[Jl+om>>2],xm=q[Il+12>>2],wm=q[km+1236>>2],zm=q[km+1228>>2],ym=q[km+1232>>2],Jl=0;q[4+(Il=xm+(Jl<<4)|0)>>2]=q[(mm=Jl+vm<<2)+ym>>2],q[Il>>2]=q[mm+zm>>2],mm=q[mm+wm>>2],q[Il+12>>2]=0,q[Il+8>>2]=mm,(0|nm)!=(0|(Jl=Jl+1|0)););if((0|lm)==(0|(im=im+1|0)))break}if(Jl=q[hm+80>>2],(0|(q[$l+500>>2]=Jl))<1)im=0;else{for(mm=q[km+1280>>2],om=q[km+1268>>2],pm=q[km+1276>>2],qm=q[km+1272>>2],rm=q[km+1264>>2],sm=q[km+1260>>2],lm=q[km+1248>>2],nm=q[$l+568>>2],tm=q[$l+504>>2];Il=tm+w(Jl=Jl+-1|0,24)|0,q[Il>>2]=nm+w(q[(im=Jl<<2)+lm>>2],36),q[Il+4>>2]=q[im+sm>>2],q[Il+8>>2]=q[im+rm>>2],q[Il+12>>2]=q[im+qm>>2],im=q[im+om>>2],q[Il+20>>2]=mm+(im<<1),q[Il+16>>2]=pm+(im<<2),0<(0|Jl););if((0|(Jl=q[$l+500>>2]))<1)im=0;else{for(mm=q[$l+512>>2],im=0;Il=q[8+(nm+w(q[(om=(Jl=Jl+-1|0)<<2)+lm>>2],36)|0)>>2],im=(q[mm+om>>2]=Il)+im|0,0<(0|Jl););Jl=q[$l+500>>2]}}q[$l+508>>2]=Jl,q[$l+516>>2]=im;o:if(4<=r[a+4|0]){if(!((lm=r[km+4|0])>>>0<4)){if(Jl=q[hm+120>>2],1<=(0|(q[$l+572>>2]=Jl))){for(mm=q[km+1172>>2],om=q[$l+576>>2];lm=(0|(hm=q[(Il=(Jl=Jl+-1|0)<<2)+mm>>2]))<0?hm=nm=im=0:(im=(lm=q[Il+q[km+1176>>2]>>2]<<2)+q[km+1188>>2]|0,nm=q[Il+q[km+1180>>2]>>2],hm=q[$l+544>>2]+w(hm,52)|0,lm+q[km+1184>>2]|0),Il=om+w(Jl,20)|0,q[Il+12>>2]=nm,q[Il+8>>2]=im,q[Il+4>>2]=lm,q[Il>>2]=hm,0<(0|Jl););if(km=q[$l>>2],(lm=r[km+4|0])>>>0<4)break o}if(hm=q[km+704>>2],im=q[hm+100>>2],1<=(0|(q[$l+580>>2]=im)))for(nm=q[km+1084>>2],mm=q[km+1076>>2],om=q[km+1192>>2],pm=q[km+1080>>2],qm=q[$l+584>>2];Il=qm+w(im=im+-1|0,28)|0,q[Il>>2]=q[(Jl=im<<2)+pm>>2],q[Il+4>>2]=om+(q[Jl+mm>>2]<<2),Jl=q[Jl+nm>>2],q[Il+20>>2]=1,q[Il+24>>2]=1,q[Il+12>>2]=0,q[Il+16>>2]=0,q[Il+8>>2]=Jl,0<(0|im););if(im=q[hm+104>>2],1<=(0|(q[$l+588>>2]=im))){for(;;){if(Il=q[$l+592>>2]+w(im=im+-1|0,48)|0,q[Il>>2]=q[$l+584>>2]+w(q[(lm=im<<2)+q[km+1088>>2]>>2],28),Jl=q[lm+q[km+1092>>2]>>2],q[Il+28>>2]=1,q[Il+32>>2]=1,q[Il+8>>2]=0,q[Il+4>>2]=Jl,hm=q[lm+q[km+1104>>2]>>2],1<=(0|(q[Il+36>>2]=hm)))for(Jl=0;q[q[Il+40>>2]+(Jl<<2)>>2]=q[$l+576>>2]+w(q[q[km+1168>>2]+(q[lm+q[km+1100>>2]>>2]+Jl<<2)>>2],20),(0|hm)!=(0|(Jl=Jl+1|0)););if(!(1<=(0|im)))break}km=q[$l>>2],lm=r[km+4|0]}if(!(lm>>>0<4)){if(lm=q[a+704>>2],Jl=q[lm+108>>2],1<=(0|(q[$l+604>>2]=Jl)))for(hm=q[a+1124>>2],nm=q[a+1128>>2],mm=q[a+1120>>2],om=q[$l+592>>2],pm=q[$l+608>>2];Il=pm+w(Jl=Jl+-1|0,12)|0,q[Il>>2]=q[(im=Jl<<2)+mm>>2],q[Il+4>>2]=q[im+nm>>2],q[Il+8>>2]=om+w(q[hm+im>>2],48),0<(0|Jl););if(Jl=q[lm+112>>2],1<=(0|(q[$l+620>>2]=Jl)))for(lm=q[a+1148>>2],hm=q[a+1152>>2],nm=q[a+1144>>2],mm=q[$l+592>>2],om=q[$l+624>>2];Il=om+w(Jl=Jl+-1|0,12)|0,q[Il>>2]=q[(im=Jl<<2)+nm>>2],q[Il+4>>2]=q[hm+im>>2],q[Il+8>>2]=mm+w(q[im+lm>>2],48),0<(0|Jl););if(im=q[km+1192>>2],Il=q[q[km+704>>2]+20>>2],q[$l+640>>2]=q[km+972>>2],lm=q[km+964>>2],q[$l+636>>2]=lm,!((0|Il)<(Jl=1))&&(q[lm>>2]=im+(q[q[km+968>>2]>>2]<<2),1!=(0|Il)))for(;q[(lm=Jl<<2)+q[$l+636>>2]>>2]=im+(q[lm+q[km+968>>2]>>2]<<2),(0|Il)!=(0|(Jl=Jl+1|0)););}}}else if(!(q[hm+20>>2]<1))for(hm=0;;){if(im=q[(nm=hm<<2)+q[$l+636>>2]>>2],1<=((Il=0)|(Jl=q[nm+q[km+952>>2]>>2])))for(pm=Jl+(mm=q[nm+q[km+948>>2]>>2])|0,qm=q[km+1060>>2],rm=q[km+1056>>2];;){if(1<=(0|(om=q[(Jl=mm<<2)+qm>>2])))for(sm=om+(lm=q[Jl+rm>>2])|0,tm=q[km+1192>>2];;){om=im+(Il<<2)|0,um=u[tm+(lm<<2)>>2],Jl=im;q:{if(0<(0|Il))for(;;){if(u[Jl>>2]==um)break q;if(!((Jl=Jl+4|0)>>>0>>0))break}u[om>>2]=um,Il=Il+1|0}if(!((0|(lm=lm+1|0))<(0|sm)))break}if(!((0|(mm=mm+1|0))<(0|pm)))break}if(function(a,Sm){var un,Kn,xn=0,yn=0,Jn=0;q[8+(L=un=L-208|0)>>2]=1,q[12+un>>2]=0;a:if(Kn=Sm<<2){for(q[16+un>>2]=4,Jn=Sm=q[20+un>>2]=4,xn=2;Sm=(Jn+4|0)+(yn=Sm)|0,q[(16+un|0)+(xn<<2)>>2]=Sm,xn=xn+1|0,Jn=yn,Sm>>>0>>0;);if((yn=(a+Kn|0)-4|0)>>>0<=a>>>0)Sm=xn=1;else for(Sm=xn=1;Sm=3==(3&xn)?(ta(a,Sm,16+un|0),ma(8+un|0,2),Sm+2|0):(t[(16+un|0)+((Jn=Sm+-1|0)<<2)>>2]>=yn-a>>>0?la(a,8+un|0,Sm,0,16+un|0):ta(a,Sm,16+un|0),1==(0|Sm)?(ka(8+un|0,1),0):(ka(8+un|0,Jn),1)),xn=1|q[8+un>>2],q[8+un>>2]=xn,(a=a+4|0)>>>0>>0;);for(la(a,8+un|0,Sm,0,16+un|0);;){e:{f:{g:{if(!(1!=(0|Sm)|1!=(0|xn))){if(q[12+un>>2])break g;break a}if(1<(0|Sm))break f}ma(8+un|0,yn=Oa(8+un|0)),xn=q[8+un>>2],Sm=Sm+yn|0;break e}ka(8+un|0,2),q[8+un>>2]=7^q[8+un>>2],ma(8+un|0,1),la((Jn=a+-4|0)-q[(16+un|0)+((yn=Sm+-2|0)<<2)>>2]|0,8+un|0,Sm+-1|0,1,16+un|0),ka(8+un|0,1),xn=1|q[8+un>>2],q[8+un>>2]=xn,la(Jn,8+un|0,yn,1,16+un|0),Sm=yn}a=a+-4|0}}L=208+un|0}(im,Il),q[nm+q[$l+640>>2]>>2]=Il,!((0|(hm=hm+1|0))>2]+20>>2]))break}if(!(r[a+4|0]<5|r[q[$l>>2]+4|0]<4)){if(Il=q[a+704>>2],Jl=q[Il+128>>2],1<=(0|(q[$l+596>>2]=Jl)))for(lm=q[a+1112>>2],hm=q[a+1116>>2],nm=q[a+1108>>2],mm=q[$l+592>>2],om=q[$l+600>>2];km=om+w(Jl=Jl+-1|0,12)|0,q[km>>2]=q[(im=Jl<<2)+nm>>2],q[km+4>>2]=q[hm+im>>2],q[km+8>>2]=mm+w(q[im+lm>>2],48),0<(0|Jl););if(Jl=q[Il+132>>2],1<=(0|(q[$l+612>>2]=Jl)))for(lm=q[a+1136>>2],hm=q[a+1140>>2],nm=q[a+1132>>2],mm=q[$l+592>>2],om=q[$l+616>>2];km=om+w(Jl=Jl+-1|0,12)|0,q[km>>2]=q[(im=Jl<<2)+nm>>2],q[km+4>>2]=q[hm+im>>2],q[km+8>>2]=mm+w(q[im+lm>>2],48),0<(0|Jl););if(Jl=q[Il+136>>2],!((0|(q[$l+628>>2]=Jl))<1))for(km=q[a+1160>>2],im=q[a+1164>>2],lm=q[a+1156>>2],hm=q[$l+592>>2],nm=q[$l+632>>2];a=nm+w(Jl=Jl+-1|0,12)|0,q[a>>2]=q[(Il=Jl<<2)+lm>>2],q[a+4>>2]=q[Il+im>>2],q[a+8>>2]=hm+w(q[Il+km>>2],48),0<(0|Jl););}ua($l)}return L=576+jm|0,$l}(a,Wa,Xa))break a;q[36+Ya>>2]=2209,q[32+Ya>>2]=2361,Y(4,1294,32+Ya|0)}else q[20+Ya>>2]=1444,q[16+Ya>>2]=2361,Y(4,1294,16+Ya|0);else q[4+Ya>>2]=2132,q[Ya>>2]=2361,Y(4,1294,Ya);Wa=0}return L=64+Ya|0,0|Wa}function xa(a){var Wa;return L=Wa=L-16|0,a=(a|=0)?function(a){var Il;return ca(16+(L=Il=L-576|0)|0,0,560),Fa(a,16+Il|0,12+Il|0),L=576+Il|0,q[12+Il>>2]}(a):(q[4+Wa>>2]=2132,q[Wa>>2]=2343,Y(4,1294,Wa),0),L=16+Wa|0,0|a}function ya(a){var Xa=r[a+4|0];X(q[a+704>>2],4,64),da(q[a+708>>2],4),da(q[a+708>>2]+4|0,4),da(q[a+708>>2]+8|0,4),da(q[a+708>>2]+12|0,4),da(q[a+708>>2]+16|0,4),da(q[a+708>>2]+20|0,1),X(q[a+720>>2],4,q[q[a+704>>2]>>2]),X(q[a+724>>2],4,q[q[a+704>>2]>>2]),X(q[a+728>>2],4,q[q[a+704>>2]>>2]),X(q[a+732>>2],4,q[q[a+704>>2]>>2]),X(q[a+736>>2],4,q[q[a+704>>2]>>2]),X(q[a+740>>2],4,q[q[a+704>>2]>>2]),X(q[a+752>>2],4,q[q[a+704>>2]+4>>2]),X(q[a+756>>2],4,q[q[a+704>>2]+4>>2]),X(q[a+760>>2],4,q[q[a+704>>2]+4>>2]),X(q[a+764>>2],4,q[q[a+704>>2]+4>>2]),X(q[a+768>>2],4,q[q[a+704>>2]+4>>2]),X(q[a+772>>2],4,q[q[a+704>>2]+4>>2]),X(q[a+776>>2],4,q[q[a+704>>2]+4>>2]),X(q[a+780>>2],4,q[q[a+704>>2]+8>>2]),X(q[a+784>>2],4,q[q[a+704>>2]+8>>2]),X(q[a+788>>2],4,q[q[a+704>>2]+8>>2]),X(q[a+796>>2],4,q[q[a+704>>2]+8>>2]),X(q[a+800>>2],4,q[q[a+704>>2]+8>>2]),X(q[a+804>>2],4,q[q[a+704>>2]+8>>2]),X(q[a+812>>2],4,q[q[a+704>>2]+12>>2]),X(q[a+816>>2],4,q[q[a+704>>2]+12>>2]),X(q[a+820>>2],4,q[q[a+704>>2]+12>>2]),X(q[a+828>>2],4,q[q[a+704>>2]+12>>2]),X(q[a+852>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+856>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+860>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+868>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+872>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+876>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+880>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+884>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+888>>2],1,q[q[a+704>>2]+16>>2]),X(q[a+892>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+896>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+900>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+904>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+908>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+912>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+924>>2],4,q[q[a+704>>2]+20>>2]),X(q[a+928>>2],4,q[q[a+704>>2]+20>>2]),X(q[a+932>>2],4,q[q[a+704>>2]+20>>2]),X(q[a+936>>2],4,q[q[a+704>>2]+20>>2]),X(q[a+940>>2],4,q[q[a+704>>2]+20>>2]),X(q[a+948>>2],4,q[q[a+704>>2]+20>>2]),X(q[a+952>>2],4,q[q[a+704>>2]+20>>2]),X(q[a+976>>2],4,q[q[a+704>>2]+24>>2]),X(q[a+980>>2],4,q[q[a+704>>2]+28>>2]),X(q[a+984>>2],4,q[q[a+704>>2]+28>>2]),X(q[a+996>>2],4,q[q[a+704>>2]+32>>2]),X(q[a+1e3>>2],4,q[q[a+704>>2]+32>>2]),X(q[a+1004>>2],4,q[q[a+704>>2]+32>>2]),X(q[a+1008>>2],4,q[q[a+704>>2]+32>>2]),X(q[a+1012>>2],4,q[q[a+704>>2]+32>>2]),X(q[a+1016>>2],4,q[q[a+704>>2]+32>>2]),X(q[a+1020>>2],4,q[q[a+704>>2]+32>>2]),X(q[a+1032>>2],4,q[q[a+704>>2]+36>>2]),X(q[a+1036>>2],4,q[q[a+704>>2]+36>>2]),X(q[a+1040>>2],4,q[q[a+704>>2]+36>>2]),X(q[a+1052>>2],4,q[q[a+704>>2]+40>>2]),X(q[a+1064>>2],4,q[q[a+704>>2]+44>>2]),X(q[a+1068>>2],4,q[q[a+704>>2]+48>>2]),X(q[a+1072>>2],4,q[q[a+704>>2]+48>>2]),X(q[a+1056>>2],4,q[q[a+704>>2]+52>>2]),X(q[a+1060>>2],4,q[q[a+704>>2]+52>>2]),X(q[a+1192>>2],4,q[q[a+704>>2]+56>>2]),X(q[a+1196>>2],4,q[q[a+704>>2]+60>>2]),X(q[a+1200>>2],2,q[q[a+704>>2]+64>>2]),X(q[a+1204>>2],4,q[q[a+704>>2]+68>>2]),X(q[a+1208>>2],4,q[q[a+704>>2]+72>>2]),X(q[a+1212>>2],4,q[q[a+704>>2]+72>>2]),X(q[a+1216>>2],4,q[q[a+704>>2]+72>>2]),X(q[a+1220>>2],4,q[q[a+704>>2]+72>>2]),X(q[a+1224>>2],4,q[q[a+704>>2]+72>>2]),X(q[a+1228>>2],4,q[q[a+704>>2]+76>>2]),X(q[a+1232>>2],4,q[q[a+704>>2]+76>>2]),X(q[a+1236>>2],4,q[q[a+704>>2]+76>>2]),X(q[a+1248>>2],4,q[q[a+704>>2]+80>>2]),X(q[a+1252>>2],4,q[q[a+704>>2]+80>>2]),X(q[a+1256>>2],4,q[q[a+704>>2]+80>>2]),X(q[a+1260>>2],4,q[q[a+704>>2]+80>>2]),X(q[a+1264>>2],4,q[q[a+704>>2]+80>>2]),X(q[a+1268>>2],4,q[q[a+704>>2]+80>>2]),X(q[a+1272>>2],4,q[q[a+704>>2]+80>>2]),X(q[a+1276>>2],4,q[q[a+704>>2]+84>>2]),X(q[a+1280>>2],2,q[q[a+704>>2]+84>>2]),X(q[a+1284>>2],4,q[q[a+704>>2]+88>>2]),Xa>>>0<2||(X(q[a+808>>2],4,q[q[a+704>>2]+8>>2]),Xa>>>0<4)||(X(q[a+968>>2],4,q[q[a+704>>2]+20>>2]),X(q[a+972>>2],4,q[q[a+704>>2]+20>>2]),X(q[a+792>>2],4,q[q[a+704>>2]+8>>2]),X(q[a+824>>2],4,q[q[a+704>>2]+12>>2]),X(q[a+864>>2],4,q[q[a+704>>2]+16>>2]),X(q[a+1288>>2],4,q[q[a+704>>2]+92>>2]),X(q[a+1292>>2],4,q[q[a+704>>2]+92>>2]),X(q[a+1296>>2],4,q[q[a+704>>2]+92>>2]),X(q[a+1300>>2],4,q[q[a+704>>2]+96>>2]),X(q[a+1304>>2],4,q[q[a+704>>2]+96>>2]),X(q[a+1308>>2],4,q[q[a+704>>2]+96>>2]),X(q[a+944>>2],4,q[q[a+704>>2]+20>>2]),X(q[a+956>>2],4,q[q[a+704>>2]+20>>2]),X(q[a+960>>2],4,q[q[a+704>>2]+20>>2]),X(q[a+1076>>2],4,q[q[a+704>>2]+100>>2]),X(q[a+1080>>2],4,q[q[a+704>>2]+100>>2]),X(q[a+1084>>2],4,q[q[a+704>>2]+100>>2]),X(q[a+1088>>2],4,q[q[a+704>>2]+104>>2]),X(q[a+1092>>2],4,q[q[a+704>>2]+104>>2]),X(q[a+1096>>2],4,q[q[a+704>>2]+104>>2]),X(q[a+1100>>2],4,q[q[a+704>>2]+104>>2]),X(q[a+1104>>2],4,q[q[a+704>>2]+104>>2]),X(q[a+1120>>2],4,q[q[a+704>>2]+108>>2]),X(q[a+1124>>2],4,q[q[a+704>>2]+108>>2]),X(q[a+1128>>2],4,q[q[a+704>>2]+108>>2]),X(q[a+1144>>2],4,q[q[a+704>>2]+112>>2]),X(q[a+1148>>2],4,q[q[a+704>>2]+112>>2]),X(q[a+1152>>2],4,q[q[a+704>>2]+112>>2]),X(q[a+1168>>2],4,q[q[a+704>>2]+116>>2]),X(q[a+1172>>2],4,q[q[a+704>>2]+120>>2]),X(q[a+1176>>2],4,q[q[a+704>>2]+120>>2]),X(q[a+1180>>2],4,q[q[a+704>>2]+120>>2]),X(q[a+1184>>2],4,q[q[a+704>>2]+124>>2]),X(q[a+1188>>2],4,q[q[a+704>>2]+124>>2]),4!=(0|Xa)&&(X(q[a+988>>2],4,q[q[a+704>>2]+28>>2]),X(q[a+992>>2],4,q[q[a+704>>2]+28>>2]),X(q[a+1024>>2],4,q[q[a+704>>2]+32>>2]),X(q[a+1028>>2],4,q[q[a+704>>2]+32>>2]),X(q[a+1044>>2],4,q[q[a+704>>2]+36>>2]),X(q[a+1048>>2],4,q[q[a+704>>2]+36>>2]),X(q[a+1108>>2],4,q[q[a+704>>2]+128>>2]),X(q[a+1112>>2],4,q[q[a+704>>2]+128>>2]),X(q[a+1116>>2],4,q[q[a+704>>2]+128>>2]),X(q[a+1132>>2],4,q[q[a+704>>2]+132>>2]),X(q[a+1136>>2],4,q[q[a+704>>2]+132>>2]),X(q[a+1140>>2],4,q[q[a+704>>2]+132>>2]),X(q[a+1156>>2],4,q[q[a+704>>2]+136>>2]),X(q[a+1160>>2],4,q[q[a+704>>2]+136>>2]),X(q[a+1164>>2],4,q[q[a+704>>2]+136>>2])))}function za(a,Za){var _a=0,lb=0,mb=0,ob=0,pb=0,rb=0,nb=a+Za|0;a:{b:if(!(1&(_a=q[a+4>>2]))){if(!(3&_a))break a;if(Za=(_a=q[a>>2])+Za|0,(0|(a=a-_a|0))!=q[2092])if(_a>>>0<=255)mb=_a>>>3,_a=q[a+8>>2],(0|(lb=q[a+12>>2]))==(0|_a)?(rb=q[2087]&ed(mb),q[2087]=rb):(q[_a+12>>2]=lb,q[lb+8>>2]=_a);else{if(pb=q[a+24>>2],(0|(_a=q[a+12>>2]))!=(0|a))lb=q[a+8>>2],q[lb+12>>2]=_a,q[_a+8>>2]=lb;else if(mb=(mb=q[(lb=a+20|0)>>2])||q[(lb=a+16|0)>>2]){for(;ob=lb,(mb=q[(lb=(_a=mb)+20|0)>>2])||(lb=_a+16|0,mb=q[_a+16>>2]););q[ob>>2]=0}else _a=0;if(pb){lb=q[a+28>>2];e:{if(q[(mb=8652+(lb<<2)|0)>>2]==(0|a)){if(q[mb>>2]=_a)break e;rb=q[2088]&ed(lb),q[2088]=rb;break b}if(!(q[pb+(q[pb+16>>2]==(0|a)?16:20)>>2]=_a))break b}q[_a+24>>2]=pb,(lb=q[a+16>>2])&&(q[_a+16>>2]=lb,q[lb+24>>2]=_a),(lb=q[a+20>>2])&&(q[_a+20>>2]=lb,q[lb+24>>2]=_a)}}else if(3==(3&(_a=q[4+nb>>2])))return q[2089]=Za,q[4+nb>>2]=-2&_a,q[a+4>>2]=1|Za,q[nb>>2]=Za}f:{if(!(2&(_a=q[4+nb>>2]))){if(q[2093]==(0|nb)){if(q[2093]=a,Za=q[2090]+Za|0,q[2090]=Za,q[a+4>>2]=1|Za,q[2092]!=(0|a))break a;return q[2089]=0,q[2092]=0}if(q[2092]==(0|nb))return q[2092]=a,Za=q[2089]+Za|0,q[2089]=Za,q[a+4>>2]=1|Za,q[a+Za>>2]=Za;Za=(-8&_a)+Za|0;g:if(_a>>>0<=255)mb=_a>>>3,_a=q[8+nb>>2],(0|(lb=q[12+nb>>2]))==(0|_a)?(rb=q[2087]&ed(mb),q[2087]=rb):(q[_a+12>>2]=lb,q[lb+8>>2]=_a);else{if(pb=q[24+nb>>2],(0|nb)!=(0|(_a=q[12+nb>>2])))lb=q[8+nb>>2],q[lb+12>>2]=_a,q[_a+8>>2]=lb;else if(mb=(mb=q[(lb=20+nb|0)>>2])||q[(lb=16+nb|0)>>2]){for(;ob=lb,(mb=q[(lb=(_a=mb)+20|0)>>2])||(lb=_a+16|0,mb=q[_a+16>>2]););q[ob>>2]=0}else _a=0;if(pb){lb=q[28+nb>>2];j:{if(q[(mb=8652+(lb<<2)|0)>>2]==(0|nb)){if(q[mb>>2]=_a)break j;rb=q[2088]&ed(lb),q[2088]=rb;break g}if(!(q[pb+(q[pb+16>>2]==(0|nb)?16:20)>>2]=_a))break g}q[_a+24>>2]=pb,(lb=q[16+nb>>2])&&(q[_a+16>>2]=lb,q[lb+24>>2]=_a),(lb=q[20+nb>>2])&&(q[_a+20>>2]=lb,q[lb+24>>2]=_a)}}if(q[a+4>>2]=1|Za,q[a+Za>>2]=Za,q[2092]!=(0|a))break f;return q[2089]=Za}q[4+nb>>2]=-2&_a,q[a+4>>2]=1|Za,q[a+Za>>2]=Za}if(Za>>>0<=255)return Za=8388+((_a=Za>>>3)<<3)|0,_a=(lb=q[2087])&(_a=1<<_a)?q[Za+8>>2]:(q[2087]=_a|lb,Za),q[Za+8>>2]=a,q[_a+12>>2]=a,q[a+12>>2]=Za,q[a+8>>2]=_a;q[a+16>>2]=0,_a=q[a+20>>2]=0,(mb=Za>>>8)&&(_a=31,16777215>>0||(_a=28+((_a=((nb=(mb<<=ob=mb+1048320>>>16&8)<<(_a=mb+520192>>>16&4))<<(mb=245760+nb>>>16&2)>>>15)-(mb|_a|ob)|0)<<1|Za>>>_a+21&1)|0)),mb=8652+((q[(lb=a)+28>>2]=_a)<<2)|0;m:{if((lb=q[2088])&(ob=1<<_a)){for(lb=Za<<(31==(0|_a)?0:25-(_a>>>1)|0),_a=q[mb>>2];;){if((-8&q[(mb=_a)+4>>2])==(0|Za))break m;if(_a=lb>>>29,lb<<=1,!(_a=q[16+(ob=mb+(4&_a)|0)>>2]))break}q[ob+16>>2]=a}else q[2088]=lb|ob,q[mb>>2]=a;return q[a+24>>2]=mb,q[a+12>>2]=a,q[a+8>>2]=a}Za=q[mb+8>>2],q[Za+12>>2]=a,q[mb+8>>2]=a,q[a+24>>2]=0,q[a+12>>2]=mb,q[a+8>>2]=Za}}function Aa(a){var vb,xb,yb,Ab,Bb,Cb,sb,wb,Za=x(0),tb=(x(0),0),ub=0,zb=(x(0),x(0),x(0),x(0),0);x(0),x(0);a:{b:{if(j(a),ub=2147483647&(tb=b[0])){if(!(ub>>>0<2139095041))return x(x(.10000000149011612)+a);if(1065353216==(0|ub))return x(-1<(0|tb)?.10000000149011612:10);if(2139095040==(0|ub))return x(-1<(0|tb)?0:-a);if(1073741824==(0|tb))return x(.010000000707805157);if(1056964608==(0|tb))return x(.3162277638912201);if(1291845633<=ub>>>0)return x((0|tb)<0?H:0);if(vb=u[1701],wb=x(x(1.600000023841858)-vb),xb=x(x(1)/x(vb+x(1.600000023841858))),f(0,-4096&(j(sb=x(wb*xb)),b[0])),Za=k(),yb=x(Za*Za),Bb=u[1705],vb=x(xb*x(x(wb-x((Ab=Za)*x(3.099609375)))-x(Za*x(x(1.600000023841858)-x(x(3.099609375)-vb))))),xb=x(x(sb+Za)*vb),Za=x(sb*sb),wb=x(xb+x(x(Za*Za)*x(x(Za*x(x(Za*x(x(Za*x(x(Za*x(x(Za*x(.20697501301765442))+x(.23066075146198273)))+x(.2727281153202057)))+x(.3333333432674408)))+x(.4285714328289032)))+x(.6000000238418579)))),f(0,-4096&(j(x(x(yb+x(3))+wb)),b[0])),Za=k(),xb=x(Ab*Za),sb=x(x(vb*Za)+x(sb*x(wb-x(x(Za+x(-3))-yb)))),f(0,-4096&(j(x(xb+sb)),b[0])),Za=k(),vb=x(Za*x(.9619140625)),yb=x(u[1703]+x(x(x(sb-x(Za-xb))*x(.9617967009544373))+x(Za*x(-.00011736857413779944)))),f(0,-4096&(j(x(x(Bb+x(vb+yb))+x(-4))),b[0])),sb=k(),f(0,-4096&tb),wb=k(),Za=x(sb*wb),a=x(x(x(yb-x(x(x(sb-x(-4))-Bb)-vb))*a)+x(x(a-wb)*sb)),j(sb=x(Za+a)),1124073473<=(0|(tb=b[0])))break b;d:{if((ub=1124073472)==(0|tb)){if(x(a+x(4.299566569443414e-8))>x(sb-Za))break b}else{if(ub=2147483647&tb,!(a<=x(sb-Za)^1|-1021968384!=(0|tb))|1125515265<=ub>>>0)break a;if(ub>>>0<1056964609)break d}zb=(8388607&(ub=(8388608>>>(ub>>>23)-126)+tb|0)|8388608)>>>150-(Cb=ub>>>23&255),zb=(0|tb)<0?0-zb|0:zb,Za=x(Za-(f(0,ub&-8388608>>Cb-127),k())),j(x(a+Za)),tb=b[0]}f(0,-32768&tb),sb=k(),vb=x(sb*x(.693145751953125)),sb=x(x(sb*x(14286065379565116e-22))+x(x(a-x(sb-Za))*x(.6931471824645996))),a=x(vb+sb),Za=x(a*a),Za=x(a-x(Za*x(x(Za*x(x(Za*x(x(Za*x(x(Za*x(4.138136944220605e-8))+x(-16533901998627698e-22)))+x(661375597701408e-19)))+x(-.0027777778450399637)))+x(.1666666716337204)))),Ab=x(x(a*Za)/x(Za+x(-2))),Za=x(sb-x(a-vb)),a=(0|(tb=0|(j(a=x(x(a-x(Ab-x(Za+x(a*Za))))+x(1))),b[0]+(zb<<23))))<=8388607?function(a,Vk){var zl=0;return 128<=(0|Vk)?(a=x(a*x(17014118346046923e22)),Vk=(0|(zl=Vk+-127|0))<128?zl:(a=x(a*x(17014118346046923e22)),((0|Vk)<381?Vk:381)+-254|0)):-127<(0|Vk)||(a=x(a*x(11754943508222875e-54)),Vk=-127<(0|(zl=Vk+126|0))?zl:(a=x(a*x(11754943508222875e-54)),(-378<(0|Vk)?Vk:-378)+252|0)),x(a*(f(0,1065353216+(Vk<<23)|0),k()))}(a,zb):(f(0,tb),k()),a=x(x(1)*a)}else a=x(1);return a}return x(H)}return x(0)}function Ba(a,Db){var Jb,Eb,Gb,Fb=0,Hb=0,Ib=x(0);if(j(Db),!((Gb=2147483647&(Eb=b[0]))>>>0<=2139095040&&(j(a),(Fb=2147483647&(Hb=b[0]))>>>0<2139095041)))return x(a+Db);if(1065353216==(0|Eb))return Ca(a);Eb=(Jb=Eb>>>30&2)|Hb>>>31;b:{c:{d:{e:{if(!Fb){switch(Eb-2|0){case 0:break e;case 1:break;default:break d}return x(-3.1415927410125732)}if(2139095040!=(0|Gb)){if(!Gb|!(Fb>>>0<=218103808+Gb>>>0&&2139095040!=(0|Fb)))break b;if(a=Ib=Fb+218103808>>>0>>0&&(Ib=x(0),Jb)?Ib:Ca(x(y(x(a/Db)))),Eb>>>0<=2){switch(Eb-1|0){case 0:return x(-a);case 1:break;default:break d}return x(x(3.1415927410125732)-x(a+x(8.742277657347586e-8)))}return x(x(a+x(8.742277657347586e-8))+x(-3.1415927410125732))}if(2139095040==(0|Fb))break c;return u[6784+(Eb<<2)>>2]}a=x(3.1415927410125732)}return a}return u[6768+(Eb<<2)>>2]}return x((0|Hb)<0?-1.5707963705062866:1.5707963705062866)}function Ca(a){x(0);var Kb,Nb,Ob,Db,Mb,Lb=0;x(0),x(0),j(a);a:{if(1283457024<=(Db=2147483647&(Mb=b[0]))>>>0){if(2139095040>>0)break a;return x((0|Mb)<0?-1.570796251296997:1.570796251296997)}b:{if(Db>>>0<=1054867455){if(Lb=-1,964689920<=Db>>>0)break b;break a}a=x(y(a)),Lb=Db>>>0<=1066926079?Db>>>0<=1060110335?(a=x(x(x(a+a)+x(-1))/x(a+x(2))),0):(a=x(x(a+x(-1))/x(a+x(1))),1):Db>>>0<=1075576831?(a=x(x(a+x(-1.5))/x(x(a*x(1.5))+x(1))),2):(a=x(x(-1)/a),3)}if(Db=Lb,Nb=x(a*a),Kb=x(Nb*Nb),Ob=x(Kb*x(x(Kb*x(-.106480173766613))+x(-.19999158382415771))),Kb=x(Nb*x(x(Kb*x(x(Kb*x(.06168760731816292))+x(.14253635704517365)))+x(.333333283662796))),(0|Db)<=-1)return x(a-x(a*x(Ob+Kb)));a=x(u[6736+(Db<<=2)>>2]-x(x(x(a*x(Ob+Kb))-u[6752+Db>>2])-a)),a=(0|Mb)<0?x(-a):a}return a}function Da(a,Pb){var Ub,Sb,Tb,Qb=0,Rb=0;return L=Sb=L-16|0,j(a),(Qb=2147483647&(Tb=b[0]))>>>0<=1305022426?(v[Pb>>3]=(Ub=+a)+-1.5707963109016418*(Rb=.6366197723675814*Ub+6755399441055744-6755399441055744)+-1.5893254773528196e-8*Rb,Qb=y(Rb)<2147483648?~~Rb:-2147483648):2139095040<=Qb>>>0?(v[Pb>>3]=x(a-a),Qb=0):(Ub=Qb,v[8+Sb>>3]=(f(0,Ub-((Qb=(Qb>>>23)-150|0)<<23)|0),k()),Qb=function(a,Il,Jl){var Nl,Sl,Wl,Xl,Zl,_l,Kl=0,Ll=0,Ml=0,Ol=0,Pl=0,Ql=0,Rl=0,Tl=0,Ul=0,Vl=0,Yl=0;if(L=Nl=L-560|0,Rl=(Ll=Jl)+w(Wl=0<(0|(Jl=(Jl+-3|0)/24|0))?Jl:0,-24)|0,0<=(0|(Sl=q[972])))for(Ll=Sl+1|0,Jl=Wl;v[(320+Nl|0)+(Ml<<3)>>3]=(0|Jl)<0?0:+q[3904+(Jl<<2)>>2],Jl=Jl+1|0,(0|Ll)!=(0|(Ml=Ml+1|0)););for(Pl=Rl+-24|0,Ll=0;;){for(Kl=Jl=0;Kl+=v[(Jl<<3)+a>>3]*v[(320+Nl|0)+(Ll-Jl<<3)>>3],1!=(0|(Jl=Jl+1|0)););if(v[(Ll<<3)+Nl>>3]=Kl,Jl=(0|Ll)<(0|Sl),Ll=Ll+1|0,!Jl)break}_l=23-Pl|0,Xl=24-Pl|0,Ll=Sl;a:{for(;;){if(Kl=v[(Ll<<3)+Nl>>3],!(Ul=((Jl=0)|(Ml=Ll))<1))for(;Ql=(480+Nl|0)+(Jl<<2)|0,Tl=Kl,Ol=y(Kl*=5.960464477539063e-8)<2147483648?~~Kl:-2147483648,Ol=y(Tl+=-16777216*(Kl=0|Ol))<2147483648?~~Tl:-2147483648,q[Ql>>2]=Ol,Kl=v[((Ml=Ml+-1|0)<<3)+Nl>>3]+Kl,(0|Ll)!=(0|(Jl=Jl+1|0)););Kl=ja(Kl,Pl),Kl=(Kl+=-8*C(.125*Kl))-(0|(Ql=y(Kl)<2147483648?~~Kl:-2147483648));e:{f:{g:{if(Yl=(0|Pl)<1){if(Pl)break g;Ol=q[476+((Ll<<2)+Nl|0)>>2]>>23}else Ol=q[476+(Ml=(Ll<<2)+Nl|0)>>2],Vl=Ml,Ml=Ol-((Jl=Ol>>Xl)<>2]=Ml)>>_l;if((0|Ol)<1)break e;break f}if(Ol=2,!(.5<=Kl)){Ol=0;break e}}if(Ml=Jl=0,!Ul)for(;;){Ul=q[(Zl=(480+Nl|0)+(Jl<<2)|0)>>2],Vl=16777215;i:{j:{if(!Ml){if(!Ul)break j;Vl=16777216,Ml=1}q[Zl>>2]=Vl-Ul;break i}Ml=0}if((0|Ll)==(0|(Jl=Jl+1|0)))break}Yl||1<(Jl=Pl+-1|0)>>>0||(q[476+(Jl=(Ll<<2)+Nl|0)>>2]=Jl-1?8388607&q[Jl+476>>2]:4194303&q[Jl+476>>2]),Ql=Ql+1|0,2==(0|Ol)&&(Kl=1-Kl,Ol=2,Ml)&&(Kl-=ja(1,Pl))}if(0!=Kl)break;if(!(((Ml=0)|(Jl=Ll))<=(0|Sl))){for(;Ml=q[(480+Nl|0)+((Jl=Jl+-1|0)<<2)>>2]|Ml,(0|Sl)<(0|Jl););if(Ml){for(Rl=Pl;Rl=Rl+-24|0,!q[(480+Nl|0)+((Ll=Ll+-1|0)<<2)>>2];);break a}}for(Jl=1;Jl=(Ml=Jl)+1|0,!q[(480+Nl|0)+(Sl-Ml<<2)>>2];);for(Ml=Ll+Ml|0;;){for(Ll=Ql=Ll+1|0,v[(320+Nl|0)+(Ql<<3)>>3]=q[3904+(Wl+Ll<<2)>>2],Kl=Jl=0;Kl+=v[(Jl<<3)+a>>3]*v[(320+Nl|0)+(Ql-Jl<<3)>>3],1!=(0|(Jl=Jl+1|0)););if(v[(Ll<<3)+Nl>>3]=Kl,!((0|Ll)<(0|Ml)))break}Ll=Ml}16777216<=(Kl=ja(Kl,0-Pl|0))?(a=(480+Nl|0)+(Ll<<2)|0,Tl=Kl,Jl=y(Kl*=5.960464477539063e-8)<2147483648?~~Kl:-2147483648,Ml=y(Kl=Tl+-16777216*(0|Jl))<2147483648?~~Kl:-2147483648,q[a>>2]=Ml,Ll=Ll+1|0):(Jl=y(Kl)<2147483648?~~Kl:-2147483648,Rl=Pl),q[(480+Nl|0)+(Ll<<2)>>2]=Jl}if(Kl=ja(1,Rl),!((0|Ll)<=-1)){for(Jl=Ll;v[(Jl<<3)+Nl>>3]=Kl*+q[(480+Nl|0)+(Jl<<2)>>2],Kl*=5.960464477539063e-8,a=0<(0|Jl),Jl=Jl+-1|0,a;);if(!((0|Ll)<=-1))for(Jl=Ll;;){for(Pl=Ll-(a=Jl)|0,Jl=Kl=0;Kl+=v[6672+(Jl<<3)>>3]*v[(a+Jl<<3)+Nl>>3],!((0|Sl)<=(0|Jl))&&(Rl=Jl>>>0>>0,Jl=Jl+1|0,Rl););if(v[(160+Nl|0)+(Pl<<3)>>3]=Kl,Jl=a+-1|0,!(0<(0|a)))break}}if(0<=(Ll|(Kl=0)))for(;Kl+=v[(160+Nl|0)+(Ll<<3)>>3],a=0<(0|Ll),Ll=Ll+-1|0,a;);return v[Il>>3]=Ol?-Kl:Kl,L=560+Nl|0,7&Ql}(8+Sb|0,Sb,Qb),Rb=v[Sb>>3],(0|Tb)<=-1?(v[Pb>>3]=-Rb,Qb=0-Qb|0):v[Pb>>3]=Rb),L=16+Sb|0,Qb}function Ea(a,Pb){return a?function(a,Il){a:{if(a){if(Il>>>0<=127)break a;if(q[q[1789]>>2]){if(Il>>>0<=2047)return o[a+1|0]=63&Il|128,o[0|a]=Il>>>6|192,2;if(!(57344!=(-8192&Il)&&55296<=Il>>>0))return o[a+2|0]=63&Il|128,o[0|a]=Il>>>12|224,o[a+1|0]=Il>>>6&63|128,3;if(Il+-65536>>>0<=1048575)return o[a+3|0]=63&Il|128,o[0|a]=Il>>>18|240,o[a+2|0]=Il>>>6&63|128,o[a+1|0]=Il>>>12&63|128,4}else if(57216==(-128&Il))break a;q[2086]=25,a=-1}else a=1;return a}return o[0|a]=Il,1}(a,Pb):0}function Fa(a,Pb,Wb){var fc,gc,Xb=0,Yb=0,Zb=0,_b=0,$b=0,ac=0,bc=0,cc=0,dc=0,ec=r[a+4|0];if(q[Pb>>2]=652,Yb=q[a+704>>2],1<=(0|(_b=q[Yb>>2]))){for($b=q[a+720>>2],bc=q[a+1072>>2];Zb=(1<>2]<<2)>>2])+Zb|0,(0|_b)!=(0|(Xb=Xb+1|0)););Xb=Zb<<2}if(q[Pb+4>>2]=w(_b,12),q[Pb+8>>2]=q[Yb>>2]<<2,q[Pb+12>>2]=q[Yb>>2]<<2,q[Pb+16>>2]=q[Yb>>2]<<2,q[Pb+20>>2]=q[Yb>>2]<<2,Zb=q[Yb>>2],q[Pb+28>>2]=Xb,q[Pb+24>>2]=Zb<<2,Zb=q[Yb>>2],q[Pb+40>>2]=Xb,q[Pb+36>>2]=Xb,q[Pb+32>>2]=Zb<<2,q[Pb+44>>2]=q[Yb+4>>2]<<5,q[Pb+48>>2]=q[Yb+4>>2]<<2,q[Pb+52>>2]=q[Yb+4>>2]<<2,q[Pb+56>>2]=q[Yb+4>>2]<<2,q[Pb+60>>2]=q[Yb+4>>2]<<4,q[Pb+64>>2]=q[Yb+4>>2]<<4,1<=((Xb=0)|(_b=q[Yb+8>>2]))){for($b=q[a+780>>2],bc=q[a+1072>>2],dc=q[a+796>>2],Zb=0;ac=(15+(q[(cc=Xb<<2)+dc>>2]<<3)&-16)+ac|0,Zb=(1<>2]<<2)>>2])+Zb|0,(0|_b)!=(0|(Xb=Xb+1|0)););Xb=Zb<<2}if(q[Pb+68>>2]=w(_b,24),q[Pb+72>>2]=q[Yb+8>>2]<<2,q[Pb+76>>2]=q[Yb+8>>2]<<2,Zb=q[Yb+8>>2],q[Pb+84>>2]=ac,q[Pb+80>>2]=Zb<<2,q[Pb+88>>2]=q[Yb+8>>2]<<4,q[Pb+92>>2]=q[Yb+8>>2]<<4,Zb=q[Yb+8>>2],q[Pb+100>>2]=Xb,q[Pb+96>>2]=Zb<<2,Zb=q[Yb+8>>2],q[Pb+140>>2]=Xb,q[Pb+136>>2]=Xb,q[Pb+132>>2]=Xb,q[Pb+128>>2]=Xb,q[Pb+124>>2]=Xb,q[Pb+120>>2]=Xb,q[Pb+116>>2]=Xb,q[Pb+112>>2]=Xb,q[Pb+108>>2]=Xb,q[Pb+104>>2]=Zb<<2,q[Pb+144>>2]=q[Yb+8>>2]<<2,q[Pb+148>>2]=q[Yb+8>>2]<<2,q[Pb+152>>2]=q[Yb+8>>2]<<2,q[Pb+156>>2]=q[Yb+8>>2]<<2,q[Pb+160>>2]=q[Yb+8>>2]<<2,q[Pb+164>>2]=q[Yb+8>>2]<<2,1<=((Xb=ac=0)|(_b=q[Yb+12>>2]))){for($b=q[a+812>>2],bc=q[a+1072>>2],Zb=0;Zb=(1<>2]<<2)>>2])+Zb|0,(0|_b)!=(0|(Xb=Xb+1|0)););Xb=Zb<<2}if(q[Pb+168>>2]=w(_b,12),q[Pb+172>>2]=q[Yb+12>>2]<<2,q[Pb+176>>2]=q[Yb+12>>2]<<2,q[Pb+180>>2]=q[Yb+12>>2]<<2,q[Pb+184>>2]=q[Yb+12>>2]<<2,q[Pb+188>>2]=q[Yb+12>>2]<<2,q[Pb+192>>2]=q[Yb+12>>2]<<2,q[Pb+196>>2]=q[Yb+12>>2]<<2,q[Pb+200>>2]=q[Yb+12>>2]<<2,q[Pb+204>>2]=q[Yb+12>>2]<<4,q[Pb+208>>2]=q[Yb+12>>2]<<4,Zb=q[Yb+12>>2],q[Pb+216>>2]=Xb,q[Pb+212>>2]=Zb<<2,Zb=q[Yb+12>>2],q[Pb+268>>2]=Xb,q[Pb+264>>2]=Xb,q[Pb+260>>2]=Xb,q[Pb+256>>2]=Xb,q[Pb+252>>2]=Xb,q[Pb+248>>2]=Xb,q[Pb+244>>2]=Xb,q[Pb+240>>2]=Xb,q[Pb+236>>2]=Xb,q[Pb+232>>2]=Xb,q[Pb+228>>2]=Xb,q[Pb+224>>2]=Xb,q[Pb+220>>2]=Zb<<2,q[Pb+272>>2]=q[Yb+12>>2]<<2,q[Pb+276>>2]=q[Yb+12>>2]<<2,q[Pb+280>>2]=q[Yb+12>>2]<<2,q[Pb+284>>2]=q[Yb+12>>2]<<2,q[Pb+288>>2]=q[Yb+12>>2]<<2,q[Pb+292>>2]=q[Yb+12>>2]<<2,1<=((Xb=0)|(Zb=q[Yb+16>>2]))){for($b=q[a+852>>2],bc=q[a+1072>>2],dc=q[a+892>>2],_b=0;ac=(15+(q[(cc=Xb<<2)+dc>>2]<<3)&-16)+ac|0,_b=(1<>2]<<2)>>2])+_b|0,(0|Zb)!=(0|(Xb=Xb+1|0)););Xb=_b<<2}if(q[Pb+296>>2]=w(Zb,20),q[Pb+300>>2]=q[Yb+16>>2]<<2,q[Pb+304>>2]=q[Yb+16>>2],q[Pb+308>>2]=q[Yb+16>>2]<<2,q[Pb+312>>2]=q[Yb+16>>2]<<2,Zb=q[Yb+16>>2],q[Pb+320>>2]=ac,q[Pb+316>>2]=Zb<<2,q[Pb+324>>2]=q[Yb+16>>2]<<2,q[Pb+328>>2]=q[Yb+16>>2]<<4,q[Pb+332>>2]=q[Yb+16>>2]<<4,q[Pb+336>>2]=q[Yb+16>>2]<<2,q[Pb+340>>2]=q[Yb+16>>2]<<2,q[Pb+344>>2]=q[Yb+16>>2]<<2,q[Pb+348>>2]=q[Yb+16>>2]<<4,q[Pb+352>>2]=q[Yb+16>>2]<<4,Zb=q[Yb+16>>2],q[Pb+360>>2]=Xb,q[Pb+356>>2]=Zb<<2,Zb=q[Yb+16>>2],q[Pb+404>>2]=Xb,q[Pb+400>>2]=Xb,q[Pb+396>>2]=Xb,q[Pb+392>>2]=Xb,q[Pb+388>>2]=Xb,q[Pb+384>>2]=Xb,q[Pb+380>>2]=Xb,q[Pb+376>>2]=Xb,q[Pb+372>>2]=Xb,q[Pb+368>>2]=Xb,q[Pb+364>>2]=Zb<<2,q[Pb+408>>2]=q[Yb+16>>2]<<2,q[Pb+412>>2]=q[Yb+16>>2]<<2,q[Pb+416>>2]=q[Yb+16>>2]<<2,q[Pb+420>>2]=q[Yb+16>>2]<<2,q[Pb+424>>2]=q[Yb+16>>2]<<2,q[Pb+428>>2]=q[Yb+16>>2]<<2,$b=q[a+704>>2],q[Pb+432>>2]=w(q[$b+20>>2],52),q[Pb+436>>2]=ec>>>(Xb=_b=0)<=3?q[$b+20>>2]<<2:0,q[Pb+440>>2]=q[$b+20>>2]<<2,q[Pb+444>>2]=w(q[$b+52>>2],28),1<=(0|(Yb=q[$b+48>>2]))){for(Zb=q[a+1072>>2],ac=0;ac=(bc=q[Zb+(Xb<<2)>>2])+ac|0,_b=(1<>2]=Xb,q[Pb+456>>2]=Xb,q[Pb+452>>2]=_b,q[Pb+448>>2]=w(Yb,36),q[Pb+500>>2]=w(q[$b+72>>2],28),1<=((ac=Xb=Zb=0)|(bc=q[$b+72>>2]))){for(dc=q[a+1224>>2],cc=q[a+1220>>2],gc=q[a+1212>>2],_b=0;_b=(0|(fc=q[(Yb=ac<<2)+cc>>2]-q[Yb+dc>>2]|0))<(0|_b)?_b:1+fc|0,Xb=(0|Xb)<(0|(Yb=q[Yb+gc>>2]))?Yb:Xb,(0|bc)!=(0|(ac=ac+1|0)););ac=Xb<<2,Xb=_b<<2}if(Yb=q[$b+76>>2],q[Pb+516>>2]=Xb,q[Pb+512>>2]=ac,q[Pb+508>>2]=Xb,q[Pb+504>>2]=Yb<<4,1<=(0|(Yb=q[$b+80>>2]))){for(Zb=q[a+1248>>2],ac=q[a+1072>>2],_b=Xb=0;_b=(1<>2]<<2)>>2])+_b|0,(0|Yb)!=(0|(Xb=Xb+1|0)););Zb=_b<<2}if(q[Pb+520>>2]=w(Yb,24),q[Pb+524>>2]=q[$b+80>>2]<<2,Yb=q[$b+80>>2],q[Pb+532>>2]=Zb,q[Pb+528>>2]=Yb<<2,Yb=q[$b+80>>2],q[Pb+544>>2]=Zb,q[Pb+540>>2]=Zb,q[Pb+536>>2]=Yb<<2,Yb=Pb,4<=ec>>>0){if(q[Pb+464>>2]=w(q[$b+120>>2],20),q[Pb+468>>2]=w(q[$b+100>>2],28),Zb=Pb,1<=((Xb=ac=0)|(bc=q[$b+104>>2]))){for(a=q[a+1104>>2],_b=0;_b=q[a+(Xb<<2)>>2]+_b|0,(0|bc)!=(0|(Xb=Xb+1|0)););a=_b<<2}else a=0;q[Zb+476>>2]=a,q[Pb+472>>2]=w(bc,48),q[Pb+484>>2]=w(q[$b+108>>2],12),a=q[$b+112>>2],q[Pb+552>>2]=0,q[Pb+492>>2]=w(a,12),a=0}else{if((0|(ac=q[$b+20>>2]))<1)_b=0;else for(bc=q[a+1060>>2],dc=q[a+952>>2],a=q[a+948>>2],Zb=_b=0;;){if(1<=(0|(cc=q[(Xb=Zb<<2)+dc>>2])))for(cc=(Xb=bc+(q[a+Xb>>2]<<2)|0)+(cc<<2)|0;_b=q[Xb>>2]+_b|0,(Xb=Xb+4|0)>>>0>>0;);if((0|ac)==(0|(Zb=Zb+1|0)))break}q[Pb+552>>2]=ac<<2,ac=q[$b+20>>2]<<2,a=_b<<2}for(q[Yb+556>>2]=a,q[Pb+548>>2]=ac,4>>0&&(q[Pb+480>>2]=w(q[$b+128>>2],12),q[Pb+488>>2]=w(q[$b+132>>2],12),q[Pb+496>>2]=w(q[$b+136>>2],12)),Xb=_b=0;Xb=((Yb=q[(a=(_b<<2)+Pb|0)>>2])+15&-16)+(q[a>>2]=Xb)|0,140!=(0|(_b=_b+1|0)););q[Wb>>2]=Xb}function Ga(a,Pb,Wb,hc){a:{if(!(20>>0||9<(Pb=Pb+-9|0)>>>0)){switch(Pb-1|0){default:return Pb=q[Wb>>2],q[Wb>>2]=Pb+4,q[a>>2]=q[Pb>>2];case 0:return Pb=q[Wb>>2],q[Wb>>2]=Pb+4,Pb=q[Pb>>2],q[a>>2]=Pb,q[a+4>>2]=Pb>>31;case 1:return Pb=q[Wb>>2],q[Wb>>2]=Pb+4,q[a>>2]=q[Pb>>2],q[a+4>>2]=0;case 3:return Pb=q[Wb>>2],q[Wb>>2]=Pb+4,Pb=p[Pb>>1],q[a>>2]=Pb,q[a+4>>2]=Pb>>31;case 4:return Pb=q[Wb>>2],q[Wb>>2]=Pb+4,q[a>>2]=s[Pb>>1],q[a+4>>2]=0;case 5:return Pb=q[Wb>>2],q[Wb>>2]=Pb+4,Pb=o[0|Pb],q[a>>2]=Pb,q[a+4>>2]=Pb>>31;case 6:return Pb=q[Wb>>2],q[Wb>>2]=Pb+4,q[a>>2]=r[0|Pb],q[a+4>>2]=0;case 2:case 7:break a;case 8:}n[hc](a,Wb)}return}Pb=q[Wb>>2]+7&-8,q[Wb>>2]=Pb+8,Wb=q[Pb+4>>2],q[a>>2]=q[Pb>>2],q[a+4>>2]=Wb}function Ha(a){var Pb,hc,Wb=0;if(ha(o[q[a>>2]]))for(;Pb=q[a>>2],hc=o[0|Pb],q[a>>2]=Pb+1,Wb=(w(Wb,10)+hc|0)-48|0,ha(o[Pb+1|0]););return Wb}function Ia(a,ic,jc,kc,lc){var oc,mc;q[204+(L=mc=L-208|0)>>2]=jc,ca(160+mc|(jc=0),0,40),q[200+mc>>2]=q[204+mc>>2],(0|ra(0,ic,200+mc|0,80+mc|0,160+mc|0,kc,lc))<0||(jc=0<=q[a+76>>2]?1:jc,jc=q[a>>2],o[a+74|0]<=0&&(q[a>>2]=-33&jc),oc=32&jc,q[a+48>>2]?ra(a,ic,200+mc|0,80+mc|0,160+mc|0,kc,lc):(q[a+48>>2]=80,q[a+16>>2]=80+mc,q[a+28>>2]=mc,q[a+20>>2]=mc,jc=q[a+44>>2],ra(a,ic,200+(q[a+44>>2]=mc)|0,80+mc|0,160+mc|0,kc,lc),jc&&(n[q[a+36>>2]](a,0,0),q[a+48>>2]=0,q[a+44>>2]=jc,q[a+28>>2]=0,q[a+16>>2]=0,q[a+20>>2]=0)),q[a>>2]=q[a>>2]|oc),L=208+mc|0}function Ka(a,ic,pc){var rc,qc;$(8+(L=qc=L-160|0)|0,3192,144),q[52+qc>>2]=a,q[28+qc>>2]=a,q[56+qc>>2]=rc=(rc=-2-a|0)>>>0<256?rc:256,q[36+qc>>2]=a=a+rc|0,q[24+qc>>2]=a,Ia(8+qc|0,ic,pc,11,12),rc&&(a=q[28+qc>>2],o[a-((0|a)==q[24+qc>>2])|0]=0),L=160+qc|0}function La(a,ic){var sc,tc,pc=0,pc=0!=(0|ic);a:{b:{c:{d:if(!(!ic|!(3&a)))for(;;){if(!r[0|a])break c;if(a=a+1|0,pc=0!=(0|(ic=ic+-1|0)),!ic)break d;if(!(3&a))break}if(!pc)break b}if(!r[0|a])break a;e:{if(4<=ic>>>0){for(pc=(pc=ic+-4|0)-(sc=-4&pc)|0,sc=4+(a+sc|0)|0;;){if((-1^(tc=q[a>>2]))&tc+-16843009&-2139062144)break e;if(a=a+4|0,!(3<(ic=ic+-4|0)>>>0))break}ic=pc,a=sc}if(!ic)break b}for(;;){if(!r[0|a])break a;if(a=a+1|0,!(ic=ic+-1|0))break}}return 0}return a}function Ma(a){var uc,ic=0;if(!a)return 32;if(!(1&a))for(;ic=ic+1|0,uc=2&a,a>>>=1,!uc;);return ic}function Na(a,vc){var zc,Ac,Bc,yc,wc=0,xc=0,xc=4;L=yc=L-256|0;a:if(!((0|vc)<2))for(wc=q[(Bc=(vc<<2)+a|0)>>2]=yc;;){for($(wc,q[a>>2],zc=xc>>>0<256?xc:256),wc=0;$(q[(Ac=(wc<<2)+a|0)>>2],q[((wc=wc+1|0)<<2)+a>>2],zc),q[Ac>>2]=q[Ac>>2]+zc,(0|vc)!=(0|wc););if(!(xc=xc-zc|0))break a;wc=q[Bc>>2]}L=256+yc|0}function Oa(a){return Ma(q[a>>2]+-1|0)||((a=Ma(q[a+4>>2]))?a+32|0:0)}function _c(a,$o){$o|=0,b[0]=a|=0,b[1]=$o}function bd(a,$o,ap){return function(a,$o,ap){var ep,cp,bp,dp,fp=w(cp=ap>>>16,bp=a>>>16);return a=(65535&(bp=((ep=w(dp=65535&ap,a&=65535))>>>16)+w(bp,dp)|0))+w(a,cp)|0,M=((fp+w($o,ap)|0)+(bp>>>16)|0)+(a>>>16)|0,65535&ep|a<<16}(a,$o,ap)}function cd(a,$o,ap){return function(a,$o,ap){var np,mp,gp=0,hp=0,ip=0,jp=0,kp=0,lp=0,op=0;a:{b:{c:{d:{e:{if(!(hp=$o))return _c(($o=a)-w(a=(a>>>0)/(ap>>>0)|0,ap)|0,0),M=0,a;if(gp=ap){if(!((jp=gp+-1|0)&gp))break e;kp=0-(jp=(z(gp)+33|0)-z(hp)|0)|0;break c}if(!a)return _c(0,hp-w(a=(hp>>>0)/0|0,0)|0),M=0,a;if((gp=32-z(hp)|0)>>>0<31)break d;break b}if(_c(a&jp,0),1==(0|gp))break a;return ap=31&(gp=gp?31-z(gp+-1^gp)|0:32),a=32<=(63&gp)>>>0?(hp=0,$o>>>ap):(hp=$o>>>ap,((1<>>ap),M=hp,a}jp=gp+1|0,kp=63-gp|0}if(gp=$o,ip=31&(hp=63&jp),ip=32<=hp>>>0?(hp=0,gp>>>ip):(hp=gp>>>ip,((1<>>ip),gp=31&(kp&=63),32<=kp>>>0?($o=a<>>32-gp|$o<>>0<4294967295&&(gp=0);ip=(mp=lp=ip<<1|$o>>>31)-(np=ap&(lp=gp-((hp=hp<<1|ip>>>31)+(kp>>>0>>0)|0)>>31))|0,hp=hp-(mp>>>0>>0)|0,$o=$o<<1|a>>>31,a=op|a<<1,op=lp&=1,jp=jp+-1|0;);return _c(ip,hp),M=$o<<1|a>>>31,lp|a<<1}_c(a,$o),$o=a=0}return M=$o,a}(a,$o,ap)}function ed(a){var pp;return(-1>>>(pp=31&a)&-2)<>>a}function N(){return buffer.byteLength/65536|0}}(H,I,J)}}l=null,b.wasmBinary&&(F=b.wasmBinary);var WebAssembly={},F=[];"object"!=typeof WebAssembly&&E("no native wasm support detected");var I,J=new function(a){var c=Array(16);return c.grow=function(){17<=c.length&&B("Unable to grow wasm table. Use a higher value for RESERVED_FUNCTION_POINTERS or set ALLOW_TABLE_GROWTH."),c.push(null)},c.set=function(a,e){c[a]=e},c.get=function(a){return c[a]},c},K=!1;function assert(a,c){a||B("Assertion failed: "+c)}var buffer,M,L,N,ha="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function ia(a,c,d){var e=c+d;for(d=c;a[d]&&!(e<=d);)++d;if(16>10,56320|1023&f)))):e+=String.fromCharCode(f)}return e}function ja(a,c){return a?ia(L,a,c):""}function ka(a){return 0>>16)*e+d*(c>>>16)<<16)|0}),Math.fround||(ra=new Float32Array(1),Math.fround=function(a){return ra[0]=a,ra[0]}),Math.clz32||(Math.clz32=function(a){var c=32,d=a>>16;return d&&(c-=16,a=d),(d=a>>8)&&(c-=8,a=d),(d=a>>4)&&(c-=4,a=d),(d=a>>2)&&(c-=2,a=d),a>>1?c-2:c-a}),Math.trunc||(Math.trunc=function(a){return a<0?Math.ceil(a):Math.floor(a)}),0),Q=null,U=null;function B(a){throw b.onAbort&&b.onAbort(a),D(a),E(a),K=!0,"abort("+a+"). Build with -s ASSERTIONS=1 for more info."}b.preloadedImages={},b.preloadedAudios={};var V="data:application/octet-stream;base64,";function W(a){return String.prototype.startsWith?a.startsWith(V):0===a.indexOf(V)}var X="_em_module.wasm";function ta(){try{if(F)return new Uint8Array(F);var a=z(X);if(a)return a;if(w)return w(X);throw"both async and sync fetching of the wasm failed"}catch(c){B(c)}}W(X)||(t=X,X=b.locateFile?b.locateFile(t,u):u+t),na.push({ea:function(){va()}});var wa=[null,[],[]],xa=!1;function C(a){for(var c=[],d=0;d>4,f=(15&f)<<4|g>>2,h=(3&g)<<6|m}while(c+=String.fromCharCode(e),64!==g&&(c+=String.fromCharCode(f)),64!==m&&(c+=String.fromCharCode(h)),d>16),la(I.buffer);var d=1;break a}catch(e){}d=void 0}return!!d},c:function(a,c,d,e){try{for(var f=0,g=0;g>2],h=N[c+(8*g+4)>>2],A=0;A>2]=f,0}catch(T){return"undefined"!=typeof FS&&T instanceof FS.fa||B(T),T.ga}},memory:I,table:J},u=function(){function a(a){b.asm=a.exports,P--,b.monitorRunDependencies&&b.monitorRunDependencies(P),0==P&&(null!==Q&&(clearInterval(Q),Q=null),U)&&(a=U,U=null,a())}function c(c){a(c.instance)}function d(a){(F||!p&&!q||"function"!=typeof fetch?new Promise(function(a){a(ta())}):fetch(X,{credentials:"same-origin"}).then(function(a){if(a.ok)return a.arrayBuffer();throw"failed to load wasm binary file at '"+X+"'"}).catch(ta)).then(function(){return{then:function(a){a({instance:new da})}}}).then(a,function(a){E("failed to asynchronously prepare wasm: "+a),B(a)})}var e={env:H,wasi_unstable:H};if(P++,b.monitorRunDependencies&&b.monitorRunDependencies(P),b.instantiateWasm)try{return b.instantiateWasm(e,a)}catch(f){return E("Module.instantiateWasm callback failed with error: "+f),!1}return F||"function"!=typeof WebAssembly.instantiateStreaming||W(X)||"function"!=typeof fetch?d(c):fetch(X,{credentials:"same-origin"}).then(function(a){return WebAssembly.instantiateStreaming(a,e).then(c,function(a){E("wasm streaming compile failed: "+a),E("falling back to ArrayBuffer instantiation"),d(c)})}),{}}(),va=(b.asm=u,b.___wasm_call_ctors=function(){return b.asm.d.apply(null,arguments)}),Aa=(b._csmGetLogFunction=function(){return b.asm.e.apply(null,arguments)},b._csmGetVersion=function(){return b.asm.f.apply(null,arguments)},b._csmGetLatestMocVersion=function(){return b.asm.g.apply(null,arguments)},b._csmGetMocVersion=function(){return b.asm.h.apply(null,arguments)},b._csmHasMocConsistency=function(){return b.asm.i.apply(null,arguments)},b._csmSetLogFunction=function(){return b.asm.j.apply(null,arguments)},b._csmReviveMocInPlace=function(){return b.asm.k.apply(null,arguments)},b._csmReadCanvasInfo=function(){return b.asm.l.apply(null,arguments)},b._csmGetSizeofModel=function(){return b.asm.m.apply(null,arguments)},b._csmInitializeModelInPlace=function(){return b.asm.n.apply(null,arguments)},b._csmUpdateModel=function(){return b.asm.o.apply(null,arguments)},b._csmGetParameterCount=function(){return b.asm.p.apply(null,arguments)},b._csmGetParameterIds=function(){return b.asm.q.apply(null,arguments)},b._csmGetParameterTypes=function(){return b.asm.r.apply(null,arguments)},b._csmGetParameterMinimumValues=function(){return b.asm.s.apply(null,arguments)},b._csmGetParameterMaximumValues=function(){return b.asm.t.apply(null,arguments)},b._csmGetParameterDefaultValues=function(){return b.asm.u.apply(null,arguments)},b._csmGetParameterValues=function(){return b.asm.v.apply(null,arguments)},b._csmGetPartCount=function(){return b.asm.w.apply(null,arguments)},b._csmGetPartIds=function(){return b.asm.x.apply(null,arguments)},b._csmGetPartOpacities=function(){return b.asm.y.apply(null,arguments)},b._csmGetPartParentPartIndices=function(){return b.asm.z.apply(null,arguments)},b._csmGetDrawableCount=function(){return b.asm.A.apply(null,arguments)},b._csmGetDrawableIds=function(){return b.asm.B.apply(null,arguments)},b._csmGetDrawableConstantFlags=function(){return b.asm.C.apply(null,arguments)},b._csmGetDrawableDynamicFlags=function(){return b.asm.D.apply(null,arguments)},b._csmGetDrawableTextureIndices=function(){return b.asm.E.apply(null,arguments)},b._csmGetDrawableDrawOrders=function(){return b.asm.F.apply(null,arguments)},b._csmGetDrawableRenderOrders=function(){return b.asm.G.apply(null,arguments)},b._csmGetDrawableOpacities=function(){return b.asm.H.apply(null,arguments)},b._csmGetDrawableMaskCounts=function(){return b.asm.I.apply(null,arguments)},b._csmGetDrawableMasks=function(){return b.asm.J.apply(null,arguments)},b._csmGetDrawableVertexCounts=function(){return b.asm.K.apply(null,arguments)},b._csmGetDrawableVertexPositions=function(){return b.asm.L.apply(null,arguments)},b._csmGetDrawableVertexUvs=function(){return b.asm.M.apply(null,arguments)},b._csmGetDrawableIndexCounts=function(){return b.asm.N.apply(null,arguments)},b._csmGetDrawableIndices=function(){return b.asm.O.apply(null,arguments)},b._csmGetDrawableMultiplyColors=function(){return b.asm.P.apply(null,arguments)},b._csmGetDrawableScreenColors=function(){return b.asm.Q.apply(null,arguments)},b._csmGetDrawableParentPartIndices=function(){return b.asm.R.apply(null,arguments)},b._csmResetDrawableDynamicFlags=function(){return b.asm.S.apply(null,arguments)},b._csmGetParameterKeyCounts=function(){return b.asm.T.apply(null,arguments)},b._csmGetParameterKeyValues=function(){return b.asm.U.apply(null,arguments)},b._csmMallocMoc=function(){return b.asm.V.apply(null,arguments)},b._csmMallocModelAndInitialize=function(){return b.asm.W.apply(null,arguments)},b._csmMalloc=function(){return b.asm.X.apply(null,arguments)},b._csmFree=function(){return b.asm.Y.apply(null,arguments)},b._csmInitializeAmountOfMemory=function(){return b.asm.Z.apply(null,arguments)},b.stackSave=function(){return b.asm._.apply(null,arguments)}),Ba=b.stackAlloc=function(){return b.asm.$.apply(null,arguments)},Ca=b.stackRestore=function(){return b.asm.aa.apply(null,arguments)},ca=b.__growWasmMemory=function(){return b.asm.ba.apply(null,arguments)};function Z(){function a(){if(!Y&&(Y=!0,!K)){if(O(na),O(oa),b.onRuntimeInitialized&&b.onRuntimeInitialized(),b.postRun)for("function"==typeof b.postRun&&(b.postRun=[b.postRun]);b.postRun.length;){var a=b.postRun.shift();pa.unshift(a)}O(pa)}}if(!(0>6}else{if(k<=65535){if(d<=e+2)break;f[e++]=224|k>>12}else{if(d<=e+3)break;f[e++]=240|k>>18,f[e++]=128|k>>12&63}f[e++]=128|k>>6&63}f[e++]=128|63&k}}f[e]=0}}return c},array:function(a){var c=Ba(a.length);return M.set(a,c),c}},g=function(a){var c=b["_"+a];return assert(c,"Cannot call unknown function "+a+", make sure it is exported"),c}(a),m=[];if(a=0,e)for(var h=0;h(r(),s(m(e),{title:t.$t("settings.pages.modules.memory-long-term.title"),subtitle:t.$t("settings.title")},null,8,["title","subtitle"]))}});export{u as default}; diff --git a/assets/memory-long-term-DqgaRqei.js b/assets/memory-long-term-DqgaRqei.js new file mode 100644 index 0000000000000000000000000000000000000000..aee71719cff337865b7ae4c3b5bad597d1794c28 --- /dev/null +++ b/assets/memory-long-term-DqgaRqei.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{_ as e}from"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";import{d as o,x as s,o as r,u as m}from"./index-D55VqdU4.js";const u=o({__name:"memory-long-term",setup(n){return(t,i)=>(r(),s(m(e),{title:t.$t("settings.pages.modules.memory-long-term.title"),subtitle:t.$t("settings.title")},null,8,["title","subtitle"]))}});export{u as default}; diff --git a/assets/memory-short-term-5cVLOK6h.js b/assets/memory-short-term-5cVLOK6h.js deleted file mode 100644 index 13ba682994786f0b28f504410369123a63fdb6db..0000000000000000000000000000000000000000 --- a/assets/memory-short-term-5cVLOK6h.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{_ as e}from"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";import{d as s,x as o,o as r,u as m}from"./index--eYU5aQm.js";const u=s({__name:"memory-short-term",setup(i){return(t,n)=>(r(),o(m(e),{title:t.$t("settings.pages.modules.memory-short-term.title"),subtitle:t.$t("settings.title")},null,8,["title","subtitle"]))}});export{u as default}; diff --git a/assets/memory-short-term-CgjWXBzF.js b/assets/memory-short-term-CgjWXBzF.js new file mode 100644 index 0000000000000000000000000000000000000000..721f2a706b3071e85aa7f42c28fedca54b192eed --- /dev/null +++ b/assets/memory-short-term-CgjWXBzF.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{_ as e}from"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";import{d as s,x as o,o as r,u as m}from"./index-D55VqdU4.js";const u=s({__name:"memory-short-term",setup(i){return(t,n)=>(r(),o(m(e),{title:t.$t("settings.pages.modules.memory-short-term.title"),subtitle:t.$t("settings.title")},null,8,["title","subtitle"]))}});export{u as default}; diff --git a/assets/messages-Da3sXLYk.js b/assets/messages-BXrCHBJr.js similarity index 67% rename from assets/messages-Da3sXLYk.js rename to assets/messages-BXrCHBJr.js index c2f274218095fe7023737a9181de0d198cf507a2..1afdcc319711a006951ebb87626da5b438323776 100644 --- a/assets/messages-Da3sXLYk.js +++ b/assets/messages-BXrCHBJr.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{_ as c}from"./Textarea.vue_vue_type_script_setup_true_lang-DwFb1myn.js";import{d as g,g as o,c as l,o as u,a as e,b as _,u as v,D as p,bx as b,by as x}from"./index--eYU5aQm.js";import{u as k}from"./queue-D6byf-bD.js";import{u as h,l as w}from"./queues-r0c9CGew.js";import"./Basic.vue_vue_type_script_setup_true_lang-Ckn2TiNk.js";const y={flex:"","flex-col":"","gap-2":"","p-2":""},S={flex:"","flex-row":"","gap-2":""},V={"rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-4":""},M={"w-full":"",flex:"","flex-row":"","gap-4":""},Q={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},P=g({__name:"messages",setup(B){const s=o(""),r=o([]),t=o(!1),f=k({handlers:[async i=>{r.value.push(i.data)}]}),d=h(f);async function m(){t.value=!0,d.add(s.value),d.add(w),s.value="",t.value=!1}return(i,a)=>(u(),l("div",y,[e("div",S,[_(v(c),{modelValue:s.value,"onUpdate:modelValue":a[0]||(a[0]=n=>s.value=n),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:m},null,8,["modelValue"]),e("button",V,p(t.value?"Processing...":"Send"),1)]),e("div",M,[e("div",Q,[a[1]||(a[1]=e("h3",{"font-semibold":""}," TTS Message ",-1)),(u(!0),l(b,null,x(r.value,n=>(u(),l("div",{key:n},[e("div",null,p(n),1)]))),128))])])]))}});export{P as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{_ as c}from"./Textarea.vue_vue_type_script_setup_true_lang-NzxEJo0x.js";import{d as g,g as o,c as l,o as u,a as e,b as _,u as v,D as p,bx as b,by as x}from"./index-D55VqdU4.js";import{u as k}from"./queue-CugJlP7m.js";import{u as h,l as w}from"./queues-DEEIdmXP.js";import"./Basic.vue_vue_type_script_setup_true_lang-DJ4kS-zi.js";const y={flex:"","flex-col":"","gap-2":"","p-2":""},S={flex:"","flex-row":"","gap-2":""},V={"rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-4":""},M={"w-full":"",flex:"","flex-row":"","gap-4":""},Q={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},P=g({__name:"messages",setup(B){const s=o(""),r=o([]),t=o(!1),f=k({handlers:[async i=>{r.value.push(i.data)}]}),d=h(f);async function m(){t.value=!0,d.add(s.value),d.add(w),s.value="",t.value=!1}return(i,a)=>(u(),l("div",y,[e("div",S,[_(v(c),{modelValue:s.value,"onUpdate:modelValue":a[0]||(a[0]=n=>s.value=n),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:m},null,8,["modelValue"]),e("button",V,p(t.value?"Processing...":"Send"),1)]),e("div",M,[e("div",Q,[a[1]||(a[1]=e("h3",{"font-semibold":""}," TTS Message ",-1)),(u(!0),l(b,null,x(r.value,n=>(u(),l("div",{key:n},[e("div",null,p(n),1)]))),128))])])]))}});export{P as default}; diff --git a/assets/microsoft-speech-DN1YLkUZ.js b/assets/microsoft-speech-BIikQlYj.js similarity index 67% rename from assets/microsoft-speech-DN1YLkUZ.js rename to assets/microsoft-speech-BIikQlYj.js index fd8ed9d507436d6887a8945cf46f268e9944f1fc..407c700be1ffe95e6aa7ecbbf6bfe9411b2de5f1 100644 --- a/assets/microsoft-speech-DN1YLkUZ.js +++ b/assets/microsoft-speech-BIikQlYj.js @@ -1 +1 @@ -import{_ as P}from"./FieldInput.vue_vue_type_script_setup_true_lang-CriF7G5j.js";import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{d as $,q,s as B,g as v,h as f,r as K,x as M,o as T,y as g,b as h,u as n}from"./index--eYU5aQm.js";import{u as z}from"./providers-YQf-rDZ1.js";import{u as E}from"./speech-BOhrg3WS.js";import{_ as F,a as G}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-CYRUbdP0.js";import"./Input.vue_vue_type_script_setup_true_lang-DaL4uFR_.js";import"./index-Be1NqeGb.js";import"./TestDummyMarker.vue_vue_type_script_setup_true_lang-Pam45T1i.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dsoa87PD.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-CWkRm8IH.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BHnSNWo1.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CCsf2oJB.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BJL9_E_2.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";const t="microsoft-speech",x="v1",oe=$({__name:"microsoft-speech",setup(H){const{t:S}=q(),C={pitch:0,speed:1,volume:0},p=E(),d=z(),{providers:r}=B(d),c=v(0),_=v(1),b=v(0),u=f({get:()=>{var o;return((o=r.value[t])==null?void 0:o.region)||"eastasia"},set:o=>{r.value[t]||(r.value[t]={}),r.value[t].region=o}}),U=f(()=>{var o;return!!((o=r.value[t])!=null&&o.apiKey)}),y=f(()=>p.availableVoices[t]||[]);async function k(o,e,l){const i=d.getProviderInstance(t);if(!i)throw new Error("Failed to initialize speech provider");const a=d.getProviderConfig(t),s=a.model||x,V={...a,region:u.value,disableSsml:!l};if(!l&&e){const w=y.value.find(m=>m.id===e);if(w){const m=p.generateSSML(o,w,{...a,pitch:c.value});return await p.speech(i,s,m,e,V)}}return await p.speech(i,s,o,e,V)}return(o,e)=>{const l=K("SpeechVoiceSettings");return T(),M(n(G),{"provider-id":t,"default-model":x,"additional-settings":C},{"basic-settings":g(()=>[h(n(P),{modelValue:u.value,"onUpdate:modelValue":e[0]||(e[0]=i=>u.value=i),label:n(S)("settings.pages.providers.provider.microsoft-speech.fields.field.region.label"),description:n(S)("settings.pages.providers.provider.microsoft-speech.fields.field.region.description"),placeholder:"eastasia",required:"",type:"text"},null,8,["modelValue","label","description"])]),"voice-settings":g(({voiceSettings:i,updateVoiceSettings:a})=>[h(l,{pitch:c.value,"onUpdate:pitch":e[1]||(e[1]=s=>c.value=s),speed:_.value,"onUpdate:speed":e[2]||(e[2]=s=>_.value=s),volume:b.value,"onUpdate:volume":e[3]||(e[3]=s=>b.value=s),settings:i,"show-pitch":!0,"show-speed":!0,"show-volume":!0,onUpdate:a},null,8,["pitch","speed","volume","settings","onUpdate"])]),playground:g(()=>[h(n(F),{"available-voices":y.value,"generate-speech":k,"api-key-configured":U.value,"default-text":"Hello! This is a test of the Microsoft Speech synthesis."},null,8,["available-voices","api-key-configured"])]),_:1})}}});export{oe as default}; +import{_ as P}from"./FieldInput.vue_vue_type_script_setup_true_lang-DQP2RhYC.js";import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{d as $,q,s as B,g as v,h as f,r as K,x as M,o as T,y as g,b as h,u as n}from"./index-D55VqdU4.js";import{u as z}from"./providers-DAp1566d.js";import{u as E}from"./speech-BtNOtIn9.js";import{_ as F,a as G}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-CPbYTBJt.js";import"./Input.vue_vue_type_script_setup_true_lang-CeU0PE9S.js";import"./index-Be1NqeGb.js";import"./TestDummyMarker.vue_vue_type_script_setup_true_lang-DRQbkM6R.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-BtshDojk.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BDoHyduV.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BbB31kj-.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BMPV9bKe.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DLyRry-6.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";const t="microsoft-speech",x="v1",oe=$({__name:"microsoft-speech",setup(H){const{t:S}=q(),C={pitch:0,speed:1,volume:0},p=E(),d=z(),{providers:r}=B(d),c=v(0),_=v(1),b=v(0),u=f({get:()=>{var o;return((o=r.value[t])==null?void 0:o.region)||"eastasia"},set:o=>{r.value[t]||(r.value[t]={}),r.value[t].region=o}}),U=f(()=>{var o;return!!((o=r.value[t])!=null&&o.apiKey)}),y=f(()=>p.availableVoices[t]||[]);async function k(o,e,l){const i=d.getProviderInstance(t);if(!i)throw new Error("Failed to initialize speech provider");const a=d.getProviderConfig(t),s=a.model||x,V={...a,region:u.value,disableSsml:!l};if(!l&&e){const w=y.value.find(m=>m.id===e);if(w){const m=p.generateSSML(o,w,{...a,pitch:c.value});return await p.speech(i,s,m,e,V)}}return await p.speech(i,s,o,e,V)}return(o,e)=>{const l=K("SpeechVoiceSettings");return T(),M(n(G),{"provider-id":t,"default-model":x,"additional-settings":C},{"basic-settings":g(()=>[h(n(P),{modelValue:u.value,"onUpdate:modelValue":e[0]||(e[0]=i=>u.value=i),label:n(S)("settings.pages.providers.provider.microsoft-speech.fields.field.region.label"),description:n(S)("settings.pages.providers.provider.microsoft-speech.fields.field.region.description"),placeholder:"eastasia",required:"",type:"text"},null,8,["modelValue","label","description"])]),"voice-settings":g(({voiceSettings:i,updateVoiceSettings:a})=>[h(l,{pitch:c.value,"onUpdate:pitch":e[1]||(e[1]=s=>c.value=s),speed:_.value,"onUpdate:speed":e[2]||(e[2]=s=>_.value=s),volume:b.value,"onUpdate:volume":e[3]||(e[3]=s=>b.value=s),settings:i,"show-pitch":!0,"show-speed":!0,"show-volume":!0,onUpdate:a},null,8,["pitch","speed","volume","settings","onUpdate"])]),playground:g(()=>[h(n(F),{"available-voices":y.value,"generate-speech":k,"api-key-configured":U.value,"default-text":"Hello! This is a test of the Microsoft Speech synthesis."},null,8,["available-voices","api-key-configured"])]),_:1})}}});export{oe as default}; diff --git a/assets/mistral-ai-D6fyZpIj.js b/assets/mistral-ai-BllFW1bl.js similarity index 69% rename from assets/mistral-ai-D6fyZpIj.js rename to assets/mistral-ai-BllFW1bl.js index 5df02a36b853623ae8013fbca03ff6e6e9611d3d..80e66cf4b8232763a067cf5d61516d072a2fe4b3 100644 --- a/assets/mistral-ai-D6fyZpIj.js +++ b/assets/mistral-ai-BllFW1bl.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{d as U,q as V,bG as y,s as $,h as v,l as k,w as K,x as h,o as x,y as m,b as l,u as t}from"./index--eYU5aQm.js";import{u as w}from"./providers-YQf-rDZ1.js";import{_ as z,a as C}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dsoa87PD.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CCsf2oJB.js";import{_ as N,a as P}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BJL9_E_2.js";import{_ as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DVunqc-i.js";import"./index-Be1NqeGb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-CWkRm8IH.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BHnSNWo1.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-CriF7G5j.js";import"./Input.vue_vue_type_script_setup_true_lang-DaL4uFR_.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";const a="mistral-ai",L=U({__name:"mistral-ai",setup(S){const{t:p}=V(),_=y(),d=w(),{providers:o}=$(d),n=v(()=>d.getProviderMetadata(a)),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});k(()=>{var e,i;d.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),K([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return x(),h(t(R),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(_).back()},{default:m(()=>[l(t(N),null,{default:m(()=>[l(t(P),{title:t(p)("settings.pages.providers.common.section.basic.title"),description:t(p)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:m(()=>{var u;return[l(t(M),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=g=>r.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"mis-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(p)("settings.pages.providers.common.section.advanced.title")},{default:m(()=>[l(t(C),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=u=>s.value=u),placeholder:"https://api.mistral.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});export{L as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{d as U,q as V,bG as y,s as $,h as v,l as k,w as K,x as h,o as x,y as m,b as l,u as t}from"./index-D55VqdU4.js";import{u as w}from"./providers-DAp1566d.js";import{_ as z,a as C}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-BtshDojk.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BMPV9bKe.js";import{_ as N,a as P}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DLyRry-6.js";import{_ as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-Cc3LXYUd.js";import"./index-Be1NqeGb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BDoHyduV.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BbB31kj-.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DQP2RhYC.js";import"./Input.vue_vue_type_script_setup_true_lang-CeU0PE9S.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";const a="mistral-ai",L=U({__name:"mistral-ai",setup(S){const{t:p}=V(),_=y(),d=w(),{providers:o}=$(d),n=v(()=>d.getProviderMetadata(a)),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});k(()=>{var e,i;d.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),K([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return x(),h(t(R),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(_).back()},{default:m(()=>[l(t(N),null,{default:m(()=>[l(t(P),{title:t(p)("settings.pages.providers.common.section.basic.title"),description:t(p)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:m(()=>{var u;return[l(t(M),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=g=>r.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"mis-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(p)("settings.pages.providers.common.section.advanced.title")},{default:m(()=>[l(t(C),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=u=>s.value=u),placeholder:"https://api.mistral.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});export{L as default}; diff --git a/assets/moonshot-ai-UMUsb3tN.js b/assets/moonshot-ai-DHW8Lwbg.js similarity index 68% rename from assets/moonshot-ai-UMUsb3tN.js rename to assets/moonshot-ai-DHW8Lwbg.js index 8b27d48a3e9c6cc4fcdedcbf617e4774d40ae5aa..304f49a570563594efd6290cac670b55a81f37ca 100644 --- a/assets/moonshot-ai-UMUsb3tN.js +++ b/assets/moonshot-ai-DHW8Lwbg.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{d as h,q as U,bG as V,s as y,h as v,l as $,w as k,x as K,o as x,y as m,b as l,u as t}from"./index--eYU5aQm.js";import{u as w}from"./providers-YQf-rDZ1.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dsoa87PD.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CCsf2oJB.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BJL9_E_2.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DVunqc-i.js";import"./index-Be1NqeGb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-CWkRm8IH.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BHnSNWo1.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-CriF7G5j.js";import"./Input.vue_vue_type_script_setup_true_lang-DaL4uFR_.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";const a="moonshot-ai",L=h({__name:"moonshot-ai",setup(B){const{t:p}=U(),_=V(),d=w(),{providers:o}=y(d),n=v(()=>d.getProviderMetadata(a)),i=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,s;d.initializeProvider(a),i.value=((e=o.value[a])==null?void 0:e.apiKey)||"",r.value=((s=o.value[a])==null?void 0:s.baseUrl)||""}),k([i,r],()=>{o.value[a]={...o.value[a],apiKey:i.value,baseUrl:r.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,s)=>{var c,f;return x(),K(t(S),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(_).back()},{default:m(()=>[l(t(P),null,{default:m(()=>[l(t(R),{title:t(p)("settings.pages.providers.common.section.basic.title"),description:t(p)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:m(()=>{var u;return[l(t(N),{modelValue:i.value,"onUpdate:modelValue":s[0]||(s[0]=g=>i.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"ms-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(p)("settings.pages.providers.common.section.advanced.title")},{default:m(()=>[l(t(M),{modelValue:r.value,"onUpdate:modelValue":s[1]||(s[1]=u=>r.value=u),placeholder:"https://api.moonshot.cn/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{L as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{d as h,q as U,bG as V,s as y,h as v,l as $,w as k,x as K,o as x,y as m,b as l,u as t}from"./index-D55VqdU4.js";import{u as w}from"./providers-DAp1566d.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-BtshDojk.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BMPV9bKe.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DLyRry-6.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-Cc3LXYUd.js";import"./index-Be1NqeGb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BDoHyduV.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BbB31kj-.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DQP2RhYC.js";import"./Input.vue_vue_type_script_setup_true_lang-CeU0PE9S.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";const a="moonshot-ai",L=h({__name:"moonshot-ai",setup(B){const{t:p}=U(),_=V(),d=w(),{providers:o}=y(d),n=v(()=>d.getProviderMetadata(a)),i=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,s;d.initializeProvider(a),i.value=((e=o.value[a])==null?void 0:e.apiKey)||"",r.value=((s=o.value[a])==null?void 0:s.baseUrl)||""}),k([i,r],()=>{o.value[a]={...o.value[a],apiKey:i.value,baseUrl:r.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,s)=>{var c,f;return x(),K(t(S),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(_).back()},{default:m(()=>[l(t(P),null,{default:m(()=>[l(t(R),{title:t(p)("settings.pages.providers.common.section.basic.title"),description:t(p)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:m(()=>{var u;return[l(t(N),{modelValue:i.value,"onUpdate:modelValue":s[0]||(s[0]=g=>i.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"ms-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(p)("settings.pages.providers.common.section.advanced.title")},{default:m(()=>[l(t(M),{modelValue:r.value,"onUpdate:modelValue":s[1]||(s[1]=u=>r.value=u),placeholder:"https://api.moonshot.cn/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{L as default}; diff --git a/assets/novita-ai-DhZP6eEA.js b/assets/novita-ai-Bwr7ycLb.js similarity index 69% rename from assets/novita-ai-DhZP6eEA.js rename to assets/novita-ai-Bwr7ycLb.js index 9a3f746cb7cd4e857ad7148717a28c80e64a31ac..92590f14594b495ebc1067f25e7d9f704208ff18 100644 --- a/assets/novita-ai-DhZP6eEA.js +++ b/assets/novita-ai-Bwr7ycLb.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{d as U,q as V,bG as y,s as $,h as v,l as k,w as K,x as h,o as x,y as p,b as l,u as t}from"./index--eYU5aQm.js";import{u as w}from"./providers-YQf-rDZ1.js";import{_ as z,a as C}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dsoa87PD.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CCsf2oJB.js";import{_ as N,a as P}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BJL9_E_2.js";import{_ as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DVunqc-i.js";import"./index-Be1NqeGb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-CWkRm8IH.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BHnSNWo1.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-CriF7G5j.js";import"./Input.vue_vue_type_script_setup_true_lang-DaL4uFR_.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";const a="novita-ai",L=U({__name:"novita-ai",setup(S){const{t:d}=V(),_=y(),m=w(),{providers:o}=$(m),n=v(()=>m.getProviderMetadata(a)),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});k(()=>{var e,i;m.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),K([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return x(),h(t(R),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(_).back()},{default:p(()=>[l(t(N),null,{default:p(()=>[l(t(P),{title:t(d)("settings.pages.providers.common.section.basic.title"),description:t(d)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:p(()=>{var u;return[l(t(M),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=g=>r.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"nvt-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(d)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(C),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=u=>s.value=u),placeholder:"https://api.novita.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});export{L as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{d as U,q as V,bG as y,s as $,h as v,l as k,w as K,x as h,o as x,y as p,b as l,u as t}from"./index-D55VqdU4.js";import{u as w}from"./providers-DAp1566d.js";import{_ as z,a as C}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-BtshDojk.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BMPV9bKe.js";import{_ as N,a as P}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DLyRry-6.js";import{_ as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-Cc3LXYUd.js";import"./index-Be1NqeGb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BDoHyduV.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BbB31kj-.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DQP2RhYC.js";import"./Input.vue_vue_type_script_setup_true_lang-CeU0PE9S.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";const a="novita-ai",L=U({__name:"novita-ai",setup(S){const{t:d}=V(),_=y(),m=w(),{providers:o}=$(m),n=v(()=>m.getProviderMetadata(a)),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});k(()=>{var e,i;m.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),K([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return x(),h(t(R),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(_).back()},{default:p(()=>[l(t(N),null,{default:p(()=>[l(t(P),{title:t(d)("settings.pages.providers.common.section.basic.title"),description:t(d)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:p(()=>{var u;return[l(t(M),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=g=>r.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"nvt-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(d)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(C),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=u=>s.value=u),placeholder:"https://api.novita.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});export{L as default}; diff --git a/assets/ollama-b51zIBIG.js b/assets/ollama-X-aI2B2C.js similarity index 86% rename from assets/ollama-b51zIBIG.js rename to assets/ollama-X-aI2B2C.js index ed505a596cd409dbe0bc6bebdba3f9eb69563ed6..ed9f618f3947800c0df774dcc0d47df7134a2f02 100644 --- a/assets/ollama-b51zIBIG.js +++ b/assets/ollama-X-aI2B2C.js @@ -1 +1 @@ -import{_ as P}from"./Input.vue_vue_type_script_setup_true_lang-DaL4uFR_.js";import{d as w,bI as x,bJ as U,c as g,o as f,b as m,g as $,w as C,bw as N,a as _,A as D,bL as I,C as O,D as M,bx as R,by as S,q as z,bG as A,s as F,h as q,l as L,c9 as T,x as E,y as b,u as t}from"./index--eYU5aQm.js";import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{u as G}from"./providers-YQf-rDZ1.js";import{a as J,_ as j}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dsoa87PD.js";import{_ as H,a as Q}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BJL9_E_2.js";import{_ as W}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DVunqc-i.js";import"./index-Be1NqeGb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-CWkRm8IH.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BHnSNWo1.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-CriF7G5j.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";const X={flex:"~ gap-2"},Y=w({__name:"InputKeyValue",props:x({name:null,keyPlaceholder:null,valuePlaceholder:null},{propertyKey:{required:!0},propertyKeyModifiers:{},propertyValue:{required:!0},propertyValueModifiers:{}}),emits:["update:propertyKey","update:propertyValue"],setup(v){const o=v,s=U(v,"propertyKey"),u=U(v,"propertyValue");return(r,a)=>(f(),g("div",X,[m(P,{modelValue:s.value,"onUpdate:modelValue":a[0]||(a[0]=n=>s.value=n),placeholder:o.keyPlaceholder,class:"w-1/2"},null,8,["modelValue","placeholder"]),m(P,{modelValue:u.value,"onUpdate:modelValue":a[1]||(a[1]=n=>u.value=n),placeholder:o.valuePlaceholder,class:"w-1/2"},null,8,["modelValue","placeholder"])]))}}),Z={"max-w-full":""},ee={flex:"~ col gap-2"},le={class:"flex items-center gap-1 text-sm font-medium"},ae={key:0,class:"text-red-500"},te={class:"text-xs text-neutral-500 dark:text-neutral-400","text-nowrap":""},oe={flex:"~ col gap-2"},re=["onClick"],se=w({__name:"FieldKeyValues",props:x({label:null,description:null,name:null,keyPlaceholder:null,valuePlaceholder:null,required:{type:Boolean},inputClass:null},{modelValue:{required:!0},modelModifiers:{}}),emits:x(["remove","add"],["update:modelValue"]),setup(v,{emit:o}){const s=v,u=o,r=U(v,"modelValue"),a=$(""),n=$("");return C([a,n],()=>{u("add",a.value,n.value)}),(K,p)=>{const k=N("auto-animate");return f(),g("div",Z,[_("label",ee,[_("div",null,[_("div",le,[I(M(s.label)+" ",1),s.required!==!1?(f(),g("span",ae,"*")):O("",!0)]),_("div",te,M(s.description),1)]),D((f(),g("div",oe,[(f(!0),g(R,null,S(r.value,(y,l)=>(f(),g("div",{key:l,"w-full":"",flex:"","items-center":"","gap-2":""},[m(Y,{"property-key":y.key,"onUpdate:propertyKey":e=>y.key=e,"property-value":y.value,"onUpdate:propertyValue":e=>y.value=e,"key-placeholder":s.keyPlaceholder,"value-placeholder":s.valuePlaceholder,"w-full":""},null,8,["property-key","onUpdate:propertyKey","property-value","onUpdate:propertyValue","key-placeholder","value-placeholder"]),_("button",{onClick:e=>u("remove",l)},p[0]||(p[0]=[_("div",{"i-solar:minus-circle-line-duotone":"",size:"6"},null,-1)]),8,re)]))),128))])),[[k]])])])}}}),d="ollama",he=w({__name:"ollama",setup(v){const{t:o}=z(),s=A(),u=G(),{providers:r}=F(u),a=q(()=>u.getProviderMetadata(d)),n=q({get:()=>{var l,e,i;return((l=r.value[d])==null?void 0:l.baseUrl)||((i=(e=a.value)==null?void 0:e.defaultOptions)==null?void 0:i.baseUrl)||""},set:l=>{r.value[d]||(r.value[d]={}),r.value[d].baseUrl=l}});L(()=>{var l,e,i,h;u.initializeProvider(d),n.value=((l=r.value[d])==null?void 0:l.baseUrl)||((i=(e=a.value)==null?void 0:e.defaultOptions)==null?void 0:i.baseUrl)||"",(h=r.value[d])!=null&&h.headers||(r.value[d].headers={})});function K(){var l;r.value[d]={...(l=a.value)==null?void 0:l.defaultOptions}}const p=T([{key:"",value:""}]);function k(l,e,i){l&&l.push({key:e,value:i})}function y(l,e){e&&(e.length===1?(e[0].key="",e[0].value=""):e.splice(l,1))}return C(p,l=>{l.length>0&&(l[l.length-1].key!==""||l[l.length-1].value!=="")&&l.push({key:"",value:""})},{deep:!0,immediate:!0}),(l,e)=>{var i,h;return f(),E(t(W),{"provider-name":(i=a.value)==null?void 0:i.localizedName,"provider-icon":(h=a.value)==null?void 0:h.icon,"on-back":()=>t(s).back()},{default:b(()=>[m(t(H),null,{default:b(()=>[m(t(Q),{title:t(o)("settings.pages.providers.common.section.basic.title"),description:t(o)("settings.pages.providers.common.section.basic.description"),"on-reset":K},{default:b(()=>{var c,V;return[m(t(J),{modelValue:n.value,"onUpdate:modelValue":e[0]||(e[0]=B=>n.value=B),placeholder:((V=(c=a.value)==null?void 0:c.defaultOptions)==null?void 0:V.baseUrl)||"",required:""},null,8,["modelValue","placeholder"])]}),_:1},8,["title","description"]),m(t(j),{title:t(o)("settings.pages.providers.common.section.advanced.title")},{default:b(()=>[m(t(se),{modelValue:p,"onUpdate:modelValue":e[1]||(e[1]=c=>p=c),label:t(o)("settings.pages.providers.common.section.advanced.fields.field.headers.label"),description:t(o)("settings.pages.providers.common.section.advanced.fields.field.headers.description"),"key-placeholder":t(o)("settings.pages.providers.common.section.advanced.fields.field.headers.key.placeholder"),"value-placeholder":t(o)("settings.pages.providers.common.section.advanced.fields.field.headers.value.placeholder"),onAdd:e[2]||(e[2]=(c,V)=>k(p,c,V)),onRemove:e[3]||(e[3]=c=>y(c,p))},null,8,["modelValue","label","description","key-placeholder","value-placeholder"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{he as default}; +import{_ as P}from"./Input.vue_vue_type_script_setup_true_lang-CeU0PE9S.js";import{d as w,bI as x,bJ as U,c as g,o as f,b as m,g as $,w as C,bw as N,a as _,A as D,bL as I,C as O,D as M,bx as R,by as S,q as z,bG as A,s as F,h as q,l as L,c9 as T,x as E,y as b,u as t}from"./index-D55VqdU4.js";import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{u as G}from"./providers-DAp1566d.js";import{a as J,_ as j}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-BtshDojk.js";import{_ as H,a as Q}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DLyRry-6.js";import{_ as W}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-Cc3LXYUd.js";import"./index-Be1NqeGb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BDoHyduV.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BbB31kj-.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DQP2RhYC.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";const X={flex:"~ gap-2"},Y=w({__name:"InputKeyValue",props:x({name:null,keyPlaceholder:null,valuePlaceholder:null},{propertyKey:{required:!0},propertyKeyModifiers:{},propertyValue:{required:!0},propertyValueModifiers:{}}),emits:["update:propertyKey","update:propertyValue"],setup(v){const o=v,s=U(v,"propertyKey"),u=U(v,"propertyValue");return(r,a)=>(f(),g("div",X,[m(P,{modelValue:s.value,"onUpdate:modelValue":a[0]||(a[0]=n=>s.value=n),placeholder:o.keyPlaceholder,class:"w-1/2"},null,8,["modelValue","placeholder"]),m(P,{modelValue:u.value,"onUpdate:modelValue":a[1]||(a[1]=n=>u.value=n),placeholder:o.valuePlaceholder,class:"w-1/2"},null,8,["modelValue","placeholder"])]))}}),Z={"max-w-full":""},ee={flex:"~ col gap-2"},le={class:"flex items-center gap-1 text-sm font-medium"},ae={key:0,class:"text-red-500"},te={class:"text-xs text-neutral-500 dark:text-neutral-400","text-nowrap":""},oe={flex:"~ col gap-2"},re=["onClick"],se=w({__name:"FieldKeyValues",props:x({label:null,description:null,name:null,keyPlaceholder:null,valuePlaceholder:null,required:{type:Boolean},inputClass:null},{modelValue:{required:!0},modelModifiers:{}}),emits:x(["remove","add"],["update:modelValue"]),setup(v,{emit:o}){const s=v,u=o,r=U(v,"modelValue"),a=$(""),n=$("");return C([a,n],()=>{u("add",a.value,n.value)}),(K,p)=>{const k=N("auto-animate");return f(),g("div",Z,[_("label",ee,[_("div",null,[_("div",le,[I(M(s.label)+" ",1),s.required!==!1?(f(),g("span",ae,"*")):O("",!0)]),_("div",te,M(s.description),1)]),D((f(),g("div",oe,[(f(!0),g(R,null,S(r.value,(y,l)=>(f(),g("div",{key:l,"w-full":"",flex:"","items-center":"","gap-2":""},[m(Y,{"property-key":y.key,"onUpdate:propertyKey":e=>y.key=e,"property-value":y.value,"onUpdate:propertyValue":e=>y.value=e,"key-placeholder":s.keyPlaceholder,"value-placeholder":s.valuePlaceholder,"w-full":""},null,8,["property-key","onUpdate:propertyKey","property-value","onUpdate:propertyValue","key-placeholder","value-placeholder"]),_("button",{onClick:e=>u("remove",l)},p[0]||(p[0]=[_("div",{"i-solar:minus-circle-line-duotone":"",size:"6"},null,-1)]),8,re)]))),128))])),[[k]])])])}}}),d="ollama",he=w({__name:"ollama",setup(v){const{t:o}=z(),s=A(),u=G(),{providers:r}=F(u),a=q(()=>u.getProviderMetadata(d)),n=q({get:()=>{var l,e,i;return((l=r.value[d])==null?void 0:l.baseUrl)||((i=(e=a.value)==null?void 0:e.defaultOptions)==null?void 0:i.baseUrl)||""},set:l=>{r.value[d]||(r.value[d]={}),r.value[d].baseUrl=l}});L(()=>{var l,e,i,h;u.initializeProvider(d),n.value=((l=r.value[d])==null?void 0:l.baseUrl)||((i=(e=a.value)==null?void 0:e.defaultOptions)==null?void 0:i.baseUrl)||"",(h=r.value[d])!=null&&h.headers||(r.value[d].headers={})});function K(){var l;r.value[d]={...(l=a.value)==null?void 0:l.defaultOptions}}const p=T([{key:"",value:""}]);function k(l,e,i){l&&l.push({key:e,value:i})}function y(l,e){e&&(e.length===1?(e[0].key="",e[0].value=""):e.splice(l,1))}return C(p,l=>{l.length>0&&(l[l.length-1].key!==""||l[l.length-1].value!=="")&&l.push({key:"",value:""})},{deep:!0,immediate:!0}),(l,e)=>{var i,h;return f(),E(t(W),{"provider-name":(i=a.value)==null?void 0:i.localizedName,"provider-icon":(h=a.value)==null?void 0:h.icon,"on-back":()=>t(s).back()},{default:b(()=>[m(t(H),null,{default:b(()=>[m(t(Q),{title:t(o)("settings.pages.providers.common.section.basic.title"),description:t(o)("settings.pages.providers.common.section.basic.description"),"on-reset":K},{default:b(()=>{var c,V;return[m(t(J),{modelValue:n.value,"onUpdate:modelValue":e[0]||(e[0]=B=>n.value=B),placeholder:((V=(c=a.value)==null?void 0:c.defaultOptions)==null?void 0:V.baseUrl)||"",required:""},null,8,["modelValue","placeholder"])]}),_:1},8,["title","description"]),m(t(j),{title:t(o)("settings.pages.providers.common.section.advanced.title")},{default:b(()=>[m(t(se),{modelValue:p,"onUpdate:modelValue":e[1]||(e[1]=c=>p=c),label:t(o)("settings.pages.providers.common.section.advanced.fields.field.headers.label"),description:t(o)("settings.pages.providers.common.section.advanced.fields.field.headers.description"),"key-placeholder":t(o)("settings.pages.providers.common.section.advanced.fields.field.headers.key.placeholder"),"value-placeholder":t(o)("settings.pages.providers.common.section.advanced.fields.field.headers.value.placeholder"),onAdd:e[2]||(e[2]=(c,V)=>k(p,c,V)),onRemove:e[3]||(e[3]=c=>y(c,p))},null,8,["modelValue","label","description","key-placeholder","value-placeholder"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{he as default}; diff --git a/assets/openai-DYnQZUih.js b/assets/openai-CJb4OpgD.js similarity index 70% rename from assets/openai-DYnQZUih.js rename to assets/openai-CJb4OpgD.js index 121df38291f12062eb97e376368a4b2c71d5c16f..5b725c37ae99d9d03e2e0e2d667bfa47059db5f6 100644 --- a/assets/openai-DYnQZUih.js +++ b/assets/openai-CJb4OpgD.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{d as h,q as U,bG as V,s as k,h as v,l as y,w as $,x as K,o as x,y as n,b as l,u as t}from"./index--eYU5aQm.js";import{u as I}from"./providers-YQf-rDZ1.js";import{_ as w,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dsoa87PD.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CCsf2oJB.js";import{_ as R,a as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BJL9_E_2.js";import{_ as z}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DVunqc-i.js";import"./index-Be1NqeGb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-CWkRm8IH.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BHnSNWo1.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-CriF7G5j.js";import"./Input.vue_vue_type_script_setup_true_lang-DaL4uFR_.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";const e="openai",L=h({__name:"openai",setup(A){const{t:u}=U(),_=V(),c=I(),{providers:a}=k(c),m=v(()=>c.getProviderMetadata(e)),s=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.apiKey)||""},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].apiKey=o}}),r=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.baseUrl)||"https://api.openai.com/v1/"},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].baseUrl=o}});y(()=>{var o,i;a.value[e]||(a.value[e]={baseUrl:"https://api.openai.com/v1/"}),s.value=((o=a.value[e])==null?void 0:o.apiKey)||"",r.value=((i=a.value[e])==null?void 0:i.baseUrl)||"https://api.openai.com/v1/"}),$([s,r],()=>{a.value[e]={...a.value[e],apiKey:s.value,baseUrl:r.value||"https://api.openai.com/v1/"}});function b(){a.value[e]={baseUrl:"https://api.openai.com/v1/"}}return(o,i)=>{var d,f;return x(),K(t(z),{"provider-name":((d=m.value)==null?void 0:d.localizedName)||"OpenAI","provider-icon":(f=m.value)==null?void 0:f.icon,"on-back":()=>t(_).back()},{default:n(()=>[l(t(R),null,{default:n(()=>[l(t(S),{title:t(u)("settings.pages.providers.common.section.basic.title"),description:t(u)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:n(()=>{var p;return[l(t(N),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=g=>s.value=g),"provider-name":((p=m.value)==null?void 0:p.localizedName)||"OpenAI",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(w),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:n(()=>[l(t(M),{modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=p=>r.value=p),placeholder:"https://api.openai.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{L as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{d as h,q as U,bG as V,s as k,h as v,l as y,w as $,x as K,o as x,y as n,b as l,u as t}from"./index-D55VqdU4.js";import{u as I}from"./providers-DAp1566d.js";import{_ as w,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-BtshDojk.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BMPV9bKe.js";import{_ as R,a as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DLyRry-6.js";import{_ as z}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-Cc3LXYUd.js";import"./index-Be1NqeGb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BDoHyduV.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BbB31kj-.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DQP2RhYC.js";import"./Input.vue_vue_type_script_setup_true_lang-CeU0PE9S.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";const e="openai",L=h({__name:"openai",setup(A){const{t:u}=U(),_=V(),c=I(),{providers:a}=k(c),m=v(()=>c.getProviderMetadata(e)),s=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.apiKey)||""},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].apiKey=o}}),r=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.baseUrl)||"https://api.openai.com/v1/"},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].baseUrl=o}});y(()=>{var o,i;a.value[e]||(a.value[e]={baseUrl:"https://api.openai.com/v1/"}),s.value=((o=a.value[e])==null?void 0:o.apiKey)||"",r.value=((i=a.value[e])==null?void 0:i.baseUrl)||"https://api.openai.com/v1/"}),$([s,r],()=>{a.value[e]={...a.value[e],apiKey:s.value,baseUrl:r.value||"https://api.openai.com/v1/"}});function b(){a.value[e]={baseUrl:"https://api.openai.com/v1/"}}return(o,i)=>{var d,f;return x(),K(t(z),{"provider-name":((d=m.value)==null?void 0:d.localizedName)||"OpenAI","provider-icon":(f=m.value)==null?void 0:f.icon,"on-back":()=>t(_).back()},{default:n(()=>[l(t(R),null,{default:n(()=>[l(t(S),{title:t(u)("settings.pages.providers.common.section.basic.title"),description:t(u)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:n(()=>{var p;return[l(t(N),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=g=>s.value=g),"provider-name":((p=m.value)==null?void 0:p.localizedName)||"OpenAI",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(w),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:n(()=>[l(t(M),{modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=p=>r.value=p),placeholder:"https://api.openai.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{L as default}; diff --git a/assets/openrouter-ai-CAqHWZfw.js b/assets/openrouter-ai-DqPOkDgq.js similarity index 72% rename from assets/openrouter-ai-CAqHWZfw.js rename to assets/openrouter-ai-DqPOkDgq.js index 70a346bb5221195eed42b0c996e1a3ac0bc228bd..2a900f7c45ccb5b6e9163910e7d9592b319652cd 100644 --- a/assets/openrouter-ai-CAqHWZfw.js +++ b/assets/openrouter-ai-DqPOkDgq.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{d as V,q as k,bG as y,s as $,h as _,l as K,w as O,x as h,o as x,y as v,b as d,u as l}from"./index--eYU5aQm.js";import{u as w}from"./providers-YQf-rDZ1.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dsoa87PD.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CCsf2oJB.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BJL9_E_2.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DVunqc-i.js";import"./index-Be1NqeGb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-CWkRm8IH.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BHnSNWo1.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-CriF7G5j.js";import"./Input.vue_vue_type_script_setup_true_lang-DaL4uFR_.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";const a="openrouter-ai",Q=V({__name:"openrouter-ai",setup(B){const{t:c}=k(),b=y(),f=w(),{providers:o}=$(f),r=_(()=>f.getProviderMetadata(a)),i=_({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),n=_({get:()=>{var e,t,s;return((e=o.value[a])==null?void 0:e.baseUrl)||((s=(t=r.value)==null?void 0:t.defaultOptions)==null?void 0:s.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});K(()=>{var e,t,s,u;f.initializeProvider(a),i.value=((e=o.value[a])==null?void 0:e.apiKey)||"",n.value=((t=o.value[a])==null?void 0:t.baseUrl)||((u=(s=r.value)==null?void 0:s.defaultOptions)==null?void 0:u.baseUrl)||""}),O([i,n],()=>{var e,t;o.value[a]={...o.value[a],apiKey:i.value,baseUrl:n.value||((t=(e=r.value)==null?void 0:e.defaultOptions)==null?void 0:t.baseUrl)||""}});function U(){var e;o.value[a]={...(e=r.value)==null?void 0:e.defaultOptions}}return(e,t)=>{var s,u;return x(),h(l(S),{"provider-name":(s=r.value)==null?void 0:s.localizedName,"provider-icon":(u=r.value)==null?void 0:u.icon,"on-back":()=>l(b).back()},{default:v(()=>[d(l(P),null,{default:v(()=>[d(l(R),{title:l(c)("settings.pages.providers.common.section.basic.title"),description:l(c)("settings.pages.providers.common.section.basic.description"),"on-reset":U},{default:v(()=>{var p;return[d(l(N),{modelValue:i.value,"onUpdate:modelValue":t[0]||(t[0]=m=>i.value=m),"provider-name":(p=r.value)==null?void 0:p.localizedName,placeholder:"sk-or-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),d(l(z),{title:l(c)("settings.pages.providers.common.section.advanced.title")},{default:v(()=>{var p,m;return[d(l(M),{modelValue:n.value,"onUpdate:modelValue":t[1]||(t[1]=g=>n.value=g),placeholder:((m=(p=r.value)==null?void 0:p.defaultOptions)==null?void 0:m.baseUrl)||""},null,8,["modelValue","placeholder"])]}),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{Q as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{d as V,q as k,bG as y,s as $,h as _,l as K,w as O,x as h,o as x,y as v,b as d,u as l}from"./index-D55VqdU4.js";import{u as w}from"./providers-DAp1566d.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-BtshDojk.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BMPV9bKe.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DLyRry-6.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-Cc3LXYUd.js";import"./index-Be1NqeGb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BDoHyduV.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BbB31kj-.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DQP2RhYC.js";import"./Input.vue_vue_type_script_setup_true_lang-CeU0PE9S.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";const a="openrouter-ai",Q=V({__name:"openrouter-ai",setup(B){const{t:c}=k(),b=y(),f=w(),{providers:o}=$(f),r=_(()=>f.getProviderMetadata(a)),i=_({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),n=_({get:()=>{var e,t,s;return((e=o.value[a])==null?void 0:e.baseUrl)||((s=(t=r.value)==null?void 0:t.defaultOptions)==null?void 0:s.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});K(()=>{var e,t,s,u;f.initializeProvider(a),i.value=((e=o.value[a])==null?void 0:e.apiKey)||"",n.value=((t=o.value[a])==null?void 0:t.baseUrl)||((u=(s=r.value)==null?void 0:s.defaultOptions)==null?void 0:u.baseUrl)||""}),O([i,n],()=>{var e,t;o.value[a]={...o.value[a],apiKey:i.value,baseUrl:n.value||((t=(e=r.value)==null?void 0:e.defaultOptions)==null?void 0:t.baseUrl)||""}});function U(){var e;o.value[a]={...(e=r.value)==null?void 0:e.defaultOptions}}return(e,t)=>{var s,u;return x(),h(l(S),{"provider-name":(s=r.value)==null?void 0:s.localizedName,"provider-icon":(u=r.value)==null?void 0:u.icon,"on-back":()=>l(b).back()},{default:v(()=>[d(l(P),null,{default:v(()=>[d(l(R),{title:l(c)("settings.pages.providers.common.section.basic.title"),description:l(c)("settings.pages.providers.common.section.basic.description"),"on-reset":U},{default:v(()=>{var p;return[d(l(N),{modelValue:i.value,"onUpdate:modelValue":t[0]||(t[0]=m=>i.value=m),"provider-name":(p=r.value)==null?void 0:p.localizedName,placeholder:"sk-or-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),d(l(z),{title:l(c)("settings.pages.providers.common.section.advanced.title")},{default:v(()=>{var p,m;return[d(l(M),{modelValue:n.value,"onUpdate:modelValue":t[1]||(t[1]=g=>n.value=g),placeholder:((m=(p=r.value)==null?void 0:p.defaultOptions)==null?void 0:m.baseUrl)||""},null,8,["modelValue","placeholder"])]}),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{Q as default}; diff --git a/assets/providers-YQf-rDZ1.js b/assets/providers-DAp1566d.js similarity index 99% rename from assets/providers-YQf-rDZ1.js rename to assets/providers-DAp1566d.js index 0bcb95576524107347a74b7ebea98a491fc2fbab..55bc4e5e73d1fffe72b00d2880698886aaae344a 100644 --- a/assets/providers-YQf-rDZ1.js +++ b/assets/providers-DAp1566d.js @@ -1 +1 @@ -import{f as oe,bD as le,q as de,g as q,w as ce,h as w}from"./index--eYU5aQm.js";import{r as Z,a as R,e as ee,o as k}from"./index-Be1NqeGb.js";const b=async a=>(a.fetch??globalThis.fetch)(Z("models",a.baseURL),{headers:R(a.headers,a.apiKey),signal:a.abortSignal}).then(ee).then(({data:i})=>i),_=a=>({chat:i=>Object.assign(a,{model:i})}),K=a=>({embed:i=>Object.assign(a,{model:i})}),f=a=>({model:()=>a}),pe=a=>({speech:i=>Object.assign(a,{model:i})}),ue=a=>({transcription:i=>Object.assign(a,{model:i})}),m=(a,i)=>({metadata:{id:a,...i}}),p=(...a)=>Object.assign(a[0],...a.slice(1)),ge=(a,i="https://api.anthropic.com/v1/")=>p(m("anthropic"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),L=(a,i="https://api.deepseek.com/")=>p(m("deepseek"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),G=(a,i="https://api.fireworks.ai/inference/v1/")=>p(m("fireworks"),_({apiKey:a,baseURL:i}),K({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),$=(a,i="https://generativelanguage.googleapis.com/v1beta/openai/")=>p(m("google-generative-ai"),_({apiKey:a,baseURL:i}),K({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),D=(a,i="https://api.mistral.ai/v1/")=>p(m("mistral"),_({apiKey:a,baseURL:i}),K({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),V=(a,i="https://api.moonshot.cn/v1/")=>p(m("moonshot"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),N=(a,i="https://api.novita.ai/v3/openai/")=>p(m("novita"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),S=(a,i="https://api.openai.com/v1/")=>p(m("openai"),_({apiKey:a,baseURL:i}),K({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i}),pe({apiKey:a,baseURL:i}),ue({apiKey:a,baseURL:i})),me=(a,i="")=>p(m("openrouter"),{chat:(d,o)=>{const h={apiKey:a,baseURL:i,model:d};return{...o?(({extraHeaders:n,models:v,provider:g})=>{n!=null&&(h.headers??(h.headers={}),Object.assign(h.headers,n));let c;return g!=null&&(c=k(g)),k({models:v,provider:c})})(o):{},...h}}},f({apiKey:a,baseURL:i})),ve=(a,i="https://api.perplexity.ai/")=>p(m("perplexity"),_({apiKey:a,baseURL:i})),W=(a,i="https://api.together.xyz/v1/")=>p(m("together-ai"),_({apiKey:a,baseURL:i}),K({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i,fetch:async(...d)=>globalThis.fetch(...d).then(async o=>o.json()).then(o=>Response.json({data:o,object:"list"}))})),_e=(a,i)=>{const d=`https://api.cloudflare.com/client/v4/accounts/${i}/ai/v1/`;return p(m("workers-ai"),_({apiKey:a,baseURL:d}),K({apiKey:a,baseURL:d}))},H=(a,i="https://api.x.ai/v1/")=>p(m("xai"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),A=(a="http://localhost:11434/v1/")=>p(m("ollama"),_({baseURL:a}),K({baseURL:a}),f({baseURL:a}));var J=(a,i="http://localhost:5933/v1/")=>{const d=({applyTextNormalization:t,languageCode:n,nextRequestIds:v,nextText:g,previousRequestIds:c,previousText:y,pronunciationDictionaryLocators:x,seed:M,voiceSettings:C})=>({extraBody:k({applyTextNormalization:t,languageCode:n,nextRequestIds:v,nextText:g,previousRequestIds:c,previousText:y,pronunciationDictionaryLocators:x?x.map(B=>k(B)):void 0,seed:M,voiceSettings:k(C??{similarityBoost:.75,stability:.5})})});return p({speech:(t,n)=>({...n?d(n):{},apiKey:a,baseURL:i,model:`elevenlabs/${t}`})},{voice:t=>(i.endsWith("v1/")?i=i.slice(0,-3):i.endsWith("v1")&&(i=i.slice(0,-2)),{query:"provider=elevenlabs",...t?d(t):{},apiKey:a,baseURL:i})})},X=(a,i="http://localhost:5933/v1/")=>{const d=t=>{const{deploymentId:n,region:v,sampleRate:g}=t,c={deploymentId:n,region:v,sampleRate:g};return"disableSsml"in t?c.disableSsml=t.disableSsml:"lang"in t&&(c.lang=t.lang,c.gender=t.gender,c.voice=t.voice),{extraBody:k(c)}};return p({speech:(t,n)=>({...n?d(n):{},apiKey:a,baseURL:i,model:`microsoft/${t}`})},{voice:t=>(i.endsWith("v1/")?i=i.slice(0,-3):i.endsWith("v1")&&(i=i.slice(0,-2)),{query:`region=${t==null?void 0:t.region}&provider=microsoft`,...t?d(t):{},apiKey:a,baseURL:i})})},Q=(a,i="http://localhost:5933/v1/")=>{const d=t=>{var v,g;const n={app:{appid:(v=t.app)==null?void 0:v.appId,token:a}};return typeof t.app<"u"&&(n.app={...t.app,appid:(g=t.app)==null?void 0:g.appId,token:a}),typeof t.user<"u"&&(n.user=t.user),typeof t.audio<"u"&&(n.audio=t.audio),{extraBody:k(n)}};return p({speech:(t,n)=>({...n?d(n):{},apiKey:a,baseURL:i,model:`volcengine/${t}`})},{voice:t=>(i.endsWith("v1/")?i=i.slice(0,-3):i.endsWith("v1")&&(i=i.slice(0,-2)),{query:"provider=volcengine",...t?d(t):{},apiKey:a,baseURL:i})})},Y=(a,i="http://localhost:5933/v1/")=>{const d=t=>{const{sampleRate:n,volume:v,rate:g,pitch:c}=t,y={sampleRate:n,volume:v,rate:g,pitch:c};return Object.keys(y).forEach(x=>y[x]===void 0&&delete y[x]),{extraBody:k(y)}};return p({speech:(t,n)=>({...n?d(n):{},apiKey:a,baseURL:i,model:`alibaba/${t}`})},{voice:t=>{let n=i;return n.endsWith("v1/")?n=n.slice(0,-3):n.endsWith("v1")&&(n=n.slice(0,-2)),{query:"provider=alibaba",...t?d(t):{},apiKey:a,baseURL:n}}})},E=async a=>(a.fetch??globalThis.fetch)(Z(a.query?`api/voices?${a.query}`:"api/voices",a.baseURL),{headers:R({...a.headers},a.apiKey),method:"GET",signal:a.abortSignal}).then(ee).then(({voices:i})=>i);const he=[{model_id:"eleven_multilingual_v2",name:"Eleven Multilingual v2",can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!0,can_use_speaker_boost:!0,serves_pro_voices:!1,token_cost_factor:1,description:"Our most life-like, emotionally rich mode in 29 languages. Best for voice overs, audiobooks, post-production, or any other content creation needs.",requires_alpha_access:!1,max_characters_request_free_user:1e4,max_characters_request_subscribed_user:1e4,maximum_text_length_per_request:1e4,languages:[{language_id:"en",name:"English"},{language_id:"ja",name:"Japanese"},{language_id:"zh",name:"Chinese"},{language_id:"de",name:"German"},{language_id:"hi",name:"Hindi"},{language_id:"fr",name:"French"},{language_id:"ko",name:"Korean"},{language_id:"pt",name:"Portuguese"},{language_id:"it",name:"Italian"},{language_id:"es",name:"Spanish"},{language_id:"id",name:"Indonesian"},{language_id:"nl",name:"Dutch"},{language_id:"tr",name:"Turkish"},{language_id:"fil",name:"Filipino"},{language_id:"pl",name:"Polish"},{language_id:"sv",name:"Swedish"},{language_id:"bg",name:"Bulgarian"},{language_id:"ro",name:"Romanian"},{language_id:"ar",name:"Arabic"},{language_id:"cs",name:"Czech"},{language_id:"el",name:"Greek"},{language_id:"fi",name:"Finnish"},{language_id:"hr",name:"Croatian"},{language_id:"ms",name:"Malay"},{language_id:"sk",name:"Slovak"},{language_id:"da",name:"Danish"},{language_id:"ta",name:"Tamil"},{language_id:"uk",name:"Ukrainian"},{language_id:"ru",name:"Russian"}],model_rates:{character_cost_multiplier:1},concurrency_group:"standard"},{model_id:"eleven_flash_v2_5",name:"Eleven Flash v2.5",can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:"Our ultra low latency model in 32 languages. Ideal for conversational use cases.",requires_alpha_access:!1,max_characters_request_free_user:4e4,max_characters_request_subscribed_user:4e4,maximum_text_length_per_request:4e4,languages:[{language_id:"en",name:"English"},{language_id:"ja",name:"Japanese"},{language_id:"zh",name:"Chinese"},{language_id:"de",name:"German"},{language_id:"hi",name:"Hindi"},{language_id:"fr",name:"French"},{language_id:"ko",name:"Korean"},{language_id:"pt",name:"Portuguese"},{language_id:"it",name:"Italian"},{language_id:"es",name:"Spanish"},{language_id:"ru",name:"Russian"},{language_id:"id",name:"Indonesian"},{language_id:"nl",name:"Dutch"},{language_id:"tr",name:"Turkish"},{language_id:"fil",name:"Filipino"},{language_id:"pl",name:"Polish"},{language_id:"sv",name:"Swedish"},{language_id:"bg",name:"Bulgarian"},{language_id:"ro",name:"Romanian"},{language_id:"ar",name:"Arabic"},{language_id:"cs",name:"Czech"},{language_id:"el",name:"Greek"},{language_id:"fi",name:"Finnish"},{language_id:"hr",name:"Croatian"},{language_id:"ms",name:"Malay"},{language_id:"sk",name:"Slovak"},{language_id:"da",name:"Danish"},{language_id:"ta",name:"Tamil"},{language_id:"uk",name:"Ukrainian"},{language_id:"hu",name:"Hungarian"},{language_id:"no",name:"Norwegian"},{language_id:"vi",name:"Vietnamese"}],model_rates:{character_cost_multiplier:.5},concurrency_group:"turbo"},{model_id:"eleven_turbo_v2_5",name:"Eleven Turbo v2.5",can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:"Our high quality, low latency model in 32 languages. Best for developer use cases where speed matters and you need non-English languages.",requires_alpha_access:!1,max_characters_request_free_user:4e4,max_characters_request_subscribed_user:4e4,maximum_text_length_per_request:4e4,languages:[{language_id:"en",name:"English"},{language_id:"ja",name:"Japanese"},{language_id:"zh",name:"Chinese"},{language_id:"de",name:"German"},{language_id:"hi",name:"Hindi"},{language_id:"fr",name:"French"},{language_id:"ko",name:"Korean"},{language_id:"pt",name:"Portuguese"},{language_id:"it",name:"Italian"},{language_id:"es",name:"Spanish"},{language_id:"ru",name:"Russian"},{language_id:"id",name:"Indonesian"},{language_id:"nl",name:"Dutch"},{language_id:"tr",name:"Turkish"},{language_id:"fil",name:"Filipino"},{language_id:"pl",name:"Polish"},{language_id:"sv",name:"Swedish"},{language_id:"bg",name:"Bulgarian"},{language_id:"ro",name:"Romanian"},{language_id:"ar",name:"Arabic"},{language_id:"cs",name:"Czech"},{language_id:"el",name:"Greek"},{language_id:"fi",name:"Finnish"},{language_id:"hr",name:"Croatian"},{language_id:"ms",name:"Malay"},{language_id:"sk",name:"Slovak"},{language_id:"da",name:"Danish"},{language_id:"ta",name:"Tamil"},{language_id:"uk",name:"Ukrainian"},{language_id:"vi",name:"Vietnamese"},{language_id:"no",name:"Norwegian"},{language_id:"hu",name:"Hungarian"}],model_rates:{character_cost_multiplier:.5},concurrency_group:"turbo"},{model_id:"eleven_turbo_v2",name:"Eleven Turbo v2",can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:"Our English-only, low latency model. Best for developer use cases where speed matters and you only need English. Performance is on par with Turbo v2.5.",requires_alpha_access:!1,max_characters_request_free_user:3e4,max_characters_request_subscribed_user:3e4,maximum_text_length_per_request:3e4,languages:[{language_id:"en",name:"English"}],model_rates:{character_cost_multiplier:.5},concurrency_group:"turbo"},{model_id:"eleven_flash_v2",name:"Eleven Flash v2",can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:"Our ultra low latency model in english. Ideal for conversational use cases.",requires_alpha_access:!1,max_characters_request_free_user:3e4,max_characters_request_subscribed_user:3e4,maximum_text_length_per_request:3e4,languages:[{language_id:"en",name:"English"}],model_rates:{character_cost_multiplier:.5},concurrency_group:"turbo"},{model_id:"eleven_english_sts_v2",name:"Eleven English v2",can_be_finetuned:!1,can_do_text_to_speech:!1,can_do_voice_conversion:!0,can_use_style:!0,can_use_speaker_boost:!0,serves_pro_voices:!1,token_cost_factor:1,description:"Our state-of-the-art speech to speech model suitable for scenarios where you need maximum control over the content and prosody of your generations.",requires_alpha_access:!1,max_characters_request_free_user:5e3,max_characters_request_subscribed_user:5e3,maximum_text_length_per_request:5e3,languages:[{language_id:"en",name:"English"}],model_rates:{character_cost_multiplier:1},concurrency_group:"standard"},{model_id:"eleven_multilingual_v1",name:"Eleven Multilingual v1",can_be_finetuned:!1,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:"Our first Multilingual model, capability of generating speech in 10 languages. Now outclassed by Multilingual v2 (for content creation) and Turbo v2.5 (for low latency use cases).",requires_alpha_access:!1,max_characters_request_free_user:1e4,max_characters_request_subscribed_user:1e4,maximum_text_length_per_request:1e4,languages:[{language_id:"en",name:"English"},{language_id:"de",name:"German"},{language_id:"pl",name:"Polish"},{language_id:"es",name:"Spanish"},{language_id:"it",name:"Italian"},{language_id:"fr",name:"French"},{language_id:"pt",name:"Portuguese"},{language_id:"hi",name:"Hindi"},{language_id:"ar",name:"Arabic"}],model_rates:{character_cost_multiplier:1},concurrency_group:"standard"},{model_id:"eleven_multilingual_sts_v2",name:"Eleven Multilingual v2",can_be_finetuned:!0,can_do_text_to_speech:!1,can_do_voice_conversion:!0,can_use_style:!0,can_use_speaker_boost:!0,serves_pro_voices:!1,token_cost_factor:1,description:"Our cutting-edge, multilingual speech-to-speech model is designed for situations that demand unparalleled control over both the content and the prosody of the generated speech across various languages.",requires_alpha_access:!1,max_characters_request_free_user:1e4,max_characters_request_subscribed_user:1e4,maximum_text_length_per_request:1e4,languages:[{language_id:"en",name:"English"},{language_id:"ja",name:"Japanese"},{language_id:"zh",name:"Chinese"},{language_id:"de",name:"German"},{language_id:"hi",name:"Hindi"},{language_id:"fr",name:"French"},{language_id:"ko",name:"Korean"},{language_id:"pt",name:"Portuguese"},{language_id:"it",name:"Italian"},{language_id:"es",name:"Spanish"},{language_id:"ru",name:"Russian"},{language_id:"id",name:"Indonesian"},{language_id:"nl",name:"Dutch"},{language_id:"tr",name:"Turkish"},{language_id:"fil",name:"Filipino"},{language_id:"pl",name:"Polish"},{language_id:"sv",name:"Swedish"},{language_id:"bg",name:"Bulgarian"},{language_id:"ro",name:"Romanian"},{language_id:"ar",name:"Arabic"},{language_id:"cs",name:"Czech"},{language_id:"el",name:"Greek"},{language_id:"fi",name:"Finnish"},{language_id:"hr",name:"Croatian"},{language_id:"ms",name:"Malay"},{language_id:"sk",name:"Slovak"},{language_id:"da",name:"Danish"},{language_id:"ta",name:"Tamil"},{language_id:"uk",name:"Ukrainian"}],model_rates:{character_cost_multiplier:1},concurrency_group:"standard"},{model_id:"eleven_monolingual_v1",name:"Eleven English v1",can_be_finetuned:!1,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:"Our first ever text to speech model. Now outclassed by Multilingual v2 (for content creation) and Turbo v2.5 (for low latency use cases).",requires_alpha_access:!1,max_characters_request_free_user:1e4,max_characters_request_subscribed_user:1e4,maximum_text_length_per_request:1e4,languages:[{language_id:"en",name:"English"}],model_rates:{character_cost_multiplier:1},concurrency_group:"standard"}],xe=oe("providers",()=>{const a=le("settings/credentials/providers",{}),{t:i}=de();async function d(e){try{const r=await fetch("https://openrouter.ai/api/v1/models",{headers:{Authorization:`Bearer ${e.apiKey.trim()}`,"Content-Type":"application/json"}});if(!r.ok)throw new Error(`Failed to fetch OpenRouter models: ${r.statusText}`);return(await r.json()).data.map(s=>({id:s.id,name:s.name||s.id,provider:"openrouter-ai",description:s.description||"",contextLength:s.context_length,deprecated:!1}))}catch(r){throw console.error("Error fetching OpenRouter models:",r),r}}const o={"openrouter-ai":{id:"openrouter-ai",nameKey:"settings.pages.providers.provider.openrouter.title",name:"OpenRouter",descriptionKey:"settings.pages.providers.provider.openrouter.description",description:"openrouter.ai",icon:"i-lobe-icons:openrouter",defaultOptions:{baseUrl:"https://openrouter.ai/api/v1/"},createProvider:e=>me(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>d(e)},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},ollama:{id:"ollama",nameKey:"settings.pages.providers.provider.ollama.title",name:"Ollama",descriptionKey:"settings.pages.providers.provider.ollama.description",description:"ollama.com",icon:"i-lobe-icons:ollama",defaultOptions:{baseUrl:"http://localhost:11434/v1/"},createProvider:e=>A(e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...A(e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"ollama",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.baseUrl}},vllm:{id:"vllm",nameKey:"settings.pages.providers.provider.vllm.title",name:"vLLM",descriptionKey:"settings.pages.providers.provider.vllm.description",description:"vllm.ai",iconColor:"i-lobe-icons:vllm",createProvider:e=>A(e.baseUrl.trim()),capabilities:{listModels:async()=>[{id:"llama-2-7b",name:"Llama 2 (7B)",provider:"vllm",description:"Meta's Llama 2 7B parameter model",contextLength:4096},{id:"llama-2-13b",name:"Llama 2 (13B)",provider:"vllm",description:"Meta's Llama 2 13B parameter model",contextLength:4096},{id:"llama-2-70b",name:"Llama 2 (70B)",provider:"vllm",description:"Meta's Llama 2 70B parameter model",contextLength:4096},{id:"mistral-7b",name:"Mistral (7B)",provider:"vllm",description:"Mistral AI's 7B parameter model",contextLength:8192},{id:"mixtral-8x7b",name:"Mixtral (8x7B)",provider:"vllm",description:"Mistral AI's Mixtral 8x7B MoE model",contextLength:32768},{id:"custom",name:"Custom Model",provider:"vllm",description:"Specify a custom model name",contextLength:0}]},validators:{validateProviderConfig:e=>!!e.baseUrl}},openai:{id:"openai",nameKey:"settings.pages.providers.provider.openai.title",name:"OpenAI",descriptionKey:"settings.pages.providers.provider.openai.description",description:"openai.com",icon:"i-lobe-icons:openai",defaultOptions:{baseUrl:"https://api.openai.com/v1/"},createProvider:e=>S(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...S(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"openai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},anthropic:{id:"anthropic",nameKey:"settings.pages.providers.provider.anthropic.title",name:"Anthropic",descriptionKey:"settings.pages.providers.provider.anthropic.description",description:"anthropic.com",icon:"i-lobe-icons:anthropic",defaultOptions:{baseUrl:"https://api.anthropic.com/v1/"},createProvider:e=>ge(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>[{id:"claude-3-7-sonnet-20250219",name:"Claude 3.7 Sonnet",provider:"anthropic",description:"",contextLength:0,deprecated:!1},{id:"claude-3-5-sonnet-20241022",name:"Claude 3.5 Sonnet (New)",provider:"anthropic",description:"",contextLength:0,deprecated:!1},{id:"claude-3-5-haiku-20241022",name:"Claude 3.5 Haiku",provider:"anthropic",description:"",contextLength:0,deprecated:!1},{id:"claude-3-5-sonnet-20240620",name:"Claude 3.5 Sonnet (Old)",provider:"anthropic",description:"",contextLength:0,deprecated:!1},{id:"claude-3-haiku-20240307",name:"Claude 3 Haiku",provider:"anthropic",description:"",contextLength:0,deprecated:!1},{id:"claude-3-opus-20240229",name:"Claude 3 Opus",provider:"anthropic",description:"",contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"google-generative-ai":{id:"google-generative-ai",nameKey:"settings.pages.providers.provider.google-generative-ai.title",name:"Google Gemini",descriptionKey:"settings.pages.providers.provider.google-generative-ai.description",description:"ai.google.dev",icon:"i-lobe-icons:gemini",defaultOptions:{baseUrl:"https://generativelanguage.googleapis.com/v1beta/openai/"},createProvider:e=>$(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...$(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"google-generative-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},xai:{id:"xai",nameKey:"settings.pages.providers.provider.xai.title",name:"xAI",descriptionKey:"settings.pages.providers.provider.xai.description",description:"x.ai",icon:"i-lobe-icons:xai",createProvider:e=>H(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...H(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"xai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},deepseek:{id:"deepseek",nameKey:"settings.pages.providers.provider.deepseek.title",name:"DeepSeek",descriptionKey:"settings.pages.providers.provider.deepseek.description",description:"deepseek.com",iconColor:"i-lobe-icons:deepseek",createProvider:e=>L(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...L(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"deepseek",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},elevenlabs:{id:"elevenlabs",nameKey:"settings.pages.providers.provider.elevenlabs.title",name:"ElevenLabs",descriptionKey:"settings.pages.providers.provider.elevenlabs.description",description:"elevenlabs.io",icon:"i-simple-icons:elevenlabs",defaultOptions:{baseUrl:"https://unspeech.hyp3r.link/v1/",voiceSettings:{similarityBoost:.75,stability:.5}},createProvider:e=>J(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>he.map(e=>({id:e.model_id,name:e.name,provider:"elevenlabs",description:e.description,contextLength:0,deprecated:!1})),listVoices:async e=>{const r=J(e.apiKey.trim(),e.baseUrl.trim()),l=await E({...r.voice()}),s=l.findIndex(P=>P.name.includes("Aria")),u=l.findIndex(P=>P.name.includes("Bill")),j=s!==-1?s:0,F=u!==-1?u:l.length-1,I=Math.min(j,F),z=Math.max(j,F);return[...l.slice(0,I),...l.slice(z+1),...l.slice(I,z+1)].map(P=>({id:P.id,name:P.name,provider:"elevenlabs",previewURL:P.preview_audio_url,languages:P.languages}))}},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"microsoft-speech":{id:"microsoft-speech",nameKey:"settings.pages.providers.provider.microsoft-speech.title",name:"Microsoft / Azure Speech",descriptionKey:"settings.pages.providers.provider.microsoft-speech.description",description:"speech.microsoft.com",iconColor:"i-lobe-icons:microsoft",defaultOptions:{baseUrl:"https://unspeech.hyp3r.link/v1/"},createProvider:e=>X(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>[{id:"v1",name:"v1",provider:"microsoft-speech",description:"",contextLength:0,deprecated:!1}],listVoices:async e=>{const r=X(e.apiKey.trim(),e.baseUrl.trim());return(await E({...r.voice({region:e.region})})).map(s=>{var u;return{id:s.id,name:s.name,provider:"microsoft-speech",previewURL:s.preview_audio_url,languages:s.languages,gender:(u=s.labels)==null?void 0:u.gender}})}},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"alibaba-cloud-model-studio":{id:"alibaba-cloud-model-studio",nameKey:"settings.pages.providers.provider.alibaba-cloud-model-studio.title",name:"Alibaba Cloud Model Studio",descriptionKey:"settings.pages.providers.provider.alibaba-cloud-model-studio.description",description:"bailian.console.aliyun.com",iconColor:"i-lobe-icons:alibabacloud",defaultOptions:{baseUrl:"https://unspeech.hyp3r.link/v1/"},createProvider:e=>Y(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listVoices:async e=>{const r=Y(e.apiKey.trim(),e.baseUrl.trim());return(await E({...r.voice()})).map(s=>{var u;return{id:s.id,name:s.name,provider:"alibaba-cloud-model-studio",previewURL:s.preview_audio_url,languages:s.languages,gender:(u=s.labels)==null?void 0:u.gender}})},listModels:async()=>[{id:"cozyvoice-v1",name:"CozyVoice",provider:"alibaba-cloud-model-studio",description:"",contextLength:0,deprecated:!1},{id:"cozyvoice-v2",name:"CozyVoice (New)",provider:"alibaba-cloud-model-studio",description:"",contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},volcengine:{id:"volcengine",nameKey:"settings.pages.providers.provider.volcengine.title",name:"settings.pages.providers.provider.volcengine.title",descriptionKey:"settings.pages.providers.provider.volcengine.description",description:"volcengine.com",iconColor:"i-lobe-icons:volcengine",defaultOptions:{baseUrl:"https://unspeech.hyp3r.link/v1/"},createProvider:e=>Q(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listVoices:async e=>{const r=Q(e.apiKey.trim(),e.baseUrl.trim());return(await E({...r.voice()})).map(s=>{var u;return{id:s.id,name:s.name,provider:"volcano-engine",previewURL:s.preview_audio_url,languages:s.languages,gender:(u=s.labels)==null?void 0:u.gender}})},listModels:async()=>[{id:"v1",name:"v1",provider:"volcano-engine",description:"",contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl&&!!e.app&&!!e.app.appId}},"together-ai":{id:"together-ai",nameKey:"settings.pages.providers.provider.together.title",name:"Together.ai",descriptionKey:"settings.pages.providers.provider.together.description",description:"together.ai",iconColor:"i-lobe-icons:together",createProvider:e=>W(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...W(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"together-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"novita-ai":{id:"novita-ai",nameKey:"settings.pages.providers.provider.novita.title",name:"Novita",descriptionKey:"settings.pages.providers.provider.novita.description",description:"novita.ai",iconColor:"i-lobe-icons:novita",createProvider:e=>N(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...N(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"novita-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"fireworks-ai":{id:"fireworks-ai",nameKey:"settings.pages.providers.provider.fireworks.title",name:"Fireworks.ai",descriptionKey:"settings.pages.providers.provider.fireworks.description",description:"fireworks.ai",icon:"i-lobe-icons:fireworks",createProvider:e=>G(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...G(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"fireworks-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"featherless-ai":{id:"featherless-ai",nameKey:"settings.pages.providers.provider.featherless.title",name:"Featherless.ai",descriptionKey:"settings.pages.providers.provider.featherless.description",description:"featherless.ai",icon:"i-lobe-icons:featherless-ai",defaultOptions:{baseUrl:"https://api.featherless.ai/v1/"},createProvider:e=>S(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...S(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"featherless-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"cloudflare-workers-ai":{id:"cloudflare-workers-ai",nameKey:"settings.pages.providers.provider.cloudflare-workers-ai.title",name:"Cloudflare Workers AI",descriptionKey:"settings.pages.providers.provider.cloudflare-workers-ai.description",description:"cloudflare.com",iconColor:"i-lobe-icons:cloudflare",createProvider:e=>_e(e.apiKey.trim(),e.accountId),capabilities:{listModels:async()=>[]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.accountId}},"perplexity-ai":{id:"perplexity-ai",nameKey:"settings.pages.providers.provider.perplexity.title",name:"Perplexity",descriptionKey:"settings.pages.providers.provider.perplexity.description",description:"perplexity.ai",icon:"i-lobe-icons:perplexity",defaultOptions:{baseUrl:"https://api.perplexity.ai"},createProvider:e=>ve(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>[{id:"sonar-small-online",name:"Sonar Small (Online)",provider:"perplexity-ai",description:"Efficient model with online search capabilities",contextLength:12e3},{id:"sonar-medium-online",name:"Sonar Medium (Online)",provider:"perplexity-ai",description:"Balanced model with online search capabilities",contextLength:12e3},{id:"sonar-large-online",name:"Sonar Large (Online)",provider:"perplexity-ai",description:"Powerful model with online search capabilities",contextLength:12e3},{id:"codey-small",name:"Codey Small",provider:"perplexity-ai",description:"Specialized for code generation and understanding",contextLength:12e3},{id:"codey-large",name:"Codey Large",provider:"perplexity-ai",description:"Advanced code generation and understanding",contextLength:12e3}]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"mistral-ai":{id:"mistral-ai",nameKey:"settings.pages.providers.provider.mistral.title",name:"Mistral",descriptionKey:"settings.pages.providers.provider.mistral.description",description:"mistral.ai",iconColor:"i-lobe-icons:mistral",createProvider:e=>D(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...D(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"mistral-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"moonshot-ai":{id:"moonshot-ai",nameKey:"settings.pages.providers.provider.moonshot.title",name:"Moonshot AI",descriptionKey:"settings.pages.providers.provider.moonshot.description",description:"moonshot.ai",icon:"i-lobe-icons:moonshot",createProvider:e=>V(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...V(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"moonshot-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}}};async function h(e){const r=a.value[e];if(!r)return!1;const l=o[e];return l?await l.validators.validateProviderConfig(r):!1}const t=q({});function n(e){var r;if(!a.value[e]){const l=o[e];a.value[e]={baseUrl:((r=l.defaultOptions)==null?void 0:r.baseUrl)||""}}}Object.keys(o).forEach(n);async function v(){await Promise.all(Object.keys(o).map(async e=>{t.value[e]=await h(e)}))}v(),ce(a,v,{deep:!0});const g=w(()=>Object.keys(o).filter(e=>t.value[e])),c=q({}),y=q({}),x=q({});async function M(e){const r=a.value[e];if(!r)return[];const l=o[e];if(!l)return[];y.value[e]=!0,x.value[e]=null;try{const s=l.capabilities.listModels?await l.capabilities.listModels(r):[];return c.value[e]=s.map(u=>({id:u.id,name:u.name,description:u.description,contextLength:u.contextLength,deprecated:u.deprecated,provider:e})),c.value[e]}catch(s){return console.error(`Error fetching models for ${e}:`,s),x.value[e]=s instanceof Error?s.message:"Unknown error",[]}finally{y.value[e]=!1}}function C(e){return c.value[e]||[]}const B=w(()=>{const e=[];for(const r of g.value)e.push(...c.value[r]||[]);return e});async function ae(){for(const e of g.value)o[e].capabilities.listModels&&await M(e)}function T(e){const r=o[e];if(!r)throw new Error(`Provider metadata for ${e} not found`);return{...r,localizedName:i(r.nameKey,r.name),localizedDescription:i(r.descriptionKey,r.description)}}const ie=w(()=>Object.values(o).map(e=>({...e,localizedName:i(e.nameKey,e.name),localizedDescription:i(e.descriptionKey,e.description),configured:t.value[e.id]||!1})));function O(e){const r=a.value[e];if(!r)throw new Error(`Provider credentials for ${e} not found`);const l=o[e];if(!l)throw new Error(`Provider metadata for ${e} not found`);try{return l.createProvider(r)}catch(s){throw console.error(`Error creating provider instance for ${e}:`,s),s}}const U=w(()=>g.value.map(e=>T(e))),re=w(()=>U.value.filter(e=>{const r=O(e.id);return"chat"in r&&typeof r.chat=="function"})),te=w(()=>U.value.filter(e=>{const r=O(e.id);return"transcription"in r&&typeof r.transcription=="function"})),ne=w(()=>U.value.filter(e=>{const r=O(e.id);return"speech"in r&&typeof r.speech=="function"}));function se(e){return a.value[e]}return{providers:a,getProviderConfig:se,availableProviders:g,configuredProviders:t,providerMetadata:o,getProviderMetadata:T,allProvidersMetadata:ie,initializeProvider:n,validateProvider:h,availableModels:c,isLoadingModels:y,modelLoadError:x,fetchModelsForProvider:M,getModelsForProvider:C,allAvailableModels:B,loadModelsForConfiguredProviders:ae,getProviderInstance:O,availableProvidersMetadata:U,availableTextGenerationsProvidersMetadata:re,availableAudioSpeechProvidersMetadata:ne,availableAudioTranscriptionProvidersMetadata:te}});export{b as l,xe as u}; +import{f as oe,bD as le,q as de,g as q,w as ce,h as w}from"./index-D55VqdU4.js";import{r as Z,a as R,e as ee,o as k}from"./index-Be1NqeGb.js";const b=async a=>(a.fetch??globalThis.fetch)(Z("models",a.baseURL),{headers:R(a.headers,a.apiKey),signal:a.abortSignal}).then(ee).then(({data:i})=>i),_=a=>({chat:i=>Object.assign(a,{model:i})}),K=a=>({embed:i=>Object.assign(a,{model:i})}),f=a=>({model:()=>a}),pe=a=>({speech:i=>Object.assign(a,{model:i})}),ue=a=>({transcription:i=>Object.assign(a,{model:i})}),m=(a,i)=>({metadata:{id:a,...i}}),p=(...a)=>Object.assign(a[0],...a.slice(1)),ge=(a,i="https://api.anthropic.com/v1/")=>p(m("anthropic"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),L=(a,i="https://api.deepseek.com/")=>p(m("deepseek"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),G=(a,i="https://api.fireworks.ai/inference/v1/")=>p(m("fireworks"),_({apiKey:a,baseURL:i}),K({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),$=(a,i="https://generativelanguage.googleapis.com/v1beta/openai/")=>p(m("google-generative-ai"),_({apiKey:a,baseURL:i}),K({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),D=(a,i="https://api.mistral.ai/v1/")=>p(m("mistral"),_({apiKey:a,baseURL:i}),K({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),V=(a,i="https://api.moonshot.cn/v1/")=>p(m("moonshot"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),N=(a,i="https://api.novita.ai/v3/openai/")=>p(m("novita"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),S=(a,i="https://api.openai.com/v1/")=>p(m("openai"),_({apiKey:a,baseURL:i}),K({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i}),pe({apiKey:a,baseURL:i}),ue({apiKey:a,baseURL:i})),me=(a,i="")=>p(m("openrouter"),{chat:(d,o)=>{const h={apiKey:a,baseURL:i,model:d};return{...o?(({extraHeaders:n,models:v,provider:g})=>{n!=null&&(h.headers??(h.headers={}),Object.assign(h.headers,n));let c;return g!=null&&(c=k(g)),k({models:v,provider:c})})(o):{},...h}}},f({apiKey:a,baseURL:i})),ve=(a,i="https://api.perplexity.ai/")=>p(m("perplexity"),_({apiKey:a,baseURL:i})),W=(a,i="https://api.together.xyz/v1/")=>p(m("together-ai"),_({apiKey:a,baseURL:i}),K({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i,fetch:async(...d)=>globalThis.fetch(...d).then(async o=>o.json()).then(o=>Response.json({data:o,object:"list"}))})),_e=(a,i)=>{const d=`https://api.cloudflare.com/client/v4/accounts/${i}/ai/v1/`;return p(m("workers-ai"),_({apiKey:a,baseURL:d}),K({apiKey:a,baseURL:d}))},H=(a,i="https://api.x.ai/v1/")=>p(m("xai"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),A=(a="http://localhost:11434/v1/")=>p(m("ollama"),_({baseURL:a}),K({baseURL:a}),f({baseURL:a}));var J=(a,i="http://localhost:5933/v1/")=>{const d=({applyTextNormalization:t,languageCode:n,nextRequestIds:v,nextText:g,previousRequestIds:c,previousText:y,pronunciationDictionaryLocators:x,seed:M,voiceSettings:C})=>({extraBody:k({applyTextNormalization:t,languageCode:n,nextRequestIds:v,nextText:g,previousRequestIds:c,previousText:y,pronunciationDictionaryLocators:x?x.map(B=>k(B)):void 0,seed:M,voiceSettings:k(C??{similarityBoost:.75,stability:.5})})});return p({speech:(t,n)=>({...n?d(n):{},apiKey:a,baseURL:i,model:`elevenlabs/${t}`})},{voice:t=>(i.endsWith("v1/")?i=i.slice(0,-3):i.endsWith("v1")&&(i=i.slice(0,-2)),{query:"provider=elevenlabs",...t?d(t):{},apiKey:a,baseURL:i})})},X=(a,i="http://localhost:5933/v1/")=>{const d=t=>{const{deploymentId:n,region:v,sampleRate:g}=t,c={deploymentId:n,region:v,sampleRate:g};return"disableSsml"in t?c.disableSsml=t.disableSsml:"lang"in t&&(c.lang=t.lang,c.gender=t.gender,c.voice=t.voice),{extraBody:k(c)}};return p({speech:(t,n)=>({...n?d(n):{},apiKey:a,baseURL:i,model:`microsoft/${t}`})},{voice:t=>(i.endsWith("v1/")?i=i.slice(0,-3):i.endsWith("v1")&&(i=i.slice(0,-2)),{query:`region=${t==null?void 0:t.region}&provider=microsoft`,...t?d(t):{},apiKey:a,baseURL:i})})},Q=(a,i="http://localhost:5933/v1/")=>{const d=t=>{var v,g;const n={app:{appid:(v=t.app)==null?void 0:v.appId,token:a}};return typeof t.app<"u"&&(n.app={...t.app,appid:(g=t.app)==null?void 0:g.appId,token:a}),typeof t.user<"u"&&(n.user=t.user),typeof t.audio<"u"&&(n.audio=t.audio),{extraBody:k(n)}};return p({speech:(t,n)=>({...n?d(n):{},apiKey:a,baseURL:i,model:`volcengine/${t}`})},{voice:t=>(i.endsWith("v1/")?i=i.slice(0,-3):i.endsWith("v1")&&(i=i.slice(0,-2)),{query:"provider=volcengine",...t?d(t):{},apiKey:a,baseURL:i})})},Y=(a,i="http://localhost:5933/v1/")=>{const d=t=>{const{sampleRate:n,volume:v,rate:g,pitch:c}=t,y={sampleRate:n,volume:v,rate:g,pitch:c};return Object.keys(y).forEach(x=>y[x]===void 0&&delete y[x]),{extraBody:k(y)}};return p({speech:(t,n)=>({...n?d(n):{},apiKey:a,baseURL:i,model:`alibaba/${t}`})},{voice:t=>{let n=i;return n.endsWith("v1/")?n=n.slice(0,-3):n.endsWith("v1")&&(n=n.slice(0,-2)),{query:"provider=alibaba",...t?d(t):{},apiKey:a,baseURL:n}}})},E=async a=>(a.fetch??globalThis.fetch)(Z(a.query?`api/voices?${a.query}`:"api/voices",a.baseURL),{headers:R({...a.headers},a.apiKey),method:"GET",signal:a.abortSignal}).then(ee).then(({voices:i})=>i);const he=[{model_id:"eleven_multilingual_v2",name:"Eleven Multilingual v2",can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!0,can_use_speaker_boost:!0,serves_pro_voices:!1,token_cost_factor:1,description:"Our most life-like, emotionally rich mode in 29 languages. Best for voice overs, audiobooks, post-production, or any other content creation needs.",requires_alpha_access:!1,max_characters_request_free_user:1e4,max_characters_request_subscribed_user:1e4,maximum_text_length_per_request:1e4,languages:[{language_id:"en",name:"English"},{language_id:"ja",name:"Japanese"},{language_id:"zh",name:"Chinese"},{language_id:"de",name:"German"},{language_id:"hi",name:"Hindi"},{language_id:"fr",name:"French"},{language_id:"ko",name:"Korean"},{language_id:"pt",name:"Portuguese"},{language_id:"it",name:"Italian"},{language_id:"es",name:"Spanish"},{language_id:"id",name:"Indonesian"},{language_id:"nl",name:"Dutch"},{language_id:"tr",name:"Turkish"},{language_id:"fil",name:"Filipino"},{language_id:"pl",name:"Polish"},{language_id:"sv",name:"Swedish"},{language_id:"bg",name:"Bulgarian"},{language_id:"ro",name:"Romanian"},{language_id:"ar",name:"Arabic"},{language_id:"cs",name:"Czech"},{language_id:"el",name:"Greek"},{language_id:"fi",name:"Finnish"},{language_id:"hr",name:"Croatian"},{language_id:"ms",name:"Malay"},{language_id:"sk",name:"Slovak"},{language_id:"da",name:"Danish"},{language_id:"ta",name:"Tamil"},{language_id:"uk",name:"Ukrainian"},{language_id:"ru",name:"Russian"}],model_rates:{character_cost_multiplier:1},concurrency_group:"standard"},{model_id:"eleven_flash_v2_5",name:"Eleven Flash v2.5",can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:"Our ultra low latency model in 32 languages. Ideal for conversational use cases.",requires_alpha_access:!1,max_characters_request_free_user:4e4,max_characters_request_subscribed_user:4e4,maximum_text_length_per_request:4e4,languages:[{language_id:"en",name:"English"},{language_id:"ja",name:"Japanese"},{language_id:"zh",name:"Chinese"},{language_id:"de",name:"German"},{language_id:"hi",name:"Hindi"},{language_id:"fr",name:"French"},{language_id:"ko",name:"Korean"},{language_id:"pt",name:"Portuguese"},{language_id:"it",name:"Italian"},{language_id:"es",name:"Spanish"},{language_id:"ru",name:"Russian"},{language_id:"id",name:"Indonesian"},{language_id:"nl",name:"Dutch"},{language_id:"tr",name:"Turkish"},{language_id:"fil",name:"Filipino"},{language_id:"pl",name:"Polish"},{language_id:"sv",name:"Swedish"},{language_id:"bg",name:"Bulgarian"},{language_id:"ro",name:"Romanian"},{language_id:"ar",name:"Arabic"},{language_id:"cs",name:"Czech"},{language_id:"el",name:"Greek"},{language_id:"fi",name:"Finnish"},{language_id:"hr",name:"Croatian"},{language_id:"ms",name:"Malay"},{language_id:"sk",name:"Slovak"},{language_id:"da",name:"Danish"},{language_id:"ta",name:"Tamil"},{language_id:"uk",name:"Ukrainian"},{language_id:"hu",name:"Hungarian"},{language_id:"no",name:"Norwegian"},{language_id:"vi",name:"Vietnamese"}],model_rates:{character_cost_multiplier:.5},concurrency_group:"turbo"},{model_id:"eleven_turbo_v2_5",name:"Eleven Turbo v2.5",can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:"Our high quality, low latency model in 32 languages. Best for developer use cases where speed matters and you need non-English languages.",requires_alpha_access:!1,max_characters_request_free_user:4e4,max_characters_request_subscribed_user:4e4,maximum_text_length_per_request:4e4,languages:[{language_id:"en",name:"English"},{language_id:"ja",name:"Japanese"},{language_id:"zh",name:"Chinese"},{language_id:"de",name:"German"},{language_id:"hi",name:"Hindi"},{language_id:"fr",name:"French"},{language_id:"ko",name:"Korean"},{language_id:"pt",name:"Portuguese"},{language_id:"it",name:"Italian"},{language_id:"es",name:"Spanish"},{language_id:"ru",name:"Russian"},{language_id:"id",name:"Indonesian"},{language_id:"nl",name:"Dutch"},{language_id:"tr",name:"Turkish"},{language_id:"fil",name:"Filipino"},{language_id:"pl",name:"Polish"},{language_id:"sv",name:"Swedish"},{language_id:"bg",name:"Bulgarian"},{language_id:"ro",name:"Romanian"},{language_id:"ar",name:"Arabic"},{language_id:"cs",name:"Czech"},{language_id:"el",name:"Greek"},{language_id:"fi",name:"Finnish"},{language_id:"hr",name:"Croatian"},{language_id:"ms",name:"Malay"},{language_id:"sk",name:"Slovak"},{language_id:"da",name:"Danish"},{language_id:"ta",name:"Tamil"},{language_id:"uk",name:"Ukrainian"},{language_id:"vi",name:"Vietnamese"},{language_id:"no",name:"Norwegian"},{language_id:"hu",name:"Hungarian"}],model_rates:{character_cost_multiplier:.5},concurrency_group:"turbo"},{model_id:"eleven_turbo_v2",name:"Eleven Turbo v2",can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:"Our English-only, low latency model. Best for developer use cases where speed matters and you only need English. Performance is on par with Turbo v2.5.",requires_alpha_access:!1,max_characters_request_free_user:3e4,max_characters_request_subscribed_user:3e4,maximum_text_length_per_request:3e4,languages:[{language_id:"en",name:"English"}],model_rates:{character_cost_multiplier:.5},concurrency_group:"turbo"},{model_id:"eleven_flash_v2",name:"Eleven Flash v2",can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:"Our ultra low latency model in english. Ideal for conversational use cases.",requires_alpha_access:!1,max_characters_request_free_user:3e4,max_characters_request_subscribed_user:3e4,maximum_text_length_per_request:3e4,languages:[{language_id:"en",name:"English"}],model_rates:{character_cost_multiplier:.5},concurrency_group:"turbo"},{model_id:"eleven_english_sts_v2",name:"Eleven English v2",can_be_finetuned:!1,can_do_text_to_speech:!1,can_do_voice_conversion:!0,can_use_style:!0,can_use_speaker_boost:!0,serves_pro_voices:!1,token_cost_factor:1,description:"Our state-of-the-art speech to speech model suitable for scenarios where you need maximum control over the content and prosody of your generations.",requires_alpha_access:!1,max_characters_request_free_user:5e3,max_characters_request_subscribed_user:5e3,maximum_text_length_per_request:5e3,languages:[{language_id:"en",name:"English"}],model_rates:{character_cost_multiplier:1},concurrency_group:"standard"},{model_id:"eleven_multilingual_v1",name:"Eleven Multilingual v1",can_be_finetuned:!1,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:"Our first Multilingual model, capability of generating speech in 10 languages. Now outclassed by Multilingual v2 (for content creation) and Turbo v2.5 (for low latency use cases).",requires_alpha_access:!1,max_characters_request_free_user:1e4,max_characters_request_subscribed_user:1e4,maximum_text_length_per_request:1e4,languages:[{language_id:"en",name:"English"},{language_id:"de",name:"German"},{language_id:"pl",name:"Polish"},{language_id:"es",name:"Spanish"},{language_id:"it",name:"Italian"},{language_id:"fr",name:"French"},{language_id:"pt",name:"Portuguese"},{language_id:"hi",name:"Hindi"},{language_id:"ar",name:"Arabic"}],model_rates:{character_cost_multiplier:1},concurrency_group:"standard"},{model_id:"eleven_multilingual_sts_v2",name:"Eleven Multilingual v2",can_be_finetuned:!0,can_do_text_to_speech:!1,can_do_voice_conversion:!0,can_use_style:!0,can_use_speaker_boost:!0,serves_pro_voices:!1,token_cost_factor:1,description:"Our cutting-edge, multilingual speech-to-speech model is designed for situations that demand unparalleled control over both the content and the prosody of the generated speech across various languages.",requires_alpha_access:!1,max_characters_request_free_user:1e4,max_characters_request_subscribed_user:1e4,maximum_text_length_per_request:1e4,languages:[{language_id:"en",name:"English"},{language_id:"ja",name:"Japanese"},{language_id:"zh",name:"Chinese"},{language_id:"de",name:"German"},{language_id:"hi",name:"Hindi"},{language_id:"fr",name:"French"},{language_id:"ko",name:"Korean"},{language_id:"pt",name:"Portuguese"},{language_id:"it",name:"Italian"},{language_id:"es",name:"Spanish"},{language_id:"ru",name:"Russian"},{language_id:"id",name:"Indonesian"},{language_id:"nl",name:"Dutch"},{language_id:"tr",name:"Turkish"},{language_id:"fil",name:"Filipino"},{language_id:"pl",name:"Polish"},{language_id:"sv",name:"Swedish"},{language_id:"bg",name:"Bulgarian"},{language_id:"ro",name:"Romanian"},{language_id:"ar",name:"Arabic"},{language_id:"cs",name:"Czech"},{language_id:"el",name:"Greek"},{language_id:"fi",name:"Finnish"},{language_id:"hr",name:"Croatian"},{language_id:"ms",name:"Malay"},{language_id:"sk",name:"Slovak"},{language_id:"da",name:"Danish"},{language_id:"ta",name:"Tamil"},{language_id:"uk",name:"Ukrainian"}],model_rates:{character_cost_multiplier:1},concurrency_group:"standard"},{model_id:"eleven_monolingual_v1",name:"Eleven English v1",can_be_finetuned:!1,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:"Our first ever text to speech model. Now outclassed by Multilingual v2 (for content creation) and Turbo v2.5 (for low latency use cases).",requires_alpha_access:!1,max_characters_request_free_user:1e4,max_characters_request_subscribed_user:1e4,maximum_text_length_per_request:1e4,languages:[{language_id:"en",name:"English"}],model_rates:{character_cost_multiplier:1},concurrency_group:"standard"}],xe=oe("providers",()=>{const a=le("settings/credentials/providers",{}),{t:i}=de();async function d(e){try{const r=await fetch("https://openrouter.ai/api/v1/models",{headers:{Authorization:`Bearer ${e.apiKey.trim()}`,"Content-Type":"application/json"}});if(!r.ok)throw new Error(`Failed to fetch OpenRouter models: ${r.statusText}`);return(await r.json()).data.map(s=>({id:s.id,name:s.name||s.id,provider:"openrouter-ai",description:s.description||"",contextLength:s.context_length,deprecated:!1}))}catch(r){throw console.error("Error fetching OpenRouter models:",r),r}}const o={"openrouter-ai":{id:"openrouter-ai",nameKey:"settings.pages.providers.provider.openrouter.title",name:"OpenRouter",descriptionKey:"settings.pages.providers.provider.openrouter.description",description:"openrouter.ai",icon:"i-lobe-icons:openrouter",defaultOptions:{baseUrl:"https://openrouter.ai/api/v1/"},createProvider:e=>me(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>d(e)},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},ollama:{id:"ollama",nameKey:"settings.pages.providers.provider.ollama.title",name:"Ollama",descriptionKey:"settings.pages.providers.provider.ollama.description",description:"ollama.com",icon:"i-lobe-icons:ollama",defaultOptions:{baseUrl:"http://localhost:11434/v1/"},createProvider:e=>A(e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...A(e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"ollama",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.baseUrl}},vllm:{id:"vllm",nameKey:"settings.pages.providers.provider.vllm.title",name:"vLLM",descriptionKey:"settings.pages.providers.provider.vllm.description",description:"vllm.ai",iconColor:"i-lobe-icons:vllm",createProvider:e=>A(e.baseUrl.trim()),capabilities:{listModels:async()=>[{id:"llama-2-7b",name:"Llama 2 (7B)",provider:"vllm",description:"Meta's Llama 2 7B parameter model",contextLength:4096},{id:"llama-2-13b",name:"Llama 2 (13B)",provider:"vllm",description:"Meta's Llama 2 13B parameter model",contextLength:4096},{id:"llama-2-70b",name:"Llama 2 (70B)",provider:"vllm",description:"Meta's Llama 2 70B parameter model",contextLength:4096},{id:"mistral-7b",name:"Mistral (7B)",provider:"vllm",description:"Mistral AI's 7B parameter model",contextLength:8192},{id:"mixtral-8x7b",name:"Mixtral (8x7B)",provider:"vllm",description:"Mistral AI's Mixtral 8x7B MoE model",contextLength:32768},{id:"custom",name:"Custom Model",provider:"vllm",description:"Specify a custom model name",contextLength:0}]},validators:{validateProviderConfig:e=>!!e.baseUrl}},openai:{id:"openai",nameKey:"settings.pages.providers.provider.openai.title",name:"OpenAI",descriptionKey:"settings.pages.providers.provider.openai.description",description:"openai.com",icon:"i-lobe-icons:openai",defaultOptions:{baseUrl:"https://api.openai.com/v1/"},createProvider:e=>S(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...S(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"openai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},anthropic:{id:"anthropic",nameKey:"settings.pages.providers.provider.anthropic.title",name:"Anthropic",descriptionKey:"settings.pages.providers.provider.anthropic.description",description:"anthropic.com",icon:"i-lobe-icons:anthropic",defaultOptions:{baseUrl:"https://api.anthropic.com/v1/"},createProvider:e=>ge(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>[{id:"claude-3-7-sonnet-20250219",name:"Claude 3.7 Sonnet",provider:"anthropic",description:"",contextLength:0,deprecated:!1},{id:"claude-3-5-sonnet-20241022",name:"Claude 3.5 Sonnet (New)",provider:"anthropic",description:"",contextLength:0,deprecated:!1},{id:"claude-3-5-haiku-20241022",name:"Claude 3.5 Haiku",provider:"anthropic",description:"",contextLength:0,deprecated:!1},{id:"claude-3-5-sonnet-20240620",name:"Claude 3.5 Sonnet (Old)",provider:"anthropic",description:"",contextLength:0,deprecated:!1},{id:"claude-3-haiku-20240307",name:"Claude 3 Haiku",provider:"anthropic",description:"",contextLength:0,deprecated:!1},{id:"claude-3-opus-20240229",name:"Claude 3 Opus",provider:"anthropic",description:"",contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"google-generative-ai":{id:"google-generative-ai",nameKey:"settings.pages.providers.provider.google-generative-ai.title",name:"Google Gemini",descriptionKey:"settings.pages.providers.provider.google-generative-ai.description",description:"ai.google.dev",icon:"i-lobe-icons:gemini",defaultOptions:{baseUrl:"https://generativelanguage.googleapis.com/v1beta/openai/"},createProvider:e=>$(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...$(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"google-generative-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},xai:{id:"xai",nameKey:"settings.pages.providers.provider.xai.title",name:"xAI",descriptionKey:"settings.pages.providers.provider.xai.description",description:"x.ai",icon:"i-lobe-icons:xai",createProvider:e=>H(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...H(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"xai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},deepseek:{id:"deepseek",nameKey:"settings.pages.providers.provider.deepseek.title",name:"DeepSeek",descriptionKey:"settings.pages.providers.provider.deepseek.description",description:"deepseek.com",iconColor:"i-lobe-icons:deepseek",createProvider:e=>L(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...L(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"deepseek",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},elevenlabs:{id:"elevenlabs",nameKey:"settings.pages.providers.provider.elevenlabs.title",name:"ElevenLabs",descriptionKey:"settings.pages.providers.provider.elevenlabs.description",description:"elevenlabs.io",icon:"i-simple-icons:elevenlabs",defaultOptions:{baseUrl:"https://unspeech.hyp3r.link/v1/",voiceSettings:{similarityBoost:.75,stability:.5}},createProvider:e=>J(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>he.map(e=>({id:e.model_id,name:e.name,provider:"elevenlabs",description:e.description,contextLength:0,deprecated:!1})),listVoices:async e=>{const r=J(e.apiKey.trim(),e.baseUrl.trim()),l=await E({...r.voice()}),s=l.findIndex(P=>P.name.includes("Aria")),u=l.findIndex(P=>P.name.includes("Bill")),j=s!==-1?s:0,F=u!==-1?u:l.length-1,I=Math.min(j,F),z=Math.max(j,F);return[...l.slice(0,I),...l.slice(z+1),...l.slice(I,z+1)].map(P=>({id:P.id,name:P.name,provider:"elevenlabs",previewURL:P.preview_audio_url,languages:P.languages}))}},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"microsoft-speech":{id:"microsoft-speech",nameKey:"settings.pages.providers.provider.microsoft-speech.title",name:"Microsoft / Azure Speech",descriptionKey:"settings.pages.providers.provider.microsoft-speech.description",description:"speech.microsoft.com",iconColor:"i-lobe-icons:microsoft",defaultOptions:{baseUrl:"https://unspeech.hyp3r.link/v1/"},createProvider:e=>X(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>[{id:"v1",name:"v1",provider:"microsoft-speech",description:"",contextLength:0,deprecated:!1}],listVoices:async e=>{const r=X(e.apiKey.trim(),e.baseUrl.trim());return(await E({...r.voice({region:e.region})})).map(s=>{var u;return{id:s.id,name:s.name,provider:"microsoft-speech",previewURL:s.preview_audio_url,languages:s.languages,gender:(u=s.labels)==null?void 0:u.gender}})}},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"alibaba-cloud-model-studio":{id:"alibaba-cloud-model-studio",nameKey:"settings.pages.providers.provider.alibaba-cloud-model-studio.title",name:"Alibaba Cloud Model Studio",descriptionKey:"settings.pages.providers.provider.alibaba-cloud-model-studio.description",description:"bailian.console.aliyun.com",iconColor:"i-lobe-icons:alibabacloud",defaultOptions:{baseUrl:"https://unspeech.hyp3r.link/v1/"},createProvider:e=>Y(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listVoices:async e=>{const r=Y(e.apiKey.trim(),e.baseUrl.trim());return(await E({...r.voice()})).map(s=>{var u;return{id:s.id,name:s.name,provider:"alibaba-cloud-model-studio",previewURL:s.preview_audio_url,languages:s.languages,gender:(u=s.labels)==null?void 0:u.gender}})},listModels:async()=>[{id:"cozyvoice-v1",name:"CozyVoice",provider:"alibaba-cloud-model-studio",description:"",contextLength:0,deprecated:!1},{id:"cozyvoice-v2",name:"CozyVoice (New)",provider:"alibaba-cloud-model-studio",description:"",contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},volcengine:{id:"volcengine",nameKey:"settings.pages.providers.provider.volcengine.title",name:"settings.pages.providers.provider.volcengine.title",descriptionKey:"settings.pages.providers.provider.volcengine.description",description:"volcengine.com",iconColor:"i-lobe-icons:volcengine",defaultOptions:{baseUrl:"https://unspeech.hyp3r.link/v1/"},createProvider:e=>Q(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listVoices:async e=>{const r=Q(e.apiKey.trim(),e.baseUrl.trim());return(await E({...r.voice()})).map(s=>{var u;return{id:s.id,name:s.name,provider:"volcano-engine",previewURL:s.preview_audio_url,languages:s.languages,gender:(u=s.labels)==null?void 0:u.gender}})},listModels:async()=>[{id:"v1",name:"v1",provider:"volcano-engine",description:"",contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl&&!!e.app&&!!e.app.appId}},"together-ai":{id:"together-ai",nameKey:"settings.pages.providers.provider.together.title",name:"Together.ai",descriptionKey:"settings.pages.providers.provider.together.description",description:"together.ai",iconColor:"i-lobe-icons:together",createProvider:e=>W(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...W(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"together-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"novita-ai":{id:"novita-ai",nameKey:"settings.pages.providers.provider.novita.title",name:"Novita",descriptionKey:"settings.pages.providers.provider.novita.description",description:"novita.ai",iconColor:"i-lobe-icons:novita",createProvider:e=>N(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...N(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"novita-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"fireworks-ai":{id:"fireworks-ai",nameKey:"settings.pages.providers.provider.fireworks.title",name:"Fireworks.ai",descriptionKey:"settings.pages.providers.provider.fireworks.description",description:"fireworks.ai",icon:"i-lobe-icons:fireworks",createProvider:e=>G(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...G(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"fireworks-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"featherless-ai":{id:"featherless-ai",nameKey:"settings.pages.providers.provider.featherless.title",name:"Featherless.ai",descriptionKey:"settings.pages.providers.provider.featherless.description",description:"featherless.ai",icon:"i-lobe-icons:featherless-ai",defaultOptions:{baseUrl:"https://api.featherless.ai/v1/"},createProvider:e=>S(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...S(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"featherless-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"cloudflare-workers-ai":{id:"cloudflare-workers-ai",nameKey:"settings.pages.providers.provider.cloudflare-workers-ai.title",name:"Cloudflare Workers AI",descriptionKey:"settings.pages.providers.provider.cloudflare-workers-ai.description",description:"cloudflare.com",iconColor:"i-lobe-icons:cloudflare",createProvider:e=>_e(e.apiKey.trim(),e.accountId),capabilities:{listModels:async()=>[]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.accountId}},"perplexity-ai":{id:"perplexity-ai",nameKey:"settings.pages.providers.provider.perplexity.title",name:"Perplexity",descriptionKey:"settings.pages.providers.provider.perplexity.description",description:"perplexity.ai",icon:"i-lobe-icons:perplexity",defaultOptions:{baseUrl:"https://api.perplexity.ai"},createProvider:e=>ve(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>[{id:"sonar-small-online",name:"Sonar Small (Online)",provider:"perplexity-ai",description:"Efficient model with online search capabilities",contextLength:12e3},{id:"sonar-medium-online",name:"Sonar Medium (Online)",provider:"perplexity-ai",description:"Balanced model with online search capabilities",contextLength:12e3},{id:"sonar-large-online",name:"Sonar Large (Online)",provider:"perplexity-ai",description:"Powerful model with online search capabilities",contextLength:12e3},{id:"codey-small",name:"Codey Small",provider:"perplexity-ai",description:"Specialized for code generation and understanding",contextLength:12e3},{id:"codey-large",name:"Codey Large",provider:"perplexity-ai",description:"Advanced code generation and understanding",contextLength:12e3}]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"mistral-ai":{id:"mistral-ai",nameKey:"settings.pages.providers.provider.mistral.title",name:"Mistral",descriptionKey:"settings.pages.providers.provider.mistral.description",description:"mistral.ai",iconColor:"i-lobe-icons:mistral",createProvider:e=>D(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...D(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"mistral-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"moonshot-ai":{id:"moonshot-ai",nameKey:"settings.pages.providers.provider.moonshot.title",name:"Moonshot AI",descriptionKey:"settings.pages.providers.provider.moonshot.description",description:"moonshot.ai",icon:"i-lobe-icons:moonshot",createProvider:e=>V(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...V(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"moonshot-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}}};async function h(e){const r=a.value[e];if(!r)return!1;const l=o[e];return l?await l.validators.validateProviderConfig(r):!1}const t=q({});function n(e){var r;if(!a.value[e]){const l=o[e];a.value[e]={baseUrl:((r=l.defaultOptions)==null?void 0:r.baseUrl)||""}}}Object.keys(o).forEach(n);async function v(){await Promise.all(Object.keys(o).map(async e=>{t.value[e]=await h(e)}))}v(),ce(a,v,{deep:!0});const g=w(()=>Object.keys(o).filter(e=>t.value[e])),c=q({}),y=q({}),x=q({});async function M(e){const r=a.value[e];if(!r)return[];const l=o[e];if(!l)return[];y.value[e]=!0,x.value[e]=null;try{const s=l.capabilities.listModels?await l.capabilities.listModels(r):[];return c.value[e]=s.map(u=>({id:u.id,name:u.name,description:u.description,contextLength:u.contextLength,deprecated:u.deprecated,provider:e})),c.value[e]}catch(s){return console.error(`Error fetching models for ${e}:`,s),x.value[e]=s instanceof Error?s.message:"Unknown error",[]}finally{y.value[e]=!1}}function C(e){return c.value[e]||[]}const B=w(()=>{const e=[];for(const r of g.value)e.push(...c.value[r]||[]);return e});async function ae(){for(const e of g.value)o[e].capabilities.listModels&&await M(e)}function T(e){const r=o[e];if(!r)throw new Error(`Provider metadata for ${e} not found`);return{...r,localizedName:i(r.nameKey,r.name),localizedDescription:i(r.descriptionKey,r.description)}}const ie=w(()=>Object.values(o).map(e=>({...e,localizedName:i(e.nameKey,e.name),localizedDescription:i(e.descriptionKey,e.description),configured:t.value[e.id]||!1})));function O(e){const r=a.value[e];if(!r)throw new Error(`Provider credentials for ${e} not found`);const l=o[e];if(!l)throw new Error(`Provider metadata for ${e} not found`);try{return l.createProvider(r)}catch(s){throw console.error(`Error creating provider instance for ${e}:`,s),s}}const U=w(()=>g.value.map(e=>T(e))),re=w(()=>U.value.filter(e=>{const r=O(e.id);return"chat"in r&&typeof r.chat=="function"})),te=w(()=>U.value.filter(e=>{const r=O(e.id);return"transcription"in r&&typeof r.transcription=="function"})),ne=w(()=>U.value.filter(e=>{const r=O(e.id);return"speech"in r&&typeof r.speech=="function"}));function se(e){return a.value[e]}return{providers:a,getProviderConfig:se,availableProviders:g,configuredProviders:t,providerMetadata:o,getProviderMetadata:T,allProvidersMetadata:ie,initializeProvider:n,validateProvider:h,availableModels:c,isLoadingModels:y,modelLoadError:x,fetchModelsForProvider:M,getModelsForProvider:C,allAvailableModels:B,loadModelsForConfiguredProviders:ae,getProviderInstance:O,availableProvidersMetadata:U,availableTextGenerationsProvidersMetadata:re,availableAudioSpeechProvidersMetadata:ne,availableAudioTranscriptionProvidersMetadata:te}});export{b as l,xe as u}; diff --git a/assets/queue-CbNCDjQD.js b/assets/queue-CSnE70Jj.js similarity index 90% rename from assets/queue-CbNCDjQD.js rename to assets/queue-CSnE70Jj.js index 2b5b886181cf6a81af424ac6c90e70422796bf2c..b2fedf77304aefe0352510bf8cedfed3b30d777f 100644 --- a/assets/queue-CbNCDjQD.js +++ b/assets/queue-CSnE70Jj.js @@ -1 +1 @@ -import{u as o}from"./queue-D6byf-bD.js";import{d as v,g as h,l as g,c as k,o as w,a as I}from"./index--eYU5aQm.js";const Q=v({__name:"queue",setup(P){function i(e){return new Promise(a=>setTimeout(a,e))}const n=h(""),d=o({handlers:[async e=>{console.log("ready to play speech audio for",e)}]}),u=o({handlers:[async e=>{console.log("ready to stream speech audio for",e),d.add(e.data)}]}),l=o({handlers:[async e=>{const a=[".","?","!"];let s=!1;for(const t of a){if(!e.data.includes(t))continue;const r=e.data.indexOf(t),p=e.data.slice(0,r+1),y=e.data.slice(r+1);n.value+=p,u.add(n.value.trim()),n.value=y,s=!0}s||(n.value+=e.data)}]}),c=["Hello"," N","eko","! I"," am"," an"," AI"," assistant"," trained"," to"," help"," with"," a"," variety"," of"," tasks"," such"," as"," answering"," questions",","," providing"," information",","," giving"," recommendations",","," and"," more",". How"," can"," I"," assist"," you"," today","?","Hello"," N","eko",","," I"," am"," an"," AI"," assistant","."," I"," can"," help"," answer"," questions",","," provide"," information",","," assist"," with"," tasks",","," and"," engage"," in"," conversation","."," How"," can"," I"," assist"," you"," today","?"];async function f(){for(const e of c)await i(100),l.add(e)}async function m(){f()}return g(()=>{m()}),(e,a)=>(w(),k("div",null,a[0]||(a[0]=[I("div",null,null,-1)])))}});export{Q as default}; +import{u as o}from"./queue-CugJlP7m.js";import{d as v,g as h,l as g,c as k,o as w,a as I}from"./index-D55VqdU4.js";const Q=v({__name:"queue",setup(P){function i(e){return new Promise(a=>setTimeout(a,e))}const n=h(""),d=o({handlers:[async e=>{console.log("ready to play speech audio for",e)}]}),u=o({handlers:[async e=>{console.log("ready to stream speech audio for",e),d.add(e.data)}]}),l=o({handlers:[async e=>{const a=[".","?","!"];let s=!1;for(const t of a){if(!e.data.includes(t))continue;const r=e.data.indexOf(t),p=e.data.slice(0,r+1),y=e.data.slice(r+1);n.value+=p,u.add(n.value.trim()),n.value=y,s=!0}s||(n.value+=e.data)}]}),c=["Hello"," N","eko","! I"," am"," an"," AI"," assistant"," trained"," to"," help"," with"," a"," variety"," of"," tasks"," such"," as"," answering"," questions",","," providing"," information",","," giving"," recommendations",","," and"," more",". How"," can"," I"," assist"," you"," today","?","Hello"," N","eko",","," I"," am"," an"," AI"," assistant","."," I"," can"," help"," answer"," questions",","," provide"," information",","," assist"," with"," tasks",","," and"," engage"," in"," conversation","."," How"," can"," I"," assist"," you"," today","?"];async function f(){for(const e of c)await i(100),l.add(e)}async function m(){f()}return g(()=>{m()}),(e,a)=>(w(),k("div",null,a[0]||(a[0]=[I("div",null,null,-1)])))}});export{Q as default}; diff --git a/assets/queue-D6byf-bD.js b/assets/queue-CugJlP7m.js similarity index 91% rename from assets/queue-D6byf-bD.js rename to assets/queue-CugJlP7m.js index 5a561d11ef6fb5d8dc36d007f2da498913c7c9d4..bcb33875e07fdb7276f3f30378226dff5f9aa0ab 100644 --- a/assets/queue-D6byf-bD.js +++ b/assets/queue-CugJlP7m.js @@ -1 +1 @@ -import{g as l}from"./index--eYU5aQm.js";function m(f){const t=l([]),a=l(!1),d={add:[],pick:[],processing:[],error:[],processed:[],done:[]},s={};function c(n,e){d[n].push(e)}function r(n,...e){d[n].forEach(i=>{i(...e)})}function h(n,e){s[n]=s[n]||[],s[n].push(e)}function p(n,...e){(s[n]||[]).forEach(i=>{i(...e)})}async function v(n){t.value.push(n),r("add",n)}function g(){const n=t.value.shift();if(n)return r("pick",n),n}async function u(){if(a.value)return;const n=g();if(n){a.value=!0;for(const e of f.handlers){r("processing",n,e);try{const o=await e({data:n,itemsToBeProcessed:()=>t.value.length,emit:p});r("processed",n,o,e)}catch(o){r("error",n,o,e);continue}}a.value=!1,r("done",n),t.value.length>0&&u()}}return c("add",u),c("done",u),{add:v,on:c,onHandlerEvent:h,queue:t}}export{m as u}; +import{g as l}from"./index-D55VqdU4.js";function m(f){const t=l([]),a=l(!1),d={add:[],pick:[],processing:[],error:[],processed:[],done:[]},s={};function c(n,e){d[n].push(e)}function r(n,...e){d[n].forEach(i=>{i(...e)})}function h(n,e){s[n]=s[n]||[],s[n].push(e)}function p(n,...e){(s[n]||[]).forEach(i=>{i(...e)})}async function v(n){t.value.push(n),r("add",n)}function g(){const n=t.value.shift();if(n)return r("pick",n),n}async function u(){if(a.value)return;const n=g();if(n){a.value=!0;for(const e of f.handlers){r("processing",n,e);try{const o=await e({data:n,itemsToBeProcessed:()=>t.value.length,emit:p});r("processed",n,o,e)}catch(o){r("error",n,o,e);continue}}a.value=!1,r("done",n),t.value.length>0&&u()}}return c("add",u),c("done",u),{add:v,on:c,onHandlerEvent:h,queue:t}}export{m as u}; diff --git a/assets/queues-r0c9CGew.js b/assets/queues-DEEIdmXP.js similarity index 84% rename from assets/queues-r0c9CGew.js rename to assets/queues-DEEIdmXP.js index d32b492b7de17091e479cac8446f646e0eb40696..571720cedc7bbe9543087ed5a94e2944bb1bc257 100644 --- a/assets/queues-r0c9CGew.js +++ b/assets/queues-DEEIdmXP.js @@ -1 +1 @@ -import{j as i}from"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{u as s}from"./queue-D6byf-bD.js";import{g as d}from"./index--eYU5aQm.js";const l="<|llm_inference_end|>";function y(o){function t(e){for(const n of i)if(e.includes(n))return{ok:!0,emotion:n};return{ok:!1,emotion:""}}return s({handlers:[async e=>{if(i.includes(e.data)){e.emit("emotion",e.data),await o.add(e.data);return}{const{ok:n,emotion:a}=t(e.data);n&&(e.emit("emotion",a),await o.add(a))}}]})}function k(){function o(e){if(!/<\|DELAY:\d+\|>/i.test(e))return{ok:!1,delay:0};const n=/<\|DELAY:(\d+)\|>/i.exec(e),a=n==null?void 0:n[1];if(!a)return{ok:!1,delay:0};const r=Number.parseFloat(a);return r<=0||Number.isNaN(r)?{ok:!0,delay:0}:{ok:!0,delay:r}}function t(e){return new Promise(n=>setTimeout(n,e))}return s({handlers:[async e=>{const{ok:n,delay:a}=o(e.data);n&&(e.emit("delay",a),await t(a*1e3))}]})}function p(o){const t=d("");return s({handlers:[async e=>{if(e.data===l){const a=t.value.trim();a&&await o.add(a),t.value="";return}const n=/[.?!]/;for(t.value+=e.data;t.value;){const a=n.exec(t.value);if(!a||typeof a.index>"u")break;const r=t.value.slice(0,a.index+1),u=t.value.slice(a.index+1);await o.add(r),t.value=u}}]})}export{y as a,k as b,l,p as u}; +import{j as i}from"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{u as s}from"./queue-CugJlP7m.js";import{g as d}from"./index-D55VqdU4.js";const l="<|llm_inference_end|>";function y(o){function t(e){for(const n of i)if(e.includes(n))return{ok:!0,emotion:n};return{ok:!1,emotion:""}}return s({handlers:[async e=>{if(i.includes(e.data)){e.emit("emotion",e.data),await o.add(e.data);return}{const{ok:n,emotion:a}=t(e.data);n&&(e.emit("emotion",a),await o.add(a))}}]})}function k(){function o(e){if(!/<\|DELAY:\d+\|>/i.test(e))return{ok:!1,delay:0};const n=/<\|DELAY:(\d+)\|>/i.exec(e),a=n==null?void 0:n[1];if(!a)return{ok:!1,delay:0};const r=Number.parseFloat(a);return r<=0||Number.isNaN(r)?{ok:!0,delay:0}:{ok:!0,delay:r}}function t(e){return new Promise(n=>setTimeout(n,e))}return s({handlers:[async e=>{const{ok:n,delay:a}=o(e.data);n&&(e.emit("delay",a),await t(a*1e3))}]})}function p(o){const t=d("");return s({handlers:[async e=>{if(e.data===l){const a=t.value.trim();a&&await o.add(a),t.value="";return}const n=/[.?!]/;for(t.value+=e.data;t.value;){const a=n.exec(t.value);if(!a||typeof a.index>"u")break;const r=t.value.slice(0,a.index+1),u=t.value.slice(a.index+1);await o.add(r),t.value=u}}]})}export{y as a,k as b,l,p as u}; diff --git a/assets/speech-BOhrg3WS.js b/assets/speech-BtNOtIn9.js similarity index 98% rename from assets/speech-BOhrg3WS.js rename to assets/speech-BtNOtIn9.js index 775ee4275d275310b1e1dc16a1360121bf88853a..ffd1b095f25bad1626aaf46660e78f09a826c46d 100644 --- a/assets/speech-BOhrg3WS.js +++ b/assets/speech-BtNOtIn9.js @@ -1,2 +1,2 @@ -import{f as te,bD as f,g as b,h as p,w as P,l as re}from"./index--eYU5aQm.js";import{r as ne,a as ae,b as oe,d as se}from"./index-Be1NqeGb.js";import{u as ce}from"./providers-YQf-rDZ1.js";const ie=async e=>(e.fetch??globalThis.fetch)(ne("audio/speech",e.baseURL),{body:oe(e),headers:ae({"Content-Type":"application/json",...e.headers},e.apiKey),method:"POST",signal:e.abortSignal}).then(se).then(async t=>t.arrayBuffer()),ue=/["&'<>`]/g,le=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,de=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,me=/[|\\{}()[\]^$+*?.]/g,U=new WeakMap;function N(e,t){if(e=e.replace(t.subset?ge(t.subset):ue,n),t.subset||t.escapeOnly)return e;return e.replace(le,r).replace(de,n);function r(a,s,l){return t.format((a.charCodeAt(0)-55296)*1024+a.charCodeAt(1)-56320+65536,l.charCodeAt(s+2),t)}function n(a,s,l){return t.format(a.charCodeAt(0),l.charCodeAt(s+1),t)}}function ge(e){let t=U.get(e);return t||(t=fe(e),U.set(e,t)),t}function fe(e){const t=[];let r=-1;for(;++r",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:"€"},Se=["cent","copy","divide","gt","lt","not","para","times"],j={}.hasOwnProperty,L={};let S;for(S in C)j.call(C,S)&&(L[C[S]]=S);const xe=/[^\dA-Za-z]/;function Ee(e,t,r,n){const a=String.fromCharCode(e);if(j.call(L,a)){const s=L[a],l="&"+s;return r&&be.includes(s)&&!Se.includes(s)&&(!n||t&&t!==61&&xe.test(String.fromCharCode(t)))?l:l+";"}return""}function we(e,t,r){let n=he(e,t,r.omitOptionalSemicolons),a;if((r.useNamedReferences||r.useShortestReferences)&&(a=Ee(e,t,r.omitOptionalSemicolons,r.attribute)),(r.useShortestReferences||!a)&&r.useShortestReferences){const s=ye(e,t,r.omitOptionalSemicolons);s.length/g,Te=[">"];function Le(e){return""}function Me(e){return""}const Re=[" ",` +import{f as te,bD as f,g as b,h as p,w as P,l as re}from"./index-D55VqdU4.js";import{r as ne,a as ae,b as oe,d as se}from"./index-Be1NqeGb.js";import{u as ce}from"./providers-DAp1566d.js";const ie=async e=>(e.fetch??globalThis.fetch)(ne("audio/speech",e.baseURL),{body:oe(e),headers:ae({"Content-Type":"application/json",...e.headers},e.apiKey),method:"POST",signal:e.abortSignal}).then(se).then(async t=>t.arrayBuffer()),ue=/["&'<>`]/g,le=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,de=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,me=/[|\\{}()[\]^$+*?.]/g,U=new WeakMap;function N(e,t){if(e=e.replace(t.subset?ge(t.subset):ue,n),t.subset||t.escapeOnly)return e;return e.replace(le,r).replace(de,n);function r(a,s,l){return t.format((a.charCodeAt(0)-55296)*1024+a.charCodeAt(1)-56320+65536,l.charCodeAt(s+2),t)}function n(a,s,l){return t.format(a.charCodeAt(0),l.charCodeAt(s+1),t)}}function ge(e){let t=U.get(e);return t||(t=fe(e),U.set(e,t)),t}function fe(e){const t=[];let r=-1;for(;++r",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:"€"},Se=["cent","copy","divide","gt","lt","not","para","times"],j={}.hasOwnProperty,L={};let S;for(S in C)j.call(C,S)&&(L[C[S]]=S);const xe=/[^\dA-Za-z]/;function Ee(e,t,r,n){const a=String.fromCharCode(e);if(j.call(L,a)){const s=L[a],l="&"+s;return r&&be.includes(s)&&!Se.includes(s)&&(!n||t&&t!==61&&xe.test(String.fromCharCode(t)))?l:l+";"}return""}function we(e,t,r){let n=he(e,t,r.omitOptionalSemicolons),a;if((r.useNamedReferences||r.useShortestReferences)&&(a=Ee(e,t,r.omitOptionalSemicolons,r.attribute)),(r.useShortestReferences||!a)&&r.useShortestReferences){const s=ye(e,t,r.omitOptionalSemicolons);s.length/g,Te=[">"];function Le(e){return""}function Me(e){return""}const Re=[" ",` `," ",'"',"&","'","/","<","=",">"];function x(e){return y(e,Re)}function F(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let n=0,a=r.indexOf(t);for(;a!==-1;)n++,a=r.indexOf(t,a+t.length);return n}function M(e,t){const r=String(e);let n=t.options.quote||'"';if(t.options.quoteSmart){const a=n==='"'?"'":'"';F(r,n)>F(r,a)&&(n=a)}return n+y(r,["<","&",n])+n}function $e(e,t){const r=x(e.name),n=e.public,a=e.system;let s=""}const Ue={}.hasOwnProperty;function Fe(e,t){const r=x(e.name),n=k(e,t),a=e.attributes||{},s=n?!1:t.options.closeEmptyElements,l=[];let h;for(h in a)if(Ue.call(a,h)){const g=a[h];g!=null&&l.push(x(h)+"="+M(g,t))}return"<"+r+(l.length===0?"":" "+l.join(" "))+(s?(t.options.tightClose?"":" ")+"/":"")+">"+n+(s?"":"")}const De=/\?>/g,Ne=[">"];function je(e){const t=x(e.name)||"x",r=y(e.value,Ne,De);return""}const Ie=["&","<"];function I(e){return y(e.value,Ie)}function ze(e,t){return t.options.allowDangerousXml?e.value:I(e)}const ke={}.hasOwnProperty,D={cdata:Le,comment:Me,doctype:$e,element:Fe,instruction:je,raw:ze,root:k,text:I};function z(e,t){const r=e&&e.type;if(!r)throw new Error("Expected node, not `"+e+"`");if(!ke.call(D,r))throw new Error("Cannot compile unknown node `"+r+"`");const n=D[r];return n(e,t)}function k(e,t){const r=e&&e.children||[];let n=-1;const a=[];for(;++n{const e=ce(),t=f("settings/speech/active-provider",""),r=f("settings/speech/active-model","eleven_multilingual_v2"),n=f("settings/speech/voice",""),a=b(),s=f("settings/speech/pitch",0),l=f("settings/speech/rate",1),h=f("settings/speech/ssml-enabled",!1),g=b(!1),E=b(null),v=b({}),B=f("settings/speech/language","en-US"),w=b(""),H=p(()=>e.availableProviders.filter(o=>O(o)).map(o=>e.getProviderMetadata(o))),V=p(()=>{var o;return((o=e.getProviderMetadata(t.value))==null?void 0:o.capabilities.listModels)!==void 0}),A=p(()=>e.getModelsForProvider(t.value)),Y=p(()=>e.isLoadingModels[t.value]||!1),X=p(()=>e.modelLoadError[t.value]||null),G=p(()=>{if(!w.value.trim())return A.value;const o=w.value.toLowerCase().trim();return A.value.filter(c=>c.name.toLowerCase().includes(o)||c.id.toLowerCase().includes(o)||c.description&&c.description.toLowerCase().includes(o))}),_=p(()=>["elevenlabs","microsoft-speech","azure-speech","google","alibaba-cloud-model-studio","volcengine"].includes(t.value));function O(o){return["elevenlabs","microsoft-speech","azure-speech","google","amazon","alibaba-cloud-model-studio","volcengine"].includes(o)}async function q(o){var c,i;if(!o||!O(o))return[];g.value=!0,E.value=null;try{const u=await((i=(c=e.getProviderMetadata(o).capabilities).listVoices)==null?void 0:i.call(c,e.getProviderConfig(o)))||[];return v.value[o]=u,u}catch(u){return console.error(`Error fetching voices for ${o}:`,u),E.value=u instanceof Error?u.message:"Unknown error",[]}finally{g.value=!1}}function K(o){return v.value[o]||[]}P(t,async o=>{o&&await q(o)}),re(()=>{q(t.value).then(()=>{var o;n.value&&(a.value=(o=v.value[t.value])==null?void 0:o.find(c=>c.id===n.value))})}),P(n,o=>{var c;o&&(a.value=(c=v.value[t.value])==null?void 0:c.find(i=>i.id===o))},{immediate:!0}),P(v,o=>{var c;n.value&&(a.value=(c=o[t.value])==null?void 0:c.find(i=>i.id===n.value))},{immediate:!0});async function Q(o,c,i,u,m={}){return await ie({...o.speech(c,{...m}),input:i,voice:u})}function Z(o,c,i){var $;const u=i==null?void 0:i.pitch,m=i==null?void 0:i.speed,d=i==null?void 0:i.volume,W={pitch:u!=null?u>0?`+${u}%`:`-${u}%`:void 0,rate:m!=null?m!==1?`${m}`:"1":void 0,volume:d!=null?d>0?`+${d}%`:`${d}%`:void 0},J=T("speak",{version:"1.0",xmlns:"http://www.w3.org/2001/10/synthesis","xml:lang":(($=c.languages[0])==null?void 0:$.code)||"en-US"},[T("voice",{name:c.id,gender:c.gender||"neutral"},[Object.entries(W).filter(([Ve,ee])=>ee!=null).length>0?T("prosody",{pitch:u!=null?u>0?`+${u}%`:`-${u}%`:void 0,rate:m!=null?m!==1?`${m}`:"1":void 0,volume:d!=null?d>0?`+${d}%`:`${d}%`:void 0},[o]):o])]);return Be(J)}return{activeSpeechProvider:t,activeSpeechModel:r,activeSpeechVoice:a,activeSpeechVoiceId:n,pitch:s,rate:l,ssmlEnabled:h,selectedLanguage:B,isLoadingSpeechProviderVoices:g,speechProviderError:E,availableVoices:v,modelSearchQuery:w,availableSpeechProvidersMetadata:H,supportsSSML:_,supportsModelListing:V,providerModels:A,isLoadingActiveProviderModels:Y,activeProviderModelError:X,filteredModels:G,speech:Q,loadVoicesForProvider:q,getVoicesForProvider:K,generateSSML:Z,isSpeechProvider:O}});export{F as c,ie as g,_e as s,Ke as u}; diff --git a/assets/speech-D5UnB8H8.js b/assets/speech-CkUHmU-4.js similarity index 97% rename from assets/speech-D5UnB8H8.js rename to assets/speech-CkUHmU-4.js index 482561a0e5a66392ce019e06ce95580520862fa7..2483d9a6a4997da576f40c456fb8cf505205d55c 100644 --- a/assets/speech-D5UnB8H8.js +++ b/assets/speech-CkUHmU-4.js @@ -1 +1 @@ -import{d as D,g as V,l as ae,w as X,m as re,c as u,o as i,bx as H,by as K,a as e,n as ve,z as $,bI as W,bJ as Y,A as Q,bA as me,C as P,D as y,b as _,y as I,bn as Z,h as pe,c8 as fe,bE as ne,x as G,q as ge,s as te,H as xe,bw as be,u as t,bo as he,ad as F,bH as ye}from"./index--eYU5aQm.js";import{_ as se,a as ke}from"./TestDummyMarker.vue_vue_type_script_setup_true_lang-Pam45T1i.js";import{_ as we}from"./FieldInput.vue_vue_type_script_setup_true_lang-CriF7G5j.js";import{_ as le}from"./FieldRange.vue_vue_type_script_setup_true_lang-DcZafZ9u.js";import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{R as _e,a as Se}from"./RadioCardDetailManySelect-B7rv-Fju.js";import{_ as Ve}from"./Textarea.vue_vue_type_script_setup_true_lang-DwFb1myn.js";import{_ as Me}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-BHnSNWo1.js";import{_ as Ce}from"./Input.vue_vue_type_script_setup_true_lang-DaL4uFR_.js";import{_ as $e}from"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";import{u as Pe}from"./providers-YQf-rDZ1.js";import{u as Ue,g as Le}from"./speech-BOhrg3WS.js";import{b as oe}from"./route-block-B_A1xBdJ.js";import"./Basic.vue_vue_type_script_setup_true_lang-Ckn2TiNk.js";import"./index-Be1NqeGb.js";const qe=D({__name:"AudioSpectrum",props:{stream:null,bars:{default:32},minFreq:{default:60},maxFreq:{default:4e3}},setup(o){const l=o,g=V(Array.from({length:l.bars}).fill(0));ae(()=>{m()}),X(()=>l.stream,()=>{m()});function m(){if(!l.stream)return;const c=new(window.AudioContext||window.webkitAudioContext),f=c.createMediaStreamSource(l.stream),v=c.createAnalyser();v.fftSize=2048,f.connect(v);const b=v.frequencyBinCount,M=new Uint8Array(b),p=c.sampleRate/v.fftSize,k=Math.floor(l.minFreq/p),U=Math.floor(l.maxFreq/p),q=U-k,E=Math.floor(q/l.bars),T=()=>{try{requestAnimationFrame(T),v.getByteFrequencyData(M);const A=Array.from({length:l.bars}).fill(0);for(let z=0;zre(c.$slots,"default",{frequencies:g.value})}}),Ae={"h-full":"",flex:"","items-center":"","gap-1":""},Ee=5,Re=D({__name:"AudioSpectrumVisualizer",props:{frequencies:null,barsClass:null},setup(o){const l=o;function g(c,f){return .1+(1-.1)*(c/f)}function m(c,f){const v=g(f,l.frequencies.length);return Math.min(100,Math.max(10,c*100*Ee*v))}return(c,f)=>(i(),u("div",Ae,[(i(!0),u(H,null,K(o.frequencies,(v,b)=>(i(),u("div",{key:b,"h-full":"",flex:"","flex-1":"","items-end":""},[e("div",{transition:"all 100 ease-in-out","mx-auto":"","my-0":"","w-full":"","rounded-full":"",class:$(o.barsClass),style:ve({height:`${m(v,b)}%`})},null,6)]))),128))]))}}),Te={class:"p-3"},ze={class:"flex items-start"},Be=["checked","name","value"],Fe={class:"relative mr-3 mt-0.5 flex-shrink-0"},Ie={key:0,class:"i-solar:pause-circle-bold-duotone text-xl text-neutral-400 dark:text-neutral-500"},Ne={key:1,class:"i-solar:play-circle-bold-duotone text-xl text-neutral-400 dark:text-neutral-500"},De={key:1,class:"mt-auto w-full flex items-center justify-center bg-neutral-50 py-3 text-xs text-neutral-400 italic dark:bg-neutral-800/50 dark:text-neutral-600"},je={class:"flex-1 cursor-pointer"},Oe={class:"flex items-center"},Qe={key:0,class:"mt-1 flex flex-wrap gap-1"},He={key:1,class:"mt-3"},Je={relative:""},Ge={key:0,class:"h-16 px-3 pb-2"},Ye=D({__name:"VoiceCard",props:W({name:null,voice:null,currentlyPlayingId:null,customInputPlaceholder:{default:"Enter custom voice name"},showVisualizer:{type:Boolean,default:!0},audioStream:{default:null}},{"voice-id":{required:!1,default:""},"voice-idModifiers":{},"custom-voice-name":{required:!1,default:""},"custom-voice-nameModifiers":{}}),emits:W(["togglePlayback"],["update:voice-id","update:custom-voice-name"]),setup(o,{emit:l}){const g=o,m=l,c=Y(o,"voice-id"),f=Y(o,"custom-voice-name");function v(h){return h.previewURL||h.preview_audio_url}function b(h){var k,U,q;const p=[];if((k=h.labels)!=null&&k.gender&&p.push(h.labels.gender),(U=h.labels)!=null&&U.age&&p.push(h.labels.age),(q=h.labels)!=null&&q.accent&&p.push(h.labels.accent),h.languages&&h.languages.length>0){const E=h.languages.map(T=>T.name).join(", ");p.push(E)}return p}function M(){m("togglePlayback",g.voice)}return(h,p)=>(i(),u("label",{border:"2px solid",class:$(["scroll-snap-align-start form_voice-card relative flex flex-col overflow-hidden rounded-xl",[c.value===g.voice.id?"bg-primary-50 dark:bg-primary-900/20 border-primary-100 dark:border-primary-900 hover:border-primary-500/30 dark:hover:border-primary-400/30":"bg-white dark:bg-neutral-900/20 border-neutral-100 dark:border-neutral-900 hover:border-primary-500/30 dark:hover:border-primary-400/30",c.value===g.voice.id?"form_voice-card-active":""]]),transition:"all duration-200 ease-in-out"},[e("div",Te,[e("div",ze,[Q(e("input",{"onUpdate:modelValue":p[0]||(p[0]=k=>c.value=k),checked:c.value===g.voice.id,type:"radio",name:o.name,value:g.voice.id,class:"absolute cursor-pointer opacity-0"},null,8,Be),[[me,c.value]]),e("div",Fe,[e("div",{class:$(["size-5 border-2 rounded-full transition-colors duration-200",[c.value===g.voice.id?"border-primary-500 dark:border-primary-400":"border-neutral-300 dark:border-neutral-600"]])},[e("div",{class:$(["absolute left-1/2 top-1/2 size-3 rounded-full transition-opacity duration-200 -translate-x-1/2 -translate-y-1/2",[c.value===g.voice.id?"opacity-100 bg-primary-500 dark:bg-primary-400":"opacity-0"]])},null,2)],2)]),v(o.voice)?(i(),u("button",{key:0,absolute:"","right-0":"",top:"0","z-100":"",class:$(["translate-x-[-50%] translate-y-[50%]",[o.currentlyPlayingId===o.voice.id?"text-white dark:text-white":""]]),onClick:M},[o.currentlyPlayingId===o.voice.id?(i(),u("div",Ie)):(i(),u("div",Ne))],2)):(i(),u("div",De," No preview available ")),e("div",je,[e("div",Oe,[e("span",{class:$(["line-clamp-1 font-medium",[c.value===o.voice.id?"text-neutral-700 dark:text-neutral-300":"text-neutral-700 dark:text-neutral-400"]])},y(o.voice.name),3)]),b(o.voice).length>0?(i(),u("div",Qe,[(i(!0),u(H,null,K(b(o.voice),(k,U)=>(i(),u("span",{key:U,class:$(["inline-flex items-center rounded-md px-1.5 py-0.5 text-xs",[c.value===o.voice.id?"bg-primary-100 text-primary-700 dark:bg-primary-900/30 dark:text-primary-400":"bg-neutral-100 text-neutral-700 dark:bg-neutral-800 dark:text-neutral-300"]])},y(k),3))),128))])):P("",!0),o.voice.customizable&&c.value===o.voice.id?(i(),u("div",He,[_(Ce,{modelValue:f.value,"onUpdate:modelValue":p[1]||(p[1]=k=>f.value=k),type:"text",class:"w-full border border-neutral-300 rounded bg-white px-2 py-1 text-sm dark:border-neutral-700 dark:bg-neutral-900",placeholder:o.customInputPlaceholder},null,8,["modelValue","placeholder"])])):P("",!0),o.voice.description?(i(),u("div",{key:2,class:$(["line-clamp-2 mt-1 text-xs",[c.value===o.voice.id?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]])},y(o.voice.description),3)):P("",!0)])])]),e("div",Je,[_(Me,null,{default:I(()=>[o.showVisualizer&&o.currentlyPlayingId===o.voice.id&&o.audioStream?(i(),u("div",Ge,[_(qe,{stream:o.audioStream,bars:24,"min-freq":60,"max-freq":4e3},{default:I(({frequencies:k})=>[_(Re,{frequencies:k,"bars-class":c.value===o.voice.id?"bg-primary-500 dark:bg-primary-400":"bg-neutral-400 dark:bg-neutral-600"},null,8,["frequencies","bars-class"])]),_:1},8,["stream"])])):P("",!0)]),_:1})])],2))}}),Ke=Z(Ye,[["__scopeId","data-v-dbab964e"]]),We={class:"voice-preview-player"},Xe={key:0,class:"relative","inline-flex":"~","w-full":"","items-center":""},Ze=["placeholder"],et={class:"mt-4 space-y-2"},tt={key:0,class:"text-sm text-neutral-500 dark:text-neutral-400"},st={key:1,class:"flex items-center gap-3 border border-2 border-amber-200 rounded-xl bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},lt={class:"flex flex-col"},ot={class:"font-medium"},at={class:"text-sm text-amber-600 dark:text-amber-400"},rt={class:"relative"},nt=D({__name:"VoiceCardManySelect",props:W({voices:null,searchable:{type:Boolean,default:!0},searchPlaceholder:{default:"Search voices..."},searchNoResultsTitle:{default:"No voices found"},searchNoResultsDescription:{default:"Try a different search term"},searchResultsText:{default:"{count} of {total} voices"},customInputPlaceholder:{default:"Enter custom voice name"},expandButtonText:{default:"Show more"},collapseButtonText:{default:"Show less"},playButtonText:{default:"Play sample"},pauseButtonText:{default:"Pause"},showVisualizer:{type:Boolean,default:!0}},{"search-query":{required:!1,default:""},"search-queryModifiers":{},"voice-id":{required:!1,default:""},"voice-idModifiers":{}}),emits:["update:search-query","update:voice-id"],setup(o){const l=o,g=V(!1),m=V(),c=V(new Map),f=V(new Map),v=V(new Map),b=V(new Map),M=V(null);function h(){return M.value||(M.value=new(window.AudioContext||window.webkitAudioContext)),M.value}const p=Y(o,"search-query"),k=Y(o,"voice-id"),U=pe(()=>{if(!p.value)return l.voices;const a=p.value.toLowerCase();return l.voices.filter(r=>{const n=r.name.toLowerCase().includes(a),x=r.description&&r.description.toLowerCase().includes(a),w=r.tags&&r.tags.some(S=>S.toLowerCase().includes(a)),L=r.labels&&Object.values(r.labels).some(S=>typeof S=="string"&&S.toLowerCase().includes(a)),C=r.languages&&r.languages.some(S=>S.name.toLowerCase().includes(a)||S.code.toLowerCase().includes(a));return n||x||w||L||C})});function q(a){return a.previewURL||a.preview_audio_url}function E(a){const r=q(a);if(!r)return null;if(c.value.has(a.id))return c.value.get(a.id)||null;const n=new Audio(r);return n.crossOrigin="anonymous",n.preload="auto",n.addEventListener("ended",()=>{if(m.value===a.id){m.value=void 0;const x=f.value.get(a.id);x&&(x.getTracks().forEach(w=>w.stop()),f.value.delete(a.id))}}),c.value.set(a.id,n),n}function T(a,r){try{if(f.value.has(r))return f.value.get(r)||null;const n=h();if(b.value.has(r)){const C=b.value.get(r),S=n.createMediaStreamDestination();C.connect(S);const j=S.stream;return f.value.set(r,j),j}const x=n.createMediaElementSource(a);b.value.set(r,x),x.connect(n.destination);const w=n.createMediaStreamDestination();x.connect(w);const L=w.stream;return f.value.set(r,L),L}catch(n){return console.error("Failed to create audio stream for visualizer:",n),null}}function A(a){try{if(!q(a))return;const n=E(a);if(!n)return;if(m.value===a.id){n.pause(),m.value=void 0;const x=f.value.get(a.id);x&&(x.getTracks().forEach(w=>w.stop()),f.value.delete(a.id));return}if(m.value){const x=c.value.get(m.value);x&&x.pause();const w=f.value.get(m.value);w&&(w.getTracks().forEach(L=>L.stop()),f.value.delete(m.value))}l.showVisualizer&&!f.value.has(a.id)&&T(n,a.id),n.currentTime=0,n.play().catch(x=>{console.error("Failed to play audio:",x)}),m.value=a.id}catch(r){console.error(r),m.value=void 0}}function z(){c.value.forEach(a=>{a.pause(),a.src=""}),c.value.clear(),f.value.forEach(a=>{a.getTracks().forEach(r=>r.stop())}),f.value.clear(),v.value.forEach(a=>{a.state!=="closed"&&a.close()}),v.value.clear(),b.value.clear(),m.value=void 0}X(p,()=>{if(m.value){const a=c.value.get(m.value);a&&a.pause();const r=f.value.get(m.value);r&&(r.getTracks().forEach(n=>n.stop()),f.value.delete(m.value)),m.value=void 0}}),fe(z);const B=V("");return(a,r)=>(i(),u("div",We,[o.searchable?(i(),u("div",Xe,[r[4]||(r[4]=e("div",{class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"},[e("div",{"i-solar:magnifer-line-duotone":"",class:"text-neutral-500 dark:text-neutral-400"})],-1)),Q(e("input",{"onUpdate:modelValue":r[0]||(r[0]=n=>p.value=n),type:"search",class:"w-full rounded-xl p-2.5 pl-10 text-sm outline-none",border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",bg:"white dark:neutral-900",placeholder:o.searchPlaceholder},null,8,Ze),[[ne,p.value]])])):P("",!0),e("div",et,[p.value?(i(),u("div",tt,y(o.searchResultsText.replace("{count}",U.value.length.toString()).replace("{total}",o.voices.length.toString())),1)):P("",!0),p.value&&U.value.length===0?(i(),u("div",st,[r[5]||(r[5]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),e("div",lt,[e("span",ot,y(o.searchNoResultsTitle),1),e("span",at,y(o.searchNoResultsDescription.replace("{query}",p.value)),1)])])):P("",!0),e("div",rt,[e("div",{class:$(["scrollbar-hide grid auto-cols-[350px] grid-flow-col max-h-[calc(100dvh-7lh)] gap-4 overflow-x-auto",[g.value?"grid-cols-1 md:grid-cols-2 grid-flow-row auto-cols-auto":""]]),transition:"all duration-200 ease-in-out",style:{"scroll-snap-type":"x mandatory"}},[(i(!0),u(H,null,K(U.value,n=>(i(),G(Ke,{key:n.id,"voice-id":k.value,"onUpdate:voiceId":r[1]||(r[1]=x=>k.value=x),"custom-voice-name":B.value,"onUpdate:customVoiceName":r[2]||(r[2]=x=>B.value=x),name:"voice",voice:n,"currently-playing-id":m.value,"custom-input-placeholder":o.customInputPlaceholder,"show-visualizer":o.showVisualizer,"audio-stream":f.value.get(n.id),onTogglePlayback:A},null,8,["voice-id","custom-voice-name","voice","currently-playing-id","custom-input-placeholder","show-visualizer","audio-stream"]))),128))],2),e("div",{bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"",class:$([g.value?"w-full":"mt-4 w-full rounded-lg"])},[e("button",{"w-full":"",flex:"","items-center":"","justify-center":"","gap-2":"","rounded-lg":"","py-2":"",transition:"all duration-200 ease-in-out",class:$([g.value?"bg-primary-500 hover:bg-primary-600 text-white":"bg-white dark:bg-neutral-900 hover:bg-neutral-100 dark:hover:bg-neutral-800"]),onClick:r[3]||(r[3]=n=>g.value=!g.value)},[e("span",null,y(g.value?o.collapseButtonText:o.expandButtonText),1),e("div",{class:$([g.value?"rotate-180":"","text-lg"]),"i-solar:alt-arrow-down-bold-duotone":"",transition:"transform duration-200 ease-in-out"},null,2)],2)],2)])])]))}}),it=Z(nt,[["__scopeId","data-v-070104a7"]]),ut=D({__name:"Skeleton",props:{animation:{default:"pulse"}},setup(o){const l=o;return(g,m)=>(i(),u("div",{class:$(["skeleton",l.animation!=="none"?`skeleton-${l.animation}`:""]),bg:"neutral-200 dark:neutral-800",overflow:"hidden"},[re(g.$slots,"default",{},void 0,!0)],2))}}),O=Z(ut,[["__scopeId","data-v-f404da2a"]]),dt={flex:"~ col md:row gap-6"},ct={bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-4",class:"w-full md:w-[40%]"},vt={flex:"~ col gap-4"},mt={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},pt={text:"neutral-400 dark:neutral-500"},ft={"max-w-full":""},gt={key:0,flex:"~ row gap-4",style:{"scrollbar-width":"none"},"min-w-0":"","of-x-scroll":"","scroll-smooth":"",role:"radiogroup"},xt={key:1},bt={key:0},ht={flex:"~ col gap-4"},yt={class:"text-lg md:text-2xl"},kt={text:"neutral-400 dark:neutral-400"},wt={key:0,class:"flex items-center justify-center py-4"},_t={key:1,class:"flex items-center gap-3 border border-red-200 rounded-lg bg-red-50 p-4 dark:border-red-800 dark:bg-red-900/20"},St={class:"flex flex-col"},Vt={class:"font-medium"},Mt={class:"text-sm text-red-600 dark:text-red-400"},Ct={key:2,class:"flex items-center gap-3 border border-amber-200 rounded-lg bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},$t={class:"flex flex-col"},Pt={class:"font-medium"},Ut={class:"text-sm text-amber-600 dark:text-amber-400"},Lt={key:0},qt={flex:"~ col gap-4"},At={key:0},Et={class:"flex flex-col gap-4"},Rt={flex:"~ row gap-4"},Tt={key:1,class:"space-y-6"},zt={key:2,class:"flex items-center gap-3 border border-2 border-red-200 rounded-lg bg-red-50 p-4 dark:border-red-800 dark:bg-red-900/20"},Bt={class:"flex flex-col"},Ft={class:"text-sm text-red-600 dark:text-red-400"},It={key:3,class:"flex items-center gap-3 border border-2 border-amber-200 rounded-lg bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},Nt={flex:"~ col gap-4"},Dt={key:4,class:"mt-2 space-y-6"},jt={key:0},Ot={flex:"~ col gap-4"},Qt={flex:"~ col gap-6",class:"w-full md:w-[60%]"},Ht={"w-full":"","rounded-xl":""},Jt={class:"mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400","w-full":""},Gt={class:"inline-flex items-center gap-4"},Yt={flex:"~ col gap-4"},Kt={flex:"~ row","gap-4":""},Wt=["disabled"],Xt={flex:"~ row","items-center":"","gap-2":""},Zt=["src"],es={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},ts=D({__name:"speech",setup(o){const{t:l}=ge(),g=Pe(),m=Ue(),{availableProviders:c,availableAudioSpeechProvidersMetadata:f}=te(g),{activeSpeechProvider:v,activeSpeechModel:b,activeSpeechVoice:M,activeSpeechVoiceId:h,pitch:p,isLoadingSpeechProviderVoices:k,supportsModelListing:U,providerModels:q,isLoadingActiveProviderModels:E,activeProviderModelError:T,modelSearchQuery:A,speechProviderError:z,ssmlEnabled:B,availableVoices:a}=te(m),r=V(""),n=V(!1),x=V("Hello, my name is AI Assistant"),w=V(""),L=V(!1),C=V(""),S=V(null),j=V("");ae(async()=>{await m.loadVoicesForProvider(v.value),await g.loadModelsForConfiguredProviders()}),X(v,async()=>{await m.loadVoicesForProvider(v.value),await g.loadModelsForConfiguredProviders()});async function ie(){if(!x.value.trim()&&!n.value||n.value&&!w.value.trim())return;if(!b.value){console.error("No model selected");return}if(!M.value){console.error("No voice selected");return}const R=g.getProviderInstance(v.value);if(!R){console.error("Failed to initialize speech provider");return}const s=g.getProviderConfig(v.value);L.value=!0,j.value="";try{C.value&&ee();const N=n.value?w.value:m.generateSSML(x.value,M.value,{...s,pitch:p.value}),J=await Le({...R.speech(b.value,s),input:N,voice:M.value.id});C.value=URL.createObjectURL(new Blob([J])),setTimeout(()=>{S.value&&S.value.play()},100)}catch(N){console.error("Error generating speech:",N),j.value=N instanceof Error?N.message:"An unknown error occurred"}finally{L.value=!1}}function ee(){S.value&&(S.value.pause(),S.value.currentTime=0),C.value&&(URL.revokeObjectURL(C.value),C.value="")}xe(()=>{C.value&&URL.revokeObjectURL(C.value)});function ue(R){M.value={id:R,name:R,description:R,previewURL:R,languages:[{code:"en",title:"English"}],provider:v.value,gender:"male"}}function de(R){b.value=R}return(R,s)=>{var J;const N=be("motion");return i(),u(H,null,[_(t($e),{title:t(l)("settings.pages.modules.speech.title"),subtitle:t(l)("settings.pages.modules.title")},null,8,["title","subtitle"]),e("div",dt,[e("div",ct,[e("div",null,[e("div",vt,[e("div",null,[e("h2",mt,y(t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.title")),1),e("div",pt,[e("span",null,y(t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.description")),1)])]),e("div",ft,[t(c).length>0?(i(),u("fieldset",gt,[(i(!0),u(H,null,K(t(f),d=>(i(),G(t(Se),{id:d.id,key:d.id,modelValue:t(v),"onUpdate:modelValue":s[0]||(s[0]=ce=>F(v)?v.value=ce:null),name:"speech-provider",value:d.id,title:d.localizedName,description:d.localizedDescription},null,8,["id","modelValue","value","title","description"]))),128))])):(i(),u("div",xt,[_(t(he),{class:"flex items-center gap-3 rounded-lg p-4",border:"2 dashed neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-800",transition:"colors duration-200 ease-in-out",to:"/settings/providers"},{default:I(()=>s[13]||(s[13]=[e("div",{"i-solar:warning-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1),e("div",{class:"flex flex-col"},[e("span",{class:"font-medium"},"No Speech Providers Configured"),e("span",{class:"text-sm text-neutral-400 dark:text-neutral-500"},"Click here to set up your speech providers")],-1),e("div",{"i-solar:arrow-right-line-duotone":"",class:"ml-auto text-xl text-neutral-400 dark:text-neutral-500"},null,-1)])),_:1})]))])]),e("div",null,[t(v)&&t(U)?(i(),u("div",bt,[e("div",ht,[e("div",null,[e("h2",yt,y(t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",kt,[e("span",null,y(t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),t(E)?(i(),u("div",wt,[s[14]||(s[14]=e("div",{class:"mr-2 animate-spin"},[e("div",{"i-solar:spinner-line-duotone":"","text-xl":""})],-1)),e("span",null,y(t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.loading")),1)])):t(T)?(i(),u("div",_t,[s[15]||(s[15]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",St,[e("span",Vt,y(t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.error")),1),e("span",Mt,y(t(T)),1)])])):t(q).length===0&&!t(E)?(i(),u("div",Ct,[s[16]||(s[16]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),e("div",$t,[e("span",Pt,y(t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models")),1),e("span",Ut,y(t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description")),1)])])):t(q).length>0?(i(),G(t(_e),{key:3,modelValue:t(b),"onUpdate:modelValue":s[1]||(s[1]=d=>F(b)?b.value=d:null),"search-query":t(A),"onUpdate:searchQuery":s[2]||(s[2]=d=>F(A)?A.value=d:null),items:t(q),searchable:!0,"search-placeholder":t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder"),"search-no-results-title":t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results"),"search-no-results-description":t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description",{query:t(A)}),"search-results-text":t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results",{count:"{count}",total:"{total}"}),"custom-input-placeholder":t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder"),"expand-button-text":t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.expand"),"collapse-button-text":t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse"),"onUpdate:customValue":de},null,8,["modelValue","search-query","items","search-placeholder","search-no-results-title","search-no-results-description","search-results-text","custom-input-placeholder","expand-button-text","collapse-button-text"])):P("",!0)])])):P("",!0)])]),t(v)?(i(),u("div",Lt,[e("div",qt,[s[27]||(s[27]=e("div",null,[e("h2",{class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"}," Voice Configuration "),e("div",{text:"neutral-400 dark:neutral-500"},[e("span",null,"Customize how your AI assistant speaks")])],-1)),t(k)?(i(),u("div",At,[e("div",Et,[_(t(O),{class:"w-full rounded-lg p-2.5 text-sm"},{default:I(()=>s[17]||(s[17]=[e("div",{class:"h-1lh"},null,-1)])),_:1}),e("div",Rt,[_(t(O),{class:"w-full rounded-lg p-4 text-sm"},{default:I(()=>s[18]||(s[18]=[e("div",{class:"h-1lh"},null,-1)])),_:1}),_(t(O),{class:"w-full rounded-lg p-4 text-sm"},{default:I(()=>s[19]||(s[19]=[e("div",{class:"h-1lh"},null,-1)])),_:1}),_(t(O),{class:"w-full rounded-lg p-4 text-sm"},{default:I(()=>s[20]||(s[20]=[e("div",{class:"h-1lh"},null,-1)])),_:1})]),_(t(O),{class:"w-full rounded-lg p-3 text-sm"},{default:I(()=>s[21]||(s[21]=[e("div",{class:"h-1lh"},null,-1)])),_:1})])])):t(a)[t(v)]&&t(a)[t(v)].length>0?(i(),u("div",Tt,[_(t(it),{"search-query":r.value,"onUpdate:searchQuery":s[3]||(s[3]=d=>r.value=d),"voice-id":t(h),"onUpdate:voiceId":s[4]||(s[4]=d=>F(h)?h.value=d:null),voices:(J=t(a)[t(v)])==null?void 0:J.map(d=>({id:d.id,name:d.name,description:d.description,previewURL:d.previewURL,customizable:!1})),searchable:!0,"search-placeholder":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_placeholder"),"search-no-results-title":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices"),"search-no-results-description":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices_description"),"search-results-text":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_results",{count:0,total:0}),"custom-input-placeholder":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.custom_voice_placeholder"),"expand-button-text":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.show_more"),"collapse-button-text":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.show_less"),"play-button-text":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.play_sample"),"pause-button-text":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.pause"),"onUpdate:customValue":ue},null,8,["search-query","voice-id","voices","search-placeholder","search-no-results-title","search-no-results-description","search-results-text","custom-input-placeholder","expand-button-text","collapse-button-text","play-button-text","pause-button-text"])])):t(z)?(i(),u("div",zt,[s[23]||(s[23]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",Bt,[s[22]||(s[22]=e("span",{class:"font-medium"},"Error loading voices",-1)),e("span",Ft,y(t(z)),1)])])):(i(),u("div",It,s[24]||(s[24]=[e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1),e("div",{class:"flex flex-col"},[e("span",{class:"font-medium"},"No voices available"),e("span",{class:"text-sm text-amber-600 dark:text-amber-400"}," No voices were found for this provider. You can enter a custom voice name below. ")],-1)]))),e("div",Nt,[_(t(le),{modelValue:t(p),"onUpdate:modelValue":s[5]||(s[5]=d=>F(p)?p.value=d:null),label:"Pitch",description:"Tune the pitch of the voice",min:-100,max:100,step:1,"format-value":d=>`${d}%`},null,8,["modelValue","format-value"]),_(t(se),{modelValue:t(B),"onUpdate:modelValue":s[6]||(s[6]=d=>F(B)?B.value=d:null),label:"Enable SSML",description:"Enable Speech Synthesis Markup Language for more control over speech output"},null,8,["modelValue"])]),!t(a)[t(v)]||t(a)[t(v)].length===0?(i(),u("div",Dt,[_(t(we),{modelValue:t(h),"onUpdate:modelValue":s[7]||(s[7]=d=>F(h)?h.value=d:null),type:"text",label:"Voice ID",description:"Enter the voice ID for your custom voice",placeholder:"Enter voice name (e.g., 'Rachel', 'Josh')"},null,8,["modelValue"]),t(v)==="elevenlabs"?(i(),u("div",jt,[s[26]||(s[26]=e("label",{class:"mb-1 block text-sm font-medium"}," Model ",-1)),Q(e("select",{"onUpdate:modelValue":s[8]||(s[8]=d=>F(b)?b.value=d:null),class:"w-full border border-neutral-300 rounded bg-white px-3 py-2 dark:border-neutral-700 dark:bg-neutral-900"},s[25]||(s[25]=[e("option",{value:"eleven_monolingual_v1"}," Monolingual v1 ",-1),e("option",{value:"eleven_multilingual_v1"}," Multilingual v1 ",-1),e("option",{value:"eleven_multilingual_v2"}," Multilingual v2 ",-1)]),512),[[ye,t(b)]])])):P("",!0),e("div",Ot,[_(t(le),{modelValue:t(p),"onUpdate:modelValue":s[9]||(s[9]=d=>F(p)?p.value=d:null),label:"Pitch",description:"Tune the pitch of the voice",min:-100,max:100,step:1,"format-value":d=>`${d}%`},null,8,["modelValue","format-value"])])])):P("",!0)])])):P("",!0)]),e("div",Qt,[e("div",Ht,[e("h2",Jt,[e("div",Gt,[_(t(ke)),e("div",null,y(t(l)("settings.pages.providers.provider.elevenlabs.playground.title")),1)])]),e("div",Yt,[_(t(se),{modelValue:n.value,"onUpdate:modelValue":s[10]||(s[10]=d=>n.value=d),label:"Use Custom SSML",description:"Enable to input raw SSML instead of plain text"},null,8,["modelValue"]),n.value?Q((i(),u("textarea",{key:1,"onUpdate:modelValue":s[12]||(s[12]=d=>w.value=d),placeholder:"Enter SSML text...",border:"neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700",transition:"all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900","h-48":"","w-full":"","rounded-lg":"","px-3":"","py-2":"","text-sm":"","font-mono":"","outline-none":""},null,512)),[[ne,w.value]]):(i(),G(t(Ve),{key:0,modelValue:x.value,"onUpdate:modelValue":s[11]||(s[11]=d=>x.value=d),"h-24":"","w-full":"",placeholder:t(l)("settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder")},null,8,["modelValue","placeholder"])),e("div",Kt,[e("button",{border:"neutral-800 dark:neutral-200 solid 2",transition:"border duration-250 ease-in-out","rounded-lg":"","px-4":"",text:"neutral-100 dark:neutral-900","py-2":"","text-sm":"",disabled:L.value||!x.value.trim()&&!n.value||n.value&&!w.value.trim()||!t(M),class:$({"opacity-50 cursor-not-allowed":L.value||!x.value.trim()&&!n.value||n.value&&!w.value.trim()||!t(M)}),bg:"neutral-700 dark:neutral-300",onClick:ie},[e("div",Xt,[s[28]||(s[28]=e("div",{"i-solar:play-circle-bold-duotone":""},null,-1)),e("span",null,y(L.value?t(l)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating"):t(l)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label")),1)])],10,Wt),C.value?(i(),u("button",{key:0,border:"primary-300 dark:primary-800 solid 2",transition:"border duration-250 ease-in-out","rounded-lg":"","px-4":"","py-2":"","text-sm":"",onClick:ee},s[29]||(s[29]=[e("div",{flex:"~ row","items-center":"","gap-2":""},[e("div",{"i-solar:stop-circle-bold-duotone":""}),e("span",null,"Stop")],-1)]))):P("",!0)]),C.value?(i(),u("audio",{key:2,ref_key:"audioPlayer",ref:S,src:C.value,controls:"",class:"mt-2 w-full"},null,8,Zt)):P("",!0)])])])]),Q((i(),u("div",es,s[30]||(s[30]=[e("div",{text:"60","i-solar:user-speak-rounded-bold-duotone":""},null,-1)]))),[[N]])],64)}}});typeof oe=="function"&&oe(ts);export{ts as default}; +import{d as D,g as V,l as ae,w as X,m as re,c as u,o as i,bx as H,by as K,a as e,n as ve,z as $,bI as W,bJ as Y,A as Q,bA as me,C as P,D as y,b as _,y as I,bn as Z,h as pe,c8 as fe,bE as ne,x as G,q as ge,s as te,H as xe,bw as be,u as t,bo as he,ad as F,bH as ye}from"./index-D55VqdU4.js";import{_ as se,a as ke}from"./TestDummyMarker.vue_vue_type_script_setup_true_lang-DRQbkM6R.js";import{_ as we}from"./FieldInput.vue_vue_type_script_setup_true_lang-DQP2RhYC.js";import{_ as le}from"./FieldRange.vue_vue_type_script_setup_true_lang-CtbCdbG8.js";import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{R as _e,a as Se}from"./RadioCardDetailManySelect-B6ly4h3g.js";import{_ as Ve}from"./Textarea.vue_vue_type_script_setup_true_lang-NzxEJo0x.js";import{_ as Me}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-BbB31kj-.js";import{_ as Ce}from"./Input.vue_vue_type_script_setup_true_lang-CeU0PE9S.js";import{_ as $e}from"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";import{u as Pe}from"./providers-DAp1566d.js";import{u as Ue,g as Le}from"./speech-BtNOtIn9.js";import{b as oe}from"./route-block-B_A1xBdJ.js";import"./Basic.vue_vue_type_script_setup_true_lang-DJ4kS-zi.js";import"./index-Be1NqeGb.js";const qe=D({__name:"AudioSpectrum",props:{stream:null,bars:{default:32},minFreq:{default:60},maxFreq:{default:4e3}},setup(o){const l=o,g=V(Array.from({length:l.bars}).fill(0));ae(()=>{m()}),X(()=>l.stream,()=>{m()});function m(){if(!l.stream)return;const c=new(window.AudioContext||window.webkitAudioContext),f=c.createMediaStreamSource(l.stream),v=c.createAnalyser();v.fftSize=2048,f.connect(v);const b=v.frequencyBinCount,M=new Uint8Array(b),p=c.sampleRate/v.fftSize,k=Math.floor(l.minFreq/p),U=Math.floor(l.maxFreq/p),q=U-k,E=Math.floor(q/l.bars),T=()=>{try{requestAnimationFrame(T),v.getByteFrequencyData(M);const A=Array.from({length:l.bars}).fill(0);for(let z=0;zre(c.$slots,"default",{frequencies:g.value})}}),Ae={"h-full":"",flex:"","items-center":"","gap-1":""},Ee=5,Re=D({__name:"AudioSpectrumVisualizer",props:{frequencies:null,barsClass:null},setup(o){const l=o;function g(c,f){return .1+(1-.1)*(c/f)}function m(c,f){const v=g(f,l.frequencies.length);return Math.min(100,Math.max(10,c*100*Ee*v))}return(c,f)=>(i(),u("div",Ae,[(i(!0),u(H,null,K(o.frequencies,(v,b)=>(i(),u("div",{key:b,"h-full":"",flex:"","flex-1":"","items-end":""},[e("div",{transition:"all 100 ease-in-out","mx-auto":"","my-0":"","w-full":"","rounded-full":"",class:$(o.barsClass),style:ve({height:`${m(v,b)}%`})},null,6)]))),128))]))}}),Te={class:"p-3"},ze={class:"flex items-start"},Be=["checked","name","value"],Fe={class:"relative mr-3 mt-0.5 flex-shrink-0"},Ie={key:0,class:"i-solar:pause-circle-bold-duotone text-xl text-neutral-400 dark:text-neutral-500"},Ne={key:1,class:"i-solar:play-circle-bold-duotone text-xl text-neutral-400 dark:text-neutral-500"},De={key:1,class:"mt-auto w-full flex items-center justify-center bg-neutral-50 py-3 text-xs text-neutral-400 italic dark:bg-neutral-800/50 dark:text-neutral-600"},je={class:"flex-1 cursor-pointer"},Oe={class:"flex items-center"},Qe={key:0,class:"mt-1 flex flex-wrap gap-1"},He={key:1,class:"mt-3"},Je={relative:""},Ge={key:0,class:"h-16 px-3 pb-2"},Ye=D({__name:"VoiceCard",props:W({name:null,voice:null,currentlyPlayingId:null,customInputPlaceholder:{default:"Enter custom voice name"},showVisualizer:{type:Boolean,default:!0},audioStream:{default:null}},{"voice-id":{required:!1,default:""},"voice-idModifiers":{},"custom-voice-name":{required:!1,default:""},"custom-voice-nameModifiers":{}}),emits:W(["togglePlayback"],["update:voice-id","update:custom-voice-name"]),setup(o,{emit:l}){const g=o,m=l,c=Y(o,"voice-id"),f=Y(o,"custom-voice-name");function v(h){return h.previewURL||h.preview_audio_url}function b(h){var k,U,q;const p=[];if((k=h.labels)!=null&&k.gender&&p.push(h.labels.gender),(U=h.labels)!=null&&U.age&&p.push(h.labels.age),(q=h.labels)!=null&&q.accent&&p.push(h.labels.accent),h.languages&&h.languages.length>0){const E=h.languages.map(T=>T.name).join(", ");p.push(E)}return p}function M(){m("togglePlayback",g.voice)}return(h,p)=>(i(),u("label",{border:"2px solid",class:$(["scroll-snap-align-start form_voice-card relative flex flex-col overflow-hidden rounded-xl",[c.value===g.voice.id?"bg-primary-50 dark:bg-primary-900/20 border-primary-100 dark:border-primary-900 hover:border-primary-500/30 dark:hover:border-primary-400/30":"bg-white dark:bg-neutral-900/20 border-neutral-100 dark:border-neutral-900 hover:border-primary-500/30 dark:hover:border-primary-400/30",c.value===g.voice.id?"form_voice-card-active":""]]),transition:"all duration-200 ease-in-out"},[e("div",Te,[e("div",ze,[Q(e("input",{"onUpdate:modelValue":p[0]||(p[0]=k=>c.value=k),checked:c.value===g.voice.id,type:"radio",name:o.name,value:g.voice.id,class:"absolute cursor-pointer opacity-0"},null,8,Be),[[me,c.value]]),e("div",Fe,[e("div",{class:$(["size-5 border-2 rounded-full transition-colors duration-200",[c.value===g.voice.id?"border-primary-500 dark:border-primary-400":"border-neutral-300 dark:border-neutral-600"]])},[e("div",{class:$(["absolute left-1/2 top-1/2 size-3 rounded-full transition-opacity duration-200 -translate-x-1/2 -translate-y-1/2",[c.value===g.voice.id?"opacity-100 bg-primary-500 dark:bg-primary-400":"opacity-0"]])},null,2)],2)]),v(o.voice)?(i(),u("button",{key:0,absolute:"","right-0":"",top:"0","z-100":"",class:$(["translate-x-[-50%] translate-y-[50%]",[o.currentlyPlayingId===o.voice.id?"text-white dark:text-white":""]]),onClick:M},[o.currentlyPlayingId===o.voice.id?(i(),u("div",Ie)):(i(),u("div",Ne))],2)):(i(),u("div",De," No preview available ")),e("div",je,[e("div",Oe,[e("span",{class:$(["line-clamp-1 font-medium",[c.value===o.voice.id?"text-neutral-700 dark:text-neutral-300":"text-neutral-700 dark:text-neutral-400"]])},y(o.voice.name),3)]),b(o.voice).length>0?(i(),u("div",Qe,[(i(!0),u(H,null,K(b(o.voice),(k,U)=>(i(),u("span",{key:U,class:$(["inline-flex items-center rounded-md px-1.5 py-0.5 text-xs",[c.value===o.voice.id?"bg-primary-100 text-primary-700 dark:bg-primary-900/30 dark:text-primary-400":"bg-neutral-100 text-neutral-700 dark:bg-neutral-800 dark:text-neutral-300"]])},y(k),3))),128))])):P("",!0),o.voice.customizable&&c.value===o.voice.id?(i(),u("div",He,[_(Ce,{modelValue:f.value,"onUpdate:modelValue":p[1]||(p[1]=k=>f.value=k),type:"text",class:"w-full border border-neutral-300 rounded bg-white px-2 py-1 text-sm dark:border-neutral-700 dark:bg-neutral-900",placeholder:o.customInputPlaceholder},null,8,["modelValue","placeholder"])])):P("",!0),o.voice.description?(i(),u("div",{key:2,class:$(["line-clamp-2 mt-1 text-xs",[c.value===o.voice.id?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]])},y(o.voice.description),3)):P("",!0)])])]),e("div",Je,[_(Me,null,{default:I(()=>[o.showVisualizer&&o.currentlyPlayingId===o.voice.id&&o.audioStream?(i(),u("div",Ge,[_(qe,{stream:o.audioStream,bars:24,"min-freq":60,"max-freq":4e3},{default:I(({frequencies:k})=>[_(Re,{frequencies:k,"bars-class":c.value===o.voice.id?"bg-primary-500 dark:bg-primary-400":"bg-neutral-400 dark:bg-neutral-600"},null,8,["frequencies","bars-class"])]),_:1},8,["stream"])])):P("",!0)]),_:1})])],2))}}),Ke=Z(Ye,[["__scopeId","data-v-dbab964e"]]),We={class:"voice-preview-player"},Xe={key:0,class:"relative","inline-flex":"~","w-full":"","items-center":""},Ze=["placeholder"],et={class:"mt-4 space-y-2"},tt={key:0,class:"text-sm text-neutral-500 dark:text-neutral-400"},st={key:1,class:"flex items-center gap-3 border border-2 border-amber-200 rounded-xl bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},lt={class:"flex flex-col"},ot={class:"font-medium"},at={class:"text-sm text-amber-600 dark:text-amber-400"},rt={class:"relative"},nt=D({__name:"VoiceCardManySelect",props:W({voices:null,searchable:{type:Boolean,default:!0},searchPlaceholder:{default:"Search voices..."},searchNoResultsTitle:{default:"No voices found"},searchNoResultsDescription:{default:"Try a different search term"},searchResultsText:{default:"{count} of {total} voices"},customInputPlaceholder:{default:"Enter custom voice name"},expandButtonText:{default:"Show more"},collapseButtonText:{default:"Show less"},playButtonText:{default:"Play sample"},pauseButtonText:{default:"Pause"},showVisualizer:{type:Boolean,default:!0}},{"search-query":{required:!1,default:""},"search-queryModifiers":{},"voice-id":{required:!1,default:""},"voice-idModifiers":{}}),emits:["update:search-query","update:voice-id"],setup(o){const l=o,g=V(!1),m=V(),c=V(new Map),f=V(new Map),v=V(new Map),b=V(new Map),M=V(null);function h(){return M.value||(M.value=new(window.AudioContext||window.webkitAudioContext)),M.value}const p=Y(o,"search-query"),k=Y(o,"voice-id"),U=pe(()=>{if(!p.value)return l.voices;const a=p.value.toLowerCase();return l.voices.filter(r=>{const n=r.name.toLowerCase().includes(a),x=r.description&&r.description.toLowerCase().includes(a),w=r.tags&&r.tags.some(S=>S.toLowerCase().includes(a)),L=r.labels&&Object.values(r.labels).some(S=>typeof S=="string"&&S.toLowerCase().includes(a)),C=r.languages&&r.languages.some(S=>S.name.toLowerCase().includes(a)||S.code.toLowerCase().includes(a));return n||x||w||L||C})});function q(a){return a.previewURL||a.preview_audio_url}function E(a){const r=q(a);if(!r)return null;if(c.value.has(a.id))return c.value.get(a.id)||null;const n=new Audio(r);return n.crossOrigin="anonymous",n.preload="auto",n.addEventListener("ended",()=>{if(m.value===a.id){m.value=void 0;const x=f.value.get(a.id);x&&(x.getTracks().forEach(w=>w.stop()),f.value.delete(a.id))}}),c.value.set(a.id,n),n}function T(a,r){try{if(f.value.has(r))return f.value.get(r)||null;const n=h();if(b.value.has(r)){const C=b.value.get(r),S=n.createMediaStreamDestination();C.connect(S);const j=S.stream;return f.value.set(r,j),j}const x=n.createMediaElementSource(a);b.value.set(r,x),x.connect(n.destination);const w=n.createMediaStreamDestination();x.connect(w);const L=w.stream;return f.value.set(r,L),L}catch(n){return console.error("Failed to create audio stream for visualizer:",n),null}}function A(a){try{if(!q(a))return;const n=E(a);if(!n)return;if(m.value===a.id){n.pause(),m.value=void 0;const x=f.value.get(a.id);x&&(x.getTracks().forEach(w=>w.stop()),f.value.delete(a.id));return}if(m.value){const x=c.value.get(m.value);x&&x.pause();const w=f.value.get(m.value);w&&(w.getTracks().forEach(L=>L.stop()),f.value.delete(m.value))}l.showVisualizer&&!f.value.has(a.id)&&T(n,a.id),n.currentTime=0,n.play().catch(x=>{console.error("Failed to play audio:",x)}),m.value=a.id}catch(r){console.error(r),m.value=void 0}}function z(){c.value.forEach(a=>{a.pause(),a.src=""}),c.value.clear(),f.value.forEach(a=>{a.getTracks().forEach(r=>r.stop())}),f.value.clear(),v.value.forEach(a=>{a.state!=="closed"&&a.close()}),v.value.clear(),b.value.clear(),m.value=void 0}X(p,()=>{if(m.value){const a=c.value.get(m.value);a&&a.pause();const r=f.value.get(m.value);r&&(r.getTracks().forEach(n=>n.stop()),f.value.delete(m.value)),m.value=void 0}}),fe(z);const B=V("");return(a,r)=>(i(),u("div",We,[o.searchable?(i(),u("div",Xe,[r[4]||(r[4]=e("div",{class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"},[e("div",{"i-solar:magnifer-line-duotone":"",class:"text-neutral-500 dark:text-neutral-400"})],-1)),Q(e("input",{"onUpdate:modelValue":r[0]||(r[0]=n=>p.value=n),type:"search",class:"w-full rounded-xl p-2.5 pl-10 text-sm outline-none",border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",bg:"white dark:neutral-900",placeholder:o.searchPlaceholder},null,8,Ze),[[ne,p.value]])])):P("",!0),e("div",et,[p.value?(i(),u("div",tt,y(o.searchResultsText.replace("{count}",U.value.length.toString()).replace("{total}",o.voices.length.toString())),1)):P("",!0),p.value&&U.value.length===0?(i(),u("div",st,[r[5]||(r[5]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),e("div",lt,[e("span",ot,y(o.searchNoResultsTitle),1),e("span",at,y(o.searchNoResultsDescription.replace("{query}",p.value)),1)])])):P("",!0),e("div",rt,[e("div",{class:$(["scrollbar-hide grid auto-cols-[350px] grid-flow-col max-h-[calc(100dvh-7lh)] gap-4 overflow-x-auto",[g.value?"grid-cols-1 md:grid-cols-2 grid-flow-row auto-cols-auto":""]]),transition:"all duration-200 ease-in-out",style:{"scroll-snap-type":"x mandatory"}},[(i(!0),u(H,null,K(U.value,n=>(i(),G(Ke,{key:n.id,"voice-id":k.value,"onUpdate:voiceId":r[1]||(r[1]=x=>k.value=x),"custom-voice-name":B.value,"onUpdate:customVoiceName":r[2]||(r[2]=x=>B.value=x),name:"voice",voice:n,"currently-playing-id":m.value,"custom-input-placeholder":o.customInputPlaceholder,"show-visualizer":o.showVisualizer,"audio-stream":f.value.get(n.id),onTogglePlayback:A},null,8,["voice-id","custom-voice-name","voice","currently-playing-id","custom-input-placeholder","show-visualizer","audio-stream"]))),128))],2),e("div",{bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"",class:$([g.value?"w-full":"mt-4 w-full rounded-lg"])},[e("button",{"w-full":"",flex:"","items-center":"","justify-center":"","gap-2":"","rounded-lg":"","py-2":"",transition:"all duration-200 ease-in-out",class:$([g.value?"bg-primary-500 hover:bg-primary-600 text-white":"bg-white dark:bg-neutral-900 hover:bg-neutral-100 dark:hover:bg-neutral-800"]),onClick:r[3]||(r[3]=n=>g.value=!g.value)},[e("span",null,y(g.value?o.collapseButtonText:o.expandButtonText),1),e("div",{class:$([g.value?"rotate-180":"","text-lg"]),"i-solar:alt-arrow-down-bold-duotone":"",transition:"transform duration-200 ease-in-out"},null,2)],2)],2)])])]))}}),it=Z(nt,[["__scopeId","data-v-070104a7"]]),ut=D({__name:"Skeleton",props:{animation:{default:"pulse"}},setup(o){const l=o;return(g,m)=>(i(),u("div",{class:$(["skeleton",l.animation!=="none"?`skeleton-${l.animation}`:""]),bg:"neutral-200 dark:neutral-800",overflow:"hidden"},[re(g.$slots,"default",{},void 0,!0)],2))}}),O=Z(ut,[["__scopeId","data-v-f404da2a"]]),dt={flex:"~ col md:row gap-6"},ct={bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-4",class:"w-full md:w-[40%]"},vt={flex:"~ col gap-4"},mt={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},pt={text:"neutral-400 dark:neutral-500"},ft={"max-w-full":""},gt={key:0,flex:"~ row gap-4",style:{"scrollbar-width":"none"},"min-w-0":"","of-x-scroll":"","scroll-smooth":"",role:"radiogroup"},xt={key:1},bt={key:0},ht={flex:"~ col gap-4"},yt={class:"text-lg md:text-2xl"},kt={text:"neutral-400 dark:neutral-400"},wt={key:0,class:"flex items-center justify-center py-4"},_t={key:1,class:"flex items-center gap-3 border border-red-200 rounded-lg bg-red-50 p-4 dark:border-red-800 dark:bg-red-900/20"},St={class:"flex flex-col"},Vt={class:"font-medium"},Mt={class:"text-sm text-red-600 dark:text-red-400"},Ct={key:2,class:"flex items-center gap-3 border border-amber-200 rounded-lg bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},$t={class:"flex flex-col"},Pt={class:"font-medium"},Ut={class:"text-sm text-amber-600 dark:text-amber-400"},Lt={key:0},qt={flex:"~ col gap-4"},At={key:0},Et={class:"flex flex-col gap-4"},Rt={flex:"~ row gap-4"},Tt={key:1,class:"space-y-6"},zt={key:2,class:"flex items-center gap-3 border border-2 border-red-200 rounded-lg bg-red-50 p-4 dark:border-red-800 dark:bg-red-900/20"},Bt={class:"flex flex-col"},Ft={class:"text-sm text-red-600 dark:text-red-400"},It={key:3,class:"flex items-center gap-3 border border-2 border-amber-200 rounded-lg bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},Nt={flex:"~ col gap-4"},Dt={key:4,class:"mt-2 space-y-6"},jt={key:0},Ot={flex:"~ col gap-4"},Qt={flex:"~ col gap-6",class:"w-full md:w-[60%]"},Ht={"w-full":"","rounded-xl":""},Jt={class:"mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400","w-full":""},Gt={class:"inline-flex items-center gap-4"},Yt={flex:"~ col gap-4"},Kt={flex:"~ row","gap-4":""},Wt=["disabled"],Xt={flex:"~ row","items-center":"","gap-2":""},Zt=["src"],es={text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},ts=D({__name:"speech",setup(o){const{t:l}=ge(),g=Pe(),m=Ue(),{availableProviders:c,availableAudioSpeechProvidersMetadata:f}=te(g),{activeSpeechProvider:v,activeSpeechModel:b,activeSpeechVoice:M,activeSpeechVoiceId:h,pitch:p,isLoadingSpeechProviderVoices:k,supportsModelListing:U,providerModels:q,isLoadingActiveProviderModels:E,activeProviderModelError:T,modelSearchQuery:A,speechProviderError:z,ssmlEnabled:B,availableVoices:a}=te(m),r=V(""),n=V(!1),x=V("Hello, my name is AI Assistant"),w=V(""),L=V(!1),C=V(""),S=V(null),j=V("");ae(async()=>{await m.loadVoicesForProvider(v.value),await g.loadModelsForConfiguredProviders()}),X(v,async()=>{await m.loadVoicesForProvider(v.value),await g.loadModelsForConfiguredProviders()});async function ie(){if(!x.value.trim()&&!n.value||n.value&&!w.value.trim())return;if(!b.value){console.error("No model selected");return}if(!M.value){console.error("No voice selected");return}const R=g.getProviderInstance(v.value);if(!R){console.error("Failed to initialize speech provider");return}const s=g.getProviderConfig(v.value);L.value=!0,j.value="";try{C.value&&ee();const N=n.value?w.value:m.generateSSML(x.value,M.value,{...s,pitch:p.value}),J=await Le({...R.speech(b.value,s),input:N,voice:M.value.id});C.value=URL.createObjectURL(new Blob([J])),setTimeout(()=>{S.value&&S.value.play()},100)}catch(N){console.error("Error generating speech:",N),j.value=N instanceof Error?N.message:"An unknown error occurred"}finally{L.value=!1}}function ee(){S.value&&(S.value.pause(),S.value.currentTime=0),C.value&&(URL.revokeObjectURL(C.value),C.value="")}xe(()=>{C.value&&URL.revokeObjectURL(C.value)});function ue(R){M.value={id:R,name:R,description:R,previewURL:R,languages:[{code:"en",title:"English"}],provider:v.value,gender:"male"}}function de(R){b.value=R}return(R,s)=>{var J;const N=be("motion");return i(),u(H,null,[_(t($e),{title:t(l)("settings.pages.modules.speech.title"),subtitle:t(l)("settings.pages.modules.title")},null,8,["title","subtitle"]),e("div",dt,[e("div",ct,[e("div",null,[e("div",vt,[e("div",null,[e("h2",mt,y(t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.title")),1),e("div",pt,[e("span",null,y(t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.description")),1)])]),e("div",ft,[t(c).length>0?(i(),u("fieldset",gt,[(i(!0),u(H,null,K(t(f),d=>(i(),G(t(Se),{id:d.id,key:d.id,modelValue:t(v),"onUpdate:modelValue":s[0]||(s[0]=ce=>F(v)?v.value=ce:null),name:"speech-provider",value:d.id,title:d.localizedName,description:d.localizedDescription},null,8,["id","modelValue","value","title","description"]))),128))])):(i(),u("div",xt,[_(t(he),{class:"flex items-center gap-3 rounded-lg p-4",border:"2 dashed neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-800",transition:"colors duration-200 ease-in-out",to:"/settings/providers"},{default:I(()=>s[13]||(s[13]=[e("div",{"i-solar:warning-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1),e("div",{class:"flex flex-col"},[e("span",{class:"font-medium"},"No Speech Providers Configured"),e("span",{class:"text-sm text-neutral-400 dark:text-neutral-500"},"Click here to set up your speech providers")],-1),e("div",{"i-solar:arrow-right-line-duotone":"",class:"ml-auto text-xl text-neutral-400 dark:text-neutral-500"},null,-1)])),_:1})]))])]),e("div",null,[t(v)&&t(U)?(i(),u("div",bt,[e("div",ht,[e("div",null,[e("h2",yt,y(t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",kt,[e("span",null,y(t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),t(E)?(i(),u("div",wt,[s[14]||(s[14]=e("div",{class:"mr-2 animate-spin"},[e("div",{"i-solar:spinner-line-duotone":"","text-xl":""})],-1)),e("span",null,y(t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.loading")),1)])):t(T)?(i(),u("div",_t,[s[15]||(s[15]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",St,[e("span",Vt,y(t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.error")),1),e("span",Mt,y(t(T)),1)])])):t(q).length===0&&!t(E)?(i(),u("div",Ct,[s[16]||(s[16]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),e("div",$t,[e("span",Pt,y(t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models")),1),e("span",Ut,y(t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description")),1)])])):t(q).length>0?(i(),G(t(_e),{key:3,modelValue:t(b),"onUpdate:modelValue":s[1]||(s[1]=d=>F(b)?b.value=d:null),"search-query":t(A),"onUpdate:searchQuery":s[2]||(s[2]=d=>F(A)?A.value=d:null),items:t(q),searchable:!0,"search-placeholder":t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder"),"search-no-results-title":t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results"),"search-no-results-description":t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description",{query:t(A)}),"search-results-text":t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results",{count:"{count}",total:"{total}"}),"custom-input-placeholder":t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder"),"expand-button-text":t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.expand"),"collapse-button-text":t(l)("settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse"),"onUpdate:customValue":de},null,8,["modelValue","search-query","items","search-placeholder","search-no-results-title","search-no-results-description","search-results-text","custom-input-placeholder","expand-button-text","collapse-button-text"])):P("",!0)])])):P("",!0)])]),t(v)?(i(),u("div",Lt,[e("div",qt,[s[27]||(s[27]=e("div",null,[e("h2",{class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"}," Voice Configuration "),e("div",{text:"neutral-400 dark:neutral-500"},[e("span",null,"Customize how your AI assistant speaks")])],-1)),t(k)?(i(),u("div",At,[e("div",Et,[_(t(O),{class:"w-full rounded-lg p-2.5 text-sm"},{default:I(()=>s[17]||(s[17]=[e("div",{class:"h-1lh"},null,-1)])),_:1}),e("div",Rt,[_(t(O),{class:"w-full rounded-lg p-4 text-sm"},{default:I(()=>s[18]||(s[18]=[e("div",{class:"h-1lh"},null,-1)])),_:1}),_(t(O),{class:"w-full rounded-lg p-4 text-sm"},{default:I(()=>s[19]||(s[19]=[e("div",{class:"h-1lh"},null,-1)])),_:1}),_(t(O),{class:"w-full rounded-lg p-4 text-sm"},{default:I(()=>s[20]||(s[20]=[e("div",{class:"h-1lh"},null,-1)])),_:1})]),_(t(O),{class:"w-full rounded-lg p-3 text-sm"},{default:I(()=>s[21]||(s[21]=[e("div",{class:"h-1lh"},null,-1)])),_:1})])])):t(a)[t(v)]&&t(a)[t(v)].length>0?(i(),u("div",Tt,[_(t(it),{"search-query":r.value,"onUpdate:searchQuery":s[3]||(s[3]=d=>r.value=d),"voice-id":t(h),"onUpdate:voiceId":s[4]||(s[4]=d=>F(h)?h.value=d:null),voices:(J=t(a)[t(v)])==null?void 0:J.map(d=>({id:d.id,name:d.name,description:d.description,previewURL:d.previewURL,customizable:!1})),searchable:!0,"search-placeholder":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_placeholder"),"search-no-results-title":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices"),"search-no-results-description":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices_description"),"search-results-text":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_results",{count:0,total:0}),"custom-input-placeholder":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.custom_voice_placeholder"),"expand-button-text":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.show_more"),"collapse-button-text":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.show_less"),"play-button-text":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.play_sample"),"pause-button-text":t(l)("settings.pages.modules.speech.sections.section.provider-voice-selection.pause"),"onUpdate:customValue":ue},null,8,["search-query","voice-id","voices","search-placeholder","search-no-results-title","search-no-results-description","search-results-text","custom-input-placeholder","expand-button-text","collapse-button-text","play-button-text","pause-button-text"])])):t(z)?(i(),u("div",zt,[s[23]||(s[23]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",Bt,[s[22]||(s[22]=e("span",{class:"font-medium"},"Error loading voices",-1)),e("span",Ft,y(t(z)),1)])])):(i(),u("div",It,s[24]||(s[24]=[e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1),e("div",{class:"flex flex-col"},[e("span",{class:"font-medium"},"No voices available"),e("span",{class:"text-sm text-amber-600 dark:text-amber-400"}," No voices were found for this provider. You can enter a custom voice name below. ")],-1)]))),e("div",Nt,[_(t(le),{modelValue:t(p),"onUpdate:modelValue":s[5]||(s[5]=d=>F(p)?p.value=d:null),label:"Pitch",description:"Tune the pitch of the voice",min:-100,max:100,step:1,"format-value":d=>`${d}%`},null,8,["modelValue","format-value"]),_(t(se),{modelValue:t(B),"onUpdate:modelValue":s[6]||(s[6]=d=>F(B)?B.value=d:null),label:"Enable SSML",description:"Enable Speech Synthesis Markup Language for more control over speech output"},null,8,["modelValue"])]),!t(a)[t(v)]||t(a)[t(v)].length===0?(i(),u("div",Dt,[_(t(we),{modelValue:t(h),"onUpdate:modelValue":s[7]||(s[7]=d=>F(h)?h.value=d:null),type:"text",label:"Voice ID",description:"Enter the voice ID for your custom voice",placeholder:"Enter voice name (e.g., 'Rachel', 'Josh')"},null,8,["modelValue"]),t(v)==="elevenlabs"?(i(),u("div",jt,[s[26]||(s[26]=e("label",{class:"mb-1 block text-sm font-medium"}," Model ",-1)),Q(e("select",{"onUpdate:modelValue":s[8]||(s[8]=d=>F(b)?b.value=d:null),class:"w-full border border-neutral-300 rounded bg-white px-3 py-2 dark:border-neutral-700 dark:bg-neutral-900"},s[25]||(s[25]=[e("option",{value:"eleven_monolingual_v1"}," Monolingual v1 ",-1),e("option",{value:"eleven_multilingual_v1"}," Multilingual v1 ",-1),e("option",{value:"eleven_multilingual_v2"}," Multilingual v2 ",-1)]),512),[[ye,t(b)]])])):P("",!0),e("div",Ot,[_(t(le),{modelValue:t(p),"onUpdate:modelValue":s[9]||(s[9]=d=>F(p)?p.value=d:null),label:"Pitch",description:"Tune the pitch of the voice",min:-100,max:100,step:1,"format-value":d=>`${d}%`},null,8,["modelValue","format-value"])])])):P("",!0)])])):P("",!0)]),e("div",Qt,[e("div",Ht,[e("h2",Jt,[e("div",Gt,[_(t(ke)),e("div",null,y(t(l)("settings.pages.providers.provider.elevenlabs.playground.title")),1)])]),e("div",Yt,[_(t(se),{modelValue:n.value,"onUpdate:modelValue":s[10]||(s[10]=d=>n.value=d),label:"Use Custom SSML",description:"Enable to input raw SSML instead of plain text"},null,8,["modelValue"]),n.value?Q((i(),u("textarea",{key:1,"onUpdate:modelValue":s[12]||(s[12]=d=>w.value=d),placeholder:"Enter SSML text...",border:"neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700",transition:"all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900","h-48":"","w-full":"","rounded-lg":"","px-3":"","py-2":"","text-sm":"","font-mono":"","outline-none":""},null,512)),[[ne,w.value]]):(i(),G(t(Ve),{key:0,modelValue:x.value,"onUpdate:modelValue":s[11]||(s[11]=d=>x.value=d),"h-24":"","w-full":"",placeholder:t(l)("settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder")},null,8,["modelValue","placeholder"])),e("div",Kt,[e("button",{border:"neutral-800 dark:neutral-200 solid 2",transition:"border duration-250 ease-in-out","rounded-lg":"","px-4":"",text:"neutral-100 dark:neutral-900","py-2":"","text-sm":"",disabled:L.value||!x.value.trim()&&!n.value||n.value&&!w.value.trim()||!t(M),class:$({"opacity-50 cursor-not-allowed":L.value||!x.value.trim()&&!n.value||n.value&&!w.value.trim()||!t(M)}),bg:"neutral-700 dark:neutral-300",onClick:ie},[e("div",Xt,[s[28]||(s[28]=e("div",{"i-solar:play-circle-bold-duotone":""},null,-1)),e("span",null,y(L.value?t(l)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating"):t(l)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label")),1)])],10,Wt),C.value?(i(),u("button",{key:0,border:"primary-300 dark:primary-800 solid 2",transition:"border duration-250 ease-in-out","rounded-lg":"","px-4":"","py-2":"","text-sm":"",onClick:ee},s[29]||(s[29]=[e("div",{flex:"~ row","items-center":"","gap-2":""},[e("div",{"i-solar:stop-circle-bold-duotone":""}),e("span",null,"Stop")],-1)]))):P("",!0)]),C.value?(i(),u("audio",{key:2,ref_key:"audioPlayer",ref:S,src:C.value,controls:"",class:"mt-2 w-full"},null,8,Zt)):P("",!0)])])])]),Q((i(),u("div",es,s[30]||(s[30]=[e("div",{text:"60","i-solar:user-speak-rounded-bold-duotone":""},null,-1)]))),[[N]])],64)}}});typeof oe=="function"&&oe(ts);export{ts as default}; diff --git a/assets/stage-DE9Z4XRh.js b/assets/stage-i_VpyNXN.js similarity index 84% rename from assets/stage-DE9Z4XRh.js rename to assets/stage-i_VpyNXN.js index 82698c46a1f998aba6b25ce087a036ee2982fee5..f11ac94dcc2b6759b625e332887ac44f35343afa 100644 --- a/assets/stage-DE9Z4XRh.js +++ b/assets/stage-i_VpyNXN.js @@ -1 +1 @@ -import{d as p,e as s,c,b as d,r as i,n as m,u as e,o as l}from"./index--eYU5aQm.js";const x=p({__name:"stage",setup(u){const{top:t,right:o,bottom:a,left:n}=s();return(f,_)=>{const r=i("RouterView");return l(),c("main",{text:"gray-700 dark:gray-200","h-full":"","font-cuteen":"",style:m({paddingTop:`${e(t)}px`,paddingRight:`${e(o)}px`,paddingBottom:`${e(a)}px`,paddingLeft:`${e(n)}px`})},[d(r)],4)}}});export{x as default}; +import{d as p,e as s,c,b as d,r as i,n as m,u as e,o as l}from"./index-D55VqdU4.js";const x=p({__name:"stage",setup(u){const{top:t,right:o,bottom:a,left:n}=s();return(f,_)=>{const r=i("RouterView");return l(),c("main",{text:"gray-700 dark:gray-200","h-full":"","font-cuteen":"",style:m({paddingTop:`${e(t)}px`,paddingRight:`${e(o)}px`,paddingBottom:`${e(a)}px`,paddingLeft:`${e(n)}px`})},[d(r)],4)}}});export{x as default}; diff --git a/assets/together-ai-NMFH4eMa.js b/assets/together-ai-iclTvzCk.js similarity index 62% rename from assets/together-ai-NMFH4eMa.js rename to assets/together-ai-iclTvzCk.js index cffd7ea8111f3354d68eded8ec8abe1a9fdf22e0..12289b8264264b2f5e35d7d73b7668ad194f2f07 100644 --- a/assets/together-ai-NMFH4eMa.js +++ b/assets/together-ai-iclTvzCk.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{d as h,q as y,bG as U,s as V,h as v,l as $,w as k,x,o as K,y as p,b as l,u as t}from"./index--eYU5aQm.js";import{u as z}from"./providers-YQf-rDZ1.js";import{_ as w,a as C}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dsoa87PD.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CCsf2oJB.js";import{_ as N,a as P}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BJL9_E_2.js";import{_ as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DVunqc-i.js";import"./index-Be1NqeGb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-CWkRm8IH.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BHnSNWo1.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-CriF7G5j.js";import"./Input.vue_vue_type_script_setup_true_lang-DaL4uFR_.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";const a="together-ai",L=h({__name:"together-ai",setup(S){const{t:d}=y(),_=U(),m=z(),{providers:o}=V(m),n=v(()=>m.getProviderMetadata(a)),i=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,r;m.initializeProvider(a),i.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((r=o.value[a])==null?void 0:r.baseUrl)||""}),k([i,s],()=>{o.value[a]={...o.value[a],apiKey:i.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,r)=>{var c,f;return K(),x(t(R),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(_).back()},{default:p(()=>[l(t(N),null,{default:p(()=>[l(t(P),{title:t(d)("settings.pages.providers.common.section.basic.title"),description:t(d)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:p(()=>{var u;return[l(t(M),{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=b=>i.value=b),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"togetherapi-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(w),{title:t(d)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(C),{modelValue:s.value,"onUpdate:modelValue":r[1]||(r[1]=u=>s.value=u),placeholder:"https://api.together.xyz/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});export{L as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{d as h,q as y,bG as U,s as V,h as v,l as $,w as k,x,o as K,y as p,b as l,u as t}from"./index-D55VqdU4.js";import{u as z}from"./providers-DAp1566d.js";import{_ as w,a as C}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-BtshDojk.js";import{_ as M}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BMPV9bKe.js";import{_ as N,a as P}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DLyRry-6.js";import{_ as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-Cc3LXYUd.js";import"./index-Be1NqeGb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BDoHyduV.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BbB31kj-.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DQP2RhYC.js";import"./Input.vue_vue_type_script_setup_true_lang-CeU0PE9S.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";const a="together-ai",L=h({__name:"together-ai",setup(S){const{t:d}=y(),_=U(),m=z(),{providers:o}=V(m),n=v(()=>m.getProviderMetadata(a)),i=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,r;m.initializeProvider(a),i.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((r=o.value[a])==null?void 0:r.baseUrl)||""}),k([i,s],()=>{o.value[a]={...o.value[a],apiKey:i.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,r)=>{var c,f;return K(),x(t(R),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(_).back()},{default:p(()=>[l(t(N),null,{default:p(()=>[l(t(P),{title:t(d)("settings.pages.providers.common.section.basic.title"),description:t(d)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:p(()=>{var u;return[l(t(M),{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=b=>i.value=b),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"togetherapi-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(w),{title:t(d)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(C),{modelValue:s.value,"onUpdate:modelValue":r[1]||(r[1]=u=>s.value=u),placeholder:"https://api.together.xyz/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});export{L as default}; diff --git a/assets/useIconAnimation-Rig5jSD8.js b/assets/useIconAnimation-Dw2zcJkj.js similarity index 56% rename from assets/useIconAnimation-Rig5jSD8.js rename to assets/useIconAnimation-Dw2zcJkj.js index 55adc299cf90f73e66589bdf56262476ea2dcb6d..9c7936483d42ad63e731451501c03da9077d0b0c 100644 --- a/assets/useIconAnimation-Rig5jSD8.js +++ b/assets/useIconAnimation-Dw2zcJkj.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{g as t,v as u,h as r,l as c,H as m}from"./index--eYU5aQm.js";function p(s){const n=t(!1),o=t(!1),a=t(s),e=u(),i=r(()=>o.value&&!e.disableTransitions&&e.usePageSpecificTransitions);return c(()=>{o.value=!0,requestAnimationFrame(()=>{n.value=!0})}),m(()=>{n.value=!1,o.value=!1}),{iconAnimationStarted:n,showIconAnimation:i,animationIcon:a}}export{p as u}; +import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{g as t,v as u,h as r,l as c,H as m}from"./index-D55VqdU4.js";function p(s){const n=t(!1),o=t(!1),a=t(s),e=u(),i=r(()=>o.value&&!e.disableTransitions&&e.usePageSpecificTransitions);return c(()=>{o.value=!0,requestAnimationFrame(()=>{n.value=!0})}),m(()=>{n.value=!1,o.value=!1}),{iconAnimationStarted:n,showIconAnimation:i,animationIcon:a}}export{p as u}; diff --git a/assets/vibrant-D9yH5UkB.js b/assets/vibrant-DiySZm3a.js similarity index 84% rename from assets/vibrant-D9yH5UkB.js rename to assets/vibrant-DiySZm3a.js index 0b8783ed8dd43ed523c6718d71e6b3e24b0dad4e..96d706ffe3d62e62d9f560ae6b1accc3c27e2787 100644 --- a/assets/vibrant-D9yH5UkB.js +++ b/assets/vibrant-DiySZm3a.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{_ as g}from"./InputFile.vue_vue_type_script_setup_true_lang-DSuLZiGY.js";import{d as p,g as n,w as v,c as r,o,a as s,bx as _,by as b,D as h,b as k,u as w,C as x,n as y}from"./index--eYU5aQm.js";import{V}from"./browser-CkchkNbv.js";const C={flex:"","flex-col":"","gap-4":""},j={border:"2 solid neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-900","w-full":"",flex:"","gap-2":"","rounded-lg":"","p-4":""},L={border:"2 solid neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-900","w-full":"",flex:"","gap-2":"","rounded-lg":"","p-4":""},N={flex:"","gap-2":""},O={"h-60":"",border:"2 solid neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-900","rounded-lg":""},B=["src"],I=p({__name:"vibrant",setup(D){const u=n([]),t=n(),d=n([]),i=n([]);function c(l){const a=new Image;a.src=URL.createObjectURL(l),a.onload=f,t.value=a}async function f(){if(!t.value)return;const a=await new V(t.value).getPalette();d.value=Object.values(a).map(e=>e==null?void 0:e.hex).filter(e=>typeof e=="string"),i.value=Object.values(a).map(e=>JSON.stringify(e))}return v(u,l=>{c(l[0])},{deep:!0}),(l,a)=>(o(),r("div",C,[s("div",j,[(o(!0),r(_,null,b(d.value,(e,m)=>(o(),r("div",{key:m,style:y({backgroundColor:e}),"size-20":"","rounded-full":""},null,4))),128))]),s("div",L,h(i.value),1),s("div",N,[k(w(g),{modelValue:u.value,"onUpdate:modelValue":a[0]||(a[0]=e=>u.value=e),"h-60":"","w-full":""},null,8,["modelValue"])]),s("div",O,[t.value?(o(),r("img",{key:0,src:t.value.src,"h-full":"","w-full":"","object-contain":""},null,8,B)):x("",!0)])]))}});export{I as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{_ as g}from"./InputFile.vue_vue_type_script_setup_true_lang-CR9cbe_p.js";import{d as p,g as n,w as v,c as r,o,a as s,bx as _,by as b,D as h,b as k,u as w,C as x,n as y}from"./index-D55VqdU4.js";import{V}from"./browser-CkchkNbv.js";const C={flex:"","flex-col":"","gap-4":""},j={border:"2 solid neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-900","w-full":"",flex:"","gap-2":"","rounded-lg":"","p-4":""},L={border:"2 solid neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-900","w-full":"",flex:"","gap-2":"","rounded-lg":"","p-4":""},N={flex:"","gap-2":""},O={"h-60":"",border:"2 solid neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-900","rounded-lg":""},B=["src"],I=p({__name:"vibrant",setup(D){const u=n([]),t=n(),d=n([]),i=n([]);function c(l){const a=new Image;a.src=URL.createObjectURL(l),a.onload=f,t.value=a}async function f(){if(!t.value)return;const a=await new V(t.value).getPalette();d.value=Object.values(a).map(e=>e==null?void 0:e.hex).filter(e=>typeof e=="string"),i.value=Object.values(a).map(e=>JSON.stringify(e))}return v(u,l=>{c(l[0])},{deep:!0}),(l,a)=>(o(),r("div",C,[s("div",j,[(o(!0),r(_,null,b(d.value,(e,m)=>(o(),r("div",{key:m,style:y({backgroundColor:e}),"size-20":"","rounded-full":""},null,4))),128))]),s("div",L,h(i.value),1),s("div",N,[k(w(g),{modelValue:u.value,"onUpdate:modelValue":a[0]||(a[0]=e=>u.value=e),"h-60":"","w-full":""},null,8,["modelValue"])]),s("div",O,[t.value?(o(),r("img",{key:0,src:t.value.src,"h-full":"","w-full":"","object-contain":""},null,8,B)):x("",!0)])]))}});export{I as default}; diff --git a/assets/volcengine-DGKTIK6C.js b/assets/volcengine-BIunt7Yu.js similarity index 70% rename from assets/volcengine-DGKTIK6C.js rename to assets/volcengine-BIunt7Yu.js index 2668d7f023ead0fe32640950eb1a96941d42cc10..92042bfdb833c1d50a7f526d0f832f025e35b6ba 100644 --- a/assets/volcengine-DGKTIK6C.js +++ b/assets/volcengine-BIunt7Yu.js @@ -1 +1 @@ -import{_ as V}from"./FieldInput.vue_vue_type_script_setup_true_lang-CriF7G5j.js";import{_ as y}from"./FieldRange.vue_vue_type_script_setup_true_lang-DcZafZ9u.js";import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{d as w,g as M,s as I,q as S,h as v,l as x,w as g,x as F,o as k,y as c,b as f,u as r,a as $}from"./index--eYU5aQm.js";import{u as B}from"./providers-YQf-rDZ1.js";import{u as R}from"./speech-BOhrg3WS.js";import{_ as q,a as E}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-CYRUbdP0.js";import"./Input.vue_vue_type_script_setup_true_lang-DaL4uFR_.js";import"./index-Be1NqeGb.js";import"./TestDummyMarker.vue_vue_type_script_setup_true_lang-Pam45T1i.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dsoa87PD.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-CWkRm8IH.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BHnSNWo1.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CCsf2oJB.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BJL9_E_2.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";const K={flex:"~ col gap-4"},o="volcengine",_="v1",ee=w({__name:"volcengine",setup(L){const s=M(1),d=R(),a=B(),{providers:t}=I(a),{t:n}=S(),p=v({get:()=>{var e,i;return((i=(e=t.value[o])==null?void 0:e.app)==null?void 0:i.appId)||""},set:e=>{t.value[o]||(t.value[o]={}),t.value[o].app={appId:e}}}),b=v(()=>{var e;return!!((e=t.value[o])!=null&&e.apiKey)}),C=v(()=>d.availableVoices[o]||[]);async function h(e,i,l){const u=a.getProviderInstance(o);if(!u)throw new Error("Failed to initialize speech provider");const m=a.getProviderConfig(o),P=m.model||_;return await d.speech(u,P,e,i,{...m})}return x(async()=>{const e=a.getProviderConfig(o);await a.getProviderMetadata(o).validators.validateProviderConfig(e)?await d.loadVoicesForProvider(o):console.error("Failed to validate provider config",e)}),g(s,async()=>{const e=a.getProviderConfig(o);e.audio||(e.audio={}),e.audio.speedRatio=s.value}),g([t,p],async()=>{const e=a.getProviderConfig(o);await a.getProviderMetadata(o).validators.validateProviderConfig(e)?await d.loadVoicesForProvider(o):console.error("Failed to validate provider config",e)},{immediate:!0}),(e,i)=>(k(),F(r(E),{"provider-id":o,"default-model":_},{"basic-settings":c(()=>[$("div",K,[f(r(V),{modelValue:p.value,"onUpdate:modelValue":i[0]||(i[0]=l=>p.value=l),label:r(n)("settings.pages.providers.provider.volcengine.fields.field.appId.label"),description:r(n)("settings.pages.providers.provider.volcengine.fields.field.appId.description"),required:""},null,8,["modelValue","label","description"])])]),"voice-settings":c(()=>[f(r(y),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=l=>s.value=l),label:r(n)("settings.pages.providers.provider.common.fields.field.speed.label"),description:r(n)("settings.pages.providers.provider.common.fields.field.speed.description"),min:.5,max:2,step:.01},null,8,["modelValue","label","description"])]),playground:c(()=>[f(r(q),{"available-voices":C.value,"generate-speech":h,"api-key-configured":b.value,"default-text":"Hello! This is a test of the ElevenLabs voice synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});export{ee as default}; +import{_ as V}from"./FieldInput.vue_vue_type_script_setup_true_lang-DQP2RhYC.js";import{_ as y}from"./FieldRange.vue_vue_type_script_setup_true_lang-CtbCdbG8.js";import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{d as w,g as M,s as I,q as S,h as v,l as x,w as g,x as F,o as k,y as c,b as f,u as r,a as $}from"./index-D55VqdU4.js";import{u as B}from"./providers-DAp1566d.js";import{u as R}from"./speech-BtNOtIn9.js";import{_ as q,a as E}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-CPbYTBJt.js";import"./Input.vue_vue_type_script_setup_true_lang-CeU0PE9S.js";import"./index-Be1NqeGb.js";import"./TestDummyMarker.vue_vue_type_script_setup_true_lang-DRQbkM6R.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-BtshDojk.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BDoHyduV.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BbB31kj-.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BMPV9bKe.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DLyRry-6.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";const K={flex:"~ col gap-4"},o="volcengine",_="v1",ee=w({__name:"volcengine",setup(L){const s=M(1),d=R(),a=B(),{providers:t}=I(a),{t:n}=S(),p=v({get:()=>{var e,i;return((i=(e=t.value[o])==null?void 0:e.app)==null?void 0:i.appId)||""},set:e=>{t.value[o]||(t.value[o]={}),t.value[o].app={appId:e}}}),b=v(()=>{var e;return!!((e=t.value[o])!=null&&e.apiKey)}),C=v(()=>d.availableVoices[o]||[]);async function h(e,i,l){const u=a.getProviderInstance(o);if(!u)throw new Error("Failed to initialize speech provider");const m=a.getProviderConfig(o),P=m.model||_;return await d.speech(u,P,e,i,{...m})}return x(async()=>{const e=a.getProviderConfig(o);await a.getProviderMetadata(o).validators.validateProviderConfig(e)?await d.loadVoicesForProvider(o):console.error("Failed to validate provider config",e)}),g(s,async()=>{const e=a.getProviderConfig(o);e.audio||(e.audio={}),e.audio.speedRatio=s.value}),g([t,p],async()=>{const e=a.getProviderConfig(o);await a.getProviderMetadata(o).validators.validateProviderConfig(e)?await d.loadVoicesForProvider(o):console.error("Failed to validate provider config",e)},{immediate:!0}),(e,i)=>(k(),F(r(E),{"provider-id":o,"default-model":_},{"basic-settings":c(()=>[$("div",K,[f(r(V),{modelValue:p.value,"onUpdate:modelValue":i[0]||(i[0]=l=>p.value=l),label:r(n)("settings.pages.providers.provider.volcengine.fields.field.appId.label"),description:r(n)("settings.pages.providers.provider.volcengine.fields.field.appId.description"),required:""},null,8,["modelValue","label","description"])])]),"voice-settings":c(()=>[f(r(y),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=l=>s.value=l),label:r(n)("settings.pages.providers.provider.common.fields.field.speed.label"),description:r(n)("settings.pages.providers.provider.common.fields.field.speed.description"),min:.5,max:2,step:.01},null,8,["modelValue","label","description"])]),playground:c(()=>[f(r(q),{"available-voices":C.value,"generate-speech":h,"api-key-configured":b.value,"default-text":"Hello! This is a test of the ElevenLabs voice synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});export{ee as default}; diff --git a/assets/xai-C121Ni52.js b/assets/xai-Di0tvp3d.js similarity index 68% rename from assets/xai-C121Ni52.js rename to assets/xai-Di0tvp3d.js index afd2fad21869092a9e33e27f1758b6d004189482..74595852e11e3e4c46acb25795a8d7e7712637f9 100644 --- a/assets/xai-C121Ni52.js +++ b/assets/xai-Di0tvp3d.js @@ -1 +1 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b414abf5_lang-DUJpMShQ.js";import{d as x,q as U,bG as V,s as y,h as v,l as $,w as k,x as K,o as h,y as p,b as l,u as t}from"./index--eYU5aQm.js";import{u as w}from"./providers-YQf-rDZ1.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Dsoa87PD.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CCsf2oJB.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BJL9_E_2.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DVunqc-i.js";import"./index-Be1NqeGb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-CWkRm8IH.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BHnSNWo1.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-CriF7G5j.js";import"./Input.vue_vue_type_script_setup_true_lang-DaL4uFR_.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-D324FALx.js";const a="xai",L=x({__name:"xai",setup(B){const{t:d}=U(),_=V(),m=w(),{providers:o}=y(m),n=v(()=>m.getProviderMetadata(a)),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,i;m.initializeProvider(a),s.value=((e=o.value[a])==null?void 0:e.apiKey)||"",r.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),k([s,r],()=>{o.value[a]={...o.value[a],apiKey:s.value,baseUrl:r.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return h(),K(t(S),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(_).back()},{default:p(()=>[l(t(P),null,{default:p(()=>[l(t(R),{title:t(d)("settings.pages.providers.common.section.basic.title"),description:t(d)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:p(()=>{var u;return[l(t(N),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=g=>s.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"xai-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(d)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(M),{modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=u=>r.value=u),placeholder:"https://api.x.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{L as default}; +import"./Stage.vue_vue_type_style_index_0_scoped_29db1c01_lang-D4WfHRRp.js";import{d as x,q as U,bG as V,s as y,h as v,l as $,w as k,x as K,o as h,y as p,b as l,u as t}from"./index-D55VqdU4.js";import{u as w}from"./providers-DAp1566d.js";import{_ as z,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-BtshDojk.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-BMPV9bKe.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-DLyRry-6.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-Cc3LXYUd.js";import"./index-Be1NqeGb.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BDoHyduV.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BbB31kj-.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DQP2RhYC.js";import"./Input.vue_vue_type_script_setup_true_lang-CeU0PE9S.js";import"./PageHeader.vue_vue_type_script_setup_true_lang-V4LxpvAC.js";const a="xai",L=x({__name:"xai",setup(B){const{t:d}=U(),_=V(),m=w(),{providers:o}=y(m),n=v(()=>m.getProviderMetadata(a)),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,i;m.initializeProvider(a),s.value=((e=o.value[a])==null?void 0:e.apiKey)||"",r.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),k([s,r],()=>{o.value[a]={...o.value[a],apiKey:s.value,baseUrl:r.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return h(),K(t(S),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(_).back()},{default:p(()=>[l(t(P),null,{default:p(()=>[l(t(R),{title:t(d)("settings.pages.providers.common.section.basic.title"),description:t(d)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:p(()=>{var u;return[l(t(N),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=g=>s.value=g),"provider-name":(u=n.value)==null?void 0:u.localizedName,placeholder:"xai-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(z),{title:t(d)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(M),{modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=u=>r.value=u),placeholder:"https://api.x.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});export{L as default}; diff --git a/index.html b/index.html index d0def358e4ecb7677ae1a3ce437b2c362e38999a..d99ec9872118b2945f4ed2ab91d39c33475408cf 100644 --- a/index.html +++ b/index.html @@ -23,7 +23,7 @@ src="/remote-assets/page-external-data/js/script.js" > - +